import {
    G as V,
    z as K,
    r as m,
    B as O,
    $ as G,
    H as g,
    N as r,
    I as c,
    J as t,
    Q as e,
    av as o,
    aB as p,
    P as n,
    K as N,
    M as w,
    au as S,
    ao as $,
    ap as C
} from "./common.modules-5cfe2cf4.js";
import {
    u as T,
    v as x
} from "./page-saasLottery-D5-2f97b5a2.js";
import {
    _ as H
} from "./page-activity-ActivityDetail-a58ec568.js";
import {
    u as j
} from "./page-saasLottery-K3-6457b408.js";
import {
    E as A
} from "./page-activity-Bonus-3c16c86d.js";
import "./page-turntable-assets-d6267459.js";
import "./native/index-2ac88fb8.js";
import "./en-cfd26acf.js";
const F = {
        class: "GameRecord__C"
    },
    J = {
        class: "GameRecord__C-head"
    },
    M = {
        class: "GameRecord__C-body"
    },
    Q = {
        class: "GameRecord__C-body-premium"
    },
    q = {
        key: 1,
        class: "GameRecord__C-body-empty"
    },
    U = {
        key: 0,
        class: "GameRecord__C-foot"
    },
    W = {
        class: "GameRecord__C-foot-page"
    },
    X = V({
        __name: "Record",
        setup(Y) {
            const {
                gameCode: P,
                trigger: Z
            } = T();
            K();
            const {
                historyIssues: y,
                historyIssuesTotalPage: v
            } = j(), i = m([]), R = m(!1), f = O(() => i.value.length ? i.value : y.value), u = m(v.value), z = m(10), a = m(1), B = () => {
                a.value < 2 || (a.value--, h())
            }, I = () => {
                a.value++, !(a.value > u.value) && h()
            }, h = async () => {
                try {
                    R.value = !0;
                    const {
                        result: s,
                        data: _
                    } = await x({
                        gameCode: P.value,
                        pageNo: a.value,
                        pageSize: z.value
                    });
                    s && (i.value = _.list || [], a.value = _.pageNo || 1, u.value = _.totalPage || 0)
                } catch {} finally {
                    R.value = !1
                }
            };
            return G(y, () => {
                i.value = [], a.value = 1
            }), G(v, () => {
                u.value = v.value
            }), (s, _) => {
                const l = g("van-col"),
                    k = g("van-row"),
                    b = g("van-icon");
                return r(), c("div", F, [t("div", J, [e(k, null, {
                    default: o(() => [e(l, {
                        span: "10"
                    }, {
                        default: o(() => [p(n(s.$t("gameRecordNum")), 1)]),
                        _: 1
                    }), e(l, {
                        span: "8"
                    }, {
                        default: o(() => [p(n(s.$t("gameRecordTotal")), 1)]),
                        _: 1
                    }), e(l, {
                        span: "6"
                    }, {
                        default: o(() => [p(n(s.$t("gameRecordResult")), 1)]),
                        _: 1
                    })]),
                    _: 1
                })]), t("div", M, [f.value.length ? (r(!0), c(N, {
                    key: 0
                }, w(f.value, (d, E) => (r(), S(k, {
                    key: E
                }, {
                    default: o(() => [e(l, {
                        span: "9"
                    }, {
                        default: o(() => [p(n(d.issueNumber), 1)]),
                        _: 2
                    }, 1024), e(l, {
                        span: "2"
                    }, {
                        default: o(() => [t("span", null, n(d.sum), 1)]),
                        _: 2
                    }, 1024), e(l, {
                        span: "4"
                    }, {
                        default: o(() => [t("span", null, n(d.sum > 10 ? s.$t("big") : s.$t("small")), 1)]),
                        _: 2
                    }, 1024), e(l, {
                        span: "4"
                    }, {
                        default: o(() => [t("span", null, n(d.sum % 2 ? s.$t("k3Odd") : s.$t("k3Even")), 1)]),
                        _: 2
                    }, 1024), $(` <van-col span="6">
						<span>{{ item.sum }}</span>
						<span>{{ sumOfDigits(item.premium) > 10 ? t('common.big') : t('common.small') }}</span>
						<span>{{ sumOfDigits(item.premium) % 2 ? t('common.odd') : t('common.even') }}</span>
					</van-col> `), e(l, {
                        span: "5"
                    }, {
                        default: o(() => [t("div", Q, [(r(!0), c(N, null, w(d.premium, (L, D) => (r(), c("div", {
                            key: D,
                            class: C("number" + L)
                        }, null, 2))), 128))])]),
                        _: 2
                    }, 1024)]),
                    _: 2
                }, 1024))), 128)) : (r(), c("div", q, [e(A)]))]), f.value.length ? (r(), c("div", U, [t("div", {
                    class: C(["GameRecord__C-foot-previous", {
                        disabled: a.value <= 1
                    }]),
                    onClick: B
                }, [e(b, {
                    name: "arrow-left",
                    class: "GameRecord__C-icon",
                    size: "20"
                })], 2), t("div", W, n(a.value) + "/" + n(u.value), 1), t("div", {
                    class: C(["GameRecord__C-foot-next", {
                        disabled: a.value >= u.value
                    }]),
                    onClick: I
                }, [e(b, {
                    name: "arrow",
                    class: "GameRecord__C-icon",
                    size: "20"
                })], 2)])) : $("v-if", !0)])
            }
        }
    });
const ce = H(X, [
    ["__scopeId", "data-v-ad665b84"],
    ["__file", "/usr/local/jenkins-prod/workspace/AR048-Pages-india-91club/src/saasLottery/game/K3/components/k33/Record.vue"]
]);
export {
    ce as
    default
};