best-unit 1.2.23 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/best-unit.cjs
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
padding: 4px;
|
|
43
43
|
color: ${i.closeColor};
|
|
44
44
|
font-size: 12px;
|
|
45
|
-
`,l.onclick=()=>{document.body.removeChild(a)},a.appendChild(l)}document.body.appendChild(a),o!==0&&setTimeout(()=>{document.body.contains(a)&&document.body.removeChild(a)},o||3e3)}success(t){this.show("success",t)}error(t){this.show("error",t)}warning(t){this.show("warning",t)}info(t){this.show("info",t)}}const Xe=new xo;function So(e={}){const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");console.log("fundUnitParams",t);const{env:n}=t;let r;switch(n){case X.DEV:case X.DEVELOPMENT:r="/api";break;case X.TEST:r="https://fund.bestfulfill.tech/api/sdk";break;case X.PROD:case X.PRODUCTION:default:r="https://fund.bestfulfill.com/api/sdk";break}const{baseURL:o=r,timeout:s=1e4,onError:i}=e,a=M.create({baseURL:o,timeout:s});return a.interceptors.request.use(u=>{const{token:l,locale:f}=t;return u.headers={...u.headers,Authorization:l,"x-locale":f===Pe.ZH?"zh-CN":"en-US"},u}),a.interceptors.response.use(u=>{if(u.data&&u.data.code===0)return u.data;const l=u.data?.msg||u.data?.message||"未知错误";return Xe.error(l),i&&i(l,u),Promise.reject(u.data||{message:"未知错误"})},u=>{const l=u.response?.data?.msg||u.response?.data?.message||u.message||"网络请求失败";return Xe.error(l),i&&i(l,u),Promise.reject(u)}),a}let xe=null;function te(){return xe||(xe=So()),xe}function wo(){xe=null}function vn(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return te().get("/balance",{params:{merchant_id:e.merchantId,biz_type:e.bizType,fund_balance_id:e.fundBalanceId}}).then(t=>{const n=t.data,r={fundBalanceId:n.fund_balance_id,merchantId:n.merchant_id,bizType:n.biz_type,currency:n.currency,totalAmount:n.total_amount,frozenAmount:n.frozen_amount,creditLimit:n.credit_config?.credit_limit,creditUsed:n.credit_used,isCredit:!!n.credit_config,availableAmount:n.available_amount,pendingAmount:n.pending_amount,status:n.status,createdAt:n.created_at};return sessionStorage.setItem("balanceData",JSON.stringify(r)),r})}const Lo=async()=>te().get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),Ao=async(e,t)=>te().post("/oss/upload",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:n=>{if(n.total){const r=Math.round(n.loaded*100/n.total);t&&t(r)}}}).then(n=>n.data?.url||""),Eo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,fund_balance_id:t.fundBalanceId,source_operator:t.userId?String(t.userId):void 0,transfer_no:e.transferNo,transfer_channel:e.transferChannel,voucher_urls:e.voucherUrls};return te().post("/offline/recharge/create",n,{})},vo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,fund_balance_id:t.fundBalanceId,source_operator:t.userId?String(t.userId):void 0,amount:e.amount,currency:e.currency,recharge_channel:e.rechargeChannel,return_url:window.location.href};return te().post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)},ko=async e=>te().get("/calc-payment-amount",{params:e}).then(t=>t.data.payment_amount);async function To(){let e=JSON.parse(sessionStorage.getItem("balanceData")||"{}");return e&&Object.keys(e).length>0||(e=await vn()),e}function Co(e){const{merchant_id:t,biz_type:n,fund_balance_id:r,user_id:o,theme:s=D.WHITE,locale:i=Pe.ZH,env:a,size:u,themeConfig:l}=e;console.log(e,"InitParams1111");const f="Bearer "+e.token;return sessionStorage.setItem("fund_unit_params",JSON.stringify({merchantId:t,bizType:n,fundBalanceId:r,userId:o,token:f,theme:s,locale:i,env:a,size:u,themeConfig:l})),wo(),Lo(),{token:f,merchantId:t,bizType:n,fundBalanceId:r,userId:o,theme:s,locale:i,env:a,size:u}}function k(e){const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");if(!e)return t;if(Array.isArray(e)){const n={};return e.forEach(r=>{n[r]=t[r]}),n}return t[e]}function kn(){const e=new CustomEvent("refresh-balance",{detail:{},bubbles:!0,composed:!0});document.dispatchEvent(e)}const Ro={"/api":{target:"https://fund.bestfulfill.tech/api/sdk",changeOrigin:!0,rewrite:e=>e.replace(/^\/api/,""),secure:!1}};function Mo(){const e=k("size");return{white:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"8px 16px",cursor:"pointer",fontSize:e===d.SMALL?12:16,fontWeight:600},dark:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"8px 16px",cursor:"pointer",fontSize:e===d.SMALL?12:16,fontWeight:600}}}function Bo(e){const t=k("theme"),n=k("themeConfig"),r=t===D.WHITE,o=Mo();let s=e;return!s&&n&&(s=(r?n.white:n.dark)?.color),r?{...o.white,background:s||o.white.background}:{...o.dark,background:s||o.dark.background}}function Tn({onClick:e,color:t,children:n}){const r=Bo(t);return m("button",{style:r,onClick:e,type:"button",children:n})}const Fo={确定:"确定",余额详情:"余额详情",真实金额:"真实金额",冻结金额:"冻结金额",信用额度:"信用额度",已用额度:"已用额度",可用余额:"可用余额",暂无数据:"暂无数据","金额需在1到999999.99之间":"金额需在1到999999.99之间","充值 / 转账":"充值 / 转账",在线充值:"在线充值",线下转账:"线下转账",充值币种:"充值币种",充值金额:"充值金额",支付平台:"支付平台",请选择充值币种:"请选择充值币种",请输入充值金额:"请输入充值金额",请选择支付平台:"请选择支付平台","需要收取手续费,实际支付金额约为:":"需要收取手续费,实际支付金额约为:","提交失败,请重试":"提交失败,请重试","提交中...":"提交中...",去支付:"去支付",取消:"取消",关闭:"关闭",第三方支付平台:"第三方支付平台",交易ID:"交易ID",请输入转账交易ID:"请输入转账交易ID",上传文件:"上传文件",请上传转账凭证:"请上传转账凭证"
|
|
45
|
+
`,l.onclick=()=>{document.body.removeChild(a)},a.appendChild(l)}document.body.appendChild(a),o!==0&&setTimeout(()=>{document.body.contains(a)&&document.body.removeChild(a)},o||3e3)}success(t){this.show("success",t)}error(t){this.show("error",t)}warning(t){this.show("warning",t)}info(t){this.show("info",t)}}const Xe=new xo;function So(e={}){const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");console.log("fundUnitParams",t);const{env:n}=t;let r;switch(n){case X.DEV:case X.DEVELOPMENT:r="/api";break;case X.TEST:r="https://fund.bestfulfill.tech/api/sdk";break;case X.PROD:case X.PRODUCTION:default:r="https://fund.bestfulfill.com/api/sdk";break}const{baseURL:o=r,timeout:s=1e4,onError:i}=e,a=M.create({baseURL:o,timeout:s});return a.interceptors.request.use(u=>{const{token:l,locale:f}=t;return u.headers={...u.headers,Authorization:l,"x-locale":f===Pe.ZH?"zh-CN":"en-US"},u}),a.interceptors.response.use(u=>{if(u.data&&u.data.code===0)return u.data;const l=u.data?.msg||u.data?.message||"未知错误";return Xe.error(l),i&&i(l,u),Promise.reject(u.data||{message:"未知错误"})},u=>{const l=u.response?.data?.msg||u.response?.data?.message||u.message||"网络请求失败";return Xe.error(l),i&&i(l,u),Promise.reject(u)}),a}let xe=null;function te(){return xe||(xe=So()),xe}function wo(){xe=null}function vn(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return te().get("/balance",{params:{merchant_id:e.merchantId,biz_type:e.bizType,fund_balance_id:e.fundBalanceId}}).then(t=>{const n=t.data,r={fundBalanceId:n.fund_balance_id,merchantId:n.merchant_id,bizType:n.biz_type,currency:n.currency,totalAmount:n.total_amount,frozenAmount:n.frozen_amount,creditLimit:n.credit_config?.credit_limit,creditUsed:n.credit_used,isCredit:!!n.credit_config,availableAmount:n.available_amount,pendingAmount:n.pending_amount,status:n.status,createdAt:n.created_at};return sessionStorage.setItem("balanceData",JSON.stringify(r)),r})}const Lo=async()=>te().get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),Ao=async(e,t)=>te().post("/oss/upload",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:n=>{if(n.total){const r=Math.round(n.loaded*100/n.total);t&&t(r)}}}).then(n=>n.data?.url||""),Eo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,fund_balance_id:t.fundBalanceId,source_operator:t.userId?String(t.userId):void 0,transfer_no:e.transferNo,transfer_channel:e.transferChannel,voucher_urls:e.voucherUrls};return te().post("/offline/recharge/create",n,{})},vo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,fund_balance_id:t.fundBalanceId,source_operator:t.userId?String(t.userId):void 0,amount:e.amount,currency:e.currency,recharge_channel:e.rechargeChannel,return_url:window.location.href};return te().post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)},ko=async e=>te().get("/calc-payment-amount",{params:e}).then(t=>t.data.payment_amount);async function To(){let e=JSON.parse(sessionStorage.getItem("balanceData")||"{}");return e&&Object.keys(e).length>0||(e=await vn()),e}function Co(e){const{merchant_id:t,biz_type:n,fund_balance_id:r,user_id:o,theme:s=D.WHITE,locale:i=Pe.ZH,env:a,size:u,themeConfig:l}=e;console.log(e,"InitParams1111");const f="Bearer "+e.token;return sessionStorage.setItem("fund_unit_params",JSON.stringify({merchantId:t,bizType:n,fundBalanceId:r,userId:o,token:f,theme:s,locale:i,env:a,size:u,themeConfig:l})),wo(),Lo(),{token:f,merchantId:t,bizType:n,fundBalanceId:r,userId:o,theme:s,locale:i,env:a,size:u}}function k(e){const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");if(!e)return t;if(Array.isArray(e)){const n={};return e.forEach(r=>{n[r]=t[r]}),n}return t[e]}function kn(){const e=new CustomEvent("refresh-balance",{detail:{},bubbles:!0,composed:!0});document.dispatchEvent(e)}const Ro={"/api":{target:"https://fund.bestfulfill.tech/api/sdk",changeOrigin:!0,rewrite:e=>e.replace(/^\/api/,""),secure:!1}};function Mo(){const e=k("size");return{white:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"8px 16px",cursor:"pointer",fontSize:e===d.SMALL?12:16,fontWeight:600},dark:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"8px 16px",cursor:"pointer",fontSize:e===d.SMALL?12:16,fontWeight:600}}}function Bo(e){const t=k("theme"),n=k("themeConfig"),r=t===D.WHITE,o=Mo();let s=e;return!s&&n&&(s=(r?n.white:n.dark)?.color),r?{...o.white,background:s||o.white.background}:{...o.dark,background:s||o.dark.background}}function Tn({onClick:e,color:t,children:n}){const r=Bo(t);return m("button",{style:r,onClick:e,type:"button",children:n})}const Fo={确定:"确定",提交成功:"提交成功",余额详情:"余额详情",真实金额:"真实金额",冻结金额:"冻结金额",信用额度:"信用额度",已用额度:"已用额度",可用余额:"可用余额",暂无数据:"暂无数据","金额需在1到999999.99之间":"金额需在1到999999.99之间","充值 / 转账":"充值 / 转账",在线充值:"在线充值",线下转账:"线下转账",充值币种:"充值币种",充值金额:"充值金额",支付平台:"支付平台",请选择充值币种:"请选择充值币种",请输入充值金额:"请输入充值金额",请选择支付平台:"请选择支付平台","需要收取手续费,实际支付金额约为:":"需要收取手续费,实际支付金额约为:","提交失败,请重试":"提交失败,请重试","提交中...":"提交中...",去支付:"去支付",取消:"取消",关闭:"关闭",第三方支付平台:"第三方支付平台",交易ID:"交易ID",请输入转账交易ID:"请输入转账交易ID",上传文件:"上传文件",请上传转账凭证:"请上传转账凭证","加载中...":"加载中...",错误:"错误",成功:"成功",必填:"必填","充值/转账":"充值/转账",切换为暗黑主题:"切换为暗黑主题",切换为白色主题:"切换为白色主题",点击或拖拽文件到此处上传:"点击或拖拽文件到此处上传","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传",个文件:"个文件","正在上传...":"正在上传...",已上传:"已上传",移除:"移除"};function Oo(e){return Fo[e]||e}const Po={确定:"Confirm",提交成功:"Submit Success",余额详情:"Balance Details",真实金额:"Real Balance",冻结金额:"Frozen Amount",信用额度:"Credit Limit",已用额度:"Credit Used",可用余额:"Available Balance",暂无数据:"No Data","金额需在1到999999.99之间":"Amount must be between 1 and 999999.99","充值 / 转账":"Recharge / Transfer",在线充值:"Online Recharge",线下转账:"Offline Transfer",充值币种:"Recharge Currency",充值金额:"Recharge Amount",支付平台:"Payment Platform",请选择充值币种:"Please select recharge currency",请输入充值金额:"Please enter recharge amount",请选择支付平台:"Please select payment platform","需要收取手续费,实际支付金额约为:":"requires a handling fee, the actual payment amount is approximately: ","提交失败,请重试":"Submit failed, please try again","提交中...":"Submitting...",去支付:"Go to Pay",取消:"Cancel",关闭:"Close",第三方支付平台:"Third-party Payment Platform",交易ID:"Transaction ID",请输入转账交易ID:"Please enter transfer transaction ID",上传文件:"Upload Files",请上传转账凭证:"Please upload transfer voucher","加载中...":"Loading...",错误:"Error",成功:"Success",必填:"Required","充值/转账":"Recharge/Transfer",切换为暗黑主题:"Switch to Dark Theme",切换为白色主题:"Switch to Light Theme",点击或拖拽文件到此处上传:"Click or drag files here to upload","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"Supports JPG, PNG, PDF formats, single file not exceeding 20MB, maximum",个文件:"files can be uploaded","正在上传...":"Uploading...",已上传:"Uploaded",移除:"Remove"};function Io(e){return Po[e]||e}function No(){return JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").locale||Pe.ZH}function A(e){return No()==="zh"?Oo(e):Io(e)}const Ot={white:{trigger:{background:"#fff",color:"#222",border:"1px solid #d9d9d9"},triggerDisabled:{background:"#f5f5f5",color:"#bfbfbf",border:"1px solid #f0f0f0"},triggerError:{background:"#fff",color:"#222",border:"1px solid #ff4d4f"},dropdown:{background:"#fff",border:"1px solid #d9d9d9",color:"#222"},option:(e,t,n)=>({color:t?"#bfbfbf":e?"#1890ff":"#222",background:e?"#e6f7ff":n&&!t||t?"#f5f5f5":"#fff"}),placeholder:{color:"#bfbfbf"},scrollbarThumb:"#e5e5e5",scrollbarTrack:"#f5f5f5",boxShadow:"0 2px 8px rgba(0,0,0,0.08)"},dark:{trigger:{background:"#23262F",color:"#fff",border:"1px solid #374151"},triggerDisabled:{background:"#23262F",color:"#666",border:"1px solid #374151"},triggerError:{background:"#23262F",color:"#fff",border:"1px solid #ff4d4f"},dropdown:{background:"#23262F",border:"1px solid #374151",color:"#fff"},option:(e,t,n)=>({color:t?"#666":e?"#00E8C6":"#fff",background:e?"#23262F":n&&!t?"#333843":"#23262F"}),placeholder:{color:"#666"},scrollbarThumb:"#444C5C",scrollbarTrack:"#23262F",boxShadow:"0 2px 8px rgba(0,0,0,0.32)"}};function Do(){const e=k("theme"),t=k("themeConfig"),n=e===D.WHITE,r=n?Ot.white:Ot.dark;if(t){const o=n?t.white:t.dark;if(o?.color)return{...r,option:(s,i,a)=>({...r.option(s,i,a),color:i?r.option(s,i,a).color:s?o.color:r.option(s,i,a).color})}}return r}const Ze=({value:e,onChange:t,options:n,placeholder:r,style:o,error:s,disabled:i,dropdownStyle:a,className:u,dropdownClassName:l,children:f})=>{const[c,_]=O(!1),h=Ee(null),[b,y]=O(null),g=Do(),x=k("size");le(()=>{if(!c)return;const w=E=>{h.current&&!h.current.contains(E.target)&&_(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]);const S=n.find(w=>w.value===e),v=()=>s?g.triggerError:i?g.triggerDisabled:g.trigger;return m("div",{ref:h,className:u,style:{position:"relative",...o},children:[m("style",{children:`
|
|
46
46
|
.custom-select-dropdown {
|
|
47
47
|
scrollbar-width: thin;
|
|
48
48
|
scrollbar-color: ${g.scrollbarThumb} ${g.scrollbarTrack};
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
.custom-select-dropdown::-webkit-scrollbar-track {
|
|
58
58
|
background: ${g.scrollbarTrack};
|
|
59
59
|
}
|
|
60
|
-
`}),m("div",{onClick:()=>!i&&_(w=>!w),style:{minHeight:x===d.SMALL?32:40,borderRadius:6,display:"flex",alignItems:"center",padding:x===d.SMALL?"0 10px":"0 12px",fontSize:x===d.SMALL?12:15,cursor:i?"not-allowed":"pointer",boxSizing:"border-box",transition:"border 0.2s",opacity:i?.6:1,width:"100%",...v(),...o},tabIndex:0,children:[m("span",{style:{flex:1},children:S?S.label:m("span",{style:g.placeholder,children:r||"请选择"})}),m("span",{style:{marginLeft:8,display:"flex",alignItems:"center"},children:m("svg",{width:x===d.SMALL?16:20,height:x===d.SMALL?16:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m("path",{d:"M6 8L10 12L14 8",stroke:"#bfbfbf","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})})]}),c&&!i&&m("div",{className:`custom-select-dropdown${l?" "+l:""}`,style:{position:"absolute",left:0,right:0,top:x===d.SMALL?32:44,zIndex:10,borderRadius:6,boxShadow:g.boxShadow,maxHeight:x===d.SMALL?160:220,overflowY:"auto",...g.dropdown,...a},children:[n.length===0&&m("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:x===d.SMALL?80:120,width:"100%",userSelect:"none"},children:[m("svg",{width:x===d.SMALL?48:64,height:x===d.SMALL?32:41,viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:[m("title",{children:A("暂无数据")}),m("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[m("ellipse",{fill:"#f5f5f5",cx:"32",cy:"33",rx:"32",ry:"7"}),m("g",{fillRule:"nonzero",stroke:"#d9d9d9",children:[m("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),m("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"#fafafa"})]})]})]}),m("div",{style:{marginTop:8,color:"#bfbfbf",fontSize:x===d.SMALL?12:15},children:A("暂无数据")})]}),n.map((w,E)=>m("div",{onClick:()=>{w.disabled||(_(!1),t?.(w.value))},onMouseEnter:()=>y(E),onMouseLeave:()=>y(null),style:{padding:x===d.SMALL?"6px 10px":"10px 16px",fontSize:x===d.SMALL?12:15,cursor:w.disabled?"not-allowed":"pointer",fontWeight:e===w.value?600:400,opacity:w.disabled?.6:1,...g.option(e===w.value,!!w.disabled,b===E)},children:w.label},w.value))]}),f]})};function zo(){const e=k("size");return{white:{label:{marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:e===d.SMALL?12:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:e===d.SMALL?12:13,marginTop:e===d.SMALL?2:4,textAlign:"left"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:e===d.SMALL?"6px 16px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer"},buttonSubmit:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 16px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer",fontWeight:600},feeTip:{marginBottom:24,padding:e===d.SMALL?"8px 10px":"12px 16px",background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6,fontSize:e===d.SMALL?12:14,color:"#52c41a"}},dark:{label:{marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #374151",background:"#23262F",color:"#fff",fontSize:e===d.SMALL?12:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:e===d.SMALL?12:13,marginTop:e===d.SMALL?2:4,textAlign:"left"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 16px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 16px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer",fontWeight:600},feeTip:{marginBottom:e===d.SMALL?16:24,padding:e===d.SMALL?"8px 10px":"12px 16px",background:"#1a1a1a",border:"1px solid #333",borderRadius:6,fontSize:e===d.SMALL?12:14,color:"#52c41a"}}}}function Uo(){const e=k("theme"),t=k("themeConfig"),n=e===D.WHITE,r=zo(),o=n?r.white:r.dark;if(t){const s=n?t.white:t.dark;if(s?.color)return{...o,buttonSubmit:{...o.buttonSubmit,background:s.color}}}return o}function Ho(e){return e=e.replace(/[^\d.]/g,""),e=e.replace(/\.(?=.*\.)/g,""),e=e.replace(/^(\d+)(\.\d{0,2})?.*$/,"$1$2"),e=e.replace(/^0+(\d)/,"$1"),e.startsWith(".")&&(e="0"+e),e}function jo(e){if(!e)return"";const t=parseFloat(e);return isNaN(t)?"":t.toFixed(2)}const $o=({formState:e,setFormState:t,onClose:n,loading:r})=>{const o=JSON.parse(sessionStorage.getItem("all_dicts")||"{}"),s=o?.currency||[],i=o?.channel?.filter(_=>_.payment_support)||[],[a,u]=O(""),[l,f]=O(!1),c=Uo();return le(()=>{e.currency&&e.amount&&e.rechargeChannel?ko({channel:e.rechargeChannel,amount:e.amount,currency:e.currency}).then(_=>{u(_),f(!0)}).catch(_=>{console.error("计算支付金额失败:",_),f(!1)}):f(!1)},[e.currency,e.amount,e.rechargeChannel]),m(K,{children:[m("div",{style:{marginBottom:18},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("充值币种")]}),m(Ze,{value:e.currency,onChange:_=>{t(h=>({...h,currency:_}))},options:s?.map(_=>({value:_.value,label:_.label})),placeholder:A("请选择充值币种")})]}),m("div",{style:{marginBottom:18},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("充值金额")]}),m("input",{type:"text",placeholder:A("请输入充值金额"),value:e.amount,onInput:_=>{let h=_.target.value;h=Ho(h);let b="";if(h&&!h.endsWith(".")){let y=parseFloat(h);if(!isNaN(y)&&(y<1&&(y=1),y>999999.99&&(y=999999.99),h=y.toString(),/\./.test(_.target.value))){const g=_.target.value.split(".")[1];g!==void 0&&g.length>0&&(h=y.toFixed(Math.min(g.length,2)))}}t(y=>({...y,amount:h,amountError:b}))},onBlur:_=>{let h=_.target.value;h=jo(h),t(b=>({...b,amount:h,amountError:""}))},style:{...c.input,...e.amountError?c.inputError:{}}}),e.amountError&&m("div",{style:c.error,children:e.amountError})]}),m("div",{style:{marginBottom:24},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("支付平台")]}),m(Ze,{value:e.rechargeChannel,onChange:_=>{t(h=>({...h,rechargeChannel:_,rechargeChannelError:_?"":h.rechargeChannelError}))},options:i?.map(_=>({value:_.value,label:_.label})),placeholder:A("请选择支付平台")}),e.rechargeChannelError&&m("div",{style:c.error,children:e.rechargeChannelError})]}),l&&a&&m("div",{style:c.feeTip,children:[i.find(_=>_.value===e.rechargeChannel)?.label||e.rechargeChannel,A("需要收取手续费,实际支付金额约为:"),"$",a]}),e.error&&m("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),m("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[m("button",{type:"button",onClick:n,style:c.buttonCancel,children:A("取消")}),m("button",{type:"submit",disabled:r,style:c.buttonSubmit,children:A(r?"提交中...":"去支付")})]})]})};function Wo(){const e=k("size");return{white:{container:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:e===d.SMALL?16:24,textAlign:"center",cursor:"pointer",minHeight:e===d.SMALL?80:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:e===d.SMALL?12:15},fileItem:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:e===d.SMALL?"8px 10px":"12px 16px",marginBottom:8,fontSize:e===d.SMALL?12:15,color:"#222",justifyContent:"space-between"},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"4px 14px",fontSize:e===d.SMALL?12:15,marginLeft:e===d.SMALL?8:16,cursor:"pointer"}},dark:{container:{border:"1.5px dashed #444C5C",borderRadius:8,background:"#181A20",padding:e===d.SMALL?16:24,textAlign:"center",cursor:"pointer",minHeight:e===d.SMALL?80:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:e===d.SMALL?12:15},fileItem:{display:"flex",alignItems:"center",background:"#23262F",borderRadius:8,padding:e===d.SMALL?"8px 10px":"12px 16px",marginBottom:8,fontSize:e===d.SMALL?12:15,color:"#fff",justifyContent:"space-between"},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"4px 14px",fontSize:e===d.SMALL?12:15,marginLeft:e===d.SMALL?8:16,cursor:"pointer"}}}}function qo(){const t=k("theme")===D.WHITE,n=Wo();return t?n.white:n.dark}const Jo=({value:e=[],onChange:t,maxCount:n=10,accept:r=".jpg,.jpeg,.png,.pdf",multiple:o=!0,disabled:s=!1})=>{const i=k("size"),a=Ee(null),[u,l]=O(!1),[f,c]=O(0),_=qo(),h=async y=>{const g=Array.from(y.target.files).slice(0,n);if(!g.length)return;l(!0);const x=[];for(let S=0;S<g.length;S++){c(0);const v=new FormData;v.append("file",g[S]);try{const w=await Ao(v,E=>c(E));w&&x.push(w)}catch{}}l(!1),c(0),t?.([...e,...x]),a.current&&(a.current.value="")},b=y=>{const g=e.filter((x,S)=>S!==y);t?.(g)};return m("div",{children:[m("div",{style:{..._.container,cursor:s?"not-allowed":_.container.cursor,opacity:s?.6:1},onClick:()=>!s&&a.current?.click(),children:[m("div",{style:{fontSize:i===d.SMALL?32:48,marginBottom:i===d.SMALL?8:12},children:"📁"}),m("div",{style:{color:"#222",fontSize:i===d.SMALL?12:15,marginBottom:i===d.SMALL?4:8},children:A("点击或拖拽文件到此处上传")}),m("div",{style:{color:"#999",fontSize:i===d.SMALL?12:13},children:[A("支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传")," ",n," ",A("个文件")]}),m("input",{ref:a,type:"file",multiple:o,accept:r,style:{display:"none"},onChange:h,disabled:s}),u&&m("div",{style:{marginTop:i===d.SMALL?8:12,color:"#1677ff"},children:[A("正在上传...")," ",f,"%"]})]}),e&&e.length>0&&m("div",{style:{marginTop:i===d.SMALL?8:12},children:e.map((y,g)=>m("div",{style:_.fileItem,children:[m("div",{style:{display:"flex",alignItems:"center",flex:1},children:m("span",{style:{fontWeight:500,wordBreak:"break-all"},children:y.split("/").pop()})}),m("button",{type:"button",onClick:x=>{x.stopPropagation(),b(g)},style:_.removeBtn,disabled:s,children:A("移除")})]},y))})]})};function Vo(){const e=k("size");return{white:{label:{marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:e===d.SMALL?12:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:e===d.SMALL?12:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},upload:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:e===d.SMALL?12:24,textAlign:"center",cursor:"pointer",minHeight:e===d.SMALL?100:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:e===d.SMALL?12:15},uploadError:{border:"1px dashed #ff4d4f"},fileItem:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:e===d.SMALL?"8px 10px":"12px 16px",marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:15,color:"#222",justifyContent:"space-between"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:e===d.SMALL?"6px 18px":"8px 24px",cursor:"pointer"},buttonSubmit:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"8px 24px",cursor:"pointer",fontWeight:600},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"4px 14px",fontSize:e===d.SMALL?12:15,marginLeft:e===d.SMALL?8:16,cursor:"pointer"},error:{color:"#ff4d4f",fontSize:e===d.SMALL?12:13,marginTop:e===d.SMALL?2:4,textAlign:"left"}},dark:{label:{marginBottom:e===d.SMALL?4:8,fontSize:e===d.SMALL?12:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #374151",background:"#23262F",color:"#fff",fontSize:e===d.SMALL?12:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,border:"1px solid #374151",background:"#23262F",color:"#fff",fontSize:e===d.SMALL?12:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},upload:{border:"1px dashed #374151",borderRadius:8,background:"#181A20",padding:e===d.SMALL?12:24,textAlign:"center",cursor:"pointer",minHeight:e===d.SMALL?100:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:e===d.SMALL?12:14},uploadError:{border:"1px dashed #ff4d4f"},fileItem:{display:"flex",alignItems:"center",background:"#23262F",borderRadius:8,padding:e===d.SMALL?"8px 10px":"12px 16px",marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:15,color:"#fff",justifyContent:"space-between"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"8px 24px",fontSize:e===d.SMALL?12:14,cursor:"pointer",fontWeight:600},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"4px 14px",fontSize:e===d.SMALL?12:15,marginLeft:e===d.SMALL?8:16,cursor:"pointer"},error:{color:"#ff4d4f",fontSize:e===d.SMALL?12:13,marginTop:e===d.SMALL?2:4,textAlign:"left"}}}}function Go(){const e=k("theme"),t=k("themeConfig"),n=e===D.WHITE,r=Vo(),o=n?r.white:r.dark;if(console.log(t,"themeConfig"),t){const s=n?t.white:t.dark;if(s?.color)return{...o,buttonSubmit:{...o.buttonSubmit,background:s.color}}}return o}const Ko=({formState:e,setFormState:t,onClose:n,loading:r})=>{const o=JSON.parse(sessionStorage.getItem("all_dicts")||"{}");console.log(o,"allDicts");const s=o?.channel||[],i=Go();return m("form",{onSubmit:async u=>{u.preventDefault();let l=!0;t(f=>({...f,platformError:"",transactionIdError:"",filesError:""})),e.platform||(t(f=>({...f,platformError:A("请选择支付平台")})),l=!1),e.transactionId.trim()||(t(f=>({...f,transactionIdError:A("请输入转账交易ID")})),l=!1),(!e.files||e.files.length===0)&&(t(f=>({...f,filesError:A("请上传转账凭证")})),l=!1),l&&(await Eo({transferChannel:e.platform,transferNo:e.transactionId,voucherUrls:e.files}),n(),Xe.success(A("离线充值创建成功")))},children:[m("div",{style:{marginBottom:18},children:[m("div",{style:i.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("第三方支付平台")]}),m(Ze,{value:e.platform,onChange:u=>{t(l=>({...l,platform:u,platformError:u?"":l.platformError}))},options:[...s?.map(u=>({value:u.value,label:u.label}))],placeholder:A("请选择支付平台")}),e.platformError&&m("div",{style:i.error,children:e.platformError})]}),m("div",{style:{marginBottom:18},children:[m("div",{style:i.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("交易ID")]}),m("input",{type:"text",placeholder:A("请输入转账交易ID"),value:e.transactionId,maxLength:200,onInput:u=>{let l=u.target.value;l.length>200&&(l=l.slice(0,200)),t(f=>({...f,transactionId:l,transactionIdError:l?"":f.transactionIdError}))},style:{...i.input,...e.transactionIdError?i.inputError:{}}}),e.transactionIdError&&m("div",{style:i.error,children:e.transactionIdError})]}),m("div",{style:{marginBottom:24},children:[m("div",{style:i.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("上传文件")]}),m(Jo,{value:e.files,onChange:u=>t(l=>({...l,files:u,filesError:""})),maxCount:10,accept:".jpg,.jpeg,.png,.pdf",multiple:!0}),e.filesError&&m("div",{style:i.error,children:e.filesError})]}),m("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[m("button",{type:"button",onClick:n,style:i.buttonCancel,children:A("取消")}),m("button",{type:"submit",disabled:r,style:i.buttonSubmit,children:A("确定")})]})]})};function Xo(){const e=k("size");return{white:{mask:"rgba(0, 0, 0, 0.45)",modalBg:"#fff",modalColor:"#222",modalBoxShadow:"0 6px 16px rgba(0, 0, 0, 0.12)",closeBtn:{position:"absolute",top:"16px",right:"16px",background:"none",border:"none",fontSize:e===d.SMALL?16:24,cursor:"pointer",color:"#999",padding:"0",width:e===d.SMALL?16:24,height:e===d.SMALL?16:24,display:"flex",alignItems:"center",justifyContent:"center"},title:{fontSize:e===d.SMALL?16:18,fontWeight:"600",marginBottom:e===d.SMALL?16:24,color:"#222"},tabBtn:(t,n)=>({flex:1,padding:e===d.SMALL?"8px 10px":"12px 16px",background:t?"#1890ff":"transparent",color:t?"#fff":"#666",border:"1px solid #d9d9d9",borderRight:n?"none":"1px solid #d9d9d9",cursor:"pointer",fontSize:e===d.SMALL?12:14,fontWeight:t?"600":"400",borderRadius:n?"6px 0 0 6px":"0 6px 6px 0"})},dark:{mask:"rgba(0, 0, 0, 0.65)",modalBg:"#23262F",modalColor:"#F5F6FA",modalBoxShadow:"0 6px 16px rgba(0,0,0,0.32)",closeBtn:{position:"absolute",top:e===d.SMALL?"12px":"16px",right:e===d.SMALL?"12px":"16px",background:"none",border:"none",fontSize:e===d.SMALL?16:24,cursor:"pointer",color:"#B5B8BE",padding:"0",width:e===d.SMALL?16:24,height:e===d.SMALL?16:24,display:"flex",alignItems:"center",justifyContent:"center"},title:{fontSize:e===d.SMALL?16:18,fontWeight:"600",marginBottom:e===d.SMALL?16:24,color:"#F5F6FA"},tabBtn:(t,n)=>({flex:1,padding:e===d.SMALL?"8px 10px":"12px 16px",background:t?"#00E8C6":"transparent",color:t?"#fff":"#B5B8BE",border:"1px solid #444C5C",borderRight:n?"none":"1px solid #444C5C",cursor:"pointer",fontSize:e===d.SMALL?12:14,fontWeight:t?"600":"400",borderRadius:n?"6px 0 0 6px":"0 6px 6px 0"})}}}function Zo(){const t=k("theme")===D.WHITE,n=Xo();return t?n.white:n.dark}const pe=k("size");function Yo({visible:e,onClose:t,title:n,children:r,width:o=pe===d.SMALL?300:400,maxWidth:s=pe===d.SMALL?300:400,showClose:i=!0,maskClosable:a=!0}){const[u,l]=O(!1),f=Zo(),c=h=>{h.target===h.currentTarget?l(!0):l(!1)},_=h=>{h.target===h.currentTarget&&u&&a&&t(),l(!1)};return e?m("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:f.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onMouseDown:c,onMouseUp:_,children:m("div",{style:{background:f.modalBg,padding:pe===d.SMALL?24:32,borderRadius:pe===d.SMALL?8:12,minWidth:o,maxWidth:s,color:f.modalColor,boxShadow:f.modalBoxShadow,position:"relative"},onClick:h=>h.stopPropagation(),children:[i&&m("button",{type:"button",onClick:t,style:f.closeBtn,"aria-label":"关闭",children:"×"}),n&&m("div",{style:f.title,children:n}),r]})}):null}function Qo(){const e=k("size");return{white:{tabBtn:(t,n)=>({flex:1,background:t?"#fff":"#F7F8FA",color:t?"#1890ff":"#222",border:"1px solid #F0F1F3",borderRadius:n?"8px 0 0 8px":"0 8px 8px 0",fontWeight:500,fontSize:e===d.SMALL?12:16,height:e===d.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer"})},dark:{tabBtn:(t,n)=>({flex:1,background:t?"#23262F":"#181A20",color:t?"#00E8C6":"#fff",border:"1px solid #444C5C",borderRadius:n?"8px 0 0 8px":"0 8px 8px 0",fontWeight:500,fontSize:e===d.SMALL?12:16,height:e===d.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer"})}}}function ei(){const e=k("theme"),t=k("themeConfig"),n=e===D.WHITE,r=Qo(),o=n?r.white:r.dark;if(t){const s=n?t.white:t.dark;if(s?.color)return{...o,tabBtn:(i,a)=>({...o.tabBtn(i,a),color:i?s.color:o.tabBtn(i,a).color})}}return o}const ti=k("size");function ni({visible:e,onClose:t,onSubmit:n}){const[r,o]=O({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[s,i]=O({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}),[a,u]=O("online"),l=ei();le(()=>{e||(u("online"),o({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),i({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]);const f=async c=>{c.preventDefault();let _=!0;if(o(h=>({...h,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(h=>({...h,amountError:A("请输入充值金额")})),_=!1),r.rechargeChannel||(o(h=>({...h,rechargeChannelError:A("请选择支付平台")})),_=!1),!!_){o(h=>({...h,loading:!0,error:""}));try{await n({amount:r.amount,rechargeChannel:r.rechargeChannel,currency:r.currency}),t()}catch{o(h=>({...h,error:A("提交失败,请重试")}))}finally{o(h=>({...h,loading:!1}))}}};return m(Yo,{visible:e,onClose:t,title:A("充值 / 转账"),children:[m("div",{style:{display:"flex",marginBottom:ti===d.SMALL?16:28},children:[m("button",{type:"button",onClick:()=>u("online"),style:l.tabBtn(a==="online",!0),children:A("在线充值")}),m("button",{type:"button",onClick:()=>u("offline"),style:l.tabBtn(a==="offline",!1),children:A("线下转账")})]}),a==="online"?m("form",{onSubmit:f,children:m($o,{formState:r,setFormState:o,onClose:t,loading:r.loading})}):m(Ko,{formState:s,setFormState:i,onClose:t,loading:s.loading})]})}function st(){return(st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ri=["context","children"];function oi(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var s,i,a={},u=Object.keys(r);for(i=0;i<u.length;i++)o.indexOf(s=u[i])>=0||(a[s]=r[s]);return a}(e,ri);return wn(t,n)}function ii(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Z(oi,st({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],s={},i=0,a=n.attributes,u=n.childNodes;for(i=a.length;i--;)a[i].name!=="slot"&&(s[a[i].name]=a[i].value,s[Cn(a[i].name)]=a[i].value);for(i=u.length;i--;){var l=t(u[i],null),f=u[i].slot;f?s[f]=Z(Pt,{name:f},l):o[i]=l}var c=r?Z(Pt,null,o):o;return Z(r||n.nodeName.toLowerCase(),s,c)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Sn:Oe)(this._vdom,this._root)}function Cn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function si(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[Cn(e)]=n,this._vdom=wn(this._vdom,r),Oe(this._vdom,this._root)}}function ai(){Oe(this._vdom=null,this._root)}function Pt(e,t){var n=this;return Z("slot",st({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function at(e,t,n,r){function o(){var s=Reflect.construct(HTMLElement,[],o);return s._vdomComponent=e,s._root=r&&r.shadow?s.attachShadow({mode:r.mode||"open"}):s,s}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=ii,o.prototype.attributeChangedCallback=si,o.prototype.disconnectedCallback=ai,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(s){Object.defineProperty(o.prototype,s,{get:function(){return this._vdom.props[s]},set:function(i){this._vdom?this.attributeChangedCallback(s,null,i):(this._props||(this._props={}),this._props[s]=i,this.connectedCallback());var a=typeof i;i!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(s,i)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}function li(){const[e,t]=O(!1),n=async r=>{const o=await vo({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return m("div",{children:[m(Tn,{onClick:()=>t(!0),children:A("充值/转账")}),m(ni,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}at(li,"best-recharge",["theme"],{shadow:!1});const It={white:{popover:{background:"#fff",color:"#222",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",border:"none"},arrow:{top:"#fff",bottom:"#fff",left:"#fff",right:"#fff"}},dark:{popover:{background:"#23262F",color:"#fff",boxShadow:"0 4px 16px rgba(0,0,0,0.32)",border:"1px solid #444C5C"},arrow:{top:"#23262F",bottom:"#23262F",left:"#23262F",right:"#23262F"}}};function ci(){return k("theme")===D.WHITE?It.white:It.dark}const ui=({popover:e,children:t,popoverWidth:n,popoverMinWidth:r,offsetY:o,offsetX:s,popoverPosition:i="top"})=>{const a=k("size"),u=n??(a===d.SMALL?200:300),l=r??(a===d.SMALL?150:200),f=o??(a===d.SMALL?8:16),c=s??(a===d.SMALL?8:16),[_,h]=O(!1),[b,y]=O(i),g=Ee(null),x=Ee(null),S=ci(),v=()=>{if(x.current&&(clearTimeout(x.current),x.current=null),i==="top"||i==="bottom")if(g.current){const N=g.current.getBoundingClientRect();i==="top"&&N.top<100?y("bottom"):i==="bottom"&&window.innerHeight-N.bottom<100?y("top"):y(i)}else y(i);else y(i);h(!0)},w=()=>{x.current=window.setTimeout(()=>{h(!1)},120)};let E={position:"absolute",zIndex:999,borderRadius:6,fontSize:a===d.SMALL?12:15,minWidth:l,width:u,padding:a===d.SMALL?"6px 12px":"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...S.popover},C={position:"absolute",zIndex:11,width:0,height:0};return b==="top"?(E={...E,left:"50%",top:-48,transform:"translateX(-50%)"},C={...C,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${S.arrow.top}`}):b==="bottom"?(E={...E,left:"50%",top:"100%",marginTop:f,transform:"translateX(-50%)"},C={...C,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${S.arrow.bottom}`}):b==="leftTop"?(E={...E,right:"100%",top:0,marginRight:c,transform:"none"},C={...C,right:-8,top:a===d.SMALL?8:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${S.arrow.left}`}):b==="rightTop"&&(E={...E,left:"100%",top:0,marginLeft:c,transform:"translateY(0)"},C={...C,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${S.arrow.right}`}),m("div",{ref:g,style:{position:"relative",display:"inline-block"},onMouseEnter:v,onMouseLeave:w,children:[t,_&&m("div",{style:E,onMouseEnter:v,onMouseLeave:w,children:[e,m("div",{style:C})]})]})};function di(){const e=k("size");return{white:{popoverTitle:{fontSize:e===d.SMALL?12:16,fontWeight:600,color:"#222",marginBottom:e===d.SMALL?12:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===d.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:e===d.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===d.SMALL?6:8,height:e===d.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===d.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===d.SMALL?12:15}),main:{fontSize:e===d.SMALL?18:24,fontWeight:800,color:"#111827",display:"inline-block"},currency:{fontSize:e===d.SMALL?16:18,color:"#6b7280",marginLeft:e===d.SMALL?6:8,fontWeight:600}},dark:{popoverTitle:{fontSize:e===d.SMALL?14:16,fontWeight:600,color:"#fff",marginBottom:e===d.SMALL?14:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===d.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #374151",fontSize:e===d.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#B5B8BE",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===d.SMALL?6:8,height:e===d.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===d.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===d.SMALL?12:15}),main:{fontSize:e===d.SMALL?18:24,fontWeight:800,color:"#fff",display:"inline-block"},currency:{fontSize:e===d.SMALL?16:18,color:"#B5B8BE",marginLeft:e===d.SMALL?6:8,fontWeight:600}}}}function fi(){const t=k("theme")===D.WHITE,n=di();return t?n.white:n.dark}function Nt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function pi(e){const[t,n]=O({available:0,currency:"USD",symbol:"$",details:[]}),r=async()=>{try{const i=await vn(),a=[{label:"",value:i.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"",value:i.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},...i.isCredit?[{label:"",value:i.creditLimit,color:"#1890ff",dot:"#1890ff"},{label:"",value:i.creditUsed,color:"#ff0000",dot:"#ff0000"}]:[],{label:"",value:i.availableAmount,color:"#1890ff",dot:"#15b36b"}],u={available:i.availableAmount,currency:"USD",symbol:"$",details:a};n(u)}catch(i){console.error("获取余额失败:",i)}};le(()=>{r()},[]),le(()=>{const i=()=>{r()};return document.addEventListener("refresh-balance",i),()=>{document.removeEventListener("refresh-balance",i)}},[]);const o=fi(),s=[{label:A("真实金额"),value:t.details[0]?.value||0,color:"#15b36b",dot:"#15b36b"},{label:A("冻结金额"),value:t.details[1]?.value||0,color:"#f59e0b",dot:"#f59e0b"},...t.details.length>4?[{label:A("信用额度"),value:t.details[2]?.value||0,color:"#1890ff",dot:"#1890ff"},{label:A("已用额度"),value:t.details[3]?.value||0,color:"#ff0000",dot:"#ff0000"}]:[],{label:A("可用余额"),value:t.details[t.details.length-1]?.value||0,color:"#1890ff",dot:"#15b36b"}];return m(ui,{popover:m(K,{children:[m("div",{style:o.popoverTitle,children:A("余额详情")}),s.map(i=>m("div",{style:o.detailRow,children:[m("span",{style:o.detailLabel,children:[m("span",{style:o.detailDot(i.dot)}),i.label]}),m("span",{style:o.detailValue(i.color),children:[t.symbol,Nt(i.value)]})]},i.label))]}),popoverPosition:e.popoverPosition||"bottom",children:m("div",{style:o.main,children:[t.symbol,Nt(t.available),m("span",{style:o.currency,children:t.currency})]})})}at(pi,"best-statistical-balance");const he={white:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,transition:"all 0.2s ease"},dark:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,transition:"all 0.2s ease"}};function hi(e){return k("theme")===D.WHITE?{...he.white,background:e||he.white.background}:{...he.dark,background:e||he.dark.background}}function mi(e){switch(e){case"small":return{fontSize:"12px",gap:"2px"};case"large":return{fontSize:"18px",gap:"6px"};default:return{fontSize:"14px",gap:"4px"}}}function _i({color:e,size:t="medium",children:n}){const[r,o]=O(!1),s=hi(e),i=mi(t),a={...s,...i,display:"flex",alignItems:"center"};return m(K,{children:[m("style",{children:`
|
|
60
|
+
`}),m("div",{onClick:()=>!i&&_(w=>!w),style:{minHeight:x===d.SMALL?32:40,borderRadius:6,display:"flex",alignItems:"center",padding:x===d.SMALL?"0 10px":"0 12px",fontSize:x===d.SMALL?12:15,cursor:i?"not-allowed":"pointer",boxSizing:"border-box",transition:"border 0.2s",opacity:i?.6:1,width:"100%",...v(),...o},tabIndex:0,children:[m("span",{style:{flex:1},children:S?S.label:m("span",{style:g.placeholder,children:r||"请选择"})}),m("span",{style:{marginLeft:8,display:"flex",alignItems:"center"},children:m("svg",{width:x===d.SMALL?16:20,height:x===d.SMALL?16:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m("path",{d:"M6 8L10 12L14 8",stroke:"#bfbfbf","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})})]}),c&&!i&&m("div",{className:`custom-select-dropdown${l?" "+l:""}`,style:{position:"absolute",left:0,right:0,top:x===d.SMALL?32:44,zIndex:10,borderRadius:6,boxShadow:g.boxShadow,maxHeight:x===d.SMALL?160:220,overflowY:"auto",...g.dropdown,...a},children:[n.length===0&&m("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:x===d.SMALL?80:120,width:"100%",userSelect:"none"},children:[m("svg",{width:x===d.SMALL?48:64,height:x===d.SMALL?32:41,viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:[m("title",{children:A("暂无数据")}),m("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[m("ellipse",{fill:"#f5f5f5",cx:"32",cy:"33",rx:"32",ry:"7"}),m("g",{fillRule:"nonzero",stroke:"#d9d9d9",children:[m("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),m("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"#fafafa"})]})]})]}),m("div",{style:{marginTop:8,color:"#bfbfbf",fontSize:x===d.SMALL?12:15},children:A("暂无数据")})]}),n.map((w,E)=>m("div",{onClick:()=>{w.disabled||(_(!1),t?.(w.value))},onMouseEnter:()=>y(E),onMouseLeave:()=>y(null),style:{padding:x===d.SMALL?"6px 10px":"10px 16px",fontSize:x===d.SMALL?12:15,cursor:w.disabled?"not-allowed":"pointer",fontWeight:e===w.value?600:400,opacity:w.disabled?.6:1,...g.option(e===w.value,!!w.disabled,b===E)},children:w.label},w.value))]}),f]})};function zo(){const e=k("size");return{white:{label:{marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:e===d.SMALL?12:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:e===d.SMALL?12:13,marginTop:e===d.SMALL?2:4,textAlign:"left"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:e===d.SMALL?"6px 16px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer"},buttonSubmit:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 16px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer",fontWeight:600},feeTip:{marginBottom:24,padding:e===d.SMALL?"8px 10px":"12px 16px",background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6,fontSize:e===d.SMALL?12:14,color:"#52c41a"}},dark:{label:{marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #374151",background:"#23262F",color:"#fff",fontSize:e===d.SMALL?12:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:e===d.SMALL?12:13,marginTop:e===d.SMALL?2:4,textAlign:"left"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 16px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 16px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer",fontWeight:600},feeTip:{marginBottom:e===d.SMALL?16:24,padding:e===d.SMALL?"8px 10px":"12px 16px",background:"#1a1a1a",border:"1px solid #333",borderRadius:6,fontSize:e===d.SMALL?12:14,color:"#52c41a"}}}}function Uo(){const e=k("theme"),t=k("themeConfig"),n=e===D.WHITE,r=zo(),o=n?r.white:r.dark;if(t){const s=n?t.white:t.dark;if(s?.color)return{...o,buttonSubmit:{...o.buttonSubmit,background:s.color}}}return o}function Ho(e){return e=e.replace(/[^\d.]/g,""),e=e.replace(/\.(?=.*\.)/g,""),e=e.replace(/^(\d+)(\.\d{0,2})?.*$/,"$1$2"),e=e.replace(/^0+(\d)/,"$1"),e.startsWith(".")&&(e="0"+e),e}function jo(e){if(!e)return"";const t=parseFloat(e);return isNaN(t)?"":t.toFixed(2)}const $o=({formState:e,setFormState:t,onClose:n,loading:r})=>{const o=JSON.parse(sessionStorage.getItem("all_dicts")||"{}"),s=o?.currency||[],i=o?.channel?.filter(_=>_.payment_support)||[],[a,u]=O(""),[l,f]=O(!1),c=Uo();return le(()=>{e.currency&&e.amount&&e.rechargeChannel?ko({channel:e.rechargeChannel,amount:e.amount,currency:e.currency}).then(_=>{u(_),f(!0)}).catch(_=>{console.error("计算支付金额失败:",_),f(!1)}):f(!1)},[e.currency,e.amount,e.rechargeChannel]),m(K,{children:[m("div",{style:{marginBottom:18},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("充值币种")]}),m(Ze,{value:e.currency,onChange:_=>{t(h=>({...h,currency:_}))},options:s?.map(_=>({value:_.value,label:_.label})),placeholder:A("请选择充值币种")})]}),m("div",{style:{marginBottom:18},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("充值金额")]}),m("input",{type:"text",placeholder:A("请输入充值金额"),value:e.amount,onInput:_=>{let h=_.target.value;h=Ho(h);let b="";if(h&&!h.endsWith(".")){let y=parseFloat(h);if(!isNaN(y)&&(y<1&&(y=1),y>999999.99&&(y=999999.99),h=y.toString(),/\./.test(_.target.value))){const g=_.target.value.split(".")[1];g!==void 0&&g.length>0&&(h=y.toFixed(Math.min(g.length,2)))}}t(y=>({...y,amount:h,amountError:b}))},onBlur:_=>{let h=_.target.value;h=jo(h),t(b=>({...b,amount:h,amountError:""}))},style:{...c.input,...e.amountError?c.inputError:{}}}),e.amountError&&m("div",{style:c.error,children:e.amountError})]}),m("div",{style:{marginBottom:24},children:[m("div",{style:c.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("支付平台")]}),m(Ze,{value:e.rechargeChannel,onChange:_=>{t(h=>({...h,rechargeChannel:_,rechargeChannelError:_?"":h.rechargeChannelError}))},options:i?.map(_=>({value:_.value,label:_.label})),placeholder:A("请选择支付平台")}),e.rechargeChannelError&&m("div",{style:c.error,children:e.rechargeChannelError})]}),l&&a&&m("div",{style:c.feeTip,children:[i.find(_=>_.value===e.rechargeChannel)?.label||e.rechargeChannel,A("需要收取手续费,实际支付金额约为:"),"$",a]}),e.error&&m("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),m("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[m("button",{type:"button",onClick:n,style:c.buttonCancel,children:A("取消")}),m("button",{type:"submit",disabled:r,style:c.buttonSubmit,children:A(r?"提交中...":"去支付")})]})]})};function Wo(){const e=k("size");return{white:{container:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:e===d.SMALL?16:24,textAlign:"center",cursor:"pointer",minHeight:e===d.SMALL?80:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:e===d.SMALL?12:15},fileItem:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:e===d.SMALL?"8px 10px":"12px 16px",marginBottom:8,fontSize:e===d.SMALL?12:15,color:"#222",justifyContent:"space-between"},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"4px 14px",fontSize:e===d.SMALL?12:15,marginLeft:e===d.SMALL?8:16,cursor:"pointer"}},dark:{container:{border:"1.5px dashed #444C5C",borderRadius:8,background:"#181A20",padding:e===d.SMALL?16:24,textAlign:"center",cursor:"pointer",minHeight:e===d.SMALL?80:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:e===d.SMALL?12:15},fileItem:{display:"flex",alignItems:"center",background:"#23262F",borderRadius:8,padding:e===d.SMALL?"8px 10px":"12px 16px",marginBottom:8,fontSize:e===d.SMALL?12:15,color:"#fff",justifyContent:"space-between"},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 10px":"4px 14px",fontSize:e===d.SMALL?12:15,marginLeft:e===d.SMALL?8:16,cursor:"pointer"}}}}function qo(){const t=k("theme")===D.WHITE,n=Wo();return t?n.white:n.dark}const Jo=({value:e=[],onChange:t,maxCount:n=10,accept:r=".jpg,.jpeg,.png,.pdf",multiple:o=!0,disabled:s=!1})=>{const i=k("size"),a=Ee(null),[u,l]=O(!1),[f,c]=O(0),_=qo(),h=async y=>{const g=Array.from(y.target.files).slice(0,n);if(!g.length)return;l(!0);const x=[];for(let S=0;S<g.length;S++){c(0);const v=new FormData;v.append("file",g[S]);try{const w=await Ao(v,E=>c(E));w&&x.push(w)}catch{}}l(!1),c(0),t?.([...e,...x]),a.current&&(a.current.value="")},b=y=>{const g=e.filter((x,S)=>S!==y);t?.(g)};return m("div",{children:[m("div",{style:{..._.container,cursor:s?"not-allowed":_.container.cursor,opacity:s?.6:1},onClick:()=>!s&&a.current?.click(),children:[m("div",{style:{fontSize:i===d.SMALL?32:48,marginBottom:i===d.SMALL?8:12},children:"📁"}),m("div",{style:{color:"#222",fontSize:i===d.SMALL?12:15,marginBottom:i===d.SMALL?4:8},children:A("点击或拖拽文件到此处上传")}),m("div",{style:{color:"#999",fontSize:i===d.SMALL?12:13},children:[A("支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传")," ",n," ",A("个文件")]}),m("input",{ref:a,type:"file",multiple:o,accept:r,style:{display:"none"},onChange:h,disabled:s}),u&&m("div",{style:{marginTop:i===d.SMALL?8:12,color:"#1677ff"},children:[A("正在上传...")," ",f,"%"]})]}),e&&e.length>0&&m("div",{style:{marginTop:i===d.SMALL?8:12},children:e.map((y,g)=>m("div",{style:_.fileItem,children:[m("div",{style:{display:"flex",alignItems:"center",flex:1},children:m("span",{style:{fontWeight:500,wordBreak:"break-all"},children:y.split("/").pop()})}),m("button",{type:"button",onClick:x=>{x.stopPropagation(),b(g)},style:_.removeBtn,disabled:s,children:A("移除")})]},y))})]})};function Vo(){const e=k("size");return{white:{label:{marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:e===d.SMALL?12:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:e===d.SMALL?12:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},upload:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:e===d.SMALL?12:24,textAlign:"center",cursor:"pointer",minHeight:e===d.SMALL?100:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:e===d.SMALL?12:15},uploadError:{border:"1px dashed #ff4d4f"},fileItem:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:e===d.SMALL?"8px 10px":"12px 16px",marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:15,color:"#222",justifyContent:"space-between"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:e===d.SMALL?"6px 18px":"8px 24px",cursor:"pointer"},buttonSubmit:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"8px 24px",cursor:"pointer",fontWeight:600},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"4px 14px",fontSize:e===d.SMALL?12:15,marginLeft:e===d.SMALL?8:16,cursor:"pointer"},error:{color:"#ff4d4f",fontSize:e===d.SMALL?12:13,marginTop:e===d.SMALL?2:4,textAlign:"left"}},dark:{label:{marginBottom:e===d.SMALL?4:8,fontSize:e===d.SMALL?12:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #374151",background:"#23262F",color:"#fff",fontSize:e===d.SMALL?12:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:e===d.SMALL?"8px 10px":"10px 12px",borderRadius:6,border:"1px solid #374151",background:"#23262F",color:"#fff",fontSize:e===d.SMALL?12:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},upload:{border:"1px dashed #374151",borderRadius:8,background:"#181A20",padding:e===d.SMALL?12:24,textAlign:"center",cursor:"pointer",minHeight:e===d.SMALL?100:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:e===d.SMALL?12:14},uploadError:{border:"1px dashed #ff4d4f"},fileItem:{display:"flex",alignItems:"center",background:"#23262F",borderRadius:8,padding:e===d.SMALL?"8px 10px":"12px 16px",marginBottom:e===d.SMALL?6:8,fontSize:e===d.SMALL?12:15,color:"#fff",justifyContent:"space-between"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"8px 24px",fontSize:e===d.SMALL?12:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"8px 24px",fontSize:e===d.SMALL?12:14,cursor:"pointer",fontWeight:600},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:e===d.SMALL?"6px 18px":"4px 14px",fontSize:e===d.SMALL?12:15,marginLeft:e===d.SMALL?8:16,cursor:"pointer"},error:{color:"#ff4d4f",fontSize:e===d.SMALL?12:13,marginTop:e===d.SMALL?2:4,textAlign:"left"}}}}function Go(){const e=k("theme"),t=k("themeConfig"),n=e===D.WHITE,r=Vo(),o=n?r.white:r.dark;if(console.log(t,"themeConfig"),t){const s=n?t.white:t.dark;if(s?.color)return{...o,buttonSubmit:{...o.buttonSubmit,background:s.color}}}return o}const Ko=({formState:e,setFormState:t,onClose:n,loading:r})=>{const o=JSON.parse(sessionStorage.getItem("all_dicts")||"{}");console.log(o,"allDicts");const s=o?.channel||[],i=Go();return m("form",{onSubmit:async u=>{u.preventDefault();let l=!0;t(f=>({...f,platformError:"",transactionIdError:"",filesError:""})),e.platform||(t(f=>({...f,platformError:A("请选择支付平台")})),l=!1),e.transactionId.trim()||(t(f=>({...f,transactionIdError:A("请输入转账交易ID")})),l=!1),(!e.files||e.files.length===0)&&(t(f=>({...f,filesError:A("请上传转账凭证")})),l=!1),l&&(await Eo({transferChannel:e.platform,transferNo:e.transactionId,voucherUrls:e.files}),n(),Xe.success(A("提交成功")))},children:[m("div",{style:{marginBottom:18},children:[m("div",{style:i.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("第三方支付平台")]}),m(Ze,{value:e.platform,onChange:u=>{t(l=>({...l,platform:u,platformError:u?"":l.platformError}))},options:[...s?.map(u=>({value:u.value,label:u.label}))],placeholder:A("请选择支付平台")}),e.platformError&&m("div",{style:i.error,children:e.platformError})]}),m("div",{style:{marginBottom:18},children:[m("div",{style:i.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("交易ID")]}),m("input",{type:"text",placeholder:A("请输入转账交易ID"),value:e.transactionId,maxLength:200,onInput:u=>{let l=u.target.value;l.length>200&&(l=l.slice(0,200)),t(f=>({...f,transactionId:l,transactionIdError:l?"":f.transactionIdError}))},style:{...i.input,...e.transactionIdError?i.inputError:{}}}),e.transactionIdError&&m("div",{style:i.error,children:e.transactionIdError})]}),m("div",{style:{marginBottom:24},children:[m("div",{style:i.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," ",A("上传文件")]}),m(Jo,{value:e.files,onChange:u=>t(l=>({...l,files:u,filesError:""})),maxCount:10,accept:".jpg,.jpeg,.png,.pdf",multiple:!0}),e.filesError&&m("div",{style:i.error,children:e.filesError})]}),m("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[m("button",{type:"button",onClick:n,style:i.buttonCancel,children:A("取消")}),m("button",{type:"submit",disabled:r,style:i.buttonSubmit,children:A("确定")})]})]})};function Xo(){const e=k("size");return{white:{mask:"rgba(0, 0, 0, 0.45)",modalBg:"#fff",modalColor:"#222",modalBoxShadow:"0 6px 16px rgba(0, 0, 0, 0.12)",closeBtn:{position:"absolute",top:"16px",right:"16px",background:"none",border:"none",fontSize:e===d.SMALL?16:24,cursor:"pointer",color:"#999",padding:"0",width:e===d.SMALL?16:24,height:e===d.SMALL?16:24,display:"flex",alignItems:"center",justifyContent:"center"},title:{fontSize:e===d.SMALL?16:18,fontWeight:"600",marginBottom:e===d.SMALL?16:24,color:"#222"},tabBtn:(t,n)=>({flex:1,padding:e===d.SMALL?"8px 10px":"12px 16px",background:t?"#1890ff":"transparent",color:t?"#fff":"#666",border:"1px solid #d9d9d9",borderRight:n?"none":"1px solid #d9d9d9",cursor:"pointer",fontSize:e===d.SMALL?12:14,fontWeight:t?"600":"400",borderRadius:n?"6px 0 0 6px":"0 6px 6px 0"})},dark:{mask:"rgba(0, 0, 0, 0.65)",modalBg:"#23262F",modalColor:"#F5F6FA",modalBoxShadow:"0 6px 16px rgba(0,0,0,0.32)",closeBtn:{position:"absolute",top:e===d.SMALL?"12px":"16px",right:e===d.SMALL?"12px":"16px",background:"none",border:"none",fontSize:e===d.SMALL?16:24,cursor:"pointer",color:"#B5B8BE",padding:"0",width:e===d.SMALL?16:24,height:e===d.SMALL?16:24,display:"flex",alignItems:"center",justifyContent:"center"},title:{fontSize:e===d.SMALL?16:18,fontWeight:"600",marginBottom:e===d.SMALL?16:24,color:"#F5F6FA"},tabBtn:(t,n)=>({flex:1,padding:e===d.SMALL?"8px 10px":"12px 16px",background:t?"#00E8C6":"transparent",color:t?"#fff":"#B5B8BE",border:"1px solid #444C5C",borderRight:n?"none":"1px solid #444C5C",cursor:"pointer",fontSize:e===d.SMALL?12:14,fontWeight:t?"600":"400",borderRadius:n?"6px 0 0 6px":"0 6px 6px 0"})}}}function Zo(){const t=k("theme")===D.WHITE,n=Xo();return t?n.white:n.dark}const pe=k("size");function Yo({visible:e,onClose:t,title:n,children:r,width:o=pe===d.SMALL?300:400,maxWidth:s=pe===d.SMALL?300:400,showClose:i=!0,maskClosable:a=!0}){const[u,l]=O(!1),f=Zo(),c=h=>{h.target===h.currentTarget?l(!0):l(!1)},_=h=>{h.target===h.currentTarget&&u&&a&&t(),l(!1)};return e?m("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:f.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onMouseDown:c,onMouseUp:_,children:m("div",{style:{background:f.modalBg,padding:pe===d.SMALL?24:32,borderRadius:pe===d.SMALL?8:12,minWidth:o,maxWidth:s,color:f.modalColor,boxShadow:f.modalBoxShadow,position:"relative"},onClick:h=>h.stopPropagation(),children:[i&&m("button",{type:"button",onClick:t,style:f.closeBtn,"aria-label":"关闭",children:"×"}),n&&m("div",{style:f.title,children:n}),r]})}):null}function Qo(){const e=k("size");return{white:{tabBtn:(t,n)=>({flex:1,background:t?"#fff":"#F7F8FA",color:t?"#1890ff":"#222",border:"1px solid #F0F1F3",borderRadius:n?"8px 0 0 8px":"0 8px 8px 0",fontWeight:500,fontSize:e===d.SMALL?12:16,height:e===d.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer"})},dark:{tabBtn:(t,n)=>({flex:1,background:t?"#23262F":"#181A20",color:t?"#00E8C6":"#fff",border:"1px solid #444C5C",borderRadius:n?"8px 0 0 8px":"0 8px 8px 0",fontWeight:500,fontSize:e===d.SMALL?12:16,height:e===d.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer"})}}}function ei(){const e=k("theme"),t=k("themeConfig"),n=e===D.WHITE,r=Qo(),o=n?r.white:r.dark;if(t){const s=n?t.white:t.dark;if(s?.color)return{...o,tabBtn:(i,a)=>({...o.tabBtn(i,a),color:i?s.color:o.tabBtn(i,a).color})}}return o}const ti=k("size");function ni({visible:e,onClose:t,onSubmit:n}){const[r,o]=O({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[s,i]=O({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}),[a,u]=O("online"),l=ei();le(()=>{e||(u("online"),o({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),i({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]);const f=async c=>{c.preventDefault();let _=!0;if(o(h=>({...h,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(h=>({...h,amountError:A("请输入充值金额")})),_=!1),r.rechargeChannel||(o(h=>({...h,rechargeChannelError:A("请选择支付平台")})),_=!1),!!_){o(h=>({...h,loading:!0,error:""}));try{await n({amount:r.amount,rechargeChannel:r.rechargeChannel,currency:r.currency}),t()}catch{o(h=>({...h,error:A("提交失败,请重试")}))}finally{o(h=>({...h,loading:!1}))}}};return m(Yo,{visible:e,onClose:t,title:A("充值 / 转账"),children:[m("div",{style:{display:"flex",marginBottom:ti===d.SMALL?16:28},children:[m("button",{type:"button",onClick:()=>u("online"),style:l.tabBtn(a==="online",!0),children:A("在线充值")}),m("button",{type:"button",onClick:()=>u("offline"),style:l.tabBtn(a==="offline",!1),children:A("线下转账")})]}),a==="online"?m("form",{onSubmit:f,children:m($o,{formState:r,setFormState:o,onClose:t,loading:r.loading})}):m(Ko,{formState:s,setFormState:i,onClose:t,loading:s.loading})]})}function st(){return(st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ri=["context","children"];function oi(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var s,i,a={},u=Object.keys(r);for(i=0;i<u.length;i++)o.indexOf(s=u[i])>=0||(a[s]=r[s]);return a}(e,ri);return wn(t,n)}function ii(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Z(oi,st({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],s={},i=0,a=n.attributes,u=n.childNodes;for(i=a.length;i--;)a[i].name!=="slot"&&(s[a[i].name]=a[i].value,s[Cn(a[i].name)]=a[i].value);for(i=u.length;i--;){var l=t(u[i],null),f=u[i].slot;f?s[f]=Z(Pt,{name:f},l):o[i]=l}var c=r?Z(Pt,null,o):o;return Z(r||n.nodeName.toLowerCase(),s,c)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Sn:Oe)(this._vdom,this._root)}function Cn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function si(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[Cn(e)]=n,this._vdom=wn(this._vdom,r),Oe(this._vdom,this._root)}}function ai(){Oe(this._vdom=null,this._root)}function Pt(e,t){var n=this;return Z("slot",st({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function at(e,t,n,r){function o(){var s=Reflect.construct(HTMLElement,[],o);return s._vdomComponent=e,s._root=r&&r.shadow?s.attachShadow({mode:r.mode||"open"}):s,s}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=ii,o.prototype.attributeChangedCallback=si,o.prototype.disconnectedCallback=ai,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(s){Object.defineProperty(o.prototype,s,{get:function(){return this._vdom.props[s]},set:function(i){this._vdom?this.attributeChangedCallback(s,null,i):(this._props||(this._props={}),this._props[s]=i,this.connectedCallback());var a=typeof i;i!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(s,i)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}function li(){const[e,t]=O(!1),n=async r=>{const o=await vo({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return m("div",{children:[m(Tn,{onClick:()=>t(!0),children:A("充值/转账")}),m(ni,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}at(li,"best-recharge",["theme"],{shadow:!1});const It={white:{popover:{background:"#fff",color:"#222",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",border:"none"},arrow:{top:"#fff",bottom:"#fff",left:"#fff",right:"#fff"}},dark:{popover:{background:"#23262F",color:"#fff",boxShadow:"0 4px 16px rgba(0,0,0,0.32)",border:"1px solid #444C5C"},arrow:{top:"#23262F",bottom:"#23262F",left:"#23262F",right:"#23262F"}}};function ci(){return k("theme")===D.WHITE?It.white:It.dark}const ui=({popover:e,children:t,popoverWidth:n,popoverMinWidth:r,offsetY:o,offsetX:s,popoverPosition:i="top"})=>{const a=k("size"),u=n??(a===d.SMALL?200:300),l=r??(a===d.SMALL?150:200),f=o??(a===d.SMALL?8:16),c=s??(a===d.SMALL?8:16),[_,h]=O(!1),[b,y]=O(i),g=Ee(null),x=Ee(null),S=ci(),v=()=>{if(x.current&&(clearTimeout(x.current),x.current=null),i==="top"||i==="bottom")if(g.current){const N=g.current.getBoundingClientRect();i==="top"&&N.top<100?y("bottom"):i==="bottom"&&window.innerHeight-N.bottom<100?y("top"):y(i)}else y(i);else y(i);h(!0)},w=()=>{x.current=window.setTimeout(()=>{h(!1)},120)};let E={position:"absolute",zIndex:999,borderRadius:6,fontSize:a===d.SMALL?12:15,minWidth:l,width:u,padding:a===d.SMALL?"6px 12px":"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...S.popover},C={position:"absolute",zIndex:11,width:0,height:0};return b==="top"?(E={...E,left:"50%",top:-48,transform:"translateX(-50%)"},C={...C,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${S.arrow.top}`}):b==="bottom"?(E={...E,left:"50%",top:"100%",marginTop:f,transform:"translateX(-50%)"},C={...C,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${S.arrow.bottom}`}):b==="leftTop"?(E={...E,right:"100%",top:0,marginRight:c,transform:"none"},C={...C,right:-8,top:a===d.SMALL?8:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${S.arrow.left}`}):b==="rightTop"&&(E={...E,left:"100%",top:0,marginLeft:c,transform:"translateY(0)"},C={...C,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${S.arrow.right}`}),m("div",{ref:g,style:{position:"relative",display:"inline-block"},onMouseEnter:v,onMouseLeave:w,children:[t,_&&m("div",{style:E,onMouseEnter:v,onMouseLeave:w,children:[e,m("div",{style:C})]})]})};function di(){const e=k("size");return{white:{popoverTitle:{fontSize:e===d.SMALL?12:16,fontWeight:600,color:"#222",marginBottom:e===d.SMALL?12:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===d.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:e===d.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===d.SMALL?6:8,height:e===d.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===d.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===d.SMALL?12:15}),main:{fontSize:e===d.SMALL?18:24,fontWeight:800,color:"#111827",display:"inline-block"},currency:{fontSize:e===d.SMALL?16:18,color:"#6b7280",marginLeft:e===d.SMALL?6:8,fontWeight:600}},dark:{popoverTitle:{fontSize:e===d.SMALL?14:16,fontWeight:600,color:"#fff",marginBottom:e===d.SMALL?14:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===d.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #374151",fontSize:e===d.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#B5B8BE",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===d.SMALL?6:8,height:e===d.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===d.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===d.SMALL?12:15}),main:{fontSize:e===d.SMALL?18:24,fontWeight:800,color:"#fff",display:"inline-block"},currency:{fontSize:e===d.SMALL?16:18,color:"#B5B8BE",marginLeft:e===d.SMALL?6:8,fontWeight:600}}}}function fi(){const t=k("theme")===D.WHITE,n=di();return t?n.white:n.dark}function Nt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function pi(e){const[t,n]=O({available:0,currency:"USD",symbol:"$",details:[]}),r=async()=>{try{const i=await vn(),a=[{label:"",value:i.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"",value:i.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},...i.isCredit?[{label:"",value:i.creditLimit,color:"#1890ff",dot:"#1890ff"},{label:"",value:i.creditUsed,color:"#ff0000",dot:"#ff0000"}]:[],{label:"",value:i.availableAmount,color:"#1890ff",dot:"#15b36b"}],u={available:i.availableAmount,currency:"USD",symbol:"$",details:a};n(u)}catch(i){console.error("获取余额失败:",i)}};le(()=>{r()},[]),le(()=>{const i=()=>{r()};return document.addEventListener("refresh-balance",i),()=>{document.removeEventListener("refresh-balance",i)}},[]);const o=fi(),s=[{label:A("真实金额"),value:t.details[0]?.value||0,color:"#15b36b",dot:"#15b36b"},{label:A("冻结金额"),value:t.details[1]?.value||0,color:"#f59e0b",dot:"#f59e0b"},...t.details.length>4?[{label:A("信用额度"),value:t.details[2]?.value||0,color:"#1890ff",dot:"#1890ff"},{label:A("已用额度"),value:t.details[3]?.value||0,color:"#ff0000",dot:"#ff0000"}]:[],{label:A("可用余额"),value:t.details[t.details.length-1]?.value||0,color:"#1890ff",dot:"#15b36b"}];return m(ui,{popover:m(K,{children:[m("div",{style:o.popoverTitle,children:A("余额详情")}),s.map(i=>m("div",{style:o.detailRow,children:[m("span",{style:o.detailLabel,children:[m("span",{style:o.detailDot(i.dot)}),i.label]}),m("span",{style:o.detailValue(i.color),children:[t.symbol,Nt(i.value)]})]},i.label))]}),popoverPosition:e.popoverPosition||"bottom",children:m("div",{style:o.main,children:[t.symbol,Nt(t.available),m("span",{style:o.currency,children:t.currency})]})})}at(pi,"best-statistical-balance");const he={white:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,transition:"all 0.2s ease"},dark:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,transition:"all 0.2s ease"}};function hi(e){return k("theme")===D.WHITE?{...he.white,background:e||he.white.background}:{...he.dark,background:e||he.dark.background}}function mi(e){switch(e){case"small":return{fontSize:"12px",gap:"2px"};case"large":return{fontSize:"18px",gap:"6px"};default:return{fontSize:"14px",gap:"4px"}}}function _i({color:e,size:t="medium",children:n}){const[r,o]=O(!1),s=hi(e),i=mi(t),a={...s,...i,display:"flex",alignItems:"center"};return m(K,{children:[m("style",{children:`
|
|
61
61
|
@keyframes spin {
|
|
62
62
|
from {
|
|
63
63
|
transform: rotate(0deg);
|
package/dist/best-unit.js
CHANGED
|
@@ -2441,6 +2441,7 @@ function kn({ onClick: e, color: t, children: n }) {
|
|
|
2441
2441
|
}
|
|
2442
2442
|
const To = {
|
|
2443
2443
|
确定: "确定",
|
|
2444
|
+
提交成功: "提交成功",
|
|
2444
2445
|
// 余额相关
|
|
2445
2446
|
余额详情: "余额详情",
|
|
2446
2447
|
真实金额: "真实金额",
|
|
@@ -2472,7 +2473,6 @@ const To = {
|
|
|
2472
2473
|
请输入转账交易ID: "请输入转账交易ID",
|
|
2473
2474
|
上传文件: "上传文件",
|
|
2474
2475
|
请上传转账凭证: "请上传转账凭证",
|
|
2475
|
-
离线充值创建成功: "离线充值创建成功",
|
|
2476
2476
|
// 通用
|
|
2477
2477
|
"加载中...": "加载中...",
|
|
2478
2478
|
错误: "错误",
|
|
@@ -2495,6 +2495,7 @@ function Co(e) {
|
|
|
2495
2495
|
}
|
|
2496
2496
|
const Ro = {
|
|
2497
2497
|
确定: "Confirm",
|
|
2498
|
+
提交成功: "Submit Success",
|
|
2498
2499
|
// 余额相关
|
|
2499
2500
|
余额详情: "Balance Details",
|
|
2500
2501
|
真实金额: "Real Balance",
|
|
@@ -2526,7 +2527,6 @@ const Ro = {
|
|
|
2526
2527
|
请输入转账交易ID: "Please enter transfer transaction ID",
|
|
2527
2528
|
上传文件: "Upload Files",
|
|
2528
2529
|
请上传转账凭证: "Please upload transfer voucher",
|
|
2529
|
-
离线充值创建成功: "Offline recharge created successfully",
|
|
2530
2530
|
// 通用
|
|
2531
2531
|
"加载中...": "Loading...",
|
|
2532
2532
|
错误: "Error",
|
|
@@ -3556,7 +3556,7 @@ const Wo = ({ formState: e, setFormState: t, onClose: n, loading: r }) => {
|
|
|
3556
3556
|
transferChannel: e.platform,
|
|
3557
3557
|
transferNo: e.transactionId,
|
|
3558
3558
|
voucherUrls: e.files
|
|
3559
|
-
}), n(), Xe.success(A("
|
|
3559
|
+
}), n(), Xe.success(A("提交成功")));
|
|
3560
3560
|
}, children: [
|
|
3561
3561
|
/* @__PURE__ */ m("div", { style: { marginBottom: 18 }, children: [
|
|
3562
3562
|
/* @__PURE__ */ m("div", { style: i.label, children: [
|
package/package.json
CHANGED
package/src/local/en.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// 英文语言包
|
|
2
2
|
export const en: Record<string, string> = {
|
|
3
3
|
确定: "Confirm",
|
|
4
|
+
提交成功: "Submit Success",
|
|
4
5
|
// 余额相关
|
|
5
6
|
余额详情: "Balance Details",
|
|
6
7
|
真实金额: "Real Balance",
|
|
@@ -35,7 +36,6 @@ export const en: Record<string, string> = {
|
|
|
35
36
|
请输入转账交易ID: "Please enter transfer transaction ID",
|
|
36
37
|
上传文件: "Upload Files",
|
|
37
38
|
请上传转账凭证: "Please upload transfer voucher",
|
|
38
|
-
离线充值创建成功: "Offline recharge created successfully",
|
|
39
39
|
|
|
40
40
|
// 通用
|
|
41
41
|
"加载中...": "Loading...",
|
package/src/local/zh.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// 中文语言包
|
|
2
2
|
export const zh: Record<string, string> = {
|
|
3
3
|
确定: "确定",
|
|
4
|
+
提交成功: "提交成功",
|
|
4
5
|
// 余额相关
|
|
5
6
|
余额详情: "余额详情",
|
|
6
7
|
真实金额: "真实金额",
|
|
@@ -34,7 +35,6 @@ export const zh: Record<string, string> = {
|
|
|
34
35
|
请输入转账交易ID: "请输入转账交易ID",
|
|
35
36
|
上传文件: "上传文件",
|
|
36
37
|
请上传转账凭证: "请上传转账凭证",
|
|
37
|
-
离线充值创建成功: "离线充值创建成功",
|
|
38
38
|
|
|
39
39
|
// 通用
|
|
40
40
|
"加载中...": "加载中...",
|