2 lines
44 KiB
JavaScript
2 lines
44 KiB
JavaScript
import{j as e,c as h0,r as i}from"./react-vendor-C_od1ZSF.js";import{L as me}from"./vendor-Es4K8PXl.js";import{g as k0,a as G0,b as pe}from"./index-CCqtUiU5.js";import{o as X0}from"./contract-COFcZjyb.js";import{L as K,ak as ge,al as de,M as P0,I as xe,R as ue,ad as U0,k as he,am as _e,s as z0,an as be,ao as fe,ah as B0,X as je}from"./icons-vendor-CvzvbbIV.js";const K0=[["尊嘟假嘟","https://img.alicdn.com/imgextra/i2/O1CN01hWzOgD1KcmFEIaGwE_!!6000000001185-2-tps-64-64.png_110x10000.jpg_.webp"],["鸡哔你","https://img.alicdn.com/imgextra/i1/O1CN01P9TVJl1JCqCZcQIdW_!!6000000000993-2-tps-64-64.png_110x10000.jpg_.webp"],["谁懂啊","https://img.alicdn.com/imgextra/i1/O1CN01r9qUnx1g3tcrtSmcs_!!6000000004087-2-tps-64-64.png_110x10000.jpg_.webp"],["吗喽","https://img.alicdn.com/imgextra/i4/O1CN01dTynZh1LnbIYTHI1D_!!6000000001344-2-tps-64-64.png_110x10000.jpg_.webp"],["功德+1","https://img.alicdn.com/imgextra/i1/O1CN01l1G5pS1IVn37pfQJi_!!6000000000899-2-tps-64-64.png_110x10000.jpg_.webp"],["city不city啊","https://img.alicdn.com/imgextra/i2/O1CN01zRjPTR29lWHqabmDA_!!6000000008108-2-tps-64-64.png_110x10000.jpg_.webp"],["激推","https://img.alicdn.com/imgextra/i3/O1CN01ADTJ6u1khypfxbfnQ_!!6000000004716-2-tps-64-64.png_110x10000.jpg_.webp"],["微笑","https://img.alicdn.com/imgextra/i1/O1CN017b61R51wRk2lVV7vx_!!6000000006305-2-tps-980-980.png_110x10000.jpg_.webp"],["龇牙","https://img.alicdn.com/imgextra/i2/O1CN01nmOh4S22Yxz8IdEVf_!!6000000007133-2-tps-980-980.png_110x10000.jpg_.webp"],["流泪","https://img.alicdn.com/imgextra/i2/O1CN01Ec1EaL1zqQETcM2dX_!!6000000006765-2-tps-980-980.png_110x10000.jpg_.webp"],["尴尬","https://img.alicdn.com/imgextra/i2/O1CN01UrWH7a1ZVBrgRYXlc_!!6000000003199-2-tps-980-980.png_110x10000.jpg_.webp"],["撇嘴","https://img.alicdn.com/imgextra/i2/O1CN01Sr7o2b1lUWg5KfOD8_!!6000000004822-2-tps-980-980.png_110x10000.jpg_.webp"],["破涕为笑","https://img.alicdn.com/imgextra/i4/O1CN01pPetah1gkwndfn7Fs_!!6000000004181-2-tps-980-980.png_110x10000.jpg_.webp"],["捂脸哭","https://img.alicdn.com/imgextra/i2/O1CN0170KgpE1dE1TuQgd66_!!6000000003703-2-tps-980-980.png_110x10000.jpg_.webp"],["害羞","https://img.alicdn.com/imgextra/i3/O1CN01ZoB0Lb1ps7XpqP8PQ_!!6000000005415-2-tps-980-980.png_110x10000.jpg_.webp"],["感动","https://img.alicdn.com/imgextra/i2/O1CN01wqD4ly29yndR3Qp3A_!!6000000008137-2-tps-980-980.png_110x10000.jpg_.webp"],["滴泪","https://img.alicdn.com/imgextra/i1/O1CN01MpkJ3L1oUTTqfryOn_!!6000000005228-2-tps-980-980.png_110x10000.jpg_.webp"],["暗中观察","https://img.alicdn.com/imgextra/i1/O1CN010LO9yj272W07GlLls_!!6000000007739-2-tps-980-980.png_110x10000.jpg_.webp"],["偷笑","https://img.alicdn.com/imgextra/i4/O1CN01vJtO031g818IuYO7x_!!6000000004096-2-tps-980-980.png_110x10000.jpg_.webp"],["ok","https://img.alicdn.com/imgextra/i3/O1CN01QRkqDF25tz0WcANje_!!6000000007585-2-tps-980-980.png_110x10000.jpg_.webp"],["送花","https://img.alicdn.com/imgextra/i2/O1CN01PpzBNX1JNpeJBWnvr_!!6000000001017-2-tps-980-980.png_110x10000.jpg_.webp"],["大哭","https://img.alicdn.com/imgextra/i4/O1CN014TiaNb1ViEgNvRrTB_!!6000000002686-2-tps-980-980.png_110x10000.jpg_.webp"],["色","https://img.alicdn.com/imgextra/i2/O1CN01840t1B1JaCLGvHnBK_!!6000000001044-2-tps-980-980.png_110x10000.jpg_.webp"],["惊慌","https://img.alicdn.com/imgextra/i1/O1CN01mnqO7G1LAfUnfAN2U_!!6000000001259-2-tps-980-980.png_110x10000.jpg_.webp"],["惊讶","https://img.alicdn.com/imgextra/i3/O1CN0127IeyS1Kw0p0P4jzI_!!6000000001227-2-tps-980-980.png_110x10000.jpg_.webp"],["得意","https://img.alicdn.com/imgextra/i4/O1CN018QUnFv1WpOUES9POZ_!!6000000002837-2-tps-980-980.png_110x10000.jpg_.webp"],["睡","https://img.alicdn.com/imgextra/i2/O1CN01RprGZl1lqVgnEJLCx_!!6000000004870-2-tps-980-980.png_110x10000.jpg_.webp"],["不好意思","https://img.alicdn.com/imgextra/i3/O1CN01rMJJgn1SUXzuVpUhO_!!6000000002250-2-tps-980-980.png_110x10000.jpg_.webp"],["托腮","https://img.alicdn.com/imgextra/i1/O1CN01w3reBU1d3wlgOBtyZ_!!6000000003681-2-tps-980-980.png_110x10000.jpg_.webp"],["发怒","https://img.alicdn.com/imgextra/i2/O1CN013Wzy8d2A8PxGJZPpT_!!6000000008158-2-tps-980-980.png_110x10000.jpg_.webp"],["难过","https://img.alicdn.com/imgextra/i2/O1CN01zcwaSh1G9gZCFuFal_!!6000000000580-2-tps-980-980.png_110x10000.jpg_.webp"],["调皮","https://img.alicdn.com/imgextra/i3/O1CN01Zd1YHi1TI0lwpBe8c_!!6000000002358-2-tps-980-980.png_110x10000.jpg_.webp"],["愉快","https://img.alicdn.com/imgextra/i2/O1CN0145wDk21SWpyjTvsvA_!!6000000002255-2-tps-980-980.png_110x10000.jpg_.webp"],["白眼","https://img.alicdn.com/imgextra/i4/O1CN01nexGth1hwEAT1SHO2_!!6000000004341-2-tps-980-980.png_110x10000.jpg_.webp"],["拒绝","https://img.alicdn.com/imgextra/i2/O1CN01nqusqS1uHXzoUcpXr_!!6000000006012-2-tps-980-980.png_110x10000.jpg_.webp"],["期待","https://img.alicdn.com/imgextra/i3/O1CN01M44QY11Oh8Q5PdMIx_!!6000000001736-2-tps-980-980.png_110x10000.jpg_.webp"],["困","https://img.alicdn.com/imgextra/i4/O1CN01J4hFFz1Y9pmNdBq76_!!6000000003017-2-tps-980-980.png_110x10000.jpg_.webp"],["流汗","https://img.alicdn.com/imgextra/i4/O1CN01BU3NZ21gdcSjkqnST_!!6000000004165-2-tps-980-980.png_110x10000.jpg_.webp"],["憨笑","https://img.alicdn.com/imgextra/i2/O1CN01Pee9Ql1SJ661eH9By_!!6000000002225-2-tps-980-980.png_110x10000.jpg_.webp"],["耶","https://img.alicdn.com/imgextra/i2/O1CN01pFicsL1ipBhIqzcgs_!!6000000004461-2-tps-980-980.png_110x10000.jpg_.webp"],["奋斗","https://img.alicdn.com/imgextra/i3/O1CN01ZhQ4AV25xBmTK3CnF_!!6000000007592-2-tps-980-980.png_110x10000.jpg_.webp"],["咒骂","https://img.alicdn.com/imgextra/i3/O1CN01r1Zh9927QKb4pnf7k_!!6000000007791-2-tps-980-980.png_110x10000.jpg_.webp"],["疑问","https://img.alicdn.com/imgextra/i4/O1CN01UZqbzt29MmlNctCQS_!!6000000008054-2-tps-980-980.png_110x10000.jpg_.webp"],["嘘","https://img.alicdn.com/imgextra/i1/O1CN01qBlYkM1ojaYF75On5_!!6000000005261-2-tps-980-980.png_110x10000.jpg_.webp"],["晕","https://img.alicdn.com/imgextra/i2/O1CN014zhM2h1wPuSUFoMwV_!!6000000006301-2-tps-980-980.png_110x10000.jpg_.webp"],["开心到模糊","https://img.alicdn.com/imgextra/i1/O1CN01T1Dy271j6akZWo7Vr_!!6000000004499-2-tps-980-980.png_110x10000.jpg_.webp"],["衰","https://img.alicdn.com/imgextra/i1/O1CN01aOXsNr1LmgMvtyzOO_!!6000000001342-2-tps-980-980.png_110x10000.jpg_.webp"],["委屈","https://img.alicdn.com/imgextra/i2/O1CN013J0bMk1QNYih3UFTk_!!6000000001964-2-tps-980-980.png_110x10000.jpg_.webp"],["再见","https://img.alicdn.com/imgextra/i2/O1CN01IHKsQx1UdpFgeTHcA_!!6000000002541-2-tps-980-980.png_110x10000.jpg_.webp"],["鼓掌","https://img.alicdn.com/imgextra/i4/O1CN01DHxB5s1G1RRBxekIu_!!6000000000562-2-tps-980-980.png_110x10000.jpg_.webp"],["吐","https://img.alicdn.com/imgextra/i1/O1CN01xyVxH21LNUaMgW4hh_!!6000000001287-2-tps-980-980.png_110x10000.jpg_.webp"],["坏笑","https://img.alicdn.com/imgextra/i1/O1CN01zV7opv1bIU6iI8OhM_!!6000000003442-2-tps-980-980.png_110x10000.jpg_.webp"],["抠鼻","https://img.alicdn.com/imgextra/i1/O1CN01QOanju1sNqCrtYstu_!!6000000005755-2-tps-980-980.png_110x10000.jpg_.webp"],["叹气","https://img.alicdn.com/imgextra/i3/O1CN01RElx7R1QD1c8ZN07f_!!6000000001941-2-tps-980-980.png_110x10000.jpg_.webp"],["无聊","https://img.alicdn.com/imgextra/i2/O1CN01d91LnZ1UJDQjKCouC_!!6000000002496-2-tps-980-980.png_110x10000.jpg_.webp"],["思考","https://img.alicdn.com/imgextra/i2/O1CN01wQjg2f1tO84ZWitn9_!!6000000005891-2-tps-980-980.png_110x10000.jpg_.webp"],["呆","https://img.alicdn.com/imgextra/i1/O1CN01GLqBWC1DGbhqmpD2L_!!6000000000189-2-tps-980-980.png_110x10000.jpg_.webp"],["哇哦","https://img.alicdn.com/imgextra/i2/O1CN01MtLpS21qRO2bnAA5k_!!6000000005492-2-tps-980-980.png_110x10000.jpg_.webp"],["飞吻","https://img.alicdn.com/imgextra/i4/O1CN01q1WpFE25ljsNKjvHX_!!6000000007567-2-tps-980-980.png_110x10000.jpg_.webp"],["好喜欢","https://img.alicdn.com/imgextra/i2/O1CN01mD4iQM1O57XyQ5SHD_!!6000000001653-2-tps-980-980.png_110x10000.jpg_.webp"],["拜托","https://img.alicdn.com/imgextra/i4/O1CN01SQgrTH1dzCH3pIyRN_!!6000000003806-2-tps-980-980.png_110x10000.jpg_.webp"],["真棒","https://img.alicdn.com/imgextra/i2/O1CN017fcAmd1SCgYCj9Upk_!!6000000002211-2-tps-980-980.png_110x10000.jpg_.webp"],["流鼻血","https://img.alicdn.com/imgextra/i3/O1CN0139JscY1rC6RS9GR4j_!!6000000005594-2-tps-980-980.png_110x10000.jpg_.webp"],["费解","https://img.alicdn.com/imgextra/i1/O1CN01FqAVvR1tyJMPj13ie_!!6000000005970-2-tps-980-980.png_110x10000.jpg_.webp"],["秃头","https://img.alicdn.com/imgextra/i4/O1CN01ZF4bV11thMhqm2Z1h_!!6000000005933-2-tps-980-980.png_110x10000.jpg_.webp"],["嘿哈","https://img.alicdn.com/imgextra/i4/O1CN01ObcOw61FOVlvQg7Mw_!!6000000000477-2-tps-980-980.png_110x10000.jpg_.webp"],["吃土","https://img.alicdn.com/imgextra/i3/O1CN01Z6nJ1b1ZYr22YseHN_!!6000000003207-2-tps-980-980.png_110x10000.jpg_.webp"],["机智","https://img.alicdn.com/imgextra/i1/O1CN01rfKY351zDUZJlBiir_!!6000000006680-2-tps-980-980.png_110x10000.jpg_.webp"],["举杯","https://img.alicdn.com/imgextra/i4/O1CN01R2tn4F1mn8NuEIE8J_!!6000000004998-2-tps-980-980.png_110x10000.jpg_.webp"],["握手","https://img.alicdn.com/imgextra/i4/O1CN01NDcA251JDkvuFhSDb_!!6000000000995-2-tps-980-980.png_110x10000.jpg_.webp"],["挥手","https://img.alicdn.com/imgextra/i4/O1CN01iVN0ht1TmEuSwauGt_!!6000000002424-2-tps-980-980.png_110x10000.jpg_.webp"],["yeah","https://img.alicdn.com/imgextra/i3/O1CN01opt7hh27Wk8omjR4t_!!6000000007805-2-tps-980-980.png_110x10000.jpg_.webp"],["666","https://img.alicdn.com/imgextra/i3/O1CN01YRWDPF1OjQOpXeuTC_!!6000000001741-2-tps-980-980.png_110x10000.jpg_.webp"],["棒","https://img.alicdn.com/imgextra/i3/O1CN01agprvs1HU7rPRxOnB_!!6000000000760-2-tps-980-980.png_110x10000.jpg_.webp"],["爱你","https://img.alicdn.com/imgextra/i1/O1CN01SzxgcH1GSSo6Lwmwk_!!6000000000621-2-tps-980-980.png_110x10000.jpg_.webp"],["比心","https://img.alicdn.com/imgextra/i1/O1CN01YHZ39t1DeQIeb0TWQ_!!6000000000241-2-tps-980-980.png_110x10000.jpg_.webp"],["感谢","https://img.alicdn.com/imgextra/i3/O1CN01ywacF81baLYNeyK1n_!!6000000003481-2-tps-980-980.png_110x10000.jpg_.webp"],["拍手","https://img.alicdn.com/imgextra/i4/O1CN01wbj4wv1K7ArD9AU44_!!6000000001116-2-tps-980-980.png_110x10000.jpg_.webp"],["拉钩","https://img.alicdn.com/imgextra/i1/O1CN01dePkKH1HOd6ivAcu8_!!6000000000748-2-tps-980-980.png_110x10000.jpg_.webp"],["没钱","https://img.alicdn.com/imgextra/i3/O1CN01qhxGjp1zD2AfqmWx5_!!6000000006679-2-tps-980-980.png_110x10000.jpg_.webp"],["小刀","https://img.alicdn.com/imgextra/i3/O1CN01tFVx5Y1T2thPjhR6b_!!6000000002325-2-tps-980-980.png_110x10000.jpg_.webp"],["不刀","https://img.alicdn.com/imgextra/i4/O1CN01zTxff61clcvOcTS3n_!!6000000003641-2-tps-980-980.png_110x10000.jpg_.webp"],["同出","https://img.alicdn.com/imgextra/i3/O1CN01URKas6249R8ozS98O_!!6000000007348-2-tps-980-980.png_110x10000.jpg_.webp"],["递钱","https://img.alicdn.com/imgextra/i4/O1CN01PzhgV51FLlOaZHZ6n_!!6000000000471-2-tps-980-980.png_110x10000.jpg_.webp"],["数钱","https://img.alicdn.com/imgextra/i3/O1CN01CzXXvp23khkljToQH_!!6000000007294-2-tps-980-980.png_110x10000.jpg_.webp"],["打call","https://img.alicdn.com/imgextra/i1/O1CN01X7VUVm1il48IYv8Qw_!!6000000004452-2-tps-980-980.png_110x10000.jpg_.webp"],["号外","https://img.alicdn.com/imgextra/i2/O1CN01vg6xSM1Vxo9EKyfjR_!!6000000002720-2-tps-980-980.png_110x10000.jpg_.webp"],["包邮","https://img.alicdn.com/imgextra/i3/O1CN01yVS7ys24jA22oVZ2T_!!6000000007426-2-tps-980-980.png_110x10000.jpg_.webp"],["求赞","https://img.alicdn.com/imgextra/i1/O1CN01Xwqi5A1giCQMRcX6N_!!6000000004175-2-tps-980-980.png_110x10000.jpg_.webp"],["非主流","https://img.alicdn.com/imgextra/i1/O1CN013wyI1j1hlEfDUoATI_!!6000000004317-2-tps-980-980.png_110x10000.jpg_.webp"],["吃瓜","https://img.alicdn.com/imgextra/i1/O1CN01LLOFsh1UUCw0deZba_!!6000000002520-2-tps-980-980.png_110x10000.jpg_.webp"],["种草","https://img.alicdn.com/imgextra/i2/O1CN01ooeRC81hA8a4x9S3q_!!6000000004236-2-tps-980-980.png_110x10000.jpg_.webp"],["佛系","https://img.alicdn.com/imgextra/i4/O1CN01BYXEe321GMHMZ9w66_!!6000000006957-2-tps-980-980.png_110x10000.jpg_.webp"],["超便宜","https://img.alicdn.com/imgextra/i4/O1CN01mqgSZi1Er4rOIDiP7_!!6000000000404-2-tps-980-980.png_110x10000.jpg_.webp"],["拥抱","https://img.alicdn.com/imgextra/i1/O1CN01yuGD9c1hJkttfKHAm_!!6000000004257-2-tps-980-980.png_110x10000.jpg_.webp"],["摊手","https://img.alicdn.com/imgextra/i2/O1CN014AiIqE1o9repE6STR_!!6000000005183-2-tps-980-980.png_110x10000.jpg_.webp"],["举手","https://img.alicdn.com/imgextra/i1/O1CN01xizuHZ1WPkJCogbuj_!!6000000002781-2-tps-980-980.png_110x10000.jpg_.webp"],["蹲","https://img.alicdn.com/imgextra/i3/O1CN01Midjjn1FrMj2CWer6_!!6000000000540-2-tps-980-980.png_110x10000.jpg_.webp"],["跪了","https://img.alicdn.com/imgextra/i3/O1CN01F2y52j24E16L6RIjF_!!6000000007358-2-tps-980-980.png_110x10000.jpg_.webp"],["拜","https://img.alicdn.com/imgextra/i4/O1CN01Jldd1G1oXDrEHH2qr_!!6000000005234-2-tps-980-980.png_110x10000.jpg_.webp"],["排","https://img.alicdn.com/imgextra/i3/O1CN01uSUmYD1jD0IJf0UVU_!!6000000004513-2-tps-980-980.png_110x10000.jpg_.webp"],["旺财","https://img.alicdn.com/imgextra/i3/O1CN01A25Mv01DKjGseAmuP_!!6000000000198-2-tps-980-980.png_110x10000.jpg_.webp"],["招财猫","https://img.alicdn.com/imgextra/i3/O1CN01WmJ7Sr20EhDyp86Bd_!!6000000006818-2-tps-980-980.png_110x10000.jpg_.webp"],["酸了","https://img.alicdn.com/imgextra/i3/O1CN01UFgjn61JJi5Iqxdk7_!!6000000001008-2-tps-980-980.png_110x10000.jpg_.webp"],["鸭鸭","https://img.alicdn.com/imgextra/i3/O1CN01pHSCSQ1deaS8WDiqG_!!6000000003761-2-tps-980-980.png_110x10000.jpg_.webp"],["方了","https://img.alicdn.com/imgextra/i3/O1CN01br7g711whlu8xOPUt_!!6000000006340-2-tps-980-980.png_110x10000.jpg_.webp"],["白菜","https://img.alicdn.com/imgextra/i1/O1CN01KABFLt24WKwXjVp08_!!6000000007398-2-tps-980-980.png_110x10000.jpg_.webp"],["桃子","https://img.alicdn.com/imgextra/i1/O1CN01CQhhPH1vJfRjDGBv5_!!6000000006152-2-tps-980-980.png_110x10000.jpg_.webp"],["打包","https://img.alicdn.com/imgextra/i3/O1CN01oYOkUI1VT7c0ivZHV_!!6000000002653-2-tps-980-980.png_110x10000.jpg_.webp"],["沙发","https://img.alicdn.com/imgextra/i4/O1CN018qUFaE1DGbhqpMIit_!!6000000000189-2-tps-980-980.png_110x10000.jpg_.webp"],["南","https://img.alicdn.com/imgextra/i1/O1CN01ZSA6wg1PEZKf4h99R_!!6000000001809-2-tps-980-980.png_110x10000.jpg_.webp"],["盯","https://img.alicdn.com/imgextra/i4/O1CN01OWB1Gx1s01bzBhHN6_!!6000000005703-2-tps-980-980.png_110x10000.jpg_.webp"],["hot","https://img.alicdn.com/imgextra/i4/O1CN01DDD9uA22cAl7VDH7d_!!6000000007140-2-tps-980-980.png_110x10000.jpg_.webp"],["new","https://img.alicdn.com/imgextra/i3/O1CN01rRJXJo1qwzN4YnOHX_!!6000000005561-2-tps-980-980.png_110x10000.jpg_.webp"],["cool","https://img.alicdn.com/imgextra/i4/O1CN013bUubF2855qb2Qt5l_!!6000000007880-2-tps-980-980.png_110x10000.jpg_.webp"],["1","https://img.alicdn.com/imgextra/i1/O1CN01U8XG5y1Ie22frQHCQ_!!6000000000917-2-tps-980-980.png_110x10000.jpg_.webp"],["可","https://img.alicdn.com/imgextra/i2/O1CN01SMjtPG1iJaN17p94N_!!6000000004392-2-tps-980-980.png_110x10000.jpg_.webp"],["搬砖","https://img.alicdn.com/imgextra/i1/O1CN01GbqW6G1LOrm0Gllcb_!!6000000001290-2-tps-980-980.png_110x10000.jpg_.webp"],["菜狗","https://img.alicdn.com/imgextra/i2/O1CN01VtN0t91USNLmvfmol_!!6000000002516-2-tps-980-980.png_110x10000.jpg_.webp"],["开心面具","https://img.alicdn.com/imgextra/i3/O1CN017elkpk22EoYlBPKd3_!!6000000007089-2-tps-980-980.png_110x10000.jpg_.webp"],["快递","https://img.alicdn.com/imgextra/i2/O1CN01AmUZXk1d3wle5O8IJ_!!6000000003681-2-tps-980-980.png_110x10000.jpg_.webp"],["裂开","https://img.alicdn.com/imgextra/i1/O1CN01BihwvO1a5N9bFt0LU_!!6000000003278-2-tps-980-980.png_110x10000.jpg_.webp"],["啤酒","https://img.alicdn.com/imgextra/i4/O1CN01jDkgEj1WvLdXUVBDx_!!6000000002850-2-tps-980-980.png_110x10000.jpg_.webp"],["瑞思拜","https://img.alicdn.com/imgextra/i4/O1CN011gR0Um1K3VgpYjPOi_!!6000000001108-2-tps-980-980.png_110x10000.jpg_.webp"],["小丑","https://img.alicdn.com/imgextra/i3/O1CN01jMikhO1NJUM15XKTf_!!6000000001549-2-tps-980-980.png_110x10000.jpg_.webp"],["爱心","https://img.alicdn.com/imgextra/i1/O1CN015RVSWf23s25eETJqO_!!6000000007310-2-tps-980-980.png_110x10000.jpg_.webp"]],we=r=>r,Ne=new Map(K0.map(([r,l])=>[r,l])),ye=r=>r.split(/(\[[^\]]+\])/g).map((l,s)=>{const n=l.startsWith("[")?Ne.get(l.slice(1,-1)):void 0;return n?e.jsx("img",{src:n,alt:l,title:l,className:"mx-0.5 inline-block h-7 w-7 align-middle"},s):e.jsx(h0.Fragment,{children:l},s)}),Ce=async r=>k0("/api/v1/accounts/details",void 0,r),J0=async r=>k0("/api/v1/accounts/runtime-status",void 0,r),F0=async(r,l,s,n=!1)=>{const u=await k0("/api/v1/chat/sessions",{account_id:r,cursor:l,refresh:n?1:void 0},n?{timeoutMs:6e4,...s}:s),w=X0(u,["data","result"])||{};return{sessions:w.sessions||[],has_more:w.has_more===!0,next_cursor:w.next_cursor}},W0=async(r,l,s,n,u)=>{const w=await k0("/api/v1/chat/messages",{account_id:r,chat_id:l,cursor:s,before_id:n},u),h=X0(w,["data","result"])||{};return{messages:h.messages||[],has_more:h.has_more===!0,next_cursor:h.next_cursor,session:h.session}},Oe=async(r,l)=>G0("/api/v1/chat/messages",r,l),ve=async(r,l)=>{const s=new FormData;return Object.entries(r).forEach(([n,u])=>s.append(n,u)),pe("/api/v1/chat/images",s,{timeoutMs:12e4,...l})},Q0=async(r,l,s,n)=>G0("/api/v1/chat/read",{account_id:r,chat_id:l,message_ids:s},n),A0=r=>{const l=Number.isFinite(r)?Math.max(0,Math.floor(r)):0;return l>99?"99+":String(l)},V0=r=>(Number.isFinite(r)?Math.max(0,Math.floor(r)):0)<10?"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-red-500 text-[10px] font-bold leading-none text-white":"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-red-500 px-1.5 text-[10px] font-bold leading-none text-white",Z0=(r,l)=>r.filter(s=>s.direction==="incoming"&&s.message_type!=="system"&&!s.message_key.startsWith("in-")).map(s=>({messageId:s.message_key,sessionId:l,cid:`${l}@goofish`,conversationType:1})),ke=(r,l,s)=>{const n=l.trim().toLowerCase();return r.filter(u=>s&&u.unread_count<=0?!1:n?[u.buyer_name,u.buyer_id,u.item_title,u.last_message].some(w=>(w||"").toLowerCase().includes(n)):!0)},Se=(r,l)=>{const s=new Set(r.map(n=>n.message_key));return[...l.filter(n=>!s.has(n.message_key)),...r]},H0=(r,l)=>{const s=r.findIndex(n=>n.message_key===l.message_key);return s<0?[...r,l]:r.map((n,u)=>u===s?l:n)},Re=(r,l)=>{if(l.direction!=="incoming"||l.message_type==="system")return r;const s=l.sent_at>0?l.sent_at:Date.now();return r.map(n=>n.chat_id===l.chat_id&&n.direction==="outgoing"&&n.status==="sent"&&n.sent_at<=l.sent_at?{...n,read_status:2,read_at:s}:n)},y=(r,l,s)=>r===l&&!s.aborted,Y=r=>r instanceof Error&&r.message==="请求已取消",Ee=r=>{if(!r)return"";const l=new Date(r<1e10?r*1e3:r),s=new Date;return l.toDateString()===s.toDateString()?l.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1}):l.toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit"})},Ie=r=>new Date(r<1e10?r*1e3:r).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}),De=()=>{const[r,l]=i.useState([]),[s,n]=i.useState(""),[u,w]=i.useState({}),[h,$]=i.useState(""),[L,R]=i.useState([]),[e0,S0]=i.useState(""),[A,R0]=i.useState(!1),[H,_0]=i.useState(""),[q,O]=i.useState(null),[b0,T]=i.useState(!0),[U,f0]=i.useState(!1),[W,j0]=i.useState(!1),[t0,w0]=i.useState(!1),[N0,s0]=i.useState(),[a0,i0]=i.useState({}),[n0,r0]=i.useState({}),[l0,c0]=i.useState(!1),[E0,I0]=i.useState(!1),[C,F]=i.useState(!1),[D0,N]=i.useState(""),[M0,o0]=i.useState("connecting"),[Q,m0]=i.useState(null),[V,p0]=i.useState(null),E=i.useRef(""),Z=i.useRef(""),P=i.useRef(null),G=i.useRef({accountID:"",chatID:""}),g0=i.useRef(!0),a=i.useRef(!1),_=i.useRef(null),k=i.useRef(new Set),I=i.useRef(0),z=i.useRef(null),B=i.useRef(0),L0=i.useRef(null),J=i.useRef(0),d0=i.useRef(null),x0=i.useRef(0),y0=i.useRef(null),D=i.useRef(0),X=i.useRef(null);i.useEffect(()=>{E.current=s},[s]),i.useEffect(()=>{Z.current=h},[h]);const u0=i.useCallback(async t=>{var o;const m=++I.current;(o=z.current)==null||o.abort();const p=new AbortController;z.current=p;try{const c=await F0(t,void 0,{signal:p.signal},!0);if(!y(I.current,m,p.signal))return[];const d=c.sessions.map(g=>t===E.current&&g.chat_id===Z.current?{...g,unread_count:0}:g);return w(g=>({...g,[t]:d})),i0(g=>({...g,[t]:c.next_cursor})),r0(g=>({...g,[t]:c.has_more})),d}catch(c){return y(I.current,m,p.signal)&&!Y(c)&&N(c instanceof Error?c.message:"同步会话失败"),[]}},[]);i.useEffect(()=>{const t=new AbortController;return(async()=>{var p;T(!0);try{const[o,c]=await Promise.all([Ce({signal:t.signal}),J0({signal:t.signal})]),g=o.map(b=>{var v,T0;return{...b,runtime_state:((v=c[b.id])==null?void 0:v.state)||(b.enabled?"connecting":"disabled"),runtime_connected:((T0=c[b.id])==null?void 0:T0.connected)===!0}}).filter(b=>b.enabled),j=await Promise.all(g.map(async b=>[b.id,await F0(b.id,void 0,{signal:t.signal})]));if(t.signal.aborted)return;l(g),w(Object.fromEntries(j.map(([b,v])=>[b,v.sessions]))),i0(Object.fromEntries(j.map(([b,v])=>[b,v.next_cursor]))),r0(Object.fromEntries(j.map(([b,v])=>[b,v.has_more])));const x=window.localStorage.getItem("ydisks.chat.account.v1")||"",S=g.some(b=>b.id===x)?x:((p=g[0])==null?void 0:p.id)||"";n(S)}catch(o){t.signal.aborted||N(o instanceof Error?o.message:"加载聊天数据失败")}finally{t.signal.aborted||T(!1)}})(),(()=>t.abort())},[]),i.useEffect(()=>{let t=!1,m=0,p=null;const o=async()=>{p=new AbortController;try{const c=await J0({signal:p.signal,timeoutMs:1e4});t||l(d=>d.map(g=>{var j,x;return{...g,runtime_state:((j=c[g.id])==null?void 0:j.state)||g.runtime_state,runtime_connected:((x=c[g.id])==null?void 0:x.connected)??g.runtime_connected}}))}catch{}finally{t||(m=window.setTimeout(o,3e3))}};return m=window.setTimeout(o,3e3),(()=>{t=!0,window.clearTimeout(m),p==null||p.abort()})},[]),i.useEffect(()=>{if(!s)return;window.localStorage.setItem("ydisks.chat.account.v1",s);const t=u[s]||[];$(m=>{var p;return t.some(o=>o.chat_id===m)?m:((p=t[0])==null?void 0:p.chat_id)||""})},[s,u]),i.useEffect(()=>{!s||k.current.has(s)||(k.current.add(s),u0(s))},[s,u0]),i.useEffect(()=>{var p,o;if(!s||!h){B.current+=1,J.current+=1,(p=d0.current)==null||p.abort(),a.current=!1,R([]);return}const t=++B.current;(o=L0.current)==null||o.abort();const m=new AbortController;return L0.current=m,f0(!0),W0(s,h,void 0,void 0,{signal:m.signal}).then(c=>{if(!y(B.current,t,m.signal))return;const d=Z0(c.messages,h);Q0(s,h,d,{signal:m.signal}),R(c.messages),w0(c.has_more),s0(c.next_cursor),c.session&&w(g=>({...g,[s]:(g[s]||[]).map(j=>{var x;return j.chat_id===((x=c.session)==null?void 0:x.chat_id)?c.session:j})})),w(g=>({...g,[s]:(g[s]||[]).map(j=>j.chat_id===h?{...j,unread_count:0}:j)}))}).catch(c=>{y(B.current,t,m.signal)&&!Y(c)&&N(c instanceof Error?c.message:"加载消息失败")}).finally(()=>{y(B.current,t,m.signal)&&f0(!1)}),(()=>m.abort())},[s,h]),i.useEffect(()=>{var t;(t=y0.current)==null||t.abort(),x0.current+=1},[s]),i.useEffect(()=>{var t;(t=X.current)==null||t.abort(),D.current+=1},[s,h]),i.useEffect(()=>{O(null)},[s,h]),i.useEffect(()=>{var t;J.current+=1,(t=d0.current)==null||t.abort(),a.current=!1},[s,h]),i.useEffect(()=>(()=>{var t,m,p,o,c;(t=z.current)==null||t.abort(),(m=L0.current)==null||m.abort(),J.current+=1,(p=d0.current)==null||p.abort(),(o=y0.current)==null||o.abort(),(c=X.current)==null||c.abort()}),[]),i.useEffect(()=>{const t=q;return(()=>{t&&URL.revokeObjectURL(t.url)})},[q]);const Y0=i.useCallback(async()=>{var d,g;if(!s||!h||W||!t0)return;const t=P.current,m=(t==null?void 0:t.scrollHeight)||0,p=B.current,o=++J.current;(d=d0.current)==null||d.abort();const c=new AbortController;d0.current=c,a.current=!0,j0(!0),N("");try{const j=(g=L[0])==null?void 0:g.id,x=await W0(s,h,N0,j,{signal:c.signal});if(!y(B.current,p,c.signal)||o!==J.current)return;R(S=>Se(S,x.messages)),w0(x.has_more),s0(x.next_cursor),requestAnimationFrame(()=>{o===J.current&&!c.signal.aborted&&t&&(t.scrollTop+=t.scrollHeight-m)})}catch(j){a.current=!1,Y(j)||N(j instanceof Error?j.message:"加载历史消息失败")}finally{o===J.current&&j0(!1)}},[s,h,t0,N0,L,W]);i.useEffect(()=>{let t=!1,m=0,p=0,o=null;const c=()=>{if(t)return;o0("connecting");const d=window.location.protocol==="https:"?"wss:":"ws:";o=new WebSocket(`${d}//${window.location.host}/api/v1/chat/ws`),o.onopen=()=>{p=0,o0("online")},o.onmessage=g=>{try{const x=JSON.parse(g.data).message;if(!x)return;const S=x.account_id;if(w(b=>{const v=b[S]||[];return v.some(M=>M.chat_id===x.chat_id)?{...b,[S]:v.map(M=>M.chat_id===x.chat_id?{...M,last_message:x.content,last_message_at:x.sent_at,unread_count:x.direction==="incoming"&&x.message_type!=="system"&&(E.current!==S||Z.current!==x.chat_id)?M.unread_count+1:M.unread_count}:M).sort((M,oe)=>oe.last_message_at-M.last_message_at)}:(u0(S),b)}),E.current===S&&Z.current===x.chat_id&&(R(b=>Re(H0(b,x),x)),x.direction==="incoming"&&x.message_type!=="system")){const b=Z0([x],x.chat_id);Q0(S,x.chat_id,b)}}catch{}},o.onclose=()=>{if(t)return;o0("offline");const g=Math.min(15e3,1e3*2**Math.min(p++,4));m=window.setTimeout(c,g)},o.onerror=()=>o==null?void 0:o.close()};return c(),(()=>{t=!0,window.clearTimeout(m),o==null||o.close()})},[u0]);const $0=i.useCallback(()=>{const t=P.current;if(!t)return;const m=t.scrollHeight-t.scrollTop-t.clientHeight;g0.current=m<=48},[]);i.useLayoutEffect(()=>{const t=G.current.accountID!==s||G.current.chatID!==h;G.current={accountID:s,chatID:h},t&&(g0.current=!0);const m=P.current;if(m){if(a.current){a.current=!1;return}(U||g0.current)&&(m.scrollTop=m.scrollHeight)}},[s,h,L,U]);const ee=r.find(t=>t.id===s),C0=u[s]||[],f=C0.find(t=>t.chat_id===h),te=i.useMemo(()=>ke(C0,e0,A),[C0,e0,A]),se=i.useCallback(t=>(u[t]||[]).reduce((m,p)=>m+p.unread_count,0),[u]),ae=i.useCallback(async()=>{var o;if(!s||l0||!n0[s])return;const t=++x0.current;(o=y0.current)==null||o.abort();const m=new AbortController;y0.current=m;const p=s;c0(!0),N("");try{const c=await F0(p,a0[p],{signal:m.signal},!0);if(!y(x0.current,t,m.signal))return;w(d=>({...d,[p]:c.sessions})),i0(d=>({...d,[p]:c.next_cursor})),r0(d=>({...d,[p]:c.has_more}))}catch(c){y(x0.current,t,m.signal)&&!Y(c)&&N(c instanceof Error?c.message:"加载历史联系人失败")}finally{y(x0.current,t,m.signal)&&c0(!1)}},[s,a0,l0,n0]),O0=i.useCallback(async(t,m)=>{var c;if(!f||!s||C)return;const p=++D.current;(c=X.current)==null||c.abort();const o=new AbortController;X.current=o,F(!0),N("");try{const d=await Oe({account_id:s,chat_id:f.chat_id,buyer_id:f.buyer_id,buyer_name:f.buyer_name,item_id:f.item_id,item_title:f.item_title,text:t},{signal:o.signal});if(!y(D.current,p,o.signal))return;_0(""),m0(null),R(g=>H0(g,d.message))}catch(d){y(D.current,p,o.signal)&&(m&&m0(t),Y(d)||N(d instanceof Error?d.message:"消息发送失败"))}finally{y(D.current,p,o.signal)&&F(!1)}},[s,f,C]),v0=i.useCallback(async(t,m)=>{var c;if(!f||!s||C)return;const p=++D.current;(c=X.current)==null||c.abort();const o=new AbortController;X.current=o,F(!0),N("");try{const d=await ve({account_id:s,chat_id:f.chat_id,buyer_id:f.buyer_id,buyer_name:f.buyer_name,buyer_avatar_url:f.buyer_avatar_url,item_id:f.item_id,item_title:f.item_title,image:t},{signal:o.signal});if(!y(D.current,p,o.signal))return;p0(null),R(g=>H0(g,d.message))}catch(d){y(D.current,p,o.signal)&&(m&&p0(t),Y(d)||N(d instanceof Error?d.message:"图片发送失败"))}finally{y(D.current,p,o.signal)&&(F(!1),_.current&&(_.current.value=""))}},[s,f,C]),ie=i.useCallback(async()=>{const t=H.trim();!t||!f||!s||C||await O0(t,!0)},[s,H,f,O0,C]),q0=i.useCallback(async t=>{if(!(!t||!f||!s||C)){if(!t.type.startsWith("image/")){N("仅支持粘贴/发送图片文件");return}N(""),O({file:t,url:URL.createObjectURL(t)})}},[s,f,C]),ne=i.useCallback(async t=>{const m=t.find(p=>p.type.startsWith("image/"));m&&await q0(m)},[q0]),re=i.useCallback(()=>{O(null),_.current&&(_.current.value="")},[]),le=i.useCallback(async()=>{if(!q||!f||!s||C)return;const t=q.file;O(null),await v0(t,!0)},[s,q,f,v0,C]),ce=i.useCallback(async()=>{Q?await O0(Q,!1):V&&await v0(V,!1)},[V,Q,v0,O0]);return{accounts:r,activeAccountID:s,activeSessions:C0,selectedSession:f,activeAccount:ee,messages:L,search:e0,unreadOnly:A,draft:H,loading:b0,messagesLoading:U,olderLoading:W,hasOlder:t0,contactsLoading:l0,hasMoreContacts:n0[s]===!0,emojiOpen:E0,sending:C,error:D0,liveState:M0,pendingImage:q,activeChatID:h,filteredSessions:te,scrollRef:P,imageInputRef:_,setActiveAccountID:n,setActiveChatID:$,setSearch:S0,setUnreadOnly:R0,setDraft:_0,setEmojiOpen:I0,reloadSessions:u0,loadMoreContacts:ae,loadOlderMessages:Y0,handleMessageScroll:$0,handleSend:ie,handleImage:q0,handlePastedImages:ne,confirmSendImage:le,closeImagePreview:re,retrySend:ce,retryAvailable:!!(Q||V),unreadForAccount:se,emojiURL:we,xianyuEmojis:K0,renderXianyuText:ye,formatClock:Ee,messageTime:Ie}},Fe=()=>{const{accounts:r,activeAccountID:l,activeChatID:s,activeAccount:n,selectedSession:u,filteredSessions:w,messages:h,search:$,unreadOnly:L,draft:R,loading:e0,messagesLoading:S0,olderLoading:A,hasOlder:R0,contactsLoading:H,hasMoreContacts:_0,emojiOpen:q,sending:O,error:b0,liveState:T,pendingImage:U,scrollRef:f0,imageInputRef:W,setActiveAccountID:j0,setActiveChatID:t0,setSearch:w0,setUnreadOnly:N0,setDraft:s0,setEmojiOpen:a0,reloadSessions:i0,loadMoreContacts:n0,loadOlderMessages:r0,handleMessageScroll:l0,handleSend:c0,handleImage:E0,handlePastedImages:I0,confirmSendImage:C,closeImagePreview:F,retrySend:D0,retryAvailable:N,unreadForAccount:M0,emojiURL:o0,xianyuEmojis:Q,renderXianyuText:m0,formatClock:V,messageTime:p0}=De(),E=h0.useMemo(()=>h.filter(a=>a.message_type==="image"),[h]),Z=h0.useMemo(()=>E.map(a=>({src:a.content,alt:"聊天图片"})),[E]),[P,G]=h0.useState(-1),g0=h0.useCallback(a=>{G(E.findIndex(_=>_.message_key===a))},[E]);return e0?e.jsx("div",{className:"flex h-[calc(100vh-4rem)] items-center justify-center",children:e.jsx(K,{className:"h-8 w-8 animate-spin text-sky-500"})}):e.jsxs("section",{className:"flex h-[calc(100vh-4rem)] min-h-[560px] flex-col overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-chat",children:[e.jsxs("header",{className:"border-b border-slate-200 bg-slate-50/70 px-5 pt-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-black tracking-tight text-slate-950",children:"在线聊天"}),e.jsx("p",{className:"mt-0.5 text-xs font-medium text-slate-500",children:"复用账号实时连接,消息按账号完全隔离"})]}),e.jsxs("div",{className:`flex items-center gap-2 rounded-full px-3 py-1.5 text-xs font-bold ${T==="online"?"bg-emerald-50 text-emerald-700":T==="connecting"?"bg-amber-50 text-amber-700":"bg-red-50 text-red-700"}`,children:[T==="online"?e.jsx(ge,{className:"h-3.5 w-3.5"}):e.jsx(de,{className:"h-3.5 w-3.5"}),T==="online"?"实时同步中":T==="connecting"?"正在连接":"连接已断开"]})]}),e.jsx("div",{className:"flex gap-1 overflow-x-auto pb-0",role:"tablist","aria-label":"聊天账号",children:r.map(a=>{const _=a.id===l,k=M0(a.id),I=A0(k),z=a.runtime_state==="online";return e.jsxs("button",{type:"button",role:"tab","aria-selected":_,onClick:(()=>j0(a.id)),className:`relative flex h-11 shrink-0 items-center gap-2 border-b-2 px-3 text-sm font-extrabold transition-colors ${_?"border-sky-500 text-sky-700":"border-transparent text-slate-500 hover:text-slate-900"}`,children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${z?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{className:"max-w-36 truncate",children:a.nickname||a.remark||a.id}),k>0&&e.jsx("span",{"aria-label":`未读消息 ${I} 条`,className:V0(k),children:I})]},a.id)})})]}),r.length===0?e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center text-center",children:[e.jsx(P0,{className:"h-12 w-12 text-slate-300"}),e.jsx("h3",{className:"mt-4 font-black text-slate-800",children:"暂无启用账号"}),e.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"先在账号管理中启用账号,聊天会话会自动出现。"})]}):e.jsxs("div",{className:"grid min-h-0 flex-1 overflow-hidden grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-slate-200 bg-slate-50/40",children:[e.jsxs("div",{className:"space-y-3 border-b border-slate-200 p-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(xe,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),e.jsx("input",{value:$,onChange:(a=>w0(a.target.value)),placeholder:"搜索用户、商品或消息",className:"h-10 w-full rounded-xl border border-slate-200 bg-white pl-9 pr-3 text-sm outline-none transition focus:border-sky-400 focus:ring-2 focus:ring-sky-100"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("button",{type:"button",onClick:(()=>N0(a=>!a)),className:`rounded-lg px-2.5 py-1.5 text-xs font-bold ${L?"bg-sky-100 text-sky-700":"text-slate-500 hover:bg-slate-100"}`,children:L?"只看未读":"全部会话"}),e.jsx("button",{type:"button",title:"刷新会话",onClick:(()=>void i0(l)),className:"rounded-lg p-2 text-slate-400 hover:bg-slate-100 hover:text-slate-700",children:e.jsx(ue,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[w.map(a=>e.jsxs("button",{type:"button",onClick:(()=>t0(a.chat_id)),className:`flex w-full gap-3 border-b border-slate-100 p-4 text-left transition-colors ${a.chat_id===s?"bg-white shadow-chat-active":"hover:bg-white/80"}`,children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-slate-200 text-slate-500",children:a.buyer_avatar_url?e.jsx("img",{src:a.buyer_avatar_url,alt:"",className:"h-full w-full object-cover"}):e.jsx(U0,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-extrabold text-slate-900",children:a.buyer_name||`用户 ${a.buyer_id}`}),e.jsx("span",{className:"ml-auto shrink-0 text-[10px] font-medium text-slate-400",children:V(a.last_message_at)})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-xs text-slate-500",children:a.last_message||"暂无消息"}),a.unread_count>0&&e.jsx("span",{"aria-label":`未读消息 ${A0(a.unread_count)} 条`,className:`ml-auto ${V0(a.unread_count)}`,children:A0(a.unread_count)})]}),a.item_title&&e.jsxs("div",{className:"mt-1.5 truncate text-[10px] font-medium text-sky-700",children:["商品 · ",a.item_title]})]})]},a.chat_id)),w.length===0&&e.jsx("div",{className:"px-6 py-16 text-center text-sm text-slate-400",children:"当前账号暂无匹配会话"}),_0&&!$&&!L&&e.jsx("div",{className:"flex justify-center p-4",children:e.jsxs("button",{type:"button",onClick:(()=>void n0()),disabled:H,className:"flex items-center gap-2 rounded-full border border-slate-200 bg-white px-4 py-2 text-xs font-bold text-slate-500 shadow-sm hover:border-sky-200 hover:text-sky-600 disabled:opacity-50",children:[H&&e.jsx(K,{className:"h-3.5 w-3.5 animate-spin"}),H?"正在加载":"加载更多历史联系人"]})})]})]}),e.jsx("main",{className:"flex min-h-0 min-w-0 flex-col overflow-hidden bg-surface-subtle",children:u?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-16 shrink-0 items-center border-b border-slate-200 bg-white px-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-black text-slate-950",children:u.buyer_name||u.buyer_id}),e.jsxs("div",{className:"mt-0.5 truncate text-xs text-slate-500",children:["用户 ID:",u.buyer_id]})]}),e.jsx("span",{className:`ml-auto rounded-full px-2.5 py-1 text-[10px] font-bold ${(n==null?void 0:n.runtime_state)==="online"?"bg-emerald-50 text-emerald-700":"bg-slate-100 text-slate-500"}`,children:(n==null?void 0:n.runtime_state)==="online"?"账号在线":"账号离线"})]}),e.jsx("div",{ref:f0,onScroll:l0,className:"min-h-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:S0?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(K,{className:"h-6 w-6 animate-spin text-sky-500"})}):e.jsxs(e.Fragment,{children:[R0&&e.jsx("div",{className:"flex justify-center pb-1",children:e.jsxs("button",{type:"button",onClick:(()=>void r0()),disabled:A,className:"flex items-center gap-2 rounded-full border border-slate-200 bg-white px-4 py-1.5 text-xs font-bold text-slate-500 shadow-sm transition hover:border-sky-200 hover:text-sky-600 disabled:opacity-50",children:[A&&e.jsx(K,{className:"h-3.5 w-3.5 animate-spin"}),A?"正在加载":"加载更早消息"]})}),h.map(a=>{const _=a.direction==="outgoing";return a.message_type==="system"?e.jsx("div",{className:"flex justify-center py-1",children:e.jsxs("div",{className:"max-w-[82%] rounded-xl border border-slate-200 bg-slate-100 px-4 py-2 text-center text-xs leading-5 text-slate-500",children:[m0(a.content),e.jsx("div",{className:"mt-1 text-[10px] text-slate-400",children:p0(a.sent_at)})]})},a.message_key):e.jsxs("div",{className:`flex items-end gap-2.5 ${_?"justify-end":"justify-start"}`,children:[!_&&e.jsx("div",{className:"h-9 w-9 shrink-0 overflow-hidden rounded-full bg-slate-200 ring-2 ring-white",children:u.buyer_avatar_url?e.jsx("img",{src:u.buyer_avatar_url,alt:u.buyer_name||"用户",className:"h-full w-full object-cover"}):e.jsx(U0,{className:"m-2 h-5 w-5 text-slate-500"})}),e.jsxs("div",{className:`max-w-[72%] ${_?"items-end":"items-start"} flex flex-col`,children:[e.jsx("div",{className:"mb-1 px-1 text-[10px] font-semibold text-slate-400",children:_?(n==null?void 0:n.nickname)||(n==null?void 0:n.remark)||"我":u.buyer_name||a.sender_name||u.buyer_id}),a.message_type==="image"?e.jsx("button",{type:"button",title:"点击预览大图",onClick:g0.bind(null,a.message_key),className:`block cursor-zoom-in overflow-hidden rounded-2xl border bg-white p-1 text-left shadow-sm ${_?"rounded-br-md border-sky-200":"rounded-bl-md border-slate-200"}`,children:e.jsx("img",{src:a.content,alt:"聊天图片",className:"max-h-80 max-w-full rounded-xl object-contain"})}):a.message_type==="video"?e.jsx("video",{src:a.content,controls:!0,preload:"metadata",className:"max-h-80 max-w-full rounded-2xl bg-black"}):e.jsx("div",{className:`rounded-2xl px-4 py-2.5 text-sm leading-6 shadow-sm ${_?"rounded-br-md bg-sky-500 text-white":"rounded-bl-md border border-slate-200 bg-white text-slate-800"}`,children:m0(a.content)}),e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-[10px] text-slate-400",children:[p0(a.sent_at),_&&(a.status==="failed"?e.jsx(he,{className:"h-3 w-3 text-red-500","aria-label":"发送失败"}):a.read_status===2?e.jsx(_e,{className:"h-3 w-3 text-sky-500","aria-label":"对方已读"}):a.status==="sent"?e.jsx(z0,{className:"h-3 w-3 text-sky-500","aria-label":"已发送未读"}):e.jsx(z0,{className:"h-3 w-3","aria-label":"发送中"}))]})]}),_&&e.jsx("div",{className:"h-9 w-9 shrink-0 overflow-hidden rounded-full bg-sky-100 ring-2 ring-white",children:n!=null&&n.avatar_url?e.jsx("img",{src:n.avatar_url,alt:"我",className:"h-full w-full object-cover"}):e.jsx(U0,{className:"m-2 h-5 w-5 text-sky-600"})})]},a.message_key)})]})}),b0&&e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-red-100 bg-red-50 px-5 py-2 text-xs font-medium text-red-700",children:[e.jsx("span",{children:b0}),N&&e.jsx("button",{type:"button",className:"font-bold underline",onClick:(()=>void D0()),children:"重试发送"})]}),e.jsxs("div",{className:"relative z-10 shrink-0 border-t border-slate-200 bg-white p-4 shadow-chat-input",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-1",children:[e.jsxs("div",{className:"relative",children:[e.jsx("button",{type:"button",onClick:(()=>a0(a=>!a)),disabled:O||(n==null?void 0:n.runtime_state)!=="online",className:"rounded-lg p-2 text-slate-500 hover:bg-sky-50 hover:text-sky-600 disabled:opacity-40",title:"闲鱼表情",children:e.jsx(be,{className:"h-5 w-5"})}),q&&e.jsxs("div",{className:"absolute bottom-11 left-0 z-30 w-[360px] rounded-2xl border border-slate-200 bg-white p-3 shadow-2xl",children:[e.jsx("div",{className:"mb-2 text-xs font-bold text-slate-500",children:"全部表情"}),e.jsx("div",{className:"grid max-h-72 grid-cols-8 gap-1 overflow-y-auto",children:Q.map(([a,_])=>e.jsx("button",{type:"button",title:`[${a}]`,onClick:(()=>{s0(k=>k+`[${a}]`),a0(!1)}),className:"flex h-10 w-10 items-center justify-center rounded-lg hover:bg-slate-100",children:e.jsx("img",{src:o0(_),alt:`[${a}]`,className:"h-8 w-8 object-contain"})},a))})]})]}),e.jsx("input",{ref:W,type:"file",accept:"image/*",className:"hidden",onChange:(a=>{var _;return void E0((_=a.target.files)==null?void 0:_[0])})}),e.jsx("button",{type:"button",onClick:(()=>{var a;return(a=W.current)==null?void 0:a.click()}),disabled:O||(n==null?void 0:n.runtime_state)!=="online",className:"rounded-lg p-2 text-slate-500 transition hover:bg-sky-50 hover:text-sky-600 disabled:opacity-40",title:"发送图片(最大 10MB)",children:e.jsx(fe,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"flex items-end gap-3 rounded-2xl border border-slate-200 bg-slate-50 p-2 transition focus-within:border-sky-400 focus-within:ring-2 focus-within:ring-sky-100",children:[e.jsx("textarea",{value:R,onChange:(a=>s0(a.target.value)),rows:2,maxLength:2e3,onKeyDown:(a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),c0())}),onPaste:(a=>{var I;const _=Array.from(((I=a.clipboardData)==null?void 0:I.files)||[]);_.find(z=>z.type.startsWith("image/"))&&(a.preventDefault(),I0(_))}),disabled:(n==null?void 0:n.runtime_state)!=="online",placeholder:(n==null?void 0:n.runtime_state)==="online"?"输入消息,Enter 发送,Shift + Enter 换行,Ctrl + V 粘贴图片":"账号离线,暂时无法发送",className:"max-h-32 min-h-12 flex-1 resize-none bg-transparent px-2 py-2 text-sm leading-6 outline-none disabled:cursor-not-allowed"}),e.jsx("button",{type:"button",onClick:(()=>void c0()),disabled:!R.trim()||O||(n==null?void 0:n.runtime_state)!=="online",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-sky-500 text-white shadow-md shadow-sky-100 transition hover:bg-sky-600 disabled:cursor-not-allowed disabled:bg-slate-300 disabled:shadow-none","aria-label":"发送消息",children:O?e.jsx(K,{className:"h-4 w-4 animate-spin"}):e.jsx(B0,{className:"h-4 w-4"})})]})]})]}):e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center text-center",children:[e.jsx(P0,{className:"h-12 w-12 text-slate-300"}),e.jsx("h3",{className:"mt-4 font-black text-slate-700",children:"选择一个用户开始聊天"}),e.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"该账号的新消息会实时出现在左侧列表。"})]})})]}),U&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 p-4",onClick:F,children:e.jsxs("div",{className:"flex max-h-full w-full max-w-2xl flex-col overflow-hidden rounded-2xl bg-white shadow-2xl",onClick:(a=>a.stopPropagation()),children:[e.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-slate-200 px-5 py-3",children:[e.jsx("div",{className:"text-sm font-black text-slate-900",children:"发送图片预览"}),e.jsx("button",{type:"button",title:"取消",onClick:F,className:"rounded-lg p-1.5 text-slate-400 transition hover:bg-slate-100 hover:text-slate-700",children:e.jsx(je,{className:"h-5 w-5"})})]}),e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-hidden bg-slate-100 p-4",children:e.jsx("img",{src:U.url,alt:"待发送图片预览",className:"max-h-[55vh] max-w-full rounded-xl object-contain"})}),e.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-slate-200 px-5 py-3",children:[e.jsxs("div",{className:"min-w-0 truncate text-xs text-slate-500",children:[U.file.name||"粘贴的图片"," · ",(U.file.size/1024).toFixed(0)," KB"]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:F,className:"rounded-xl px-4 py-2 text-sm font-bold text-slate-600 transition hover:bg-slate-100",children:"取消"}),e.jsxs("button",{type:"button",onClick:(()=>void C()),disabled:O||(n==null?void 0:n.runtime_state)!=="online",className:"flex items-center gap-2 rounded-xl bg-sky-500 px-4 py-2 text-sm font-bold text-white shadow-md shadow-sky-100 transition hover:bg-sky-600 disabled:cursor-not-allowed disabled:opacity-50",children:[O?e.jsx(K,{className:"h-4 w-4 animate-spin"}):e.jsx(B0,{className:"h-4 w-4"}),"发送"]})]})]})]})}),e.jsx(me,{open:P>=0,index:Math.max(P,0),close:(()=>G(-1)),slides:Z})]})};export{Fe as default};
|