1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8633],{58633:(e,l,s)=>{s.r(l),s.d(l,{SoldOutDialog:()=>g});var t=s(26514),a=s(2981),i=s(75834),o=s(49421),d=s(81586),n=s(62229),r=s(28590),_=s(16074),c=s(60269),h=s(55047),u=s(80254);let g=({soldOutItemsData:e=[]})=>{let[l,s]=(0,i.useState)(!0),[g,m]=(0,i.useState)(!e.length),[x,j]=(0,i.useState)(e),{cart:f}=(0,d.Pj)(),{t:p}=(0,h.Bd)("common"),v=(0,i.useCallback)(async()=>{if(0===e.length){let e=await f.fetchSoldOutItems();m(!1),e&&e.length>0?j(e):s(!1)}},[e.length,f]),b=async()=>{f.removeSoldOutItems(),s(!1)};return(0,i.useEffect)(()=>{v()},[v]),(0,t.jsxs)(a.I,{dialogPanelClassName:"w-[min(48rem,_100%)]",isOpen:l,setIsOpen:s,isButtonClosable:!0,children:[(0,t.jsxs)("header",{children:[(0,t.jsx)(r.Lx,{children:(0,t.jsx)(_.h,{heading:2,children:p("sold_out_dialog__heading")})}),(0,t.jsxs)("p",{children:[p("sold_out_dialog__info_1")," ",(0,t.jsx)("strong",{children:p("sold_out_dialog__info_1_strong")})]}),(0,t.jsx)("p",{className:"pt-4",children:p("sold_out_dialog__info_2")})]}),(0,t.jsxs)("div",{children:[g&&(0,t.jsx)("div",{className:"relative p-8",children:(0,t.jsx)(o.a,{isActive:!0})}),x&&x.length>0&&(0,t.jsx)("div",{className:"mt-4",children:x.map((e,l)=>(0,t.jsx)("div",{className:"py-6 lg:py-4 border-b border-gray-500",children:(0,t.jsx)(n.w,{smallerImage:!0,product:e})},`soldOutDialogItem_${e.id}-${l}`))})]}),(0,t.jsxs)("footer",{className:"flex flex-col sm:flex-row justify-between mt-6 gap-4 md:px-8",children:[(0,t.jsx)(c.S,{className:"w-full",variant:"light",onClick:()=>s(!1),"data-testid":u.Q.SoldOutDialogChangeCartButton,children:p("sold_out_dialog__btn_change_cart")}),(0,t.jsx)(c.S,{className:"w-full",onClick:b,"data-testid":u.Q.SoldOutDialogRemoveItemsButton,children:p("sold_out_dialog__btn_remove_items")})]})]})}}}]);
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.