import{h as f,r as p,u as g,v as y,w as h,x as A,z as C}from"https://cdn.shopify.com/oxygen-v2/26990/12114/24902/1271030/build/_shared/chunk-WBUZYK2C.js";import{a as n}from"https://cdn.shopify.com/oxygen-v2/26990/12114/24902/1271030/build/_shared/chunk-ETAMIKPL.js";import{h as l}from"https://cdn.shopify.com/oxygen-v2/26990/12114/24902/1271030/build/_shared/chunk-A5X4ILTT.js";import{f as i,j as a,t as d,u}from"https://cdn.shopify.com/oxygen-v2/26990/12114/24902/1271030/build/_shared/chunk-ANEL4B2W.js";import{b as m}from"https://cdn.shopify.com/oxygen-v2/26990/12114/24902/1271030/build/_shared/chunk-UJLG5X7C.js";import{d as c}from"https://cdn.shopify.com/oxygen-v2/26990/12114/24902/1271030/build/_shared/chunk-CFWRSLVV.js";var e=c(m());function x(){let t=u(),r=i(),o=d().some(s=>s?.handle?.renderInModal);return t.isAuthenticated?r?o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(C,{cancelLink:"/account",size:"w-2/3 lg:w-1/3",children:(0,e.jsx)(a,{context:{customer:t.customer}})}),(0,e.jsx)(w,{...t})]}):(0,e.jsx)(a,{context:{customer:t.customer}}):(0,e.jsx)(w,{...t}):(0,e.jsx)(a,{})}function w({customer:t,heading:r,featuredData:N}){let o=n(t.orders),s=n(t.addresses);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(A,{heading:r}),o&&(0,e.jsx)(O,{orders:o}),(0,e.jsx)(y,{customer:t}),(0,e.jsx)(h,{addresses:s,customer:t})]})}function O({orders:t}){return(0,e.jsx)("div",{className:"mt-6",children:(0,e.jsxs)("div",{className:"grid w-full gap-4 p-4 py-6 md:gap-8 md:p-8 lg:p-12",children:[(0,e.jsx)("h3",{className:"basis-full md:basis-auto mt-2 mb-2.5 font-serif text-4xl border-b-[3px] border-[#ec5a28] md:border-1",children:"Order History"}),t?.length?(0,e.jsx)(v,{orders:t}):(0,e.jsx)(T,{})]})})}function T(){return(0,e.jsxs)("div",{children:[(0,e.jsx)(f,{className:"mb-1",size:"fine",width:"narrow",as:"p",children:"You haven't placed any orders yet."}),(0,e.jsx)("div",{className:"w-48",children:(0,e.jsx)(p,{className:"w-full mt-2 text-sm",variant:"secondary",to:l("/"),children:"Start Shopping"})})]})}function v({orders:t}){return(0,e.jsx)("ul",{className:"grid grid-flow-row grid-cols-1 gap-2 gap-y-6 md:gap-4 lg:gap-6 false sm:grid-cols-3",children:t.map(r=>(0,e.jsx)(g,{order:r},r.id))})}export{x as a};