best-unit 2.0.10 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/best-unit.cjs +1 -1
- package/dist/best-unit.js +11 -2
- package/package.json +1 -1
- package/src/components/business/payment-sdk/online-payment/theme.tsx +5 -0
- package/src/components/business/payment-sdk/select-payment/theme.tsx +5 -0
- package/src/components/business/statistical-balance/index.tsx +1 -2
package/dist/best-unit.cjs
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
.${e.scrollbarClass}::-webkit-scrollbar-thumb:hover {
|
|
76
76
|
background: ${e.scrollbarThumbHoverColor};
|
|
77
77
|
}
|
|
78
|
-
`,document.head.appendChild(n),t}function Vn({visible:e,onClose:t,title:n,children:r,width:o=re===l.SMALL?300:400,maxWidth:a=re===l.SMALL?300:400,showClose:i=!0,maskClosable:s=!0}){const[p,c]=B(!1),f=_i();J(()=>{Si(f)},[f]);const u=m=>{m.target===m.currentTarget?c(!0):c(!1)},y=m=>{m.target===m.currentTarget&&p&&s&&t(),c(!1)};return e?d("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:f.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onMouseDown:u,onMouseUp:y,children:d("div",{style:{background:f.modalBg,borderRadius:re===l.SMALL?8:12,minWidth:o,maxWidth:a,color:f.modalColor,boxShadow:f.modalBoxShadow,position:"relative",width:typeof o=="string"?o:`${o}px`,maxHeight:"90vh",display:"flex",flexDirection:"column"},onClick:m=>m.stopPropagation(),children:[d("div",{style:{position:"sticky",top:0,background:f.modalBg,borderRadius:re===l.SMALL?"8px 8px 0 0":"12px 12px 0 0",padding:re===l.SMALL?"24px 24px 0 24px":"32px 32px 0 32px",zIndex:1,borderBottom:`1px solid ${f.headerBorder}`},children:[i&&d("button",{type:"button",onClick:t,style:f.closeBtn,"aria-label":"关闭",children:"×"}),n&&d("div",{style:f.title,children:n})]}),d("div",{className:`modal-content ${f.scrollbarClass}`,style:{flex:1,overflowY:"auto",padding:re===l.SMALL?"16px 24px 24px 24px":"20px 32px 32px 32px"},children:r})]})}):null}function Li(){const e=E("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===l.SMALL?12:16,height:e===l.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===l.SMALL?12:16,height:e===l.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer"})}}}function wi(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Li(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,tabBtn:(i,s)=>({...o.tabBtn(i,s),color:i?a.color:o.tabBtn(i,s).color})}}return o}const Ai=E("size");function ki({visible:e,onClose:t,onSubmit:n}){const[r,o]=B({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,i]=B({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}),[s,p]=B("online"),c=wi();J(()=>{e||(p("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 u=>{u.preventDefault();let y=!0;if(o(m=>({...m,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(m=>({...m,amountError:_("请输入充值金额")})),y=!1),r.rechargeChannel||(o(m=>({...m,rechargeChannelError:_("请选择支付平台")})),y=!1),!!y){o(m=>({...m,loading:!0,error:""}));try{await n({amount:r.amount,rechargeChannel:r.rechargeChannel,currency:r.currency}),t()}catch{o(m=>({...m,error:_("提交失败,请重试")}))}finally{o(m=>({...m,loading:!1}))}}};return d(Vn,{visible:e,onClose:t,title:_("充值 / 转账"),children:[d("div",{style:{display:"flex",marginBottom:Ai===l.SMALL?16:28},children:[d("button",{type:"button",onClick:()=>p("online"),style:c.tabBtn(s==="online",!0),children:_("在线充值")}),d("button",{type:"button",onClick:()=>p("offline"),style:c.tabBtn(s==="offline",!1),children:_("线下转账")})]}),d("div",{style:{display:s==="online"?"block":"none"},children:d("form",{onSubmit:f,children:d(fi,{formState:r,setFormState:o,onClose:t,loading:r.loading})})}),d("div",{style:{display:s==="offline"?"block":"none"},children:d(yi,{formState:a,setFormState:i,onClose:t,loading:a.loading})})]})}function mt(){return(mt=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 Ei=["context","children"];function Ci(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,i,s={},p=Object.keys(r);for(i=0;i<p.length;i++)o.indexOf(a=p[i])>=0||(s[a]=r[a]);return s}(e,Ei);return un(t,n)}function vi(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=ie(Ci,mt({},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=[],a={},i=0,s=n.attributes,p=n.childNodes;for(i=s.length;i--;)s[i].name!=="slot"&&(a[s[i].name]=s[i].value,a[Yn(s[i].name)]=s[i].value);for(i=p.length;i--;){var c=t(p[i],null),f=p[i].slot;f?a[f]=ie(Gt,{name:f},c):o[i]=c}var u=r?ie(Gt,null,o):o;return ie(r||n.nodeName.toLowerCase(),a,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?dn:ze)(this._vdom,this._root)}function Yn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ti(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[Yn(e)]=n,this._vdom=un(this._vdom,r),ze(this._vdom,this._root)}}function Mi(){ze(this._vdom=null,this._root)}function Gt(e,t){var n=this;return ie("slot",mt({},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 qe(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=vi,o.prototype.attributeChangedCallback=Ti,o.prototype.disconnectedCallback=Mi,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(i){this._vdom?this.attributeChangedCallback(a,null,i):(this._props||(this._props={}),this._props[a]=i,this.connectedCallback());var s=typeof i;i!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(a,i)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}function Bi(){const[e,t]=B(!1),n=async r=>{const o=await Wn({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return d("div",{children:[d(ht,{onClick:()=>t(!0),children:_("充值/转账")}),d(ki,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}qe(Bi,"best-recharge",["theme"],{shadow:!1});function Ri(){const e=E("size"),t={wrapper:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:e===l.SMALL?12:20,alignItems:"start",minWidth:880,"@media (max-width: 1020px)":{gridTemplateColumns:"1fr",gap:16,minWidth:"auto",width:"100%"}},fieldLabel:{fontSize:e===l.SMALL?12:13,marginBottom:6,fontWeight:500,textAlign:"left"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13},inputWrapper:{position:"relative"},inputSuffix:{padding:"0 8px",fontSize:e===l.SMALL?12:13,opacity:.8},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},subTitle:{marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?8:10,fontWeight:600,textAlign:"left"},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},methodList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},bankList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}}};return{white:{...t,left:{background:"#fff",borderRadius:8,padding:16,border:"1px solid #E5E6EB"},right:{background:"#fff",borderRadius:8,padding:16},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 480px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#1890ff":"#E5E6EB"}`,color:n?"#1890ff":"#222",background:n?"#EEF7FF":"#fff",cursor:"pointer"}),input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:600,cursor:"pointer"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",cursor:"pointer"}),bankItem:{padding:"10px 12px",borderRadius:8,border:"1px solid #F0F1F3",background:"#F7F8FA",textAlign:"left"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left"},reminderList:{margin:0,paddingLeft:18,color:"#6b7280",lineHeight:1.6,textAlign:"left"}},dark:{...t,left:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},right:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 480px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#00E8C6":"#374151"}`,color:n?"#00E8C6":"#fff",background:n?"#0F2824":"#23262F",cursor:"pointer"}),input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#00E8C6",color:"#111",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:700,cursor:"pointer"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer"}),bankItem:{padding:"10px 12px",borderRadius:8,border:"1px solid #374151",background:"#23262F",textAlign:"left",color:"#fff"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1",fontSize:e===l.SMALL?12:13},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left",color:"#fff"},reminderList:{margin:0,paddingLeft:18,color:"#B5B8BE",lineHeight:1.6,textAlign:"left"}}}}function Fi(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Ri(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,payButton:{...o.payButton,background:a.color},currencyItem:i=>({...o.currencyItem(i),border:`1px solid ${i?a.color:n?"#E5E6EB":"#374151"}`,color:i?a.color:n?"#222":"#fff"}),methodItem:i=>({...o.methodItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`})}}return o}function Ii(){const e=E("size"),t={left:{background:"#fff",borderRadius:8,padding:16,border:"1px solid #E5E6EB"},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},fieldLabel:{fontSize:e===l.SMALL?14:16,marginBottom:6,fontWeight:500,textAlign:"left"},required:{color:"#ff4d4f",marginRight:4},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 600px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#1890ff":"#E5E6EB"}`,color:n?"#1890ff":"#222",background:n?"#EEF7FF":"#fff",cursor:"pointer"}),inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},bizRateBox:{marginTop:6,color:"#666",fontSize:e===l.SMALL?12:13,textAlign:"left",lineHeight:1.6},bizRateStrong:{color:"#111",fontWeight:600},subTitle:{fontSize:e===l.SMALL?12:14,marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?8:10,textAlign:"left"},methodList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},methodItem:n=>({padding:"12px 16px",textAlign:"left",borderRadius:10,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),channelIcon:{width:22,height:22,objectFit:"contain",marginRight:8,display:"inline-block"},bankList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},bankItem:n=>({padding:"12px 16px",borderRadius:10,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",textAlign:"left",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13}};return{white:{...t,input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"}},dark:{...t,left:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#00E8C6":"#374151"}`,color:n?"#00E8C6":"#fff",background:n?"#0F2824":"#23262F",cursor:"pointer"}),input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},methodItem:n=>({padding:"12px 16px",textAlign:"left",borderRadius:10,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),bankItem:n=>({padding:"12px 16px",borderRadius:10,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",textAlign:"left",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44})}}}function Di(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Ii(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,titleBar:{...o.titleBar,background:a.color},currencyItem:i=>({...o.currencyItem(i),border:`1px solid ${i?a.color:n?"#E5E6EB":"#374151"}`,color:i?a.color:n?"#222":"#fff"}),methodItem:i=>({...o.methodItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`}),bankItem:i=>({...o.bankItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`})}}return o}function zi({onChannelChange:e,onAmountChange:t,onCurrencyChange:n,initialAmount:r="",initialCurrency:o="USD",initialPaymentType:a="online",amountError:i=""}){const s=Di(),c=JSON.parse(sessionStorage.getItem("all_dicts")||"{}")?.currency||[],[f,u]=B([]),[y,m]=B([]),[h,x]=B({currency:o,amount:r,onlineChannel:"",bankChannel:"",paymentType:a,amountError:""}),[b,S]=B(null),L=se(null),M=(w,F)=>{const U=w!==void 0?w:h.amount,$=F!==void 0?F:h.currency;if(!U||Number(U)<=0){S(null);return}L.current&&clearTimeout(L.current),L.current=window.setTimeout(()=>{Jo({currency:$,amount:U}).then(V=>S(V)).catch(()=>S(null))},300)};J(()=>{qo({currency:h.currency}).then(w=>{const F=w.onlineChannel||[],U=w.offlineChannel||[];u(F),m(U);const $=F.length>0,V=U?.[0]?.value||"",Se=F?.[0]?.value||"",de=$?a:"bank",k=de==="online"?Se:V;x(v=>({...v,onlineChannel:Se,bankChannel:V,paymentType:de})),k&&e(k,de)})},[h.currency]);function A(w){return w=w.replace(/[^\d.]/g,""),w=w.replace(/\.(?=.*\.)/g,""),w=w.replace(/^(\d+)(\.\d{0,2})?.*$/,"$1$2"),w=w.replace(/^0+(\d)/,"$1"),w.startsWith(".")&&(w="0"+w),w}const T=w=>{x(F=>({...F,currency:w})),n(w),M(void 0,w)},R=w=>{const F=A(w);x(U=>({...U,amount:F,amountError:""})),t(F),M(F)},P=(w,F)=>{x(U=>({...U,[F==="online"?"onlineChannel":"bankChannel"]:w,paymentType:F})),e(w,F),M()};return d("div",{style:s.left,children:[d("div",{style:s.blockTitle,children:[d("span",{style:s.titleBar}),_("选择支付方式")]}),d("div",{style:s.fieldLabel,children:_("支付币种")}),d("div",{style:s.currencyRow,children:(c||[]).slice(0,4).map(w=>d("button",{type:"button",onClick:()=>T(w.value),style:s.currencyItem(h.currency===w.value),children:w.label}))}),d("div",{style:{height:12}}),d("div",{style:s.fieldLabel,children:[d("span",{style:s.required,children:"*"}),_("支付金额")]}),d("div",{style:s.inputWrapper,children:[d("input",{type:"text",placeholder:_("请输入充值金额"),value:h.amount,onInput:w=>{R(w.target.value)},style:{...s.input,...i?s.inputError:{}}}),d("div",{style:s.inputSuffixAbs,children:h.currency})]}),i&&d("div",{style:s.error,children:i}),b&&b.consistent===!1&&d("div",{style:s.bizRateBox,children:[d("div",{children:_("您的支付币种与默认币种不一致,将转换为默认币种入账")}),d("div",{children:[_("目前汇率为:")," ",h.currency,_(`→${b.currency} = `),d("span",{style:s.bizRateStrong,children:b.exchangeRate})]}),d("div",{children:[_("钱包预计增加"),d("span",{style:s.bizRateStrong,children:[b.currency," ",b.amount]})]})]}),d("div",{style:{height:20}}),d("div",{style:s.fieldLabel,children:_("支付方式")}),f.length>0&&d("div",{children:[d("div",{style:s.subTitle,children:_("线上支付")}),d("div",{style:s.methodList,children:f.map(w=>d("button",{type:"button",onClick:()=>P(w.value,"online"),style:s.methodItem(h.onlineChannel===w.value&&h.paymentType==="online"),children:[w.icon&&d("img",{src:w.icon,alt:w.label,style:s.channelIcon}),w.label]}))})]}),d("div",{style:s.subTitle,children:_("银行转账")}),d("div",{style:s.bankList,children:y.map(w=>d("button",{type:"button",onClick:()=>P(w.value,"bank"),style:s.bankItem(h.bankChannel===w.value&&h.paymentType==="bank"),children:[w.icon&&d("img",{src:w.icon,alt:w.label,style:s.channelIcon}),w.label]}))})]})}function Oi(){const e=E("size"),t={right:{background:"#fff",borderRadius:8,padding:16},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},disabled:{backgroundColor:"#f5f5f5",color:"#999",cursor:"not-allowed"},disabledDark:{backgroundColor:"#1A1D23",color:"#6B7280",cursor:"not-allowed",border:"1px solid #374151"},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:600,cursor:"pointer"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13},calcBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?8:12,color:"#666",textAlign:"left",lineHeight:1.6,fontSize:e===l.SMALL?12:13},calcLine:{marginBottom:4},calcAmount:{color:"#ff4d4f",fontWeight:700,margin:"0 4px"},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left"},reminderList:{margin:0,paddingLeft:18,color:"#6b7280",lineHeight:1.6,textAlign:"left",listStyleType:"disc",listStylePosition:"outside"},listItem:{listStyleType:"disc",listStylePosition:"outside"},error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13}};return{white:{...t,input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"}},dark:{...t,right:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},payButton:{...t.payButton,background:"#00E8C6",color:"#111",fontWeight:700},noticeBox:{...t.noticeBox,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"}}}}function Pi(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Oi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,payButton:{...o.payButton,background:a.color},titleBar:{...o.titleBar,background:a.color}}}return o}function Ni({onSubmit:e,amount:t,currency:n,channel:r,loading:o=!1,error:a="",onAmountError:i}){const s=Pi(),p=s.right.background==="#181A20",[c,f]=B({amount:t,currency:n,channel:r,loading:o,error:a,amountError:""}),[u,y]=B(null);J(()=>{f(x=>({...x,amount:t,currency:n,channel:r,loading:o,error:a}));const h=setTimeout(()=>{t&&r&&n?Hn({channel:r,amount:t,currency:n}).then(x=>y(x)).catch(()=>y(null)):y(null)},300);return()=>clearTimeout(h)},[t,n,r,o,a]);const m=async h=>{h&&h.preventDefault();let x=!0;if(t.trim()||(x=!1,i?.(_("请输入充值金额"))),r||(x=!1,f(b=>({...b,error:_("请选择支付平台")}))),!!x){f(b=>({...b,loading:!0,error:""}));try{await e({amount:t,currency:n,rechargeChannel:r})}finally{f(b=>({...b,loading:!1}))}}};return d("div",{style:s.right,children:[d("div",{style:s.blockTitle,children:[d("span",{style:s.titleBar}),_("在线支付")]}),d("form",{onSubmit:m,children:[d("div",{style:s.inputWrapper,children:[d("input",{type:"text",placeholder:_("支付金额"),value:c.amount,readOnly:!0,disabled:!0,style:{...s.input,...p?s.disabledDark:s.disabled,width:"100%"}}),d("div",{style:s.inputSuffixAbs,children:c.currency})]}),d("button",{type:"submit",disabled:c.loading,style:s.payButton,children:c.loading?_("提交中..."):_("立即支付")})]}),u&&d("div",{style:s.calcBox,children:[d("div",{style:s.calcLine,children:[_("预计支付金额约为:"),d("span",{style:s.calcAmount,children:`$${u.paymentAmount}`}),u.currency]}),d("div",{style:s.calcLine,children:[_("手续费约为:"),d("span",{style:s.calcAmount,children:`$${u.fee}`}),u.currency]}),d("div",{children:_("注:地区/币种/卡类型可能影响手续费,最终以平台为准。")})]}),d("div",{style:s.noticeBox,children:_("请在转账后提交银行回单,否则可能无法及时核验")}),d("div",{style:s.reminderTitle,children:_("温馨提示")}),d("ul",{style:s.reminderList,children:[d("li",{style:s.listItem,children:_("支付金额须与申请金额一致,请勿多付、少付或分批提交。")}),d("li",{style:s.listItem,children:_("请妥善保存回单并提供准确的支付时间,否则可能无法核验。")}),d("li",{style:s.listItem,children:_("工作时间提交4小时内审核,非工作时间将顺延至下一个工作日。")}),d("li",{style:s.listItem,children:_("如有问题,请联系平台客服。")}),d("li",{style:s.listItem,children:_("预付充值将收取平台服务费,具体以官方为准。")})]}),c.error&&d("div",{style:s.error,children:c.error})]})}function Ui(){const e=E("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?14:16,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{padding:e===l.SMALL?12:16}},header:{marginBottom:e===l.SMALL?16:20},backButton:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",color:"#1890ff",cursor:"pointer",fontSize:e===l.SMALL?13:14,fontWeight:500},backIcon:{fontSize:e===l.SMALL?16:18},uploadSection:{marginBottom:e===l.SMALL?18:24},uploadArea:{border:"2px dashed #D9D9D9",borderRadius:8,padding:e===l.SMALL?"30px 16px":"40px 20px",textAlign:"center",cursor:"pointer",background:"#FAFAFA",transition:"all 0.3s ease",width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{padding:e===l.SMALL?"30px 15px":"40px 20px"}},uploadIcon:{fontSize:e===l.SMALL?40:52,marginBottom:e===l.SMALL?10:12},uploadTitle:{fontSize:e===l.SMALL?14:16,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?6:10},uploadHint:{fontSize:e===l.SMALL?12:13,color:"#999"},hiddenInput:{display:"none"},fileList:{marginTop:e===l.SMALL?10:12},fileItem:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:e===l.SMALL?"6px 10px":"8px 12px",background:"#F5F5F5",borderRadius:6,marginBottom:6},fileName:{fontSize:e===l.SMALL?12:13,color:"#222"},removeButton:{background:"#ff4d4f",color:"#fff",border:"none",borderRadius:"50%",width:20,height:20,cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center"},fieldSection:{marginBottom:e===l.SMALL?12:16},fieldLabel:{display:"block",fontSize:e===l.SMALL?13:14,fontWeight:500,color:"#222",marginBottom:e===l.SMALL?6:10},required:{color:"#ff4d4f",marginRight:4},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,border:"1px solid #D9D9D9",outline:"none",fontSize:14,boxSizing:"border-box"},inputError:{border:"1px solid #ff4d4f"},disabled:{backgroundColor:"#f5f5f5",color:"#999",cursor:"not-allowed"},disabledDark:{backgroundColor:"#1A1D23",color:"#6B7280",cursor:"not-allowed",border:"1px solid #374151"},calendarIcon:{position:"absolute",right:e===l.SMALL?8:10,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?12:14,pointerEvents:"none"},currencySuffix:{position:"absolute",right:e===l.SMALL?10:12,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?12:14,color:"#999",pointerEvents:"none"},buttonSection:{display:"flex",gap:e===l.SMALL?10:12,marginTop:e===l.SMALL?24:32,width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",gap:e===l.SMALL?8:12}},cancelButton:{flex:1,padding:e===l.SMALL?"8px 12px":"10px 16px",borderRadius:6,border:"1px solid #D9D9D9",background:"#fff",color:"#222",fontSize:e===l.SMALL?12:14,fontWeight:500,cursor:"pointer",minWidth:0,boxSizing:"border-box"},submitButton:{flex:1,padding:e===l.SMALL?"8px 12px":"10px 16px",borderRadius:6,border:"none",background:"#1890ff",color:"#fff",fontSize:e===l.SMALL?12:14,fontWeight:600,cursor:"pointer",minWidth:0,boxSizing:"border-box"},error:{color:"#ff4d4f",fontSize:e===l.SMALL?12:13,marginTop:6}};return{white:{...t},dark:{...t,container:{...t.container,background:"#181A20",border:"1px solid #2B2E38"},backButton:{...t.backButton,color:"#00E8C6"},uploadArea:{...t.uploadArea,border:"2px dashed #374151",background:"#23262F"},uploadTitle:{...t.uploadTitle,color:"#fff"},uploadHint:{...t.uploadHint,color:"#B5B8BE"},fileItem:{...t.fileItem,background:"#2B2E38"},fileName:{...t.fileName,color:"#fff"},fieldLabel:{...t.fieldLabel,color:"#fff"},input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},calendarIcon:{...t.calendarIcon,color:"#B5B8BE"},currencySuffix:{...t.currencySuffix,color:"#B5B8BE"},cancelButton:{...t.cancelButton,border:"1px solid #374151",background:"#23262F",color:"#fff"},submitButton:{...t.submitButton,background:"#00E8C6",color:"#111"}}}}function $i(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Ui(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,backButton:{...o.backButton,color:a.color},submitButton:{...o.submitButton,background:a.color}}}return o}const Wi="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1760084950168'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6759'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M932.579556%20137.272889h-192V64.142222a9.159111%209.159111%200%200%200-9.130667-9.159111h-64a9.159111%209.159111%200%200%200-9.159111%209.159111v73.130667H365.738667V64.142222a9.159111%209.159111%200%200%200-9.159111-9.159111h-64a9.159111%209.159111%200%200%200-9.130667%209.159111v73.130667h-192c-20.224%200-36.579556%2016.355556-36.579556%2036.579555v758.869334c0%2020.195556%2016.355556%2036.551111%2036.579556%2036.551111h841.130667c20.252444%200%2036.579556-16.327111%2036.579555-36.551111V173.852444c0-20.224-16.355556-36.579556-36.579555-36.579555zM886.897778%20887.011556H137.159111V452.693333H886.897778v434.261334z%20m-749.710222-512V219.534222h146.289777v54.869334c0%205.034667%204.124444%209.130667%209.130667%209.130666h64a9.159111%209.159111%200%200%200%209.159111-9.130666V219.562667h292.551111v54.869333c0%205.034667%204.124444%209.130667%209.159111%209.130667h64a9.159111%209.159111%200%200%200%209.130667-9.130667V219.562667h146.289778v155.448889H137.159111z'%20p-id='6760'%3e%3c/path%3e%3c/svg%3e";function Hi(){const e=E("theme"),t=E("themeConfig"),n={container:{position:"relative",display:"inline-block"},input:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",backgroundColor:"#fff",cursor:"pointer",transition:"all 0.3s",outline:"none",fontSize:"14px",lineHeight:"1.5715",color:"rgba(0, 0, 0, 0.85)"},inputText:{flex:1,textAlign:"left",color:"rgba(0, 0, 0, 0.85)"},calendarIcon:{fontSize:"16px",color:"rgba(0, 0, 0, 0.45)",marginLeft:"8px",width:16,height:16,objectFit:"contain",display:"inline-block"},disabled:{backgroundColor:"#f5f5f5",color:"rgba(0, 0, 0, 0.25)",cursor:"not-allowed"},panel:{position:"absolute",top:"100%",left:0,zIndex:1050,backgroundColor:"#fff",border:"1px solid #d9d9d9",borderRadius:"6px",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",padding:"8px",minWidth:"280px",marginTop:"4px"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",marginBottom:"8px"},navButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"16px",color:"rgba(0, 0, 0, 0.45)",transition:"all 0.3s"},monthYear:{fontSize:"16px",fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},weekHeader:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"4px",marginBottom:"8px"},weekDay:{display:"flex",alignItems:"center",justifyContent:"center",height:"32px",fontSize:"14px",fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},calendarGrid:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"4px"},dayButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"14px",transition:"all 0.3s",color:"rgba(0, 0, 0, 0.85)"},dayCurrentMonth:{color:"rgba(0, 0, 0, 0.85)"},dayOtherMonth:{color:"rgba(0, 0, 0, 0.25)"},dayToday:{fontWeight:600,color:"#1890ff"},daySelected:{backgroundColor:"#1890ff",color:"#fff"},yearPicker:{maxHeight:"200px",overflowY:"auto",marginBottom:"8px",border:"1px solid #f0f0f0",borderRadius:"4px",padding:"8px"},yearGrid:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"4px"},yearButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"14px",transition:"all 0.3s",color:"rgba(0, 0, 0, 0.85)"},yearSelected:{backgroundColor:"#1890ff",color:"#fff"},small:{padding:"4px 8px",fontSize:"12px"},middle:{padding:"8px 12px",fontSize:"14px"},large:{padding:"12px 16px",fontSize:"16px"}},r={white:{...n,input:{...n.input,border:"1px solid #d9d9d9",backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.85)"},inputText:{...n.inputText,color:"rgba(0, 0, 0, 0.85)"},calendarIcon:{...n.calendarIcon,color:"rgba(0, 0, 0, 0.45)"},disabled:{...n.disabled,backgroundColor:"#f5f5f5",color:"rgba(0, 0, 0, 0.25)"},panel:{...n.panel,backgroundColor:"#fff",border:"1px solid #d9d9d9"},navButton:{...n.navButton,color:"rgba(0, 0, 0, 0.45)"},monthYear:{...n.monthYear,color:"rgba(0, 0, 0, 0.85)"},weekDay:{...n.weekDay,color:"rgba(0, 0, 0, 0.85)"},dayButton:{...n.dayButton,color:"rgba(0, 0, 0, 0.85)"},dayCurrentMonth:{...n.dayCurrentMonth,color:"rgba(0, 0, 0, 0.85)"},dayOtherMonth:{...n.dayOtherMonth,color:"rgba(0, 0, 0, 0.25)"},dayToday:{...n.dayToday,color:"#1890ff"},daySelected:{...n.daySelected,backgroundColor:"#1890ff",color:"#fff"},yearPicker:{...n.yearPicker,border:"1px solid #f0f0f0"},yearButton:{...n.yearButton,color:"rgba(0, 0, 0, 0.85)"},yearSelected:{...n.yearSelected,backgroundColor:"#1890ff",color:"#fff"}},dark:{...n,input:{...n.input,border:"1px solid #434343",backgroundColor:"#141414",color:"rgba(255, 255, 255, 0.85)"},inputText:{...n.inputText,color:"rgba(255, 255, 255, 0.85)"},calendarIcon:{...n.calendarIcon,color:"rgba(255, 255, 255, 0.45)"},disabled:{...n.disabled,backgroundColor:"#262626",color:"rgba(255, 255, 255, 0.25)"},panel:{...n.panel,backgroundColor:"#141414",border:"1px solid #434343"},navButton:{...n.navButton,color:"rgba(255, 255, 255, 0.45)"},monthYear:{...n.monthYear,color:"rgba(255, 255, 255, 0.85)"},weekDay:{...n.weekDay,color:"rgba(255, 255, 255, 0.85)"},dayButton:{...n.dayButton,color:"rgba(255, 255, 255, 0.85)"},dayCurrentMonth:{...n.dayCurrentMonth,color:"rgba(255, 255, 255, 0.85)"},dayOtherMonth:{...n.dayOtherMonth,color:"rgba(255, 255, 255, 0.25)"},dayToday:{...n.dayToday,color:"#00E8C6"},daySelected:{...n.daySelected,backgroundColor:"#00E8C6",color:"#111"},yearPicker:{...n.yearPicker,border:"1px solid #434343"},yearButton:{...n.yearButton,color:"rgba(255, 255, 255, 0.85)"},yearSelected:{...n.yearSelected,backgroundColor:"#00E8C6",color:"#111"}}},o=r[e]||r.white,a=t?.[e]?.color;return a&&(o.dayToday.color=a,o.daySelected.backgroundColor=a,o.yearSelected.backgroundColor=a,e==="dark"&&(o.daySelected.color="#111",o.yearSelected.color="#111")),o}function ji(){return Hi()}function qi({value:e="",placeholder:t=_("请选择日期"),disabled:n=!1,size:r="middle",onChange:o,onFocus:a,onBlur:i,className:s="",style:p={}}){const c=ji(),[f,u]=B(!1),[y,m]=B(e),[h,x]=B(new Date),[b,S]=B(!1),L=se(null),M=k=>{if(!k)return"";const v=new Date(k);return`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}-${String(v.getDate()).padStart(2,"0")}`},A=(k,v)=>new Date(k,v+1,0).getDate(),T=(k,v)=>new Date(k,v,1).getDay(),R=()=>{const k=h.getFullYear(),v=h.getMonth(),ue=A(k,v),Gn=T(k,v),fe=[],gt=v===0?11:v-1,bt=v===0?k-1:k,yt=A(bt,gt);for(let H=Gn-1;H>=0;H--)fe.push({date:yt-H,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${bt}-${String(gt+1).padStart(2,"0")}-${String(yt-H).padStart(2,"0")}`});const Kn=new Date,xt=y?new Date(y):null;for(let H=1;H<=ue;H++){const _t=`${k}-${String(v+1).padStart(2,"0")}-${String(H).padStart(2,"0")}`,St=new Date(_t);fe.push({date:H,isCurrentMonth:!0,isToday:St.toDateString()===Kn.toDateString(),isSelected:xt&&St.toDateString()===xt.toDateString(),fullDate:_t})}const Xn=v===11?0:v+1,Zn=v===11?k+1:k,Qn=42-fe.length;for(let H=1;H<=Qn;H++)fe.push({date:H,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${Zn}-${String(Xn+1).padStart(2,"0")}-${String(H).padStart(2,"0")}`});return fe},P=k=>{m(k),u(!1),o?.(k)},w=k=>{const v=new Date(h);k==="prev"?v.setMonth(v.getMonth()-1):v.setMonth(v.getMonth()+1),x(v)},F=k=>{const v=new Date(h);k==="prev"?v.setFullYear(v.getFullYear()-1):v.setFullYear(v.getFullYear()+1),x(v)},U=k=>{const v=new Date(h);v.setFullYear(k),x(v),S(!1)},$=()=>{const k=new Date().getFullYear(),v=[];for(let ue=k-50;ue<=k+50;ue++)v.push(ue);return v};J(()=>{const k=v=>{L.current&&!L.current.contains(v.target)&&u(!1)};if(f)return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f]);const V=R(),Se=[_("一月"),_("二月"),_("三月"),_("四月"),_("五月"),_("六月"),_("七月"),_("八月"),_("九月"),_("十月"),_("十一月"),_("十二月")],de=[_("日"),_("一"),_("二"),_("三"),_("四"),_("五"),_("六")];return d("div",{ref:L,className:`date-picker-container ${s}`,style:{...c.container,...p},children:[d("div",{style:{...c.input,...c[r],...n?c.disabled:{}},onClick:()=>!n&&u(!f),onFocus:a,onBlur:i,children:[d("span",{style:c.inputText,children:y?M(y):t}),d("img",{src:Wi,alt:"calendar",style:c.calendarIcon})]}),f&&d("div",{style:c.panel,children:[d("div",{style:c.header,children:[d("button",{type:"button",style:c.navButton,onClick:()=>F("prev"),children:"‹‹"}),d("button",{type:"button",style:c.navButton,onClick:()=>w("prev"),children:"‹"}),d("span",{style:c.monthYear,onClick:()=>S(!b),children:[h.getFullYear(),"年",Se[h.getMonth()]]}),d("button",{type:"button",style:c.navButton,onClick:()=>w("next"),children:"›"}),d("button",{type:"button",style:c.navButton,onClick:()=>F("next"),children:"››"})]}),b&&d("div",{style:c.yearPicker,children:d("div",{style:c.yearGrid,children:$().map(k=>d("button",{type:"button",style:{...c.yearButton,...k===h.getFullYear()?c.yearSelected:{}},onClick:()=>U(k),children:k},k))})}),d("div",{style:c.weekHeader,children:de.map(k=>d("div",{style:c.weekDay,children:k},k))}),d("div",{style:c.calendarGrid,children:V.map((k,v)=>d("button",{type:"button",style:{...c.dayButton,...k.isCurrentMonth?c.dayCurrentMonth:c.dayOtherMonth,...k.isToday?c.dayToday:{},...k.isSelected?c.daySelected:{}},onClick:()=>P(k.fullDate),disabled:n,children:k.date},v))})]})]})}function Ji({onBack:e,onCancel:t,currency:n="USD",amount:r="",channel:o="",onAmountError:a}){const i=$i(),s=i.container.background==="#181A20",p=new Date,c=`${p.getFullYear()}-${String(p.getMonth()+1).padStart(2,"0")}-${String(p.getDate()).padStart(2,"0")}`,[f,u]=B({urls:[],transferTime:c,transferAmount:r,transactionId:"",payerName:"",filesError:"",timeError:"",amountError:"",transactionIdError:"",payerNameError:""});J(()=>{u(m=>({...m,transferAmount:r}))},[r]);const y=async()=>{let m=!0;if(f.urls.length===0&&(m=!1,u(h=>({...h,filesError:_("请上传银行转账回单")}))),f.transferTime||(m=!1,u(h=>({...h,timeError:_("请选择转账时间")}))),r.trim()||(m=!1,a?.(_("请输入充值金额"))),f.transactionId.trim()||(m=!1,u(h=>({...h,transactionIdError:_("请输入转账交易ID")}))),f.payerName.trim()||(m=!1,u(h=>({...h,payerNameError:_("请输入付款人名称")}))),!!m)try{await $n({transferDate:f.transferTime,transferNo:f.transactionId,transferChannel:o,voucherUrls:f.urls,payerName:f.payerName,submitAmount:r,submitCurrency:n}),Ie.success(_("提交成功")),t()}finally{u(h=>({...h,loading:!1}))}};return d("div",{style:i.container,children:[d("div",{style:i.header,children:d("button",{type:"button",onClick:e,style:i.backButton,children:[d("span",{style:i.backIcon,children:"←"}),_("返回账户信息")]})}),d("div",{style:i.uploadSection,children:[d(Jn,{value:f.urls,onChange:m=>{u(h=>({...h,urls:m,filesError:""}))},maxCount:10,accept:"image/*,.pdf",multiple:!0}),f.filesError&&d("div",{style:i.error,children:f.filesError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("转账时间")]}),d(qi,{value:f.transferTime,placeholder:_("请选择转账时间"),onChange:m=>{u(h=>({...h,transferTime:m,timeError:""}))},style:{width:"100%"}}),f.timeError&&d("div",{style:i.error,children:f.timeError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:_("转账金额")}),d("div",{style:i.inputWrapper,children:[d("input",{type:"text",placeholder:_("请输入实际转账金额"),value:f.transferAmount,readOnly:!0,disabled:!0,style:{...i.input,...s?i.disabledDark:i.disabled}}),d("span",{style:i.currencySuffix,children:n})]})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("交易ID")]}),d("input",{type:"text",placeholder:_("请输入转账交易ID"),value:f.transactionId,onChange:m=>{u(h=>({...h,transactionId:m.target.value,transactionIdError:""}))},style:{...i.input,...f.transactionIdError?i.inputError:{}}}),f.transactionIdError&&d("div",{style:i.error,children:f.transactionIdError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("付款人名称")]}),d("input",{type:"text",placeholder:_("请输入付款人名称"),value:f.payerName,onChange:m=>{u(h=>({...h,payerName:m.target.value,payerNameError:""}))},style:{...i.input,...f.payerNameError?i.inputError:{}}}),f.payerNameError&&d("div",{style:i.error,children:f.payerNameError})]}),d("div",{style:i.buttonSection,children:[d("button",{type:"button",onClick:t,style:i.cancelButton,children:_("取消")}),d("button",{type:"button",onClick:y,style:i.submitButton,children:_("提交审核")})]})]})}function Vi(){const e=E("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?16:20,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{maxWidth:"100%",margin:0,padding:e===l.SMALL?12:16},"@media (min-width: 1021px)":{maxWidth:600,margin:"0 auto"}},header:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?16:20,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},bankDetails:{marginBottom:e===l.SMALL?20:24},detailCard:{marginTop:12,marginBottom:12,border:"1px solid #f0f0f0",borderRadius:8,background:"#fafafa",overflow:"hidden"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"8px 0":"10px 0",borderBottom:"1px solid #f0f0f0",width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",alignItems:"flex-start",gap:4}},label:{fontSize:e===l.SMALL?13:14,color:"#666",fontWeight:500,minWidth:120,"@media (max-width: 600px)":{minWidth:"auto",marginBottom:2}},value:{fontSize:e===l.SMALL?13:14,color:"#222",fontWeight:500,textAlign:"right",flex:1,"@media (max-width: 600px)":{textAlign:"left",flex:"none",width:"100%"}},valueWithCopy:{display:"flex",alignItems:"center",gap:8,flex:1,justifyContent:"flex-end",minWidth:0,"@media (max-width: 600px)":{flex:"none",width:"100%",justifyContent:"flex-start"}},row:{display:"flex",alignItems:"center",padding:"10px 12px",borderBottom:"1px solid #ededed"},rowLast:{borderBottom:"none"},rowAlt:{background:"#fafafa"},labelMuted:{fontSize:e===l.SMALL?13:14,color:"#8c8c8c",fontWeight:500,flex:.4},valueStrong:{fontSize:e===l.SMALL?13:14,color:"#111",textAlign:"right",flex:.6,wordBreak:"break-all"},copyButton:{padding:e===l.SMALL?"4px 8px":"6px 12px",fontSize:e===l.SMALL?11:12,background:"#1890ff",color:"#fff",border:"none",borderRadius:4,cursor:"pointer",fontWeight:500,flexShrink:0,whiteSpace:"nowrap"},confirmButton:{width:"100%",marginBottom:e===l.SMALL?16:20,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"10px 12px":"12px 16px",fontWeight:600,cursor:"pointer",fontSize:e===l.SMALL?13:14},noticeBox:{marginBottom:e===l.SMALL?16:20,padding:e===l.SMALL?"10px 12px":"12px 16px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13,lineHeight:1.5},reminderTitle:{fontWeight:600,marginBottom:e===l.SMALL?8:12,textAlign:"left",fontSize:e===l.SMALL?14:16},reminderList:{margin:0,paddingLeft:18,color:"#666",lineHeight:1.6,textAlign:"left",fontSize:e===l.SMALL?12:13,listStyleType:"disc",listStylePosition:"outside"},link:{color:"#1890ff",textDecoration:"none",fontWeight:500}};return{white:{...t},dark:{...t,container:{...t.container,background:"#181A20",border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},detailCard:{...t.detailCard,border:"1px solid #374151",background:"#23262F"},row:{...t.row,borderBottom:"1px solid #374151",background:"#23262F"},rowAlt:{...t.rowAlt,borderBottom:"1px solid #374151",background:"#23262F"},rowLast:{...t.rowLast,background:"#23262F"},labelMuted:{...t.labelMuted,color:"#B5B8BE"},valueStrong:{...t.valueStrong,color:"#fff"},label:{...t.label,color:"#B5B8BE"},value:{...t.value,color:"#fff"},copyButton:{...t.copyButton,background:"#00E8C6",color:"#111"},confirmButton:{...t.confirmButton,background:"#00E8C6",color:"#111"},noticeBox:{...t.noticeBox,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"},link:{...t.link,color:"#00E8C6"}}}}function Yi(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Vi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,titleBar:{...o.titleBar,background:a.color},copyButton:{...o.copyButton,background:a.color},confirmButton:{...o.confirmButton,background:a.color},link:{...o.link,color:a.color}}}return o}function Gi({onConfirm:e,channelCode:t}){const n=Yi(),[r,o]=B([]);return J(()=>{if(!t)return;let a=!0;return jn({code:t}).then(i=>{if(a){if(Array.isArray(i)){o(i.map(s=>String(s)));return}if(i&&typeof i=="object"){const s=[];Object.keys(i).forEach(p=>{const c=i[p];s.push(`${p}: ${c}`)}),o(s);return}o(i?[String(i)]:[])}}).catch(()=>o([])),()=>{a=!1}},[t]),d("div",{style:n.container,children:[d("div",{style:n.header,children:[d("span",{style:n.titleBar}),_("银行转账")]}),r.length>0&&d("div",{style:n.detailCard,children:r.map((a,i)=>{const s=String(a).split(":"),p=s.shift()?.trim()||"",c=s.join(":").trim();return d("div",{style:{...n.row,...i===r.length-1?n.rowLast:{},...i%2===1?n.rowAlt:{}},children:[d("div",{style:n.labelMuted,children:p}),d("div",{style:n.valueStrong,children:c||"-"})]},i)})}),d("button",{type:"button",onClick:e,style:n.confirmButton,children:_("确认转账详情")}),d("div",{style:n.noticeBox,children:_("转账后提交银行回单提示")}),d("div",{style:n.reminderTitle,children:_("温馨提示")}),d("ul",{style:n.reminderList,children:[d("li",{children:_("支付金额匹配提醒")}),d("li",{children:_("保存交易回单提醒")}),d("li",{children:_("查看余额提醒")}),d("li",{children:_("联系客服提醒")}),d("li",{children:_("P卡转账延迟提醒")}),d("li",{children:[_("平台服务费说明")," ",d("a",{href:"#",style:n.link,children:_("费用政策")})," ",_("详情")]})]})]})}function Ki({visible:e,onClose:t,onSubmit:n}){const r=Fi(),[o,a]=B(!1),[i,s]=B({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1});J(()=>{const x=()=>{a(window.innerWidth<=1020)};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),J(()=>{e||s({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1})},[e]);const p=(x,b)=>{s(S=>({...S,channel:x,paymentType:b,channelError:""}))},c=x=>{s(b=>({...b,amount:x,amountError:""}))},f=x=>{s(b=>({...b,amountError:x}))},u=x=>{s(b=>({...b,currency:x}))},y=async x=>{s(b=>({...b,loading:!0,error:""}));try{await n(x),t()}catch{s(b=>({...b,error:_("提交失败,请重试")}))}finally{s(b=>({...b,loading:!1}))}},m=()=>{console.log("用户确认银行转账详情"),s(x=>({...x,showOfflineUpload:!0}))},h=()=>{s(x=>({...x,showOfflineUpload:!1}))};return d(Vn,{visible:e,onClose:t,title:_("充值/转账"),width:o?"95%":960,maxWidth:o?"95%":1e3,children:d("div",{style:{...r.wrapper,...o?{gridTemplateColumns:"1fr",gap:16,minWidth:"auto"}:{}},children:[d(zi,{onChannelChange:p,onAmountChange:c,onCurrencyChange:u,initialAmount:i.amount,initialCurrency:i.currency,initialPaymentType:i.paymentType,amountError:i.amountError}),i.paymentType==="online"?d(Ni,{onSubmit:y,amount:i.amount,currency:i.currency,channel:i.channel,loading:i.loading,error:i.error,onAmountError:f}):i.showOfflineUpload?d(Ji,{onBack:h,onCancel:t,currency:i.currency,amount:i.amount,channel:i.channel,onAmountError:f}):d(Gi,{onConfirm:m,channelCode:i.channel})]})})}function Xi(){const[e,t]=B(!1),n=async r=>{const o=await Wn({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return d("div",{children:[d(ht,{onClick:()=>t(!0),children:_("充值/转账")}),d(Ki,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}qe(Xi,"best-payment",["theme"],{shadow:!1});const Kt={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 Zi(){return E("theme")===N.WHITE?Kt.white:Kt.dark}const Qi=({popover:e,children:t,popoverWidth:n,popoverMinWidth:r,offsetY:o,offsetX:a,popoverPosition:i="top"})=>{const s=E("size"),p=n??(s===l.SMALL?200:300),c=r??(s===l.SMALL?150:200),f=o??(s===l.SMALL?8:16),u=a??(s===l.SMALL?8:16),[y,m]=B(!1),[h,x]=B(i),b=se(null),S=se(null),L=Zi(),M=()=>{if(S.current&&(clearTimeout(S.current),S.current=null),i==="top"||i==="bottom")if(b.current){const P=b.current.getBoundingClientRect();i==="top"&&P.top<100?x("bottom"):i==="bottom"&&window.innerHeight-P.bottom<100?x("top"):x(i)}else x(i);else x(i);m(!0)},A=()=>{S.current=window.setTimeout(()=>{m(!1)},120)};let T={position:"absolute",zIndex:999,borderRadius:6,fontSize:s===l.SMALL?12:15,minWidth:c,width:p,padding:s===l.SMALL?"6px 12px":"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...L.popover},R={position:"absolute",zIndex:11,width:0,height:0};return h==="top"?(T={...T,left:"50%",top:-48,transform:"translateX(-50%)"},R={...R,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${L.arrow.top}`}):h==="bottom"?(T={...T,left:"50%",top:"100%",marginTop:f,transform:"translateX(-50%)"},R={...R,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${L.arrow.bottom}`}):h==="leftTop"?(T={...T,right:"100%",top:0,marginRight:u,transform:"none"},R={...R,right:-8,top:s===l.SMALL?8:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${L.arrow.left}`}):h==="rightTop"&&(T={...T,left:"100%",top:0,marginLeft:u,transform:"translateY(0)"},R={...R,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${L.arrow.right}`}),d("div",{ref:b,style:{position:"relative",display:"inline-block"},onMouseEnter:M,onMouseLeave:A,children:[t,y&&d("div",{style:T,onMouseEnter:M,onMouseLeave:A,children:[e,d("div",{style:R})]})]})};function ea(){const e=E("size");return{white:{popoverTitle:{fontSize:e===l.SMALL?12:16,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?12:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:e===l.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===l.SMALL?6:8,height:e===l.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===l.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===l.SMALL?12:15}),main:{fontSize:e===l.SMALL?18:24,fontWeight:800,color:"#111827",display:"inline-block"},currency:{fontSize:e===l.SMALL?16:18,color:"#6b7280",marginLeft:e===l.SMALL?6:8,fontWeight:600}},dark:{popoverTitle:{fontSize:e===l.SMALL?14:16,fontWeight:600,color:"#fff",marginBottom:e===l.SMALL?14:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #374151",fontSize:e===l.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#B5B8BE",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===l.SMALL?6:8,height:e===l.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===l.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===l.SMALL?12:15}),main:{fontSize:e===l.SMALL?18:24,fontWeight:800,color:"#fff",display:"inline-block"},currency:{fontSize:e===l.SMALL?16:18,color:"#B5B8BE",marginLeft:e===l.SMALL?6:8,fontWeight:600}}}}function ta(){const t=E("theme")===N.WHITE,n=ea();return t?n.white:n.dark}function Xt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function na(e){const[t,n]=B({currBalance:0,currency:"USD",details:[]}),r=async()=>{try{const i=await Un(),s=[{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"}],p={currBalance:i.currBalance,currency:"USD",symbol:"$",details:s};n(p)}catch(i){console.error("获取余额失败:",i)}};J(()=>{r()},[]),J(()=>{const i=()=>{r()};return window.addEventListener("refresh-balance",i),()=>{window.removeEventListener("refresh-balance",i)}},[]);const o=ta(),a=[{label:_("真实金额"),value:t.details[0]?.value||0,color:"#15b36b",dot:"#15b36b"},{label:_("冻结金额"),value:t.details[1]?.value||0,color:"#f59e0b",dot:"#f59e0b"},...t.details.length>4?[{label:_("信用额度"),value:t.details[2]?.value||0,color:"#1890ff",dot:"#1890ff"},{label:_("已用额度"),value:t.details[3]?.value||0,color:"#ff0000",dot:"#ff0000"}]:[],{label:_("可用余额"),value:t.details[4]?.value||0,color:"#1890ff",dot:"#15b36b"}];return d(Qi,{popover:d(ne,{children:[d("div",{style:o.popoverTitle,children:_("余额详情")}),a.map(i=>d("div",{style:o.detailRow,children:[d("span",{style:o.detailLabel,children:[d("span",{style:o.detailDot(i.dot)}),i.label]}),d("span",{style:o.detailValue(i.color),children:Xt(i.value)})]},i.label))]}),popoverPosition:e.popoverPosition||"bottom",children:d("div",{style:o.main,children:[Xt(t.currBalance),d("span",{style:o.currency,children:t.currency})]})})}qe(na,"best-statistical-balance");const we={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 ra(e){return E("theme")===N.WHITE?{...we.white,background:e||we.white.background}:{...we.dark,background:e||we.dark.background}}function oa(e){switch(e){case"small":return{fontSize:"12px",gap:"2px"};case"large":return{fontSize:"18px",gap:"6px"};default:return{fontSize:"14px",gap:"4px"}}}function ia({color:e,size:t="medium",children:n}){const[r,o]=B(!1),a=ra(e),i=oa(t),s={...a,...i,display:"flex",alignItems:"center"};return d(ne,{children:[d("style",{children:`
|
|
78
|
+
`,document.head.appendChild(n),t}function Vn({visible:e,onClose:t,title:n,children:r,width:o=re===l.SMALL?300:400,maxWidth:a=re===l.SMALL?300:400,showClose:i=!0,maskClosable:s=!0}){const[p,c]=B(!1),f=_i();J(()=>{Si(f)},[f]);const u=m=>{m.target===m.currentTarget?c(!0):c(!1)},y=m=>{m.target===m.currentTarget&&p&&s&&t(),c(!1)};return e?d("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:f.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onMouseDown:u,onMouseUp:y,children:d("div",{style:{background:f.modalBg,borderRadius:re===l.SMALL?8:12,minWidth:o,maxWidth:a,color:f.modalColor,boxShadow:f.modalBoxShadow,position:"relative",width:typeof o=="string"?o:`${o}px`,maxHeight:"90vh",display:"flex",flexDirection:"column"},onClick:m=>m.stopPropagation(),children:[d("div",{style:{position:"sticky",top:0,background:f.modalBg,borderRadius:re===l.SMALL?"8px 8px 0 0":"12px 12px 0 0",padding:re===l.SMALL?"24px 24px 0 24px":"32px 32px 0 32px",zIndex:1,borderBottom:`1px solid ${f.headerBorder}`},children:[i&&d("button",{type:"button",onClick:t,style:f.closeBtn,"aria-label":"关闭",children:"×"}),n&&d("div",{style:f.title,children:n})]}),d("div",{className:`modal-content ${f.scrollbarClass}`,style:{flex:1,overflowY:"auto",padding:re===l.SMALL?"16px 24px 24px 24px":"20px 32px 32px 32px"},children:r})]})}):null}function Li(){const e=E("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===l.SMALL?12:16,height:e===l.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===l.SMALL?12:16,height:e===l.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer"})}}}function wi(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Li(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,tabBtn:(i,s)=>({...o.tabBtn(i,s),color:i?a.color:o.tabBtn(i,s).color})}}return o}const Ai=E("size");function ki({visible:e,onClose:t,onSubmit:n}){const[r,o]=B({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,i]=B({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}),[s,p]=B("online"),c=wi();J(()=>{e||(p("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 u=>{u.preventDefault();let y=!0;if(o(m=>({...m,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(m=>({...m,amountError:_("请输入充值金额")})),y=!1),r.rechargeChannel||(o(m=>({...m,rechargeChannelError:_("请选择支付平台")})),y=!1),!!y){o(m=>({...m,loading:!0,error:""}));try{await n({amount:r.amount,rechargeChannel:r.rechargeChannel,currency:r.currency}),t()}catch{o(m=>({...m,error:_("提交失败,请重试")}))}finally{o(m=>({...m,loading:!1}))}}};return d(Vn,{visible:e,onClose:t,title:_("充值 / 转账"),children:[d("div",{style:{display:"flex",marginBottom:Ai===l.SMALL?16:28},children:[d("button",{type:"button",onClick:()=>p("online"),style:c.tabBtn(s==="online",!0),children:_("在线充值")}),d("button",{type:"button",onClick:()=>p("offline"),style:c.tabBtn(s==="offline",!1),children:_("线下转账")})]}),d("div",{style:{display:s==="online"?"block":"none"},children:d("form",{onSubmit:f,children:d(fi,{formState:r,setFormState:o,onClose:t,loading:r.loading})})}),d("div",{style:{display:s==="offline"?"block":"none"},children:d(yi,{formState:a,setFormState:i,onClose:t,loading:a.loading})})]})}function mt(){return(mt=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 Ei=["context","children"];function Ci(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,i,s={},p=Object.keys(r);for(i=0;i<p.length;i++)o.indexOf(a=p[i])>=0||(s[a]=r[a]);return s}(e,Ei);return un(t,n)}function vi(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=ie(Ci,mt({},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=[],a={},i=0,s=n.attributes,p=n.childNodes;for(i=s.length;i--;)s[i].name!=="slot"&&(a[s[i].name]=s[i].value,a[Yn(s[i].name)]=s[i].value);for(i=p.length;i--;){var c=t(p[i],null),f=p[i].slot;f?a[f]=ie(Gt,{name:f},c):o[i]=c}var u=r?ie(Gt,null,o):o;return ie(r||n.nodeName.toLowerCase(),a,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?dn:ze)(this._vdom,this._root)}function Yn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ti(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[Yn(e)]=n,this._vdom=un(this._vdom,r),ze(this._vdom,this._root)}}function Mi(){ze(this._vdom=null,this._root)}function Gt(e,t){var n=this;return ie("slot",mt({},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 qe(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=vi,o.prototype.attributeChangedCallback=Ti,o.prototype.disconnectedCallback=Mi,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(i){this._vdom?this.attributeChangedCallback(a,null,i):(this._props||(this._props={}),this._props[a]=i,this.connectedCallback());var s=typeof i;i!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(a,i)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}function Bi(){const[e,t]=B(!1),n=async r=>{const o=await Wn({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return d("div",{children:[d(ht,{onClick:()=>t(!0),children:_("充值/转账")}),d(ki,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}qe(Bi,"best-recharge",["theme"],{shadow:!1});function Ri(){const e=E("size"),t={wrapper:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:e===l.SMALL?12:20,alignItems:"start",minWidth:880,"@media (max-width: 1020px)":{gridTemplateColumns:"1fr",gap:16,minWidth:"auto",width:"100%"}},fieldLabel:{fontSize:e===l.SMALL?12:13,marginBottom:6,fontWeight:500,textAlign:"left"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13},inputWrapper:{position:"relative"},inputSuffix:{padding:"0 8px",fontSize:e===l.SMALL?12:13,opacity:.8},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},subTitle:{marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?8:10,fontWeight:600,textAlign:"left"},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},methodList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},bankList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}}};return{white:{...t,left:{background:"#fff",borderRadius:8,padding:16,border:"1px solid #E5E6EB"},right:{background:"#fff",borderRadius:8,padding:16},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 480px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#1890ff":"#E5E6EB"}`,color:n?"#1890ff":"#222",background:n?"#EEF7FF":"#fff",cursor:"pointer"}),input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:600,cursor:"pointer"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",cursor:"pointer"}),bankItem:{padding:"10px 12px",borderRadius:8,border:"1px solid #F0F1F3",background:"#F7F8FA",textAlign:"left"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left"},reminderList:{margin:0,paddingLeft:18,color:"#6b7280",lineHeight:1.6,textAlign:"left"}},dark:{...t,left:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},right:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 480px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#00E8C6":"#374151"}`,color:n?"#00E8C6":"#fff",background:n?"#0F2824":"#23262F",cursor:"pointer"}),input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#00E8C6",color:"#111",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:700,cursor:"pointer"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer"}),bankItem:{padding:"10px 12px",borderRadius:8,border:"1px solid #374151",background:"#23262F",textAlign:"left",color:"#fff"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1",fontSize:e===l.SMALL?12:13},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left",color:"#fff"},reminderList:{margin:0,paddingLeft:18,color:"#B5B8BE",lineHeight:1.6,textAlign:"left"}}}}function Fi(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Ri(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,payButton:{...o.payButton,background:a.color},currencyItem:i=>({...o.currencyItem(i),border:`1px solid ${i?a.color:n?"#E5E6EB":"#374151"}`,color:i?a.color:n?"#222":"#fff"}),methodItem:i=>({...o.methodItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`})}}return o}function Ii(){const e=E("size"),t={left:{background:"#fff",borderRadius:8,padding:16,border:"1px solid #E5E6EB"},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},fieldLabel:{fontSize:e===l.SMALL?14:16,marginBottom:6,fontWeight:500,textAlign:"left"},required:{color:"#ff4d4f",marginRight:4},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 600px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#1890ff":"#E5E6EB"}`,color:n?"#1890ff":"#222",background:n?"#EEF7FF":"#fff",cursor:"pointer"}),inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},bizRateBox:{marginTop:6,color:"#666",fontSize:e===l.SMALL?12:13,textAlign:"left",lineHeight:1.6},bizRateStrong:{color:"#111",fontWeight:600},subTitle:{fontSize:e===l.SMALL?12:14,marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?8:10,textAlign:"left"},methodList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},methodItem:n=>({padding:"12px 16px",textAlign:"left",borderRadius:10,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),channelIcon:{width:22,height:22,objectFit:"contain",marginRight:8,display:"inline-block"},bankList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},bankItem:n=>({padding:"12px 16px",borderRadius:10,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",textAlign:"left",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13}};return{white:{...t,input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"}},dark:{...t,left:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#00E8C6":"#374151"}`,color:n?"#00E8C6":"#fff",background:n?"#0F2824":"#23262F",cursor:"pointer"}),input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},bizRateBox:{...t.bizRateBox,color:"#B5B8BE"},bizRateStrong:{color:"#ff4d4f",fontWeight:600},methodItem:n=>({padding:"12px 16px",textAlign:"left",borderRadius:10,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),bankItem:n=>({padding:"12px 16px",borderRadius:10,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",textAlign:"left",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44})}}}function Di(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Ii(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,titleBar:{...o.titleBar,background:a.color},currencyItem:i=>({...o.currencyItem(i),border:`1px solid ${i?a.color:n?"#E5E6EB":"#374151"}`,color:i?a.color:n?"#222":"#fff"}),methodItem:i=>({...o.methodItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`}),bankItem:i=>({...o.bankItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`})}}return o}function zi({onChannelChange:e,onAmountChange:t,onCurrencyChange:n,initialAmount:r="",initialCurrency:o="USD",initialPaymentType:a="online",amountError:i=""}){const s=Di(),c=JSON.parse(sessionStorage.getItem("all_dicts")||"{}")?.currency||[],[f,u]=B([]),[y,m]=B([]),[h,x]=B({currency:o,amount:r,onlineChannel:"",bankChannel:"",paymentType:a,amountError:""}),[b,S]=B(null),L=se(null),M=(w,F)=>{const U=w!==void 0?w:h.amount,$=F!==void 0?F:h.currency;if(!U||Number(U)<=0){S(null);return}L.current&&clearTimeout(L.current),L.current=window.setTimeout(()=>{Jo({currency:$,amount:U}).then(V=>S(V)).catch(()=>S(null))},300)};J(()=>{qo({currency:h.currency}).then(w=>{const F=w.onlineChannel||[],U=w.offlineChannel||[];u(F),m(U);const $=F.length>0,V=U?.[0]?.value||"",Se=F?.[0]?.value||"",de=$?a:"bank",k=de==="online"?Se:V;x(v=>({...v,onlineChannel:Se,bankChannel:V,paymentType:de})),k&&e(k,de)})},[h.currency]);function A(w){return w=w.replace(/[^\d.]/g,""),w=w.replace(/\.(?=.*\.)/g,""),w=w.replace(/^(\d+)(\.\d{0,2})?.*$/,"$1$2"),w=w.replace(/^0+(\d)/,"$1"),w.startsWith(".")&&(w="0"+w),w}const T=w=>{x(F=>({...F,currency:w})),n(w),M(void 0,w)},R=w=>{const F=A(w);x(U=>({...U,amount:F,amountError:""})),t(F),M(F)},P=(w,F)=>{x(U=>({...U,[F==="online"?"onlineChannel":"bankChannel"]:w,paymentType:F})),e(w,F),M()};return d("div",{style:s.left,children:[d("div",{style:s.blockTitle,children:[d("span",{style:s.titleBar}),_("选择支付方式")]}),d("div",{style:s.fieldLabel,children:_("支付币种")}),d("div",{style:s.currencyRow,children:(c||[]).slice(0,4).map(w=>d("button",{type:"button",onClick:()=>T(w.value),style:s.currencyItem(h.currency===w.value),children:w.label}))}),d("div",{style:{height:12}}),d("div",{style:s.fieldLabel,children:[d("span",{style:s.required,children:"*"}),_("支付金额")]}),d("div",{style:s.inputWrapper,children:[d("input",{type:"text",placeholder:_("请输入充值金额"),value:h.amount,onInput:w=>{R(w.target.value)},style:{...s.input,...i?s.inputError:{}}}),d("div",{style:s.inputSuffixAbs,children:h.currency})]}),i&&d("div",{style:s.error,children:i}),b&&b.consistent===!1&&d("div",{style:s.bizRateBox,children:[d("div",{children:_("您的支付币种与默认币种不一致,将转换为默认币种入账")}),d("div",{children:[_("目前汇率为:")," ",h.currency,_(`→${b.currency} = `),d("span",{style:s.bizRateStrong,children:b.exchangeRate})]}),d("div",{children:[_("钱包预计增加"),d("span",{style:s.bizRateStrong,children:[b.currency," ",b.amount]})]})]}),d("div",{style:{height:20}}),d("div",{style:s.fieldLabel,children:_("支付方式")}),f.length>0&&d("div",{children:[d("div",{style:s.subTitle,children:_("线上支付")}),d("div",{style:s.methodList,children:f.map(w=>d("button",{type:"button",onClick:()=>P(w.value,"online"),style:s.methodItem(h.onlineChannel===w.value&&h.paymentType==="online"),children:[w.icon&&d("img",{src:w.icon,alt:w.label,style:s.channelIcon}),w.label]}))})]}),d("div",{style:s.subTitle,children:_("银行转账")}),d("div",{style:s.bankList,children:y.map(w=>d("button",{type:"button",onClick:()=>P(w.value,"bank"),style:s.bankItem(h.bankChannel===w.value&&h.paymentType==="bank"),children:[w.icon&&d("img",{src:w.icon,alt:w.label,style:s.channelIcon}),w.label]}))})]})}function Oi(){const e=E("size"),t={right:{background:"#fff",borderRadius:8,padding:16},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},disabled:{backgroundColor:"#f5f5f5",color:"#999",cursor:"not-allowed"},disabledDark:{backgroundColor:"#1A1D23",color:"#6B7280",cursor:"not-allowed",border:"1px solid #374151"},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:600,cursor:"pointer"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13},calcBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?8:12,color:"#666",textAlign:"left",lineHeight:1.6,fontSize:e===l.SMALL?12:13},calcLine:{marginBottom:4},calcAmount:{color:"#ff4d4f",fontWeight:700,margin:"0 4px"},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left"},reminderList:{margin:0,paddingLeft:18,color:"#6b7280",lineHeight:1.6,textAlign:"left",listStyleType:"disc",listStylePosition:"outside"},listItem:{listStyleType:"disc",listStylePosition:"outside"},error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13}};return{white:{...t,input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"}},dark:{...t,right:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},payButton:{...t.payButton,background:"#00E8C6",color:"#111",fontWeight:700},noticeBox:{...t.noticeBox,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1"},calcBox:{...t.calcBox,color:"#B5B8BE"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"}}}}function Pi(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Oi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,payButton:{...o.payButton,background:a.color},titleBar:{...o.titleBar,background:a.color}}}return o}function Ni({onSubmit:e,amount:t,currency:n,channel:r,loading:o=!1,error:a="",onAmountError:i}){const s=Pi(),p=s.right.background==="#181A20",[c,f]=B({amount:t,currency:n,channel:r,loading:o,error:a,amountError:""}),[u,y]=B(null);J(()=>{f(x=>({...x,amount:t,currency:n,channel:r,loading:o,error:a}));const h=setTimeout(()=>{t&&r&&n?Hn({channel:r,amount:t,currency:n}).then(x=>y(x)).catch(()=>y(null)):y(null)},300);return()=>clearTimeout(h)},[t,n,r,o,a]);const m=async h=>{h&&h.preventDefault();let x=!0;if(t.trim()||(x=!1,i?.(_("请输入充值金额"))),r||(x=!1,f(b=>({...b,error:_("请选择支付平台")}))),!!x){f(b=>({...b,loading:!0,error:""}));try{await e({amount:t,currency:n,rechargeChannel:r})}finally{f(b=>({...b,loading:!1}))}}};return d("div",{style:s.right,children:[d("div",{style:s.blockTitle,children:[d("span",{style:s.titleBar}),_("在线支付")]}),d("form",{onSubmit:m,children:[d("div",{style:s.inputWrapper,children:[d("input",{type:"text",placeholder:_("支付金额"),value:c.amount,readOnly:!0,disabled:!0,style:{...s.input,...p?s.disabledDark:s.disabled,width:"100%"}}),d("div",{style:s.inputSuffixAbs,children:c.currency})]}),d("button",{type:"submit",disabled:c.loading,style:s.payButton,children:c.loading?_("提交中..."):_("立即支付")})]}),u&&d("div",{style:s.calcBox,children:[d("div",{style:s.calcLine,children:[_("预计支付金额约为:"),d("span",{style:s.calcAmount,children:`$${u.paymentAmount}`}),u.currency]}),d("div",{style:s.calcLine,children:[_("手续费约为:"),d("span",{style:s.calcAmount,children:`$${u.fee}`}),u.currency]}),d("div",{children:_("注:地区/币种/卡类型可能影响手续费,最终以平台为准。")})]}),d("div",{style:s.noticeBox,children:_("请在转账后提交银行回单,否则可能无法及时核验")}),d("div",{style:s.reminderTitle,children:_("温馨提示")}),d("ul",{style:s.reminderList,children:[d("li",{style:s.listItem,children:_("支付金额须与申请金额一致,请勿多付、少付或分批提交。")}),d("li",{style:s.listItem,children:_("请妥善保存回单并提供准确的支付时间,否则可能无法核验。")}),d("li",{style:s.listItem,children:_("工作时间提交4小时内审核,非工作时间将顺延至下一个工作日。")}),d("li",{style:s.listItem,children:_("如有问题,请联系平台客服。")}),d("li",{style:s.listItem,children:_("预付充值将收取平台服务费,具体以官方为准。")})]}),c.error&&d("div",{style:s.error,children:c.error})]})}function Ui(){const e=E("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?14:16,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{padding:e===l.SMALL?12:16}},header:{marginBottom:e===l.SMALL?16:20},backButton:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",color:"#1890ff",cursor:"pointer",fontSize:e===l.SMALL?13:14,fontWeight:500},backIcon:{fontSize:e===l.SMALL?16:18},uploadSection:{marginBottom:e===l.SMALL?18:24},uploadArea:{border:"2px dashed #D9D9D9",borderRadius:8,padding:e===l.SMALL?"30px 16px":"40px 20px",textAlign:"center",cursor:"pointer",background:"#FAFAFA",transition:"all 0.3s ease",width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{padding:e===l.SMALL?"30px 15px":"40px 20px"}},uploadIcon:{fontSize:e===l.SMALL?40:52,marginBottom:e===l.SMALL?10:12},uploadTitle:{fontSize:e===l.SMALL?14:16,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?6:10},uploadHint:{fontSize:e===l.SMALL?12:13,color:"#999"},hiddenInput:{display:"none"},fileList:{marginTop:e===l.SMALL?10:12},fileItem:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:e===l.SMALL?"6px 10px":"8px 12px",background:"#F5F5F5",borderRadius:6,marginBottom:6},fileName:{fontSize:e===l.SMALL?12:13,color:"#222"},removeButton:{background:"#ff4d4f",color:"#fff",border:"none",borderRadius:"50%",width:20,height:20,cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center"},fieldSection:{marginBottom:e===l.SMALL?12:16},fieldLabel:{display:"block",fontSize:e===l.SMALL?13:14,fontWeight:500,color:"#222",marginBottom:e===l.SMALL?6:10},required:{color:"#ff4d4f",marginRight:4},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,border:"1px solid #D9D9D9",outline:"none",fontSize:14,boxSizing:"border-box"},inputError:{border:"1px solid #ff4d4f"},disabled:{backgroundColor:"#f5f5f5",color:"#999",cursor:"not-allowed"},disabledDark:{backgroundColor:"#1A1D23",color:"#6B7280",cursor:"not-allowed",border:"1px solid #374151"},calendarIcon:{position:"absolute",right:e===l.SMALL?8:10,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?12:14,pointerEvents:"none"},currencySuffix:{position:"absolute",right:e===l.SMALL?10:12,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?12:14,color:"#999",pointerEvents:"none"},buttonSection:{display:"flex",gap:e===l.SMALL?10:12,marginTop:e===l.SMALL?24:32,width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",gap:e===l.SMALL?8:12}},cancelButton:{flex:1,padding:e===l.SMALL?"8px 12px":"10px 16px",borderRadius:6,border:"1px solid #D9D9D9",background:"#fff",color:"#222",fontSize:e===l.SMALL?12:14,fontWeight:500,cursor:"pointer",minWidth:0,boxSizing:"border-box"},submitButton:{flex:1,padding:e===l.SMALL?"8px 12px":"10px 16px",borderRadius:6,border:"none",background:"#1890ff",color:"#fff",fontSize:e===l.SMALL?12:14,fontWeight:600,cursor:"pointer",minWidth:0,boxSizing:"border-box"},error:{color:"#ff4d4f",fontSize:e===l.SMALL?12:13,marginTop:6}};return{white:{...t},dark:{...t,container:{...t.container,background:"#181A20",border:"1px solid #2B2E38"},backButton:{...t.backButton,color:"#00E8C6"},uploadArea:{...t.uploadArea,border:"2px dashed #374151",background:"#23262F"},uploadTitle:{...t.uploadTitle,color:"#fff"},uploadHint:{...t.uploadHint,color:"#B5B8BE"},fileItem:{...t.fileItem,background:"#2B2E38"},fileName:{...t.fileName,color:"#fff"},fieldLabel:{...t.fieldLabel,color:"#fff"},input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},calendarIcon:{...t.calendarIcon,color:"#B5B8BE"},currencySuffix:{...t.currencySuffix,color:"#B5B8BE"},cancelButton:{...t.cancelButton,border:"1px solid #374151",background:"#23262F",color:"#fff"},submitButton:{...t.submitButton,background:"#00E8C6",color:"#111"}}}}function $i(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Ui(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,backButton:{...o.backButton,color:a.color},submitButton:{...o.submitButton,background:a.color}}}return o}const Wi="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1760084950168'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6759'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M932.579556%20137.272889h-192V64.142222a9.159111%209.159111%200%200%200-9.130667-9.159111h-64a9.159111%209.159111%200%200%200-9.159111%209.159111v73.130667H365.738667V64.142222a9.159111%209.159111%200%200%200-9.159111-9.159111h-64a9.159111%209.159111%200%200%200-9.130667%209.159111v73.130667h-192c-20.224%200-36.579556%2016.355556-36.579556%2036.579555v758.869334c0%2020.195556%2016.355556%2036.551111%2036.579556%2036.551111h841.130667c20.252444%200%2036.579556-16.327111%2036.579555-36.551111V173.852444c0-20.224-16.355556-36.579556-36.579555-36.579555zM886.897778%20887.011556H137.159111V452.693333H886.897778v434.261334z%20m-749.710222-512V219.534222h146.289777v54.869334c0%205.034667%204.124444%209.130667%209.130667%209.130666h64a9.159111%209.159111%200%200%200%209.159111-9.130666V219.562667h292.551111v54.869333c0%205.034667%204.124444%209.130667%209.159111%209.130667h64a9.159111%209.159111%200%200%200%209.130667-9.130667V219.562667h146.289778v155.448889H137.159111z'%20p-id='6760'%3e%3c/path%3e%3c/svg%3e";function Hi(){const e=E("theme"),t=E("themeConfig"),n={container:{position:"relative",display:"inline-block"},input:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",backgroundColor:"#fff",cursor:"pointer",transition:"all 0.3s",outline:"none",fontSize:"14px",lineHeight:"1.5715",color:"rgba(0, 0, 0, 0.85)"},inputText:{flex:1,textAlign:"left",color:"rgba(0, 0, 0, 0.85)"},calendarIcon:{fontSize:"16px",color:"rgba(0, 0, 0, 0.45)",marginLeft:"8px",width:16,height:16,objectFit:"contain",display:"inline-block"},disabled:{backgroundColor:"#f5f5f5",color:"rgba(0, 0, 0, 0.25)",cursor:"not-allowed"},panel:{position:"absolute",top:"100%",left:0,zIndex:1050,backgroundColor:"#fff",border:"1px solid #d9d9d9",borderRadius:"6px",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",padding:"8px",minWidth:"280px",marginTop:"4px"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",marginBottom:"8px"},navButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"16px",color:"rgba(0, 0, 0, 0.45)",transition:"all 0.3s"},monthYear:{fontSize:"16px",fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},weekHeader:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"4px",marginBottom:"8px"},weekDay:{display:"flex",alignItems:"center",justifyContent:"center",height:"32px",fontSize:"14px",fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},calendarGrid:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"4px"},dayButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"14px",transition:"all 0.3s",color:"rgba(0, 0, 0, 0.85)"},dayCurrentMonth:{color:"rgba(0, 0, 0, 0.85)"},dayOtherMonth:{color:"rgba(0, 0, 0, 0.25)"},dayToday:{fontWeight:600,color:"#1890ff"},daySelected:{backgroundColor:"#1890ff",color:"#fff"},yearPicker:{maxHeight:"200px",overflowY:"auto",marginBottom:"8px",border:"1px solid #f0f0f0",borderRadius:"4px",padding:"8px"},yearGrid:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"4px"},yearButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"14px",transition:"all 0.3s",color:"rgba(0, 0, 0, 0.85)"},yearSelected:{backgroundColor:"#1890ff",color:"#fff"},small:{padding:"4px 8px",fontSize:"12px"},middle:{padding:"8px 12px",fontSize:"14px"},large:{padding:"12px 16px",fontSize:"16px"}},r={white:{...n,input:{...n.input,border:"1px solid #d9d9d9",backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.85)"},inputText:{...n.inputText,color:"rgba(0, 0, 0, 0.85)"},calendarIcon:{...n.calendarIcon,color:"rgba(0, 0, 0, 0.45)"},disabled:{...n.disabled,backgroundColor:"#f5f5f5",color:"rgba(0, 0, 0, 0.25)"},panel:{...n.panel,backgroundColor:"#fff",border:"1px solid #d9d9d9"},navButton:{...n.navButton,color:"rgba(0, 0, 0, 0.45)"},monthYear:{...n.monthYear,color:"rgba(0, 0, 0, 0.85)"},weekDay:{...n.weekDay,color:"rgba(0, 0, 0, 0.85)"},dayButton:{...n.dayButton,color:"rgba(0, 0, 0, 0.85)"},dayCurrentMonth:{...n.dayCurrentMonth,color:"rgba(0, 0, 0, 0.85)"},dayOtherMonth:{...n.dayOtherMonth,color:"rgba(0, 0, 0, 0.25)"},dayToday:{...n.dayToday,color:"#1890ff"},daySelected:{...n.daySelected,backgroundColor:"#1890ff",color:"#fff"},yearPicker:{...n.yearPicker,border:"1px solid #f0f0f0"},yearButton:{...n.yearButton,color:"rgba(0, 0, 0, 0.85)"},yearSelected:{...n.yearSelected,backgroundColor:"#1890ff",color:"#fff"}},dark:{...n,input:{...n.input,border:"1px solid #434343",backgroundColor:"#141414",color:"rgba(255, 255, 255, 0.85)"},inputText:{...n.inputText,color:"rgba(255, 255, 255, 0.85)"},calendarIcon:{...n.calendarIcon,color:"rgba(255, 255, 255, 0.45)"},disabled:{...n.disabled,backgroundColor:"#262626",color:"rgba(255, 255, 255, 0.25)"},panel:{...n.panel,backgroundColor:"#141414",border:"1px solid #434343"},navButton:{...n.navButton,color:"rgba(255, 255, 255, 0.45)"},monthYear:{...n.monthYear,color:"rgba(255, 255, 255, 0.85)"},weekDay:{...n.weekDay,color:"rgba(255, 255, 255, 0.85)"},dayButton:{...n.dayButton,color:"rgba(255, 255, 255, 0.85)"},dayCurrentMonth:{...n.dayCurrentMonth,color:"rgba(255, 255, 255, 0.85)"},dayOtherMonth:{...n.dayOtherMonth,color:"rgba(255, 255, 255, 0.25)"},dayToday:{...n.dayToday,color:"#00E8C6"},daySelected:{...n.daySelected,backgroundColor:"#00E8C6",color:"#111"},yearPicker:{...n.yearPicker,border:"1px solid #434343"},yearButton:{...n.yearButton,color:"rgba(255, 255, 255, 0.85)"},yearSelected:{...n.yearSelected,backgroundColor:"#00E8C6",color:"#111"}}},o=r[e]||r.white,a=t?.[e]?.color;return a&&(o.dayToday.color=a,o.daySelected.backgroundColor=a,o.yearSelected.backgroundColor=a,e==="dark"&&(o.daySelected.color="#111",o.yearSelected.color="#111")),o}function ji(){return Hi()}function qi({value:e="",placeholder:t=_("请选择日期"),disabled:n=!1,size:r="middle",onChange:o,onFocus:a,onBlur:i,className:s="",style:p={}}){const c=ji(),[f,u]=B(!1),[y,m]=B(e),[h,x]=B(new Date),[b,S]=B(!1),L=se(null),M=k=>{if(!k)return"";const v=new Date(k);return`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}-${String(v.getDate()).padStart(2,"0")}`},A=(k,v)=>new Date(k,v+1,0).getDate(),T=(k,v)=>new Date(k,v,1).getDay(),R=()=>{const k=h.getFullYear(),v=h.getMonth(),ue=A(k,v),Gn=T(k,v),fe=[],gt=v===0?11:v-1,bt=v===0?k-1:k,yt=A(bt,gt);for(let H=Gn-1;H>=0;H--)fe.push({date:yt-H,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${bt}-${String(gt+1).padStart(2,"0")}-${String(yt-H).padStart(2,"0")}`});const Kn=new Date,xt=y?new Date(y):null;for(let H=1;H<=ue;H++){const _t=`${k}-${String(v+1).padStart(2,"0")}-${String(H).padStart(2,"0")}`,St=new Date(_t);fe.push({date:H,isCurrentMonth:!0,isToday:St.toDateString()===Kn.toDateString(),isSelected:xt&&St.toDateString()===xt.toDateString(),fullDate:_t})}const Xn=v===11?0:v+1,Zn=v===11?k+1:k,Qn=42-fe.length;for(let H=1;H<=Qn;H++)fe.push({date:H,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${Zn}-${String(Xn+1).padStart(2,"0")}-${String(H).padStart(2,"0")}`});return fe},P=k=>{m(k),u(!1),o?.(k)},w=k=>{const v=new Date(h);k==="prev"?v.setMonth(v.getMonth()-1):v.setMonth(v.getMonth()+1),x(v)},F=k=>{const v=new Date(h);k==="prev"?v.setFullYear(v.getFullYear()-1):v.setFullYear(v.getFullYear()+1),x(v)},U=k=>{const v=new Date(h);v.setFullYear(k),x(v),S(!1)},$=()=>{const k=new Date().getFullYear(),v=[];for(let ue=k-50;ue<=k+50;ue++)v.push(ue);return v};J(()=>{const k=v=>{L.current&&!L.current.contains(v.target)&&u(!1)};if(f)return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f]);const V=R(),Se=[_("一月"),_("二月"),_("三月"),_("四月"),_("五月"),_("六月"),_("七月"),_("八月"),_("九月"),_("十月"),_("十一月"),_("十二月")],de=[_("日"),_("一"),_("二"),_("三"),_("四"),_("五"),_("六")];return d("div",{ref:L,className:`date-picker-container ${s}`,style:{...c.container,...p},children:[d("div",{style:{...c.input,...c[r],...n?c.disabled:{}},onClick:()=>!n&&u(!f),onFocus:a,onBlur:i,children:[d("span",{style:c.inputText,children:y?M(y):t}),d("img",{src:Wi,alt:"calendar",style:c.calendarIcon})]}),f&&d("div",{style:c.panel,children:[d("div",{style:c.header,children:[d("button",{type:"button",style:c.navButton,onClick:()=>F("prev"),children:"‹‹"}),d("button",{type:"button",style:c.navButton,onClick:()=>w("prev"),children:"‹"}),d("span",{style:c.monthYear,onClick:()=>S(!b),children:[h.getFullYear(),"年",Se[h.getMonth()]]}),d("button",{type:"button",style:c.navButton,onClick:()=>w("next"),children:"›"}),d("button",{type:"button",style:c.navButton,onClick:()=>F("next"),children:"››"})]}),b&&d("div",{style:c.yearPicker,children:d("div",{style:c.yearGrid,children:$().map(k=>d("button",{type:"button",style:{...c.yearButton,...k===h.getFullYear()?c.yearSelected:{}},onClick:()=>U(k),children:k},k))})}),d("div",{style:c.weekHeader,children:de.map(k=>d("div",{style:c.weekDay,children:k},k))}),d("div",{style:c.calendarGrid,children:V.map((k,v)=>d("button",{type:"button",style:{...c.dayButton,...k.isCurrentMonth?c.dayCurrentMonth:c.dayOtherMonth,...k.isToday?c.dayToday:{},...k.isSelected?c.daySelected:{}},onClick:()=>P(k.fullDate),disabled:n,children:k.date},v))})]})]})}function Ji({onBack:e,onCancel:t,currency:n="USD",amount:r="",channel:o="",onAmountError:a}){const i=$i(),s=i.container.background==="#181A20",p=new Date,c=`${p.getFullYear()}-${String(p.getMonth()+1).padStart(2,"0")}-${String(p.getDate()).padStart(2,"0")}`,[f,u]=B({urls:[],transferTime:c,transferAmount:r,transactionId:"",payerName:"",filesError:"",timeError:"",amountError:"",transactionIdError:"",payerNameError:""});J(()=>{u(m=>({...m,transferAmount:r}))},[r]);const y=async()=>{let m=!0;if(f.urls.length===0&&(m=!1,u(h=>({...h,filesError:_("请上传银行转账回单")}))),f.transferTime||(m=!1,u(h=>({...h,timeError:_("请选择转账时间")}))),r.trim()||(m=!1,a?.(_("请输入充值金额"))),f.transactionId.trim()||(m=!1,u(h=>({...h,transactionIdError:_("请输入转账交易ID")}))),f.payerName.trim()||(m=!1,u(h=>({...h,payerNameError:_("请输入付款人名称")}))),!!m)try{await $n({transferDate:f.transferTime,transferNo:f.transactionId,transferChannel:o,voucherUrls:f.urls,payerName:f.payerName,submitAmount:r,submitCurrency:n}),Ie.success(_("提交成功")),t()}finally{u(h=>({...h,loading:!1}))}};return d("div",{style:i.container,children:[d("div",{style:i.header,children:d("button",{type:"button",onClick:e,style:i.backButton,children:[d("span",{style:i.backIcon,children:"←"}),_("返回账户信息")]})}),d("div",{style:i.uploadSection,children:[d(Jn,{value:f.urls,onChange:m=>{u(h=>({...h,urls:m,filesError:""}))},maxCount:10,accept:"image/*,.pdf",multiple:!0}),f.filesError&&d("div",{style:i.error,children:f.filesError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("转账时间")]}),d(qi,{value:f.transferTime,placeholder:_("请选择转账时间"),onChange:m=>{u(h=>({...h,transferTime:m,timeError:""}))},style:{width:"100%"}}),f.timeError&&d("div",{style:i.error,children:f.timeError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:_("转账金额")}),d("div",{style:i.inputWrapper,children:[d("input",{type:"text",placeholder:_("请输入实际转账金额"),value:f.transferAmount,readOnly:!0,disabled:!0,style:{...i.input,...s?i.disabledDark:i.disabled}}),d("span",{style:i.currencySuffix,children:n})]})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("交易ID")]}),d("input",{type:"text",placeholder:_("请输入转账交易ID"),value:f.transactionId,onChange:m=>{u(h=>({...h,transactionId:m.target.value,transactionIdError:""}))},style:{...i.input,...f.transactionIdError?i.inputError:{}}}),f.transactionIdError&&d("div",{style:i.error,children:f.transactionIdError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("付款人名称")]}),d("input",{type:"text",placeholder:_("请输入付款人名称"),value:f.payerName,onChange:m=>{u(h=>({...h,payerName:m.target.value,payerNameError:""}))},style:{...i.input,...f.payerNameError?i.inputError:{}}}),f.payerNameError&&d("div",{style:i.error,children:f.payerNameError})]}),d("div",{style:i.buttonSection,children:[d("button",{type:"button",onClick:t,style:i.cancelButton,children:_("取消")}),d("button",{type:"button",onClick:y,style:i.submitButton,children:_("提交审核")})]})]})}function Vi(){const e=E("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?16:20,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{maxWidth:"100%",margin:0,padding:e===l.SMALL?12:16},"@media (min-width: 1021px)":{maxWidth:600,margin:"0 auto"}},header:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?16:20,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},bankDetails:{marginBottom:e===l.SMALL?20:24},detailCard:{marginTop:12,marginBottom:12,border:"1px solid #f0f0f0",borderRadius:8,background:"#fafafa",overflow:"hidden"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"8px 0":"10px 0",borderBottom:"1px solid #f0f0f0",width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",alignItems:"flex-start",gap:4}},label:{fontSize:e===l.SMALL?13:14,color:"#666",fontWeight:500,minWidth:120,"@media (max-width: 600px)":{minWidth:"auto",marginBottom:2}},value:{fontSize:e===l.SMALL?13:14,color:"#222",fontWeight:500,textAlign:"right",flex:1,"@media (max-width: 600px)":{textAlign:"left",flex:"none",width:"100%"}},valueWithCopy:{display:"flex",alignItems:"center",gap:8,flex:1,justifyContent:"flex-end",minWidth:0,"@media (max-width: 600px)":{flex:"none",width:"100%",justifyContent:"flex-start"}},row:{display:"flex",alignItems:"center",padding:"10px 12px",borderBottom:"1px solid #ededed"},rowLast:{borderBottom:"none"},rowAlt:{background:"#fafafa"},labelMuted:{fontSize:e===l.SMALL?13:14,color:"#8c8c8c",fontWeight:500,flex:.4},valueStrong:{fontSize:e===l.SMALL?13:14,color:"#111",textAlign:"right",flex:.6,wordBreak:"break-all"},copyButton:{padding:e===l.SMALL?"4px 8px":"6px 12px",fontSize:e===l.SMALL?11:12,background:"#1890ff",color:"#fff",border:"none",borderRadius:4,cursor:"pointer",fontWeight:500,flexShrink:0,whiteSpace:"nowrap"},confirmButton:{width:"100%",marginBottom:e===l.SMALL?16:20,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"10px 12px":"12px 16px",fontWeight:600,cursor:"pointer",fontSize:e===l.SMALL?13:14},noticeBox:{marginBottom:e===l.SMALL?16:20,padding:e===l.SMALL?"10px 12px":"12px 16px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13,lineHeight:1.5},reminderTitle:{fontWeight:600,marginBottom:e===l.SMALL?8:12,textAlign:"left",fontSize:e===l.SMALL?14:16},reminderList:{margin:0,paddingLeft:18,color:"#666",lineHeight:1.6,textAlign:"left",fontSize:e===l.SMALL?12:13,listStyleType:"disc",listStylePosition:"outside"},link:{color:"#1890ff",textDecoration:"none",fontWeight:500}};return{white:{...t},dark:{...t,container:{...t.container,background:"#181A20",border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},detailCard:{...t.detailCard,border:"1px solid #374151",background:"#23262F"},row:{...t.row,borderBottom:"1px solid #374151",background:"#23262F"},rowAlt:{...t.rowAlt,borderBottom:"1px solid #374151",background:"#23262F"},rowLast:{...t.rowLast,background:"#23262F"},labelMuted:{...t.labelMuted,color:"#B5B8BE"},valueStrong:{...t.valueStrong,color:"#fff"},label:{...t.label,color:"#B5B8BE"},value:{...t.value,color:"#fff"},copyButton:{...t.copyButton,background:"#00E8C6",color:"#111"},confirmButton:{...t.confirmButton,background:"#00E8C6",color:"#111"},noticeBox:{...t.noticeBox,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"},link:{...t.link,color:"#00E8C6"}}}}function Yi(){const e=E("theme"),t=E("themeConfig"),n=e===N.WHITE,r=Vi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,titleBar:{...o.titleBar,background:a.color},copyButton:{...o.copyButton,background:a.color},confirmButton:{...o.confirmButton,background:a.color},link:{...o.link,color:a.color}}}return o}function Gi({onConfirm:e,channelCode:t}){const n=Yi(),[r,o]=B([]);return J(()=>{if(!t)return;let a=!0;return jn({code:t}).then(i=>{if(a){if(Array.isArray(i)){o(i.map(s=>String(s)));return}if(i&&typeof i=="object"){const s=[];Object.keys(i).forEach(p=>{const c=i[p];s.push(`${p}: ${c}`)}),o(s);return}o(i?[String(i)]:[])}}).catch(()=>o([])),()=>{a=!1}},[t]),d("div",{style:n.container,children:[d("div",{style:n.header,children:[d("span",{style:n.titleBar}),_("银行转账")]}),r.length>0&&d("div",{style:n.detailCard,children:r.map((a,i)=>{const s=String(a).split(":"),p=s.shift()?.trim()||"",c=s.join(":").trim();return d("div",{style:{...n.row,...i===r.length-1?n.rowLast:{},...i%2===1?n.rowAlt:{}},children:[d("div",{style:n.labelMuted,children:p}),d("div",{style:n.valueStrong,children:c||"-"})]},i)})}),d("button",{type:"button",onClick:e,style:n.confirmButton,children:_("确认转账详情")}),d("div",{style:n.noticeBox,children:_("转账后提交银行回单提示")}),d("div",{style:n.reminderTitle,children:_("温馨提示")}),d("ul",{style:n.reminderList,children:[d("li",{children:_("支付金额匹配提醒")}),d("li",{children:_("保存交易回单提醒")}),d("li",{children:_("查看余额提醒")}),d("li",{children:_("联系客服提醒")}),d("li",{children:_("P卡转账延迟提醒")}),d("li",{children:[_("平台服务费说明")," ",d("a",{href:"#",style:n.link,children:_("费用政策")})," ",_("详情")]})]})]})}function Ki({visible:e,onClose:t,onSubmit:n}){const r=Fi(),[o,a]=B(!1),[i,s]=B({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1});J(()=>{const x=()=>{a(window.innerWidth<=1020)};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),J(()=>{e||s({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1})},[e]);const p=(x,b)=>{s(S=>({...S,channel:x,paymentType:b,channelError:""}))},c=x=>{s(b=>({...b,amount:x,amountError:""}))},f=x=>{s(b=>({...b,amountError:x}))},u=x=>{s(b=>({...b,currency:x}))},y=async x=>{s(b=>({...b,loading:!0,error:""}));try{await n(x),t()}catch{s(b=>({...b,error:_("提交失败,请重试")}))}finally{s(b=>({...b,loading:!1}))}},m=()=>{console.log("用户确认银行转账详情"),s(x=>({...x,showOfflineUpload:!0}))},h=()=>{s(x=>({...x,showOfflineUpload:!1}))};return d(Vn,{visible:e,onClose:t,title:_("充值/转账"),width:o?"95%":960,maxWidth:o?"95%":1e3,children:d("div",{style:{...r.wrapper,...o?{gridTemplateColumns:"1fr",gap:16,minWidth:"auto"}:{}},children:[d(zi,{onChannelChange:p,onAmountChange:c,onCurrencyChange:u,initialAmount:i.amount,initialCurrency:i.currency,initialPaymentType:i.paymentType,amountError:i.amountError}),i.paymentType==="online"?d(Ni,{onSubmit:y,amount:i.amount,currency:i.currency,channel:i.channel,loading:i.loading,error:i.error,onAmountError:f}):i.showOfflineUpload?d(Ji,{onBack:h,onCancel:t,currency:i.currency,amount:i.amount,channel:i.channel,onAmountError:f}):d(Gi,{onConfirm:m,channelCode:i.channel})]})})}function Xi(){const[e,t]=B(!1),n=async r=>{const o=await Wn({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return d("div",{children:[d(ht,{onClick:()=>t(!0),children:_("充值/转账")}),d(Ki,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}qe(Xi,"best-payment",["theme"],{shadow:!1});const Kt={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 Zi(){return E("theme")===N.WHITE?Kt.white:Kt.dark}const Qi=({popover:e,children:t,popoverWidth:n,popoverMinWidth:r,offsetY:o,offsetX:a,popoverPosition:i="top"})=>{const s=E("size"),p=n??(s===l.SMALL?200:300),c=r??(s===l.SMALL?150:200),f=o??(s===l.SMALL?8:16),u=a??(s===l.SMALL?8:16),[y,m]=B(!1),[h,x]=B(i),b=se(null),S=se(null),L=Zi(),M=()=>{if(S.current&&(clearTimeout(S.current),S.current=null),i==="top"||i==="bottom")if(b.current){const P=b.current.getBoundingClientRect();i==="top"&&P.top<100?x("bottom"):i==="bottom"&&window.innerHeight-P.bottom<100?x("top"):x(i)}else x(i);else x(i);m(!0)},A=()=>{S.current=window.setTimeout(()=>{m(!1)},120)};let T={position:"absolute",zIndex:999,borderRadius:6,fontSize:s===l.SMALL?12:15,minWidth:c,width:p,padding:s===l.SMALL?"6px 12px":"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...L.popover},R={position:"absolute",zIndex:11,width:0,height:0};return h==="top"?(T={...T,left:"50%",top:-48,transform:"translateX(-50%)"},R={...R,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${L.arrow.top}`}):h==="bottom"?(T={...T,left:"50%",top:"100%",marginTop:f,transform:"translateX(-50%)"},R={...R,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${L.arrow.bottom}`}):h==="leftTop"?(T={...T,right:"100%",top:0,marginRight:u,transform:"none"},R={...R,right:-8,top:s===l.SMALL?8:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${L.arrow.left}`}):h==="rightTop"&&(T={...T,left:"100%",top:0,marginLeft:u,transform:"translateY(0)"},R={...R,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${L.arrow.right}`}),d("div",{ref:b,style:{position:"relative",display:"inline-block"},onMouseEnter:M,onMouseLeave:A,children:[t,y&&d("div",{style:T,onMouseEnter:M,onMouseLeave:A,children:[e,d("div",{style:R})]})]})};function ea(){const e=E("size");return{white:{popoverTitle:{fontSize:e===l.SMALL?12:16,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?12:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:e===l.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===l.SMALL?6:8,height:e===l.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===l.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===l.SMALL?12:15}),main:{fontSize:e===l.SMALL?18:24,fontWeight:800,color:"#111827",display:"inline-block"},currency:{fontSize:e===l.SMALL?16:18,color:"#6b7280",marginLeft:e===l.SMALL?6:8,fontWeight:600}},dark:{popoverTitle:{fontSize:e===l.SMALL?14:16,fontWeight:600,color:"#fff",marginBottom:e===l.SMALL?14:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #374151",fontSize:e===l.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#B5B8BE",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===l.SMALL?6:8,height:e===l.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===l.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===l.SMALL?12:15}),main:{fontSize:e===l.SMALL?18:24,fontWeight:800,color:"#fff",display:"inline-block"},currency:{fontSize:e===l.SMALL?16:18,color:"#B5B8BE",marginLeft:e===l.SMALL?6:8,fontWeight:600}}}}function ta(){const t=E("theme")===N.WHITE,n=ea();return t?n.white:n.dark}function Xt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function na(e){const[t,n]=B({currBalance:0,currency:"USD",details:[]}),r=async()=>{try{const i=await Un(),s=[{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"}],p={currBalance:i.currBalance,currency:i.currency,details:s};n(p)}catch(i){console.error("获取余额失败:",i)}};J(()=>{r()},[]),J(()=>{const i=()=>{r()};return window.addEventListener("refresh-balance",i),()=>{window.removeEventListener("refresh-balance",i)}},[]);const o=ta(),a=[{label:_("真实金额"),value:t.details[0]?.value||0,color:"#15b36b",dot:"#15b36b"},{label:_("冻结金额"),value:t.details[1]?.value||0,color:"#f59e0b",dot:"#f59e0b"},...t.details.length>4?[{label:_("信用额度"),value:t.details[2]?.value||0,color:"#1890ff",dot:"#1890ff"},{label:_("已用额度"),value:t.details[3]?.value||0,color:"#ff0000",dot:"#ff0000"}]:[],{label:_("可用余额"),value:t.details[4]?.value||0,color:"#1890ff",dot:"#15b36b"}];return d(Qi,{popover:d(ne,{children:[d("div",{style:o.popoverTitle,children:_("余额详情")}),a.map(i=>d("div",{style:o.detailRow,children:[d("span",{style:o.detailLabel,children:[d("span",{style:o.detailDot(i.dot)}),i.label]}),d("span",{style:o.detailValue(i.color),children:Xt(i.value)})]},i.label))]}),popoverPosition:e.popoverPosition||"bottom",children:d("div",{style:o.main,children:[Xt(t.currBalance),d("span",{style:o.currency,children:t.currency})]})})}qe(na,"best-statistical-balance");const we={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 ra(e){return E("theme")===N.WHITE?{...we.white,background:e||we.white.background}:{...we.dark,background:e||we.dark.background}}function oa(e){switch(e){case"small":return{fontSize:"12px",gap:"2px"};case"large":return{fontSize:"18px",gap:"6px"};default:return{fontSize:"14px",gap:"4px"}}}function ia({color:e,size:t="medium",children:n}){const[r,o]=B(!1),a=ra(e),i=oa(t),s={...a,...i,display:"flex",alignItems:"center"};return d(ne,{children:[d("style",{children:`
|
|
79
79
|
@keyframes spin {
|
|
80
80
|
from {
|
|
81
81
|
transform: rotate(0deg);
|
package/dist/best-unit.js
CHANGED
|
@@ -4892,6 +4892,11 @@ function Mi() {
|
|
|
4892
4892
|
background: "#23262F",
|
|
4893
4893
|
color: "#fff"
|
|
4894
4894
|
},
|
|
4895
|
+
bizRateBox: {
|
|
4896
|
+
...t.bizRateBox,
|
|
4897
|
+
color: "#B5B8BE"
|
|
4898
|
+
},
|
|
4899
|
+
bizRateStrong: { color: "#ff4d4f", fontWeight: 600 },
|
|
4895
4900
|
methodItem: (n) => ({
|
|
4896
4901
|
padding: "12px 16px",
|
|
4897
4902
|
textAlign: "left",
|
|
@@ -5252,6 +5257,11 @@ function Ri() {
|
|
|
5252
5257
|
border: "1px solid #5C3E12",
|
|
5253
5258
|
color: "#F4E3C1"
|
|
5254
5259
|
},
|
|
5260
|
+
// 计算金额提示在暗黑模式下的文本颜色优化
|
|
5261
|
+
calcBox: {
|
|
5262
|
+
...t.calcBox,
|
|
5263
|
+
color: "#B5B8BE"
|
|
5264
|
+
},
|
|
5255
5265
|
reminderTitle: {
|
|
5256
5266
|
...t.reminderTitle,
|
|
5257
5267
|
color: "#fff"
|
|
@@ -7164,8 +7174,7 @@ function Xi(e) {
|
|
|
7164
7174
|
}
|
|
7165
7175
|
], p = {
|
|
7166
7176
|
currBalance: i.currBalance,
|
|
7167
|
-
currency:
|
|
7168
|
-
symbol: "$",
|
|
7177
|
+
currency: i.currency,
|
|
7169
7178
|
details: s
|
|
7170
7179
|
};
|
|
7171
7180
|
n(p);
|
package/package.json
CHANGED
|
@@ -152,6 +152,11 @@ function createOnlinePaymentThemes() {
|
|
|
152
152
|
border: "1px solid #5C3E12",
|
|
153
153
|
color: "#F4E3C1",
|
|
154
154
|
},
|
|
155
|
+
// 计算金额提示在暗黑模式下的文本颜色优化
|
|
156
|
+
calcBox: {
|
|
157
|
+
...base.calcBox,
|
|
158
|
+
color: "#B5B8BE",
|
|
159
|
+
},
|
|
155
160
|
reminderTitle: {
|
|
156
161
|
...base.reminderTitle,
|
|
157
162
|
color: "#fff",
|
|
@@ -182,6 +182,11 @@ function createSelectPaymentThemes() {
|
|
|
182
182
|
background: "#23262F",
|
|
183
183
|
color: "#fff",
|
|
184
184
|
},
|
|
185
|
+
bizRateBox: {
|
|
186
|
+
...base.bizRateBox,
|
|
187
|
+
color: "#B5B8BE",
|
|
188
|
+
},
|
|
189
|
+
bizRateStrong: { color: "#ff4d4f", fontWeight: 600 },
|
|
185
190
|
methodItem: (active: boolean) => ({
|
|
186
191
|
padding: "12px 16px",
|
|
187
192
|
textAlign: "left",
|