PageSourceSearch

https://www.birchbox.co.uk/_next/static/chunks/6504.f7709698afdb215c.js

js birchbox.co.uk collected 2026-10-02 15:10:36 UTC 13,549 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6504],{17152:(e,l,t)=>{t.d(l,{A:()=>s});var n=t(37876),i=t(14232),r=t(39895);let a=0,s={image:e=>{let{node:l}=e;a+=1;let t=l.linkTo?(0,r.A)(l.linkTo):null,s=l.linkTo&&l.linkTo.target?{target:l.linkTo.target,rel:"noopener"}:{},o=[l.label||"","block-img"],d=(null==l?void 0:l.alt)||"Article image ".concat(a),u=(0,n.jsx)("img",{src:(null==l?void 0:l.url)||"",alt:d,copyright:(null==l?void 0:l.copyright)||""}),c={className:o.join(" ")},m=t?(0,n.jsx)("a",{href:t,...s,children:u}):u;return(0,i.createElement)("p",c,m)},embed:e=>{let{node:l}=e,t={"data-oembed":l.oembed.embed_url,"data-oembed-type":l.oembed.type,"data-oembed-provider":l.oembed.provider_name,className:"video-embed",dangerouslySetInnerHTML:{__html:l.oembed.html}};return(0,i.createElement)("div",t)},hyperlink:e=>{let{node:l,children:t}=e,n=l.data.target?{target:l.data.target,rel:"noopener"}:{},a=(0,r.A)(l.data);return(0,i.createElement)("a",{target:n,href:a},t)},label:e=>{var l;let{node:t,children:n}=e;if((null==t||null==(l=t.data)?void 0:l.label)==="blockquote")return(0,i.createElement)("blockquote",{},n);let r=t.data.label?{className:t.data.label}:{className:""};return(0,i.createElement)("span",r,n)},heading1:e=>{let{children:l}=e;return(null==l?void 0:l.some(e=>"string"==typeof e?e.trim():e))?(0,i.createElement)("h1",{},l):null},heading2:e=>{let{children:l}=e;return(null==l?void 0:l.some(e=>"string"==typeof e?e.trim():e))?(0,i.createElement)("h2",{},l):null},heading3:e=>{let{children:l}=e;return(null==l?void 0:l.some(e=>"string"==typeof e?e.trim():e))?(0,i.createElement)("h3",{},l):null},heading4:e=>{let{children:l}=e;return(null==l?void 0:l.some(e=>"string"==typeof e?e.trim():e))?(0,i.createElement)("h4",{},l):null},heading5:e=>{let{children:l}=e;return(null==l?void 0:l.some(e=>"string"==typeof e?e.trim():e))?(0,i.createElement)("h5",{},l):null},heading6:e=>{let{children:l}=e;return(null==l?void 0:l.some(e=>"string"==typeof e?e.trim():e))?(0,i.createElement)("h6",{},l):null}}},17171:e=>{e.exports=JSON.parse('{"N":{"WQ":"Add to cart","YF":"Adding...","qk":"Coming soon"},"q":{"OA":"How to use it","Yq":"Reviews","fy":"Ingredients","eq":"Highlights","pt":"View all","UJ":"Read more","ap":"Collapse","vh":"Subscribed","OL":"You\'re subscribed to another plan.","Jl":{"D":"You may also like"}}}')},30574:(e,l,t)=>{t.d(l,{A:()=>s});var n=t(37876),i=t(46462),r=t(39895),a=t(17152);let s=function(e){let{content:l}=e;return(0,n.jsx)(i.$,{field:l,linkResolver:r.A,components:a.A})}},76504:(e,l,t)=>{t.r(l),t.d(l,{default:()=>v});var n=t(37876),i=t(14232),r=t(78723),a=t(92918),s=t(74380),o=t(78799),d=t(60272),u=t(30574),c=t(97091),m=t(88636),p=t(94144);function b(e){var l,t,r,a;let{subscription:s,onAddToCart:d,isBestValue:u}=e,[c,b]=(0,i.useState)(!1),x=(null==m||null==(l=m.products)?void 0:l[s.productId.split("/").pop()])||(null==m?void 0:m.sellingPlanBulletPoints),v=(null==s||null==(t=s.productId)?void 0:t.split("/").pop())===(null==m||null==(r=m.promotionDetails)?void 0:r.product),h={"en-us":"$","en-gb":"\xa3"};return(0,n.jsxs)("div",{className:"border shrink-0 flex flex-col justify-between pb-6 border-gray-150 bg-white w-[300px] lg:w-[328px] shadow-md md:shadow-bbx-xl",children:[u&&(0,n.jsx)("div",{className:"flex justify-center px-10 py-4 bg-bbx-neon-green",children:(0,n.jsx)("span",{className:"text-2xl font-medium lg:text-3xl",children:m.topPick})}),(0,n.jsxs)("div",{className:"flex flex-col px-8 pb-6 mt-6 gap-y-6",children:[(0,n.jsx)("h3",{className:"text-2xl font-medium lg:text-3xl",children:s.name}),v&&(0,n.jsx)("div",{className:"text-lg bg-bbx-neon-green rounded-full px-5 py-1 w-fit",dangerouslySetInnerHTML:{__html:null==m||null==(a=m.promotionDetails)?void 0:a.calloutText}}),(0,n.jsxs)("p",{className:"font-medium text-gray-500",children:[(0,n.jsx)("span",{className:"text-2xl font-normal tracking-tight",children:s.priceHeader}),(0,n.jsxs)("span",{className:"",children:["/ ",s.frequencyText]})]}),(0,n.jsx)("ul",{className:"flex-1 mb-8 space-y-3",children:null==x?void 0:x.map((e,l,t)=>{if(l===t.length-1){var i;let l=Number(e),t=(Number(parseFloat(s.priceHeader.replace(/[\$£]/g,"")))*l).toFixed(2),r=Math.floor(l/12),a=l%12,d="".concat(l," month").concat(l>1?"s":"");return l>=12&&(d="".concat(r," year").concat(r>1?"s":"").concat(a>0?", ".concat(a," month").concat(a>1?"s":""):"").trim()),v?[(0,n.jsxs)("li",{className:"text-sm list-item-checkmark",children:["Renews at ",t,"/",d]},"renew-".concat(l)),(0,n.jsx)("li",{className:"text-sm list-item-checkmark",children:null==m||null==(i=m.promotionDetail
1s)?void 0:i.bulletPoint},"promo-".concat(l))]:(0,n.jsxs)("li",{className:"text-sm list-item-checkmark",children:["Renews at ",h[o.vV],t,"/",d]},"renew-".concat(l))}return(0,n.jsx)("li",{className:"text-sm list-item-checkmark",children:e},e)})})]}),(0,n.jsx)("div",{className:"mx-6",children:(0,n.jsx)(p.A,{product:{id:s.productId,name:s.name,price:{amount:s.pricePerMonth.toString(),currencyCode:s.currencyCode},vendor:"birchbox",availableForSale:!0,requiresSellingPlan:!0},loading:c,setLoading:b,sellingPlanId:s.sellingPlanId,variant:{id:s.variantId,availableForSale:!0},ctaText:"es-es"===o.vV?"Suscr\xedbete":"Subscribe",onAddToCart:d,className:"w-full button button-primary"})})]})}function x(e){let{sectionTitle:l,display:t="All Subscription Box"}=e,[m,p]=(0,i.useState)(!1),{items:x}=(0,s.Ay)(),v=(0,i.useMemo)(()=>{var e;return null==x||null==(e=x.find(e=>(0,d.B)(e.merchandise.id)))?void 0:e.id},[x]),h=(0,i.useMemo)(()=>a.filter(e=>"All Subscription Box"===t?e.sellingPlanTypes.includes("all"):"Gift Subscription Box"===t?e.sellingPlanTypes.includes("gift"):"ACE Subscription Box"===t?e.sellingPlanTypes.includes("ace"):"Featured Subscription Box 1"===t?e.sellingPlanTypes.includes("featured1"):"Featured Subscription Box 2"===t?e.sellingPlanTypes.includes("featured2"):"Featured Subscription Box 3"===t?e.sellingPlanTypes.includes("featured3"):"Featured Subscription Box 4"===t?e.sellingPlanTypes.includes("featured4"):"Featured Subscription Box 5"===t?e.sellingPlanTypes.includes("featured5"):"Featured Subscription Box 6"===t?e.sellingPlanTypes.includes("featured6"):"Featured Subscription Box 7"===t?e.sellingPlanTypes.includes("featured7"):"Featured Subscription Box 8"===t?e.sellingPlanTypes.includes("featured8"):"Featured Subscription Box 9"===t?e.sellingPlanTypes.includes("featured9"):"Featured Subscription Box 10"===t&&e.sellingPlanTypes.includes("featured10")),[t]),g=(0,i.useMemo)(()=>h.reduce((e,l)=>null===e||l.pricePerMonth<e?l.pricePerMonth:e,null),[h]),y=()=>{document.cookie.split(";").some(e=>e.trim().startsWith("bbSurveySubmitted="))||p(!0)};return(0,n.jsxs)("section",{className:"flex flex-col items-center pricing-cards section",id:"choose-plan",children:[(0,n.jsxs)("div",{className:"overflow-x-auto max-md:w-screen md:container",children:[(0,n.jsx)("div",{className:"flex items-end justify-between max-md:container",children:(null==l?void 0:l[0])&&(0,n.jsx)("div",{className:"text-3xl font-medium lg:text-6xl",children:(0,n.jsx)(u.A,{content:l})})}),(0,n.jsx)("div",{className:"grid justify-center md:justify-between md:py-8 md:mt-8 overflow-x-auto max-md:px-4 max-md:grid-flow-row-dense md:grid-cols-2 xl:grid-cols-3 gap-8 md:gap-16 lg:mt-12",children:h.map(e=>(0,n.jsx)(b,{onAddToCart:y,isBestValue:"es-es"!==o.vV&&e.pricePerMonth===g,subscription:e},e.productId))})]}),v&&(0,n.jsx)(r.BN,{surveyType:"new",children:(0,n.jsx)(c.A,{isModalOpen:m,closeModal:()=>{p(!1)}})})]})}function v(e){let{slice:l}=e;return(0,n.jsx)(x,{display:l.primary.selling_plans,sectionTitle:l.primary.section_title})}},86920:(e,l,t)=>{t.d(l,{A:()=>s});var n=t(20542),i=t(58149),r=t(78799),a=t(60272);function s(e){let{product:l,variant:t}=e,{canAddSubscriptionBoxToCart:s,subscriptionBoxInCart:o,alreadyPurchasedSubscriptionBox:d}=(0,n.A)(),{data:u}=(0,i.Ay)([d,l,t,s,o],()=>(function(e){var l;let{product:t,variant:n,canAddSubscriptionBoxToCart:i,subscriptionBoxInCart:s,alreadyPurchasedSubscriptionBox:o}=e;if(!(null==n?void 0:n.id))return!1;let d=(0,a.B)(n.id),u=i||(null==s?void 0:s.productId)!==t.id;return!!(!d&&r.PI&&t.availableForSale&&n.availableForSale&&(null!=(l=n.quantityAvailable)?l:1)>0||d&&u)})({alreadyPurchasedSubscriptionBox:d,product:l,variant:t,canAddSubscriptionBoxToCart:s,subscriptionBoxInCart:o}));return u}},88636:e=>{e.exports=JSON.parse('{"seeAllPlans":"See All Plans","sellingPlanBulletPoints":["Get 2-6 items every month","Free Shipping"],"promotionDetails":{"product":"","calloutText":"","bulletPoint":""},"products":{"6839074455609":["Everything in Monthly Membership, plus…","Save 12% each billing period",12],"6839071801401":["Everything in Monthly Membership, plus…","Save 3% each billing period",3],"6838751592505":["Receive 4-6 items every month","Trial, deluxe-sample, and full-size options","Free Shipping",1]},"topPick":"TOP PICK"}')},94144:(e,l,t)=>{t.d(l,{A:()=>h});var n=t(37876),i=t(20542),r=t(17171),a=t(36854),s=t(36595),o=t(7293),d=t(19467),u=t(49018),c=t(36710),m=t(94444),p=t(86920),b=t(74380),x=t(78799),v=t(60272);function h(e){var l;let{product:t,variant:h,loading:g,setLoading:y,sellingPlanId:f,priceText:j,ctaText:N=r.N.WQ,onAddToCart:A,className:S="button button-primary whitespace-nowrap",render
1SoldOutButton:k=!0,icon:w,breadcrumbs:P=null,lineItemAttributes:T}=e,B=(0,m.A)(),{subscriptionBoxInCart:F,alreadyPurchasedSubscriptionBox:_}=(0,i.A)(),q=(0,v.B)(null==h?void 0:h.id),{items:I,revalidate:C}=(0,b.Ay)(),E=(0,p.A)({product:t,variant:h}),M=g?r.N.YF:N,W=async()=>{var e,l,n,i,r,m,p,b,x,g,j,N,S,k;y(!0);let w=null==I||null==(e=I.find(e=>(0,v.B)(e.merchandise.id)))?void 0:e.id;if(!f&&t.requiresSellingPlan)throw Error("Product requires a selling plan, but none was selected.");let F=I||[],_=F.filter(e=>{var l;return!e.sellingPlanAllocation&&!e.merchandise.sku.startsWith("bb-box")&&!e.merchandise.sku.startsWith("signature-box")&&!(null==(l=e.attributes)?void 0:l.some(e=>"source"===e.key&&"get_started_gift"===e.value))}),E=F.filter(e=>e.sellingPlanAllocation||e.merchandise.sku.startsWith("bb-box")||e.merchandise.sku.startsWith("signature-box"));async function M(e,l){try{await e(),null==l||l()}catch(e){console.error("Error during revalidate or onAddToCart:",e)}}async function W(){q?(_.length>0&&await (0,c.A)(_.filter(e=>void 0!==e.id).map(e=>({id:e.id}))),w?await (0,u.A)({id:w,quantity:1,variantId:h.id,sellingPlanId:f||void 0}):await B({variantId:h.id||"",quantity:1,sellingPlanId:f,attributes:T})):q||(w&&await (0,c.A)(E.map(e=>({id:e.id||""}))),await B({variantId:null==h?void 0:h.id,quantity:1,sellingPlanId:f,attributes:T})),await M(C,A),y(!1)}await W();let O=(0,s.A)({product:t,price:(null==h||null==(l=h.price)?void 0:l.amount)||(null==t||null==(n=t.price)?void 0:n.amount),productBreadcrumb:P,isSubscriptionBox:!!q});(0,o.h)({event:"analytics_event",data:{eventData:{category:"ecommerce",action:"addToCart",label:null==t?void 0:t.name},ecommerce:{currencyCode:(null==h||null==(i=h.price)?void 0:i.currencyCode)||(null==t||null==(r=t.price)?void 0:r.currencyCode),add:{actionField:{list:(null==P||null==(m=P[0])?void 0:m.title)||"membership"},products:[O]}}}}),t&&t.id&&h&&h.id&&(0,d.zM)(t,1,(null==P||null==(S=P[0])?void 0:S.title)||"membership");let V=null!=(k=null==h||null==(p=h.price)?void 0:p.amount)?k:null==t||null==(b=t.price)?void 0:b.amount,D=null==T||null==(x=T.find(e=>"source"===e.key))?void 0:x.value;a.Ay.capture("add_to_cart",{product_id:null==t?void 0:t.id,product_name:null==t?void 0:t.name,variant_id:null==h?void 0:h.id,quantity:1,value:null!=V?parseFloat(String(V)):void 0,currency:(null==h||null==(g=h.price)?void 0:g.currencyCode)||(null==t||null==(j=t.price)?void 0:j.currencyCode),is_subscription_box:!!q,list:(null==P||null==(N=P[0])?void 0:N.title)||"membership",...D&&{source:D}})};if((null==h?void 0:h.price)&&(null==(l=h.price)?void 0:l.amount)==="0")return null;if(E)return(0,n.jsxs)("button",{className:S,type:"button",disabled:g,onClick:W,children:[w&&(0,n.jsx)("i",{className:w}),M," ",j&&(0,n.jsxs)("span",{className:"md:hidden",children:["(",j,")"]})]});let O="button button-primary";if((null==t?void 0:t.requiresSellingPlan)&&!f)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:O,type:"button",disabled:!0,children:r.N.WQ}),(0,n.jsx)("p",{className:"mt-2 text-xs",children:"This product requires a subscription to be selected."})]});if(q){if(_&&_.productId===t.id&&_.variantId===h.id)return(0,n.jsxs)("button",{type:"button",className:O,disabled:!0,children:[(0,n.jsx)("i",{className:"mr-1 fa fa-check"})," ",r.q.vh]});if(_)return(0,n.jsxs)("div",{className:"relative flex flex-col justify-end pb-2",children:[(0,n.jsx)("button",{className:O,type:"button",disabled:!0,children:"es-es"===x.vV?"Suscr\xedbete":"Subscribe"}),(0,n.jsx)("p",{className:"absolute inset-x-0 mt-1 text-xs text-center",style:{transform:"translate(0, calc(100% + 4px))"},children:r.q.OL})]});if(F&&F.productId===t.id)return(0,n.jsxs)("button",{className:O,type:"button",disabled:!0,children:[(0,n.jsx)("i",{className:"mr-2 fa fa-check"}),"es-es"===x.vV?"Adicional":"Added"]})}return k?(0,n.jsx)("div",{className:"button button-primary disabled",title:"This product is currently out of stock.",children:r.N.qk}):null}},94444:(e,l,t)=>{t.d(l,{A:()=>r});var n=t(74380),i=t(27022);function r(){let{revalidate:e}=(0,n.Ay)();return async l=>{let{variantId:t,quantity:n,sellingPlanId:r,attributes:a}=l;await (0,i.A)({variantId:t,quantity:n,sellingPlanId:r,attributes:a}),await e()}}}}]);
2//# sourceMappingURL=6504.f7709698afdb215c.js.map

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.