1import{ad as S,a as h,C as I,$ as _,c as u}from"./B30BqIw0.js";const p=()=>{const{sessionContext:f}=h(),{locale:m}=I(),{cart:T,cartItems:d}=_(),l=u(()=>{const e=m.value==="en-UK",a=!!f.value?.salesChannel?.translated?.customFields?.custom_is_tax_combine_condition;return e&&a}),i=e=>{if(!e)return 0;const a=[e?.calculatedPrice?.calculatedTaxes,e?.calculatedPrices?.[0]?.calculatedTaxes,e?.price?.calculatedTaxes];for(const t of a){if(!t?.length)continue;const s=t.reduce((c,n)=>c+(Number(n.tax)||0),0);if(s!==0)return s}if(l.value){const t=Number(e?.customFields?.cbaxStatistics?.tax);if(!isNaN(t)&&t>0)return t;const s=[e?.calculatedPrice,e?.calculatedPrices?.[0],e?.priceDefinition];for(const r of s)if(r?.taxRules?.length&&(r.unitPrice||r.totalPrice)){const b=Number(r.taxRules[0].taxRate),o=Number(r.unitPrice||r.totalPrice);if(b>0&&o>0)return o-o/(1+b/100)}const c=Number(e?.tax?.taxRate),n=e?.calculatedPrice?.unitPrice||e?.price?.[0]?.net||0;if(c>0&&n>0)return n*c/100}return 0},g=(e,a)=>{const t=Number(e)||0;if(!t)return 0;const s=Number(a?.price?.calculatedTaxes[0]?.taxRate)||0;return s>0?t*s/100:0},C=e=>e?.deliveries?.reduce((a,t)=>{const s=t?.shippingCosts?.calculatedTaxes?.reduce((c,n)=>c+(Number(n.tax)||0),0)||0;return a+s},0)||0,x=e=>(e||[]).reduce((a,t)=>a+i(t),0),N=e=>{if(!e)return 0;const a=[e?.calculatedPrice?.taxRules,e?.calculatedPrices?.[0]?.taxRules,e?.priceDefinition?.taxRules];for(const s of a){const c=Number(s?.[0]?.taxRate);if(c>0)return c}const t=Number(e?.tax?.taxRate);return t>0?t:0},R=(e,a,t=!1)=>{if(!e||!l.value)return e;if(t){const c=N(a),n=c>0?e*c/100:i(a);return e+n}const s=i(a);return e+s},P=u(()=>T.value?.price?.calculatedTaxes?.reduce((e,a)=>e+(Number(a.tax)||0),0)||0),v=u(()=>x(d.value));return{isUKTaxCombined:l,calculatedCartTax:P,calculatedSubtotalTax:v,getProductTax:i,getListPriceTax:g,getSubtotalTax:x,getShippingTax:C,getTaxInclusivePrice:R}},K=S(p);export{K as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.