From f3771c5a48d2429bb7bd0eb6655286ff940fe89b Mon Sep 17 00:00:00 2001 From: jinghui Date: Tue, 17 Nov 2026 00:20:20 +0800 Subject: [PATCH] =?UTF-8?q?v3.6.16:=20=E5=95=86=E5=93=81=E5=88=86=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=98=BE=E7=A4=BA=EF=BC=88=E5=9C=A8=E5=94=AE/?= =?UTF-8?q?=E5=B7=B2=E4=B8=8B=E6=9E=B6/=E8=8D=89=E7=A8=BF=E4=B8=89?= =?UTF-8?q?=E5=A5=97=E4=BA=92=E4=B8=8D=E6=B7=B7=E6=8E=92=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: 商品与发货页显示34件, 实际在售只有14件——本地库把20件已下架商品 和在售混在同一个列表里, 页头/页签/下拉全部用 items.length 口径。 - 新增状态分段页签: 在售 14 / 已下架 20 / 草稿 (品牌黄高亮, 带计数) - 计数口径统一为 onSaleCount: 页头badge、商品页签、账号下拉全部改为在售数 - 空状态按状态区分文案(没有已下架商品/没有草稿/拉取中/拉取失败) - 草稿本地库没有概念, 切到草稿页签时才按账号现拉闲鱼(带scope去重守卫) - 后端新增 /items/xyh-list: 按闲鱼分组(在售/已下架/已售出/草稿)拉取, XianyuAutoAsync.get_item_list_info 增加 group_name 参数按名选分组, 账号没有该分组时返回明确提示而非报错 --- XianyuAutoAsync.py | 40 ++- app/reply_server.py | 2 + app/routers/xyh_items.py | 293 ++++++++++++++++++ frontend/components/ItemList.tsx | 103 ++++-- ...IReply-C49hHlXg.js => AIReply-Dsfaod73.js} | 2 +- .../{About-DCjjMMTu.js => About-DH_fUK9S.js} | 2 +- ...st-CC8hRCM2.js => AccountList-jdp7_cFb.js} | 2 +- ...EwndHV.js => BuyerInteraction-0rmlMue9.js} | 2 +- ...dList-DaeMtjqS.js => CardList-BeNoktSc.js} | 2 +- ...oard-R20Ph_el.js => Dashboard-r6bLPRiz.js} | 2 +- .../{Help-LRtmM6iN.js => Help-cncF4wHf.js} | 2 +- ...otList-BwqIdE0Z.js => HotList-DMnVJNpG.js} | 2 +- static/assets/ItemList-DpqEi6Ob.js | 16 - static/assets/ItemList-Du75o4x-.js | 16 + ...words-DYO7Z25o.js => Keywords-BPlwSBj7.js} | 2 +- ...e9TqW.js => MessageManagement-CJJfjP2Z.js} | 2 +- ...mX.js => NotificationsAndLogs-DX1qmLDY.js} | 2 +- ...List-DnNov42V.js => OrderList-CMlmoGwo.js} | 2 +- ...hops-CypJHQVt.js => PeerShops-Iz71xL1V.js} | 2 +- ...tch-Db4Gwt9m.js => PriceWatch-B4ja8BGi.js} | 2 +- ...Zohdg.js => ProductAutomation-BTRBUe6v.js} | 2 +- ...{Resell-C3EooCYv.js => Resell-eqQKBhXl.js} | 2 +- ...tings-BKqYYBIp.js => Settings-CgkuCQg8.js} | 2 +- ...WEnM8-3J.js => UserManagement-93cH0Rs5.js} | 2 +- ...ivity-CRI26G7w.js => activity-CV-Hy1l6.js} | 2 +- .../{check-6Gro50Mh.js => check--qTdUCr3.js} | 2 +- ...-DwOZeQi3.js => chevron-right-zTm23uAy.js} | 2 +- .../{eye-BNO0yecz.js => eye-BXgO1egk.js} | 2 +- ...ye-off-DA35-r8G.js => eye-off-DqZjZWJp.js} | 2 +- ...wer-2-DPAmZVRG.js => flower-2-CSgAnLCK.js} | 2 +- .../{image-BCD-eej2.js => image-DkNS6I4I.js} | 2 +- static/assets/index-AteK7Kef.css | 1 + .../{index-IChzZLcq.js => index-C6Y7HdB3.js} | 4 +- static/assets/index-D3PEF3ay.css | 1 - .../{key-BRO3zsxh.js => key-CnYS625y.js} | 2 +- ...{link-2-CYVpjq_H.js => link-2-CUR4V6rB.js} | 2 +- ...xWp.js => message-square-text-DbxdYCPP.js} | 2 +- ...ackage-3qqwOYvH.js => package-DjIVaNpE.js} | 2 +- ...-FQzJ-066.js => package-check-C8PHQCAA.js} | 2 +- ...-line-27OudxQx.js => pen-line-B2U8YMna.js} | 2 +- .../{play-52JRVRYm.js => play-B67lJrJT.js} | 2 +- .../{plus-hTzuza9d.js => plus-BZHhM3Ok.js} | 2 +- .../{power-ZOn3B5wN.js => power-WuQyd1QF.js} | 2 +- ...-off-D8Ea3WwY.js => power-off-CcqbyexD.js} | 2 +- .../{save-m64KWfbE.js => save-C5DQBwo1.js} | 2 +- ...{search-D1CHR5V5.js => search-DbZW8Se5.js} | 2 +- .../{send-Db002WMI.js => send-CTCS9sD8.js} | 2 +- ...s-2-B-NwJM90.js => settings-2-DYoajNQY.js} | 2 +- ...t-ob02IPrt.js => shield-alert-BSaySGHY.js} | 2 +- ...rkles-B5X13VUJ.js => sparkles-CczcRRJP.js} | 2 +- ...pen-BOlWgFhh.js => square-pen-ptW8MQaM.js} | 2 +- ...rash-2-CnOVC8WZ.js => trash-2-BG9PyYJR.js} | 2 +- ...up-BDgJo2q2.js => trending-up-BR0vQ8dC.js} | 2 +- .../{truck-eLsCuQDz.js => truck-Cz_KAtqT.js} | 2 +- .../assets/{ui-DHCIdv_V.js => ui-Dh615-z8.js} | 2 +- .../{zap-CQAFaWUI.js => zap-BAb90aFH.js} | 2 +- static/index.html | 4 +- 57 files changed, 477 insertions(+), 97 deletions(-) create mode 100644 app/routers/xyh_items.py rename static/assets/{AIReply-C49hHlXg.js => AIReply-Dsfaod73.js} (97%) rename static/assets/{About-DCjjMMTu.js => About-DH_fUK9S.js} (98%) rename static/assets/{AccountList-CC8hRCM2.js => AccountList-jdp7_cFb.js} (99%) rename static/assets/{BuyerInteraction-BJEwndHV.js => BuyerInteraction-0rmlMue9.js} (96%) rename static/assets/{CardList-DaeMtjqS.js => CardList-BeNoktSc.js} (98%) rename static/assets/{Dashboard-R20Ph_el.js => Dashboard-r6bLPRiz.js} (99%) rename static/assets/{Help-LRtmM6iN.js => Help-cncF4wHf.js} (99%) rename static/assets/{HotList-BwqIdE0Z.js => HotList-DMnVJNpG.js} (98%) delete mode 100644 static/assets/ItemList-DpqEi6Ob.js create mode 100644 static/assets/ItemList-Du75o4x-.js rename static/assets/{Keywords-DYO7Z25o.js => Keywords-BPlwSBj7.js} (97%) rename static/assets/{MessageManagement-BX9e9TqW.js => MessageManagement-CJJfjP2Z.js} (98%) rename static/assets/{NotificationsAndLogs-DvXsPImX.js => NotificationsAndLogs-DX1qmLDY.js} (97%) rename static/assets/{OrderList-DnNov42V.js => OrderList-CMlmoGwo.js} (98%) rename static/assets/{PeerShops-CypJHQVt.js => PeerShops-Iz71xL1V.js} (98%) rename static/assets/{PriceWatch-Db4Gwt9m.js => PriceWatch-B4ja8BGi.js} (98%) rename static/assets/{ProductAutomation-ByBZohdg.js => ProductAutomation-BTRBUe6v.js} (98%) rename static/assets/{Resell-C3EooCYv.js => Resell-eqQKBhXl.js} (98%) rename static/assets/{Settings-BKqYYBIp.js => Settings-CgkuCQg8.js} (98%) rename static/assets/{UserManagement-WEnM8-3J.js => UserManagement-93cH0Rs5.js} (98%) rename static/assets/{activity-CRI26G7w.js => activity-CV-Hy1l6.js} (89%) rename static/assets/{check-6Gro50Mh.js => check--qTdUCr3.js} (86%) rename static/assets/{chevron-right-DwOZeQi3.js => chevron-right-zTm23uAy.js} (92%) rename static/assets/{eye-BNO0yecz.js => eye-BXgO1egk.js} (90%) rename static/assets/{eye-off-DA35-r8G.js => eye-off-DqZjZWJp.js} (92%) rename static/assets/{flower-2-DPAmZVRG.js => flower-2-CSgAnLCK.js} (93%) rename static/assets/{image-BCD-eej2.js => image-DkNS6I4I.js} (90%) create mode 100644 static/assets/index-AteK7Kef.css rename static/assets/{index-IChzZLcq.js => index-C6Y7HdB3.js} (99%) delete mode 100644 static/assets/index-D3PEF3ay.css rename static/assets/{key-BRO3zsxh.js => key-CnYS625y.js} (90%) rename static/assets/{link-2-CYVpjq_H.js => link-2-CUR4V6rB.js} (89%) rename static/assets/{message-square-text-C6Er6xWp.js => message-square-text-DbxdYCPP.js} (91%) rename static/assets/{package-3qqwOYvH.js => package-DjIVaNpE.js} (91%) rename static/assets/{package-check-FQzJ-066.js => package-check-C8PHQCAA.js} (92%) rename static/assets/{pen-line-27OudxQx.js => pen-line-B2U8YMna.js} (90%) rename static/assets/{play-52JRVRYm.js => play-B67lJrJT.js} (87%) rename static/assets/{plus-hTzuza9d.js => plus-BZHhM3Ok.js} (86%) rename static/assets/{power-ZOn3B5wN.js => power-WuQyd1QF.js} (93%) rename static/assets/{power-off-D8Ea3WwY.js => power-off-CcqbyexD.js} (90%) rename static/assets/{save-m64KWfbE.js => save-C5DQBwo1.js} (91%) rename static/assets/{search-D1CHR5V5.js => search-DbZW8Se5.js} (88%) rename static/assets/{send-Db002WMI.js => send-CTCS9sD8.js} (90%) rename static/assets/{settings-2-B-NwJM90.js => settings-2-DYoajNQY.js} (90%) rename static/assets/{shield-alert-ob02IPrt.js => shield-alert-BSaySGHY.js} (91%) rename static/assets/{sparkles-B5X13VUJ.js => sparkles-CczcRRJP.js} (93%) rename static/assets/{square-pen-BOlWgFhh.js => square-pen-ptW8MQaM.js} (91%) rename static/assets/{trash-2-CnOVC8WZ.js => trash-2-BG9PyYJR.js} (91%) rename static/assets/{trending-up-BDgJo2q2.js => trending-up-BR0vQ8dC.js} (87%) rename static/assets/{truck-eLsCuQDz.js => truck-Cz_KAtqT.js} (93%) rename static/assets/{ui-DHCIdv_V.js => ui-Dh615-z8.js} (99%) rename static/assets/{zap-CQAFaWUI.js => zap-BAb90aFH.js} (89%) diff --git a/XianyuAutoAsync.py b/XianyuAutoAsync.py index b4c364d..0f85f8f 100644 --- a/XianyuAutoAsync.py +++ b/XianyuAutoAsync.py @@ -11213,7 +11213,7 @@ class XianyuLive: items.append(item) return items - async def get_item_list_info(self, page_number=1, page_size=20, retry_count=0): + async def get_item_list_info(self, page_number=1, page_size=20, retry_count=0, group_name=None): """动态发现当前账号的在售分组并获取商品列表。""" if retry_count >= 4: return {'error': '获取商品信息失败,重试次数过多'} @@ -11315,7 +11315,8 @@ class XianyuLive: return res_json try: - item_group = getattr(self, '_item_list_group', None) + # 指定 group_name 时强制走分组发现,不能复用上次选中的“在售”缓存 + item_group = None if group_name else getattr(self, '_item_list_group', None) if page_number == 1 or not item_group: discovery_response = await request_item_api({ 'needGroupInfo': True, @@ -11328,7 +11329,7 @@ class XianyuLive: error_msg = discovery_ret[0] if discovery_ret else '未知错误' if 'TOKEN' in str(error_msg).upper(): await asyncio.sleep(0.5) - return await self.get_item_list_info(page_number, page_size, retry_count + 1) + return await self.get_item_list_info(page_number, page_size, retry_count + 1, group_name=group_name) return {'error': f"商品分组发现失败: {error_msg}"} # 用 `or []` 兜住显式 None:闲鱼对无分组账号有时省略这个键 @@ -11348,8 +11349,28 @@ class XianyuLive: f"【{self.cookie_id}】商品分组发现: account={self.myid}, " f"groups={group_summary}" ) - item_group = self._select_item_group(groups) - if not item_group: + if group_name: + item_group = next( + ( + group for group in groups + if isinstance(group, dict) and str(group.get('groupName')) == group_name + ), + None, + ) + if not item_group: + available = [ + str(group.get('groupName')) for group in groups + if isinstance(group, dict) and group.get('groupName') + ] + return { + 'error': ( + f'闲鱼账号没有名为「{group_name}」的商品分组' + f'(现有分组:{"、".join(available) or "无"})' + ) + } + else: + item_group = self._select_item_group(groups) + if not item_group and not group_name: # 没匹配到“在售”不代表拿不到商品:闲鱼可能改了分组文案, # 账号也可能只有自定义分组。这里退回“按商品数最多的分组”, # 真的一件商品都没有才如实返回空列表,而不是报成接口异常。 @@ -11424,7 +11445,8 @@ class XianyuLive: confirmed=False, response_fields=sorted(discovery_data.keys()), ) - self._item_list_group = item_group + if group_name is None: + self._item_list_group = item_group group_id = item_group.get('groupId') group_name = item_group.get('groupName', '在售') @@ -11442,7 +11464,7 @@ class XianyuLive: error_msg = response_ret[0] if response_ret else '未知错误' if 'TOKEN' in str(error_msg).upper(): await asyncio.sleep(0.5) - return await self.get_item_list_info(page_number, page_size, retry_count + 1) + return await self.get_item_list_info(page_number, page_size, retry_count + 1, group_name=group_name) return {'error': f"获取商品信息失败: {error_msg}"} items_data = res_json.get('data', {}) @@ -11510,11 +11532,11 @@ class XianyuLive: f"(第{retry_count + 1}次): {self._safe_str(e)}" ) await asyncio.sleep(backoff) - return await self.get_item_list_info(page_number, page_size, retry_count + 1) + return await self.get_item_list_info(page_number, page_size, retry_count + 1, group_name=group_name) except Exception as e: logger.error(f"商品信息API请求异常: {self._safe_str(e)}") await asyncio.sleep(0.5) - return await self.get_item_list_info(page_number, page_size, retry_count + 1) + return await self.get_item_list_info(page_number, page_size, retry_count + 1, group_name=group_name) async def get_all_items(self, page_size=20, max_pages=None): """获取所有在售商品信息(自动分页)。""" diff --git a/app/reply_server.py b/app/reply_server.py index ef9d472..54655bd 100644 --- a/app/reply_server.py +++ b/app/reply_server.py @@ -43,6 +43,7 @@ from app.routers.logistics_quote import create_logistics_quote_router from app.routers.logistics_agent import create_logistics_agent_router from app.routers.hotlist import create_hotlist_router from app.routers.peer_shops import create_peer_shops_router +from app.routers.xyh_items import create_xyh_items_router from utils.qr_login import qr_login_manager from utils.xianyu_utils import trans_cookies from utils.image_utils import image_manager @@ -397,6 +398,7 @@ logger.info("已注册物流 Agent 路由") app.include_router(create_hotlist_router(get_current_user, db_manager)) app.include_router(create_peer_shops_router(get_current_user, db_manager)) +app.include_router(create_xyh_items_router(get_current_user, db_manager)) logger.info("已注册实时热卖榜路由") from app.routers.pricewatch import create_pricewatch_router, start_scheduler as start_pricewatch_scheduler diff --git a/app/routers/xyh_items.py b/app/routers/xyh_items.py new file mode 100644 index 0000000..1eaf501 --- /dev/null +++ b/app/routers/xyh_items.py @@ -0,0 +1,293 @@ +"""闲鱼实时商品:按状态分组列表(在售/已下架/已售出/草稿)与商品编辑。 + +分组数据来自 mtop.idle.web.xyh.item.list 的 itemGroupList(综合/在售/已售出/ +自定义分组,账号有已下架商品时会出现「已下架」组);草稿组同理按名匹配, +闲鱼没开草稿分组时返回明确的空态提示而不是报错。 + +编辑走 mtop.idle.pc.idleitem.edit,报文结构与一键转卖发布 +(mtop.idle.pc.idleitem.publish)完全一致,额外带 itemId。 +""" +import logging +from typing import Any, Callable, Dict, List, Optional + +from fastapi import APIRouter, Depends, HTTPException +from pydantic import BaseModel + +from XianyuAutoAsync import XianyuLive +from utils.xianyu_seller_api import SellerApiError, XianyuSellerAPI +from app.routers.resell import ( + _build_publish_payload, + _category_name, + _detail_images, + _money, + _normalize_detail, +) + +logger = logging.getLogger(__name__) + +# 前端固定选项卡(必须与闲鱼分组名逐字一致,拉取时按名匹配) +XYH_STATUS_GROUPS = ("在售", "已下架", "已售出", "草稿") + + +class XyhDetailRequest(BaseModel): + cookie_id: str + item_id: str + + +class XyhEditRequest(BaseModel): + cookie_id: str + item_id: str + title: str + price: float + quantity: int = 1 + delivery: str = "包邮" + post_price: float = 0 + desc: str = "" + images: Optional[List[Dict[str, Any]]] = None + + +def create_xyh_items_router( + get_current_user: Callable[..., Dict[str, Any]], + db_manager: Any, +) -> APIRouter: + router = APIRouter() + + def require_account(cookie_id: str, current_user: Dict[str, Any]) -> Dict[str, Any]: + details = db_manager.get_cookie_details(cookie_id) + if not details or details.get("user_id") != current_user["user_id"]: + raise HTTPException(status_code=404, detail="账号不存在或无权限") + if not details.get("value"): + raise HTTPException(status_code=400, detail="账号 Cookie 为空,无法调用闲鱼接口") + return details + + async def call_buyer( + cookie_id: str, + cookies_str: str, + api: str, + payload: Dict[str, Any], + spm_cnt: str = "a21ybx.item.0.0", + version: str = "1.0", + ) -> Dict[str, Any]: + client = XianyuSellerAPI(cookie_id, cookies_str) + try: + return await client._call_buyer(api, payload, spm_cnt=spm_cnt, version=version) + except SellerApiError as exc: + raise HTTPException(status_code=502, detail=str(exc)) from exc + finally: + await client.close() + + # ------------------------------------------------------------------ + # 分组商品列表:在售 / 已下架 / 已售出 / 草稿 + # ------------------------------------------------------------------ + @router.get("/items/xyh-list") + async def xyh_list( + cookie_id: str, + group_name: str = "在售", + page: int = 1, + current_user: Dict[str, Any] = Depends(get_current_user), + ): + if group_name not in XYH_STATUS_GROUPS: + raise HTTPException(status_code=400, detail=f"不支持的商品状态:{group_name}") + details = require_account(cookie_id, current_user) + instance = XianyuLive( + cookies_str=details["value"], + cookie_id=cookie_id, + user_id=current_user["user_id"], + ) + try: + result = await instance.get_item_list_info(max(1, page), 20, group_name=group_name) + finally: + await instance.close_session() + + if result.get("error"): + # 分组不存在(如账号没有草稿分组)→ 200 空列表 + 提示,让前端显示空态 + error_text = str(result["error"]) + if "没有名为" in error_text: + return {"success": True, "group_name": group_name, "page": page, + "total": 0, "items": [], "notice": error_text} + raise HTTPException(status_code=502, detail=error_text) + + items: List[Dict[str, Any]] = [] + for it in result.get("items") or []: + if not isinstance(it, dict) or not it.get("id"): + continue + items.append({ + "item_id": str(it.get("id") or ""), + "item_title": it.get("title") or "未命名商品", + "item_price": it.get("price") or "", + "item_image": it.get("item_image") or "", + "cookie_id": cookie_id, + "xyh_status": group_name, + }) + return { + "success": True, + "group_name": result.get("group_name") or group_name, + "page": page, + "total": result.get("total_count") or len(items), + "items": items, + } + + # ------------------------------------------------------------------ + # 商品详情(编辑弹窗预填):字段与一键转卖预览一致 + 运费方式推断 + # ------------------------------------------------------------------ + def _infer_delivery(item_do: Dict[str, Any]) -> tuple[str, str]: + """从详情的 postFee 推断运费方式与一口价运费(元)。""" + post_fee = item_do.get("postFee") or {} + if not isinstance(post_fee, dict): + return "包邮", "" + if post_fee.get("canFreeShipping"): + return "包邮", "" + price_cent = post_fee.get("postPriceInCent") + if price_cent: + try: + return "一口价", str(round(int(price_cent) / 100, 2)) + except (TypeError, ValueError): + pass + if str(post_fee.get("templateId") or "") == "-100": + return "按距离计费", "" + return "无需邮寄", "" + + @router.post("/items/xyh-detail") + async def xyh_detail( + req: XyhDetailRequest, + current_user: Dict[str, Any] = Depends(get_current_user), + ): + details = require_account(req.cookie_id, current_user) + # 编辑页初始化数据(p_publish-index.js 用它预填),拿不到再回退商品详情 + data: Dict[str, Any] = {} + try: + edit_detail = await call_buyer( + req.cookie_id, + details["value"], + "mtop.idle.pc.idleitem.editDetail", + {"itemId": str(req.item_id)}, + spm_cnt="a21ybx.publish.0.0", + ) + data = edit_detail.get("data") or {} + except HTTPException: + data = {} + # editDetail 结构可能不含 itemDO.title,拿不到就回退商品详情 + item_do = data.get("itemDO") if isinstance(data.get("itemDO"), dict) else {} + if not item_do.get("title"): + result = await call_buyer( + req.cookie_id, + details["value"], + "mtop.taobao.idle.pc.detail", + {"itemId": str(req.item_id)}, + spm_cnt="a21ybx.detail.0.0", + ) + data = result.get("data") or {} + item = _normalize_detail(data) + delivery, post_price = _infer_delivery(data.get("itemDO") or {}) + item["delivery"] = delivery + item["post_price"] = post_price + if not item.get("title"): + raise HTTPException(status_code=502, detail="详情里没有标题,无法编辑该商品") + return {"success": True, "item": item} + + # ------------------------------------------------------------------ + # 提交编辑:与一键转卖同一套报文(_build_publish_payload)+ itemId + # ------------------------------------------------------------------ + @router.post("/items/xyh-edit") + async def xyh_edit( + req: XyhEditRequest, + current_user: Dict[str, Any] = Depends(get_current_user), + ): + details = require_account(req.cookie_id, current_user) + cookies_str = details["value"] + + if not req.title.strip(): + raise HTTPException(status_code=400, detail="标题不能为空") + try: + price_cent = _money(req.price) + except ValueError as exc: + raise HTTPException(status_code=400, detail=str(exc)) from exc + + # 1. 源详情:类目 / 标签 / 原价 / 未改动的图片兜底 + detail_result = await call_buyer( + req.cookie_id, cookies_str, + "mtop.taobao.idle.pc.detail", + {"itemId": str(req.item_id)}, + spm_cnt="a21ybx.detail.0.0", + ) + detail = detail_result.get("data") or {} + item_do = detail.get("itemDO") or {} + images = _detail_images(item_do) + if req.images: + custom: List[Dict[str, Any]] = [] + for raw in req.images[:9]: + if not isinstance(raw, dict): + continue + url = str(raw.get("url") or "").strip() + if not url.startswith(("http://", "https://")): + continue + try: + width = int(raw.get("width") or 1000) + height = int(raw.get("height") or 1000) + except (TypeError, ValueError): + width, height = 1000, 1000 + custom.append({"url": url, "width": width, "height": height}) + if custom: + images = custom + if not images: + raise HTTPException(status_code=400, detail="商品没有可用图片,无法保存") + + labels = item_do.get("itemLabelExtList") or [] + cat = dict(item_do.get("itemCatDTO") or {}) + cat_name = _category_name(labels) + if not cat.get("catId") or not cat_name: + raise HTTPException(status_code=400, detail="详情里没有类目信息,无法保存编辑") + + # 2. 发布地址(与转卖一致,取账号默认) + poi_result = await call_buyer( + req.cookie_id, cookies_str, + "mtop.taobao.idle.local.poi.get", + {"longitude": 116.4, "latitude": 39.9}, + spm_cnt="a21ybx.publish.0.0", + ) + poi_data = poi_result.get("data") or {} + addresses = poi_data.get("commonAddresses") or [] + selected = poi_data.get("selectedPoi") or (addresses[0] if addresses else None) + if not selected: + raise HTTPException(status_code=400, detail="账号未设置发布地址,请先在闲鱼 App 设置默认地址") + + # 3. 组装报文(与一键转卖发布同一结构)+ itemId + payload = _build_publish_payload( + title=req.title.strip(), + desc=(req.desc or "").strip() or (item_do.get("desc") or "").strip(), + price_cent=price_cent, + post_price_cent=_money(req.post_price) + if req.delivery == "一口价" and req.post_price > 0 else None, + delivery=req.delivery, + quantity=max(1, int(req.quantity or 1)), + images=images, + labels=labels, + cat=cat, + cat_name=cat_name, + location=selected, + original_price=item_do.get("originalPrice"), + ) + # PC 编辑页(p_publish-index.js):有 itemId 走 edit,且 + # bizcode/publishScene 必须是 pcMainPublish,沿用发布的 mainPublish 会 + # 被服务端以 FAIL_BIZ_JSON_ERROR 拒绝(pyxianyu docs 实证) + payload["itemId"] = str(req.item_id) + payload["bizcode"] = "pcMainPublish" + payload["publishScene"] = "pcMainPublish" + + result = await call_buyer( + req.cookie_id, cookies_str, + "mtop.idle.pc.idleitem.edit", + payload, + spm_cnt="a21ybx.publish.0.0", + ) + data = result.get("data") or {} + edited_id = str(data.get("itemId") or req.item_id) + return { + "success": True, + "item_id": edited_id, + "url": f"https://www.goofish.com/item?id={edited_id}", + "title": req.title.strip(), + "price": req.price, + } + + return router diff --git a/frontend/components/ItemList.tsx b/frontend/components/ItemList.tsx index 5195768..8de1b21 100644 --- a/frontend/components/ItemList.tsx +++ b/frontend/components/ItemList.tsx @@ -266,6 +266,12 @@ const ItemList: React.FC = () => { [accountScopedItems], ); + // 账号下拉里每个账号的在售数:口径与列表一致,下拉不再显示含下架的总数 + const onSaleCountOf = useCallback( + (accountId: string) => items.filter(item => item.cookie_id === accountId && !isOffShelf(item) && !isDraft(item)).length, + [items], + ); + // 闲鱼草稿:本地库无草稿概念,按账号实时从闲鱼拉取(xyh-list), account scope 变化时重拉。 const [draftState, setDraftState] = useState<{ scope: string; @@ -288,6 +294,8 @@ const ItemList: React.FC = () => { const scope = listAccountFilter || '__all__'; const accountIds = listAccountFilter ? [listAccountFilter] : accounts.map(a => a.id); if (!accountIds.length) return; + // 同一账号范围已经拉过就不重复打闲鱼接口(轮询/重渲染都会走到这里) + if (draftState?.scope === scope) return; setDraftLoading(true); try { const results = await Promise.all( @@ -331,6 +339,12 @@ const ItemList: React.FC = () => { } }, [listAccountFilter, accounts]); + // 切到草稿页签或换账号范围时才去闲鱼拉草稿(本地库没有草稿概念) + useEffect(() => { + if (statusFilter !== 'draft') return; + void fetchDrafts(); + }, [statusFilter, fetchDrafts]); + const visibleItems = useMemo(() => { if (statusFilter === 'draft') return draftScopedItems; const base = accountScopedItems; @@ -750,14 +764,20 @@ const ItemList: React.FC = () => { title="商品与发货" description="同步在售商品并配置自动发货。" icon={Box} - badge={{items.length} 件商品} + badge={( + + {statusFilter === 'on_sale' && `在售 ${onSaleCount} 件`} + {statusFilter === 'off_shelf' && `已下架 ${offShelfCount} 件`} + {statusFilter === 'draft' && `草稿 ${draftTotal ?? '—'} 件`} + + )} /> { }} aria-label="选择账号" > - + {accounts.map(account => ( ))} 已配置专属发货 {configuredItemCount} 件 - {offShelfCount > 0 && ( - - )}
@@ -847,6 +853,49 @@ const ItemList: React.FC = () => {
+ {/* 状态分段:在售/已下架/草稿三套数据互不混排。 + 本地库只有在售与下架,草稿要现拉闲鱼,故计数在拉取前显示为 — */} +
+ {([ + { id: 'on_sale', label: '在售', count: onSaleCount }, + { id: 'off_shelf', label: '已下架', count: offShelfCount }, + { id: 'draft', label: '草稿', count: draftTotal }, + ] as const).map(tab => { + const active = statusFilter === tab.id; + return ( + + ); + })} + {statusFilter === 'draft' && draftLoading && ( + + + 正在从闲鱼拉取草稿… + + )} + {statusFilter === 'draft' && !draftLoading && draftNotice && ( + {draftNotice} + )} +
+ {visibleItems.length > 0 ? ( <> {/* 各列用固定宽度而非 minmax 压缩:列宽足够时内容不再挤在一起, @@ -1103,8 +1152,22 @@ const ItemList: React.FC = () => { ) : ( diff --git a/static/assets/AIReply-C49hHlXg.js b/static/assets/AIReply-Dsfaod73.js similarity index 97% rename from static/assets/AIReply-C49hHlXg.js rename to static/assets/AIReply-Dsfaod73.js index 06b94a1..4fa1fb3 100644 --- a/static/assets/AIReply-C49hHlXg.js +++ b/static/assets/AIReply-Dsfaod73.js @@ -1 +1 @@ -import{r as l,o as O,n as i,z as k,j as e,B as j,L as A,E as H,aF as F,S,K as q,aS as z}from"./index-IChzZLcq.js";import{P as B,a as U,E as D,S as o}from"./ui-DHCIdv_V.js";import{S as $}from"./save-m64KWfbE.js";import{M as E}from"./message-square-text-C6Er6xWp.js";import{E as G}from"./eye-off-DA35-r8G.js";import{E as J}from"./eye-BNO0yecz.js";import{P as C}from"./play-52JRVRYm.js";const I="https://ai.88531.cn/v1",Q="https://ai.88531.cn",f={ai_enabled:!1,model_name:"qwen-plus",api_key:"",api_key_configured:!1,base_url:I,user_agent:"codex_cli_rs/0.0.0 (Hermes Agent)",max_discount_percent:10,max_discount_amount:100,max_bargain_rounds:3,context_enabled:!0,context_message_limit:12,context_expire_minutes:120,custom_prompts:""},ae=()=>{const[c,P]=l.useState([]),[t,y]=l.useState(""),[a,d]=l.useState(f),[K,x]=l.useState(!0),[p,N]=l.useState(!1),[u,_]=l.useState(!1),[g,w]=l.useState(!1),[h,R]=l.useState("你好,这个商品现在还能买吗?"),[v,b]=l.useState(""),r=l.useMemo(()=>c.find(s=>s.id===t),[c,t]);l.useEffect(()=>{O().then(s=>{var m;P(s),y(((m=s[0])==null?void 0:m.id)||"")}).catch(s=>i(s instanceof Error?s.message:"账号加载失败","error")).finally(()=>x(!1))},[]),l.useEffect(()=>{t&&(x(!0),b(""),w(!1),k(t).then(s=>d({...f,...s,api_key:""})).catch(s=>i(s instanceof Error?s.message:"AI配置加载失败","error")).finally(()=>x(!1)))},[t]);const n=(s,m)=>{d(M=>({...M,[s]:m}))},T=async()=>{if(!t){i("请先选择账号","warning");return}if(!a.model_name.trim()||!a.base_url.trim()){i("模型名称和接口地址不能为空","warning");return}N(!0);try{await q(t,a);const s=await k(t);d({...f,...s,api_key:""}),i("人工智能回复配置已保存","success")}catch(s){i(s instanceof Error?s.message:"AI配置保存失败","error")}finally{N(!1)}},L=async()=>{if(!t||!h.trim()){i("请选择账号并输入测试消息","warning");return}_(!0),b("");try{const s=await z(t,{message:h.trim(),item_title:"测试商品",item_price:100,item_desc:"仅用于测试人工智能回复,不会发送到闲鱼。"});b(s.reply||s.message||"测试完成"),i("AI回复测试完成","success")}catch(s){i(s instanceof Error?s.message:"AI回复测试失败","error")}finally{_(!1)}};return K&&c.length===0?e.jsx(B,{label:"正在加载 AI 回复配置"}):e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(U,{title:"AI 回复",description:"按账号配置模型连接、上下文记忆、议价边界和业务回复规则。",icon:j,actions:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-end gap-2",children:[e.jsxs("label",{className:"min-w-0 sm:w-72",children:[e.jsx("span",{className:"field-label",children:"当前账号"}),e.jsx("select",{value:t,onChange:s=>y(s.target.value),className:"ios-input w-full rounded-md px-3 py-2 text-sm font-semibold",children:c.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||`账号 ${s.id.slice(0,8)}`},s.id))})]}),e.jsxs("button",{type:"button",onClick:T,disabled:p||!t,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[p?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx($,{className:"h-4 w-4"}),p?"保存中":"保存配置"]})]})}),t?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel grid gap-4 p-4 lg:grid-cols-[1fr_auto] lg:items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-gray-900",children:[e.jsx(E,{className:"h-5 w-5"}),(r==null?void 0:r.nickname)||(r==null?void 0:r.remark)||t]}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"回复优先级:关键词回复 → 人工智能回复 → 默认回复。AI失败时不会中断消息处理。"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[e.jsx("span",{className:"text-sm font-bold text-gray-700",children:a.ai_enabled?"已启用":"已停用"}),e.jsx("input",{type:"checkbox",checked:a.ai_enabled,onChange:s=>n("ai_enabled",s.target.checked),className:"h-5 w-5 accent-yellow-400"})]})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(340px,0.65fr)]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"模型连接",description:"支持 OpenAI 兼容接口;密钥留空时保留服务器中已有配置。",icon:j}),e.jsxs("div",{className:"grid gap-4 p-5 md:grid-cols-2",children:[e.jsxs("div",{className:"md:col-span-2 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-brand-200 bg-brand-50 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-800",children:"没有 API Key?每天可免费领取额度"}),e.jsx("p",{className:"mt-0.5 text-xs text-gray-600",children:"兼容 OpenAI 接口,注册后把密钥填到下方即可直接用。"})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:e.jsxs("a",{href:Q,target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1 rounded-md bg-brand-500 px-3 py-1.5 text-xs font-semibold text-brand-ink hover:bg-brand-600",children:["免费领取 token",e.jsx(H,{className:"h-3.5 w-3.5"})]})})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"接口地址"}),e.jsx("input",{value:a.base_url,onChange:s=>n("base_url",s.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm",placeholder:I})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"模型名称"}),e.jsx("input",{value:a.model_name,onChange:s=>n("model_name",s.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm",placeholder:"qwen-plus"})]}),e.jsxs("label",{className:"md:col-span-2",children:[e.jsxs("span",{className:"mb-1.5 flex items-center justify-between gap-3 text-sm font-semibold text-gray-700",children:["API Key",a.api_key_configured&&!a.api_key&&e.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-emerald-700",children:[e.jsx(F,{className:"h-3.5 w-3.5"}),"已配置,留空保持不变"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:g?"text":"password",value:a.api_key,onChange:s=>n("api_key",s.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 pr-10 text-sm",placeholder:a.api_key_configured?"输入新密钥以替换":"请输入 API Key",autoComplete:"new-password"}),e.jsx("button",{type:"button",onClick:()=>w(s=>!s),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-gray-500 hover:bg-gray-100",title:g?"隐藏密钥":"显示密钥",children:g?e.jsx(G,{className:"h-4 w-4"}):e.jsx(J,{className:"h-4 w-4"})})]})]}),e.jsxs("label",{className:"md:col-span-2",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"User-Agent"}),e.jsx("input",{value:a.user_agent??"",onChange:s=>n("user_agent",s.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm",placeholder:"codex_cli_rs/0.0.0 (Hermes Agent)"}),e.jsx("span",{className:"mt-1 block text-xs text-gray-500",children:"部分 API 中转站(如 AgentRouter)通过 User-Agent 白名单检测客户端,留空使用默认值。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"回复策略",description:"约束议价空间,并补充账号专属的语气、承诺和售后规则。",icon:E}),e.jsxs("div",{className:"grid gap-4 p-5 sm:grid-cols-3",children:[e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"最大折扣比例"}),e.jsx("input",{type:"number",min:0,max:100,value:a.max_discount_percent,onChange:s=>n("max_discount_percent",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"最大折扣金额"}),e.jsx("input",{type:"number",min:0,value:a.max_discount_amount??0,onChange:s=>n("max_discount_amount",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"最大议价轮次"}),e.jsx("input",{type:"number",min:1,max:10,value:a.max_bargain_rounds,onChange:s=>n("max_bargain_rounds",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm"})]}),e.jsxs("label",{className:"sm:col-span-3",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"回复风格与业务规则"}),e.jsx("textarea",{value:a.custom_prompts,onChange:s=>n("custom_prompts",s.target.value),className:"ios-input min-h-36 w-full resize-y rounded-md px-3 py-2.5 text-sm leading-6",placeholder:"例如:语气简洁,不承诺未确认的库存;涉及售后时引导买家说明订单号。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"上下文对话",description:"控制单个买家会话中可用于连续回复的近期消息范围。",icon:S}),e.jsxs("div",{className:"grid gap-4 p-5 sm:grid-cols-2",children:[e.jsxs("label",{className:"flex items-center justify-between gap-4 sm:col-span-2",children:[e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-semibold text-gray-700",children:"记住近期对话"}),e.jsx("span",{className:"mt-1 block text-xs leading-5 text-gray-500",children:"上下文按账号、会话和商品隔离,切换商品不会混入旧商品内容。"})]}),e.jsx("input",{type:"checkbox",checked:a.context_enabled,onChange:s=>n("context_enabled",s.target.checked),className:"h-5 w-5 shrink-0 accent-yellow-400"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"记忆消息数"}),e.jsx("input",{type:"number",min:2,max:30,disabled:!a.context_enabled,value:a.context_message_limit,onChange:s=>n("context_message_limit",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm disabled:bg-gray-100"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"上下文有效期(分钟)"}),e.jsx("input",{type:"number",min:5,max:1440,disabled:!a.context_enabled,value:a.context_expire_minutes,onChange:s=>n("context_expire_minutes",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm disabled:bg-gray-100"})]}),e.jsx("p",{className:"text-xs leading-5 text-gray-500 sm:col-span-2",children:"付款、发货、退款、收货等系统事件不会交给大模型,将继续由订单状态和自动发货规则处理。"})]})]})]}),e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"回复测试",description:"只生成文本,不会发送到闲鱼会话。",icon:C}),e.jsxs("div",{className:"p-5",children:[e.jsx("textarea",{value:h,onChange:s=>R(s.target.value),className:"ios-input min-h-24 w-full resize-y rounded-md px-3 py-2.5 text-sm"}),e.jsxs("button",{type:"button",onClick:L,disabled:u||!a.ai_enabled,className:"ios-btn-primary mt-3 flex w-full items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[u?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx(C,{className:"h-4 w-4"}),u?"生成中":"测试回复"]}),v&&e.jsx("div",{className:"mt-4 border-l-4 border-yellow-400 bg-yellow-50 px-4 py-3 text-sm leading-6 text-gray-800",children:v})]})]}),e.jsx("section",{className:"section-panel p-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(S,{className:"mt-0.5 h-5 w-5 shrink-0 text-emerald-700"}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-gray-900",children:"运行保护"}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:"密钥不会回传到浏览器;接口超时、空回复或格式异常时,系统会自动继续使用默认回复。"})]})]})})]})]})]}):e.jsx(D,{icon:j,title:"暂无可配置账号",description:"请先在账号管理中添加并登录闲鱼账号。"})]})};export{ae as default}; +import{r as l,o as O,n as i,z as k,j as e,B as j,L as A,E as H,aF as F,S,K as q,aS as z}from"./index-C6Y7HdB3.js";import{P as B,a as U,E as D,S as o}from"./ui-Dh615-z8.js";import{S as $}from"./save-C5DQBwo1.js";import{M as E}from"./message-square-text-DbxdYCPP.js";import{E as G}from"./eye-off-DqZjZWJp.js";import{E as J}from"./eye-BXgO1egk.js";import{P as C}from"./play-B67lJrJT.js";const I="https://ai.88531.cn/v1",Q="https://ai.88531.cn",f={ai_enabled:!1,model_name:"qwen-plus",api_key:"",api_key_configured:!1,base_url:I,user_agent:"codex_cli_rs/0.0.0 (Hermes Agent)",max_discount_percent:10,max_discount_amount:100,max_bargain_rounds:3,context_enabled:!0,context_message_limit:12,context_expire_minutes:120,custom_prompts:""},ae=()=>{const[c,P]=l.useState([]),[t,y]=l.useState(""),[a,d]=l.useState(f),[K,x]=l.useState(!0),[p,N]=l.useState(!1),[u,_]=l.useState(!1),[g,w]=l.useState(!1),[h,R]=l.useState("你好,这个商品现在还能买吗?"),[v,b]=l.useState(""),r=l.useMemo(()=>c.find(s=>s.id===t),[c,t]);l.useEffect(()=>{O().then(s=>{var m;P(s),y(((m=s[0])==null?void 0:m.id)||"")}).catch(s=>i(s instanceof Error?s.message:"账号加载失败","error")).finally(()=>x(!1))},[]),l.useEffect(()=>{t&&(x(!0),b(""),w(!1),k(t).then(s=>d({...f,...s,api_key:""})).catch(s=>i(s instanceof Error?s.message:"AI配置加载失败","error")).finally(()=>x(!1)))},[t]);const n=(s,m)=>{d(M=>({...M,[s]:m}))},T=async()=>{if(!t){i("请先选择账号","warning");return}if(!a.model_name.trim()||!a.base_url.trim()){i("模型名称和接口地址不能为空","warning");return}N(!0);try{await q(t,a);const s=await k(t);d({...f,...s,api_key:""}),i("人工智能回复配置已保存","success")}catch(s){i(s instanceof Error?s.message:"AI配置保存失败","error")}finally{N(!1)}},L=async()=>{if(!t||!h.trim()){i("请选择账号并输入测试消息","warning");return}_(!0),b("");try{const s=await z(t,{message:h.trim(),item_title:"测试商品",item_price:100,item_desc:"仅用于测试人工智能回复,不会发送到闲鱼。"});b(s.reply||s.message||"测试完成"),i("AI回复测试完成","success")}catch(s){i(s instanceof Error?s.message:"AI回复测试失败","error")}finally{_(!1)}};return K&&c.length===0?e.jsx(B,{label:"正在加载 AI 回复配置"}):e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(U,{title:"AI 回复",description:"按账号配置模型连接、上下文记忆、议价边界和业务回复规则。",icon:j,actions:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-end gap-2",children:[e.jsxs("label",{className:"min-w-0 sm:w-72",children:[e.jsx("span",{className:"field-label",children:"当前账号"}),e.jsx("select",{value:t,onChange:s=>y(s.target.value),className:"ios-input w-full rounded-md px-3 py-2 text-sm font-semibold",children:c.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||`账号 ${s.id.slice(0,8)}`},s.id))})]}),e.jsxs("button",{type:"button",onClick:T,disabled:p||!t,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[p?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx($,{className:"h-4 w-4"}),p?"保存中":"保存配置"]})]})}),t?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel grid gap-4 p-4 lg:grid-cols-[1fr_auto] lg:items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-gray-900",children:[e.jsx(E,{className:"h-5 w-5"}),(r==null?void 0:r.nickname)||(r==null?void 0:r.remark)||t]}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"回复优先级:关键词回复 → 人工智能回复 → 默认回复。AI失败时不会中断消息处理。"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[e.jsx("span",{className:"text-sm font-bold text-gray-700",children:a.ai_enabled?"已启用":"已停用"}),e.jsx("input",{type:"checkbox",checked:a.ai_enabled,onChange:s=>n("ai_enabled",s.target.checked),className:"h-5 w-5 accent-yellow-400"})]})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(340px,0.65fr)]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"模型连接",description:"支持 OpenAI 兼容接口;密钥留空时保留服务器中已有配置。",icon:j}),e.jsxs("div",{className:"grid gap-4 p-5 md:grid-cols-2",children:[e.jsxs("div",{className:"md:col-span-2 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-brand-200 bg-brand-50 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-800",children:"没有 API Key?每天可免费领取额度"}),e.jsx("p",{className:"mt-0.5 text-xs text-gray-600",children:"兼容 OpenAI 接口,注册后把密钥填到下方即可直接用。"})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:e.jsxs("a",{href:Q,target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1 rounded-md bg-brand-500 px-3 py-1.5 text-xs font-semibold text-brand-ink hover:bg-brand-600",children:["免费领取 token",e.jsx(H,{className:"h-3.5 w-3.5"})]})})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"接口地址"}),e.jsx("input",{value:a.base_url,onChange:s=>n("base_url",s.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm",placeholder:I})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"模型名称"}),e.jsx("input",{value:a.model_name,onChange:s=>n("model_name",s.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm",placeholder:"qwen-plus"})]}),e.jsxs("label",{className:"md:col-span-2",children:[e.jsxs("span",{className:"mb-1.5 flex items-center justify-between gap-3 text-sm font-semibold text-gray-700",children:["API Key",a.api_key_configured&&!a.api_key&&e.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-emerald-700",children:[e.jsx(F,{className:"h-3.5 w-3.5"}),"已配置,留空保持不变"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:g?"text":"password",value:a.api_key,onChange:s=>n("api_key",s.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 pr-10 text-sm",placeholder:a.api_key_configured?"输入新密钥以替换":"请输入 API Key",autoComplete:"new-password"}),e.jsx("button",{type:"button",onClick:()=>w(s=>!s),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-gray-500 hover:bg-gray-100",title:g?"隐藏密钥":"显示密钥",children:g?e.jsx(G,{className:"h-4 w-4"}):e.jsx(J,{className:"h-4 w-4"})})]})]}),e.jsxs("label",{className:"md:col-span-2",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"User-Agent"}),e.jsx("input",{value:a.user_agent??"",onChange:s=>n("user_agent",s.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm",placeholder:"codex_cli_rs/0.0.0 (Hermes Agent)"}),e.jsx("span",{className:"mt-1 block text-xs text-gray-500",children:"部分 API 中转站(如 AgentRouter)通过 User-Agent 白名单检测客户端,留空使用默认值。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"回复策略",description:"约束议价空间,并补充账号专属的语气、承诺和售后规则。",icon:E}),e.jsxs("div",{className:"grid gap-4 p-5 sm:grid-cols-3",children:[e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"最大折扣比例"}),e.jsx("input",{type:"number",min:0,max:100,value:a.max_discount_percent,onChange:s=>n("max_discount_percent",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"最大折扣金额"}),e.jsx("input",{type:"number",min:0,value:a.max_discount_amount??0,onChange:s=>n("max_discount_amount",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"最大议价轮次"}),e.jsx("input",{type:"number",min:1,max:10,value:a.max_bargain_rounds,onChange:s=>n("max_bargain_rounds",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm"})]}),e.jsxs("label",{className:"sm:col-span-3",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"回复风格与业务规则"}),e.jsx("textarea",{value:a.custom_prompts,onChange:s=>n("custom_prompts",s.target.value),className:"ios-input min-h-36 w-full resize-y rounded-md px-3 py-2.5 text-sm leading-6",placeholder:"例如:语气简洁,不承诺未确认的库存;涉及售后时引导买家说明订单号。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"上下文对话",description:"控制单个买家会话中可用于连续回复的近期消息范围。",icon:S}),e.jsxs("div",{className:"grid gap-4 p-5 sm:grid-cols-2",children:[e.jsxs("label",{className:"flex items-center justify-between gap-4 sm:col-span-2",children:[e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-semibold text-gray-700",children:"记住近期对话"}),e.jsx("span",{className:"mt-1 block text-xs leading-5 text-gray-500",children:"上下文按账号、会话和商品隔离,切换商品不会混入旧商品内容。"})]}),e.jsx("input",{type:"checkbox",checked:a.context_enabled,onChange:s=>n("context_enabled",s.target.checked),className:"h-5 w-5 shrink-0 accent-yellow-400"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"记忆消息数"}),e.jsx("input",{type:"number",min:2,max:30,disabled:!a.context_enabled,value:a.context_message_limit,onChange:s=>n("context_message_limit",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm disabled:bg-gray-100"})]}),e.jsxs("label",{children:[e.jsx("span",{className:"mb-1.5 block text-sm font-semibold text-gray-700",children:"上下文有效期(分钟)"}),e.jsx("input",{type:"number",min:5,max:1440,disabled:!a.context_enabled,value:a.context_expire_minutes,onChange:s=>n("context_expire_minutes",Number(s.target.value)),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm disabled:bg-gray-100"})]}),e.jsx("p",{className:"text-xs leading-5 text-gray-500 sm:col-span-2",children:"付款、发货、退款、收货等系统事件不会交给大模型,将继续由订单状态和自动发货规则处理。"})]})]})]}),e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"回复测试",description:"只生成文本,不会发送到闲鱼会话。",icon:C}),e.jsxs("div",{className:"p-5",children:[e.jsx("textarea",{value:h,onChange:s=>R(s.target.value),className:"ios-input min-h-24 w-full resize-y rounded-md px-3 py-2.5 text-sm"}),e.jsxs("button",{type:"button",onClick:L,disabled:u||!a.ai_enabled,className:"ios-btn-primary mt-3 flex w-full items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[u?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx(C,{className:"h-4 w-4"}),u?"生成中":"测试回复"]}),v&&e.jsx("div",{className:"mt-4 border-l-4 border-yellow-400 bg-yellow-50 px-4 py-3 text-sm leading-6 text-gray-800",children:v})]})]}),e.jsx("section",{className:"section-panel p-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(S,{className:"mt-0.5 h-5 w-5 shrink-0 text-emerald-700"}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-gray-900",children:"运行保护"}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:"密钥不会回传到浏览器;接口超时、空回复或格式异常时,系统会自动继续使用默认回复。"})]})]})})]})]})]}):e.jsx(D,{icon:j,title:"暂无可配置账号",description:"请先在账号管理中添加并登录闲鱼账号。"})]})};export{ae as default}; diff --git a/static/assets/About-DCjjMMTu.js b/static/assets/About-DH_fUK9S.js similarity index 98% rename from static/assets/About-DCjjMMTu.js rename to static/assets/About-DH_fUK9S.js index 1c0d584..c14ca83 100644 --- a/static/assets/About-DCjjMMTu.js +++ b/static/assets/About-DH_fUK9S.js @@ -1,4 +1,4 @@ -import{c as m,r as n,j as e,bE as h,e as g,P as b,E as l,aF as j,aV as f,aW as o,bF as N}from"./index-IChzZLcq.js";import{a as u,E as y}from"./ui-DHCIdv_V.js";/** +import{c as m,r as n,j as e,bE as h,e as g,P as b,E as l,aF as j,aV as f,aW as o,bF as N}from"./index-C6Y7HdB3.js";import{a as u,E as y}from"./ui-Dh615-z8.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/AccountList-CC8hRCM2.js b/static/assets/AccountList-jdp7_cFb.js similarity index 99% rename from static/assets/AccountList-CC8hRCM2.js rename to static/assets/AccountList-jdp7_cFb.js index 1f2a02c..53f4e1d 100644 --- a/static/assets/AccountList-CC8hRCM2.js +++ b/static/assets/AccountList-jdp7_cFb.js @@ -1,4 +1,4 @@ -import{c as ee,r as i,j as e,U as Ce,B as Q,M as Ze,L as C,S as G,e as Ae,k as es,b as z,X as T,l as ss,m as O,o as ts,p as as,q as rs,s as ls,t as ns,n as m,u as Ie,v as Me,w as is,x as os,y as ds,z as cs,A as ms,D as xs,F as us,G as hs,H as ps,I as gs,J as fs,K as bs,N as ys}from"./index-IChzZLcq.js";import{P as js,a as Ns,E as _s}from"./ui-DHCIdv_V.js";import{C as Z}from"./check-6Gro50Mh.js";import{S as ws}from"./sparkles-B5X13VUJ.js";import{P as vs,a as ks}from"./power-ZOn3B5wN.js";import{T as Ss}from"./trash-2-CnOVC8WZ.js";import{K as Cs}from"./key-BRO3zsxh.js";import{E as As}from"./eye-off-DA35-r8G.js";import{E as Is}from"./eye-BNO0yecz.js";import{S as $e}from"./save-m64KWfbE.js";/** +import{c as ee,r as i,j as e,U as Ce,B as Q,M as Ze,L as C,S as G,e as Ae,k as es,b as z,X as T,l as ss,m as O,o as ts,p as as,q as rs,s as ls,t as ns,n as m,u as Ie,v as Me,w as is,x as os,y as ds,z as cs,A as ms,D as xs,F as us,G as hs,H as ps,I as gs,J as fs,K as bs,N as ys}from"./index-C6Y7HdB3.js";import{P as js,a as Ns,E as _s}from"./ui-Dh615-z8.js";import{C as Z}from"./check--qTdUCr3.js";import{S as ws}from"./sparkles-CczcRRJP.js";import{P as vs,a as ks}from"./power-WuQyd1QF.js";import{T as Ss}from"./trash-2-BG9PyYJR.js";import{K as Cs}from"./key-CnYS625y.js";import{E as As}from"./eye-off-DqZjZWJp.js";import{E as Is}from"./eye-BXgO1egk.js";import{S as $e}from"./save-C5DQBwo1.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/BuyerInteraction-BJEwndHV.js b/static/assets/BuyerInteraction-0rmlMue9.js similarity index 96% rename from static/assets/BuyerInteraction-BJEwndHV.js rename to static/assets/BuyerInteraction-0rmlMue9.js index 4b50850..b6e3de1 100644 --- a/static/assets/BuyerInteraction-BJEwndHV.js +++ b/static/assets/BuyerInteraction-0rmlMue9.js @@ -1 +1 @@ -import{r as n,j as e,Q as C,e as T,aT as $,T as P,o as B,n as i,aY as H,bG as M}from"./index-IChzZLcq.js";import{P as D,a as R,N as z,S as d}from"./ui-DHCIdv_V.js";import{S as G}from"./save-m64KWfbE.js";import{S as O}from"./shield-alert-ob02IPrt.js";import{F as U}from"./flower-2-DPAmZVRG.js";import{M as q}from"./message-square-text-C6Er6xWp.js";const r=200,A="宝贝收到了,很满意,感谢老板,欢迎下次再来!",I="亲,感谢支持!有任何问题随时找我~",K={auto_rate_enabled:"评价买家",auto_flower_enabled:"索要小红花",auto_thanks_enabled:"收货致谢",auto_receive_flower_enabled:"自动收下小红花"},Q=[{value:300,label:"5 分钟"},{value:900,label:"15 分钟"},{value:1800,label:"30 分钟"},{value:3600,label:"1 小时"},{value:7200,label:"2 小时(默认)"},{value:21600,label:"6 小时"},{value:86400,label:"24 小时"}],ee=()=>{const[l,c]=n.useState(null),[p,h]=n.useState(!1),[b,_]=n.useState(!1),[o,E]=n.useState([]),[f,x]=n.useState({}),j=()=>{h(!0),Promise.all([$(),P().catch(()=>null),B().catch(()=>[])]).then(([t,a,s])=>{c({...t,auto_rate_template:(t.auto_rate_template??"").trim()||(a==null?void 0:a.auto_rate_template)||A}),E(s),x((a==null?void 0:a.accounts)??{})}).finally(()=>h(!1))},F=async(t,a)=>{const s=f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},w={...s,[a]:!s[a]};x(u=>({...u,[t]:w}));try{await M(t,{[a]:w[a]})}catch(u){x(k=>({...k,[t]:s})),i(`保存失败:${u.message}`)}};n.useEffect(()=>{j()},[]);const L=async()=>{if(!l)return;const t=(l.auto_rate_template||"").trim();if(!t){i("默认评价内容不能为空");return}if(t.length>r){i(`默认评价内容不能超过 ${r} 字`);return}_(!0);try{await H({auto_rate_template:t,auto_thanks_template:(l.auto_thanks_template||"").trim(),buyer_interaction_interval:String(S)}),i("买家互动配置已保存")}catch(a){i(`保存失败:${a.message}`)}finally{_(!1)}};if(!l)return e.jsx(D,{label:"正在加载买家互动配置"});const m=t=>f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},g=o.some(t=>m(t.id).auto_rate_enabled),y=o.some(t=>m(t.id).auto_thanks_enabled),N=l.auto_rate_template??"",v=l.auto_thanks_template??"",S=Number(l.buyer_interaction_interval)||7200;return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(R,{title:"买家互动",description:"评价买家、索要小红花与自动收花。涉及平台实际操作,请按账号开启。",icon:C,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:j,disabled:p,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(T,{className:`h-4 w-4 ${p?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:b,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(G,{className:"h-4 w-4"}),b?"保存中":"保存设置"]})]})}),e.jsx(z,{type:"warning",message:"评价提交后无法撤销,求花会向买家发送一条消息。建议先用测试订单验证效果。"}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"按账号开启",description:"逐个账号控制。关闭的账号不会自动执行,订单页也不显示入口、后端拒绝请求。",icon:O}),o.length===0?e.jsx("p",{className:"px-4 py-6 text-sm text-gray-500",children:"还没有账号,请先在账号管理里添加。"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 text-left text-xs text-gray-500",children:[e.jsx("th",{className:"px-4 py-2 font-semibold",children:"账号"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"评价买家"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"索要小红花"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"收货致谢"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"自动收下小红花"})]})}),e.jsx("tbody",{children:o.map(t=>{const a=m(t.id);return e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("p",{className:"font-semibold text-gray-900",children:t.nickname||t.id}),e.jsx("p",{className:"mt-0.5 font-mono text-xs text-gray-400",children:t.id})]}),["auto_rate_enabled","auto_flower_enabled","auto_thanks_enabled","auto_receive_flower_enabled"].map(s=>e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{type:"button",role:"switch","aria-checked":a[s],"aria-label":`${t.nickname||t.id} ${K[s]}`,onClick:()=>void F(t.id,s),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${a[s]?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${a[s]?"translate-x-5":""}`})})},s))]},t.id)})})]})}),e.jsxs("p",{className:"border-t border-gray-100 px-4 py-3 text-xs leading-5 text-gray-500",children:["三项都在",e.jsx("strong",{className:"font-semibold text-gray-700",children:"买家确认收货"}),"后触发。 致谢文本立即发送;评价和求花要等闲鱼把订单切到「交易成功」,通常几十秒内完成, 失败则由下面的兜底轮询稍后重试。"]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"默认评价内容",description:"订单页打开评价框时自动填入,仍可逐单修改后再提交。",icon:U}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"评价文案"}),e.jsx("textarea",{value:N,onChange:t=>c({...l,auto_rate_template:t.target.value}),maxLength:r,placeholder:A,className:"ios-input mt-1 min-h-28 w-full resize-y rounded-md px-3 py-2.5 text-sm",disabled:!g}),e.jsxs("div",{className:"mt-1 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-500",children:g?"闲鱼对评价内容有长度和内容限制,过长可能被拒绝。":"为任一账号开启「评价买家」后可编辑。"}),e.jsxs("span",{className:"text-xs text-gray-400",children:[N.length,"/",r]})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"收货致谢文本",description:"买家确认收货后立即发送这条消息。留空则不发送。",icon:q}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"致谢文案"}),e.jsx("textarea",{value:v,onChange:t=>c({...l,auto_thanks_template:t.target.value}),maxLength:r,placeholder:I,className:"ios-input mt-1 min-h-28 w-full resize-y rounded-md px-3 py-2.5 text-sm",disabled:!y}),e.jsxs("div",{className:"mt-1 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-500",children:y?"同一笔交易只发一次,不会因多条系统消息重复打扰买家。":"为任一账号开启「收货致谢」后可编辑。"}),e.jsxs("span",{className:"text-xs text-gray-400",children:[v.length,"/",r]})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"兜底检查间隔",description:"确认收货已由消息事件即时触发,这里只在漏收消息或服务重启时补做。",icon:T}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"检查频率"}),e.jsx("select",{value:S,onChange:t=>c({...l,buyer_interaction_interval:t.target.value}),className:"ios-input mt-1 w-full rounded-md px-3 py-2.5 text-sm",children:Q.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:"每轮都会拉取一次卖出订单列表,设得太密容易触发平台风控。 正常情况下靠即时触发就够了,这里保持较长间隔即可。"})]})]})]})]})};export{ee as default}; +import{r as n,j as e,Q as C,e as T,aT as $,T as P,o as B,n as i,aY as H,bG as M}from"./index-C6Y7HdB3.js";import{P as D,a as R,N as z,S as d}from"./ui-Dh615-z8.js";import{S as G}from"./save-C5DQBwo1.js";import{S as O}from"./shield-alert-BSaySGHY.js";import{F as U}from"./flower-2-CSgAnLCK.js";import{M as q}from"./message-square-text-DbxdYCPP.js";const r=200,A="宝贝收到了,很满意,感谢老板,欢迎下次再来!",I="亲,感谢支持!有任何问题随时找我~",K={auto_rate_enabled:"评价买家",auto_flower_enabled:"索要小红花",auto_thanks_enabled:"收货致谢",auto_receive_flower_enabled:"自动收下小红花"},Q=[{value:300,label:"5 分钟"},{value:900,label:"15 分钟"},{value:1800,label:"30 分钟"},{value:3600,label:"1 小时"},{value:7200,label:"2 小时(默认)"},{value:21600,label:"6 小时"},{value:86400,label:"24 小时"}],ee=()=>{const[l,c]=n.useState(null),[p,h]=n.useState(!1),[b,_]=n.useState(!1),[o,E]=n.useState([]),[f,x]=n.useState({}),j=()=>{h(!0),Promise.all([$(),P().catch(()=>null),B().catch(()=>[])]).then(([t,a,s])=>{c({...t,auto_rate_template:(t.auto_rate_template??"").trim()||(a==null?void 0:a.auto_rate_template)||A}),E(s),x((a==null?void 0:a.accounts)??{})}).finally(()=>h(!1))},F=async(t,a)=>{const s=f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},w={...s,[a]:!s[a]};x(u=>({...u,[t]:w}));try{await M(t,{[a]:w[a]})}catch(u){x(k=>({...k,[t]:s})),i(`保存失败:${u.message}`)}};n.useEffect(()=>{j()},[]);const L=async()=>{if(!l)return;const t=(l.auto_rate_template||"").trim();if(!t){i("默认评价内容不能为空");return}if(t.length>r){i(`默认评价内容不能超过 ${r} 字`);return}_(!0);try{await H({auto_rate_template:t,auto_thanks_template:(l.auto_thanks_template||"").trim(),buyer_interaction_interval:String(S)}),i("买家互动配置已保存")}catch(a){i(`保存失败:${a.message}`)}finally{_(!1)}};if(!l)return e.jsx(D,{label:"正在加载买家互动配置"});const m=t=>f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},g=o.some(t=>m(t.id).auto_rate_enabled),y=o.some(t=>m(t.id).auto_thanks_enabled),N=l.auto_rate_template??"",v=l.auto_thanks_template??"",S=Number(l.buyer_interaction_interval)||7200;return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(R,{title:"买家互动",description:"评价买家、索要小红花与自动收花。涉及平台实际操作,请按账号开启。",icon:C,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:j,disabled:p,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(T,{className:`h-4 w-4 ${p?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:b,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(G,{className:"h-4 w-4"}),b?"保存中":"保存设置"]})]})}),e.jsx(z,{type:"warning",message:"评价提交后无法撤销,求花会向买家发送一条消息。建议先用测试订单验证效果。"}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"按账号开启",description:"逐个账号控制。关闭的账号不会自动执行,订单页也不显示入口、后端拒绝请求。",icon:O}),o.length===0?e.jsx("p",{className:"px-4 py-6 text-sm text-gray-500",children:"还没有账号,请先在账号管理里添加。"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 text-left text-xs text-gray-500",children:[e.jsx("th",{className:"px-4 py-2 font-semibold",children:"账号"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"评价买家"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"索要小红花"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"收货致谢"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"自动收下小红花"})]})}),e.jsx("tbody",{children:o.map(t=>{const a=m(t.id);return e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("p",{className:"font-semibold text-gray-900",children:t.nickname||t.id}),e.jsx("p",{className:"mt-0.5 font-mono text-xs text-gray-400",children:t.id})]}),["auto_rate_enabled","auto_flower_enabled","auto_thanks_enabled","auto_receive_flower_enabled"].map(s=>e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{type:"button",role:"switch","aria-checked":a[s],"aria-label":`${t.nickname||t.id} ${K[s]}`,onClick:()=>void F(t.id,s),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${a[s]?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${a[s]?"translate-x-5":""}`})})},s))]},t.id)})})]})}),e.jsxs("p",{className:"border-t border-gray-100 px-4 py-3 text-xs leading-5 text-gray-500",children:["三项都在",e.jsx("strong",{className:"font-semibold text-gray-700",children:"买家确认收货"}),"后触发。 致谢文本立即发送;评价和求花要等闲鱼把订单切到「交易成功」,通常几十秒内完成, 失败则由下面的兜底轮询稍后重试。"]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"默认评价内容",description:"订单页打开评价框时自动填入,仍可逐单修改后再提交。",icon:U}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"评价文案"}),e.jsx("textarea",{value:N,onChange:t=>c({...l,auto_rate_template:t.target.value}),maxLength:r,placeholder:A,className:"ios-input mt-1 min-h-28 w-full resize-y rounded-md px-3 py-2.5 text-sm",disabled:!g}),e.jsxs("div",{className:"mt-1 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-500",children:g?"闲鱼对评价内容有长度和内容限制,过长可能被拒绝。":"为任一账号开启「评价买家」后可编辑。"}),e.jsxs("span",{className:"text-xs text-gray-400",children:[N.length,"/",r]})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"收货致谢文本",description:"买家确认收货后立即发送这条消息。留空则不发送。",icon:q}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"致谢文案"}),e.jsx("textarea",{value:v,onChange:t=>c({...l,auto_thanks_template:t.target.value}),maxLength:r,placeholder:I,className:"ios-input mt-1 min-h-28 w-full resize-y rounded-md px-3 py-2.5 text-sm",disabled:!y}),e.jsxs("div",{className:"mt-1 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-500",children:y?"同一笔交易只发一次,不会因多条系统消息重复打扰买家。":"为任一账号开启「收货致谢」后可编辑。"}),e.jsxs("span",{className:"text-xs text-gray-400",children:[v.length,"/",r]})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"兜底检查间隔",description:"确认收货已由消息事件即时触发,这里只在漏收消息或服务重启时补做。",icon:T}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("label",{className:"field-label",children:"检查频率"}),e.jsx("select",{value:S,onChange:t=>c({...l,buyer_interaction_interval:t.target.value}),className:"ios-input mt-1 w-full rounded-md px-3 py-2.5 text-sm",children:Q.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:"每轮都会拉取一次卖出订单列表,设得太密容易触发平台风控。 正常情况下靠即时触发就够了,这里保持较长间隔即可。"})]})]})]})]})};export{ee as default}; diff --git a/static/assets/CardList-DaeMtjqS.js b/static/assets/CardList-BeNoktSc.js similarity index 98% rename from static/assets/CardList-DaeMtjqS.js rename to static/assets/CardList-BeNoktSc.js index 0d56a53..ca5c95c 100644 --- a/static/assets/CardList-DaeMtjqS.js +++ b/static/assets/CardList-BeNoktSc.js @@ -1,4 +1,4 @@ -import{c as P,r as m,j as e,X as D,a6 as re,n as j,a7 as de,a8 as M,a9 as G,b as z,aa as H,v as Y,ab as ce,ac as oe,ad as me}from"./index-IChzZLcq.js";import{a as pe,S as xe,E as B}from"./ui-DHCIdv_V.js";import{P as U}from"./plus-hTzuza9d.js";import{S as he}from"./square-pen-BOlWgFhh.js";import{T as ye}from"./trash-2-CnOVC8WZ.js";import{P as Z}from"./package-3qqwOYvH.js";import{S as ue}from"./save-m64KWfbE.js";import{I as q}from"./image-BCD-eej2.js";import{P as be}from"./package-check-FQzJ-066.js";/** +import{c as P,r as m,j as e,X as D,a6 as re,n as j,a7 as de,a8 as M,a9 as G,b as z,aa as H,v as Y,ab as ce,ac as oe,ad as me}from"./index-C6Y7HdB3.js";import{a as pe,S as xe,E as B}from"./ui-Dh615-z8.js";import{P as U}from"./plus-BZHhM3Ok.js";import{S as he}from"./square-pen-ptW8MQaM.js";import{T as ye}from"./trash-2-BG9PyYJR.js";import{P as Z}from"./package-DjIVaNpE.js";import{S as ue}from"./save-C5DQBwo1.js";import{I as q}from"./image-DkNS6I4I.js";import{P as be}from"./package-check-C8PHQCAA.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/Dashboard-R20Ph_el.js b/static/assets/Dashboard-r6bLPRiz.js similarity index 99% rename from static/assets/Dashboard-R20Ph_el.js rename to static/assets/Dashboard-r6bLPRiz.js index 8e98772..09d736a 100644 --- a/static/assets/Dashboard-R20Ph_el.js +++ b/static/assets/Dashboard-r6bLPRiz.js @@ -1,4 +1,4 @@ -var Db=Object.defineProperty;var $b=(e,t,r)=>t in e?Db(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _i=(e,t,r)=>$b(e,typeof t!="symbol"?t+"":t,r);import{c as gu,r as v,a as bu,b as xu,g as Nb,R as Rb,d as Lb,j as I,C as zb,e as Bb,U as Fb,E as Wb,f as Kb,h as Ub,n as Hb,i as Ac}from"./index-IChzZLcq.js";import{P as Yb,a as Gb,b as Vb,S as qb,E as Ii}from"./ui-DHCIdv_V.js";import{P as Ro}from"./package-3qqwOYvH.js";import{T as Lh}from"./trending-up-BDgJo2q2.js";import{A as Xb}from"./activity-CRI26G7w.js";import{P as Zb}from"./package-check-FQzJ-066.js";/** +var Db=Object.defineProperty;var $b=(e,t,r)=>t in e?Db(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _i=(e,t,r)=>$b(e,typeof t!="symbol"?t+"":t,r);import{c as gu,r as v,a as bu,b as xu,g as Nb,R as Rb,d as Lb,j as I,C as zb,e as Bb,U as Fb,E as Wb,f as Kb,h as Ub,n as Hb,i as Ac}from"./index-C6Y7HdB3.js";import{P as Yb,a as Gb,b as Vb,S as qb,E as Ii}from"./ui-Dh615-z8.js";import{P as Ro}from"./package-DjIVaNpE.js";import{T as Lh}from"./trending-up-BR0vQ8dC.js";import{A as Xb}from"./activity-CV-Hy1l6.js";import{P as Zb}from"./package-check-C8PHQCAA.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/Help-LRtmM6iN.js b/static/assets/Help-cncF4wHf.js similarity index 99% rename from static/assets/Help-LRtmM6iN.js rename to static/assets/Help-cncF4wHf.js index 4372511..9ed426a 100644 --- a/static/assets/Help-LRtmM6iN.js +++ b/static/assets/Help-cncF4wHf.js @@ -1 +1 @@ -import{r as d,j as e}from"./index-IChzZLcq.js";const r=[{group:"快速开始",items:[{id:"dashboard",label:"系统总览"},{id:"accounts",label:"账号管理"}]},{group:"闲鱼业务",items:[{id:"items",label:"商品与发货"},{id:"resell",label:"一键转卖"},{id:"hotlist",label:"实时热卖榜"},{id:"pricewatch",label:"价格监控"},{id:"orders",label:"订单管理"},{id:"buyer-interaction",label:"买家互动"},{id:"cards",label:"卡密库存"}]},{group:"消息与自动化",items:[{id:"messages",label:"消息中心"},{id:"auto-reply",label:"自动回复"},{id:"ai-reply",label:"AI 回复"},{id:"product-automation",label:"商品自动化"}]},{group:"系统",items:[{id:"notifications",label:"通知与日志"},{id:"settings",label:"系统设置"},{id:"users",label:"用户管理"},{id:"about",label:"关于本系统"}]}],p={dashboard:{title:"系统总览",intro:"登录后的首页,汇总账号、订单、营收和库存数据,一眼判断当前经营状态。",steps:["顶部时间筛选可切换统计周期:今天 / 昨天 / 三天内 / 7天内 / 一个月内 / 自定义。","「有效成交额」与「已到账」两张卡片展示所选周期内的资金数据。","「系统运行中」状态灯表示后端自动回复、定时任务正常运行。","左侧菜单点击任意功能即可切换页面,右上角可切换日间/夜间模式。"],tips:["新部署时没有订单记录,金额显示 ¥0.00 属正常,产生交易后自动累计。"]},accounts:{title:"账号管理",intro:"所有功能的入口:先把闲鱼账号接入系统,其他页面才能选择该账号操作。",steps:["点击「添加账号」,填入账号备注名与 Cookie(从浏览器登录闲鱼后在开发者工具 Network 里复制)。","保存后列表会显示该账号,可点击「检测」验证 Cookie 是否仍然有效。","失效的账号需要重新复制 Cookie 更新;不用的账号可「禁用」而不必删除。","启用状态的账号才会参与自动回复、订单同步、消息聚合等自动化。"],tips:["Cookie 等同账号登录态,请勿泄露;本系统只保存在自己的服务器数据库中。"]},items:{title:"商品与发货",intro:"同步闲鱼在售商品,为每个商品配置自动发货内容(卡密、网盘链接或文字说明)。",steps:["选择账号后点击同步,把该账号在闲鱼的在售商品拉取到列表。","给商品设置发货内容:虚拟商品可填卡密说明或网盘链接,实物商品可填物流备注。","买家付款后系统按这里配置的内容自动回复发货,无需手动复制粘贴。","商品价格、标题变化可通过刷新按钮同步最新状态。"],tips:["发货内容支持多行文本与链接,建议按「商品名称 + 提取码」格式写清楚。"]},resell:{title:"一键转卖",intro:"从收藏或搜索结果里挑商品,改好标题价格直接发布到自己账号,做无货源转卖。",steps:["右上角先选择要发布到的闲鱼账号。","点「我的收藏」→「加载收藏」读取该账号收藏的在售商品;或切到「搜索商品」按关键词找货。","在列表中勾选想转卖的商品,修改标题、价格、描述等发布信息。","点「一键转卖」发布,商品即挂到自己账号名下。"],tips:["发布前核对价格是否留足利润;同名商品重复转卖前先在商品列表确认未上架过。"]},hotlist:{title:"实时热卖榜",intro:"抓取闲鱼实时热卖数据,帮你判断什么好卖、该上什么货。",steps:["选择分类或直接查看综合热卖榜,列表按近期成交热度排序。","点击商品可查看详情与价格区间,作为自己定价的参考。","看中的品可直接跳「一键转卖」上架到自己账号。"],tips:["榜单数据为实时抓取,个别时段可能延迟,可点刷新重新拉取。"]},pricewatch:{title:"价格监控",intro:"设定关键词和目标价,系统定时搜索闲鱼,出现低于目标价的商品立即通知你捡漏。",steps:["点「新建规则」:填写关键词(如想蹲的商品名)、目标价、检测间隔,保存后立即执行一次检测。","检测结果展示匹配商品数、历史最低价与「最近一次」的完整商品信息(超长内容自动换行展示)。","低于目标价时触发通知——前提是已在「通知与日志」页配置好通知渠道并勾选「价格监控」事件(见下方章节)。","点「历史记录」查看每次检测的明细;不需要的规则可停用或删除。"],tips:["通知没发出来时,页面顶部的红色提示会写明去哪配置,按提示到「通知与日志」页补配即可。","关键词越具体匹配越准,避免太宽泛导致噪音过多。"]},orders:{title:"订单管理",intro:"汇总所选账号的闲鱼订单,查看状态、手动补发与核对发货记录。",steps:["选择账号与时间范围筛选订单,列表显示买家、商品、金额与状态。","自动发货成功的订单会标记发货内容;失败的可在这里点「重新发货」补发。","点订单行可展开详情,核对买家留言与发货回执。"],tips:["订单数据来自定时同步,新成交订单可能延迟几分钟出现。"]},"buyer-interaction":{title:"买家互动",intro:"评价买家、索要小红花与自动收花——和闲鱼平台实际操作绑定,需按账号开启。",steps:["先在「账号管理」添加账号(无账号时本页会提示先去添加)。","在「按账号开启」区域为需要的账号打开对应开关:评价买家 / 索要小红花 / 自动收花。","点「保存设置」生效;关闭的账号不会执行任何互动,订单页也不显示入口。","建议先用一笔测试订单验证效果,再放开到全部账号。"],tips:["⚠ 评价提交后无法撤销,索要小红花会给买家发一条消息——务必先小范围测试。"]},cards:{title:"卡密库存",intro:"导入与管理卡密,配合「商品与发货」实现虚拟商品自动发货、库存自动扣减。",steps:["新建卡密分组(对应某个商品),批量粘贴或上传卡密文本,一行一条。","在「商品与发货」把商品的发货方式关联到该卡密分组。","买家付款后系统自动取一条卡密发出并扣减库存,列表显示剩余数量。","库存告急时及时补充,发货失败的订单会记录原因便于排查。"],tips:["卡密只对管理员可见,普通用户页面不会展示明文。"]},messages:{title:"消息中心",intro:"把多个闲鱼账号的买家消息聚合到一处,集中查看与回复。",steps:["选择账号后加载未读/全部消息,按时间倒序展示。","点击会话查看上下文并可手动回复;已被自动回复接管的会话会标注规则来源。","新消息会实时提醒,避免漏掉买家咨询。"],tips:["消息聚合依赖账号 Cookie 有效,账号失效时先到「账号管理」更新。"]},"auto-reply":{title:"自动回复",intro:"配置关键词规则:买家消息命中触发词即自动回复,7×24 接待。",steps:["点「新建规则」,设置触发关键词(支持多个、精确/模糊匹配)与回复内容。","回复支持多行文本、链接与随机话术(多条回复轮流发送,避免重复感)。","保存即生效,无需重启;列表可停用、编辑、删除规则。","在规则上可指定仅对某账号生效,或全局所有账号共用。"],tips:["建议先配 3-5 条高频问题(价格、包邮、发货时间)再逐步扩充。"]},"ai-reply":{title:"AI 回复",intro:"接入大模型 API,让 AI 根据上下文智能回复买家消息、自动议价。",steps:["先到「系统设置 → AI 服务」填好 API 地址、Key 与模型名(本地 NewAPI 或任意兼容接口)。","在本页设置议价策略:最大优惠百分比/金额、议价轮数上限。","开启「上下文」后 AI 会携带最近若干条对话,回复更连贯。","系统先匹配关键词规则,未命中才走 AI;可在页面调整两者的优先级。"],tips:["AI 每次回复消耗 API 额度,量大时建议设置轮数与优惠上限兜底。"]},"product-automation":{title:"商品自动化",intro:"商品素材库与批量任务:筛选规则、删除计划、历史数据补偿集中管理。",steps:["「素材库」标签:按账号/关键词搜索已入库的商品素材,供批量任务取用。","「筛选规则」标签:定义商品筛选条件(标题、分类、价格区间),命中规则的素材进入处理流程。","「删除计划」标签:创建批量下架任务,按计划时间或条件执行删除。","「补偿任务」标签:对漏统计的历史数据发起回补;「刷新数据」同步最新任务状态。"],tips:["删除计划执行前请核对规则,批量下架不可自动撤销。"]},notifications:{title:"通知与日志",intro:"统一管理外部通知渠道、账号绑定、风控事件和系统运行日志。",steps:["「通知渠道」标签:点「新建渠道」创建发送通道——邮件渠道只需填接收邮箱(SMTP 自动复用系统设置)。","「账号通知」标签:新建规则时选择账号 + 渠道,并在「事件」里勾选要提醒的类型(价格监控、登录异常等)。","「风控日志」「系统日志」标签:查看平台风控事件与系统运行记录,便于排查问题。","顶部「刷新配置」可重新加载渠道与规则的最新状态。"],tips:["价格监控要发通知:渠道 + 账号通知规则 + 事件勾选「价格监控」三者缺一不可。","渠道里的密钥仅用于服务端发送,不要截图外发。"]},settings:{title:"系统设置",intro:"全局配置中心:邮件服务、AI 接口、公告与默认登录信息都在这里。",steps:["「邮件服务」:填 SMTP 服务器/端口/账号/授权码(QQ 邮箱 465 端口自动走 SSL),点「测试发送」验证。","「AI 服务」:配置模型 API 地址、Key 与模型名,供「AI 回复」使用。","「公告管理」:编辑系统顶部展示的公告与版本更新提示。","其余开关(默认登录信息展示、图形验证码等)按需调整,改动即时生效。"],tips:["改完 SMTP 务必点测试发送,收到邮件即配置成功。"]},users:{title:"用户管理",intro:"管理员专用:管理能登录本系统的用户,支持重置密码与启用禁用。",steps:["列表展示全部用户及其登录状态,可按启用/停用控制能否登录。","点「重置密码」为用户设置新密码(只有管理员能操作)。","停用的用户立即无法登录,历史数据保留。"],tips:["建议只给自己与必要协作者开账号,管理员账号保持一个即可。"]},about:{title:"关于本系统",intro:"版本信息、项目主页与联系方式。",steps:["查看当前版本号与更新日志,新版本发布后按提示升级。","页面上有项目开源地址与作者联系方式,问题反馈优先走这里。"]}},x=()=>{const[n,o]=d.useState("dashboard");d.useEffect(()=>{const l=new IntersectionObserver(t=>{const s=t.filter(i=>i.isIntersecting).sort((i,a)=>i.boundingClientRect.top-a.boundingClientRect.top);s[0]&&o(s[0].target.id.replace("help-",""))},{rootMargin:"0px 0px -70% 0px",threshold:0});return r.forEach(t=>t.items.forEach(s=>{const i=document.getElementById(`help-${s.id}`);i&&l.observe(i)})),()=>l.disconnect()},[]);const c=l=>{const t=document.getElementById(`help-${l}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),o(l))};return e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6",children:[e.jsx("nav",{id:"help-nav",className:"sticky top-14 lg:top-auto z-10 lg:z-auto lg:w-56 shrink-0",children:e.jsxs("div",{className:"lg:sticky lg:top-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-3 shadow-sm",children:[e.jsx("div",{className:"px-2 pb-2 text-xs font-semibold text-slate-400 uppercase tracking-wider",children:"功能导航"}),e.jsx("div",{className:"flex lg:block gap-2 lg:gap-0 overflow-x-auto lg:overflow-visible",children:r.map(l=>e.jsxs("div",{className:"lg:mb-3 shrink-0",children:[e.jsx("div",{className:"hidden lg:block px-2 pt-1 pb-1 text-[11px] font-medium text-slate-400",children:l.group}),l.items.map(t=>e.jsx("button",{onClick:()=>c(t.id),className:`w-auto lg:w-full text-left whitespace-nowrap px-2.5 py-1.5 rounded-lg text-sm transition-colors ${n===t.id?"bg-amber-500/15 text-amber-600 dark:text-amber-400 font-medium":"text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700/60"}`,children:t.label},t.id))]},l.group))})]})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[e.jsxs("div",{className:"bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-5",children:[e.jsx("h1",{className:"text-xl font-bold text-slate-800 dark:text-slate-100",children:"躺赚鱼 使用说明"}),e.jsx("p",{className:"mt-1.5 text-sm text-slate-500 dark:text-slate-400",children:"每个功能的详细使用教程:左侧菜单点击可跳转定位,右侧为操作步骤与真实界面截图。 建议按「快速开始 → 闲鱼业务 → 消息与自动化」的顺序初次上手。"})]}),r.map(l=>l.items.map(t=>{const s=p[t.id];return s?e.jsxs("section",{id:`help-${t.id}`,className:"bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-5 scroll-mt-32 lg:scroll-mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-5 rounded-full bg-amber-500"}),e.jsx("h2",{className:"text-lg font-semibold text-slate-800 dark:text-slate-100",children:s.title})]}),e.jsx("p",{className:"mt-2 text-sm text-slate-600 dark:text-slate-300",children:s.intro}),e.jsxs("div",{className:"mt-4",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-400 mb-2",children:"操作步骤"}),e.jsx("ol",{className:"space-y-1.5 text-sm text-slate-700 dark:text-slate-300 list-decimal list-inside",children:s.steps.map((i,a)=>e.jsx("li",{className:"leading-relaxed",children:i},a))})]}),s.tips&&s.tips.length>0&&e.jsxs("div",{className:"mt-4 rounded-lg bg-amber-50 dark:bg-amber-500/10 border border-amber-200 dark:border-amber-500/20 px-3.5 py-2.5",children:[e.jsx("div",{className:"text-xs font-semibold text-amber-700 dark:text-amber-400 mb-1",children:"小提示"}),e.jsx("ul",{className:"space-y-1 text-[13px] text-amber-800 dark:text-amber-300 list-disc list-inside",children:s.tips.map((i,a)=>e.jsx("li",{className:"leading-relaxed",children:i},a))})]}),e.jsxs("figure",{className:"mt-4",children:[e.jsx("img",{src:`/static/help/${t.id}.png`,alt:`${s.title} 页面界面截图`,loading:"lazy",className:"w-full rounded-lg border border-slate-200 dark:border-slate-700 shadow-sm"}),e.jsxs("figcaption",{className:"mt-1.5 text-xs text-slate-400",children:["▲ ",s.title," —— 实际界面截图"]})]})]},t.id):null}))]})]})})};export{x as default}; +import{r as d,j as e}from"./index-C6Y7HdB3.js";const r=[{group:"快速开始",items:[{id:"dashboard",label:"系统总览"},{id:"accounts",label:"账号管理"}]},{group:"闲鱼业务",items:[{id:"items",label:"商品与发货"},{id:"resell",label:"一键转卖"},{id:"hotlist",label:"实时热卖榜"},{id:"pricewatch",label:"价格监控"},{id:"orders",label:"订单管理"},{id:"buyer-interaction",label:"买家互动"},{id:"cards",label:"卡密库存"}]},{group:"消息与自动化",items:[{id:"messages",label:"消息中心"},{id:"auto-reply",label:"自动回复"},{id:"ai-reply",label:"AI 回复"},{id:"product-automation",label:"商品自动化"}]},{group:"系统",items:[{id:"notifications",label:"通知与日志"},{id:"settings",label:"系统设置"},{id:"users",label:"用户管理"},{id:"about",label:"关于本系统"}]}],p={dashboard:{title:"系统总览",intro:"登录后的首页,汇总账号、订单、营收和库存数据,一眼判断当前经营状态。",steps:["顶部时间筛选可切换统计周期:今天 / 昨天 / 三天内 / 7天内 / 一个月内 / 自定义。","「有效成交额」与「已到账」两张卡片展示所选周期内的资金数据。","「系统运行中」状态灯表示后端自动回复、定时任务正常运行。","左侧菜单点击任意功能即可切换页面,右上角可切换日间/夜间模式。"],tips:["新部署时没有订单记录,金额显示 ¥0.00 属正常,产生交易后自动累计。"]},accounts:{title:"账号管理",intro:"所有功能的入口:先把闲鱼账号接入系统,其他页面才能选择该账号操作。",steps:["点击「添加账号」,填入账号备注名与 Cookie(从浏览器登录闲鱼后在开发者工具 Network 里复制)。","保存后列表会显示该账号,可点击「检测」验证 Cookie 是否仍然有效。","失效的账号需要重新复制 Cookie 更新;不用的账号可「禁用」而不必删除。","启用状态的账号才会参与自动回复、订单同步、消息聚合等自动化。"],tips:["Cookie 等同账号登录态,请勿泄露;本系统只保存在自己的服务器数据库中。"]},items:{title:"商品与发货",intro:"同步闲鱼在售商品,为每个商品配置自动发货内容(卡密、网盘链接或文字说明)。",steps:["选择账号后点击同步,把该账号在闲鱼的在售商品拉取到列表。","给商品设置发货内容:虚拟商品可填卡密说明或网盘链接,实物商品可填物流备注。","买家付款后系统按这里配置的内容自动回复发货,无需手动复制粘贴。","商品价格、标题变化可通过刷新按钮同步最新状态。"],tips:["发货内容支持多行文本与链接,建议按「商品名称 + 提取码」格式写清楚。"]},resell:{title:"一键转卖",intro:"从收藏或搜索结果里挑商品,改好标题价格直接发布到自己账号,做无货源转卖。",steps:["右上角先选择要发布到的闲鱼账号。","点「我的收藏」→「加载收藏」读取该账号收藏的在售商品;或切到「搜索商品」按关键词找货。","在列表中勾选想转卖的商品,修改标题、价格、描述等发布信息。","点「一键转卖」发布,商品即挂到自己账号名下。"],tips:["发布前核对价格是否留足利润;同名商品重复转卖前先在商品列表确认未上架过。"]},hotlist:{title:"实时热卖榜",intro:"抓取闲鱼实时热卖数据,帮你判断什么好卖、该上什么货。",steps:["选择分类或直接查看综合热卖榜,列表按近期成交热度排序。","点击商品可查看详情与价格区间,作为自己定价的参考。","看中的品可直接跳「一键转卖」上架到自己账号。"],tips:["榜单数据为实时抓取,个别时段可能延迟,可点刷新重新拉取。"]},pricewatch:{title:"价格监控",intro:"设定关键词和目标价,系统定时搜索闲鱼,出现低于目标价的商品立即通知你捡漏。",steps:["点「新建规则」:填写关键词(如想蹲的商品名)、目标价、检测间隔,保存后立即执行一次检测。","检测结果展示匹配商品数、历史最低价与「最近一次」的完整商品信息(超长内容自动换行展示)。","低于目标价时触发通知——前提是已在「通知与日志」页配置好通知渠道并勾选「价格监控」事件(见下方章节)。","点「历史记录」查看每次检测的明细;不需要的规则可停用或删除。"],tips:["通知没发出来时,页面顶部的红色提示会写明去哪配置,按提示到「通知与日志」页补配即可。","关键词越具体匹配越准,避免太宽泛导致噪音过多。"]},orders:{title:"订单管理",intro:"汇总所选账号的闲鱼订单,查看状态、手动补发与核对发货记录。",steps:["选择账号与时间范围筛选订单,列表显示买家、商品、金额与状态。","自动发货成功的订单会标记发货内容;失败的可在这里点「重新发货」补发。","点订单行可展开详情,核对买家留言与发货回执。"],tips:["订单数据来自定时同步,新成交订单可能延迟几分钟出现。"]},"buyer-interaction":{title:"买家互动",intro:"评价买家、索要小红花与自动收花——和闲鱼平台实际操作绑定,需按账号开启。",steps:["先在「账号管理」添加账号(无账号时本页会提示先去添加)。","在「按账号开启」区域为需要的账号打开对应开关:评价买家 / 索要小红花 / 自动收花。","点「保存设置」生效;关闭的账号不会执行任何互动,订单页也不显示入口。","建议先用一笔测试订单验证效果,再放开到全部账号。"],tips:["⚠ 评价提交后无法撤销,索要小红花会给买家发一条消息——务必先小范围测试。"]},cards:{title:"卡密库存",intro:"导入与管理卡密,配合「商品与发货」实现虚拟商品自动发货、库存自动扣减。",steps:["新建卡密分组(对应某个商品),批量粘贴或上传卡密文本,一行一条。","在「商品与发货」把商品的发货方式关联到该卡密分组。","买家付款后系统自动取一条卡密发出并扣减库存,列表显示剩余数量。","库存告急时及时补充,发货失败的订单会记录原因便于排查。"],tips:["卡密只对管理员可见,普通用户页面不会展示明文。"]},messages:{title:"消息中心",intro:"把多个闲鱼账号的买家消息聚合到一处,集中查看与回复。",steps:["选择账号后加载未读/全部消息,按时间倒序展示。","点击会话查看上下文并可手动回复;已被自动回复接管的会话会标注规则来源。","新消息会实时提醒,避免漏掉买家咨询。"],tips:["消息聚合依赖账号 Cookie 有效,账号失效时先到「账号管理」更新。"]},"auto-reply":{title:"自动回复",intro:"配置关键词规则:买家消息命中触发词即自动回复,7×24 接待。",steps:["点「新建规则」,设置触发关键词(支持多个、精确/模糊匹配)与回复内容。","回复支持多行文本、链接与随机话术(多条回复轮流发送,避免重复感)。","保存即生效,无需重启;列表可停用、编辑、删除规则。","在规则上可指定仅对某账号生效,或全局所有账号共用。"],tips:["建议先配 3-5 条高频问题(价格、包邮、发货时间)再逐步扩充。"]},"ai-reply":{title:"AI 回复",intro:"接入大模型 API,让 AI 根据上下文智能回复买家消息、自动议价。",steps:["先到「系统设置 → AI 服务」填好 API 地址、Key 与模型名(本地 NewAPI 或任意兼容接口)。","在本页设置议价策略:最大优惠百分比/金额、议价轮数上限。","开启「上下文」后 AI 会携带最近若干条对话,回复更连贯。","系统先匹配关键词规则,未命中才走 AI;可在页面调整两者的优先级。"],tips:["AI 每次回复消耗 API 额度,量大时建议设置轮数与优惠上限兜底。"]},"product-automation":{title:"商品自动化",intro:"商品素材库与批量任务:筛选规则、删除计划、历史数据补偿集中管理。",steps:["「素材库」标签:按账号/关键词搜索已入库的商品素材,供批量任务取用。","「筛选规则」标签:定义商品筛选条件(标题、分类、价格区间),命中规则的素材进入处理流程。","「删除计划」标签:创建批量下架任务,按计划时间或条件执行删除。","「补偿任务」标签:对漏统计的历史数据发起回补;「刷新数据」同步最新任务状态。"],tips:["删除计划执行前请核对规则,批量下架不可自动撤销。"]},notifications:{title:"通知与日志",intro:"统一管理外部通知渠道、账号绑定、风控事件和系统运行日志。",steps:["「通知渠道」标签:点「新建渠道」创建发送通道——邮件渠道只需填接收邮箱(SMTP 自动复用系统设置)。","「账号通知」标签:新建规则时选择账号 + 渠道,并在「事件」里勾选要提醒的类型(价格监控、登录异常等)。","「风控日志」「系统日志」标签:查看平台风控事件与系统运行记录,便于排查问题。","顶部「刷新配置」可重新加载渠道与规则的最新状态。"],tips:["价格监控要发通知:渠道 + 账号通知规则 + 事件勾选「价格监控」三者缺一不可。","渠道里的密钥仅用于服务端发送,不要截图外发。"]},settings:{title:"系统设置",intro:"全局配置中心:邮件服务、AI 接口、公告与默认登录信息都在这里。",steps:["「邮件服务」:填 SMTP 服务器/端口/账号/授权码(QQ 邮箱 465 端口自动走 SSL),点「测试发送」验证。","「AI 服务」:配置模型 API 地址、Key 与模型名,供「AI 回复」使用。","「公告管理」:编辑系统顶部展示的公告与版本更新提示。","其余开关(默认登录信息展示、图形验证码等)按需调整,改动即时生效。"],tips:["改完 SMTP 务必点测试发送,收到邮件即配置成功。"]},users:{title:"用户管理",intro:"管理员专用:管理能登录本系统的用户,支持重置密码与启用禁用。",steps:["列表展示全部用户及其登录状态,可按启用/停用控制能否登录。","点「重置密码」为用户设置新密码(只有管理员能操作)。","停用的用户立即无法登录,历史数据保留。"],tips:["建议只给自己与必要协作者开账号,管理员账号保持一个即可。"]},about:{title:"关于本系统",intro:"版本信息、项目主页与联系方式。",steps:["查看当前版本号与更新日志,新版本发布后按提示升级。","页面上有项目开源地址与作者联系方式,问题反馈优先走这里。"]}},x=()=>{const[n,o]=d.useState("dashboard");d.useEffect(()=>{const l=new IntersectionObserver(t=>{const s=t.filter(i=>i.isIntersecting).sort((i,a)=>i.boundingClientRect.top-a.boundingClientRect.top);s[0]&&o(s[0].target.id.replace("help-",""))},{rootMargin:"0px 0px -70% 0px",threshold:0});return r.forEach(t=>t.items.forEach(s=>{const i=document.getElementById(`help-${s.id}`);i&&l.observe(i)})),()=>l.disconnect()},[]);const c=l=>{const t=document.getElementById(`help-${l}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),o(l))};return e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6",children:[e.jsx("nav",{id:"help-nav",className:"sticky top-14 lg:top-auto z-10 lg:z-auto lg:w-56 shrink-0",children:e.jsxs("div",{className:"lg:sticky lg:top-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-3 shadow-sm",children:[e.jsx("div",{className:"px-2 pb-2 text-xs font-semibold text-slate-400 uppercase tracking-wider",children:"功能导航"}),e.jsx("div",{className:"flex lg:block gap-2 lg:gap-0 overflow-x-auto lg:overflow-visible",children:r.map(l=>e.jsxs("div",{className:"lg:mb-3 shrink-0",children:[e.jsx("div",{className:"hidden lg:block px-2 pt-1 pb-1 text-[11px] font-medium text-slate-400",children:l.group}),l.items.map(t=>e.jsx("button",{onClick:()=>c(t.id),className:`w-auto lg:w-full text-left whitespace-nowrap px-2.5 py-1.5 rounded-lg text-sm transition-colors ${n===t.id?"bg-amber-500/15 text-amber-600 dark:text-amber-400 font-medium":"text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700/60"}`,children:t.label},t.id))]},l.group))})]})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[e.jsxs("div",{className:"bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-5",children:[e.jsx("h1",{className:"text-xl font-bold text-slate-800 dark:text-slate-100",children:"躺赚鱼 使用说明"}),e.jsx("p",{className:"mt-1.5 text-sm text-slate-500 dark:text-slate-400",children:"每个功能的详细使用教程:左侧菜单点击可跳转定位,右侧为操作步骤与真实界面截图。 建议按「快速开始 → 闲鱼业务 → 消息与自动化」的顺序初次上手。"})]}),r.map(l=>l.items.map(t=>{const s=p[t.id];return s?e.jsxs("section",{id:`help-${t.id}`,className:"bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-5 scroll-mt-32 lg:scroll-mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-5 rounded-full bg-amber-500"}),e.jsx("h2",{className:"text-lg font-semibold text-slate-800 dark:text-slate-100",children:s.title})]}),e.jsx("p",{className:"mt-2 text-sm text-slate-600 dark:text-slate-300",children:s.intro}),e.jsxs("div",{className:"mt-4",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-400 mb-2",children:"操作步骤"}),e.jsx("ol",{className:"space-y-1.5 text-sm text-slate-700 dark:text-slate-300 list-decimal list-inside",children:s.steps.map((i,a)=>e.jsx("li",{className:"leading-relaxed",children:i},a))})]}),s.tips&&s.tips.length>0&&e.jsxs("div",{className:"mt-4 rounded-lg bg-amber-50 dark:bg-amber-500/10 border border-amber-200 dark:border-amber-500/20 px-3.5 py-2.5",children:[e.jsx("div",{className:"text-xs font-semibold text-amber-700 dark:text-amber-400 mb-1",children:"小提示"}),e.jsx("ul",{className:"space-y-1 text-[13px] text-amber-800 dark:text-amber-300 list-disc list-inside",children:s.tips.map((i,a)=>e.jsx("li",{className:"leading-relaxed",children:i},a))})]}),e.jsxs("figure",{className:"mt-4",children:[e.jsx("img",{src:`/static/help/${t.id}.png`,alt:`${s.title} 页面界面截图`,loading:"lazy",className:"w-full rounded-lg border border-slate-200 dark:border-slate-700 shadow-sm"}),e.jsxs("figcaption",{className:"mt-1.5 text-xs text-slate-400",children:["▲ ",s.title," —— 实际界面截图"]})]})]},t.id):null}))]})]})})};export{x as default}; diff --git a/static/assets/HotList-BwqIdE0Z.js b/static/assets/HotList-DMnVJNpG.js similarity index 98% rename from static/assets/HotList-BwqIdE0Z.js rename to static/assets/HotList-DMnVJNpG.js index def820f..a199083 100644 --- a/static/assets/HotList-BwqIdE0Z.js +++ b/static/assets/HotList-DMnVJNpG.js @@ -1 +1 @@ -import{r as n,bO as H,bP as O,j as e,bQ as S,L as y,e as A,E as B}from"./index-IChzZLcq.js";import{P as F,a as U,N as q,b as z,E as Q}from"./ui-DHCIdv_V.js";import{T as R}from"./trending-up-BDgJo2q2.js";import{P as V}from"./package-3qqwOYvH.js";const W=2500,L=r=>r?r>=1e4?`${(r/1e4).toFixed(1).replace(/\.0$/,"")}万`:String(r):"0",Y=r=>{if(!r)return"—";const i=Date.now()-r;if(i<6e4)return"刚刚";if(i<36e5)return`${Math.floor(i/6e4)}分钟前`;if(i<864e5)return`${Math.floor(i/36e5)}小时前`;if(i<7*864e5)return`${Math.floor(i/864e5)}天前`;const o=new Date(r);return`${o.getMonth()+1}月${o.getDate()}日`},G=r=>{if(!r)return"—";const i=new Date(r),o=v=>String(v).padStart(2,"0");return`${i.getFullYear()}-${o(i.getMonth()+1)}-${o(i.getDate())}`},J=({rank:r})=>{const i=r===1?"bg-amber-400 text-white":r===2?"bg-gray-300 text-gray-700":r===3?"bg-orange-300 text-orange-900":"bg-[var(--surface-subtle)] text-[var(--text-soft)]";return e.jsx("span",{className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-sm font-bold ${i}`,children:r})},se=()=>{const[r,i]=n.useState(!0),[o,v]=n.useState({}),[$,P]=n.useState([]),[d,M]=n.useState("digital"),[j,f]=n.useState(null),[h,_]=n.useState(0),[u,k]=n.useState(!1),g=n.useRef(null),I=n.useRef(d);I.current=d;const w=n.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=null)},[]),b=n.useCallback(async s=>{try{const a=await H();v(a.boards||{}),P(a.categories||[]),s!=null&&s.silent||i(!1),Object.values(a.boards||{}).some(x=>x.refreshing)?E():w()}catch(a){s!=null&&s.silent||(i(!1),f({type:"error",message:a.message||"榜单加载失败"}))}},[]),E=n.useCallback(()=>{g.current||(g.current=setInterval(()=>{b({silent:!0})},W))},[b]);n.useEffect(()=>(b(),w),[b,w]),n.useEffect(()=>{if(h<=0)return;const s=setInterval(()=>_(a=>a<=1?0:a-1),1e3);return()=>clearInterval(s)},[h]);const t=o[d];n.useEffect(()=>{const s=o[d];!s||r||s.refreshing||s.items.length>0||s.cooldown_remaining>0||N(d)},[d,r,o]);const N=async s=>{if(!u){k(!0);try{const a=await O(s);a.started?(f({type:"info",message:a.categories&&a.categories.length>1?"已开始刷新全部类目,完成后自动更新。":"已开始抓取,十几秒后榜单自动刷新。"}),E()):a.reason==="cooldown"?f({type:"error",message:a.message||"刷新过于频繁,请稍后再试"}):f({type:"info",message:a.message||"已有刷新任务进行中"})}catch(a){f({type:"error",message:a.message||"刷新触发失败"})}finally{k(!1)}}};n.useEffect(()=>{t&&t.cooldown_remaining>0&&_(t.cooldown_remaining)},[t]);const T=n.useMemo(()=>$.map(s=>{var a;return{id:s.id,label:s.name,count:(a=o[s.id])==null?void 0:a.items.length}}),[$,o]),C=n.useMemo(()=>{if(!t)return[];const s={};return(t.items||[]).forEach(l=>{(l.keywords||[]).forEach(x=>{const p=s[x]||(s[x]={hits:0,want:0});p.hits+=1,p.want+=l.want_count||0})}),(t.keywords&&t.keywords.length?t.keywords:Object.keys(s)).map(l=>{var x,p;return{kw:l,hits:((x=s[l])==null?void 0:x.hits)||0,want:((p=s[l])==null?void 0:p.want)||0}}).sort((l,x)=>x.want-l.want)},[t]),m=!!(t!=null&&t.refreshing),c=t==null?void 0:t.progress,D=t!=null&&t.updated_at?Y(t.updated_at*1e3):"尚未生成";return r?e.jsx(F,{label:"正在加载热卖榜"}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(U,{title:"实时热卖榜",description:"按「想要人数」排序的全网热卖商品,数据来自闲鱼实时搜索聚合。",icon:S,badge:e.jsx("span",{className:"rounded-full bg-[var(--surface-subtle)] px-2 py-0.5 text-xs text-[var(--text-soft)]",children:t?`更新于 ${D}`:"待生成"}),actions:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",className:"ios-btn-secondary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N("all"),disabled:u||m||h>0,children:[u||m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(A,{className:"h-4 w-4"}),"全部刷新"]}),e.jsxs("button",{type:"button",className:"ios-btn-primary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N(d),disabled:u||m||h>0,children:[m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(R,{className:"h-4 w-4"}),h>0?`${h}s 后可刷新`:"刷新本类目"]})]})}),j&&e.jsx(q,{type:j.type==="info"?"success":j.type,message:j.message,onClose:()=>f(null)}),e.jsx("div",{className:"toolbar",children:e.jsx(z,{value:d,onChange:M,items:T,ariaLabel:"热卖榜类目"})}),m&&e.jsx("div",{className:"section-panel",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm text-[var(--text-soft)]",children:[e.jsx(y,{className:"h-4 w-4 animate-spin text-[#ff4400]"}),e.jsxs("span",{children:["正在抓取「",(c==null?void 0:c.keyword)||"…","」",c&&c.total>0?`(${Math.min(c.done+1,c.total)}/${c.total})`:""]}),c&&c.total>0&&e.jsx("span",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-subtle)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[#ff4400] transition-all",style:{width:`${Math.round(c.done/c.total*100)}%`}})})]})}),!t||t.items.length===0?e.jsx(Q,{icon:S,title:m?"正在生成榜单":"榜单还没生成",description:m?"首次抓取需要十几个关键词、约 20 秒,完成后自动展示。":"点右上角「刷新本类目」开始抓取,按想要人数排出前 30 名。",action:m?void 0:e.jsx("button",{type:"button",className:"ios-btn-primary rounded-md px-4 py-2 text-sm",onClick:()=>void N(d),disabled:u||h>0,children:"生成榜单"})}):e.jsxs("section",{className:"section-panel",children:[e.jsx("div",{className:"section-panel__header",children:e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:"section-header__icon","aria-hidden":"true",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"section-title",children:[t.name,"热卖榜 · Top ",t.items.length]}),e.jsxs("p",{className:"section-description",children:["共 ",t.source_count," 个在售商品参与排序,按「想要人数」取前 ",t.items.length," 名"]}),C.length>0&&e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-[var(--text-soft)]",children:"热门搜索词:"}),C.map(({kw:s,hits:a,want:l})=>e.jsxs("a",{href:`https://www.goofish.com/search?q=${encodeURIComponent(s)}`,target:"_blank",rel:"noreferrer noopener",title:a>0?`点击搜索「${s}」· 命中 ${a} 个商品 · 合计 ${l} 人想要`:`点击搜索「${s}」(本轮未命中商品)`,className:"group inline-flex items-center gap-1 rounded-full bg-[var(--surface-subtle)] px-2 py-0.5 text-xs text-[var(--text)] transition-colors hover:bg-[#ff4400] hover:text-white",children:[e.jsx("span",{children:s}),a>0&&e.jsx("span",{className:"font-medium text-[#ff4400] group-hover:text-white",children:L(l)})]},s))]})]})]})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"data-table responsive-data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"w-[6%]",children:"排名"}),e.jsx("th",{className:"w-[44%]",children:"商品"}),e.jsx("th",{className:"w-[11%]",children:"价格"}),e.jsx("th",{className:"w-[12%]",children:"想要人数"}),e.jsx("th",{className:"w-[12%]",children:"发布时间"}),e.jsx("th",{className:"w-[15%] text-right",children:"操作"})]})}),e.jsx("tbody",{children:t.items.map(s=>{var a;return e.jsxs("tr",{children:[e.jsx("td",{"data-label":"排名",children:e.jsx(J,{rank:s.rank})}),e.jsx("td",{"data-label":"商品",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"h-12 w-12 shrink-0 overflow-hidden rounded-lg bg-[var(--surface-subtle)]",children:s.image?e.jsx("img",{src:s.image,alt:"",loading:"lazy",className:"h-full w-full object-cover",onError:l=>{l.currentTarget.style.display="none"}}):e.jsx("div",{className:"flex h-full items-center justify-center text-gray-400",children:e.jsx(V,{className:"h-5 w-5"})})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer noopener",className:"block text-sm text-[var(--text)] break-words hover:text-[#ff4400] hover:underline",title:s.title,children:s.title||"(无标题)"}),e.jsxs("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-[var(--text-soft)]",children:[s.area&&e.jsx("span",{children:s.area}),(a=s.keywords)==null?void 0:a.slice(0,3).map(l=>e.jsx("span",{className:"rounded bg-[var(--surface-subtle)] px-1.5 py-0.5",children:l},l))]})]})]})}),e.jsx("td",{"data-label":"价格",children:e.jsx("span",{className:"font-bold text-[#ff4400]",children:s.price||"面议"})}),e.jsxs("td",{"data-label":"想要人数",children:[e.jsx("span",{className:"font-semibold text-[var(--text)]",children:L(s.want_count)}),e.jsx("span",{className:"ml-1 text-xs text-[var(--text-soft)]",children:"人想要"})]}),e.jsx("td",{"data-label":"发布时间",className:"whitespace-nowrap text-sm text-[var(--text-soft)]",children:G(s.publish_time)}),e.jsx("td",{"data-label":"操作",className:"text-right",children:e.jsxs("a",{href:s.url,target:"_blank",rel:"noreferrer noopener",className:"ios-btn-secondary inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm",children:[e.jsx(B,{className:"h-3.5 w-3.5"}),"查看商品"]})})]},s.item_id)})})]})}),e.jsx("p",{className:"px-4 py-3 text-xs text-[var(--text-soft)]",children:"口径说明:闲鱼不公开销量数据,本榜按商品「想要人数」降序排列,同分按发布时间取新; 数据为实时搜索快照,每 10 分钟可刷新一次。"})]})]})};export{se as default}; +import{r as n,bO as H,bP as O,j as e,bQ as S,L as y,e as A,E as B}from"./index-C6Y7HdB3.js";import{P as F,a as U,N as q,b as z,E as Q}from"./ui-Dh615-z8.js";import{T as R}from"./trending-up-BR0vQ8dC.js";import{P as V}from"./package-DjIVaNpE.js";const W=2500,L=r=>r?r>=1e4?`${(r/1e4).toFixed(1).replace(/\.0$/,"")}万`:String(r):"0",Y=r=>{if(!r)return"—";const i=Date.now()-r;if(i<6e4)return"刚刚";if(i<36e5)return`${Math.floor(i/6e4)}分钟前`;if(i<864e5)return`${Math.floor(i/36e5)}小时前`;if(i<7*864e5)return`${Math.floor(i/864e5)}天前`;const o=new Date(r);return`${o.getMonth()+1}月${o.getDate()}日`},G=r=>{if(!r)return"—";const i=new Date(r),o=v=>String(v).padStart(2,"0");return`${i.getFullYear()}-${o(i.getMonth()+1)}-${o(i.getDate())}`},J=({rank:r})=>{const i=r===1?"bg-amber-400 text-white":r===2?"bg-gray-300 text-gray-700":r===3?"bg-orange-300 text-orange-900":"bg-[var(--surface-subtle)] text-[var(--text-soft)]";return e.jsx("span",{className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-sm font-bold ${i}`,children:r})},se=()=>{const[r,i]=n.useState(!0),[o,v]=n.useState({}),[$,P]=n.useState([]),[d,M]=n.useState("digital"),[j,f]=n.useState(null),[h,_]=n.useState(0),[u,k]=n.useState(!1),g=n.useRef(null),I=n.useRef(d);I.current=d;const w=n.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=null)},[]),b=n.useCallback(async s=>{try{const a=await H();v(a.boards||{}),P(a.categories||[]),s!=null&&s.silent||i(!1),Object.values(a.boards||{}).some(x=>x.refreshing)?E():w()}catch(a){s!=null&&s.silent||(i(!1),f({type:"error",message:a.message||"榜单加载失败"}))}},[]),E=n.useCallback(()=>{g.current||(g.current=setInterval(()=>{b({silent:!0})},W))},[b]);n.useEffect(()=>(b(),w),[b,w]),n.useEffect(()=>{if(h<=0)return;const s=setInterval(()=>_(a=>a<=1?0:a-1),1e3);return()=>clearInterval(s)},[h]);const t=o[d];n.useEffect(()=>{const s=o[d];!s||r||s.refreshing||s.items.length>0||s.cooldown_remaining>0||N(d)},[d,r,o]);const N=async s=>{if(!u){k(!0);try{const a=await O(s);a.started?(f({type:"info",message:a.categories&&a.categories.length>1?"已开始刷新全部类目,完成后自动更新。":"已开始抓取,十几秒后榜单自动刷新。"}),E()):a.reason==="cooldown"?f({type:"error",message:a.message||"刷新过于频繁,请稍后再试"}):f({type:"info",message:a.message||"已有刷新任务进行中"})}catch(a){f({type:"error",message:a.message||"刷新触发失败"})}finally{k(!1)}}};n.useEffect(()=>{t&&t.cooldown_remaining>0&&_(t.cooldown_remaining)},[t]);const T=n.useMemo(()=>$.map(s=>{var a;return{id:s.id,label:s.name,count:(a=o[s.id])==null?void 0:a.items.length}}),[$,o]),C=n.useMemo(()=>{if(!t)return[];const s={};return(t.items||[]).forEach(l=>{(l.keywords||[]).forEach(x=>{const p=s[x]||(s[x]={hits:0,want:0});p.hits+=1,p.want+=l.want_count||0})}),(t.keywords&&t.keywords.length?t.keywords:Object.keys(s)).map(l=>{var x,p;return{kw:l,hits:((x=s[l])==null?void 0:x.hits)||0,want:((p=s[l])==null?void 0:p.want)||0}}).sort((l,x)=>x.want-l.want)},[t]),m=!!(t!=null&&t.refreshing),c=t==null?void 0:t.progress,D=t!=null&&t.updated_at?Y(t.updated_at*1e3):"尚未生成";return r?e.jsx(F,{label:"正在加载热卖榜"}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(U,{title:"实时热卖榜",description:"按「想要人数」排序的全网热卖商品,数据来自闲鱼实时搜索聚合。",icon:S,badge:e.jsx("span",{className:"rounded-full bg-[var(--surface-subtle)] px-2 py-0.5 text-xs text-[var(--text-soft)]",children:t?`更新于 ${D}`:"待生成"}),actions:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",className:"ios-btn-secondary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N("all"),disabled:u||m||h>0,children:[u||m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(A,{className:"h-4 w-4"}),"全部刷新"]}),e.jsxs("button",{type:"button",className:"ios-btn-primary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N(d),disabled:u||m||h>0,children:[m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(R,{className:"h-4 w-4"}),h>0?`${h}s 后可刷新`:"刷新本类目"]})]})}),j&&e.jsx(q,{type:j.type==="info"?"success":j.type,message:j.message,onClose:()=>f(null)}),e.jsx("div",{className:"toolbar",children:e.jsx(z,{value:d,onChange:M,items:T,ariaLabel:"热卖榜类目"})}),m&&e.jsx("div",{className:"section-panel",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm text-[var(--text-soft)]",children:[e.jsx(y,{className:"h-4 w-4 animate-spin text-[#ff4400]"}),e.jsxs("span",{children:["正在抓取「",(c==null?void 0:c.keyword)||"…","」",c&&c.total>0?`(${Math.min(c.done+1,c.total)}/${c.total})`:""]}),c&&c.total>0&&e.jsx("span",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-subtle)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[#ff4400] transition-all",style:{width:`${Math.round(c.done/c.total*100)}%`}})})]})}),!t||t.items.length===0?e.jsx(Q,{icon:S,title:m?"正在生成榜单":"榜单还没生成",description:m?"首次抓取需要十几个关键词、约 20 秒,完成后自动展示。":"点右上角「刷新本类目」开始抓取,按想要人数排出前 30 名。",action:m?void 0:e.jsx("button",{type:"button",className:"ios-btn-primary rounded-md px-4 py-2 text-sm",onClick:()=>void N(d),disabled:u||h>0,children:"生成榜单"})}):e.jsxs("section",{className:"section-panel",children:[e.jsx("div",{className:"section-panel__header",children:e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:"section-header__icon","aria-hidden":"true",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"section-title",children:[t.name,"热卖榜 · Top ",t.items.length]}),e.jsxs("p",{className:"section-description",children:["共 ",t.source_count," 个在售商品参与排序,按「想要人数」取前 ",t.items.length," 名"]}),C.length>0&&e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-[var(--text-soft)]",children:"热门搜索词:"}),C.map(({kw:s,hits:a,want:l})=>e.jsxs("a",{href:`https://www.goofish.com/search?q=${encodeURIComponent(s)}`,target:"_blank",rel:"noreferrer noopener",title:a>0?`点击搜索「${s}」· 命中 ${a} 个商品 · 合计 ${l} 人想要`:`点击搜索「${s}」(本轮未命中商品)`,className:"group inline-flex items-center gap-1 rounded-full bg-[var(--surface-subtle)] px-2 py-0.5 text-xs text-[var(--text)] transition-colors hover:bg-[#ff4400] hover:text-white",children:[e.jsx("span",{children:s}),a>0&&e.jsx("span",{className:"font-medium text-[#ff4400] group-hover:text-white",children:L(l)})]},s))]})]})]})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"data-table responsive-data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"w-[6%]",children:"排名"}),e.jsx("th",{className:"w-[44%]",children:"商品"}),e.jsx("th",{className:"w-[11%]",children:"价格"}),e.jsx("th",{className:"w-[12%]",children:"想要人数"}),e.jsx("th",{className:"w-[12%]",children:"发布时间"}),e.jsx("th",{className:"w-[15%] text-right",children:"操作"})]})}),e.jsx("tbody",{children:t.items.map(s=>{var a;return e.jsxs("tr",{children:[e.jsx("td",{"data-label":"排名",children:e.jsx(J,{rank:s.rank})}),e.jsx("td",{"data-label":"商品",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"h-12 w-12 shrink-0 overflow-hidden rounded-lg bg-[var(--surface-subtle)]",children:s.image?e.jsx("img",{src:s.image,alt:"",loading:"lazy",className:"h-full w-full object-cover",onError:l=>{l.currentTarget.style.display="none"}}):e.jsx("div",{className:"flex h-full items-center justify-center text-gray-400",children:e.jsx(V,{className:"h-5 w-5"})})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer noopener",className:"block text-sm text-[var(--text)] break-words hover:text-[#ff4400] hover:underline",title:s.title,children:s.title||"(无标题)"}),e.jsxs("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-[var(--text-soft)]",children:[s.area&&e.jsx("span",{children:s.area}),(a=s.keywords)==null?void 0:a.slice(0,3).map(l=>e.jsx("span",{className:"rounded bg-[var(--surface-subtle)] px-1.5 py-0.5",children:l},l))]})]})]})}),e.jsx("td",{"data-label":"价格",children:e.jsx("span",{className:"font-bold text-[#ff4400]",children:s.price||"面议"})}),e.jsxs("td",{"data-label":"想要人数",children:[e.jsx("span",{className:"font-semibold text-[var(--text)]",children:L(s.want_count)}),e.jsx("span",{className:"ml-1 text-xs text-[var(--text-soft)]",children:"人想要"})]}),e.jsx("td",{"data-label":"发布时间",className:"whitespace-nowrap text-sm text-[var(--text-soft)]",children:G(s.publish_time)}),e.jsx("td",{"data-label":"操作",className:"text-right",children:e.jsxs("a",{href:s.url,target:"_blank",rel:"noreferrer noopener",className:"ios-btn-secondary inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm",children:[e.jsx(B,{className:"h-3.5 w-3.5"}),"查看商品"]})})]},s.item_id)})})]})}),e.jsx("p",{className:"px-4 py-3 text-xs text-[var(--text-soft)]",children:"口径说明:闲鱼不公开销量数据,本榜按商品「想要人数」降序排列,同分按发布时间取新; 数据为实时搜索快照,每 10 分钟可刷新一次。"})]})]})};export{se as default}; diff --git a/static/assets/ItemList-DpqEi6Ob.js b/static/assets/ItemList-DpqEi6Ob.js deleted file mode 100644 index 9dfcc58..0000000 --- a/static/assets/ItemList-DpqEi6Ob.js +++ /dev/null @@ -1,16 +0,0 @@ -import{c as Se,r,ae as ws,af as Ke,n as w,j as e,e as Ce,X as ie,L as G,ag as ks,ah as Ss,ai as Cs,v as ye,aj as Is,ak as qe,b as xe,al as ve,am as we,an as $s,ao as Ms,ap as Ds,aq as ss,ar as Oe,o as Ve,h as _e,a8 as He,as as Xe,at as Ne,w as Fs,au as Ps,av as Ge,aw as Qe,ax as Es,ay as Bs,az as Rs,aA as Ls}from"./index-IChzZLcq.js";import{E as ne,S as ke,P as We,a as Ts,b as zs,N as Us}from"./ui-DHCIdv_V.js";import{S as pe}from"./shield-alert-ob02IPrt.js";import{S as he}from"./save-m64KWfbE.js";import{T as ge}from"./trash-2-CnOVC8WZ.js";import{P as ue}from"./plus-hTzuza9d.js";import{P as Ks}from"./power-off-D8Ea3WwY.js";import{a as qs,P as Os}from"./power-ZOn3B5wN.js";import{P as ts}from"./package-check-FQzJ-066.js";import{S as Je}from"./sparkles-B5X13VUJ.js";import{S as Vs}from"./settings-2-B-NwJM90.js";import{S as Hs}from"./square-pen-BOlWgFhh.js";/** - * @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 Xs=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Gs=Se("list-checks",Xs);/** - * @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 Qs=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],Ye=Se("scan-line",Qs);/** - * @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 Ws=[["path",{d:"M2 21a8 8 0 0 1 11.873-7",key:"74fkxq"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m17 17 5 5",key:"p7ous7"}],["path",{d:"m22 17-5 5",key:"gqnmv0"}]],Ze=Se("user-round-x",Ws),Js=({accounts:o=[],items:u=[],selectedAccount:x="",onSelectedAccountChange:_})=>{const[k,S]=r.useState([]),[T,y]=r.useState([]),[C,M]=r.useState(!1),[D,E]=r.useState(""),[g,m]=r.useState({scope:"account",buyer_id:"",buyer_nick:"",item_id:"",reason:""}),h=r.useMemo(()=>u.filter(t=>t.cookie_id===x),[u,x]);r.useEffect(()=>{x&&F()},[x]);const F=async()=>{if(x){M(!0);try{const[t,a]=await Promise.all([ws(x),Ke(x)]);S(t),y(a)}catch(t){w(`加载发货保护配置失败:${t.message}`)}finally{M(!1)}}},N=(t,a)=>{S(c=>c.map(f=>f.rule_code===t?{...f,...a,only_card_after_close:a.auto_close_order===!1?!1:a.only_card_after_close??f.only_card_after_close}:f))},q=async t=>{E(t.rule_code);try{const a=await ks(x,t.rule_code,{enabled:t.enabled,priority:t.priority,block_reason:t.block_reason,auto_close_order:t.auto_close_order,only_card_after_close:t.only_card_after_close,excluded_item_ids:t.excluded_item_ids,config:t.config});N(t.rule_code,a),w(`“${t.rule_name}”已保存`)}catch(a){w(`保存失败:${a.message}`)}finally{E("")}},Q=async()=>{if(!g.buyer_id.trim()){w("请输入买家 ID");return}if(g.scope==="item"&&!g.item_id){w("请选择黑名单生效的商品");return}try{await Ss({account_id:g.scope==="global"?void 0:x,buyer_id:g.buyer_id.trim(),buyer_nick:g.buyer_nick.trim(),item_id:g.scope==="item"?g.item_id:void 0,reason:g.reason.trim(),is_enabled:!0}),m({scope:g.scope,buyer_id:"",buyer_nick:"",item_id:"",reason:""}),y(await Ke(x))}catch(t){w(`添加失败:${t.message}`)}},O=async t=>{try{const a=await Cs(t.id,{is_enabled:!t.is_enabled});y(c=>c.map(f=>f.id===t.id?a:f))}catch(a){w(`更新失败:${a.message}`)}},W=async t=>{if(await ye(`确认移除买家 ${t.buyer_nick||t.buyer_id}?`))try{await Is(t.id),y(a=>a.filter(c=>c.id!==t.id))}catch(a){w(`删除失败:${a.message}`)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"toolbar",children:[e.jsxs("div",{className:"toolbar__group w-full sm:w-auto",children:[e.jsx("label",{htmlFor:"protection-account",className:"text-xs font-bold text-gray-600",children:"应用账号"}),e.jsxs("select",{id:"protection-account",value:x,onChange:t=>_==null?void 0:_(t.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm sm:min-w-72",children:[e.jsx("option",{value:"",children:"请选择账号"}),o.map(t=>e.jsx("option",{value:t.id,children:t.nickname||t.remark||t.id},t.id))]})]}),e.jsxs("button",{type:"button",onClick:()=>void F(),disabled:!x||C,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[e.jsx(Ce,{className:`h-4 w-4 ${C?"animate-spin":""}`}),"刷新"]})]}),x?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(ke,{title:"发货拦截规则",description:"规则按优先级判定,可对指定商品设置排除项。",icon:pe}),e.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[k.map(t=>e.jsxs("div",{className:"grid gap-4 py-5 xl:grid-cols-[minmax(230px,1fr)_minmax(360px,1.5fr)_44px] xl:items-start",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",role:"switch","aria-checked":t.enabled,onClick:()=>N(t.rule_code,{enabled:!t.enabled}),className:`relative h-6 w-11 rounded-full transition-colors ${t.enabled?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${t.enabled?"translate-x-5":"translate-x-0"}`})}),e.jsx("span",{className:"font-bold text-gray-900",children:t.rule_name})]}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:t.rule_description})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-[100px_1fr]",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["优先级",e.jsx("input",{type:"number",min:0,max:999,value:t.priority,onChange:a=>N(t.rule_code,{priority:Number(a.target.value)}),className:"mt-1 w-full rounded-md border border-gray-200 px-2 py-2 text-sm"})]}),e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["命中后发送给买家的提示",e.jsx("input",{value:t.block_reason,onChange:a=>N(t.rule_code,{block_reason:a.target.value}),placeholder:"留空则只停止发货",className:"mt-1 w-full rounded-md border border-gray-200 px-3 py-2 text-sm font-normal"})]}),e.jsxs("div",{className:"rounded-md border border-gray-200 bg-gray-50 p-3 sm:col-span-2",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["命中后处理",e.jsxs("span",{className:"mt-2 flex items-center gap-2 font-medium text-gray-700",children:[e.jsx("input",{type:"checkbox",checked:t.auto_close_order,onChange:a=>N(t.rule_code,{auto_close_order:a.target.checked,only_card_after_close:a.target.checked?t.only_card_after_close:!1}),className:"h-4 w-4 rounded border-gray-300 text-amber-600"}),"主动关闭闲鱼订单"]})]}),e.jsxs("label",{className:`text-xs font-bold ${t.auto_close_order?"text-gray-600":"text-gray-400"}`,children:["关单后处理",e.jsxs("span",{className:"mt-2 flex items-center gap-2 font-medium",children:[e.jsx("input",{type:"checkbox",disabled:!t.auto_close_order,checked:t.auto_close_order&&t.only_card_after_close,onChange:a=>N(t.rule_code,{only_card_after_close:a.target.checked}),className:"h-4 w-4 rounded border-gray-300 text-amber-600 disabled:opacity-50"}),"关闭成功后仍发送卡券"]})]})]}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-gray-500",children:"未开启“关闭后仍发送卡券”时,规则命中即停止发货;关单失败也会停止发货。"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"text-xs font-bold text-gray-600",children:"排除商品"}),e.jsxs("div",{className:"mt-1 grid gap-2 md:grid-cols-2",children:[e.jsxs("select",{defaultValue:"",onChange:a=>{const c=a.target.value;c&&!t.excluded_item_ids.includes(c)&&N(t.rule_code,{excluded_item_ids:[...t.excluded_item_ids,c]}),a.currentTarget.value=""},className:"rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-normal",children:[e.jsx("option",{value:"",children:"从当前账号商品中选择"}),h.map(a=>e.jsx("option",{value:a.item_id,children:a.item_title||a.item_id},a.item_id))]}),e.jsx("input",{value:t.excluded_item_ids.join(", "),onChange:a=>N(t.rule_code,{excluded_item_ids:a.target.value.split(/[\s,,]+/).map(c=>c.trim()).filter(Boolean)}),placeholder:"也可直接输入商品 ID,逗号分隔",className:"rounded-md border border-gray-200 px-3 py-2 text-sm font-normal"})]}),t.excluded_item_ids.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:t.excluded_item_ids.map(a=>{const c=h.find(f=>f.item_id===a);return e.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded bg-gray-100 px-2 py-1 text-xs text-gray-600",children:[e.jsx("span",{className:"max-w-52 truncate",children:(c==null?void 0:c.item_title)||a}),e.jsx("button",{type:"button",onClick:()=>N(t.rule_code,{excluded_item_ids:t.excluded_item_ids.filter(f=>f!==a)}),title:`移除排除商品 ${a}`,className:"rounded p-0.5 hover:bg-gray-200",children:e.jsx(ie,{className:"h-3 w-3"})})]},a)})})]}),t.rule_code==="buyer_credit_zero"?e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["评价数阈值",e.jsx("input",{type:"number",min:0,max:99999,value:Number(t.config.threshold)||0,onChange:a=>N(t.rule_code,{config:{...t.config,threshold:Math.max(0,Number(a.target.value)||0)}}),className:"mt-1 w-full rounded-md border border-gray-200 px-2 py-2 text-sm"})]}):null,t.rule_code==="buyer_has_order"||t.rule_code==="buyer_has_order_global"?e.jsxs("label",{className:"flex items-center gap-2 text-xs font-bold text-gray-600 sm:col-span-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.config.same_item_only,onChange:a=>N(t.rule_code,{config:{...t.config,same_item_only:a.target.checked}}),className:"h-4 w-4 rounded border-gray-300 text-amber-600"}),"仅在买家已有同一商品订单时拦截"]}):null,t.rule_code==="buyer_unconfirmed"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["未确认订单阈值",e.jsx("input",{type:"number",min:1,max:99,value:Number(t.config.min_count)||1,onChange:a=>N(t.rule_code,{config:{...t.config,min_count:Math.max(1,Number(a.target.value)||1)}}),className:"ios-input mt-1 w-full rounded-md px-3 py-2 text-sm"})]}),e.jsxs("label",{className:"flex items-center gap-2 self-end pb-2 text-xs font-bold text-gray-600",children:[e.jsx("input",{type:"checkbox",checked:!!t.config.same_item_only,onChange:a=>N(t.rule_code,{config:{...t.config,same_item_only:a.target.checked}}),className:"h-4 w-4 rounded border-gray-300 text-amber-600"}),"仅统计同一商品"]})]}):null]}),e.jsx("button",{type:"button",onClick:()=>void q(t),disabled:D===t.rule_code,title:"保存规则",className:"ios-btn-primary flex h-10 w-10 items-center justify-center rounded-md p-0 disabled:opacity-50",children:D===t.rule_code?e.jsx(G,{className:"h-4 w-4 animate-spin"}):e.jsx(he,{className:"h-4 w-4"})})]},t.rule_code)),!C&&k.length===0&&e.jsx(ne,{compact:!0,title:"暂无发货拦截规则",description:"当前账号没有可配置的拦截规则。",icon:pe})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(ke,{title:"买家黑名单",description:"支持商品级、账号级和全部账号三种生效范围。",icon:Ze}),e.jsxs("div",{className:"grid gap-2 border-b border-gray-200 bg-gray-50/60 p-4 md:grid-cols-2 xl:grid-cols-6",children:[e.jsxs("select",{value:g.scope,onChange:t=>m({...g,scope:t.target.value,item_id:""}),className:"ios-input rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"item",children:"当前商品"}),e.jsx("option",{value:"account",children:"当前账号"}),e.jsx("option",{value:"global",children:"全部账号"})]}),e.jsx("input",{value:g.buyer_id,onChange:t=>m({...g,buyer_id:t.target.value}),placeholder:"买家 ID *",className:"ios-input rounded-md px-3 py-2 text-sm"}),e.jsx("input",{value:g.buyer_nick,onChange:t=>m({...g,buyer_nick:t.target.value}),placeholder:"买家昵称",className:"ios-input rounded-md px-3 py-2 text-sm"}),g.scope==="item"?e.jsxs("select",{value:g.item_id,onChange:t=>m({...g,item_id:t.target.value}),className:"ios-input rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"选择商品 *"}),h.map(t=>e.jsx("option",{value:t.item_id,children:t.item_title||t.item_id},t.item_id))]}):e.jsx("div",{className:"flex items-center rounded-md border border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-500",children:g.scope==="account"?"对当前账号全部商品生效":"对名下全部闲鱼账号生效"}),e.jsx("input",{value:g.reason,onChange:t=>m({...g,reason:t.target.value}),placeholder:"拉黑原因",className:"ios-input rounded-md px-3 py-2 text-sm"}),e.jsx("button",{type:"button",onClick:()=>void Q(),className:"ios-btn-danger rounded-md px-4 py-2 text-sm",children:"加入黑名单"})]}),e.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[T.map(t=>e.jsxs("div",{className:"flex flex-col gap-3 py-3 sm:flex-row sm:items-center",children:[e.jsx("button",{type:"button",role:"switch","aria-checked":t.is_enabled,onClick:()=>void O(t),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${t.is_enabled?"bg-red-500":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${t.is_enabled?"translate-x-5":"translate-x-0"}`})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"font-bold text-gray-900",children:t.buyer_nick||t.buyer_id}),e.jsxs("p",{className:"break-all text-xs text-gray-500",children:["ID ",t.buyer_id,t.item_id?` · 商品级 · ${t.item_id}`:t.account_id?` · 账号级 · ${t.account_id}`:" · 全部账号",t.reason?` · ${t.reason}`:""]})]}),e.jsx("button",{type:"button",onClick:()=>void W(t),title:"移除黑名单",className:"ios-btn-danger flex h-9 w-9 items-center justify-center rounded-md p-0",children:e.jsx(ge,{className:"h-4 w-4"})})]},t.id)),T.length===0&&e.jsx(ne,{compact:!0,title:"暂无买家黑名单",description:"当前账号没有适用的黑名单记录。",icon:Ze})]})]})]}):e.jsx(ne,{title:"请选择闲鱼账号",description:"选择账号后可管理发货拦截规则和买家黑名单。",icon:pe})]})},Ae={keyword:"",cookieId:"",cardId:"",deliveryCount:1,description:"",enabled:!0},Ys=({accounts:o,cards:u,rules:x,onReload:_})=>{const[k,S]=r.useState(null),[T,y]=r.useState(!1),[C,M]=r.useState(!1),[D,E]=r.useState(!1),[g,m]=r.useState(""),[h,F]=r.useState(Ae),N=()=>{S(null),F(Ae),y(!0)},q=a=>{S(a),F({keyword:a.item_keyword,cookieId:a.cookie_id||"",cardId:String(a.card_group_id),deliveryCount:Math.max(1,a.priority||1),description:a.name||"",enabled:a.enabled}),y(!0)},Q=async()=>{E(!0);try{await _()}catch(a){w(`刷新失败:${a.message}`)}finally{E(!1)}},O=async()=>{if(!h.keyword.trim()){w("请填写触发关键词");return}if(!h.cardId){w("请选择发货卡密或内容");return}M(!0);try{await ve({id:k==null?void 0:k.id,item_keyword:h.keyword.trim(),cookie_id:h.cookieId||void 0,item_id:void 0,card_group_id:Number(h.cardId),priority:Math.max(1,Math.floor(h.deliveryCount||1)),name:h.description.trim(),enabled:h.enabled}),await _(),y(!1),w("通用发货规则已保存")}catch(a){w(`保存失败:${a.message}`)}finally{M(!1)}},W=async a=>{m(a.id);try{await ve({...a,enabled:!a.enabled}),await _()}catch(c){w(`更新失败:${c.message}`)}finally{m("")}},t=async a=>{if(await ye(`确认删除通用发货规则“${a.item_keyword}”吗?`)){m(a.id);try{await we(a.id),await _(),w("通用发货规则已删除")}catch(c){w(`删除失败:${c.message}`)}finally{m("")}}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(ke,{title:"账号与全局兜底规则",description:"按商品标题或本地详情关键词匹配,商品专属规则优先。",icon:qe,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>void Q(),disabled:D,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm disabled:opacity-50",children:[e.jsx(Ce,{className:`h-4 w-4 ${D?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:N,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(ue,{className:"h-4 w-4"}),"添加规则"]})]})}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[x.map(a=>{const c=g===a.id,f=o.find(V=>V.id===a.cookie_id);return e.jsx("article",{className:`p-4 ${a.enabled?"":"opacity-70"}`,children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center",children:[e.jsx("div",{className:`flex h-11 w-11 flex-none items-center justify-center rounded-md ${a.enabled?"bg-blue-50 text-blue-700":"bg-gray-100 text-gray-400"}`,children:e.jsx(qe,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h4",{className:"font-bold text-gray-900",children:a.item_keyword}),e.jsx("span",{className:`rounded px-2 py-1 text-xs font-bold ${a.enabled?"bg-green-50 text-green-700":"bg-gray-100 text-gray-500"}`,children:a.enabled?"已启用":"已停用"}),e.jsx("span",{className:"rounded bg-blue-50 px-2 py-1 text-xs font-bold text-blue-700",children:a.cookie_id?"指定账号":"全部账号"})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-5 gap-y-1 text-sm text-gray-600",children:[e.jsxs("span",{children:["发货:",a.card_group_name||`卡密 ${a.card_group_id}`]}),e.jsxs("span",{children:["每单:",Math.max(1,a.priority||1)," 份"]}),a.cookie_id&&e.jsxs("span",{children:["账号:",(f==null?void 0:f.nickname)||(f==null?void 0:f.remark)||a.cookie_id]})]}),a.name&&e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:a.name})]}),e.jsxs("div",{className:"flex flex-none justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void W(a),disabled:c,className:`rounded-md p-2.5 ${a.enabled?"bg-amber-50 text-amber-700 hover:bg-amber-100":"bg-green-50 text-green-700 hover:bg-green-100"}`,title:a.enabled?"停用规则":"启用规则","aria-label":a.enabled?"停用规则":"启用规则",children:c?e.jsx(G,{className:"h-4 w-4 animate-spin"}):a.enabled?e.jsx(Ks,{className:"h-4 w-4"}):e.jsx(qs,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>q(a),disabled:c,className:"rounded-md bg-gray-100 p-2.5 text-gray-700 hover:bg-gray-200",title:"编辑规则","aria-label":"编辑规则",children:e.jsx(Os,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void t(a),disabled:c,className:"rounded-md bg-red-50 p-2.5 text-red-600 hover:bg-red-100",title:"删除规则","aria-label":"删除规则",children:e.jsx(ge,{className:"h-4 w-4"})})]})]})},a.id)}),x.length===0&&e.jsx(ne,{compact:!0,title:"暂无通用发货规则",description:"可添加指定账号或全部账号适用的关键词兜底规则。",icon:ts})]})]}),T&&xe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:k?"编辑通用发货规则":"添加通用发货规则"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"未指定账号时对当前用户的全部闲鱼账号生效。"})]}),e.jsx("button",{type:"button",onClick:()=>y(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(ie,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-account",children:"适用账号"}),e.jsxs("select",{id:"generic-rule-account",value:h.cookieId,onChange:a=>F(c=>({...c,cookieId:a.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"全部账号"}),o.map(a=>e.jsx("option",{value:a.id,children:a.nickname||a.remark||a.id},a.id))]})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-keyword",children:"商品关键词"}),e.jsx("input",{id:"generic-rule-keyword",value:h.keyword,onChange:a=>F(c=>({...c,keyword:a.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"例如:Kimi、会员、周卡"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-card",children:"发货卡密或内容"}),e.jsxs("select",{id:"generic-rule-card",value:h.cardId,onChange:a=>F(c=>({...c,cardId:a.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择"}),u.map(a=>e.jsxs("option",{value:a.id,disabled:!a.enabled,children:[a.name||`卡密 ${a.id}`,a.enabled?"":"(已停用)"]},a.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-count",children:"每单发货数量"}),e.jsx("input",{id:"generic-rule-count",type:"number",min:1,step:1,value:h.deliveryCount,onChange:a=>F(c=>({...c,deliveryCount:Math.max(1,Number(a.target.value)||1)})),className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-description",children:"规则备注"}),e.jsx("input",{id:"generic-rule-description",value:h.description,onChange:a=>F(c=>({...c,description:a.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"便于识别此规则"})]}),e.jsxs("div",{className:"sm:col-span-2 flex items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-gray-800",children:"启用规则"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"关闭后保留配置,但不会参与匹配。"})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":h.enabled,onClick:()=>F(a=>({...a,enabled:!a.enabled})),className:`relative inline-flex h-6 w-11 items-center rounded-full ${h.enabled?"bg-[#ffe100]":"bg-[#e8dcbc]"}`,"aria-label":"启用通用发货规则",children:e.jsx("span",{className:`h-4 w-4 rounded-full bg-white transition-transform ${h.enabled?"translate-x-6":"translate-x-1"}`})})]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>y(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:()=>void O(),disabled:C,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 disabled:opacity-50",children:[C?e.jsx(G,{className:"h-4 w-4 animate-spin"}):e.jsx(he,{className:"h-4 w-4"}),"保存规则"]})]})]})}),document.body)]})};function Zs({cookieId:o,itemId:u}){const[x,_]=r.useState([]),[k,S]=r.useState(!1),[T,y]=r.useState(""),[C,M]=r.useState(""),D=m=>{if(_(m.options),M(m.detection_status),m.detection_status==="unauthorized")y("该账号没有卖家 SKU 权限,可尝试买家接口(风控风险更高,只调一次)");else if(m.detection_status==="risk_control"){const h=Math.max(1,Math.ceil((m.retry_after_seconds||0)/60));y(`触发平台风控,请约 ${h} 分钟后再试`)}else m.options.length?y(`已识别 ${m.options.length} 个 SKU`):y(m.warning?`商家接口暂不可用:${m.warning}`:"暂无可识别 SKU")},E=async()=>{S(!0),y("");try{D(await $s(o,u))}catch(m){M(""),y(m instanceof Error?m.message:"SKU 识别失败")}finally{S(!1)}},g=async()=>{if(await ye("买家接口会以买家身份读取商品详情,风控风险更高,只调用一次且失败不会自动重试。确认继续吗?",{title:"尝试买家接口",confirmLabel:"仍然调用一次",danger:!0})){S(!0),y("");try{D(await Ms(o,u))}catch(h){y(h instanceof Error?h.message:"买家接口识别失败")}finally{S(!1)}}};return e.jsxs("section",{className:"mt-4 rounded-md border border-cyan-200 bg-cyan-50/40 p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-gray-900",children:"SKU 识别"}),e.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"只读取并展示商品规格,不在这里设置防薅限制。"})]}),e.jsxs("div",{className:"flex gap-2",children:[C==="unauthorized"&&e.jsxs("button",{type:"button",onClick:g,disabled:k,className:"inline-flex items-center gap-1 rounded-md border border-amber-500 px-3 py-2 text-xs font-semibold text-amber-700 disabled:opacity-50",children:[e.jsx(Ye,{size:14}),"尝试买家接口"]}),e.jsxs("button",{type:"button",onClick:E,disabled:k,className:"inline-flex items-center gap-1 rounded-md border border-cyan-600 px-3 py-2 text-xs font-semibold text-cyan-700 disabled:opacity-50",children:[e.jsx(Ye,{size:14}),k?"处理中":"识别 SKU"]})]})]}),T&&e.jsx("p",{className:"mt-2 text-xs text-cyan-800",children:T}),x.length>0&&e.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:x.map(m=>e.jsxs("div",{className:"rounded border border-cyan-100 bg-white p-3",children:[e.jsx("p",{className:"truncate text-xs font-semibold text-gray-800",children:m.name}),e.jsx("p",{className:"truncate font-mono text-[10px] text-gray-500",children:m.key})]},m.key))})]})}const es={cookieId:"",itemId:"",title:"",price:"",imageUrl:"",description:"",detail:""},ce=(o=0)=>({clientId:`${Date.now()}-${o}-${Math.random().toString(36).slice(2)}`,displayName:"",specText:"",platformSkuId:"",cardId:"",deliveryCount:1,enabled:!0}),L=o=>`${o.cookie_id}:${o.item_id}`,As=o=>{const u=o==null?void 0:o.trim().replace(/^[¥¥]\s*/,"");return u?`¥${u}`:"价格未知"},et=o=>{const u=o==null?void 0:o.trim();return u?u.startsWith("//")?`https:${u}`:u:""},as={api:"API 动态内容",text:"固定文本",data:"批量库存",image:"图片内容"},st=o=>o?o.enabled?o.type==="data"?`当前可用 ${(o.data_content||"").split(/\r?\n/).filter(x=>x.trim()).length} 条`:as[o.type]:"该库存已停用":"尚未选择发货库存",tt=({item:o})=>{const u=et(o.item_image),[x,_]=r.useState(!1);return r.useEffect(()=>_(!1),[u]),!u||x?e.jsx("div",{className:"flex h-full w-full items-center justify-center text-gray-400",children:e.jsx(ss,{className:"h-8 w-8"})}):e.jsx("img",{src:u,alt:o.item_title||"商品图片",className:"h-full w-full object-cover",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>_(!0)})},me=({checked:o,disabled:u,label:x,onChange:_})=>e.jsx("button",{type:"button",role:"switch","aria-checked":o,"aria-label":x,disabled:u,onClick:_,className:`relative inline-flex h-6 w-11 flex-none items-center rounded-full transition-colors ${o?"bg-[#ffe100]":"bg-[#e8dcbc]"} disabled:cursor-not-allowed disabled:opacity-50`,children:e.jsx("span",{className:`h-4 w-4 rounded-full bg-white shadow-sm transition-transform ${o?"translate-x-6":"translate-x-1"}`})}),gt=()=>{const[o,u]=r.useState([]),[x,_]=r.useState([]),k=r.useRef(null),[S,T]=r.useState([]),[y,C]=r.useState([]),[M,D]=r.useState([]),[E,g]=r.useState("products"),[m,h]=r.useState(""),[F,N]=r.useState(!0),[q,Q]=r.useState(!1),[O,W]=r.useState(!1),[t,a]=r.useState(""),[c,f]=r.useState(1),[V,ls]=r.useState(20),[H,B]=r.useState(""),[be,j]=r.useState(null),[X,re]=r.useState(null),[fe,Ie]=r.useState(""),[I,ee]=r.useState(null),[$e,Me]=r.useState(!1),[b,U]=r.useState({enabled:!0,isMultiSpec:!1,variants:[ce()]}),[is,de]=r.useState(!1),[v,K]=r.useState(es),se=r.useMemo(()=>new Map(x.map(s=>[s.id,s.nickname||s.remark||`账号 ${s.id.substring(0,6)}`])),[x]),De=r.useMemo(()=>new Map(x.map(s=>[s.id,s.avatar_url||""])),[x]),te=r.useMemo(()=>{const s=new Map;return y.forEach(l=>{l.cookie_id&&l.item_id&&s.set(`${l.cookie_id}:${l.item_id}`,l)}),s},[y]),Fe=r.useMemo(()=>y.filter(s=>!s.item_id),[y]),Pe=r.useMemo(()=>new Map(M.map(s=>[`${s.cookie_id}:${s.item_id}`,s])),[M]),[oe,ns]=r.useState("on_sale"),J=s=>s.listing_status==="off_shelf",Ee=s=>s.listing_status==="draft",Y=r.useMemo(()=>t?o.filter(s=>s.cookie_id===t):o,[o,t]);r.useMemo(()=>Y.filter(s=>!J(s)&&!Ee(s)).length,[Y]);const Be=r.useMemo(()=>Y.filter(J).length,[Y]),[z,Re]=r.useState(null),[at,Le]=r.useState(!1),Te=r.useMemo(()=>{const s=(z==null?void 0:z.items)||[];return t?s.filter(l=>l.cookie_id===t):s},[z,t]);z==null||z.total,z!=null&&z.notice,r.useCallback(async()=>{var d;const s=t||"__all__",l=t?[t]:x.map(i=>i.id);if(l.length){Le(!0);try{const i=await Promise.all(l.map(async $=>{try{return await Ds($,"草稿",1)}catch(P){return{success:!1,group_name:"草稿",page:1,total:0,items:[],notice:"",_error:(P==null?void 0:P.message)||"拉取失败"}}})),n=[];let p=0,R="",A="";for(const $ of i)$&&$.success?(p+=typeof $.total=="number"?$.total:((d=$.items)==null?void 0:d.length)||0,($.items||[]).forEach(P=>{n.push({id:`draft:${P.cookie_id||""}:${P.item_id}`,cookie_id:P.cookie_id,item_id:P.item_id,item_title:P.item_title,item_price:P.item_price,item_image:P.item_image,listing_status:"draft"})}),$.notice&&(R=$.notice)):(R=R||$.notice||"",A=A||$._error||"");Re({scope:s,items:n,total:p,notice:R,error:A})}catch(i){Re({scope:s,items:[],total:0,notice:"",error:(i==null?void 0:i.message)||"拉取失败"})}finally{Le(!1)}}},[t,x]);const ae=r.useMemo(()=>{if(oe==="draft")return Te;const s=Y;return oe==="on_sale"?s.filter(l=>!J(l)&&!Ee(l)):s.filter(J)},[Y,oe,Te]),le=Math.max(1,Math.ceil(ae.length/V)),rs=r.useMemo(()=>ae.slice((c-1)*V,c*V),[ae,c,V]);r.useEffect(()=>{c>le&&f(1)},[le,c]);const ds=r.useMemo(()=>{const s=new Set(M.map(l=>`${l.cookie_id}:${l.item_id}`));return y.forEach(l=>{l.cookie_id&&l.item_id&&s.add(`${l.cookie_id}:${l.item_id}`)}),s.size},[M,y]),os=async()=>{N(!0);try{const[s,l,d,i,n]=await Promise.all([Ve(),_e(),He(),Xe(),Ne()]);_(s),u(l),T(d),C(i),D(n),h(p=>{var R;return p||((R=s[0])==null?void 0:R.id)||""})}catch(s){j({type:"error",message:s instanceof Error?s.message:"商品数据加载失败"})}finally{N(!1)}},cs=async()=>{const s=await Xe();C(s)},ze=async()=>{D(await Ne())};r.useEffect(()=>{os();const s=()=>{Ve().then(_).catch(()=>{}),He().then(T).catch(()=>{}),Ne().then(D).catch(()=>{})},l=setInterval(s,3e4),d=k.current;let i;return d&&(i=new IntersectionObserver(n=>{n.some(p=>p.isIntersecting)&&s()}),i.observe(d)),()=>{clearInterval(l),i==null||i.disconnect()}},[]);const ms=async()=>{if(!m){j({type:"error",message:"请先选择需要同步的账号"});return}Q(!0),j(null);try{const s=await Fs(m);if((s==null?void 0:s.success)===!1)throw new Error(s.message||"同步失败");u(await _e()),j({type:"success",message:(s==null?void 0:s.message)||"商品同步完成"})}catch(s){j({type:"error",message:s instanceof Error?s.message:"同步失败"})}finally{Q(!1)}},xs=async()=>{W(!0),j(null);try{const s=await Ps(m||void 0);if((s==null?void 0:s.success)===!1)throw new Error(s.message||"擦亮失败");j({type:"success",message:(s==null?void 0:s.message)||"商品擦亮完成"})}catch(s){j({type:"error",message:s instanceof Error?s.message:"擦亮失败"})}finally{W(!1)}},Ue=()=>{var s;K({...es,cookieId:m||((s=x[0])==null?void 0:s.id)||""}),de(!0)},ps=async()=>{if(!v.cookieId||!v.itemId.trim()||!v.title.trim()){j({type:"error",message:"账号、商品 ID 和商品标题为必填项"});return}B("manual-item");try{await Ls({cookie_id:v.cookieId,item_id:v.itemId.trim(),title:v.title.trim(),price:v.price.trim(),image_url:v.imageUrl.trim(),description:v.description.trim(),detail:v.detail.trim()}),u(await _e()),de(!1),j({type:"success",message:"商品已添加,可继续配置自动发货"})}catch(s){j({type:"error",message:s instanceof Error?s.message:"商品添加失败"})}finally{B("")}},us=s=>{re(s),Ie(s.item_detail||"")},hs=async()=>{if(!X)return;const s=L(X);B(s);try{await Rs(X.cookie_id,X.item_id,fe),u(l=>l.map(d=>L(d)===s?{...d,item_detail:fe}:d)),re(null),j({type:"success",message:"商品详情已保存"})}catch(l){j({type:"error",message:l instanceof Error?l.message:"保存失败"})}finally{B("")}},je=async s=>{const l=te.get(L(s));ee(s),Me(!0);try{const d=await Ge(s.cookie_id,s.item_id);d.configured&&d.variants.length>0?U({enabled:d.enabled,isMultiSpec:d.is_multi_spec,variants:d.variants.map((i,n)=>({clientId:String(i.id||ce(n).clientId),displayName:i.display_name||"",specText:i.spec_text||"",platformSkuId:i.platform_sku_id||"",cardId:i.card_id?String(i.card_id):"",deliveryCount:Math.max(1,i.delivery_count||1),enabled:i.enabled&&i.binding_enabled}))}):U({enabled:(l==null?void 0:l.enabled)??!0,isMultiSpec:!1,variants:[{...ce(),displayName:"默认规格",cardId:l!=null&&l.card_group_id?String(l.card_group_id):"",deliveryCount:Math.max(1,(l==null?void 0:l.priority)||1)}]})}catch(d){ee(null),j({type:"error",message:d instanceof Error?d.message:"发货配置加载失败"})}finally{Me(!1)}},Z=(s,l)=>{U(d=>({...d,variants:d.variants.map(i=>i.clientId===s?{...i,...l}:i)}))},gs=()=>{U(s=>({...s,variants:[...s.variants,ce(s.variants.length)]}))},ys=s=>{U(l=>l.variants.length<=1?l:{...l,variants:l.variants.filter(d=>d.clientId!==s)})},bs=async()=>{if(!I)return;const s=b.isMultiSpec?b.variants:b.variants.slice(0,1);if(s.length===0){j({type:"error",message:"至少需要保留一个商品规格"});return}const l=s.findIndex(n=>!n.cardId||b.isMultiSpec&&(!n.displayName.trim()||!n.specText.trim()));if(l>=0){j({type:"error",message:b.isMultiSpec?`请完整填写第 ${l+1} 个规格名称、规格组合和发货库存`:"请选择自动发货使用的卡密或内容"});return}const d=L(I),i=te.get(d);B(d);try{await Qe(I.cookie_id,I.item_id,{enabled:b.enabled,is_multi_spec:b.isMultiSpec,variants:s.map(n=>({display_name:b.isMultiSpec?n.displayName.trim():"默认规格",spec_text:b.isMultiSpec?n.specText.trim():"",spec_payload:void 0,platform_sku_id:b.isMultiSpec?n.platformSkuId.trim():"",card_id:Number(n.cardId),delivery_count:Math.max(1,Math.floor(n.deliveryCount||1)),enabled:n.enabled,binding_enabled:n.enabled,source:"manual"}))}),i&&(await we(i.id),C(n=>n.filter(p=>p.id!==i.id))),u(n=>n.map(p=>L(p)===d?{...p,is_multi_spec:b.isMultiSpec}:p)),await ze(),ee(null),j({type:"success",message:"商品自动发货配置已保存"})}catch(n){j({type:"error",message:n instanceof Error?n.message:"发货配置保存失败"})}finally{B("")}},fs=async s=>{const l=L(s),d=Pe.get(l),i=te.get(l);if(!d&&!i){je(s);return}B(l);try{if(d){const n=await Ge(s.cookie_id,s.item_id);await Qe(s.cookie_id,s.item_id,{enabled:!n.enabled,is_multi_spec:n.is_multi_spec,variants:n.variants.map(p=>({display_name:p.display_name,spec_text:p.spec_text,spec_payload:p.spec_payload,platform_sku_id:p.platform_sku_id,card_id:p.card_id,delivery_count:p.delivery_count,enabled:p.enabled,binding_enabled:p.binding_enabled,source:p.source||"manual"}))}),await ze()}else i&&(await ve({...i,enabled:!i.enabled}),C(n=>n.map(p=>p.id===i.id?{...p,enabled:!i.enabled}:p)))}catch(n){j({type:"error",message:n instanceof Error?n.message:"状态更新失败"})}finally{B("")}},js=async s=>{if(!await ye(`确认删除商品“${s.item_title||s.item_id}”的本地记录吗?`))return;const l=L(s),d=te.get(l);B(l);try{d&&await we(d.id),await Bs(s.cookie_id,s.item_id),u(i=>i.filter(n=>L(n)!==l)),C(i=>i.filter(n=>n.id!==(d==null?void 0:d.id))),D(i=>i.filter(n=>`${n.cookie_id}:${n.item_id}`!==l)),j({type:"success",message:"商品及其专属发货配置已删除"})}catch(i){j({type:"error",message:i instanceof Error?i.message:"删除失败"})}finally{B("")}},_s=async(s,l)=>{const d=L(s),i=!s[l];B(d);try{await Es(s.cookie_id,s.item_id,i),u(n=>n.map(p=>L(p)===d?{...p,[l]:i}:p))}catch(n){j({type:"error",message:n instanceof Error?n.message:"状态更新失败"})}finally{B("")}};return F?e.jsx(We,{label:"正在加载商品与发货配置"}):e.jsxs("div",{ref:k,className:"page-stack animate-fade-in",children:[e.jsx(Ts,{title:"商品与发货",description:"同步在售商品并配置自动发货。",icon:ss,badge:e.jsxs("span",{className:"status-badge status-badge-info",children:[o.length," 件商品"]})}),e.jsx(zs,{value:E,onChange:g,items:[{id:"products",label:"商品与专属发货",icon:Oe,count:o.length},{id:"rules",label:"通用发货规则",icon:Gs,count:Fe.length},{id:"protection",label:"发货保护与黑名单",icon:pe}],ariaLabel:"商品与发货功能"}),be&&e.jsx(Us,{type:be.type,message:be.message,onClose:()=>j(null)}),e.jsx("section",{hidden:E!=="products",className:"space-y-4",children:e.jsxs("section",{className:"section-panel",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-gray-200 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{className:"ios-input rounded-md px-3 py-2 text-sm",value:m,onChange:s=>{h(s.target.value),a(s.target.value),f(1)},"aria-label":"选择账号",children:[e.jsxs("option",{value:"",children:["全部账号(",o.length,")"]}),x.map(s=>e.jsxs("option",{value:s.id,children:[se.get(s.id),"(",o.filter(l=>l.cookie_id===s.id).length,")"]},s.id))]}),e.jsxs("span",{className:"text-xs text-gray-500",children:["已配置专属发货 ",ds," 件"]}),Be>0&&e.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-gray-500",children:[e.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 cursor-pointer accent-brand-500",checked:oe==="off_shelf",onChange:s=>{ns(s.target.checked?"off_shelf":"on_sale"),f(1)}}),"显示已下架(",Be,")"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:Ue,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm",children:[e.jsx(ue,{className:"h-4 w-4"}),"手动添加"]}),e.jsxs("button",{type:"button",onClick:ms,disabled:q||!m,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm",title:m?"从闲鱼拉取该账号的在售商品":"请先在左侧选择账号",children:[e.jsx(Ce,{className:`h-4 w-4 ${q?"animate-spin":""}`}),q?"正在同步":"同步商品"]}),e.jsxs("button",{type:"button",onClick:xs,disabled:O||o.length===0,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm",title:"重新获取搜索曝光,平台对每日擦亮次数有限制",children:[e.jsx(Je,{className:`h-4 w-4 ${O?"animate-pulse":""}`}),O?"正在擦亮":"一键擦亮"]})]})]}),ae.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("div",{className:"min-w-full xl:min-w-[1200px]",children:[e.jsxs("div",{className:"hidden grid-cols-[340px_140px_260px_210px_110px] border-b-2 border-gray-300 bg-gray-100 text-xs font-bold text-gray-600 xl:grid [&>span]:border-r [&>span]:border-gray-300 [&>span]:px-4 [&>span]:py-3 [&>span:nth-child(2)]:px-2 [&>span:last-child]:border-r-0",children:[e.jsx("span",{children:"商品信息"}),e.jsx("span",{children:"所属账号"}),e.jsx("span",{children:"专属自动发货"}),e.jsx("span",{children:"商品能力"}),e.jsx("span",{className:"text-right",children:"操作"})]}),e.jsx("div",{className:"divide-y-2 divide-gray-200",children:rs.map(s=>{const l=L(s),d=H===l,i=te.get(l),n=Pe.get(l),p=!!(n||i),R=(n==null?void 0:n.enabled)??!!(i!=null&&i.enabled),A=!!(n&&!n.complete),$=R?A?"status-badge-warning":"status-badge-success":p?"status-badge-warning":"status-badge-info",P=R?A?"待完善":"发货中":p?"已暂停":"未配置",Ns=n?n.is_multi_spec?`${n.configured_count}/${n.variant_count} 个规格已绑定`:"普通商品发货":(i==null?void 0:i.card_group_name)||(i?`卡密 ${i.card_group_id}`:"尚未绑定发货内容"),vs=n?n.complete?`累计发货 ${n.delivery_times} 次`:"存在未启用或不可用的规格库存":i?`每单发货 ${i.priority} 份`:"配置后可按订单自动发货";return e.jsxs("article",{className:"grid gap-4 px-4 py-4 transition-colors hover:bg-[#fffdf0] xl:grid-cols-[340px_140px_260px_210px_110px] xl:items-stretch xl:gap-0 xl:px-0 xl:[&>*]:flex xl:[&>*]:min-w-0 xl:[&>*]:flex-col xl:[&>*]:justify-center xl:[&>*]:border-r xl:[&>*]:border-gray-200 xl:[&>*]:px-4 xl:[&>*:first-child]:!flex-row xl:[&>*:first-child]:items-center xl:[&>*:last-child]:border-r-0",children:[e.jsxs("div",{className:"flex min-w-0 gap-3",children:[e.jsx("div",{className:"h-20 w-20 flex-none overflow-hidden rounded-md border border-gray-200 bg-gray-100",children:e.jsx(tt,{item:s})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-start gap-2",children:[e.jsx("h3",{className:`min-w-0 flex-1 text-sm font-bold leading-5 ${J(s)?"text-gray-400 line-through":"text-gray-900"}`,children:s.item_title||"未命名商品"}),J(s)&&e.jsx("span",{className:"status-badge shrink-0 bg-gray-100 text-gray-500",title:s.last_seen_at?`最后一次被闲鱼返回:${s.last_seen_at}`:"闲鱼商品列表已不再返回这件商品",children:"已下架"}),e.jsx("span",{className:`status-badge shrink-0 ${$}`,children:P})]}),e.jsx("p",{className:"mt-1 text-lg font-bold text-[#d92d20]",children:As(s.item_price)}),e.jsxs("p",{className:"mt-1 truncate font-mono text-xs text-gray-400",children:["商品 ID ",s.item_id]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-t border-gray-100 pt-3 xl:!flex-row xl:items-center xl:gap-1.5 xl:border-0 xl:px-2 xl:pt-0",children:[De.get(s.cookie_id)?e.jsx("img",{src:De.get(s.cookie_id),alt:"",className:"h-7 w-7 flex-none rounded-full object-cover",referrerPolicy:"no-referrer"}):e.jsx("span",{className:"flex h-7 w-7 flex-none items-center justify-center rounded-full bg-gray-200 text-[10px] text-gray-500",children:(se.get(s.cookie_id)||"?").slice(0,1)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-xs font-semibold text-gray-800",children:se.get(s.cookie_id)||"未命名账号"}),e.jsx("p",{className:"truncate font-mono text-[10px] text-gray-400",children:s.cookie_id})]})]}),e.jsxs("div",{className:"border-t border-gray-100 pt-3 xl:border-0 xl:pt-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ts,{className:`h-4 w-4 shrink-0 ${R?"text-green-600":"text-gray-400"}`}),e.jsx("span",{className:"text-sm font-bold text-gray-800",children:Ns})]}),e.jsx("p",{className:"mt-1 truncate text-xs text-gray-500",children:vs})]}),e.jsxs("div",{className:"flex flex-none flex-col items-center gap-1",children:[e.jsx(me,{checked:R,disabled:d,label:`${s.item_title||s.item_id} 自动发货`,onChange:()=>fs(s)}),e.jsx("span",{className:"text-[10px] font-semibold text-gray-500",children:"总开关"})]})]}),e.jsxs("button",{type:"button",onClick:()=>je(s),disabled:d,className:"ios-btn-secondary mt-3 flex w-full items-center justify-center gap-2 rounded-md px-3 py-2 text-xs",children:[e.jsx(Vs,{className:"h-4 w-4"}),p?"编辑发货策略":"配置自动发货"]}),e.jsxs("button",{type:"button",onClick:()=>je(s),disabled:d,className:"mt-2 flex w-full items-center justify-center gap-2 rounded-md border border-cyan-300 bg-cyan-50 px-3 py-2 text-xs font-semibold text-cyan-700 hover:bg-cyan-100",children:[e.jsx(Je,{className:"h-4 w-4"}),"识别 SKU"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 border-t border-gray-100 pt-3 sm:grid-cols-3 xl:grid-cols-1 xl:gap-0 xl:border-0 xl:pt-0 xl:[&>div]:border-b xl:[&>div]:border-dashed xl:[&>div]:border-gray-200 xl:[&>div]:py-1.5 xl:[&>div:last-child]:border-b-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-600",children:"规格模式"}),e.jsx("span",{className:"text-xs font-bold text-gray-800",children:n?n.is_multi_spec?`${n.variant_count} 个规格`:"普通商品":s.is_multi_spec?"旧版多规格":"普通商品"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-600",title:"买家一次买 N 件时是否发 N 份",children:"多数量"}),e.jsx(me,{checked:!!s.multi_quantity_delivery,disabled:d,label:`${s.item_title||s.item_id} 多数量发货`,onChange:()=>_s(s,"multi_quantity_delivery")})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-600",children:"本地详情"}),e.jsx("span",{className:`text-xs font-bold ${s.item_detail?"text-gray-800":"text-gray-400"}`,children:s.item_detail?"已维护":"暂无"})]})]}),e.jsx("div",{className:"flex items-center justify-end gap-1 border-t border-gray-100 pt-3 xl:!flex-row xl:items-center xl:justify-end xl:border-0 xl:pt-0",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>us(s),disabled:d,className:"rounded-md p-2 text-gray-600 hover:bg-gray-100",title:"编辑本地详情","aria-label":"编辑本地详情",children:e.jsx(Hs,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>js(s),disabled:d,className:"rounded-md p-2 text-red-500 hover:bg-red-50",title:"删除本地记录","aria-label":"删除本地记录",children:d?e.jsx(G,{className:"h-4 w-4 animate-spin"}):e.jsx(ge,{className:"h-4 w-4"})})]})})]},l)})})]})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-gray-200 px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-500",children:["第 ",c," 页 / 共 ",le," 页(",ae.length," 件)"]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-gray-500",children:["每页",e.jsx("select",{value:V,onChange:s=>{ls(Number(s.target.value)),f(1)},className:"ios-input rounded-md px-2 py-1 text-sm","aria-label":"每页显示数量",children:[10,20,50,100].map(s=>e.jsx("option",{value:s,children:s},s))}),"件"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",disabled:c<=1,onClick:()=>f(s=>Math.max(1,s-1)),className:"rounded-md bg-gray-50 px-3 py-2 text-sm text-gray-600 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",children:"上一页"}),e.jsx("button",{type:"button",disabled:c>=le,onClick:()=>f(s=>Math.min(le,s+1)),className:"rounded-md bg-gray-50 px-3 py-2 text-sm text-gray-600 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",children:"下一页"})]})]})]}):e.jsx(ne,{title:"暂无商品数据",description:"先选择闲鱼账号同步在售商品,也可以手动添加商品并直接配置自动发货。",icon:Oe,action:e.jsx("button",{type:"button",onClick:Ue,className:"ios-btn-secondary rounded-md px-4 py-2 text-sm",children:"手动添加商品"})})]})}),e.jsx("section",{hidden:E!=="rules",children:e.jsx(Ys,{accounts:x,cards:S,rules:Fe,onReload:cs})}),e.jsx("section",{hidden:E!=="protection",children:e.jsx(Js,{accounts:x,items:o,selectedAccount:m,onSelectedAccountChange:h})}),I&&xe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container modal-container-lg",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"商品自动发货"}),e.jsx("p",{className:"mt-1 line-clamp-1 text-sm text-gray-500",children:I.item_title||I.item_id})]}),e.jsx("button",{type:"button",onClick:()=>ee(null),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(ie,{className:"h-5 w-5"})})]}),e.jsx("div",{className:"modal-body space-y-5",children:$e?e.jsx(We,{label:"正在加载商品发货配置"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 rounded-md border border-gray-200 bg-gray-50 p-4 sm:grid-cols-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"所属账号"}),e.jsx("p",{className:"mt-1 truncate text-sm font-bold text-gray-900",children:se.get(I.cookie_id)||I.cookie_id})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"商品 ID"}),e.jsx("p",{className:"mt-1 truncate font-mono text-sm text-gray-900",children:I.item_id})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 sm:justify-end",children:[e.jsxs("div",{className:"sm:text-right",children:[e.jsx("p",{className:"text-sm font-bold text-gray-900",children:"自动发货"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"关闭后保留全部绑定"})]}),e.jsx(me,{checked:b.enabled,label:"启用商品自动发货",onChange:()=>U(s=>({...s,enabled:!s.enabled}))})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-sm font-bold text-gray-800",children:"商品规格模式"}),e.jsxs("div",{className:"grid grid-cols-2 rounded-md border border-gray-200 bg-gray-100 p-1",role:"radiogroup","aria-label":"商品规格模式",children:[e.jsx("button",{type:"button",role:"radio","aria-checked":!b.isMultiSpec,onClick:()=>U(s=>({...s,isMultiSpec:!1})),className:`rounded px-3 py-2 text-sm font-semibold ${b.isMultiSpec?"text-gray-500 hover:text-gray-800":"bg-white text-gray-900 shadow-sm"}`,children:"普通商品"}),e.jsx("button",{type:"button",role:"radio","aria-checked":b.isMultiSpec,onClick:()=>U(s=>({...s,isMultiSpec:!0})),className:`rounded px-3 py-2 text-sm font-semibold ${b.isMultiSpec?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-800"}`,children:"多规格商品"})]}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-gray-500",children:b.isMultiSpec?"订单规格必须与下方某一规格组合精确匹配,否则系统会阻止发货,不会使用其他规格库存兜底。":"所有订单使用同一个发货库存;如商品有套餐、周期或版本差异,请切换为多规格商品。"})]}),e.jsx(Zs,{cookieId:I.cookie_id,itemId:I.item_id}),e.jsx("div",{className:"space-y-3",children:(b.isMultiSpec?b.variants:b.variants.slice(0,1)).map((s,l)=>{const d=S.find(i=>String(i.id)===s.cardId);return e.jsxs("article",{className:"rounded-md border border-gray-200 bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-gray-100 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"truncate text-sm font-bold text-gray-900",children:b.isMultiSpec?s.displayName.trim()||`规格 ${l+1}`:"默认发货配置"}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-gray-500",children:b.isMultiSpec?s.specText.trim()||"等待填写规格组合":"适用于该商品的全部订单"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(me,{checked:s.enabled,label:`${s.displayName||`规格 ${l+1}`} 启用状态`,onChange:()=>Z(s.clientId,{enabled:!s.enabled})}),b.isMultiSpec&&b.variants.length>1&&e.jsx("button",{type:"button",onClick:()=>ys(s.clientId),className:"rounded-md p-2 text-red-500 hover:bg-red-50",title:"删除规格","aria-label":`删除规格 ${l+1}`,children:e.jsx(ge,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"grid gap-4 p-4 sm:grid-cols-2",children:[b.isMultiSpec&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"field-label",htmlFor:`variant-name-${s.clientId}`,children:"规格显示名称"}),e.jsx("input",{id:`variant-name-${s.clientId}`,value:s.displayName,onChange:i=>Z(s.clientId,{displayName:i.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"例如:周卡 / 独享"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"field-label",htmlFor:`variant-spec-${s.clientId}`,children:"规格组合"}),e.jsx("input",{id:`variant-spec-${s.clientId}`,value:s.specText,onChange:i=>Z(s.clientId,{specText:i.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"周期=周卡 | 版本=独享"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsxs("label",{className:"field-label",htmlFor:`variant-sku-${s.clientId}`,children:["闲鱼 SKU ID ",e.jsx("span",{className:"font-normal text-gray-400",children:"(可选,填写后优先匹配)"})]}),e.jsx("input",{id:`variant-sku-${s.clientId}`,value:s.platformSkuId,onChange:i=>Z(s.clientId,{platformSkuId:i.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5 font-mono",placeholder:"从订单或商品接口获取的平台规格 ID"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"field-label",htmlFor:`variant-card-${s.clientId}`,children:"绑定发货库存"}),e.jsxs("select",{id:`variant-card-${s.clientId}`,value:s.cardId,onChange:i=>Z(s.clientId,{cardId:i.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择卡密或内容"}),S.map(i=>e.jsxs("option",{value:i.id,disabled:!i.enabled,children:[i.name||`卡密 ${i.id}`," · ",as[i.type],i.enabled?"":"(已停用)"]},i.id))]}),e.jsx("p",{className:`mt-1.5 text-xs ${(d==null?void 0:d.enabled)===!1?"text-red-600":"text-gray-500"}`,children:st(d)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"field-label",htmlFor:`variant-count-${s.clientId}`,children:"每购买 1 件发货份数"}),e.jsx("input",{id:`variant-count-${s.clientId}`,type:"number",min:1,step:1,value:s.deliveryCount,onChange:i=>Z(s.clientId,{deliveryCount:Math.max(1,Math.floor(Number(i.target.value)||1))}),className:"ios-input w-full rounded-md px-3 py-2.5"}),e.jsx("p",{className:`mt-1.5 text-xs ${I.multi_quantity_delivery?"text-gray-500":"text-amber-700"}`,children:I.multi_quantity_delivery?`已开启「多数量」:买 N 件发 ${s.deliveryCount||1} × N 份。`:`⚠️ 未开启「多数量」:无论买家拍几件都只发 ${s.deliveryCount||1} 份。需按件数递增请到商品列表开启「多数量」。`})]})]})]},s.clientId)})}),b.isMultiSpec&&e.jsxs("button",{type:"button",onClick:gs,className:"ios-btn-secondary flex w-full items-center justify-center gap-2 rounded-md border-dashed px-4 py-2.5 text-sm",children:[e.jsx(ue,{className:"h-4 w-4"}),"添加商品规格"]})]})}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>ee(null),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:bs,disabled:!!H||$e,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[H?e.jsx(G,{className:"h-4 w-4 animate-spin"}):e.jsx(he,{className:"h-4 w-4"}),"保存策略"]})]})]})}),document.body),X&&xe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"编辑商品详情"}),e.jsx("p",{className:"mt-1 line-clamp-1 text-sm text-gray-500",children:X.item_title||X.item_id})]}),e.jsx("button",{type:"button",onClick:()=>re(null),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(ie,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"item-detail",children:"本地商品详情"}),e.jsx("textarea",{id:"item-detail",value:fe,onChange:s=>Ie(s.target.value),className:"ios-input min-h-64 w-full resize-y rounded-md p-3 font-mono text-sm",placeholder:"补充商品说明,供自动回复和发货逻辑读取。"})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>re(null),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:hs,disabled:!!H,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[H?e.jsx(G,{className:"h-4 w-4 animate-spin"}):e.jsx(he,{className:"h-4 w-4"}),"保存"]})]})]})}),document.body),is&&xe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"手动添加商品"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"适用于暂未同步到列表、但需要配置自动发货的商品。"})]}),e.jsx("button",{type:"button",onClick:()=>de(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(ie,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-account",children:"所属账号"}),e.jsxs("select",{id:"manual-account",value:v.cookieId,onChange:s=>K(l=>({...l,cookieId:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择账号"}),x.map(s=>e.jsx("option",{value:s.id,children:se.get(s.id)},s.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-item-id",children:"商品 ID"}),e.jsx("input",{id:"manual-item-id",value:v.itemId,onChange:s=>K(l=>({...l,itemId:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"例如 1070863591807"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-price",children:"价格"}),e.jsx("input",{id:"manual-price",value:v.price,onChange:s=>K(l=>({...l,price:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"例如 80"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-title",children:"商品标题"}),e.jsx("input",{id:"manual-title",value:v.title,onChange:s=>K(l=>({...l,title:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-image",children:"图片 URL"}),e.jsx("input",{id:"manual-image",value:v.imageUrl,onChange:s=>K(l=>({...l,imageUrl:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"https://..."})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-description",children:"商品简介"}),e.jsx("input",{id:"manual-description",value:v.description,onChange:s=>K(l=>({...l,description:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-detail",children:"本地详情"}),e.jsx("textarea",{id:"manual-detail",value:v.detail,onChange:s=>K(l=>({...l,detail:s.target.value})),className:"ios-input min-h-28 w-full resize-y rounded-md p-3"})]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>de(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:ps,disabled:H==="manual-item",className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[H==="manual-item"?e.jsx(G,{className:"h-4 w-4 animate-spin"}):e.jsx(ue,{className:"h-4 w-4"}),"添加商品"]})]})]})}),document.body)]})};export{gt as default}; diff --git a/static/assets/ItemList-Du75o4x-.js b/static/assets/ItemList-Du75o4x-.js new file mode 100644 index 0000000..2abf101 --- /dev/null +++ b/static/assets/ItemList-Du75o4x-.js @@ -0,0 +1,16 @@ +import{c as Me,r,ae as Ms,af as Xe,n as k,j as e,e as De,X as ne,L as O,ag as Ds,ah as Fs,ai as Ps,v as be,aj as Es,ak as Ge,b as pe,al as Ce,am as Ie,an as Bs,ao as Rs,ap as Ls,aq as ns,ar as Qe,o as We,h as ke,a8 as Je,as as Ye,at as Se,w as Ts,au as zs,av as Ze,aw as Ae,ax as Us,ay as Ks,az as qs,aA as Os}from"./index-C6Y7HdB3.js";import{E as re,S as $e,P as es,a as Vs,b as Hs,N as Xs}from"./ui-Dh615-z8.js";import{S as ue}from"./shield-alert-BSaySGHY.js";import{S as ge}from"./save-C5DQBwo1.js";import{T as ye}from"./trash-2-BG9PyYJR.js";import{P as he}from"./plus-BZHhM3Ok.js";import{P as Gs}from"./power-off-CcqbyexD.js";import{a as Qs,P as Ws}from"./power-WuQyd1QF.js";import{P as rs}from"./package-check-C8PHQCAA.js";import{S as ss}from"./sparkles-CczcRRJP.js";import{S as Js}from"./settings-2-DYoajNQY.js";import{S as Ys}from"./square-pen-ptW8MQaM.js";/** + * @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 Zs=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],As=Me("list-checks",Zs);/** + * @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:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],ts=Me("scan-line",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 st=[["path",{d:"M2 21a8 8 0 0 1 11.873-7",key:"74fkxq"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m17 17 5 5",key:"p7ous7"}],["path",{d:"m22 17-5 5",key:"gqnmv0"}]],as=Me("user-round-x",st),tt=({accounts:c=[],items:u=[],selectedAccount:x="",onSelectedAccountChange:_})=>{const[C,I]=r.useState([]),[U,y]=r.useState([]),[$,F]=r.useState(!1),[P,R]=r.useState(""),[g,m]=r.useState({scope:"account",buyer_id:"",buyer_nick:"",item_id:"",reason:""}),h=r.useMemo(()=>u.filter(t=>t.cookie_id===x),[u,x]);r.useEffect(()=>{x&&E()},[x]);const E=async()=>{if(x){F(!0);try{const[t,a]=await Promise.all([Ms(x),Xe(x)]);I(t),y(a)}catch(t){k(`加载发货保护配置失败:${t.message}`)}finally{F(!1)}}},N=(t,a)=>{I(o=>o.map(f=>f.rule_code===t?{...f,...a,only_card_after_close:a.auto_close_order===!1?!1:a.only_card_after_close??f.only_card_after_close}:f))},V=async t=>{R(t.rule_code);try{const a=await Ds(x,t.rule_code,{enabled:t.enabled,priority:t.priority,block_reason:t.block_reason,auto_close_order:t.auto_close_order,only_card_after_close:t.only_card_after_close,excluded_item_ids:t.excluded_item_ids,config:t.config});N(t.rule_code,a),k(`“${t.rule_name}”已保存`)}catch(a){k(`保存失败:${a.message}`)}finally{R("")}},J=async()=>{if(!g.buyer_id.trim()){k("请输入买家 ID");return}if(g.scope==="item"&&!g.item_id){k("请选择黑名单生效的商品");return}try{await Fs({account_id:g.scope==="global"?void 0:x,buyer_id:g.buyer_id.trim(),buyer_nick:g.buyer_nick.trim(),item_id:g.scope==="item"?g.item_id:void 0,reason:g.reason.trim(),is_enabled:!0}),m({scope:g.scope,buyer_id:"",buyer_nick:"",item_id:"",reason:""}),y(await Xe(x))}catch(t){k(`添加失败:${t.message}`)}},H=async t=>{try{const a=await Ps(t.id,{is_enabled:!t.is_enabled});y(o=>o.map(f=>f.id===t.id?a:f))}catch(a){k(`更新失败:${a.message}`)}},Y=async t=>{if(await be(`确认移除买家 ${t.buyer_nick||t.buyer_id}?`))try{await Es(t.id),y(a=>a.filter(o=>o.id!==t.id))}catch(a){k(`删除失败:${a.message}`)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"toolbar",children:[e.jsxs("div",{className:"toolbar__group w-full sm:w-auto",children:[e.jsx("label",{htmlFor:"protection-account",className:"text-xs font-bold text-gray-600",children:"应用账号"}),e.jsxs("select",{id:"protection-account",value:x,onChange:t=>_==null?void 0:_(t.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm sm:min-w-72",children:[e.jsx("option",{value:"",children:"请选择账号"}),c.map(t=>e.jsx("option",{value:t.id,children:t.nickname||t.remark||t.id},t.id))]})]}),e.jsxs("button",{type:"button",onClick:()=>void E(),disabled:!x||$,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[e.jsx(De,{className:`h-4 w-4 ${$?"animate-spin":""}`}),"刷新"]})]}),x?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel",children:[e.jsx($e,{title:"发货拦截规则",description:"规则按优先级判定,可对指定商品设置排除项。",icon:ue}),e.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[C.map(t=>e.jsxs("div",{className:"grid gap-4 py-5 xl:grid-cols-[minmax(230px,1fr)_minmax(360px,1.5fr)_44px] xl:items-start",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",role:"switch","aria-checked":t.enabled,onClick:()=>N(t.rule_code,{enabled:!t.enabled}),className:`relative h-6 w-11 rounded-full transition-colors ${t.enabled?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${t.enabled?"translate-x-5":"translate-x-0"}`})}),e.jsx("span",{className:"font-bold text-gray-900",children:t.rule_name})]}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:t.rule_description})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-[100px_1fr]",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["优先级",e.jsx("input",{type:"number",min:0,max:999,value:t.priority,onChange:a=>N(t.rule_code,{priority:Number(a.target.value)}),className:"mt-1 w-full rounded-md border border-gray-200 px-2 py-2 text-sm"})]}),e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["命中后发送给买家的提示",e.jsx("input",{value:t.block_reason,onChange:a=>N(t.rule_code,{block_reason:a.target.value}),placeholder:"留空则只停止发货",className:"mt-1 w-full rounded-md border border-gray-200 px-3 py-2 text-sm font-normal"})]}),e.jsxs("div",{className:"rounded-md border border-gray-200 bg-gray-50 p-3 sm:col-span-2",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["命中后处理",e.jsxs("span",{className:"mt-2 flex items-center gap-2 font-medium text-gray-700",children:[e.jsx("input",{type:"checkbox",checked:t.auto_close_order,onChange:a=>N(t.rule_code,{auto_close_order:a.target.checked,only_card_after_close:a.target.checked?t.only_card_after_close:!1}),className:"h-4 w-4 rounded border-gray-300 text-amber-600"}),"主动关闭闲鱼订单"]})]}),e.jsxs("label",{className:`text-xs font-bold ${t.auto_close_order?"text-gray-600":"text-gray-400"}`,children:["关单后处理",e.jsxs("span",{className:"mt-2 flex items-center gap-2 font-medium",children:[e.jsx("input",{type:"checkbox",disabled:!t.auto_close_order,checked:t.auto_close_order&&t.only_card_after_close,onChange:a=>N(t.rule_code,{only_card_after_close:a.target.checked}),className:"h-4 w-4 rounded border-gray-300 text-amber-600 disabled:opacity-50"}),"关闭成功后仍发送卡券"]})]})]}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-gray-500",children:"未开启“关闭后仍发送卡券”时,规则命中即停止发货;关单失败也会停止发货。"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"text-xs font-bold text-gray-600",children:"排除商品"}),e.jsxs("div",{className:"mt-1 grid gap-2 md:grid-cols-2",children:[e.jsxs("select",{defaultValue:"",onChange:a=>{const o=a.target.value;o&&!t.excluded_item_ids.includes(o)&&N(t.rule_code,{excluded_item_ids:[...t.excluded_item_ids,o]}),a.currentTarget.value=""},className:"rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-normal",children:[e.jsx("option",{value:"",children:"从当前账号商品中选择"}),h.map(a=>e.jsx("option",{value:a.item_id,children:a.item_title||a.item_id},a.item_id))]}),e.jsx("input",{value:t.excluded_item_ids.join(", "),onChange:a=>N(t.rule_code,{excluded_item_ids:a.target.value.split(/[\s,,]+/).map(o=>o.trim()).filter(Boolean)}),placeholder:"也可直接输入商品 ID,逗号分隔",className:"rounded-md border border-gray-200 px-3 py-2 text-sm font-normal"})]}),t.excluded_item_ids.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:t.excluded_item_ids.map(a=>{const o=h.find(f=>f.item_id===a);return e.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded bg-gray-100 px-2 py-1 text-xs text-gray-600",children:[e.jsx("span",{className:"max-w-52 truncate",children:(o==null?void 0:o.item_title)||a}),e.jsx("button",{type:"button",onClick:()=>N(t.rule_code,{excluded_item_ids:t.excluded_item_ids.filter(f=>f!==a)}),title:`移除排除商品 ${a}`,className:"rounded p-0.5 hover:bg-gray-200",children:e.jsx(ne,{className:"h-3 w-3"})})]},a)})})]}),t.rule_code==="buyer_credit_zero"?e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["评价数阈值",e.jsx("input",{type:"number",min:0,max:99999,value:Number(t.config.threshold)||0,onChange:a=>N(t.rule_code,{config:{...t.config,threshold:Math.max(0,Number(a.target.value)||0)}}),className:"mt-1 w-full rounded-md border border-gray-200 px-2 py-2 text-sm"})]}):null,t.rule_code==="buyer_has_order"||t.rule_code==="buyer_has_order_global"?e.jsxs("label",{className:"flex items-center gap-2 text-xs font-bold text-gray-600 sm:col-span-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.config.same_item_only,onChange:a=>N(t.rule_code,{config:{...t.config,same_item_only:a.target.checked}}),className:"h-4 w-4 rounded border-gray-300 text-amber-600"}),"仅在买家已有同一商品订单时拦截"]}):null,t.rule_code==="buyer_unconfirmed"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["未确认订单阈值",e.jsx("input",{type:"number",min:1,max:99,value:Number(t.config.min_count)||1,onChange:a=>N(t.rule_code,{config:{...t.config,min_count:Math.max(1,Number(a.target.value)||1)}}),className:"ios-input mt-1 w-full rounded-md px-3 py-2 text-sm"})]}),e.jsxs("label",{className:"flex items-center gap-2 self-end pb-2 text-xs font-bold text-gray-600",children:[e.jsx("input",{type:"checkbox",checked:!!t.config.same_item_only,onChange:a=>N(t.rule_code,{config:{...t.config,same_item_only:a.target.checked}}),className:"h-4 w-4 rounded border-gray-300 text-amber-600"}),"仅统计同一商品"]})]}):null]}),e.jsx("button",{type:"button",onClick:()=>void V(t),disabled:P===t.rule_code,title:"保存规则",className:"ios-btn-primary flex h-10 w-10 items-center justify-center rounded-md p-0 disabled:opacity-50",children:P===t.rule_code?e.jsx(O,{className:"h-4 w-4 animate-spin"}):e.jsx(ge,{className:"h-4 w-4"})})]},t.rule_code)),!$&&C.length===0&&e.jsx(re,{compact:!0,title:"暂无发货拦截规则",description:"当前账号没有可配置的拦截规则。",icon:ue})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx($e,{title:"买家黑名单",description:"支持商品级、账号级和全部账号三种生效范围。",icon:as}),e.jsxs("div",{className:"grid gap-2 border-b border-gray-200 bg-gray-50/60 p-4 md:grid-cols-2 xl:grid-cols-6",children:[e.jsxs("select",{value:g.scope,onChange:t=>m({...g,scope:t.target.value,item_id:""}),className:"ios-input rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"item",children:"当前商品"}),e.jsx("option",{value:"account",children:"当前账号"}),e.jsx("option",{value:"global",children:"全部账号"})]}),e.jsx("input",{value:g.buyer_id,onChange:t=>m({...g,buyer_id:t.target.value}),placeholder:"买家 ID *",className:"ios-input rounded-md px-3 py-2 text-sm"}),e.jsx("input",{value:g.buyer_nick,onChange:t=>m({...g,buyer_nick:t.target.value}),placeholder:"买家昵称",className:"ios-input rounded-md px-3 py-2 text-sm"}),g.scope==="item"?e.jsxs("select",{value:g.item_id,onChange:t=>m({...g,item_id:t.target.value}),className:"ios-input rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"选择商品 *"}),h.map(t=>e.jsx("option",{value:t.item_id,children:t.item_title||t.item_id},t.item_id))]}):e.jsx("div",{className:"flex items-center rounded-md border border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-500",children:g.scope==="account"?"对当前账号全部商品生效":"对名下全部闲鱼账号生效"}),e.jsx("input",{value:g.reason,onChange:t=>m({...g,reason:t.target.value}),placeholder:"拉黑原因",className:"ios-input rounded-md px-3 py-2 text-sm"}),e.jsx("button",{type:"button",onClick:()=>void J(),className:"ios-btn-danger rounded-md px-4 py-2 text-sm",children:"加入黑名单"})]}),e.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[U.map(t=>e.jsxs("div",{className:"flex flex-col gap-3 py-3 sm:flex-row sm:items-center",children:[e.jsx("button",{type:"button",role:"switch","aria-checked":t.is_enabled,onClick:()=>void H(t),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${t.is_enabled?"bg-red-500":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${t.is_enabled?"translate-x-5":"translate-x-0"}`})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"font-bold text-gray-900",children:t.buyer_nick||t.buyer_id}),e.jsxs("p",{className:"break-all text-xs text-gray-500",children:["ID ",t.buyer_id,t.item_id?` · 商品级 · ${t.item_id}`:t.account_id?` · 账号级 · ${t.account_id}`:" · 全部账号",t.reason?` · ${t.reason}`:""]})]}),e.jsx("button",{type:"button",onClick:()=>void Y(t),title:"移除黑名单",className:"ios-btn-danger flex h-9 w-9 items-center justify-center rounded-md p-0",children:e.jsx(ye,{className:"h-4 w-4"})})]},t.id)),U.length===0&&e.jsx(re,{compact:!0,title:"暂无买家黑名单",description:"当前账号没有适用的黑名单记录。",icon:as})]})]})]}):e.jsx(re,{title:"请选择闲鱼账号",description:"选择账号后可管理发货拦截规则和买家黑名单。",icon:ue})]})},ls={keyword:"",cookieId:"",cardId:"",deliveryCount:1,description:"",enabled:!0},at=({accounts:c,cards:u,rules:x,onReload:_})=>{const[C,I]=r.useState(null),[U,y]=r.useState(!1),[$,F]=r.useState(!1),[P,R]=r.useState(!1),[g,m]=r.useState(""),[h,E]=r.useState(ls),N=()=>{I(null),E(ls),y(!0)},V=a=>{I(a),E({keyword:a.item_keyword,cookieId:a.cookie_id||"",cardId:String(a.card_group_id),deliveryCount:Math.max(1,a.priority||1),description:a.name||"",enabled:a.enabled}),y(!0)},J=async()=>{R(!0);try{await _()}catch(a){k(`刷新失败:${a.message}`)}finally{R(!1)}},H=async()=>{if(!h.keyword.trim()){k("请填写触发关键词");return}if(!h.cardId){k("请选择发货卡密或内容");return}F(!0);try{await Ce({id:C==null?void 0:C.id,item_keyword:h.keyword.trim(),cookie_id:h.cookieId||void 0,item_id:void 0,card_group_id:Number(h.cardId),priority:Math.max(1,Math.floor(h.deliveryCount||1)),name:h.description.trim(),enabled:h.enabled}),await _(),y(!1),k("通用发货规则已保存")}catch(a){k(`保存失败:${a.message}`)}finally{F(!1)}},Y=async a=>{m(a.id);try{await Ce({...a,enabled:!a.enabled}),await _()}catch(o){k(`更新失败:${o.message}`)}finally{m("")}},t=async a=>{if(await be(`确认删除通用发货规则“${a.item_keyword}”吗?`)){m(a.id);try{await Ie(a.id),await _(),k("通用发货规则已删除")}catch(o){k(`删除失败:${o.message}`)}finally{m("")}}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx($e,{title:"账号与全局兜底规则",description:"按商品标题或本地详情关键词匹配,商品专属规则优先。",icon:Ge,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>void J(),disabled:P,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm disabled:opacity-50",children:[e.jsx(De,{className:`h-4 w-4 ${P?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:N,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(he,{className:"h-4 w-4"}),"添加规则"]})]})}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[x.map(a=>{const o=g===a.id,f=c.find(X=>X.id===a.cookie_id);return e.jsx("article",{className:`p-4 ${a.enabled?"":"opacity-70"}`,children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center",children:[e.jsx("div",{className:`flex h-11 w-11 flex-none items-center justify-center rounded-md ${a.enabled?"bg-blue-50 text-blue-700":"bg-gray-100 text-gray-400"}`,children:e.jsx(Ge,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h4",{className:"font-bold text-gray-900",children:a.item_keyword}),e.jsx("span",{className:`rounded px-2 py-1 text-xs font-bold ${a.enabled?"bg-green-50 text-green-700":"bg-gray-100 text-gray-500"}`,children:a.enabled?"已启用":"已停用"}),e.jsx("span",{className:"rounded bg-blue-50 px-2 py-1 text-xs font-bold text-blue-700",children:a.cookie_id?"指定账号":"全部账号"})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-5 gap-y-1 text-sm text-gray-600",children:[e.jsxs("span",{children:["发货:",a.card_group_name||`卡密 ${a.card_group_id}`]}),e.jsxs("span",{children:["每单:",Math.max(1,a.priority||1)," 份"]}),a.cookie_id&&e.jsxs("span",{children:["账号:",(f==null?void 0:f.nickname)||(f==null?void 0:f.remark)||a.cookie_id]})]}),a.name&&e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:a.name})]}),e.jsxs("div",{className:"flex flex-none justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void Y(a),disabled:o,className:`rounded-md p-2.5 ${a.enabled?"bg-amber-50 text-amber-700 hover:bg-amber-100":"bg-green-50 text-green-700 hover:bg-green-100"}`,title:a.enabled?"停用规则":"启用规则","aria-label":a.enabled?"停用规则":"启用规则",children:o?e.jsx(O,{className:"h-4 w-4 animate-spin"}):a.enabled?e.jsx(Gs,{className:"h-4 w-4"}):e.jsx(Qs,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>V(a),disabled:o,className:"rounded-md bg-gray-100 p-2.5 text-gray-700 hover:bg-gray-200",title:"编辑规则","aria-label":"编辑规则",children:e.jsx(Ws,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void t(a),disabled:o,className:"rounded-md bg-red-50 p-2.5 text-red-600 hover:bg-red-100",title:"删除规则","aria-label":"删除规则",children:e.jsx(ye,{className:"h-4 w-4"})})]})]})},a.id)}),x.length===0&&e.jsx(re,{compact:!0,title:"暂无通用发货规则",description:"可添加指定账号或全部账号适用的关键词兜底规则。",icon:rs})]})]}),U&&pe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:C?"编辑通用发货规则":"添加通用发货规则"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"未指定账号时对当前用户的全部闲鱼账号生效。"})]}),e.jsx("button",{type:"button",onClick:()=>y(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(ne,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-account",children:"适用账号"}),e.jsxs("select",{id:"generic-rule-account",value:h.cookieId,onChange:a=>E(o=>({...o,cookieId:a.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"全部账号"}),c.map(a=>e.jsx("option",{value:a.id,children:a.nickname||a.remark||a.id},a.id))]})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-keyword",children:"商品关键词"}),e.jsx("input",{id:"generic-rule-keyword",value:h.keyword,onChange:a=>E(o=>({...o,keyword:a.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"例如:Kimi、会员、周卡"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-card",children:"发货卡密或内容"}),e.jsxs("select",{id:"generic-rule-card",value:h.cardId,onChange:a=>E(o=>({...o,cardId:a.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择"}),u.map(a=>e.jsxs("option",{value:a.id,disabled:!a.enabled,children:[a.name||`卡密 ${a.id}`,a.enabled?"":"(已停用)"]},a.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-count",children:"每单发货数量"}),e.jsx("input",{id:"generic-rule-count",type:"number",min:1,step:1,value:h.deliveryCount,onChange:a=>E(o=>({...o,deliveryCount:Math.max(1,Number(a.target.value)||1)})),className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"generic-rule-description",children:"规则备注"}),e.jsx("input",{id:"generic-rule-description",value:h.description,onChange:a=>E(o=>({...o,description:a.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"便于识别此规则"})]}),e.jsxs("div",{className:"sm:col-span-2 flex items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-gray-800",children:"启用规则"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"关闭后保留配置,但不会参与匹配。"})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":h.enabled,onClick:()=>E(a=>({...a,enabled:!a.enabled})),className:`relative inline-flex h-6 w-11 items-center rounded-full ${h.enabled?"bg-[#ffe100]":"bg-[#e8dcbc]"}`,"aria-label":"启用通用发货规则",children:e.jsx("span",{className:`h-4 w-4 rounded-full bg-white transition-transform ${h.enabled?"translate-x-6":"translate-x-1"}`})})]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>y(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:()=>void H(),disabled:$,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 disabled:opacity-50",children:[$?e.jsx(O,{className:"h-4 w-4 animate-spin"}):e.jsx(ge,{className:"h-4 w-4"}),"保存规则"]})]})]})}),document.body)]})};function lt({cookieId:c,itemId:u}){const[x,_]=r.useState([]),[C,I]=r.useState(!1),[U,y]=r.useState(""),[$,F]=r.useState(""),P=m=>{if(_(m.options),F(m.detection_status),m.detection_status==="unauthorized")y("该账号没有卖家 SKU 权限,可尝试买家接口(风控风险更高,只调一次)");else if(m.detection_status==="risk_control"){const h=Math.max(1,Math.ceil((m.retry_after_seconds||0)/60));y(`触发平台风控,请约 ${h} 分钟后再试`)}else m.options.length?y(`已识别 ${m.options.length} 个 SKU`):y(m.warning?`商家接口暂不可用:${m.warning}`:"暂无可识别 SKU")},R=async()=>{I(!0),y("");try{P(await Bs(c,u))}catch(m){F(""),y(m instanceof Error?m.message:"SKU 识别失败")}finally{I(!1)}},g=async()=>{if(await be("买家接口会以买家身份读取商品详情,风控风险更高,只调用一次且失败不会自动重试。确认继续吗?",{title:"尝试买家接口",confirmLabel:"仍然调用一次",danger:!0})){I(!0),y("");try{P(await Rs(c,u))}catch(h){y(h instanceof Error?h.message:"买家接口识别失败")}finally{I(!1)}}};return e.jsxs("section",{className:"mt-4 rounded-md border border-cyan-200 bg-cyan-50/40 p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-gray-900",children:"SKU 识别"}),e.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"只读取并展示商品规格,不在这里设置防薅限制。"})]}),e.jsxs("div",{className:"flex gap-2",children:[$==="unauthorized"&&e.jsxs("button",{type:"button",onClick:g,disabled:C,className:"inline-flex items-center gap-1 rounded-md border border-amber-500 px-3 py-2 text-xs font-semibold text-amber-700 disabled:opacity-50",children:[e.jsx(ts,{size:14}),"尝试买家接口"]}),e.jsxs("button",{type:"button",onClick:R,disabled:C,className:"inline-flex items-center gap-1 rounded-md border border-cyan-600 px-3 py-2 text-xs font-semibold text-cyan-700 disabled:opacity-50",children:[e.jsx(ts,{size:14}),C?"处理中":"识别 SKU"]})]})]}),U&&e.jsx("p",{className:"mt-2 text-xs text-cyan-800",children:U}),x.length>0&&e.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:x.map(m=>e.jsxs("div",{className:"rounded border border-cyan-100 bg-white p-3",children:[e.jsx("p",{className:"truncate text-xs font-semibold text-gray-800",children:m.name}),e.jsx("p",{className:"truncate font-mono text-[10px] text-gray-500",children:m.key})]},m.key))})]})}const is={cookieId:"",itemId:"",title:"",price:"",imageUrl:"",description:"",detail:""},me=(c=0)=>({clientId:`${Date.now()}-${c}-${Math.random().toString(36).slice(2)}`,displayName:"",specText:"",platformSkuId:"",cardId:"",deliveryCount:1,enabled:!0}),z=c=>`${c.cookie_id}:${c.item_id}`,it=c=>{const u=c==null?void 0:c.trim().replace(/^[¥¥]\s*/,"");return u?`¥${u}`:"价格未知"},nt=c=>{const u=c==null?void 0:c.trim();return u?u.startsWith("//")?`https:${u}`:u:""},ds={api:"API 动态内容",text:"固定文本",data:"批量库存",image:"图片内容"},rt=c=>c?c.enabled?c.type==="data"?`当前可用 ${(c.data_content||"").split(/\r?\n/).filter(x=>x.trim()).length} 条`:ds[c.type]:"该库存已停用":"尚未选择发货库存",dt=({item:c})=>{const u=nt(c.item_image),[x,_]=r.useState(!1);return r.useEffect(()=>_(!1),[u]),!u||x?e.jsx("div",{className:"flex h-full w-full items-center justify-center text-gray-400",children:e.jsx(ns,{className:"h-8 w-8"})}):e.jsx("img",{src:u,alt:c.item_title||"商品图片",className:"h-full w-full object-cover",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>_(!0)})},xe=({checked:c,disabled:u,label:x,onChange:_})=>e.jsx("button",{type:"button",role:"switch","aria-checked":c,"aria-label":x,disabled:u,onClick:_,className:`relative inline-flex h-6 w-11 flex-none items-center rounded-full transition-colors ${c?"bg-[#ffe100]":"bg-[#e8dcbc]"} disabled:cursor-not-allowed disabled:opacity-50`,children:e.jsx("span",{className:`h-4 w-4 rounded-full bg-white shadow-sm transition-transform ${c?"translate-x-6":"translate-x-1"}`})}),_t=()=>{const[c,u]=r.useState([]),[x,_]=r.useState([]),C=r.useRef(null),[I,U]=r.useState([]),[y,$]=r.useState([]),[F,P]=r.useState([]),[R,g]=r.useState("products"),[m,h]=r.useState(""),[E,N]=r.useState(!0),[V,J]=r.useState(!1),[H,Y]=r.useState(!1),[t,a]=r.useState(""),[o,f]=r.useState(1),[X,os]=r.useState(20),[G,L]=r.useState(""),[fe,j]=r.useState(null),[Q,de]=r.useState(null),[je,Fe]=r.useState(""),[M,se]=r.useState(null),[Pe,Ee]=r.useState(!1),[b,K]=r.useState({enabled:!0,isMultiSpec:!1,variants:[me()]}),[cs,oe]=r.useState(!1),[v,q]=r.useState(is),te=r.useMemo(()=>new Map(x.map(s=>[s.id,s.nickname||s.remark||`账号 ${s.id.substring(0,6)}`])),[x]),Be=r.useMemo(()=>new Map(x.map(s=>[s.id,s.avatar_url||""])),[x]),ae=r.useMemo(()=>{const s=new Map;return y.forEach(l=>{l.cookie_id&&l.item_id&&s.set(`${l.cookie_id}:${l.item_id}`,l)}),s},[y]),Re=r.useMemo(()=>y.filter(s=>!s.item_id),[y]),Le=r.useMemo(()=>new Map(F.map(s=>[`${s.cookie_id}:${s.item_id}`,s])),[F]),[S,ms]=r.useState("on_sale"),W=s=>s.listing_status==="off_shelf",_e=s=>s.listing_status==="draft",Z=r.useMemo(()=>t?c.filter(s=>s.cookie_id===t):c,[c,t]),ce=r.useMemo(()=>Z.filter(s=>!W(s)&&!_e(s)).length,[Z]),Te=r.useMemo(()=>Z.filter(W).length,[Z]),xs=r.useCallback(s=>c.filter(l=>l.cookie_id===s&&!W(l)&&!_e(l)).length,[c]),[w,ze]=r.useState(null),[Ne,Ue]=r.useState(!1),Ke=r.useMemo(()=>{const s=(w==null?void 0:w.items)||[];return t?s.filter(l=>l.cookie_id===t):s},[w,t]),ve=(w==null?void 0:w.total)??null,qe=(w==null?void 0:w.notice)||"",Oe=r.useCallback(async()=>{var d;const s=t||"__all__",l=t?[t]:x.map(i=>i.id);if(l.length&&(w==null?void 0:w.scope)!==s){Ue(!0);try{const i=await Promise.all(l.map(async D=>{try{return await Ls(D,"草稿",1)}catch(B){return{success:!1,group_name:"草稿",page:1,total:0,items:[],notice:"",_error:(B==null?void 0:B.message)||"拉取失败"}}})),n=[];let p=0,T="",ee="";for(const D of i)D&&D.success?(p+=typeof D.total=="number"?D.total:((d=D.items)==null?void 0:d.length)||0,(D.items||[]).forEach(B=>{n.push({id:`draft:${B.cookie_id||""}:${B.item_id}`,cookie_id:B.cookie_id,item_id:B.item_id,item_title:B.item_title,item_price:B.item_price,item_image:B.item_image,listing_status:"draft"})}),D.notice&&(T=D.notice)):(T=T||D.notice||"",ee=ee||D._error||"");ze({scope:s,items:n,total:p,notice:T,error:ee})}catch(i){ze({scope:s,items:[],total:0,notice:"",error:(i==null?void 0:i.message)||"拉取失败"})}finally{Ue(!1)}}},[t,x]);r.useEffect(()=>{S==="draft"&&Oe()},[S,Oe]);const le=r.useMemo(()=>{if(S==="draft")return Ke;const s=Z;return S==="on_sale"?s.filter(l=>!W(l)&&!_e(l)):s.filter(W)},[Z,S,Ke]),ie=Math.max(1,Math.ceil(le.length/X)),ps=r.useMemo(()=>le.slice((o-1)*X,o*X),[le,o,X]);r.useEffect(()=>{o>ie&&f(1)},[ie,o]);const us=r.useMemo(()=>{const s=new Set(F.map(l=>`${l.cookie_id}:${l.item_id}`));return y.forEach(l=>{l.cookie_id&&l.item_id&&s.add(`${l.cookie_id}:${l.item_id}`)}),s.size},[F,y]),hs=async()=>{N(!0);try{const[s,l,d,i,n]=await Promise.all([We(),ke(),Je(),Ye(),Se()]);_(s),u(l),U(d),$(i),P(n),h(p=>{var T;return p||((T=s[0])==null?void 0:T.id)||""})}catch(s){j({type:"error",message:s instanceof Error?s.message:"商品数据加载失败"})}finally{N(!1)}},gs=async()=>{const s=await Ye();$(s)},Ve=async()=>{P(await Se())};r.useEffect(()=>{hs();const s=()=>{We().then(_).catch(()=>{}),Je().then(U).catch(()=>{}),Se().then(P).catch(()=>{})},l=setInterval(s,3e4),d=C.current;let i;return d&&(i=new IntersectionObserver(n=>{n.some(p=>p.isIntersecting)&&s()}),i.observe(d)),()=>{clearInterval(l),i==null||i.disconnect()}},[]);const ys=async()=>{if(!m){j({type:"error",message:"请先选择需要同步的账号"});return}J(!0),j(null);try{const s=await Ts(m);if((s==null?void 0:s.success)===!1)throw new Error(s.message||"同步失败");u(await ke()),j({type:"success",message:(s==null?void 0:s.message)||"商品同步完成"})}catch(s){j({type:"error",message:s instanceof Error?s.message:"同步失败"})}finally{J(!1)}},bs=async()=>{Y(!0),j(null);try{const s=await zs(m||void 0);if((s==null?void 0:s.success)===!1)throw new Error(s.message||"擦亮失败");j({type:"success",message:(s==null?void 0:s.message)||"商品擦亮完成"})}catch(s){j({type:"error",message:s instanceof Error?s.message:"擦亮失败"})}finally{Y(!1)}},He=()=>{var s;q({...is,cookieId:m||((s=x[0])==null?void 0:s.id)||""}),oe(!0)},fs=async()=>{if(!v.cookieId||!v.itemId.trim()||!v.title.trim()){j({type:"error",message:"账号、商品 ID 和商品标题为必填项"});return}L("manual-item");try{await Os({cookie_id:v.cookieId,item_id:v.itemId.trim(),title:v.title.trim(),price:v.price.trim(),image_url:v.imageUrl.trim(),description:v.description.trim(),detail:v.detail.trim()}),u(await ke()),oe(!1),j({type:"success",message:"商品已添加,可继续配置自动发货"})}catch(s){j({type:"error",message:s instanceof Error?s.message:"商品添加失败"})}finally{L("")}},js=s=>{de(s),Fe(s.item_detail||"")},_s=async()=>{if(!Q)return;const s=z(Q);L(s);try{await qs(Q.cookie_id,Q.item_id,je),u(l=>l.map(d=>z(d)===s?{...d,item_detail:je}:d)),de(null),j({type:"success",message:"商品详情已保存"})}catch(l){j({type:"error",message:l instanceof Error?l.message:"保存失败"})}finally{L("")}},we=async s=>{const l=ae.get(z(s));se(s),Ee(!0);try{const d=await Ze(s.cookie_id,s.item_id);d.configured&&d.variants.length>0?K({enabled:d.enabled,isMultiSpec:d.is_multi_spec,variants:d.variants.map((i,n)=>({clientId:String(i.id||me(n).clientId),displayName:i.display_name||"",specText:i.spec_text||"",platformSkuId:i.platform_sku_id||"",cardId:i.card_id?String(i.card_id):"",deliveryCount:Math.max(1,i.delivery_count||1),enabled:i.enabled&&i.binding_enabled}))}):K({enabled:(l==null?void 0:l.enabled)??!0,isMultiSpec:!1,variants:[{...me(),displayName:"默认规格",cardId:l!=null&&l.card_group_id?String(l.card_group_id):"",deliveryCount:Math.max(1,(l==null?void 0:l.priority)||1)}]})}catch(d){se(null),j({type:"error",message:d instanceof Error?d.message:"发货配置加载失败"})}finally{Ee(!1)}},A=(s,l)=>{K(d=>({...d,variants:d.variants.map(i=>i.clientId===s?{...i,...l}:i)}))},Ns=()=>{K(s=>({...s,variants:[...s.variants,me(s.variants.length)]}))},vs=s=>{K(l=>l.variants.length<=1?l:{...l,variants:l.variants.filter(d=>d.clientId!==s)})},ws=async()=>{if(!M)return;const s=b.isMultiSpec?b.variants:b.variants.slice(0,1);if(s.length===0){j({type:"error",message:"至少需要保留一个商品规格"});return}const l=s.findIndex(n=>!n.cardId||b.isMultiSpec&&(!n.displayName.trim()||!n.specText.trim()));if(l>=0){j({type:"error",message:b.isMultiSpec?`请完整填写第 ${l+1} 个规格名称、规格组合和发货库存`:"请选择自动发货使用的卡密或内容"});return}const d=z(M),i=ae.get(d);L(d);try{await Ae(M.cookie_id,M.item_id,{enabled:b.enabled,is_multi_spec:b.isMultiSpec,variants:s.map(n=>({display_name:b.isMultiSpec?n.displayName.trim():"默认规格",spec_text:b.isMultiSpec?n.specText.trim():"",spec_payload:void 0,platform_sku_id:b.isMultiSpec?n.platformSkuId.trim():"",card_id:Number(n.cardId),delivery_count:Math.max(1,Math.floor(n.deliveryCount||1)),enabled:n.enabled,binding_enabled:n.enabled,source:"manual"}))}),i&&(await Ie(i.id),$(n=>n.filter(p=>p.id!==i.id))),u(n=>n.map(p=>z(p)===d?{...p,is_multi_spec:b.isMultiSpec}:p)),await Ve(),se(null),j({type:"success",message:"商品自动发货配置已保存"})}catch(n){j({type:"error",message:n instanceof Error?n.message:"发货配置保存失败"})}finally{L("")}},ks=async s=>{const l=z(s),d=Le.get(l),i=ae.get(l);if(!d&&!i){we(s);return}L(l);try{if(d){const n=await Ze(s.cookie_id,s.item_id);await Ae(s.cookie_id,s.item_id,{enabled:!n.enabled,is_multi_spec:n.is_multi_spec,variants:n.variants.map(p=>({display_name:p.display_name,spec_text:p.spec_text,spec_payload:p.spec_payload,platform_sku_id:p.platform_sku_id,card_id:p.card_id,delivery_count:p.delivery_count,enabled:p.enabled,binding_enabled:p.binding_enabled,source:p.source||"manual"}))}),await Ve()}else i&&(await Ce({...i,enabled:!i.enabled}),$(n=>n.map(p=>p.id===i.id?{...p,enabled:!i.enabled}:p)))}catch(n){j({type:"error",message:n instanceof Error?n.message:"状态更新失败"})}finally{L("")}},Ss=async s=>{if(!await be(`确认删除商品“${s.item_title||s.item_id}”的本地记录吗?`))return;const l=z(s),d=ae.get(l);L(l);try{d&&await Ie(d.id),await Ks(s.cookie_id,s.item_id),u(i=>i.filter(n=>z(n)!==l)),$(i=>i.filter(n=>n.id!==(d==null?void 0:d.id))),P(i=>i.filter(n=>`${n.cookie_id}:${n.item_id}`!==l)),j({type:"success",message:"商品及其专属发货配置已删除"})}catch(i){j({type:"error",message:i instanceof Error?i.message:"删除失败"})}finally{L("")}},Cs=async(s,l)=>{const d=z(s),i=!s[l];L(d);try{await Us(s.cookie_id,s.item_id,i),u(n=>n.map(p=>z(p)===d?{...p,[l]:i}:p))}catch(n){j({type:"error",message:n instanceof Error?n.message:"状态更新失败"})}finally{L("")}};return E?e.jsx(es,{label:"正在加载商品与发货配置"}):e.jsxs("div",{ref:C,className:"page-stack animate-fade-in",children:[e.jsx(Vs,{title:"商品与发货",description:"同步在售商品并配置自动发货。",icon:ns,badge:e.jsxs("span",{className:"status-badge status-badge-info",children:[S==="on_sale"&&`在售 ${ce} 件`,S==="off_shelf"&&`已下架 ${Te} 件`,S==="draft"&&`草稿 ${ve??"—"} 件`]})}),e.jsx(Hs,{value:R,onChange:g,items:[{id:"products",label:"商品与专属发货",icon:Qe,count:ce},{id:"rules",label:"通用发货规则",icon:As,count:Re.length},{id:"protection",label:"发货保护与黑名单",icon:ue}],ariaLabel:"商品与发货功能"}),fe&&e.jsx(Xs,{type:fe.type,message:fe.message,onClose:()=>j(null)}),e.jsx("section",{hidden:R!=="products",className:"space-y-4",children:e.jsxs("section",{className:"section-panel",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-gray-200 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{className:"ios-input rounded-md px-3 py-2 text-sm",value:m,onChange:s=>{h(s.target.value),a(s.target.value),f(1)},"aria-label":"选择账号",children:[e.jsxs("option",{value:"",children:["全部账号(在售 ",ce,")"]}),x.map(s=>e.jsxs("option",{value:s.id,children:[te.get(s.id),"(在售 ",xs(s.id),")"]},s.id))]}),e.jsxs("span",{className:"text-xs text-gray-500",children:["已配置专属发货 ",us," 件"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:He,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm",children:[e.jsx(he,{className:"h-4 w-4"}),"手动添加"]}),e.jsxs("button",{type:"button",onClick:ys,disabled:V||!m,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm",title:m?"从闲鱼拉取该账号的在售商品":"请先在左侧选择账号",children:[e.jsx(De,{className:`h-4 w-4 ${V?"animate-spin":""}`}),V?"正在同步":"同步商品"]}),e.jsxs("button",{type:"button",onClick:bs,disabled:H||c.length===0,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm",title:"重新获取搜索曝光,平台对每日擦亮次数有限制",children:[e.jsx(ss,{className:`h-4 w-4 ${H?"animate-pulse":""}`}),H?"正在擦亮":"一键擦亮"]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-gray-200 px-4 py-2",role:"tablist","aria-label":"商品状态",children:[[{id:"on_sale",label:"在售",count:ce},{id:"off_shelf",label:"已下架",count:Te},{id:"draft",label:"草稿",count:ve}].map(s=>{const l=S===s.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":l,onClick:()=>{ms(s.id),f(1)},className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors ${l?"bg-[var(--brand)] font-semibold text-[var(--brand-ink)] shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"}`,children:[s.label,e.jsx("span",{className:`text-xs ${l?"text-[var(--brand-ink)]/70":"text-gray-400"}`,children:s.id==="draft"&&ve===null?"—":s.count})]},s.id)}),S==="draft"&&Ne&&e.jsxs("span",{className:"ml-1 flex items-center gap-1 text-xs text-gray-400",children:[e.jsx(O,{className:"h-3.5 w-3.5 animate-spin"}),"正在从闲鱼拉取草稿…"]}),S==="draft"&&!Ne&&qe&&e.jsx("span",{className:"ml-1 text-xs text-gray-400",children:qe})]}),le.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("div",{className:"min-w-full xl:min-w-[1200px]",children:[e.jsxs("div",{className:"hidden grid-cols-[340px_140px_260px_210px_110px] border-b-2 border-gray-300 bg-gray-100 text-xs font-bold text-gray-600 xl:grid [&>span]:border-r [&>span]:border-gray-300 [&>span]:px-4 [&>span]:py-3 [&>span:nth-child(2)]:px-2 [&>span:last-child]:border-r-0",children:[e.jsx("span",{children:"商品信息"}),e.jsx("span",{children:"所属账号"}),e.jsx("span",{children:"专属自动发货"}),e.jsx("span",{children:"商品能力"}),e.jsx("span",{className:"text-right",children:"操作"})]}),e.jsx("div",{className:"divide-y-2 divide-gray-200",children:ps.map(s=>{const l=z(s),d=G===l,i=ae.get(l),n=Le.get(l),p=!!(n||i),T=(n==null?void 0:n.enabled)??!!(i!=null&&i.enabled),ee=!!(n&&!n.complete),D=T?ee?"status-badge-warning":"status-badge-success":p?"status-badge-warning":"status-badge-info",B=T?ee?"待完善":"发货中":p?"已暂停":"未配置",Is=n?n.is_multi_spec?`${n.configured_count}/${n.variant_count} 个规格已绑定`:"普通商品发货":(i==null?void 0:i.card_group_name)||(i?`卡密 ${i.card_group_id}`:"尚未绑定发货内容"),$s=n?n.complete?`累计发货 ${n.delivery_times} 次`:"存在未启用或不可用的规格库存":i?`每单发货 ${i.priority} 份`:"配置后可按订单自动发货";return e.jsxs("article",{className:"grid gap-4 px-4 py-4 transition-colors hover:bg-[#fffdf0] xl:grid-cols-[340px_140px_260px_210px_110px] xl:items-stretch xl:gap-0 xl:px-0 xl:[&>*]:flex xl:[&>*]:min-w-0 xl:[&>*]:flex-col xl:[&>*]:justify-center xl:[&>*]:border-r xl:[&>*]:border-gray-200 xl:[&>*]:px-4 xl:[&>*:first-child]:!flex-row xl:[&>*:first-child]:items-center xl:[&>*:last-child]:border-r-0",children:[e.jsxs("div",{className:"flex min-w-0 gap-3",children:[e.jsx("div",{className:"h-20 w-20 flex-none overflow-hidden rounded-md border border-gray-200 bg-gray-100",children:e.jsx(dt,{item:s})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-start gap-2",children:[e.jsx("h3",{className:`min-w-0 flex-1 text-sm font-bold leading-5 ${W(s)?"text-gray-400 line-through":"text-gray-900"}`,children:s.item_title||"未命名商品"}),W(s)&&e.jsx("span",{className:"status-badge shrink-0 bg-gray-100 text-gray-500",title:s.last_seen_at?`最后一次被闲鱼返回:${s.last_seen_at}`:"闲鱼商品列表已不再返回这件商品",children:"已下架"}),e.jsx("span",{className:`status-badge shrink-0 ${D}`,children:B})]}),e.jsx("p",{className:"mt-1 text-lg font-bold text-[#d92d20]",children:it(s.item_price)}),e.jsxs("p",{className:"mt-1 truncate font-mono text-xs text-gray-400",children:["商品 ID ",s.item_id]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-t border-gray-100 pt-3 xl:!flex-row xl:items-center xl:gap-1.5 xl:border-0 xl:px-2 xl:pt-0",children:[Be.get(s.cookie_id)?e.jsx("img",{src:Be.get(s.cookie_id),alt:"",className:"h-7 w-7 flex-none rounded-full object-cover",referrerPolicy:"no-referrer"}):e.jsx("span",{className:"flex h-7 w-7 flex-none items-center justify-center rounded-full bg-gray-200 text-[10px] text-gray-500",children:(te.get(s.cookie_id)||"?").slice(0,1)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-xs font-semibold text-gray-800",children:te.get(s.cookie_id)||"未命名账号"}),e.jsx("p",{className:"truncate font-mono text-[10px] text-gray-400",children:s.cookie_id})]})]}),e.jsxs("div",{className:"border-t border-gray-100 pt-3 xl:border-0 xl:pt-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:`h-4 w-4 shrink-0 ${T?"text-green-600":"text-gray-400"}`}),e.jsx("span",{className:"text-sm font-bold text-gray-800",children:Is})]}),e.jsx("p",{className:"mt-1 truncate text-xs text-gray-500",children:$s})]}),e.jsxs("div",{className:"flex flex-none flex-col items-center gap-1",children:[e.jsx(xe,{checked:T,disabled:d,label:`${s.item_title||s.item_id} 自动发货`,onChange:()=>ks(s)}),e.jsx("span",{className:"text-[10px] font-semibold text-gray-500",children:"总开关"})]})]}),e.jsxs("button",{type:"button",onClick:()=>we(s),disabled:d,className:"ios-btn-secondary mt-3 flex w-full items-center justify-center gap-2 rounded-md px-3 py-2 text-xs",children:[e.jsx(Js,{className:"h-4 w-4"}),p?"编辑发货策略":"配置自动发货"]}),e.jsxs("button",{type:"button",onClick:()=>we(s),disabled:d,className:"mt-2 flex w-full items-center justify-center gap-2 rounded-md border border-cyan-300 bg-cyan-50 px-3 py-2 text-xs font-semibold text-cyan-700 hover:bg-cyan-100",children:[e.jsx(ss,{className:"h-4 w-4"}),"识别 SKU"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 border-t border-gray-100 pt-3 sm:grid-cols-3 xl:grid-cols-1 xl:gap-0 xl:border-0 xl:pt-0 xl:[&>div]:border-b xl:[&>div]:border-dashed xl:[&>div]:border-gray-200 xl:[&>div]:py-1.5 xl:[&>div:last-child]:border-b-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-600",children:"规格模式"}),e.jsx("span",{className:"text-xs font-bold text-gray-800",children:n?n.is_multi_spec?`${n.variant_count} 个规格`:"普通商品":s.is_multi_spec?"旧版多规格":"普通商品"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-600",title:"买家一次买 N 件时是否发 N 份",children:"多数量"}),e.jsx(xe,{checked:!!s.multi_quantity_delivery,disabled:d,label:`${s.item_title||s.item_id} 多数量发货`,onChange:()=>Cs(s,"multi_quantity_delivery")})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-600",children:"本地详情"}),e.jsx("span",{className:`text-xs font-bold ${s.item_detail?"text-gray-800":"text-gray-400"}`,children:s.item_detail?"已维护":"暂无"})]})]}),e.jsx("div",{className:"flex items-center justify-end gap-1 border-t border-gray-100 pt-3 xl:!flex-row xl:items-center xl:justify-end xl:border-0 xl:pt-0",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>js(s),disabled:d,className:"rounded-md p-2 text-gray-600 hover:bg-gray-100",title:"编辑本地详情","aria-label":"编辑本地详情",children:e.jsx(Ys,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>Ss(s),disabled:d,className:"rounded-md p-2 text-red-500 hover:bg-red-50",title:"删除本地记录","aria-label":"删除本地记录",children:d?e.jsx(O,{className:"h-4 w-4 animate-spin"}):e.jsx(ye,{className:"h-4 w-4"})})]})})]},l)})})]})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-gray-200 px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-500",children:["第 ",o," 页 / 共 ",ie," 页(",le.length," 件)"]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-gray-500",children:["每页",e.jsx("select",{value:X,onChange:s=>{os(Number(s.target.value)),f(1)},className:"ios-input rounded-md px-2 py-1 text-sm","aria-label":"每页显示数量",children:[10,20,50,100].map(s=>e.jsx("option",{value:s,children:s},s))}),"件"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",disabled:o<=1,onClick:()=>f(s=>Math.max(1,s-1)),className:"rounded-md bg-gray-50 px-3 py-2 text-sm text-gray-600 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",children:"上一页"}),e.jsx("button",{type:"button",disabled:o>=ie,onClick:()=>f(s=>Math.min(ie,s+1)),className:"rounded-md bg-gray-50 px-3 py-2 text-sm text-gray-600 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",children:"下一页"})]})]})]}):e.jsx(re,{title:S==="off_shelf"?"没有已下架商品":S==="draft"?"没有草稿":"暂无商品数据",description:S==="off_shelf"?"该账号目前没有被下架的商品。下架的商品会从在售列表移出,同步后自动归到这里。":S==="draft"?Ne?"正在从闲鱼拉取草稿…":w!=null&&w.error?`草稿拉取失败:${w.error}`:"该账号在闲鱼上没有未发布的草稿。":"先选择闲鱼账号同步在售商品,也可以手动添加商品并直接配置自动发货。",icon:Qe,action:e.jsx("button",{type:"button",onClick:He,className:"ios-btn-secondary rounded-md px-4 py-2 text-sm",children:"手动添加商品"})})]})}),e.jsx("section",{hidden:R!=="rules",children:e.jsx(at,{accounts:x,cards:I,rules:Re,onReload:gs})}),e.jsx("section",{hidden:R!=="protection",children:e.jsx(tt,{accounts:x,items:c,selectedAccount:m,onSelectedAccountChange:h})}),M&&pe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container modal-container-lg",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"商品自动发货"}),e.jsx("p",{className:"mt-1 line-clamp-1 text-sm text-gray-500",children:M.item_title||M.item_id})]}),e.jsx("button",{type:"button",onClick:()=>se(null),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(ne,{className:"h-5 w-5"})})]}),e.jsx("div",{className:"modal-body space-y-5",children:Pe?e.jsx(es,{label:"正在加载商品发货配置"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 rounded-md border border-gray-200 bg-gray-50 p-4 sm:grid-cols-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"所属账号"}),e.jsx("p",{className:"mt-1 truncate text-sm font-bold text-gray-900",children:te.get(M.cookie_id)||M.cookie_id})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"商品 ID"}),e.jsx("p",{className:"mt-1 truncate font-mono text-sm text-gray-900",children:M.item_id})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 sm:justify-end",children:[e.jsxs("div",{className:"sm:text-right",children:[e.jsx("p",{className:"text-sm font-bold text-gray-900",children:"自动发货"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"关闭后保留全部绑定"})]}),e.jsx(xe,{checked:b.enabled,label:"启用商品自动发货",onChange:()=>K(s=>({...s,enabled:!s.enabled}))})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-sm font-bold text-gray-800",children:"商品规格模式"}),e.jsxs("div",{className:"grid grid-cols-2 rounded-md border border-gray-200 bg-gray-100 p-1",role:"radiogroup","aria-label":"商品规格模式",children:[e.jsx("button",{type:"button",role:"radio","aria-checked":!b.isMultiSpec,onClick:()=>K(s=>({...s,isMultiSpec:!1})),className:`rounded px-3 py-2 text-sm font-semibold ${b.isMultiSpec?"text-gray-500 hover:text-gray-800":"bg-white text-gray-900 shadow-sm"}`,children:"普通商品"}),e.jsx("button",{type:"button",role:"radio","aria-checked":b.isMultiSpec,onClick:()=>K(s=>({...s,isMultiSpec:!0})),className:`rounded px-3 py-2 text-sm font-semibold ${b.isMultiSpec?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-800"}`,children:"多规格商品"})]}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-gray-500",children:b.isMultiSpec?"订单规格必须与下方某一规格组合精确匹配,否则系统会阻止发货,不会使用其他规格库存兜底。":"所有订单使用同一个发货库存;如商品有套餐、周期或版本差异,请切换为多规格商品。"})]}),e.jsx(lt,{cookieId:M.cookie_id,itemId:M.item_id}),e.jsx("div",{className:"space-y-3",children:(b.isMultiSpec?b.variants:b.variants.slice(0,1)).map((s,l)=>{const d=I.find(i=>String(i.id)===s.cardId);return e.jsxs("article",{className:"rounded-md border border-gray-200 bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-gray-100 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"truncate text-sm font-bold text-gray-900",children:b.isMultiSpec?s.displayName.trim()||`规格 ${l+1}`:"默认发货配置"}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-gray-500",children:b.isMultiSpec?s.specText.trim()||"等待填写规格组合":"适用于该商品的全部订单"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{checked:s.enabled,label:`${s.displayName||`规格 ${l+1}`} 启用状态`,onChange:()=>A(s.clientId,{enabled:!s.enabled})}),b.isMultiSpec&&b.variants.length>1&&e.jsx("button",{type:"button",onClick:()=>vs(s.clientId),className:"rounded-md p-2 text-red-500 hover:bg-red-50",title:"删除规格","aria-label":`删除规格 ${l+1}`,children:e.jsx(ye,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"grid gap-4 p-4 sm:grid-cols-2",children:[b.isMultiSpec&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"field-label",htmlFor:`variant-name-${s.clientId}`,children:"规格显示名称"}),e.jsx("input",{id:`variant-name-${s.clientId}`,value:s.displayName,onChange:i=>A(s.clientId,{displayName:i.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"例如:周卡 / 独享"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"field-label",htmlFor:`variant-spec-${s.clientId}`,children:"规格组合"}),e.jsx("input",{id:`variant-spec-${s.clientId}`,value:s.specText,onChange:i=>A(s.clientId,{specText:i.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"周期=周卡 | 版本=独享"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsxs("label",{className:"field-label",htmlFor:`variant-sku-${s.clientId}`,children:["闲鱼 SKU ID ",e.jsx("span",{className:"font-normal text-gray-400",children:"(可选,填写后优先匹配)"})]}),e.jsx("input",{id:`variant-sku-${s.clientId}`,value:s.platformSkuId,onChange:i=>A(s.clientId,{platformSkuId:i.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5 font-mono",placeholder:"从订单或商品接口获取的平台规格 ID"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"field-label",htmlFor:`variant-card-${s.clientId}`,children:"绑定发货库存"}),e.jsxs("select",{id:`variant-card-${s.clientId}`,value:s.cardId,onChange:i=>A(s.clientId,{cardId:i.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择卡密或内容"}),I.map(i=>e.jsxs("option",{value:i.id,disabled:!i.enabled,children:[i.name||`卡密 ${i.id}`," · ",ds[i.type],i.enabled?"":"(已停用)"]},i.id))]}),e.jsx("p",{className:`mt-1.5 text-xs ${(d==null?void 0:d.enabled)===!1?"text-red-600":"text-gray-500"}`,children:rt(d)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"field-label",htmlFor:`variant-count-${s.clientId}`,children:"每购买 1 件发货份数"}),e.jsx("input",{id:`variant-count-${s.clientId}`,type:"number",min:1,step:1,value:s.deliveryCount,onChange:i=>A(s.clientId,{deliveryCount:Math.max(1,Math.floor(Number(i.target.value)||1))}),className:"ios-input w-full rounded-md px-3 py-2.5"}),e.jsx("p",{className:`mt-1.5 text-xs ${M.multi_quantity_delivery?"text-gray-500":"text-amber-700"}`,children:M.multi_quantity_delivery?`已开启「多数量」:买 N 件发 ${s.deliveryCount||1} × N 份。`:`⚠️ 未开启「多数量」:无论买家拍几件都只发 ${s.deliveryCount||1} 份。需按件数递增请到商品列表开启「多数量」。`})]})]})]},s.clientId)})}),b.isMultiSpec&&e.jsxs("button",{type:"button",onClick:Ns,className:"ios-btn-secondary flex w-full items-center justify-center gap-2 rounded-md border-dashed px-4 py-2.5 text-sm",children:[e.jsx(he,{className:"h-4 w-4"}),"添加商品规格"]})]})}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>se(null),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:ws,disabled:!!G||Pe,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[G?e.jsx(O,{className:"h-4 w-4 animate-spin"}):e.jsx(ge,{className:"h-4 w-4"}),"保存策略"]})]})]})}),document.body),Q&&pe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"编辑商品详情"}),e.jsx("p",{className:"mt-1 line-clamp-1 text-sm text-gray-500",children:Q.item_title||Q.item_id})]}),e.jsx("button",{type:"button",onClick:()=>de(null),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(ne,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"item-detail",children:"本地商品详情"}),e.jsx("textarea",{id:"item-detail",value:je,onChange:s=>Fe(s.target.value),className:"ios-input min-h-64 w-full resize-y rounded-md p-3 font-mono text-sm",placeholder:"补充商品说明,供自动回复和发货逻辑读取。"})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>de(null),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:_s,disabled:!!G,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[G?e.jsx(O,{className:"h-4 w-4 animate-spin"}):e.jsx(ge,{className:"h-4 w-4"}),"保存"]})]})]})}),document.body),cs&&pe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"手动添加商品"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"适用于暂未同步到列表、但需要配置自动发货的商品。"})]}),e.jsx("button",{type:"button",onClick:()=>oe(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(ne,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-account",children:"所属账号"}),e.jsxs("select",{id:"manual-account",value:v.cookieId,onChange:s=>q(l=>({...l,cookieId:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择账号"}),x.map(s=>e.jsx("option",{value:s.id,children:te.get(s.id)},s.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-item-id",children:"商品 ID"}),e.jsx("input",{id:"manual-item-id",value:v.itemId,onChange:s=>q(l=>({...l,itemId:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"例如 1070863591807"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-price",children:"价格"}),e.jsx("input",{id:"manual-price",value:v.price,onChange:s=>q(l=>({...l,price:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"例如 80"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-title",children:"商品标题"}),e.jsx("input",{id:"manual-title",value:v.title,onChange:s=>q(l=>({...l,title:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-image",children:"图片 URL"}),e.jsx("input",{id:"manual-image",value:v.imageUrl,onChange:s=>q(l=>({...l,imageUrl:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5",placeholder:"https://..."})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-description",children:"商品简介"}),e.jsx("input",{id:"manual-description",value:v.description,onChange:s=>q(l=>({...l,description:s.target.value})),className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("label",{className:"mb-2 block text-sm font-bold text-gray-700",htmlFor:"manual-detail",children:"本地详情"}),e.jsx("textarea",{id:"manual-detail",value:v.detail,onChange:s=>q(l=>({...l,detail:s.target.value})),className:"ios-input min-h-28 w-full resize-y rounded-md p-3"})]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>oe(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:fs,disabled:G==="manual-item",className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[G==="manual-item"?e.jsx(O,{className:"h-4 w-4 animate-spin"}):e.jsx(he,{className:"h-4 w-4"}),"添加商品"]})]})]})}),document.body)]})};export{_t as default}; diff --git a/static/assets/Keywords-DYO7Z25o.js b/static/assets/Keywords-BPlwSBj7.js similarity index 97% rename from static/assets/Keywords-DYO7Z25o.js rename to static/assets/Keywords-BPlwSBj7.js index 36a6b6c..b895340 100644 --- a/static/assets/Keywords-DYO7Z25o.js +++ b/static/assets/Keywords-BPlwSBj7.js @@ -1 +1 @@ -import{r as i,o as J,b3 as fe,as as Ne,a8 as ve,b4 as we,j as e,M as R,B as P,e as Q,b as E,X as F,v as k,b5 as _e,n as t,al as V,am as ke,b6 as Se,b7 as Ce,b8 as De,b9 as Re,ba as Pe}from"./index-IChzZLcq.js";import{a as Ee,b as Fe,E as S,P as Me,S as M}from"./ui-DHCIdv_V.js";import{T}from"./truck-eLsCuQDz.js";import{K as W}from"./key-BRO3zsxh.js";import{P as Te}from"./plus-hTzuza9d.js";import{P as $,a as $e}from"./power-ZOn3B5wN.js";import{T as A}from"./trash-2-CnOVC8WZ.js";import{P as Ae}from"./power-off-D8Ea3WwY.js";import{S as K}from"./save-m64KWfbE.js";import{S as Ke}from"./sparkles-B5X13VUJ.js";const Ve=({mode:l})=>{const[x,L]=i.useState([]),[d,B]=i.useState(""),[y,Y]=i.useState("reply"),[j,Z]=i.useState([]),[I,h]=i.useState(!1),[f,z]=i.useState(null),[c,N]=i.useState({keyword:"",reply_content:""}),[C,ee]=i.useState([]),[se,ae]=i.useState([]),[te,u]=i.useState(!1),[v,H]=i.useState(null),[r,o]=i.useState({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),[O,le]=i.useState({}),[ie,g]=i.useState(!1),[Le,q]=i.useState(null),[n,m]=i.useState({cookie_id:"",enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),[re,U]=i.useState(!1);i.useEffect(()=>{if(l==="delivery"){b(),X(),J().then(L);return}J().then(s=>{L(s),s&&s.length>0&&B(a=>a||s[0].id)})},[l]),i.useEffect(()=>{l==="reply"&&d&&(_(),w())},[l,d]);const w=async()=>{try{const s=await fe();le(s)}catch(s){console.error("加载默认回复失败",s)}},b=async()=>{try{const s=await Ne();ee(s.filter(a=>!a.item_id))}catch(s){console.error("加载发货规则失败",s)}},X=async()=>{try{const s=await ve();ae(s)}catch(s){console.error("加载卡券失败",s)}},_=async()=>{if(d){U(!0);try{const s=await we(d);Z(s)}catch(s){console.error("加载关键词失败",s)}finally{U(!1)}}},ne=()=>{if(l==="delivery")H(null),o({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),u(!0);else if(y==="reply")z(null),N({keyword:"",reply_content:""}),h(!0);else{if(!d)return;G(d)}},G=async s=>{try{const a=await Se(s);q(a),m({cookie_id:s,enabled:a.enabled,reply_content:a.reply_content,reply_once:a.reply_once,reply_image_url:a.reply_image_url||""}),g(!0)}catch(a){console.error("加载默认回复失败",a),q(null),m({cookie_id:s,enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),g(!0)}},de=s=>{y==="reply"&&(z(s),N({keyword:s.keyword,reply_content:s.reply_content}),h(!0))},ce=s=>{H(s),o({keyword:s.item_keyword,cookie_id:s.cookie_id||"",card_id:String(s.card_group_id),description:s.name,enabled:s.enabled}),u(!0)},oe=async()=>{if(!d){t("请先选择账号");return}if(!c.keyword.trim()||!c.reply_content.trim()){t("请填写关键词和回复内容");return}try{await Re({id:f==null?void 0:f.id,keyword:c.keyword,reply_content:c.reply_content,match_type:"exact",enabled:!0},d),h(!1),_(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},me=async()=>{if(!r.keyword.trim()){t("请填写触发关键词");return}if(!r.card_id){t("请选择卡券");return}try{await V({id:v==null?void 0:v.id,item_keyword:r.keyword,cookie_id:r.cookie_id||void 0,item_id:void 0,card_group_id:parseInt(r.card_id),name:r.description,priority:1,enabled:r.enabled}),u(!1),b(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},pe=async s=>{if(!(!d||!await k("确认删除该关键词吗?")))try{await _e(s,d),_(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},xe=async s=>{if(await k("确认删除该发货规则吗?"))try{await ke(s),b(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ye=async s=>{try{await V({id:s.id,item_keyword:s.item_keyword,cookie_id:s.cookie_id,item_id:s.item_id,card_group_id:s.card_group_id,name:s.name,priority:s.priority,enabled:!s.enabled}),b()}catch(a){t("操作失败:"+a.message)}},he=async()=>{if(!n.cookie_id){t("请先选择账号");return}try{await Pe(n.cookie_id,{enabled:n.enabled,reply_content:n.reply_content,reply_once:n.reply_once,reply_image_url:n.reply_image_url}),g(!1),w(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},ue=async s=>{if(await k("确认删除该默认回复吗?"))try{await De(s),w(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ge=async s=>{if(await k("确认清空该账号的回复记录吗?清空后可以重新对所有对话使用默认回复。"))try{await Ce(s),t("清空成功!")}catch(a){t("清空失败:"+a.message)}},be=Object.values(O).filter(s=>s.enabled).length,je=()=>{l==="delivery"?Promise.all([b(),X()]):y==="reply"?_():w()},D=(s,a,p)=>e.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":p,onClick:a,className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${s?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${s?"translate-x-5":""}`})});return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(Ee,{title:l==="reply"?"自动回复":"通用自动发货",description:l==="reply"?"管理账号关键词回复和未命中规则时的默认回复。":"管理按账号或全部账号生效的关键词兜底发货规则。",icon:l==="reply"?R:T}),l==="reply"&&e.jsx(Fe,{value:y,onChange:Y,ariaLabel:"自动回复功能",items:[{id:"reply",label:"关键词回复",icon:W,count:j.length},{id:"default",label:"账号默认回复",icon:P,count:be}]}),e.jsxs("div",{className:"toolbar",children:[e.jsx("div",{className:"toolbar__group",children:l==="reply"?e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"reply-account",className:"text-xs font-bold text-gray-600",children:"应用账号"}),e.jsxs("select",{id:"reply-account",className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-64",value:d,onChange:s=>B(s.target.value),children:[e.jsx("option",{value:"",children:"请选择账号"}),x.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||s.id},s.id))]})]}):e.jsx("p",{className:"text-sm text-gray-600",children:"商品专属规则在“商品与发货”配置,此处仅处理关键词兜底。"})}),e.jsxs("div",{className:"toolbar__group",children:[e.jsxs("button",{type:"button",onClick:je,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx(Q,{className:"h-4 w-4"}),"刷新"]}),e.jsxs("button",{type:"button",onClick:ne,disabled:l==="reply"&&!d,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx(Te,{className:"h-4 w-4"}),l==="delivery"?"添加通用规则":y==="reply"?"添加关键词":"编辑默认回复"]})]})]}),l==="reply"&&!d?e.jsx(S,{title:"请选择闲鱼账号",description:"选择账号后可查看和编辑该账号的自动回复配置。",icon:R}):l==="reply"&&y==="reply"?re?e.jsx(Me,{label:"正在加载关键词回复"}):e.jsxs("section",{className:"section-panel",children:[e.jsx(M,{title:"关键词回复规则",description:`当前账号共 ${j.length} 条规则`,icon:W}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[j.map(s=>e.jsxs("article",{className:"grid gap-3 px-4 py-4 sm:grid-cols-[minmax(160px,0.7fr)_minmax(0,1.5fr)_auto] sm:items-center",children:[e.jsx("div",{className:"min-w-0",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"break-words text-sm font-bold text-gray-900",children:s.keyword}),e.jsx("span",{className:"status-badge status-badge-success",children:"精确匹配"})]})}),e.jsx("p",{className:"min-w-0 whitespace-pre-wrap break-words text-sm leading-6 text-gray-600",children:s.reply_content||"未填写回复内容"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>de(s),className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",title:"编辑关键词",children:e.jsx($,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void pe(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",title:"删除关键词",children:e.jsx(A,{className:"h-4 w-4"})})]})]},s.id)),j.length===0&&e.jsx(S,{compact:!0,title:"暂无关键词回复",description:"添加规则后,命中关键词的买家消息将使用指定内容回复。",icon:R})]})]}):l==="delivery"?e.jsxs("section",{className:"section-panel",children:[e.jsx(M,{title:"关键词兜底发货",description:`共 ${C.length} 条通用规则`,icon:T}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[C.map(s=>{var a;return e.jsxs("article",{className:"grid gap-3 px-4 py-4 lg:grid-cols-[minmax(180px,0.7fr)_minmax(0,1.4fr)_auto] lg:items-center",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"break-words text-sm font-bold text-gray-900",children:s.item_keyword}),e.jsx("span",{className:`status-badge ${s.enabled?"status-badge-success":"bg-gray-100 text-gray-600"}`,children:s.enabled?"已启用":"已停用"})]}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:s.cookie_id?"指定账号":"全部账号"})]}),e.jsxs("div",{className:"min-w-0 text-sm text-gray-600",children:[e.jsxs("p",{className:"truncate",children:["发货内容:",s.card_group_name||`卡密 ${s.card_group_id}`]}),s.cookie_id&&e.jsxs("p",{className:"mt-1 truncate text-xs text-gray-500",children:["账号:",((a=x.find(p=>p.id===s.cookie_id))==null?void 0:a.nickname)||s.cookie_id]}),s.name&&e.jsx("p",{className:"mt-1 break-words text-xs text-gray-500",children:s.name})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void ye(s),className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",title:s.enabled?"停用规则":"启用规则",children:s.enabled?e.jsx(Ae,{className:"h-4 w-4"}):e.jsx($e,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>ce(s),className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",title:"编辑规则",children:e.jsx($,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void xe(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",title:"删除规则",children:e.jsx(A,{className:"h-4 w-4"})})]})]},s.id)}),C.length===0&&e.jsx(S,{compact:!0,title:"暂无通用发货规则",description:"商品专属发货请在“商品与发货”中配置。",icon:T})]})]}):e.jsxs("section",{className:"section-panel",children:[e.jsx(M,{title:"账号默认回复",description:"关键词规则未命中时使用对应账号的默认内容。",icon:P}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[x.map(s=>{const a=O[s.id],p=!!(a!=null&&a.enabled);return e.jsxs("article",{className:"grid gap-3 px-4 py-4 sm:grid-cols-[minmax(180px,0.7fr)_minmax(0,1.4fr)_auto] sm:items-center",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"truncate text-sm font-bold text-gray-900",children:s.nickname||s.remark||s.id}),e.jsx("span",{className:`status-badge ${p?"status-badge-success":"bg-gray-100 text-gray-600"}`,children:p?"已启用":"未启用"}),(a==null?void 0:a.reply_once)&&e.jsx("span",{className:"status-badge status-badge-info",children:"单会话一次"})]}),e.jsx("p",{className:"mt-1 break-all text-xs text-gray-500",children:s.id})]}),e.jsx("p",{className:"min-w-0 whitespace-pre-wrap break-words text-sm leading-6 text-gray-600",children:(a==null?void 0:a.reply_content)||"未设置默认回复内容"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void G(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",title:"编辑默认回复",children:e.jsx($,{className:"h-4 w-4"})}),p&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>void ge(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-blue-50 text-blue-700 hover:bg-blue-100",title:"清空回复记录",children:e.jsx(Q,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void ue(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",title:"删除默认回复",children:e.jsx(A,{className:"h-4 w-4"})})]})]})]},s.id)}),x.length===0&&e.jsx(S,{compact:!0,title:"暂无闲鱼账号",description:"添加账号后可配置账号默认回复。",icon:P})]})]}),l==="reply"&&I&&E.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:f?"编辑关键词回复":"添加关键词回复"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"当前规则使用精确匹配。"})]}),e.jsx("button",{type:"button",onClick:()=>h(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(F,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body space-y-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"触发关键词"}),e.jsx("input",{value:c.keyword,onChange:s=>N({...c,keyword:s.target.value}),placeholder:"例如:价格、包邮",className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"回复内容"}),e.jsx("textarea",{value:c.reply_content,onChange:s=>N({...c,reply_content:s.target.value}),placeholder:"输入自动回复内容",rows:7,className:"ios-input w-full resize-y rounded-md px-3 py-2.5"})]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>h(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:()=>void oe(),className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[e.jsx(K,{className:"h-4 w-4"}),"保存"]})]})]})}),document.body),l==="delivery"&&te&&E.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:v?"编辑通用发货规则":"添加通用发货规则"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"未指定账号时对全部闲鱼账号生效。"})]}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(F,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body grid gap-4 sm:grid-cols-2",children:[e.jsxs("label",{className:"block sm:col-span-2",children:[e.jsx("span",{className:"field-label",children:"适用账号"}),e.jsxs("select",{value:r.cookie_id,onChange:s=>o({...r,cookie_id:s.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"全部账号"}),x.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||s.id},s.id))]})]}),e.jsxs("label",{className:"block sm:col-span-2",children:[e.jsx("span",{className:"field-label",children:"商品关键词"}),e.jsx("input",{value:r.keyword,onChange:s=>o({...r,keyword:s.target.value}),placeholder:"例如:会员、周卡",className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"发货卡密或内容"}),e.jsxs("select",{value:r.card_id,onChange:s=>o({...r,card_id:s.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择"}),se.map(s=>{var a;return e.jsx("option",{value:s.id,children:s.name||((a=s.text_content)==null?void 0:a.substring(0,30))||`卡券 ${s.id}`},s.id)})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"规则备注"}),e.jsx("input",{value:r.description,onChange:s=>o({...r,description:s.target.value}),placeholder:"便于识别此规则",className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4 sm:col-span-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-gray-800",children:"启用规则"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"停用后保留配置但不参与匹配。"})]}),D(r.enabled,()=>o({...r,enabled:!r.enabled}),"启用通用发货规则")]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>u(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:()=>void me(),className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[e.jsx(K,{className:"h-4 w-4"}),"保存"]})]})]})}),document.body),l==="reply"&&ie&&E.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"账号默认回复"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"关键词规则未命中时使用此内容。"})]}),e.jsx("button",{type:"button",onClick:()=>g(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(F,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body space-y-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"应用账号"}),e.jsxs("select",{value:n.cookie_id,onChange:s=>m({...n,cookie_id:s.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择账号"}),x.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||s.id},s.id))]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-gray-800",children:"启用默认回复"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"参与当前账号自动回复。"})]}),D(n.enabled,()=>m({...n,enabled:!n.enabled}),"启用默认回复")]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-gray-800",children:"单会话一次"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"每个对话仅触发一次。"})]}),D(n.reply_once,()=>m({...n,reply_once:!n.reply_once}),"每个会话只回复一次")]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"回复内容"}),e.jsx("textarea",{value:n.reply_content,onChange:s=>m({...n,reply_content:s.target.value}),placeholder:"输入默认回复内容",rows:7,className:"ios-input w-full resize-y rounded-md px-3 py-2.5"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"回复图片 URL(可选)"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ke,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsx("input",{value:n.reply_image_url,onChange:s=>m({...n,reply_image_url:s.target.value}),placeholder:"https://example.com/image.jpg",className:"ios-input w-full rounded-md py-2.5 pl-9 pr-3"})]})]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>g(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:()=>void he(),className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[e.jsx(K,{className:"h-4 w-4"}),"保存"]})]})]})}),document.body)]})};export{Ve as default}; +import{r as i,o as J,b3 as fe,as as Ne,a8 as ve,b4 as we,j as e,M as R,B as P,e as Q,b as E,X as F,v as k,b5 as _e,n as t,al as V,am as ke,b6 as Se,b7 as Ce,b8 as De,b9 as Re,ba as Pe}from"./index-C6Y7HdB3.js";import{a as Ee,b as Fe,E as S,P as Me,S as M}from"./ui-Dh615-z8.js";import{T}from"./truck-Cz_KAtqT.js";import{K as W}from"./key-CnYS625y.js";import{P as Te}from"./plus-BZHhM3Ok.js";import{P as $,a as $e}from"./power-WuQyd1QF.js";import{T as A}from"./trash-2-BG9PyYJR.js";import{P as Ae}from"./power-off-CcqbyexD.js";import{S as K}from"./save-C5DQBwo1.js";import{S as Ke}from"./sparkles-CczcRRJP.js";const Ve=({mode:l})=>{const[x,L]=i.useState([]),[d,B]=i.useState(""),[y,Y]=i.useState("reply"),[j,Z]=i.useState([]),[I,h]=i.useState(!1),[f,z]=i.useState(null),[c,N]=i.useState({keyword:"",reply_content:""}),[C,ee]=i.useState([]),[se,ae]=i.useState([]),[te,u]=i.useState(!1),[v,H]=i.useState(null),[r,o]=i.useState({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),[O,le]=i.useState({}),[ie,g]=i.useState(!1),[Le,q]=i.useState(null),[n,m]=i.useState({cookie_id:"",enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),[re,U]=i.useState(!1);i.useEffect(()=>{if(l==="delivery"){b(),X(),J().then(L);return}J().then(s=>{L(s),s&&s.length>0&&B(a=>a||s[0].id)})},[l]),i.useEffect(()=>{l==="reply"&&d&&(_(),w())},[l,d]);const w=async()=>{try{const s=await fe();le(s)}catch(s){console.error("加载默认回复失败",s)}},b=async()=>{try{const s=await Ne();ee(s.filter(a=>!a.item_id))}catch(s){console.error("加载发货规则失败",s)}},X=async()=>{try{const s=await ve();ae(s)}catch(s){console.error("加载卡券失败",s)}},_=async()=>{if(d){U(!0);try{const s=await we(d);Z(s)}catch(s){console.error("加载关键词失败",s)}finally{U(!1)}}},ne=()=>{if(l==="delivery")H(null),o({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),u(!0);else if(y==="reply")z(null),N({keyword:"",reply_content:""}),h(!0);else{if(!d)return;G(d)}},G=async s=>{try{const a=await Se(s);q(a),m({cookie_id:s,enabled:a.enabled,reply_content:a.reply_content,reply_once:a.reply_once,reply_image_url:a.reply_image_url||""}),g(!0)}catch(a){console.error("加载默认回复失败",a),q(null),m({cookie_id:s,enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),g(!0)}},de=s=>{y==="reply"&&(z(s),N({keyword:s.keyword,reply_content:s.reply_content}),h(!0))},ce=s=>{H(s),o({keyword:s.item_keyword,cookie_id:s.cookie_id||"",card_id:String(s.card_group_id),description:s.name,enabled:s.enabled}),u(!0)},oe=async()=>{if(!d){t("请先选择账号");return}if(!c.keyword.trim()||!c.reply_content.trim()){t("请填写关键词和回复内容");return}try{await Re({id:f==null?void 0:f.id,keyword:c.keyword,reply_content:c.reply_content,match_type:"exact",enabled:!0},d),h(!1),_(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},me=async()=>{if(!r.keyword.trim()){t("请填写触发关键词");return}if(!r.card_id){t("请选择卡券");return}try{await V({id:v==null?void 0:v.id,item_keyword:r.keyword,cookie_id:r.cookie_id||void 0,item_id:void 0,card_group_id:parseInt(r.card_id),name:r.description,priority:1,enabled:r.enabled}),u(!1),b(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},pe=async s=>{if(!(!d||!await k("确认删除该关键词吗?")))try{await _e(s,d),_(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},xe=async s=>{if(await k("确认删除该发货规则吗?"))try{await ke(s),b(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ye=async s=>{try{await V({id:s.id,item_keyword:s.item_keyword,cookie_id:s.cookie_id,item_id:s.item_id,card_group_id:s.card_group_id,name:s.name,priority:s.priority,enabled:!s.enabled}),b()}catch(a){t("操作失败:"+a.message)}},he=async()=>{if(!n.cookie_id){t("请先选择账号");return}try{await Pe(n.cookie_id,{enabled:n.enabled,reply_content:n.reply_content,reply_once:n.reply_once,reply_image_url:n.reply_image_url}),g(!1),w(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},ue=async s=>{if(await k("确认删除该默认回复吗?"))try{await De(s),w(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ge=async s=>{if(await k("确认清空该账号的回复记录吗?清空后可以重新对所有对话使用默认回复。"))try{await Ce(s),t("清空成功!")}catch(a){t("清空失败:"+a.message)}},be=Object.values(O).filter(s=>s.enabled).length,je=()=>{l==="delivery"?Promise.all([b(),X()]):y==="reply"?_():w()},D=(s,a,p)=>e.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":p,onClick:a,className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${s?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${s?"translate-x-5":""}`})});return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(Ee,{title:l==="reply"?"自动回复":"通用自动发货",description:l==="reply"?"管理账号关键词回复和未命中规则时的默认回复。":"管理按账号或全部账号生效的关键词兜底发货规则。",icon:l==="reply"?R:T}),l==="reply"&&e.jsx(Fe,{value:y,onChange:Y,ariaLabel:"自动回复功能",items:[{id:"reply",label:"关键词回复",icon:W,count:j.length},{id:"default",label:"账号默认回复",icon:P,count:be}]}),e.jsxs("div",{className:"toolbar",children:[e.jsx("div",{className:"toolbar__group",children:l==="reply"?e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"reply-account",className:"text-xs font-bold text-gray-600",children:"应用账号"}),e.jsxs("select",{id:"reply-account",className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-64",value:d,onChange:s=>B(s.target.value),children:[e.jsx("option",{value:"",children:"请选择账号"}),x.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||s.id},s.id))]})]}):e.jsx("p",{className:"text-sm text-gray-600",children:"商品专属规则在“商品与发货”配置,此处仅处理关键词兜底。"})}),e.jsxs("div",{className:"toolbar__group",children:[e.jsxs("button",{type:"button",onClick:je,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx(Q,{className:"h-4 w-4"}),"刷新"]}),e.jsxs("button",{type:"button",onClick:ne,disabled:l==="reply"&&!d,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx(Te,{className:"h-4 w-4"}),l==="delivery"?"添加通用规则":y==="reply"?"添加关键词":"编辑默认回复"]})]})]}),l==="reply"&&!d?e.jsx(S,{title:"请选择闲鱼账号",description:"选择账号后可查看和编辑该账号的自动回复配置。",icon:R}):l==="reply"&&y==="reply"?re?e.jsx(Me,{label:"正在加载关键词回复"}):e.jsxs("section",{className:"section-panel",children:[e.jsx(M,{title:"关键词回复规则",description:`当前账号共 ${j.length} 条规则`,icon:W}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[j.map(s=>e.jsxs("article",{className:"grid gap-3 px-4 py-4 sm:grid-cols-[minmax(160px,0.7fr)_minmax(0,1.5fr)_auto] sm:items-center",children:[e.jsx("div",{className:"min-w-0",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"break-words text-sm font-bold text-gray-900",children:s.keyword}),e.jsx("span",{className:"status-badge status-badge-success",children:"精确匹配"})]})}),e.jsx("p",{className:"min-w-0 whitespace-pre-wrap break-words text-sm leading-6 text-gray-600",children:s.reply_content||"未填写回复内容"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>de(s),className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",title:"编辑关键词",children:e.jsx($,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void pe(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",title:"删除关键词",children:e.jsx(A,{className:"h-4 w-4"})})]})]},s.id)),j.length===0&&e.jsx(S,{compact:!0,title:"暂无关键词回复",description:"添加规则后,命中关键词的买家消息将使用指定内容回复。",icon:R})]})]}):l==="delivery"?e.jsxs("section",{className:"section-panel",children:[e.jsx(M,{title:"关键词兜底发货",description:`共 ${C.length} 条通用规则`,icon:T}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[C.map(s=>{var a;return e.jsxs("article",{className:"grid gap-3 px-4 py-4 lg:grid-cols-[minmax(180px,0.7fr)_minmax(0,1.4fr)_auto] lg:items-center",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"break-words text-sm font-bold text-gray-900",children:s.item_keyword}),e.jsx("span",{className:`status-badge ${s.enabled?"status-badge-success":"bg-gray-100 text-gray-600"}`,children:s.enabled?"已启用":"已停用"})]}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:s.cookie_id?"指定账号":"全部账号"})]}),e.jsxs("div",{className:"min-w-0 text-sm text-gray-600",children:[e.jsxs("p",{className:"truncate",children:["发货内容:",s.card_group_name||`卡密 ${s.card_group_id}`]}),s.cookie_id&&e.jsxs("p",{className:"mt-1 truncate text-xs text-gray-500",children:["账号:",((a=x.find(p=>p.id===s.cookie_id))==null?void 0:a.nickname)||s.cookie_id]}),s.name&&e.jsx("p",{className:"mt-1 break-words text-xs text-gray-500",children:s.name})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void ye(s),className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",title:s.enabled?"停用规则":"启用规则",children:s.enabled?e.jsx(Ae,{className:"h-4 w-4"}):e.jsx($e,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>ce(s),className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",title:"编辑规则",children:e.jsx($,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void xe(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",title:"删除规则",children:e.jsx(A,{className:"h-4 w-4"})})]})]},s.id)}),C.length===0&&e.jsx(S,{compact:!0,title:"暂无通用发货规则",description:"商品专属发货请在“商品与发货”中配置。",icon:T})]})]}):e.jsxs("section",{className:"section-panel",children:[e.jsx(M,{title:"账号默认回复",description:"关键词规则未命中时使用对应账号的默认内容。",icon:P}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[x.map(s=>{const a=O[s.id],p=!!(a!=null&&a.enabled);return e.jsxs("article",{className:"grid gap-3 px-4 py-4 sm:grid-cols-[minmax(180px,0.7fr)_minmax(0,1.4fr)_auto] sm:items-center",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"truncate text-sm font-bold text-gray-900",children:s.nickname||s.remark||s.id}),e.jsx("span",{className:`status-badge ${p?"status-badge-success":"bg-gray-100 text-gray-600"}`,children:p?"已启用":"未启用"}),(a==null?void 0:a.reply_once)&&e.jsx("span",{className:"status-badge status-badge-info",children:"单会话一次"})]}),e.jsx("p",{className:"mt-1 break-all text-xs text-gray-500",children:s.id})]}),e.jsx("p",{className:"min-w-0 whitespace-pre-wrap break-words text-sm leading-6 text-gray-600",children:(a==null?void 0:a.reply_content)||"未设置默认回复内容"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void G(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",title:"编辑默认回复",children:e.jsx($,{className:"h-4 w-4"})}),p&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>void ge(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-blue-50 text-blue-700 hover:bg-blue-100",title:"清空回复记录",children:e.jsx(Q,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void ue(s.id),className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",title:"删除默认回复",children:e.jsx(A,{className:"h-4 w-4"})})]})]})]},s.id)}),x.length===0&&e.jsx(S,{compact:!0,title:"暂无闲鱼账号",description:"添加账号后可配置账号默认回复。",icon:P})]})]}),l==="reply"&&I&&E.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:f?"编辑关键词回复":"添加关键词回复"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"当前规则使用精确匹配。"})]}),e.jsx("button",{type:"button",onClick:()=>h(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(F,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body space-y-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"触发关键词"}),e.jsx("input",{value:c.keyword,onChange:s=>N({...c,keyword:s.target.value}),placeholder:"例如:价格、包邮",className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"回复内容"}),e.jsx("textarea",{value:c.reply_content,onChange:s=>N({...c,reply_content:s.target.value}),placeholder:"输入自动回复内容",rows:7,className:"ios-input w-full resize-y rounded-md px-3 py-2.5"})]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>h(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:()=>void oe(),className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[e.jsx(K,{className:"h-4 w-4"}),"保存"]})]})]})}),document.body),l==="delivery"&&te&&E.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:v?"编辑通用发货规则":"添加通用发货规则"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"未指定账号时对全部闲鱼账号生效。"})]}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(F,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body grid gap-4 sm:grid-cols-2",children:[e.jsxs("label",{className:"block sm:col-span-2",children:[e.jsx("span",{className:"field-label",children:"适用账号"}),e.jsxs("select",{value:r.cookie_id,onChange:s=>o({...r,cookie_id:s.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"全部账号"}),x.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||s.id},s.id))]})]}),e.jsxs("label",{className:"block sm:col-span-2",children:[e.jsx("span",{className:"field-label",children:"商品关键词"}),e.jsx("input",{value:r.keyword,onChange:s=>o({...r,keyword:s.target.value}),placeholder:"例如:会员、周卡",className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"发货卡密或内容"}),e.jsxs("select",{value:r.card_id,onChange:s=>o({...r,card_id:s.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择"}),se.map(s=>{var a;return e.jsx("option",{value:s.id,children:s.name||((a=s.text_content)==null?void 0:a.substring(0,30))||`卡券 ${s.id}`},s.id)})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"规则备注"}),e.jsx("input",{value:r.description,onChange:s=>o({...r,description:s.target.value}),placeholder:"便于识别此规则",className:"ios-input w-full rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4 sm:col-span-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-gray-800",children:"启用规则"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"停用后保留配置但不参与匹配。"})]}),D(r.enabled,()=>o({...r,enabled:!r.enabled}),"启用通用发货规则")]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>u(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:()=>void me(),className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[e.jsx(K,{className:"h-4 w-4"}),"保存"]})]})]})}),document.body),l==="reply"&&ie&&E.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"账号默认回复"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"关键词规则未命中时使用此内容。"})]}),e.jsx("button",{type:"button",onClick:()=>g(!1),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(F,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body space-y-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"应用账号"}),e.jsxs("select",{value:n.cookie_id,onChange:s=>m({...n,cookie_id:s.target.value}),className:"ios-input w-full rounded-md px-3 py-2.5",children:[e.jsx("option",{value:"",children:"请选择账号"}),x.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||s.id},s.id))]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-gray-800",children:"启用默认回复"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"参与当前账号自动回复。"})]}),D(n.enabled,()=>m({...n,enabled:!n.enabled}),"启用默认回复")]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-gray-800",children:"单会话一次"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"每个对话仅触发一次。"})]}),D(n.reply_once,()=>m({...n,reply_once:!n.reply_once}),"每个会话只回复一次")]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"回复内容"}),e.jsx("textarea",{value:n.reply_content,onChange:s=>m({...n,reply_content:s.target.value}),placeholder:"输入默认回复内容",rows:7,className:"ios-input w-full resize-y rounded-md px-3 py-2.5"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"field-label",children:"回复图片 URL(可选)"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ke,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsx("input",{value:n.reply_image_url,onChange:s=>m({...n,reply_image_url:s.target.value}),placeholder:"https://example.com/image.jpg",className:"ios-input w-full rounded-md py-2.5 pl-9 pr-3"})]})]})]}),e.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>g(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5",children:"取消"}),e.jsxs("button",{type:"button",onClick:()=>void he(),className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5",children:[e.jsx(K,{className:"h-4 w-4"}),"保存"]})]})]})}),document.body)]})};export{Ve as default}; diff --git a/static/assets/MessageManagement-BX9e9TqW.js b/static/assets/MessageManagement-CJJfjP2Z.js similarity index 98% rename from static/assets/MessageManagement-BX9e9TqW.js rename to static/assets/MessageManagement-CJJfjP2Z.js index 0552a8c..e86db65 100644 --- a/static/assets/MessageManagement-BX9e9TqW.js +++ b/static/assets/MessageManagement-CJJfjP2Z.js @@ -1,4 +1,4 @@ -import{c as We,r as n,aX as mt,o as xt,n as u,h as ut,bb as ht,bc as ft,j as t,e as $e,L as U,bd as pt,X as gt,be as bt,bf as jt,bg as yt,aU as vt,bh as wt,bi as Nt,bj as kt,bk as St,v as Te,bl as Ct,bm as Mt}from"./index-IChzZLcq.js";import{I as Re,c as _t,S as Ee,E as It}from"./ui-DHCIdv_V.js";import{S as Z}from"./settings-2-B-NwJM90.js";import{S as $t}from"./search-D1CHR5V5.js";import{P as Tt}from"./package-3qqwOYvH.js";import{I as Rt}from"./image-BCD-eej2.js";import{Z as Et}from"./zap-CQAFaWUI.js";import{S as Lt}from"./send-Db002WMI.js";import{P as Le}from"./plus-hTzuza9d.js";import{T as Ue}from"./trash-2-CnOVC8WZ.js";/** +import{c as We,r as n,aX as mt,o as xt,n as u,h as ut,bb as ht,bc as ft,j as t,e as $e,L as U,bd as pt,X as gt,be as bt,bf as jt,bg as yt,aU as vt,bh as wt,bi as Nt,bj as kt,bk as St,v as Te,bl as Ct,bm as Mt}from"./index-C6Y7HdB3.js";import{I as Re,c as _t,S as Ee,E as It}from"./ui-Dh615-z8.js";import{S as Z}from"./settings-2-DYoajNQY.js";import{S as $t}from"./search-DbZW8Se5.js";import{P as Tt}from"./package-DjIVaNpE.js";import{I as Rt}from"./image-DkNS6I4I.js";import{Z as Et}from"./zap-BAb90aFH.js";import{S as Lt}from"./send-CTCS9sD8.js";import{P as Le}from"./plus-BZHhM3Ok.js";import{T as Ue}from"./trash-2-BG9PyYJR.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/NotificationsAndLogs-DvXsPImX.js b/static/assets/NotificationsAndLogs-DX1qmLDY.js similarity index 97% rename from static/assets/NotificationsAndLogs-DvXsPImX.js rename to static/assets/NotificationsAndLogs-DX1qmLDY.js index 1b1f918..a410f4f 100644 --- a/static/assets/NotificationsAndLogs-DvXsPImX.js +++ b/static/assets/NotificationsAndLogs-DX1qmLDY.js @@ -1 +1 @@ -import{r as l,j as t,bd as $,e as ee,L as te,aF as ot,C as ct,X as Se,o as dt,bn as mt,bo as xt,bp as pt,n as o,bq as ut,br as ht,bs as _e,v as se,bt as yt,bu as Re,bv as bt,bw as gt,bx as ft,by as jt,bz as Nt}from"./index-IChzZLcq.js";import{a as vt,b as wt,S as E,E as L}from"./ui-DHCIdv_V.js";import{L as ae}from"./link-2-CYVpjq_H.js";import{S as le}from"./shield-alert-ob02IPrt.js";import{A as ne}from"./activity-CRI26G7w.js";import{P as $e}from"./plus-hTzuza9d.js";import{P as Ee}from"./pen-line-27OudxQx.js";import{T as ie}from"./trash-2-CnOVC8WZ.js";import{S as kt}from"./send-Db002WMI.js";import{C as Ct,a as St}from"./chevron-right-DwOZeQi3.js";import{S as Le}from"./save-m64KWfbE.js";import{C as _t}from"./check-6Gro50Mh.js";const y={dingtalk:{label:"钉钉",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://oapi.dingtalk.com/robot/send?..."},{key:"secret",label:"加签密钥",type:"password",optional:!0}],defaults:{}},feishu:{label:"飞书",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/..."},{key:"secret",label:"签名密钥",type:"password",optional:!0}],defaults:{}},bark:{label:"Bark",fields:[{key:"device_key",label:"Device Key",type:"password"},{key:"server_url",label:"服务器地址",placeholder:"https://api.day.app",optional:!0}],defaults:{server_url:"https://api.day.app"}},email:{label:"邮件",fields:[{key:"smtp_server",label:"SMTP 服务器",placeholder:"留空则使用「系统设置 → 邮件服务」",optional:!0},{key:"smtp_port",label:"SMTP 端口",type:"number",placeholder:"留空则使用系统设置(如 465)",optional:!0},{key:"email_user",label:"发件邮箱",placeholder:"留空则使用系统设置的发件邮箱",optional:!0},{key:"email_password",label:"邮箱密码或授权码",type:"password",placeholder:"留空则使用系统设置的授权码",optional:!0},{key:"recipient_email",label:"接收邮箱",placeholder:"必填,通知发到这个邮箱"}],defaults:{}},webhook:{label:"Webhook",fields:[{key:"webhook_url",label:"Webhook 地址"},{key:"http_method",label:"请求方法",type:"select",options:["POST","PUT"]},{key:"headers",label:"请求头 JSON",type:"textarea",placeholder:'{"Authorization":"Bearer ..."}',optional:!0}],defaults:{http_method:"POST",headers:"{}"}},wechat:{label:"企业微信",fields:[{key:"webhook_url",label:"机器人 Webhook 地址"}],defaults:{}},telegram:{label:"Telegram",fields:[{key:"bot_token",label:"Bot Token",type:"password"},{key:"chat_id",label:"Chat ID"}],defaults:{}}},re=20,Rt=i=>{var k,x;const r=(x=(k=i==null?void 0:i.response)==null?void 0:k.data)==null?void 0:x.detail;if(r&&typeof r=="object"&&"message"in r){const b=r.message;if(typeof b=="string"&&b.trim())return b.trim()}return typeof r=="string"&&r.trim()?r.trim():i instanceof Error&&i.message?i.message:"测试发送失败,请稍后重试"},oe=i=>i.nickname||i.remark||i.id,T=i=>{if(!i)return"-";const r=new Date(i.includes("T")?i:`${i.replace(" ","T")}Z`);return Number.isNaN(r.getTime())?i:r.toLocaleString("zh-CN")},Wt=({isAdmin:i})=>{const[r,k]=l.useState("channels"),[x,b]=l.useState([]),[A,ce]=l.useState([]),[de,D]=l.useState([]),[Te,g]=l.useState({}),[f,Ae]=l.useState([]),[me,De]=l.useState([]),[C,xe]=l.useState(!0),[Pe,j]=l.useState(!1),[N,pe]=l.useState(null),[P,B]=l.useState("dingtalk"),[O,I]=l.useState(""),[d,p]=l.useState({}),[ue,he]=l.useState(!1),[Be,u]=l.useState(!1),[v,ye]=l.useState(null),[M,q]=l.useState(""),[W,G]=l.useState(""),[z,F]=l.useState(""),[H,h]=l.useState([]),[be,S]=l.useState(!1),[ge,Oe]=l.useState([]),[fe,Ie]=l.useState(0),[U,Me]=l.useState(""),[Z,qe]=l.useState(""),[w,_]=l.useState(0),[J,je]=l.useState(!1),[Ne,We]=l.useState([]),[ve,Ge]=l.useState(""),[R,we]=l.useState(""),[K,ke]=l.useState(!1),m=async()=>{xe(!0);try{const[e,s,a,n]=await Promise.all([dt(),mt(),xt(),pt()]);b(e),ce(s.data),D(a.data),g(c=>{const rt=new Set(a.data.map(Y=>String(Y.id)));return Object.fromEntries(Object.entries(c).filter(([Y])=>rt.has(Y)))}),Ae(n.events),De(n.priorities)}catch(e){o(`加载通知配置失败:${e.message}`)}finally{xe(!1)}};l.useEffect(()=>{m()},[]);const ze=()=>{const e="dingtalk";pe(null),B(e),I(""),p({...y[e].defaults}),j(!0)},Fe=e=>{pe(e),B(e.type),I(e.name),p({...y[e.type].defaults,...e.config}),j(!0)},He=e=>{B(e),p({...y[e].defaults})},Ue=async()=>{he(!0);try{N?await _e(N.id,{name:O,config:d,enabled:N.enabled}):await jt({name:O,type:P,config:d}),j(!1),await m()}catch(e){o(`保存通知渠道失败:${e.message}`)}finally{he(!1)}},Ze=async e=>{try{await _e(e.id,{enabled:!e.enabled}),ce(s=>s.map(a=>a.id===e.id?{...a,enabled:!a.enabled}:a)),e.enabled?D(s=>s.filter(a=>a.channel_id!==Number(e.id))):await m()}catch(s){o(`更新渠道状态失败:${s.message}`)}},Je=async e=>{if(await se(`确认删除通知渠道“${e.name}”?相关账号绑定也会被删除。`))try{await yt(e.id),await m()}catch(s){o(`删除通知渠道失败:${s.message}`)}},Ke=e=>{var s;return((s=f.find(a=>a.id===e))==null?void 0:s.label)||e},Xe=e=>!e.event_types||e.event_types.length===0?"全部事件":e.event_types.map(Ke).join("、"),Qe=me.length>0?me:Array.from(new Set(f.map(e=>e.priority))).map(e=>({id:e,label:e==="critical"?"关键":e==="warning"?"重要":"一般"})),Ve=()=>{var e;ye(null),q(((e=x[0])==null?void 0:e.id)||""),G(""),F(""),h([]),u(!0)},Ye=e=>{ye(e),q(e.cookie_id),G(String(e.channel_id)),F(e.name||""),h(e.event_types||[]),u(!0)},et=e=>{h(s=>s.includes(e)?s.filter(a=>a!==e):[...s,e])},X=e=>{if(e==="all"){h(f.map(s=>s.id));return}if(e==="none"){h([]);return}h(f.filter(s=>s.priority===e).map(s=>s.id))},tt=async()=>{if(v){S(!0);try{await Re(v.id,{name:z.trim(),eventTypes:H}),u(!1),await m()}catch(e){o(`保存通知规则失败:${e.message}`)}finally{S(!1)}return}if(!M||!W){o("请选择账号和通知渠道");return}S(!0);try{await Nt(M,Number(W),!0,{name:z.trim(),eventTypes:H}),u(!1),await m()}catch(e){o(`创建通知规则失败:${e.message}`)}finally{S(!1)}},st=async e=>{try{await Re(e.id,{enabled:!e.enabled}),await m()}catch(s){o(`更新通知规则失败:${s.message}`)}},at=async e=>{const s=String(e.id);g(a=>({...a,[s]:{status:"sending",message:"发送中"}}));try{const a=await bt(e.id),n=`${a.message} · ${a.channel.name}`;g(c=>({...c,[s]:{status:"success",message:n,requestId:a.request_id,sentAt:a.sent_at}})),o(`${n}(请求 ID:${a.request_id})`,"success")}catch(a){const n=Rt(a);g(c=>({...c,[s]:{status:"error",message:n}})),o(`测试发送失败:${n}`,"error")}},lt=async e=>{const s=e.name||e.channel_name;if(await se(`确认删除通知规则“${s}”?`))try{await gt(e.id),D(a=>a.filter(n=>n.id!==e.id)),g(a=>{const n={...a};return delete n[String(e.id)],n})}catch(a){o(`删除通知规则失败:${a.message}`)}},Q=async(e=w)=>{je(!0);try{const s=await ut({cookie_id:U||void 0,processing_status:Z||void 0,limit:re,offset:e*re});Oe(s.data||[]),Ie(s.total||0)}catch(s){o(`加载风控日志失败:${s.message}`)}finally{je(!1)}};l.useEffect(()=>{r==="risk"&&Q()},[r,U,Z,w]);const nt=async e=>{if(await se("确认删除这条风控日志?"))try{const s=await ft(e.id);if(s.success===!1)throw new Error(s.message||"删除失败");await Q()}catch(s){o(`删除风控日志失败:${s.message}`)}},Ce=async()=>{if(i){ke(!0);try{const e=await ht({lines:300,level:ve||void 0,source:R.trim()||void 0});if(!e.success)throw new Error(e.message||"加载失败");We(e.logs||[])}catch(e){o(`加载系统日志失败:${e.message}`)}finally{ke(!1)}}};l.useEffect(()=>{r==="system"&&i&&Ce()},[r]);const V=Math.max(1,Math.ceil(fe/re)),it=[{id:"channels",label:"通知渠道",icon:$},{id:"bindings",label:"账号通知",icon:ae},{id:"risk",label:"风控日志",icon:le},...i?[{id:"system",label:"系统日志",icon:ne}]:[]];return t.jsxs("div",{className:"page-stack animate-fade-in",children:[t.jsx(vt,{title:"通知与日志",description:"统一管理外部通知渠道、账号绑定、风控事件和系统运行日志。",icon:$,actions:t.jsxs("button",{type:"button",onClick:()=>void m(),disabled:C,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[t.jsx(ee,{className:`h-4 w-4 ${C?"animate-spin":""}`}),"刷新配置"]})}),t.jsx(wt,{value:r,onChange:k,items:it,ariaLabel:"通知与日志功能"}),r==="channels"&&t.jsxs("section",{className:"section-panel",children:[t.jsx(E,{title:"通知渠道",description:"密钥仅用于服务端发送通知,请避免在日志或截图中公开。",icon:$,actions:t.jsxs("button",{type:"button",onClick:ze,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx($e,{className:"h-4 w-4"}),"新建渠道"]})}),t.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[A.map(e=>{var s;return t.jsxs("div",{className:"flex flex-col gap-3 py-4 sm:flex-row sm:items-center",children:[t.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,onClick:()=>void Ze(e),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${e.enabled?"bg-[#ffe100]":"bg-gray-300"}`,title:e.enabled?"停用渠道":"启用渠道",children:t.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-5":""}`})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"font-bold text-gray-900",children:e.name}),t.jsx("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs font-bold text-gray-600",children:((s=y[e.type])==null?void 0:s.label)||e.type})]}),t.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[e.enabled?"可用于账号通知":"已停用",e.updated_at?` · 更新于 ${T(e.updated_at)}`:""]})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{type:"button",onClick:()=>Fe(e),title:"编辑渠道",className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",children:t.jsx(Ee,{className:"h-4 w-4"})}),t.jsx("button",{type:"button",onClick:()=>void Je(e),title:"删除渠道",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(ie,{className:"h-4 w-4"})})]})]},e.id)}),!C&&A.length===0&&t.jsx(L,{compact:!0,title:"暂无通知渠道",description:"新建渠道后可绑定到指定闲鱼账号。",icon:$})]})]}),r==="bindings"&&t.jsxs("section",{className:"section-panel",children:[t.jsx(E,{title:"账号通知规则",description:"同一账号可配置多条规则,按事件类型选择要通知的内容;测试发送会真实触达当前渠道。",icon:ae,actions:t.jsxs("button",{type:"button",onClick:Ve,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx($e,{className:"h-4 w-4"}),"新建规则"]})}),t.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[de.map(e=>{const s=x.find(c=>c.id===e.cookie_id),a=Te[String(e.id)],n=(a==null?void 0:a.status)==="sending";return t.jsxs("div",{className:"flex flex-col gap-3 py-4 sm:flex-row sm:items-center","aria-busy":n||void 0,children:[t.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,"aria-label":`${e.name||e.channel_name}通知规则开关`,onClick:()=>void st(e),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${e.enabled?"bg-[#ffe100]":"bg-gray-300"}`,title:e.enabled?"暂停规则":"启用规则",children:t.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-5":""}`})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("p",{className:"font-bold text-gray-900",children:e.name||"默认规则"}),t.jsx("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs font-bold text-gray-600",children:e.channel_name})]}),t.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[s?oe(s):e.cookie_id," · ",e.channel_enabled===!1?"渠道已停用":e.enabled?"接收通知":"已暂停"]}),t.jsxs("p",{className:"mt-1 break-words text-xs text-gray-500",children:["通知内容:",Xe(e)]})]}),t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsxs("button",{type:"button",onClick:()=>void at(e),disabled:n,"aria-label":`测试发送规则${e.name||e.channel_name}`,title:e.enabled?"向该渠道真实发送一条测试消息":"规则已暂停,仅验证渠道配置",className:"ios-btn-secondary flex min-h-11 items-center gap-1.5 rounded-md px-3 text-xs disabled:cursor-wait disabled:opacity-60",children:[n?t.jsx(te,{className:"h-3.5 w-3.5 animate-spin"}):t.jsx(kt,{className:"h-3.5 w-3.5"}),n?"发送中":"测试发送"]}),t.jsx("button",{type:"button",onClick:()=>Ye(e),title:"编辑规则",className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",children:t.jsx(Ee,{className:"h-4 w-4"})}),t.jsx("button",{type:"button",onClick:()=>void lt(e),title:"删除规则",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(ie,{className:"h-4 w-4"})}),a&&a.status!=="sending"&&t.jsxs("span",{role:"status",className:`flex max-w-full items-center gap-1 text-xs ${a.status==="success"?"text-emerald-700":"text-red-700"}`,title:a.requestId?`请求 ID:${a.requestId}`:void 0,children:[a.status==="success"?t.jsx(ot,{className:"h-3.5 w-3.5 shrink-0"}):t.jsx(ct,{className:"h-3.5 w-3.5 shrink-0"}),t.jsxs("span",{className:"break-words",children:[a.message,a.sentAt?` · ${T(a.sentAt)}`:""]})]})]})]},e.id)}),!C&&de.length===0&&t.jsx(L,{compact:!0,title:"暂无账号通知规则",description:"先创建并启用通知渠道,再为账号添加通知规则。",icon:ae})]})]}),r==="risk"&&t.jsxs("section",{className:"section-panel",children:[t.jsx(E,{title:"发货风控日志",description:"查看发货前拦截、关单、补偿和异常处理结果。",icon:le}),t.jsx("div",{className:"toolbar rounded-none border-x-0 border-t-0 shadow-none",children:t.jsxs("div",{className:"toolbar__group",children:[t.jsxs("select",{value:U,onChange:e=>{Me(e.target.value),_(0)},className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-56",children:[t.jsx("option",{value:"",children:"全部账号"}),x.map(e=>t.jsx("option",{value:e.id,children:oe(e)},e.id))]}),t.jsxs("select",{value:Z,onChange:e=>{qe(e.target.value),_(0)},className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-40",children:[t.jsx("option",{value:"",children:"全部状态"}),t.jsx("option",{value:"processing",children:"处理中"}),t.jsx("option",{value:"success",children:"成功"}),t.jsx("option",{value:"failed",children:"失败"})]}),t.jsxs("button",{type:"button",onClick:()=>void Q(),disabled:J,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx(ee,{className:`h-4 w-4 ${J?"animate-spin":""}`}),"刷新"]})]})}),t.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[ge.map(e=>t.jsxs("div",{className:"grid gap-3 py-4 lg:grid-cols-[180px_120px_minmax(0,1fr)_44px] lg:items-start",children:[t.jsxs("div",{children:[t.jsx("p",{className:"break-all text-sm font-bold text-gray-900",children:e.cookie_id}),t.jsx("p",{className:"mt-1 text-xs text-gray-500",children:T(e.created_at)})]}),t.jsxs("div",{children:[t.jsx("span",{className:`inline-flex rounded px-2 py-1 text-xs font-bold ${e.processing_status==="success"?"bg-emerald-50 text-emerald-700":e.processing_status==="failed"?"bg-red-50 text-red-700":"bg-amber-50 text-amber-700"}`,children:e.processing_status==="success"?"成功":e.processing_status==="failed"?"失败":"处理中"}),t.jsx("p",{className:"mt-2 text-xs text-gray-500",children:e.event_type})]}),t.jsxs("div",{className:"min-w-0 text-sm leading-6 text-gray-700",children:[t.jsx("p",{children:e.event_description||e.processing_result||"无详细描述"}),e.processing_result&&e.event_description&&t.jsx("p",{className:"mt-1 text-xs text-gray-500",children:e.processing_result}),e.error_message&&t.jsx("p",{className:"mt-1 break-words text-xs text-red-600",children:e.error_message})]}),t.jsx("button",{type:"button",onClick:()=>void nt(e),title:"删除日志",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(ie,{className:"h-4 w-4"})})]},e.id)),!J&&ge.length===0&&t.jsx(L,{compact:!0,title:"没有符合条件的风控日志",description:"调整账号或状态筛选条件后重新查询。",icon:le})]}),t.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 px-4 py-3",children:[t.jsxs("p",{className:"text-xs text-gray-500",children:["共 ",fe," 条"]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>_(e=>Math.max(0,e-1)),disabled:w===0,title:"上一页",className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 disabled:opacity-40",children:t.jsx(Ct,{className:"h-4 w-4"})}),t.jsxs("span",{className:"min-w-20 text-center text-sm font-bold",children:[w+1," / ",V]}),t.jsx("button",{type:"button",onClick:()=>_(e=>Math.min(V-1,e+1)),disabled:w+1>=V,title:"下一页",className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 disabled:opacity-40",children:t.jsx(St,{className:"h-4 w-4"})})]})]})]}),r==="system"&&i&&t.jsxs("section",{className:"section-panel",children:[t.jsx(E,{title:"系统运行日志",description:"最多读取最近 300 行,可按级别和来源快速定位运行异常。",icon:ne}),t.jsxs("div",{className:"grid gap-3 border-b border-gray-200 bg-gray-50/60 p-4 sm:grid-cols-[160px_minmax(0,1fr)_auto_auto]",children:[t.jsxs("select",{value:ve,onChange:e=>Ge(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm",children:[t.jsx("option",{value:"",children:"全部级别"}),t.jsx("option",{value:"DEBUG",children:"DEBUG"}),t.jsx("option",{value:"INFO",children:"INFO"}),t.jsx("option",{value:"WARNING",children:"WARNING"}),t.jsx("option",{value:"ERROR",children:"ERROR"})]}),t.jsx("input",{value:R,onChange:e=>we(e.target.value),placeholder:"按日志来源筛选",className:"ios-input rounded-md px-3 py-2.5 text-sm"}),t.jsx("button",{type:"button","aria-pressed":R==="logistics_quote",onClick:()=>we(e=>e==="logistics_quote"?"":"logistics_quote"),className:`rounded-md px-3 py-2.5 text-sm font-bold ${R==="logistics_quote"?"bg-[#ffe100] text-gray-900":"bg-white text-gray-700 ring-1 ring-gray-200 hover:bg-gray-100"}`,children:"物流报价"}),t.jsxs("button",{type:"button",onClick:()=>void Ce(),disabled:K,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx(ee,{className:`h-4 w-4 ${K?"animate-spin":""}`}),"查询"]})]}),t.jsxs("div",{className:"max-h-[620px] divide-y divide-gray-100 overflow-y-auto px-4 font-mono text-xs",children:[[...Ne].reverse().map((e,s)=>t.jsxs("div",{className:"grid gap-2 py-3 lg:grid-cols-[165px_80px_180px_minmax(0,1fr)]",children:[t.jsx("span",{className:"text-gray-500",children:T(e.timestamp)}),t.jsx("span",{className:`font-bold ${e.level==="ERROR"?"text-red-600":e.level==="WARNING"?"text-amber-700":"text-gray-700"}`,children:e.level}),t.jsx("span",{className:"truncate text-gray-500",title:e.source,children:e.source}),t.jsx("span",{className:"break-words text-gray-800",children:e.message})]},`${e.timestamp}-${s}`)),!K&&Ne.length===0&&t.jsx(L,{compact:!0,title:"暂无系统日志",description:"当前筛选条件没有返回运行记录。",icon:ne})]})]}),Pe&&t.jsx("div",{className:"modal-overlay",children:t.jsxs("div",{className:"modal-container max-w-xl",children:[t.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900",children:N?"编辑通知渠道":"新建通知渠道"}),t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"配置服务端发送通知所需的连接信息。"})]}),t.jsx("button",{type:"button",onClick:()=>j(!1),title:"关闭",className:"flex h-9 w-9 items-center justify-center rounded-md hover:bg-gray-100",children:t.jsx(Se,{className:"h-5 w-5"})})]}),t.jsxs("div",{className:"modal-body space-y-4",children:[t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["渠道名称",t.jsx("input",{value:O,onChange:e=>I(e.target.value),placeholder:"例如:订单告警群",className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal"})]}),t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["渠道类型",t.jsx("select",{value:P,disabled:!!N,onChange:e=>He(e.target.value),className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal disabled:bg-gray-100",children:Object.entries(y).map(([e,s])=>t.jsx("option",{value:e,children:s.label},e))})]}),y[P].fields.map(e=>{var s;return t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:[e.label,e.optional?"(可选)":"",e.type==="textarea"?t.jsx("textarea",{value:String(d[e.key]??""),onChange:a=>p({...d,[e.key]:a.target.value}),placeholder:e.placeholder,rows:4,className:"ios-input mt-2 w-full resize-y rounded-md px-3 py-2.5 font-mono text-sm font-normal"}):e.type==="select"?t.jsx("select",{value:String(d[e.key]??""),onChange:a=>p({...d,[e.key]:a.target.value}),className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal",children:(s=e.options)==null?void 0:s.map(a=>t.jsx("option",{children:a},a))}):t.jsx("input",{type:e.type||"text",value:String(d[e.key]??""),onChange:a=>p({...d,[e.key]:e.type==="number"?Number(a.target.value):a.target.value}),placeholder:e.placeholder,className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal"})]},e.key)})]}),t.jsxs("div",{className:"modal-footer flex justify-end gap-3",children:[t.jsx("button",{type:"button",onClick:()=>j(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5 text-sm",children:"取消"}),t.jsxs("button",{type:"button",onClick:()=>void Ue(),disabled:ue,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[ue?t.jsx(te,{className:"h-4 w-4 animate-spin"}):t.jsx(Le,{className:"h-4 w-4"}),"保存"]})]})]})}),Be&&t.jsx("div",{className:"modal-overlay",children:t.jsxs("div",{className:"modal-container max-w-2xl",children:[t.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900",children:v?"编辑通知规则":"新建通知规则"}),t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"选择这条规则要通知的内容,未勾选任何类型表示订阅全部事件。"})]}),t.jsx("button",{type:"button",onClick:()=>u(!1),title:"关闭",className:"flex h-9 w-9 items-center justify-center rounded-md hover:bg-gray-100",children:t.jsx(Se,{className:"h-5 w-5"})})]}),t.jsxs("div",{className:"modal-body space-y-4",children:[t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["账号",t.jsxs("select",{value:M,disabled:!!v,onChange:e=>q(e.target.value),className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal disabled:bg-gray-100",children:[t.jsx("option",{value:"",children:"选择账号"}),x.map(e=>t.jsx("option",{value:e.id,children:oe(e)},e.id))]})]}),t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["通知渠道",t.jsxs("select",{value:W,disabled:!!v,onChange:e=>G(e.target.value),className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal disabled:bg-gray-100",children:[t.jsx("option",{value:"",children:"选择已启用渠道"}),A.filter(e=>e.enabled).map(e=>t.jsx("option",{value:e.id,children:e.name},e.id))]})]})]}),t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["规则名称(可选)",t.jsx("input",{value:z,onChange:e=>F(e.target.value),placeholder:"例如:仅关键提醒",className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal"})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-sm font-bold text-gray-700",children:"通知内容"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{type:"button",onClick:()=>X("all"),className:"rounded-md bg-gray-100 px-3 py-1.5 text-xs font-bold text-gray-700 hover:bg-gray-200",children:"全选"}),t.jsx("button",{type:"button",onClick:()=>X("critical"),className:"rounded-md bg-red-50 px-3 py-1.5 text-xs font-bold text-red-700 hover:bg-red-100",children:"仅关键"}),t.jsx("button",{type:"button",onClick:()=>X("none"),className:"rounded-md bg-gray-100 px-3 py-1.5 text-xs font-bold text-gray-700 hover:bg-gray-200",children:"清空"})]})]}),t.jsx("div",{className:"mt-3 space-y-3",children:Qe.map(e=>{const s=f.filter(n=>n.priority===e.id);if(s.length===0)return null;const a=e.id==="critical"?"text-red-700":e.id==="warning"?"text-amber-700":"text-gray-600";return t.jsxs("div",{children:[t.jsx("p",{className:`text-xs font-bold ${a}`,children:e.label}),t.jsx("div",{className:"mt-2 grid gap-2 sm:grid-cols-2",children:s.map(n=>{const c=H.includes(n.id);return t.jsxs("button",{type:"button",onClick:()=>et(n.id),className:`flex items-start gap-2 rounded-md border p-3 text-left transition-colors ${c?"border-[#ffe100] bg-[#fffbe6]":"border-gray-200 bg-white hover:bg-gray-50"}`,children:[t.jsx("span",{className:`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${c?"border-[#ffe100] bg-[#ffe100]":"border-gray-300 bg-white"}`,children:c&&t.jsx(_t,{className:"h-3 w-3 text-gray-900"})}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block text-sm font-bold text-gray-900",children:n.label}),t.jsx("span",{className:"mt-0.5 block text-xs text-gray-500",children:n.description})]})]},n.id)})})]},e.id)})}),t.jsx("p",{className:"mt-3 text-xs text-gray-500",children:"未勾选任何类型时接收全部事件;只想收关键提醒可点“仅关键”。"})]})]}),t.jsxs("div",{className:"modal-footer flex justify-end gap-3",children:[t.jsx("button",{type:"button",onClick:()=>u(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5 text-sm",children:"取消"}),t.jsxs("button",{type:"button",onClick:()=>void tt(),disabled:be,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[be?t.jsx(te,{className:"h-4 w-4 animate-spin"}):t.jsx(Le,{className:"h-4 w-4"}),"保存"]})]})]})})]})};export{Wt as default}; +import{r as l,j as t,bd as $,e as ee,L as te,aF as ot,C as ct,X as Se,o as dt,bn as mt,bo as xt,bp as pt,n as o,bq as ut,br as ht,bs as _e,v as se,bt as yt,bu as Re,bv as bt,bw as gt,bx as ft,by as jt,bz as Nt}from"./index-C6Y7HdB3.js";import{a as vt,b as wt,S as E,E as L}from"./ui-Dh615-z8.js";import{L as ae}from"./link-2-CUR4V6rB.js";import{S as le}from"./shield-alert-BSaySGHY.js";import{A as ne}from"./activity-CV-Hy1l6.js";import{P as $e}from"./plus-BZHhM3Ok.js";import{P as Ee}from"./pen-line-B2U8YMna.js";import{T as ie}from"./trash-2-BG9PyYJR.js";import{S as kt}from"./send-CTCS9sD8.js";import{C as Ct,a as St}from"./chevron-right-zTm23uAy.js";import{S as Le}from"./save-C5DQBwo1.js";import{C as _t}from"./check--qTdUCr3.js";const y={dingtalk:{label:"钉钉",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://oapi.dingtalk.com/robot/send?..."},{key:"secret",label:"加签密钥",type:"password",optional:!0}],defaults:{}},feishu:{label:"飞书",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/..."},{key:"secret",label:"签名密钥",type:"password",optional:!0}],defaults:{}},bark:{label:"Bark",fields:[{key:"device_key",label:"Device Key",type:"password"},{key:"server_url",label:"服务器地址",placeholder:"https://api.day.app",optional:!0}],defaults:{server_url:"https://api.day.app"}},email:{label:"邮件",fields:[{key:"smtp_server",label:"SMTP 服务器",placeholder:"留空则使用「系统设置 → 邮件服务」",optional:!0},{key:"smtp_port",label:"SMTP 端口",type:"number",placeholder:"留空则使用系统设置(如 465)",optional:!0},{key:"email_user",label:"发件邮箱",placeholder:"留空则使用系统设置的发件邮箱",optional:!0},{key:"email_password",label:"邮箱密码或授权码",type:"password",placeholder:"留空则使用系统设置的授权码",optional:!0},{key:"recipient_email",label:"接收邮箱",placeholder:"必填,通知发到这个邮箱"}],defaults:{}},webhook:{label:"Webhook",fields:[{key:"webhook_url",label:"Webhook 地址"},{key:"http_method",label:"请求方法",type:"select",options:["POST","PUT"]},{key:"headers",label:"请求头 JSON",type:"textarea",placeholder:'{"Authorization":"Bearer ..."}',optional:!0}],defaults:{http_method:"POST",headers:"{}"}},wechat:{label:"企业微信",fields:[{key:"webhook_url",label:"机器人 Webhook 地址"}],defaults:{}},telegram:{label:"Telegram",fields:[{key:"bot_token",label:"Bot Token",type:"password"},{key:"chat_id",label:"Chat ID"}],defaults:{}}},re=20,Rt=i=>{var k,x;const r=(x=(k=i==null?void 0:i.response)==null?void 0:k.data)==null?void 0:x.detail;if(r&&typeof r=="object"&&"message"in r){const b=r.message;if(typeof b=="string"&&b.trim())return b.trim()}return typeof r=="string"&&r.trim()?r.trim():i instanceof Error&&i.message?i.message:"测试发送失败,请稍后重试"},oe=i=>i.nickname||i.remark||i.id,T=i=>{if(!i)return"-";const r=new Date(i.includes("T")?i:`${i.replace(" ","T")}Z`);return Number.isNaN(r.getTime())?i:r.toLocaleString("zh-CN")},Wt=({isAdmin:i})=>{const[r,k]=l.useState("channels"),[x,b]=l.useState([]),[A,ce]=l.useState([]),[de,D]=l.useState([]),[Te,g]=l.useState({}),[f,Ae]=l.useState([]),[me,De]=l.useState([]),[C,xe]=l.useState(!0),[Pe,j]=l.useState(!1),[N,pe]=l.useState(null),[P,B]=l.useState("dingtalk"),[O,I]=l.useState(""),[d,p]=l.useState({}),[ue,he]=l.useState(!1),[Be,u]=l.useState(!1),[v,ye]=l.useState(null),[M,q]=l.useState(""),[W,G]=l.useState(""),[z,F]=l.useState(""),[H,h]=l.useState([]),[be,S]=l.useState(!1),[ge,Oe]=l.useState([]),[fe,Ie]=l.useState(0),[U,Me]=l.useState(""),[Z,qe]=l.useState(""),[w,_]=l.useState(0),[J,je]=l.useState(!1),[Ne,We]=l.useState([]),[ve,Ge]=l.useState(""),[R,we]=l.useState(""),[K,ke]=l.useState(!1),m=async()=>{xe(!0);try{const[e,s,a,n]=await Promise.all([dt(),mt(),xt(),pt()]);b(e),ce(s.data),D(a.data),g(c=>{const rt=new Set(a.data.map(Y=>String(Y.id)));return Object.fromEntries(Object.entries(c).filter(([Y])=>rt.has(Y)))}),Ae(n.events),De(n.priorities)}catch(e){o(`加载通知配置失败:${e.message}`)}finally{xe(!1)}};l.useEffect(()=>{m()},[]);const ze=()=>{const e="dingtalk";pe(null),B(e),I(""),p({...y[e].defaults}),j(!0)},Fe=e=>{pe(e),B(e.type),I(e.name),p({...y[e.type].defaults,...e.config}),j(!0)},He=e=>{B(e),p({...y[e].defaults})},Ue=async()=>{he(!0);try{N?await _e(N.id,{name:O,config:d,enabled:N.enabled}):await jt({name:O,type:P,config:d}),j(!1),await m()}catch(e){o(`保存通知渠道失败:${e.message}`)}finally{he(!1)}},Ze=async e=>{try{await _e(e.id,{enabled:!e.enabled}),ce(s=>s.map(a=>a.id===e.id?{...a,enabled:!a.enabled}:a)),e.enabled?D(s=>s.filter(a=>a.channel_id!==Number(e.id))):await m()}catch(s){o(`更新渠道状态失败:${s.message}`)}},Je=async e=>{if(await se(`确认删除通知渠道“${e.name}”?相关账号绑定也会被删除。`))try{await yt(e.id),await m()}catch(s){o(`删除通知渠道失败:${s.message}`)}},Ke=e=>{var s;return((s=f.find(a=>a.id===e))==null?void 0:s.label)||e},Xe=e=>!e.event_types||e.event_types.length===0?"全部事件":e.event_types.map(Ke).join("、"),Qe=me.length>0?me:Array.from(new Set(f.map(e=>e.priority))).map(e=>({id:e,label:e==="critical"?"关键":e==="warning"?"重要":"一般"})),Ve=()=>{var e;ye(null),q(((e=x[0])==null?void 0:e.id)||""),G(""),F(""),h([]),u(!0)},Ye=e=>{ye(e),q(e.cookie_id),G(String(e.channel_id)),F(e.name||""),h(e.event_types||[]),u(!0)},et=e=>{h(s=>s.includes(e)?s.filter(a=>a!==e):[...s,e])},X=e=>{if(e==="all"){h(f.map(s=>s.id));return}if(e==="none"){h([]);return}h(f.filter(s=>s.priority===e).map(s=>s.id))},tt=async()=>{if(v){S(!0);try{await Re(v.id,{name:z.trim(),eventTypes:H}),u(!1),await m()}catch(e){o(`保存通知规则失败:${e.message}`)}finally{S(!1)}return}if(!M||!W){o("请选择账号和通知渠道");return}S(!0);try{await Nt(M,Number(W),!0,{name:z.trim(),eventTypes:H}),u(!1),await m()}catch(e){o(`创建通知规则失败:${e.message}`)}finally{S(!1)}},st=async e=>{try{await Re(e.id,{enabled:!e.enabled}),await m()}catch(s){o(`更新通知规则失败:${s.message}`)}},at=async e=>{const s=String(e.id);g(a=>({...a,[s]:{status:"sending",message:"发送中"}}));try{const a=await bt(e.id),n=`${a.message} · ${a.channel.name}`;g(c=>({...c,[s]:{status:"success",message:n,requestId:a.request_id,sentAt:a.sent_at}})),o(`${n}(请求 ID:${a.request_id})`,"success")}catch(a){const n=Rt(a);g(c=>({...c,[s]:{status:"error",message:n}})),o(`测试发送失败:${n}`,"error")}},lt=async e=>{const s=e.name||e.channel_name;if(await se(`确认删除通知规则“${s}”?`))try{await gt(e.id),D(a=>a.filter(n=>n.id!==e.id)),g(a=>{const n={...a};return delete n[String(e.id)],n})}catch(a){o(`删除通知规则失败:${a.message}`)}},Q=async(e=w)=>{je(!0);try{const s=await ut({cookie_id:U||void 0,processing_status:Z||void 0,limit:re,offset:e*re});Oe(s.data||[]),Ie(s.total||0)}catch(s){o(`加载风控日志失败:${s.message}`)}finally{je(!1)}};l.useEffect(()=>{r==="risk"&&Q()},[r,U,Z,w]);const nt=async e=>{if(await se("确认删除这条风控日志?"))try{const s=await ft(e.id);if(s.success===!1)throw new Error(s.message||"删除失败");await Q()}catch(s){o(`删除风控日志失败:${s.message}`)}},Ce=async()=>{if(i){ke(!0);try{const e=await ht({lines:300,level:ve||void 0,source:R.trim()||void 0});if(!e.success)throw new Error(e.message||"加载失败");We(e.logs||[])}catch(e){o(`加载系统日志失败:${e.message}`)}finally{ke(!1)}}};l.useEffect(()=>{r==="system"&&i&&Ce()},[r]);const V=Math.max(1,Math.ceil(fe/re)),it=[{id:"channels",label:"通知渠道",icon:$},{id:"bindings",label:"账号通知",icon:ae},{id:"risk",label:"风控日志",icon:le},...i?[{id:"system",label:"系统日志",icon:ne}]:[]];return t.jsxs("div",{className:"page-stack animate-fade-in",children:[t.jsx(vt,{title:"通知与日志",description:"统一管理外部通知渠道、账号绑定、风控事件和系统运行日志。",icon:$,actions:t.jsxs("button",{type:"button",onClick:()=>void m(),disabled:C,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[t.jsx(ee,{className:`h-4 w-4 ${C?"animate-spin":""}`}),"刷新配置"]})}),t.jsx(wt,{value:r,onChange:k,items:it,ariaLabel:"通知与日志功能"}),r==="channels"&&t.jsxs("section",{className:"section-panel",children:[t.jsx(E,{title:"通知渠道",description:"密钥仅用于服务端发送通知,请避免在日志或截图中公开。",icon:$,actions:t.jsxs("button",{type:"button",onClick:ze,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx($e,{className:"h-4 w-4"}),"新建渠道"]})}),t.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[A.map(e=>{var s;return t.jsxs("div",{className:"flex flex-col gap-3 py-4 sm:flex-row sm:items-center",children:[t.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,onClick:()=>void Ze(e),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${e.enabled?"bg-[#ffe100]":"bg-gray-300"}`,title:e.enabled?"停用渠道":"启用渠道",children:t.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-5":""}`})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"font-bold text-gray-900",children:e.name}),t.jsx("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs font-bold text-gray-600",children:((s=y[e.type])==null?void 0:s.label)||e.type})]}),t.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[e.enabled?"可用于账号通知":"已停用",e.updated_at?` · 更新于 ${T(e.updated_at)}`:""]})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{type:"button",onClick:()=>Fe(e),title:"编辑渠道",className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",children:t.jsx(Ee,{className:"h-4 w-4"})}),t.jsx("button",{type:"button",onClick:()=>void Je(e),title:"删除渠道",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(ie,{className:"h-4 w-4"})})]})]},e.id)}),!C&&A.length===0&&t.jsx(L,{compact:!0,title:"暂无通知渠道",description:"新建渠道后可绑定到指定闲鱼账号。",icon:$})]})]}),r==="bindings"&&t.jsxs("section",{className:"section-panel",children:[t.jsx(E,{title:"账号通知规则",description:"同一账号可配置多条规则,按事件类型选择要通知的内容;测试发送会真实触达当前渠道。",icon:ae,actions:t.jsxs("button",{type:"button",onClick:Ve,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx($e,{className:"h-4 w-4"}),"新建规则"]})}),t.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[de.map(e=>{const s=x.find(c=>c.id===e.cookie_id),a=Te[String(e.id)],n=(a==null?void 0:a.status)==="sending";return t.jsxs("div",{className:"flex flex-col gap-3 py-4 sm:flex-row sm:items-center","aria-busy":n||void 0,children:[t.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,"aria-label":`${e.name||e.channel_name}通知规则开关`,onClick:()=>void st(e),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${e.enabled?"bg-[#ffe100]":"bg-gray-300"}`,title:e.enabled?"暂停规则":"启用规则",children:t.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-5":""}`})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("p",{className:"font-bold text-gray-900",children:e.name||"默认规则"}),t.jsx("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs font-bold text-gray-600",children:e.channel_name})]}),t.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[s?oe(s):e.cookie_id," · ",e.channel_enabled===!1?"渠道已停用":e.enabled?"接收通知":"已暂停"]}),t.jsxs("p",{className:"mt-1 break-words text-xs text-gray-500",children:["通知内容:",Xe(e)]})]}),t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsxs("button",{type:"button",onClick:()=>void at(e),disabled:n,"aria-label":`测试发送规则${e.name||e.channel_name}`,title:e.enabled?"向该渠道真实发送一条测试消息":"规则已暂停,仅验证渠道配置",className:"ios-btn-secondary flex min-h-11 items-center gap-1.5 rounded-md px-3 text-xs disabled:cursor-wait disabled:opacity-60",children:[n?t.jsx(te,{className:"h-3.5 w-3.5 animate-spin"}):t.jsx(kt,{className:"h-3.5 w-3.5"}),n?"发送中":"测试发送"]}),t.jsx("button",{type:"button",onClick:()=>Ye(e),title:"编辑规则",className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200",children:t.jsx(Ee,{className:"h-4 w-4"})}),t.jsx("button",{type:"button",onClick:()=>void lt(e),title:"删除规则",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(ie,{className:"h-4 w-4"})}),a&&a.status!=="sending"&&t.jsxs("span",{role:"status",className:`flex max-w-full items-center gap-1 text-xs ${a.status==="success"?"text-emerald-700":"text-red-700"}`,title:a.requestId?`请求 ID:${a.requestId}`:void 0,children:[a.status==="success"?t.jsx(ot,{className:"h-3.5 w-3.5 shrink-0"}):t.jsx(ct,{className:"h-3.5 w-3.5 shrink-0"}),t.jsxs("span",{className:"break-words",children:[a.message,a.sentAt?` · ${T(a.sentAt)}`:""]})]})]})]},e.id)}),!C&&de.length===0&&t.jsx(L,{compact:!0,title:"暂无账号通知规则",description:"先创建并启用通知渠道,再为账号添加通知规则。",icon:ae})]})]}),r==="risk"&&t.jsxs("section",{className:"section-panel",children:[t.jsx(E,{title:"发货风控日志",description:"查看发货前拦截、关单、补偿和异常处理结果。",icon:le}),t.jsx("div",{className:"toolbar rounded-none border-x-0 border-t-0 shadow-none",children:t.jsxs("div",{className:"toolbar__group",children:[t.jsxs("select",{value:U,onChange:e=>{Me(e.target.value),_(0)},className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-56",children:[t.jsx("option",{value:"",children:"全部账号"}),x.map(e=>t.jsx("option",{value:e.id,children:oe(e)},e.id))]}),t.jsxs("select",{value:Z,onChange:e=>{qe(e.target.value),_(0)},className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-40",children:[t.jsx("option",{value:"",children:"全部状态"}),t.jsx("option",{value:"processing",children:"处理中"}),t.jsx("option",{value:"success",children:"成功"}),t.jsx("option",{value:"failed",children:"失败"})]}),t.jsxs("button",{type:"button",onClick:()=>void Q(),disabled:J,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx(ee,{className:`h-4 w-4 ${J?"animate-spin":""}`}),"刷新"]})]})}),t.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[ge.map(e=>t.jsxs("div",{className:"grid gap-3 py-4 lg:grid-cols-[180px_120px_minmax(0,1fr)_44px] lg:items-start",children:[t.jsxs("div",{children:[t.jsx("p",{className:"break-all text-sm font-bold text-gray-900",children:e.cookie_id}),t.jsx("p",{className:"mt-1 text-xs text-gray-500",children:T(e.created_at)})]}),t.jsxs("div",{children:[t.jsx("span",{className:`inline-flex rounded px-2 py-1 text-xs font-bold ${e.processing_status==="success"?"bg-emerald-50 text-emerald-700":e.processing_status==="failed"?"bg-red-50 text-red-700":"bg-amber-50 text-amber-700"}`,children:e.processing_status==="success"?"成功":e.processing_status==="failed"?"失败":"处理中"}),t.jsx("p",{className:"mt-2 text-xs text-gray-500",children:e.event_type})]}),t.jsxs("div",{className:"min-w-0 text-sm leading-6 text-gray-700",children:[t.jsx("p",{children:e.event_description||e.processing_result||"无详细描述"}),e.processing_result&&e.event_description&&t.jsx("p",{className:"mt-1 text-xs text-gray-500",children:e.processing_result}),e.error_message&&t.jsx("p",{className:"mt-1 break-words text-xs text-red-600",children:e.error_message})]}),t.jsx("button",{type:"button",onClick:()=>void nt(e),title:"删除日志",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(ie,{className:"h-4 w-4"})})]},e.id)),!J&&ge.length===0&&t.jsx(L,{compact:!0,title:"没有符合条件的风控日志",description:"调整账号或状态筛选条件后重新查询。",icon:le})]}),t.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 px-4 py-3",children:[t.jsxs("p",{className:"text-xs text-gray-500",children:["共 ",fe," 条"]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>_(e=>Math.max(0,e-1)),disabled:w===0,title:"上一页",className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 disabled:opacity-40",children:t.jsx(Ct,{className:"h-4 w-4"})}),t.jsxs("span",{className:"min-w-20 text-center text-sm font-bold",children:[w+1," / ",V]}),t.jsx("button",{type:"button",onClick:()=>_(e=>Math.min(V-1,e+1)),disabled:w+1>=V,title:"下一页",className:"flex h-9 w-9 items-center justify-center rounded-md bg-gray-100 disabled:opacity-40",children:t.jsx(St,{className:"h-4 w-4"})})]})]})]}),r==="system"&&i&&t.jsxs("section",{className:"section-panel",children:[t.jsx(E,{title:"系统运行日志",description:"最多读取最近 300 行,可按级别和来源快速定位运行异常。",icon:ne}),t.jsxs("div",{className:"grid gap-3 border-b border-gray-200 bg-gray-50/60 p-4 sm:grid-cols-[160px_minmax(0,1fr)_auto_auto]",children:[t.jsxs("select",{value:ve,onChange:e=>Ge(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm",children:[t.jsx("option",{value:"",children:"全部级别"}),t.jsx("option",{value:"DEBUG",children:"DEBUG"}),t.jsx("option",{value:"INFO",children:"INFO"}),t.jsx("option",{value:"WARNING",children:"WARNING"}),t.jsx("option",{value:"ERROR",children:"ERROR"})]}),t.jsx("input",{value:R,onChange:e=>we(e.target.value),placeholder:"按日志来源筛选",className:"ios-input rounded-md px-3 py-2.5 text-sm"}),t.jsx("button",{type:"button","aria-pressed":R==="logistics_quote",onClick:()=>we(e=>e==="logistics_quote"?"":"logistics_quote"),className:`rounded-md px-3 py-2.5 text-sm font-bold ${R==="logistics_quote"?"bg-[#ffe100] text-gray-900":"bg-white text-gray-700 ring-1 ring-gray-200 hover:bg-gray-100"}`,children:"物流报价"}),t.jsxs("button",{type:"button",onClick:()=>void Ce(),disabled:K,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx(ee,{className:`h-4 w-4 ${K?"animate-spin":""}`}),"查询"]})]}),t.jsxs("div",{className:"max-h-[620px] divide-y divide-gray-100 overflow-y-auto px-4 font-mono text-xs",children:[[...Ne].reverse().map((e,s)=>t.jsxs("div",{className:"grid gap-2 py-3 lg:grid-cols-[165px_80px_180px_minmax(0,1fr)]",children:[t.jsx("span",{className:"text-gray-500",children:T(e.timestamp)}),t.jsx("span",{className:`font-bold ${e.level==="ERROR"?"text-red-600":e.level==="WARNING"?"text-amber-700":"text-gray-700"}`,children:e.level}),t.jsx("span",{className:"truncate text-gray-500",title:e.source,children:e.source}),t.jsx("span",{className:"break-words text-gray-800",children:e.message})]},`${e.timestamp}-${s}`)),!K&&Ne.length===0&&t.jsx(L,{compact:!0,title:"暂无系统日志",description:"当前筛选条件没有返回运行记录。",icon:ne})]})]}),Pe&&t.jsx("div",{className:"modal-overlay",children:t.jsxs("div",{className:"modal-container max-w-xl",children:[t.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900",children:N?"编辑通知渠道":"新建通知渠道"}),t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"配置服务端发送通知所需的连接信息。"})]}),t.jsx("button",{type:"button",onClick:()=>j(!1),title:"关闭",className:"flex h-9 w-9 items-center justify-center rounded-md hover:bg-gray-100",children:t.jsx(Se,{className:"h-5 w-5"})})]}),t.jsxs("div",{className:"modal-body space-y-4",children:[t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["渠道名称",t.jsx("input",{value:O,onChange:e=>I(e.target.value),placeholder:"例如:订单告警群",className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal"})]}),t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["渠道类型",t.jsx("select",{value:P,disabled:!!N,onChange:e=>He(e.target.value),className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal disabled:bg-gray-100",children:Object.entries(y).map(([e,s])=>t.jsx("option",{value:e,children:s.label},e))})]}),y[P].fields.map(e=>{var s;return t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:[e.label,e.optional?"(可选)":"",e.type==="textarea"?t.jsx("textarea",{value:String(d[e.key]??""),onChange:a=>p({...d,[e.key]:a.target.value}),placeholder:e.placeholder,rows:4,className:"ios-input mt-2 w-full resize-y rounded-md px-3 py-2.5 font-mono text-sm font-normal"}):e.type==="select"?t.jsx("select",{value:String(d[e.key]??""),onChange:a=>p({...d,[e.key]:a.target.value}),className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal",children:(s=e.options)==null?void 0:s.map(a=>t.jsx("option",{children:a},a))}):t.jsx("input",{type:e.type||"text",value:String(d[e.key]??""),onChange:a=>p({...d,[e.key]:e.type==="number"?Number(a.target.value):a.target.value}),placeholder:e.placeholder,className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal"})]},e.key)})]}),t.jsxs("div",{className:"modal-footer flex justify-end gap-3",children:[t.jsx("button",{type:"button",onClick:()=>j(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5 text-sm",children:"取消"}),t.jsxs("button",{type:"button",onClick:()=>void Ue(),disabled:ue,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[ue?t.jsx(te,{className:"h-4 w-4 animate-spin"}):t.jsx(Le,{className:"h-4 w-4"}),"保存"]})]})]})}),Be&&t.jsx("div",{className:"modal-overlay",children:t.jsxs("div",{className:"modal-container max-w-2xl",children:[t.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900",children:v?"编辑通知规则":"新建通知规则"}),t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"选择这条规则要通知的内容,未勾选任何类型表示订阅全部事件。"})]}),t.jsx("button",{type:"button",onClick:()=>u(!1),title:"关闭",className:"flex h-9 w-9 items-center justify-center rounded-md hover:bg-gray-100",children:t.jsx(Se,{className:"h-5 w-5"})})]}),t.jsxs("div",{className:"modal-body space-y-4",children:[t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["账号",t.jsxs("select",{value:M,disabled:!!v,onChange:e=>q(e.target.value),className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal disabled:bg-gray-100",children:[t.jsx("option",{value:"",children:"选择账号"}),x.map(e=>t.jsx("option",{value:e.id,children:oe(e)},e.id))]})]}),t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["通知渠道",t.jsxs("select",{value:W,disabled:!!v,onChange:e=>G(e.target.value),className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal disabled:bg-gray-100",children:[t.jsx("option",{value:"",children:"选择已启用渠道"}),A.filter(e=>e.enabled).map(e=>t.jsx("option",{value:e.id,children:e.name},e.id))]})]})]}),t.jsxs("label",{className:"block text-sm font-bold text-gray-700",children:["规则名称(可选)",t.jsx("input",{value:z,onChange:e=>F(e.target.value),placeholder:"例如:仅关键提醒",className:"ios-input mt-2 w-full rounded-md px-3 py-2.5 font-normal"})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-sm font-bold text-gray-700",children:"通知内容"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{type:"button",onClick:()=>X("all"),className:"rounded-md bg-gray-100 px-3 py-1.5 text-xs font-bold text-gray-700 hover:bg-gray-200",children:"全选"}),t.jsx("button",{type:"button",onClick:()=>X("critical"),className:"rounded-md bg-red-50 px-3 py-1.5 text-xs font-bold text-red-700 hover:bg-red-100",children:"仅关键"}),t.jsx("button",{type:"button",onClick:()=>X("none"),className:"rounded-md bg-gray-100 px-3 py-1.5 text-xs font-bold text-gray-700 hover:bg-gray-200",children:"清空"})]})]}),t.jsx("div",{className:"mt-3 space-y-3",children:Qe.map(e=>{const s=f.filter(n=>n.priority===e.id);if(s.length===0)return null;const a=e.id==="critical"?"text-red-700":e.id==="warning"?"text-amber-700":"text-gray-600";return t.jsxs("div",{children:[t.jsx("p",{className:`text-xs font-bold ${a}`,children:e.label}),t.jsx("div",{className:"mt-2 grid gap-2 sm:grid-cols-2",children:s.map(n=>{const c=H.includes(n.id);return t.jsxs("button",{type:"button",onClick:()=>et(n.id),className:`flex items-start gap-2 rounded-md border p-3 text-left transition-colors ${c?"border-[#ffe100] bg-[#fffbe6]":"border-gray-200 bg-white hover:bg-gray-50"}`,children:[t.jsx("span",{className:`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border ${c?"border-[#ffe100] bg-[#ffe100]":"border-gray-300 bg-white"}`,children:c&&t.jsx(_t,{className:"h-3 w-3 text-gray-900"})}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block text-sm font-bold text-gray-900",children:n.label}),t.jsx("span",{className:"mt-0.5 block text-xs text-gray-500",children:n.description})]})]},n.id)})})]},e.id)})}),t.jsx("p",{className:"mt-3 text-xs text-gray-500",children:"未勾选任何类型时接收全部事件;只想收关键提醒可点“仅关键”。"})]})]}),t.jsxs("div",{className:"modal-footer flex justify-end gap-3",children:[t.jsx("button",{type:"button",onClick:()=>u(!1),className:"ios-btn-secondary rounded-md px-4 py-2.5 text-sm",children:"取消"}),t.jsxs("button",{type:"button",onClick:()=>void tt(),disabled:be,className:"ios-btn-primary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[be?t.jsx(te,{className:"h-4 w-4 animate-spin"}):t.jsx(Le,{className:"h-4 w-4"}),"保存"]})]})]})})]})};export{Wt as default}; diff --git a/static/assets/OrderList-DnNov42V.js b/static/assets/OrderList-CMlmoGwo.js similarity index 98% rename from static/assets/OrderList-DnNov42V.js rename to static/assets/OrderList-CMlmoGwo.js index e75624a..6d2ea4b 100644 --- a/static/assets/OrderList-DnNov42V.js +++ b/static/assets/OrderList-CMlmoGwo.js @@ -1,4 +1,4 @@ -import{c as Re,r as l,h as ys,O as js,j as e,e as $,P as fs,E as vs,Q as Ns,b as N,X as _,o as _s,T as ws,V as Me,W as ks,Y as Ss,n,Z as Cs,v as Pe,_ as Os,$ as Es,a0 as Ls,a1 as Is,a2 as Ms,a3 as Ps,a4 as Ds,a5 as Fs}from"./index-IChzZLcq.js";import{a as As,b as $s,E as Rs}from"./ui-DHCIdv_V.js";import{P as qs}from"./plus-hTzuza9d.js";import{T as De}from"./truck-eLsCuQDz.js";import{S as Ts}from"./search-D1CHR5V5.js";import{P as Y}from"./package-check-FQzJ-066.js";import{F as zs}from"./flower-2-DPAmZVRG.js";import{E as Vs}from"./eye-BNO0yecz.js";import{S as Hs}from"./square-pen-BOlWgFhh.js";import{T as Js}from"./trash-2-CnOVC8WZ.js";import{C as Ws,a as Bs}from"./chevron-right-DwOZeQi3.js";import{S as Fe}from"./save-m64KWfbE.js";/** +import{c as Re,r as l,h as ys,O as js,j as e,e as $,P as fs,E as vs,Q as Ns,b as N,X as _,o as _s,T as ws,V as Me,W as ks,Y as Ss,n,Z as Cs,v as Pe,_ as Os,$ as Es,a0 as Ls,a1 as Is,a2 as Ms,a3 as Ps,a4 as Ds,a5 as Fs}from"./index-C6Y7HdB3.js";import{a as As,b as $s,E as Rs}from"./ui-Dh615-z8.js";import{P as qs}from"./plus-BZHhM3Ok.js";import{T as De}from"./truck-Cz_KAtqT.js";import{S as Ts}from"./search-DbZW8Se5.js";import{P as Y}from"./package-check-C8PHQCAA.js";import{F as zs}from"./flower-2-CSgAnLCK.js";import{E as Vs}from"./eye-BXgO1egk.js";import{S as Hs}from"./square-pen-ptW8MQaM.js";import{T as Js}from"./trash-2-BG9PyYJR.js";import{C as Ws,a as Bs}from"./chevron-right-zTm23uAy.js";import{S as Fe}from"./save-C5DQBwo1.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/PeerShops-CypJHQVt.js b/static/assets/PeerShops-Iz71xL1V.js similarity index 98% rename from static/assets/PeerShops-CypJHQVt.js rename to static/assets/PeerShops-Iz71xL1V.js index aaca5bc..48a2e0f 100644 --- a/static/assets/PeerShops-CypJHQVt.js +++ b/static/assets/PeerShops-Iz71xL1V.js @@ -1,4 +1,4 @@ -import{c as B,r as d,bR as T,o as G,bS as J,bT as Q,j as e,bU as q,L as S,e as W,E as X}from"./index-IChzZLcq.js";import{P as Z,a as ee,N as te,E as D}from"./ui-DHCIdv_V.js";import{S as K}from"./sparkles-B5X13VUJ.js";import{P as se}from"./package-3qqwOYvH.js";import{S as re}from"./search-D1CHR5V5.js";import{T as ae}from"./trending-up-BDgJo2q2.js";/** +import{c as B,r as d,bR as T,o as G,bS as J,bT as Q,j as e,bU as q,L as S,e as W,E as X}from"./index-C6Y7HdB3.js";import{P as Z,a as ee,N as te,E as D}from"./ui-Dh615-z8.js";import{S as K}from"./sparkles-CczcRRJP.js";import{P as se}from"./package-DjIVaNpE.js";import{S as re}from"./search-DbZW8Se5.js";import{T as ae}from"./trending-up-BR0vQ8dC.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/PriceWatch-Db4Gwt9m.js b/static/assets/PriceWatch-B4ja8BGi.js similarity index 98% rename from static/assets/PriceWatch-Db4Gwt9m.js rename to static/assets/PriceWatch-B4ja8BGi.js index 252e95c..040d5c6 100644 --- a/static/assets/PriceWatch-Db4Gwt9m.js +++ b/static/assets/PriceWatch-B4ja8BGi.js @@ -1,4 +1,4 @@ -import{c as C,r as l,bV as pe,bW as he,j as e,bX as X,e as E,X as q,bY as ue,aF as be,bZ as je,b_ as ge,b$ as V,c0 as ve,c1 as _e,c2 as ye}from"./index-IChzZLcq.js";import{P as Z,a as Ne,N as R,E as J}from"./ui-DHCIdv_V.js";import{P as fe}from"./plus-hTzuza9d.js";import{P as Q}from"./play-52JRVRYm.js";import{P as we}from"./pen-line-27OudxQx.js";import{T as ke}from"./trash-2-CnOVC8WZ.js";import{S as U}from"./search-D1CHR5V5.js";/** +import{c as C,r as l,bV as pe,bW as he,j as e,bX as X,e as E,X as q,bY as ue,aF as be,bZ as je,b_ as ge,b$ as V,c0 as ve,c1 as _e,c2 as ye}from"./index-C6Y7HdB3.js";import{P as Z,a as Ne,N as R,E as J}from"./ui-Dh615-z8.js";import{P as fe}from"./plus-BZHhM3Ok.js";import{P as Q}from"./play-B67lJrJT.js";import{P as we}from"./pen-line-B2U8YMna.js";import{T as ke}from"./trash-2-BG9PyYJR.js";import{S as U}from"./search-DbZW8Se5.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/ProductAutomation-ByBZohdg.js b/static/assets/ProductAutomation-BTRBUe6v.js similarity index 98% rename from static/assets/ProductAutomation-ByBZohdg.js rename to static/assets/ProductAutomation-BTRBUe6v.js index 1bee8f5..f2b8f55 100644 --- a/static/assets/ProductAutomation-ByBZohdg.js +++ b/static/assets/ProductAutomation-BTRBUe6v.js @@ -1,4 +1,4 @@ -import{c as H,r as c,j as e,aB as J,e as ye,S as ge,E as be,L as j,aC as je,aD as _e,aE as Ne,aF as ve,X as O,o as fe,aG as we,aH as ke,aI as Ce,aJ as U,n as r,v as E,aK as $e,aL as Se,aM as Pe,aN as De,aO as Re,aP as Fe,aQ as Me,aR as Le}from"./index-IChzZLcq.js";import{P as Ie,a as Ae,b as Ee,S as _,E as N,N as ze}from"./ui-DHCIdv_V.js";import{S as C}from"./search-D1CHR5V5.js";import{T as v}from"./trash-2-CnOVC8WZ.js";import{S as z}from"./save-m64KWfbE.js";import{P as X}from"./play-52JRVRYm.js";import{P as Te}from"./package-check-FQzJ-066.js";import{L as Be}from"./link-2-CYVpjq_H.js";/** +import{c as H,r as c,j as e,aB as J,e as ye,S as ge,E as be,L as j,aC as je,aD as _e,aE as Ne,aF as ve,X as O,o as fe,aG as we,aH as ke,aI as Ce,aJ as U,n as r,v as E,aK as $e,aL as Se,aM as Pe,aN as De,aO as Re,aP as Fe,aQ as Me,aR as Le}from"./index-C6Y7HdB3.js";import{P as Ie,a as Ae,b as Ee,S as _,E as N,N as ze}from"./ui-Dh615-z8.js";import{S as C}from"./search-DbZW8Se5.js";import{T as v}from"./trash-2-BG9PyYJR.js";import{S as z}from"./save-C5DQBwo1.js";import{P as X}from"./play-B67lJrJT.js";import{P as Te}from"./package-check-C8PHQCAA.js";import{L as Be}from"./link-2-CUR4V6rB.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/Resell-C3EooCYv.js b/static/assets/Resell-eqQKBhXl.js similarity index 98% rename from static/assets/Resell-C3EooCYv.js rename to static/assets/Resell-eqQKBhXl.js index da3f7b5..45dab0a 100644 --- a/static/assets/Resell-C3EooCYv.js +++ b/static/assets/Resell-eqQKBhXl.js @@ -1,4 +1,4 @@ -import{c as Fe,r,o as Ee,j as e,bH as le,L as g,b as Re,X as ie,E as Ae,bI as $e,bJ as Ue,bK as qe,bL as De,bM as Me,bN as Te}from"./index-IChzZLcq.js";import{a as ze,N as Be,b as He,E as ne}from"./ui-DHCIdv_V.js";import{S as F}from"./search-D1CHR5V5.js";import{P as Oe}from"./plus-hTzuza9d.js";import{S as Ke}from"./sparkles-B5X13VUJ.js";import{P as We}from"./package-3qqwOYvH.js";/** +import{c as Fe,r,o as Ee,j as e,bH as le,L as g,b as Re,X as ie,E as Ae,bI as $e,bJ as Ue,bK as qe,bL as De,bM as Me,bN as Te}from"./index-C6Y7HdB3.js";import{a as ze,N as Be,b as He,E as ne}from"./ui-Dh615-z8.js";import{S as F}from"./search-DbZW8Se5.js";import{P as Oe}from"./plus-BZHhM3Ok.js";import{S as Ke}from"./sparkles-CczcRRJP.js";import{P as We}from"./package-DjIVaNpE.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/Settings-BKqYYBIp.js b/static/assets/Settings-CgkuCQg8.js similarity index 98% rename from static/assets/Settings-BKqYYBIp.js rename to static/assets/Settings-CgkuCQg8.js index 5233515..2c32a11 100644 --- a/static/assets/Settings-BKqYYBIp.js +++ b/static/assets/Settings-CgkuCQg8.js @@ -1,4 +1,4 @@ -import{c as se,r as l,aT as ae,j as e,l as te,e as K,aU as ne,aV as v,aW as q,S as le,ak as O,aX as ie,aY as re,n as c,aZ as ce,a_ as oe,a$ as de,b0 as pe,b1 as me,b2 as ue}from"./index-IChzZLcq.js";import{P as xe,a as he,b as ge,S as p,N as ye}from"./ui-DHCIdv_V.js";import{S as je}from"./save-m64KWfbE.js";import{S as Q}from"./sparkles-B5X13VUJ.js";import{Z as L}from"./zap-CQAFaWUI.js";import{E as w}from"./eye-off-DA35-r8G.js";import{E as C}from"./eye-BNO0yecz.js";/** +import{c as se,r as l,aT as ae,j as e,l as te,e as K,aU as ne,aV as v,aW as q,S as le,ak as O,aX as ie,aY as re,n as c,aZ as ce,a_ as oe,a$ as de,b0 as pe,b1 as me,b2 as ue}from"./index-C6Y7HdB3.js";import{P as xe,a as he,b as ge,S as p,N as ye}from"./ui-Dh615-z8.js";import{S as je}from"./save-C5DQBwo1.js";import{S as Q}from"./sparkles-CczcRRJP.js";import{Z as L}from"./zap-BAb90aFH.js";import{E as w}from"./eye-off-DqZjZWJp.js";import{E as C}from"./eye-BXgO1egk.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/UserManagement-WEnM8-3J.js b/static/assets/UserManagement-93cH0Rs5.js similarity index 98% rename from static/assets/UserManagement-WEnM8-3J.js rename to static/assets/UserManagement-93cH0Rs5.js index 8c50fd6..64fe59f 100644 --- a/static/assets/UserManagement-WEnM8-3J.js +++ b/static/assets/UserManagement-93cH0Rs5.js @@ -1 +1 @@ -import{r as l,j as e,U as h,e as $,S as j,aU as A,L as f,ak as L,bA as P,n as i,v as y,bB as R,bC as T,aZ as E,bD as _}from"./index-IChzZLcq.js";import{a as I,S as N,E as B}from"./ui-DHCIdv_V.js";import{T as D}from"./trash-2-CnOVC8WZ.js";const H=n=>{if(!n)return"-";const c=new Date(n.includes("T")?n:`${n.replace(" ","T")}Z`);return Number.isNaN(c.getTime())?n:c.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},M=()=>{const[n,c]=l.useState([]),[u,g]=l.useState(!0),[o,d]=l.useState(null),[w,p]=l.useState(null),[b,m]=l.useState(""),x=async()=>{g(!0);try{c(await P())}catch(t){i(`加载用户列表失败:${t.message}`,"error")}finally{g(!1)}};l.useEffect(()=>{x()},[]);const U=async t=>{if(o!==null)return;const s=t.is_active!==!1;if(!(s&&!await y(`禁用用户「${t.username}」?其所有在线会话将立即下线,且无法再登录。`,{title:"禁用用户",confirmLabel:"禁用",danger:!0}))){d(t.id);try{const a=await R(t.id,!s);i(a.message||"状态已更新","success"),await x()}catch(a){i(`操作失败:${a.message}`,"error")}finally{d(null)}}},C=async t=>{const[s,a]=E(b);if(!s){i(a,"warning");return}if(o===null){d(t.id);try{const r=await _(t.id,b);i(r.message||"密码已重置","success"),p(null),m("")}catch(r){i(`重置失败:${r.message}`,"error")}finally{d(null)}}},k=async t=>{if(o===null&&await y(`删除用户「${t.username}」?其名下的闲鱼账号、卡密、回复规则等数据将一并删除,不可恢复。`,{title:"删除用户",confirmLabel:"删除",danger:!0})){d(t.id);try{const s=await T(t.id);i(s.message||"用户已删除","success"),await x()}catch(s){i(`删除失败:${s.message}`,"error")}finally{d(null)}}};return e.jsxs("div",{className:"page-stack",children:[e.jsx(I,{title:"用户管理",description:"管理注册用户与登录权限。普通用户仅能操作分配给其名下的账号数据。",icon:h,actions:e.jsxs("button",{type:"button",onClick:()=>void x(),className:"ios-btn-secondary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx($,{className:`h-4 w-4 ${u?"animate-spin":""}`}),"刷新"]})}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"权限说明",icon:j}),e.jsxs("div",{className:"grid gap-3 p-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(j,{className:"h-4 w-4 text-[#8a6300]"}),"管理员(admin)"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"拥有全部权限:系统设置、通知与系统日志、用户管理,以及所有闲鱼账号和数据。"})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(A,{className:"h-4 w-4 text-[var(--text-soft)]"}),"普通用户"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"只能看到并操作自己名下的闲鱼账号、商品、订单与消息;侧栏不显示系统设置与用户管理,接口层也会拒绝其访问。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"用户列表",description:`共 ${n.length} 个用户`,icon:h}),e.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[n.map(t=>{const s=t.username==="admin",a=t.is_active===!1,r=o===t.id,v=w===t.id;return e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[var(--brand)] text-sm font-black text-[#2a2416]",children:t.username.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm font-bold text-[var(--text)]",children:t.username}),s&&e.jsx("span",{className:"rounded-full bg-[var(--brand)] px-2 py-0.5 text-[10px] font-bold text-[#2a2416]",children:"内置管理员"}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-bold ${a?"bg-red-50 text-red-600":"bg-emerald-50 text-emerald-600"}`,children:a?"已禁用":"正常"})]}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-[var(--text-muted)]",children:t.email}),e.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-soft)]",children:[t.cookie_count??0," 个闲鱼账号 · ",t.card_count??0," 张卡密 · 注册于 ",H(t.created_at)]})]}),!s&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void U(t),disabled:r,className:a?"rounded-md bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-700 hover:bg-emerald-100 disabled:opacity-50":"rounded-md bg-amber-50 px-3 py-2 text-xs font-bold text-amber-700 hover:bg-amber-100 disabled:opacity-50",children:r?e.jsx(f,{className:"h-4 w-4 animate-spin"}):a?"启用":"禁用"}),e.jsx("button",{type:"button",onClick:()=>{p(v?null:t.id),m("")},disabled:r,title:"重置密码",className:"flex h-9 w-9 items-center justify-center rounded-md bg-[var(--surface-subtle)] text-[var(--text-muted)] hover:bg-[var(--surface-hover)] hover:text-[var(--text)] disabled:opacity-50",children:e.jsx(L,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void k(t),disabled:r,title:"删除用户",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100 disabled:opacity-50",children:e.jsx(D,{className:"h-4 w-4"})})]})]}),v&&!s&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3",children:[e.jsx("input",{type:"password",value:b,onChange:S=>m(S.target.value),placeholder:"新密码:至少 8 位,含字母和数字",autoComplete:"new-password",className:"ios-input h-10 min-w-0 flex-1 rounded-md px-3 text-sm"}),e.jsx("button",{type:"button",onClick:()=>void C(t),disabled:r,className:"ios-btn-primary h-10 rounded-md px-4 text-sm disabled:opacity-50",children:r?e.jsx(f,{className:"h-4 w-4 animate-spin"}):"确认重置"}),e.jsx("button",{type:"button",onClick:()=>{p(null),m("")},className:"ios-btn-secondary h-10 rounded-md px-4 text-sm",children:"取消"})]})]},t.id)}),!u&&n.length===0&&e.jsx(B,{compact:!0,title:"暂无用户",description:"开放注册后,新注册的用户会出现在这里。",icon:h}),u&&e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(f,{className:"h-6 w-6 animate-spin text-[#d6b600]"})})]})]})]})};export{M as default}; +import{r as l,j as e,U as h,e as $,S as j,aU as A,L as f,ak as L,bA as P,n as i,v as y,bB as R,bC as T,aZ as E,bD as _}from"./index-C6Y7HdB3.js";import{a as I,S as N,E as B}from"./ui-Dh615-z8.js";import{T as D}from"./trash-2-BG9PyYJR.js";const H=n=>{if(!n)return"-";const c=new Date(n.includes("T")?n:`${n.replace(" ","T")}Z`);return Number.isNaN(c.getTime())?n:c.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},M=()=>{const[n,c]=l.useState([]),[u,g]=l.useState(!0),[o,d]=l.useState(null),[w,p]=l.useState(null),[b,m]=l.useState(""),x=async()=>{g(!0);try{c(await P())}catch(t){i(`加载用户列表失败:${t.message}`,"error")}finally{g(!1)}};l.useEffect(()=>{x()},[]);const U=async t=>{if(o!==null)return;const s=t.is_active!==!1;if(!(s&&!await y(`禁用用户「${t.username}」?其所有在线会话将立即下线,且无法再登录。`,{title:"禁用用户",confirmLabel:"禁用",danger:!0}))){d(t.id);try{const a=await R(t.id,!s);i(a.message||"状态已更新","success"),await x()}catch(a){i(`操作失败:${a.message}`,"error")}finally{d(null)}}},C=async t=>{const[s,a]=E(b);if(!s){i(a,"warning");return}if(o===null){d(t.id);try{const r=await _(t.id,b);i(r.message||"密码已重置","success"),p(null),m("")}catch(r){i(`重置失败:${r.message}`,"error")}finally{d(null)}}},k=async t=>{if(o===null&&await y(`删除用户「${t.username}」?其名下的闲鱼账号、卡密、回复规则等数据将一并删除,不可恢复。`,{title:"删除用户",confirmLabel:"删除",danger:!0})){d(t.id);try{const s=await T(t.id);i(s.message||"用户已删除","success"),await x()}catch(s){i(`删除失败:${s.message}`,"error")}finally{d(null)}}};return e.jsxs("div",{className:"page-stack",children:[e.jsx(I,{title:"用户管理",description:"管理注册用户与登录权限。普通用户仅能操作分配给其名下的账号数据。",icon:h,actions:e.jsxs("button",{type:"button",onClick:()=>void x(),className:"ios-btn-secondary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx($,{className:`h-4 w-4 ${u?"animate-spin":""}`}),"刷新"]})}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"权限说明",icon:j}),e.jsxs("div",{className:"grid gap-3 p-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(j,{className:"h-4 w-4 text-[#8a6300]"}),"管理员(admin)"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"拥有全部权限:系统设置、通知与系统日志、用户管理,以及所有闲鱼账号和数据。"})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(A,{className:"h-4 w-4 text-[var(--text-soft)]"}),"普通用户"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"只能看到并操作自己名下的闲鱼账号、商品、订单与消息;侧栏不显示系统设置与用户管理,接口层也会拒绝其访问。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"用户列表",description:`共 ${n.length} 个用户`,icon:h}),e.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[n.map(t=>{const s=t.username==="admin",a=t.is_active===!1,r=o===t.id,v=w===t.id;return e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[var(--brand)] text-sm font-black text-[#2a2416]",children:t.username.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm font-bold text-[var(--text)]",children:t.username}),s&&e.jsx("span",{className:"rounded-full bg-[var(--brand)] px-2 py-0.5 text-[10px] font-bold text-[#2a2416]",children:"内置管理员"}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-bold ${a?"bg-red-50 text-red-600":"bg-emerald-50 text-emerald-600"}`,children:a?"已禁用":"正常"})]}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-[var(--text-muted)]",children:t.email}),e.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-soft)]",children:[t.cookie_count??0," 个闲鱼账号 · ",t.card_count??0," 张卡密 · 注册于 ",H(t.created_at)]})]}),!s&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void U(t),disabled:r,className:a?"rounded-md bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-700 hover:bg-emerald-100 disabled:opacity-50":"rounded-md bg-amber-50 px-3 py-2 text-xs font-bold text-amber-700 hover:bg-amber-100 disabled:opacity-50",children:r?e.jsx(f,{className:"h-4 w-4 animate-spin"}):a?"启用":"禁用"}),e.jsx("button",{type:"button",onClick:()=>{p(v?null:t.id),m("")},disabled:r,title:"重置密码",className:"flex h-9 w-9 items-center justify-center rounded-md bg-[var(--surface-subtle)] text-[var(--text-muted)] hover:bg-[var(--surface-hover)] hover:text-[var(--text)] disabled:opacity-50",children:e.jsx(L,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>void k(t),disabled:r,title:"删除用户",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100 disabled:opacity-50",children:e.jsx(D,{className:"h-4 w-4"})})]})]}),v&&!s&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3",children:[e.jsx("input",{type:"password",value:b,onChange:S=>m(S.target.value),placeholder:"新密码:至少 8 位,含字母和数字",autoComplete:"new-password",className:"ios-input h-10 min-w-0 flex-1 rounded-md px-3 text-sm"}),e.jsx("button",{type:"button",onClick:()=>void C(t),disabled:r,className:"ios-btn-primary h-10 rounded-md px-4 text-sm disabled:opacity-50",children:r?e.jsx(f,{className:"h-4 w-4 animate-spin"}):"确认重置"}),e.jsx("button",{type:"button",onClick:()=>{p(null),m("")},className:"ios-btn-secondary h-10 rounded-md px-4 text-sm",children:"取消"})]})]},t.id)}),!u&&n.length===0&&e.jsx(B,{compact:!0,title:"暂无用户",description:"开放注册后,新注册的用户会出现在这里。",icon:h}),u&&e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(f,{className:"h-6 w-6 animate-spin text-[#d6b600]"})})]})]})]})};export{M as default}; diff --git a/static/assets/activity-CRI26G7w.js b/static/assets/activity-CV-Hy1l6.js similarity index 89% rename from static/assets/activity-CRI26G7w.js rename to static/assets/activity-CV-Hy1l6.js index 0e867a3..301d49a 100644 --- a/static/assets/activity-CRI26G7w.js +++ b/static/assets/activity-CV-Hy1l6.js @@ -1,4 +1,4 @@ -import{c as t}from"./index-IChzZLcq.js";/** +import{c as t}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/check-6Gro50Mh.js b/static/assets/check--qTdUCr3.js similarity index 86% rename from static/assets/check-6Gro50Mh.js rename to static/assets/check--qTdUCr3.js index 2469a1f..b733a35 100644 --- a/static/assets/check-6Gro50Mh.js +++ b/static/assets/check--qTdUCr3.js @@ -1,4 +1,4 @@ -import{c}from"./index-IChzZLcq.js";/** +import{c}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/chevron-right-DwOZeQi3.js b/static/assets/chevron-right-zTm23uAy.js similarity index 92% rename from static/assets/chevron-right-DwOZeQi3.js rename to static/assets/chevron-right-zTm23uAy.js index 32ca6c3..fa74466 100644 --- a/static/assets/chevron-right-DwOZeQi3.js +++ b/static/assets/chevron-right-zTm23uAy.js @@ -1,4 +1,4 @@ -import{c as o}from"./index-IChzZLcq.js";/** +import{c as o}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/eye-BNO0yecz.js b/static/assets/eye-BXgO1egk.js similarity index 90% rename from static/assets/eye-BNO0yecz.js rename to static/assets/eye-BXgO1egk.js index 6d1cf38..a92cdd9 100644 --- a/static/assets/eye-BNO0yecz.js +++ b/static/assets/eye-BXgO1egk.js @@ -1,4 +1,4 @@ -import{c}from"./index-IChzZLcq.js";/** +import{c}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/eye-off-DA35-r8G.js b/static/assets/eye-off-DqZjZWJp.js similarity index 92% rename from static/assets/eye-off-DA35-r8G.js rename to static/assets/eye-off-DqZjZWJp.js index e871f75..2c533f0 100644 --- a/static/assets/eye-off-DA35-r8G.js +++ b/static/assets/eye-off-DqZjZWJp.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/flower-2-DPAmZVRG.js b/static/assets/flower-2-CSgAnLCK.js similarity index 93% rename from static/assets/flower-2-DPAmZVRG.js rename to static/assets/flower-2-CSgAnLCK.js index 1df8889..8d55c09 100644 --- a/static/assets/flower-2-DPAmZVRG.js +++ b/static/assets/flower-2-CSgAnLCK.js @@ -1,4 +1,4 @@ -import{c}from"./index-IChzZLcq.js";/** +import{c}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/image-BCD-eej2.js b/static/assets/image-DkNS6I4I.js similarity index 90% rename from static/assets/image-BCD-eej2.js rename to static/assets/image-DkNS6I4I.js index 9265e05..170c73c 100644 --- a/static/assets/image-BCD-eej2.js +++ b/static/assets/image-DkNS6I4I.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/index-AteK7Kef.css b/static/assets/index-AteK7Kef.css new file mode 100644 index 0000000..0984e79 --- /dev/null +++ b/static/assets/index-AteK7Kef.css @@ -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:rgb(var(--gray-200) / 1)}: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:rgb(var(--gray-400) / 1)}input::placeholder,textarea::placeholder{opacity:1;color:rgb(var(--gray-400) / 1)}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}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-x-3{left:.75rem;right:.75rem}.-bottom-1{bottom:-.25rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1\.5{top:-.375rem}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.bottom-4{bottom:1rem}.bottom-8{bottom:2rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-3\.5{left:.875rem}.left-4{left:1rem}.left-5{left:1.25rem}.right-0{right:0}.right-0\.5{right:.125rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-14{top:3.5rem}.top-2{top:.5rem}.top-4{top:1rem}.top-8{top:2rem}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[10000\]{z-index:10000}.col-span-2{grid-column:span 2 / span 2}.m-3{margin:.75rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-ml-2{margin-left:-.5rem}.-mt-1{margin-top:-.25rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-44{height:11rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[18px\]{height:18px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[340px\]{height:340px}.h-\[68px\]{height:68px}.h-\[76px\]{height:76px}.h-\[calc\(100vh-3\.5rem\)\]{height:calc(100vh - 3.5rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-72{max-height:18rem}.max-h-80{max-height:20rem}.max-h-\[220px\]{max-height:220px}.max-h-\[400px\]{max-height:400px}.max-h-\[460px\]{max-height:460px}.max-h-\[620px\]{max-height:620px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[92vh\]{max-height:92vh}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-11{min-height:2.75rem}.min-h-20{min-height:5rem}.min-h-24{min-height:6rem}.min-h-28{min-height:7rem}.min-h-36{min-height:9rem}.min-h-64{min-height:16rem}.min-h-\[2\.5rem\]{min-height:2.5rem}.min-h-\[320px\]{min-height:320px}.min-h-\[42px\]{min-height:42px}.min-h-\[500px\]{min-height:500px}.min-h-\[560px\]{min-height:560px}.min-h-\[56px\]{min-height:56px}.min-h-\[84px\]{min-height:84px}.min-h-\[calc\(100vh-2rem\)\]{min-height:calc(100vh - 2rem)}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-44{width:11rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[10\%\]{width:10%}.w-\[11\%\]{width:11%}.w-\[12\%\]{width:12%}.w-\[13\%\]{width:13%}.w-\[15\%\]{width:15%}.w-\[16\%\]{width:16%}.w-\[17\%\]{width:17%}.w-\[18\%\]{width:18%}.w-\[18px\]{width:18px}.w-\[20\%\]{width:20%}.w-\[22\%\]{width:22%}.w-\[248px\]{width:248px}.w-\[25\%\]{width:25%}.w-\[44\%\]{width:44%}.w-\[6\%\]{width:6%}.w-\[min\(22rem\,calc\(100vw-3rem\)\)\]{width:min(22rem,calc(100vw - 3rem))}.w-\[min\(380px\,calc\(100vw-2rem\)\)\]{width:min(380px,calc(100vw - 2rem))}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-20{min-width:5rem}.min-w-5{min-width:1.25rem}.min-w-\[1040px\]{min-width:1040px}.min-w-\[3\.5rem\]{min-width:3.5rem}.min-w-\[760px\]{min-width:760px}.min-w-\[820px\]{min-width:820px}.min-w-\[860px\]{min-width:860px}.min-w-\[900px\]{min-width:900px}.min-w-\[980px\]{min-width:980px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-52{max-width:13rem}.max-w-5xl{max-width:64rem}.max-w-72{max-width:18rem}.max-w-\[10rem\]{max-width:10rem}.max-w-\[1320px\]{max-width:1320px}.max-w-\[1600px\]{max-width:1600px}.max-w-\[220px\]{max-width:220px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-\[380px\]{max-width:380px}.max-w-\[680px\]{max-width:680px}.max-w-\[76\%\]{max-width:76%}.max-w-\[86\%\]{max-width:86%}.max-w-\[980px\]{max-width:980px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.cursor-crosshair{cursor:crosshair}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize-y{resize:vertical}.resize{resize:both}.scroll-mt-32{scroll-margin-top:8rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[340px_140px_260px_210px_110px\]{grid-template-columns:340px 140px 260px 210px 110px}.grid-cols-\[48px_minmax\(0\,1fr\)_auto\]{grid-template-columns:48px minmax(0,1fr) auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-y-2>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(2px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(2px * var(--tw-divide-y-reverse))}.divide-\[\#eeeeee\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(238 238 238 / var(--tw-divide-opacity, 1))}.divide-\[var\(--border\)\]>:not([hidden])~:not([hidden]){border-color:var(--border)}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(var(--gray-100) / var(--tw-divide-opacity, 1))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(var(--gray-200) / var(--tw-divide-opacity, 1))}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:8px}.rounded-2xl{border-radius:24px}.rounded-3xl{border-radius:32px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:16px}.rounded-md{border-radius:10px}.rounded-none{border-radius:0}.rounded-xl{border-radius:20px}.rounded-b-md{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-dashed{border-style:dashed}.border-\[\#f5c800\]{--tw-border-opacity: 1;border-color:rgb(245 200 0 / var(--tw-border-opacity, 1))}.border-\[\#ffe100\]{--tw-border-opacity: 1;border-color:rgb(255 225 0 / var(--tw-border-opacity, 1))}.border-\[\#ffe566\]{--tw-border-opacity: 1;border-color:rgb(255 229 102 / var(--tw-border-opacity, 1))}.border-\[var\(--border\)\]{border-color:var(--border)}.border-\[var\(--border-light\)\]{border-color:var(--border-light)}.border-\[var\(--border-strong\)\]{border-color:var(--border-strong)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-400{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-brand-200{--tw-border-opacity: 1;border-color:rgb(255 239 163 / var(--tw-border-opacity, 1))}.border-cyan-100{--tw-border-opacity: 1;border-color:rgb(207 250 254 / var(--tw-border-opacity, 1))}.border-cyan-200{--tw-border-opacity: 1;border-color:rgb(165 243 252 / var(--tw-border-opacity, 1))}.border-cyan-300{--tw-border-opacity: 1;border-color:rgb(103 232 249 / var(--tw-border-opacity, 1))}.border-cyan-600{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity, 1))}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(var(--gray-100) / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(var(--gray-200) / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(var(--gray-300) / var(--tw-border-opacity, 1))}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(var(--gray-50) / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-indigo-200{--tw-border-opacity: 1;border-color:rgb(199 210 254 / var(--tw-border-opacity, 1))}.border-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-sky-200{--tw-border-opacity: 1;border-color:rgb(186 230 253 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-violet-100{--tw-border-opacity: 1;border-color:rgb(237 233 254 / var(--tw-border-opacity, 1))}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity, 1))}.bg-\[\#8fc7a8\]{--tw-bg-opacity: 1;background-color:rgb(143 199 168 / var(--tw-bg-opacity, 1))}.bg-\[\#b8ac8e\]{--tw-bg-opacity: 1;background-color:rgb(184 172 142 / var(--tw-bg-opacity, 1))}.bg-\[\#c9b8e8\]{--tw-bg-opacity: 1;background-color:rgb(201 184 232 / var(--tw-bg-opacity, 1))}.bg-\[\#e8a0a0\]{--tw-bg-opacity: 1;background-color:rgb(232 160 160 / var(--tw-bg-opacity, 1))}.bg-\[\#e8dcbc\]{--tw-bg-opacity: 1;background-color:rgb(232 220 188 / var(--tw-bg-opacity, 1))}.bg-\[\#eef4ff\]{--tw-bg-opacity: 1;background-color:rgb(238 244 255 / var(--tw-bg-opacity, 1))}.bg-\[\#f0f7f3\]{--tw-bg-opacity: 1;background-color:rgb(240 247 243 / var(--tw-bg-opacity, 1))}.bg-\[\#f5c800\]{--tw-bg-opacity: 1;background-color:rgb(245 200 0 / var(--tw-bg-opacity, 1))}.bg-\[\#f7f2fb\]{--tw-bg-opacity: 1;background-color:rgb(247 242 251 / var(--tw-bg-opacity, 1))}.bg-\[\#ff4400\]{--tw-bg-opacity: 1;background-color:rgb(255 68 0 / var(--tw-bg-opacity, 1))}.bg-\[\#ffd700\]{--tw-bg-opacity: 1;background-color:rgb(255 215 0 / var(--tw-bg-opacity, 1))}.bg-\[\#ffe100\]{--tw-bg-opacity: 1;background-color:rgb(255 225 0 / var(--tw-bg-opacity, 1))}.bg-\[\#fff7e6\]{--tw-bg-opacity: 1;background-color:rgb(255 247 230 / var(--tw-bg-opacity, 1))}.bg-\[\#fff8d1\]{--tw-bg-opacity: 1;background-color:rgb(255 248 209 / var(--tw-bg-opacity, 1))}.bg-\[\#fffbe6\]{--tw-bg-opacity: 1;background-color:rgb(255 251 230 / var(--tw-bg-opacity, 1))}.bg-\[\#fffdf0\]{--tw-bg-opacity: 1;background-color:rgb(255 253 240 / var(--tw-bg-opacity, 1))}.bg-\[var\(--app-bg\)\]{background-color:var(--app-bg)}.bg-\[var\(--brand\)\]{background-color:var(--brand)}.bg-\[var\(--brand-50\)\]{background-color:var(--brand-50)}.bg-\[var\(--surface\)\]{background-color:var(--surface)}.bg-\[var\(--surface-hover\)\]{background-color:var(--surface-hover)}.bg-\[var\(--surface-strong\)\]{background-color:var(--surface-strong)}.bg-\[var\(--surface-subtle\)\]{background-color:var(--surface-subtle)}.bg-\[var\(--unread-badge\)\]{background-color:var(--unread-badge)}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-black\/40{background-color:#0006}.bg-black\/55{background-color:#0000008c}.bg-black\/60{background-color:#0009}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(255 253 240 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(255 215 0 / var(--tw-bg-opacity, 1))}.bg-cyan-50{--tw-bg-opacity: 1;background-color:rgb(236 254 255 / var(--tw-bg-opacity, 1))}.bg-cyan-50\/40{background-color:#ecfeff66}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(var(--gray-100) / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(var(--gray-200) / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(var(--gray-300) / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(var(--gray-50) / var(--tw-bg-opacity, 1))}.bg-gray-50\/60{background-color:rgb(var(--gray-50) / .6)}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-indigo-50\/70{background-color:#eef2ffb3}.bg-orange-300{--tw-bg-opacity: 1;background-color:rgb(253 186 116 / var(--tw-bg-opacity, 1))}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-sky-100{--tw-bg-opacity: 1;background-color:rgb(224 242 254 / var(--tw-bg-opacity, 1))}.bg-sky-50{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-violet-50{--tw-bg-opacity: 1;background-color:rgb(245 243 255 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/20{background-color:#fff3}.bg-white\/70{background-color:#ffffffb3}.bg-white\/95{background-color:#fffffff2}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-300{--tw-gradient-from: #fcd34d var(--tw-gradient-from-position);--tw-gradient-to: rgb(252 211 77 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-50{--tw-gradient-from: #fffbeb var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 251 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-200{--tw-gradient-from: rgb(var(--gray-200) / 1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(var(--gray-200) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-300{--tw-gradient-from: #fdba74 var(--tw-gradient-from-position);--tw-gradient-to: rgb(253 186 116 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-amber-500{--tw-gradient-to: #f59e0b var(--tw-gradient-to-position)}.to-gray-400{--tw-gradient-to: rgb(var(--gray-400) / 1) var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-7{padding:1.75rem}.px-0{padding-left:0;padding-right:0}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-10{padding-bottom:2.5rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-11{padding-right:2.75rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-\[0\.15em\]{letter-spacing:.15em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-\[\#2a2416\]{--tw-text-opacity: 1;color:rgb(42 36 22 / var(--tw-text-opacity, 1))}.text-\[\#3f5f8f\]{--tw-text-opacity: 1;color:rgb(63 95 143 / var(--tw-text-opacity, 1))}.text-\[\#3f7a5c\]{--tw-text-opacity: 1;color:rgb(63 122 92 / var(--tw-text-opacity, 1))}.text-\[\#544c39\]{--tw-text-opacity: 1;color:rgb(84 76 57 / var(--tw-text-opacity, 1))}.text-\[\#6b5200\]{--tw-text-opacity: 1;color:rgb(107 82 0 / var(--tw-text-opacity, 1))}.text-\[\#6b5a8a\]{--tw-text-opacity: 1;color:rgb(107 90 138 / var(--tw-text-opacity, 1))}.text-\[\#8a6300\]{--tw-text-opacity: 1;color:rgb(138 99 0 / var(--tw-text-opacity, 1))}.text-\[\#8c7900\]{--tw-text-opacity: 1;color:rgb(140 121 0 / var(--tw-text-opacity, 1))}.text-\[\#999\]{--tw-text-opacity: 1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}.text-\[\#d6b600\]{--tw-text-opacity: 1;color:rgb(214 182 0 / var(--tw-text-opacity, 1))}.text-\[\#d92d20\]{--tw-text-opacity: 1;color:rgb(217 45 32 / var(--tw-text-opacity, 1))}.text-\[\#ff3b30\]{--tw-text-opacity: 1;color:rgb(255 59 48 / var(--tw-text-opacity, 1))}.text-\[\#ff4400\]{--tw-text-opacity: 1;color:rgb(255 68 0 / var(--tw-text-opacity, 1))}.text-\[var\(--border\)\]{color:var(--border)}.text-\[var\(--brand-ink\)\]{color:var(--brand-ink)}.text-\[var\(--brand-primary\)\]{color:var(--brand-primary)}.text-\[var\(--brand-text\)\]{color:var(--brand-text)}.text-\[var\(--danger-ink\)\]{color:var(--danger-ink)}.text-\[var\(--text\)\]{color:var(--text)}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-\[var\(--text-secondary\)\]{color:var(--text-secondary)}.text-\[var\(--text-soft\)\]{color:var(--text-soft)}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-amber-950{--tw-text-opacity: 1;color:rgb(69 26 3 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-brand-ink{--tw-text-opacity: 1;color:rgb(42 36 22 / var(--tw-text-opacity, 1))}.text-cyan-700{--tw-text-opacity: 1;color:rgb(14 116 144 / var(--tw-text-opacity, 1))}.text-cyan-800{--tw-text-opacity: 1;color:rgb(21 94 117 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-emerald-700\/70{color:#047857b3}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-emerald-900\/80{color:#064e3bcc}.text-gray-300{--tw-text-opacity: 1;color:rgb(var(--gray-300) / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(var(--gray-400) / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(var(--gray-500) / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(var(--gray-600) / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(var(--gray-700) / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(var(--gray-800) / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(var(--gray-900) / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.text-indigo-950{--tw-text-opacity: 1;color:rgb(30 27 75 / var(--tw-text-opacity, 1))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-orange-950{--tw-text-opacity: 1;color:rgb(67 20 7 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity, 1))}.text-sky-700{--tw-text-opacity: 1;color:rgb(3 105 161 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-violet-700{--tw-text-opacity: 1;color:rgb(109 40 217 / var(--tw-text-opacity, 1))}.text-violet-900{--tw-text-opacity: 1;color:rgb(76 29 149 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.accent-\[\#f5c400\]{accent-color:#f5c400}.accent-yellow-400{accent-color:#facc15}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_12px_40px_rgba\(20\,24\,28\,0\.24\)\]{--tw-shadow: 0 12px 40px rgba(20,24,28,.24);--tw-shadow-colored: 0 12px 40px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(156\,163\,175\,0\.45\)\]{--tw-shadow: 0 1px 3px rgba(156,163,175,.45);--tw-shadow-colored: 0 1px 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(245\,158\,11\,0\.45\)\]{--tw-shadow: 0 1px 3px rgba(245,158,11,.45);--tw-shadow-colored: 0 1px 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(249\,115\,22\,0\.45\)\]{--tw-shadow: 0 1px 3px rgba(249,115,22,.45);--tw-shadow-colored: 0 1px 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(20\,24\,28\,0\.10\)\]{--tw-shadow: 0 4px 16px rgba(20,24,28,.1);--tw-shadow-colored: 0 4px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[var\(--shadow-card\,0_8px_24px_rgba\(20\,24\,28\,0\.16\)\)\]{--tw-shadow: var(--shadow-card,0 8px 24px rgba(20,24,28,.16));--tw-shadow-colored: 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[var\(--shadow-brand\)\]{--tw-shadow-color: var(--shadow-brand);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[var\(--shadow-sm\)\]{--tw-shadow-color: var(--shadow-sm);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-amber-500\/30{--tw-ring-color: rgb(245 158 11 / .3)}.ring-gray-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(var(--gray-200) / var(--tw-ring-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}*{box-sizing:border-box;margin:0;padding:0}:root,:root[data-theme=light]{color-scheme:light;--app-bg: #f7f6f3;--surface: #ffffff;--surface-subtle: #faf9f7;--surface-strong: #f2f1ed;--surface-hover: #faf9f6;--border: #e9e7e2;--border-strong: #d6d3cc;--border-brand: #ffd400;--text: #23211e;--text-muted: #6b6862;--text-soft: #76716a;--gray-50: 250 250 248;--gray-100: 245 244 240;--gray-200: 235 233 227;--gray-300: 221 217 208;--gray-400: 118 113 106;--gray-500: 107 104 98;--gray-600: 102 98 92;--gray-700: 74 71 66;--gray-800: 51 48 44;--gray-900: 34 32 29;--brand-50: #fffdf0;--brand-100: #fff8d1;--brand-200: #ffefa3;--brand-300: #ffe566;--brand: #ffe100;--brand-hover: #ffd700;--brand-active: #f5c800;--brand-ink: #2a2416;--brand-soft: #fff9c9;--brand-text: #806d00;--selection-bg: #fb923c;--selection-ink: var(--brand-ink);--focus-ring: #806d00;--unread-badge: #dc2626;--danger: #b42318;--danger-ink: #b42318;--danger-soft: #fff0f0;--success: #0f704b;--success-ink: #0f704b;--success-soft: #eefaf3;--warning: #945800;--warning-ink: #945800;--warning-soft: #fff7e6;--info: #2a5f92;--info-ink: #2a5f92;--info-soft: #f0f7ff;--radius-xs: 8px;--radius: 10px;--radius-lg: 16px;--radius-xl: 20px;--radius-pill: 999px;--shadow-sm: 0 1px 2px rgba(35, 33, 30, .05);--shadow-md: 0 6px 20px rgba(35, 33, 30, .08);--shadow-lg: 0 16px 40px rgba(35, 33, 30, .12);--shadow-brand: 0 6px 18px rgba(255, 214, 0, .35);--chart-grid: #ebe9e3;--chart-cursor: rgba(35, 33, 30, .06);--scrollbar-thumb: #d6d3cc;--scrollbar-thumb-hover: #b9b4aa}:root[data-theme=dark]{color-scheme:dark;--app-bg: #11110f;--surface: #191916;--surface-subtle: #20201c;--surface-strong: #292820;--surface-hover: #302e27;--border: #37362f;--border-strong: #504c40;--border-brand: #d9bd19;--text: #f5f2e8;--text-muted: #c2bcae;--text-soft: #aaa59b;--gray-50: 32 32 28;--gray-100: 41 40 34;--gray-200: 56 53 45;--gray-300: 77 72 60;--gray-400: 170 165 155;--gray-500: 174 167 153;--gray-600: 194 188 174;--gray-700: 215 210 198;--gray-800: 234 230 220;--gray-900: 245 242 232;--brand-50: #292617;--brand-100: #373116;--brand-200: #4b4015;--brand-soft: #393216;--brand-text: #f2d85c;--focus-ring: #f2d85c;--danger: #ff8c8c;--danger-ink: #ffaaaa;--danger-soft: #3a1e1e;--success: #75d9a3;--success-ink: #8fe0b5;--success-soft: #173528;--warning: #ffd170;--warning-ink: #f3d77c;--warning-soft: #3a2d16;--info: #91c9ff;--info-ink: #9dccff;--info-soft: #182e45;--shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);--shadow-md: 0 10px 28px rgba(0, 0, 0, .32);--shadow-lg: 0 22px 60px rgba(0, 0, 0, .42);--shadow-brand: 0 7px 22px rgba(221, 187, 0, .18);--chart-grid: #403d36;--chart-cursor: rgba(255, 255, 255, .06);--scrollbar-thumb: #5b574e;--scrollbar-thumb-hover: #d2bd38}html,body,#root{height:100%;width:100%}html{background:var(--app-bg);scrollbar-color:var(--scrollbar-thumb) transparent}body{font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;background-color:var(--app-bg);color:var(--text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}button,input,select,textarea{font:inherit}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}input:disabled,select:disabled,textarea:disabled,input[readonly]{color:var(--text-muted)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,textarea:-webkit-autofill,select:-webkit-autofill{-webkit-text-fill-color:var(--text);caret-color:var(--text);box-shadow:0 0 0 1000px var(--surface) inset;-webkit-transition:background-color 9999s ease-out 0s;transition:background-color 9999s ease-out 0s}.theme-picker{min-width:0;color:var(--text-muted)}.theme-picker__heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;padding:0 2px;font-size:11px;font-weight:700}.theme-picker__status{color:var(--text-soft);font-size:10px;font-weight:600}.theme-switcher{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;border:1px solid var(--border);border-radius:12px;background:var(--surface-strong);padding:3px}.theme-switcher__option{display:inline-flex;min-width:0;min-height:36px;align-items:center;justify-content:center;gap:5px;border:1px solid transparent;border-radius:8px;color:var(--text-muted);font-size:11px;font-weight:650;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.theme-switcher__option:hover{background:var(--surface-hover);color:var(--text)}.theme-switcher__option--active,.theme-switcher__option--active:hover{border-color:var(--border-brand);background:var(--brand-soft);color:var(--brand-text);font-weight:750}.theme-picker--compact .theme-switcher{grid-template-columns:repeat(3,36px);border-radius:11px}.theme-picker--compact .theme-switcher__option{width:36px;min-height:36px}.media-light-surface{color-scheme:light;background:#fff!important;color:#23211e!important}:root[data-theme=dark] .media-light-surface .bg-white,:root[data-theme=dark] .media-light-surface [class~="bg-white/95"]{background-color:#fffffff5!important}:root[data-theme=dark] .media-light-surface .bg-gray-50,:root[data-theme=dark] .media-light-surface .bg-green-50{background-color:#fafaf8!important}:root[data-theme=dark] .media-light-surface .text-gray-500{color:#6b6862!important}:root[data-theme=dark] .media-light-surface .text-gray-800{color:#33302c!important}:root[data-theme=dark] .media-light-surface .text-green-700{color:#0f704b!important}:root[data-theme=dark] .media-light-surface .text-amber-800{color:#7a5100!important}:root[data-theme=dark] .media-light-surface .text-blue-600{color:#245f9d!important}:root[data-theme=dark] .media-light-surface .text-red-600{color:#c92a2a!important}:root[data-theme=dark] .bg-white{background-color:var(--surface)}:root[data-theme=dark] [class~="bg-white/95"]{background-color:#191916f5}:root[data-theme=dark] [class~="bg-white/90"],:root[data-theme=dark] [class~="bg-white/80"]{background-color:#191916e6}:root[data-theme=dark] [class~="bg-[#fffdf5]"]{background-color:var(--app-bg)}:root[data-theme=dark] [class~="bg-[#fff9e8]"],:root[data-theme=dark] [class~="bg-[#fffdf0]"],:root[data-theme=dark] [class~="bg-[#f5edd6]"]{background-color:var(--surface-strong)}:root[data-theme=dark] [class~="hover:bg-[#fff9e8]"]:hover,:root[data-theme=dark] [class~="hover:bg-[#fffdf5]"]:hover,:root[data-theme=dark] [class~="hover:bg-[#fffdf0]"]:hover{background-color:var(--surface-hover)}:root[data-theme=dark] [class~="disabled:bg-white"]:disabled{background-color:var(--surface)}:root[data-theme=dark] [class~="border-[#f0e6c8]"],:root[data-theme=dark] [class~="border-[#e6d69a]"]{border-color:var(--border)}:root[data-theme=dark] [class~="text-[#111]"],:root[data-theme=dark] [class~="text-[#333]"],:root[data-theme=dark] [class~="text-[#555]"],:root[data-theme=dark] [class~="text-[#666]"]{color:var(--text)}:root[data-theme=dark] [class~="text-[#777]"],:root[data-theme=dark] [class~="text-[#888]"]{color:var(--text-muted)}:root[data-theme=dark] [class~="text-[#999]"],:root[data-theme=dark] [class~="text-[#aaa]"],:root[data-theme=dark] [class~="text-[#a89e83]"],:root[data-theme=dark] [class~="text-[#b8ac8e]"],:root[data-theme=dark] [class~="text-[#d0d0d0]"]{color:var(--text-soft)}:root[data-theme=dark] [class~="text-[#8c7900]"],:root[data-theme=dark] [class~="text-[#8a6300]"],:root[data-theme=dark] [class~="text-[#6b5200]"],:root[data-theme=dark] [class~="text-[#d6b600]"]{color:var(--brand-text)}:root[data-theme=dark] [class~="hover:text-black"]:hover,:root[data-theme=dark] [class~="hover:text-[#111]"]:hover{color:var(--text)}:root[data-theme=dark] button .rounded-full.bg-white{background-color:#f4f1e8}:root[data-theme=dark] .bg-red-50,:root[data-theme=dark] .bg-red-100{background-color:var(--danger-soft)}:root[data-theme=dark] .border-red-200{border-color:#744040}:root[data-theme=dark] .text-red-500,:root[data-theme=dark] .text-red-600,:root[data-theme=dark] .text-red-700,:root[data-theme=dark] .text-red-800,:root[data-theme=dark] .text-red-900{color:#faa}:root[data-theme=dark] .bg-green-50,:root[data-theme=dark] .bg-green-100,:root[data-theme=dark] .bg-emerald-50{background-color:var(--success-soft)}:root[data-theme=dark] .border-green-200,:root[data-theme=dark] .border-emerald-200{border-color:#356b50}:root[data-theme=dark] .text-green-600,:root[data-theme=dark] .text-green-700,:root[data-theme=dark] .text-green-800,:root[data-theme=dark] .text-emerald-600,:root[data-theme=dark] .text-emerald-700,:root[data-theme=dark] .text-emerald-800{color:#8fe0b5}:root[data-theme=dark] .bg-blue-50,:root[data-theme=dark] .bg-blue-100{background-color:var(--info-soft)}:root[data-theme=dark] .border-blue-200{border-color:#3c638c}:root[data-theme=dark] .text-blue-500,:root[data-theme=dark] .text-blue-600,:root[data-theme=dark] .text-blue-700,:root[data-theme=dark] .text-blue-800,:root[data-theme=dark] .text-blue-900{color:#9dccff}:root[data-theme=dark] .bg-yellow-50,:root[data-theme=dark] .bg-yellow-100,:root[data-theme=dark] .bg-amber-50,:root[data-theme=dark] .bg-amber-100,:root[data-theme=dark] .bg-amber-200{background-color:var(--warning-soft)}:root[data-theme=dark] .border-amber-200{border-color:#755f2d}:root[data-theme=dark] .text-yellow-600,:root[data-theme=dark] .text-yellow-700,:root[data-theme=dark] .text-yellow-800,:root[data-theme=dark] .text-amber-500,:root[data-theme=dark] .text-amber-600,:root[data-theme=dark] .text-amber-700,:root[data-theme=dark] .text-amber-800,:root[data-theme=dark] .text-amber-900{color:#f3d77c}:root[data-theme=dark] [class~="bg-[#fff8d1]"]{background-color:#393216}:root[data-theme=dark] [class~="bg-[#eef4ff]"]{background-color:#1c2d45}:root[data-theme=dark] [class~="bg-[#f0f7f3]"]{background-color:#193126}:root[data-theme=dark] [class~="bg-[#f7f2fb]"]{background-color:#2c2438}:root[data-theme=dark] [class~="text-[#3f5f8f]"]{color:#aacbff}:root[data-theme=dark] [class~="text-[#3f7a5c]"]{color:#9bd9b5}:root[data-theme=dark] [class~="text-[#6b5a8a]"]{color:#d1baf2}:root[data-theme=dark] [class~="hover:bg-red-50"]:hover,:root[data-theme=dark] [class~="hover:bg-red-100"]:hover{background-color:var(--danger-soft)}:root[data-theme=dark] [class~="hover:bg-green-50"]:hover,:root[data-theme=dark] [class~="hover:bg-green-100"]:hover,:root[data-theme=dark] [class~="hover:bg-emerald-50"]:hover{background-color:var(--success-soft)}:root[data-theme=dark] [class~="hover:bg-blue-50"]:hover,:root[data-theme=dark] [class~="hover:bg-blue-100"]:hover{background-color:var(--info-soft)}:root[data-theme=dark] [class~="hover:bg-yellow-50"]:hover,:root[data-theme=dark] [class~="hover:bg-yellow-100"]:hover,:root[data-theme=dark] [class~="hover:bg-amber-50"]:hover,:root[data-theme=dark] [class~="hover:bg-amber-100"]:hover{background-color:var(--warning-soft)}:root[data-theme=dark] [class~="hover:bg-black/5"]:hover{background-color:#ffffff14}:root[data-theme=dark] [class~="hover:text-red-600"]:hover,:root[data-theme=dark] [class~="hover:text-red-700"]:hover{color:#faa}:root[data-theme=dark] [class~="hover:text-green-600"]:hover,:root[data-theme=dark] [class~="hover:text-green-700"]:hover,:root[data-theme=dark] [class~="hover:text-emerald-600"]:hover{color:#8fe0b5}:root[data-theme=dark] [class~="hover:text-blue-600"]:hover,:root[data-theme=dark] [class~="hover:text-blue-700"]:hover{color:#9dccff}:root[data-theme=dark] [class~="hover:text-amber-600"]:hover,:root[data-theme=dark] [class~="hover:text-amber-700"]:hover{color:#f3d77c}:root[data-theme=dark] [class~="hover:bg-pink-50"]:hover,:root[data-theme=dark] [class~="hover:bg-pink-100"]:hover{background-color:var(--danger-soft)}:root[data-theme=dark] [class~="hover:text-pink-600"]:hover,:root[data-theme=dark] [class~="hover:text-pink-700"]:hover,:root[data-theme=dark] [class~="hover:text-yellow-600"]:hover{color:var(--warning-ink)}:root[data-theme=dark] [class~="hover:bg-amber-200"]:hover{background-color:var(--warning-soft)}:root[data-theme=dark] .theme-brand-panel [class~="text-[#8a6300]"]{color:#8a6300}:root[data-theme=dark] .theme-brand-panel [class~="text-[#6b5200]"]{color:#6b5200}:root[data-theme=dark] .page-tab:not(.page-tab--active) .page-tab__count{background:#ffffff14}.recharts-pie-label-text,.recharts-text{fill:var(--text-muted)}:root[data-theme=dark] .modal-overlay,:root[data-theme=dark] .modal-overlay-centered{background-color:#000000ad}.page-stack{display:flex;flex-direction:column;gap:20px}.page-header{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;min-height:62px;padding-bottom:16px;border-bottom:1px solid var(--border)}.page-header__identity{display:flex;min-width:0;align-items:flex-start;gap:12px}.page-header__icon{display:inline-flex;width:42px;height:42px;flex:0 0 42px;align-items:center;justify-content:center;border-radius:var(--radius-lg);background:linear-gradient(140deg,var(--brand-300),var(--brand));color:var(--brand-ink);box-shadow:var(--shadow-brand)}.page-title{color:var(--text);font-size:24px;font-weight:750;line-height:1.25}.page-description{margin-top:5px;max-width:760px;color:var(--text-muted);font-size:13px;line-height:1.6}.page-actions{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}.page-tabs{display:inline-flex;max-width:100%;gap:4px;overflow-x:auto;border-radius:var(--radius-pill);background:var(--surface-strong);padding:4px;scrollbar-width:none;-ms-overflow-style:none}.page-tabs::-webkit-scrollbar{display:none}.page-tab{display:inline-flex;min-height:38px;flex:0 0 auto;align-items:center;justify-content:center;gap:7px;border-radius:var(--radius-pill);padding:8px 16px;color:var(--text-muted);font-size:13px;font-weight:650;line-height:1.2;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease}.page-tab:hover{background:var(--surface);color:var(--text)}.page-tab--active{background:var(--brand);color:var(--brand-ink);box-shadow:var(--shadow-brand)}.page-tab--active:hover{background:var(--brand)}.page-tab__count{min-width:20px;border-radius:var(--radius-pill);background:#ffffff8c;padding:2px 7px;color:inherit;font-size:11px;font-weight:700;text-align:center}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);padding:14px;box-shadow:var(--shadow-sm)}.toolbar__group{display:flex;min-width:0;flex-wrap:wrap;align-items:center;gap:8px}.section-panel{overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-xl);background:var(--surface);box-shadow:var(--shadow-sm)}.section-panel__header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:58px;border-bottom:1px solid var(--border);padding:14px 18px}.section-header__icon{display:inline-flex;width:34px;height:34px;flex:0 0 34px;align-items:center;justify-content:center;border-radius:var(--radius);background:var(--surface-strong);color:var(--text-muted)}.section-header__actions{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}.section-title{color:var(--text);font-size:15px;font-weight:700}.section-description{margin-top:3px;color:var(--text-muted);font-size:12px;line-height:1.5}.notice-banner{display:flex;min-height:46px;align-items:center;gap:10px;border:1px solid var(--border);border-radius:var(--radius-lg);padding:11px 14px;font-size:13px;font-weight:600;line-height:1.5}.notice-banner button{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;border-radius:var(--radius-pill);padding:5px}.notice-banner--success{border-color:color-mix(in srgb,var(--success) 38%,var(--border));background:var(--success-soft);color:var(--success-ink)}.notice-banner--error{border-color:color-mix(in srgb,var(--danger) 38%,var(--border));background:var(--danger-soft);color:var(--danger-ink)}.notice-banner--warning{border-color:var(--border-strong);background:var(--warning-soft);color:var(--warning-ink)}.notice-banner--info{border-color:color-mix(in srgb,var(--info) 38%,var(--border));background:var(--info-soft);color:var(--info-ink)}.metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.metric-card{min-width:0;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);padding:18px;box-shadow:var(--shadow-sm);transition:box-shadow .16s ease,transform .16s ease}.metric-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px)}.metric-card__label{color:var(--text-muted);font-size:12px;font-weight:650}.metric-card__value{margin-top:7px;color:var(--text);font-size:24px;font-weight:750;line-height:1.2}.metric-card__meta{margin-top:6px;color:var(--text-soft);font-size:11px;line-height:1.5}.metric-grid--compact{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.metric-grid--compact .metric-card{padding:10px 12px;border-radius:var(--radius-md)}.metric-grid--compact .metric-card__label{font-size:11px}.metric-grid--compact .metric-card__value{margin-top:2px;font-size:20px}.metric-grid--compact .metric-card__meta{margin-top:1px;font-size:10px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}.field-label{display:block;margin-bottom:6px;color:var(--text-muted);font-size:12px;font-weight:700}.empty-state{display:flex;min-height:260px;flex-direction:column;align-items:center;justify-content:center;border:1px dashed var(--border-strong);border-radius:var(--radius-xl);background:var(--surface);padding:32px;text-align:center}.empty-state--compact{min-height:160px}.empty-state__icon{display:inline-flex;width:52px;height:52px;align-items:center;justify-content:center;border-radius:var(--radius-lg);background:var(--surface-strong);color:var(--text-soft)}.empty-state h3{margin-top:14px;color:var(--text);font-size:15px;font-weight:700}.empty-state p{margin-top:5px;max-width:520px;color:var(--text-muted);font-size:13px;line-height:1.6}.page-loading{display:flex;min-height:260px;align-items:center;justify-content:center;gap:9px;color:var(--text-muted);font-size:13px;font-weight:600}.ios-card{background:var(--surface);border-radius:var(--radius-lg);border:1px solid var(--border);box-shadow:var(--shadow-sm);transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease}.ios-card:hover{border-color:var(--border-brand);box-shadow:var(--shadow-md)}.ios-input{min-height:42px;background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius);color:var(--text);font-weight:500;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ios-input:hover:not(:disabled):not(:focus){border-color:var(--border-brand)}.ios-input:focus{background:var(--surface);border-color:var(--focus-ring);box-shadow:0 0 0 4px color-mix(in srgb,var(--focus-ring) 28%,transparent);outline:none}.ios-input::-moz-placeholder{color:var(--text-soft);font-weight:400}.ios-input::placeholder{color:var(--text-soft);font-weight:400}.ios-input:disabled,.ios-input[readonly]{border-color:var(--border);background:var(--surface-strong);color:var(--text-muted);cursor:not-allowed}.ios-btn-primary{min-height:42px;border-radius:var(--radius-pill);background:var(--brand);color:var(--brand-ink);font-weight:700;border:none;box-shadow:var(--shadow-brand);transition:background-color .15s ease,box-shadow .15s ease,transform .1s ease;cursor:pointer}.ios-btn-primary:hover:not(:disabled){background:var(--brand-hover);box-shadow:0 8px 22px #ffd60073}.ios-btn-primary:active:not(:disabled){background:var(--brand-active);transform:translateY(1px);box-shadow:var(--shadow-sm)}.ios-btn-primary:disabled{background:var(--surface-strong);color:var(--text-soft);box-shadow:none;cursor:not-allowed}.ios-btn-secondary{min-height:42px;border-radius:var(--radius-pill);background:var(--surface);color:var(--text);font-weight:600;border:1px solid var(--border-strong);transition:background-color .15s ease,border-color .15s ease;cursor:pointer}.ios-btn-secondary:hover:not(:disabled){background:var(--surface-hover);border-color:var(--brand)}.ios-btn-secondary:disabled{color:var(--text-soft);cursor:not-allowed}.ios-btn-danger{min-height:42px;border-radius:var(--radius-pill);background:var(--danger-soft);color:var(--danger);font-weight:600;border:1px solid color-mix(in srgb,var(--danger) 38%,var(--border));transition:background-color .15s ease,border-color .15s ease;cursor:pointer}.ios-btn-danger:hover:not(:disabled){background:color-mix(in srgb,var(--danger-soft) 82%,var(--danger));border-color:color-mix(in srgb,var(--danger) 62%,var(--border))}.data-table{width:100%;border-collapse:collapse;text-align:left}.data-table thead{background:var(--surface-subtle);color:var(--text-muted);font-size:11px;font-weight:700}.data-table th{height:46px;padding:0 16px;border-bottom:1px solid var(--border);letter-spacing:0}.data-table td{padding:13px 16px;border-bottom:1px solid var(--border);vertical-align:middle}.data-table tbody tr:last-child td{border-bottom:0}.data-table tbody tr:hover{background:var(--surface-hover)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:var(--radius-pill)}::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-thumb-hover)}aside nav::-webkit-scrollbar{width:4px}aside nav::-webkit-scrollbar-thumb{background:transparent}aside nav:hover::-webkit-scrollbar-thumb{background:var(--border-strong)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fadeIn .18s ease-out forwards}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}::-moz-selection{background:var(--brand);color:#000}::selection{background:var(--brand);color:#000}.chat-self-bubble ::-moz-selection{background:var(--selection-bg);color:var(--selection-ink)}.chat-self-bubble ::selection{background:var(--selection-bg);color:var(--selection-ink)}.text-brand{color:#8c7900}.bg-brand{background-color:var(--brand)}.border-brand{border-color:var(--brand)}.status-badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:var(--radius-pill);font-size:12px;font-weight:650}.status-badge-success{background-color:var(--success-soft);color:var(--success-ink)}.status-badge-warning{background-color:var(--brand-100);color:var(--warning-ink)}.status-badge-error{background-color:var(--danger-soft);color:var(--danger-ink)}.status-badge-info{background-color:var(--surface-strong);color:var(--text-muted)}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;align-items:center;justify-content:center;background-color:#0006;padding:1rem;overflow-y:auto}.modal-container{position:relative;width:100%;max-width:42rem;max-height:85vh;margin:auto;display:flex;flex-direction:column;background-color:var(--surface);color:var(--text);border-radius:var(--radius-xl);border:1px solid var(--border);box-shadow:var(--shadow-lg);overflow:hidden}.modal-header{flex-shrink:0;padding:20px 22px;border-bottom:1px solid var(--border);background:var(--surface-subtle);z-index:10}.modal-body{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;padding:22px;color:var(--text)}.modal-footer{flex-shrink:0;padding:16px 22px;border-top:1px solid var(--border);background:var(--surface-subtle);z-index:10}.modal-container-lg{max-width:64rem}.modal-overlay-centered{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;justify-content:center;background-color:#0006;padding:1rem;overflow-y:auto}@media(max-width:1023px){.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-grid--compact{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:639px){.page-stack{gap:16px}.page-header{min-height:0;align-items:flex-start;padding-bottom:14px}.page-header__icon{width:34px;height:34px;flex-basis:34px}.page-title{font-size:20px}.page-actions{width:100%;justify-content:stretch}.page-actions>*{flex:1 1 auto}.toolbar{align-items:stretch}.toolbar,.toolbar__group{flex-direction:column}.toolbar__group>input,.toolbar__group>select,.toolbar__group>button{width:100%}.section-panel__header{flex-direction:column;align-items:flex-start}.section-header__actions{width:100%;justify-content:stretch}.section-header__actions>*{flex:1 1 auto;justify-content:center}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric-grid--compact{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-card{padding:12px 14px}.metric-card__label{font-size:11px}.metric-card__value,.metric-grid--compact .metric-card__value{font-size:18px}}.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:var(--surface);color:var(--text);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow-md);overflow:hidden}@media(max-width:768px){.page-stack{gap:16px}.page-header{min-height:0;flex-direction:column;align-items:stretch;gap:12px;padding-bottom:14px}.page-title{font-size:21px}.page-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));justify-content:stretch}.page-actions>*{min-width:0}.toolbar{flex-direction:column;align-items:stretch}.toolbar__group{display:grid;grid-template-columns:1fr}.page-tabs{display:grid;width:100%;grid-auto-flow:column;grid-auto-columns:minmax(128px,1fr)}.page-tab{min-width:0;white-space:normal}.responsive-data-table{min-width:0!important}.responsive-data-table,.responsive-data-table tbody,.responsive-data-table tr,.responsive-data-table td{display:block;width:100%}.responsive-data-table thead{display:none}.responsive-data-table tbody tr{border-bottom:1px solid var(--border);padding:12px 16px}.responsive-data-table tbody tr:last-child{border-bottom:0}.responsive-data-table td{display:grid;grid-template-columns:minmax(82px,30%) minmax(0,1fr);align-items:center;gap:12px;border:0;padding:7px 0;text-align:left}.responsive-data-table td:before{content:attr(data-label);color:var(--text-muted);font-size:11px;font-weight:700}.responsive-data-table td>*{min-width:0}.responsive-data-table td[data-label=订单信息],.responsive-data-table td[data-label=卡密名称]{align-items:start}.responsive-data-table td[data-label=操作]>div{flex-wrap:wrap;justify-content:flex-start}.responsive-data-table td>.status-badge{justify-self:start}.ios-card{border-radius:var(--radius)}.ios-input{font-size:16px}.modal-container{max-width:calc(100% - 2rem);max-height:90vh;border-radius:var(--radius)}.modal-header,.modal-body,.modal-footer{padding-left:1.5rem;padding-right:1.5rem}}.marquee{overflow:hidden}.marquee__track{display:inline-flex;align-items:center;white-space:nowrap;will-change:transform;animation:marquee-scroll 40s linear infinite}.marquee:hover .marquee__track{animation-play-state:paused}@keyframes marquee-scroll{0%{transform:translate(0)}to{transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.marquee__track{animation:none}.marquee{overflow-x:auto}}.placeholder\:text-\[var\(--text-soft\)\]::-moz-placeholder{color:var(--text-soft)}.placeholder\:text-\[var\(--text-soft\)\]::placeholder{color:var(--text-soft)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-1\.5:after{content:var(--tw-content);top:-.375rem;right:-.375rem;bottom:-.375rem;left:-.375rem}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.last\:mb-0:last-child{margin-bottom:0}.last\:border-0:last-child{border-width:0px}.last\:border-b-0:last-child{border-bottom-width:0px}.even\:bg-\[var\(--surface-subtle\)\]:nth-child(2n){background-color:var(--surface-subtle)}.hover\:border-\[\#ff4400\]:hover{--tw-border-opacity: 1;border-color:rgb(255 68 0 / var(--tw-border-opacity, 1))}.hover\:border-\[var\(--border-strong\)\]:hover{border-color:var(--border-strong)}.hover\:border-amber-400:hover{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(var(--gray-400) / var(--tw-border-opacity, 1))}.hover\:border-purple-400:hover{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#ff4400\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 68 0 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#ffd700\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 215 0 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#fffdf0\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 253 240 / var(--tw-bg-opacity, 1))}.hover\:bg-\[var\(--brand-hover\)\]:hover{background-color:var(--brand-hover)}.hover\:bg-\[var\(--danger-soft\)\]:hover{background-color:var(--danger-soft)}.hover\:bg-\[var\(--surface-hover\)\]:hover{background-color:var(--surface-hover)}.hover\:bg-\[var\(--surface-strong\)\]:hover{background-color:var(--surface-strong)}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-200:hover{--tw-bg-opacity: 1;background-color:rgb(253 230 138 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-50:hover{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.hover\:bg-black\/5:hover{background-color:#0000000d}.hover\:bg-black\/80:hover{background-color:#000c}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-50:hover{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.hover\:bg-brand-600:hover{--tw-bg-opacity: 1;background-color:rgb(245 200 0 / var(--tw-bg-opacity, 1))}.hover\:bg-cyan-100:hover{--tw-bg-opacity: 1;background-color:rgb(207 250 254 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-100:hover{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(var(--gray-100) / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(var(--gray-200) / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(var(--gray-50) / var(--tw-bg-opacity, 1))}.hover\:bg-green-100:hover{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.hover\:bg-green-50:hover{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.hover\:bg-pink-50:hover{--tw-bg-opacity: 1;background-color:rgb(253 242 248 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-rose-50:hover{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-violet-100:hover{--tw-bg-opacity: 1;background-color:rgb(237 233 254 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/40:hover{background-color:#fff6}.hover\:bg-yellow-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.hover\:text-\[\#ff4400\]:hover{--tw-text-opacity: 1;color:rgb(255 68 0 / var(--tw-text-opacity, 1))}.hover\:text-\[var\(--danger\)\]:hover{color:var(--danger)}.hover\:text-\[var\(--text\)\]:hover{color:var(--text)}.hover\:text-amber-600:hover{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.hover\:text-amber-700:hover{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(var(--gray-600) / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(var(--gray-700) / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(var(--gray-800) / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(var(--gray-900) / var(--tw-text-opacity, 1))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-pink-600:hover{--tw-text-opacity: 1;color:rgb(219 39 119 / var(--tw-text-opacity, 1))}.hover\:text-purple-500:hover{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:text-yellow-600:hover{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-\[\#ffe100\]:focus{--tw-border-opacity: 1;border-color:rgb(255 225 0 / var(--tw-border-opacity, 1))}.focus\:border-\[var\(--brand\)\]:focus{border-color:var(--brand)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-\[var\(--brand\)\]:focus{--tw-ring-color: var(--brand)}.focus-visible\:outline-2:focus-visible{outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-\[var\(--focus-ring\)\]:focus-visible{outline-color:var(--focus-ring)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:bg-\[var\(--surface\)\]:disabled{background-color:var(--surface)}.disabled\:bg-\[var\(--surface-strong\)\]:disabled{background-color:var(--surface-strong)}.disabled\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(var(--gray-100) / var(--tw-bg-opacity, 1))}.disabled\:text-\[var\(--text-soft\)\]:disabled{color:var(--text-soft)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.disabled\:opacity-70:disabled{opacity:.7}.group:focus-within .group-focus-within\:text-\[\#ffe100\]{--tw-text-opacity: 1;color:rgb(255 225 0 / var(--tw-text-opacity, 1))}.group:focus-within .group-focus-within\:text-gray-700{--tw-text-opacity: 1;color:rgb(var(--gray-700) / var(--tw-text-opacity, 1))}.group:hover .group-hover\:flex{display:flex}.group:hover .group-hover\:text-\[\#ff4400\]{--tw-text-opacity: 1;color:rgb(255 68 0 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-\[var\(--text-muted\)\]{color:var(--text-muted)}.group:hover .group-hover\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media(prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}.dark\:border-amber-500\/20:is(.dark *){border-color:#f59e0b33}.dark\:border-slate-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f59e0b1a}.dark\:bg-slate-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.dark\:from-amber-950\/20:is(.dark *){--tw-gradient-from: rgb(69 26 3 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(69 26 3 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:to-\[var\(--surface\)\]:is(.dark *){--tw-gradient-to: var(--surface) var(--tw-gradient-to-position)}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(var(--gray-600) / var(--tw-text-opacity, 1))}.dark\:text-slate-100:is(.dark *){--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.dark\:text-slate-300:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark\:text-slate-400:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-slate-700\/60:hover:is(.dark *){background-color:#33415599}@media(min-width:640px){.sm\:right-6{right:1.5rem}.sm\:top-6{top:1.5rem}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:col-span-3{grid-column:span 3 / span 3}.sm\:inline-flex{display:inline-flex}.sm\:h-16{height:4rem}.sm\:min-h-\[72px\]{min-height:72px}.sm\:min-h-\[92px\]{min-height:92px}.sm\:min-h-\[calc\(100vh-3rem\)\]{min-height:calc(100vh - 3rem)}.sm\:w-16{width:4rem}.sm\:w-64{width:16rem}.sm\:w-72{width:18rem}.sm\:w-auto{width:auto}.sm\:min-w-40{min-width:10rem}.sm\:min-w-44{min-width:11rem}.sm\:min-w-52{min-width:13rem}.sm\:min-w-56{min-width:14rem}.sm\:min-w-64{min-width:16rem}.sm\:min-w-72{min-width:18rem}.sm\:max-w-xs{max-width:20rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[100px_1fr\]{grid-template-columns:100px 1fr}.sm\:grid-cols-\[140px_200px_1fr_auto\]{grid-template-columns:140px 200px 1fr auto}.sm\:grid-cols-\[160px_minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:160px minmax(0,1fr) auto auto}.sm\:grid-cols-\[24px_52px_180px_minmax\(0\,1fr\)_44px\]{grid-template-columns:24px 52px 180px minmax(0,1fr) 44px}.sm\:grid-cols-\[minmax\(160px\,0\.7fr\)_minmax\(0\,1\.5fr\)_auto\]{grid-template-columns:minmax(160px,.7fr) minmax(0,1.5fr) auto}.sm\:grid-cols-\[minmax\(180px\,0\.7fr\)_minmax\(0\,1\.4fr\)_auto\]{grid-template-columns:minmax(180px,.7fr) minmax(0,1.4fr) auto}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:border-0{border-width:0px}.sm\:p-10{padding:2.5rem}.sm\:p-5{padding:1.25rem}.sm\:p-6{padding:1.5rem}.sm\:p-8{padding:2rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:px-8{padding-left:2rem;padding-right:2rem}.sm\:pt-0{padding-top:0}.sm\:text-right{text-align:right}}@media(min-width:768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:min-h-\[360px\]{min-height:360px}.md\:w-44{width:11rem}.md\:w-72{width:18rem}.md\:w-auto{width:auto}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-\[minmax\(0\,1fr\)_150px_minmax\(0\,1\.4fr\)\]{grid-template-columns:minmax(0,1fr) 150px minmax(0,1.4fr)}.md\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto}.md\:flex-row{flex-direction:row}.md\:items-end{align-items:flex-end}.md\:items-center{align-items:center}}@media(min-width:1024px){.lg\:sticky{position:sticky}.lg\:top-2{top:.5rem}.lg\:top-auto{top:auto}.lg\:z-auto{z-index:auto}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mb-3{margin-bottom:.75rem}.lg\:ml-\[248px\]{margin-left:248px}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:h-screen{height:100vh}.lg\:w-56{width:14rem}.lg\:w-full{width:100%}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:scroll-mt-4{scroll-margin-top:1rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1\.05fr_0\.95fr\]{grid-template-columns:1.05fr .95fr}.lg\:grid-cols-\[165px_80px_180px_minmax\(0\,1fr\)\]{grid-template-columns:165px 80px 180px minmax(0,1fr)}.lg\:grid-cols-\[180px_120px_minmax\(0\,1fr\)_44px\]{grid-template-columns:180px 120px minmax(0,1fr) 44px}.lg\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.lg\:grid-cols-\[220px_180px_minmax\(240px\,1fr\)_auto\]{grid-template-columns:220px 180px minmax(240px,1fr) auto}.lg\:grid-cols-\[356px_minmax\(0\,1fr\)\]{grid-template-columns:356px minmax(0,1fr)}.lg\:grid-cols-\[minmax\(180px\,0\.7fr\)_minmax\(0\,1\.4fr\)_auto\]{grid-template-columns:minmax(180px,.7fr) minmax(0,1.4fr) auto}.lg\:grid-cols-\[minmax\(220px\,1\.2fr\)_minmax\(260px\,1\.5fr\)_180px_auto\]{grid-template-columns:minmax(220px,1.2fr) minmax(260px,1.5fr) 180px auto}.lg\:grid-cols-\[minmax\(220px\,1fr\)_1fr_180px_auto\]{grid-template-columns:minmax(220px,1fr) 1fr 180px auto}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:items-center{align-items:center}.lg\:gap-0{gap:0px}.lg\:overflow-visible{overflow:visible}.lg\:border-b-0{border-bottom-width:0px}.lg\:border-r{border-right-width:1px}.lg\:p-8{padding:2rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media(min-width:1280px){.xl\:grid{display:grid}.xl\:min-w-\[1200px\]{min-width:1200px}.xl\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.xl\:grid-cols-\[340px_140px_260px_210px_110px\]{grid-template-columns:340px 140px 260px 210px 110px}.xl\:grid-cols-\[minmax\(0\,1\.35fr\)_minmax\(340px\,0\.65fr\)\]{grid-template-columns:minmax(0,1.35fr) minmax(340px,.65fr)}.xl\:grid-cols-\[minmax\(230px\,1fr\)_minmax\(360px\,1\.5fr\)_44px\]{grid-template-columns:minmax(230px,1fr) minmax(360px,1.5fr) 44px}.xl\:\!flex-row{flex-direction:row!important}.xl\:items-start{align-items:flex-start}.xl\:items-center{align-items:center}.xl\:items-stretch{align-items:stretch}.xl\:justify-end{justify-content:flex-end}.xl\:gap-0{gap:0px}.xl\:gap-1\.5{gap:.375rem}.xl\:border-0{border-width:0px}.xl\:px-0{padding-left:0;padding-right:0}.xl\:px-2{padding-left:.5rem;padding-right:.5rem}.xl\:pt-0{padding-top:0}.xl\:\[\&\>\*\:first-child\]\:\!flex-row>*:first-child{flex-direction:row!important}.xl\:\[\&\>\*\:first-child\]\:items-center>*:first-child{align-items:center}.xl\:\[\&\>\*\:last-child\]\:border-r-0>*:last-child{border-right-width:0px}.xl\:\[\&\>\*\]\:flex>*{display:flex}.xl\:\[\&\>\*\]\:min-w-0>*{min-width:0px}.xl\:\[\&\>\*\]\:flex-col>*{flex-direction:column}.xl\:\[\&\>\*\]\:justify-center>*{justify-content:center}.xl\:\[\&\>\*\]\:border-r>*{border-right-width:1px}.xl\:\[\&\>\*\]\:border-gray-200>*{--tw-border-opacity: 1;border-color:rgb(var(--gray-200) / var(--tw-border-opacity, 1))}.xl\:\[\&\>\*\]\:px-4>*{padding-left:1rem;padding-right:1rem}.xl\:\[\&\>div\:last-child\]\:border-b-0>div:last-child{border-bottom-width:0px}.xl\:\[\&\>div\]\:border-b>div{border-bottom-width:1px}.xl\:\[\&\>div\]\:border-dashed>div{border-style:dashed}.xl\:\[\&\>div\]\:border-gray-200>div{--tw-border-opacity: 1;border-color:rgb(var(--gray-200) / var(--tw-border-opacity, 1))}.xl\:\[\&\>div\]\:py-1\.5>div{padding-top:.375rem;padding-bottom:.375rem}}.\[\&\>span\:last-child\]\:border-r-0>span:last-child{border-right-width:0px}.\[\&\>span\:nth-child\(2\)\]\:px-2>span:nth-child(2){padding-left:.5rem;padding-right:.5rem}.\[\&\>span\]\:border-r>span{border-right-width:1px}.\[\&\>span\]\:border-gray-300>span{--tw-border-opacity: 1;border-color:rgb(var(--gray-300) / var(--tw-border-opacity, 1))}.\[\&\>span\]\:px-4>span{padding-left:1rem;padding-right:1rem}.\[\&\>span\]\:py-3>span{padding-top:.75rem;padding-bottom:.75rem} diff --git a/static/assets/index-IChzZLcq.js b/static/assets/index-C6Y7HdB3.js similarity index 99% rename from static/assets/index-IChzZLcq.js rename to static/assets/index-C6Y7HdB3.js index 561d006..6ca4cd7 100644 --- a/static/assets/index-IChzZLcq.js +++ b/static/assets/index-C6Y7HdB3.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-R20Ph_el.js","assets/ui-DHCIdv_V.js","assets/package-3qqwOYvH.js","assets/trending-up-BDgJo2q2.js","assets/activity-CRI26G7w.js","assets/package-check-FQzJ-066.js","assets/AccountList-CC8hRCM2.js","assets/check-6Gro50Mh.js","assets/sparkles-B5X13VUJ.js","assets/power-ZOn3B5wN.js","assets/trash-2-CnOVC8WZ.js","assets/key-BRO3zsxh.js","assets/eye-off-DA35-r8G.js","assets/eye-BNO0yecz.js","assets/save-m64KWfbE.js","assets/OrderList-DnNov42V.js","assets/plus-hTzuza9d.js","assets/truck-eLsCuQDz.js","assets/search-D1CHR5V5.js","assets/flower-2-DPAmZVRG.js","assets/square-pen-BOlWgFhh.js","assets/chevron-right-DwOZeQi3.js","assets/CardList-DaeMtjqS.js","assets/image-BCD-eej2.js","assets/ItemList-DpqEi6Ob.js","assets/shield-alert-ob02IPrt.js","assets/power-off-D8Ea3WwY.js","assets/settings-2-B-NwJM90.js","assets/ProductAutomation-ByBZohdg.js","assets/play-52JRVRYm.js","assets/link-2-CYVpjq_H.js","assets/AIReply-C49hHlXg.js","assets/message-square-text-C6Er6xWp.js","assets/Settings-BKqYYBIp.js","assets/zap-CQAFaWUI.js","assets/Keywords-DYO7Z25o.js","assets/MessageManagement-BX9e9TqW.js","assets/send-Db002WMI.js","assets/NotificationsAndLogs-DvXsPImX.js","assets/pen-line-27OudxQx.js","assets/UserManagement-WEnM8-3J.js","assets/About-DCjjMMTu.js","assets/BuyerInteraction-BJEwndHV.js","assets/Resell-C3EooCYv.js","assets/HotList-BwqIdE0Z.js","assets/PeerShops-CypJHQVt.js","assets/PriceWatch-Db4Gwt9m.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-r6bLPRiz.js","assets/ui-Dh615-z8.js","assets/package-DjIVaNpE.js","assets/trending-up-BR0vQ8dC.js","assets/activity-CV-Hy1l6.js","assets/package-check-C8PHQCAA.js","assets/AccountList-jdp7_cFb.js","assets/check--qTdUCr3.js","assets/sparkles-CczcRRJP.js","assets/power-WuQyd1QF.js","assets/trash-2-BG9PyYJR.js","assets/key-CnYS625y.js","assets/eye-off-DqZjZWJp.js","assets/eye-BXgO1egk.js","assets/save-C5DQBwo1.js","assets/OrderList-CMlmoGwo.js","assets/plus-BZHhM3Ok.js","assets/truck-Cz_KAtqT.js","assets/search-DbZW8Se5.js","assets/flower-2-CSgAnLCK.js","assets/square-pen-ptW8MQaM.js","assets/chevron-right-zTm23uAy.js","assets/CardList-BeNoktSc.js","assets/image-DkNS6I4I.js","assets/ItemList-Du75o4x-.js","assets/shield-alert-BSaySGHY.js","assets/power-off-CcqbyexD.js","assets/settings-2-DYoajNQY.js","assets/ProductAutomation-BTRBUe6v.js","assets/play-B67lJrJT.js","assets/link-2-CUR4V6rB.js","assets/AIReply-Dsfaod73.js","assets/message-square-text-DbxdYCPP.js","assets/Settings-CgkuCQg8.js","assets/zap-BAb90aFH.js","assets/Keywords-BPlwSBj7.js","assets/MessageManagement-CJJfjP2Z.js","assets/send-CTCS9sD8.js","assets/NotificationsAndLogs-DX1qmLDY.js","assets/pen-line-B2U8YMna.js","assets/UserManagement-93cH0Rs5.js","assets/About-DH_fUK9S.js","assets/BuyerInteraction-0rmlMue9.js","assets/Resell-eqQKBhXl.js","assets/HotList-DMnVJNpG.js","assets/PeerShops-Iz71xL1V.js","assets/PriceWatch-B4ja8BGi.js"])))=>i.map(i=>d[i]); function xp(l,s){for(var c=0;cr[f]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const y of m.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&r(y)}).observe(document,{childList:!0,subtree:!0});function c(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function r(f){if(f.ep)return;f.ep=!0;const m=c(f);fetch(f.href,m)}})();function hh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Ic={exports:{}},lu={};/** * @license React * react-jsx-runtime.production.js @@ -280,4 +280,4 @@ Error generating stack: `+n.message+` `);return y===-1?"":f.stack.slice(y+1)})();try{if(!r.stack)r.stack=m;else if(m){const y=m.indexOf(` `),p=y===-1?-1:m.indexOf(` `,y+1),v=p===-1?"":m.slice(p+1);String(r.stack).endsWith(v)||(r.stack+=` -`+m)}}catch{}}throw r}}_request(s,c){typeof s=="string"?(c=c||{},c.url=s):c=s||{},c=bn(this.defaults,c);const{transitional:r,paramsSerializer:f,headers:m}=c;r!==void 0&&Ci.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean),advertiseZstdAcceptEncoding:ot.transitional(ot.boolean),validateStatusUndefinedResolves:ot.transitional(ot.boolean)},!1),f!=null&&(x.isFunction(f)?c.paramsSerializer={serialize:f}:Ci.assertOptions(f,{encode:ot.function,serialize:ot.function},!0)),c.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?c.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:c.allowAbsoluteUrls=!0),Ci.assertOptions(c,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),c.method=(c.method||this.defaults.method||"get").toLowerCase();let y=m&&x.merge(m.common,m[c.method]);m&&x.forEach(["delete","get","head","post","put","patch","query","common"],W=>{delete m[W]}),c.headers=ft.concat(y,m);const p=[];let v=!0;this.interceptors.request.forEach(function(X){if(typeof X.runWhen=="function"&&X.runWhen(c)===!1)return;v=v&&X.synchronous;const Y=c.transitional||Er;Y&&Y.legacyInterceptorReqResOrdering?p.unshift(X.fulfilled,X.rejected):p.push(X.fulfilled,X.rejected)});const g=[];this.interceptors.response.forEach(function(X){g.push(X.fulfilled,X.rejected)});let A,N=0,B;if(!v){const W=[rr.bind(this),void 0];for(W.unshift(...p),W.push(...g),B=W.length,A=Promise.resolve(c);Nrr.call(this,F)))}catch(C){A=Promise.reject(C)}break}}if(!A)try{A=rr.call(this,F)}catch(W){A=Promise.reject(W)}for(N=0,B=g.length;N{if(!r._listeners)return;let m=r._listeners.length;for(;m-- >0;)r._listeners[m](f);r._listeners=null}),this.promise.then=f=>{let m;const y=new Promise(p=>{r.subscribe(p),m=p}).then(f);return y.cancel=function(){r.unsubscribe(m)},y},s(function(m,y,p){r.reason||(r.reason=new du(m,y,p),c(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const c=this._listeners.indexOf(s);c!==-1&&this._listeners.splice(c,1)}toAbortSignal(){const s=new AbortController,c=r=>{s.abort(r)};return this.subscribe(c),s.signal.unsubscribe=()=>this.unsubscribe(c),s.signal}static source(){let s;return{token:new $h(function(f){s=f}),cancel:s}}};function gv(l){return function(c){return l.apply(null,c)}}function bv(l){return x.isObject(l)&&l.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pr).forEach(([l,s])=>{pr[s]=l});function Fh(l){const s=new yn(l),c=Th(yn.prototype.request,s);return x.extend(c,yn.prototype,s,{allOwnKeys:!0}),x.extend(c,s,null,{allOwnKeys:!0}),c.create=function(f){return Fh(bn(l,f))},c}const Qe=Fh(fu);Qe.Axios=yn;Qe.CanceledError=du;Qe.CancelToken=pv;Qe.isCancel=Vh;Qe.VERSION=Tr;Qe.toFormData=Hi;Qe.AxiosError=V;Qe.Cancel=Qe.CanceledError;Qe.all=function(s){return Promise.all(s)};Qe.spread=gv;Qe.isAxiosError=bv;Qe.mergeConfig=bn;Qe.AxiosHeaders=ft;Qe.formToJSON=l=>Yh(x.isHTMLForm(l)?new FormData(l):l);Qe.getAdapter=Jh.getAdapter;Qe.HttpStatusCode=pr;Qe.default=Qe;const{Axios:y2,AxiosError:p2,CanceledError:g2,isCancel:b2,CancelToken:v2,VERSION:S2,all:_2,Cancel:x2,isAxiosError:E2,spread:A2,toFormData:T2,AxiosHeaders:O2,HttpStatusCode:N2,formToJSON:R2,getAdapter:w2,mergeConfig:z2,create:j2}=Qe,Qa=Qe.create({baseURL:"",timeout:3e4,headers:{"Content-Type":"application/json"}});Qa.interceptors.request.use(l=>{const s=localStorage.getItem("auth_token");return s&&(l.headers.Authorization=`Bearer ${s}`),typeof FormData<"u"&&l.data instanceof FormData&&delete l.headers["Content-Type"],l},l=>Promise.reject(l));Qa.interceptors.response.use(l=>l,l=>{var s;if(((s=l.response)==null?void 0:s.status)===401){localStorage.removeItem("auth_token");try{window.dispatchEvent(new Event("auth:logout"))}catch{}}return Promise.reject(l)});const ee=async(l,s,c)=>(await Qa.get(l,{params:s,...c})).data,ne=async(l,s,c)=>(await Qa.post(l,s,c)).data,De=async(l,s,c)=>(await Qa.put(l,s,c)).data,vv=async(l,s,c)=>(await Qa.patch(l,s,c)).data,tt=async(l,s)=>(await Qa.delete(l,s)).data,Sv=async l=>ne("/login",l),_v=async()=>ee("/system-settings/public"),xv=async(l,s)=>De("/profile",{new_username:l,current_password:s}),Ev=async l=>ne("/register",l),Av=async(l,s="register",c)=>ne("/send-verification-code",{email:l,type:s,captcha_session_id:c==null?void 0:c.session_id,captcha_code:c==null?void 0:c.code}),Tv=async l=>ne("/generate-captcha",{session_id:l}),Ov=async()=>ee("/verify"),Nv=async(l,s)=>ne("/change-password",{current_password:l,new_password:s}),D2=async()=>(await ee("/cookies/details")).map(s=>({id:s.id,value:s.value,cookie:s.value,enabled:s.enabled,auto_confirm:s.auto_confirm,remark:s.remark,note:s.remark,pause_duration:s.pause_duration,username:s.username,login_password:s.login_password,show_browser:s.show_browser,nickname:s.nickname||s.remark||s.username||`账号 ${s.id.substring(0,6)}`,avatar_url:s.avatar_url,location:s.location,bio:s.bio,followers:s.followers,following:s.following,profile_updated_at:s.profile_updated_at,runtime_state:s.runtime_state,login_info:s.login_info,ai_enabled:!1})),C2=async l=>ne(`/cookies/${l}/refresh-profile`),M2=async()=>ne("/qr-login/generate"),U2=async l=>ee(`/qr-login/check/${l}`),q2=async(l,s)=>De(`/cookies/${l}/status`,{enabled:s}),B2=async l=>tt(`/cookies/${l}`),H2=async(l,s)=>De(`/cookies/${l}/remark`,{remark:s}),L2=async(l,s)=>De(`/cookies/${l}/auto-confirm`,{auto_confirm:s}),k2=async(l,s)=>De(`/cookies/${l}/pause-duration`,{pause_duration:s}),Y2=async(l,s)=>De(`/cookies/${l}`,{id:l,value:s}),V2=async(l,s)=>De(`/cookies/${l}/login-info`,s),X2=async()=>ee("/ai-reply-settings"),Rv=l=>{const s=(l==null?void 0:l.order_status)||(l==null?void 0:l.status)||"processing";return{...l,status:s,order_status:s}},G2=async(l,s,c=1,r=20)=>{const f={page:c,page_size:r};l&&(f.cookie_id=l),s&&s!=="all"&&(f.status=s);const m=await ee("/api/orders",f),y=(m.orders||m.data||[]).map(Rv);return{success:!0,data:y,total:m.total||y.length,page:m.page||c,page_size:m.page_size||r,total_pages:m.total_pages||1,status_counts:m.status_counts}},Q2=async(l,s)=>De(`/api/orders/${l}`,s),Z2=async(l,s)=>De(`/api/orders/${l}/note`,{note:s}),K2=async l=>tt(`/api/orders/${l}`),J2=async(l,s)=>{const c=new FormData,r=localStorage.getItem("auth_token");return(await fetch("/api/orders/refresh",{method:"POST",headers:{Authorization:`Bearer ${r}`},body:c})).json()},$2=async l=>ne(`/api/orders/${l}/refresh`),F2=async(l,s,c)=>ne("/api/orders/manual-ship",{order_ids:l,ship_mode:s,custom_content:c}),W2=async l=>{const s=l instanceof FormData;return(await fetch("/api/orders/import",{method:"POST",headers:{...s?{}:{"Content-Type":"application/json"},Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:s?l:JSON.stringify(l)})).json()},wv=l=>{if(!l)return"";const s=l.match(/filename\*=UTF-8''([^;\s]+)/i);if(s)try{return decodeURIComponent(s[1])}catch{return s[1]}const c=l.match(/filename\s*=\s*"?([^";]+)"?/i);return c?c[1].trim():""},I2=async l=>{var v;const s={};l.cookie_id&&(s.cookie_id=l.cookie_id),l.status&&l.status!=="all"&&(s.status=l.status);const c=await Qa.get("/api/orders/export",{params:s,responseType:"blob"}),r=c.data;if(!(r instanceof Blob)||r.size===0)throw new Error("导出失败:服务器未返回有效文件");if(r.type.includes("application/json")){let g="导出失败";try{const A=JSON.parse(await r.text());g=(A==null?void 0:A.message)||g}catch{}throw new Error(g)}const f=wv((v=c.headers)==null?void 0:v["content-disposition"]),m=/\.csv$/i.test(f)?f:`orders_${Date.now()}.csv`,y=URL.createObjectURL(r),p=document.createElement("a");return p.href=y,p.download=m,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(y),m},P2=async(l,s=7)=>{const c=new FormData;return c.append("days",String(s)),(await fetch("/api/orders/sync-sold",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:c})).json()},eS=async(l=!1)=>(await ee("/quick-phrases",{include_disabled:l})).data||[],tS=async(l,s,c="默认",r=0)=>{const f=new FormData;return f.append("title",l),f.append("content",s),f.append("category",c),f.append("sort_order",String(r)),(await fetch("/quick-phrases",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:f})).json()},aS=async(l,s)=>{const c=new FormData;return Object.entries(s).forEach(([f,m])=>{m!=null&&c.append(f,String(m))}),(await fetch(`/quick-phrases/${l}`,{method:"PUT",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:c})).json()},nS=async l=>tt(`/quick-phrases/${l}`),lS=async l=>ne(`/quick-phrases/${l}/use`),uS=async()=>ee("/api/risk-control/status"),iS=async l=>ne(`/api/risk-control/${encodeURIComponent(l)}/fresh-captcha-url`),sS=async(l,s=300)=>{const c=new FormData;return c.append("cookie_id",l),c.append("timeout",String(s)),ne("/api/captcha/manual-session",c,{timeout:(s+30)*1e3})},cS=async(l,s)=>{const c=new FormData;return l&&c.append("cookie_id",l),(await fetch("/api/items/polish",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:c})).json()},rS=async l=>ne(`/api/orders/${l}/require-flower`),oS=async()=>ee("/api/seller-features"),fS=async(l,s)=>De(`/api/seller-features/${l}`,s),dS=async(l,s,c=1,r=!1)=>{const f=new FormData;return f.append("order_ids",l.join(",")),f.append("feedback",s),f.append("rate",String(c)),f.append("anonymous",String(r)),(await fetch("/api/orders/rate",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:f})).json()},mS=async()=>ee("/admin/stats"),hS=async()=>(await ee("/admin/users")).users||[],yS=async(l,s)=>vv(`/admin/users/${l}/status`,{is_active:s}),pS=async(l,s)=>De(`/admin/users/${l}/password`,{new_password:s}),gS=async l=>tt(`/admin/users/${l}`),bS=async(l=7)=>{let s;if(typeof l=="number"){const c=new Date,r=new Date;r.setDate(r.getDate()-l),s={start_date:r.toISOString().split("T")[0],end_date:c.toISOString().split("T")[0]}}else s=l;return ee("/analytics/orders",s)},vS=async l=>(await ee("/analytics/orders/valid",{start_date:l.start_date,end_date:l.end_date})).orders||[],SS=async()=>{const l=await ee("/cards");return Array.isArray(l)?l:l.cards||[]},_S=async l=>ne("/cards",l),xS=async(l,s)=>De(`/cards/${l}`,s),ES=async l=>tt(`/cards/${l}`),AS=async(l=200)=>{const s=await ee("/cards/shipped",{limit:l});return{total:s.total||0,shipments:s.shipments||[]}},TS=async()=>tt("/cards/shipped"),OS=async l=>{const s=new FormData;return s.append("image",l),ne("/upload-image",s)},NS=async()=>{const l=await ee("/items");return Array.isArray(l)?l:l.items||[]},RS=async(l,s,c=1)=>ee(`/items/xyh-list?cookie_id=${encodeURIComponent(l)}&group_name=${encodeURIComponent(s)}&page=${c}`),wS=async l=>ne("/items/get-all-from-account",{cookie_id:l}),zS=async l=>ne("/items",l),jS=async(l,s)=>tt(`/items/${l}/${s}`),DS=async(l,s,c)=>De(`/items/${l}/${s}`,{item_detail:c}),CS=async(l,s,c)=>De(`/items/${l}/${s}/multi-quantity-delivery`,{multi_quantity_delivery:c}),MS=async()=>(await ee("/item-delivery-configs")).configs||[],US=async(l,s)=>ee(`/items/${encodeURIComponent(l)}/${encodeURIComponent(s)}/delivery-config`),qS=async(l,s,c)=>De(`/items/${encodeURIComponent(l)}/${encodeURIComponent(s)}/delivery-config`,c),Wh=l=>({options:l.options||[],detection_status:l.detection_status||"ok",retry_after_seconds:l.retry_after_seconds,warning:l.warning}),BS=async(l,s)=>{const c=await ee(`/api/anti-abuse/sku-options/${encodeURIComponent(s)}`,{cookie_id:l});return Wh(c)},HS=async(l,s)=>{const c=await ee(`/api/anti-abuse/sku-options/${encodeURIComponent(s)}/buyer-test`,{cookie_id:l});return Wh(c)},LS=async l=>(await ee("/product-automation/materials",void 0)).data||[],kS=async(l,s)=>(await De(`/product-automation/materials/${l}`,s)).data,YS=async l=>{await tt(`/product-automation/materials/${l}`)},VS=async()=>(await ee("/product-automation/filter-rules")).data||[],XS=async l=>(l.id?await De(`/product-automation/filter-rules/${l.id}`,l):await ne("/product-automation/filter-rules",l)).data,GS=async l=>{await tt(`/product-automation/filter-rules/${l}`)},QS=async l=>(await ne(`/product-automation/filter-rules/${l}/run`,{})).data,ZS=async()=>(await ee("/product-automation/delete-rules")).data||[],KS=async l=>(l.id?await De(`/product-automation/delete-rules/${l.id}`,l):await ne("/product-automation/delete-rules",l)).data,JS=async l=>{await tt(`/product-automation/delete-rules/${l}`)},$S=async l=>(await ne(`/product-automation/delete-rules/${l}/preview`,{})).data,FS=async(l=50)=>(await ee("/product-automation/runs",{limit:l})).data||[],Nr=async l=>(await ne(l,{})).data,WS=()=>Nr("/product-automation/repairs/published-ids"),IS=()=>Nr("/product-automation/repairs/short-links"),PS=()=>Nr("/product-automation/repairs/cards"),e_=async()=>{const l=await ee("/delivery-rules");return(Array.isArray(l)?l:l.data||l.rules||[]).map(c=>({id:String(c.id),name:c.description||c.keyword||"",item_keyword:c.keyword||"",cookie_id:c.cookie_id||void 0,item_id:c.item_id||void 0,item_title:c.item_title||void 0,card_group_id:c.card_id||0,card_group_name:c.card_name||"",priority:c.delivery_count||1,enabled:!!c.enabled,delivery_times:c.delivery_times||0}))},t_=async l=>{const s={keyword:l.item_keyword,card_id:l.card_group_id,delivery_count:l.priority,enabled:l.enabled??!0,description:l.name,cookie_id:l.cookie_id||null,item_id:l.item_id||null};return l.id?De(`/delivery-rules/${l.id}`,s):ne("/delivery-rules",s)},a_=async l=>tt(`/delivery-rules/${l}`),n_=async l=>(await ee(`/delivery-block-rules/${l}`)).rules,l_=async(l,s,c)=>(await De(`/delivery-block-rules/${l}/${s}`,c)).rule,u_=async l=>(await ee("/blacklist",l?{cookie_id:l}:void 0)).entries,i_=async l=>(await ne("/blacklist",l)).entry,s_=async(l,s)=>(await De(`/blacklist/${l}`,s)).entry,c_=async l=>{await tt(`/blacklist/${l}`)},r_=async l=>{if(!l)return[];const s=await ee(`/keywords-with-item-id/${l}`);return(Array.isArray(s)?s:[]).map((r,f)=>({id:String(f),keyword:r.keyword||"",reply_content:r.reply||"",item_id:r.item_id||"",match_type:"exact",enabled:!0}))},o_=async(l,s)=>{const c=await ee(`/keywords-with-item-id/${s}`),r=Array.isArray(c)?c:[];if(l.id){const f=parseInt(l.id);f>=0&&f{const c=await ee(`/keywords-with-item-id/${s}`),r=Array.isArray(c)?c:[],f=parseInt(l);return f>=0&&f{const l=await ee("/system-settings");return l.data||l},m_=async l=>{const s=Object.entries(l).map(([c,r])=>De(`/system-settings/${c}`,{value:String(r)}));return await Promise.all(s),{success:!0,message:"Settings saved"}},h_=async l=>ne("/system-settings/email-test",l),y_=async l=>ee(`/ai-reply-settings/${l}`),p_=async(l,s)=>{const c={ai_enabled:s.ai_enabled??!1,model_name:s.model_name??"qwen-plus",api_key:s.api_key??"",base_url:s.base_url??"https://dashscope.aliyuncs.com/compatible-mode/v1",max_discount_percent:s.max_discount_percent??10,max_discount_amount:s.max_discount_amount??100,max_bargain_rounds:s.max_bargain_rounds??3,context_enabled:s.context_enabled??!0,context_message_limit:s.context_message_limit??12,context_expire_minutes:s.context_expire_minutes??120,custom_prompts:s.custom_prompts??""};return De(`/ai-reply-settings/${l}`,c)},g_=async(l,s={})=>{const c=await ne(`/ai-reply-test/${l}`,{message:"你好,这是一条测试消息",...s});return{success:c.success??!0,message:c.message||"AI 连接测试成功",reply:c.reply}},b_=async()=>({success:!0,data:(await ee("/notification-channels")||[]).map(c=>{let r;try{r=JSON.parse(c.config)}catch{r=void 0}return{id:String(c.id),name:c.name,type:c.type,config:r||{},enabled:c.enabled,created_at:c.created_at,updated_at:c.updated_at}})}),v_=async l=>ne("/notification-channels",{...l,config:JSON.stringify(l.config)}),S_=async(l,s)=>{const c={...s};return"config"in s&&(c.config=JSON.stringify(s.config)),De(`/notification-channels/${l}`,c)},__=async l=>tt(`/notification-channels/${l}`),x_=async()=>{const l=await ee("/notification-events");return{success:!0,events:(l==null?void 0:l.events)||[],priorities:(l==null?void 0:l.priorities)||[]}},E_=async()=>{const l=await ee("/message-notifications"),s=[];for(const[c,r]of Object.entries(l||{}))if(Array.isArray(r))for(const f of r)s.push({id:String(f.id),cookie_id:c,channel_id:f.channel_id,channel_name:f.channel_name,channel_type:f.channel_type,channel_enabled:f.channel_enabled!==!1,name:f.name??null,event_types:f.event_types??null,enabled:f.enabled});return{success:!0,data:s}},A_=async(l,s,c,r)=>ne(`/message-notifications/${l}`,{channel_id:s,enabled:c,...r?{name:r.name??"",event_types:r.eventTypes??[]}:{}}),T_=async(l,s)=>{const c={};return s.name!==void 0&&(c.name=s.name),s.eventTypes!==void 0&&(c.event_types=s.eventTypes),s.enabled!==void 0&&(c.enabled=s.enabled),De(`/message-notifications/rule/${l}`,c)},O_=async l=>tt(`/message-notifications/${l}`),N_=async l=>ne(`/message-notifications/rule/${l}/test`),R_=async(l={})=>ee("/risk-control-logs",l),w_=async l=>tt(`/risk-control-logs/${l}`),z_=async(l={})=>ee("/logs",l),j_=async(l={})=>(await ee("/message-filters",l)).data||[],D_=async l=>ne("/message-filters/batch-create",l),C_=async l=>(await De(`/message-filters/${l}/toggle`,{})).data,M_=async l=>{await tt(`/message-filters/${l}`)},U_=async l=>(await ne("/message-filters/batch-delete",{ids:l})).deleted,q_=async()=>(await ee("/chat/accounts")).data||[],B_=async(l,s,c=30)=>(await ee(`/chat/conversations/${encodeURIComponent(l)}`,{cursor:s,limit:c})).data,H_=async(l,s,c,r=50)=>(await ee(`/chat/messages/${encodeURIComponent(l)}/${encodeURIComponent(s)}`,{cursor:c,limit:r})).data,L_=async(l,s)=>ne(`/chat/send/${encodeURIComponent(l)}`,s),k_=async(l,s)=>{const c=new FormData;return c.append("cid",s.cid),c.append("to_user_id",s.to_user_id),c.append("image",s.file),ne(`/chat/send-image/${encodeURIComponent(l)}`,c)},Y_=async()=>ee("/default-replies"),V_=async l=>{const s=await ee(`/default-replies/${l}`);return{cookie_id:l,enabled:s.enabled||!1,reply_content:s.reply_content||"",reply_once:s.reply_once||!1,reply_image_url:s.reply_image_url||""}},X_=async(l,s)=>De(`/default-replies/${l}`,{enabled:s.enabled??!1,reply_content:s.reply_content||"",reply_once:s.reply_once??!1,reply_image_url:s.reply_image_url||""}),G_=async l=>tt(`/default-replies/${l}`),Q_=async l=>ne(`/default-replies/${l}/clear-records`,{}),zv=async(l=!1)=>ee("/api/announcement",l?{force:!0}:void 0),Z_=async(l,s=1,c=20,r="VALID")=>ee("/resell/favorites",{cookie_id:l,page:s,page_size:c,type:r}),K_=async(l,s,c=1,r=20)=>ee("/resell/search",{cookie_id:l,keyword:s,page:c,page_size:r}),J_=async()=>ee("/hotlist"),$_=async l=>ne("/hotlist/refresh",{category:l}),F_=async l=>ne("/resell/preview",l),W_=async()=>ee("/pricewatch/rules"),I_=async l=>ne("/pricewatch/rules",l),P_=async(l,s)=>De(`/pricewatch/rules/${l}`,s),ex=async l=>tt(`/pricewatch/rules/${l}`),tx=async l=>ne("/pricewatch/preview",l),ax=async l=>ne(`/pricewatch/rules/${l}/run`),nx=async(l,s=50)=>ee(`/pricewatch/rules/${l}/records`,{limit:s}),lx=async()=>ee("/pricewatch/cookies"),ux=async l=>ne("/resell/publish",l),ix=async l=>{const s=new FormData;return s.append("file",l),ne("/resell/upload-image",s,{timeout:6e4})},sx=async l=>ne("/resell/ai-optimize",l,{timeout:15e4}),cx=async l=>ne("/ai-optimize/preview",{cookie_id:l},{timeout:15e3}),rx=async l=>ne("/ai-optimize/suggest",{cookie_id:l},{timeout:36e4}),ox=async l=>ee("/peer-shops",{cookie_id:l}),fx=async l=>ne("/peer-shops/refresh",{cookie_id:l}),dx=async l=>ne("/peer-shops/ai-analyze",{cookie_id:l},{timeout:36e4}),gr="app:feedback",br="app:confirm",jv=l=>/失败|错误|异常|无法|error|fail/i.test(l)?"error":/警告|注意|请输入|请选择|warning/i.test(l)?"warning":/成功|完成|已新增|已保存|已删除|success/i.test(l)?"success":"info",il=(l,s)=>{const c=String(l??"").trim();c&&window.dispatchEvent(new CustomEvent(gr,{detail:{id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,message:c,type:s||jv(c)}}))},mx=(l,s={})=>new Promise(c=>{window.dispatchEvent(new CustomEvent(br,{detail:{message:l,title:s.title||"确认操作",confirmLabel:s.confirmLabel||"确认",cancelLabel:s.cancelLabel||"取消",danger:s.danger??!0,resolve:c}}))}),Dv=/^[A-Za-z0-9_-]{3,32}$/,Cv=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,Mv=72;function Ih(l){return l?Dv.test(l)?[!0,""]:[!1,"用户名需为 3-32 位字母、数字、下划线或连字符"]:[!1,"用户名不能为空"]}function Uv(l){return l?l.length>254?[!1,"邮箱地址过长"]:Cv.test(l)?[!0,""]:[!1,"邮箱格式不正确"]:[!1,"邮箱不能为空"]}function Ph(l){if(!l)return[!1,"密码不能为空"];if(l.length<8)return[!1,"密码至少 8 位,且需同时包含字母和数字"];if(l.length>64)return[!1,"密码最长 64 位"];if(new TextEncoder().encode(l).length>Mv)return[!1,"密码过长(超过 72 字节),请缩短后重试"];const s=/[a-zA-Z]/.test(l),c=/\d/.test(l);return!s||!c?[!1,"密码至少 8 位,且需同时包含字母和数字"]:[!0,""]}const qv=({activeTab:l,setActiveTab:s,onLogout:c,mobileOpen:r,onMobileClose:f,isAdmin:m=!1,username:y,onUsernameChange:p})=>{const[v,g]=q.useState(!1),[A,N]=q.useState(null),B=q.useRef(null),F=X=>m||!["settings","users"].includes(X.id);q.useEffect(()=>{if(!v)return;const X=Y=>{B.current&&!B.current.contains(Y.target)&&g(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[v]);const W=[{label:"经营概览",items:[{id:"dashboard",icon:h1,label:"总览"}]},{label:"闲鱼业务",items:[{id:"accounts",icon:tg,label:"账号管理"},{id:"items",icon:$p,label:"商品与发货"},{id:"resell",icon:X1,label:"一键转卖"},{id:"hotlist",icon:o1,label:"实时热卖榜"},{id:"peershops",icon:Wp,label:"同行热卖店铺"},{id:"pricewatch",icon:K1,label:"价格监控"},{id:"orders",icon:L1,label:"订单管理"},{id:"buyer-interaction",icon:Y1,label:"买家互动"},{id:"cards",icon:l1,label:"卡密库存"}]},{label:"客户沟通",items:[{id:"messages",icon:p1,label:"消息中心"},{id:"auto-reply",icon:R1,label:"自动回复"},{id:"ai-reply",icon:Kp,label:"AI 回复"}]},{label:"自动化",items:[{id:"product-automation",icon:ng,label:"商品自动化"}]},{label:"系统",items:[{id:"help",icon:Qp,label:"使用说明"},{id:"users",icon:F1,label:"用户管理"},{id:"notifications",icon:Xp,label:"通知与日志"},{id:"settings",icon:q1,label:"系统设置"},{id:"about",icon:bh,label:"关于"}].filter(F)}];return h.jsxs(h.Fragment,{children:[r&&h.jsx("button",{type:"button",className:"fixed inset-0 z-30 bg-black/40 lg:hidden",onClick:f,"aria-label":"关闭导航"}),h.jsxs("aside",{className:`fixed left-0 top-0 z-40 flex h-screen w-[248px] flex-col bg-[var(--surface)] transition-transform lg:translate-x-0 ${r?"translate-x-0":"-translate-x-full"}`,style:{borderRight:"1px solid var(--border)"},children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs("div",{className:"flex h-[76px] shrink-0 items-center gap-3 px-5",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl",style:{background:"linear-gradient(140deg, var(--brand-300), var(--brand))",boxShadow:"var(--shadow-brand)"},children:h.jsx("span",{className:"text-lg font-black text-[#2a2416]",children:"躺"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-base font-extrabold text-[var(--text)]",children:"躺赚鱼"}),h.jsx("p",{className:"mt-0.5 text-[11px] font-medium text-[var(--text-soft)]",children:"运营工作台"})]}),h.jsx("button",{type:"button",onClick:f,className:"rounded-full p-2 hover:bg-[var(--surface-hover)] lg:hidden","aria-label":"关闭导航",children:h.jsx(_h,{className:"w-5 h-5"})})]}),h.jsx("nav",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-4",children:W.map((X,Y)=>h.jsxs("div",{className:Y===0?"":"mt-5",children:[h.jsx("p",{className:"mb-2 px-3 text-[11px] font-bold uppercase tracking-wide text-[var(--text-soft)]",children:X.label}),h.jsx("div",{className:"space-y-1",children:X.items.map(C=>{const K=C.icon,Q=l===C.id;return h.jsxs("button",{type:"button",onClick:()=>s(C.id),className:`group flex min-h-11 w-full items-center gap-3 rounded-xl px-3 text-left transition-all ${Q?"font-bold text-[#2a2416]":"font-medium text-[var(--text-muted)] hover:bg-[var(--surface-hover)] hover:text-[var(--text)]"}`,style:Q?{background:"linear-gradient(135deg, var(--brand-300), var(--brand))",boxShadow:"var(--shadow-brand)"}:void 0,children:[h.jsx(K,{className:`h-[18px] w-[18px] shrink-0 ${Q?"text-[#2a2416]":"text-[var(--text-soft)] group-hover:text-[var(--text-muted)]"}`}),h.jsx("span",{className:"truncate text-sm",children:C.label})]},C.id)})})]},X.label))})]}),h.jsxs("div",{className:"shrink-0 p-3",style:{borderTop:"1px solid var(--border)"},children:[h.jsx(dr,{className:"mb-2"}),h.jsxs("div",{className:"relative",ref:B,children:[h.jsxs("button",{type:"button",onClick:()=>g(X=>!X),"aria-expanded":v,"aria-haspopup":"menu",className:"flex min-h-11 w-full items-center gap-3 rounded-xl px-3 text-left transition-colors hover:bg-[var(--surface-hover)]",children:[h.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-black text-[#2a2416]",style:{background:"linear-gradient(140deg, var(--brand-300), var(--brand))"},children:(y||"?").slice(0,1).toUpperCase()}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-semibold text-[var(--text)]",children:y||"未登录"}),h.jsx("span",{className:"block text-[11px] font-medium text-[var(--text-soft)]",children:m?"管理员":"用户"})]}),h.jsx(Pp,{className:`h-4 w-4 shrink-0 text-[var(--text-soft)] transition-transform ${v?"":"rotate-180"}`})]}),v&&h.jsxs("div",{role:"menu",className:"absolute bottom-full left-0 right-0 mb-2 space-y-0.5 rounded-xl border bg-[var(--surface)] p-1.5 shadow-[var(--shadow-card,0_8px_24px_rgba(20,24,28,0.16))]",style:{borderColor:"var(--border)"},children:[!m&&h.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{g(!1),N("rename")},className:"flex min-h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-sm font-medium text-[var(--text-muted)] transition-colors hover:bg-[var(--surface-hover)] hover:text-[var(--text)]",children:[h.jsx(I1,{className:"h-4 w-4 shrink-0"}),"修改用户名"]}),h.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{g(!1),N("password")},className:"flex min-h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-sm font-medium text-[var(--text-muted)] transition-colors hover:bg-[var(--surface-hover)] hover:text-[var(--text)]",children:[h.jsx(vh,{className:"h-4 w-4 shrink-0"}),"修改密码"]}),h.jsx("div",{className:"my-1",style:{borderTop:"1px solid var(--border)"}}),h.jsxs("button",{type:"button",role:"menuitem",onClick:c,className:"flex min-h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-sm font-medium text-[var(--text-muted)] transition-colors hover:bg-[var(--danger-soft)] hover:text-[var(--danger)]",children:[h.jsx(S1,{className:"h-4 w-4 shrink-0"}),"退出登录"]})]})]})]}),A&&Up.createPortal(h.jsx(Bv,{mode:A,isAdmin:m,onClose:()=>N(null),onRenamed:X=>{N(null),p==null||p(X)}}),document.body)]})]})},Bv=({mode:l,isAdmin:s,onClose:c,onRenamed:r})=>{const[f,m]=q.useState(""),[y,p]=q.useState(""),[v,g]=q.useState(""),[A,N]=q.useState(!1),B=l==="rename",F=async X=>{X.preventDefault();const Y=y.trim();if(B){if(!Ih(Y)){il("用户名需 3-32 位,仅限字母、数字、下划线或短横线","warning");return}}else{if(!Ph(Y)){il("新密码至少 8 位,且同时包含字母和数字","warning");return}if(Y!==v){il("两次输入的新密码不一致","warning");return}}N(!0);try{const C=B?await xv(Y,f):await Nv(f,Y);C.success?(il(B?"用户名修改成功":"密码修改成功,下次登录请使用新密码","success"),B?r(Y):c()):il(C.message||"修改失败,请稍后重试","error")}catch{il("网络异常,修改失败","error")}finally{N(!1)}},W="ios-input h-11 w-full rounded-md px-4 text-sm";return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:A?void 0:c,children:h.jsxs("form",{className:"w-full max-w-sm rounded-2xl bg-[var(--surface)] p-6 shadow-[0_12px_40px_rgba(20,24,28,0.24)]",onClick:X=>X.stopPropagation(),onSubmit:X=>void F(X),children:[h.jsx("h3",{className:"text-base font-extrabold text-[var(--text)]",children:B?"修改用户名":"修改密码"}),h.jsx("p",{className:"mt-1 text-xs text-[var(--text-soft)]",children:B?"用户名是登录凭证,修改后请用新用户名登录":"修改成功后当前登录保持有效"}),h.jsxs("label",{className:"mt-4 block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-[var(--text-muted)]",children:"当前密码"}),h.jsx("input",{type:"password",autoComplete:"current-password",value:f,onChange:X=>m(X.target.value),className:W,placeholder:"请输入当前密码",disabled:A})]}),h.jsxs("label",{className:"mt-3 block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-[var(--text-muted)]",children:B?"新用户名":"新密码"}),h.jsx("input",{type:B?"text":"password",autoComplete:B?"username":"new-password",value:y,onChange:X=>p(X.target.value),className:W,placeholder:B?"3-32 位字母/数字/下划线/短横线":"至少 8 位,含字母和数字",disabled:A})]}),!B&&h.jsxs("label",{className:"mt-3 block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-[var(--text-muted)]",children:"确认新密码"}),h.jsx("input",{type:"password",autoComplete:"new-password",value:v,onChange:X=>g(X.target.value),className:W,placeholder:"再次输入新密码",disabled:A})]}),h.jsxs("div",{className:"mt-6 flex gap-3",children:[h.jsx("button",{type:"button",onClick:c,disabled:A,className:"ios-btn-secondary h-11 flex-1 rounded-md text-sm font-bold",children:"取消"}),h.jsx("button",{type:"submit",disabled:A||!f||!y.trim(),className:"ios-btn-primary h-11 flex-1 rounded-md text-sm font-bold disabled:opacity-60",children:A?h.jsx(su,{className:"mx-auto h-4 w-4 animate-spin"}):"确认修改"})]})]})})},Hv={success:{icon:or,className:"border-emerald-200 bg-emerald-50 text-emerald-800"},error:{icon:t1,className:"border-red-200 bg-red-50 text-red-800"},warning:{icon:Sh,className:"border-amber-200 bg-amber-50 text-amber-900"},info:{icon:bh,className:"border-gray-200 bg-white text-gray-800"}},Lv=()=>{const[l,s]=q.useState([]),[c,r]=q.useState(null);q.useEffect(()=>{const m=p=>{const v=p.detail;s(g=>[...g.slice(-3),v]),window.setTimeout(()=>{s(g=>g.filter(A=>A.id!==v.id))},v.type==="error"?6e3:3600)},y=p=>{r(p.detail)};return window.addEventListener(gr,m),window.addEventListener(br,y),()=>{window.removeEventListener(gr,m),window.removeEventListener(br,y)}},[]),q.useEffect(()=>{if(!c)return;const m=y=>{y.key==="Escape"&&(c.resolve(!1),r(null))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[c]);const f=m=>{c==null||c.resolve(m),r(null)};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed right-4 top-4 z-[10000] flex w-[min(380px,calc(100vw-2rem))] flex-col gap-2","aria-live":"polite",children:l.map(m=>{const y=Hv[m.type],p=y.icon;return h.jsxs("div",{role:m.type==="error"?"alert":"status",className:`flex items-start gap-3 rounded-md border px-4 py-3 shadow-[0_4px_16px_rgba(20,24,28,0.10)] ${y.className}`,children:[h.jsx(p,{className:"mt-0.5 h-5 w-5 shrink-0"}),h.jsx("span",{className:"min-w-0 flex-1 break-words text-sm font-medium",children:m.message}),h.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 hover:bg-black/5",onClick:()=>s(v=>v.filter(g=>g.id!==m.id)),"aria-label":"关闭提示",children:h.jsx(_h,{className:"h-4 w-4"})})]},m.id)})}),c&&h.jsx("div",{className:"modal-overlay",role:"presentation",onMouseDown:m=>{m.target===m.currentTarget&&f(!1)},children:h.jsxs("div",{role:"alertdialog","aria-modal":"true","aria-labelledby":"global-confirm-title","aria-describedby":"global-confirm-message",className:"modal-container max-w-md",children:[h.jsxs("div",{className:"modal-body flex items-start gap-3",children:[h.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-amber-50 text-amber-700",children:h.jsx(Sh,{className:"h-5 w-5"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"global-confirm-title",className:"text-base font-bold text-gray-900",children:c.title}),h.jsx("p",{id:"global-confirm-message",className:"mt-1 break-words text-sm leading-6 text-gray-600",children:c.message})]})]}),h.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[h.jsx("button",{type:"button",className:"ios-btn-secondary rounded-md px-4 py-2 text-sm",onClick:()=>f(!1),children:c.cancelLabel}),h.jsx("button",{type:"button",className:`${c.danger?"ios-btn-danger":"ios-btn-primary"} rounded-md px-4 py-2 text-sm`,onClick:()=>f(!0),autoFocus:!0,children:c.confirmLabel})]})]})})]})},kv={info:"border-[#ffe566] bg-[#fffdf0] text-[#6b5200]",warning:"border-[#f5c800] bg-[#fff7e6] text-[#8a6300]",danger:"border-red-200 bg-red-50 text-red-700"},oh={info:"bg-[#ffe100] text-[#2a2416]",warning:"bg-[#f5c800] text-[#2a2416]",danger:"bg-red-600 text-white"},Yv=()=>{const[l,s]=q.useState(null);q.useEffect(()=>{const y=()=>{zv().then(s).catch(()=>{})};y();const p=setInterval(y,3e5);return()=>clearInterval(p)},[]);const c=(l==null?void 0:l.announcements)||[],r=!!(l!=null&&l.has_update);if(!c.length&&!r)return null;const f=c.some(y=>y.level==="danger")?"danger":c.some(y=>y.level==="warning")?"warning":"info",m=c.map(y=>h.jsxs("span",{className:"inline-flex items-center gap-2 px-8",children:[h.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-bold ${oh[y.level]||oh.info}`,children:y.level==="danger"?"重要":y.level==="warning"?"注意":"通知"}),y.title&&h.jsx("b",{className:"font-bold",children:y.title}),h.jsx("span",{children:y.content.replace(/\s*\n\s*/g," ")}),y.published_at&&h.jsx("span",{className:"text-[11px] opacity-60",children:y.published_at})]},y.id));return h.jsxs("div",{className:"mx-auto max-w-[1320px] space-y-2 px-4 pt-4 sm:px-6 lg:px-8",children:[r&&h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-amber-200 bg-amber-50 px-4 py-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("p",{className:"text-sm font-bold text-amber-900",children:["发现新版本 ",l==null?void 0:l.latest_version,h.jsxs("span",{className:"ml-2 font-normal text-amber-700",children:["当前 ",l==null?void 0:l.local_version]})]}),(l==null?void 0:l.release_notes)&&h.jsx("p",{className:"mt-1 whitespace-pre-wrap text-xs leading-relaxed text-amber-800",children:l.release_notes})]}),(l==null?void 0:l.download_url)&&h.jsxs("a",{href:l.download_url,target:"_blank",rel:"noopener noreferrer",className:"ios-btn-primary inline-flex flex-none items-center gap-2 rounded-md px-3 py-2 text-xs",children:[h.jsx(i1,{className:"h-4 w-4"}),"前往下载",h.jsx(c1,{className:"h-3 w-3"})]})]}),c.length>0&&h.jsxs("div",{className:`flex items-center gap-3 overflow-hidden rounded-md border px-3 py-2 ${kv[f]}`,children:[h.jsx(A1,{className:"h-4 w-4 flex-none"}),h.jsx("div",{className:"marquee min-w-0 flex-1",children:h.jsxs("div",{className:"marquee__track text-xs leading-relaxed",children:[m,h.jsx("span",{"aria-hidden":"true",children:m})]})})]})]})},fh=({image:l,code:s,onCodeChange:c,onRefresh:r,label:f="图形验证码"})=>h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:f}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",placeholder:"请输入图中字符",value:s,onChange:m=>c(m.target.value),maxLength:4,autoComplete:"off",className:"ios-input h-11 w-full rounded-md px-4 text-sm uppercase"}),l?h.jsx("img",{src:l,alt:"图形验证码,点击换一张",title:"看不清?点击换一张",onClick:r,className:"h-11 w-28 shrink-0 cursor-pointer rounded-md border border-gray-200 bg-white"}):h.jsx("button",{type:"button",onClick:r,className:"h-11 w-28 shrink-0 rounded-md border border-gray-200 bg-gray-50 text-xs text-gray-500",children:"点击获取"}),h.jsx("button",{type:"button",onClick:r,"aria-label":"刷新图形验证码",className:"ios-btn-secondary h-11 shrink-0 rounded-md px-2",children:h.jsx(M1,{className:"h-4 w-4"})})]})]});function dh(l=!1){const[s,c]=q.useState(()=>mh()),[r,f]=q.useState(""),[m,y]=q.useState(""),[p,v]=q.useState(!1),g=q.useCallback(async()=>{const A=mh();c(A),y("");try{const N=await Tv(A);N.success&&f(N.captcha_image)}catch{}},[]);return q.useEffect(()=>{l&&g()},[]),{sessionId:s,image:r,code:m,setCode:y,required:p,setRequired:v,refresh:g}}function mh(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`sess-${Date.now()}-${Math.random().toString(36).slice(2)}`}const Vv=q.lazy(()=>Ie(()=>import("./Dashboard-R20Ph_el.js"),__vite__mapDeps([0,1,2,3,4,5]))),Xv=q.lazy(()=>Ie(()=>import("./AccountList-CC8hRCM2.js"),__vite__mapDeps([6,1,7,8,9,10,11,12,13,14]))),Gv=q.lazy(()=>Ie(()=>import("./OrderList-DnNov42V.js"),__vite__mapDeps([15,1,16,17,18,5,19,13,20,10,21,14]))),Qv=q.lazy(()=>Ie(()=>import("./CardList-DaeMtjqS.js"),__vite__mapDeps([22,1,16,20,10,2,14,23,5]))),Zv=q.lazy(()=>Ie(()=>import("./ItemList-DpqEi6Ob.js"),__vite__mapDeps([24,1,25,14,10,16,26,9,5,8,27,20]))),Kv=q.lazy(()=>Ie(()=>import("./ProductAutomation-ByBZohdg.js"),__vite__mapDeps([28,1,18,10,14,29,5,30]))),Jv=q.lazy(()=>Ie(()=>import("./AIReply-C49hHlXg.js"),__vite__mapDeps([31,1,14,32,12,13,29]))),$v=q.lazy(()=>Ie(()=>import("./Settings-BKqYYBIp.js"),__vite__mapDeps([33,1,14,8,34,12,13]))),Fv=q.lazy(()=>Ie(()=>import("./Keywords-DYO7Z25o.js"),__vite__mapDeps([35,1,17,11,16,9,10,26,14,8]))),Wv=q.lazy(()=>Ie(()=>import("./MessageManagement-BX9e9TqW.js"),__vite__mapDeps([36,1,27,18,2,23,34,37,16,10]))),Iv=q.lazy(()=>Ie(()=>import("./NotificationsAndLogs-DvXsPImX.js"),__vite__mapDeps([38,1,30,25,4,16,39,10,37,21,14,7]))),Pv=q.lazy(()=>Ie(()=>import("./UserManagement-WEnM8-3J.js"),__vite__mapDeps([40,1,10]))),e2=q.lazy(()=>Ie(()=>import("./About-DCjjMMTu.js"),__vite__mapDeps([41,1]))),t2=q.lazy(()=>Ie(()=>import("./BuyerInteraction-BJEwndHV.js"),__vite__mapDeps([42,1,14,25,19,32]))),a2=q.lazy(()=>Ie(()=>import("./Resell-C3EooCYv.js"),__vite__mapDeps([43,1,18,16,8,2]))),n2=q.lazy(()=>Ie(()=>import("./HotList-BwqIdE0Z.js"),__vite__mapDeps([44,1,3,2]))),l2=q.lazy(()=>Ie(()=>import("./PeerShops-CypJHQVt.js"),__vite__mapDeps([45,1,8,2,18,3]))),u2=q.lazy(()=>Ie(()=>import("./PriceWatch-Db4Gwt9m.js"),__vite__mapDeps([46,1,16,29,39,10,18]))),i2=q.lazy(()=>Ie(()=>import("./Help-LRtmM6iN.js"),[])),We=()=>h.jsxs("div",{className:"page-loading",children:[h.jsx(su,{className:"h-5 w-5 animate-spin"}),h.jsx("span",{children:"正在加载页面"})]}),s2={dashboard:"总览",accounts:"账号管理",items:"商品与发货",resell:"一键转卖",hotlist:"实时热卖榜",peershops:"同行热卖店铺",pricewatch:"价格监控",orders:"订单管理","buyer-interaction":"买家互动",cards:"卡密库存",messages:"消息中心","auto-reply":"自动回复","ai-reply":"AI 回复","product-automation":"商品自动化",notifications:"通知与日志",settings:"系统设置",users:"用户管理",about:"关于",help:"使用说明"},c2=["settings","users"],r2=()=>{const[l,s]=q.useState(!1),[c,r]=q.useState(()=>localStorage.getItem("active_page")||"dashboard"),[f,m]=q.useState(!0),[y,p]=q.useState(""),[v,g]=q.useState(""),[A,N]=q.useState(!1),[B,F]=q.useState(""),[W,X]=q.useState(""),[Y,C]=q.useState(!1),[K,Q]=q.useState(!1),[te,Ee]=q.useState("login"),[me,le]=q.useState(!1),[Le,ct]=q.useState(!0),[be,Me]=q.useState({username:"",email:"",password:"",code:""}),[ke,xt]=q.useState(!1),[He,Re]=q.useState(""),[z,L]=q.useState(""),[P,Se]=q.useState(!1),[re,S]=q.useState(0),j=dh(),H=dh();q.useEffect(()=>{te==="register"&&j.refresh()},[te]),q.useEffect(()=>{_v().then(k=>{le(String(k.registration_enabled)==="true"),ct(String(k.email_verification_enabled??"true")!=="false")}).catch(()=>le(!1))},[]),q.useEffect(()=>{if(re<=0)return;const k=setTimeout(()=>S(re-1),1e3);return()=>clearTimeout(k)},[re]);const G=async()=>{if(!be.email.trim()){Re("请先填写邮箱");return}if(!j.code.trim()){Re("请先输入图形验证码");return}Se(!0),Re(""),L("");try{const k=await Av(be.email.trim(),"register",{session_id:j.sessionId,code:j.code.trim()});if((k==null?void 0:k.success)===!1){Re(k.message||"验证码发送失败,请确认邮件服务已配置"),j.refresh();return}L("验证码已发送,请查收邮箱"),S(60),j.refresh()}catch(k){Re(k instanceof Error?k.message:"验证码发送失败"),j.refresh()}finally{Se(!1)}},ue=async k=>{k.preventDefault(),Re(""),L("");for(const[ie,Te]of[Ih(be.username.trim()),Uv(be.email.trim()),Ph(be.password)])if(!ie){Re(Te);return}if(Le&&!be.code.trim()){Re("请填写邮箱验证码");return}xt(!0);try{const ie=await Ev({username:be.username.trim(),email:be.email.trim(),password:be.password,...Le?{verification_code:be.code.trim()}:{}});ie!=null&&ie.success?(p(be.username.trim()),g(""),Me({username:"",email:"",password:"",code:""}),Ee("login"),F(""),L(""),X("注册成功,请使用新账号登录")):Re((ie==null?void 0:ie.message)||"注册失败")}catch(ie){Re(ie instanceof Error?ie.message:"注册失败,请稍后重试")}finally{xt(!1)}};q.useEffect(()=>{localStorage.getItem("auth_token")?Ov().then(Te=>{if(!Te.authenticated){localStorage.removeItem("auth_token");return}Q(!!Te.is_admin),p(Te.username||""),s(!0)}).catch(()=>localStorage.removeItem("auth_token")).finally(()=>m(!1)):m(!1);const ie=()=>s(!1);return window.addEventListener("auth:logout",ie),()=>window.removeEventListener("auth:logout",ie)},[]),q.useEffect(()=>{localStorage.setItem("active_page",c)},[c]),q.useEffect(()=>{!K&&c2.includes(c)&&r("dashboard")},[K]);const Z=async k=>{k.preventDefault(),N(!0),F("");try{const ie=await Sv({username:y,password:v,...H.required?{captcha_session_id:H.sessionId,captcha_code:H.code.trim()}:{}});ie.success&&ie.token?(localStorage.setItem("auth_token",ie.token),Q(!!ie.is_admin),p(ie.username||y),s(!0)):(F(ie.message||"账号或密码错误"),ie.captcha_required&&(H.setRequired(!0),H.refresh()))}catch(ie){F(ie instanceof Error?ie.message:"登录失败,请稍后重试")}finally{N(!1)}};return f?h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[var(--app-bg)]",children:h.jsxs("div",{className:"flex items-center gap-3 text-sm font-semibold text-[var(--text-muted)]",children:[h.jsx(su,{className:"h-5 w-5 animate-spin text-[var(--brand-text)]"}),"正在验证登录状态"]})}):l?h.jsxs("div",{className:"flex min-h-screen bg-[var(--app-bg)] text-[var(--text)]",children:[h.jsx(Lv,{}),h.jsx(qv,{activeTab:c,setActiveTab:k=>{r(k),C(!1)},mobileOpen:Y,onMobileClose:()=>C(!1),isAdmin:K,username:l?y:"",onUsernameChange:p,onLogout:()=>{localStorage.removeItem("auth_token"),Q(!1),s(!1)}}),h.jsxs("main",{className:"min-h-screen min-w-0 flex-1 lg:ml-[248px]",children:[h.jsxs("header",{className:"sticky top-0 z-20 flex h-14 items-center gap-3 border-b border-[var(--border)] bg-[var(--surface)] px-4 lg:hidden",children:[h.jsx("button",{type:"button",onClick:()=>C(!0),className:"p-2 -ml-2 rounded-md hover:bg-gray-100",title:"打开导航","aria-label":"打开导航",children:h.jsx(O1,{className:"w-5 h-5"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"truncate text-sm font-bold",children:s2[c]||"躺赚鱼"}),h.jsx("p",{className:"text-[11px] text-gray-400",children:"躺赚鱼"})]}),h.jsx(dr,{compact:!0,className:"ml-auto"})]}),c!=="messages"&&h.jsx(Yv,{}),h.jsxs("div",{className:c==="messages"?"h-[calc(100vh-3.5rem)] lg:h-screen overflow-hidden":c==="help"?"w-full p-4 pb-10 sm:p-6 lg:p-8":"mx-auto max-w-[1320px] p-4 pb-10 sm:p-6 lg:p-8",children:[h.jsx("section",{hidden:c!=="dashboard",children:h.jsx(q.Suspense,{fallback:c==="dashboard"?h.jsx(We,{}):null,children:h.jsx(Vv,{})})}),h.jsx("section",{hidden:c!=="accounts",children:h.jsx(q.Suspense,{fallback:c==="accounts"?h.jsx(We,{}):null,children:h.jsx(Xv,{})})}),h.jsx("section",{hidden:c!=="items",children:h.jsx(q.Suspense,{fallback:c==="items"?h.jsx(We,{}):null,children:h.jsx(Zv,{})})}),h.jsx("section",{hidden:c!=="resell",children:h.jsx(q.Suspense,{fallback:c==="resell"?h.jsx(We,{}):null,children:h.jsx(a2,{})})}),h.jsx("section",{hidden:c!=="hotlist",children:h.jsx(q.Suspense,{fallback:c==="hotlist"?h.jsx(We,{}):null,children:h.jsx(n2,{})})}),h.jsx("section",{hidden:c!=="peershops",children:h.jsx(q.Suspense,{fallback:c==="peershops"?h.jsx(We,{}):null,children:h.jsx(l2,{})})}),h.jsx("section",{hidden:c!=="pricewatch",children:h.jsx(q.Suspense,{fallback:c==="pricewatch"?h.jsx(We,{}):null,children:h.jsx(u2,{})})}),h.jsx("section",{hidden:c!=="product-automation",children:h.jsx(q.Suspense,{fallback:c==="product-automation"?h.jsx(We,{}):null,children:h.jsx(Kv,{})})}),h.jsx("section",{hidden:c!=="orders",children:h.jsx(q.Suspense,{fallback:c==="orders"?h.jsx(We,{}):null,children:h.jsx(Gv,{})})}),h.jsx("section",{hidden:c!=="cards",children:h.jsx(q.Suspense,{fallback:c==="cards"?h.jsx(We,{}):null,children:h.jsx(Qv,{})})}),h.jsx("section",{hidden:c!=="auto-reply",children:h.jsx(q.Suspense,{fallback:c==="auto-reply"?h.jsx(We,{}):null,children:h.jsx(Fv,{mode:"reply"})})}),h.jsx("section",{hidden:c!=="ai-reply",children:h.jsx(q.Suspense,{fallback:c==="ai-reply"?h.jsx(We,{}):null,children:h.jsx(Jv,{})})}),h.jsx("section",{hidden:c!=="messages",className:"h-full min-h-0",children:h.jsx(q.Suspense,{fallback:c==="messages"?h.jsx(We,{}):null,children:h.jsx(Wv,{isActive:c==="messages"})})}),h.jsx("section",{hidden:c!=="notifications",children:h.jsx(q.Suspense,{fallback:c==="notifications"?h.jsx(We,{}):null,children:h.jsx(Iv,{isAdmin:K})})}),K&&h.jsx("section",{hidden:c!=="users",children:h.jsx(q.Suspense,{fallback:c==="users"?h.jsx(We,{}):null,children:h.jsx(Pv,{})})}),K&&h.jsx("section",{hidden:c!=="settings",children:h.jsx(q.Suspense,{fallback:c==="settings"?h.jsx(We,{}):null,children:h.jsx($v,{})})}),h.jsx("section",{hidden:c!=="buyer-interaction",children:h.jsx(q.Suspense,{fallback:c==="buyer-interaction"?h.jsx(We,{}):null,children:h.jsx(t2,{})})}),h.jsx("section",{hidden:c!=="about",children:h.jsx(q.Suspense,{fallback:c==="about"?h.jsx(We,{}):null,children:h.jsx(e2,{})})}),h.jsx("section",{hidden:c!=="help",children:h.jsx(q.Suspense,{fallback:c==="help"?h.jsx(We,{}):null,children:h.jsx(i2,{})})})]})]})]}):h.jsxs("div",{className:"relative min-h-screen bg-[var(--app-bg)] p-4 font-sans text-[var(--text)] sm:p-6",children:[h.jsx(dr,{compact:!0,className:"absolute right-4 top-4 z-10 sm:right-6 sm:top-6"}),h.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-2rem)] max-w-5xl items-center justify-center sm:min-h-[calc(100vh-3rem)]",children:h.jsxs("div",{className:"grid w-full overflow-hidden rounded-3xl bg-[var(--surface)] lg:grid-cols-[1.05fr_0.95fr]",style:{border:"1px solid var(--border)",boxShadow:"var(--shadow-lg)"},children:[h.jsxs("div",{className:"theme-brand-panel hidden min-h-[560px] flex-col justify-between p-10 lg:flex",style:{background:"linear-gradient(155deg, #fff8d1 0%, #ffe566 55%, #ffe100 100%)"},children:[h.jsxs("div",{children:[h.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl bg-white/70 backdrop-blur",children:h.jsx("span",{className:"text-2xl font-black text-[#2a2416]",children:"躺"})}),h.jsx("p",{className:"mt-7 text-xs font-bold tracking-widest text-[#8a6300]",children:"TANGZHUAN YU"}),h.jsx("h1",{className:"mt-2 max-w-md text-3xl font-extrabold leading-tight text-[#2a2416]",children:"躺赚鱼"}),h.jsx("p",{className:"mt-4 max-w-md text-sm leading-7 text-[#6b5200]",children:"统一处理账号、商品、订单、消息、回复和自动发货。"})]}),h.jsx("div",{className:"grid grid-cols-2 gap-3",children:["账号与商品同步","订单与发货处理","消息与自动回复","通知与运行日志"].map(k=>h.jsx("div",{className:"rounded-2xl bg-white/70 px-4 py-3 text-xs font-bold text-[#544c39] backdrop-blur",children:k},k))})]}),h.jsx("div",{className:"flex min-h-[500px] items-center p-7 sm:p-10",children:h.jsxs("div",{className:"mx-auto w-full max-w-sm animate-fade-in",children:[h.jsxs("div",{className:"mb-8",children:[h.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-2xl lg:hidden",style:{background:"linear-gradient(140deg, var(--brand-300), var(--brand))",boxShadow:"var(--shadow-brand)"},children:h.jsx("span",{className:"text-xl font-black text-[#2a2416]",children:"躺"})}),h.jsx("h2",{className:"text-2xl font-extrabold text-gray-900",children:te==="login"?"登录管理后台":"注册新账号"}),h.jsx("p",{className:"mt-2 text-sm text-gray-500",children:te==="login"?"使用管理员账号进入工作台":"创建账号后即可登录工作台"})]}),te==="login"&&h.jsxs("form",{onSubmit:Z,className:"space-y-5",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"管理员账号"}),h.jsxs("div",{className:"relative group",children:[h.jsx(Gm,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"text",placeholder:"请输入账号",value:y,onChange:k=>p(k.target.value),autoComplete:"username",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"密码"}),h.jsxs("div",{className:"relative group",children:[h.jsx(Vm,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"password",placeholder:"请输入密码",value:v,onChange:k=>g(k.target.value),autoComplete:"current-password",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),H.required&&h.jsx(fh,{image:H.image,code:H.code,onCodeChange:H.setCode,onRefresh:()=>void H.refresh()})]}),W&&h.jsxs("div",{role:"status",className:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 p-3 text-sm font-semibold text-green-700",children:[h.jsx(or,{className:"h-4 w-4 shrink-0"})," ",W]}),B&&h.jsxs("div",{role:"alert",className:"flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm font-semibold text-red-700",children:[h.jsx(Xm,{className:"h-4 w-4 shrink-0"})," ",B]}),h.jsx("button",{type:"submit",disabled:A,className:"ios-btn-primary flex h-11 w-full items-center justify-center gap-2 rounded-md text-sm disabled:opacity-70",children:A?h.jsx(su,{className:"h-4 w-4 animate-spin"}):h.jsxs(h.Fragment,{children:["登录 ",h.jsx(Ym,{className:"h-4 w-4"})]})})]}),te==="register"&&h.jsxs("form",{onSubmit:ue,className:"space-y-5",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"账号"}),h.jsxs("div",{className:"relative group",children:[h.jsx(Gm,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"text",placeholder:"设置登录账号",value:be.username,onChange:k=>Me({...be,username:k.target.value}),autoComplete:"username",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"邮箱"}),h.jsxs("div",{className:"relative group",children:[h.jsx(x1,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"email",placeholder:"用于找回账号",value:be.email,onChange:k=>Me({...be,email:k.target.value}),autoComplete:"email",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"密码"}),h.jsxs("div",{className:"relative group",children:[h.jsx(Vm,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"password",placeholder:"至少 8 位,含字母和数字",value:be.password,onChange:k=>Me({...be,password:k.target.value}),autoComplete:"new-password",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),Le&&h.jsxs(h.Fragment,{children:[h.jsx(fh,{image:j.image,code:j.code,onCodeChange:j.setCode,onRefresh:()=>void j.refresh()}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"邮箱验证码"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("div",{className:"relative group flex-1",children:[h.jsx(vh,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"text",placeholder:"请输入验证码",value:be.code,onChange:k=>Me({...be,code:k.target.value}),className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]}),h.jsx("button",{type:"button",onClick:()=>void G(),disabled:P||re>0,className:"ios-btn-secondary h-11 shrink-0 rounded-md px-3 text-xs font-bold disabled:opacity-60",children:re>0?`${re}s`:P?"发送中":"获取验证码"})]})]})]})]}),z&&h.jsxs("div",{role:"status",className:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 p-3 text-sm font-semibold text-green-700",children:[h.jsx(or,{className:"h-4 w-4 shrink-0"})," ",z]}),He&&h.jsxs("div",{role:"alert",className:"flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm font-semibold text-red-700",children:[h.jsx(Xm,{className:"h-4 w-4 shrink-0"})," ",He]}),h.jsx("button",{type:"submit",disabled:ke,className:"ios-btn-primary flex h-11 w-full items-center justify-center gap-2 rounded-md text-sm disabled:opacity-70",children:ke?h.jsx(su,{className:"h-4 w-4 animate-spin"}):h.jsxs(h.Fragment,{children:["注册 ",h.jsx(Ym,{className:"h-4 w-4"})]})})]}),me&&h.jsx("div",{className:"mt-5 text-center text-xs text-gray-500",children:te==="login"?h.jsxs(h.Fragment,{children:["还没有账号?",h.jsx("button",{type:"button",onClick:()=>{Ee("register"),F(""),X("")},className:"ml-1 font-bold text-[var(--brand-text)] hover:underline",children:"注册新账号"})]}):h.jsxs(h.Fragment,{children:["已有账号?",h.jsx("button",{type:"button",onClick:()=>{Ee("login"),Re(""),L("")},className:"ml-1 font-bold text-[var(--brand-text)] hover:underline",children:"返回登录"})]})}),h.jsxs("p",{className:"mt-7 border-t border-gray-100 pt-5 text-xs font-medium text-gray-400",children:["更多开源应用:",h.jsx("a",{href:"https://nav.88531.cn",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--brand-text)] hover:underline",children:"https://nav.88531.cn"})]})]})})]})})]})},ey=document.getElementById("root");if(!ey)throw new Error("Could not find root element to mount to");const o2=Dp.createRoot(ey);o2.render(h.jsx(yh.StrictMode,{children:h.jsx(sg,{children:h.jsx(r2,{})})}));export{$2 as $,q2 as A,Kp as B,t1 as C,B2 as D,c1 as E,H2 as F,Y2 as G,L2 as H,k2 as I,V2 as J,p_ as K,su as L,R1 as M,cx as N,yh as O,i1 as P,Y1 as Q,f2 as R,Xm as S,oS as T,tg as U,G2 as V,J2 as W,_h as X,I2 as Y,P2 as Z,rS as _,vr as a,tS as a$,K2 as a0,W2 as a1,F2 as a2,Q2 as a3,Z2 as a4,dS as a5,OS as a6,AS as a7,SS as a8,l1 as a9,zS as aA,ng as aB,WS as aC,IS as aD,PS as aE,or as aF,LS as aG,VS as aH,ZS as aI,FS as aJ,YS as aK,XS as aL,QS as aM,GS as aN,KS as aO,$S as aP,JS as aQ,kS as aR,g_ as aS,d_ as aT,I1 as aU,x1 as aV,A1 as aW,eS as aX,m_ as aY,Ph as aZ,Nv as a_,xS as aa,ES as ab,_S as ac,TS as ad,n_ as ae,u_ as af,l_ as ag,i_ as ah,s_ as ai,c_ as aj,vh as ak,t_ as al,a_ as am,BS as an,HS as ao,RS as ap,$p as aq,L1 as ar,e_ as as,MS as at,cS as au,US as av,qS as aw,CS as ax,jS as ay,DS as az,Up as b,P_ as b$,aS as b0,nS as b1,h_ as b2,Y_ as b3,r_ as b4,f_ as b5,V_ as b6,Q_ as b7,G_ as b8,o_ as b9,hS as bA,yS as bB,gS as bC,pS as bD,bh as bE,zv as bF,fS as bG,X1 as bH,Z_ as bI,K_ as bJ,ix as bK,sx as bL,ux as bM,F_ as bN,J_ as bO,$_ as bP,o1 as bQ,ox as bR,fx as bS,dx as bT,Wp as bU,W_ as bV,lx as bW,K1 as bX,Sh as bY,tx as bZ,I_ as b_,X_ as ba,B_ as bb,H_ as bc,Xp as bd,C_ as be,q_ as bf,j_ as bg,lS as bh,L_ as bi,k_ as bj,D_ as bk,U_ as bl,M_ as bm,b_ as bn,E_ as bo,x_ as bp,R_ as bq,z_ as br,S_ as bs,__ as bt,T_ as bu,N_ as bv,O_ as bw,w_ as bx,v_ as by,A_ as bz,de as c,ax as c0,ex as c1,nx as c2,vS as d,M1 as e,mS as f,hh as g,NS as h,bS as i,h as j,Gm as k,q1 as l,uS as m,il as n,D2 as o,X2 as p,M2 as q,q as r,U2 as s,iS as t,rx as u,mx as v,wS as w,sS as x,C2 as y,y_ as z}; +`+m)}}catch{}}throw r}}_request(s,c){typeof s=="string"?(c=c||{},c.url=s):c=s||{},c=bn(this.defaults,c);const{transitional:r,paramsSerializer:f,headers:m}=c;r!==void 0&&Ci.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean),advertiseZstdAcceptEncoding:ot.transitional(ot.boolean),validateStatusUndefinedResolves:ot.transitional(ot.boolean)},!1),f!=null&&(x.isFunction(f)?c.paramsSerializer={serialize:f}:Ci.assertOptions(f,{encode:ot.function,serialize:ot.function},!0)),c.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?c.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:c.allowAbsoluteUrls=!0),Ci.assertOptions(c,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),c.method=(c.method||this.defaults.method||"get").toLowerCase();let y=m&&x.merge(m.common,m[c.method]);m&&x.forEach(["delete","get","head","post","put","patch","query","common"],W=>{delete m[W]}),c.headers=ft.concat(y,m);const p=[];let v=!0;this.interceptors.request.forEach(function(X){if(typeof X.runWhen=="function"&&X.runWhen(c)===!1)return;v=v&&X.synchronous;const Y=c.transitional||Er;Y&&Y.legacyInterceptorReqResOrdering?p.unshift(X.fulfilled,X.rejected):p.push(X.fulfilled,X.rejected)});const g=[];this.interceptors.response.forEach(function(X){g.push(X.fulfilled,X.rejected)});let A,N=0,B;if(!v){const W=[rr.bind(this),void 0];for(W.unshift(...p),W.push(...g),B=W.length,A=Promise.resolve(c);Nrr.call(this,F)))}catch(C){A=Promise.reject(C)}break}}if(!A)try{A=rr.call(this,F)}catch(W){A=Promise.reject(W)}for(N=0,B=g.length;N{if(!r._listeners)return;let m=r._listeners.length;for(;m-- >0;)r._listeners[m](f);r._listeners=null}),this.promise.then=f=>{let m;const y=new Promise(p=>{r.subscribe(p),m=p}).then(f);return y.cancel=function(){r.unsubscribe(m)},y},s(function(m,y,p){r.reason||(r.reason=new du(m,y,p),c(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const c=this._listeners.indexOf(s);c!==-1&&this._listeners.splice(c,1)}toAbortSignal(){const s=new AbortController,c=r=>{s.abort(r)};return this.subscribe(c),s.signal.unsubscribe=()=>this.unsubscribe(c),s.signal}static source(){let s;return{token:new $h(function(f){s=f}),cancel:s}}};function gv(l){return function(c){return l.apply(null,c)}}function bv(l){return x.isObject(l)&&l.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pr).forEach(([l,s])=>{pr[s]=l});function Fh(l){const s=new yn(l),c=Th(yn.prototype.request,s);return x.extend(c,yn.prototype,s,{allOwnKeys:!0}),x.extend(c,s,null,{allOwnKeys:!0}),c.create=function(f){return Fh(bn(l,f))},c}const Qe=Fh(fu);Qe.Axios=yn;Qe.CanceledError=du;Qe.CancelToken=pv;Qe.isCancel=Vh;Qe.VERSION=Tr;Qe.toFormData=Hi;Qe.AxiosError=V;Qe.Cancel=Qe.CanceledError;Qe.all=function(s){return Promise.all(s)};Qe.spread=gv;Qe.isAxiosError=bv;Qe.mergeConfig=bn;Qe.AxiosHeaders=ft;Qe.formToJSON=l=>Yh(x.isHTMLForm(l)?new FormData(l):l);Qe.getAdapter=Jh.getAdapter;Qe.HttpStatusCode=pr;Qe.default=Qe;const{Axios:y2,AxiosError:p2,CanceledError:g2,isCancel:b2,CancelToken:v2,VERSION:S2,all:_2,Cancel:x2,isAxiosError:E2,spread:A2,toFormData:T2,AxiosHeaders:O2,HttpStatusCode:N2,formToJSON:R2,getAdapter:w2,mergeConfig:z2,create:j2}=Qe,Qa=Qe.create({baseURL:"",timeout:3e4,headers:{"Content-Type":"application/json"}});Qa.interceptors.request.use(l=>{const s=localStorage.getItem("auth_token");return s&&(l.headers.Authorization=`Bearer ${s}`),typeof FormData<"u"&&l.data instanceof FormData&&delete l.headers["Content-Type"],l},l=>Promise.reject(l));Qa.interceptors.response.use(l=>l,l=>{var s;if(((s=l.response)==null?void 0:s.status)===401){localStorage.removeItem("auth_token");try{window.dispatchEvent(new Event("auth:logout"))}catch{}}return Promise.reject(l)});const ee=async(l,s,c)=>(await Qa.get(l,{params:s,...c})).data,ne=async(l,s,c)=>(await Qa.post(l,s,c)).data,De=async(l,s,c)=>(await Qa.put(l,s,c)).data,vv=async(l,s,c)=>(await Qa.patch(l,s,c)).data,tt=async(l,s)=>(await Qa.delete(l,s)).data,Sv=async l=>ne("/login",l),_v=async()=>ee("/system-settings/public"),xv=async(l,s)=>De("/profile",{new_username:l,current_password:s}),Ev=async l=>ne("/register",l),Av=async(l,s="register",c)=>ne("/send-verification-code",{email:l,type:s,captcha_session_id:c==null?void 0:c.session_id,captcha_code:c==null?void 0:c.code}),Tv=async l=>ne("/generate-captcha",{session_id:l}),Ov=async()=>ee("/verify"),Nv=async(l,s)=>ne("/change-password",{current_password:l,new_password:s}),D2=async()=>(await ee("/cookies/details")).map(s=>({id:s.id,value:s.value,cookie:s.value,enabled:s.enabled,auto_confirm:s.auto_confirm,remark:s.remark,note:s.remark,pause_duration:s.pause_duration,username:s.username,login_password:s.login_password,show_browser:s.show_browser,nickname:s.nickname||s.remark||s.username||`账号 ${s.id.substring(0,6)}`,avatar_url:s.avatar_url,location:s.location,bio:s.bio,followers:s.followers,following:s.following,profile_updated_at:s.profile_updated_at,runtime_state:s.runtime_state,login_info:s.login_info,ai_enabled:!1})),C2=async l=>ne(`/cookies/${l}/refresh-profile`),M2=async()=>ne("/qr-login/generate"),U2=async l=>ee(`/qr-login/check/${l}`),q2=async(l,s)=>De(`/cookies/${l}/status`,{enabled:s}),B2=async l=>tt(`/cookies/${l}`),H2=async(l,s)=>De(`/cookies/${l}/remark`,{remark:s}),L2=async(l,s)=>De(`/cookies/${l}/auto-confirm`,{auto_confirm:s}),k2=async(l,s)=>De(`/cookies/${l}/pause-duration`,{pause_duration:s}),Y2=async(l,s)=>De(`/cookies/${l}`,{id:l,value:s}),V2=async(l,s)=>De(`/cookies/${l}/login-info`,s),X2=async()=>ee("/ai-reply-settings"),Rv=l=>{const s=(l==null?void 0:l.order_status)||(l==null?void 0:l.status)||"processing";return{...l,status:s,order_status:s}},G2=async(l,s,c=1,r=20)=>{const f={page:c,page_size:r};l&&(f.cookie_id=l),s&&s!=="all"&&(f.status=s);const m=await ee("/api/orders",f),y=(m.orders||m.data||[]).map(Rv);return{success:!0,data:y,total:m.total||y.length,page:m.page||c,page_size:m.page_size||r,total_pages:m.total_pages||1,status_counts:m.status_counts}},Q2=async(l,s)=>De(`/api/orders/${l}`,s),Z2=async(l,s)=>De(`/api/orders/${l}/note`,{note:s}),K2=async l=>tt(`/api/orders/${l}`),J2=async(l,s)=>{const c=new FormData,r=localStorage.getItem("auth_token");return(await fetch("/api/orders/refresh",{method:"POST",headers:{Authorization:`Bearer ${r}`},body:c})).json()},$2=async l=>ne(`/api/orders/${l}/refresh`),F2=async(l,s,c)=>ne("/api/orders/manual-ship",{order_ids:l,ship_mode:s,custom_content:c}),W2=async l=>{const s=l instanceof FormData;return(await fetch("/api/orders/import",{method:"POST",headers:{...s?{}:{"Content-Type":"application/json"},Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:s?l:JSON.stringify(l)})).json()},wv=l=>{if(!l)return"";const s=l.match(/filename\*=UTF-8''([^;\s]+)/i);if(s)try{return decodeURIComponent(s[1])}catch{return s[1]}const c=l.match(/filename\s*=\s*"?([^";]+)"?/i);return c?c[1].trim():""},I2=async l=>{var v;const s={};l.cookie_id&&(s.cookie_id=l.cookie_id),l.status&&l.status!=="all"&&(s.status=l.status);const c=await Qa.get("/api/orders/export",{params:s,responseType:"blob"}),r=c.data;if(!(r instanceof Blob)||r.size===0)throw new Error("导出失败:服务器未返回有效文件");if(r.type.includes("application/json")){let g="导出失败";try{const A=JSON.parse(await r.text());g=(A==null?void 0:A.message)||g}catch{}throw new Error(g)}const f=wv((v=c.headers)==null?void 0:v["content-disposition"]),m=/\.csv$/i.test(f)?f:`orders_${Date.now()}.csv`,y=URL.createObjectURL(r),p=document.createElement("a");return p.href=y,p.download=m,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(y),m},P2=async(l,s=7)=>{const c=new FormData;return c.append("days",String(s)),(await fetch("/api/orders/sync-sold",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:c})).json()},eS=async(l=!1)=>(await ee("/quick-phrases",{include_disabled:l})).data||[],tS=async(l,s,c="默认",r=0)=>{const f=new FormData;return f.append("title",l),f.append("content",s),f.append("category",c),f.append("sort_order",String(r)),(await fetch("/quick-phrases",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:f})).json()},aS=async(l,s)=>{const c=new FormData;return Object.entries(s).forEach(([f,m])=>{m!=null&&c.append(f,String(m))}),(await fetch(`/quick-phrases/${l}`,{method:"PUT",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:c})).json()},nS=async l=>tt(`/quick-phrases/${l}`),lS=async l=>ne(`/quick-phrases/${l}/use`),uS=async()=>ee("/api/risk-control/status"),iS=async l=>ne(`/api/risk-control/${encodeURIComponent(l)}/fresh-captcha-url`),sS=async(l,s=300)=>{const c=new FormData;return c.append("cookie_id",l),c.append("timeout",String(s)),ne("/api/captcha/manual-session",c,{timeout:(s+30)*1e3})},cS=async(l,s)=>{const c=new FormData;return l&&c.append("cookie_id",l),(await fetch("/api/items/polish",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:c})).json()},rS=async l=>ne(`/api/orders/${l}/require-flower`),oS=async()=>ee("/api/seller-features"),fS=async(l,s)=>De(`/api/seller-features/${l}`,s),dS=async(l,s,c=1,r=!1)=>{const f=new FormData;return f.append("order_ids",l.join(",")),f.append("feedback",s),f.append("rate",String(c)),f.append("anonymous",String(r)),(await fetch("/api/orders/rate",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("auth_token")}`},body:f})).json()},mS=async()=>ee("/admin/stats"),hS=async()=>(await ee("/admin/users")).users||[],yS=async(l,s)=>vv(`/admin/users/${l}/status`,{is_active:s}),pS=async(l,s)=>De(`/admin/users/${l}/password`,{new_password:s}),gS=async l=>tt(`/admin/users/${l}`),bS=async(l=7)=>{let s;if(typeof l=="number"){const c=new Date,r=new Date;r.setDate(r.getDate()-l),s={start_date:r.toISOString().split("T")[0],end_date:c.toISOString().split("T")[0]}}else s=l;return ee("/analytics/orders",s)},vS=async l=>(await ee("/analytics/orders/valid",{start_date:l.start_date,end_date:l.end_date})).orders||[],SS=async()=>{const l=await ee("/cards");return Array.isArray(l)?l:l.cards||[]},_S=async l=>ne("/cards",l),xS=async(l,s)=>De(`/cards/${l}`,s),ES=async l=>tt(`/cards/${l}`),AS=async(l=200)=>{const s=await ee("/cards/shipped",{limit:l});return{total:s.total||0,shipments:s.shipments||[]}},TS=async()=>tt("/cards/shipped"),OS=async l=>{const s=new FormData;return s.append("image",l),ne("/upload-image",s)},NS=async()=>{const l=await ee("/items");return Array.isArray(l)?l:l.items||[]},RS=async(l,s,c=1)=>ee(`/items/xyh-list?cookie_id=${encodeURIComponent(l)}&group_name=${encodeURIComponent(s)}&page=${c}`),wS=async l=>ne("/items/get-all-from-account",{cookie_id:l}),zS=async l=>ne("/items",l),jS=async(l,s)=>tt(`/items/${l}/${s}`),DS=async(l,s,c)=>De(`/items/${l}/${s}`,{item_detail:c}),CS=async(l,s,c)=>De(`/items/${l}/${s}/multi-quantity-delivery`,{multi_quantity_delivery:c}),MS=async()=>(await ee("/item-delivery-configs")).configs||[],US=async(l,s)=>ee(`/items/${encodeURIComponent(l)}/${encodeURIComponent(s)}/delivery-config`),qS=async(l,s,c)=>De(`/items/${encodeURIComponent(l)}/${encodeURIComponent(s)}/delivery-config`,c),Wh=l=>({options:l.options||[],detection_status:l.detection_status||"ok",retry_after_seconds:l.retry_after_seconds,warning:l.warning}),BS=async(l,s)=>{const c=await ee(`/api/anti-abuse/sku-options/${encodeURIComponent(s)}`,{cookie_id:l});return Wh(c)},HS=async(l,s)=>{const c=await ee(`/api/anti-abuse/sku-options/${encodeURIComponent(s)}/buyer-test`,{cookie_id:l});return Wh(c)},LS=async l=>(await ee("/product-automation/materials",void 0)).data||[],kS=async(l,s)=>(await De(`/product-automation/materials/${l}`,s)).data,YS=async l=>{await tt(`/product-automation/materials/${l}`)},VS=async()=>(await ee("/product-automation/filter-rules")).data||[],XS=async l=>(l.id?await De(`/product-automation/filter-rules/${l.id}`,l):await ne("/product-automation/filter-rules",l)).data,GS=async l=>{await tt(`/product-automation/filter-rules/${l}`)},QS=async l=>(await ne(`/product-automation/filter-rules/${l}/run`,{})).data,ZS=async()=>(await ee("/product-automation/delete-rules")).data||[],KS=async l=>(l.id?await De(`/product-automation/delete-rules/${l.id}`,l):await ne("/product-automation/delete-rules",l)).data,JS=async l=>{await tt(`/product-automation/delete-rules/${l}`)},$S=async l=>(await ne(`/product-automation/delete-rules/${l}/preview`,{})).data,FS=async(l=50)=>(await ee("/product-automation/runs",{limit:l})).data||[],Nr=async l=>(await ne(l,{})).data,WS=()=>Nr("/product-automation/repairs/published-ids"),IS=()=>Nr("/product-automation/repairs/short-links"),PS=()=>Nr("/product-automation/repairs/cards"),e_=async()=>{const l=await ee("/delivery-rules");return(Array.isArray(l)?l:l.data||l.rules||[]).map(c=>({id:String(c.id),name:c.description||c.keyword||"",item_keyword:c.keyword||"",cookie_id:c.cookie_id||void 0,item_id:c.item_id||void 0,item_title:c.item_title||void 0,card_group_id:c.card_id||0,card_group_name:c.card_name||"",priority:c.delivery_count||1,enabled:!!c.enabled,delivery_times:c.delivery_times||0}))},t_=async l=>{const s={keyword:l.item_keyword,card_id:l.card_group_id,delivery_count:l.priority,enabled:l.enabled??!0,description:l.name,cookie_id:l.cookie_id||null,item_id:l.item_id||null};return l.id?De(`/delivery-rules/${l.id}`,s):ne("/delivery-rules",s)},a_=async l=>tt(`/delivery-rules/${l}`),n_=async l=>(await ee(`/delivery-block-rules/${l}`)).rules,l_=async(l,s,c)=>(await De(`/delivery-block-rules/${l}/${s}`,c)).rule,u_=async l=>(await ee("/blacklist",l?{cookie_id:l}:void 0)).entries,i_=async l=>(await ne("/blacklist",l)).entry,s_=async(l,s)=>(await De(`/blacklist/${l}`,s)).entry,c_=async l=>{await tt(`/blacklist/${l}`)},r_=async l=>{if(!l)return[];const s=await ee(`/keywords-with-item-id/${l}`);return(Array.isArray(s)?s:[]).map((r,f)=>({id:String(f),keyword:r.keyword||"",reply_content:r.reply||"",item_id:r.item_id||"",match_type:"exact",enabled:!0}))},o_=async(l,s)=>{const c=await ee(`/keywords-with-item-id/${s}`),r=Array.isArray(c)?c:[];if(l.id){const f=parseInt(l.id);f>=0&&f{const c=await ee(`/keywords-with-item-id/${s}`),r=Array.isArray(c)?c:[],f=parseInt(l);return f>=0&&f{const l=await ee("/system-settings");return l.data||l},m_=async l=>{const s=Object.entries(l).map(([c,r])=>De(`/system-settings/${c}`,{value:String(r)}));return await Promise.all(s),{success:!0,message:"Settings saved"}},h_=async l=>ne("/system-settings/email-test",l),y_=async l=>ee(`/ai-reply-settings/${l}`),p_=async(l,s)=>{const c={ai_enabled:s.ai_enabled??!1,model_name:s.model_name??"qwen-plus",api_key:s.api_key??"",base_url:s.base_url??"https://dashscope.aliyuncs.com/compatible-mode/v1",max_discount_percent:s.max_discount_percent??10,max_discount_amount:s.max_discount_amount??100,max_bargain_rounds:s.max_bargain_rounds??3,context_enabled:s.context_enabled??!0,context_message_limit:s.context_message_limit??12,context_expire_minutes:s.context_expire_minutes??120,custom_prompts:s.custom_prompts??""};return De(`/ai-reply-settings/${l}`,c)},g_=async(l,s={})=>{const c=await ne(`/ai-reply-test/${l}`,{message:"你好,这是一条测试消息",...s});return{success:c.success??!0,message:c.message||"AI 连接测试成功",reply:c.reply}},b_=async()=>({success:!0,data:(await ee("/notification-channels")||[]).map(c=>{let r;try{r=JSON.parse(c.config)}catch{r=void 0}return{id:String(c.id),name:c.name,type:c.type,config:r||{},enabled:c.enabled,created_at:c.created_at,updated_at:c.updated_at}})}),v_=async l=>ne("/notification-channels",{...l,config:JSON.stringify(l.config)}),S_=async(l,s)=>{const c={...s};return"config"in s&&(c.config=JSON.stringify(s.config)),De(`/notification-channels/${l}`,c)},__=async l=>tt(`/notification-channels/${l}`),x_=async()=>{const l=await ee("/notification-events");return{success:!0,events:(l==null?void 0:l.events)||[],priorities:(l==null?void 0:l.priorities)||[]}},E_=async()=>{const l=await ee("/message-notifications"),s=[];for(const[c,r]of Object.entries(l||{}))if(Array.isArray(r))for(const f of r)s.push({id:String(f.id),cookie_id:c,channel_id:f.channel_id,channel_name:f.channel_name,channel_type:f.channel_type,channel_enabled:f.channel_enabled!==!1,name:f.name??null,event_types:f.event_types??null,enabled:f.enabled});return{success:!0,data:s}},A_=async(l,s,c,r)=>ne(`/message-notifications/${l}`,{channel_id:s,enabled:c,...r?{name:r.name??"",event_types:r.eventTypes??[]}:{}}),T_=async(l,s)=>{const c={};return s.name!==void 0&&(c.name=s.name),s.eventTypes!==void 0&&(c.event_types=s.eventTypes),s.enabled!==void 0&&(c.enabled=s.enabled),De(`/message-notifications/rule/${l}`,c)},O_=async l=>tt(`/message-notifications/${l}`),N_=async l=>ne(`/message-notifications/rule/${l}/test`),R_=async(l={})=>ee("/risk-control-logs",l),w_=async l=>tt(`/risk-control-logs/${l}`),z_=async(l={})=>ee("/logs",l),j_=async(l={})=>(await ee("/message-filters",l)).data||[],D_=async l=>ne("/message-filters/batch-create",l),C_=async l=>(await De(`/message-filters/${l}/toggle`,{})).data,M_=async l=>{await tt(`/message-filters/${l}`)},U_=async l=>(await ne("/message-filters/batch-delete",{ids:l})).deleted,q_=async()=>(await ee("/chat/accounts")).data||[],B_=async(l,s,c=30)=>(await ee(`/chat/conversations/${encodeURIComponent(l)}`,{cursor:s,limit:c})).data,H_=async(l,s,c,r=50)=>(await ee(`/chat/messages/${encodeURIComponent(l)}/${encodeURIComponent(s)}`,{cursor:c,limit:r})).data,L_=async(l,s)=>ne(`/chat/send/${encodeURIComponent(l)}`,s),k_=async(l,s)=>{const c=new FormData;return c.append("cid",s.cid),c.append("to_user_id",s.to_user_id),c.append("image",s.file),ne(`/chat/send-image/${encodeURIComponent(l)}`,c)},Y_=async()=>ee("/default-replies"),V_=async l=>{const s=await ee(`/default-replies/${l}`);return{cookie_id:l,enabled:s.enabled||!1,reply_content:s.reply_content||"",reply_once:s.reply_once||!1,reply_image_url:s.reply_image_url||""}},X_=async(l,s)=>De(`/default-replies/${l}`,{enabled:s.enabled??!1,reply_content:s.reply_content||"",reply_once:s.reply_once??!1,reply_image_url:s.reply_image_url||""}),G_=async l=>tt(`/default-replies/${l}`),Q_=async l=>ne(`/default-replies/${l}/clear-records`,{}),zv=async(l=!1)=>ee("/api/announcement",l?{force:!0}:void 0),Z_=async(l,s=1,c=20,r="VALID")=>ee("/resell/favorites",{cookie_id:l,page:s,page_size:c,type:r}),K_=async(l,s,c=1,r=20)=>ee("/resell/search",{cookie_id:l,keyword:s,page:c,page_size:r}),J_=async()=>ee("/hotlist"),$_=async l=>ne("/hotlist/refresh",{category:l}),F_=async l=>ne("/resell/preview",l),W_=async()=>ee("/pricewatch/rules"),I_=async l=>ne("/pricewatch/rules",l),P_=async(l,s)=>De(`/pricewatch/rules/${l}`,s),ex=async l=>tt(`/pricewatch/rules/${l}`),tx=async l=>ne("/pricewatch/preview",l),ax=async l=>ne(`/pricewatch/rules/${l}/run`),nx=async(l,s=50)=>ee(`/pricewatch/rules/${l}/records`,{limit:s}),lx=async()=>ee("/pricewatch/cookies"),ux=async l=>ne("/resell/publish",l),ix=async l=>{const s=new FormData;return s.append("file",l),ne("/resell/upload-image",s,{timeout:6e4})},sx=async l=>ne("/resell/ai-optimize",l,{timeout:15e4}),cx=async l=>ne("/ai-optimize/preview",{cookie_id:l},{timeout:15e3}),rx=async l=>ne("/ai-optimize/suggest",{cookie_id:l},{timeout:36e4}),ox=async l=>ee("/peer-shops",{cookie_id:l}),fx=async l=>ne("/peer-shops/refresh",{cookie_id:l}),dx=async l=>ne("/peer-shops/ai-analyze",{cookie_id:l},{timeout:36e4}),gr="app:feedback",br="app:confirm",jv=l=>/失败|错误|异常|无法|error|fail/i.test(l)?"error":/警告|注意|请输入|请选择|warning/i.test(l)?"warning":/成功|完成|已新增|已保存|已删除|success/i.test(l)?"success":"info",il=(l,s)=>{const c=String(l??"").trim();c&&window.dispatchEvent(new CustomEvent(gr,{detail:{id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,message:c,type:s||jv(c)}}))},mx=(l,s={})=>new Promise(c=>{window.dispatchEvent(new CustomEvent(br,{detail:{message:l,title:s.title||"确认操作",confirmLabel:s.confirmLabel||"确认",cancelLabel:s.cancelLabel||"取消",danger:s.danger??!0,resolve:c}}))}),Dv=/^[A-Za-z0-9_-]{3,32}$/,Cv=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,Mv=72;function Ih(l){return l?Dv.test(l)?[!0,""]:[!1,"用户名需为 3-32 位字母、数字、下划线或连字符"]:[!1,"用户名不能为空"]}function Uv(l){return l?l.length>254?[!1,"邮箱地址过长"]:Cv.test(l)?[!0,""]:[!1,"邮箱格式不正确"]:[!1,"邮箱不能为空"]}function Ph(l){if(!l)return[!1,"密码不能为空"];if(l.length<8)return[!1,"密码至少 8 位,且需同时包含字母和数字"];if(l.length>64)return[!1,"密码最长 64 位"];if(new TextEncoder().encode(l).length>Mv)return[!1,"密码过长(超过 72 字节),请缩短后重试"];const s=/[a-zA-Z]/.test(l),c=/\d/.test(l);return!s||!c?[!1,"密码至少 8 位,且需同时包含字母和数字"]:[!0,""]}const qv=({activeTab:l,setActiveTab:s,onLogout:c,mobileOpen:r,onMobileClose:f,isAdmin:m=!1,username:y,onUsernameChange:p})=>{const[v,g]=q.useState(!1),[A,N]=q.useState(null),B=q.useRef(null),F=X=>m||!["settings","users"].includes(X.id);q.useEffect(()=>{if(!v)return;const X=Y=>{B.current&&!B.current.contains(Y.target)&&g(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[v]);const W=[{label:"经营概览",items:[{id:"dashboard",icon:h1,label:"总览"}]},{label:"闲鱼业务",items:[{id:"accounts",icon:tg,label:"账号管理"},{id:"items",icon:$p,label:"商品与发货"},{id:"resell",icon:X1,label:"一键转卖"},{id:"hotlist",icon:o1,label:"实时热卖榜"},{id:"peershops",icon:Wp,label:"同行热卖店铺"},{id:"pricewatch",icon:K1,label:"价格监控"},{id:"orders",icon:L1,label:"订单管理"},{id:"buyer-interaction",icon:Y1,label:"买家互动"},{id:"cards",icon:l1,label:"卡密库存"}]},{label:"客户沟通",items:[{id:"messages",icon:p1,label:"消息中心"},{id:"auto-reply",icon:R1,label:"自动回复"},{id:"ai-reply",icon:Kp,label:"AI 回复"}]},{label:"自动化",items:[{id:"product-automation",icon:ng,label:"商品自动化"}]},{label:"系统",items:[{id:"help",icon:Qp,label:"使用说明"},{id:"users",icon:F1,label:"用户管理"},{id:"notifications",icon:Xp,label:"通知与日志"},{id:"settings",icon:q1,label:"系统设置"},{id:"about",icon:bh,label:"关于"}].filter(F)}];return h.jsxs(h.Fragment,{children:[r&&h.jsx("button",{type:"button",className:"fixed inset-0 z-30 bg-black/40 lg:hidden",onClick:f,"aria-label":"关闭导航"}),h.jsxs("aside",{className:`fixed left-0 top-0 z-40 flex h-screen w-[248px] flex-col bg-[var(--surface)] transition-transform lg:translate-x-0 ${r?"translate-x-0":"-translate-x-full"}`,style:{borderRight:"1px solid var(--border)"},children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs("div",{className:"flex h-[76px] shrink-0 items-center gap-3 px-5",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl",style:{background:"linear-gradient(140deg, var(--brand-300), var(--brand))",boxShadow:"var(--shadow-brand)"},children:h.jsx("span",{className:"text-lg font-black text-[#2a2416]",children:"躺"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-base font-extrabold text-[var(--text)]",children:"躺赚鱼"}),h.jsx("p",{className:"mt-0.5 text-[11px] font-medium text-[var(--text-soft)]",children:"运营工作台"})]}),h.jsx("button",{type:"button",onClick:f,className:"rounded-full p-2 hover:bg-[var(--surface-hover)] lg:hidden","aria-label":"关闭导航",children:h.jsx(_h,{className:"w-5 h-5"})})]}),h.jsx("nav",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-4",children:W.map((X,Y)=>h.jsxs("div",{className:Y===0?"":"mt-5",children:[h.jsx("p",{className:"mb-2 px-3 text-[11px] font-bold uppercase tracking-wide text-[var(--text-soft)]",children:X.label}),h.jsx("div",{className:"space-y-1",children:X.items.map(C=>{const K=C.icon,Q=l===C.id;return h.jsxs("button",{type:"button",onClick:()=>s(C.id),className:`group flex min-h-11 w-full items-center gap-3 rounded-xl px-3 text-left transition-all ${Q?"font-bold text-[#2a2416]":"font-medium text-[var(--text-muted)] hover:bg-[var(--surface-hover)] hover:text-[var(--text)]"}`,style:Q?{background:"linear-gradient(135deg, var(--brand-300), var(--brand))",boxShadow:"var(--shadow-brand)"}:void 0,children:[h.jsx(K,{className:`h-[18px] w-[18px] shrink-0 ${Q?"text-[#2a2416]":"text-[var(--text-soft)] group-hover:text-[var(--text-muted)]"}`}),h.jsx("span",{className:"truncate text-sm",children:C.label})]},C.id)})})]},X.label))})]}),h.jsxs("div",{className:"shrink-0 p-3",style:{borderTop:"1px solid var(--border)"},children:[h.jsx(dr,{className:"mb-2"}),h.jsxs("div",{className:"relative",ref:B,children:[h.jsxs("button",{type:"button",onClick:()=>g(X=>!X),"aria-expanded":v,"aria-haspopup":"menu",className:"flex min-h-11 w-full items-center gap-3 rounded-xl px-3 text-left transition-colors hover:bg-[var(--surface-hover)]",children:[h.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-black text-[#2a2416]",style:{background:"linear-gradient(140deg, var(--brand-300), var(--brand))"},children:(y||"?").slice(0,1).toUpperCase()}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-semibold text-[var(--text)]",children:y||"未登录"}),h.jsx("span",{className:"block text-[11px] font-medium text-[var(--text-soft)]",children:m?"管理员":"用户"})]}),h.jsx(Pp,{className:`h-4 w-4 shrink-0 text-[var(--text-soft)] transition-transform ${v?"":"rotate-180"}`})]}),v&&h.jsxs("div",{role:"menu",className:"absolute bottom-full left-0 right-0 mb-2 space-y-0.5 rounded-xl border bg-[var(--surface)] p-1.5 shadow-[var(--shadow-card,0_8px_24px_rgba(20,24,28,0.16))]",style:{borderColor:"var(--border)"},children:[!m&&h.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{g(!1),N("rename")},className:"flex min-h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-sm font-medium text-[var(--text-muted)] transition-colors hover:bg-[var(--surface-hover)] hover:text-[var(--text)]",children:[h.jsx(I1,{className:"h-4 w-4 shrink-0"}),"修改用户名"]}),h.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{g(!1),N("password")},className:"flex min-h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-sm font-medium text-[var(--text-muted)] transition-colors hover:bg-[var(--surface-hover)] hover:text-[var(--text)]",children:[h.jsx(vh,{className:"h-4 w-4 shrink-0"}),"修改密码"]}),h.jsx("div",{className:"my-1",style:{borderTop:"1px solid var(--border)"}}),h.jsxs("button",{type:"button",role:"menuitem",onClick:c,className:"flex min-h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-sm font-medium text-[var(--text-muted)] transition-colors hover:bg-[var(--danger-soft)] hover:text-[var(--danger)]",children:[h.jsx(S1,{className:"h-4 w-4 shrink-0"}),"退出登录"]})]})]})]}),A&&Up.createPortal(h.jsx(Bv,{mode:A,isAdmin:m,onClose:()=>N(null),onRenamed:X=>{N(null),p==null||p(X)}}),document.body)]})]})},Bv=({mode:l,isAdmin:s,onClose:c,onRenamed:r})=>{const[f,m]=q.useState(""),[y,p]=q.useState(""),[v,g]=q.useState(""),[A,N]=q.useState(!1),B=l==="rename",F=async X=>{X.preventDefault();const Y=y.trim();if(B){if(!Ih(Y)){il("用户名需 3-32 位,仅限字母、数字、下划线或短横线","warning");return}}else{if(!Ph(Y)){il("新密码至少 8 位,且同时包含字母和数字","warning");return}if(Y!==v){il("两次输入的新密码不一致","warning");return}}N(!0);try{const C=B?await xv(Y,f):await Nv(f,Y);C.success?(il(B?"用户名修改成功":"密码修改成功,下次登录请使用新密码","success"),B?r(Y):c()):il(C.message||"修改失败,请稍后重试","error")}catch{il("网络异常,修改失败","error")}finally{N(!1)}},W="ios-input h-11 w-full rounded-md px-4 text-sm";return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:A?void 0:c,children:h.jsxs("form",{className:"w-full max-w-sm rounded-2xl bg-[var(--surface)] p-6 shadow-[0_12px_40px_rgba(20,24,28,0.24)]",onClick:X=>X.stopPropagation(),onSubmit:X=>void F(X),children:[h.jsx("h3",{className:"text-base font-extrabold text-[var(--text)]",children:B?"修改用户名":"修改密码"}),h.jsx("p",{className:"mt-1 text-xs text-[var(--text-soft)]",children:B?"用户名是登录凭证,修改后请用新用户名登录":"修改成功后当前登录保持有效"}),h.jsxs("label",{className:"mt-4 block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-[var(--text-muted)]",children:"当前密码"}),h.jsx("input",{type:"password",autoComplete:"current-password",value:f,onChange:X=>m(X.target.value),className:W,placeholder:"请输入当前密码",disabled:A})]}),h.jsxs("label",{className:"mt-3 block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-[var(--text-muted)]",children:B?"新用户名":"新密码"}),h.jsx("input",{type:B?"text":"password",autoComplete:B?"username":"new-password",value:y,onChange:X=>p(X.target.value),className:W,placeholder:B?"3-32 位字母/数字/下划线/短横线":"至少 8 位,含字母和数字",disabled:A})]}),!B&&h.jsxs("label",{className:"mt-3 block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-[var(--text-muted)]",children:"确认新密码"}),h.jsx("input",{type:"password",autoComplete:"new-password",value:v,onChange:X=>g(X.target.value),className:W,placeholder:"再次输入新密码",disabled:A})]}),h.jsxs("div",{className:"mt-6 flex gap-3",children:[h.jsx("button",{type:"button",onClick:c,disabled:A,className:"ios-btn-secondary h-11 flex-1 rounded-md text-sm font-bold",children:"取消"}),h.jsx("button",{type:"submit",disabled:A||!f||!y.trim(),className:"ios-btn-primary h-11 flex-1 rounded-md text-sm font-bold disabled:opacity-60",children:A?h.jsx(su,{className:"mx-auto h-4 w-4 animate-spin"}):"确认修改"})]})]})})},Hv={success:{icon:or,className:"border-emerald-200 bg-emerald-50 text-emerald-800"},error:{icon:t1,className:"border-red-200 bg-red-50 text-red-800"},warning:{icon:Sh,className:"border-amber-200 bg-amber-50 text-amber-900"},info:{icon:bh,className:"border-gray-200 bg-white text-gray-800"}},Lv=()=>{const[l,s]=q.useState([]),[c,r]=q.useState(null);q.useEffect(()=>{const m=p=>{const v=p.detail;s(g=>[...g.slice(-3),v]),window.setTimeout(()=>{s(g=>g.filter(A=>A.id!==v.id))},v.type==="error"?6e3:3600)},y=p=>{r(p.detail)};return window.addEventListener(gr,m),window.addEventListener(br,y),()=>{window.removeEventListener(gr,m),window.removeEventListener(br,y)}},[]),q.useEffect(()=>{if(!c)return;const m=y=>{y.key==="Escape"&&(c.resolve(!1),r(null))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[c]);const f=m=>{c==null||c.resolve(m),r(null)};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed right-4 top-4 z-[10000] flex w-[min(380px,calc(100vw-2rem))] flex-col gap-2","aria-live":"polite",children:l.map(m=>{const y=Hv[m.type],p=y.icon;return h.jsxs("div",{role:m.type==="error"?"alert":"status",className:`flex items-start gap-3 rounded-md border px-4 py-3 shadow-[0_4px_16px_rgba(20,24,28,0.10)] ${y.className}`,children:[h.jsx(p,{className:"mt-0.5 h-5 w-5 shrink-0"}),h.jsx("span",{className:"min-w-0 flex-1 break-words text-sm font-medium",children:m.message}),h.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 hover:bg-black/5",onClick:()=>s(v=>v.filter(g=>g.id!==m.id)),"aria-label":"关闭提示",children:h.jsx(_h,{className:"h-4 w-4"})})]},m.id)})}),c&&h.jsx("div",{className:"modal-overlay",role:"presentation",onMouseDown:m=>{m.target===m.currentTarget&&f(!1)},children:h.jsxs("div",{role:"alertdialog","aria-modal":"true","aria-labelledby":"global-confirm-title","aria-describedby":"global-confirm-message",className:"modal-container max-w-md",children:[h.jsxs("div",{className:"modal-body flex items-start gap-3",children:[h.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-amber-50 text-amber-700",children:h.jsx(Sh,{className:"h-5 w-5"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"global-confirm-title",className:"text-base font-bold text-gray-900",children:c.title}),h.jsx("p",{id:"global-confirm-message",className:"mt-1 break-words text-sm leading-6 text-gray-600",children:c.message})]})]}),h.jsxs("div",{className:"modal-footer flex justify-end gap-2",children:[h.jsx("button",{type:"button",className:"ios-btn-secondary rounded-md px-4 py-2 text-sm",onClick:()=>f(!1),children:c.cancelLabel}),h.jsx("button",{type:"button",className:`${c.danger?"ios-btn-danger":"ios-btn-primary"} rounded-md px-4 py-2 text-sm`,onClick:()=>f(!0),autoFocus:!0,children:c.confirmLabel})]})]})})]})},kv={info:"border-[#ffe566] bg-[#fffdf0] text-[#6b5200]",warning:"border-[#f5c800] bg-[#fff7e6] text-[#8a6300]",danger:"border-red-200 bg-red-50 text-red-700"},oh={info:"bg-[#ffe100] text-[#2a2416]",warning:"bg-[#f5c800] text-[#2a2416]",danger:"bg-red-600 text-white"},Yv=()=>{const[l,s]=q.useState(null);q.useEffect(()=>{const y=()=>{zv().then(s).catch(()=>{})};y();const p=setInterval(y,3e5);return()=>clearInterval(p)},[]);const c=(l==null?void 0:l.announcements)||[],r=!!(l!=null&&l.has_update);if(!c.length&&!r)return null;const f=c.some(y=>y.level==="danger")?"danger":c.some(y=>y.level==="warning")?"warning":"info",m=c.map(y=>h.jsxs("span",{className:"inline-flex items-center gap-2 px-8",children:[h.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-bold ${oh[y.level]||oh.info}`,children:y.level==="danger"?"重要":y.level==="warning"?"注意":"通知"}),y.title&&h.jsx("b",{className:"font-bold",children:y.title}),h.jsx("span",{children:y.content.replace(/\s*\n\s*/g," ")}),y.published_at&&h.jsx("span",{className:"text-[11px] opacity-60",children:y.published_at})]},y.id));return h.jsxs("div",{className:"mx-auto max-w-[1320px] space-y-2 px-4 pt-4 sm:px-6 lg:px-8",children:[r&&h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-amber-200 bg-amber-50 px-4 py-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("p",{className:"text-sm font-bold text-amber-900",children:["发现新版本 ",l==null?void 0:l.latest_version,h.jsxs("span",{className:"ml-2 font-normal text-amber-700",children:["当前 ",l==null?void 0:l.local_version]})]}),(l==null?void 0:l.release_notes)&&h.jsx("p",{className:"mt-1 whitespace-pre-wrap text-xs leading-relaxed text-amber-800",children:l.release_notes})]}),(l==null?void 0:l.download_url)&&h.jsxs("a",{href:l.download_url,target:"_blank",rel:"noopener noreferrer",className:"ios-btn-primary inline-flex flex-none items-center gap-2 rounded-md px-3 py-2 text-xs",children:[h.jsx(i1,{className:"h-4 w-4"}),"前往下载",h.jsx(c1,{className:"h-3 w-3"})]})]}),c.length>0&&h.jsxs("div",{className:`flex items-center gap-3 overflow-hidden rounded-md border px-3 py-2 ${kv[f]}`,children:[h.jsx(A1,{className:"h-4 w-4 flex-none"}),h.jsx("div",{className:"marquee min-w-0 flex-1",children:h.jsxs("div",{className:"marquee__track text-xs leading-relaxed",children:[m,h.jsx("span",{"aria-hidden":"true",children:m})]})})]})]})},fh=({image:l,code:s,onCodeChange:c,onRefresh:r,label:f="图形验证码"})=>h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:f}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",placeholder:"请输入图中字符",value:s,onChange:m=>c(m.target.value),maxLength:4,autoComplete:"off",className:"ios-input h-11 w-full rounded-md px-4 text-sm uppercase"}),l?h.jsx("img",{src:l,alt:"图形验证码,点击换一张",title:"看不清?点击换一张",onClick:r,className:"h-11 w-28 shrink-0 cursor-pointer rounded-md border border-gray-200 bg-white"}):h.jsx("button",{type:"button",onClick:r,className:"h-11 w-28 shrink-0 rounded-md border border-gray-200 bg-gray-50 text-xs text-gray-500",children:"点击获取"}),h.jsx("button",{type:"button",onClick:r,"aria-label":"刷新图形验证码",className:"ios-btn-secondary h-11 shrink-0 rounded-md px-2",children:h.jsx(M1,{className:"h-4 w-4"})})]})]});function dh(l=!1){const[s,c]=q.useState(()=>mh()),[r,f]=q.useState(""),[m,y]=q.useState(""),[p,v]=q.useState(!1),g=q.useCallback(async()=>{const A=mh();c(A),y("");try{const N=await Tv(A);N.success&&f(N.captcha_image)}catch{}},[]);return q.useEffect(()=>{l&&g()},[]),{sessionId:s,image:r,code:m,setCode:y,required:p,setRequired:v,refresh:g}}function mh(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`sess-${Date.now()}-${Math.random().toString(36).slice(2)}`}const Vv=q.lazy(()=>Ie(()=>import("./Dashboard-r6bLPRiz.js"),__vite__mapDeps([0,1,2,3,4,5]))),Xv=q.lazy(()=>Ie(()=>import("./AccountList-jdp7_cFb.js"),__vite__mapDeps([6,1,7,8,9,10,11,12,13,14]))),Gv=q.lazy(()=>Ie(()=>import("./OrderList-CMlmoGwo.js"),__vite__mapDeps([15,1,16,17,18,5,19,13,20,10,21,14]))),Qv=q.lazy(()=>Ie(()=>import("./CardList-BeNoktSc.js"),__vite__mapDeps([22,1,16,20,10,2,14,23,5]))),Zv=q.lazy(()=>Ie(()=>import("./ItemList-Du75o4x-.js"),__vite__mapDeps([24,1,25,14,10,16,26,9,5,8,27,20]))),Kv=q.lazy(()=>Ie(()=>import("./ProductAutomation-BTRBUe6v.js"),__vite__mapDeps([28,1,18,10,14,29,5,30]))),Jv=q.lazy(()=>Ie(()=>import("./AIReply-Dsfaod73.js"),__vite__mapDeps([31,1,14,32,12,13,29]))),$v=q.lazy(()=>Ie(()=>import("./Settings-CgkuCQg8.js"),__vite__mapDeps([33,1,14,8,34,12,13]))),Fv=q.lazy(()=>Ie(()=>import("./Keywords-BPlwSBj7.js"),__vite__mapDeps([35,1,17,11,16,9,10,26,14,8]))),Wv=q.lazy(()=>Ie(()=>import("./MessageManagement-CJJfjP2Z.js"),__vite__mapDeps([36,1,27,18,2,23,34,37,16,10]))),Iv=q.lazy(()=>Ie(()=>import("./NotificationsAndLogs-DX1qmLDY.js"),__vite__mapDeps([38,1,30,25,4,16,39,10,37,21,14,7]))),Pv=q.lazy(()=>Ie(()=>import("./UserManagement-93cH0Rs5.js"),__vite__mapDeps([40,1,10]))),e2=q.lazy(()=>Ie(()=>import("./About-DH_fUK9S.js"),__vite__mapDeps([41,1]))),t2=q.lazy(()=>Ie(()=>import("./BuyerInteraction-0rmlMue9.js"),__vite__mapDeps([42,1,14,25,19,32]))),a2=q.lazy(()=>Ie(()=>import("./Resell-eqQKBhXl.js"),__vite__mapDeps([43,1,18,16,8,2]))),n2=q.lazy(()=>Ie(()=>import("./HotList-DMnVJNpG.js"),__vite__mapDeps([44,1,3,2]))),l2=q.lazy(()=>Ie(()=>import("./PeerShops-Iz71xL1V.js"),__vite__mapDeps([45,1,8,2,18,3]))),u2=q.lazy(()=>Ie(()=>import("./PriceWatch-B4ja8BGi.js"),__vite__mapDeps([46,1,16,29,39,10,18]))),i2=q.lazy(()=>Ie(()=>import("./Help-cncF4wHf.js"),[])),We=()=>h.jsxs("div",{className:"page-loading",children:[h.jsx(su,{className:"h-5 w-5 animate-spin"}),h.jsx("span",{children:"正在加载页面"})]}),s2={dashboard:"总览",accounts:"账号管理",items:"商品与发货",resell:"一键转卖",hotlist:"实时热卖榜",peershops:"同行热卖店铺",pricewatch:"价格监控",orders:"订单管理","buyer-interaction":"买家互动",cards:"卡密库存",messages:"消息中心","auto-reply":"自动回复","ai-reply":"AI 回复","product-automation":"商品自动化",notifications:"通知与日志",settings:"系统设置",users:"用户管理",about:"关于",help:"使用说明"},c2=["settings","users"],r2=()=>{const[l,s]=q.useState(!1),[c,r]=q.useState(()=>localStorage.getItem("active_page")||"dashboard"),[f,m]=q.useState(!0),[y,p]=q.useState(""),[v,g]=q.useState(""),[A,N]=q.useState(!1),[B,F]=q.useState(""),[W,X]=q.useState(""),[Y,C]=q.useState(!1),[K,Q]=q.useState(!1),[te,Ee]=q.useState("login"),[me,le]=q.useState(!1),[Le,ct]=q.useState(!0),[be,Me]=q.useState({username:"",email:"",password:"",code:""}),[ke,xt]=q.useState(!1),[He,Re]=q.useState(""),[z,L]=q.useState(""),[P,Se]=q.useState(!1),[re,S]=q.useState(0),j=dh(),H=dh();q.useEffect(()=>{te==="register"&&j.refresh()},[te]),q.useEffect(()=>{_v().then(k=>{le(String(k.registration_enabled)==="true"),ct(String(k.email_verification_enabled??"true")!=="false")}).catch(()=>le(!1))},[]),q.useEffect(()=>{if(re<=0)return;const k=setTimeout(()=>S(re-1),1e3);return()=>clearTimeout(k)},[re]);const G=async()=>{if(!be.email.trim()){Re("请先填写邮箱");return}if(!j.code.trim()){Re("请先输入图形验证码");return}Se(!0),Re(""),L("");try{const k=await Av(be.email.trim(),"register",{session_id:j.sessionId,code:j.code.trim()});if((k==null?void 0:k.success)===!1){Re(k.message||"验证码发送失败,请确认邮件服务已配置"),j.refresh();return}L("验证码已发送,请查收邮箱"),S(60),j.refresh()}catch(k){Re(k instanceof Error?k.message:"验证码发送失败"),j.refresh()}finally{Se(!1)}},ue=async k=>{k.preventDefault(),Re(""),L("");for(const[ie,Te]of[Ih(be.username.trim()),Uv(be.email.trim()),Ph(be.password)])if(!ie){Re(Te);return}if(Le&&!be.code.trim()){Re("请填写邮箱验证码");return}xt(!0);try{const ie=await Ev({username:be.username.trim(),email:be.email.trim(),password:be.password,...Le?{verification_code:be.code.trim()}:{}});ie!=null&&ie.success?(p(be.username.trim()),g(""),Me({username:"",email:"",password:"",code:""}),Ee("login"),F(""),L(""),X("注册成功,请使用新账号登录")):Re((ie==null?void 0:ie.message)||"注册失败")}catch(ie){Re(ie instanceof Error?ie.message:"注册失败,请稍后重试")}finally{xt(!1)}};q.useEffect(()=>{localStorage.getItem("auth_token")?Ov().then(Te=>{if(!Te.authenticated){localStorage.removeItem("auth_token");return}Q(!!Te.is_admin),p(Te.username||""),s(!0)}).catch(()=>localStorage.removeItem("auth_token")).finally(()=>m(!1)):m(!1);const ie=()=>s(!1);return window.addEventListener("auth:logout",ie),()=>window.removeEventListener("auth:logout",ie)},[]),q.useEffect(()=>{localStorage.setItem("active_page",c)},[c]),q.useEffect(()=>{!K&&c2.includes(c)&&r("dashboard")},[K]);const Z=async k=>{k.preventDefault(),N(!0),F("");try{const ie=await Sv({username:y,password:v,...H.required?{captcha_session_id:H.sessionId,captcha_code:H.code.trim()}:{}});ie.success&&ie.token?(localStorage.setItem("auth_token",ie.token),Q(!!ie.is_admin),p(ie.username||y),s(!0)):(F(ie.message||"账号或密码错误"),ie.captcha_required&&(H.setRequired(!0),H.refresh()))}catch(ie){F(ie instanceof Error?ie.message:"登录失败,请稍后重试")}finally{N(!1)}};return f?h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[var(--app-bg)]",children:h.jsxs("div",{className:"flex items-center gap-3 text-sm font-semibold text-[var(--text-muted)]",children:[h.jsx(su,{className:"h-5 w-5 animate-spin text-[var(--brand-text)]"}),"正在验证登录状态"]})}):l?h.jsxs("div",{className:"flex min-h-screen bg-[var(--app-bg)] text-[var(--text)]",children:[h.jsx(Lv,{}),h.jsx(qv,{activeTab:c,setActiveTab:k=>{r(k),C(!1)},mobileOpen:Y,onMobileClose:()=>C(!1),isAdmin:K,username:l?y:"",onUsernameChange:p,onLogout:()=>{localStorage.removeItem("auth_token"),Q(!1),s(!1)}}),h.jsxs("main",{className:"min-h-screen min-w-0 flex-1 lg:ml-[248px]",children:[h.jsxs("header",{className:"sticky top-0 z-20 flex h-14 items-center gap-3 border-b border-[var(--border)] bg-[var(--surface)] px-4 lg:hidden",children:[h.jsx("button",{type:"button",onClick:()=>C(!0),className:"p-2 -ml-2 rounded-md hover:bg-gray-100",title:"打开导航","aria-label":"打开导航",children:h.jsx(O1,{className:"w-5 h-5"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"truncate text-sm font-bold",children:s2[c]||"躺赚鱼"}),h.jsx("p",{className:"text-[11px] text-gray-400",children:"躺赚鱼"})]}),h.jsx(dr,{compact:!0,className:"ml-auto"})]}),c!=="messages"&&h.jsx(Yv,{}),h.jsxs("div",{className:c==="messages"?"h-[calc(100vh-3.5rem)] lg:h-screen overflow-hidden":c==="help"?"w-full p-4 pb-10 sm:p-6 lg:p-8":"mx-auto max-w-[1320px] p-4 pb-10 sm:p-6 lg:p-8",children:[h.jsx("section",{hidden:c!=="dashboard",children:h.jsx(q.Suspense,{fallback:c==="dashboard"?h.jsx(We,{}):null,children:h.jsx(Vv,{})})}),h.jsx("section",{hidden:c!=="accounts",children:h.jsx(q.Suspense,{fallback:c==="accounts"?h.jsx(We,{}):null,children:h.jsx(Xv,{})})}),h.jsx("section",{hidden:c!=="items",children:h.jsx(q.Suspense,{fallback:c==="items"?h.jsx(We,{}):null,children:h.jsx(Zv,{})})}),h.jsx("section",{hidden:c!=="resell",children:h.jsx(q.Suspense,{fallback:c==="resell"?h.jsx(We,{}):null,children:h.jsx(a2,{})})}),h.jsx("section",{hidden:c!=="hotlist",children:h.jsx(q.Suspense,{fallback:c==="hotlist"?h.jsx(We,{}):null,children:h.jsx(n2,{})})}),h.jsx("section",{hidden:c!=="peershops",children:h.jsx(q.Suspense,{fallback:c==="peershops"?h.jsx(We,{}):null,children:h.jsx(l2,{})})}),h.jsx("section",{hidden:c!=="pricewatch",children:h.jsx(q.Suspense,{fallback:c==="pricewatch"?h.jsx(We,{}):null,children:h.jsx(u2,{})})}),h.jsx("section",{hidden:c!=="product-automation",children:h.jsx(q.Suspense,{fallback:c==="product-automation"?h.jsx(We,{}):null,children:h.jsx(Kv,{})})}),h.jsx("section",{hidden:c!=="orders",children:h.jsx(q.Suspense,{fallback:c==="orders"?h.jsx(We,{}):null,children:h.jsx(Gv,{})})}),h.jsx("section",{hidden:c!=="cards",children:h.jsx(q.Suspense,{fallback:c==="cards"?h.jsx(We,{}):null,children:h.jsx(Qv,{})})}),h.jsx("section",{hidden:c!=="auto-reply",children:h.jsx(q.Suspense,{fallback:c==="auto-reply"?h.jsx(We,{}):null,children:h.jsx(Fv,{mode:"reply"})})}),h.jsx("section",{hidden:c!=="ai-reply",children:h.jsx(q.Suspense,{fallback:c==="ai-reply"?h.jsx(We,{}):null,children:h.jsx(Jv,{})})}),h.jsx("section",{hidden:c!=="messages",className:"h-full min-h-0",children:h.jsx(q.Suspense,{fallback:c==="messages"?h.jsx(We,{}):null,children:h.jsx(Wv,{isActive:c==="messages"})})}),h.jsx("section",{hidden:c!=="notifications",children:h.jsx(q.Suspense,{fallback:c==="notifications"?h.jsx(We,{}):null,children:h.jsx(Iv,{isAdmin:K})})}),K&&h.jsx("section",{hidden:c!=="users",children:h.jsx(q.Suspense,{fallback:c==="users"?h.jsx(We,{}):null,children:h.jsx(Pv,{})})}),K&&h.jsx("section",{hidden:c!=="settings",children:h.jsx(q.Suspense,{fallback:c==="settings"?h.jsx(We,{}):null,children:h.jsx($v,{})})}),h.jsx("section",{hidden:c!=="buyer-interaction",children:h.jsx(q.Suspense,{fallback:c==="buyer-interaction"?h.jsx(We,{}):null,children:h.jsx(t2,{})})}),h.jsx("section",{hidden:c!=="about",children:h.jsx(q.Suspense,{fallback:c==="about"?h.jsx(We,{}):null,children:h.jsx(e2,{})})}),h.jsx("section",{hidden:c!=="help",children:h.jsx(q.Suspense,{fallback:c==="help"?h.jsx(We,{}):null,children:h.jsx(i2,{})})})]})]})]}):h.jsxs("div",{className:"relative min-h-screen bg-[var(--app-bg)] p-4 font-sans text-[var(--text)] sm:p-6",children:[h.jsx(dr,{compact:!0,className:"absolute right-4 top-4 z-10 sm:right-6 sm:top-6"}),h.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-2rem)] max-w-5xl items-center justify-center sm:min-h-[calc(100vh-3rem)]",children:h.jsxs("div",{className:"grid w-full overflow-hidden rounded-3xl bg-[var(--surface)] lg:grid-cols-[1.05fr_0.95fr]",style:{border:"1px solid var(--border)",boxShadow:"var(--shadow-lg)"},children:[h.jsxs("div",{className:"theme-brand-panel hidden min-h-[560px] flex-col justify-between p-10 lg:flex",style:{background:"linear-gradient(155deg, #fff8d1 0%, #ffe566 55%, #ffe100 100%)"},children:[h.jsxs("div",{children:[h.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl bg-white/70 backdrop-blur",children:h.jsx("span",{className:"text-2xl font-black text-[#2a2416]",children:"躺"})}),h.jsx("p",{className:"mt-7 text-xs font-bold tracking-widest text-[#8a6300]",children:"TANGZHUAN YU"}),h.jsx("h1",{className:"mt-2 max-w-md text-3xl font-extrabold leading-tight text-[#2a2416]",children:"躺赚鱼"}),h.jsx("p",{className:"mt-4 max-w-md text-sm leading-7 text-[#6b5200]",children:"统一处理账号、商品、订单、消息、回复和自动发货。"})]}),h.jsx("div",{className:"grid grid-cols-2 gap-3",children:["账号与商品同步","订单与发货处理","消息与自动回复","通知与运行日志"].map(k=>h.jsx("div",{className:"rounded-2xl bg-white/70 px-4 py-3 text-xs font-bold text-[#544c39] backdrop-blur",children:k},k))})]}),h.jsx("div",{className:"flex min-h-[500px] items-center p-7 sm:p-10",children:h.jsxs("div",{className:"mx-auto w-full max-w-sm animate-fade-in",children:[h.jsxs("div",{className:"mb-8",children:[h.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-2xl lg:hidden",style:{background:"linear-gradient(140deg, var(--brand-300), var(--brand))",boxShadow:"var(--shadow-brand)"},children:h.jsx("span",{className:"text-xl font-black text-[#2a2416]",children:"躺"})}),h.jsx("h2",{className:"text-2xl font-extrabold text-gray-900",children:te==="login"?"登录管理后台":"注册新账号"}),h.jsx("p",{className:"mt-2 text-sm text-gray-500",children:te==="login"?"使用管理员账号进入工作台":"创建账号后即可登录工作台"})]}),te==="login"&&h.jsxs("form",{onSubmit:Z,className:"space-y-5",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"管理员账号"}),h.jsxs("div",{className:"relative group",children:[h.jsx(Gm,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"text",placeholder:"请输入账号",value:y,onChange:k=>p(k.target.value),autoComplete:"username",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"密码"}),h.jsxs("div",{className:"relative group",children:[h.jsx(Vm,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"password",placeholder:"请输入密码",value:v,onChange:k=>g(k.target.value),autoComplete:"current-password",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),H.required&&h.jsx(fh,{image:H.image,code:H.code,onCodeChange:H.setCode,onRefresh:()=>void H.refresh()})]}),W&&h.jsxs("div",{role:"status",className:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 p-3 text-sm font-semibold text-green-700",children:[h.jsx(or,{className:"h-4 w-4 shrink-0"})," ",W]}),B&&h.jsxs("div",{role:"alert",className:"flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm font-semibold text-red-700",children:[h.jsx(Xm,{className:"h-4 w-4 shrink-0"})," ",B]}),h.jsx("button",{type:"submit",disabled:A,className:"ios-btn-primary flex h-11 w-full items-center justify-center gap-2 rounded-md text-sm disabled:opacity-70",children:A?h.jsx(su,{className:"h-4 w-4 animate-spin"}):h.jsxs(h.Fragment,{children:["登录 ",h.jsx(Ym,{className:"h-4 w-4"})]})})]}),te==="register"&&h.jsxs("form",{onSubmit:ue,className:"space-y-5",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"账号"}),h.jsxs("div",{className:"relative group",children:[h.jsx(Gm,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"text",placeholder:"设置登录账号",value:be.username,onChange:k=>Me({...be,username:k.target.value}),autoComplete:"username",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"邮箱"}),h.jsxs("div",{className:"relative group",children:[h.jsx(x1,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"email",placeholder:"用于找回账号",value:be.email,onChange:k=>Me({...be,email:k.target.value}),autoComplete:"email",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"密码"}),h.jsxs("div",{className:"relative group",children:[h.jsx(Vm,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"password",placeholder:"至少 8 位,含字母和数字",value:be.password,onChange:k=>Me({...be,password:k.target.value}),autoComplete:"new-password",required:!0,className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]})]}),Le&&h.jsxs(h.Fragment,{children:[h.jsx(fh,{image:j.image,code:j.code,onCodeChange:j.setCode,onRefresh:()=>void j.refresh()}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"mb-1.5 block text-xs font-bold text-gray-600",children:"邮箱验证码"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("div",{className:"relative group flex-1",children:[h.jsx(vh,{className:"absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400 group-focus-within:text-gray-700"}),h.jsx("input",{type:"text",placeholder:"请输入验证码",value:be.code,onChange:k=>Me({...be,code:k.target.value}),className:"ios-input h-11 w-full rounded-md py-2.5 pl-10 pr-4 text-sm"})]}),h.jsx("button",{type:"button",onClick:()=>void G(),disabled:P||re>0,className:"ios-btn-secondary h-11 shrink-0 rounded-md px-3 text-xs font-bold disabled:opacity-60",children:re>0?`${re}s`:P?"发送中":"获取验证码"})]})]})]})]}),z&&h.jsxs("div",{role:"status",className:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 p-3 text-sm font-semibold text-green-700",children:[h.jsx(or,{className:"h-4 w-4 shrink-0"})," ",z]}),He&&h.jsxs("div",{role:"alert",className:"flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm font-semibold text-red-700",children:[h.jsx(Xm,{className:"h-4 w-4 shrink-0"})," ",He]}),h.jsx("button",{type:"submit",disabled:ke,className:"ios-btn-primary flex h-11 w-full items-center justify-center gap-2 rounded-md text-sm disabled:opacity-70",children:ke?h.jsx(su,{className:"h-4 w-4 animate-spin"}):h.jsxs(h.Fragment,{children:["注册 ",h.jsx(Ym,{className:"h-4 w-4"})]})})]}),me&&h.jsx("div",{className:"mt-5 text-center text-xs text-gray-500",children:te==="login"?h.jsxs(h.Fragment,{children:["还没有账号?",h.jsx("button",{type:"button",onClick:()=>{Ee("register"),F(""),X("")},className:"ml-1 font-bold text-[var(--brand-text)] hover:underline",children:"注册新账号"})]}):h.jsxs(h.Fragment,{children:["已有账号?",h.jsx("button",{type:"button",onClick:()=>{Ee("login"),Re(""),L("")},className:"ml-1 font-bold text-[var(--brand-text)] hover:underline",children:"返回登录"})]})}),h.jsxs("p",{className:"mt-7 border-t border-gray-100 pt-5 text-xs font-medium text-gray-400",children:["更多开源应用:",h.jsx("a",{href:"https://nav.88531.cn",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--brand-text)] hover:underline",children:"https://nav.88531.cn"})]})]})})]})})]})},ey=document.getElementById("root");if(!ey)throw new Error("Could not find root element to mount to");const o2=Dp.createRoot(ey);o2.render(h.jsx(yh.StrictMode,{children:h.jsx(sg,{children:h.jsx(r2,{})})}));export{$2 as $,q2 as A,Kp as B,t1 as C,B2 as D,c1 as E,H2 as F,Y2 as G,L2 as H,k2 as I,V2 as J,p_ as K,su as L,R1 as M,cx as N,yh as O,i1 as P,Y1 as Q,f2 as R,Xm as S,oS as T,tg as U,G2 as V,J2 as W,_h as X,I2 as Y,P2 as Z,rS as _,vr as a,tS as a$,K2 as a0,W2 as a1,F2 as a2,Q2 as a3,Z2 as a4,dS as a5,OS as a6,AS as a7,SS as a8,l1 as a9,zS as aA,ng as aB,WS as aC,IS as aD,PS as aE,or as aF,LS as aG,VS as aH,ZS as aI,FS as aJ,YS as aK,XS as aL,QS as aM,GS as aN,KS as aO,$S as aP,JS as aQ,kS as aR,g_ as aS,d_ as aT,I1 as aU,x1 as aV,A1 as aW,eS as aX,m_ as aY,Ph as aZ,Nv as a_,xS as aa,ES as ab,_S as ac,TS as ad,n_ as ae,u_ as af,l_ as ag,i_ as ah,s_ as ai,c_ as aj,vh as ak,t_ as al,a_ as am,BS as an,HS as ao,RS as ap,$p as aq,L1 as ar,e_ as as,MS as at,cS as au,US as av,qS as aw,CS as ax,jS as ay,DS as az,Up as b,P_ as b$,aS as b0,nS as b1,h_ as b2,Y_ as b3,r_ as b4,f_ as b5,V_ as b6,Q_ as b7,G_ as b8,o_ as b9,hS as bA,yS as bB,gS as bC,pS as bD,bh as bE,zv as bF,fS as bG,X1 as bH,Z_ as bI,K_ as bJ,ix as bK,sx as bL,ux as bM,F_ as bN,J_ as bO,$_ as bP,o1 as bQ,ox as bR,fx as bS,dx as bT,Wp as bU,W_ as bV,lx as bW,K1 as bX,Sh as bY,tx as bZ,I_ as b_,X_ as ba,B_ as bb,H_ as bc,Xp as bd,C_ as be,q_ as bf,j_ as bg,lS as bh,L_ as bi,k_ as bj,D_ as bk,U_ as bl,M_ as bm,b_ as bn,E_ as bo,x_ as bp,R_ as bq,z_ as br,S_ as bs,__ as bt,T_ as bu,N_ as bv,O_ as bw,w_ as bx,v_ as by,A_ as bz,de as c,ax as c0,ex as c1,nx as c2,vS as d,M1 as e,mS as f,hh as g,NS as h,bS as i,h as j,Gm as k,q1 as l,uS as m,il as n,D2 as o,X2 as p,M2 as q,q as r,U2 as s,iS as t,rx as u,mx as v,wS as w,sS as x,C2 as y,y_ as z}; diff --git a/static/assets/index-D3PEF3ay.css b/static/assets/index-D3PEF3ay.css deleted file mode 100644 index 43999c8..0000000 --- a/static/assets/index-D3PEF3ay.css +++ /dev/null @@ -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:rgb(var(--gray-200) / 1)}: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:rgb(var(--gray-400) / 1)}input::placeholder,textarea::placeholder{opacity:1;color:rgb(var(--gray-400) / 1)}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}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-x-3{left:.75rem;right:.75rem}.-bottom-1{bottom:-.25rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1\.5{top:-.375rem}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.bottom-4{bottom:1rem}.bottom-8{bottom:2rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-3\.5{left:.875rem}.left-4{left:1rem}.left-5{left:1.25rem}.right-0{right:0}.right-0\.5{right:.125rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-14{top:3.5rem}.top-2{top:.5rem}.top-4{top:1rem}.top-8{top:2rem}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[10000\]{z-index:10000}.col-span-2{grid-column:span 2 / span 2}.m-3{margin:.75rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-ml-2{margin-left:-.5rem}.-mt-1{margin-top:-.25rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-44{height:11rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[18px\]{height:18px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[340px\]{height:340px}.h-\[68px\]{height:68px}.h-\[76px\]{height:76px}.h-\[calc\(100vh-3\.5rem\)\]{height:calc(100vh - 3.5rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-72{max-height:18rem}.max-h-80{max-height:20rem}.max-h-\[220px\]{max-height:220px}.max-h-\[400px\]{max-height:400px}.max-h-\[460px\]{max-height:460px}.max-h-\[620px\]{max-height:620px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[92vh\]{max-height:92vh}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-11{min-height:2.75rem}.min-h-20{min-height:5rem}.min-h-24{min-height:6rem}.min-h-28{min-height:7rem}.min-h-36{min-height:9rem}.min-h-64{min-height:16rem}.min-h-\[2\.5rem\]{min-height:2.5rem}.min-h-\[320px\]{min-height:320px}.min-h-\[42px\]{min-height:42px}.min-h-\[500px\]{min-height:500px}.min-h-\[560px\]{min-height:560px}.min-h-\[56px\]{min-height:56px}.min-h-\[84px\]{min-height:84px}.min-h-\[calc\(100vh-2rem\)\]{min-height:calc(100vh - 2rem)}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-44{width:11rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[10\%\]{width:10%}.w-\[11\%\]{width:11%}.w-\[12\%\]{width:12%}.w-\[13\%\]{width:13%}.w-\[15\%\]{width:15%}.w-\[16\%\]{width:16%}.w-\[17\%\]{width:17%}.w-\[18\%\]{width:18%}.w-\[18px\]{width:18px}.w-\[20\%\]{width:20%}.w-\[22\%\]{width:22%}.w-\[248px\]{width:248px}.w-\[25\%\]{width:25%}.w-\[44\%\]{width:44%}.w-\[6\%\]{width:6%}.w-\[min\(22rem\,calc\(100vw-3rem\)\)\]{width:min(22rem,calc(100vw - 3rem))}.w-\[min\(380px\,calc\(100vw-2rem\)\)\]{width:min(380px,calc(100vw - 2rem))}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-20{min-width:5rem}.min-w-5{min-width:1.25rem}.min-w-\[1040px\]{min-width:1040px}.min-w-\[3\.5rem\]{min-width:3.5rem}.min-w-\[760px\]{min-width:760px}.min-w-\[820px\]{min-width:820px}.min-w-\[860px\]{min-width:860px}.min-w-\[900px\]{min-width:900px}.min-w-\[980px\]{min-width:980px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-52{max-width:13rem}.max-w-5xl{max-width:64rem}.max-w-72{max-width:18rem}.max-w-\[10rem\]{max-width:10rem}.max-w-\[1320px\]{max-width:1320px}.max-w-\[1600px\]{max-width:1600px}.max-w-\[220px\]{max-width:220px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-\[380px\]{max-width:380px}.max-w-\[680px\]{max-width:680px}.max-w-\[76\%\]{max-width:76%}.max-w-\[86\%\]{max-width:86%}.max-w-\[980px\]{max-width:980px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.table-fixed{table-layout:fixed}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.cursor-crosshair{cursor:crosshair}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize-y{resize:vertical}.resize{resize:both}.scroll-mt-32{scroll-margin-top:8rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[340px_140px_260px_210px_110px\]{grid-template-columns:340px 140px 260px 210px 110px}.grid-cols-\[48px_minmax\(0\,1fr\)_auto\]{grid-template-columns:48px minmax(0,1fr) auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-y-2>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(2px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(2px * var(--tw-divide-y-reverse))}.divide-\[\#eeeeee\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(238 238 238 / var(--tw-divide-opacity, 1))}.divide-\[var\(--border\)\]>:not([hidden])~:not([hidden]){border-color:var(--border)}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(var(--gray-100) / var(--tw-divide-opacity, 1))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(var(--gray-200) / var(--tw-divide-opacity, 1))}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:8px}.rounded-2xl{border-radius:24px}.rounded-3xl{border-radius:32px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:16px}.rounded-md{border-radius:10px}.rounded-none{border-radius:0}.rounded-xl{border-radius:20px}.rounded-b-md{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-dashed{border-style:dashed}.border-\[\#f5c800\]{--tw-border-opacity: 1;border-color:rgb(245 200 0 / var(--tw-border-opacity, 1))}.border-\[\#ffe100\]{--tw-border-opacity: 1;border-color:rgb(255 225 0 / var(--tw-border-opacity, 1))}.border-\[\#ffe566\]{--tw-border-opacity: 1;border-color:rgb(255 229 102 / var(--tw-border-opacity, 1))}.border-\[var\(--border\)\]{border-color:var(--border)}.border-\[var\(--border-light\)\]{border-color:var(--border-light)}.border-\[var\(--border-strong\)\]{border-color:var(--border-strong)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-400{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-brand-200{--tw-border-opacity: 1;border-color:rgb(255 239 163 / var(--tw-border-opacity, 1))}.border-cyan-100{--tw-border-opacity: 1;border-color:rgb(207 250 254 / var(--tw-border-opacity, 1))}.border-cyan-200{--tw-border-opacity: 1;border-color:rgb(165 243 252 / var(--tw-border-opacity, 1))}.border-cyan-300{--tw-border-opacity: 1;border-color:rgb(103 232 249 / var(--tw-border-opacity, 1))}.border-cyan-600{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity, 1))}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(var(--gray-100) / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(var(--gray-200) / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(var(--gray-300) / var(--tw-border-opacity, 1))}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(var(--gray-50) / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-indigo-200{--tw-border-opacity: 1;border-color:rgb(199 210 254 / var(--tw-border-opacity, 1))}.border-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-sky-200{--tw-border-opacity: 1;border-color:rgb(186 230 253 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-violet-100{--tw-border-opacity: 1;border-color:rgb(237 233 254 / var(--tw-border-opacity, 1))}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity, 1))}.bg-\[\#8fc7a8\]{--tw-bg-opacity: 1;background-color:rgb(143 199 168 / var(--tw-bg-opacity, 1))}.bg-\[\#b8ac8e\]{--tw-bg-opacity: 1;background-color:rgb(184 172 142 / var(--tw-bg-opacity, 1))}.bg-\[\#c9b8e8\]{--tw-bg-opacity: 1;background-color:rgb(201 184 232 / var(--tw-bg-opacity, 1))}.bg-\[\#e8a0a0\]{--tw-bg-opacity: 1;background-color:rgb(232 160 160 / var(--tw-bg-opacity, 1))}.bg-\[\#e8dcbc\]{--tw-bg-opacity: 1;background-color:rgb(232 220 188 / var(--tw-bg-opacity, 1))}.bg-\[\#eef4ff\]{--tw-bg-opacity: 1;background-color:rgb(238 244 255 / var(--tw-bg-opacity, 1))}.bg-\[\#f0f7f3\]{--tw-bg-opacity: 1;background-color:rgb(240 247 243 / var(--tw-bg-opacity, 1))}.bg-\[\#f5c800\]{--tw-bg-opacity: 1;background-color:rgb(245 200 0 / var(--tw-bg-opacity, 1))}.bg-\[\#f7f2fb\]{--tw-bg-opacity: 1;background-color:rgb(247 242 251 / var(--tw-bg-opacity, 1))}.bg-\[\#ff4400\]{--tw-bg-opacity: 1;background-color:rgb(255 68 0 / var(--tw-bg-opacity, 1))}.bg-\[\#ffd700\]{--tw-bg-opacity: 1;background-color:rgb(255 215 0 / var(--tw-bg-opacity, 1))}.bg-\[\#ffe100\]{--tw-bg-opacity: 1;background-color:rgb(255 225 0 / var(--tw-bg-opacity, 1))}.bg-\[\#fff7e6\]{--tw-bg-opacity: 1;background-color:rgb(255 247 230 / var(--tw-bg-opacity, 1))}.bg-\[\#fff8d1\]{--tw-bg-opacity: 1;background-color:rgb(255 248 209 / var(--tw-bg-opacity, 1))}.bg-\[\#fffbe6\]{--tw-bg-opacity: 1;background-color:rgb(255 251 230 / var(--tw-bg-opacity, 1))}.bg-\[\#fffdf0\]{--tw-bg-opacity: 1;background-color:rgb(255 253 240 / var(--tw-bg-opacity, 1))}.bg-\[var\(--app-bg\)\]{background-color:var(--app-bg)}.bg-\[var\(--brand\)\]{background-color:var(--brand)}.bg-\[var\(--brand-50\)\]{background-color:var(--brand-50)}.bg-\[var\(--surface\)\]{background-color:var(--surface)}.bg-\[var\(--surface-hover\)\]{background-color:var(--surface-hover)}.bg-\[var\(--surface-strong\)\]{background-color:var(--surface-strong)}.bg-\[var\(--surface-subtle\)\]{background-color:var(--surface-subtle)}.bg-\[var\(--unread-badge\)\]{background-color:var(--unread-badge)}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-black\/40{background-color:#0006}.bg-black\/55{background-color:#0000008c}.bg-black\/60{background-color:#0009}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(255 253 240 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(255 215 0 / var(--tw-bg-opacity, 1))}.bg-cyan-50{--tw-bg-opacity: 1;background-color:rgb(236 254 255 / var(--tw-bg-opacity, 1))}.bg-cyan-50\/40{background-color:#ecfeff66}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(var(--gray-100) / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(var(--gray-200) / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(var(--gray-300) / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(var(--gray-50) / var(--tw-bg-opacity, 1))}.bg-gray-50\/60{background-color:rgb(var(--gray-50) / .6)}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-indigo-50\/70{background-color:#eef2ffb3}.bg-orange-300{--tw-bg-opacity: 1;background-color:rgb(253 186 116 / var(--tw-bg-opacity, 1))}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-sky-100{--tw-bg-opacity: 1;background-color:rgb(224 242 254 / var(--tw-bg-opacity, 1))}.bg-sky-50{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-violet-50{--tw-bg-opacity: 1;background-color:rgb(245 243 255 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/20{background-color:#fff3}.bg-white\/70{background-color:#ffffffb3}.bg-white\/95{background-color:#fffffff2}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-300{--tw-gradient-from: #fcd34d var(--tw-gradient-from-position);--tw-gradient-to: rgb(252 211 77 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-50{--tw-gradient-from: #fffbeb var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 251 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-200{--tw-gradient-from: rgb(var(--gray-200) / 1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(var(--gray-200) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-300{--tw-gradient-from: #fdba74 var(--tw-gradient-from-position);--tw-gradient-to: rgb(253 186 116 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-amber-500{--tw-gradient-to: #f59e0b var(--tw-gradient-to-position)}.to-gray-400{--tw-gradient-to: rgb(var(--gray-400) / 1) var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-7{padding:1.75rem}.px-0{padding-left:0;padding-right:0}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-10{padding-bottom:2.5rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-11{padding-right:2.75rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-\[0\.15em\]{letter-spacing:.15em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-\[\#2a2416\]{--tw-text-opacity: 1;color:rgb(42 36 22 / var(--tw-text-opacity, 1))}.text-\[\#3f5f8f\]{--tw-text-opacity: 1;color:rgb(63 95 143 / var(--tw-text-opacity, 1))}.text-\[\#3f7a5c\]{--tw-text-opacity: 1;color:rgb(63 122 92 / var(--tw-text-opacity, 1))}.text-\[\#544c39\]{--tw-text-opacity: 1;color:rgb(84 76 57 / var(--tw-text-opacity, 1))}.text-\[\#6b5200\]{--tw-text-opacity: 1;color:rgb(107 82 0 / var(--tw-text-opacity, 1))}.text-\[\#6b5a8a\]{--tw-text-opacity: 1;color:rgb(107 90 138 / var(--tw-text-opacity, 1))}.text-\[\#8a6300\]{--tw-text-opacity: 1;color:rgb(138 99 0 / var(--tw-text-opacity, 1))}.text-\[\#8c7900\]{--tw-text-opacity: 1;color:rgb(140 121 0 / var(--tw-text-opacity, 1))}.text-\[\#999\]{--tw-text-opacity: 1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}.text-\[\#d6b600\]{--tw-text-opacity: 1;color:rgb(214 182 0 / var(--tw-text-opacity, 1))}.text-\[\#d92d20\]{--tw-text-opacity: 1;color:rgb(217 45 32 / var(--tw-text-opacity, 1))}.text-\[\#ff3b30\]{--tw-text-opacity: 1;color:rgb(255 59 48 / var(--tw-text-opacity, 1))}.text-\[\#ff4400\]{--tw-text-opacity: 1;color:rgb(255 68 0 / var(--tw-text-opacity, 1))}.text-\[var\(--border\)\]{color:var(--border)}.text-\[var\(--brand-ink\)\]{color:var(--brand-ink)}.text-\[var\(--brand-primary\)\]{color:var(--brand-primary)}.text-\[var\(--brand-text\)\]{color:var(--brand-text)}.text-\[var\(--danger-ink\)\]{color:var(--danger-ink)}.text-\[var\(--text\)\]{color:var(--text)}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-\[var\(--text-secondary\)\]{color:var(--text-secondary)}.text-\[var\(--text-soft\)\]{color:var(--text-soft)}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-amber-950{--tw-text-opacity: 1;color:rgb(69 26 3 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-brand-ink{--tw-text-opacity: 1;color:rgb(42 36 22 / var(--tw-text-opacity, 1))}.text-cyan-700{--tw-text-opacity: 1;color:rgb(14 116 144 / var(--tw-text-opacity, 1))}.text-cyan-800{--tw-text-opacity: 1;color:rgb(21 94 117 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-emerald-700\/70{color:#047857b3}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-emerald-900\/80{color:#064e3bcc}.text-gray-300{--tw-text-opacity: 1;color:rgb(var(--gray-300) / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(var(--gray-400) / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(var(--gray-500) / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(var(--gray-600) / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(var(--gray-700) / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(var(--gray-800) / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(var(--gray-900) / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.text-indigo-950{--tw-text-opacity: 1;color:rgb(30 27 75 / var(--tw-text-opacity, 1))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-orange-950{--tw-text-opacity: 1;color:rgb(67 20 7 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity, 1))}.text-sky-700{--tw-text-opacity: 1;color:rgb(3 105 161 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-violet-700{--tw-text-opacity: 1;color:rgb(109 40 217 / var(--tw-text-opacity, 1))}.text-violet-900{--tw-text-opacity: 1;color:rgb(76 29 149 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.accent-\[\#f5c400\]{accent-color:#f5c400}.accent-brand-500{accent-color:#FFD700}.accent-yellow-400{accent-color:#facc15}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_12px_40px_rgba\(20\,24\,28\,0\.24\)\]{--tw-shadow: 0 12px 40px rgba(20,24,28,.24);--tw-shadow-colored: 0 12px 40px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(156\,163\,175\,0\.45\)\]{--tw-shadow: 0 1px 3px rgba(156,163,175,.45);--tw-shadow-colored: 0 1px 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(245\,158\,11\,0\.45\)\]{--tw-shadow: 0 1px 3px rgba(245,158,11,.45);--tw-shadow-colored: 0 1px 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(249\,115\,22\,0\.45\)\]{--tw-shadow: 0 1px 3px rgba(249,115,22,.45);--tw-shadow-colored: 0 1px 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(20\,24\,28\,0\.10\)\]{--tw-shadow: 0 4px 16px rgba(20,24,28,.1);--tw-shadow-colored: 0 4px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[var\(--shadow-card\,0_8px_24px_rgba\(20\,24\,28\,0\.16\)\)\]{--tw-shadow: var(--shadow-card,0 8px 24px rgba(20,24,28,.16));--tw-shadow-colored: 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[var\(--shadow-brand\)\]{--tw-shadow-color: var(--shadow-brand);--tw-shadow: var(--tw-shadow-colored)}.shadow-\[var\(--shadow-sm\)\]{--tw-shadow-color: var(--shadow-sm);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-amber-500\/30{--tw-ring-color: rgb(245 158 11 / .3)}.ring-gray-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(var(--gray-200) / var(--tw-ring-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}*{box-sizing:border-box;margin:0;padding:0}:root,:root[data-theme=light]{color-scheme:light;--app-bg: #f7f6f3;--surface: #ffffff;--surface-subtle: #faf9f7;--surface-strong: #f2f1ed;--surface-hover: #faf9f6;--border: #e9e7e2;--border-strong: #d6d3cc;--border-brand: #ffd400;--text: #23211e;--text-muted: #6b6862;--text-soft: #76716a;--gray-50: 250 250 248;--gray-100: 245 244 240;--gray-200: 235 233 227;--gray-300: 221 217 208;--gray-400: 118 113 106;--gray-500: 107 104 98;--gray-600: 102 98 92;--gray-700: 74 71 66;--gray-800: 51 48 44;--gray-900: 34 32 29;--brand-50: #fffdf0;--brand-100: #fff8d1;--brand-200: #ffefa3;--brand-300: #ffe566;--brand: #ffe100;--brand-hover: #ffd700;--brand-active: #f5c800;--brand-ink: #2a2416;--brand-soft: #fff9c9;--brand-text: #806d00;--selection-bg: #fb923c;--selection-ink: var(--brand-ink);--focus-ring: #806d00;--unread-badge: #dc2626;--danger: #b42318;--danger-ink: #b42318;--danger-soft: #fff0f0;--success: #0f704b;--success-ink: #0f704b;--success-soft: #eefaf3;--warning: #945800;--warning-ink: #945800;--warning-soft: #fff7e6;--info: #2a5f92;--info-ink: #2a5f92;--info-soft: #f0f7ff;--radius-xs: 8px;--radius: 10px;--radius-lg: 16px;--radius-xl: 20px;--radius-pill: 999px;--shadow-sm: 0 1px 2px rgba(35, 33, 30, .05);--shadow-md: 0 6px 20px rgba(35, 33, 30, .08);--shadow-lg: 0 16px 40px rgba(35, 33, 30, .12);--shadow-brand: 0 6px 18px rgba(255, 214, 0, .35);--chart-grid: #ebe9e3;--chart-cursor: rgba(35, 33, 30, .06);--scrollbar-thumb: #d6d3cc;--scrollbar-thumb-hover: #b9b4aa}:root[data-theme=dark]{color-scheme:dark;--app-bg: #11110f;--surface: #191916;--surface-subtle: #20201c;--surface-strong: #292820;--surface-hover: #302e27;--border: #37362f;--border-strong: #504c40;--border-brand: #d9bd19;--text: #f5f2e8;--text-muted: #c2bcae;--text-soft: #aaa59b;--gray-50: 32 32 28;--gray-100: 41 40 34;--gray-200: 56 53 45;--gray-300: 77 72 60;--gray-400: 170 165 155;--gray-500: 174 167 153;--gray-600: 194 188 174;--gray-700: 215 210 198;--gray-800: 234 230 220;--gray-900: 245 242 232;--brand-50: #292617;--brand-100: #373116;--brand-200: #4b4015;--brand-soft: #393216;--brand-text: #f2d85c;--focus-ring: #f2d85c;--danger: #ff8c8c;--danger-ink: #ffaaaa;--danger-soft: #3a1e1e;--success: #75d9a3;--success-ink: #8fe0b5;--success-soft: #173528;--warning: #ffd170;--warning-ink: #f3d77c;--warning-soft: #3a2d16;--info: #91c9ff;--info-ink: #9dccff;--info-soft: #182e45;--shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);--shadow-md: 0 10px 28px rgba(0, 0, 0, .32);--shadow-lg: 0 22px 60px rgba(0, 0, 0, .42);--shadow-brand: 0 7px 22px rgba(221, 187, 0, .18);--chart-grid: #403d36;--chart-cursor: rgba(255, 255, 255, .06);--scrollbar-thumb: #5b574e;--scrollbar-thumb-hover: #d2bd38}html,body,#root{height:100%;width:100%}html{background:var(--app-bg);scrollbar-color:var(--scrollbar-thumb) transparent}body{font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;background-color:var(--app-bg);color:var(--text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}button,input,select,textarea{font:inherit}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}input:disabled,select:disabled,textarea:disabled,input[readonly]{color:var(--text-muted)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,textarea:-webkit-autofill,select:-webkit-autofill{-webkit-text-fill-color:var(--text);caret-color:var(--text);box-shadow:0 0 0 1000px var(--surface) inset;-webkit-transition:background-color 9999s ease-out 0s;transition:background-color 9999s ease-out 0s}.theme-picker{min-width:0;color:var(--text-muted)}.theme-picker__heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;padding:0 2px;font-size:11px;font-weight:700}.theme-picker__status{color:var(--text-soft);font-size:10px;font-weight:600}.theme-switcher{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;border:1px solid var(--border);border-radius:12px;background:var(--surface-strong);padding:3px}.theme-switcher__option{display:inline-flex;min-width:0;min-height:36px;align-items:center;justify-content:center;gap:5px;border:1px solid transparent;border-radius:8px;color:var(--text-muted);font-size:11px;font-weight:650;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.theme-switcher__option:hover{background:var(--surface-hover);color:var(--text)}.theme-switcher__option--active,.theme-switcher__option--active:hover{border-color:var(--border-brand);background:var(--brand-soft);color:var(--brand-text);font-weight:750}.theme-picker--compact .theme-switcher{grid-template-columns:repeat(3,36px);border-radius:11px}.theme-picker--compact .theme-switcher__option{width:36px;min-height:36px}.media-light-surface{color-scheme:light;background:#fff!important;color:#23211e!important}:root[data-theme=dark] .media-light-surface .bg-white,:root[data-theme=dark] .media-light-surface [class~="bg-white/95"]{background-color:#fffffff5!important}:root[data-theme=dark] .media-light-surface .bg-gray-50,:root[data-theme=dark] .media-light-surface .bg-green-50{background-color:#fafaf8!important}:root[data-theme=dark] .media-light-surface .text-gray-500{color:#6b6862!important}:root[data-theme=dark] .media-light-surface .text-gray-800{color:#33302c!important}:root[data-theme=dark] .media-light-surface .text-green-700{color:#0f704b!important}:root[data-theme=dark] .media-light-surface .text-amber-800{color:#7a5100!important}:root[data-theme=dark] .media-light-surface .text-blue-600{color:#245f9d!important}:root[data-theme=dark] .media-light-surface .text-red-600{color:#c92a2a!important}:root[data-theme=dark] .bg-white{background-color:var(--surface)}:root[data-theme=dark] [class~="bg-white/95"]{background-color:#191916f5}:root[data-theme=dark] [class~="bg-white/90"],:root[data-theme=dark] [class~="bg-white/80"]{background-color:#191916e6}:root[data-theme=dark] [class~="bg-[#fffdf5]"]{background-color:var(--app-bg)}:root[data-theme=dark] [class~="bg-[#fff9e8]"],:root[data-theme=dark] [class~="bg-[#fffdf0]"],:root[data-theme=dark] [class~="bg-[#f5edd6]"]{background-color:var(--surface-strong)}:root[data-theme=dark] [class~="hover:bg-[#fff9e8]"]:hover,:root[data-theme=dark] [class~="hover:bg-[#fffdf5]"]:hover,:root[data-theme=dark] [class~="hover:bg-[#fffdf0]"]:hover{background-color:var(--surface-hover)}:root[data-theme=dark] [class~="disabled:bg-white"]:disabled{background-color:var(--surface)}:root[data-theme=dark] [class~="border-[#f0e6c8]"],:root[data-theme=dark] [class~="border-[#e6d69a]"]{border-color:var(--border)}:root[data-theme=dark] [class~="text-[#111]"],:root[data-theme=dark] [class~="text-[#333]"],:root[data-theme=dark] [class~="text-[#555]"],:root[data-theme=dark] [class~="text-[#666]"]{color:var(--text)}:root[data-theme=dark] [class~="text-[#777]"],:root[data-theme=dark] [class~="text-[#888]"]{color:var(--text-muted)}:root[data-theme=dark] [class~="text-[#999]"],:root[data-theme=dark] [class~="text-[#aaa]"],:root[data-theme=dark] [class~="text-[#a89e83]"],:root[data-theme=dark] [class~="text-[#b8ac8e]"],:root[data-theme=dark] [class~="text-[#d0d0d0]"]{color:var(--text-soft)}:root[data-theme=dark] [class~="text-[#8c7900]"],:root[data-theme=dark] [class~="text-[#8a6300]"],:root[data-theme=dark] [class~="text-[#6b5200]"],:root[data-theme=dark] [class~="text-[#d6b600]"]{color:var(--brand-text)}:root[data-theme=dark] [class~="hover:text-black"]:hover,:root[data-theme=dark] [class~="hover:text-[#111]"]:hover{color:var(--text)}:root[data-theme=dark] button .rounded-full.bg-white{background-color:#f4f1e8}:root[data-theme=dark] .bg-red-50,:root[data-theme=dark] .bg-red-100{background-color:var(--danger-soft)}:root[data-theme=dark] .border-red-200{border-color:#744040}:root[data-theme=dark] .text-red-500,:root[data-theme=dark] .text-red-600,:root[data-theme=dark] .text-red-700,:root[data-theme=dark] .text-red-800,:root[data-theme=dark] .text-red-900{color:#faa}:root[data-theme=dark] .bg-green-50,:root[data-theme=dark] .bg-green-100,:root[data-theme=dark] .bg-emerald-50{background-color:var(--success-soft)}:root[data-theme=dark] .border-green-200,:root[data-theme=dark] .border-emerald-200{border-color:#356b50}:root[data-theme=dark] .text-green-600,:root[data-theme=dark] .text-green-700,:root[data-theme=dark] .text-green-800,:root[data-theme=dark] .text-emerald-600,:root[data-theme=dark] .text-emerald-700,:root[data-theme=dark] .text-emerald-800{color:#8fe0b5}:root[data-theme=dark] .bg-blue-50,:root[data-theme=dark] .bg-blue-100{background-color:var(--info-soft)}:root[data-theme=dark] .border-blue-200{border-color:#3c638c}:root[data-theme=dark] .text-blue-500,:root[data-theme=dark] .text-blue-600,:root[data-theme=dark] .text-blue-700,:root[data-theme=dark] .text-blue-800,:root[data-theme=dark] .text-blue-900{color:#9dccff}:root[data-theme=dark] .bg-yellow-50,:root[data-theme=dark] .bg-yellow-100,:root[data-theme=dark] .bg-amber-50,:root[data-theme=dark] .bg-amber-100,:root[data-theme=dark] .bg-amber-200{background-color:var(--warning-soft)}:root[data-theme=dark] .border-amber-200{border-color:#755f2d}:root[data-theme=dark] .text-yellow-600,:root[data-theme=dark] .text-yellow-700,:root[data-theme=dark] .text-yellow-800,:root[data-theme=dark] .text-amber-500,:root[data-theme=dark] .text-amber-600,:root[data-theme=dark] .text-amber-700,:root[data-theme=dark] .text-amber-800,:root[data-theme=dark] .text-amber-900{color:#f3d77c}:root[data-theme=dark] [class~="bg-[#fff8d1]"]{background-color:#393216}:root[data-theme=dark] [class~="bg-[#eef4ff]"]{background-color:#1c2d45}:root[data-theme=dark] [class~="bg-[#f0f7f3]"]{background-color:#193126}:root[data-theme=dark] [class~="bg-[#f7f2fb]"]{background-color:#2c2438}:root[data-theme=dark] [class~="text-[#3f5f8f]"]{color:#aacbff}:root[data-theme=dark] [class~="text-[#3f7a5c]"]{color:#9bd9b5}:root[data-theme=dark] [class~="text-[#6b5a8a]"]{color:#d1baf2}:root[data-theme=dark] [class~="hover:bg-red-50"]:hover,:root[data-theme=dark] [class~="hover:bg-red-100"]:hover{background-color:var(--danger-soft)}:root[data-theme=dark] [class~="hover:bg-green-50"]:hover,:root[data-theme=dark] [class~="hover:bg-green-100"]:hover,:root[data-theme=dark] [class~="hover:bg-emerald-50"]:hover{background-color:var(--success-soft)}:root[data-theme=dark] [class~="hover:bg-blue-50"]:hover,:root[data-theme=dark] [class~="hover:bg-blue-100"]:hover{background-color:var(--info-soft)}:root[data-theme=dark] [class~="hover:bg-yellow-50"]:hover,:root[data-theme=dark] [class~="hover:bg-yellow-100"]:hover,:root[data-theme=dark] [class~="hover:bg-amber-50"]:hover,:root[data-theme=dark] [class~="hover:bg-amber-100"]:hover{background-color:var(--warning-soft)}:root[data-theme=dark] [class~="hover:bg-black/5"]:hover{background-color:#ffffff14}:root[data-theme=dark] [class~="hover:text-red-600"]:hover,:root[data-theme=dark] [class~="hover:text-red-700"]:hover{color:#faa}:root[data-theme=dark] [class~="hover:text-green-600"]:hover,:root[data-theme=dark] [class~="hover:text-green-700"]:hover,:root[data-theme=dark] [class~="hover:text-emerald-600"]:hover{color:#8fe0b5}:root[data-theme=dark] [class~="hover:text-blue-600"]:hover,:root[data-theme=dark] [class~="hover:text-blue-700"]:hover{color:#9dccff}:root[data-theme=dark] [class~="hover:text-amber-600"]:hover,:root[data-theme=dark] [class~="hover:text-amber-700"]:hover{color:#f3d77c}:root[data-theme=dark] [class~="hover:bg-pink-50"]:hover,:root[data-theme=dark] [class~="hover:bg-pink-100"]:hover{background-color:var(--danger-soft)}:root[data-theme=dark] [class~="hover:text-pink-600"]:hover,:root[data-theme=dark] [class~="hover:text-pink-700"]:hover,:root[data-theme=dark] [class~="hover:text-yellow-600"]:hover{color:var(--warning-ink)}:root[data-theme=dark] [class~="hover:bg-amber-200"]:hover{background-color:var(--warning-soft)}:root[data-theme=dark] .theme-brand-panel [class~="text-[#8a6300]"]{color:#8a6300}:root[data-theme=dark] .theme-brand-panel [class~="text-[#6b5200]"]{color:#6b5200}:root[data-theme=dark] .page-tab:not(.page-tab--active) .page-tab__count{background:#ffffff14}.recharts-pie-label-text,.recharts-text{fill:var(--text-muted)}:root[data-theme=dark] .modal-overlay,:root[data-theme=dark] .modal-overlay-centered{background-color:#000000ad}.page-stack{display:flex;flex-direction:column;gap:20px}.page-header{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;min-height:62px;padding-bottom:16px;border-bottom:1px solid var(--border)}.page-header__identity{display:flex;min-width:0;align-items:flex-start;gap:12px}.page-header__icon{display:inline-flex;width:42px;height:42px;flex:0 0 42px;align-items:center;justify-content:center;border-radius:var(--radius-lg);background:linear-gradient(140deg,var(--brand-300),var(--brand));color:var(--brand-ink);box-shadow:var(--shadow-brand)}.page-title{color:var(--text);font-size:24px;font-weight:750;line-height:1.25}.page-description{margin-top:5px;max-width:760px;color:var(--text-muted);font-size:13px;line-height:1.6}.page-actions{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}.page-tabs{display:inline-flex;max-width:100%;gap:4px;overflow-x:auto;border-radius:var(--radius-pill);background:var(--surface-strong);padding:4px;scrollbar-width:none;-ms-overflow-style:none}.page-tabs::-webkit-scrollbar{display:none}.page-tab{display:inline-flex;min-height:38px;flex:0 0 auto;align-items:center;justify-content:center;gap:7px;border-radius:var(--radius-pill);padding:8px 16px;color:var(--text-muted);font-size:13px;font-weight:650;line-height:1.2;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease}.page-tab:hover{background:var(--surface);color:var(--text)}.page-tab--active{background:var(--brand);color:var(--brand-ink);box-shadow:var(--shadow-brand)}.page-tab--active:hover{background:var(--brand)}.page-tab__count{min-width:20px;border-radius:var(--radius-pill);background:#ffffff8c;padding:2px 7px;color:inherit;font-size:11px;font-weight:700;text-align:center}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);padding:14px;box-shadow:var(--shadow-sm)}.toolbar__group{display:flex;min-width:0;flex-wrap:wrap;align-items:center;gap:8px}.section-panel{overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-xl);background:var(--surface);box-shadow:var(--shadow-sm)}.section-panel__header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:58px;border-bottom:1px solid var(--border);padding:14px 18px}.section-header__icon{display:inline-flex;width:34px;height:34px;flex:0 0 34px;align-items:center;justify-content:center;border-radius:var(--radius);background:var(--surface-strong);color:var(--text-muted)}.section-header__actions{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}.section-title{color:var(--text);font-size:15px;font-weight:700}.section-description{margin-top:3px;color:var(--text-muted);font-size:12px;line-height:1.5}.notice-banner{display:flex;min-height:46px;align-items:center;gap:10px;border:1px solid var(--border);border-radius:var(--radius-lg);padding:11px 14px;font-size:13px;font-weight:600;line-height:1.5}.notice-banner button{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;border-radius:var(--radius-pill);padding:5px}.notice-banner--success{border-color:color-mix(in srgb,var(--success) 38%,var(--border));background:var(--success-soft);color:var(--success-ink)}.notice-banner--error{border-color:color-mix(in srgb,var(--danger) 38%,var(--border));background:var(--danger-soft);color:var(--danger-ink)}.notice-banner--warning{border-color:var(--border-strong);background:var(--warning-soft);color:var(--warning-ink)}.notice-banner--info{border-color:color-mix(in srgb,var(--info) 38%,var(--border));background:var(--info-soft);color:var(--info-ink)}.metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.metric-card{min-width:0;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);padding:18px;box-shadow:var(--shadow-sm);transition:box-shadow .16s ease,transform .16s ease}.metric-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px)}.metric-card__label{color:var(--text-muted);font-size:12px;font-weight:650}.metric-card__value{margin-top:7px;color:var(--text);font-size:24px;font-weight:750;line-height:1.2}.metric-card__meta{margin-top:6px;color:var(--text-soft);font-size:11px;line-height:1.5}.metric-grid--compact{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.metric-grid--compact .metric-card{padding:10px 12px;border-radius:var(--radius-md)}.metric-grid--compact .metric-card__label{font-size:11px}.metric-grid--compact .metric-card__value{margin-top:2px;font-size:20px}.metric-grid--compact .metric-card__meta{margin-top:1px;font-size:10px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}.field-label{display:block;margin-bottom:6px;color:var(--text-muted);font-size:12px;font-weight:700}.empty-state{display:flex;min-height:260px;flex-direction:column;align-items:center;justify-content:center;border:1px dashed var(--border-strong);border-radius:var(--radius-xl);background:var(--surface);padding:32px;text-align:center}.empty-state--compact{min-height:160px}.empty-state__icon{display:inline-flex;width:52px;height:52px;align-items:center;justify-content:center;border-radius:var(--radius-lg);background:var(--surface-strong);color:var(--text-soft)}.empty-state h3{margin-top:14px;color:var(--text);font-size:15px;font-weight:700}.empty-state p{margin-top:5px;max-width:520px;color:var(--text-muted);font-size:13px;line-height:1.6}.page-loading{display:flex;min-height:260px;align-items:center;justify-content:center;gap:9px;color:var(--text-muted);font-size:13px;font-weight:600}.ios-card{background:var(--surface);border-radius:var(--radius-lg);border:1px solid var(--border);box-shadow:var(--shadow-sm);transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease}.ios-card:hover{border-color:var(--border-brand);box-shadow:var(--shadow-md)}.ios-input{min-height:42px;background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius);color:var(--text);font-weight:500;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ios-input:hover:not(:disabled):not(:focus){border-color:var(--border-brand)}.ios-input:focus{background:var(--surface);border-color:var(--focus-ring);box-shadow:0 0 0 4px color-mix(in srgb,var(--focus-ring) 28%,transparent);outline:none}.ios-input::-moz-placeholder{color:var(--text-soft);font-weight:400}.ios-input::placeholder{color:var(--text-soft);font-weight:400}.ios-input:disabled,.ios-input[readonly]{border-color:var(--border);background:var(--surface-strong);color:var(--text-muted);cursor:not-allowed}.ios-btn-primary{min-height:42px;border-radius:var(--radius-pill);background:var(--brand);color:var(--brand-ink);font-weight:700;border:none;box-shadow:var(--shadow-brand);transition:background-color .15s ease,box-shadow .15s ease,transform .1s ease;cursor:pointer}.ios-btn-primary:hover:not(:disabled){background:var(--brand-hover);box-shadow:0 8px 22px #ffd60073}.ios-btn-primary:active:not(:disabled){background:var(--brand-active);transform:translateY(1px);box-shadow:var(--shadow-sm)}.ios-btn-primary:disabled{background:var(--surface-strong);color:var(--text-soft);box-shadow:none;cursor:not-allowed}.ios-btn-secondary{min-height:42px;border-radius:var(--radius-pill);background:var(--surface);color:var(--text);font-weight:600;border:1px solid var(--border-strong);transition:background-color .15s ease,border-color .15s ease;cursor:pointer}.ios-btn-secondary:hover:not(:disabled){background:var(--surface-hover);border-color:var(--brand)}.ios-btn-secondary:disabled{color:var(--text-soft);cursor:not-allowed}.ios-btn-danger{min-height:42px;border-radius:var(--radius-pill);background:var(--danger-soft);color:var(--danger);font-weight:600;border:1px solid color-mix(in srgb,var(--danger) 38%,var(--border));transition:background-color .15s ease,border-color .15s ease;cursor:pointer}.ios-btn-danger:hover:not(:disabled){background:color-mix(in srgb,var(--danger-soft) 82%,var(--danger));border-color:color-mix(in srgb,var(--danger) 62%,var(--border))}.data-table{width:100%;border-collapse:collapse;text-align:left}.data-table thead{background:var(--surface-subtle);color:var(--text-muted);font-size:11px;font-weight:700}.data-table th{height:46px;padding:0 16px;border-bottom:1px solid var(--border);letter-spacing:0}.data-table td{padding:13px 16px;border-bottom:1px solid var(--border);vertical-align:middle}.data-table tbody tr:last-child td{border-bottom:0}.data-table tbody tr:hover{background:var(--surface-hover)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:var(--radius-pill)}::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-thumb-hover)}aside nav::-webkit-scrollbar{width:4px}aside nav::-webkit-scrollbar-thumb{background:transparent}aside nav:hover::-webkit-scrollbar-thumb{background:var(--border-strong)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fadeIn .18s ease-out forwards}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}::-moz-selection{background:var(--brand);color:#000}::selection{background:var(--brand);color:#000}.chat-self-bubble ::-moz-selection{background:var(--selection-bg);color:var(--selection-ink)}.chat-self-bubble ::selection{background:var(--selection-bg);color:var(--selection-ink)}.text-brand{color:#8c7900}.bg-brand{background-color:var(--brand)}.border-brand{border-color:var(--brand)}.status-badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:var(--radius-pill);font-size:12px;font-weight:650}.status-badge-success{background-color:var(--success-soft);color:var(--success-ink)}.status-badge-warning{background-color:var(--brand-100);color:var(--warning-ink)}.status-badge-error{background-color:var(--danger-soft);color:var(--danger-ink)}.status-badge-info{background-color:var(--surface-strong);color:var(--text-muted)}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;align-items:center;justify-content:center;background-color:#0006;padding:1rem;overflow-y:auto}.modal-container{position:relative;width:100%;max-width:42rem;max-height:85vh;margin:auto;display:flex;flex-direction:column;background-color:var(--surface);color:var(--text);border-radius:var(--radius-xl);border:1px solid var(--border);box-shadow:var(--shadow-lg);overflow:hidden}.modal-header{flex-shrink:0;padding:20px 22px;border-bottom:1px solid var(--border);background:var(--surface-subtle);z-index:10}.modal-body{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;padding:22px;color:var(--text)}.modal-footer{flex-shrink:0;padding:16px 22px;border-top:1px solid var(--border);background:var(--surface-subtle);z-index:10}.modal-container-lg{max-width:64rem}.modal-overlay-centered{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;justify-content:center;background-color:#0006;padding:1rem;overflow-y:auto}@media(max-width:1023px){.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-grid--compact{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:639px){.page-stack{gap:16px}.page-header{min-height:0;align-items:flex-start;padding-bottom:14px}.page-header__icon{width:34px;height:34px;flex-basis:34px}.page-title{font-size:20px}.page-actions{width:100%;justify-content:stretch}.page-actions>*{flex:1 1 auto}.toolbar{align-items:stretch}.toolbar,.toolbar__group{flex-direction:column}.toolbar__group>input,.toolbar__group>select,.toolbar__group>button{width:100%}.section-panel__header{flex-direction:column;align-items:flex-start}.section-header__actions{width:100%;justify-content:stretch}.section-header__actions>*{flex:1 1 auto;justify-content:center}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric-grid--compact{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-card{padding:12px 14px}.metric-card__label{font-size:11px}.metric-card__value,.metric-grid--compact .metric-card__value{font-size:18px}}.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:var(--surface);color:var(--text);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow-md);overflow:hidden}@media(max-width:768px){.page-stack{gap:16px}.page-header{min-height:0;flex-direction:column;align-items:stretch;gap:12px;padding-bottom:14px}.page-title{font-size:21px}.page-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));justify-content:stretch}.page-actions>*{min-width:0}.toolbar{flex-direction:column;align-items:stretch}.toolbar__group{display:grid;grid-template-columns:1fr}.page-tabs{display:grid;width:100%;grid-auto-flow:column;grid-auto-columns:minmax(128px,1fr)}.page-tab{min-width:0;white-space:normal}.responsive-data-table{min-width:0!important}.responsive-data-table,.responsive-data-table tbody,.responsive-data-table tr,.responsive-data-table td{display:block;width:100%}.responsive-data-table thead{display:none}.responsive-data-table tbody tr{border-bottom:1px solid var(--border);padding:12px 16px}.responsive-data-table tbody tr:last-child{border-bottom:0}.responsive-data-table td{display:grid;grid-template-columns:minmax(82px,30%) minmax(0,1fr);align-items:center;gap:12px;border:0;padding:7px 0;text-align:left}.responsive-data-table td:before{content:attr(data-label);color:var(--text-muted);font-size:11px;font-weight:700}.responsive-data-table td>*{min-width:0}.responsive-data-table td[data-label=订单信息],.responsive-data-table td[data-label=卡密名称]{align-items:start}.responsive-data-table td[data-label=操作]>div{flex-wrap:wrap;justify-content:flex-start}.responsive-data-table td>.status-badge{justify-self:start}.ios-card{border-radius:var(--radius)}.ios-input{font-size:16px}.modal-container{max-width:calc(100% - 2rem);max-height:90vh;border-radius:var(--radius)}.modal-header,.modal-body,.modal-footer{padding-left:1.5rem;padding-right:1.5rem}}.marquee{overflow:hidden}.marquee__track{display:inline-flex;align-items:center;white-space:nowrap;will-change:transform;animation:marquee-scroll 40s linear infinite}.marquee:hover .marquee__track{animation-play-state:paused}@keyframes marquee-scroll{0%{transform:translate(0)}to{transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.marquee__track{animation:none}.marquee{overflow-x:auto}}.placeholder\:text-\[var\(--text-soft\)\]::-moz-placeholder{color:var(--text-soft)}.placeholder\:text-\[var\(--text-soft\)\]::placeholder{color:var(--text-soft)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-1\.5:after{content:var(--tw-content);top:-.375rem;right:-.375rem;bottom:-.375rem;left:-.375rem}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.last\:mb-0:last-child{margin-bottom:0}.last\:border-0:last-child{border-width:0px}.last\:border-b-0:last-child{border-bottom-width:0px}.even\:bg-\[var\(--surface-subtle\)\]:nth-child(2n){background-color:var(--surface-subtle)}.hover\:border-\[\#ff4400\]:hover{--tw-border-opacity: 1;border-color:rgb(255 68 0 / var(--tw-border-opacity, 1))}.hover\:border-\[var\(--border-strong\)\]:hover{border-color:var(--border-strong)}.hover\:border-amber-400:hover{--tw-border-opacity: 1;border-color:rgb(251 191 36 / var(--tw-border-opacity, 1))}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(var(--gray-400) / var(--tw-border-opacity, 1))}.hover\:border-purple-400:hover{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.hover\:bg-\[\#ff4400\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 68 0 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#ffd700\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 215 0 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#fffdf0\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 253 240 / var(--tw-bg-opacity, 1))}.hover\:bg-\[var\(--brand-hover\)\]:hover{background-color:var(--brand-hover)}.hover\:bg-\[var\(--danger-soft\)\]:hover{background-color:var(--danger-soft)}.hover\:bg-\[var\(--surface-hover\)\]:hover{background-color:var(--surface-hover)}.hover\:bg-\[var\(--surface-strong\)\]:hover{background-color:var(--surface-strong)}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-200:hover{--tw-bg-opacity: 1;background-color:rgb(253 230 138 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-50:hover{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.hover\:bg-black\/5:hover{background-color:#0000000d}.hover\:bg-black\/80:hover{background-color:#000c}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-50:hover{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.hover\:bg-brand-600:hover{--tw-bg-opacity: 1;background-color:rgb(245 200 0 / var(--tw-bg-opacity, 1))}.hover\:bg-cyan-100:hover{--tw-bg-opacity: 1;background-color:rgb(207 250 254 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-100:hover{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(var(--gray-100) / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(var(--gray-200) / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(var(--gray-50) / var(--tw-bg-opacity, 1))}.hover\:bg-green-100:hover{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.hover\:bg-green-50:hover{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.hover\:bg-pink-50:hover{--tw-bg-opacity: 1;background-color:rgb(253 242 248 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-rose-50:hover{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-violet-100:hover{--tw-bg-opacity: 1;background-color:rgb(237 233 254 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/40:hover{background-color:#fff6}.hover\:bg-yellow-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.hover\:text-\[\#ff4400\]:hover{--tw-text-opacity: 1;color:rgb(255 68 0 / var(--tw-text-opacity, 1))}.hover\:text-\[var\(--danger\)\]:hover{color:var(--danger)}.hover\:text-\[var\(--text\)\]:hover{color:var(--text)}.hover\:text-amber-600:hover{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.hover\:text-amber-700:hover{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(var(--gray-600) / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(var(--gray-800) / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(var(--gray-900) / var(--tw-text-opacity, 1))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-pink-600:hover{--tw-text-opacity: 1;color:rgb(219 39 119 / var(--tw-text-opacity, 1))}.hover\:text-purple-500:hover{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:text-yellow-600:hover{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-\[\#ffe100\]:focus{--tw-border-opacity: 1;border-color:rgb(255 225 0 / var(--tw-border-opacity, 1))}.focus\:border-\[var\(--brand\)\]:focus{border-color:var(--brand)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-\[var\(--brand\)\]:focus{--tw-ring-color: var(--brand)}.focus-visible\:outline-2:focus-visible{outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-\[var\(--focus-ring\)\]:focus-visible{outline-color:var(--focus-ring)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:bg-\[var\(--surface\)\]:disabled{background-color:var(--surface)}.disabled\:bg-\[var\(--surface-strong\)\]:disabled{background-color:var(--surface-strong)}.disabled\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(var(--gray-100) / var(--tw-bg-opacity, 1))}.disabled\:text-\[var\(--text-soft\)\]:disabled{color:var(--text-soft)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.disabled\:opacity-70:disabled{opacity:.7}.group:focus-within .group-focus-within\:text-\[\#ffe100\]{--tw-text-opacity: 1;color:rgb(255 225 0 / var(--tw-text-opacity, 1))}.group:focus-within .group-focus-within\:text-gray-700{--tw-text-opacity: 1;color:rgb(var(--gray-700) / var(--tw-text-opacity, 1))}.group:hover .group-hover\:flex{display:flex}.group:hover .group-hover\:text-\[\#ff4400\]{--tw-text-opacity: 1;color:rgb(255 68 0 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-\[var\(--text-muted\)\]{color:var(--text-muted)}.group:hover .group-hover\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media(prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}.dark\:border-amber-500\/20:is(.dark *){border-color:#f59e0b33}.dark\:border-slate-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f59e0b1a}.dark\:bg-slate-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.dark\:from-amber-950\/20:is(.dark *){--tw-gradient-from: rgb(69 26 3 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(69 26 3 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:to-\[var\(--surface\)\]:is(.dark *){--tw-gradient-to: var(--surface) var(--tw-gradient-to-position)}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(var(--gray-600) / var(--tw-text-opacity, 1))}.dark\:text-slate-100:is(.dark *){--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.dark\:text-slate-300:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark\:text-slate-400:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-slate-700\/60:hover:is(.dark *){background-color:#33415599}@media(min-width:640px){.sm\:right-6{right:1.5rem}.sm\:top-6{top:1.5rem}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:col-span-3{grid-column:span 3 / span 3}.sm\:inline-flex{display:inline-flex}.sm\:h-16{height:4rem}.sm\:min-h-\[72px\]{min-height:72px}.sm\:min-h-\[92px\]{min-height:92px}.sm\:min-h-\[calc\(100vh-3rem\)\]{min-height:calc(100vh - 3rem)}.sm\:w-16{width:4rem}.sm\:w-64{width:16rem}.sm\:w-72{width:18rem}.sm\:w-auto{width:auto}.sm\:min-w-40{min-width:10rem}.sm\:min-w-44{min-width:11rem}.sm\:min-w-52{min-width:13rem}.sm\:min-w-56{min-width:14rem}.sm\:min-w-64{min-width:16rem}.sm\:min-w-72{min-width:18rem}.sm\:max-w-xs{max-width:20rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[100px_1fr\]{grid-template-columns:100px 1fr}.sm\:grid-cols-\[140px_200px_1fr_auto\]{grid-template-columns:140px 200px 1fr auto}.sm\:grid-cols-\[160px_minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:160px minmax(0,1fr) auto auto}.sm\:grid-cols-\[24px_52px_180px_minmax\(0\,1fr\)_44px\]{grid-template-columns:24px 52px 180px minmax(0,1fr) 44px}.sm\:grid-cols-\[minmax\(160px\,0\.7fr\)_minmax\(0\,1\.5fr\)_auto\]{grid-template-columns:minmax(160px,.7fr) minmax(0,1.5fr) auto}.sm\:grid-cols-\[minmax\(180px\,0\.7fr\)_minmax\(0\,1\.4fr\)_auto\]{grid-template-columns:minmax(180px,.7fr) minmax(0,1.4fr) auto}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:border-0{border-width:0px}.sm\:p-10{padding:2.5rem}.sm\:p-5{padding:1.25rem}.sm\:p-6{padding:1.5rem}.sm\:p-8{padding:2rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:px-8{padding-left:2rem;padding-right:2rem}.sm\:pt-0{padding-top:0}.sm\:text-right{text-align:right}}@media(min-width:768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:min-h-\[360px\]{min-height:360px}.md\:w-44{width:11rem}.md\:w-72{width:18rem}.md\:w-auto{width:auto}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-\[minmax\(0\,1fr\)_150px_minmax\(0\,1\.4fr\)\]{grid-template-columns:minmax(0,1fr) 150px minmax(0,1.4fr)}.md\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto}.md\:flex-row{flex-direction:row}.md\:items-end{align-items:flex-end}.md\:items-center{align-items:center}}@media(min-width:1024px){.lg\:sticky{position:sticky}.lg\:top-2{top:.5rem}.lg\:top-auto{top:auto}.lg\:z-auto{z-index:auto}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mb-3{margin-bottom:.75rem}.lg\:ml-\[248px\]{margin-left:248px}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:h-screen{height:100vh}.lg\:w-56{width:14rem}.lg\:w-full{width:100%}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:scroll-mt-4{scroll-margin-top:1rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1\.05fr_0\.95fr\]{grid-template-columns:1.05fr .95fr}.lg\:grid-cols-\[165px_80px_180px_minmax\(0\,1fr\)\]{grid-template-columns:165px 80px 180px minmax(0,1fr)}.lg\:grid-cols-\[180px_120px_minmax\(0\,1fr\)_44px\]{grid-template-columns:180px 120px minmax(0,1fr) 44px}.lg\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.lg\:grid-cols-\[220px_180px_minmax\(240px\,1fr\)_auto\]{grid-template-columns:220px 180px minmax(240px,1fr) auto}.lg\:grid-cols-\[356px_minmax\(0\,1fr\)\]{grid-template-columns:356px minmax(0,1fr)}.lg\:grid-cols-\[minmax\(180px\,0\.7fr\)_minmax\(0\,1\.4fr\)_auto\]{grid-template-columns:minmax(180px,.7fr) minmax(0,1.4fr) auto}.lg\:grid-cols-\[minmax\(220px\,1\.2fr\)_minmax\(260px\,1\.5fr\)_180px_auto\]{grid-template-columns:minmax(220px,1.2fr) minmax(260px,1.5fr) 180px auto}.lg\:grid-cols-\[minmax\(220px\,1fr\)_1fr_180px_auto\]{grid-template-columns:minmax(220px,1fr) 1fr 180px auto}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:items-center{align-items:center}.lg\:gap-0{gap:0px}.lg\:overflow-visible{overflow:visible}.lg\:border-b-0{border-bottom-width:0px}.lg\:border-r{border-right-width:1px}.lg\:p-8{padding:2rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media(min-width:1280px){.xl\:grid{display:grid}.xl\:min-w-\[1200px\]{min-width:1200px}.xl\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.xl\:grid-cols-\[340px_140px_260px_210px_110px\]{grid-template-columns:340px 140px 260px 210px 110px}.xl\:grid-cols-\[minmax\(0\,1\.35fr\)_minmax\(340px\,0\.65fr\)\]{grid-template-columns:minmax(0,1.35fr) minmax(340px,.65fr)}.xl\:grid-cols-\[minmax\(230px\,1fr\)_minmax\(360px\,1\.5fr\)_44px\]{grid-template-columns:minmax(230px,1fr) minmax(360px,1.5fr) 44px}.xl\:\!flex-row{flex-direction:row!important}.xl\:items-start{align-items:flex-start}.xl\:items-center{align-items:center}.xl\:items-stretch{align-items:stretch}.xl\:justify-end{justify-content:flex-end}.xl\:gap-0{gap:0px}.xl\:gap-1\.5{gap:.375rem}.xl\:border-0{border-width:0px}.xl\:px-0{padding-left:0;padding-right:0}.xl\:px-2{padding-left:.5rem;padding-right:.5rem}.xl\:pt-0{padding-top:0}.xl\:\[\&\>\*\:first-child\]\:\!flex-row>*:first-child{flex-direction:row!important}.xl\:\[\&\>\*\:first-child\]\:items-center>*:first-child{align-items:center}.xl\:\[\&\>\*\:last-child\]\:border-r-0>*:last-child{border-right-width:0px}.xl\:\[\&\>\*\]\:flex>*{display:flex}.xl\:\[\&\>\*\]\:min-w-0>*{min-width:0px}.xl\:\[\&\>\*\]\:flex-col>*{flex-direction:column}.xl\:\[\&\>\*\]\:justify-center>*{justify-content:center}.xl\:\[\&\>\*\]\:border-r>*{border-right-width:1px}.xl\:\[\&\>\*\]\:border-gray-200>*{--tw-border-opacity: 1;border-color:rgb(var(--gray-200) / var(--tw-border-opacity, 1))}.xl\:\[\&\>\*\]\:px-4>*{padding-left:1rem;padding-right:1rem}.xl\:\[\&\>div\:last-child\]\:border-b-0>div:last-child{border-bottom-width:0px}.xl\:\[\&\>div\]\:border-b>div{border-bottom-width:1px}.xl\:\[\&\>div\]\:border-dashed>div{border-style:dashed}.xl\:\[\&\>div\]\:border-gray-200>div{--tw-border-opacity: 1;border-color:rgb(var(--gray-200) / var(--tw-border-opacity, 1))}.xl\:\[\&\>div\]\:py-1\.5>div{padding-top:.375rem;padding-bottom:.375rem}}.\[\&\>span\:last-child\]\:border-r-0>span:last-child{border-right-width:0px}.\[\&\>span\:nth-child\(2\)\]\:px-2>span:nth-child(2){padding-left:.5rem;padding-right:.5rem}.\[\&\>span\]\:border-r>span{border-right-width:1px}.\[\&\>span\]\:border-gray-300>span{--tw-border-opacity: 1;border-color:rgb(var(--gray-300) / var(--tw-border-opacity, 1))}.\[\&\>span\]\:px-4>span{padding-left:1rem;padding-right:1rem}.\[\&\>span\]\:py-3>span{padding-top:.75rem;padding-bottom:.75rem} diff --git a/static/assets/key-BRO3zsxh.js b/static/assets/key-CnYS625y.js similarity index 90% rename from static/assets/key-BRO3zsxh.js rename to static/assets/key-CnYS625y.js index cc42f68..47618ea 100644 --- a/static/assets/key-BRO3zsxh.js +++ b/static/assets/key-CnYS625y.js @@ -1,4 +1,4 @@ -import{c}from"./index-IChzZLcq.js";/** +import{c}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/link-2-CYVpjq_H.js b/static/assets/link-2-CUR4V6rB.js similarity index 89% rename from static/assets/link-2-CYVpjq_H.js rename to static/assets/link-2-CUR4V6rB.js index 55ecc27..f97305a 100644 --- a/static/assets/link-2-CYVpjq_H.js +++ b/static/assets/link-2-CUR4V6rB.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/message-square-text-C6Er6xWp.js b/static/assets/message-square-text-DbxdYCPP.js similarity index 91% rename from static/assets/message-square-text-C6Er6xWp.js rename to static/assets/message-square-text-DbxdYCPP.js index d135846..f261dab 100644 --- a/static/assets/message-square-text-C6Er6xWp.js +++ b/static/assets/message-square-text-DbxdYCPP.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/package-3qqwOYvH.js b/static/assets/package-DjIVaNpE.js similarity index 91% rename from static/assets/package-3qqwOYvH.js rename to static/assets/package-DjIVaNpE.js index 7b24ad8..e8aa796 100644 --- a/static/assets/package-3qqwOYvH.js +++ b/static/assets/package-DjIVaNpE.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-IChzZLcq.js";/** +import{c as a}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/package-check-FQzJ-066.js b/static/assets/package-check-C8PHQCAA.js similarity index 92% rename from static/assets/package-check-FQzJ-066.js rename to static/assets/package-check-C8PHQCAA.js index 8b7e61d..911e21b 100644 --- a/static/assets/package-check-FQzJ-066.js +++ b/static/assets/package-check-C8PHQCAA.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/pen-line-27OudxQx.js b/static/assets/pen-line-B2U8YMna.js similarity index 90% rename from static/assets/pen-line-27OudxQx.js rename to static/assets/pen-line-B2U8YMna.js index 4b14bd5..2fbf290 100644 --- a/static/assets/pen-line-27OudxQx.js +++ b/static/assets/pen-line-B2U8YMna.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/play-52JRVRYm.js b/static/assets/play-B67lJrJT.js similarity index 87% rename from static/assets/play-52JRVRYm.js rename to static/assets/play-B67lJrJT.js index 80c017f..85f283e 100644 --- a/static/assets/play-52JRVRYm.js +++ b/static/assets/play-B67lJrJT.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-IChzZLcq.js";/** +import{c as a}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/plus-hTzuza9d.js b/static/assets/plus-BZHhM3Ok.js similarity index 86% rename from static/assets/plus-hTzuza9d.js rename to static/assets/plus-BZHhM3Ok.js index c514bd1..ae429ad 100644 --- a/static/assets/plus-hTzuza9d.js +++ b/static/assets/plus-BZHhM3Ok.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/power-ZOn3B5wN.js b/static/assets/power-WuQyd1QF.js similarity index 93% rename from static/assets/power-ZOn3B5wN.js rename to static/assets/power-WuQyd1QF.js index dae742a..11435f7 100644 --- a/static/assets/power-ZOn3B5wN.js +++ b/static/assets/power-WuQyd1QF.js @@ -1,4 +1,4 @@ -import{c as o}from"./index-IChzZLcq.js";/** +import{c as o}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/power-off-D8Ea3WwY.js b/static/assets/power-off-CcqbyexD.js similarity index 90% rename from static/assets/power-off-D8Ea3WwY.js rename to static/assets/power-off-CcqbyexD.js index e11d6ce..ec4f911 100644 --- a/static/assets/power-off-D8Ea3WwY.js +++ b/static/assets/power-off-CcqbyexD.js @@ -1,4 +1,4 @@ -import{c as o}from"./index-IChzZLcq.js";/** +import{c as o}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/save-m64KWfbE.js b/static/assets/save-C5DQBwo1.js similarity index 91% rename from static/assets/save-m64KWfbE.js rename to static/assets/save-C5DQBwo1.js index 27622bf..3ff3160 100644 --- a/static/assets/save-m64KWfbE.js +++ b/static/assets/save-C5DQBwo1.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-IChzZLcq.js";/** +import{c as a}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/search-D1CHR5V5.js b/static/assets/search-DbZW8Se5.js similarity index 88% rename from static/assets/search-D1CHR5V5.js rename to static/assets/search-DbZW8Se5.js index a55a916..afc1fd6 100644 --- a/static/assets/search-D1CHR5V5.js +++ b/static/assets/search-DbZW8Se5.js @@ -1,4 +1,4 @@ -import{c}from"./index-IChzZLcq.js";/** +import{c}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/send-Db002WMI.js b/static/assets/send-CTCS9sD8.js similarity index 90% rename from static/assets/send-Db002WMI.js rename to static/assets/send-CTCS9sD8.js index 9958048..9191987 100644 --- a/static/assets/send-Db002WMI.js +++ b/static/assets/send-CTCS9sD8.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-IChzZLcq.js";/** +import{c as a}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/settings-2-B-NwJM90.js b/static/assets/settings-2-DYoajNQY.js similarity index 90% rename from static/assets/settings-2-B-NwJM90.js rename to static/assets/settings-2-DYoajNQY.js index 0beaf32..20782a8 100644 --- a/static/assets/settings-2-B-NwJM90.js +++ b/static/assets/settings-2-DYoajNQY.js @@ -1,4 +1,4 @@ -import{c}from"./index-IChzZLcq.js";/** +import{c}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/shield-alert-ob02IPrt.js b/static/assets/shield-alert-BSaySGHY.js similarity index 91% rename from static/assets/shield-alert-ob02IPrt.js rename to static/assets/shield-alert-BSaySGHY.js index 0d8c1db..436562e 100644 --- a/static/assets/shield-alert-ob02IPrt.js +++ b/static/assets/shield-alert-BSaySGHY.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/sparkles-B5X13VUJ.js b/static/assets/sparkles-CczcRRJP.js similarity index 93% rename from static/assets/sparkles-B5X13VUJ.js rename to static/assets/sparkles-CczcRRJP.js index 09e68b1..49759ed 100644 --- a/static/assets/sparkles-B5X13VUJ.js +++ b/static/assets/sparkles-CczcRRJP.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-IChzZLcq.js";/** +import{c as a}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/square-pen-BOlWgFhh.js b/static/assets/square-pen-ptW8MQaM.js similarity index 91% rename from static/assets/square-pen-BOlWgFhh.js rename to static/assets/square-pen-ptW8MQaM.js index 5b9e1f4..aa9d9a9 100644 --- a/static/assets/square-pen-BOlWgFhh.js +++ b/static/assets/square-pen-ptW8MQaM.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-IChzZLcq.js";/** +import{c as a}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/trash-2-CnOVC8WZ.js b/static/assets/trash-2-BG9PyYJR.js similarity index 91% rename from static/assets/trash-2-CnOVC8WZ.js rename to static/assets/trash-2-BG9PyYJR.js index 453769e..ede3dac 100644 --- a/static/assets/trash-2-CnOVC8WZ.js +++ b/static/assets/trash-2-BG9PyYJR.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-IChzZLcq.js";/** +import{c as a}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/trending-up-BDgJo2q2.js b/static/assets/trending-up-BR0vQ8dC.js similarity index 87% rename from static/assets/trending-up-BDgJo2q2.js rename to static/assets/trending-up-BR0vQ8dC.js index 84accbd..afe5a98 100644 --- a/static/assets/trending-up-BDgJo2q2.js +++ b/static/assets/trending-up-BR0vQ8dC.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-IChzZLcq.js";/** +import{c as e}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/truck-eLsCuQDz.js b/static/assets/truck-Cz_KAtqT.js similarity index 93% rename from static/assets/truck-eLsCuQDz.js rename to static/assets/truck-Cz_KAtqT.js index 2cb4ff8..ec2de2e 100644 --- a/static/assets/truck-eLsCuQDz.js +++ b/static/assets/truck-Cz_KAtqT.js @@ -1,4 +1,4 @@ -import{c}from"./index-IChzZLcq.js";/** +import{c}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/ui-DHCIdv_V.js b/static/assets/ui-Dh615-z8.js similarity index 99% rename from static/assets/ui-DHCIdv_V.js rename to static/assets/ui-Dh615-z8.js index 94ca67b..be91460 100644 --- a/static/assets/ui-DHCIdv_V.js +++ b/static/assets/ui-Dh615-z8.js @@ -1,4 +1,4 @@ -import{c as W,j as e,L as $,aF as A,bY as H,X as R,r as x,b as z}from"./index-IChzZLcq.js";/** +import{c as W,j as e,L as $,aF as A,bY as H,X as R,r as x,b as z}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/assets/zap-CQAFaWUI.js b/static/assets/zap-BAb90aFH.js similarity index 89% rename from static/assets/zap-CQAFaWUI.js rename to static/assets/zap-BAb90aFH.js index cd00e41..54d7fa9 100644 --- a/static/assets/zap-CQAFaWUI.js +++ b/static/assets/zap-BAb90aFH.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-IChzZLcq.js";/** +import{c as a}from"./index-C6Y7HdB3.js";/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. diff --git a/static/index.html b/static/index.html index 0fdcdd9..7fbc894 100644 --- a/static/index.html +++ b/static/index.html @@ -24,8 +24,8 @@ } })(); - - + +