import{a as V,b as q,o as E,m as p,g,q as z,p as f,u as e,D as S,K as H,P as K,I as Q}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import{u as Y,$ as t}from"./useSticky-C7NwOSxX.js";import{u as j}from"./sticky-nmdN8DLF.js";import{u as G}from"./translationsStore-DBJu9sBR.js";import{_ as J}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_commonjsHelpers-Cpj98o6Y.js";const O={key:0,class:"sticky-calculator-btn--icon is-image"},R=["src"],U={key:1,class:"ccb-icon-Calculators-filled"},X={class:"sticky-calculator-btn--text"},Z={class:"sticky-calculator-btn--text__title"},tt={key:0,class:"sticky-calculator-btn--text__description"},ot=V({__name:"FloatingCart",setup(st){const{classList:I,clickAction:b,getFormattedTotal:T,getShortTitle:F,showTotal:L,updateFormulas:B,initListeners:D}=Y(),s=j(),M=G(),N=q(()=>{var v,w,C,x,A,$,P,W;const l=((v=s.getStickySettings)==null?void 0:v.btnPosition.split("_"))||[],o=l[0]||"",c=l[1]||"";let n=window.innerWidth>1280?40:20;((w=t(`.ccb-calc-id-${s.getCalcId}`))==null?void 0:w.prevAll()).each(function(){var i,u;const a=t(this)[0];if(t(a).data("position")===((i=s.getStickySettings)==null?void 0:i.btnPosition)){const y=((u=t(a).find(".sticky-calculator-btn"))==null?void 0:u.outerWidth())||0;n+=y>0?y+20:y}});let d=window.innerWidth>1280?40:20;const h=".sticky-calculator-banner";if(((C=t(h))==null?void 0:C.length)>0&&!t(h).hasClass("ccb-hide-button")&&(((A=(x=t(h))==null?void 0:x.attr("class"))==null?void 0:A.split(/\s+/))||[]).includes(o)&&!(($=t(h))!=null&&$.hasClass("ccb-hide-button"))){d=20;let k=t(".sticky-calculator-banner").height()||0,i=window.innerWidth>600?0:20;d=d+k+i}const _=t("#wpadminbar");_.length&&o==="top"&&(d+=((_==null?void 0:_.height())||0)-10);const m={[o]:`${d}px`,[c]:`${n}px`};if(c==="center"){let a=0;((W=(P=t(`.ccb-calc-id-${s.getCalcId}`))==null?void 0:P.prevAll())==null?void 0:W.filter(function(){var i;return t(this).data("position")===((i=s.getStickySettings)==null?void 0:i.btnPosition)})).each(function(){var i,u;a=(((u=(i=t(this))==null?void 0:i.find(".sticky-calculator-btn"))==null?void 0:u.outerWidth())||0)+20||0}),m.left=`calc(40% + ${a}px)`}return o==="center"&&(m.top="50%",m.transform="translateY(-50%)"),m});return E(()=>{var c,n,r;const l=((c=s.getStickySettings)==null?void 0:c.oneClickAction)||"";let o=((n=s.getStickySettings)==null?void 0:n.formulas)||[];["woo_checkout","woo_product_as_modal","woo_product_with_redirect"].includes(l)&&(o=((r=s.getWooCheckoutSettings)==null?void 0:r.formulas)||[]),B(o),D()}),(l,o)=>{var c,n;return g(),p("div",{class:Q(["sticky-calculator-btn",e(I)]),style:K(N.value),onClick:o[0]||(o[0]=H((...r)=>e(b)&&e(b)(...r),["prevent"]))},[(c=e(s).getStickySettings)!=null&&c.hideIcon?z("",!0):(g(),p("div",O,[(n=e(s).getStickySettings)!=null&&n.icon?(g(),p("img",{key:0,src:e(s).getStickySettings.icon,alt:"icon svg"},null,8,R)):(g(),p("i",U))])),f("div",X,[f("span",Z,S(e(F)),1),e(L)?(g(),p("span",tt,S(e(M).getTranslations.total)+": "+S(e(T)),1)):z("",!0)]),o[1]||(o[1]=f("div",{class:"ccb-icon-arrow"},[f("i",{class:"ccb-icon-Down"})],-1))],6)}}}),rt=J(ot,[["__scopeId","data-v-9914a85c"]]);export{rt as default};
//# sourceMappingURL=index-B_seOW1V.js.map
