var e = require("../../common/vendor.js"),
  n = require("../../hooks/useState.js"),
  t = require("../../constant/index.js"),
  o = require("../../utils/navigate.js"),
  a = require("../../utils/util.js");
require("../../store/app/index.js"),
  require("../../enums/index.js"),
  require("../../data/index.js"),
  Array || e.resolveComponent("uni-popup")(),
  Math;
var r = {
    __name: "index",
    props: { checked: { type: Boolean, default: !0 } },
    emits: ["change"],
    setup: function (r, i) {
      var u = i.emit,
        s = n.useState().setAgreementPopupShow,
        c = e.ref(null),
        l = e.ref(!1),
        p = function () {
          u("change");
        },
        d = function () {
          o.navigateTo({
            url: "/pages/web-view/index",
            params: { url: t.userAgreementUrl, title: "用户协议" },
          });
        },
        g = function () {
          o.navigateTo({
            url: "/pages/web-view/index",
            params: { url: t.userNoticeUrl, title: "用户须知" },
          });
        },
        v = function () {
          l.value = !l.value;
        },
        m = function () {
          s(!1), c.value.close();
        },
        f = function () {
          if (l.value) {
            var n = e.index.getStorageSync("hasClickAgreement");
            n ? n++ : (n = 1),
              e.index.setStorageSync("hasClickAgreement", n),
              s(!1),
              c.value.close(),
              u("change");
          } else a.showToast("请先阅读并同意协议");
        };
      return (
        e.onMounted(function () {
          !e.index.getStorageSync("hasClickAgreement") ||
          e.index.getStorageSync("hasClickAgreement") < 1
            ? setTimeout(function () {
                c.value.open(), s(!0);
              }, 300)
            : (u("change"), s(!1));
        }),
        function (n, t) {
          return {
            a: r.checked,
            b: e.o(p),
            c: !r.checked,
            d: e.o(p),
            e: e.o(p),
            f: e.o(d),
            g: e.o(g),
            h: e.o(d),
            i: e.o(g),
            j: l.value,
            k: !l.value,
            l: e.o(v),
            m: e.o(m),
            n: e.n(l.value ? "canClick" : ""),
            o: e.o(f),
            p: e.sr(c, "14559edd-0", { k: "popup" }),
            q: e.p({ type: "center", "is-mask-click": !1, animation: !0 }),
          };
        }
      );
    },
  },
  i = e._export_sfc(r, [["__scopeId", "data-v-14559edd"]]);
wx.createComponent(i);
