medusajs-documents-plugin 1.1.25 → 1.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { defineRouteConfig } from "@medusajs/admin-sdk";
3
3
  import { Container, Heading, Text, Button, Input, Select, Tooltip, IconButton, Switch, Label, Table, Badge, DropdownMenu, Textarea, FocusModal } from "@medusajs/ui";
4
4
  import { useState, useEffect, useMemo, Fragment } from "react";
5
- import { DocumentText, Plus, Sparkles, ArrowPath, ChevronDown, ChevronRight, ArrowDownTray, Envelope, Trash } from "@medusajs/icons";
5
+ import { DocumentText, ArrowPath, Plus, Sparkles, ChevronDown, ChevronRight, ArrowDownTray, Envelope, Trash } from "@medusajs/icons";
6
6
  function extractBaseReference(displayId) {
7
7
  if (!displayId) return "";
8
8
  const cleaned = String(displayId).trim();
@@ -271,6 +271,32 @@ All hardware replacements and associated workshop labor are covered under our co
271
271
  { title: "Workshop Labor & Clean-Room Installation", description: "Certified technician installation & calibration", quantity: 1, unit_price: 45 }
272
272
  ]
273
273
  },
274
+ {
275
+ id: "trade_in",
276
+ name: "Device Trade-In Agreement",
277
+ icon: "🔄",
278
+ badge: "Trade-In & Transfer",
279
+ title: "Device Trade-In & Buyback Agreement",
280
+ subject: "Device Trade-In & Buyback Agreement - Urban Device Care",
281
+ body_text: `This agreement confirms the valuation, transfer of title, and trade-in credit for the listed customer hardware. Customer verifies legal ownership and consents to complete data sanitation and ownership transfer.`,
282
+ items: [
283
+ { title: "Trade-In Device Valuation & Credit", description: "Assessed Grade A condition allowance", quantity: 1, unit_price: 25e3 },
284
+ { title: "Data Sanitization & Ownership Transfer", description: "Certified NIST 800-88 cryptographic wipe", quantity: 1, unit_price: 0 }
285
+ ]
286
+ },
287
+ {
288
+ id: "destruction",
289
+ name: "Certificate of Destruction & Disposal",
290
+ icon: "♻️",
291
+ badge: "Eco & Compliance",
292
+ title: "Certificate of Destruction & Eco-Disposal",
293
+ subject: "Certificate of Hardware Destruction & Eco-Disposal",
294
+ body_text: `This certificate confirms that the decommissioned hardware listed below has been safely demanufactured, shredded, or recycled in full compliance with WEEE and environmental data destruction standards.`,
295
+ items: [
296
+ { title: "Hardware Demanufacturing & Shredding", description: "Certified environmental destruction", quantity: 1, unit_price: 0 },
297
+ { title: "Hazardous Materials Recycling", description: "Zero-landfill lithium battery reclamation", quantity: 1, unit_price: 0 }
298
+ ]
299
+ },
274
300
  {
275
301
  id: "blank",
276
302
  name: "Blank Custom Document",
@@ -289,10 +315,11 @@ const DocumentsPage = () => {
289
315
  const [documents, setDocuments] = useState([]);
290
316
  const [loading, setLoading] = useState(true);
291
317
  const [searchTerm, setSearchTerm] = useState("");
292
- const [typeFilter, setTypeFilter] = useState("invoice");
318
+ const [typeFilter, setTypeFilter] = useState("all");
293
319
  const [sourceFilter, setSourceFilter] = useState("all");
294
320
  const [zohoLiveDocs, setZohoLiveDocs] = useState([]);
295
321
  const [loadingZoho, setLoadingZoho] = useState(false);
322
+ const [isSyncingRepairs, setIsSyncingRepairs] = useState(false);
296
323
  const [groupByJob, setGroupByJob] = useState(true);
297
324
  const [expandedGroups, setExpandedGroups] = useState({});
298
325
  const toggleGroup = (groupId) => {
@@ -363,6 +390,7 @@ const DocumentsPage = () => {
363
390
  const [previewModalOpen, setPreviewModalOpen] = useState(false);
364
391
  const [previewStyle, setPreviewStyle] = useState("modern");
365
392
  const [previewType, setPreviewType] = useState("invoice");
393
+ const [previewPreset, setPreviewPreset] = useState(null);
366
394
  const [previewBlobUrl, setPreviewBlobUrl] = useState(null);
367
395
  const [isPreviewModalLoading, setIsPreviewModalLoading] = useState(false);
368
396
  const [isGeneratingManual, setIsGeneratingManual] = useState(false);
@@ -579,10 +607,11 @@ const DocumentsPage = () => {
579
607
  setIsGeneratingCustom(false);
580
608
  }
581
609
  };
582
- const loadPreviewBlob = async (style, type) => {
610
+ const loadPreviewBlob = async (style, type, preset) => {
583
611
  setIsPreviewModalLoading(true);
584
612
  try {
585
- const res = await fetch(`/admin/documents/templates/preview?style=${style}&type=${type}`, {
613
+ const presetParam = preset ? `&preset=${preset}` : "";
614
+ const res = await fetch(`/admin/documents/templates/preview?style=${style}&type=${type}${presetParam}`, {
586
615
  credentials: "include"
587
616
  });
588
617
  if (!res.ok) {
@@ -603,31 +632,53 @@ const DocumentsPage = () => {
603
632
  setPreviewLoading(null);
604
633
  }
605
634
  };
606
- const handlePreviewTemplate = async (style, type) => {
607
- const key = `${style}-${type}`;
635
+ const handlePreviewTemplate = async (style, type, preset) => {
636
+ const key = preset ? `${style}-${type}-${preset}` : `${style}-${type}`;
608
637
  setPreviewLoading(key);
609
638
  setPreviewStyle(style);
610
639
  setPreviewType(type);
640
+ setPreviewPreset(preset || null);
611
641
  setPreviewModalOpen(true);
612
- await loadPreviewBlob(style, type);
642
+ await loadPreviewBlob(style, type, preset);
613
643
  };
614
644
  const switchPreview = async (style, type) => {
615
645
  setPreviewStyle(style);
616
646
  setPreviewType(type);
617
- await loadPreviewBlob(style, type);
647
+ await loadPreviewBlob(style, type, previewPreset);
618
648
  };
619
649
  const handleOpenPreviewNewTab = () => {
620
- window.open(`/admin/documents/templates/preview?style=${previewStyle}&type=${previewType}`, "_blank");
650
+ const presetParam = previewPreset ? `&preset=${previewPreset}` : "";
651
+ window.open(`/admin/documents/templates/preview?style=${previewStyle}&type=${previewType}${presetParam}`, "_blank");
621
652
  };
622
653
  const handleDownloadPreview = () => {
623
654
  if (!previewBlobUrl) return;
624
655
  const a = document.createElement("a");
625
656
  a.href = previewBlobUrl;
626
- a.download = `preview-${previewStyle}-${previewType}.pdf`;
657
+ a.download = `preview-${previewStyle}-${previewPreset || previewType}.pdf`;
627
658
  document.body.appendChild(a);
628
659
  a.click();
629
660
  document.body.removeChild(a);
630
661
  };
662
+ const handleSyncRepairs = async () => {
663
+ setIsSyncingRepairs(true);
664
+ try {
665
+ const res = await fetch("/admin/documents/sync", {
666
+ method: "POST",
667
+ credentials: "include"
668
+ });
669
+ const data = await res.json().catch(() => ({}));
670
+ if (res.ok && data.success) {
671
+ alert(data.message || `Successfully synced ${data.synced_tickets || 0} repairs!`);
672
+ loadDocuments();
673
+ } else {
674
+ alert(`Sync failed: ${data.message || "Unknown error"}`);
675
+ }
676
+ } catch (e) {
677
+ alert(`Error syncing repairs: ${e.message}`);
678
+ } finally {
679
+ setIsSyncingRepairs(false);
680
+ }
681
+ };
631
682
  const handleViewDocument = (id, displayId) => {
632
683
  window.open(`/admin/documents/${id}/document`, "_blank");
633
684
  };
@@ -758,6 +809,20 @@ const DocumentsPage = () => {
758
809
  ] })
759
810
  ] }),
760
811
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
812
+ /* @__PURE__ */ jsxs(
813
+ Button,
814
+ {
815
+ variant: "secondary",
816
+ size: "small",
817
+ onClick: handleSyncRepairs,
818
+ isLoading: isSyncingRepairs,
819
+ title: "Scan and synchronize all repair tickets and Zoho documents",
820
+ children: [
821
+ /* @__PURE__ */ jsx(ArrowPath, { className: `w-4 h-4 mr-1 ${isSyncingRepairs ? "animate-spin" : ""}` }),
822
+ " Sync Repairs & Zoho"
823
+ ]
824
+ }
825
+ ),
761
826
  /* @__PURE__ */ jsxs(Button, { variant: "secondary", size: "small", onClick: () => setManualModalOpen(true), children: [
762
827
  /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4 mr-1" }),
763
828
  " Create Invoice"
@@ -846,8 +911,8 @@ const DocumentsPage = () => {
846
911
  children: [
847
912
  /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, { placeholder: "Document Type" }) }),
848
913
  /* @__PURE__ */ jsxs(Select.Content, { children: [
849
- /* @__PURE__ */ jsx(Select.Item, { value: "invoice", children: "Invoices (Default)" }),
850
- /* @__PURE__ */ jsx(Select.Item, { value: "all", children: "All Types" }),
914
+ /* @__PURE__ */ jsx(Select.Item, { value: "all", children: "All Types (Default)" }),
915
+ /* @__PURE__ */ jsx(Select.Item, { value: "invoice", children: "Invoices" }),
851
916
  /* @__PURE__ */ jsx(Select.Item, { value: "receipt", children: "Receipts" }),
852
917
  /* @__PURE__ */ jsx(Select.Item, { value: "estimate", children: "Estimates / Quotes" }),
853
918
  /* @__PURE__ */ jsx(Select.Item, { value: "job_card", children: "Job Cards" }),
@@ -1365,221 +1430,567 @@ const DocumentsPage = () => {
1365
1430
  ] })
1366
1431
  ] })
1367
1432
  ] }),
1368
- activeTab === "templates" && /* @__PURE__ */ jsxs("div", { className: "p-6 max-w-4xl flex flex-col gap-6", children: [
1369
- /* @__PURE__ */ jsxs("div", { children: [
1370
- /* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-base font-semibold", children: "PDFKit Fallback Templates" }),
1371
- /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle", children: "Configure different styling templates for each document type when generated locally via PDFKit." })
1433
+ activeTab === "templates" && /* @__PURE__ */ jsxs("div", { className: "p-6 max-w-6xl flex flex-col gap-6", children: [
1434
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
1435
+ /* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg font-semibold", children: "Document Templates & Live Previews" }),
1436
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle", children: "Configure styling templates and preview official customer, workshop, and compliance documents. Zoho-backed documents match official Zoho Books layouts; workshop and custom certificates use dedicated professional formats with consistent company headers." })
1372
1437
  ] }),
1373
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
1374
- /* @__PURE__ */ jsxs("div", { className: "p-4 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between", children: [
1438
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5", children: [
1439
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1375
1440
  /* @__PURE__ */ jsxs("div", { children: [
1376
- /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Invoice Template" }),
1377
- /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-3", children: "Used for standard customer order & repair invoices." }),
1441
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1442
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1443
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "🧾" }),
1444
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Tax Invoice" })
1445
+ ] }),
1446
+ /* @__PURE__ */ jsx(Badge, { color: "orange", size: "small", children: "Zoho Exact" })
1447
+ ] }),
1448
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Official invoice matching Zoho Books layout with itemized parts & labor, balance due highlight, online payment shortlink, QR tracking, and KRA PIN." }),
1449
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1450
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1451
+ /* @__PURE__ */ jsxs(
1452
+ Select,
1453
+ {
1454
+ value: settings.invoice_template || "zoho_exact",
1455
+ onValueChange: (v) => updateSettingField("invoice_template", v),
1456
+ children: [
1457
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1458
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1459
+ /* @__PURE__ */ jsx(Select.Item, { value: "zoho_exact", children: "Zoho Books Exact Format" }),
1460
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1461
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1462
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1463
+ ] })
1464
+ ]
1465
+ }
1466
+ )
1467
+ ] })
1468
+ ] }),
1469
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1470
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Type: invoice" }),
1378
1471
  /* @__PURE__ */ jsxs(
1379
- Select,
1472
+ Button,
1380
1473
  {
1381
- value: settings.invoice_template || "zoho_exact",
1382
- onValueChange: (v) => updateSettingField("invoice_template", v),
1474
+ variant: "secondary",
1475
+ size: "small",
1476
+ onClick: () => handlePreviewTemplate(settings.invoice_template || "zoho_exact", "invoice"),
1477
+ isLoading: previewLoading === `${settings.invoice_template || "zoho_exact"}-invoice`,
1383
1478
  children: [
1384
- /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1385
- /* @__PURE__ */ jsxs(Select.Content, { children: [
1386
- /* @__PURE__ */ jsx(Select.Item, { value: "zoho_exact", children: "Zoho Books Exact Layout" }),
1387
- /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1388
- /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1389
- /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1390
- ] })
1479
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1480
+ " Preview Invoice"
1391
1481
  ]
1392
1482
  }
1393
1483
  )
1484
+ ] })
1485
+ ] }),
1486
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1487
+ /* @__PURE__ */ jsxs("div", { children: [
1488
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1489
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1490
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "💼" }),
1491
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Repair Estimate / Quote" })
1492
+ ] }),
1493
+ /* @__PURE__ */ jsx(Badge, { color: "orange", size: "small", children: "Zoho Exact" })
1494
+ ] }),
1495
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Itemized repair quotation matching Zoho Books with validity period, customer approval links, and workshop labor breakdown." }),
1496
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1497
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1498
+ /* @__PURE__ */ jsxs(
1499
+ Select,
1500
+ {
1501
+ value: settings.estimate_template || "zoho_exact",
1502
+ onValueChange: (v) => updateSettingField("estimate_template", v),
1503
+ children: [
1504
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1505
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1506
+ /* @__PURE__ */ jsx(Select.Item, { value: "zoho_exact", children: "Zoho Books Exact Format" }),
1507
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1508
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1509
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1510
+ ] })
1511
+ ]
1512
+ }
1513
+ )
1514
+ ] })
1394
1515
  ] }),
1395
- /* @__PURE__ */ jsx("div", { className: "mt-4 pt-3 border-t border-ui-border-base flex justify-end", children: /* @__PURE__ */ jsxs(
1396
- Button,
1397
- {
1398
- variant: "secondary",
1399
- size: "small",
1400
- onClick: () => handlePreviewTemplate(settings.invoice_template || "zoho_exact", "invoice"),
1401
- isLoading: previewLoading === `${settings.invoice_template || "zoho_exact"}-invoice`,
1402
- children: [
1403
- /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1404
- " Preview Invoice Template"
1405
- ]
1406
- }
1407
- ) })
1516
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1517
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Type: quote" }),
1518
+ /* @__PURE__ */ jsxs(
1519
+ Button,
1520
+ {
1521
+ variant: "secondary",
1522
+ size: "small",
1523
+ onClick: () => handlePreviewTemplate(settings.estimate_template || "zoho_exact", "estimate"),
1524
+ isLoading: previewLoading === `${settings.estimate_template || "zoho_exact"}-estimate`,
1525
+ children: [
1526
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1527
+ " Preview Estimate"
1528
+ ]
1529
+ }
1530
+ )
1531
+ ] })
1408
1532
  ] }),
1409
- /* @__PURE__ */ jsxs("div", { className: "p-4 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between", children: [
1533
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1410
1534
  /* @__PURE__ */ jsxs("div", { children: [
1411
- /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Packing Slip Template" }),
1412
- /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-3", children: "Used for warehouse fulfillment & shipping packing slips." }),
1535
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1536
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1537
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "💳" }),
1538
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Payment Receipt" })
1539
+ ] }),
1540
+ /* @__PURE__ */ jsx(Badge, { color: "orange", size: "small", children: "Zoho Exact" })
1541
+ ] }),
1542
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Official payment receipt issued upon payment capture with green PAID watermark stamp, payment reference, and receipt details." }),
1543
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1544
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1545
+ /* @__PURE__ */ jsxs(
1546
+ Select,
1547
+ {
1548
+ value: settings.receipt_template || "zoho_exact",
1549
+ onValueChange: (v) => updateSettingField("receipt_template", v),
1550
+ children: [
1551
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1552
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1553
+ /* @__PURE__ */ jsx(Select.Item, { value: "zoho_exact", children: "Zoho Books Exact Format" }),
1554
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1555
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1556
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1557
+ ] })
1558
+ ]
1559
+ }
1560
+ )
1561
+ ] })
1562
+ ] }),
1563
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1564
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Type: receipt" }),
1413
1565
  /* @__PURE__ */ jsxs(
1414
- Select,
1566
+ Button,
1415
1567
  {
1416
- value: settings.packing_slip_template || "modern",
1417
- onValueChange: (v) => updateSettingField("packing_slip_template", v),
1568
+ variant: "secondary",
1569
+ size: "small",
1570
+ onClick: () => handlePreviewTemplate(settings.receipt_template || "zoho_exact", "receipt"),
1571
+ isLoading: previewLoading === `${settings.receipt_template || "zoho_exact"}-receipt`,
1418
1572
  children: [
1419
- /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1420
- /* @__PURE__ */ jsxs(Select.Content, { children: [
1421
- /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1422
- /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1423
- /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1424
- ] })
1573
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1574
+ " Preview Receipt"
1425
1575
  ]
1426
1576
  }
1427
1577
  )
1578
+ ] })
1579
+ ] }),
1580
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1581
+ /* @__PURE__ */ jsxs("div", { children: [
1582
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1583
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1584
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "📋" }),
1585
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Repair Job Card" })
1586
+ ] }),
1587
+ /* @__PURE__ */ jsx(Badge, { color: "blue", size: "small", children: "Workshop Intake" })
1588
+ ] }),
1589
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Customer intake job card featuring asset specifications, serial/IMEI, intake condition, checklist tasks, and technician sign-off." }),
1590
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1591
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1592
+ /* @__PURE__ */ jsxs(
1593
+ Select,
1594
+ {
1595
+ value: settings.job_card_template || "standard",
1596
+ onValueChange: (v) => updateSettingField("job_card_template", v),
1597
+ children: [
1598
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1599
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1600
+ /* @__PURE__ */ jsx(Select.Item, { value: "standard", children: "Standard Workshop Intake" }),
1601
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1602
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1603
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1604
+ ] })
1605
+ ]
1606
+ }
1607
+ )
1608
+ ] })
1428
1609
  ] }),
1429
- /* @__PURE__ */ jsx("div", { className: "mt-4 pt-3 border-t border-ui-border-base flex justify-end", children: /* @__PURE__ */ jsxs(
1430
- Button,
1431
- {
1432
- variant: "secondary",
1433
- size: "small",
1434
- onClick: () => handlePreviewTemplate(settings.packing_slip_template || "modern", "packing_slip"),
1435
- isLoading: previewLoading === `${settings.packing_slip_template || "modern"}-packing_slip`,
1436
- children: [
1437
- /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1438
- " Preview Packing Slip Template"
1439
- ]
1440
- }
1441
- ) })
1610
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1611
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Type: job_card" }),
1612
+ /* @__PURE__ */ jsxs(
1613
+ Button,
1614
+ {
1615
+ variant: "secondary",
1616
+ size: "small",
1617
+ onClick: () => handlePreviewTemplate(settings.job_card_template || "standard", "job_card"),
1618
+ isLoading: previewLoading === `${settings.job_card_template || "standard"}-job_card`,
1619
+ children: [
1620
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1621
+ " Preview Job Card"
1622
+ ]
1623
+ }
1624
+ )
1625
+ ] })
1442
1626
  ] }),
1443
- /* @__PURE__ */ jsxs("div", { className: "p-4 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between", children: [
1627
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1444
1628
  /* @__PURE__ */ jsxs("div", { children: [
1445
- /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Payment Receipt Template" }),
1446
- /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-3", children: "Issued when orders or repairs are captured and paid in full." }),
1629
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1630
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1631
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "📦" }),
1632
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Packing Slip" })
1633
+ ] }),
1634
+ /* @__PURE__ */ jsx(Badge, { color: "purple", size: "small", children: "Order Fulfillment" })
1635
+ ] }),
1636
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Used for warehouse fulfillment, package tracking, and shipping dispatch verification with itemized manifest." }),
1637
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1638
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1639
+ /* @__PURE__ */ jsxs(
1640
+ Select,
1641
+ {
1642
+ value: settings.packing_slip_template || "modern",
1643
+ onValueChange: (v) => updateSettingField("packing_slip_template", v),
1644
+ children: [
1645
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1646
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1647
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1648
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1649
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1650
+ ] })
1651
+ ]
1652
+ }
1653
+ )
1654
+ ] })
1655
+ ] }),
1656
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1657
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Type: packing_slip" }),
1447
1658
  /* @__PURE__ */ jsxs(
1448
- Select,
1659
+ Button,
1449
1660
  {
1450
- value: settings.receipt_template || "zoho_exact",
1451
- onValueChange: (v) => updateSettingField("receipt_template", v),
1661
+ variant: "secondary",
1662
+ size: "small",
1663
+ onClick: () => handlePreviewTemplate(settings.packing_slip_template || "modern", "packing_slip"),
1664
+ isLoading: previewLoading === `${settings.packing_slip_template || "modern"}-packing_slip`,
1452
1665
  children: [
1453
- /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1454
- /* @__PURE__ */ jsxs(Select.Content, { children: [
1455
- /* @__PURE__ */ jsx(Select.Item, { value: "zoho_exact", children: "Zoho Books Exact Layout" }),
1456
- /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1457
- /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1458
- /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1459
- ] })
1666
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1667
+ " Preview Packing Slip"
1460
1668
  ]
1461
1669
  }
1462
1670
  )
1671
+ ] })
1672
+ ] }),
1673
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1674
+ /* @__PURE__ */ jsxs("div", { children: [
1675
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1676
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1677
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "🛡️" }),
1678
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Warranty Certificate" })
1679
+ ] }),
1680
+ /* @__PURE__ */ jsx(Badge, { color: "green", size: "small", children: "90-Day Coverage" })
1681
+ ] }),
1682
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Official certificate verifying professional repair with OEM-specification components and 90-day parts and labor coverage." }),
1683
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1684
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1685
+ /* @__PURE__ */ jsxs(
1686
+ Select,
1687
+ {
1688
+ value: settings.custom_doc_template || "modern",
1689
+ onValueChange: (v) => updateSettingField("custom_doc_template", v),
1690
+ children: [
1691
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1692
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1693
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1694
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1695
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1696
+ ] })
1697
+ ]
1698
+ }
1699
+ )
1700
+ ] })
1463
1701
  ] }),
1464
- /* @__PURE__ */ jsx("div", { className: "mt-4 pt-3 border-t border-ui-border-base flex justify-end", children: /* @__PURE__ */ jsxs(
1465
- Button,
1466
- {
1467
- variant: "secondary",
1468
- size: "small",
1469
- onClick: () => handlePreviewTemplate(settings.receipt_template || "zoho_exact", "receipt"),
1470
- isLoading: previewLoading === `${settings.receipt_template || "zoho_exact"}-receipt`,
1471
- children: [
1472
- /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1473
- " Preview Receipt Template"
1474
- ]
1475
- }
1476
- ) })
1702
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1703
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Preset: warranty" }),
1704
+ /* @__PURE__ */ jsxs(
1705
+ Button,
1706
+ {
1707
+ variant: "secondary",
1708
+ size: "small",
1709
+ onClick: () => handlePreviewTemplate(settings.custom_doc_template || "modern", "custom", "warranty"),
1710
+ isLoading: previewLoading === `${settings.custom_doc_template || "modern"}-custom-warranty`,
1711
+ children: [
1712
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1713
+ " Preview Certificate"
1714
+ ]
1715
+ }
1716
+ )
1717
+ ] })
1477
1718
  ] }),
1478
- /* @__PURE__ */ jsxs("div", { className: "p-4 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between", children: [
1719
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1479
1720
  /* @__PURE__ */ jsxs("div", { children: [
1480
- /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Estimate / Quotation Template" }),
1481
- /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-3", children: "Issued for customer repair quotations, diagnostics, and price estimates." }),
1721
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1722
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1723
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "🔬" }),
1724
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Diagnostic & Inspection" })
1725
+ ] }),
1726
+ /* @__PURE__ */ jsx(Badge, { color: "purple", size: "small", children: "Hardware Findings" })
1727
+ ] }),
1728
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Technical diagnostic report featuring component voltage checks, TrueTone / digitizer measurements, and technician notes." }),
1729
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1730
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1731
+ /* @__PURE__ */ jsxs(
1732
+ Select,
1733
+ {
1734
+ value: settings.custom_doc_template || "modern",
1735
+ onValueChange: (v) => updateSettingField("custom_doc_template", v),
1736
+ children: [
1737
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1738
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1739
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1740
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1741
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1742
+ ] })
1743
+ ]
1744
+ }
1745
+ )
1746
+ ] })
1747
+ ] }),
1748
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1749
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Preset: diagnostic" }),
1482
1750
  /* @__PURE__ */ jsxs(
1483
- Select,
1751
+ Button,
1484
1752
  {
1485
- value: settings.estimate_template || "zoho_exact",
1486
- onValueChange: (v) => updateSettingField("estimate_template", v),
1753
+ variant: "secondary",
1754
+ size: "small",
1755
+ onClick: () => handlePreviewTemplate(settings.custom_doc_template || "modern", "custom", "diagnostic"),
1756
+ isLoading: previewLoading === `${settings.custom_doc_template || "modern"}-custom-diagnostic`,
1487
1757
  children: [
1488
- /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1489
- /* @__PURE__ */ jsxs(Select.Content, { children: [
1490
- /* @__PURE__ */ jsx(Select.Item, { value: "zoho_exact", children: "Zoho Books Exact Layout" }),
1491
- /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1492
- /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1493
- /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1494
- ] })
1758
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1759
+ " Preview Report"
1495
1760
  ]
1496
1761
  }
1497
1762
  )
1763
+ ] })
1764
+ ] }),
1765
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1766
+ /* @__PURE__ */ jsxs("div", { children: [
1767
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1768
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1769
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "📜" }),
1770
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Service Completion" })
1771
+ ] }),
1772
+ /* @__PURE__ */ jsx(Badge, { color: "green", size: "small", children: "QC Cleared" })
1773
+ ] }),
1774
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Certificate verifying that maintenance, repair overhaul, and 100% bench functional test criteria have been passed." }),
1775
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1776
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1777
+ /* @__PURE__ */ jsxs(
1778
+ Select,
1779
+ {
1780
+ value: settings.custom_doc_template || "modern",
1781
+ onValueChange: (v) => updateSettingField("custom_doc_template", v),
1782
+ children: [
1783
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1784
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1785
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1786
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1787
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1788
+ ] })
1789
+ ]
1790
+ }
1791
+ )
1792
+ ] })
1498
1793
  ] }),
1499
- /* @__PURE__ */ jsx("div", { className: "mt-4 pt-3 border-t border-ui-border-base flex justify-end", children: /* @__PURE__ */ jsxs(
1500
- Button,
1501
- {
1502
- variant: "secondary",
1503
- size: "small",
1504
- onClick: () => handlePreviewTemplate(settings.estimate_template || "zoho_exact", "estimate"),
1505
- isLoading: previewLoading === `${settings.estimate_template || "zoho_exact"}-estimate`,
1506
- children: [
1507
- /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1508
- " Preview Estimate Template"
1509
- ]
1510
- }
1511
- ) })
1794
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1795
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Preset: service_completion" }),
1796
+ /* @__PURE__ */ jsxs(
1797
+ Button,
1798
+ {
1799
+ variant: "secondary",
1800
+ size: "small",
1801
+ onClick: () => handlePreviewTemplate(settings.custom_doc_template || "modern", "custom", "service_completion"),
1802
+ isLoading: previewLoading === `${settings.custom_doc_template || "modern"}-custom-service_completion`,
1803
+ children: [
1804
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1805
+ " Preview Certificate"
1806
+ ]
1807
+ }
1808
+ )
1809
+ ] })
1512
1810
  ] }),
1513
- /* @__PURE__ */ jsxs("div", { className: "p-4 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between", children: [
1811
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1514
1812
  /* @__PURE__ */ jsxs("div", { children: [
1515
- /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Custom Document Template" }),
1516
- /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-3", children: "Used for certificates, agreements, and customized memos." }),
1813
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1814
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1815
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "🤝" }),
1816
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Asset Handover & Custody" })
1817
+ ] }),
1818
+ /* @__PURE__ */ jsx(Badge, { color: "blue", size: "small", children: "Custody Release" })
1819
+ ] }),
1820
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Official physical custody and equipment return agreement acknowledging customer receipt in verified working condition." }),
1821
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1822
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1823
+ /* @__PURE__ */ jsxs(
1824
+ Select,
1825
+ {
1826
+ value: settings.custom_doc_template || "modern",
1827
+ onValueChange: (v) => updateSettingField("custom_doc_template", v),
1828
+ children: [
1829
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1830
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1831
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1832
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1833
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1834
+ ] })
1835
+ ]
1836
+ }
1837
+ )
1838
+ ] })
1839
+ ] }),
1840
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1841
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Preset: handover" }),
1517
1842
  /* @__PURE__ */ jsxs(
1518
- Select,
1843
+ Button,
1519
1844
  {
1520
- value: settings.custom_doc_template || "modern",
1521
- onValueChange: (v) => updateSettingField("custom_doc_template", v),
1845
+ variant: "secondary",
1846
+ size: "small",
1847
+ onClick: () => handlePreviewTemplate(settings.custom_doc_template || "modern", "custom", "handover"),
1848
+ isLoading: previewLoading === `${settings.custom_doc_template || "modern"}-custom-handover`,
1522
1849
  children: [
1523
- /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1524
- /* @__PURE__ */ jsxs(Select.Content, { children: [
1525
- /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1526
- /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1527
- /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" }),
1528
- /* @__PURE__ */ jsx(Select.Item, { value: "zoho_exact", children: "Zoho Books Exact Layout" })
1529
- ] })
1850
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1851
+ " Preview Handover"
1530
1852
  ]
1531
1853
  }
1532
1854
  )
1855
+ ] })
1856
+ ] }),
1857
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1858
+ /* @__PURE__ */ jsxs("div", { children: [
1859
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1860
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1861
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "💼" }),
1862
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Commercial Proforma Quote" })
1863
+ ] }),
1864
+ /* @__PURE__ */ jsx(Badge, { color: "orange", size: "small", children: "Cost Estimate" })
1865
+ ] }),
1866
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Itemized corporate repair quotation with workshop turnaround estimate, OEM part warranties, and 14-day validity period." }),
1867
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1868
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1869
+ /* @__PURE__ */ jsxs(
1870
+ Select,
1871
+ {
1872
+ value: settings.custom_doc_template || "modern",
1873
+ onValueChange: (v) => updateSettingField("custom_doc_template", v),
1874
+ children: [
1875
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1876
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1877
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1878
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1879
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1880
+ ] })
1881
+ ]
1882
+ }
1883
+ )
1884
+ ] })
1533
1885
  ] }),
1534
- /* @__PURE__ */ jsx("div", { className: "mt-4 pt-3 border-t border-ui-border-base flex justify-end", children: /* @__PURE__ */ jsxs(
1535
- Button,
1536
- {
1537
- variant: "secondary",
1538
- size: "small",
1539
- onClick: () => handlePreviewTemplate(settings.custom_doc_template || "modern", "custom"),
1540
- isLoading: previewLoading === `${settings.custom_doc_template || "modern"}-custom`,
1541
- children: [
1542
- /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1543
- " Preview Custom Doc Template"
1544
- ]
1545
- }
1546
- ) })
1886
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1887
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Preset: proforma" }),
1888
+ /* @__PURE__ */ jsxs(
1889
+ Button,
1890
+ {
1891
+ variant: "secondary",
1892
+ size: "small",
1893
+ onClick: () => handlePreviewTemplate(settings.custom_doc_template || "modern", "custom", "proforma"),
1894
+ isLoading: previewLoading === `${settings.custom_doc_template || "modern"}-custom-proforma`,
1895
+ children: [
1896
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1897
+ " Preview Proforma"
1898
+ ]
1899
+ }
1900
+ )
1901
+ ] })
1547
1902
  ] }),
1548
- /* @__PURE__ */ jsxs("div", { className: "p-4 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between", children: [
1903
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1549
1904
  /* @__PURE__ */ jsxs("div", { children: [
1550
- /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Repair Job Card Template" }),
1551
- /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-3", children: "Workshop intake job card with device specs, inspection checklist & technician sign-off." }),
1905
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1906
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1907
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "🔄" }),
1908
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Device Trade-In Agreement" })
1909
+ ] }),
1910
+ /* @__PURE__ */ jsx(Badge, { color: "green", size: "small", children: "Trade-In & Transfer" })
1911
+ ] }),
1912
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Official contract confirming hardware valuation, title handover, and trade-in store credit with verified ownership transfer." }),
1913
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1914
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1915
+ /* @__PURE__ */ jsxs(
1916
+ Select,
1917
+ {
1918
+ value: settings.custom_doc_template || "modern",
1919
+ onValueChange: (v) => updateSettingField("custom_doc_template", v),
1920
+ children: [
1921
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1922
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1923
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1924
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1925
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1926
+ ] })
1927
+ ]
1928
+ }
1929
+ )
1930
+ ] })
1931
+ ] }),
1932
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1933
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Preset: trade_in" }),
1552
1934
  /* @__PURE__ */ jsxs(
1553
- Select,
1935
+ Button,
1554
1936
  {
1555
- value: settings.job_card_template || "standard",
1556
- onValueChange: (v) => updateSettingField("job_card_template", v),
1937
+ variant: "secondary",
1938
+ size: "small",
1939
+ onClick: () => handlePreviewTemplate(settings.custom_doc_template || "modern", "custom", "trade_in"),
1940
+ isLoading: previewLoading === `${settings.custom_doc_template || "modern"}-custom-trade_in`,
1557
1941
  children: [
1558
- /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1559
- /* @__PURE__ */ jsxs(Select.Content, { children: [
1560
- /* @__PURE__ */ jsx(Select.Item, { value: "standard", children: "Workshop Intake Job Card (Standard)" }),
1561
- /* @__PURE__ */ jsx(Select.Item, { value: "zoho_exact", children: "Zoho Books Exact Layout" }),
1562
- /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1563
- /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1564
- /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1565
- ] })
1942
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1943
+ " Preview Trade-In"
1566
1944
  ]
1567
1945
  }
1568
1946
  )
1947
+ ] })
1948
+ ] }),
1949
+ /* @__PURE__ */ jsxs("div", { className: "p-5 border border-ui-border-base rounded-lg bg-ui-bg-base flex flex-col justify-between shadow-sm hover:border-ui-border-interactive transition-colors", children: [
1950
+ /* @__PURE__ */ jsxs("div", { children: [
1951
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1952
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1953
+ /* @__PURE__ */ jsx("span", { className: "text-xl", children: "♻️" }),
1954
+ /* @__PURE__ */ jsx(Label, { className: "font-semibold text-sm", children: "Destruction & Disposal" })
1955
+ ] }),
1956
+ /* @__PURE__ */ jsx(Badge, { color: "red", size: "small", children: "Eco & Compliance" })
1957
+ ] }),
1958
+ /* @__PURE__ */ jsx(Text, { className: "text-xs text-ui-fg-subtle mb-4", children: "Certificate verifying compliant electronic demanufacturing, physical shredding, and WEEE eco-friendly recycling." }),
1959
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1960
+ /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Template Style" }),
1961
+ /* @__PURE__ */ jsxs(
1962
+ Select,
1963
+ {
1964
+ value: settings.custom_doc_template || "modern",
1965
+ onValueChange: (v) => updateSettingField("custom_doc_template", v),
1966
+ children: [
1967
+ /* @__PURE__ */ jsx(Select.Trigger, { size: "small", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
1968
+ /* @__PURE__ */ jsxs(Select.Content, { children: [
1969
+ /* @__PURE__ */ jsx(Select.Item, { value: "modern", children: "Modern Minimalist" }),
1970
+ /* @__PURE__ */ jsx(Select.Item, { value: "classic", children: "Classic Corporate" }),
1971
+ /* @__PURE__ */ jsx(Select.Item, { value: "minimal", children: "Clean Tech Monospace" })
1972
+ ] })
1973
+ ]
1974
+ }
1975
+ )
1976
+ ] })
1569
1977
  ] }),
1570
- /* @__PURE__ */ jsx("div", { className: "mt-4 pt-3 border-t border-ui-border-base flex justify-end", children: /* @__PURE__ */ jsxs(
1571
- Button,
1572
- {
1573
- variant: "secondary",
1574
- size: "small",
1575
- onClick: () => handlePreviewTemplate(settings.job_card_template || "standard", "job_card"),
1576
- isLoading: previewLoading === `${settings.job_card_template || "standard"}-job_card`,
1577
- children: [
1578
- /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1579
- " Preview Job Card Template"
1580
- ]
1581
- }
1582
- ) })
1978
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-3 border-t border-ui-border-base flex items-center justify-between", children: [
1979
+ /* @__PURE__ */ jsx(Text, { className: "text-[11px] text-ui-fg-muted font-mono", children: "Preset: destruction" }),
1980
+ /* @__PURE__ */ jsxs(
1981
+ Button,
1982
+ {
1983
+ variant: "secondary",
1984
+ size: "small",
1985
+ onClick: () => handlePreviewTemplate(settings.custom_doc_template || "modern", "custom", "destruction"),
1986
+ isLoading: previewLoading === `${settings.custom_doc_template || "modern"}-custom-destruction`,
1987
+ children: [
1988
+ /* @__PURE__ */ jsx(ArrowDownTray, { className: "w-3.5 h-3.5 mr-1" }),
1989
+ " Preview Disposal"
1990
+ ]
1991
+ }
1992
+ )
1993
+ ] })
1583
1994
  ] })
1584
1995
  ] }),
1585
1996
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-3 mt-4", children: [