"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4743],{43630:function(t,e,i){var n=i(64836);e.Z=void 0;var a=n(i(64938)),o=i(85893);e.Z=(0,a.default)((0,o.jsx)("path",{d:"m16 18 2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"}),"TrendingDown")},43117:function(t,e,i){var n=i(64836);e.Z=void 0;var a=n(i(64938)),o=i(85893);e.Z=(0,a.default)((0,o.jsx)("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"}),"TrendingUp")},18979:function(t,e,i){i.d(e,{Z:function(){return j}});var n=i(63366),a=i(87462),o=i(67294),r=i(86010),l=i(70917),s=i(58510),d=i(88606),u=i(41796),h=i(90948),c=i(71657),g=i(1977),m=i(8027);function getSkeletonUtilityClass(t){return(0,m.ZP)("MuiSkeleton",t)}(0,g.Z)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);var v=i(85893);let f=["animation","className","component","height","style","variant","width"],_=t=>t,p,x,b,w,useUtilityClasses=t=>{let{classes:e,variant:i,animation:n,hasChildren:a,width:o,height:r}=t;return(0,s.Z)({root:["root",i,n,a&&"withChildren",a&&!o&&"fitContent",a&&!r&&"heightAuto"]},getSkeletonUtilityClass,e)},C=(0,l.F4)(p||(p=_`
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    opacity: 1;
  }
`)),Z=(0,l.F4)(x||(x=_`
  0% {
    transform: translateX(-100%);
  }

  50% {
    /* +0.5s of delay between each loop */
    transform: translateX(100%);
  }

  100% {
    transform: translateX(100%);
  }
`)),y=(0,h.ZP)("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(t,e)=>{let{ownerState:i}=t;return[e.root,e[i.variant],!1!==i.animation&&e[i.animation],i.hasChildren&&e.withChildren,i.hasChildren&&!i.width&&e.fitContent,i.hasChildren&&!i.height&&e.heightAuto]}})(({theme:t,ownerState:e})=>{let i=(0,d.Wy)(t.shape.borderRadius)||"px",n=(0,d.YL)(t.shape.borderRadius);return(0,a.Z)({display:"block",backgroundColor:t.vars?t.vars.palette.Skeleton.bg:(0,u.Fq)(t.palette.text.primary,"light"===t.palette.mode?.11:.13),height:"1.2em"},"text"===e.variant&&{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${i}/${Math.round(n/.6*10)/10}${i}`,"&:empty:before":{content:'"\\00a0"'}},"circular"===e.variant&&{borderRadius:"50%"},"rounded"===e.variant&&{borderRadius:(t.vars||t).shape.borderRadius},e.hasChildren&&{"& > *":{visibility:"hidden"}},e.hasChildren&&!e.width&&{maxWidth:"fit-content"},e.hasChildren&&!e.height&&{height:"auto"})},({ownerState:t})=>"pulse"===t.animation&&(0,l.iv)(b||(b=_`
      animation: ${0} 1.5s ease-in-out 0.5s infinite;
    `),C),({ownerState:t,theme:e})=>"wave"===t.animation&&(0,l.iv)(w||(w=_`
      position: relative;
      overflow: hidden;

      /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */
      -webkit-mask-image: -webkit-radial-gradient(white, black);

      &::after {
        animation: ${0} 1.6s linear 0.5s infinite;
        background: linear-gradient(
          90deg,
          transparent,
          ${0},
          transparent
        );
        content: '';
        position: absolute;
        transform: translateX(-100%); /* Avoid flash during server-side hydration */
        bottom: 0;
        left: 0;
        right: 0;
        top: 0;
      }
    `),Z,(e.vars||e).palette.action.hover)),S=o.forwardRef(function(t,e){let i=(0,c.Z)({props:t,name:"MuiSkeleton"}),{animation:o="pulse",className:l,component:s="span",height:d,style:u,variant:h="text",width:g}=i,m=(0,n.Z)(i,f),p=(0,a.Z)({},i,{animation:o,component:s,variant:h,hasChildren:!!m.children}),x=useUtilityClasses(p);return(0,v.jsx)(y,(0,a.Z)({as:s,ref:e,className:(0,r.Z)(x.root,l),ownerState:p},m,{style:(0,a.Z)({width:g,height:d},u)}))});var j=S},94743:function(t,e,i){i.r(e);var n=i(85893),a=i(99226),o=i(66242),r=i(15861),l=i(86886),s=i(43117),d=i(43630),u=i(9473),h=i(18979),c=i(34386);e.default=t=>{var e,i,g,m,v,f,p,x;let{salesData:b,loading:w}=t,C=(0,u.v9)(t=>{var e;return null===(e=t.userProfile)||void 0===e?void 0:e.userProfile});if(!b)return null;let Z=C?C.userType:null,y=[{title:"Today's Sales",amount:null!==(e=b.todaySalesFormatted)&&void 0!==e?e:0,toolTip:null==b?void 0:b.todaySales,change:null!==(i=null==b?void 0:b.salesChangePercentage)&&void 0!==i?i:0,icon:null},{title:"Total Sales",amount:null!==(g=b.totalSalesFormatted)&&void 0!==g?g:0,toolTip:null==b?void 0:b.totalSales,change:null!==(m=null==b?void 0:b.monthlySalesChangePercentage)&&void 0!==m?m:0,icon:null},{title:"Total Orders",amount:null!==(v=b.totalOrders)&&void 0!==v?v:0,change:null!==(f=null==b?void 0:b.orderChangePercentage)&&void 0!==f?f:0,icon:"/images/misc/orders.png"},{title:"Total Customers",amount:null!==(p=b.uniqueCustomerCount)&&void 0!==p?p:0,change:null!==(x=null==b?void 0:b.userChangePercentage)&&void 0!==x?x:0,icon:"/images/misc/customers.png"}];return(0,n.jsx)(a.Z,{children:(0,n.jsx)(l.ZP,{container:!0,spacing:3,children:y.map((t,e)=>{var i,u,g,m,v,f;return(0,n.jsx)(l.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,n.jsxs)(o.Z,{sx:{p:3,borderRadius:"12px",boxShadow:"0 6px 20px rgba(0, 0, 0, 0.1)",display:"flex",flexDirection:"column",justifyContent:"space-between",position:"relative",backgroundColor:"#fff",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.03)",boxShadow:"0 8px 30px rgba(0, 0, 0, 0.15)"}},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:2},children:[(0,n.jsx)(r.Z,{variant:"body2",sx:{fontWeight:"bold",color:"#003366",fontSize:"0.875rem"},children:b&&!w?t.title:(0,n.jsx)(h.Z,{width:100,height:20,animation:"wave",sx:{bgcolor:"#f0f0f0"}})}),(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:.5,backgroundColor:(null===(u=t.change)||void 0===u?void 0:null===(i=u.toString())||void 0===i?void 0:i.startsWith("-"))?"#ffe6e6":"#e6ffe6",borderRadius:"12px",px:1,py:.5},children:[(null===(m=t.change)||void 0===m?void 0:null===(g=m.toString())||void 0===g?void 0:g.startsWith("-"))?(0,n.jsx)(d.Z,{fontSize:"small",sx:{color:"#e53935"}}):(0,n.jsx)(s.Z,{fontSize:"small",sx:{color:"#43a047"}}),(0,n.jsx)(r.Z,{variant:"caption",sx:{color:(null===(f=t.change)||void 0===f?void 0:null===(v=f.toString())||void 0===v?void 0:v.startsWith("-"))?"#e53935":"#43a047",fontWeight:"bold"},children:b&&!w?void 0!==t.change?"".concat(new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t.change),"%"):"N/A":(0,n.jsx)(h.Z,{width:100,height:20,animation:"wave",sx:{bgcolor:"#f0f0f0"}})})]})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[b&&!w?t.icon&&(0,n.jsx)("img",{src:t.icon,alt:"".concat(t.title," icon"),style:{width:25,height:25,borderRadius:"50%",backgroundColor:"Manufacturer"===Z?"#003366":"#E63E3A",padding:"4px"}}):(0,n.jsx)(h.Z,{width:100,height:20,animation:"wave",sx:{bgcolor:"#f0f0f0"}}),(0,n.jsx)(r.Z,{variant:"h5",sx:{fontWeight:"bold",color:"#003366"},children:b&&!w?"Total Orders"===t.title||"Total Customers"===t.title?t.amount:(0,n.jsx)(c.Z,{title:t.toolTip,children:(0,n.jsx)("span",{children:t.amount?t.amount:"-"})}):(0,n.jsx)(h.Z,{width:100,height:20,animation:"wave",sx:{bgcolor:"#f0f0f0"}})})]})]})},e)})})})}}}]);