1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1587],{12444:(t,e,r)=>{r.d(e,{O:()=>o,q:()=>u});var a=r(45658),i=r(17307),n=r(19426);let u=()=>(0,a.j)({queryKey:["getClientCartProducts"],queryFn:()=>(0,n.M2)(i.Sn.client.cartProduct.getClientCartProducts.$get())}),o=()=>(0,a.j)({queryKey:["getClientCartProductsSummary"],queryFn:()=>(0,n.M2)(i.Sn.client.cartProduct.getClientCartProductsSummary.$get())})},17307:(t,e,r)=>{r.d(e,{Sn:()=>c});var a=r(89842),i=r(38151),n=r(11494),u=r(19426);let o=(0,a.hc)((0,u.$_)(),{fetch:async(t,e)=>{let r=null==e?void 0:e.headers,{headers:a,...u}=null!=e?e:{},o=await fetch(t,{...u,headers:r,cache:"no-store"});if(!o.ok){let t=await o.json();throw new i.y(o.status,{message:t.message||t.error||o.statusText,res:o})}let l=o.headers.get("Content-Type");return o.headers.get("Content-Encoding"),o.json=async()=>{let t=await o.text();if("application/superjson"===l)return n.Ay.parse(t);try{return JSON.parse(t)}catch(t){throw Error("Invalid JSON response")}},o}}).api;function l(t){for(var e=arguments.length,r=Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];let i=t;for(let t of r)i=i[t];return i}function s(t){return"object"!=typeof t||null===t?t:Object.fromEntries(Object.entries(t).map(t=>{let[e,r]=t;return[e,n.Ay.stringify(r)]}))}let c=function t(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Proxy(e,{get(e,a,i){if("string"==typeof a){let i=[...r,a];return"$get"===a?async function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return l(o,...i)({query:s(e[0])})}:"$post"===a?async function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return l(o,...i)({json:s(e[0])})}:t(e[a],i)}return Reflect.get(e,a,i)}})}(o);(0,a.hc)((0,u.$_)())},19426:(t,e,r)=>{r.d(e,{$_:()=>a.$_,Lp:()=>a.Lp,M2:()=>a.M2,VG:()=>a.VG});var a=r(74619)},24710:(t,e,r)=>{r.d(e,{Ic:()=>l,rr:()=>i,t5:()=>o,ru:()=>u,Aw:()=>n});var a=r(89521);let i=t=>{var e,r,i,n;let u=t.type===a.Vo.QUOTATION_ONLY,o=["hasTagNew","hasTagEcolabel","hasCertibiocideDisinfectantCertificate","hasCertibiocideNuisibleCertificate","isCommercialStopped"],l=Object.entries(t).filter(t=>{let[e,r]=t;return e.startsWith("is")&&"boolean"==typeof r&&!0===r&&!o.includes(e)}),s=t.hasTagHazardousProduct||t.isReservedForProfessionals,c=t.hasCertibiocideDisinfectantCertificate||t.hasCertibiocideNuisibleCertificate,d=t.hasCertibiocideDisinfectantCertificate,p=t.hasCertibiocideNuisibleCertificate,m=t.hasExplosivePrecursorCertificate,y=!c&&!t.isExcludedFromLoyalty,T=!t.hasTagHazardousProduct,h="productGroup"in t?null==(e=t.productGroup)?void 0:e.products.map(t=>({id:t.id,label:t.label,slug:t.slug,reference:t.reference})):void 0,x=t.availabilityDelay&&t.availabilityDelay>0?24*t.availabilityDelay:void 0,v=(null==(r=t.orderProducts)?void 0:r.reduce((t,e)=>t+e.orderShipmentProducts.reduce((t,e)=>{var r;let i=e.orderShipment.status===a.HR.TO_PROCESS||e.orderShipment.status===a.HR.TO_PREPARE,n=(null==(r=e.orderShipment.order)?void 0:r.status)!==a.Ey;return i&&n?t+e.quantity:t},0),0))||0,g=null!=(i=t.quantity)?i:0,f=null!=(n=t.externalQuantity)?n:0,C=!!t.isCommercialStopped,P=!!x,b=g+f-v;return{availabilityDelay:x,isLocalOutOfStockWithExtern:g<1&&f>0,isOutOfStock:C||b<1&&!P,isQuotationOnly:u,isProOnly:s,isCertibiocide:c,isCertibiocideDisinfectant:d,isCertibiocideNuisible:p,isExplosivePrecursor:m,quantityOptions:Array.from({length:C?0:P?50:Math.min(50,b)},(t,e)=>({id:String(e+1),name:String(e+1)})),specifications:l,productGroup:h,isProductEligibleForLoyaltyPoints:y,isProductEligibleForFreeShipping:T,isLocalOutOfStock:g<1,isExternalOutOfStock:f<1,orderQuantities:v,totalQuantity:b,localQuantity:g,externalQuantity:f,continueShippingOnOutOfStock:P,isCommercialStopped:C}},n=t=>{let{selectedQuantity:e,productComputed:r}=t;return!!r.continueShippingOnOutOfStock&&e>r.totalQuantity},u=t=>{let{selectedQuantity:e,productComputed:r}=t;return e>r.localQuantity&&e<=r.totalQuantity},o=t=>t.reduce((t,e)=>t+e.quantity*(Number(e.product.weight)||0),0),l=(t,e)=>t.every(t=>t.computed.isProductEligibleForFreeShipping)&&e<28},62950:(t,e,r)=>{r.d(e,{BT:()=>a,Gk:()=>l,KU:()=>o,Lj:()=>i,P9:()=>n,S3:()=>u}),r(74619);let a=t=>t?Math.ceil(t/100):0,i=t=>100*Math.ceil(t/100),n=(t,e)=>t?Math.round(t*(null!=e?e:20)/100):0,u=t=>
1(t/100).toLocaleString("fr-FR",{style:"currency",currency:"EUR"}),o=t=>Math.floor(t/100),l=t=>{let e=t.split("-"),r=e[0],a=e[1],i=/^\d{3}$/.test(a);return{productRef:i?"".concat(r,"-").concat(a):r,productSlug:i?e.slice(2).join("-"):e.slice(1).join("-")}}},73662:(t,e,r)=>{r.d(e,{G:()=>o,u:()=>u});var a=r(45658),i=r(17307),n=r(19426);let u=t=>(0,a.j)({queryKey:["generateCartDataFromOrder",t],queryFn:()=>(0,n.M2)(i.Sn.order.generateCartDataFromOrder.$get(t))}),o=t=>(0,a.j)({queryKey:["getOrders",t],queryFn:()=>(0,n.M2)(i.Sn.order.getOrders.$get(t))})},74619:(t,e,r)=>{r.d(e,{$_:()=>i,Lp:()=>o,M2:()=>n,VG:()=>u});var a=r(91404);function i(){return a._K.NEXT_PUBLIC_WEBSITE_URL}async function n(t){let e=await t;if(!e.ok){var r,a;let t=await e.json();throw Error(null!=(a=null!=(r=t.message)?r:t.error)?a:"HTTP error! status: ".concat(e.status))}let i=await e.json();if(i&&"object"==typeof i&&"success"in i&&!i.success){if("message"in i&&"string"==typeof i.message)throw Error(i.message);throw Error("Operation failed")}return i}let u=t=>t?"pdf"===t.split(".").pop()?"".concat(a._K.NEXT_PUBLIC_WEBSITE_URL,"/api/pdf?key=").concat(t.replace(".pdf","")):"".concat(a._K.NEXT_PUBLIC_WEBSITE_URL,"/media/images/").concat(encodeURIComponent(t)):"/images/empty-image.png",o=t=>{for(let e of(t.use={},Object.keys(t.getState())))t.use[e]=()=>t(t=>t[e]);return t}},75354:(t,e,r)=>{r.d(e,{DU:()=>i,ZY:()=>a});let a=t=>{let e=0;t.isTaxExempt||(e="taxPourcent"in t?t.taxPourcent:((t,e)=>t>0&&null!=e?Math.round(e/t*1e4)/100:0)(t.price,t.taxAmount));let r=t.isTaxExempt?0:"taxPourcent"in t?t.useTaxInclusiveUnitPrice?Math.round(t.price*(e/100)):t.price*(e/100):t.taxAmount,a=t.price+r,i=t.price*t.quantity,n=a*t.quantity;return{taxPourcent:e,priceWithTax:a,subtotal:i,totalTax:n-i,total:n}},i=t=>{var e,r,i,n;let u=t.lines||[],o=!!t.isTaxExempt,l=t.vatRates||{standard:20,intermediate:10,reduced:5.5,private:0},s={standard:0,intermediate:0,reduced:0,private:0},c=u.reduce((t,e)=>t+(e.price||0)*(e.quantity||0),0),d=Math.max(0,t.preTaxPercentageDiscount||0),p=Math.max(0,t.preTaxFixedDiscount||0),m=Math.round(d/100*c),y=Math.min(c,p+m),T=u.reduce((t,e)=>{var r;let a=e.vatType||"standard",i=e.taxPourcent;return Math.max(t,null!=i?i:null!=(r=l[a])?r:0)},0),h=o?0:T,x=(null==(e=Object.entries(l).find(t=>{let[e,r]=t;return r===T}))?void 0:e[0])||"standard",v=u.map(e=>{var r;let i=e.quantity||0,n=e.price||0,u=n*i,s=e.vatType||"standard",c=o?0:void 0!==e.taxPourcent&&null!==e.taxPourcent?e.taxPourcent:null!=(r=l[s])?r:0,d=a({price:n,quantity:i,taxPourcent:c,isTaxExempt:o,useTaxInclusiveUnitPrice:t.useTaxInclusiveUnitPrice});return{lineHT:u,lineTTC:d.total,vatType:s,rate:c,unitTTC:d.priceWithTax}}),g=o?-y:-Math.round(y*(1+h/100)),f=t.shippingPrice||0,C=o?0:null!=(r=t.shippingVatRate)?r:h,P=Math.round(f*(1+C/100)),b=new Set(v.map(t=>t.rate>0?t.vatType:null).filter(t=>!!t)),E=new Set(v.map(t=>t.vatType)),S=(()=>{if(1===b.size)return Array.from(b)[0];if(0===b.size&&E.size>=1)return 1===E.size?Array.from(E)[0]:x;let t=null;for(let[e,r]of Object.entries(l)){let a=Math.abs((C||0)-(r||0));(null===t||a<t.diff)&&(t={type:e,diff:a})}return t?t.type:x})(),M=v.reduce((t,e)=>t+e.lineTTC,0),O=Math.max(0,t.postTaxDiscountAmount||0),R=M+g+P-O,q=Math.max(0,c-y),A=q+f,D=Math.max(0,R-A),j=v.reduce((t,e)=>(t[e.vatType]+=e.lineHT,t),{...s});j[x]-=y,j[S]+=f;let _={...s};v.forEach(t=>{let e=t.lineTTC-t.lineHT;_[t.vatType]+=e}),_[x]+=g+y;let w=P-f;if(_[S]+=w,!o&&O>0){let e=Math.max(0,null!=(i=t.postTaxDiscountVatRate)?i:h),r=null;for(let[t,a]of Object.entries(l)){let i=Math.abs((e||0)-(a||0));(null===r||i<r.diff)&&(r={type:t,diff:i})}let a=r?r.type:x,n=Math.round(O/(1+e/100));j[a]=Math.max(0,(j[a]||0)-n),_[a]-=O-n}return{productsSubtotal:c,preTaxDiscountAmount:y,discountedProductsSubtotal:q,productsTaxAmount:v.reduce((t,e)=>t+(e.lineTTC-e.lineHT),0),shippingTaxAmount:w,subtotal:A,taxAmount:D,total:R,postTaxDiscountAmount:O,postTaxDiscountVatRate:null!=(n=t.postTaxDiscountVatRate)?n:h,taxAmountByTaxType:_,discountedSubtotalByTaxType:j}}},76633:(t,e,r)=>{r.r(e),r.d(e,{SharedImage:()=>u});var a=r(80981),i=r(79505),n=r(46389);let u=(0,i.memo)(t=>{let{src:e,className:r,videoProps:i,...u}=t;return(null==e?void 0:e.toLowerCase().endsWith(".mp4"))&&e?(0,a.jsx)("video",{className:r,controls:!0,src:e,...i,onError:t=>{let e=t.target;e.src.includes("/images/empty-image.png")||(e.src="/images/empty-image.png")}}):(0,a.jsx)(n.default,{...u,className:r,src:e||"/images/empty-image.png",onError:t=>{let e=t.target;e.src.includes("/images/empty-image.png")||(e.src="/images/empty-image.png")}})});u.displayName="SharedImage"},93707:(t,e,r)=>{r.d(e,{H5:()=>f,t4:()=>C,P$:()=>g});var a=r(84775),i=r(89521),n=r(90597),u=r(11622),o=r(73680),l=r(12444),s=r(73662),c=r(45658),d=r(17307),p=r(19426),m=r(99982),y=r(24710),T=r(75354),h=r(62950);let x={promoCode:null,loyaltyCheck:null,carrier:null,paymentMethod:"credit_card",deliveryAddress:null,billingAddress:null,purchaseOrderNumber:null,purchaseOrderDate:null,purchaseOrderFile:null,selectedServicePoint:null},v=(0,o.v)((t,e)=>({...x,setValue:(e,r)=>{t(t=>({...t,[e]:r}))},reset:()=>{t(x)}})),g=(0,p.Lp)(v),f=()=>{v.getState().reset()},C=()=>{let{user:t}=(0,a.wV)(),{setValue:e,reset:r,...x}=(0,o.P)(v),{order_number:g}=(0,u.useParams)(),f=!!g,{data:C}=(0,n.useQuery)({...(t=>(0,c.j)({queryKey:["getVatRatesByCountry",t],queryFn:()=>(0,p.M2)(d.Sn.vatRate.getVatRatesByCountry.$get(t))}))({countryId:i.jO}),enabled:!!t}),{data:P}=(0,n.useQuery)((0,l.q)()),{data:b}=(0,n.useQuery)({...(0,s.u)({orderNumber:parseInt(g)}),enabled:f}),E=(f?null==b?void 0:b.computed:null==P?void 0:P.computed)||{hasFreeShipping:!1,subtotal:0,totalTax:0,total:0,taxTypes:[]},S=f?(null==b?void 0:b.products.map(t=>({...t,taxType:t.product?t.product.taxType:t.taxType,price:(t.product?t.product.price:t.price)||0})))||[]:(null==P?void 0:P.availableProducts.map(t=>{var e;return{...t,taxType:null==(e=t.product)?void 0:e.taxType,price:t.product.price||0}}))||[],M=(t=>{var e,r,a;let n=t.defaultTaxRates;(null==(e=t.carrier)?void 0:e.id)!==i.GS&&(n=(null==(r=t.deliveryAddress)?void 0:r.country.vatRates.reduce((t,e)=>(t[e.type]=e.rate,t),{}))||t.defaultTaxRates);let u=e=>{let r=(0,T.DU)({lines:e.map(t=>({price:t.computed.priceWithoutTax||0,quantity:t.quantity,vatType:t.taxType})),isTaxExempt:t.isTaxExempt,useTaxInclusiveUnitPrice:!0,vatRates:n,shippingPrice:0,shippingVatRate:0,preTaxFixedDiscount:0,preTaxPercentageDiscount:0,postTaxDiscountAmount:0});return r.discountedProductsSubtotal+r.productsTaxAmount},o=(a=t.products,(0,T.DU)({lines:a.map(t=>({price:t.computed.priceWithoutTax||0,quantity:t.quantity,vatType:t.taxType})),isTaxExempt:t.isTaxExempt,useTaxInclusiveUnitPrice:!0,vatRates:n,shippingPrice:0,shippingVatRate:0,preTaxFixedDiscount:0,preTaxPercentageDiscount:0,postTaxDiscountAmount:0}).productsTaxAmount),l=u(t.products),s=t.products.reduce((t,e)=>{var r,a;let i=e.price||0,n=null!=(a=null==(r=e.product)?void 0:r.discount)?a:0;return t+e.quantity*(i*(1-n/100))},0)||0,c=()=>Math.max(...t.vatRateTypes.map(t=>{var e;return null!=(e=n[t])?e:20})),d=()=>{var e;return(null==(e=t.promoCode)?void 0:e.amount)?t.promoCode.amount:0},p=t.products.some(t=>t.product.isReservedForProfessionals),x=t.products.some(t=>{var e;return!!(null==(e=t.product)?void 0:e.hasTagHazardousProduct)}),v=t.products.reduce((t,e)=>{var r;return t+Number(null!=(r=e.product.weight)?r:1)*e.quantity},0),g=(0,y.t5)(t.products),f=(0,y.Ic)(t.products,g),C=!t.deliveryAddress||"FR"===(0,m.X2)(t.deliveryAddress.country.iso2,t.deliveryAddress.postalCode),P=(()=>{var e,r,a,n;if(!t.carrier)return!0;let u=(null==(e=t.carrier)?void 0:e.name)===i.Mf["TNT Livraison 24-48 heures"].name;return g>13?u:(null==(r=t.carrier)?void 0:r.name)===i.Mf["Colissimo - Point relais"].name||u||(null==(a=t.carrier)?void 0:a.name)===i.Mf["Chronopost "].name||(null==(n=t.carrier)?void 0:n.name)===i.Mf["Colissimo - \xc0 domicile"].name})(),b=l>=m.Gh&&f&&C,E=b&&P,S=()=>E?0:t.carrier?Math.ceil(t.carrier.price):x?m.ne:m.vP,M=()=>{let e=u(t.products);return(!E&&(e+=S(),t.isTaxExempt||(e+=(0,h.P9)(S(),c()))),t.loyaltyCheck&&(e-=t.loyaltyCheck.amount),t.promoCode&&(e-=d()),Number.isFinite(e))?Math.round(e):0},O=t.products.some(t=>{var e;
1return(0,y.Aw)({productComputed:t.computed,selectedQuantity:t.quantity})&&!!(null==(e=t.product)?void 0:e.availabilityDelay)});return{isCartEmpty:0===t.products.length,productsTotalWithoutTax:t.initialSubtotal,productsTotalWithoutTaxAfterDiscount:Math.round(s),productsTotal:l,getTaxRate:c,getTotalTax:()=>t.isTaxExempt?0:o+(E?0:(0,h.P9)(S(),c())),getDisplayedTax:()=>{var e;if(t.isTaxExempt)return 0;let r=M();return r+=((null==(e=t.loyaltyCheck)?void 0:e.amount)||0)+d(),E||(r-=S()),Math.max(0,r-=t.initialSubtotal)},getTotalAfterDiscounts:M,getPromoCodeAppliedAmount:d,getShippingCost:S,getLoyaltyPointsEarned:()=>{var e;let r=Math.max(0,(t.products.filter(t=>t.computed.isProductEligibleForLoyaltyPoints).reduce((e,r)=>e+(t.isTaxExempt?r.computed.priceWithoutTax:r.computed.priceWithTax)*r.quantity,0)||0)-(d()+((null==(e=t.loyaltyCheck)?void 0:e.amount)||0)));return(0,h.KU)(r)},taxRates:n,cartContainsProfessionalProducts:p,hasSomeProductsHazardous:x,packageWeight:v,hasFreeShipping:b,hasFreeShippingWithCarrier:E,hasSomeProductsNotAvailableImmediately:O}})({...x,...E,defaultTaxRates:(null==C?void 0:C.vatRates)||{},vatRateTypes:E.taxTypes,initialTotalTax:E.totalTax,initialTotal:E.total,initialSubtotal:E.subtotal,products:S,isTaxExempt:!!(null==t?void 0:t.isTaxExempt)});return{...x,utils:{products:S,setValue:e,reset:r,...M}}}}}]);
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.