1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[57],{45512:(e,t,n)=>{n.r(t),n.d(t,{default:()=>T});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(70358),o=n(97254),d=n(45107),c=n(10170),u=n(18913),m=n(94708),p=n(31130),h=n(72413),g=n(24271),x=n(59446),f=n(95397),v=n(26691),j=n(78913),b=n(59468),k=n(75052),L=n(84947),S=n(6887),C=n(1209),A=n(59859),y=n(70663),N=n(15166),_=n(21010);const I=e=>{let{modifiedDate:t,pendingChanges:n}=e;const s=(0,N.useCultureName)();return(0,_.jsxs)("p",{children:[(0,_.jsx)(u.sD,{textKey:"BasketExpired_Message",formatWith:[(0,N.toLocaleTime)(t,s)]}),n?(0,_.jsxs)(_.Fragment,{children:[' ',(0,_.jsx)(u.sD,{textKey:"BasketExpired_Pending"})]}):null]})};var D=n(68412);const P=()=>{const{modifiedDate:e,modelExpired:t}=(0,r.useSelector)((e=>({modifiedDate:e.basket.modifiedDate,modelExpired:e.basket.modelExpired})),r.shallowEqual),n=(0,r.useDispatch)(),{hasPendingChanges:s}=(0,b.x)(),{showConfirmation:i,clearConfirmation:o,confirmationModal:c}=(0,y.A)(),u=(0,D.$B)(e);return(0,a.useEffect)((()=>{if(!t)return;return i((()=>{n((0,d.l6)()),s&&u()}),{title:'PageExpired'},(0,_.jsx)(I,{modifiedDate:e,pendingChanges:s}),{okText:'ButtonText_Refresh'},void 0,l().expirationMsgPopup),o}),[t&&e]),c},w=(0,s.withStyles)(l())((0,a.memo)(P)),T=(0,s.withStyles)(l())((e=>{let{desktop:t,mobile:n}=e;return function(){const e=(0,r.useSelector)((e=>e.page.validate));(0,a.useEffect)((()=>{e&&(0,f.Z)()}),[])}(),function(){const{navigatingToBasket:e,updatedById:t,model:n,modifiedDate:s,customer:i}=(0,r.useSelector)((e=>{var t;return{navigatingToBasket:(null==(t=e.routing.navigatingTo)||null==(t=t.routeData)?void 0:t.routeName)===c.xW.BasketPage,updatedById:e.basket.updated.updaterId,model:e.basket.model,modifiedDate:e.basket.modifiedDate,customer:e.user.customer}}),r.shallowEqual),{addToast:l,removeToast:m,updateToast:p}=(0,o.Yf)(),g=function(){const{texts:e}=(0,u.KR)(B);return(0,a.useMemo)((()=>{const[t,n]=e;return{recalculationSuccessMsg:t,clearSuccessMsg:n}}),e)}(),x=(0,a.useRef)({});(0,h.WL)((()=>{x.current.pageReloaded=!0})),(0,a.useEffect)((()=>{x.current.date=void 0}),[i]),(0,a.useEffect)((()=>{e||(x.current.id&&m(x.current.id),x.current.prevUpdater=x.current.updater,x.current.updater=t)}),[t]);const f=(0,a.useCallback)((()=>{x.current.id=null}),[]);(0,a.useEffect)((()=>{if(e||!n)return;let i=t;t||(i=x.current.prevUpdater,x.current.prevUpdater=null,x.current.pageReloaded&&null===t&&(x.current.pageReloaded=!1,i=d.Xm.Basket)),'isAvailable'in n&&n.isAvailable&&void 0===x.current.date&&null!=s&&(x.current.date=s);const a=(0,d.dR)(n);if(i!==d.Xm.Basket||!s||a)return;if(x.current.date===s)return;x.current.date=s,x.current.id&&m(x.current.id),x.current.id='recalc'+s;const{content:r,...o}=M(x.current.id,n,g,f);l(r,o)}),[n]),(0,a.useEffect)((()=>{if(!n||!x.current.id||null===g.clearSuccessMsg||null===g.recalculationSuccessMsg)return;const e=M(x.current.id,n,g,f);p(x.current.id,e)}),[g]),(0,a.useEffect)((()=>()=>{x.current.id&&m(x.current.id)}),[])}(),(0,_.jsx)(j.V,{children:(0,_.jsx)(v.j,{children:(0,_.jsx)(k.HS,{children:(0,_.jsx)(L.t,{children:(0,_.jsx)(S.WQ,{children:(0,_.jsx)(C.U,{children:(0,_.jsx)(b._,{children:(0,_.jsx)(x.ad,{children:(0,_.jsxs)(A.O,{children:[(0,_.jsx)(m.$U,{lessThan:"md",children:(0,p.U)(n??g.mobile.value)}),(0,_.jsx)(m.$U,{greaterThanOrEqual:"md",children:(0,p.U)(t??g.desktop.value)}),(0,_.jsx)(w,{})]})})})})})})})})})}));const B=['TheBasketIsRecalculated','TheBasketIsCleared'];function M(e,t,n,s){const i='cleared'in t&&t.cleared||t.productLines&&!t.productLines.totalCount;return{content:i?n.clearSuccessMsg:n.recalculationSuccessMsg,appearance:'success',id:e,className:i?l().clearedMsg:l().recalculatedMsg,onDismiss:s}}B.disableInsiteEditor=!0},75052:(e,t,n)=>{n.d(t,{HS:()=>u,A4:()=>g,Ag:()=>h});var s=n(25498),i=n(70358),l=n(11749),a=n(45107),r=n(90794),o=n(39706),d=n(42346),c=n(21010);const u=e=>{let{children:t}=e;const n=(0,i.useSelector)((e=>e.settings.basket.checkoutItemLineComments.packageId)),[s]=(0,o.wW)(d.Ul.UseCheckoutItemLineComments);return s?(0,c.jsx)(r.rt,{packageId:n,children:(0,c.jsx)(m,{packageId:n,children:t})}):t},m=e=>{let{children:t,packageId:n,addonCheckoutItemLineComment:r}=e;
1const[o,d]=(0,s.useState)([]),[u,m]=(0,s.useState)(!1),h=(0,s.useRef)({invalidCommentLinesIds:o,hasPendingComments:u}),g=(0,s.useCallback)((e=>{h.current.hasPendingComments=e,m(e)}),[]),x=(0,s.useCallback)((e=>{h.current.invalidCommentLinesIds=e,d(e)}),[]),{productLinesList:f,pageIndex:v,modifiedDate:j,updaterId:b}=(0,i.useSelector)((e=>{var t;return{productLinesList:null==(t=e.basket.model)?void 0:t.productLines.list,pageIndex:e.basket.model&&'page'in e.basket.model?e.basket.model.page.index:null,modifiedDate:e.basket.modifiedDate,updaterId:e.basket.updated.updaterId}}),i.shallowEqual);(0,s.useEffect)((()=>{if(b!==a.Xm.BasketLineComment)return;const e=p(f);g(e)}),[j]),(0,s.useEffect)((()=>{if(!u)return;const e=p(f);g(e)}),[f]),(0,s.useEffect)((()=>{if(!f)return;const e=[];for(const t of f)if('subLines'in t&&t.subLines)for(const n of t.subLines)'commentValidationResult'in n&&n.commentValidationResult&&!n.commentValidationResult.isValid&&e.push(n.id);else'commentValidationResult'in t&&t.commentValidationResult&&!t.commentValidationResult.isValid&&e.push(t.id);x(e)}),[v]);const k=(0,s.useMemo)((()=>({setCommentState(e,t){d((n=>{let s;return s=t?n.filter((t=>t!==e)):n.includes(e)?n:[...n,e],h.current.invalidCommentLinesIds=s,s}))},hasInvalidCommentLines:()=>!!h.current.invalidCommentLinesIds.length,clearInvalidCommentLines(){x([])},hasLinesWithPendingComments:()=>h.current.hasPendingComments})),[]),L=(0,s.useMemo)((()=>({invalidCommentLinesIds:o,hasPendingComments:u,packageId:n,addonCheckoutItemLineComment:r,...k})),[o,u,n,r]);return(0,c.jsx)(l.V.Provider,{value:L,children:t})};function p(e){return!!e&&e.some((e=>!(!('requiresBasketRecalculation'in e)||!e.requiresBasketRecalculation)||'subLines'in e&&null!=e.subLines&&e.subLines.some((e=>e.requiresBasketRecalculation))))}const h=e=>{const{invalidCommentLinesIds:t}=(0,s.useContext)(l.V);return!t.includes(e)},g=()=>(0,s.useContext)(l.V)},26691:(e,t,n)=>{n.d(t,{j:()=>d,s:()=>l});var s=n(25498),i=n(40737);const l=()=>(0,s.useContext)(i.R);var a=n(86590),r=n(68412),o=n(21010);const d=e=>{let{children:t}=e;const[n,l]=(0,s.useState)(!1),d=(0,r.vJ)(),c=(0,s.useRef)(),u=(0,s.useRef)({formIsDirty:n});u.current.templateFields=d;const m=(0,s.useCallback)((e=>{u.current.formIsDirty=e,l(e)}),[]),p=(0,s.useMemo)((()=>{const e=u.current;return{setFormIsDirty(e){m(e)},validateForm:async e=>await(0,a.l)(c,e),getFormFields(){const t=e.templateFields;return t&&c.current?(0,a.wz)(c.current.values,t):null},formHasChanges:()=>e.formIsDirty}}),[]),h=(0,s.useMemo)((()=>({formIsDirty:n,templateFields:d,basketFieldsFormRef:c,...p})),[n,d]);return(0,o.jsx)(i.R.Provider,{value:h,children:t})}},33205:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var s=n(12922),i=n(32525),l=n.n(i),a=n(44892),r=n.n(a),o=n(70358),d=n(17005),c=n(3516),u=n(18913),m=n(59446),p=n(59468),h=n(72740),g=n(3392),x=n(76809),f=n(39706),v=n(24147),j=n(45107),b=n(34814),k=n(21010);const L=(0,s.withStyles)(l())((e=>{let{orderTemplate:t}=e;const n=(0,o.useDispatch)();return(0,k.jsxs)(b.$n,{size:"sm",icon:!1,onClick:e=>{e.preventDefault(),n((0,d.Px)({id:t.id}))},className:l().addBtn,noContentWrapper:!0,children:[(0,k.jsx)(g.Ev,{}),(0,k.jsx)("span",{className:"visually-hidden",children:(0,k.jsx)(u.gJ,{textKey:'Aria_OrderTemplate_AddToListButton_Label',formatWith:[t.name]})})]})}));var S=n(13948),C=n(78913),A=n(68412);const y=e=>{let{isDesignerMode:t,blockId:n}=e;const s=(0,o.useDispatch)(),{basketDisabled:i,modelExpired:a,modifiedDate:f,orderTemplates:v}=(0,o.useSelector)((e=>{let{page:t,basket:n}=e;return{basketDisabled:(0,j.KR)(n),modelExpired:n.modelExpired,modifiedDate:n.modifiedDate,orderTemplates:t.orderTemplates}}),o.shallowEqual),b=(0,A.Gg)(),{submitModifiedLines:y}=(0,m.sd)(),{hasPendingChanges:N}=(0,p.x)(),{opened:_,show:I,hide:D}=(0,c.hS)(),{texts:[P],loaded:w}=(0,u.KR)(['ButtonText_AddToList']),T=(0,C.Y)(),B=i||T;return(0,h.T7)((()=>{a&&D()}),[a&&f],!1),w?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("button",{className:`${r().link} ${l().addToOrderTemplateBtn}`,"aria-disabled":B,tabIndex:B?-1:null,onClick:()=>{if(!t&&!B){if(N||b){const[e]=y(!0);if(!e)return}null!=v&&v.items||s((0,d.NG)()),I()}},children:[(0,k.jsx)("span",{className:l().iconWrapper,"aria-hidden":!0,
1children:(0,k.jsx)(g.LP,{className:l().icon})}),P]}),(0,k.jsx)(S.I,{opened:_,hide:D,items:null==v?void 0:v.items,actionButton:L,createOrderTemplate:d.F8,blockId:n})]}):(0,k.jsx)(x.O,{})},N=(0,s.withStyles)(l(),r())((e=>{let{isDesignerMode:t,id:n}=e;const[s]=(0,f.wW)(v.Ul.UseOrderTemplates);return t||s?(0,k.jsx)(y,{isDesignerMode:t,blockId:n}):null}))},27744:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var s=n(25498),i=n(70358),l=n(45107),a=n(86590),r=n(26691),o=n(48339),d=n(72740);const c=e=>{let{children:t,onStateChange:n}=e;const{dirty:i,errors:l,touched:a}=(0,o.j7)(),{validateForm:c}=(0,r.s)();(0,d.yA)((()=>{n(i)}),[i]);const u=i&&!Object.keys(a).length&&!!Object.keys(l).length;return(0,s.useEffect)((()=>{u&&c()}),[u]),t};var u=n(80307),m=n(95397),p=n(21010);const h=e=>{let{isDesignerMode:t}=e;const n=(0,u._)(),{templateFields:o,basketFieldsFormRef:d,setFormIsDirty:h,validateForm:g}=(0,r.s)(),{basket:x,validate:f}=(0,i.useSelector)((e=>({basket:e.basket,validate:e.page.validate})),i.shallowEqual);(0,s.useEffect)((()=>{f&&n&&g().then((e=>!e&&(0,m.Z)()))}),[n]);const v=(0,s.useMemo)((()=>o?(0,a.f6)(o):{}),[o]),j=(0,l.KR)(x);(0,s.useEffect)((()=>{j&&h(!1)}),[j]);const b=!t&&!n;return j||null==o||!o.length||b?null:(0,p.jsx)(a.gK,{name:"basketFields",initialValues:v,formikRef:d,enableReinitialize:!0,children:(0,p.jsx)(c,{onStateChange:h,children:(0,p.jsx)(a.FA,{fields:o,applyNamesEscaping:!0,disableAll:t})})})}},60533:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var s=n(12922),i=n(32525),l=n.n(i),a=n(70358),r=n(60196),o=n(48099),d=n(21010);const c=(0,s.withStyles)(l())((()=>{const e=(0,a.useSelector)((e=>e.basket.model)),t=e&&'validation'in e?e.validation:null;return!t||t.isValid||0===t.failedRules.length?null:(0,d.jsx)(r.W_,{className:l().validationMessagesAlert,children:(0,d.jsx)("ul",{className:l().validationMessages,children:t.failedRules.map(((e,t)=>(0,d.jsx)("li",{children:(0,o.Ny)(e.message)},function(e,t){return`${e}${t.length}${t.substring(0,Math.min(10,t.length))}`}(t,e.message))))})})}))},94776:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var s=n(96614),i=n(10170),l=n(18913),a=n(21010);const r=i.OR.forBasket(),o=()=>{const[e]=(0,i.Ye)([r]),[t]=(0,l.KR)(['ShoppingBasket_Header']).texts;if(!e)return null;const n={title:t||'',link:{url:e,to:i.OR.forBasket()}};return(0,a.jsx)(s.Qp,{items:[n]})}},1125:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var s=n(12922),i=n(32525),l=n.n(i),a=n(70358),r=n(76809),o=n(65300),d=n(10170),c=n(39706),u=n(24147),m=n(9656),p=n(45107),h=n(78913),g=n(21010);const x=(0,s.withStyles)(l())((e=>{let{isDesignerMode:t}=e,[n]=(0,c.US)([u.Ul.CreateOrder]).abilities.map((e=>e!==u.Qs.NotAvailable));const{validation:s,basketDisabled:i,editDocumentType:x,isBasketMinimumPriceSatisfied:f}=(0,a.useSelector)((e=>{var t;let{basket:n}=e;const s=n.model;return{validation:null==s?void 0:s.validation,basketDisabled:(0,p.KR)(n)||(null==s?void 0:s.isBlocked),editDocumentType:null==s?void 0:s.editDocumentType,isBasketMinimumPriceSatisfied:null==s||null==(t=s.basketMinimumPrice)?void 0:t.isSatisfied}}),a.shallowEqual),v=(0,h.Y)(),j=s&&(0,p.Nn)(p.P7.Order,s)||i||v||!1===f;return x===m.KG.Quote?n=!1:x===m.KG.Order&&(n=!0),t||n?(0,g.jsx)(o.E$,{textKey:"ProceedToCheckout",to:d.OR.forCheckout,size:"lg",theme:"action",disabled:j,className:l().btnCheckout,placeholder:(0,g.jsx)(r.O,{className:l().btnCheckoutPlaceholder})}):null}))},14658:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var s=n(25498),i=n(70358),l=n(97328),a=n(45963),r=n(70933),o=n(39706),d=n(24147),c=n(74397),u=n(2272),m=n(21010);const p=e=>{let{id:t}=e;const n=(0,i.useDispatch)(),{products:o,expired:d}=(0,i.useSelector)((e=>{let{checkoutOffers:t}=e;return{products:t.products,expired:t.expired}}),i.shallowEqual),p=(0,s.useRef)(),h=!o||d;(0,s.useEffect)((()=>{if(null==o||!o.length)return;const e=o.map((e=>e.id)).join();p.current!==e&&(n((0,c.Q4)({products:o,source:c.jr.CheckoutOffers})),p.current=e)}),[o]),(0,s.useEffect)((()=>{h&&n((0,r.jb)())}),[h]);return null!=o&&o.length?(0,m.jsx)(u.qM.Provider,{value:{trackingSource:c.jr.CheckoutOffers},children:(0,m.jsx)(l.mc,{children:(0,m.jsx)(a.A,{id:`offers_${t}`,headerTextKey:"Basket_CheckoutOffersHeader",products:o,onUomUpdate:(e,t)=>
1{n((0,r.uI)(e,t))}})})}):null},h=e=>{let{id:t}=e;const[n]=(0,o.wW)(d.Ul.ViewCatalog);return n?(0,m.jsx)(p,{id:t}):null}},62235:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var s=n(12922),i=n(32525),l=n.n(i),a=n(44892),r=n.n(a),o=n(70358),d=n(18913),c=n(34814),u=n(76809),m=n(3392),p=n(45107),h=n(78913),g=n(70663),x=n(21010);const f=(0,s.withStyles)(l(),r())((e=>{let{isDesignerMode:t}=e;const n=(0,o.useDispatch)(),s=(0,o.useSelector)((e=>(0,p.KR)(e.basket))),i=(0,o.useSelector)((e=>{var t;return null==(t=e.basket.model)?void 0:t.productLines.totalCount})),a=(0,h.Y)(),f=s||a,{showConfirmation:v,confirmationModal:j}=(0,g.A)(),{text:b,loaded:k}=(0,c.V2)('ClearBasket');if(!k)return(0,x.jsx)(u.O,{});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("button",{className:`${r().link} ${l().clearBtn}`,onClick:()=>{f||t||(i&&i>5?v((()=>n((0,p.Up)())),{title:'Info',ariaLabel:'Aria_EmptyBasketConfirmationModal'},(0,x.jsx)(d.sD,{textKey:'EmptyBasketWarning'}),{okText:'Continue'},void 0,l().confirmationPopup):n((0,p.Up)()))},"aria-disabled":f,tabIndex:f?-1:null,children:[(0,x.jsx)("span",{className:l().iconWrapper,children:(0,x.jsx)(m.EJ,{className:l().icon})}),b]}),j]})}))},40606:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var s=n(12922),i=n(32525),l=n.n(i),a=n(70358),r=n(45107),o=n(19587),d=n(21010);const c=(0,s.withStyles)(l())((()=>{const e=(0,a.useSelector)((e=>{let{basket:t}=e;return!(0,r.KR)(t)&&t.model.creditLimit}));return e?(0,d.jsx)(o.A,{className:l().creditLimit,creditLimit:e}):null}))},62324:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var s=n(12922),i=n(32525),l=n.n(i),a=n(44892),r=n.n(a),o=n(70358),d=n(18913),c=n(45107),u=n(21010);const m=e=>{let{documentId:t}=e;const n=(0,o.useDispatch)(),[s,i,a]=(0,d.LW)(['YouAreCurrentlyEditingOrder','ButtonText_Cancel','Aria_Basket_CancelEditOrder_Label']).texts;return(0,u.jsxs)("div",{className:l().msgBlock,children:[(0,u.jsx)("span",{role:"status",children:(0,d._V)(s,[t])}),(0,u.jsx)("button",{className:r().link,"aria-label":(0,d.g_)(a),onClick:()=>n((0,c.Up)(!0)),children:(0,d.g_)(i)})]})},p=(0,s.withStyles)(l(),r())((()=>{const e=(0,o.useSelector)((e=>{var t;let{basket:n}=e;return!(0,c.KC)(n)&&(null==(t=n.model)?void 0:t.editDocumentId)}));return e?(0,u.jsx)(m,{documentId:e}):null}))},46451:(e,t,n)=>{n.r(t),n.d(t,{default:()=>j});var s=n(12922),i=n(32525),l=n.n(i),a=n(44892),r=n.n(a),o=n(70358),d=n(10170),c=n(34814),u=n(76809),m=n(3392),p=n(39706),h=n(24147),g=n(45107),x=n(78913),f=n(21010);const v=()=>{const e=(0,o.useSelector)((e=>(0,g.KC)(e.basket))),t=(0,d.uq)(),n=(0,x.Y)(),s=e||n,{text:i,loaded:a}=(0,c.V2)('LoadList');return a?(0,f.jsxs)(d.N_,{to:d.OR.forOrderTemplates,options:{backTo:t},className:`${r().link} ${l().loadTemplateBtn}`,disabled:s,children:[(0,f.jsx)("span",{className:l().iconWrapper,"aria-hidden":!0,children:(0,f.jsx)(m.uG,{className:l().icon})}),i]}):(0,f.jsx)(u.O,{})},j=(0,s.withStyles)(l(),r())((e=>{let{isDesignerMode:t}=e;const[n]=(0,p.wW)(h.Ul.UseOrderTemplates);return t||n?(0,f.jsx)(v,{}):null}))},77663:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var s=n(12922),i=n(32525),l=n.n(i),a=n(70358),r=n(45107),o=n(60196),d=n(15166),c=n(18913),u=n(21010);const m=e=>{let{basketMinimumPrice:t,subtotal:n}=e;const s=(0,d.useCurrencyInfo)(),{loaded:i,texts:[l,a,r]}=(0,c.LW)(['BasketMinimumPriceNotReached','BasketMinimumPriceOfNotReached','BasketMinimumPriceWithSubtotalOfNotReached']);return!i||t.isSatisfied?null:(0,u.jsx)(o.W_,{scrollOnAppear:!0,children:t.minimumPrice&&s?n?(0,c._V)(r,[(0,d.formatAsPrice)(n,s),(0,d.formatAsPrice)(t.minimumPrice,s)]):(0,c._V)(a,[(0,d.formatAsPrice)(t.minimumPrice,s)]):(0,c._V)(l)})},p=(0,s.withStyles)(l())((()=>{var e;const t=(0,a.useSelector)((e=>{let{basket:t}=e;return(0,r.KR)(t)?null:t.model}));return null!=t&&t.basketMinimumPrice?(0,u.jsx)("div",{"aria-live":"polite","aria-atomic":!0,className:l().minimumPriceMsg,children:(0,u.jsx)(m,{basketMinimumPrice:t.basketMinimumPrice,subtotal:null==(e=t.totals)?void 0:e.sub})}):null}))},84758:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});var s=n(70358),i=n(45107),l=n(9084),a=n(21010);const r=()=>{const e=(0,s.useSelector)((e=>{let{basket:t}=e;return!(0,i.KC)(t)&&t.model&&(0,i.S2)(t.model)?t.model.nonOrderableLines:null}));return null!=e&&e.length?(0,a.jsx)(l.A,{nonOrderableLines:e}):null}},21831:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var s=n(87840),i=n(21010);const l=e=>(0,i.jsx)(s.default,{...e,isMobile:!0})},87840:(e,t,n)=>{n.r(t),n.d(t,{default:()=>re});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(70358),o=n(97328),d=n(39706),c=n(24147),u=n(18913),m=n(65300),p=n(21010);const h=()=>{const e=(0,r.useSelector)((e=>e.settings.shoppingCartSuggestionPage)),[t]=(0,d.wW)(c.Ul.ViewProductSuggestions);return(0,p.jsxs)("div",{className:`msg-block ${l().emptyBasketBlock}`,children:[(0,p.jsx)("span",{className:l().msgEmptyBasket,children:(0,p.jsx)(u.gJ,{textKey:"Basket_EmptyBasket"})}),t&&!!e&&(0,p.jsx)(m.E$,{size:"lg",className:l().btnSuggestions,to:e.to,url:e.url,textKey:"GetProductSuggestions"})]})},g=(0,s.withStyles)(l())((0,a.memo)(h));var x=n(60196),f=n(59446),v=n(60115);const j=(0,a.createContext)({shouldRecalculate:!1,setShouldRecalculate:v.l});var b=n(59468);const k=e=>{let{isQuickOrderMode:t=!1,children:n}=e;const{hasPendingChanges:s}=(0,b.x)(),i=s||t,[l,r]=(0,a.useState)(i);(0,a.useEffect)((()=>{r(i)}),[i]);const o=(0,a.useMemo)((()=>({shouldRecalculate:l,setShouldRecalculate:r})),[l]);return(0,p.jsx)(j.Provider,{value:o,children:n})},L=e=>{let{textKey:t="RecalculateBasketMessage",messageId:n}=e;const{shouldRecalculate:s,setShouldRecalculate:i}=(0,a.useContext)(j),{submitBasket:r}=(0,f.sd)(),[d,c,m,h]=(0,u.LW)([t,'Recalculate','Recalculate_CallToActionText','Aria_Recalculate_Label']).texts,g=()=>{r(),i(!1)},v=(0,p.jsx)("span",{role:"button",className:`${x.Vd.link} ${l().btnRecalculate}`,"aria-label":(0,u.g_)(h),onClick:g,onKeyDown:e=>{' '!==e.key&&'Enter'!==e.key||g()},tabIndex:0,children:(0,u.g_)(c)});return(0,p.jsx)(o.Ff,{expanded:s,role:"alertdialog","aria-labelledby":n,duration:350,timingFunction:"ease",children:(0,p.jsx)("div",{className:l().recalcMsgWrapper,children:(0,p.jsx)(x.Z0,{className:l().recalcMsg,id:n,action:(0,p.jsx)(x.oG,{onClick:g,children:m}),children:(0,u._V)(d,[v])})})})},S=(0,s.withStyles)(l())((0,a.memo)(L));var C=n(10170),A=n(86039),y=n(34728),N=n(40119);const _=(0,r.connect)((e=>{let{routing:t}=e;return{pageUrl:t.location.pathname}}),{navigateTo:y.VJ})((e=>{let{page:t,totalCount:n,pageUrl:s,navigateTo:i,scrollToId:l,className:r}=e;const o=(0,a.useCallback)((e=>{i(C.OR.forBasket(e,!0),(0,N.M_)(s,e+1),{replaceHistory:!0,omitScroll:!0})}),[s]),d=(0,a.useCallback)((e=>(0,N.M_)(s,e+1)),[s]);return(0,p.jsx)(A.A,{pageIndex:t.index,pageSize:t.size,totalCount:n,onSelect:o,scrollToId:l,getUrl:d,className:r})}));var I=n(45107),D=n(35547),P=n(70663),w=n(88936),T=n(18720);const B=e=>{let{lines:t}=e;const{texts:[n,s,i,a],loaded:r}=(0,u.LW)(['RemoveMultiProductConfigurationMessage','RemoveMultiProductConfigurationLineTemplate','RemoveMultiProductConfigurationWithVariantLineTemplate','RemoveMultiProductConfigurationMessage_RestProducts']);if(!r)return null;
1const o=t[0].configuration.productCount,d=t.slice(0,10),c=o-d.length,m=d[0];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{className:l().modalMessage,children:n}),(0,p.jsx)("ul",{className:l().confirmationModalItems,children:d.map((e=>(0,p.jsx)("li",{children:R(s,i,e.configuredProduct)},e.id)))}),c>0&&(0,p.jsx)("div",{children:(0,u.g_)(a,[c])}),(0,p.jsx)("div",{className:l().modalReconfigureButton,children:(0,p.jsx)(T.mo,{productConfiguration:m.configuration,productTitle:m.configuredProduct.title})})]})},M=(0,s.withStyles)(l())((0,a.memo)(B));function R(e,t,n){const{id:s,title:i}=n;if(!n.variantId)return(0,u.g_)(e,[s,i]);const l=n.variantTitle||'';return i?(0,u.g_)(t,[s,i,l]):(0,u.g_)(e,[s,l])}const E=(0,s.withStyles)(l())((e=>{let{lines:t,isDesignerMode:n,children:s}=e;const i=1===t.length&&1===t[0].configuration.productCount,{showConfirmation:o,clearConfirmation:d,confirmationModal:c}=(0,P.A)(),u=(0,r.useDispatch)(),m=(0,w.K)();(0,a.useEffect)((()=>d()),[t]);const h=(0,a.useMemo)((()=>{const e=e=>{u((0,I.Jq)(e))},s=()=>{e(t[0].configuration.id),d()};return{isSingleProduct:i,handleDelete:()=>{n||(m?u((0,D.PE)()):i?e(t[0].configuration.id):o(s,{title:'DeleteConfirmation'},(0,p.jsx)(M,{lines:t}),{closeText:'ButtonText_Cancel',okText:'ButtonText_Delete'},void 0,l().removeConfigurationsPopup))}}}),[t,i,m,n]);return(0,p.jsxs)(p.Fragment,{children:[s(h),c]})}));var O=n(42369),U=n(34160),V=n(69270);const W=()=>{const{texts:e}=(0,u.KR)(['LoadingProgress_ShoppingCart_Recalculate_Step1','LoadingProgress_ShoppingCart_Recalculate_Step2','LoadingProgress_ShoppingCart_Recalculate_Step3','LoadingProgress_ShoppingCart_Recalculate_Step4','LoadingProgress_ShoppingCart_Recalculate_Step5','LoadingProgress_ShoppingCart_Recalculate_Step6']);return(0,p.jsx)("div",{className:l().linesListLoader,children:(0,p.jsx)(V.A,{className:l().progressIndicator,labels:e})})},q=(0,s.withStyles)(l())((0,a.memo)(W)),$=e=>{let{productLines:t,serviceLines:n,contentId:s,isDesignerMode:i,renderedRows:o,isLastPage:d}=e;const c=(0,r.useSelector)((e=>e.basket.updating??!1)),m=(0,a.useMemo)((()=>function(e){const t=[];for(const n of e){if(!(0,I.JH)(n)){t.push({configurationId:void 0,lines:[n]});continue}const e=n.configuration.id,s=t.find((t=>t.configurationId===e));null!=s&&s.configurationId?s.lines.push(n):t.push({configurationId:e,lines:[n]})}return t}(t.list)),[t.list]),[h,g,x,f]=(0,u.KR)(['Aria_Basket_Lines_List','Aria_Basket_ConfigurableLines_List','Aria_Basket_SupplementaryLines_List','Aria_Basket_ServiceLines_List']).texts;return(0,p.jsx)(U.F,{contentId:s,children:(0,p.jsxs)("div",{className:`${l().linesListWrapper} ${c?l().showOverlay:''}`,children:[(0,p.jsxs)("ul",{className:l().linesList,"aria-label":h,inert:c?'':void 0,children:[m.map(((e,t)=>void 0!==e.configurationId?(0,p.jsx)("li",{className:l().topConfLine,children:(0,p.jsx)(E,{lines:e.lines,isDesignerMode:i,children:t=>{const n=1===e.lines.length,s=n?a.Fragment:'ul',i=n?a.Fragment:'li',r=n?void 0:{'aria-label':g,className:l().nestedList},d=n?void 0:{className:l().nestedConfLine};return(0,p.jsx)(s,{...r,children:e.lines.map(((e,n)=>(0,p.jsxs)(i,{...d,children:[(0,p.jsx)(O.Wq,{line:e,isActionLine:0===n,configurableLineData:t,children:o}),'serviceLines'in e&&!!e.serviceLines.length&&(0,p.jsx)("ul",{className:l().nestedList,"aria-label":f,children:e.serviceLines.map(((e,t)=>(0,p.jsx)("li",{className:l().nestedServiceLine,children:(0,p.jsx)(O.Wq,{line:e,children:o})},t)))})]},n)))})}})},t):e.lines.map((e=>{var t,n;return(0,I.U0)(e)?(0,p.jsx)("li",{className:l().topSupplLine,children:(0,p.jsx)(O.Wq,{line:e,children:o})},e.id):'subLines'in e&&null!=(t=e.subLines)&&t.length?e.subLines.map((t=>{var n;return(0,p.jsxs)("li",{className:`${l().topProductLine} ${l().subLine}`,children:[(0,p.jsx)(O.Wq,{line:t,product:e.product,children:o}),'supplementaryLines'in t&&!(null==(n=t.supplementaryLines)||!n.length)&&(0,p.jsx)("ul",{className:l().nestedList,"aria-label":x,children:t.supplementaryLines.map((e=>(0,p.jsx)("li",{className:l().nestedSupplLine,children:(0,p.jsx)(O.Wq,{line:e,children:o})},e.id)))}),'serviceLines'in t&&!!t.serviceLines.length&&(0,p.jsx)("ul",{className:l().nestedList,"aria-label":f,children:t.serviceLines.map(((e,t)=>(0,p.jsx)("li",{className:l().nestedServiceLine,children:(0,p.jsx)(O.Wq,{line:e,children:o})},t)))})]},t.id)})):(0,p.jsxs)("li",{className:l().topProductLine,children:[(0,p.jsx)(O.Wq,{line:e,children:o}),'supplementaryLines'in e&&!(null==(n=e.supplementaryLines)||!n.length)&&(0,p.jsx)("ul",{className:l().nestedList,"aria-label":x,children:e.supplementaryLines.map((e=>(0,p.jsx)("li",{className:l().nestedSupplLine,children:(0,p.jsx)(O.Wq,{line:e,children:o})},e.id)))}),'serviceLines'in e&&!!e.serviceLines.length&&(0,p.jsx)("ul",{className:l().nestedList,"aria-label":f,children:e.serviceLines.map(((e,t)=>(0,p.jsx)("li",{className:l().nestedServiceLine,children:(0,p.jsx)(O.Wq,{line:e,children:o})},t)))})]},e.id)})))),d&&!!n.length&&(0,p.jsx)("li",{className:l().topServiceLine,children:1===n.length?(0,p.jsx)(O.Wq,{line:n[0],children:o}):(0,p.jsx)("ul",{className:l().nestedList,"aria-label":f,children:n.map(((e,t)=>(0,p.jsx)("li",{className:l().nestedServiceLine,children:(0,p.jsx)(O.Wq,{line:e,children:o})},t)))})})]}),c&&(0,p.jsx)(q,{})]})})},F=(0,s.withStyles)(l())((0,a.memo)($));var K=n(2040);const Q=(0,s.withStyles)(l())((e=>{let{productLines:t,serviceLines:n,contentId:s,formId:i,isDesignerMode:a,renderedRows:r,isLastPage:o}=e;const{submitBasket:d}=(0,f.sd)();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("form",{id:i,className:l().form,onSubmit:e=>{e.preventDefault(),d()},children:[(0,p.jsx)(F,{productLines:t,serviceLines:n,contentId:s,isDesignerMode:a,renderedRows:r,isLastPage:o}),(0,p.jsx)(K.HiddenSubmitButton,{})]}),(0,p.jsx)(T.Xz,{})]})}));var J=n(98071),H=n.n(J),z=n(76809),G=n(72413);const Y=(0,s.withStyles)(l(),H())((()=>{const e=(0,G.U$)(),[t,n]=(0,a.useState)();(0,a.useEffect)((()=>
1{if(void 0!==t)return;e('{basket(calculated:false){totalCount}}',void 0,(e=>e.basket.totalCount)).subscribe({next:n})}));const s=(0,r.useSelector)((e=>e.settings.shopEmailAddress)),i=(0,r.useDispatch)(),{loaded:d,texts:c}=function(){const{texts:[e,t,n,s,i,l],loaded:a}=(0,u.LW)(['Basket_ErpError_ErrorText','Basket_ErpError_PageReload_Text','ContactUs','Basket_ErpError_ContactUs_Subject','Basket_ErpError_Empty_Text','Basket_ErpError_EmptyShoppingCart_Template']);return{loaded:a,texts:{errorText:e,reloadTemplate:t,contactUs:n,contactUsSubject:s,emptyShoppingCart:i,emptyShoppingCartTemplate:l}}}(),m=(0,p.jsx)("button",{className:x.Vd.link,onClick:()=>i((0,I.Up)(!0)),children:(0,u.g_)(c.emptyShoppingCart)}),h=d?'':(0,p.jsx)(z.O,{className:H().loading}),g=void 0!==t?t:(0,p.jsx)(z.O,{className:l().errorTotalCountPlaceholder});return(0,p.jsx)(o.mc,{children:(0,p.jsxs)(x.W_,{className:H().block,children:[(0,p.jsx)("div",{children:h||(0,u._V)(c.errorText)}),(0,p.jsxs)("ul",{className:H().actionList,children:[(0,p.jsx)("li",{children:h||(0,p.jsx)("button",{className:x.Vd.link,onClick:e=>window.location.reload(),children:c.reloadTemplate})}),(0,p.jsx)("li",{children:h||(0,p.jsx)("a",{className:x.Vd.link,href:`mailto:${s}?subject=${c.contactUsSubject}`,children:c.contactUs})}),(0,p.jsx)("li",{children:h||(0,u.g_)(c.emptyShoppingCartTemplate,[m,g],!0)})]})]})})}));const X=()=>{const e=(0,r.useDispatch)(),[t,n,s]=(0,u.LW)(['BasketUnavailable','BasketUnavailable_Reload','BasketUnavailable_CallToActionText']).texts;return(0,p.jsx)(x.Z0,{action:(0,p.jsx)(x.oG,{onClick:()=>e((0,y.VJ)(C.OR.forBasket())),children:s}),children:(0,u._V)(t,[(0,p.jsx)(C.N_,{to:C.OR.forBasket(),children:(0,u._V)(n)})])})},Z=()=>{const{texts:e}=(0,u.KR)(['LoadingProgress_ShoppingCart_Step1','LoadingProgress_ShoppingCart_Step2','LoadingProgress_ShoppingCart_Step3','LoadingProgress_ShoppingCart_Step4','LoadingProgress_ShoppingCart_Step5','LoadingProgress_ShoppingCart_Step6']),[t]=(0,u.KR)(['LoadingProgress_ShoppingCart_Complete']).texts;return(0,p.jsx)("div",{className:l().mainLoader,children:(0,p.jsx)(V.A,{className:l().progressIndicator,labels:e,finalizationLabel:t})})},ee=(0,s.withStyles)(l())((0,a.memo)(Z));var te=n(78913),ne=n(90082);const se={Left:"LEFT",Center:"CENTER",Right:"RIGHT"};var ie=n(68412);const le={[se.Left]:'',[se.Right]:l().rightAlignment,[se.Center]:l().centerAlignment},ae=e=>{let{id:t,model:n,quickOrderMaxLines:s,isDesignerMode:i,lineTemplate:r,renderContentTemplates:d,pagingAlignment:c,isQuickOrderMode:u}=e;const{productLines:{totalCount:m}}=n,h=(0,I.Rb)(n)||!m,x=(0,I.dR)(n),f=(0,a.useMemo)((()=>h||x?null:d(r,!1)),[h,x,r,d]);if(h)return(0,p.jsx)(g,{});if(x)return(0,p.jsx)(X,{});const v=(0,I.S2)(n)?n.page:null,j=!!v&&v.size<m&&!u,b=!!v&&Math.floor((m-1)/v.size)===v.index,L=`basketContent_${t}`,C=`basketForm_${t}`;return(0,p.jsx)("div",{id:L,className:l().basketWrapper,children:(0,p.jsxs)(k,{isQuickOrderMode:u,children:[(0,p.jsx)(S,{messageId:`recalcMsg_${t}`}),(0,p.jsx)(Q,{productLines:n.productLines,serviceLines:n.serviceLines,contentId:L,formId:C,isDesignerMode:i,renderedRows:f,isLastPage:b}),u&&m>s&&(0,p.jsx)(S,{textKey:"PleaseRecalculateShoppingCartToSeAllLines",messageId:`quickOrderRecalcMsg_${t}`}),j&&(0,p.jsx)(o.fI,{className:l().panelFooter,children:(0,p.jsx)(o.fv,{xs:12,md:!0,className:`${l().pagingContainer} ${le[c]}`,children:(0,p.jsx)(_,{page:v,totalCount:m,scrollToId:C})})})]})})},re=(0,s.withStyles)(l())((e=>{let{id:t,model:{pagingAlignment:n=se.Right},isDesignerMode:s,contentTemplates:i,renderContentTemplates:l,isMobile:a}=e;const{model:o,quickOrderMaxLines:d,isErrorMode:c}=(0,r.useSelector)((e=>{let{basket:{model:t,isErrorMode:n},settings:s}=e;return{model:t,quickOrderMaxLines:s.basket.quickOrderMaxLines,isErrorMode:n}}),r.shallowEqual),u=(0,ie.Gg)(),m=(0,te.Y)();if(c)return(0,p.jsx)(Y,{});const h=o?(0,p.jsx)(ae,{id:t,model:o,quickOrderMaxLines:d,isQuickOrderMode:u,isDesignerMode:s??!1,lineTemplate:oe(i,a),renderContentTemplates:l,pagingAlignment:n}):null;return m?(0,p.jsx)(ee,{}):h}));function oe(e,t){return(null==e?void 0:e.basketLineView)??(t?ne.s.value:ne.g.value)}}
1,61504:(e,t,n)=>{n.r(t),n.d(t,{default:()=>B});var s=n(25498),i=n(24147),l=n(39706),a=n(12922),r=n(32525),o=n.n(r),d=n(70358),c=n(72740),u=n(17005),m=n(35547),p=n(3516),h=n(88936),g=n(18913),x=n(59446),f=n(59468),v=n(78913),j=n(48598),b=n(76809),k=n(45107),L=n(13948),S=n(79265),C=n(21010);const A=e=>{let{lineId:t,orderTemplate:n,onClick:i}=e;const l=(0,d.useDispatch)(),{containsCurrentActiveBasketLine:a,id:r,name:o}=n,c=function(e){const t=(0,s.useRef)();return t.current??(t.current={prevContainsCurrentActiveBasketLine:e,templateChangeInProgress:!1}),t.current}(a);(0,s.useEffect)((()=>{if(c.templateChangeInProgress){if(c.prevContainsCurrentActiveBasketLine!==a){const e=a?'Aria_OrderTemplate_AddedStatus':'Aria_OrderTemplate_RemovedStatus';setTimeout((()=>l((0,S.Pr)(e))),150)}c.prevContainsCurrentActiveBasketLine=a,c.templateChangeInProgress=!1}}),[n]);const m=(0,s.useCallback)((e=>{e.preventDefault(),c.templateChangeInProgress=!0,null==i||i(),l(a?(0,u.de)(r,t):(0,u.tU)(r,t))}),[a,r,t,i]);return(0,C.jsx)(j.uk,{isRemove:a??!1,onClick:m,name:o})},y=(0,s.memo)(A);const N=e=>{let{opened:t,hide:n,showLoginFirstPopup:i,blockId:l,items:a,lineId:r}=e;const o=(0,d.useDispatch)(),c=(0,s.useRef)(!1),m=(0,s.useCallback)((()=>{n(),!i&&c.current&&(c.current=!1,o((0,u.wJ)(r)))}),[i,r]),p=(0,s.useCallback)((()=>{c.current=!0}),[]),h=(0,s.useCallback)((e=>{let{orderTemplate:t}=e;return(0,C.jsx)(y,{lineId:r,orderTemplate:t,onClick:p})}),[r]);return(0,C.jsx)(L.I,{opened:t,hide:m,showLoginFirstPopup:i,items:a,actionButton:h,blockId:l,createOrderTemplate:u.F8})},_=(0,s.memo)(N);var I=n(68412);const D=e=>{let{isDesignerMode:t,showLoginFirstPopup:n,blockId:i,lineId:l,heartIconLayout:a}=e;const r=(0,d.useDispatch)(),L=(0,h.K)(),{orderTemplates:S,linesUsedInTemplates:A,currentActiveBasketLineId:y,linesUsageInfoExpired:N}=(0,d.useSelector)((e=>{var t,n,s,i;let{page:l}=e;return{orderTemplates:null==(t=l.orderTemplates)?void 0:t.items,linesUsedInTemplates:null==(n=l.orderTemplates)?void 0:n.linesUsedInTemplates,currentActiveBasketLineId:null==(s=l.orderTemplates)?void 0:s.currentActiveBasketLineId,linesUsageInfoExpired:null==(i=l.orderTemplates)?void 0:i.linesUsageInfoExpired}}),d.shallowEqual),{basketDisabled:D,modelExpired:P,modifiedDate:w}=(0,d.useSelector)((e=>({basketDisabled:(0,k.KR)(e.basket),modelExpired:e.basket.modelExpired,modifiedDate:e.basket.modifiedDate})),d.shallowEqual),T=(0,I.Gg)(),B=function(){const e=(0,s.useRef)();return e.current??(e.current={openInProcess:!1,updateLineOrderTemplates:!1}),e.current}(),{submitModifiedLines:M}=(0,x.sd)(),{hasPendingChanges:R}=(0,f.x)(),{opened:E,show:O,hide:U}=(0,p.hS)(),{texts:[V],loaded:W}=(0,g.KR)(['ButtonText_AddToList']);(0,c.T7)((()=>{P&&U()}),[P&&w],!1);const q=!t&&!L&&!n;(0,s.useEffect)((()=>{q&&r((0,u.b$)(l))}),[q&&l]);const $=q&&N;(0,s.useEffect)((()=>{$&&(B.updateLineOrderTemplates=l===y,r((0,u.b$)(l)))}),[$]),(0,s.useEffect)((()=>{B.openInProcess&&(B.openInProcess=!1,O())}),[S]);const F=(0,v.Y)(),K=D||F,Q=R||T,J=(0,s.useMemo)((()=>t?null:()=>{if(L)r((0,m.PE)());else if(!K)if(n)O();else{if(Q){const[e]=M(!0);if(!e)return}y!==l||B.updateLineOrderTemplates?(B.updateLineOrderTemplates=!1,B.openInProcess=!0,r((0,u.z1)(l))):O()}}),[K,n,Q,y,l,L,t]);if(!W)return(0,C.jsx)(b.O,{className:o().addToListPlaceholder});const H=null==A?void 0:A.includes(l);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(j.gx,{className:o().addToListIconBtn,isActive:H,onClick:J,iconLayout:a,iconText:V}),!t&&(0,C.jsx)(_,{lineId:l,opened:E,hide:U,showLoginFirstPopup:n,items:S,blockId:i})]})},P=(0,a.withStyles)(o())((0,s.memo)(D));var w=n(42369);const T=e=>{let{isDesignerMode:t,model:{heartIconLayout:n},id:s}=e;const{isLoading:a,abilities:[r]}=(0,l.US)([i.Ul.UseOrderTemplates]),o=(0,w.fD)(),d=(0,w.xq)();if(!o||o.isSupplementary||a||r===i.Qs.NotAvailable)return null;if(d&&!d.isSingleProduct&&!d.isActionLine)return null;const c=r===i.Qs.Unauthorized;return(0,C.jsx)(P,{isDesignerMode:t,showLoginFirstPopup:c,blockId:s,lineId:o.id,heartIconLayout:n})},B=(0,s.memo)(T)},66140:(e,t,n)=>{n.r(t),n.d(t,{default:()=>V});var s=n(25498),i=n(42369),l=n(42346),a=n(39706),r=n(75052),o=n(70358),d=n(90794),c=n(21010);const u=e=>{let{line:t,product:n,className:s,shouldIgnoreActions:i,isDesignerMode:l,setCommentState:a,Component:u}=e;const m=(0,o.useSelector)((e=>e.page.validate)),p=(0,r.Ag)(t.id);return(0,c.jsx)(d.PC,{className:s,isDesignerMode:l,line:t,product:n,isValid:p,setCommentState:a,validate:m,shouldIgnoreActions:i,Component:u})},m=(0,s.memo)(u);var p=n(12922),h=n(32525),g=n.n(h),x=n(45107),f=n(61855),v=n.n(f),j=n(97328),b=n(18913),k=n(2040),L=n(43026),S=n(76809),C=n(86590),A=n(96592),y=n(72740);const N=e=>{let{blockId:t,className:n,line:i,shouldIgnoreActions:l,errorMessage:a,setErrorMessage:r,validateComment:d,packageId:u,setCommentState:m}=e;
1const p=(0,o.useDispatch)(),h=i.comment??'',[f,N]=(0,s.useState)(h),[_,I]=(0,s.useState)(!1),{texts:[D],loaded:P}=(0,b.KR)(['Basket_Line_Comment']),w=(0,s.useRef)();(0,y.yA)((()=>{!i.commentValidationResult||i.commentValidationResult.isValid?(m(i.id,!0),r(void 0)):(m(i.id,!1),r(i.commentValidationResult.errorMessage))}),[i.commentValidationResult]);const T=(0,s.useCallback)(v()((async e=>{var t,n,s;if(e===h)return m(i.id,!(null==(t=i.commentValidationResult)||!t.isValid)),void r(null!=(n=i.commentValidationResult)&&n.isValid||null==(s=i.commentValidationResult)?void 0:s.errorMessage);if(I(!0),!u)return void p((0,x.v1)(i.id,e||null));const l=await d(e);m(i.id,!(null==l||!l.isValid)),null!=l&&l.isValid?(p((0,x.v1)(i.id,e||null)),r(void 0)):(M(),r(null==l?void 0:l.errorMessage))}),500),[d,i.id,i.commentValidationResult,h]),B=(0,s.useCallback)((e=>{N(e.target.value),l||T(e.target.value)}),[T,a,l]);(0,s.useEffect)((()=>{!_&&N(h??'')}),[h]),(0,s.useEffect)((()=>(M(),()=>{window.clearTimeout(w.current)})),[h]);const M=()=>{w.current=window.setTimeout((()=>{I(!1)}),500)},R=(0,j.XS)(n,g().commentContainer),E=(0,j.$q)(i.id,`basketLineCommentInput_${t}`);return(0,c.jsx)(C.tA,{className:R,label:(0,c.jsx)("label",{htmlFor:E,children:P?D:(0,c.jsx)(S.O,{className:g().commentLabelPlaceholder})}),field:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k.Input,{id:E,value:f,onChange:B,"aria-invalid":!!a||null,maxLength:A.yc}),_&&(0,c.jsx)(L.default,{className:g().spinner})]}),error:a&&(0,c.jsx)(C.Kw,{children:a})})},_=(0,p.withStyles)(g())((0,s.memo)(N));var I=n(72413),D=n(44892),P=n.n(D),w=n(48099),T=n(3392);const B=e=>{let{productTitle:t,isAdding:n,onAdd:i,onRemove:l,ariaControls:a,showButtonLabels:r}=e;const o=(0,s.useRef)(!1),{texts:[d,u,m,p],loaded:h}=(0,b.KR)([r&&'Basket_Line_AddComment',r&&'Basket_Line_RemoveComment','Aria_Basket_Line_AddComment_Label','Aria_Basket_Line_RemoveComment_Label','Basket_Line_Comment']);if((0,s.useEffect)((()=>{o.current=!1}),[n]),!h)return(0,c.jsx)(S.O,{className:g().commentControlPlaceholder});return(0,c.jsx)("button",{autoFocus:o.current,type:"button",className:`${P().link} ${g().commentControl}`,onClick:()=>{o.current=!0,n?l():i()},"aria-label":(0,w.vX)(n?p:m,[t]),"aria-controls":a,"aria-expanded":n,children:n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(T.z7,{className:P().linkIcon}),r&&(0,c.jsx)("span",{children:u})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(T.Sd,{className:P().linkIcon}),r&&(0,c.jsx)("span",{children:d})]})},`${n}`)},M=(0,p.withStyles)(g(),P())((0,s.memo)(B)),R=e=>{var t,n;let{blockId:i,line:l,fullProductTitle:a,className:r,shouldIgnoreActions:d,showButtonLabels:u,packageId:m,setCommentState:p}=e;const h=(0,o.useDispatch)(),[f,v]=(0,s.useState)(!!l.comment),{updaterId:b,validate:k}=(0,o.useSelector)((e=>({updaterId:e.basket.updated.updaterId,validate:e.page.validate})),o.shallowEqual),L=(0,I.U$)(),[S,C]=(0,s.useState)(!k||null!=(t=l.commentValidationResult)&&t.isValid||null==(n=l.commentValidationResult)?void 0:n.errorMessage);(0,s.useEffect)((()=>{b!==x.Xm.BasketLineComment&&v(!!l.comment)}),[!!l.comment]),(0,y.yA)((()=>{k&&l.commentValidationResult&&!l.commentValidationResult.isValid&&C(l.commentValidationResult.errorMessage)}),[k]);const A=(0,s.useCallback)((async e=>L(" query ValidateBasketLineComment($lineId:Guid!,$comment:String){basket(calculated:false){validateLineComment(lineId:$lineId,comment:$comment){isValid ...on CommentValidationFailedResult{errorMessage}}}}",{lineId:l.id,comment:e},(e=>{var t;return null==(t=e.basket)?void 0:t.validateLineComment})).toPromise()),[l.id,L]),N=(0,s.useCallback)((()=>{v(!0)}),[]),D=(0,s.useCallback)((async()=>{if(v(!1),d)return;if(!m)return void h((0,x.v1)(l.id,null));const e=await A(null);null!=e&&e.isValid?(h((0,x.v1)(l.id,null)),C(void 0)):C(null==e?void 0:e.errorMessage),p(l.id,!(null==e||!e.isValid))}),[l.id,l.comment,d,A]),P=(0,j.$q)(l.id,`basketLineComment_${i}`);return(0,c.jsxs)("div",{className:g().commentBlock,children:[(0,c.jsx)("div",{id:P,hidden:!f,children:f&&(0,c.jsx)(_,{blockId:i,className:r,line:l,shouldIgnoreActions:d,errorMessage:S,setErrorMessage:C,validateComment:A,packageId:m,setCommentState:p})}),(0,c.jsx)(M,{productTitle:a,isAdding:f,onAdd:N,onRemove:D,ariaControl
1s:P,showButtonLabels:u})]})},E=(0,p.withStyles)(g())((0,s.memo)(R));var O=n(88936);const U=e=>{let{id:t,model:n,isDesignerMode:o}=e;const d=(0,i.fD)(),u=(0,i.aE)(),p=(0,i.xq)(),[h]=(0,a.wW)(l.Ul.UseCheckoutItemLineComments),{clearInvalidCommentLines:g,setCommentState:x,packageId:f,addonCheckoutItemLineComment:v}=(0,r.A4)(),j=(0,O.K)();if((0,s.useEffect)((()=>{h||g()}),[h]),!d||!u||!h||d.isSupplementary||void 0===v)return null;const b=o||j,k='basket-line-comment';return null!=v&&v.editor?(0,c.jsx)(m,{line:d,product:(null==p?void 0:p.configuration.masterProduct)??u,className:k,shouldIgnoreActions:b,isDesignerMode:!!o,setCommentState:x,Component:v.editor}):(0,c.jsx)(E,{blockId:t,line:d,fullProductTitle:(0,i.rz)(u.id,u.title,p?u.variantTitle:d.title),className:k,shouldIgnoreActions:b,showButtonLabels:n.showButtonLabels,packageId:f,setCommentState:x})},V=(0,s.memo)(U)},91300:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(42369),o=n(21010);const d=()=>{const e=(0,r.aE)(),t=(0,r.xq)(),n=null==e?void 0:e.description;return t&&n?(0,o.jsx)("div",{className:l().configuredProductDescription,children:n}):null},c=(0,s.withStyles)(l())((0,a.memo)(d))},77455:(e,t,n)=>{n.d(t,{R:()=>a});var s=n(32525),i=n.n(s);let l=function(e){return e[e.Hidden=0]="Hidden",e[e.Left=1]="Left",e[e.Right=2]="Right",e}({});const a={[l.Hidden]:'',[l.Left]:i().leftDivider,[l.Right]:i().rightDivider}},24440:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var s=n(25498),i=n(42369),l=n(45107),a=n(70358),r=n(35547),o=n(88936),d=n(6887),c=n(59446),u=n(95397),m=n(12922),p=n(32525),h=n.n(p),g=n(44892),x=n.n(g),f=n(18913),v=n(3392),j=n(48099),b=n(21010);const k=e=>{let{handleDelete:t,productTitle:n,showLabel:s}=e;const{texts:[i,l],loaded:a}=(0,f.KR)([s&&'Delete','Aria_DeleteProduct_Label']);return a?(0,b.jsxs)("button",{className:x().link+' '+h().deleteButton,type:"button","aria-label":(0,j.vX)(l,[n]),onClick:t,children:[(0,b.jsx)(v.Vj,{className:x().linkIcon}),s&&(0,b.jsx)("span",{children:i})]}):null},L=(0,m.withStyles)(h(),x())((0,s.memo)(k)),S=e=>{let{productId:t,productTitle:n,showLabel:m,isDesignerMode:p}=e;const{id:h,title:g}=(0,i.fD)()||{},{getModifiedLines:x}=(0,c.sd)(),{hasLineWithInvalidQuantity:f}=(0,d.HJ)(),v=(0,o.K)(),j=(0,a.useDispatch)(),k=(0,s.useCallback)((()=>{if(p)return;if(v)return void j((0,r.PE)());if(!h)return;if(f())return void(0,u.Z)();const e=x(),t=e.findIndex((e=>e.id===h));-1===t?e.push({id:h,quantity:0}):e[t]={...e[t],quantity:0},j((0,l.vZ)(e,null,null))}),[h,p,v]);return(0,b.jsx)(L,{productTitle:(0,i.rz)(t,n,g),handleDelete:k,showLabel:m})},C=(0,s.memo)(S),A=e=>{let{model:t,isDesignerMode:n}=e;const s=(0,i.fD)(),l=(0,i.aE)(),a=(0,i.xq)();return s&&l&&!s.isSupplementary?a?null!=a&&a.isActionLine?(0,b.jsx)(L,{productTitle:(0,i.rz)(l.id,l.title,l.variantTitle),handleDelete:a.handleDelete,showLabel:t.showLabel}):null:(0,b.jsx)(C,{productId:l.id,productTitle:l.title,showLabel:t.showLabel,isDesignerMode:n}):null},y=(0,s.memo)(A)},56398:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(15166),o=n(39706),d=n(24147),c=n(18913),u=n(42369),m=n(36535),p=n(71915),h=n(21010);const g=()=>{const e=(0,r.useCurrencyInfo)(),[t]=(0,o.wW)(d.Ul.ViewPrices),n=function(){const e=(0,u.fD)();if(!e)return null;const{discount:t,productDiscountInfo:n,subTotalExcludingDiscount:s}=e;return{discount:t,productDiscountInfo:n,subTotalExcludingDiscount:s}}(),s=(0,m.x)(e,null==n?void 0:n.discount,null==n?void 0:n.productDiscountInfo),i=t&&n&&null!==s,[a,g]=(0,c.KR)([i&&'ProductsOverview_SubTotalExcludingDiscount_AltText',i&&'Discount']).texts;return i?(0,h.jsxs)("span",{className:l().discountAndFromPrice,children:[(0,h.jsx)(p.A,{priceInfo:n.subTotalExcludingDiscount,currencyInfo:e,className:l().baseSubTotals,customAltText:a}),(0,h.jsx)("span",{className:l().discountValue,"aria-hidden":!0,children:`- ${s}`}),(0,h.jsx)("span",{className:"visually-hidden",children:`${s} ${g}`})]}):null},x=(0,s.withStyles)(l())((0,a.memo)(g))},5910:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(42369),o=n(15111),d=n(42346),c=n(39706),u=n(21010);const m=()=>{const e=function(){var e;const t=(0,r.fD)();return(null==t||null==(e=t.productDiscountInfo)?void 0:e.displayName)??null}(),[t]=(0,c.wW)(d.Ul.UseProductDiscounts);return t&&null!==e?(0,u.jsx)(o.A,{className:l().discountCodeLabel,label:e}):null},p=(0,s.withStyles)(l())((0,a.memo)(m))}
1,5702:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(15166),o=n(39706),d=n(24147),c=n(18913),u=n(42369),m=n(36535),p=n(21010);const h=()=>{const[e]=(0,o.wW)(d.Ul.ViewPrices),t=function(){const e=(0,r.useCurrencyInfo)(),t=(0,u.fD)();return t?(0,m.x)(e,t.discount,t.productDiscountInfo):null}(),n=e&&null!==t,[s]=(0,c.KR)([n&&'Discount']).texts;return n?(0,p.jsxs)("span",{className:l().discountBlock,children:[(0,p.jsx)("span",{className:"visually-hidden",children:`${t} ${s}`}),(0,p.jsx)("span",{"aria-hidden":!0,children:t}),(0,p.jsx)("span",{"aria-hidden":!0,className:l().discountValueTitle,children:s})]}):null},g=(0,s.withStyles)(l())((0,a.memo)(h))},29207:(e,t,n)=>{n.r(t),n.d(t,{default:()=>j});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(70358),o=n(42369),d=n(13803),c=n(39706),u=n(45107),m=n(37901),p=n(97328),h=n(24147),g=n(9656),x=n(68412),f=n(21010);const v=e=>{let{isDesignerMode:t,isDesignerViewMode:n}=e;const s=(0,o.fD)(),i=(0,o.aE)(),v=(0,o.xq)(),j=(0,a.useRef)(null),b=(0,r.useDispatch)(),k=(0,r.useSelector)((e=>{var t;return null==(t=e.basket.model)?void 0:t.editDocumentType})),L=(0,x.Gg)(),[S]=(0,c.wW)(h.Ul.ViewEstimatedAvailabilityDate),{id:C,isSupplementary:A,estimatedAvailability:y,uom:N}=s||{},_=C&&S&&(t&&!n||!v)&&!A&&!L&&k!==g.KG.Quote,I=(0,a.useMemo)((()=>!_||y?null:()=>{b((0,u.VU)(C))}),[_&&y,C]);return(0,p.aq)(j,I,300,{threshold:.6}),_?(0,f.jsx)("div",{className:l().estDates,children:(0,f.jsx)(m.h,{ref:j,estimatedAvailability:y,uomDescription:(0,d.P6)(N,null==i?void 0:i.uoms),placeholderClassName:l().estDatesPlaceholder})}):null},j=(0,s.withStyles)(l())((0,a.memo)(v))},43601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(42369),o=n(21010);const d=()=>{var e;const t=(0,r.fD)();return null!=t&&null!=(e=t.extendedTexts)&&e.length?(0,o.jsx)(o.Fragment,{children:t.extendedTexts.map(((e,t)=>{let{title:n}=e;return(0,o.jsx)("div",{className:l().extendedText,children:n},t)}))}):null},c=(0,s.withStyles)(l())((0,a.memo)(d))},36535:(e,t,n)=>{n.d(t,{x:()=>i});var s=n(15166);function i(e,t,n){return e?n?'percentage'in n.value?(0,s.formatAsPercentage)(n.value.percentage,e,!0,2):(0,s.formatAsPrice)(n.value.amount,e):t?(0,s.formatAsPercentage)(t,e,!0,2):null:null}},60839:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(76809),o=n(48598),d=n(42369),c=n(21010);const u=()=>{const e=(0,d.aE)();if(!e)return null;const{id:t,customerSpecificId:n}=e,s=(0,c.jsx)(r.O,{className:l().itemNumberPlaceholder});return(0,c.jsxs)("span",{className:l().itemNumber,children:[(0,c.jsx)("span",{className:l().productId,children:(0,c.jsx)(o.vv,{productId:t,placeholder:s})}),n&&(0,c.jsx)("span",{className:l().specificId,children:(0,c.jsx)(o.rF,{customerSpecificId:n,placeholder:s})})]})},m=(0,s.withStyles)(l())((0,a.memo)(u))},54444:(e,t,n)=>{n.r(t),n.d(t,{default:()=>u});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(48598),o=n(42369),d=n(21010);const c=e=>{var t;let{isDesignerViewMode:n}=e;const s=function(e){const t=(0,o.aE)(),n=(0,o.fD)(),s=(0,o.xq)();return!n||n.isSupplementary||s&&!1!==e?null:{uom:(null==n?void 0:n.uom)??null,uoms:(null==t?void 0:t.uoms)??null}}(n);return s?(0,d.jsx)("div",{className:l().minMaxStepQuantityInfo,children:(0,d.jsx)(r.Uj,{className:l().quantityInfo,uoms:s.uoms,uomId:null==(t=s.uom)?void 0:t.id})}):null},u=(0,s.withStyles)(l())((0,a.memo)(c))},34078:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(70358),o=n(42369),d=n(45107),c=n(48598),u=n(97328),m=n(68412),p=n(21010);const h=e=>{let{isDesignerMode:t,isDesignerViewMode:n}=e;const s=(0,o.fD)(),i=(0,o.xq)(),h=(0,a.useRef)(null),g=(0,r.useDispatch)(),x=(0,m.Gg)(),{id:f,isSupplementary:v,priceExtraFields:j}=s||{},b=!!f&&(t&&!n||!i)&&!v&&!x,k=(0,a.useMemo)((()=>b&&void 0===j?()=>{g((0,d.uk)(f))}:null),[b&&j,f]);return(0,u.aq)(h,k,300,{threshold:.6}),b?(0,p.jsx)("div",{className:l().priceExtraFields,ref:h,children:null==j?void 0:j.map(((e,t)=>'price'in e?(0,p.jsx)(c.me,{name:e.name,className:l().field,price:e.price},t):(0,p.jsx)(c.me,{name:e.name,className:l().field,percentage:e.percentage},t)))}):null},g=(0,s.withStyles)(l())((0,a.memo)(h))},34291:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(42346),o=n(39706),d=n(42369),c=n(48598),u=n(21010);const m=e=>{let{isDesignerViewMode:t}=e;const n=function(e){const t=(0,d.aE)(),n=(0,d.fD)();return(0,d.xq)()&&!1!==e?null:{pricePerBaseUom:(null==n?void 0:n.pricePerBaseUom)??null,baseUom:(null==t?void 0:t.baseUom)??null}}(t),[s]=(0,o.wW)(r.Ul.ViewUnitOfMeasure);if(!s||!n)return null;const{pricePerBaseUom:i,baseUom:a}=n;return null!==i&&null!=a&&a.description?(0,u.jsx)("div",{className:l().pricePerBaseUom,children:(0,u.jsx)(c.AT,{className:l().baseUomPrice,pricePerBaseUom:i,baseUomDescription:a.description})}):null},p=(0,s.withStyles)(l())((0,a.memo)(m))},14920:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var s=n(25498),i=n(12922),l=n(32525),a=n.n(l),r=n(70358),o=n(45107),d=n(48598),c=n(15166),u=n(6887),m=n(68412),p=n(97328),h=n(34160),g=n(21010);const x=e=>{let{line:t,uom:n}=e;const i=(0,h.I)(),l=(0,r.useSelector)((e=>e.basket.updated.updaterId)),x=(0,m.lW)(),{setLineQuantity:f,resetLineQuantity:v}=(0,u.HJ)(),j=(0,u.Nv)(t.id),b=(0,s.useMemo)((()=>(0,d.Hj)(n&&'quantityStep'in n?n:null)),[n]),k=(0,c.useCultureName)(),L=(0,c.getNumberDecimalsSeparator)(k),S=(0,p.$q)(`${t.id}_qty`,i),C=(0,s.useCallback)((e=>{const{value:n,isValid:s}=e;t.quantity===n&&s?v(t.id):f(t.id,e)}),[t.quantity,t.id]);(0,s.useEffect)((()=>{v(t.id)}),[t.quantity]),(0,s.useEffect)((()=>{l!==o.Xm.BasketLineComment&&l!==o.Xm.Sync&&v(t.id)}),[x]);const A=(null==j?void 0:j.value)??t.quantity;return(0,g.jsx)(d.Kc,{className:a().quantity,id:S,quantity:b,value:A,onChange:C,separator:L})},f=(0,i.withStyles)(a())((0,s.memo)(x));var v=n(18913);const j=e=>{let{quantity:t}=e;return(0,g.jsxs)("div",{className:a().quantityReadOnly,children:[(0,g.jsx)("span",{className:"visually-hidden",children:(0,g.jsx)(v.gJ,{textKey:"Quantity"})}),t]})},b=(0,i.withStyles)(a())((0,s.memo)(j));var k=n(42369);const L=()=>{var e;const t=(0,k.aE)(),n=(0,k.fD)(),s=(0,k.xq)();if(!t||!n)return null;if(n.isSupplementary||s&&!s.isSingleProduct)return(0,g.jsx)(b,{quantity:n.quantity});const i=s?n.uom:null==(e=t.uoms)?void 0:e.find((e=>{var t;return e.id===(null==(t=n.uom)?void 0:t.id)}));return(0,g.jsx)(f,{line:n,uom:i})},S=(0,s.memo)(L),C=()=>{const e=(0,k.FW)();return e?(0,g.jsx)(b,{quantity:e.quantity}):(0,g.jsx)(S,{})},A=(0,s.memo)(C)},54157:(e,t,n)=>{n.r(t),n.d(t,{default:()=>u});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(42369),o=n(18720),d=n(21010);const c=e=>{let{model:t}=e;const n=(0,r.xq)(),s=(0,r.aE)();return s&&(null==n?void 0:n.isActionLine)?(0,d.jsx)(o.mo,{className:l().reconfigureButton,productC
1onfiguration:n.configuration,productTitle:(0,r.rz)(s.id,s.title,s.variantTitle),showLabel:t.showLabel}):null},u=(0,s.withStyles)(l())((0,a.memo)(c))},97256:(e,t,n)=>{n.r(t),n.d(t,{default:()=>u});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(42369),o=n(48598),d=n(21010);const c=()=>{const e=function(){const e=(0,r.aE)(),t=(0,r.xq)();return!t||t.isSingleProduct||t.isActionLine?(null==e?void 0:e.reviews)??(null==t?void 0:t.configuration.masterProduct.reviews)??null:null}();if(!e)return null;const{avg:t,total:n}=e;return(0,d.jsx)("div",{className:l().reviewsSummary,children:(0,d.jsx)(o.qr,{className:l().reviewsTotal,avg:t,total:n,summaryTextKey:"Basket_ReviewsSummaryCount",ariaSummaryTextKey:"Aria_Basket_ReviewSummaryCount"})})},u=(0,s.withStyles)(l())((0,a.memo)(c))},40424:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var s=n(25498),i=n(42369),l=n(70358),a=n(12922),r=n(32525),o=n.n(r),d=n(44892),c=n.n(d),u=n(18913),m=n(10170),p=n(48099),h=n(45107),g=n(26821),x=n(84947),f=n(39706),v=n(42346),j=n(76809),b=n(21010);const k=(0,a.withStyles)(o())((e=>{let{contentId:t,agreementsLines:n,selectedSalesAgreementLine:i,basketLineId:a,basketLineUomId:r}=e;const[d]=(0,f.wW)(v.Ul.ViewUnitOfMeasure),c=(0,l.useSelector)((e=>e.settings.product.allowUOMSelection)),{setLineAgreement:u,deleteLineAgreement:m,clearLineAgreement:p}=(0,x.A)();let h=n;c&&d||(h=h.filter((e=>{var t;return!e.uom||(null==(t=e.uom)?void 0:t.id.toUpperCase())===(null==r?void 0:r.toUpperCase())}))),(0,s.useEffect)((()=>()=>p(a)),[i]);return(0,b.jsx)(g.Vp,{id:t,className:o().lineAgreementSelector,agreementsLines:h,selectedSalesAgreementLine:i,canViewUom:d,onChange:e=>{var t,n;n=i,!(t=e)&&!n||t&&n&&t.id===n.id&&t.salesAgreementId===n.salesAgreementId?p(a):e?u(a,e):m(a)},showLabel:!0,placeholder:(0,b.jsx)(j.O,{className:o().lineAgreementSelectorPlaceholder})})}));var L=n(97328),S=n(35547);const C=e=>{let{isPreview:t,blockId:n,productId:s,line:{id:i,salesAgreementsLines:a,salesAgreementLine:r,availableSalesAgreementLines:d,uom:g},appliedSalesAgreementIds:x}=e;const C=(0,l.useDispatch)(),[A]=(0,f.wW)(v.Ul.UseMultipleSalesAgreements),{texts:[y,N,_,I],loaded:D}=(0,u.KR)([r&&(A?'Aria_AgreementIdAndLine_Label':'Aria_AgreementLine_Label'),'ButtonText_Change','Aria_Basket_ChangeSalesAgreement_Label',!r&&'SalesAgreementNotUsed']);return null!=a&&a.length?(0,b.jsx)("div",{className:o().lineAgreementBlock,children:(0,b.jsx)(k,{contentId:(0,L.$q)(i,n),agreementsLines:a,selectedSalesAgreementLine:r,basketLineId:i,basketLineUomId:null==g?void 0:g.id})}):(0,b.jsxs)("div",{className:o().lineAgreementBlock,children:[r?(0,b.jsxs)(m.N_,{to:m.OR.forSalesAgreement(r.salesAgreementId,r.id),className:o().lineAgreementId,"aria-label":(0,p.vX)(y,A?[r.salesAgreementId,r.id]:[r.id]),onClick:t?()=>(C((0,S.PE)()),!1):null,children:[A&&`${r.salesAgreementId} - `,r.id]}):(0,b.jsx)("span",{className:o().lineAgreementId,children:D?I:(0,b.jsx)(j.O,{className:o().lineAgreementTextPlaceholder})}),(0,b.jsx)("button",{type:"button",className:c().link+' '+o().lineAgreementChange,"aria-label":_,onClick:()=>{if(t)return void C((0,S.PE)());if(null==x||!x.length)return;const e=function(e,t){if(null==t||!t.length)return e;const n=[...e];for(const{salesAgreementId:e}of t)n.includes(e)||n.push(e);return n}(x,d);C((0,h.cY)(e,s,i))},children:D?N:(0,b.jsx)(j.O,{className:o().lineAgreementTextPlaceholder})})]})},A=(0,a.withStyles)(o(),c())((0,s.memo)(C));var y=n(88936);const N=e=>{var t;let{id:n,isDesignerMode:s}=e;const[a]=(0,f.wW)(v.Ul.UseSalesAgreements),r=(0,l.useSelector)((e=>{var t;return(null==(t=e.basket.appliedSalesAgreements)?void 0:t.map((e=>e.id)))??null}),l.shallowEqual),o=(0,i.fD)(),d=(0,i.aE)(),c=(0,y.K)();return(s||a&&(c||!(null==r||!r.length)))&&d&&null!=o&&null!=(t=o.availableSalesAgreementLines)&&t.length?(0,b.jsx)(A,{isPreview:c,blockId:n,productId:d.id,line:o,appliedSalesAgreementIds:r}):null},_=(0,s.memo)(N)},24489:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var s=n(25498),i=n(42369),l=n(6887),a=n(48598),r=n(58431),o=n(39706),d=n(24147),c=n(70358),u=n(9656),m=n(12922),p=n(32525),h=n.n(p),g=n(77455),x=n(21010);const f=(0,m.withStyles)(h())((e=>{let{divider:t,children:n}=e;return(0,x.jsx)("span",{className:`${h().stockIndicator} ${g.R[t]}`,children:n})}));var v=n(68412);const j=e=>{let{model:{divider:t},isDesignerMode:n,isDesignerViewMode:s}=e;const m=(0,i.fD)(),p=(0,i.aE)(),h=(0,i.xq)(),g=(0,l.Nv)((null==m?void 0:m.id)??''),j=(0,c.useSelector)((e=>{var t;return null==(t=e.basket.model)?void 0:t.editDocumentType})),b=(0,v.Gg)(),[k]=(0,o.wW)(d.Ul.ViewCheckoutStock);if(null==(null==m?void 0:m.inventory)||null!=m&&m.isSupplementary||b||j===u.KG.Quote||!k)return null;if((!n||s)&&h)return(0,x.jsx)(f,{divider:t,children:(0,x.jsx)(a.H2,{inventory:m.inventory})});if(null!=p&&p.stockLevels){const e=null!=g&&g.value?+g.value:m.quantity;return(0,x.jsx)(f,{divider:t,children:(0,x.jsx)(r.e,{inventory:m.inventory,quantity:e,stockLevels:p.stockLevels})})}return null},b=(0,s.memo)(j)},45668:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(70358),o=n(10170),d=n(2272),c=n(48598),u=n(42369),m=n(21010);const p=()=>{const e=(0,r.useSelector)((e=>{var t;return null==(t=e.settings.product)?void 0:t.noImage.small})),t=(0,u.aE)();if(!t)return null;const{id:n,title:s,url:i,imageUrl:a}=t;
1return i?(0,m.jsx)(d.XB,{children:t=>(0,m.jsx)(o.N_,{className:l().productThumbnail,url:i,to:o.OR.forProduct(n),tabIndex:-1,onClick:t,"aria-hidden":!0,children:(0,m.jsx)(c.s5,{src:a,noImageSrc:e,title:s})})}):(0,m.jsx)("span",{className:l().productThumbnail,"aria-hidden":!0,children:(0,m.jsx)(c.s5,{src:a,noImageSrc:e,title:s})})},h=(0,s.withStyles)(l())((0,a.memo)(p))},79665:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(10170),o=n(42369),d=n(2272),c=n(21010);const u=()=>{const{title:e,url:t,id:n}=function(){const e=(0,o.aE)(),t=(0,o.FW)();return{id:(null==e?void 0:e.id)??null,url:(null==e?void 0:e.url)??null,title:(null==e?void 0:e.title)??(null==t?void 0:t.title)??null}}(),s=e&&(0,c.jsx)("h2",{className:l().lineTitle,children:e});return t?(0,c.jsx)(d.XB,{children:e=>(0,c.jsx)(r.N_,{onClick:e,url:t,to:r.OR.forProduct(n),className:l().lineTitleLink,children:s})}):s},m=(0,s.withStyles)(l())((0,a.memo)(u))},55122:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(15166),o=n(39706),d=n(24147),c=n(42369),u=n(18913),m=n(71915),p=n(21010);const h=()=>{const e=(0,r.useCurrencyInfo)(),[t]=(0,o.wW)(d.Ul.ViewPrices),n=x(),[s]=(0,u.KR)([t&&'ProductsOverview_Subtotal_AltText']).texts;return t?(0,p.jsx)(m.A,{priceInfo:n,currencyInfo:e,className:l().lineTotalPrice,customAltText:s}):null},g=(0,s.withStyles)(l())((0,a.memo)(h)),x=()=>{const e=(0,c.fD)(),t=(0,c.FW)();return(null==e?void 0:e.subTotal)??(null==t?void 0:t.subTotal)}},24856:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var s=n(12922),i=n(32525),l=n.n(i),a=n(77455),r=n(42346),o=n(39706),d=n(25498),c=n(42369),u=n(48598),m=n(76809),p=n(18913),h=n(21010);const g=e=>{let{model:{divider:t}}=e;const[n]=(0,o.wW)(r.Ul.ViewUnitOfMeasure),s=(0,c.fD)(),i=(0,c.aE)();return n&&null!=s&&s.uom?(0,h.jsxs)("span",{className:`${l().unitOfMeasure} ${a.R[t]}`,children:[(0,h.jsx)("span",{className:"visually-hidden",children:(0,h.jsx)(p.gJ,{textKey:"UnitOfMeasure"})}),(0,h.jsx)(u.Ms,{id:s.uom.id,description:(0,c.P6)(s.uom,null==i?void 0:i.uoms),placeholder:(0,h.jsx)(m.O,{className:l().unitOfMeasurePlaceholder})})]}):null},x=(0,s.withStyles)(l())((0,d.memo)(g))},12447:(e,t,n)=>{n.r(t),n.d(t,{default:()=>j});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(15166),o=n(39706),d=n(24147),c=n(42369),u=n(13803),m=n(18913),p=n(71915),h=n(48598),g=n(76809),x=n(21010);const f=(0,s.withStyles)(l())((e=>{let{children:t}=e;return(0,x.jsx)("span",{className:l().unitPrice,children:t})})),v=e=>{let{model:{showLabel:t}}=e;const n=(0,r.useCurrencyInfo)(),[s,i]=(0,o.wW)(d.Ul.ViewPrices,d.Ul.ViewUnitOfMeasure),{priceInfo:a,uomInfo:c}=b(),u=s&&null!=a,v=i&&null!==c,j=t&&u,[k,L,S]=(0,m.LW)([j&&v&&'Basket_UnitPricePerUom',j&&!v&&'Basket_UnitPriceEach',u&&'Aria_Basket_Price_Label']).texts;if(!u)return null;const C=(0,x.jsx)(p.A,{priceInfo:a,currencyInfo:n,customAltText:S});if(!t)return(0,x.jsx)(f,{children:C});if(!v)return(0,x.jsx)(f,{children:(0,m.g_)(L,[C],!0)});const A=(0,x.jsx)(h.Ms,{id:c.id,description:c.description||'',placeholder:(0,x.jsx)(g.O,{className:l().unitPriceUomPlaceholder})});return(0,x.jsx)(f,{children:(0,m.g_)(k,[C,A],!0)})},j=(0,s.withStyles)(l())((0,a.memo)(v)),b=()=>{const e=(0,c.fD)(),t=(0,c.aE)(),n=(0,c.FW)();return{priceInfo:(null==e?void 0:e.priceInfo)??(null==n?void 0:n.price),uomInfo:null!=e&&e.uom?{id:e.uom.id,description:(0,u.P6)(e.uom,null==t?void 0:t.uoms)}:null}}},87892:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(42346),o=n(39706),d=n(48598),c=n(42369),u=n(21010);const m=()=>{const e=function(){const e=(0,c.aE)(),t=(0,c.fD)();return{uom:(null==t?void 0:t.uom)??null,uoms:(null==e?void 0:e.uoms)??null,baseUom:(null==e?void 0:e.baseUom)??null}}(),[t]=(0,o.wW)(r.Ul.ViewUnitOfMeasure);return t?(0,u.jsx)("div",{className:l().uomBaseQuantity,children:(0,u.jsx)(d.v4,{className:l().quantityValue,uom:e.uom,uoms:e.uoms,baseUom:e.baseUom})}):null},p=(0,s.withStyles)(l())((0,a.memo)(m))},32996:(e,t,n)=>{n.r(t),n.d(t,{default:()=>u});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(42369),o=n(48598),d=n(21010);const c=()=>{const e=(0,r.aE)();return null!=e&&e.variantTitle?(0,d.jsx)(o.j3,{variantTitle:e.variantTitle,className:l().productVariant}):null},u=(0,s.withStyles)(l())((0,a.memo)(c))},77103:(e,t,n)=>{n.r(t),n.d(t,{default:()=>k});var s=n(70358),i=n(45107),l=n(39706),a=n(24147),r=n(12922),o=n(32525),d=n.n(o),c=n(27529),u=n.n(c),m=n(18913),p=n(59446),h=n(78913),g=n(34814),x=n(11483),f=n(21010);const v=['ButtonText_Apply','DiscountCode','Aria_Basket_SubmitDiscountCode_Label','Aria_Basket_DiscountCodeApplied_Description'],j=(0,r.withStyles)(d(),u())((0,s.connect)((e=>{let{basket:{modifiedDate:t,model:n}}=e;return{line:b(n),modifiedDate:t}}))((e=>{let{line:t,id:n}=e;const{submitBasket:s}=(0,p.sd)(),i=(0,h.Y)(),{texts:[l,a,r,o],loaded:c}=(0,m.KR)(v);if(!c)return null;const j=!!t,b=j||i,k="discountDsc_"+n;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),b)return;const t=e.currentTarget.elements.code;t.value&&(s(t.value),t.value='')},className:`${d().promotionForm} ${i?d().inactive:''}`,children:[(0,f.jsx)("div",{className:`${u().tbx} ${d().inputWrapper}`,children:(0,f.jsx)("input",{name:"code",maxLength:20,placeholder:a})}),(0,f.jsx)(g.$n,{type:b?'button':'submit',size:"sm",icon:!1,"aria-label":r,"aria-disabled":b,"aria-describedby":j?k:null,children:l}),j&&(0,f.jsx)("div",{id:k,className:"visually-hidden",children:o})]}),j&&(0,f.jsx)("div",{className:d().tagsWrapper,children:(0,f.jsx)(x.v,{text:t.title||t.code,isRemovable:!0,onRemove:()=>{s('')}})})]})})));function b(e){var t;const n=e&&(0,i.S2)(e)?null==(t=e.discount)?void 0:t.promotion:null;return null!=n&&n.automatic?null:n}const k=e=>{let{isDesignerMode:t,id:n}=e;
1const[r]=(0,l.wW)(a.Ul.UsePromotionCodes),o=(0,s.useSelector)((e=>{let{basket:t}=e;return(0,i.KR)(t)}));return t||!o&&r?(0,f.jsx)(j,{id:n}):null}},60028:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(70358),o=n(76809),d=n(34814),c=n(39706),u=n(24147),m=n(45107),p=n(17005),h=n(78913),g=n(59446),x=n(21010);const f=(0,s.withStyles)(l())((e=>{let{isDesignerMode:t}=e;const n=(0,r.useDispatch)(),[s]=(0,c.wW)(u.Ul.TransferPunchoutBasket),{basketDisabled:i,basketUpdating:f,validation:v}=(0,r.useSelector)((e=>{var t;let{basket:n}=e;const s=n.model&&(0,m.S2)(n.model)?n.model:null;return{basketDisabled:!s||(0,m.KR)(n)||s.isBlocked||!1===(null==(t=s.basketMinimumPrice)?void 0:t.isSatisfied)||s.creditLimit.validationResult===m.Hl.Error,basketUpdating:n.updating,validation:null==s?void 0:s.validation}}),r.shallowEqual),j=(0,h.Y)(),{submitModifiedLines:b}=(0,g.sd)(),k=(0,a.useRef)(!1),L=v&&(0,m.Nn)(m.P7.Punchout,v)||i||j;if((0,a.useEffect)((()=>{k.current&&!f&&n((0,p.bL)())}),[f]),!t&&!s)return null;return(0,x.jsx)(d.Oi,{textKey:"Punchout",onClick:async()=>{if(t)return;const[e,s]=await b(!0);e&&(s>0?k.current=!0:n((0,p.bL)()))},size:"lg",theme:"action",disabled:L,className:l().btnPunchout,placeholder:(0,x.jsx)(o.O,{className:l().btnCheckoutPlaceholder})})}))},76995:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var s=n(12922),i=n(32525),l=n.n(i),a=n(25498),r=n(70358),o=n(18913),d=n(6430),c=n(74397),u=n(45107),m=n(59446),p=n(88936),h=n(78913),g=n(59859),x=n(68412),f=n(21010);const v=(0,s.withStyles)(l())((e=>{let{id:t,isDesignerMode:n}=e;const s=function(){const e=(0,o.LW)(['Search_SearchPrefix','ButtonText_AddToBasket','Aria_AddToBasket_Label','Aria_ConfigurableProduct_Details_Label','Loading','QuickOrder_ProductNotFound','ProductCannotBeOrderedAtThisTime','Aria_QuickOrderSearch_Label']).texts;return(0,a.useMemo)((()=>{const[t,n,s,i,l,a,r,d]=e;return{searchBoxPlaceholder:(0,o.g_)(t),addBtn:(0,o.g_)(n),addBtnAriaLabel:s,configureBtnAriaLabel:i,loadingText:(0,o.g_)(l),productNotFoundText:(0,o._V)(a),productCannotBeOrderedMessage:(0,o._V)(r),ariaLabel:(0,o.g_)(d)}}),[e])}(),i=(0,r.useDispatch)(),{basketDisabled:v,quickOrderMaxLines:j,modifiedDate:b}=(0,r.useSelector)((e=>{var t;let{basket:n,settings:s}=e;return{basketDisabled:n.isErrorMode,quickOrderMaxLines:null==(t=s.basket)?void 0:t.quickOrderMaxLines,modifiedDate:n.modifiedDate}}),r.shallowEqual),{getModifiedLines:k}=(0,m.sd)(),{productAddDisabled:L,setProductAddDisabled:S}=(0,g.K)(),C=(0,x.$B)(b),A=(0,h.Y)(),y=v||A,N=(0,a.useCallback)((e=>{L||(i((0,u.Jt)([e],k(),j)),C(),S(!0))}),[L,j]);return(0,f.jsx)(d.j,{id:t,texts:s,onProductAdd:(0,p.x)(N),productAddDisabled:L,productClickTrackingSource:c.jr.QuickOrder,disabled:y||n,className:l().quickOrder,showSalesAgreementIndicator:!0})}))},3559:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var s=n(12922),i=n(32525),l=n.n(i),a=n(70358),r=n(65300),o=n(10170),d=n(39706),c=n(24147),u=n(9656),m=n(45107),p=n(78913),h=n(21010);const g=(0,s.withStyles)(l())((e=>{let{isDesignerMode:t}=e,[n,s]=(0,d.US)([c.Ul.CreateQuote,c.Ul.CreateOrder]).abilities.map((e=>e!==c.Qs.NotAvailable));const{basketDisabled:i,editDocumentType:g,validation:x,isAgreementsApplied:f,isBasketMinimumPriceSatisfied:v}=(0,a.useSelector)((e=>{var t,n;let{basket:s}=e;return{basketDisabled:(0,m.KR)(s),editDocumentType:s.model?s.model.editDocumentType:null,validation:s.model&&(0,m.S2)(s.model)?s.model.validation:void 0,isAgreementsApplied:!(null==(t=s.appliedSalesAgreements)||!t.length),isBasketMinimumPriceSatisfied:s.model&&(0,m.S2)(s.model)?null==(n=s.model.basketMinimumPrice)?void 0:n.isSatisfied:null}}),a.shallowEqual),j=(0,p.Y)(),b=x&&(0,m.Nn)(m.P7.Quote,x)||i||j||!1===v;return g===u.KG.Quote?(n=!0,s=!1):g===u.KG.Order&&(n=!1),t||n&&!f?(0,h.jsx)(r.E$,{textKey:"GetQuote",to:o.OR.forCheckout(!0),size:s?'sm':'lg',theme:s?'regular':'action',disabled:b,className:l().btnQuote}):null}))},94096:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var s=n(12922),i=n(32525),l=n.n(i),a=n(44892),r=n.n(a),o=n(70358),d=n(34814),c=n(76809),u=n(3392),m=n(59446),p=n(45107),h=n(78913),g=n(21010);const x=(0,s.withStyles)(l(),r())((()=>{const e=(0,o.useSelector)((e=>(0,p.KR)(e.basket))),{submitBasket:t}=(0,m.sd)(),n=(0,h.Y)(),s=e||n,{text:i,loaded:a}=(0,d.V2)('RecalculateBasket');return a?(0,g.jsxs)("button",{className:`${r().link} ${l().recalculateBtn}`,type:"button","aria-disabled":s,onClick:s?null:()=>t(),tabIndex:s?-1:null,children:[(0,g.jsx)("span",{className:l().iconWrapper,children:(0,g.jsx)(u.Vv,{className:l().icon})}),i]}):(0,g.jsx)(c.O,{})}))},61210:(e,t,n)=>{n.r(t),n.d(t,{default:()=>W});var s=n(12922),i=n(32525),l=n.n(i),a=n(70358),r=n(39706),o=n(24147),d=n(45107);const c=1;var u=n(65300),m=n(10170),p=n(18913),h=n(76809),g=n(21010);const x=(0,s.withStyles)(l())((e=>{let{disabled:t,linkStyle:n}=e;const{texts:[s],loaded:i}=(0,p.KR)(['UseSalesAgreement']),a=n===c;return i?a?(0,g.jsx)(u.z9,{to:m.OR.forSalesAgreements,disabled:t,children:s}):(0,g.jsx)(m.N_,{to:m.OR.forSalesAgreements,className:l().useAgreement,disabled:t,children:s}):(0,g.jsx)(h.O,{className:a?l().agreementBtnPlaceholder:l().agreementLinkPlaceholder})}));var f=n(78913),v=n(44892),j=n.n(v),b=n(25498),k=n(34728),L=n(52657),S=n(298),C=n(3392),A=n(48099),y=n(60196),N=n(58431);const _=e=>{let{id:t,title:n,expirationDate:s,isAppliedToLines:i}=e;return(0,g.jsx)(N.T,{className:l().agreementItem,id:t,title:n,expirationDate:s,isAppliedToLines:i,showIdAsLink:!0})},I=(0,s.withStyles)(l())((0,b.memo)(_));var D=n(84947),P=n(70663);const w=e=>{let{id:t,showLabel:n,isAppliedToLines:s}=e;const i=(0,a.useDispatch)(),{showConfirmation:r,clearConfirmation:o,confirmationModal:c}=(0,P.A)(),[u,m,h]=(0,p.KR)(['YourAgreementLineSelectionsWillBeLostMessage',n&&'ButtonText_Remove','Aria_Basket_RemoveSalesAgreement_Label']).texts;return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("button",{type:"button",className:`${j().link} ${l().removeAgreement}`,onClick:()=>(e=>{if(!s)return void i((0,d.r6)(e));r((()=>{i((0,d.r6)(e)),o()}),{title:'Info',ariaLabel:'Aria_YourAgreementLineSelectionsWillBeLost'},u,{closeText:'ButtonText_Close',okText:'ButtonText_Continue'},void 0,l().confirmationPopup)})(t),"aria-label":(0,A.vX)(h,[t]),children:[(0,g.jsx)(C.Dx,{className:l().agreementIcon}),n&&(0,g.jsx)("span",{children:m})]}),c]})},T=(0,s.withStyles)(l(),j())((0,b.memo)(w)),B=e=>{let{isSingleAgreement:t}=e;const{texts:[n],loaded:s}=(0,p.KR)([t?'AppliedSalesAgreement':'AppliedSalesAgreements']);return s?(0,g.jsx)("h3",{children:n}):(0,g.jsx)(h.O,{className:l().agreementTitlePlaceholder})},M=(0,s.withStyles)(l())((0,b.memo)(B)),R=e=>{let{id:t,title:n,expirationDate:s,isAppliedToLines:i,blockId:d}=e;const[c,u]=(0,b.useState)(!1),x=(0,a.useDispatch)(),{clearLineAgreements:f}=(0,D.A)(),[v]=(0,r.wW)(o.Ul.AssignAgreementLineAutomatically),N=!i,{texts:[_,P,w,B,R,E,O,U,V],loaded:W}=(0,p.KR)(['Actions','Aria_Basket_ActionButtons_Label','ButtonText_Change','Aria_Basket_ChangeSalesAgreement_Label',v&&'ApplyAgreementLinesAutomatically',v&&'Aria_Basket_ApplySalesAgreementTerms_Label',N&&'AgreementHasNotEffectToCurrentBasket',N&&'AgreementHasNoEffectOnCurrentBasket_Action',N&&'Aria_AgreementHasNoEffectOnCurrentBasket_ActionLabel']),q=(0,g.jsxs)(g.Fragment,{children:[W?_:(0,g.jsx)(h.O,{className:l().agreementActionsPlaceholder}),(0,g.jsx)(C.mj,{})]});return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(M,{isSingleAgreement:!0}),N&&(0,g.jsx)("div",{className:l().agreementAlertWrapper,children:(0,g.jsx)(y.hZ,{className:l().agreementAlert,action:(0,g.jsx)(y.oG,{className:l().agreementAlertBtn,onClick:()=>x((0,k.VJ)(m.OR.forSalesAgreement(t))),"aria-label":(0,A.vX)(V,[t]),children:U}),children:O})}),(0,g.jsxs)("div",{className:l().singleAgreement,children:[(0,g.jsx)(I,{id:t,title:n,expirationDate:s}),(0,g.jsx)("div",{className:l().agreementActions,children:(0,g.jsx)(S.ms,{headerClassName:l().agreementActionsHeader,id:`${d}_dDown`,header:q,theme:"tooltip",placement:"bottom",opened:c,setOpened:u,togglerLabel:P,noCaretIcon:!0,showArrow:!0,children:(0,g.jsxs)("div",{className:l().agreementActionsBody,onClick:e=>{var t;return(null==(t=e.target)?void 0:t.closest('button, a'))&&u(!1)},children:[(0,g.jsx)(T,{id:t,isAppliedToLines:i,showLabel:!0}),(0,g.jsxs)(m.N_,{to:m.OR.forSalesAgreements,"aria-label":B,className:l().changeAgreement,children:[(0,g.jsx)(C.Z6,{className:l().agreementIcon}),(0,g.jsx)("span",{children:w})]}),v&&(0,g.jsxs)("button",{type:"button",className:`${j().link} ${l().applyAgreementLine}`,onClick:()=>{f(),x((0,L.oX)())},"aria-label":(0,A.vX)(E,[t]),children:[(0,g.jsx)(C.iI,{className:l().agreementIcon}),(0,g.jsx)("span",{children:R})]})]})})})]})]})},E=(0,s.withStyles)(l(),j())((0,b.memo)(R)),O=e=>{let{appliedAgreements:t}=e;const n=(0,b.useMemo)((()=>t.some((e=>{let{isAppliedToLines:t}=e;return!t}))),[t]);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(M,{isSingleAgreement:1===t.length}),n&&(0,g.jsx)(y.hZ,{className:l().agreementAlert,children:(0,g.jsx)(p.gJ,{textKey:"AgreementsHaveNoEffectOnCurrentBasket"})}),(0,g.jsx)("ul",{className:l().agreementsList,children:t.map((e=>{let{id:t,expirationDate:n,title:s,isAppliedToLines:i}=e;return(0,g.jsxs)("li",{children:[(0,g.jsx)(I,{id:t,expirationDate:n,title:s,isAppliedToLines:i}
1),(0,g.jsx)(T,{id:t,isAppliedToLines:i})]},t)}))})]})},U=(0,s.withStyles)(l())((0,b.memo)(O)),V=e=>{let{blockId:t,appliedAgreements:n,linkStyle:s}=e;const i=(0,f.Y)(),[a]=(0,r.wW)(o.Ul.UseMultipleSalesAgreements);if(!!!n.length)return(0,g.jsx)(x,{linkStyle:s,disabled:i});const d=`${l().appliedSalesAgreements} ${i?l().inactive:''}`;if(!a){const[{id:e,title:s,expirationDate:i,isAppliedToLines:l}]=n;return(0,g.jsx)("div",{className:d,children:(0,g.jsx)(E,{blockId:t,id:e,title:s,expirationDate:i,isAppliedToLines:l})})}return(0,g.jsxs)("div",{className:d,children:[(0,g.jsx)(U,{appliedAgreements:n}),(0,g.jsx)(x,{linkStyle:s,disabled:i})]})},W=(0,s.withStyles)(l())((e=>{let{model:t,isDesignerMode:n,id:s}=e;const[i]=(0,r.wW)(o.Ul.UseSalesAgreements),l=(0,a.useSelector)((e=>{var t;return(0,d.KC)(e.basket)||!(null==(t=e.basket.model)||!t.editDocumentId)})),c=(0,a.useSelector)((e=>e.basket.appliedSalesAgreements||[]),a.shallowEqual);return n||!l&&i?(0,g.jsx)(V,{blockId:s,appliedAgreements:c,linkStyle:t.linkStyle}):null}))},83953:(e,t,n)=>{n.r(t),n.d(t,{default:()=>C});var s=n(12922),i=n(32525),l=n.n(i),a=n(70358),r=n(20573),o=n(18913),d=n(30901),c=n(15166),u=n(81412),m=n(39706),p=n(24147),h=n(88936),g=n(45107),x=n(78913),f=n(41664),v=n(15111),j=n(21010);const b=e=>{let{className:t,label:n,value:s}=e;return(0,j.jsxs)("li",{className:t,children:[(0,j.jsx)("div",{children:n}),(0,j.jsx)("div",{children:s})]})};var k=n(50962),L=n(68412);const S=e=>{var t,n;let{showUnitTotal:s,isDesignerMode:i,id:S}=e;const{basket:C,currencyInfo:A,taxSettings:y,totalProductsCounter:N}=(0,a.useSelector)((e=>{let{basket:t,settings:n}=e;return{basket:t.model,currencyInfo:n.currency,taxSettings:n.tax,totalProductsCounter:n.basket.totalProductsCounter}}),a.shallowEqual),_=(0,L.Gg)(),[I]=(0,m.wW)(p.Ul.ViewPrices),D=(0,h.K)(),P=(0,x.Y)();if(!C||!(0,g.S2)(C))return null;const{totals:w,shippingCost:T,paymentCost:B,discount:M,tax:R}=C,E=s&&C.totalCount&&(0,j.jsx)("li",{children:(0,j.jsx)("div",{className:l().totalUnit,children:(0,j.jsx)(o.gJ,{textKey:"Basket_UnitTotal",formatWith:[C.totalCount,C.productLines.totalCount]})})}),O=P?`${l().totals} ${l().inactive}`:l().totals;if(!w||!C.totalCount||!I)return E?(0,j.jsx)("ul",{className:O,children:E}):null;const U=(0,c.getFormatPrice)(A,!1),V=N===f.B6.Items?(0,j.jsx)(o.gJ,{textKey:"Basket_ItemsCount",formatWith:[C.totalCount]}):(0,j.jsx)(o.gJ,{textKey:"Basket_ProductLinesCount",formatWith:[C.productLines.totalCount]}),W=(null==(t=M.promotion)?void 0:t.type)===g.mW.ProductDiscount;return(0,j.jsxs)("ul",{className:O,children:[$(V,w.sub,l().items),!!M.invoice&&$((0,j.jsx)(o.gJ,{textKey:"InvoiceDiscount"}),-M.invoice,l().invoiceDiscount),(null==(n=M.promotion)?void 0:n.type)===g.mW.FreeShippingOnly?function(){const e=(0,j.jsx)(d.A,{blockId:S}),t=null!=T&&T.freeShippingDiscountApplied?(0,j.jsx)("div",{className:l().freeLabel,children:(0,j.jsx)(o.gJ,{textKey:"FreeCosts"})}):null!=T&&T.price?q(T.price):u.JZ;return(0,j.jsx)(b,{className:`${l().shippingCost} ${l().freeShipping}`,label:(0,j.jsx)(v.A,{label:e,title:M.promotion.automatic?M.promotion.title:null}),value:t})}():!(null==T||!T.price)&&$((0,j.jsx)(d.A,{blockId:S}),T.price,l().shippingCost),B&&!!B.price&&$((0,j.jsx)(o.gJ,{textKey:"PaymentCosts"}),B.price,l().paymentCost),!W&&F(),!!w.roundOff&&$((0,j.jsx)(o.gJ,{textKey:"RoundOff"}),w.roundOff,l().roundOff),y.totalExclTax&&K(w.priceExcludingTax,!0),y.amountPosition===r.dq.Below&&K(w.price),y.mode!==r.pp.Hide&&(y.mode===r.pp.Detailed?R.taxes&&R.taxes.map(((e,t)=>$((0,j.jsx)(k.W,{code:e.code,defaultDescription:e.description}),e.amount,l().taxLine,t))):$((0,j.jsx)(o.gJ,{textKey:"TotalVAT"}),R.amount,l().tax)),!!M.payment&&$((0,j.jsx)(o.gJ,{textKey:"PaymentDiscount"}),-M.payment,l().paymentDiscount),y.amountPosition===r.dq.Above&&K(w.price),E,W&&F(!0)]});function q(e){const{symbol:t,displayAsId:n,id:s}=A,a=e<0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("span",{className:"visually-hidden",children:[a&&'-',t+(a?-e:e)]}),(0,j.jsx)("span",{"aria-hidden":!0,children:n?s:t}
1),(0,j.jsx)("span",{className:l().totalsValue,"aria-hidden":!0,children:_||D||i?u.JZ:U(e)})]})}function $(e,t,n,s){return null===t?null:(0,j.jsx)(b,{className:n,label:e,value:q(t)},s)}function F(e){var t;if(void 0===e&&(e=!1),null==(t=M.promotion)||!t.amount)return null;const n=e?M.promotion.amount:-M.promotion.amount;return $((0,j.jsx)(v.A,{title:M.promotion.automatic?M.promotion.title:null}),n,l().promotion)}function K(e,t){const n=y.focus===(t?r.d6.Excl:r.d6.Incl),s=`${n?'Focused':''}${t?'TotalExVat':'TotalIncVat'}`,i=`${l()[t?'priceExclTax':'priceInclTax']} ${n?l().emphasis:''}`;return $((0,j.jsx)(o.gJ,{textKey:s}),e,i)}},C=(0,s.withStyles)(l())((e=>{let{model:{showUnitTotal:t},isDesignerMode:n,id:s}=e;return(0,a.useSelector)((e=>(0,g.KR)(e.basket)))?null:(0,j.jsx)(S,{showUnitTotal:t,isDesignerMode:n,id:s})}))},99189:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var s=n(78736),i=n.n(s),l=n(70358),a=n(45107),r=n(12922),o=n(32525),d=n.n(o),c=n(60196),u=n(76809),m=n(21010);const p=(0,r.withStyles)(d())((e=>{let{headerText:t,lines:n}=e;return null!=n&&n.length?(0,m.jsxs)(c.hZ,{role:"alert",className:d().warning,children:[t||(0,m.jsx)(u.O,{}),(0,m.jsx)("ul",{className:d().warningLines,children:n.map(((e,t)=>(0,m.jsx)("li",{children:h(e)},t)))})]}):null}));function h(e){let t=e.productId;return e.productTitle&&(t+=` - ${e.productTitle}`),e.variationId&&(t+=` - ${e.variationTitle||e.variationId}`),e.uom&&(t+=` - ${e.uom.description||e.uom.id}`),t}var g=n(14494),x=n(18913);const f=['Basket_WarningReason_ProductDiscountOverriddenByErpDiscount','Basket_WarningReason_ProductDiscountNotAppliedDueToSalesAgreement'],v=()=>{const{warningLines:e,discountCode:t}=(0,l.useSelector)((e=>{var t;let{basket:n}=e;const s=!(0,a.KC)(n)&&n.model&&(0,a.S2)(n.model)?n.model:null;return{warningLines:null==s?void 0:s.warningLines,discountCode:null==s||null==(t=s.discount.promotion)?void 0:t.code}}),l.shallowEqual);if(null==e||!e.length)return null;const n=i()(e,(e=>e.reason));return(0,m.jsx)(x.P6,{options:f,dontWait:!0,children:e=>{let[s,i]=e;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(p,{headerText:(0,x._V)(s,[t]),lines:n[g.$Q.ProductDiscountOverriddenByErpDiscount]}),(0,m.jsx)(p,{headerText:(0,x._V)(i,[t]),lines:n[g.$Q.ProductDiscountNotAppliedDueToSalesAgreement]})]})}})}},59468:(e,t,n)=>{n.d(t,{_:()=>m,x:()=>p});var s=n(25498),i=n(60115);const l=(0,s.createContext)({hasPendingChanges:!1,setHasPendingChanges:i.l});var a=n(6887),r=n(84947),o=n(26691),d=n(75052),c=n(1209),u=n(21010);const m=e=>{let{children:t}=e;const[n,i]=(0,s.useState)(!1),{linesQuantities:m}=(0,a.HJ)(),{linesWithAgreement:p}=(0,r.A)(),{linesWithExtraFields:h}=(0,c.J)(),{formIsDirty:g}=(0,o.s)(),{hasPendingComments:x}=(0,d.A4)();(0,s.useEffect)((()=>{const e=!!Object.keys(m).length,t=!!Object.keys(p).length,n=!!Object.keys(h).length;i(e||t||n||x||g)}),[m,p,h,x,g]);const f=(0,s.useMemo)((()=>({hasPendingChanges:n,setHasPendingChanges:i})),[n]);return(0,u.jsx)(l.Provider,{value:f,children:t})},p=()=>(0,s.useContext)(l)},78913:(e,t,n)=>{n.d(t,{V:()=>r,Y:()=>o});var s=n(25498),i=n(70358);const l=(0,s.createContext)(!1);var a=n(21010);const r=e=>{let{children:t}=e;const n=(0,i.useSelector)((e=>e.page.isLoadingDetails||e.basket.hasPendingUpdates)),[r,o]=(0,s.use
1State)(!!n);return(0,s.useEffect)((()=>{if(n){const e=setTimeout((()=>o(!0)),250);return()=>clearTimeout(e)}o(!1)}),[n]),(0,a.jsx)(l.Provider,{value:r,children:t})},o=()=>(0,s.useContext)(l)},59859:(e,t,n)=>{n.d(t,{O:()=>u,K:()=>m});var s=n(25498),i=n(60115);const l=(0,s.createContext)({productAddDisabled:!1,setProductAddDisabled:i.l});var a=n(70358),r=n(45107),o=n(72413),d=n(68412),c=n(21010);const u=e=>{let{children:t}=e;const[n,i]=(0,s.useState)(!1),u=(0,d.lW)(),m=(0,a.useDispatch)();(0,o.vu)((()=>{m((0,r.jQ)())})),(0,s.useEffect)((()=>{i(!1)}),[u]),(0,s.useEffect)((()=>()=>{m((0,r.jQ)())}),[]);const p=(0,s.useMemo)((()=>({productAddDisabled:n,setProductAddDisabled:i})),[n]);return(0,c.jsx)(l.Provider,{value:p,children:t})},m=()=>(0,s.useContext)(l)},59446:(e,t,n)=>{n.d(t,{ad:()=>L,sd:()=>S});var s=n(25498),i=n(60115);const l=(0,s.createContext)({getModifiedLines:()=>[],getBasketDataForSaving:()=>Promise.resolve(null),handleModifyBasket:i.l,submitModifiedLines:()=>[!1,0],submitBasket:()=>Promise.resolve([!1,0])});var a=n(70358),r=n(45107),o=n(10170),d=n(72740),c=n(75052),u=n(26691),m=n(6887),p=n(84947),h=n(59468),g=n(88936),x=n(35547),f=n(95397),v=n(68412),j=n(17005),b=n(1209),k=n(21010);const L=e=>{let{children:t}=e;const n=(0,v.lW)(),i=(0,a.useSelector)((e=>e.basket.model)),L=i&&(0,r.S2)(i)?i.page.index:null,S=(0,a.useSelector)((e=>e.user.customer)),C=(0,g.K)(),{contextValue:A,resetModifiedLines:y,hasLinesWithPendingComments:N}=function(e,t){const n=(0,a.useDispatch)(),{hasInvalidCommentLines:i,hasLinesWithPendingComments:l}=(0,c.A4)(),{validateForm:o,getFormFields:d,formHasChanges:g}=(0,u.s)(),{linesQuantities:v,clearLinesQuantities:k,hasLineWithInvalidQuantity:L}=(0,m.HJ)(),{linesWithAgreement:S,clearLineAgreements:C}=(0,p.A)(),{hasInvalidExtraFieldsLines:A,linesWithExtraFields:y,clearLinesFields:N}=(0,b.J)(),{setHasPendingChanges:_}=(0,h.x)(),I=(0,s.useRef)({});I.current.linesWithAgreement=S,I.current.linesQuantities=v,I.current.linesWithExtraFields=y,I.current.isPreview=t;const D=(0,s.useCallback)((()=>{k(),C(),N()}),[]),P=function(e,t){const n=(0,s.useRef)(!1);return(0,s.useEffect)((()=>{n.current&&(t(),n.current=!1)}),[e]),()=>n.current=!0}(e,D),w=(0,s.useMemo)((()=>{const e=()=>{const e=[],t=I.current.linesQuantities,n=I.current.linesWithAgreement,s=I.current.linesWithExtraFields,i=new Set([...Object.keys(t),...Object.keys(n),...Object.keys(s)]);for(const l of i){const i=t[l],a=n[l],r=s[l];let o;if(a){o={id:l,salesAgreementLineAction:'UPDATED'===a.status?{newAgreementId:a.salesAgreementLine.salesAgreementId,newAgreementLineId:a.salesAgreementLine.id}:{remove:!0}}}if(r&&(o=o?{...o,extraFields:r}:{id:l,extraFields:r}),null!=i&&i.isValid){const e=+i.value;o=o?{...o,quantity:e}:{id:l,quantity:e}}o&&e.push(o)}return e},t=()=>({modifiedLines:e(),formFields:g()?d():null}),s=async()=>{if(L())return(0,f.Z)(),!1;if(!await o())return a(),!1;if(i())return a(),!1;return!A()||(a(),!1)},l=()=>{const e=L();return e&&(0,f.Z)(),!e},a=()=>{n((0,j.yS)(!0)),(0,f.Z)()},c=()=>{n((0,x.PE)())},u=async()=>{if(I.current.isPreview)return c(),null;if(!await s())return null;return t()},m=(e,t,s)=>{n((0,r.vZ)(e,t,s)),_(!1),P()};return{getModifiedLines:e,getBasketDataForSaving:u,handleModifyBasket:m,submitModifiedLines(t){if(I.current.isPreview)return c(),[!1,0];if(t){if(!l())return[!1,0]}const n=e();return m(n),[!0,n.length]},async submitBasket(e){const t=await u();if(null===t)return[!1,0];const{modifiedLines:n,formFields:s}=t;return m(n,e,s),[!0,n.length]}}}),[]);return{contextValue:w,resetModifiedLines:D,hasLinesWithPendingComments:l}}(n,C),_=(0,s.useRef)({postponeNavigation:!1,resetModifiedLinesOnBasketPageChange:!1,resetModifiedLinesOnCustomerChange:!1,shouldResumeNavigationAfterRecalculation:!1}).current,I=(0,s.useCallback)((e=>{const t=(null==e?void 0:e.routeName)===o.xW.Checkout,n=(null==e?void 0:e.routeName)===o.xW.BasketPage;if(C&&!t&&!n)return!1;_.postponeNavigation=!0;return async function(e){let{forceValidBasketState:t,resetModifiedLinesOnBasketPageChange:n,recalculateOnBasketPageChange:s}=e;const i=await A.getBasketDataForSaving();if(null===i)return _.postponeNavigation=!1,void(t?P():(_.resetModifiedLinesOnBasketPageChange=n,D()));const{modifiedLines:l,formFields:a}=i;if(0===l.length&&null===a){if(!s)return _.postponeNavigation=!1,void D();_.shouldResumeNavigationAfterRecalculation=s}A.handleModifyBasket(l,null,a)}({forceValidBasketState:t||C&&n,resetModifiedLinesOnBasketPageChange:n,recalculateOnBasketPageChange:!C&&n&&N()}),!0}),[C]),{resume:D,discard:P}=(0,o.FX)(I);return(0,d.yA)((()=>{_.resetModifiedLinesOnCustomerChange=!0}),[S]),(0,s.useEffect)((()=>{_.resetModifiedLinesOnCustomerChange&&(y(),_.resetModifiedLinesOnCustomerChange=!1),_.postponeNavigation&&(_.postponeNavigation=!1,D())}),[n]),(0,s.useEffect)((()=>{_.resetModifiedLinesOnBasketPageChange&&(y(),_.resetModifiedLinesOnBasketPageChange=!1)}),[L]),(0,s.useEffect)((()=>{_.shouldResumeNavigationAfterRecalculation&&(_.shouldResumeNavigationAfterRecalculation=!1,D())}),[i]),(0,k.jsx)(l.Provider,{value:A,children:t})};const S=()=>(0,s.useContext)(l)}}]); 2//# sourceMappingURL=basket.9c8b59d8.chunk.js.map
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.