import {
    G as J,
    z as Q,
    R as Z,
    B as $,
    r as y,
    C as j,
    H as C,
    I as r,
    J as e,
    Q as g,
    O as t,
    P as s,
    ao as q,
    Z as G,
    K as N,
    M as P,
    N as c,
    ap as X
} from "./common.modules-5cfe2cf4.js";
import {
    i as Y,
    G as ee,
    n as te,
    a4 as ae,
    bc as se,
    y as le,
    A as ne,
    cr as oe,
    cD as re,
    c as m,
    g as ce,
    aI as ie
} from "./page-activity-ActivityDetail-a58ec568.js";
const ue = {
        class: "wallet-container"
    },
    de = {
        class: "wallet-container-header"
    },
    ve = {
        class: "wallet-container-header-belly"
    },
    he = {
        key: 0
    },
    _e = {
        class: "total"
    },
    we = {
        class: "total"
    },
    ye = {
        class: "wallet-container-content"
    },
    ge = {
        class: "container"
    },
    pe = {
        class: "progressBars"
    },
    me = {
        class: "progressBarsL"
    },
    fe = {
        class: "progressBarsR"
    },
    Re = {
        class: "recycleBtnD"
    },
    ke = {
        key: 1,
        class: "recycleBtn disable"
    },
    Be = {
        class: "userDetail"
    },
    Ce = ["onClick"],
    be = {
        class: "imgD"
    },
    De = ["src"],
    Le = {
        key: 0,
        class: "gameList"
    },
    Se = {
        class: "money"
    },
    We = {
        key: 1,
        class: "gameList"
    },
    Me = J({
        __name: "index",
        setup(xe) {
            Y();
            const b = ee(),
                {
                    downAppTip: K
                } = te(),
                U = re(),
                {
                    t: n
                } = Q(),
                D = Z(),
                {
                    setLoading: p
                } = ae(),
                L = se();
            le();
            const V = {
                    recharge: {
                        title: n("recharge"),
                        icon: "rechargeIcon",
                        link: "Recharge"
                    },
                    withdraw: {
                        title: n("withdraw"),
                        icon: "widthdrawBlue",
                        link: "Withdraw"
                    },
                    rechargeHistory: {
                        title: n("rechargeRecords"),
                        icon: "rechargeHistory",
                        link: "RechargeHistory"
                    },
                    withdrawHistory: {
                        title: n("withdrawRecords"),
                        icon: "withdrawHistory",
                        link: "WithdrawHistory"
                    }
                },
                S = $(() => b.userInfo),
                z = async a => {
                    a == "Recharge" || a == "Withdraw" ? await K(a) : (a === "RechargeHistory" && U.emit("changeKeepAliveKey"), D.push({
                        name: a
                    }))
                };
            let f = 0,
                R = y([]),
                v = 0,
                h = 0,
                i = 0,
                W = "0%",
                _ = 0,
                u = 0,
                x = "0%";
            new Date().getTime() / 1e3;
            const A = y(0),
                I = y(0),
                d = y(0),
                k = y(!1);
            async function H(a = !0) {
                p(!0), await L.getAllwalletsBalance(void 0, !0), F(L.getAllwallets), p(!1), a && b.notifyARGame()
            }
            async function E() {
                if (d.value || k.value) return;
                k.value = !0;
                const a = await ne(oe(!0));
                k.value = !1, a ? (d.value = 5, v = a.data.amount, O()) : d.value = 0
            }
            const O = async () => {
                clearInterval(f), f = setInterval(async () => {
                    d.value -= 1, d.value == 0 && (clearInterval(f), p(!0), await H(!1), p(!1))
                }, 1e3)
            };

            function F(a) {
                if (!a) return;
                S.value.isShowWalletTotalCT == "1" && (A.value = a.totalWithdraw || 0, I.value = a.totalRecharge || 0), R.value = a.thidGameBalanceList || [];
                let o = a.thidGameBalanceList || [];
                if (h = 0, _ = 0, o)
                    for (var w of o) w.vendorCode === "Lottery" ? h += w.balance : _ += w.balance;
                v = h + _, v > 0 ? (i = Math.round(h / v * 1e4) / 100, u = Math.round(_ / v * 1e4) / 100, W = i + "%", x = u + "%") : (i = 0, u = 0)
            }
            return j(async () => {
                await H()
            }), (a, o) => {
                const w = C("NavBar"),
                    M = C("svg-icon"),
                    T = C("van-circle");
                return c(), r("div", ue, [e("div", de, [g(w, {
                    title: t(n)("wallet"),
                    class: "main",
                    "left-arrow": "",
                    onClickLeft: o[0] || (o[0] = l => t(D).go(-1))
                }, null, 8, ["title"]), e("div", ve, [g(M, {
                    name: "wallet1"
                }), e("div", null, s(t(m)(t(v))), 1), e("span", null, s(t(n)("totalBalance")), 1), S.value.isShowWalletTotalCT == "1" ? (c(), r("div", he, [e("div", null, [e("p", _e, s(A.value), 1), e("p", null, s(t(n)("totalWithdraw")), 1)]), e("div", null, [e("p", we, s(I.value), 1), e("p", null, s(t(n)("totalRechargeAmount")), 1)])])) : q("v-if", !0)])]), e("div", ye, [e("div", ge, [e("div", pe, [e("div", me, [g(T, {
                    "current-rate": t(i),
                    "onUpdate:currentRate": o[1] || (o[1] = l => G(i) ? i.value = l : i = l),
                    speed: 100,
                    text: t(W),
                    "stroke-width": "100",
                    "stroke-linecap": "butt"
                }, null, 8, ["current-rate", "text"]), e("h3", null, s(t(m)(t(h))), 1), e("span", null, s(t(n)("mainWallet")), 1)]), e("div", fe, [g(T, {
                    "current-rate": t(u),
                    "onUpdate:currentRate": o[2] || (o[2] = l => G(u) ? u.value = l : u = l),
                    speed: 100,
                    text: t(x),
                    "stroke-width": "100",
                    "stroke-linecap": "butt"
                }, null, 8, ["current-rate", "text"]), e("h3", null, s(t(m)(t(_))), 1), e("span", null, s(t(n)("thirdPartyWallet")), 1)])]), e("div", Re, [d.value == 0 ? (c(), r("button", {
                    key: 0,
                    class: "recycleBtn",
                    onClick: E
                }, s(t(n)("oneClickRecovery")), 1)) : (c(), r("button", ke, s(t(n)("recycling")) + " " + s(d.value), 1))]), e("div", Be, [(c(), r(N, null, P(V, (l, B) => e("div", {
                    key: B,
                    onClick: Ae => z(l.link)
                }, [e("div", be, [e("img", {
                    src: t(ce)("wallet", l.icon)
                }, null, 8, De)]), e("span", null, s(l.title), 1)], 8, Ce)), 64))])]), t(R) ? (c(), r("div", Le, [(c(!0), r(N, null, P(t(R), (l, B) => (c(), r("div", {
                    class: X(["box", l.balance > 0 ? "select" : ""]),
                    key: B
                }, [g(M, {
                    name: l.vendorCode
                }, null, 8, ["name"]), e("h3", Se, s(t(m)(l.balance, " ")), 1), e("span", null, s(t(ie)(l.vendorCode)), 1)], 2))), 128))])) : (c(), r("div", We, [e("div", null, s(t(n)("noData")), 1)]))])])
            }
        }
    });
export {
    Me as _
};