PageSourceSearch

https://sendunlimitedemail.com/sue/mod-BVO00xaY.js

js sendunlimitedemail.com collected 2026-10-05 06:26:19 UTC 5,431 bytes, 1 lines download raw bytes

1import{r as a,e as y,j as e,B as c,o as P,C as A,t as E}from"./edge-BOITG1XR.js";import{C as b,c as v,a as I,b as R}from"./mod-DgQ0OFXm.js";import{I as z}from"./mod-BUsEZZHX.js";import{K}from"./mod-BBgDTOoh.js";import{R as C}from"./mod-RPxq32x0.js";import{S as T}from"./mod-CKg_ZYcm.js";import{C as B}from"./mod-Dzi2dmtd.js";import{C as M}from"./mod-BelLWb3f.js";import{C as $}from"./mod-qF7UVkYF.js";const Q=()=>{const[u,d]=a.useState([]),[i,j]=a.useState(!0),[o,w]=a.useState(""),[n,m]=a.useState(1),[l,f]=a.useState(0),[_,g]=a.useState(null),N=25,x=a.useCallback(async()=>{j(!0);try{const s=await y.get("/admin/license-entitlements",{params:{search:o,page:n,per_page:N}});d(s.data?.data||s.data||[]),f(s.data?.total||0)}catch{try{const s=await y.get("/admin/orders",{params:{per_page:100}}),t=s.data?.data||s.data||[],h=[];t.forEach(r=>{r.license_entitlements&&r.license_entitlements.forEach(S=>{h.push({...S,order_id:r.id,customer_name:r.user?.name||r.shipping_address?.name||"N/A",customer_email:r.user?.email||"N/A"})})}),d(h),f(h.length)}catch{d([])}}finally{j(!1)}},[o,n]);a.useEffect(()=>{x()},[x]);const k=(s,t)=>{navigator.clipboard.writeText(t),g(s),E.success("License key copied"),setTimeout(()=>g(null),2e3)},L=s=>{const t={active:"bg-emerald-100 text-emerald-700",expired:"bg-red-100 text-red-700",revoked:"bg-gray-100 text-gray-600",pending:"bg-amber-100 text-amber-700"};return e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-semibold ${t[s]||t.pending}`,children:s||"pending"})},p=Math.ceil(l/N);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(K,{className:"w-6 h-6 text-violet-600"})," License Manager"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage all issued license keys across orders."})]}),e.jsxs(c,{variant:"outline",size:"sm",onClick:x,disabled:i,children:[e.jsx(C,{className:`w-4 h-4 mr-1 ${i?"animate-spin":""}`})," Refresh"]})]}),e.jsx(b,{children:e.jsx(v,{className:"pt-4",children:e.jsx("div",{className:"flex gap-3",children:e.jsxs("div",{className:"relative flex-1",children:[e.jsx(T,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(z,{placeholder:"Search by license key, product, or customer email...",value:o,onChange:s=>{w(s.target.value),m(1)},className:"pl-9"})]})})})}),e.jsxs(b,{children:[e.jsx(I,{className:"pb-2",children:e.jsxs(R,{className:"text-base",children:[l," License",l!==1?"s":""," Found"]})}),e.jsxs(v,{children:[i?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(C,{className:"w-6 h-6 animate-spin text-violet-500"})}):u.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(B,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No license entitlements found."}),e.jsx("p",{className:"text-xs mt-1",children:"Licenses are created when a digital order is paid."})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-left text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:[e.jsx("th",{className:"py-2 pr-3",children:"License Key"}),e.jsx("th",{className:"py-2 pr-3",children:"Product"}),e.jsx("th",{className:"py-2 pr-3",children:"Customer"}),e.jsx("th",{className:"py-2 pr-3",children:"Order"}),e.jsx("th",{className:"py-2 pr-3",children:"Status"}),e.jsx("th",{className:"py-2 pr-3",children:"Issued"}),e.jsx("th",{className:"py-2",children:"Actions"})]})}),e.jsx("tbody",{children:u.map((s,t)=>e.jsxs("tr",{className:"border-b last:border-0 hover:bg-gray-50",children:[e.jsx("td",{className:"py-2.5 pr-3",children:e.jsx("code",{className:"text-xs bg-slate-100 px-2 py-1 rounded font-mono",children:s.license_key?`${s.license_key.slice(0,20)}...`:"N/A"})}),e.jsx("td",{className:"py-2.5 pr-3 font-medium",children:s.product_slug||s.product?.name||"Unknown"}),e.jsxs("td",{className:"py-2.5 pr-3",children:[e.jsx("div",{className:"text-xs",children:s.customer_name||s.user?.name||"—"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.customer_email||s.user?.email||""})]}),e.jsxs("td",{className:"py-2.5 pr-3 text-xs text-muted-foreground",children:["#",s.order_id]}),e.jsx("td",{className:"py-2.5 pr-3",children:L(s.status)}),e.jsx("td",{className:"py-2.5 pr-3 text-xs text-muted-foreground",children:s.created_at?new Date(s.created_at).toLocaleDateString():"—"}),e.jsx("td",{className:"py-2.5",children:e.jsx(c,{variant:"ghost",size:"sm",onClick:()=>k(s.id||t,s.license_key),disabled:!s.license_key,children:_===(s.id||t)?e.jsx(P,{className:"w-3.5 h-3.5 text-emerald-600"}):e.jsx(M,{className:"w-3.5 h-3.5"})})})]},s.id||t))})]})}),p>1&&e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-3 border-t",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Page ",n," of ",p," (",l," total)"]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(c,{variant:"outline",size:"sm",disabled:n<=1,onClick:()=>m(s=>s-1),children:e.jsx($,{className:"w-4 h-4"})}),e.jsx(c,{variant:"outline",size:"sm",disabled:n>=p,onClick:()=>m(s=>s+1),children:e.jsx(A,{className:"w-4 h-4"})})]})]})]})]})]})};export{Q 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.