PageSourceSearch

https://bottleking.ng/_next/static/chunks/4328-bf0eff843a095f0e.js

js bottleking.ng collected 2026-10-04 02:36:28 UTC 9,430 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4328],{99160:function(e,t,l){l.r(t),l.d(t,{default:function(){return b}});var i=l(57437),a=l(2265),d=l(57818),s=l(16463),n=l(72259),o=l(30311);function r(){return(0,i.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M0 20C0 8.95431 8.95431 0 20 0C31.0457 0 40 8.95431 40 20C40 31.0457 31.0457 40 20 40C8.95431 40 0 31.0457 0 20Z",fill:"white"}),(0,i.jsx)("g",{clipPath:"url(#clip0_13712_68728)",children:(0,i.jsx)("path",{d:"M16.2493 20.0013L18.7493 22.5013L23.7493 17.5013M28.3327 20.0013C28.3327 24.6037 24.6017 28.3346 19.9993 28.3346C15.397 28.3346 11.666 24.6037 11.666 20.0013C11.666 15.3989 15.397 11.668 19.9993 11.668C24.6017 11.668 28.3327 15.3989 28.3327 20.0013Z",stroke:"#08080A",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_13712_68728",children:(0,i.jsx)("rect",{width:"20",height:"20",fill:"white",transform:"translate(10 10)"})})})]})}var u=l(22223),c=l(6804),v=l(95622),m=l(48952),h=l(47643);let g=(0,d.default)(()=>Promise.all([l.e(8173),l.e(7524),l.e(7138),l.e(1985),l.e(1900),l.e(2766),l.e(3921)]).then(l.bind(l,24039)),{loadableGenerated:{webpack:()=>[24039]},ssr:!1,loading:()=>(0,i.jsxs)("div",{className:"w-full animate-pulse",style:{contain:"layout style paint"},children:[(0,i.jsx)("div",{className:"h-6 bg-gray-200 rounded w-1/3 mb-4"}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,i.jsx)("div",{className:"h-[169px] bg-gray-200 rounded"}),(0,i.jsx)("div",{className:"h-[169px] bg-gray-200 rounded"})]})]})}),p=(0,d.default)(()=>Promise.all([l.e(8173),l.e(7524),l.e(7138),l.e(1985),l.e(1900),l.e(2766),l.e(2912)]).then(l.bind(l,60346)),{loadableGenerated:{webpack:()=>[60346]},ssr:!1,loading:()=>(0,i.jsxs)("div",{className:"w-full animate-pulse",style:{minHeight:"400px",contain:"layout style paint"},children:[(0,i.jsx)("div",{className:"h-6 bg-gray-200 rounded w-1/4 mb-4"}),(0,i.jsxs)("div",{className:"grid grid-cols-4 gap-6",children:[(0,i.jsx)("div",{className:"h-[280px] bg-gray-200 rounded"}),(0,i.jsx)("div",{className:"h-[280px] bg-gray-200 rounded"}),(0,i.jsx)("div",{className:"h-[280px] bg-gray-200 rounded"}),(0,i.jsx)("div",{className:"h-[280px] bg-gray-200 rounded"})]})]})});function b(e){let{title:t,products:l,viewAllLink:d="",itemsPerPage:b=2,marqueeItems:x=[],showViewAll:w=!1,showMarquee:y=!1,marqueeItemsByBundle:f={}}=e,[j,N]=a.useState(null);a.useEffect(()=>{let e=()=>N(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let{isBundle:T,trackRef:I,isDragging:k,totalPages:B,currentPage:_,containerRef:P,productPages:C,goToPage:q,onTouchEnd:L,onTouchMove:S,onTouchStart:E,getTransform:W,handleBundleBuyNow:M,handleBundleAddToCart:V,getMarqueeItemsForProduct:F,generateBundleSlug:A}=function(e){let{products:t,itemsPerPage:l=2,marqueeItems:d=[],showMarquee:g=!1,marqueeItemsByBundle:p={}}=e,b=(0,s.useRouter)(),x=(0,v.TL)(),w=(0,v.CG)(e=>e.cart),y=a.useRef(null),f=a.useRef(null),[j,N]=a.useState(0),[T,I]=a.useState(0),[k,B]=a.useState(!1),[_,P]=a.useState(null),[C,q]=a.useState(null),L=Math.ceil(t.length/l),S=a.useMemo(()=>{let e=[];for(let i=0;i<L;i++){let a=i*l,d=a+l;e.push(t.slice(a,d))}return e},[t,l,L]);a.useEffect(()=>{I(0)},[t]);let E=async e=>{try{x((0,h.an)({name:e.name,price:e.price||0,bundleId:e.bundleId,quantity:e.quantity||1}));let n={isWishList:!1,bundleId:e.bundleId,quantity:e.quantity||1};!0===e.isWishlist&&(n.isWishList=!0);let T=await (0,u.XY)(n);if(null==T?void 0:T.status){var t,l,a,d,s,c,v,g,p,w,y,f,j,N;(null===(t=T.data)||void 0===t?void 0:t._id)&&((0,m.TV)(T.data._id),x((0,h.TV)({cart_id:T.data._id}))),x((0,h.addBultItems)({cart_id:T.data._id,cartTotal:(null===(l=T.data.items)||void 0===l?void 0:l.overallTotal)||0,bundles:(null===(d=T.data.items)||void 0===d?void 0:null===(a=d.bundles)||void 0===a?void 0:a.items)||[],bundlesTotal:(null===(c=T.data.items)||void 0===c?void 0:null===(s=c.bundles)||void 0===s?void 0:s.total)||0,variations:(null===(g=T.data.items)||void 0===g?void 0:null===(v=g.regularProducts)||void 0===v?void 0:v.items)||[],bkItemsTotal:(null===(w=T.data.items)||void 0===w?void 0:null===(p=w.regularProducts)||void 0===p?void 0:p.total)||0,specialItems:(null===(f=T.data.items)||void 0===f?void 0:null===(y=f.specialProducts)||void 0===y?void 0:y.items)||[],specialItemsTotal:(null===(N=T.data.items)||void 0===N?void 0:null===(j=N.specialProducts)||void 0===j?void 0:j.total)||0})),(0,o.toast)({description:(0,i.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,i.jsx)(r,{}),(0,i.jsx)("span",{className:"text-sm sm:text-base",children:e.isWishlist?"Bundle added to wishlist":"Bundle added to cart"})]}),style:{color:"white",backgroundColor:"black"},className:"sm:max-w-md mx-auto",action:(0,i.jsx)("button",{onClick:()=>{e.isWishlist?b.push("/wishlist"):b.push("/cart"),(0,o.toast)({}).dismiss()},className:"bg-white px-2 min-w-[100px] py-2 text-black text-center text-xs hover:bg-gray-100 transition-colors",children:e.isWishlist?"View Wishlist":"View Cart"})})}}catch(t){(0,n.q)("Error adding bundle to cart:",t),(0,o.toast)({title:"Error",variant:"destructive",description:"Bad Request"!==t.message?null==t?void 0:t.message:e.isWishlist?"Failed to add bundle to wishlist":"Failed to add bundle to cart"})}};return{trackRef:y,touchEnd:_,isBundle:e=>{var t,l,i,a;return!!e.bundleId||"Bundle"===e.volume||"bundle"===e.type||(null===(t=e.sku)||void 0===t?void 0:t.startsWith("BUNDLE"))||(null===(l=e.name)||void 0===l?void 0:l.toLowerCase().includes("bundle"))||(null===(i=e.name)||void 0===i?void 0:i.toLowerCase().includes("combo"))||(null===(a=e.name)||void 0===a?void 0:a.toLowerCase().includes("pack"))},cartState:w,dragOffset:j,isDragging:k,touchStart:C,totalPages:L,currentPage:T,containerRef:f,productPages:S,minSwipeDistance:30,router:b,goToPage:e=>{I(e)},onTouchEnd:()=>
1{if(B(!1),!C||!_){N(0);return}let e=C-_;e>30&&T<L-1?I(e=>e+1):e<-30&&T>0&&I(e=>e-1),N(0),P(null),q(null)},onTouchMove:e=>{if(null!==C){let t=e.targetTouches[0].clientX;P(t),N(t-C)}},onTouchStart:e=>{q(e.targetTouches[0].clientX),B(!0),N(0)},getTransform:()=>{if(!f.current)return"translateX(0)";let e=f.current.offsetWidth;return"translateX(-".concat(T*e-(k?j:0),"px)")},handleBundleBuyNow:async e=>{try{x((0,h.an)({name:e.name,price:e.price||0,bundleId:e.bundleId,quantity:e.quantity||1}));let n=await (0,u.XY)({isWishList:!1,bundleId:e.bundleId,quantity:e.quantity||1});if(null==n?void 0:n.status){var t,l,i,a,d,s,r,c,v,g,p,b,w,y;(null===(t=n.data)||void 0===t?void 0:t._id)&&((0,m.TV)(n.data._id),x((0,h.TV)({cart_id:n.data._id}))),x((0,h.addBultItems)({cart_id:n.data._id,cartTotal:(null===(l=n.data.items)||void 0===l?void 0:l.overallTotal)||0,bundles:(null===(a=n.data.items)||void 0===a?void 0:null===(i=a.bundles)||void 0===i?void 0:i.items)||[],bundlesTotal:(null===(s=n.data.items)||void 0===s?void 0:null===(d=s.bundles)||void 0===d?void 0:d.total)||0,variations:(null===(c=n.data.items)||void 0===c?void 0:null===(r=c.regularProducts)||void 0===r?void 0:r.items)||[],bkItemsTotal:(null===(g=n.data.items)||void 0===g?void 0:null===(v=g.regularProducts)||void 0===v?void 0:v.total)||0,specialItems:(null===(b=n.data.items)||void 0===b?void 0:null===(p=b.specialProducts)||void 0===p?void 0:p.items)||[],specialItemsTotal:(null===(y=n.data.items)||void 0===y?void 0:null===(w=y.specialProducts)||void 0===w?void 0:w.total)||0})),window.location.href="/checkout"}}catch(e){(0,n.q)("Error during buy now:",e),(0,o.toast)({title:"Error",variant:"destructive",description:e.message||"Failed to process buy now"})}},handleBundleAddToCart:E,getMarqueeItemsForProduct:e=>g?p&&e.bundleId?p[e.bundleId]||[]:d:[],generateBundleSlug:e=>{if(e.slug&&""!==e.slug.trim())return e.slug;if(e.name){let t=(0,c.generateSlugFromName)(e.name);if(t)return t}return e.bundleId||e._id}}}({title:t,products:l,viewAllLink:d,showViewAll:w,showMarquee:y,itemsPerPage:b,marqueeItems:x,marqueeItemsByBundle:f});return null===j?(0,i.jsxs)("div",{className:"w-full animate-pulse",style:{minHeight:"300px",contain:"layout style paint"},children:[(0,i.jsx)("div",{className:"h-6 bg-gray-200 rounded w-1/4 mb-4"}),(0,i.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,i.jsx)("div",{className:"h-[200px] bg-gray-200 rounded"}),(0,i.jsx)("div",{className:"h-[200px] bg-gray-200 rounded"}),(0,i.jsx)("div",{className:"h-[200px] bg-gray-200 rounded hidden md:block"}),(0,i.jsx)("div",{className:"h-[200px] bg-gray-200 rounded hidden md:block"})]})]}):(0,i.jsx)(a.Fragment,{children:j?(0,i.jsx)(g,{title:t,products:l,isBundle:T,trackRef:I,isDragging:k,totalPages:B,showMarquee:y,showViewAll:w,viewAllLink:d,currentPage:_,containerRef:P,productPages:C,goToPage:q,onTouchEnd:L,onTouchMove:S,onTouchStart:E,getTransform:W,handleBundleBuyNow:M,handleBundleAddToCart:V,getMarqueeItemsForProduct:F,generateBundleSlug:A}):(0,i.jsx)(p,{title:t,products:l,isBundle:T,showMarquee:y,showViewAll:w,viewAllLink:d,handleBu
1ndleBuyNow:M,handleBundleAddToCart:V,getMarqueeItemsForProduct:F,generateBundleSlug:A})})}},48952:function(e,t,l){l.d(t,{TV:function(){return a}});var i=l(72259);let a=e=>{try{return localStorage.setItem("cart_id",e),!0}catch(e){return(0,i.q)("Error setting cart ID in localStorage:",e),!1}}}}]);

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.