import{a as z,b as E,o as M,m as i,g as c,p as e,q as _,u as t,D as n,K as P,P as N,I as V}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import{u as W,$ as q}from"./useSticky-C7NwOSxX.js";import{u as H}from"./sticky-nmdN8DLF.js";import{u as K}from"./translationsStore-DBJu9sBR.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_commonjsHelpers-Cpj98o6Y.js";const G={class:"sticky-calculator-banner--container ccb-desktop"},J={class:"sticky-calculator-banner--left"},O={key:0,class:"sticky-bar-icon is-image"},Q=["src"],R={key:1,class:"ccb-icon-Calculators-filled"},U={class:"sticky-bar-text"},X={class:"sticky-bar-text__title"},Y={key:0,class:"sticky-bar-text__description"},Z={class:"sticky-calculator-banner--right"},$={key:0,class:"sticky-bar-totals"},tt={class:"sticky-bar-action"},st=["textContent"],et={class:"sticky-calculator-banner--container ccb-mobile"},ot={class:"sticky-calculator-banner--top"},it={key:0,class:"sticky-bar-icon"},ct=["src"],nt={key:1,class:"ccb-icon-Calculators-filled"},at={class:"ccb-sticky-banner-content"},lt={class:"sticky-bar-text"},rt={class:"sticky-bar-text__title"},_t={key:0,class:"sticky-bar-text__description"},dt={key:0,class:"sticky-bar-totals"},ut={class:"sticky-calculator-banner--bottom"},kt={class:"sticky-bar-action"},gt=["textContent"],yt=z({__name:"FloatingBar",setup(mt){const s=H(),p=K(),{classList:d,clickAction:y,getFormattedTotal:S,getTitle:b,showTotal:h,updateFormulas:A,initListeners:B,scrollHandler:F,updateClassList:v,customBannerEvent:I}=W(),L=E(()=>{var a,l;let r=0;const o=q("#wpadminbar");return o!=null&&o.length&&((a=s.getStickySettings)==null?void 0:a.bannerPosition)==="top"&&window.innerWidth>600&&(r+=(o==null?void 0:o.height())||0),{[((l=s.getStickySettings)==null?void 0:l.bannerPosition)||""]:`${r}px`}});return M(()=>{var l,u,k,g;const r=((l=s.getStickySettings)==null?void 0:l.bannerPosition)||"",o=((u=s.getStickySettings)==null?void 0:u.oneClickAction)||"";d.value.includes(r)||v([...d.value,r]),d.value.includes("modal-action")||v([...d.value,"modal-action"]),["open_modal","pro_features","woo_product_as_modal"].includes(o)?I(!0):o==="scroll_to"&&F();let a=((k=s.getStickySettings)==null?void 0:k.formulas)||[];["woo_checkout","woo_product_as_modal","woo_product_with_redirect"].includes(o)&&(a=((g=s.getWooCheckoutSettings)==null?void 0:g.formulas)||[]),A(a),B()}),(r,o)=>{var a,l,u,k,g,f,x,C,T,w,D;return c(),i("div",{class:V(["sticky-calculator-banner",t(d)]),style:N(L.value)},[e("div",G,[e("div",J,[(a=t(s).getStickySettings)!=null&&a.hideIcon?_("",!0):(c(),i("div",O,[(l=t(s).getStickySettings)!=null&&l.icon?(c(),i("img",{key:0,src:t(s).getStickySettings.icon,alt:"icon svg"},null,8,Q)):(c(),i("i",R))])),e("div",U,[e("span",X,n(t(b)),1),(k=(u=t(s).getStickySettings)==null?void 0:u.customDesc.trim())!=null&&k.length?(c(),i("span",Y,n(t(s).getStickySettings.customDesc),1)):_("",!0)])]),e("div",Z,[t(h)?(c(),i("div",$,[e("span",null,n(t(p).getTranslations.total)+": "+n(t(S)),1)])):_("",!0),e("div",tt,[e("button",{onClick:o[0]||(o[0]=P((...m)=>t(y)&&t(y)(...m),["prevent"])),style:{height:"40px"},class:"calc-btn-action success",textContent:n((g=t(s).getStickySettings)==null?void 0:g.btnText)},null,8,st)])])]),e("div",et,[e("div",ot,[(f=t(s).getStickySettings)!=null&&f.hideIcon?_("",!0):(c(),i("div",it,[(x=t(s).getStickySettings)!=null&&x.icon?(c(),i("img",{key:0,src:t(s).getStickySettings.icon,alt:"icon svg"},null,8,ct)):(c(),i("i",nt))])),e("div",at,[e("div",lt,[e("span",rt,n(t(b)),1),(w=(T=(C=t(s).getStickySettings)==null?void 0:C.customDesc)==null?void 0:T.trim())!=null&&w.length?(c(),i("span",_t,n(t(s).getStickySettings.customDesc),1)):_("",!0)]),t(h)?(c(),i("div",dt,[e("span",null,n(t(p).getTranslations.total)+": "+n(t(S)),1)])):_("",!0)])]),e("div",ut,[e("div",kt,[e("button",{onClick:o[1]||(o[1]=P((...m)=>t(y)&&t(y)(...m),["prevent"])),style:{height:"40px"},class:"calc-btn-action success",textContent:n((D=t(s).getStickySettings)==null?void 0:D.btnText)},null,8,gt)])])])],6)}}}),xt=j(yt,[["__scopeId","data-v-f4fa4b27"]]);export{xt as default};
//# sourceMappingURL=index-BTO6WLBP.js.map
