PageSourceSearch

https://www.jewelryinsider.ai/assets/dashboard-lQ39jBZz.js

js jewelryinsider.ai collected 2026-10-05 12:40:50 UTC 8,135 bytes, 1 lines download raw bytes

1import{j as e,L as h}from"./lazyWithRetry-DFTD8Tw5.js";import{r}from"./recharts-DO5TFdhs.js";import{T as O}from"./TradeLayout-CDh2rxNn.js";import{S as C}from"./StatusBadge-iIKqU8d_.js";import{t as F,l as P,x as _}from"./use-pro-auth-zpXUMgKu.js";import{S as k}from"./shopping-cart-B2JMOjR4.js";import{T as R}from"./truck-CnMEJUGX.js";import{D as E}from"./dollar-sign-Nb5A0znk.js";import{A as I}from"./award-DNdRYzCS.js";import{A as M,L as q}from"./ring-agent-navigation-BtBzU6aw.js";import{P as S}from"./package-BezJYPLY.js";import{P as V}from"./jewelbuilder-BXDIZRaS.js";import{S as B}from"./send-CVGG88RG.js";import"./Helmet-D3GRV9gs.js";import"./settings-CAWYVemo.js";import"./log-out-o3bGEHSz.js";import"./clipboard-list-Dm62gHu6.js";import"./menu-DE7GfWI4.js";import"./search-CHvOJCVp.js";import"./chevron-down-C6bT3e7h.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./check-DaJfD8Y-.js";const Q={blue:{bg:"rgba(59, 130, 246, 0.12)",text:"#60A5FA"},green:{bg:"rgba(5, 150, 105, 0.10)",text:"#059669"},amber:{bg:"rgba(217, 119, 6, 0.10)",text:"#D97706"},purple:{bg:"rgba(79, 93, 117, 0.10)",text:"#4F5D75"},red:{bg:"rgba(220, 38, 38, 0.10)",text:"#DC2626"}};function g({icon:x,label:f,value:s,prefix:j="",suffix:a="",trend:o,trendLabel:m,color:c="blue"}){const[l,b]=r.useState(typeof s=="number"?0:s),[i,v]=r.useState(!1),d=r.useRef(null);r.useEffect(()=>{if(typeof s!="number"||i)return;const t=new IntersectionObserver(([n])=>{if(n.isIntersecting&&!i){v(!0);const u=800,D=performance.now(),N=s,w=A=>{const T=A-D,y=Math.min(T/u,1),L=1-Math.pow(1-y,3);b(Math.round(N*L)),y<1?requestAnimationFrame(w):b(N)};requestAnimationFrame(w)}},{threshold:.3});return d.current&&t.observe(d.current),()=>t.disconnect()},[s,i]);const p=Q[c];return e.jsxs("div",{ref:d,className:"b2b-stat-card b2b-animate-in",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center mb-1",style:{background:p.bg},children:e.jsx(x,{className:"w-[18px] h-[18px]",style:{color:p.text}})}),e.jsxs("div",{className:"b2b-stat-value b2b-animate-count",children:[j,typeof l=="number"?l.toLocaleString():l,a]}),e.jsx("div",{className:"b2b-stat-label",children:f}),o!==void 0&&e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsxs("span",{className:"text-[12px] font-semibold",style:{color:o>=0?"#059669":"#DC2626"},children:[o>=0?"↑":"↓"," ",Math.abs(o),"%"]}),m&&e.jsx("span",{className:"text-[11px] text-[var(--b2b-text-muted)]",children:m})]})]})}function xe(){F();const{isPro:x}=P(),{tradeFetch:f}=_(),[s,j]=r.useState([]),[a,o]=r.useState(!0);r.useEffect(()=>{(async()=>{try{const u=await(await f("/api/trade/orders")).json();u.success&&j(u.data||[])}catch{}finally{o(!1)}})()},[]);const m=s.length,c=s.filter(t=>t.status==="processing").length,l=s.filter(t=>t.status==="shipped").length,b=s.filter(t=>t.status!=="cancelled").reduce((t,n)=>t+(n.total||0),0),i=s.slice(0,5),v=t=>new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=x?"5–10%":"0%",p=x?"Pro Discount":"Discount";return e.jsxs(O,{title:"Dashboard",subtitle:"Welcome back. Here's an overview of your trade account.",seoDescription:"View your wholesale order statistics, recent orders, and trade account overview on Jewelry Insider.",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[e.jsx(g,{icon:k,label:"Total Orders",value:a?"…":m,trend:c>0?c:void 0,trendLabel:c>0?"processing":void 0,color:"blue"}),e.jsx(g,{icon:R,label:"In Transit",value:a?"…":l,color:"purple"}),e.jsx(g,{icon:E,label:"Total Spent",value:a?"…":b,prefix:"$",color:"amber"}),e.jsx(g,{icon:I,label:p,value:d,color:"green"})]}),e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"b2b-heading-sm text-[var(--b2b-text)]",children:"Recent Orders"}),e.jsx(h,{href:"/trade/orders",children:e.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium text-[var(--b2b-accent)] hover:text-[var(--b2b-accent-hover)] cursor-pointer transition-colors",children:["View All ",e.jsx(M,{className:"w-3.5 h-3.5"})]})})]}),a?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(q,{className:"w-6 h-6 text-[var(--b2b-accent)] animate-spin"})}):i.length===0?e.jsxs("div",{className:"b2b-card-static p-8 text-center",children:[e.jsx(S,{className:"w-8 h-8 text-[var(--b2b-text-muted)] mx-auto mb-2"}),e.jsx("p",{className:"text-[13px] text-[var(--b2b-text-muted)]",children:"No orders yet. Browse the catalog to get started."})]}):e.jsxs("div",{className:"b2b-card-static overflow-hidden",children:[e.jsx("div",{className:"hidden sm:grid grid-cols-[120px_1fr_80px_100px_120px] gap-2 px-4 py-2.5 bg-[var(--b2b-bg)] border-b border-[var(--b2b-border)]",children:["Order #","Date","Items","Total","Status"].map(t=>e.jsx("span",{className:"text-[11px] uppercase tracking-wider font-semibold text-[var(--b2b-text-muted)]",children:t},t))}),i.map((t,n)=>e.jsx(h,{href:"/trade/orders",children:e.jsxs("div",{className:"grid sm:grid-cols-[120px_1fr_80px_100px_120px] gap-2 px-4 py-3 hover:bg-[var(--b2b-bg-elevated)] curs
1or-pointer transition-colors border-b border-[var(--b2b-border)] last:border-b-0 b2b-animate-in",style:{animationDelay:`${n*50}ms`},children:[e.jsx("span",{className:"b2b-font-mono text-[13px] font-semibold text-[var(--b2b-text)]",children:t.id}),e.jsxs("span",{className:"text-[13px] text-[var(--b2b-text-secondary)]",children:[v(t.createdAt),t.poNumber&&e.jsxs("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded bg-[var(--b2b-bg-secondary)] text-[var(--b2b-text-muted)] border border-[var(--b2b-border)]",children:["PO: ",t.poNumber]})]}),e.jsx("span",{className:"text-[13px] text-[var(--b2b-text-secondary)] sm:text-center",children:t.items.length}),e.jsxs("span",{className:"b2b-font-mono text-[13px] font-medium text-[var(--b2b-text)]",children:["$",t.total.toLocaleString()]}),e.jsx(C,{status:t.status,size:"sm"})]})},t.id))]})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"b2b-heading-sm text-[var(--b2b-text)] mb-4",children:"Quick Actions"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsx(h,{href:"/trade/catalog",children:e.jsx("div",{className:"b2b-card p-5 cursor-pointer group",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-[rgba(59,130,246,0.12)] flex items-center justify-center group-hover:bg-[rgba(59,130,246,0.20)] transition-colors",children:e.jsx(S,{className:"w-5 h-5 text-[#60A5FA]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-medium text-[var(--b2b-text)]",children:"Browse Catalog"}),e.jsx("p",{className:"text-[12px] text-[var(--b2b-text-muted)]",children:"Explore wholesale products"})]})]})})}),e.jsx(h,{href:"/trade/quotes/new",children:e.jsx("div",{className:"b2b-card p-5 cursor-pointer group",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-[rgba(139,92,246,0.12)] flex items-center justify-center group-hover:bg-[rgba(139,92,246,0.20)] transition-colors",children:e.jsx(V,{className:"w-5 h-5 text-[#4F5D75]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-medium text-[var(--b2b-text)]",children:"New Quote Request"}),e.jsx("p",{className:"text-[12px] text-[var(--b2b-text-muted)]",children:"Submit an RFQ"})]})]})})}),e.jsx("a",{href:"mailto:[email protected]",className:"no-underline",children:e.jsx("div",{className:"b2b-card p-5 cursor-pointer group",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-[rgba(16,185,129,0.12)] flex items-center justify-center group-hover:bg-[rgba(16,185,129,0.20)] transition-colors",children:e.jsx(B,{className:"w-5 h-5 text-[#059669]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-medium text-[var(--b2b-text)]",children:"Contact Your Rep"}),e.jsx("p",{className:"text-[12px] text-[var(--b2b-text-muted)]",children:"Get help with orders"})]})]})})})]})]})]})}export{xe as default};

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.