import {
    G as H,
    $ as q,
    r as c,
    z as re,
    R as ce,
    B as J,
    C as ue,
    aJ as de,
    H as h,
    az as ve,
    N as l,
    I as r,
    J as e,
    P as o,
    O as n,
    an as p,
    at as U,
    au as g,
    Q as y,
    ao as O,
    K as $,
    M as W,
    aw as A,
    aA as pe,
    V as he,
    aB as ye,
    aC as _e
} from "./common.modules-af1f85b9.js";
import {
    a1 as fe,
    m as me,
    y as ge,
    a as we,
    i as ke,
    c as j,
    b as w,
    A as Ce,
    a2 as be,
    _ as De
} from "./page-activity-ActivityDetail-09e806d3.js";
import {
    C as Ae
} from "./page-activity-Championship-a1efdd83.js";
import {
    E as $e
} from "./page-activity-Bonus-78dc3749.js";
const Se = _ => (ye("data-v-4a7709f3"), _ = _(), _e(), _),
    Te = {
        class: "activity-wrapper"
    },
    Re = {
        class: "activity-banner"
    },
    Be = {
        class: "activity-bonus"
    },
    Ie = {
        class: "activity-panel"
    },
    Pe = {
        class: "msg-window"
    },
    Ue = {
        class: "msg-header"
    },
    Oe = {
        class: "msg-footer"
    },
    Le = Se(() => e("div", {
        class: "nowidth"
    }, null, -1)),
    Ee = ["onClick"],
    Ne = {
        class: "activity-panel-content"
    },
    xe = {
        class: "content-para"
    },
    ze = {
        class: "content-para"
    },
    Fe = {
        key: 0,
        class: "cardBox"
    },
    Ge = {
        class: "activitySection__container"
    },
    Me = ["onClick"],
    Ve = ["src", "onError"],
    qe = {
        class: "box-content"
    },
    Je = {
        class: "box-title"
    },
    We = {
        class: "dialog-window"
    },
    je = {
        class: "dialog-wrapper"
    },
    He = {
        class: "dialog-title"
    },
    Ke = {
        class: "dialog-para"
    },
    Qe = H({
        __name: "index",
        props: {
            activityList: {
                type: Array,
                default: () => {}
            }
        },
        setup(_) {
            const {
                getSelfCustomerServiceLink: L
            } = fe({
                ServerType: 2
            }), {
                ActiveSotre: i,
                saveUserGuidelines: S,
                saveUserDayRequest: K,
                getDailyAwardCount: Q,
                allUnAwardCount: T,
                getActive: X
            } = me(), Y = ge(), {
                championEntranceV: R,
                championEntranceVO: E
            } = we(), {
                isOpenInvitedWheel: Z
            } = ke();
            q(() => i.value.isOpenChampion, a => {
                a == 1 && R()
            });
            const k = c(!1);
            q(k, a => {
                k.value && R()
            });
            const N = c(!0),
                x = c(!0),
                z = c([]),
                {
                    t: u
                } = re(),
                B = c(!1),
                I = c(!1),
                P = c(1),
                F = c(!1),
                v = ce(),
                G = J(() => [{
                    name: u("actTip1"),
                    icon: "a1",
                    goPath: "DailyTasks",
                    noread: T.value,
                    show: i.value.isOpenActivityAward
                }, {
                    name: u("invitationBonus"),
                    icon: "a2",
                    goPath: "InvitationBonus",
                    noread: 0,
                    show: i.value.isTaskState
                }, {
                    name: u("laundryAmount"),
                    icon: "a3",
                    goPath: "Laundry",
                    noread: 0,
                    show: i.value.isOpenWashCode
                }, {
                    name: u("superjackpot"),
                    icon: "a4",
                    goPath: "SuperJackpot",
                    noread: i.value.unJackpotCount,
                    show: i.value.isOpenJackpotReward
                }, {
                    name: u("newMenberPackage"),
                    icon: "a5",
                    goPath: "MemberPackage",
                    noread: 0,
                    show: i.value.newMemberGiftPackageSwitch
                }, {
                    name: u("inviteWheel"),
                    icon: "a6",
                    goPath: "turntable",
                    noread: 0,
                    show: Z.value
                }]),
                ee = J(() => G.value.filter(a => a.show).length);

            function ae(a) {
                let t;
                const {
                    bannerID: d,
                    jumpType: C,
                    contents: m
                } = a;
                if (C == 2) {
                    if (m.startsWith("/")) {
                        v.push({
                            path: m
                        });
                        return
                    }
                    window.location.assign(m);
                    return
                } else if (C == 5) return L();
                switch (d) {
                    case 1:
                        t = "DailyTasks";
                        break;
                    case 2:
                        t = "PointMall";
                        break;
                    case 3:
                        t = "InvitationBonus";
                        break;
                    default:
                        t = "ActivityDetail";
                        break
                }
                t == "ActivityDetail" ? v.push({
                    name: t,
                    query: {
                        id: d
                    }
                }) : t && v.push({
                    name: t
                })
            }
            const te = (a, t) => {
                    a.bannerUrl = w("images", "avatar"), he(() => {
                        let d = document.querySelector(`.act_${t}`);
                        d.src = a.bannerUrl, d.style.objectFit = "contain"
                    })
                },
                f = a => {
                    v.push({
                        name: a
                    })
                },
                se = () => {
                    S(), f("DailyTasks")
                },
                M = () => {
                    x.value = !1, N.value = !1
                },
                V = (a = null) => {
                    K(), a && (M(), f("DailyTasks"))
                },
                ne = async () => {
                    const a = await Ce(be({
                        pageNo: P.value,
                        pageSize: 20
                    }));
                    a ? (a.data.totalCount == 0 && (F.value = !0), a.data.totalPage <= P.value && (I.value = !0), a.data.list && z.value.push(...a.data.list), P.value++) : I.value = !0, B.value = !1
                };
            return ue(async () => {
                await X(), i.value.isOpenActivityAward && Q(), i.value.isOpenChampion == 1 && R()
            }), de(() => {
                x.value = !1, N.value = !1
            }), (a, t) => {
                const d = h("van-icon"),
                    C = h("van-popover"),
                    m = h("van-badge"),
                    ie = h("van-list"),
                    oe = h("van-dialog"),
                    b = ve("lazy");
                return l(), r("div", Te, [e("div", Re, [e("ul", Be, [e("li", null, [e("p", null, o(a.$t("todayRewards")), 1), e("h3", null, o(n(j)(n(i).todayRewards)), 1)]), e("li", null, [e("p", null, o(a.$t("totalRewards")), 1), e("h3", null, o(n(j)(n(i).totalRewards)), 1)])]), n(Y).getIsShowRewardCenter ? (l(), r("div", {
                    key: 0,
                    class: "bonus-button",
                    onClick: t[0] || (t[0] = s => n(v).push({
                        name: "Bonus"
                    }))
                }, o(a.$t("bonusDetails")), 1)) : p("v-if", !0)]), e("div", Ie, [n(i).isFinishUserGuidelines && n(i).isOpenActivityAward ? (l(), U(C, {
                    key: 0,
                    show: n(i).isFinishUserGuidelines,
                    "onUpdate:show": t[1] || (t[1] = s => n(i).isFinishUserGuidelines = s),
                    overlay: !0,
                    placement: "top-start",
                    "close-on-click-overlay": !1,
                    onClose: M,
                    class: "arPopover"
                }, {
                    reference: g(() => [Le]),
                    default: g(() => [e("div", Pe, [e("div", Ue, o(a.$t("activityTip8")), 1), e("div", Oe, [e("div", {
                        onClick: se
                    }, [e("span", null, o(a.$t("dragonEntry")), 1), y(d, {
                        name: "arrow-double-right",
                        color: "var(main-color)"
                    })])])])]),
                    _: 1
                }, 8, ["show"])) : p("v-if", !0), e("div", {
                    class: O(["activity-panel-header", ["lg" + ee.value]])
                }, [(l(!0), r($, null, W(G.value, s => (l(), r($, null, [s.show ? (l(), r("div", {
                    key: 0,
                    class: "header-item",
                    onClick: D => f(s.goPath)
                }, [y(m, {
                    content: s.noread,
                    max: "99",
                    "show-zero": s.noread > 0,
                    color: "#FA5B5B"
                }, {
                    default: g(() => [e("div", {
                        class: O([s.icon, "bgcontainer"])
                    }, null, 2)]),
                    _: 2
                }, 1032, ["content", "show-zero"]), e("span", null, o(s.name), 1)], 8, Ee)) : p("v-if", !0)], 64))), 256))], 2), e("div", Ne, [e("div", {
                    class: "content-title",
                    onClick: t[2] || (t[2] = s => f("RedeemGift"))
                }, [A(e("img", null, null, 512), [
                    [b, n(w)("activity/DailyTask", "signInBanner")]
                ]), e("div", xe, o(a.$t("giftExchange")), 1), e("p", null, o(a.$t("activityTip3")), 1)]), e("div", {
                    class: "content-title",
                    onClick: t[3] || (t[3] = s => f("DailySignIn"))
                }, [A(e("img", null, null, 512), [
                    [b, n(w)("activity/DailyTask", "giftRedeem")]
                ]), e("div", ze, o(a.$t("code8007")), 1), e("p", null, o(a.$t("activityTip4")), 1)])])]), n(i).isOpenChampion == 1 ? (l(), r("div", Fe, [y(Ae, {
                    itemD: n(E),
                    state: n(E).state,
                    isRefresh: k.value,
                    "onUpdate:isRefresh": t[4] || (t[4] = s => k.value = s),
                    bgImgWidth: "100%",
                    bgImgHeight: "150px",
                    onClick: t[5] || (t[5] = () => n(v).push({
                        name: "Championship"
                    }))
                }, null, 8, ["itemD", "state", "isRefresh"])])) : p("v-if", !0), y(ie, {
                    loading: B.value,
                    "onUpdate:loading": t[6] || (t[6] = s => B.value = s),
                    finished: I.value,
                    "finished-text": n(u)("noMoreThere"),
                    onLoad: ne
                }, {
                    default: g(() => [e("div", Ge, [(l(!0), r($, null, W(z.value, (s, D) => (l(), r("div", {
                        class: "box",
                        key: D,
                        onClick: le => ae(s)
                    }, [e("img", {
                        src: s.bannerUrl,
                        class: O(`act_${D}`),
                        onError: le => te(s, D)
                    }, null, 42, Ve), e("div", qe, [e("div", Je, o(s.bannerTitle), 1)])], 8, Me))), 128))])]),
                    _: 1
                }, 8, ["loading", "finished", "finished-text"]), F.value ? (l(), U($e, {
                    key: 1
                })) : p("v-if", !0), n(T) > 0 && n(i).isOpenActivityAward ? (l(), U(oe, {
                    key: 2,
                    show: n(i).isFirstUserDayRequest,
                    "onUpdate:show": t[9] || (t[9] = s => n(i).isFirstUserDayRequest = s),
                    "show-confirm-button": !1,
                    className: "noOverHidden"
                }, {
                    default: g(() => [e("div", We, [e("div", je, [A(e("img", null, null, 512), [
                        [b, n(w)("activity/DailyTask", "present")]
                    ]), e("div", He, [pe(o(a.$t("activityTip5")) + " ", 1), e("span", null, o(n(T)), 1)]), e("div", Ke, o(a.$t("activityTip6")), 1), e("div", {
                        class: "dialog-btn",
                        onClick: t[7] || (t[7] = s => V(!0))
                    }, o(a.$t("activityTip7")), 1), e("div", {
                        class: "dialog-footer",
                        onClick: t[8] || (t[8] = s => V())
                    }, [A(e("img", null, null, 512), [
                        [b, n(w)("activity/DailyTask", "close")]
                    ])])])])]),
                    _: 1
                }, 8, ["show"])) : p("v-if", !0)])
            }
        }
    });
const Xe = De(Qe, [
        ["__scopeId", "data-v-4a7709f3"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/components/Activity/Section/index.vue"]
    ]),
    ta = H({
        __name: "index",
        setup(_) {
            return (L, i) => {
                const S = h("NavBar");
                return l(), r($, null, [y(S, {
                    class: "main",
                    headLogo: !0
                }), y(Xe)], 64)
            }
        }
    });
export {
    ta as _
};