import {
    G as D,
    N as l,
    I as r,
    J as g,
    an as B,
    P as m,
    O as s,
    ao as O,
    ap as te,
    H as $,
    Q as _,
    aq as L,
    r as y,
    C as j,
    L as ae,
    ar as P,
    X as se,
    B as ne,
    E as oe,
    as as ie,
    V as le,
    $ as re,
    at as z,
    z as de,
    R as ce,
    K as I,
    M as E,
    au as N,
    Z as q
} from "./common.modules-af1f85b9.js";
import {
    u as Q,
    c as V,
    _ as A,
    r as ue,
    A as fe,
    d as pe,
    f as ve
} from "./page-activity-ActivityDetail-09e806d3.js";
const _e = {
        class: "bonus-item"
    },
    me = {
        class: "bonus-item-left"
    },
    ye = {
        class: "bonus-item-amount"
    },
    ge = te('<svg xmlns="http://www.w3.org/2000/svg" width="35" height="36" viewBox="0 0 35 36" fill="none" data-v-6f03e28d><circle cx="17.1089" cy="18.8912" r="17.1089" fill="url(#paint0_linear_10062_22583)" data-v-6f03e28d></circle><circle cx="17.1089" cy="17.1089" r="16.9096" fill="url(#paint1_linear_10062_22583)" stroke="url(#paint2_linear_10062_22583)" stroke-width="0.398523" data-v-6f03e28d></circle><g filter="url(#filter0_i_10062_22583)" data-v-6f03e28d><circle cx="17.1021" cy="17.1088" r="14.6138" fill="url(#paint3_linear_10062_22583)" data-v-6f03e28d></circle></g><circle cx="17.1021" cy="17.1088" r="14.4146" stroke="url(#paint4_linear_10062_22583)" stroke-width="0.398523" data-v-6f03e28d></circle><circle cx="17.111" cy="17.109" r="11.9195" fill="url(#paint5_linear_10062_22583)" stroke="url(#paint6_linear_10062_22583)" stroke-width="0.398523" data-v-6f03e28d></circle><g filter="url(#filter1_i_10062_22583)" data-v-6f03e28d><path d="M16.1719 11.6004C16.4105 10.8661 17.4494 10.8661 17.688 11.6004L18.5515 14.2582C18.6582 14.5866 18.9643 14.809 19.3096 14.809H22.1041C22.8763 14.809 23.1973 15.797 22.5726 16.2509L20.3118 17.8935C20.0324 18.0964 19.9155 18.4562 20.0222 18.7846L20.8858 21.4424C21.1244 22.1767 20.2839 22.7873 19.6593 22.3335L17.3984 20.6909C17.1191 20.4879 16.7408 20.4879 16.4614 20.6909L14.2006 22.3335C13.5759 22.7873 12.7355 22.1767 12.9741 21.4424L13.8376 18.7846C13.9443 18.4562 13.8274 18.0964 13.5481 17.8935L11.2872 16.2509C10.6626 15.797 10.9836 14.809 11.7557 14.809H14.5503C14.8956 14.809 15.2016 14.5866 15.3083 14.2582L16.1719 11.6004Z" fill="url(#paint7_linear_10062_22583)" data-v-6f03e28d></path></g><defs data-v-6f03e28d><filter id="filter0_i_10062_22583" x="2.48828" y="2.495" width="29.2266" height="30.0247" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB" data-v-6f03e28d><feFlood flood-opacity="0" result="BackgroundImageFix" data-v-6f03e28d></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" data-v-6f03e28d></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" data-v-6f03e28d></feColorMatrix><feMorphology radius="1.59409" operator="erode" in="SourceAlpha" result="effect1_innerShadow_10062_22583" data-v-6f03e28d></feMorphology><feOffset dy="0.797045" data-v-6f03e28d></feOffset><feGaussianBlur stdDeviation="0.797045" data-v-6f03e28d></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" data-v-6f03e28d></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0.883333 0 0 0 0 0.526241 0 0 0 0 0 0 0 0 1 0" data-v-6f03e28d></feColorMatrix><feBlend mode="normal" in2="shape" result="effect1_innerShadow_10062_22583" data-v-6f03e28d></feBlend></filter><filter id="filter1_i_10062_22583" x="10.957" y="11.0497" width="11.9453" height="12.2367" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB" data-v-6f03e28d><feFlood flood-opacity="0" result="BackgroundImageFix" data-v-6f03e28d></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" data-v-6f03e28d></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" data-v-6f03e28d></feColorMatrix><feOffset dy="0.797045" data-v-6f03e28d></feOffset><feGaussianBlur stdDeviation="0.797045" data-v-6f03e28d></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" data-v-6f03e28d></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0.9125 0 0 0 0 0.38325 0 0 0 0 0 0 0 0 1 0" data-v-6f03e28d></feColorMatrix><feBlend mode="normal" in2="shape" result="effect1_innerShadow_10062_22583" data-v-6f03e28d></feBlend></filter><linearGradient id="paint0_linear_10062_22583" x1="5.52473" y1="34.7525" x2="29.5841" y2="34.7525" gradientUnits="userSpaceOnUse" data-v-6f03e28d><stop stop-color="#F88F03" data-v-6f03e28d></stop><stop offset="0.537037" stop-color="#FFC225" data-v-6f03e28d></stop><stop offset="1" stop-color="#F98F06" data-v-6f03e28d></stop></linearGradient><linearGradient id="paint1_linear_10062_22583" x1="17.1089" y1="0" x2="17.1089" y2="34.2177" gradientUnits="userSpaceOnUse" data-v-6f03e28d><stop stop-color="#FFEB5D" data-v-6f03e28d></stop><stop offset="1" stop-color="#FCD74C" data-v-6f03e28d></stop></linearGradient><linearGradient id="paint2_linear_10062_22583" x1="17.1089" y1="0" x2="17.1089" y2="34.2177" gradientUnits="userSpaceOnUse" data-v-6f03e28d><stop stop-color="#FFF499" data-v-6f03e28d></stop><stop offset="1" stop-color="#FFEA60" data-v-6f03e28d></stop></linearGradient><linearGradient id="paint3_linear_10062_22583" x1="17.1021" y1="2.49499" x2="17.1021" y2="31.7226" gradientUnits="userSpaceOnUse" data-v-6f03e28d><stop stop-color="#FFA71D" data-v-6f03e28d></stop><stop offset="1" stop-color="#F88D04" data-v-6f03e28d></stop></linearGradient><linearGradient id="paint4_linear_10062_22583" x1="17.1021" y1="2.49499" x2="17.1021" y2="31.7226" gradientUnits="userSpaceOnUse" data-v-6f03e28d><stop stop-color="#FFF499" data-v-6f03e28d></stop><stop offset="1" stop-color="#FFEA60" data-v-6f03e28d></stop></linearGradient><linearGradient id="paint5_linear_10062_22583" x1="17.111" y1="4.99023" x2="17.111" y2="29.2278" gradientUnits="userSpaceOnUse" data-v-6f03e28d><stop stop-color="#FFF18E" data-v-6f03e28d></stop><stop offset="1" stop-color="#FCD751" data-v-6f03e28d></stop></linearGradient><linearGradient id="paint6_linear_10062_22583" x1="17.111" y1="4.99023" x2="17.111" y2="29.2278" gradientUnits="userSpaceOnUse" data-v-6f03e28d><stop stop-color="#FFF499" data-v-6f03e28d></stop><stop offset="1" stop-color="#FFEA60" data-v-6f03e28d></stop></linearGradient><linearGradient id="paint7_linear_10062_22583" x1="16.9299" y1="9.26746" x2="16.9299" y2="25.307" gradientUnits="userSpaceOnUse" data-v-6f03e28d><stop stop-color="#F89300" data-v-6f03e28d></stop><stop offset="1" stop-color="#F88906" data-v-6f03e28d></stop></linearGradient></defs></svg>', 1),
    he = {
        key: 0
    },
    ke = {
        key: 0
    },
    xe = {
        key: 1
    },
    we = {
        key: 2
    },
    Ce = {
        key: 1,
        class: "bonus-item-right disable"
    },
    be = D({
        __name: "item",
        props: {
            item: {
                type: Object
            },
            state: {
                type: Number,
                default: 0
            },
            time: {
                type: Boolean,
                default: !0
            }
        },
        emits: ["pack"],
        setup(t, {
            emit: p
        }) {
            const {
                rewardTypeMap: d,
                rewardStateMap: o,
                mapParam: i
            } = Q(), k = Object.keys(i), v = e => {
                const c = h => `${Math.floor(h*1e3)/10}%`;
                return e.recordType === 1 ? typeof e.maxRewardableRate == "number" ? `⬆${c(e.maxRewardableRate)}` : typeof e.maxRewardableAmount == "number" ? `⬆${V(e.maxRewardableAmount)}` : "???" : e.amount ? V(e.amount) : "???"
            };
            return (e, c) => {
                var h, x;
                return l(), r("div", _e, [g("div", me, [g("p", ye, [ge, B("<span>{{item.amount?currency(item.amount):'???'}}</span>"), g("span", null, m(v(t.item)), 1)]), g("p", null, m((h = s(d)[t.item.rewardType]) == null ? void 0 : h.label), 1), t.time ? (l(), r("p", he, m(t.item.createTime), 1)) : B("v-if", !0)]), t.state === 0 ? (l(), r("div", {
                    key: 0,
                    class: O(["bonus-item-right", {
                        receiveIng: t.item.loading
                    }]),
                    onClick: c[0] || (c[0] = C => p("pack", t.item))
                }, [B("{{item.loading?$t('receiveIng'):vaules.includes(item.rewardType+'')?$t('checkOver'):$t('receive')}}"), t.item.loading ? (l(), r("span", ke, m(e.$t("receiveIng")), 1)) : [20, 118, 107, 30, 29, 103].includes(t.item.rewardType) ? (l(), r("span", xe, m(t.item.recordType === 1 && t.item.amount === 0 ? e.$t("checkOver") : e.$t("receive")), 1)) : (l(), r("span", we, m(s(k).includes(String(t.item.rewardType)) ? e.$t("checkOver") : e.$t("receive")), 1))], 2)) : (l(), r("div", Ce, m((x = s(o)[t.state]) == null ? void 0 : x.label), 1))])
            }
        }
    });
const Se = A(be, [
    ["__scopeId", "data-v-6f03e28d"],
    ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/components/Activity/Bonus/item.vue"]
]);
const Fe = {},
    $e = {
        class: "empty__container"
    };

function Be(t, p) {
    const d = $("svg-icon");
    return l(), r("div", $e, [_(d, {
        name: "empty"
    }), L(t.$slots, "text", {}, () => [g("p", null, m(t.$t("noData")), 1)], !0)])
}
const Re = A(Fe, [
    ["render", Be],
    ["__scopeId", "data-v-f84b843f"],
    ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/components/Empty/index.vue"]
]);

function Ge(t) {
    const p = y();
    return j(() => {
        const d = "refresh" + ue();
        p.value && p.value.setAttribute("id", d), setTimeout(() => {
            const o = ae.messages();
            P.init({
                mainElement: "#" + d,
                triggerElement: "body",
                onRefresh() {
                    t()
                },
                instructionsReleaseToRefresh: o.vanPullRefresh.loosing,
                instructionsPullToRefresh: o.vanPullRefresh.pulling,
                instructionsRefreshing: o.loading
            })
        }, 200)
    }), se(() => {
        P.destroyAll()
    }), {
        elementRef: p
    }
}
const Ue = {
        class: "infiniteScroll__loading"
    },
    Le = D({
        __name: "ListSimply",
        props: {
            api: {
                type: Function,
                required: !0
            },
            distance: {
                type: Number,
                required: !1,
                default: 100
            },
            pageQuery: {
                type: null,
                required: !1,
                default: {}
            },
            list: {
                type: Array,
                required: !0
            },
            isAutoLoad: {
                type: Boolean,
                required: !1,
                default: !0
            },
            filterData: {
                type: Function,
                required: !1
            }
        },
        emits: ["update:list", "update:pageQuery", "update:totalCount", "pageChange", "listChange"],
        setup(t, {
            expose: p,
            emit: d
        }) {
            const o = t,
                i = ne(() => {
                    let a = s(o.list);
                    return o.filterData ? o.filterData(a) || [] : a || []
                }),
                {
                    isAutoLoad: k
                } = o,
                v = y(!1),
                e = y({
                    pageNo: 1,
                    pageSize: 10
                }),
                c = y(!1),
                h = async a => {
                    if (!e.value.pageNo || !e.value.pageSize) return;
                    c.value = !0;
                    let S = { ...e.value,
                        ...o.pageQuery,
                        ...a
                    };
                    const u = await fe(o.api(S));
                    if (u) {
                        e.value.pageNo = u.data.pageNo, d("pageChange", u.data), (u.data.totalCount === 0 || u.data.totalPage === e.value.pageNo) && (v.value = !0);
                        let F = e.value.pageNo === 1 ? u.data.list : [...o.list.concat(u.data.list)];
                        d("update:list", F), d("listChange", u), c.value = !1
                    } else c.value = !1
                },
                x = y(!1);
            let C = null;
            async function R() {
                C && (C(), C = null), await h(), le(() => {
                    C = re(b, a => {
                        const {
                            innerHeight: S
                        } = window;
                        x.value || a <= S + o.distance && a !== 0 && e.value.pageNo >= 1 && !c.value && !v.value && (h({
                            pageNo: e.value.pageNo + 1
                        }), x.value = !0, setTimeout(() => {
                            x.value = !1
                        }, 1e3))
                    })
                })
            }
            j(async () => {
                k && await R()
            }), oe(async () => {});
            const G = () => {
                    e.value = {
                        pageNo: 1,
                        pageSize: 10
                    }, v.value = !1, d("update:list", []), R()
                },
                {
                    elementRef: U
                } = Ge(G),
                {
                    bottom: b
                } = ie(U);
            return p({
                resetRefresh: G
            }), (a, S) => {
                const u = $("van-loading");
                return l(), r("div", {
                    class: "infiniteScroll",
                    ref_key: "scrollRef",
                    ref: U
                }, [L(a.$slots, "content", {
                    list: i.value
                }, void 0, !0), L(a.$slots, "loading", {}, () => [g("div", Ue, [c.value && !v.value ? (l(), z(u, {
                    key: 0,
                    class: "z-50"
                })) : B("v-if", !0), i.value.length === 0 && v.value ? L(a.$slots, "empty", {
                    key: 1
                }, () => [_(Re)], !0) : v.value ? (l(), r("div", {
                    key: 2,
                    ref: "pullTextRef"
                }, m(a.$t("noMoreThere")), 513)) : B("v-if", !0)])], !0)], 512)
            }
        }
    });
const Ae = A(Le, [
        ["__scopeId", "data-v-cbab7763"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/components/common/ListSimply.vue"]
    ]),
    Ne = {
        class: "bonus__container"
    },
    Oe = {
        class: "bonus__container-header"
    },
    De = {
        class: "ar"
    },
    Te = {
        class: "ar-searchbar"
    },
    Me = {
        class: "bonus__container-tabs"
    },
    Pe = ["onClick"],
    Ie = D({
        __name: "index",
        setup(t) {
            const {
                t: p
            } = de(), {
                rewardStates: d,
                rewardTypes: o,
                query: i,
                list: k,
                getListRewards: v,
                listRef: e,
                onTabState: c,
                onBonusPack: h
            } = Q(), x = ce();

            function C() {
                x.back()
            }
            const {
                minDate: R,
                maxDate: G
            } = pe(0), {
                value: U
            } = ve(), b = y(U), a = y(!1), S = y(p("all")), u = y(!1), F = y(!1), H = () => {
                [0, 2].includes(i.receiveState) || (F.value = !0)
            }, W = async ({
                selectedOptions: w
            }) => {
                a.value = !1, S.value = w[0].label, i.rewardType = w[0].value, e.value.resetRefresh()
            }, Z = ({
                selectedOptions: w
            }) => {
                F.value = !1, i.date = "", e.value.resetRefresh()
            }, J = async ({
                selectedOptions: w
            }) => {
                F.value = !1, i.date = `${b.value[0]}-${b.value[1]}-${b.value[2]} 00:00:00`, e.value.resetRefresh()
            };

            function K() {
                a.value = !0, u.value = !0
            }
            return (w, f) => {
                const X = $("NavBar"),
                    T = $("ArSelect"),
                    Y = $("van-picker"),
                    M = $("van-popup"),
                    ee = $("van-date-picker");
                return l(), r("div", Ne, [_(X, {
                    title: w.$t("bonusDetails"),
                    "left-arrow": "",
                    onClickLeft: C
                }, null, 8, ["title"]), g("div", Oe, [g("div", De, [g("div", Te, [_(T, {
                    onClickSelect: K,
                    selectName: S.value
                }, null, 8, ["selectName"]), _(T, {
                    class: O({
                        bonusStates: [0, 2].includes(s(i).receiveState)
                    }),
                    onClickSelect: H,
                    selectName: s(i).date || w.$t("pickDate")
                }, null, 8, ["class", "selectName"])])])]), g("ul", Me, [(l(!0), r(I, null, E(s(d), n => (l(), r("li", {
                    class: O({
                        active: n.value === s(i).receiveState
                    }),
                    onClick: qe => s(c)(n)
                }, m(n.label), 11, Pe))), 256))]), _(Ae, {
                    list: s(k),
                    "onUpdate:list": f[0] || (f[0] = n => q(k) ? k.value = n : null),
                    "page-query": s(i),
                    "onUpdate:pageQuery": f[1] || (f[1] = n => q(i) ? i.value = n : null),
                    api: s(v),
                    distance: 100,
                    ref_key: "listRef",
                    ref: e,
                    "is-auto-load": !0
                }, {
                    content: N(() => [(l(!0), r(I, null, E(s(k), n => (l(), z(Se, {
                        key: n.activityId,
                        item: n,
                        state: s(i).receiveState,
                        onPack: s(h)
                    }, null, 8, ["item", "state", "onPack"]))), 128))]),
                    _: 1
                }, 8, ["list", "page-query", "api"]), B(" 配合弹窗层使用 "), _(M, {
                    show: a.value,
                    "onUpdate:show": f[3] || (f[3] = n => a.value = n),
                    round: "",
                    position: "bottom"
                }, {
                    default: N(() => [_(Y, {
                        "columns-field-names": {
                            text: "label",
                            value: "value"
                        },
                        columns: s(o),
                        onCancel: f[2] || (f[2] = n => a.value = !1),
                        onConfirm: W
                    }, null, 8, ["columns"])]),
                    _: 1
                }, 8, ["show"]), _(M, {
                    show: F.value,
                    "onUpdate:show": f[5] || (f[5] = n => F.value = n),
                    round: "",
                    position: "bottom"
                }, {
                    default: N(() => [_(ee, {
                        modelValue: b.value,
                        "onUpdate:modelValue": f[4] || (f[4] = n => b.value = n),
                        title: w.$t("pickDate"),
                        onCancel: Z,
                        onConfirm: J,
                        "min-date": s(R),
                        "max-date": s(G)
                    }, null, 8, ["modelValue", "title", "min-date", "max-date"])]),
                    _: 1
                }, 8, ["show"])])
            }
        }
    });
const Ee = A(Ie, [
        ["__scopeId", "data-v-791a5344"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar055-india-bdg/src/views/activity/Bonus/index.vue"]
    ]),
    ze = Object.freeze(Object.defineProperty({
        __proto__: null,
        default: Ee
    }, Symbol.toStringTag, {
        value: "Module"
    }));
export {
    Se as B, Re as E, Ae as L, ze as i, Ge as u
};