1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3236],{73236:(e,t,s)=>{s.r(t),s.d(t,{ProductDetailsBisButton:()=>p});var a=s(6029),l=s(68934),i=s.n(l),r=s(32988),n=s.n(r),c=s(53917),o=s(16525),u=s(58503),d=s(3947),m=s(18295),k=s(94661),x=s(55729),v=s(58578),h=s(15623);let f=e=>{let{product:t,hasVariations:s,variationData:l,disabled:r=!1,className:f="",publicSettings:g}=e,{isSuccess:p,isFetching:b,isGuest:j}=(0,k.J)(),[N,w]=(0,x.useState)(!1),[_,y]=(0,x.useState)(""),[S,C]=(0,x.useState)(!1),[A,F]=(0,x.useState)("");if(!(()=>{var e,a,i;if(!(null==g||null==(e=g.features)?void 0:e.backInStockNotification)||(null==g||null==(a=g.wholesale)?void 0:a.hideAllPrices)&&j)return!1;if(null==g||null==(i=g.features)?void 0:i.backInStockNotificationBrands){let e=s&&l?l:t,a=(null==e?void 0:e.brands)||[];if(!(null==a?void 0:a.some(e=>(null==e?void 0:e.back_in_stock_notification)===!0)))return!1}let r=e=>{var t;return(null==g||null==(t=g.features)?void 0:t.lowStockIsOutOfStock)?(null==e?void 0:e.lowStockThreshold)>(null==e?void 0:e.stock):"outofstock"===e.stock_status};return r(s&&l?l:t)})())return null;let E=async()=>{w(!0),y("");let e=s&&l?l.id:t.id;try{let t=await i().post("/api/products/back-in-stock",{email:A,product_id:e});200===t.status&&(v.Ay.success("Skr\xe1ning t\xf3kst!",{id:"success-message-back-in-stock"}),y("Vi\xf0 l\xe1tum \xfeig vita \xfeegar varan er aftur komin \xe1 lager!"))}catch(e){console.log("Error",e),409===e.response.status?v.Ay.error("\xde\xfa ert \xfeegar skr\xe1\xf0ur til a\xf0 f\xe1 tilkynningar um \xfeessa v\xf6ru.",{id:"error-message-back-in-stock-duplicate"}):v.Ay.error("Ekki t\xf3kst a\xf0 skr\xe1 \xfeig",{id:"error-message-back-in-stock"})}w(!1)};return(0,a.jsxs)(a.Fragment,{children:[p&&!b?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.a,{containerClassName:"max-w-[90%] md:max-w-[50vw] w-full kc-product-bis-button__modal",open:S,onClose:()=>C(!1),children:(0,a.jsxs)("div",{className:"mb-8 flex flex-col justify-center gap-2 p-6 items-center text-center text-[20px]",children:[(0,a.jsx)("h4",{className:"text-textmain",children:"Tilkynningart\xf6lvup\xf3stur"}),N?(0,a.jsx)(m.y,{className:"h-12 w-12"}):_?(0,a.jsx)("p",{children:_}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-textmain",children:"\xdeessi vara er b\xfain \xe1 lager eins og er. Vi\xf0 l\xe1tum \xfeig vita \xfeegar h\xfan er komin aftur \xe1 lager!"}),(0,a.jsx)(u.p,{id:"email",placeholder:"Netfang",className:"my-8 w-full kc-product-bis-button__modal__input",value:A,onChange:e=>{F(e.target.value)}}),(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(o.$,{disabled:!A,className:"px-8",onClick:E,icon:(0,a.jsx)(c.X,{className:"h-7 w-7"}),children:"L\xe1ta mig vita"})})]})]})}),(0,a.jsx)("div",{className:n()(f,"kc-product-bis-button flex w-full max-w-auto justify-center gap-2"),children:(0,a.jsx)(o.$,{onClick:()=>C(!0),disabled:r||N,icon:(0,a.jsx)(c.X,{className:"h-7 w-7"}),children:(0,a.jsx)("div",{className:n()("product-bis-button-subscribe flex min-h-[2.5rem] items-center"),children:"L\xe1ta mig vita \xfeegar varan f\xe6st aftur"})})})]}):(0,a.jsx)(h.A,{className:"add-to-cart-button h-16 w-52"}),(0,a.jsx)(v.l$,{position:"top-center"})]})};var g=s(79427);let p=e=>{var t;let{block:s}=e,{hasVariations:l,product:i,publicSettings:r,variationData:n,sku:c}=(0,g.Wr)();return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(f,{className:null==s||null==(t=s.attrs)?void 0:t.className,product:i,hasVariations:l,variationData:n,disabled:l&&(null==i?void 0:i.disable_default_variation)&&!c,publicSettings:r})})}}}]);
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.