import {
    G as M,
    aw as ee,
    r as T,
    $ as z,
    B as X,
    I as i,
    ax as F,
    ay as te,
    J as e,
    az as se,
    ar as N,
    N as n,
    ap as U,
    P as s,
    ao as h,
    O as l,
    D as ne,
    aA as Y,
    z as Z,
    R as G,
    A as ae,
    H as V,
    Q as C,
    av as O,
    K as L,
    M as H,
    F as ie,
    au as q,
    aB as j,
    C as oe,
    E as le,
    aC as ue,
    aD as re
} from "./common.modules-f9fa5dc7.js";
import {
    a as J,
    c as R,
    _ as P,
    g as de,
    b as ce,
    e as pe,
    j as ve,
    h as K,
    i as fe
} from "./page-activity-ActivityDetail-0d51a056.js";
import {
    L as he,
    E as Q
} from "./page-activity-Bonus-f5229d51.js";
const me = {
        class: "item"
    },
    _e = ["src"],
    ge = {
        class: "right"
    },
    ye = {
        key: 0
    },
    $e = {
        key: 1
    },
    ke = {
        key: 2
    },
    we = {
        key: 3,
        class: "time"
    },
    Te = ["innerHTML"],
    Ce = {
        key: 4,
        class: "time"
    },
    Le = {
        key: 5,
        class: "time"
    },
    De = {
        class: "foot"
    },
    Be = {
        class: "amount"
    },
    Se = 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, "/"),
                        D = v.itemD.endTime.replace(/-/g, "/");
                    u.value = new Date(D).getTime() - new Date(a).getTime(), u.value > 0 && (k.value = ne({
                        time: u.value,
                        onChange: y
                    }), k.value.start())
                }
            }
            const {
                serviceNowTime: f
            } = J(), {
                isRefresh: t
            } = ee(v, g), u = T(0), k = T();
            z(() => v.itemD.id, a => {
                p()
            }, {
                immediate: !0
            });
            const w = X(() => k.value.current);

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

            function m(a) {
                const D = String(a.hours).padStart(2, "0"),
                    B = String(a.minutes).padStart(2, "0"),
                    S = String(a.seconds).padStart(2, "0");
                return D + ":" + B + ":" + S
            }
            return (a, D) => (n(), i("div", me, [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, S;
                return [e("div", {
                    class: U(["head", `type${a.state}`])
                }, [a.state == 1 ? (n(), i("h1", ye, s(a.$t("cpsTip3")), 1)) : a.state == 0 ? (n(), i("h1", $e, s(a.$t("startTime")), 1)) : a.state == 2 ? (n(), i("h1", ke, s(a.$t("ended")), 1)) : h("v-if", !0), a.state == 1 ? (n(), i("div", we, [e("p", {
                    innerHTML: a.$t("fifteenDays", [w.value.days])
                }, null, 8, Te), e("h6", null, s(m(w.value)), 1)])) : h("v-if", !0), a.state == 0 ? (n(), i("div", Ce, s((B = a.itemD) == null ? void 0 : B.startTime), 1)) : h("v-if", !0), a.state == 2 ? (n(), i("div", Le, "00:00:00")) : h("v-if", !0)], 2), e("div", De, [e("h1", null, s(a.$t("winTips5")), 1), e("div", Be, s(l(R)(((S = a.itemD) == null ? void 0 : S.sumBonus) || 0)), 1)])]
            }, !0)]), N(a.$slots, "footer", {}, void 0, !0)]))
        }
    });
const x = P(Se, [
        ["__scopeId", "data-v-277c60ca"],
        ["__file", "/usr/local/jenkins-prod/workspace/AR079-Pages-india-tashanwin/src/components/Activity/Championship/card.vue"]
    ]),
    be = {
        class: "dialog__container",
        role: "dialog",
        tabindex: "0"
    },
    Re = {
        key: 0,
        class: "dialog__container-img"
    },
    Ae = {
        class: "dialog__container-title"
    },
    Ie = {
        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;
            z(() => 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(), i("div", {
                    class: U(["dialog", {
                        active: c.show,
                        inactive: !c.show
                    }])
                }, [e("div", be, [c.isShowHeader ? (n(), i("div", Re, [N(t.$slots, "header", {}, () => [F(e("img", {
                    class: U({
                        succed: c.imgUrl == "succeed"
                    }),
                    alt: ""
                }, null, 2), [
                    [k, l(de)("wallet", c.imgUrl)]
                ])], !0)])) : h("v-if", !0), e("div", Ae, [N(t.$slots, "title", {}, () => [e("h1", null, s(c.title), 1)], !0)]), e("div", Ie, [N(t.$slots, "content", {}, void 0, !0)]), c.showFooter ? (n(), i("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(), i("button", {
                    key: 0,
                    onClick: u[1] || (u[1] = () => {
                        g("update:show", !1)
                    })
                }, s(c.cancelText || t.$t("cancel")), 1)) : h("v-if", !0)], !0)])) : h("v-if", !0), c.showCloseIcon ? (n(), i("img", {
                    key: 2,
                    class: "close_img",
                    src: l(ce)("common", "close"),
                    onClick: p
                }, null, 8, Oe)) : h("v-if", !0)]), e("div", {
                    class: "dialog__outside",
                    onClick: p
                })], 2)
            }
        }
    });
const He = P(Ue, [
        ["__scopeId", "data-v-3e71d3da"],
        ["__file", "/usr/local/jenkins-prod/workspace/AR079-Pages-india-tashanwin/src/components/common/Dialog.vue"]
    ]),
    Me = {
        class: "championship"
    },
    Pe = {
        class: "tabs"
    },
    je = ["onClick"],
    Ve = ["onClick"],
    qe = ["innerHTML"],
    ze = M({
        __name: "index",
        setup(c) {
            const {
                tabList: g,
                serviceNowTime: v,
                type: p
            } = J(), {
                t: f
            } = Z(), t = G(), u = ae({
                state: 1
            }), k = T([]), w = T(), y = T(!1), m = T(""), a = T(!1);
            z(a, r => {
                var o;
                a.value && ((o = w.value) == null || o.resetRefresh())
            });

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

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

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

            function f(t, u) {
                return t == u ? g("cpsTip20", [t]) : g("cpsTip21", [t, u])
            }
            return (t, u) => {
                const k = V("van-collapse-item"),
                    w = V("van-collapse");
                return n(), q(w, {
                    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", Ee, 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, [j(s(t.$t("cpsTip13")), 1), e("span", null, s(l(R)(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(), i("p", Ke, [j(s(t.$t("betAmounts")) + " ", 1), e("span", null, s(l(R)(t.data.conditionsBetAmount || 0)), 1)])) : h("v-if", !0), t.data.conditionsRechargeAmount > 0 ? (n(), i("p", Xe, [j(s(t.$t("rechageAmount")) + " ", 1), e("span", null, s(l(R)(t.data.conditionsRechargeAmount || 0)), 1)])) : h("v-if", !0), t.data.conditionsBindType ? (n(), i("p", Ye, [j(s(t.$t("toBind")) + " ", 1), e("span", null, s(l(p)[t.data.conditionsBindType]), 1)])) : h("v-if", !0), t.data.conditionsBetAmount == 0 && t.data.conditionsRechargeAmount == 0 && !t.data.conditionsBindType ? (n(), i(L, {
                            key: 3
                        }, [j(s(t.$t("cpsTip10")), 1)], 64)) : h("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), i(L, null, H(t.data.rankingAwardsList, (y, m) => (n(), i("div", {
                            class: "info",
                            key: m
                        }, [e("span", null, s(f(y.startRanking, y.endRanking)), 1), e("span", null, s(l(R)(y.awardsAmount || 0)), 1)]))), 128)), t.data.rankingAwardsList.length == 0 ? (n(), q(Q, {
                            key: 0
                        })) : h("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 = P(et, [
        ["__scopeId", "data-v-5c0f1c84"],
        ["__file", "/usr/local/jenkins-prod/workspace/AR079-Pages-india-tashanwin/src/components/Activity/Championship/rule.vue"]
    ]),
    st = {
        class: "game"
    },
    nt = {
        class: "items"
    },
    at = ["onClick"],
    it = ["onClick"],
    ot = 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(), i("div", st, [e("h1", null, s(v.$t("cpsTip22")), 1), e("div", nt, [(n(!0), i(L, null, H(v.data, t => (n(), i("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), i(L, null, H(v.arLotteryList, (t, u) => (n(), i("div", {
                    class: "lottery",
                    key: u,
                    onClick: k => l(g)(t)
                }, s(t.title), 9, it))), 128)), v.data.length == 0 && v.arLotteryList.length == 0 ? (n(), q(Q, {
                    key: 0
                })) : h("v-if", !0)])])
            }
        }
    });
const lt = P(ot, [
        ["__scopeId", "data-v-303ee053"],
        ["__file", "/usr/local/jenkins-prod/workspace/AR079-Pages-india-tashanwin/src/components/Activity/Championship/game.vue"]
    ]),
    E = c => (ue("data-v-a9d644da"), c = c(), re(), c),
    ut = {
        class: "ChampionshipDetail"
    },
    rt = {
        class: "ranking"
    },
    dt = {
        class: "title"
    },
    ct = {
        class: "amount"
    },
    pt = E(() => e("span", null, "--", -1)),
    vt = E(() => e("span", null, "--", -1)),
    ft = E(() => e("span", null, "--", -1)),
    ht = {
        class: "rankingList"
    },
    mt = {
        class: "title"
    },
    _t = E(() => 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
            } = J(), w = G(), y = X(() => {
                var $;
                return p.value ? ($ = g.find(A => A.key == p.value.state)) == null ? void 0 : $.title : ""
            }), m = T(), a = T(!1), D = T(null);

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