import {
    G as M,
    av as ee,
    r as w,
    $ as J,
    B as X,
    I as o,
    aw as F,
    ax as te,
    J as e,
    ay as se,
    aq as N,
    N as n,
    ao as U,
    P as s,
    an as m,
    O as l,
    D as ne,
    az as Y,
    z as Z,
    R as G,
    A as ae,
    H as V,
    Q as C,
    au as O,
    K as L,
    M as H,
    F as oe,
    at as z,
    aA as q,
    C as ie,
    E as le,
    aB as ue,
    aC as re
} from "./common.modules-af1f85b9.js";
import {
    a as E,
    c as I,
    _ as j,
    g as de,
    b as ce,
    e as pe,
    j as ve,
    h as K,
    i as fe
} from "./page-activity-ActivityDetail-09e806d3.js";
import {
    L as me,
    E as Q
} from "./page-activity-Bonus-78dc3749.js";
const he = {
        class: "item"
    },
    _e = ["src"],
    ge = {
        class: "right"
    },
    ye = {
        key: 0
    },
    $e = {
        key: 1
    },
    ke = {
        key: 2
    },
    Te = {
        key: 3,
        class: "time"
    },
    we = ["innerHTML"],
    Ce = {
        key: 4,
        class: "time"
    },
    Le = {
        key: 5,
        class: "time"
    },
    be = {
        class: "foot"
    },
    Be = {
        class: "amount"
    },
    De = M({
        __name: "card",
        props: {
            bgImgWidth: {
                type: String,
                required: !1,
                default: "100%"
            },
            bgImgHeight: {
                type: String,
                required: !1,
                default: "150px"
            },
            itemD: {
                type: null,
                required: !1,
                default: {}
            },
            state: {
                type: Number,
                required: !1
            },
            isRefresh: {
                type: Boolean,
                required: !1,
                default: !1
            }
        },
        emits: ["update:isRefresh"],
        setup(c, {
            emit: g
        }) {
            const v = c;

            function p() {
                if (v.state == 1) {
                    const a = f.value.replace(/-/g, "/"),
                        b = v.itemD.endTime.replace(/-/g, "/");
                    u.value = new Date(b).getTime() - new Date(a).getTime(), u.value > 0 && (k.value = ne({
                        time: u.value,
                        onChange: y
                    }), k.value.start())
                }
            }
            const {
                serviceNowTime: f
            } = E(), {
                isRefresh: t
            } = ee(v, g), u = w(0), k = w();
            J(() => v.itemD.id, a => {
                p()
            }, {
                immediate: !0
            });
            const T = X(() => k.value.current);

            function y(a) {
                a.total == 0 ? t.value = !0 : t.value = !1
            }

            function h(a) {
                const b = String(a.hours).padStart(2, "0"),
                    B = String(a.minutes).padStart(2, "0"),
                    D = String(a.seconds).padStart(2, "0");
                return b + ":" + B + ":" + D
            }
            return (a, b) => (n(), o("div", he, [F(e("img", {
                src: a.itemD.iconUrl,
                alt: "",
                style: se(`width:${a.bgImgWidth};height:${a.bgImgHeight};`)
            }, null, 12, _e), [
                [te, a.itemD.iconUrl]
            ]), e("div", ge, [N(a.$slots, "content", {}, () => {
                var B, D;
                return [e("div", {
                    class: U(["head", `type${a.state}`])
                }, [a.state == 1 ? (n(), o("h1", ye, s(a.$t("cpsTip3")), 1)) : a.state == 0 ? (n(), o("h1", $e, s(a.$t("startTime")), 1)) : a.state == 2 ? (n(), o("h1", ke, s(a.$t("ended")), 1)) : m("v-if", !0), a.state == 1 ? (n(), o("div", Te, [e("p", {
                    innerHTML: a.$t("fifteenDays", [T.value.days])
                }, null, 8, we), e("h6", null, s(h(T.value)), 1)])) : m("v-if", !0), a.state == 0 ? (n(), o("div", Ce, s((B = a.itemD) == null ? void 0 : B.startTime), 1)) : m("v-if", !0), a.state == 2 ? (n(), o("div", Le, "00:00:00")) : m("v-if", !0)], 2), e("div", be, [e("h1", null, s(a.$t("winTips5")), 1), e("div", Be, s(l(I)(((D = a.itemD) == null ? void 0 : D.sumBonus) || 0)), 1)])]
            }, !0)]), N(a.$slots, "footer", {}, void 0, !0)]))
        }
    });
const x = j(De, [
        ["__scopeId", "data-v-277c60ca"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/components/Activity/Championship/card.vue"]
    ]),
    Se = {
        class: "dialog__container",
        role: "dialog",
        tabindex: "0"
    },
    Ie = {
        key: 0,
        class: "dialog__container-img"
    },
    Re = {
        class: "dialog__container-title"
    },
    Ae = {
        class: "dialog__container-content"
    },
    Ne = {
        key: 1,
        class: "dialog__container-footer"
    },
    Oe = ["src"],
    Ue = M({
        __name: "Dialog",
        props: {
            show: {
                type: Boolean,
                default: !1
            },
            title: {
                type: String,
                default: ""
            },
            confirmText: {
                type: String,
                default: ""
            },
            showCancelBtn: {
                type: Boolean,
                default: !0
            },
            cancelText: {
                type: String,
                default: ""
            },
            clickOutSide: {
                type: Boolean,
                default: !1
            },
            isShowHeader: {
                type: Boolean,
                default: !0
            },
            imgUrl: {
                type: String,
                default: "tip"
            },
            showCloseIcon: {
                type: Boolean,
                default: !1
            },
            showFooter: {
                type: Boolean,
                default: !0
            }
        },
        emits: ["update:show", "confirm"],
        setup(c, {
            emit: g
        }) {
            const v = c;
            J(() => v.show, t => {
                t ? window.addEventListener("touchmove", f, {
                    passive: !1
                }) : window.removeEventListener("touchmove", f)
            });

            function p(t) {
                v.clickOutSide && g("update:show", !1)
            }
            const f = t => {};
            return (t, u) => {
                const k = Y("lazy");
                return n(), o("div", {
                    class: U(["dialog", {
                        active: c.show,
                        inactive: !c.show
                    }])
                }, [e("div", Se, [c.isShowHeader ? (n(), o("div", Ie, [N(t.$slots, "header", {}, () => [F(e("img", {
                    class: U({
                        succed: c.imgUrl == "succeed"
                    }),
                    alt: ""
                }, null, 2), [
                    [k, l(de)("wallet", c.imgUrl)]
                ])], !0)])) : m("v-if", !0), e("div", Re, [N(t.$slots, "title", {}, () => [e("h1", null, s(c.title), 1)], !0)]), e("div", Ae, [N(t.$slots, "content", {}, void 0, !0)]), c.showFooter ? (n(), o("div", Ne, [N(t.$slots, "footer", {}, () => [e("button", {
                    onClick: u[0] || (u[0] = () => {
                        g("confirm")
                    })
                }, s(c.confirmText || t.$t("confirm")), 1), c.showCancelBtn ? (n(), o("button", {
                    key: 0,
                    onClick: u[1] || (u[1] = () => {
                        g("update:show", !1)
                    })
                }, s(c.cancelText || t.$t("cancel")), 1)) : m("v-if", !0)], !0)])) : m("v-if", !0), c.showCloseIcon ? (n(), o("img", {
                    key: 2,
                    class: "close_img",
                    src: l(ce)("common", "close"),
                    onClick: p
                }, null, 8, Oe)) : m("v-if", !0)]), e("div", {
                    class: "dialog__outside",
                    onClick: p
                })], 2)
            }
        }
    });
const He = j(Ue, [
        ["__scopeId", "data-v-3e71d3da"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/components/common/Dialog.vue"]
    ]),
    Me = {
        class: "championship"
    },
    je = {
        class: "tabs"
    },
    qe = ["onClick"],
    Ve = ["onClick"],
    ze = ["innerHTML"],
    Je = M({
        __name: "index",
        setup(c) {
            const {
                tabList: g,
                serviceNowTime: v,
                type: p
            } = E(), {
                t: f
            } = Z(), t = G(), u = ae({
                state: 1
            }), k = w([]), T = w(), y = w(!1), h = w(""), a = w(!1);
            J(a, r => {
                var i;
                a.value && ((i = T.value) == null || i.resetRefresh())
            });

            function b(r) {
                t.push({
                    name: "Championship-ChampionshipDetail",
                    query: {
                        championId: r
                    }
                })
            }

            function B(r) {
                var i;
                u.state = r, (i = T.value) == null || i.resetRefresh()
            }

            function D(r) {
                v.value = r.serviceNowTime
            }
            const $ = w(null),
                R = async r => {
                    $.value && clearTimeout($.value), $.value = setTimeout(async () => {
                        var _;
                        if (r.isJoin) return;
                        const i = await W(ve({
                            championId: r.id
                        }));
                        if (i)
                            if (i.code == 0) oe(f("success")), (_ = T.value) == null || _.resetRefresh();
                            else if ([803, 804, 805, 807].includes(i.msgCode) && i.data != null) switch (y.value = !0, i.msgCode) {
                            case 803:
                                h.value = f("cpsTip25", [i.data]);
                                break;
                            case 804:
                                h.value = f("cpsTip26", [i.data]);
                                break;
                            case 805:
                                h.value = f("cpsTip27", [p[i.data]]);
                                break;
                            case 807:
                                let S = f("code807", ["{0}", "{1}", "{2}"]);
                                Object.values(i.data || {}).filter(Boolean).forEach((d, A) => {
                                    S = S.replace(`{${A}}`, `<span>${d}</span>`)
                                }), h.value = S;
                                break;
                            default:
                                h.value = f(`code${i.msgCode}`)
                        } else {
                            y.value = !0;
                            let S = f(`code${i.msgCode}`, ["{0}"]);
                            Object.values(i.data || {}).filter(Boolean).forEach((d, A) => {
                                S = S.replace(`{${A}}`, `<span>${d}</span>`)
                            }), h.value = S
                        }
                    }, 100)
                },
                W = async r => await r.then(_ => _ && _.code !== 0 ? [803, 804, 805, 806, 807].includes(_.msgCode) ? _ : (K(_), null) : _).catch(_ => ([806].includes(_.msgCode) || K(_), _));
            return (r, i) => {
                const _ = V("NavBar"),
                    S = V("van-sticky");
                return n(), o("div", Me, [C(S, null, {
                    default: O(() => [C(_, {
                        title: r.$t("cpsTip1"),
                        "left-arrow": "",
                        onClickLeft: i[0] || (i[0] = () => l(t).back())
                    }, null, 8, ["title"]), e("div", je, [(n(!0), o(L, null, H(l(g), d => (n(), o("div", {
                        key: d.key,
                        class: U({
                            active: u.state == d.key
                        }),
                        onClick: A => B(d.key)
                    }, s(d.title), 11, qe))), 128))])]),
                    _: 1
                }), C(me, {
                    list: k.value,
                    "onUpdate:list": i[2] || (i[2] = d => k.value = d),
                    api: l(pe),
                    "page-query": u,
                    "onUpdate:pageQuery": i[3] || (i[3] = d => u = d),
                    distance: 100,
                    ref_key: "listRef",
                    ref: T,
                    "is-auto-load": !0,
                    onListChange: D
                }, {
                    content: O(() => [(n(!0), o(L, null, H(k.value, d => (n(), o("div", {
                        key: d.id
                    }, [C(x, {
                        itemD: d,
                        state: d.state,
                        isRefresh: a.value,
                        "onUpdate:isRefresh": i[1] || (i[1] = A => a.value = A),
                        onClick: A => b(d.id)
                    }, null, 8, ["itemD", "state", "isRefresh", "onClick"]), [1].includes(d.state) ? (n(), o("div", {
                        key: 0,
                        class: U(["btn", {
                            active: !d.isJoin
                        }]),
                        onClick: A => R(d)
                    }, s(d.isJoin ? r.$t("cpsTip8") : r.$t("cpsTip9")), 11, Ve)) : m("v-if", !0)]))), 128))]),
                    _: 1
                }, 8, ["list", "api", "page-query"]), C(He, {
                    show: y.value,
                    "onUpdate:show": i[4] || (i[4] = d => y.value = d),
                    onConfirm: i[5] || (i[5] = () => y.value = !1),
                    showCancelBtn: !1,
                    showCloseIcon: !0,
                    clickOutSide: !0
                }, {
                    content: O(() => [e("h1", {
                        class: "championship-tips",
                        innerHTML: h.value
                    }, null, 8, ze)]),
                    _: 1
                }, 8, ["show"])])
            }
        }
    });
const Ee = j(Je, [
        ["__scopeId", "data-v-5ffc4111"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/views/activity/Championship/index.vue"]
    ]),
    Lt = Object.freeze(Object.defineProperty({
        __proto__: null,
        default: Ee
    }, Symbol.toStringTag, {
        value: "Module"
    })),
    Pe = {
        class: "title"
    },
    We = {
        class: "con"
    },
    Fe = ["innerHTML"],
    Ge = ["innerHTML"],
    Qe = {
        class: "condition"
    },
    Ke = {
        key: 0
    },
    Xe = {
        key: 1
    },
    Ye = {
        key: 2
    },
    Ze = {
        class: "ranking"
    },
    xe = {
        class: "top"
    },
    et = M({
        __name: "rule",
        props: {
            data: {
                type: null,
                required: !1
            }
        },
        setup(c) {
            const {
                t: g
            } = Z(), v = w(["0"]), {
                type: p
            } = E();

            function f(t, u) {
                return t == u ? g("cpsTip20", [t]) : g("cpsTip21", [t, u])
            }
            return (t, u) => {
                const k = V("van-collapse-item"),
                    T = V("van-collapse");
                return n(), z(T, {
                    modelValue: v.value,
                    "onUpdate:modelValue": u[0] || (u[0] = y => v.value = y),
                    class: "rule"
                }, {
                    default: O(() => [C(k, {
                        name: "1"
                    }, {
                        title: O(() => [e("div", Pe, s(t.$t("cpsTip5").toLocaleUpperCase()), 1)]),
                        default: O(() => [e("div", We, [e("h1", null, [e("span", null, s(t.$t("cpsTip11")), 1)]), e("div", {
                            innerHTML: t.$t("cpsTip12", [t.data.vendorCode, t.data.startTime, t.data.endTime])
                        }, null, 8, Fe), e("h1", null, [e("span", null, s(t.$t("awardAmount")), 1)]), e("div", null, [q(s(t.$t("cpsTip13")), 1), e("span", null, s(l(I)(t.data.sumBonus || 0)), 1)]), e("h1", null, [e("span", null, s(t.$t("cpsTip14")), 1)]), e("div", null, [e("div", {
                            innerHTML: t.$t("cpsTip15", [t.data.vendorCode])
                        }, null, 8, Ge), e("div", Qe, [t.data.conditionsBetAmount > 0 ? (n(), o("p", Ke, [q(s(t.$t("betAmounts")) + " ", 1), e("span", null, s(l(I)(t.data.conditionsBetAmount || 0)), 1)])) : m("v-if", !0), t.data.conditionsRechargeAmount > 0 ? (n(), o("p", Xe, [q(s(t.$t("rechageAmount")) + " ", 1), e("span", null, s(l(I)(t.data.conditionsRechargeAmount || 0)), 1)])) : m("v-if", !0), t.data.conditionsBindType ? (n(), o("p", Ye, [q(s(t.$t("toBind")) + " ", 1), e("span", null, s(l(p)[t.data.conditionsBindType]), 1)])) : m("v-if", !0), t.data.conditionsBetAmount == 0 && t.data.conditionsRechargeAmount == 0 && !t.data.conditionsBindType ? (n(), o(L, {
                            key: 3
                        }, [q(s(t.$t("cpsTip10")), 1)], 64)) : m("v-if", !0)])]), e("h1", null, [e("span", null, s(t.$t("binguoPaimin")), 1)]), e("div", Ze, [e("div", xe, [e("span", null, s(t.$t("binguoPaimin")), 1), e("span", null, s(t.$t("k3WarningTip4")), 1)]), (n(!0), o(L, null, H(t.data.rankingAwardsList, (y, h) => (n(), o("div", {
                            class: "info",
                            key: h
                        }, [e("span", null, s(f(y.startRanking, y.endRanking)), 1), e("span", null, s(l(I)(y.awardsAmount || 0)), 1)]))), 128)), t.data.rankingAwardsList.length == 0 ? (n(), z(Q, {
                            key: 0
                        })) : m("v-if", !0)]), e("h1", null, [e("span", null, s(t.$t("cpsTip16")), 1)]), e("div", null, [e("p", null, s(t.$t("cpsTip17")), 1), e("p", null, s(t.$t("cpsTip18")), 1)]), e("h1", null, [e("span", null, s(t.$t("cpsTip19")), 1)]), e("p", null, [e("span", null, s(t.data.vendorCode), 1)])])]),
                        _: 1
                    })]),
                    _: 1
                }, 8, ["modelValue"])
            }
        }
    });
const tt = j(et, [
        ["__scopeId", "data-v-5c0f1c84"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/components/Activity/Championship/rule.vue"]
    ]),
    st = {
        class: "game"
    },
    nt = {
        class: "items"
    },
    at = ["onClick"],
    ot = ["onClick"],
    it = M({
        __name: "game",
        props: {
            data: {
                type: null,
                required: !1
            },
            arLotteryList: {
                type: null,
                required: !1
            }
        },
        setup(c) {
            const {
                onItemClick: g
            } = fe();
            return G(), (v, p) => {
                const f = Y("lazy");
                return n(), o("div", st, [e("h1", null, s(v.$t("cpsTip22")), 1), e("div", nt, [(n(!0), o(L, null, H(v.data, t => (n(), o("div", {
                    class: "item",
                    key: t.gameID,
                    onClick: u => l(g)(t)
                }, [F(e("img", null, null, 512), [
                    [f, t.img]
                ])], 8, at))), 128)), (n(!0), o(L, null, H(v.arLotteryList, (t, u) => (n(), o("div", {
                    class: "lottery",
                    key: u,
                    onClick: k => l(g)(t)
                }, s(t.title), 9, ot))), 128)), v.data.length == 0 && v.arLotteryList.length == 0 ? (n(), z(Q, {
                    key: 0
                })) : m("v-if", !0)])])
            }
        }
    });
const lt = j(it, [
        ["__scopeId", "data-v-303ee053"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/components/Activity/Championship/game.vue"]
    ]),
    P = c => (ue("data-v-a9d644da"), c = c(), re(), c),
    ut = {
        class: "ChampionshipDetail"
    },
    rt = {
        class: "ranking"
    },
    dt = {
        class: "title"
    },
    ct = {
        class: "amount"
    },
    pt = P(() => e("span", null, "--", -1)),
    vt = P(() => e("span", null, "--", -1)),
    ft = P(() => e("span", null, "--", -1)),
    mt = {
        class: "rankingList"
    },
    ht = {
        class: "title"
    },
    _t = P(() => e("span", null, "TOP", -1)),
    gt = {
        key: 0,
        class: "txt"
    },
    yt = {
        class: "refresh"
    },
    $t = M({
        __name: "index",
        setup(c) {
            const {
                tabList: g,
                getChampionTaskDetailV: v,
                championTaskDetailVO: p,
                getTop10UserList: f,
                top10UserListVO: t,
                thirdGameListVO: u,
                arLotteryList: k
            } = E(), T = G(), y = X(() => {
                var $;
                return p.value ? ($ = g.find(R => R.key == p.value.state)) == null ? void 0 : $.title : ""
            }), h = w(), a = w(!1), b = w(null);

            function B() {
                v(h.value)
            }
            J(a, $ => {
                a.value && B()
            });
            const D = () => {
                f(h.value)
            };
            return ie(() => {
                h.value = Number(T.currentRoute.value.query.championId) || 0, h.value != 0 && (B(), D(), b.value = setInterval(D, 10 * 60 * 1e3))
            }), le(() => {
                clearInterval(b.value)
            }), ($, R) => {
                const W = V("NavBar");
                return n(), o("div", ut, [C(W, {
                    title: y.value,
                    "left-arrow": "",
                    onClickLeft: R[0] || (R[0] = () => l(T).back())
                }, null, 8, ["title"]), JSON.stringify(l(p)) !== "{}" ? (n(), o(L, {
                    key: 0
                }, [C(x, {
                    itemD: l(p),
                    state: l(p).state,
                    isRefresh: a.value,
                    "onUpdate:isRefresh": R[1] || (R[1] = r => a.value = r)
                }, null, 8, ["itemD", "state", "isRefresh"]), e("div", rt, [e("div", dt, [e("span", null, s($.$t("binguoPaimin")), 1), e("span", null, s($.$t("betAmounts")), 1), e("span", null, s($.$t("k3WarningTip4")), 1)]), e("div", ct, [l(p) && l(p).userJoinInfo ? (n(), o(L, {
                    key: 0
                }, [e("span", null, s(l(p).userJoinInfo.ranking), 1), e("span", null, s(l(I)(l(p).userJoinInfo.sumBetAmount || 0)), 1), e("span", null, s(l(I)(l(p).userJoinInfo.awardsAmount || 0)), 1)], 64)) : (n(), o(L, {
                    key: 1
                }, [pt, vt, ft], 64))])])], 64)) : m("v-if", !0), e("div", mt, [e("div", ht, [_t, e("span", null, s($.$t("account")), 1), e("span", null, s($.$t("betAmounts")), 1), e("span", null, s($.$t("k3WarningTip4")), 1)]), (n(!0), o(L, null, H(l(t), (r, i) => (n(), o("div", {
                    class: "info",
                    key: i
                }, [
                    [1, 2, 3].includes(r.ranking) ? (n(), o("span", {
                        key: 1,
                        class: U(`top${r.ranking}`)
                    }, null, 2)) : (n(), o("span", gt, s(r.ranking), 1)), e("span", null, s(r.userName), 1), e("span", null, s(l(I)(r.sumBetAmount || 0)), 1), e("span", null, s(l(I)(r.awardsAmount || 0)), 1)
                ]))), 128)), e("div", yt, s($.$t("cpsTip28")), 1), l(t).length == 0 ? (n(), z(Q, {
                    key: 0
                })) : m("v-if", !0)]), C(tt, {
                    data: l(p)
                }, null, 8, ["data"]), C(lt, {
                    data: l(u),
                    arLotteryList: l(k)
                }, null, 8, ["data", "arLotteryList"])])
            }
        }
    });
const kt = j($t, [
        ["__scopeId", "data-v-a9d644da"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/views/activity/Championship/ChampionshipDetail/index.vue"]
    ]),
    bt = Object.freeze(Object.defineProperty({
        __proto__: null,
        default: kt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
export {
    x as C, He as D, bt as a, Lt as i
};