"use strict";exports.id=831,exports.ids=[831],exports.modules={10831:(e,t,a)=>{a.d(t,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var l=a(16689),n=a.n(l),i=a(10792),r=a(40276),o=a(6693),m=a(83339),s=a(2614),c=a(99767),u=a(72955),d=a(16652),E=a(13666),g=a(97336),b=a(60411),p=a(44236),y=a(84256),f=a(9336),v=a(77215),Z=a(45049);let ImageComponentFallback=({src:e,alt:t,...a})=>n().createElement("img",{src:e,alt:t,...a}),__WEBPACK_DEFAULT_EXPORT__=function({title:e,direction:t="rightSide",size:a="partial",children:h,columns:k,loading:C,formatter:_,ImageComponent:x=ImageComponentFallback,buyProps:{onClick:$,...A},overlayProps:O,...w}){let{isOpen:S,setIsOpen:F,setAllVariantProducts:I,allVariantProducts:P,onChangeQuantityItem:T}=(0,u._)(),{pushToast:q}=(0,d.l8)(),{fade:D}=(0,E.b)(),W=(0,l.useMemo)(()=>P.reduce((e,t)=>({amount:e.amount+t.selectedCount,subtotal:e.subtotal+t.selectedCount*t.price}),{amount:0,subtotal:0}),[P]);function onClose(){I(e=>e.map(e=>({...e,selectedCount:0}))),F(!1)}let B=Object.keys(k).filter(e=>"additionalColumns"!==e).length+(k.additionalColumns?.length??0);return n().createElement(v.Z,{"data-fs-sku-matrix-sidebar":!0,size:a,direction:t,overlayProps:O,isOpen:S,fade:D,...w},n().createElement(Z.Z,{onClose:onClose},n().createElement("h2",{"data-fs-sku-matrix-sidebar-title":!0},e)),h,n().createElement(g.Z,{variant:"bordered"},n().createElement(b.Z,null,n().createElement(p.Z,null,n().createElement(y.Z,{align:"left",variant:"header",scope:"col"},k.name),k.additionalColumns?.map(({label:e,value:t})=>n().createElement(y.Z,{key:t,align:"left",variant:"header",scope:"col"},e)),n().createElement(y.Z,{align:"left",variant:"header",scope:"col"},k.availability.label),n().createElement(y.Z,{align:"right",variant:"header",scope:"col"},k.price),n().createElement(y.Z,{align:"left",variant:"header",scope:"col"},k.quantitySelector))),n().createElement(f.Z,null,C?n().createElement(n().Fragment,null,Array.from({length:5}).map((e,t)=>n().createElement(p.Z,{key:`table-row-${t}`},Array.from({length:B}).map((e,t)=>n().createElement(y.Z,{key:`table-cell-${t}`},n().createElement("span",null,n().createElement(i.Z,{key:t,size:{width:"100%",height:"30px"}}))))))):n().createElement(n().Fragment,null,P.map(e=>n().createElement(p.Z,{key:`${e.name}-${e.id}`},n().createElement(y.Z,{"data-fs-sku-matrix-sidebar-cell-image":!0,align:"left"},n().createElement(x,{src:e.image.url,alt:e.image.alternateName}),e.name),k.additionalColumns?.map(({value:t})=>n().createElement(y.Z,{key:`${e.name}-${e.id}-${t}`,align:"left"},e.specifications[t.toLowerCase()])),n().createElement(y.Z,{align:"left"},"showAvailability"===k.availability.stockDisplaySettings&&n().createElement(r.Z,{variant:"outOfStock"===e.availability?"warning":"success"},"outOfStock"===e.availability?"Out of stock":"Available"),"showStockQuantity"===k.availability.stockDisplaySettings&&e.inventory),n().createElement(y.Z,{align:"right"},n().createElement("div",{"data-fs-sku-matrix-sidebar-table-price":!0},n().createElement(c.Z,{value:e.price,variant:"spot",formatter:_}))),n().createElement(y.Z,{align:"right","data-fs-sku-matrix-sidebar-table-cell-quantity-selector":!0},n().createElement("div",{"data-fs-sku-matrix-sidebar-table-action":!0},n().createElement(o.Z,{min:0,max:e.inventory,disabled:!e.inventory||"outOfStock"===e.availability,initial:e.selectedCount,onChange:t=>T(e.id,t),onValidateBlur:(e,t,a)=>{q({title:"Invalid quantity!",message:`The quantity you entered is outside the range of ${e} to ${t}. The quantity was set to ${a}.`,status:"INFO",icon:n().createElement(s.Z,{name:"CircleWavyWarning",width:30,height:30})})}})))))))),n().createElement("footer",{"data-fs-sku-matrix-sidebar-footer":!0},n().createElement("div",null,n().createElement("p",null,W.amount," ",1!==W.amount?"Items":"Item"),n().createElement(c.Z,{value:W.subtotal,variant:"spot",formatter:_})),n().createElement(m.Z,{variant:"primary",disabled:!W.amount,onClick:function(e){$(e),onClose()},...A},"Add to Cart")))}}};