!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s=Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="fd3a79ee-4d3e-454a-9b83-47b6618e3464",e._sentryDebugIdIdentifier="sentry-dbid-fd3a79ee-4d3e-454a-9b83-47b6618e3464")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7811],{98054:function(e,s,t){Promise.resolve().then(t.bind(t,48946))},48946:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return D}});var r=t(27573),n=t(79851),a=t(46575),d=t(67754),i=t(7653),l=t(23442),c=t(41289),o=t.n(c),m=t(44552),u=t.n(m),x=t(93749),h=t.n(x),g=t(79965),p=t.n(g),v=t(65880),f=t(44562);/**
 * @license lucide-react v0.373.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let y=(0,t(93386).Z)("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);var N=t(66424),j=t(59348),b=t(72153),E=t(4302),w=t(87659),_=t(34304);let P=[[f.i.ORDER_PLACED],[f.i.CONFIRMED],[f.i.DELIVERED],[f.i.COMPLETED]];function A(){var e,s,t,c,m,x,g,A,D,k,C,S;let I=(0,d.useSearchParams)(),Z=I.get("payment_intent"),R=I.get("payment_intent_client_secret"),M=I.get("redirect_status"),{fetchCart:T}=(0,_.Z)(),{data:L,mutate:O}=(0,a.ZP)(["/customers/orders/check-by-payment-intent",{method:"POST",data:{paymentIntent:Z,paymentIntentSecret:R,redirectStatus:M}}],l.T2,{onSuccess:()=>{T()}}),{trigger:F}=(0,E.Z)("/customers/orders/:orderNumber/status",l.ZE,{onSuccess:()=>{O()}}),U=(0,i.useMemo)(()=>u()(null==L?void 0:L.data,e=>(null==e?void 0:e.parent)===null),[L]),Y=(0,i.useMemo)(()=>o()(null==L?void 0:L.data,e=>!!(null==e?void 0:e.parent)),[L]);return(0,r.jsx)("div",{className:"bg-white",children:(0,r.jsxs)("div",{className:"mx-auto max-w-2xl pt-16 sm:px-6 sm:py-24 lg:max-w-7xl lg:px-8",children:[(0,r.jsxs)("div",{className:"space-y-2 px-4 sm:flex sm:items-baseline sm:justify-between sm:space-y-0 sm:px-0",children:[(0,r.jsx)("div",{className:"flex sm:items-baseline sm:space-x-4",children:(0,r.jsxs)("h1",{className:"text-2xl font-bold tracking-tight text-gray-900 sm:text-3xl",children:["Order #",null==U?void 0:U.orderNumber]})}),(0,r.jsxs)("p",{className:"text-sm text-gray-600",children:[p()(null==U?void 0:U.status)," ",(0,r.jsx)("time",{className:"font-medium text-gray-900",dateTime:"2021-03-22",children:new Date(null==U?void 0:U.updatedAt).toLocaleString()})]}),(0,r.jsxs)("div",{className:"text-sm font-medium text-orange-600 hover:text-orange-500 sm:hidden",children:["View invoice",(0,r.jsx)("span",{"aria-hidden":"true",children:" →"})]})]}),(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("h2",{className:"sr-only",children:"Products purchased"}),(0,r.jsx)("div",{className:"space-y-8",children:(Y||[]).map(e=>{var s,t,a,d,i;let l=P.findIndex(s=>s.includes(e.status));return(0,r.jsxs)("div",{className:"border-b border-t border-gray-200 bg-white shadow-sm sm:rounded-lg sm:border",children:[(0,r.jsxs)("div",{className:"m-0",children:[(0,r.jsx)("h2",{className:"sr-only",children:"Recent orders"}),(0,r.jsx)("div",{className:"space-y-20",children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"sr-only",children:["Order placed on ",(0,r.jsx)("time",{dateTime:e.createdAt,children:e.createdAt})]}),(0,r.jsxs)("div",{className:"rounded-lg bg-gray-50 px-4 py-6 sm:flex sm:items-center sm:justify-between sm:space-x-6 sm:px-6 lg:space-x-8",children:[(0,r.jsxs)("dl",{className:"flex-auto space-y-6 divide-y divide-gray-200 text-sm text-gray-600 sm:grid sm:grid-cols-3 sm:gap-x-6 sm:space-y-0 sm:divide-y-0 lg:w-4/5 lg:flex-none lg:gap-x-8",children:[(0,r.jsxs)("div",{className:"flex justify-between sm:block",children:[(0,r.jsx)("dt",{className:"font-medium text-gray-900",children:"Supplier"}),(0,r.jsxs)("dd",{className:"sm:mt-1",children:[(0,r.jsx)("div",{children:null==e?void 0:null===(s=e.supplier)||void 0===s?void 0:s.name}),(0,r.jsxs)("div",{children:[null==e?void 0:null===(a=e.supplier)||void 0===a?void 0:null===(t=a.address)||void 0===t?void 0:t.suburb," ",null==e?void 0:null===(i=e.supplier)||void 0===i?void 0:null===(d=i.address)||void 0===d?void 0:d.postalCode]})]})]}),(0,r.jsxs)("div",{className:"flex justify-between pt-6 sm:block sm:pt-0",children:[(0,r.jsx)("dt",{className:"font-medium text-gray-900",children:"Order number"}),(0,r.jsxs)("dd",{className:"sm:mt-1",children:["#",e.orderNumber]})]}),(0,r.jsxs)("div",{className:"flex justify-between pt-6 font-medium text-gray-900 sm:block sm:pt-0",children:[(0,r.jsx)("dt",{children:"Total amount"}),(0,r.jsx)("dd",{className:"sm:mt-1",children:(0,n.x)(e.totalAmount)})]})]}),(0,r.jsx)("div",{className:"flex items-center justify-center py-5 sm:py-0",children:e.status===f.i.COMPLETED&&(0,r.jsxs)(b.z,{variant:"outline",children:[(0,r.jsx)(y,{className:"w-4 h-4 mr-2"}),"View Invoice"]})})]}),(0,r.jsx)("div",{className:"px-8",children:(0,r.jsxs)("table",{className:"w-full text-gray-500 sm:mt-6",children:[(0,r.jsx)("caption",{className:"sr-only",children:"Products"}),(0,r.jsx)("thead",{className:"sr-only text-left text-sm text-gray-500 sm:not-sr-only",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"py-3 pr-8 font-normal sm:w-3/5 lg:w-1/3",scope:"col",children:"Product"}),(0,r.jsx)("th",{className:"hidden w-1/5 py-3 pr-8 font-normal sm:table-cell",scope:"col",children:"Price"}),(0,r.jsx)("th",{className:"hidden py-3 pr-8 font-normal sm:table-cell",scope:"col",children:"Quantity"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-gray-200  border-gray-200 text-sm sm:border-t",children:e.items.map(e=>{var s;return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"py-6 pr-8",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(v.default,{alt:(null==e?void 0:e.product).name,className:"mr-6 h-16 w-16 rounded object-cover object-center",height:64,src:h()(null==e?void 0:e.product,"images.[0].url",j.Z),width:64}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium text-gray-900",children:(null==e?void 0:e.product).name}),(0,r.jsx)("div",{className:"mt-1 sm:hidden",children:(0,n.x)(e.price)})]})]})}),(0,r.jsx)("td",{className:"hidden py-6 pr-8 sm:table-cell",children:(0,n.x)(e.price)}),(0,r.jsx)("td",{className:"hidden py-6 pr-8 sm:table-cell",children:e.quantity}),(0,r.jsx)("td",{className:"whitespace-nowrap py-6 text-right font-medium",children:(0,r.jsxs)(w.default,{href:"/products/".concat((null==e?void 0:e.product).slug),className:"text-orange-600",children:["View",(0,r.jsx)("span",{className:"hidden lg:inline",children:" Product"}),(0,r.jsxs)("span",{className:"sr-only",children:[", ",(null==e?void 0:e.product).name]})]})})]},null==e?void 0:null===(s=e.product)||void 0===s?void 0:s._id)})})]})})]},e.orderNumber)})]}),(0,r.jsxs)("div",{className:"border-t border-gray-200 px-4 py-6 sm:px-6 lg:p-8",children:[(0,r.jsx)("h4",{className:"sr-only",children:"Status"}),(0,r.jsxs)("p",{className:"text-sm font-medium text-gray-900",children:[p()(e.status)," on ",(0,r.jsx)("time",{dateTime:e.createdAt,children:new Date(e.updatedAt).toLocaleString()})]}),(0,r.jsxs)("div",{"aria-hidden":"true",className:"mt-6",children:[(0,r.jsx)("div",{className:"overflow-hidden rounded-full bg-gray-200",children:(0,r.jsx)("div",{className:"h-2 rounded-full bg-orange-600",style:{width:"calc(".concat(l+.5," / 4 * 100%)")}})}),(0,r.jsxs)("div",{className:"mt-6 hidden grid-cols-5 text-sm font-medium text-gray-600 sm:grid",children:[(0,r.jsx)("div",{className:"text-orange-600",children:"Order Placed"}),(0,r.jsx)("div",{className:(0,n.cn)(l>1?"text-orange-600":"","text-center"),children:"Confirmed"}),(0,r.jsx)("div",{className:(0,n.cn)(l>2?"text-orange-600":"","text-center"),children:"Delivered"}),(0,r.jsx)("div",{className:(0,n.cn)(l>3?"text-orange-600":"","text-right"),children:"Completed"})]})]})]})]},e._id)})})]}),(0,r.jsxs)("div",{className:"mt-8 rounded-md border border-gray-200 shadow-md",children:[(0,r.jsx)("h2",{className:"sr-only",children:"Billing Summary"}),(0,r.jsxs)("div",{className:"bg-gray-100 px-4 py-6 sm:rounded-lg sm:px-6 lg:grid lg:grid-cols-12 lg:gap-x-8 lg:px-8 lg:py-8",children:[(0,r.jsxs)("dl",{className:"grid grid-cols-2 gap-6 text-sm sm:grid-cols-2 md:gap-x-8 lg:col-span-7",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("dt",{className:"font-medium text-gray-900",children:"Billing address"}),(0,r.jsxs)("dd",{className:"mt-3 text-gray-500",children:[(0,r.jsx)("span",{className:"block",children:null==U?void 0:null===(e=U.recipient)||void 0===e?void 0:e.name}),(0,r.jsx)("span",{className:"block",children:null==U?void 0:null===(s=U.recipient)||void 0===s?void 0:s.phone}),(0,r.jsx)("span",{className:"block",children:null==U?void 0:null===(c=U.recipient)||void 0===c?void 0:null===(t=c.address)||void 0===t?void 0:t.formattedAddress})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("dt",{className:"font-medium text-gray-900",children:"Payment information"}),(0,r.jsxs)("dd",{className:"-ml-4 -mt-1 flex flex-wrap",children:[(0,r.jsxs)("div",{className:"ml-4 mt-4 flex-shrink-0",children:[(0,r.jsx)(N.Z,{className:"h-6 w-auto text-gray-800"}),(0,r.jsx)("p",{className:"sr-only",children:null==U?void 0:null===(x=U.stripe)||void 0===x?void 0:null===(m=x.card)||void 0===m?void 0:m.brand})]}),(0,r.jsxs)("div",{className:"ml-4 mt-4",children:[(0,r.jsxs)("p",{className:"text-gray-900",children:["Ending with ",null==U?void 0:null===(A=U.stripe)||void 0===A?void 0:null===(g=A.card)||void 0===g?void 0:g.last4]}),(0,r.jsxs)("p",{className:"text-gray-600",children:["Expires ",null==U?void 0:null===(k=U.stripe)||void 0===k?void 0:null===(D=k.card)||void 0===D?void 0:D.expiryMonth," / ",null==U?void 0:null===(S=U.stripe)||void 0===S?void 0:null===(C=S.card)||void 0===C?void 0:C.expiryYear]})]})]})]})]}),(0,r.jsxs)("dl",{className:"mt-8 divide-y divide-gray-200 text-sm lg:col-span-5 lg:mt-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between pb-4",children:[(0,r.jsx)("dt",{className:"text-gray-600",children:"Subtotal"}),(0,r.jsx)("dd",{className:"font-medium text-gray-900",children:(0,n.x)((null==U?void 0:U.subTotal)||0)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,r.jsx)("dt",{className:"text-gray-600",children:"Delivery Fee"}),(0,r.jsx)("dd",{className:"font-medium text-gray-900",children:(0,n.x)((null==U?void 0:U.deliveryFee)||0)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,r.jsx)("dt",{className:"text-gray-600",children:"Service Fee"}),(0,r.jsx)("dd",{className:"font-medium text-gray-900",children:(0,n.x)((null==U?void 0:U.serviceFee)||0)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between pt-4",children:[(0,r.jsx)("dt",{className:"font-medium text-gray-900",children:"Total"}),(0,r.jsx)("dd",{className:"font-medium text-orange-600",children:(0,n.x)((null==U?void 0:U.totalAmount)||0)})]})]})]})]})]})})}function D(){return(0,r.jsx)(i.Suspense,{children:(0,r.jsx)(A,{})})}},59348:function(e,s,t){"use strict";t.d(s,{Z:function(){return r}});let r="/assets/images/logo/logo.png"},93386:function(e,s,t){"use strict";t.d(s,{Z:function(){return d}});var r=t(7653),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.373.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d=(e,s)=>{let t=(0,r.forwardRef)((t,d)=>{let{color:i="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:m="",children:u,...x}=t;return(0,r.createElement)("svg",{ref:d,...n,width:l,height:l,stroke:i,strokeWidth:o?24*Number(c)/Number(l):c,className:["lucide","lucide-".concat(a(e)),m].join(" "),...x},[...s.map(e=>{let[s,t]=e;return(0,r.createElement)(s,t)}),...Array.isArray(u)?u:[u]])});return t.displayName="".concat(e),t}},67754:function(e,s,t){"use strict";var r=t(534);t.o(r,"useParams")&&t.d(s,{useParams:function(){return r.useParams}}),t.o(r,"usePathname")&&t.d(s,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")&&t.d(s,{useRouter:function(){return r.useRouter}}),t.o(r,"useSearchParams")&&t.d(s,{useSearchParams:function(){return r.useSearchParams}})},23442:function(e,s,t){"use strict";t.d(s,{T2:function(){return d},UT:function(){return i},Xs:function(){return c},ZE:function(){return l},_i:function(){return a}});let r=t(91885).Z.create({baseURL:"https://api.agoramarketplace.com.au"}),n=(e,s)=>(s&&Object.keys(s).forEach(t=>{e=e.replace(":".concat(t),s[t])}),e),a=(e,s)=>r.get(e,s).then(e=>{if(!e.data)throw Error(e.data.message);return e.data}),d=e=>{console.log("commonFetcher",e);let[s,t]=e;return!1!==s&&r({url:s,...t}).then(e=>{if(!e.data)throw Error(e.data.message);return e.data})},i=(e,s)=>{let{arg:{body:t,params:a}}=s;return console.log("postFetcher",e,t,a),r.post(n(e,a),t).then(e=>{if(!e.data)throw Error(e.data.message);return e.data}).catch(e=>{throw Error(e.response.data.message)})},l=(e,s)=>{let{arg:{body:t,params:a}}=s;return r.put(n(e,a),t).then(e=>{if(!e.data)throw Error(e.data.message);return e.data}).catch(e=>{throw Error(e.response.data.message)})},c=(e,s)=>{let{arg:{params:t}}=s;return r.delete(n(e,t)).then(e=>{if(!e.data)throw Error(e.data.message);return e.data}).catch(e=>{throw Error(e.response.data.message)})};s.ZP=r},34304:function(e,s,t){"use strict";t.d(s,{Z:function(){return l}});var r=t(4302),n=t(46575),a=t(81086),d=t(63827),i=t(23442);function l(){let e=(0,a.Dv)(d.JA),s=(0,a.Dv)(d.tA),{trigger:t,isMutating:l}=(0,r.Z)("/customers/carts/:cartId/removeItem",i.ZE),{trigger:c,isMutating:o}=(0,r.Z)("/customers/carts/:cartId",i.ZE),{trigger:m,isMutating:u}=(0,r.Z)("/customers/carts",i.UT),{trigger:x,isMutating:h}=(0,r.Z)("/customers/carts/:cartId/validate",i.ZE),{data:g,mutate:p,isLoading:v}=(0,n.ZP)(()=>!!s&&((null==e?void 0:e._id)?"/customers/carts?teamId=".concat(null==e?void 0:e._id):"/customers/carts"));return{removeItem:t,isMutatingRemoveItem:l,updateCart:c,isMutatingUpdateCart:o,cartData:g,isMutatingGetCart:v,fetchCart:p,createCart:m,isMutatingCreateCart:u,validCart:x,isMutatingValidCart:h}}},63827:function(e,s,t){"use strict";t.d(s,{JA:function(){return l},cU:function(){return c},tA:function(){return i}});var r=t(5565),n=t(8449),a=t(7220);let d=(0,n.FL)(()=>({getItem:e=>a.Z.get(e),setItem:(e,s)=>a.Z.set(e,s,{domain:"localhost"===window.location.hostname?"localhost":".agoramarketplace.com.au",path:"/",expires:30}),removeItem:e=>a.Z.remove(e)})),i=(0,n.O4)("access_token",null,d),l=(0,n.O4)("team",null),c=(0,r.cn)(null);(0,r.cn)([]),(0,n.O4)("supplier",null)},44562:function(e,s,t){"use strict";var r,n;t.d(s,{i:function(){return r}}),(n=r||(r={})).CHARGE_PENDING="charge_pending",n.CHARGE_SUCCESS="charge_success",n.CHARGE_FAILED="charge_failed",n.PAYMENT_PENDING="payment_pending",n.PAYMENT_SUCCESS="payment_success",n.PAYMENT_FAILED="payment_failed",n.PAYMENT_CANCELLED="payment_cancelled",n.PAYMENT_REFUNDED="payment_refunded",n.PAYMENT_REFUND_FAILED="payment_refund_failed",n.PAYMENT_REFUND_SUCCESS="payment_refund_success",n.PROCESSING="processing",n.ORDER_PLACED="order_placed",n.CONFIRMED="confirmed",n.DELIVERED="delivered",n.REQUEST_PAYMENT="request_payment",n.PAYMENT_RELEASED="payment_released",n.CANCELLED="cancelled",n.COMPLETED="completed"},72153:function(e,s,t){"use strict";t.d(s,{d:function(){return l},z:function(){return c}});var r=t(27573),n=t(7653),a=t(92721),d=t(70047),i=t(79851);let l=(0,d.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),c=n.forwardRef((e,s)=>{let{className:t,variant:n,size:d,asChild:c=!1,...o}=e,m=c?a.g7:"button";return(0,r.jsx)(m,{className:(0,i.cn)(l({variant:n,size:d,className:t})),ref:s,...o})});c.displayName="Button"},79851:function(e,s,t){"use strict";t.d(s,{K:function(){return m},cn:function(){return c},x:function(){return o}});var r=t(57908),n=t(66290),a=t(79965),d=t.n(a),i=t(60898),l=t.n(i);function c(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return(0,n.m6)((0,r.W)(s))}function o(e){return new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e||0)}function m(e){return d()(l()(e))}}},function(e){e.O(0,[587,5469,7693,6575,5658,1885,4542,259,4302,7894,5898,1293,895,1744],function(){return e(e.s=98054)}),_N_E=e.O()}]);