PageSourceSearch

https://grabmojo.com/_next/static/chunks/3v2eqnbcb8t56.js

js grabmojo.com collected 2026-10-06 13:39:19 UTC 17,818 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,855862,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(618566),r=e.i(67359);e.i(662236);var i=e.i(261377);e.i(66468);var n=e.i(578648),l=e.i(522016);let c=(0,e.i(475254).default)("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);var o=e.i(797204);function d({title:e="Your cart is empty",description:s="Looks like you haven't added anything to your cart yet.",ctaText:r="Continue Shopping",ctaHref:i="/",className:n="",...m}){let u=(0,a.useRef)(null);return(0,a.useEffect)(()=>{u.current?.focus()},[]),(0,t.jsxs)("div",{className:`flex flex-col items-center justify-center py-16 px-4 text-center ${n}`,...m,children:[(0,t.jsxs)("div",{className:"mb-6 relative",children:[(0,t.jsx)(c,{className:"w-24 h-24 text-brand-primary","aria-hidden":"true"}),(0,t.jsx)("div",{className:"absolute -bottom-2 -right-2 w-8 h-8 bg-brand-secondary rounded-full flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-white text-sm font-semibold",children:"0"})})]}),(0,t.jsx)("h2",{ref:u,className:"text-2xl font-semibold text-primary mb-2 focus:outline-none focus:ring-2 focus:ring-brand-primary focus:ring-offset-2 focus:ring-offset-bg-primary rounded",tabIndex:-1,children:e}),(0,t.jsx)("p",{className:"text-secondary mb-8",children:s}),(0,t.jsx)(o.Button,{asChild:!0,variant:"primary",size:"large",className:"bg-brand-secondary hover:bg-brand-secondary/90","data-continue-shopping":!0,children:(0,t.jsx)(l.default,{href:i,children:r})})]})}d.displayName="EmptyCart";var m=e.i(657688),u=e.i(727612);e.i(18883);var x=e.i(660776),p=e.i(746934),h=e.i(806908);e.i(273235);var y=e.i(325673);let b=({item:e,onQuantityChangeAction:s,onRemoveAction:r,loading:n=!1,className:l,...c})=>{let[o,d]=(0,a.useState)(!1),[b,f]=(0,a.useState)(!1),j=(0,i.useAnnouncerStore)(e=>e.announce),g=(0,y.useDebouncedCallback)(e=>j(e),400),N=async t=>{if(!b){f(!0);try{await s(e.id,t),g(`${e.name} quantity updated to ${t}`)}catch{j(`Failed to update ${e.name} quantity. Please try again.`)}finally{f(!1)}}},v=async()=>{if(!o){d(!0),j(`Removing ${e.name} from cart...`);try{await r(e.id)}catch(t){j(`Failed to remove ${e.name}. Please try again.`)}finally{d(!1)}}},w=e.isSubscription&&e.subscriptionPrice?e.subscriptionPrice:e.price,C=e.quantity*w;return(0,t.jsx)("article",{className:(0,h.cn)("bg-bg-secondary rounded-lg p-4 sm:p-5 md:p-6 transition-opacity duration-200",l),style:{opacity:o?.5:1},"data-testid":"cart-item","aria-label":`Cart item: ${e.name}`,"aria-busy":o||b,...c,children:(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 sm:gap-5",children:[(0,t.jsx)("div",{className:"relative w-[140px] h-[140px] mx-auto sm:mx-0 sm:w-36 sm:h-36 flex-shrink-0",children:e.imageUrl?(0,t.jsx)(m.default,{src:e.imageUrl,alt:e.name,fill:!0,className:"object-cover rounded-lg",sizes:"(max-width: 640px) 220px, (max-width: 768px) 192px, (max-width: 1024px) 224px, 256px",quality:90,priority:!1}):(0,t.jsx)("div",{className:"w-full h-full bg-bg-disabled rounded-lg flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-text-disabled text-xs sm:text-sm",children:"No Image"})})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex-1 text-center sm:text-left",children:[(0,t.jsx)("h3",{className:"text-base sm:text-lg font-beausite font-medium text-primary line-clamp-2 sm:truncate",children:e.name}),e.options&&e.options.length>0&&(0,t.jsx)("div",{className:"mt-2 space-y-1",children:e.options.map((e,a)=>(0,t.jsxs)("p",{className:"text-xs sm:text-sm text-brand-primary",children:[e.name,": ",(0,t.jsx)("span",{className:"font-medium",children:e.value})]},a))}),e.isSubscription&&e.deliveryFrequency&&(0,t.jsxs)("p",{className:"mt-2 text-xs sm:text-sm text-accent-primary",children:["Subscription: ",(0,t.jsx)("span",{className:"font-medium",children:e.deliveryFrequency})]})]}),(0,t.jsxs)("div",{className:"mt-3 sm:mt-0 sm:text-right",children:[(0,t.jsxs)("span",{className:"sr-only",children:["Total price: ",(0,p.formatPrice)(C)]}),(0,t.jsxs)("div",{className:"w-full flex justify-between sm:hidden",children:[e.isSubscription&&e.subscriptionPrice?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-lg font-semibold text-brand-primary","aria-hidden":"true",children:(0,p.formatPrice)(C)}),(0,t.jsx)("p",{className:"text-xs text-text-secondary line-through","aria-label":`Original price: ${(0,p.formatPrice)(e.price*e.quantity)}`,children:(0,p.formatPrice)(e.price*e.quantity)})]}):(0,t.jsx)("p",{className:"text-lg font-semibold text-brand-primary","aria-hidden":"true",children:(0,p.formatPrice)(C)}),(0,t.jsxs)("button",{onClick:v,disabled:o||n,"aria-label":`Remove ${e.name} from cart`,className:(0,h.cn)("flex md:hidden items-center gap-2 text-sm sm:text-base text-brand-primary transition-colors","disabled:opacity-50 disabled:cursor-not-allowed","hover:text-brand-secondary cursor-pointer active:text-brand-primary-dark focus:ring-[var(--color-text-primary)] focus:ring-2 pr-5"),children:[(0,t.jsx)(u.Trash2,{size:20,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"sm:hidden",children:"Remove"})]})]}),(0,t.jsx)("div",{className:"hidden sm:block",children:e.isSubscription&&e.subscriptionPrice?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-xl font-semibold text-brand-primary","aria-hidden":"true",children:(0,p.formatPrice)(C)}),(0,t.jsx)("p",{className:"text-sm text-text-secondary line-through","aria-label":`Original price: ${(0,p.formatPrice)(e.price*e.quantity)}`,children:(0,p.formatPrice)(e.price*e.quantity)})]}):(0,t.jsx)("p",{className:"text-xl font-semibold text-brand-primary","aria-hidden":"true",children:(0,p.formatPrice)(C)})})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col sm:flex-row sm:justify-between sm:items-end gap-3",children:[(0,t.jsxs)("button",{onClick:v,disabled:o||n,"aria-label":`Remove ${e.name} from cart`,className:(0,h.cn)("hidden sm:flex items-center gap-2 text-sm sm:text-base text-brand-primary transition-colors","disabled:opacity-50 disabled:cursor-not-allowed","hover:text-brand-secondary cursor-pointer active:text-brand-primary-dark focus:ring-[var(--color-text-primary)] focus:ring-2"),children:[(0,t.jsx)(u.Trash2,{size:20,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"sm:hidden",children:"Remove"})]}),(0,t.jsx)(x.QuantitySelector,{quantity:e.quantity,onQuantityChange:e=>N(e),min:1,max:99,disabled:b||n,className:"w-full sm:w-32 [&>button]:h-[40px] sm:[&>button]:h-[40px] [&>
1input]:h-[40px] sm:[&>input]:h-[40px]"})]})]})]})})};var f=e.i(207670),j=e.i(174080);e.i(364210),e.i(197646);var g=e.i(253820),N=e.i(95187);let v=(0,N.createServerReference)("40339605caa9b7666f19feca09ef42b0799ce1c031",N.callServer,void 0,N.findSourceMapURL,"redirectToCheckout");function w({disabled:e,text:a}){let{pending:s}=(0,j.useFormStatus)();return(0,t.jsx)(o.Button,{type:"submit",disabled:e||s,variant:"primary",className:"w-full",size:"medium",loading:s,loadingText:"Redirecting to checkout...",children:a||"Proceed to Checkout"})}let C=({id:e,totals:s,isLoading:r=!1,className:i,cartId:n,onCheckout:l,isCheckoutDisabled:c=!1,checkoutButtonText:d="Proceed to Checkout",onApplyCoupon:m,isCouponLoading:u=!1,appliedCoupons:x,onRemoveCoupon:h})=>{let[y,b]=(0,a.useState)(""),[j,N]=(0,a.useState)(!1),C=async()=>{y.trim()&&m&&(await m(y.trim()),b(""),N(!1))};return r?(0,t.jsxs)("div",{id:e,className:(0,f.default)("bg-bg-secondary text-primary rounded-lg p-6",i),role:"status","aria-label":"Loading order summary",children:[(0,t.jsx)("span",{className:"sr-only",children:"Loading order summary..."}),(0,t.jsx)("h2",{className:"text-xl font-agrandir font-bold mb-4",children:"Order Summary"}),(0,t.jsxs)("div",{className:"space-y-3","aria-hidden":"true",children:[(0,t.jsx)(g.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)(g.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)(g.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)("div",{className:"border-t border-border-primary pt-3",children:(0,t.jsx)(g.Skeleton,{className:"h-6 w-full"})})]}),(0,t.jsx)(g.Skeleton,{className:"h-12 w-full mt-6","aria-hidden":"true"})]}):(0,t.jsxs)("div",{id:e,className:(0,f.default)("bg-bg-secondary text-primary rounded-lg p-6",i),children:[(0,t.jsx)("h2",{className:"text-xl font-agrandir font-bold mb-4",children:"Order Summary"}),(0,t.jsxs)("dl",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex justify-between py-5 border-b-1 border-brand-primary/20",children:[(0,t.jsx)("dt",{className:"text-body-m-bold",children:"Subtotal"}),(0,t.jsx)("dd",{className:"text-body-m text-right",children:(0,p.formatPrice)(s.subtotal)})]}),(s.discount>0||s.subscriptionDiscount>0)&&(0,t.jsxs)("div",{className:"flex justify-between text-utility-success",children:[(0,t.jsx)("span",{children:"Discounts"}),(0,t.jsxs)("span",{children:["-",(0,p.formatPrice)(s.discount+s.subscriptionDiscount)]})]}),(0,t.jsx)("div",{className:"py-4 border-b-1 border-brand-primary/20",children:x&&x.length>0?(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("span",{className:"text-body-m-bold",children:["Coupon Code: ",x[0].code]}),(0,t.jsx)("button",{onClick:()=>{h&&x&&h(x[0]?.code)},className:"text-sm text-brand-primary hover:text-brand-primary-light transition-colors",disabled:u,children:"Remove"})]}):(0,t.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>N(!j),className:"flex justify-between items-center w-full text-left","aria-expanded":j,"aria-controls":"coupon-input-container",children:[(0,t.jsx)("span",{className:"text-body-m-bold",children:"Coupon Code"}),(0,t.jsx)("span",{className:"text-sm text-brand-primary hover:text-brand-primary-light cursor-pointer transition-colors",children:j?"Cancel":"Add Coupon Code"})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:(0,f.default)("absolute inset-0 bg-gradient-to-b from-transparent via-bg-secondary/50 to-bg-secondary transition-opacity duration-500",j?"opacity-0 pointer-events-none":"opacity-100"),style:{maskImage:j?"none":"linear-gradient(to bottom, transparent 0%, black 100%)",WebkitMaskImage:j?"none":"linear-gradient(to bottom, transparent 0%, black 100%)"}}),(0,t.jsx)("div",{id:"coupon-input-container",className:(0,f.default)("transition-all duration-500 ease-out transform-gpu",j?"max-h-32 opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-4 overflow-hidden"),children:(0,t.jsxs)("div",{className:"flex flex-col space-y-3 pt-3",children:[(0,t.jsx)("label",{htmlFor:"coupon-code-input",className:"sr-only",children:"Coupon code"}),(0,t.jsx)("input",{id:"coupon-code-input",type:"text",value:y,onChange:e=>b(e.target.value),onKeyDown:e=>"Enter"===e.key&&C(),placeholder:"Enter coupon code","aria-describedby":"
1coupon-help",className:(0,f.default)("w-full px-4 py-3 bg-bg-primary/20 text-color-primary border border-border-primary rounded-md","focus:outline-none focus:ring-2 focus:ring-brand-primary focus:border-brand-primary","transition-all duration-300 ease-out",j?"scale-100":"scale-95"),disabled:u,autoFocus:j}),(0,t.jsx)("span",{id:"coupon-help",className:"sr-only",children:"Press Enter to apply coupon"}),(0,t.jsx)(o.Button,{onClick:C,variant:"primary",size:"small",disabled:!y.trim()||u,className:(0,f.default)("w-full transition-all duration-300 ease-out delay-75 bg-brand-primary",j?"scale-100 translate-y-0":"scale-95 -translate-y-2"),children:"Apply Coupon"})]})})]})]})}),(0,t.jsxs)("div",{className:"flex justify-between py-5 border-b-1 border-brand-primary/20",children:[(0,t.jsx)("dt",{className:"text-body-m-bold",children:"Tax"}),(0,t.jsx)("dd",{className:"text-body-s text-right",children:"Calculated in Checkout"})]})]}),(0,t.jsx)("div",{className:"mb-5",children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-lg font-semibold text-primary",children:"Total"}),(0,t.jsx)("span",{className:"text-xl font-bold text-primary",children:(0,p.formatPrice)(s.total)})]})}),n&&""!==n&&!l?(0,t.jsxs)("form",{action:v,children:[(0,t.jsx)("input",{type:"hidden",name:"cartId",value:n||""}),(0,t.jsx)(w,{disabled:c||0===s.subtotal,text:d})]}):(0,t.jsx)(o.Button,{onClick:l,disabled:c||0===s.subtotal,variant:"primary",className:"w-full",size:"medium",role:"link",children:d})]})};function S(e){return e&&0!==e.length?e.map(e=>e.value).join(", "):""}function k(e){let t=e.toLowerCase();return t.includes("pouch")?"pouches":t.includes("lozenge")?"lozenges":t.includes("gum")?"gum":t.includes("bundle")||t.includes("pack")?"bundles":"products"}C.displayName="CartSummary",e.s(["CartClient",0,function({initialCart:e=null}){let[l,c]=(0,a.useState)(!1),o=(0,s.useRouter)(),m=(0,i.useAnnouncerStore)(e=>e.announce),{trackRemoveFromCart:u,trackViewCart:x}=(0,n.useGTM)(),p=(0,a.useRef)(!1);!p.current&&e&&(r.useCartStore.getState().setCart(e),p.current=!0),(0,a.useEffect)(()=>{c(!0)},[]);let{cartId:h,items:y,totals:f,isLoading:j,errors:g,coupons:N,fetchCart:v,updateQuantity:w,removeItem:P,getItemCount:q,applyCoupon:I,removeCoupon:R,resetErrors:T}=(0,r.useCartStore)();(0,a.useEffect)(()=>{y.length>0&&l&&x({cartItems:y.map(e=>({productId:e.productId,productName:e.name,productCategory:k(e.name),productPrice:e.subscriptionPrice||e.price,productQuantity:e.quantity,productVariant:S(e.options)})),cartTotal:f.total,currency:"USD"})},[y,f.total,l,x]),(0,a.useEffect)(()=>{p.current||v().catch(e=>{e instanceof Error&&(e.message.includes("Cart does not exist")||e.message.includes("No cart found"))&&r.useCartStore.setState({items:[],totals:{subtotal:0,shipping:0,discount:0,subscriptionDiscount:0,total:0},cartId:null})})},[v]);let $=async(e,t)=>{let a=y.find(t=>t.id===e);if(a&&t<a.quantity){let e=a.quantity-t;u({productId:a.productId,productName:a.name,productCategory:k(a.name),productPrice:a.subscriptionPrice||a.price,productQuantity:e,productVariant:S(a.options),currency:"USD"})}await w(e,t)},z=async(e,t)=>{try{let a=y.findIndex(t=>t.id===e),s=y.find(t=>t.id===e);if(s){let e={productId:s.productId,productName:s.name,productCategory:k(s.name),productPrice:s.subscriptionPrice||s.price,productQuantity:s.quantity,productVariant:S(s.options),currency:"USD"};u(e)}await P(e),m(`${t} removed from cart`),setTimeout(()=>{if(1===y.length){let e=document.querySelector("[data-continue-shopping]");e?.focus()}else if(a<y.length){let e=document.querySelector(`[data-cart-item-index="${a}"]`);if(e){let t=e.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');t?.focus()}}else if(a>0){let e=document.querySelector(`[data-cart-item-index="${a-1}"]`);if(e){let t=e.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');t?.focus()}}},100)}catch(e){m("Failed to remove item. Please try again.")}};return((0,a.useEffect)(()=>()=>{T(),r.useCartStore.getState().stopRefreshInterval()},[T]),l)?j.fetch||0!==y.length?(0,t.jsxs)("div",{className:"responsive-container mx-auto px-4 md:px-0 py-8",children:[(0,t.jsx)("a",{href:"#cart-summary",className:"sr-only focu
1s:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-10 focus:px-4 focus:py-2 focus:bg-brand-primary focus:text-white focus:rounded-md",children:"Skip to cart summary"}),(0,t.jsx)("h1",{className:"text-3xl font-bold text-primary mb-8",children:(0,t.jsxs)("span",{"aria-live":"polite","aria-atomic":"true",children:["Shopping Cart (",q()," ",1===q()?"item":"items",")"]})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[(0,t.jsxs)("section",{className:"lg:col-span-2","aria-label":"Cart items",children:[(0,t.jsx)("h2",{className:"sr-only",children:"Your cart items"}),(0,t.jsx)("ul",{className:"space-y-4",role:"list",children:y.map((e,a)=>(0,t.jsx)("li",{children:(0,t.jsx)(b,{item:e,onQuantityChangeAction:$,onRemoveAction:t=>z(t,e.name),loading:j.updateItem||j.removeItem,className:"bg-bg-secondary","data-cart-item-index":a})},e.id))})]}),(0,t.jsxs)("aside",{className:"lg:col-span-1","aria-label":"Order summary",children:[(0,t.jsx)(C,{id:"cart-summary",totals:f,isLoading:j.fetch,cartId:h,onContinueShopping:()=>o.push("/"),isCheckoutDisabled:j.fetch||0===y.length,showTax:!1,appliedCoupons:N,className:"sticky top-4 bg-bg-secondary",onApplyCoupon:I,onRemoveCoupon:R}),Object.entries(g).map(([e,a])=>a?(0,t.jsx)("div",{role:"alert",className:"mt-4 p-3 bg-error/20 border border-error rounded-lg",children:(0,t.jsx)("p",{className:"text-sm text-error",children:a})},e):null)]})]})]}):(0,t.jsx)("div",{className:"min-h-screen responsive-container text-primary",children:(0,t.jsx)("div",{className:"responsive-container mx-auto px-4 py-8 max-w-7xl",children:(0,t.jsx)(d,{ctaHref:"/"})})}):(0,t.jsx)("div",{className:"min-h-screen bg-bg-primary text-primary",children:(0,t.jsx)("div",{className:"responsive-container mx-auto px-4 py-8 max-w-7xl",children:(0,t.jsxs)("div",{className:"animate-pulse",children:[(0,t.jsx)("div",{className:"h-8 bg-brand-primary rounded w-1/4 mb-4"}),(0,t.jsx)("div",{className:"h-32 bg-brand-primary rounded mb-4"}),(0,t.jsx)("div",{className:"h-32 bg-brand-primary rounded mb-4"})]})})})}],855862)},727612,e=>{"use strict";let t=(0,e.i(475254).default)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",0,t],727612)}]);

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.