"use strict";
const common_vendor = require("../../../common/vendor.js");
const sheep_index = require("../../index.js");
require("../../url/index.js");
require("../../store/index.js");
require("../../store/app.js");
require("../../api/promotion/diy.js");
require("../../request/index.js");
require("../../config/index.js");
require("../../platform/index.js");
require("../../platform/provider/wechat/index.js");
require("../../platform/provider/wechat/miniProgram.js");
require("../../api/member/auth.js");
require("../../api/member/social.js");
require("../../api/member/user.js");
require("../../platform/provider/apple/index.js");
require("../../platform/share.js");
require("../../router/index.js");
require("../../hooks/useModal.js");
require("../../helper/index.js");
require("../../helper/test.js");
require("../../helper/digit.js");
require("../../helper/throttle.js");
require("../../platform/pay.js");
require("../../api/pay/order.js");
require("../../store/user.js");
require("../../store/cart.js");
require("../../api/trade/cart.js");
require("../../api/pay/wallet.js");
require("../../api/trade/order.js");
require("../../api/promotion/coupon.js");
require("../../store/sys.js");
require("../../store/modal.js");
require("../../config/zIndex.js");
if (!Array) {
  const _easycom_su_navbar2 = common_vendor.resolveComponent("su-navbar");
  const _easycom_s_custom_navbar2 = common_vendor.resolveComponent("s-custom-navbar");
  const _easycom_su_inner_navbar2 = common_vendor.resolveComponent("su-inner-navbar");
  const _easycom_s_tabbar2 = common_vendor.resolveComponent("s-tabbar");
  const _easycom_s_auth_modal2 = common_vendor.resolveComponent("s-auth-modal");
  const _easycom_s_share_modal2 = common_vendor.resolveComponent("s-share-modal");
  const _easycom_s_menu_tools2 = common_vendor.resolveComponent("s-menu-tools");
  (_easycom_su_navbar2 + _easycom_s_custom_navbar2 + _easycom_su_inner_navbar2 + _easycom_s_tabbar2 + _easycom_s_auth_modal2 + _easycom_s_share_modal2 + _easycom_s_menu_tools2)();
}
const _easycom_su_navbar = () => "../../ui/su-navbar/su-navbar.js";
const _easycom_s_custom_navbar = () => "../s-custom-navbar/s-custom-navbar.js";
const _easycom_su_inner_navbar = () => "../../ui/su-inner-navbar/su-inner-navbar.js";
const _easycom_s_tabbar = () => "../s-tabbar/s-tabbar.js";
const _easycom_s_auth_modal = () => "../s-auth-modal/s-auth-modal.js";
const _easycom_s_share_modal = () => "../s-share-modal/s-share-modal.js";
const _easycom_s_menu_tools = () => "../s-menu-tools/s-menu-tools.js";
if (!Math) {
  (_easycom_su_navbar + _easycom_s_custom_navbar + _easycom_su_inner_navbar + _easycom_s_tabbar + _easycom_s_auth_modal + _easycom_s_share_modal + _easycom_s_menu_tools)();
}
const _sfc_main = {
  __name: "s-layout",
  props: {
    title: {
      type: String,
      default: ""
    },
    navbar: {
      type: String,
      default: "normal"
    },
    opacityBgUi: {
      type: String,
      default: "bg-white"
    },
    color: {
      type: String,
      default: ""
    },
    tools: {
      type: String,
      default: "title"
    },
    keyword: {
      type: String,
      default: ""
    },
    navbarStyle: {
      type: Object,
      default: () => ({
        mode: "",
        type: "",
        color: "",
        src: "",
        list: [],
        alwaysShow: 0
      })
    },
    bgStyle: {
      type: Object,
      default: () => ({
        src: "",
        color: "var(--ui-BG-1)"
      })
    },
    tabbar: {
      type: [String, Boolean],
      default: ""
    },
    onShareAppMessage: {
      type: [Boolean, Object],
      default: true
    },
    leftWidth: {
      type: [Number, String],
      default: 100
    },
    rightWidth: {
      type: [Number, String],
      default: 100
    },
    defaultSearch: {
      type: String,
      default: ""
    },
    //展示返回按钮
    showLeftButton: {
      type: Boolean,
      default: false
    }
  },
  emits: ["search"],
  setup(__props, { emit: emits }) {
    const props = __props;
    const sysStore = sheep_index.sheep.$store("sys");
    sheep_index.sheep.$store("user");
    sheep_index.sheep.$store("app");
    sheep_index.sheep.$store("modal");
    const sys = common_vendor.computed(() => sysStore);
    const navbarMode = common_vendor.computed(() => {
      if (props.navbar === "normal" || props.navbarStyle.mode === "normal") {
        return "normal";
      }
      return "inner";
    });
    const bgMain = common_vendor.computed(() => {
      if (navbarMode.value === "inner") {
        return {
          background: `${props.bgStyle.backgroundColor} url(${sheep_index.sheep.$url.cdn(
            props.bgStyle.backgroundImage
          )}) no-repeat top center / 100% auto`
        };
      }
      return {};
    });
    const bgBody = common_vendor.computed(() => {
      if (navbarMode.value === "normal") {
        return {
          background: `${props.bgStyle.backgroundColor} url(${sheep_index.sheep.$url.cdn(
            props.bgStyle.backgroundImage
          )}) no-repeat top center / 100% auto`
        };
      }
      return {};
    });
    const shareInfo = common_vendor.computed(() => {
      if (props.onShareAppMessage === true) {
        return sheep_index.sheep.$platform.share.getShareInfo();
      } else {
        if (!common_vendor.lodashExports.isEmpty(props.onShareAppMessage)) {
          sheep_index.sheep.$platform.share.updateShareInfo(props.onShareAppMessage);
          return props.onShareAppMessage;
        }
      }
      return {};
    });
    common_vendor.onShareAppMessage(() => {
      return {
        title: shareInfo.value.title,
        path: shareInfo.value.path,
        imageUrl: shareInfo.value.image
      };
    });
    common_vendor.onShow(() => {
      if (!common_vendor.lodashExports.isEmpty(shareInfo.value)) {
        sheep_index.sheep.$platform.share.updateShareInfo(shareInfo.value);
      }
    });
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: __props.navbar === "normal"
      }, __props.navbar === "normal" ? {
        b: common_vendor.o((e) => emits("search", e)),
        c: common_vendor.p({
          title: __props.title,
          statusBar: true,
          color: __props.color,
          tools: __props.tools,
          opacityBgUi: __props.opacityBgUi,
          defaultSearch: __props.defaultSearch
        })
      } : __props.navbar === "custom" && common_vendor.unref(navbarMode) === "normal" ? {
        e: common_vendor.p({
          data: __props.navbarStyle,
          showLeftButton: __props.showLeftButton
        })
      } : {}, {
        d: __props.navbar === "custom" && common_vendor.unref(navbarMode) === "normal",
        f: __props.navbar === "inner"
      }, __props.navbar === "inner" ? {
        g: common_vendor.p({
          title: __props.title
        })
      } : {}, {
        h: __props.navbar === "inner"
      }, __props.navbar === "inner" ? {
        i: common_vendor.s({
          paddingTop: common_vendor.unref(sheep_index.sheep).$platform.navbar + "px"
        })
      } : {}, {
        j: __props.navbar === "custom" && common_vendor.unref(navbarMode) === "inner"
      }, __props.navbar === "custom" && common_vendor.unref(navbarMode) === "inner" ? {
        k: common_vendor.p({
          data: __props.navbarStyle,
          showLeftButton: __props.showLeftButton
        })
      } : {}, {
        l: __props.tabbar !== ""
      }, __props.tabbar !== "" ? {
        m: common_vendor.p({
          path: __props.tabbar
        })
      } : {}, {
        n: common_vendor.s(common_vendor.unref(bgBody)),
        o: common_vendor.s(common_vendor.unref(bgMain)),
        p: common_vendor.p({
          shareInfo: common_vendor.unref(shareInfo)
        }),
        q: common_vendor.n("theme-" + common_vendor.unref(sys).mode),
        r: common_vendor.n("main-" + common_vendor.unref(sys).theme),
        s: common_vendor.n("font-" + common_vendor.unref(sys).fontSize)
      });
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-32d0115a"], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/components/s-layout/s-layout.vue"]]);
wx.createComponent(Component);
