1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1824],{34293:function(e,r,a){"use strict";a.d(r,{Ad:function(){return f},P$:function(){return x}});var t=a(50029),n=a(87794),s=a.n(n),l=a(71927),c=a(87361),i=a(30381),o=a.n(i),u=a(67294),d=a(17937),h=a(31562),p=a(85893),x=[{accessorKey:"price",header:"Price",Cell:function(e){var r=e.cell;if(r.getValue())return(0,p.jsx)("div",{children:h.v.format(r.getValue())})}},{accessorKey:"purchaseDate",header:"Date",Cell:function(e){var r=e.cell;return(0,p.jsx)("div",{children:o()(r.getValue()).format("MMMM Do YYYY")})}},{accessorKey:"source",header:"Source",Cell:function(e){var r=e.cell;return(0,p.jsx)("div",{className:"capitalize",children:r.getValue()})}}],g=[{accessorKey:"purchase.price",header:"Price",Cell:function(e){var r=e.cell;return(0,p.jsx)("div",{children:h.v.format(r.getValue())})}},{accessorKey:"customer.id",header:"Customer ID",Cell:function(e){var r=e.cell,a=e.row;return(0,p.jsx)("div",{children:(0,p.jsx)("a",{href:"/backstage/fans/view/".concat(encodeURIComponent(a.original.customer.id)),children:r.getValue()})})}},{accessorKey:"purchase.purchaseDate",header:"Date",Cell:function(e){var r=e.cell;return(0,p.jsx)("div",{children:o()(r.getValue()).format("MMMM Do YYYY")})}},{accessorKey:"merchandise.name",header:"Name",Cell:function(e){var r=e.cell,a=e.row;return(0,p.jsx)("div",{children:(0,p.jsx)("a",{href:"/backstage/merchandise/view/".concat(a.original.merchandise.id),children:r.getValue()})})}},{accessorKey:"purchase.source",header:"Source",Cell:function(e){var r=e.cell;return(0,p.jsx)("div",{className:"capitalize",children:r.getValue()})}}],f=function(e){var r=e.itemSales,a=e.getPage,n=e.rowCount,i=(0,u.useState)(r),o=i[0],h=i[1],x=(0,u.useState)(!1),f=x[0],m=x[1],v=(0,u.useState)(!1),b=v[0],j=v[1],w=(0,u.useState)({pageIndex:0,pageSize:10}),S=w[0],y=w[1];return(0,u.useEffect)((function(){var e=function(){var e=(0,t.Z)(s().mark((function e(){var r,t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(!0),m(!1),r={page:S.pageIndex,pageSize:S.pageSize},e.prev=3,e.next=6,a(r);case 6:t=e.sent,h(t),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),m(!0);case 13:j(!1);case 14:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(){return e.apply(this,arguments)}}();e()}),[S.pageIndex,S.pageSize]),(0,p.jsx)(l.Z,{theme:d.H,children:(0,p.jsx)(c.ZP,{enableDensityToggle:!1,enableFullScreenToggle:!1,enableGlobalFilter:!1,enableGlobalFilterModes:!1,enableGlobalFilterRankedResults:!1,columns:g,data:o,onPaginationChange:y,state:{pagination:S,isLoading:b,showAlertBanner:f},rowCount:n,manualPagination:!0,muiToolbarAlertBannerProps:f?{color:"error",children:"Error loading data"}:void 0})})}},15895:function(e,r,a){"use strict";a.d(r,{F:function(){return d},I:function(){return h}});var t=a(50029),n=a(87794),s=a.n(n),l=a(71927),c=a(87361),i=a(17937),o=a(67294),u=a(85893),d=[{accessorKey:"name",header:"Name",Cell:function(e){var r=e.cell,a=e.row;return(0,u.jsx)("div",{children:(0,u.jsx)("a",{href:"/backstage/merchandise/view/".concat(encodeURIComponent(a.original.id)),children:r.getValue()})})}},{accessorKey:"source",header:"Source",Cell:function(e){var r=e.cell;return(0,u.jsx)("div",{className:"capitalize",children:r.getValue()})}}],h=function(e){var r=e.merchandise,a=e.getPage,n=e.rowCount,h=(0,o.useState)(r),p=h[0],x=h[1],g=(0,o.useState)(!1),f=g[0],m=g[1],v=(0,o.useState)(!1),b=v[0],j=v[1],w=(0,o.useState)({pageIndex:0,pageSize:10}),S=w[0],y=w[1];return(0,o.useEffect)((function(){var e=function(){var e=(0,t.Z)(s().mark((function e(){var r,t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(!0),m(!1),r={page:S.pageIndex,pageSize:S.pageSize},e.prev=3,e.next=6,a(r);case 6:t=e.sent,x(t),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),m(!0);case 13:j(!1);case 14:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(){return e.apply(this,arguments)}}();e()}),[S.pageIndex,S.pageSize]),(0,u.jsx)(l.Z,{theme:i.H,children:(0,u.jsx)(c.ZP,{enableDensityToggle:!1,enableFullScreenToggle:!1,enableGlobalFilter:!1,enableGlobalFilterModes:!1,enableGlobalFilterRankedResults:!1,columns:d,data:p,onPaginationChange:y,state:{pagination:S,isLoading:b,showAlertBanner:f},rowCount:n,manualPagination:!0,muiToolbarAlertBannerProps:f?{color:"error",children:"Error loading data"}:void 0})})}},30354:function(e,r,a){"use strict";a.r(r),a.d(r,{__N_SSP:function(){return g}});var t=a(50029),n=a(87794),s=a.n(n),l=a(9008),c=a.n(l),i=a(11163),o=a(4966),u=a(31562),d=a(34293),h=a(15895),p=a(73012),x=a(85893),g=!0;r.default=function(e){var r=e.averageSpend,a=e.totalSpend,n=e.purchases,l=e.merchandise,g=e.totalMerchandise,f=e.totalPurchases,m=e.context,v=(0,i.useRouter)();new Date;return(0,x.jsxs)(o.Z,{currentPath:v.pathname,title:"Sales",queryContext:m,children:[(0,x.jsx)(c(),{children:(0,x.jsx)("title",{children:"Merchandise | Offstage"})}),(0,x.jsxs)("div",{className:"flex flex-col mb-4",children:[(0,x.jsxs)("div",{className:"flex gap-y-4 bg-[#FCFCFC] border mt-8",children:[(0,x.jsx)("div",{className:"",children:(0,x.jsx)("div",{className:"flex-none py-6 px-3 first:pl-6 last:pr-6",children:(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[(0,x.jsxs)("a",{href:"/backstage/merchandise",className:"flex flex-none h-full items-center hover:cursor-pointer w-64 space-4 hover:bg-[#D589FF] bg-[#F5E3FF] text-gray-900 p-3 text-xs md:text-sm hover:border-black font-black text-lg md:text-xl",style:{filter:"drop-shadow(4px 4px 0px rgba(0, 0, 0, 0.25))"},children:[(0,x.jsx)("p",{className:"break-words grow",children:"Merchandise"}),(0,x.jsx)("p",{className:"text-lg w-6",children:"\ud83d\udc5c"})]}),(0,x.jsxs)("a",{href:"/backstage/events",className:"flex flex-none h-full items-center hover:cursor-pointer w-64 space-4 hover:bg-[#D589FF] bg-[#F5E3FF] text-gray-900 p-3 text-xs md:text-sm hover:border-black",children:[(0,x.jsx)("p",{className:"break-words grow",children:"Events"}),(0,x.jsx)("p",{className:"text-lg w-6",children:"\ud83d\udcc5"})]})]})})}),(0,x.jsx)("div",{})]}),(0,x.jsxs)("div",{className:"flex flex-row gap-x-4 pt-8",children:[(0,x.jsx)(u._,{name:"Average purchase price",value:(null===r||void 0===r?void 0:r.toFixed(2).toString())||"0.00",symbol:"\xa3"}),(0,x.jsx)(u._,{name:"Total sales",value:(null===a||void 0===a?void 0:a.toFixed(2).toString())||"0.00",symbol:"\xa3"})]}),(0,x.jsx)("h2",{className:"text-xl md:text-2xl font-bold text-purple-600 pt-8 pb-2",children:"Items"}),(0,x.jsx)("p",{className:"text-gray-500 font-light",children:"These are all the items you are selling across platforms."}),(0,x.jsx)("hr",{className:"mt-4"}),(0,x.jsx)(h.I,{merchandise:l,rowCount:g,getPage:function(){var e=(0,t.Z)(s().mark((function e(r){var a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.Ps)(r.page,r.pageSize,m.queryContext);case 2:return a=e.sent,e.abrupt("return",a.merchandise);case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()}),(0,x.jsx)("h2",{className:"text-xl md:text-2xl font-bold text-purple-600 pt-4 pb-2",children:"Sales"}),(0,x.jsx)("p",{className:"text-gray-500 font-light",children:"These are all the sales you've made."}),(0,x.jsx)("hr",{className:"mt-4"}),(0,x.jsx)(d.Ad,{itemSales:n,rowCount:f,getPage:function(){var e=(0,t.Z)(s().mark((function e(r){var a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.Yi)(r.page,r.pageSize,m.queryContext);case 2:return a=e.sent,e.abrupt("return",a.purchases);case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()})]})]})}},10202:function(e,r,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/backstage/merchandise",function(){return a(30354)}])}},function(e){e.O(0,[6556,4052,4885,5982,3965,8626,9130,5883,4966,9774,2888,179],(function(){return r=10202,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
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.