"use strict";const e=require("../../../common/vendor.js"),r=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("../../api/member/signin.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");const t={__name:"su-fixed",props:{noNav:{type:Boolean,default:!1},bottom:{type:Boolean,default:!1},bg:{type:String,default:""},bgStyles:{type:Object,default(){}},val:{type:Number,default:0},width:{type:[String,Number],default:0},alway:{type:Boolean,default:!0},opacity:{type:Boolean,default:!1},index:{type:[Number,String],default:0},placeholder:{type:[Boolean],default:!1},sticky:{type:[Boolean],default:!1},noFixed:{type:Boolean,default:!1},ui:{type:String,default:""},clickTo:{type:Boolean,default:!1},isInset:{type:Boolean,default:!0}},setup(t){const{safeAreaInsets:o}=r.sheep.$platform.device,i=e.getCurrentInstance(),a=r.sheep.$helper.guid(),n=r.sheep.$platform.navbar,s=e.reactive({content:{},fixed:!0,scrollTop:0,opacityVal:0}),p=e.computed((()=>s.fixed&&l.bottom?l.isInset?l.val+"px":l.val+o.bottom+"px":"auto")),l=t;s.fixed=!e.unref(l.sticky),e.onPageScroll((e=>{let t=e.scrollTop;s.scrollTop=t,s.opacityVal=t>r.sheep.$platform.navbar?1:.01*t})),e.onMounted((()=>{e.nextTick$1((()=>{u()}))}));const u=()=>{e.index.createSelectorQuery().in(i).select(`#fixed-${a}`).boundingClientRect((r=>{null!=r&&(s.content=r,e.unref(l.sticky)&&d(s.scrollTop))})).exec()},d=t=>{e.unref(l.bottom)?s.fixed=t>=s.content.bottom-r.sheep.$platform.device.windowHeight+s.content.height+e.unref(l.val):s.fixed=t>=s.content.top-(e.unref(l.noNav)?e.unref(l.val):e.unref(l.val)+r.sheep.$platform.navbar)},c=()=>{l.hasToTop&&e.index.pageScrollTo({scrollTop:s.content.top,duration:100})};return(i,l)=>e.e({a:e.unref(o).bottom&&t.bottom&&t.isInset},e.unref(o).bottom&&t.bottom&&t.isInset?{b:e.s({height:e.unref(o).bottom+"px"})}:{},{c:e.o(c),d:e.s({zIndex:t.index+e.unref(r.sheep).$zIndex.navbar}),e:t.bottom},t.bottom?{f:e.n(t.bg)}:{},{g:e.n(t.ui),h:e.n(t.bg),i:e.s({zIndex:t.index+e.unref(r.sheep).$zIndex.navbar-1}),j:e.s(t.bgStyles),k:e.s(t.opacity?{opacity:s.opacityVal}:""),l:`fixed-${e.unref(a)}`,m:e.n({fixed:s.fixed}),n:e.s({left:t.sticky?"auto":"0px",top:s.fixed&&!t.bottom?(t.noNav?t.val:t.val+e.unref(n))+"px":"auto",bottom:p.value,zIndex:t.index+e.unref(r.sheep).$zIndex.navbar}),o:e.s(t.alway?"":{opacity:s.opacityVal}),p:(t.sticky||t.placeholder)&&s.fixed},(t.sticky||t.placeholder)&&s.fixed?{q:e.s({height:s.content.height+"px",width:t.width+"px"})}:{})}};wx.createComponent(t);
