PageSourceSearch

https://www.birchbox.com/_next/static/chunks/pages/profile/orders/shop-orders-8cacbc5ffe211415.js

js birchbox.com collected 2026-10-02 02:49:43 UTC 10,471 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1542],{47808:(e,r,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/orders/shop-orders",function(){return l(75862)}])},48369:(e,r,l)=>{"use strict";l.d(r,{A:()=>t});var s=l(37876);function t(e){let{classNames:r="bg-gray-100",iconSize:l="fa-xl"}=e;return(0,s.jsx)("div",{className:"flex flex-col items-center h-full justify-center text-gray-300 flex-1 ".concat(r),children:(0,s.jsx)("i",{className:"fak fa-birchbox ".concat(l)})})}},65405:(e,r,l)=>{"use strict";l.d(r,{A:()=>x});var s=l(37876);let t=JSON.parse('{"Attempted delivery":"Attempted delivery","Canceled":"Canceled","Confirmed":"Confirmed","Delivered":"Delivered","Failure":"Failure","Shipped":"Shipped","In transit":"In transit","Label printed":"Label printed","Label purchased":"Label purchased","Label voided":"Label voided","Marked as fulfilled":"Marked as fulfilled","Not delivered":"Not delivered","Out for delivery":"Out for delivery","Ready for pickup":"Ready for pickup","Picked up":"Picked up","Submitted":"Submitted","Order Placed":"Order Placed","Partially fulfilled":"Partially fulfilled","Restocked":"Restocked","Open":"Open","In progress":"In progress","On hold":"On hold","Scheduled":"Scheduled","multipleBoxErrorText":"Only one subscription box is allowed per account. Create a new account to add another box."}');var i=l(78799),n=l(58929),a=l(14059);let d={0:"0%",1:"33.33333%",2:"66.666667%",3:"100%"},o=Array.from({length:Object.keys(d).length},(e,r)=>r);function c(e){var r;let{shipmentProgress:l}=e,t=null!=(r=d[l])?r:d[0];return(0,s.jsxs)("div",{className:"relative w-full",children:[(0,s.jsxs)("div",{className:"relative flex items-center justify-between w-full h-1 bg-gray-100 rounded-full",children:[o.map(e=>(0,s.jsx)("div",{className:"w-3 h-3 rounded-full ".concat(l&&l>=e?"bg-bbx-spark":"bg-gray-100")},"shipment-progress-".concat(e))),(0,s.jsx)("div",{className:"absolute inset-x-0 top-0 w-full h-full transition-transform duration-[800ms] ease-in-out origin-left bg-bbx-spark",style:{transform:"scaleX(".concat(t,")")}})]}),(0,s.jsx)("div",{className:"absolute inset-0 trasnition duration-[800ms] ease-in-out ".concat("number"!=typeof l?"hidden":""),"aria-hidden":"true",style:{transform:"translate(".concat(t,", 0)")},children:(0,s.jsx)("div",{className:"relative rounded-full bg-bbx-spark p-1.5 before:bg-bbx-spark/50 before:absolute before:-inset-2 before:rounded-full w-min -translate-y-1/2 -translate-x-1/2",children:(0,s.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"relative z-10",children:[(0,s.jsx)("path",{d:"M8.25 3.75001H10.2469C10.3216 3.74952 10.3947 3.77165 10.4566 3.81348C10.5185 3.85531 10.5663 3.91488 10.5938 3.98438L11.25 5.62501",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M0.75 6.75H8.25",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M8.8125 10.125C9.43382 10.125 9.9375 9.62132 9.9375 9C9.9375 8.37868 9.43382 7.875 8.8125 7.875C8.19118 7.875 7.6875 8.37868 7.6875 9C7.6875 9.62132 8.19118 10.125 8.8125 10.125Z",stroke:"white",strokeMiterlimit:"10"}),(0,s.jsx)("path",{d:"M3.1875 10.125C3.80882 10.125 4.3125 9.62132 4.3125 9C4.3125 8.37868 3.80882 7.875 3.1875 7.875C2.56618 7.875 2.0625 8.37868 2.0625 9C2.0625 9.62132 2.56618 10.125 3.1875 10.125Z",stroke:"white",strokeMiterlimit:"10"}),(0,s.jsx)("path",{d:"M7.6875 9H4.3125",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2.0625 9H1.125C1.02554 9 0.930161 8.96049 0.859835 8.89017C0.789509 8.81984 0.75 8.72446 0.75 8.625V3.375C0.75 3.27554 0.789509 3.18016 0.859835 3.10984C0.930161 3.03951 1.02554 3 1.125 3H8.25V8.025",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M8.25 5.625H11.25V8.625C11.25 8.72446 11.2105 8.81984 11.1402 8.89017C11.0698 8.96049 10.9745 9 10.875 9H9.9375",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"})]})})})]})}var u=l(99219);function x(e){var r,l,d,o;let{order:x,inModal:p=!1}=e,m=x.createdAt,h=(0,a.v9)(m),v="createdAt"in x?h:(0,a.bU)(x.processedAt),f="month"in x?{status:null==(r=x.shippingDetail)?void 0:r.fulfillmentStatus,message:i.PF[null==(l=x.shippingDetail)?void 0:l.fulfillmentStatus]}:(0,n.Rr)(x),j=(0,n.WB)(f),g=(null==x?void 0:x.orderNumber)||(null==(d=x.shippingDetail)?void 0:d.orderNumber);return(0,s.jsxs)("div",{className:"flex-1 flex flex-col ".concat(p?"":"p-6 pb-12"),children:[(0,s.jsxs)("div",{className:"flex justify-between pb-4 ".concat(p?"pt-4 px-12":""),children:[v&&(0,s.jsx)("h3",{className:"font-medium",children:v}),(null==x||null==(o=x.currentTotalPrice)?void 0:o.amount)&&(0,s.jsx)("span",{className:"ml-auto font-medium text-gray-500",children:(0,s.jsx)(u.A,{price:{amount:x.currentTotalPrice.amount,currencyCode:"es-es"===i.vV?"EUR":x.currentTotalPrice.currencyCode}})})]}),(0,s.jsxs)("div",{className:"flex flex-col pt-4 border-t border-gray-200 gap-y-3 ".concat(p?"px-12":""),children:[g&&(0,s.jsxs)("div",{className:"flex justify-between text-sm font-light",children:[(0,s.jsx)("span",{children:"es-es"===i.vV?"N\xfamero de orden":"Order Number"}),(0,s.jsx)("span",{className:"text-gray-500",children:g})]}),(null==f?void 0:f.message)&&(0,s.jsxs)("div",{className:"flex justify-between text-sm font-light",children:[(0,s.jsx)("span",{children:"es-es"===i.vV?"Estado del pedido":"Order Status"}),(0,s.jsx)("span",{className:"text-gray-500",children:t[f.message]})]})]}),(0,s.jsx)("div",{className:"mx-4 mt-10 ".concat(p?"mb-8 px-12":""),children:(0,s.jsx)(c,{shipmentProgress:j})})]})}},75862:(e,r,l)=>{"use strict";l.r(r),l.d(r,{default:()=>y});var s=l(37876),t=l(62429),i=l(78799),n=l(10553),a=l(58149),d=l(58929),o=l(18528),c=l(81560),u=l(14232),x=l(54587),p=l.n(x),m=l(48369),h=l(65405);function v(e){let{order:r,openOrderModal:l}=e;return(0,s.jsxs)("button",{type:"button",className:"order-card",onClick:()=>l(null==r?void 0:r.id),children:[Array.isArray(null==r?void 0:r.lineItems)&&(0,s.jsxs)("div",{className:"flex items-center justify-center border-b border-gray-200 gap-x-3 h-28",children:[r.lineItems.map((e,l)=>{var t,i;return(null==e?void 0:e.variant)&&l<=4?(0,s.jsx)("div",{className:"px-6 pt-8 pb-6",children:(null==(t=e.variant.image)?void 0:t.url)&&(0,s.jsx)(p(),{src:null==(i=e.variant.image)?void 0:i.url,alt:e.title,width:48,height:48,className:"object-contain"})},e.variant.id):(0,s.jsx)(m.A,{},"".concat(r.orderNumber,"-no-variant"))}),r.lineItems.length>5&&(0,s.jsxs)("li",{className:"mr-4 font-medium text-gray-500",children:["+",r.lineItems.length-5]})]}),(0,s.jsx)(h.A,{order:r})]})}var f=l(48230),j=l.n(f),g=l(11752);function b(e){var r;let{order:l,activeOrder:t,closeModal:n}=e;return(0,s.jsx)(g.A,{isOpen:t===(null==l?void 0:l.id),closeModal:n,desktopStyle:"floating",children:(0,s.jsxs)("div",{className:"divide-y divide-gray-200",children:[(0,s.jsx)("h2",{className:"pb-6 font-serif text-xl text-center pt-7",children:"es-es"===i.vV?"Detalles del pedido":"Order Details"}),(0,s.jsx)(h.A,{order:l,inModal:!0}),Array.isArray(null==l?void 0:l.lineItems)&&l.lineItems.length>0&&(0,s.jsx)("ul",{className:"flex flex-col px-12 pt-12 gap-y-6 pb-14",children:null==l||null==(r=l.lineItems)?void 0:r.map(e=>{var r,t;return e.variant?(0,s.jsx)(j(),{legacyBehavior:!0,href:"".concat(i.NG,"/").concat(e.variant.handle),children:(0,s.jsxs)("a",{className:"flex gap-x-4",children:[(0,s.jsx)("div",{children:(0,s.jsx)(p(),{src:null==(r=e.variant.image)?void 0:r.url,alt:e.title,width:48,height:48,priority:!0,objectFit:"cover"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-0.5",children:[(0,s.jsx)("h4",{className:"text-sm font-medium",children:e.title}),(0,s.jsx)("span",{children:e.variant.title}),(0,s.jsxs)("span",{children:["SKU: ",e.variant.sku]})]})]})},"".concat(l.orderNumber,"-").concat(null==e||null==(t=e.variant)?void 0:t.id)):(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsx)("div",{className:"w-[48px] h-[48px]",children:(0,s.jsx)(m.A,{})}),(0,s.jsx)("h4",{className:"self-center pl-4 text-sm font-medium",children:e.title})]},"".concat(l.orderNumber,"-no-variant"))})})]})})}function N(e){let{orders:r}=e,[l,t]=(0,u.useState)(null),i=e=>{t(e)},n=()=>{t(null)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"w-full col-span-2 py-8 lg:pl-8",children:(0,s.jsx)("ul",{className:"grid gap-6 lg:grid-cols-2 lg:gap-8",children:r.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(v,{order:e,openOrderModal:i})},null==e?void 0:e.id))})}),null==r?void 0:r.map(e=>(0,s.jsx)(b,{order:e,activeOrder:l,closeModal:n},null==e?void 0:e.id))]})}function y(){let{orders:e,loading:r}=function(){var e;let{customer:r}
1=(0,o.A)(),l=(0,n.useSession)(),s=null==l||null==(e=l.data)?void 0:e.shopifyAccessToken,t=(null==r?void 0:r.id)&&s?"/".concat(r.id,"/orders"):null,{data:i,isValidating:c,mutate:u}=(0,a.Ay)(t,x);async function x(){if((null==r?void 0:r.id)&&s){let[a,o]=await Promise.all([(0,d.i9)(s),(0,d.aP)(r.id)]);if(null==a?void 0:a.length){let r=[];for(let s of o){var e,l,t,i,n;if((null==(e=s.tags)?void 0:e.includes("bb_subscription_box"))===!1&&(null==(l=s.tags)?void 0:l.includes("Ordergroove Subscription Order"))===!1&&(null==(t=s.tags)?void 0:t.includes("Ordergroove Trigger Order"))===!1&&(null==(i=s.tags)?void 0:i.includes("Subscription First Order"))===!1&&(null==(n=s.tags)?void 0:n.includes("Subscription"))===!1){let e={...a.find(e=>e.id.includes(s.id)),...s};r.push(e)}}return r.sort((e,r)=>{let l=new Date(e.processedAt).getTime(),s=new Date(r.processedAt).getTime();return l<s?1:l>s?-1:0})}}return null}return{orders:i,loading:c||void 0===i,revalidate:u}}();return r?(0,s.jsxs)("div",{className:"flex flex-col justify-center mx-auto lg:col-span-2",children:[(0,s.jsx)("div",{className:"flex justify-center mb-5",children:(0,s.jsx)(c.A,{})}),(0,s.jsx)("p",{className:"text-center",children:"es-es"===i.vV?"Cargando pedidos de tienda":"Loading Shop Orders"})]}):e?(0,s.jsx)(N,{orders:e}):(0,s.jsx)("span",{className:"p-8",children:t.Ww.L})}y.Layout=l(18813).A},81560:(e,r,l)=>{"use strict";l.d(r,{A:()=>i});var s=l(37876),t=l(78799);function i(e){let{classes:r=""}=e;return(0,s.jsx)("div",{className:"spinner ".concat(r),children:(0,s.jsxs)("span",{className:"sr-only",children:["es-es"===t.vV?"Cargando. Espere por favor":"Loading. Please wait","…"]})})}}},e=>{e.O(0,[137,636,6593,8792],()=>e(e.s=47808)),_N_E=e.O()}]);
2//# sourceMappingURL=shop-orders-8cacbc5ffe211415.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.