@nice2dev/licensing 1.2.1 → 1.2.2

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.
package/dist/index.cjs CHANGED
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const marks = require("./marks-CDyo3kiN.cjs");
3
+ const marks = require("./marks-BxZztzfi.cjs");
4
4
  const jsxRuntime = require("react/jsx-runtime");
5
+ const uiCore = require("@nice2dev/ui-core");
5
6
  const React = require("react");
6
7
  const icons = require("@nice2dev/icons");
7
8
  const HEARTBEAT_INTERVAL_MS = 5 * 60 * 1e3;
@@ -1264,9 +1265,10 @@ function useLicensePortal(config) {
1264
1265
  invoices: [],
1265
1266
  activeTab: "overview"
1266
1267
  });
1268
+ const { apiBaseUrl, authToken, customerId } = config;
1267
1269
  const service = React.useMemo(
1268
- () => new LicensePortalService(config),
1269
- [config.apiBaseUrl, config.authToken, config.customerId]
1270
+ () => new LicensePortalService({ apiBaseUrl, authToken, customerId }),
1271
+ [apiBaseUrl, authToken, customerId]
1270
1272
  );
1271
1273
  const loadData = React.useCallback(async () => {
1272
1274
  var _a;
@@ -1356,6 +1358,7 @@ function useLicensePortal(config) {
1356
1358
  };
1357
1359
  }
1358
1360
  const LicenseStatusBadge = ({ status, size = "md" }) => {
1361
+ const { t } = uiCore.useNiceTranslation();
1359
1362
  const sizeClasses = {
1360
1363
  sm: "px-2 py-0.5 text-xs",
1361
1364
  md: "px-2.5 py-1 text-sm",
@@ -1377,12 +1380,13 @@ const LicenseStatusBadge = ({ status, size = "md" }) => {
1377
1380
  style: { backgroundColor: getStatusColor(status) }
1378
1381
  }
1379
1382
  ),
1380
- status.charAt(0).toUpperCase() + status.slice(1)
1383
+ t(`licensePortal.status.${status}`, status.charAt(0).toUpperCase() + status.slice(1))
1381
1384
  ]
1382
1385
  }
1383
1386
  );
1384
1387
  };
1385
1388
  const LicenseTierBadge = ({ tier, size = "md" }) => {
1389
+ const { t } = uiCore.useNiceTranslation();
1386
1390
  const tierColors = {
1387
1391
  trial: "#6b7280",
1388
1392
  personal: "#3b82f6",
@@ -1405,11 +1409,12 @@ const LicenseTierBadge = ({ tier, size = "md" }) => {
1405
1409
  color: tierColors[tier],
1406
1410
  border: `1px solid ${tierColors[tier]}40`
1407
1411
  },
1408
- children: getTierLabel(tier)
1412
+ children: t(`licensing.tier.${tier}`, getTierLabel(tier))
1409
1413
  }
1410
1414
  );
1411
1415
  };
1412
1416
  const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected }) => {
1417
+ const { t } = uiCore.useNiceTranslation();
1413
1418
  const daysRemaining = getDaysUntilExpiration(license.expiresAt);
1414
1419
  const isExpiringSoon = daysRemaining !== null && daysRemaining <= 30 && daysRemaining > 0;
1415
1420
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1427,7 +1432,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1427
1432
  ] })
1428
1433
  ] }),
1429
1434
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-right text-sm", children: [
1430
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Seats" }),
1435
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licensePortal.seats", "Seats") }),
1431
1436
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-semibold", children: [
1432
1437
  license.activeSeats,
1433
1438
  "/",
@@ -1436,25 +1441,16 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1436
1441
  ] })
1437
1442
  ] }),
1438
1443
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm text-gray-600 mb-3", children: [
1439
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1440
- "Licensee: ",
1441
- license.licensee
1442
- ] }),
1443
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1444
- "Email: ",
1445
- license.email
1446
- ] })
1444
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: t("licensePortal.licensee", "Licensee: {licensee}").replace(
1445
+ "{licensee}",
1446
+ String(license.licensee)
1447
+ ) }),
1448
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: t("licensePortal.email", "Email: {email}").replace("{email}", String(license.email)) })
1447
1449
  ] }),
1448
- license.expiresAt && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `text-sm ${isExpiringSoon ? "text-orange-600" : "text-gray-500"}`, children: daysRemaining !== null && daysRemaining > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1449
- "Expires in ",
1450
- daysRemaining,
1451
- " days (",
1452
- formatDate(license.expiresAt),
1453
- ")"
1454
- ] }) : daysRemaining === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-600", children: "Expires today" }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-red-600", children: [
1455
- "Expired ",
1456
- formatDate(license.expiresAt)
1457
- ] }) }),
1450
+ license.expiresAt && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `text-sm ${isExpiringSoon ? "text-orange-600" : "text-gray-500"}`, children: daysRemaining !== null && daysRemaining > 0 ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: t("licensePortal.expiresInDays", "Expires in {daysRemaining} days ({expiresAt})").replace("{daysRemaining}", String(daysRemaining)).replace("{expiresAt}", String(formatDate(license.expiresAt))) }) : daysRemaining === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-600", children: t("licensePortal.expiresToday", "Expires today") }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-600", children: t("licensePortal.expired", "Expired {expiresAt}").replace(
1451
+ "{expiresAt}",
1452
+ String(formatDate(license.expiresAt))
1453
+ ) }) }),
1458
1454
  (onActivate || onDeactivate) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 mt-3 pt-3 border-t", children: [
1459
1455
  onActivate && license.status === "valid" && /* @__PURE__ */ jsxRuntime.jsx(
1460
1456
  "button",
@@ -1464,7 +1460,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1464
1460
  e.stopPropagation();
1465
1461
  onActivate();
1466
1462
  },
1467
- children: "Activate"
1463
+ children: t("licensePortal.activate", "Activate")
1468
1464
  }
1469
1465
  ),
1470
1466
  onDeactivate && /* @__PURE__ */ jsxRuntime.jsx(
@@ -1475,7 +1471,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1475
1471
  e.stopPropagation();
1476
1472
  onDeactivate();
1477
1473
  },
1478
- children: "Deactivate"
1474
+ children: t("licensePortal.deactivate", "Deactivate")
1479
1475
  }
1480
1476
  )
1481
1477
  ] })
@@ -1484,24 +1480,25 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1484
1480
  );
1485
1481
  };
1486
1482
  const LicensePortal = (props) => {
1483
+ const { t } = uiCore.useNiceTranslation();
1487
1484
  const { className, style, ...config } = props;
1488
1485
  const { state, activateLicense, deactivateLicense, selectLicense, setActiveTab, loadData } = useLicensePortal(config);
1489
1486
  if (state.loading) {
1490
1487
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-license-portal ${className || ""}`, style, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center p-8", children: [
1491
1488
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500" }),
1492
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-3 text-gray-600", children: "Loading licenses..." })
1489
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-3 text-gray-600", children: t("licensePortal.loadingLicenses", "Loading licenses...") })
1493
1490
  ] }) });
1494
1491
  }
1495
1492
  if (state.error) {
1496
1493
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-license-portal ${className || ""}`, style, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: [
1497
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-red-800 font-semibold", children: "Error loading licenses" }),
1494
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-red-800 font-semibold", children: t("licensePortal.errorLoadingLicenses", "Error loading licenses") }),
1498
1495
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-600 text-sm mt-1", children: state.error.message }),
1499
1496
  /* @__PURE__ */ jsxRuntime.jsx(
1500
1497
  "button",
1501
1498
  {
1502
1499
  className: "mt-3 px-4 py-2 bg-red-100 text-red-700 rounded hover:bg-red-200",
1503
1500
  onClick: loadData,
1504
- children: "Retry"
1501
+ children: t("licensePortal.retry", "Retry")
1505
1502
  }
1506
1503
  )
1507
1504
  ] }) });
@@ -1511,17 +1508,20 @@ const LicensePortal = (props) => {
1511
1508
  return null;
1512
1509
  }
1513
1510
  const tabs = [
1514
- { id: "overview", label: "Overview" },
1515
- { id: "licenses", label: "Licenses" },
1516
- { id: "seats", label: "Seat Management" },
1517
- ...config.showBilling ? [{ id: "billing", label: "Billing" }] : [],
1518
- ...config.showAnalytics ? [{ id: "analytics", label: "Analytics" }] : [],
1519
- { id: "settings", label: "Settings" }
1511
+ { id: "overview", label: t("licensePortal.overview", "Overview") },
1512
+ { id: "licenses", label: t("licensePortal.licenses", "Licenses") },
1513
+ { id: "seats", label: t("licensePortal.seatManagement", "Seat Management") },
1514
+ ...config.showBilling ? [{ id: "billing", label: t("licensePortal.billing", "Billing") }] : [],
1515
+ ...config.showAnalytics ? [{ id: "analytics", label: t("licensePortal.analytics", "Analytics") }] : [],
1516
+ { id: "settings", label: t("licensePortal.settings", "Settings") }
1520
1517
  ];
1521
1518
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-license-portal ${className || ""}`, style, children: [
1522
1519
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6", children: [
1523
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: "License Portal" }),
1524
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: "Manage your Nice2Dev licenses and subscriptions" })
1520
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("licensePortal.licensePortal", "License Portal") }),
1521
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: t(
1522
+ "licensePortal.manageYourNice2devLicensesAnd",
1523
+ "Manage your Nice2Dev licenses and subscriptions"
1524
+ ) })
1525
1525
  ] }),
1526
1526
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-gray-200 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "flex gap-6", children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
1527
1527
  "button",
@@ -1535,15 +1535,15 @@ const LicensePortal = (props) => {
1535
1535
  state.activeTab === "overview" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
1536
1536
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-4", children: [
1537
1537
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-4 rounded-lg border border-gray-200", children: [
1538
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Total Licenses" }),
1538
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.totalLicenses", "Total Licenses") }),
1539
1539
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold", children: overview.totalLicenses })
1540
1540
  ] }),
1541
1541
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-4 rounded-lg border border-gray-200", children: [
1542
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Active" }),
1542
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.active", "Active") }),
1543
1543
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold text-green-600", children: overview.activeLicenses })
1544
1544
  ] }),
1545
1545
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-4 rounded-lg border border-gray-200", children: [
1546
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Seats Used" }),
1546
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.seatsUsed", "Seats Used") }),
1547
1547
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-2xl font-bold", children: [
1548
1548
  overview.usedSeats,
1549
1549
  "/",
@@ -1551,22 +1551,22 @@ const LicensePortal = (props) => {
1551
1551
  ] })
1552
1552
  ] }),
1553
1553
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-4 rounded-lg border border-gray-200", children: [
1554
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Expiring Soon" }),
1554
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.expiringSoon", "Expiring Soon") }),
1555
1555
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold text-orange-600", children: overview.expiringSoon.length })
1556
1556
  ] })
1557
1557
  ] }),
1558
1558
  overview.expiringSoon.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [
1559
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: "Licenses Expiring Soon" }),
1559
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: t("licensePortal.licensesExpiringSoon", "Licenses Expiring Soon") }),
1560
1560
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: overview.expiringSoon.map((license) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
1561
1561
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-orange-700", children: license.key }),
1562
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-orange-600", children: [
1563
- getDaysUntilExpiration(license.expiresAt),
1564
- " days remaining"
1565
- ] })
1562
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-orange-600", children: t("licensePortal.daysRemainingCount", "{days} days remaining").replace(
1563
+ "{days}",
1564
+ String(getDaysUntilExpiration(license.expiresAt))
1565
+ ) })
1566
1566
  ] }, license.key)) })
1567
1567
  ] }),
1568
1568
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
1569
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Recent Activity" }) }),
1569
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("licensePortal.recentActivity", "Recent Activity") }) }),
1570
1570
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-gray-100", children: [
1571
1571
  state.actionHistory.slice(0, 5).map((action) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex items-center justify-between", children: [
1572
1572
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -1575,7 +1575,7 @@ const LicensePortal = (props) => {
1575
1575
  ] }),
1576
1576
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: formatDate(action.timestamp) })
1577
1577
  ] }, action.id)),
1578
- state.actionHistory.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: "No recent activity" })
1578
+ state.actionHistory.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: t("licensePortal.noRecentActivity", "No recent activity") })
1579
1579
  ] })
1580
1580
  ] })
1581
1581
  ] }),
@@ -1598,18 +1598,21 @@ const LicensePortal = (props) => {
1598
1598
  license.key
1599
1599
  );
1600
1600
  }),
1601
- overview.licenses.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full text-center py-8 text-gray-500", children: "No licenses found. Contact support to purchase a license." })
1601
+ overview.licenses.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full text-center py-8 text-gray-500", children: t(
1602
+ "licensePortal.noLicensesFoundContactSupport",
1603
+ "No licenses found. Contact support to purchase a license."
1604
+ ) })
1602
1605
  ] }),
1603
1606
  state.activeTab === "billing" && config.showBilling && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
1604
1607
  state.subscription && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 p-6", children: [
1605
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: "Current Subscription" }),
1608
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("licensePortal.currentSubscription", "Current Subscription") }),
1606
1609
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
1607
1610
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1608
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Plan" }),
1611
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.plan", "Plan") }),
1609
1612
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.subscription.plan })
1610
1613
  ] }),
1611
1614
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1612
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Status" }),
1615
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.status", "Status") }),
1613
1616
  /* @__PURE__ */ jsxRuntime.jsx(
1614
1617
  "div",
1615
1618
  {
@@ -1619,7 +1622,7 @@ const LicensePortal = (props) => {
1619
1622
  )
1620
1623
  ] }),
1621
1624
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1622
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Current Period" }),
1625
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.currentPeriod", "Current Period") }),
1623
1626
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-medium", children: [
1624
1627
  formatDate(state.subscription.currentPeriodStart),
1625
1628
  " -",
@@ -1628,13 +1631,13 @@ const LicensePortal = (props) => {
1628
1631
  ] })
1629
1632
  ] }),
1630
1633
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1631
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Seats" }),
1634
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.seats", "Seats") }),
1632
1635
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.subscription.seats })
1633
1636
  ] })
1634
1637
  ] })
1635
1638
  ] }),
1636
1639
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
1637
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Invoices" }) }),
1640
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("licensePortal.invoices", "Invoices") }) }),
1638
1641
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-gray-100", children: [
1639
1642
  state.invoices.map((invoice) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex items-center justify-between", children: [
1640
1643
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -1661,20 +1664,23 @@ const LicensePortal = (props) => {
1661
1664
  className: "text-blue-500 hover:text-blue-600",
1662
1665
  target: "_blank",
1663
1666
  rel: "noopener noreferrer",
1664
- children: "Download"
1667
+ children: t("licensePortal.download", "Download")
1665
1668
  }
1666
1669
  )
1667
1670
  ] })
1668
1671
  ] }, invoice.id)),
1669
- state.invoices.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: "No invoices" })
1672
+ state.invoices.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: t("licensePortal.noInvoices", "No invoices") })
1670
1673
  ] })
1671
1674
  ] })
1672
1675
  ] }),
1673
1676
  state.activeTab === "seats" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 p-6", children: [
1674
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: "Seat Management" }),
1675
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mb-4", children: "Select a license to manage seat assignments." })
1677
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("licensePortal.seatManagement", "Seat Management") }),
1678
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mb-4", children: t(
1679
+ "licensePortal.selectALicenseToManage",
1680
+ "Select a license to manage seat assignments."
1681
+ ) })
1676
1682
  ] }),
1677
- state.activeTab === "settings" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-lg border border-gray-200 p-6", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: "Portal Settings" }) })
1683
+ state.activeTab === "settings" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-lg border border-gray-200 p-6", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("licensePortal.portalSettings", "Portal Settings") }) })
1678
1684
  ] });
1679
1685
  };
1680
1686
  class ActivationService {
@@ -1692,6 +1698,7 @@ class ActivationService {
1692
1698
  const error = await response.json().catch(() => ({}));
1693
1699
  throw {
1694
1700
  code: `HTTP_${response.status}`,
1701
+ // audit-allow: i18n — the service's fallback in the thrown ActivationError (API contract)
1695
1702
  message: error.message || "Request failed",
1696
1703
  retryable: response.status >= 500,
1697
1704
  supportRequired: response.status === 403
@@ -1765,6 +1772,7 @@ async function getDefaultMachineName() {
1765
1772
  return "Unknown Device";
1766
1773
  }
1767
1774
  function useActivationWizard(config) {
1775
+ const { t } = uiCore.useNiceTranslation();
1768
1776
  const [state, setState] = React.useState({
1769
1777
  step: "enter-key",
1770
1778
  licenseKey: "",
@@ -1794,7 +1802,10 @@ function useActivationWizard(config) {
1794
1802
  ...s,
1795
1803
  error: {
1796
1804
  code: "INVALID_FORMAT",
1797
- message: "License key format is invalid. Expected format: XXXX-XXXX-XXXX-XXXX-XXXX",
1805
+ message: t(
1806
+ "activationWizard.licenseKeyFormatIsInvalid",
1807
+ "License key format is invalid. Expected format: XXXX-XXXX-XXXX-XXXX-XXXX"
1808
+ ),
1798
1809
  retryable: true
1799
1810
  }
1800
1811
  }));
@@ -1809,7 +1820,7 @@ function useActivationWizard(config) {
1809
1820
  step: "error",
1810
1821
  error: {
1811
1822
  code: validation.errorCode || "VALIDATION_FAILED",
1812
- message: validation.errorMessage || "License key validation failed",
1823
+ message: validation.errorMessage || t("activationWizard.licenseKeyValidationFailed", "License key validation failed"),
1813
1824
  retryable: true
1814
1825
  }
1815
1826
  }));
@@ -1833,7 +1844,10 @@ function useActivationWizard(config) {
1833
1844
  step: "error",
1834
1845
  error: {
1835
1846
  code: "HARDWARE_LIMIT",
1836
- message: hwCheck.reason || "Maximum hardware activations reached",
1847
+ message: hwCheck.reason || t(
1848
+ "activationWizard.maximumHardwareActivationsReached",
1849
+ "Maximum hardware activations reached"
1850
+ ),
1837
1851
  retryable: false,
1838
1852
  supportRequired: true
1839
1853
  }
@@ -1848,7 +1862,7 @@ function useActivationWizard(config) {
1848
1862
  error
1849
1863
  }));
1850
1864
  }
1851
- }, [state.licenseKey, state.machineName, service]);
1865
+ }, [state.licenseKey, state.machineName, service, t]);
1852
1866
  const acceptTermsAndActivate = React.useCallback(async () => {
1853
1867
  var _a, _b;
1854
1868
  if (!state.termsAccepted) {
@@ -1856,7 +1870,10 @@ function useActivationWizard(config) {
1856
1870
  ...s,
1857
1871
  error: {
1858
1872
  code: "TERMS_NOT_ACCEPTED",
1859
- message: "Please accept the terms of service to continue",
1873
+ message: t(
1874
+ "activationWizard.pleaseAcceptTheTermsOf",
1875
+ "Please accept the terms of service to continue"
1876
+ ),
1860
1877
  retryable: true
1861
1878
  }
1862
1879
  }));
@@ -1885,7 +1902,7 @@ function useActivationWizard(config) {
1885
1902
  }));
1886
1903
  (_b = config.onActivationError) == null ? void 0 : _b.call(config, activationError);
1887
1904
  }
1888
- }, [state, service, config]);
1905
+ }, [state, service, config, t]);
1889
1906
  const startOfflineActivation = React.useCallback(async () => {
1890
1907
  if (!config.allowOfflineActivation) {
1891
1908
  return;
@@ -1974,13 +1991,14 @@ function useActivationWizard(config) {
1974
1991
  };
1975
1992
  }
1976
1993
  const StepIndicator = ({ currentStep }) => {
1994
+ const { t } = uiCore.useNiceTranslation();
1977
1995
  const steps = [
1978
- { id: "enter-key", label: "Enter Key" },
1979
- { id: "validate", label: "Validate" },
1980
- { id: "hardware-check", label: "Hardware" },
1981
- { id: "terms", label: "Terms" },
1982
- { id: "activating", label: "Activate" },
1983
- { id: "success", label: "Done" }
1996
+ { id: "enter-key", label: t("activationWizard.enterKey", "Enter Key") },
1997
+ { id: "validate", label: t("activationWizard.validate", "Validate") },
1998
+ { id: "hardware-check", label: t("activationWizard.hardware", "Hardware") },
1999
+ { id: "terms", label: t("activationWizard.terms", "Terms") },
2000
+ { id: "activating", label: t("activationWizard.activate", "Activate") },
2001
+ { id: "success", label: t("activationWizard.done", "Done") }
1984
2002
  ];
1985
2003
  const stepOrder = [
1986
2004
  "enter-key",
@@ -2012,6 +2030,7 @@ const StepIndicator = ({ currentStep }) => {
2012
2030
  };
2013
2031
  const ActivationWizard = (props) => {
2014
2032
  var _a;
2033
+ const { t } = uiCore.useNiceTranslation();
2015
2034
  const { className, style, ...config } = props;
2016
2035
  const {
2017
2036
  state,
@@ -2032,17 +2051,20 @@ const ActivationWizard = (props) => {
2032
2051
  style,
2033
2052
  children: [
2034
2053
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-6", children: [
2035
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: "Activate License" }),
2036
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-1", children: "Follow the steps to activate your Nice2Dev license" })
2054
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("activationWizard.activateLicense", "Activate License") }),
2055
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-1", children: t(
2056
+ "activationWizard.followTheStepsToActivate",
2057
+ "Follow the steps to activate your Nice2Dev license"
2058
+ ) })
2037
2059
  ] }),
2038
2060
  state.step !== "error" && /* @__PURE__ */ jsxRuntime.jsx(StepIndicator, { currentStep: state.step }),
2039
2061
  state.step === "error" && state.error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
2040
2062
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-6 text-center", children: [
2041
2063
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-red-500 text-4xl mb-3 font-bold", "aria-hidden": "true", children: "!" }),
2042
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-red-800", children: "Activation Failed" }),
2064
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-red-800", children: t("activationWizard.activationFailed", "Activation Failed") }),
2043
2065
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-600 mt-2", children: state.error.message }),
2044
2066
  state.error.supportRequired && config.supportEmail && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600 mt-4", children: [
2045
- "Please contact support at",
2067
+ t("activationWizard.pleaseContactSupportAt", "Please contact support at"),
2046
2068
  " ",
2047
2069
  /* @__PURE__ */ jsxRuntime.jsx("a", { href: `mailto:${config.supportEmail}`, className: "text-blue-500 hover:underline", children: config.supportEmail })
2048
2070
  ] })
@@ -2053,7 +2075,7 @@ const ActivationWizard = (props) => {
2053
2075
  {
2054
2076
  onClick: () => goBack(),
2055
2077
  className: "px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
2056
- children: "Try Again"
2078
+ children: t("activationWizard.tryAgain", "Try Again")
2057
2079
  }
2058
2080
  ),
2059
2081
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2061,14 +2083,14 @@ const ActivationWizard = (props) => {
2061
2083
  {
2062
2084
  onClick: reset,
2063
2085
  className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2064
- children: "Start Over"
2086
+ children: t("activationWizard.startOver", "Start Over")
2065
2087
  }
2066
2088
  )
2067
2089
  ] })
2068
2090
  ] }),
2069
2091
  state.step === "enter-key" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2070
2092
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2071
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "License Key" }),
2093
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("activationWizard.licenseKey", "License Key") }),
2072
2094
  /* @__PURE__ */ jsxRuntime.jsx(
2073
2095
  "input",
2074
2096
  {
@@ -2080,17 +2102,20 @@ const ActivationWizard = (props) => {
2080
2102
  maxLength: 29
2081
2103
  }
2082
2104
  ),
2083
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Enter the license key you received upon purchase" })
2105
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 mt-2", children: t(
2106
+ "activationWizard.enterTheLicenseKeyYou",
2107
+ "Enter the license key you received upon purchase"
2108
+ ) })
2084
2109
  ] }),
2085
2110
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2086
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Machine Name (optional)" }),
2111
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("activationWizard.machineNameOptional", "Machine Name (optional)") }),
2087
2112
  /* @__PURE__ */ jsxRuntime.jsx(
2088
2113
  "input",
2089
2114
  {
2090
2115
  type: "text",
2091
2116
  value: state.machineName,
2092
2117
  onChange: (e) => setMachineName(e.target.value),
2093
- placeholder: "My Work PC",
2118
+ placeholder: t("activationWizard.myWorkPc", "My Work PC"),
2094
2119
  className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
2095
2120
  }
2096
2121
  )
@@ -2103,7 +2128,7 @@ const ActivationWizard = (props) => {
2103
2128
  onClick: validateKey,
2104
2129
  disabled: !state.licenseKey,
2105
2130
  className: "flex-1 px-6 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:bg-gray-300 disabled:cursor-not-allowed",
2106
- children: "Continue"
2131
+ children: t("activationWizard.continue", "Continue")
2107
2132
  }
2108
2133
  ),
2109
2134
  config.onCancel && /* @__PURE__ */ jsxRuntime.jsx(
@@ -2111,7 +2136,7 @@ const ActivationWizard = (props) => {
2111
2136
  {
2112
2137
  onClick: config.onCancel,
2113
2138
  className: "px-6 py-3 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2114
- children: "Cancel"
2139
+ children: t("activationWizard.cancel", "Cancel")
2115
2140
  }
2116
2141
  )
2117
2142
  ] }),
@@ -2121,7 +2146,8 @@ const ActivationWizard = (props) => {
2121
2146
  onClick: startOfflineActivation,
2122
2147
  className: "w-full text-sm text-blue-500 hover:underline",
2123
2148
  children: [
2124
- "Activate offline ",
2149
+ t("activationWizard.activateOffline", "Activate offline"),
2150
+ " ",
2125
2151
  /* @__PURE__ */ jsxRuntime.jsx(icons.NtdArrowRight, { size: 14, style: { verticalAlign: "-2px" } })
2126
2152
  ]
2127
2153
  }
@@ -2129,26 +2155,35 @@ const ActivationWizard = (props) => {
2129
2155
  ] }),
2130
2156
  (state.step === "validate" || state.step === "hardware-check") && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", children: [
2131
2157
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto" }),
2132
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: state.step === "validate" ? "Validating License..." : "Checking Hardware..." }),
2133
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: state.step === "validate" ? "Verifying your license key with the server" : "Collecting hardware information for activation" })
2158
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: state.step === "validate" ? t("activationWizard.validatingLicense", "Validating License...") : t("activationWizard.checkingHardware", "Checking Hardware...") }),
2159
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: state.step === "validate" ? t(
2160
+ "activationWizard.verifyingYourLicenseKeyWith",
2161
+ "Verifying your license key with the server"
2162
+ ) : t(
2163
+ "activationWizard.collectingHardwareInformationForActivati",
2164
+ "Collecting hardware information for activation"
2165
+ ) })
2134
2166
  ] }),
2135
2167
  state.step === "terms" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2136
2168
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-gray-50 rounded-lg p-4", children: [
2137
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-3", children: "License Details" }),
2169
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-3", children: t("activationWizard.licenseDetails", "License Details") }),
2138
2170
  ((_a = state.validation) == null ? void 0 : _a.license) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 text-sm", children: [
2139
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Tier:" }),
2171
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.tier", "Tier:") }),
2140
2172
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium capitalize", children: state.validation.license.tier }),
2141
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Licensee:" }),
2173
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.licensee", "Licensee:") }),
2142
2174
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.validation.license.licensee }),
2143
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Max Machines:" }),
2175
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.maxMachines", "Max Machines:") }),
2144
2176
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.validation.license.maxMachines }),
2145
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "This Machine:" }),
2177
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.thisMachine", "This Machine:") }),
2146
2178
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.machineName })
2147
2179
  ] })
2148
2180
  ] }),
2149
2181
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border border-gray-200 rounded-lg p-4 max-h-48 overflow-y-auto text-sm text-gray-600", children: [
2150
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-gray-800 mb-2", children: "Terms of Service" }),
2151
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "By activating this license, you agree to the Nice2Dev Software License Agreement. This license grants you the right to use the software on the specified number of machines according to your license tier. Unauthorized redistribution, reverse engineering, or violation of these terms may result in license revocation." })
2182
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-gray-800 mb-2", children: t("activationWizard.termsOfService", "Terms of Service") }),
2183
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: t(
2184
+ "activationWizard.byActivatingThisLicenseYou",
2185
+ "By activating this license, you agree to the Nice2Dev Software License Agreement. This license grants you the right to use the software on the specified number of machines according to your license tier. Unauthorized redistribution, reverse engineering, or violation of these terms may result in license revocation."
2186
+ ) })
2152
2187
  ] }),
2153
2188
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [
2154
2189
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2161,7 +2196,7 @@ const ActivationWizard = (props) => {
2161
2196
  }
2162
2197
  ),
2163
2198
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-gray-700", children: [
2164
- "I accept the",
2199
+ t("activationWizard.iAcceptThe", "I accept the"),
2165
2200
  " ",
2166
2201
  config.termsUrl ? /* @__PURE__ */ jsxRuntime.jsx(
2167
2202
  "a",
@@ -2170,12 +2205,12 @@ const ActivationWizard = (props) => {
2170
2205
  className: "text-blue-500 hover:underline",
2171
2206
  target: "_blank",
2172
2207
  rel: "noopener noreferrer",
2173
- children: "Terms of Service"
2208
+ children: t("activationWizard.termsOfService", "Terms of Service")
2174
2209
  }
2175
- ) : "Terms of Service",
2210
+ ) : t("activationWizard.termsOfService", "Terms of Service"),
2176
2211
  config.privacyUrl && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2177
2212
  " ",
2178
- "and",
2213
+ t("activationWizard.and", "and"),
2179
2214
  " ",
2180
2215
  /* @__PURE__ */ jsxRuntime.jsx(
2181
2216
  "a",
@@ -2184,7 +2219,7 @@ const ActivationWizard = (props) => {
2184
2219
  className: "text-blue-500 hover:underline",
2185
2220
  target: "_blank",
2186
2221
  rel: "noopener noreferrer",
2187
- children: "Privacy Policy"
2222
+ children: t("activationWizard.privacyPolicy", "Privacy Policy")
2188
2223
  }
2189
2224
  )
2190
2225
  ] })
@@ -2197,7 +2232,7 @@ const ActivationWizard = (props) => {
2197
2232
  {
2198
2233
  onClick: goBack,
2199
2234
  className: "px-6 py-3 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2200
- children: "Back"
2235
+ children: t("activationWizard.back", "Back")
2201
2236
  }
2202
2237
  ),
2203
2238
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2206,31 +2241,37 @@ const ActivationWizard = (props) => {
2206
2241
  onClick: acceptTermsAndActivate,
2207
2242
  disabled: !state.termsAccepted,
2208
2243
  className: "flex-1 px-6 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:bg-gray-300 disabled:cursor-not-allowed",
2209
- children: "Activate License"
2244
+ children: t("activationWizard.activateLicense", "Activate License")
2210
2245
  }
2211
2246
  )
2212
2247
  ] })
2213
2248
  ] }),
2214
2249
  state.step === "activating" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", children: [
2215
2250
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto" }),
2216
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: "Activating License..." }),
2217
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: "Please wait while we activate your license" })
2251
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: t("activationWizard.activatingLicense", "Activating License...") }),
2252
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: t(
2253
+ "activationWizard.pleaseWaitWhileWeActivate",
2254
+ "Please wait while we activate your license"
2255
+ ) })
2218
2256
  ] }),
2219
2257
  state.step === "success" && state.activatedLicense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-6", children: [
2220
2258
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-green-500 text-6xl", children: /* @__PURE__ */ jsxRuntime.jsx(marks.CheckMark, {}) }),
2221
2259
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2222
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold text-gray-900", children: "License Activated!" }),
2223
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: "Your license has been successfully activated on this machine." })
2260
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold text-gray-900", children: t("activationWizard.licenseActivated", "License Activated!") }),
2261
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: t(
2262
+ "activationWizard.yourLicenseHasBeenSuccessfully",
2263
+ "Your license has been successfully activated on this machine."
2264
+ ) })
2224
2265
  ] }),
2225
2266
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-green-50 rounded-lg p-4 text-left", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 text-sm", children: [
2226
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "License Key:" }),
2267
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.licenseKey2", "License Key:") }),
2227
2268
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: state.activatedLicense.key }),
2228
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Tier:" }),
2269
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.tier", "Tier:") }),
2229
2270
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "capitalize", children: state.activatedLicense.tier }),
2230
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Machine:" }),
2271
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.machine", "Machine:") }),
2231
2272
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: state.machineName }),
2232
2273
  state.activatedLicense.expiresAt && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2233
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Expires:" }),
2274
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.expires", "Expires:") }),
2234
2275
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: new Date(state.activatedLicense.expiresAt).toLocaleDateString() })
2235
2276
  ] })
2236
2277
  ] }) }),
@@ -2243,15 +2284,18 @@ const ActivationWizard = (props) => {
2243
2284
  (_a2 = config.onCancel) == null ? void 0 : _a2.call(config);
2244
2285
  },
2245
2286
  className: "px-8 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
2246
- children: "Done"
2287
+ children: t("activationWizard.done", "Done")
2247
2288
  }
2248
2289
  )
2249
2290
  ] }),
2250
2291
  state.offlineChallenge && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg p-6 max-w-md w-full", children: [
2251
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold mb-4", children: "Offline Activation" }),
2292
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold mb-4", children: t("activationWizard.offlineActivation", "Offline Activation") }),
2252
2293
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
2253
2294
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2254
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Challenge Code (send this to support):" }),
2295
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t(
2296
+ "activationWizard.challengeCodeSendThisTo",
2297
+ "Challenge Code (send this to support):"
2298
+ ) }),
2255
2299
  /* @__PURE__ */ jsxRuntime.jsx(
2256
2300
  "textarea",
2257
2301
  {
@@ -2262,13 +2306,16 @@ const ActivationWizard = (props) => {
2262
2306
  )
2263
2307
  ] }),
2264
2308
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2265
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Response Code (from support):" }),
2309
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t("activationWizard.responseCodeFromSupport", "Response Code (from support):") }),
2266
2310
  /* @__PURE__ */ jsxRuntime.jsx(
2267
2311
  "textarea",
2268
2312
  {
2269
2313
  value: offlineResponse,
2270
2314
  onChange: (e) => setOfflineResponse(e.target.value),
2271
- placeholder: "Paste the response code here...",
2315
+ placeholder: t(
2316
+ "activationWizard.pasteTheResponseCodeHere",
2317
+ "Paste the response code here..."
2318
+ ),
2272
2319
  className: "w-full px-3 py-2 border border-gray-300 rounded font-mono text-xs h-20"
2273
2320
  }
2274
2321
  )
@@ -2281,7 +2328,7 @@ const ActivationWizard = (props) => {
2281
2328
  },
2282
2329
  disabled: !offlineResponse,
2283
2330
  className: "flex-1 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:bg-gray-300",
2284
- children: "Activate"
2331
+ children: t("activationWizard.activate", "Activate")
2285
2332
  }
2286
2333
  ),
2287
2334
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2291,7 +2338,7 @@ const ActivationWizard = (props) => {
2291
2338
  setOfflineResponse("");
2292
2339
  },
2293
2340
  className: "px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",
2294
- children: "Cancel"
2341
+ children: t("activationWizard.cancel", "Cancel")
2295
2342
  }
2296
2343
  )
2297
2344
  ] })
@@ -2316,6 +2363,7 @@ class LicenseTransferService {
2316
2363
  const error = await response.json().catch(() => ({}));
2317
2364
  throw {
2318
2365
  code: `HTTP_${response.status}`,
2366
+ // audit-allow: i18n — the service's fallback in the thrown TransferError (API contract)
2319
2367
  message: error.message || "Request failed"
2320
2368
  };
2321
2369
  }
@@ -2411,6 +2459,7 @@ const TRANSFER_REASONS = [
2411
2459
  { value: "other", label: "Other" }
2412
2460
  ];
2413
2461
  function useLicenseTransfer(config) {
2462
+ const { t } = uiCore.useNiceTranslation();
2414
2463
  const [step, setStep] = React.useState("select-license");
2415
2464
  const [licenses, setLicenses] = React.useState([]);
2416
2465
  const [formData, setFormData] = React.useState({
@@ -2481,7 +2530,13 @@ function useLicenseTransfer(config) {
2481
2530
  const initiateTransfer = React.useCallback(async () => {
2482
2531
  var _a, _b;
2483
2532
  if (!formData.confirmDeactivation) {
2484
- setError({ code: "CONFIRMATION_REQUIRED", message: "Please confirm license deactivation" });
2533
+ setError({
2534
+ code: "CONFIRMATION_REQUIRED",
2535
+ message: t(
2536
+ "licenseTransfer.pleaseConfirmLicenseDeactivation",
2537
+ "Please confirm license deactivation"
2538
+ )
2539
+ });
2485
2540
  return;
2486
2541
  }
2487
2542
  setStep("processing");
@@ -2505,7 +2560,7 @@ function useLicenseTransfer(config) {
2505
2560
  } finally {
2506
2561
  setLoading(false);
2507
2562
  }
2508
- }, [formData, service, config]);
2563
+ }, [formData, service, config, t]);
2509
2564
  const reset = React.useCallback(() => {
2510
2565
  setStep("select-license");
2511
2566
  setFormData({
@@ -2540,19 +2595,23 @@ function useLicenseTransfer(config) {
2540
2595
  reset
2541
2596
  };
2542
2597
  }
2543
- const TransferStatusBadge = ({ status }) => /* @__PURE__ */ jsxRuntime.jsx(
2544
- "span",
2545
- {
2546
- className: "inline-flex items-center px-2.5 py-1 rounded-full text-sm font-medium",
2547
- style: {
2548
- backgroundColor: `${getTransferStatusColor(status)}20`,
2549
- color: getTransferStatusColor(status)
2550
- },
2551
- children: getTransferStatusLabel(status)
2552
- }
2553
- );
2598
+ const TransferStatusBadge = ({ status }) => {
2599
+ const { t } = uiCore.useNiceTranslation();
2600
+ return /* @__PURE__ */ jsxRuntime.jsx(
2601
+ "span",
2602
+ {
2603
+ className: "inline-flex items-center px-2.5 py-1 rounded-full text-sm font-medium",
2604
+ style: {
2605
+ backgroundColor: `${getTransferStatusColor(status)}20`,
2606
+ color: getTransferStatusColor(status)
2607
+ },
2608
+ children: t(`licenseTransfer.status.${status}`, getTransferStatusLabel(status))
2609
+ }
2610
+ );
2611
+ };
2554
2612
  const LicenseTransfer = (props) => {
2555
2613
  var _a, _b;
2614
+ const { t } = uiCore.useNiceTranslation();
2556
2615
  const { className, style, ...config } = props;
2557
2616
  const {
2558
2617
  step,
@@ -2581,12 +2640,15 @@ const LicenseTransfer = (props) => {
2581
2640
  className: `nice-license-transfer bg-white rounded-lg shadow-lg p-8 max-w-2xl mx-auto ${className || ""}`,
2582
2641
  style,
2583
2642
  children: [
2584
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-2", children: "Transfer License" }),
2585
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mb-6", children: "Transfer a license to another user or organization" }),
2643
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-2", children: t("licenseTransfer.transferLicense", "Transfer License") }),
2644
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mb-6", children: t(
2645
+ "licenseTransfer.transferALicenseToAnother",
2646
+ "Transfer a license to another user or organization"
2647
+ ) }),
2586
2648
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-700", children: error.message }) }),
2587
2649
  step === "select-license" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
2588
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: "Select a license to transfer" }),
2589
- loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin h-8 w-8 border-b-2 border-blue-500 rounded-full mx-auto" }) }) : licenses.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-gray-500", children: "No transferable licenses found" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4", children: licenses.map((license) => /* @__PURE__ */ jsxRuntime.jsxs(
2650
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: t("licenseTransfer.selectALicenseToTransfer", "Select a license to transfer") }),
2651
+ loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin h-8 w-8 border-b-2 border-blue-500 rounded-full mx-auto" }) }) : licenses.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-gray-500", children: t("licenseTransfer.noTransferableLicensesFound", "No transferable licenses found") }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4", children: licenses.map((license) => /* @__PURE__ */ jsxRuntime.jsxs(
2590
2652
  "div",
2591
2653
  {
2592
2654
  className: "p-4 border border-gray-200 rounded-lg hover:border-blue-500 cursor-pointer transition-colors",
@@ -2599,12 +2661,7 @@ const LicenseTransfer = (props) => {
2599
2661
  ] }),
2600
2662
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 py-1 bg-blue-100 text-blue-700 rounded text-sm capitalize", children: license.tier })
2601
2663
  ] }),
2602
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 text-sm text-gray-500", children: [
2603
- license.activeSeats,
2604
- "/",
2605
- license.maxSeats ?? "∞",
2606
- " seats used"
2607
- ] })
2664
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 text-sm text-gray-500", children: t("licenseTransfer.seatsUsed", "{activeSeats}/{maxSeats} seats used").replace("{activeSeats}", String(license.activeSeats)).replace("{maxSeats}", String(license.maxSeats ?? "∞")) })
2608
2665
  ]
2609
2666
  },
2610
2667
  license.key
@@ -2612,11 +2669,11 @@ const LicenseTransfer = (props) => {
2612
2669
  ] }),
2613
2670
  step === "enter-recipient" && selectedLicense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2614
2671
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 bg-gray-50 rounded-lg", children: [
2615
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Transferring license:" }),
2672
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licenseTransfer.transferringLicense", "Transferring license:") }),
2616
2673
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: selectedLicense.key })
2617
2674
  ] }),
2618
2675
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2619
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Recipient Email" }),
2676
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.recipientEmail", "Recipient Email") }),
2620
2677
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
2621
2678
  /* @__PURE__ */ jsxRuntime.jsx(
2622
2679
  "input",
@@ -2625,7 +2682,7 @@ const LicenseTransfer = (props) => {
2625
2682
  value: formData.recipientEmail,
2626
2683
  onChange: (e) => setFormData((f) => ({ ...f, recipientEmail: e.target.value })),
2627
2684
  onBlur: validateRecipient,
2628
- placeholder: "recipient@company.com",
2685
+ placeholder: t("licenseTransfer.recipientCompanyCom", "recipient@company.com"),
2629
2686
  className: "flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
2630
2687
  }
2631
2688
  ),
@@ -2635,7 +2692,7 @@ const LicenseTransfer = (props) => {
2635
2692
  onClick: validateRecipient,
2636
2693
  disabled: !formData.recipientEmail || loading,
2637
2694
  className: "px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 disabled:opacity-50",
2638
- children: "Validate"
2695
+ children: t("licenseTransfer.validate", "Validate")
2639
2696
  }
2640
2697
  )
2641
2698
  ] }),
@@ -2644,28 +2701,28 @@ const LicenseTransfer = (props) => {
2644
2701
  {
2645
2702
  className: `mt-2 text-sm ${recipientValidation.valid ? "text-green-600" : "text-red-600"}`,
2646
2703
  children: [
2647
- recipientValidation.valid ? "Valid recipient" : "Invalid recipient",
2648
- recipientValidation.isExternal && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-orange-600", children: "(External organization)" })
2704
+ recipientValidation.valid ? t("licenseTransfer.validRecipient", "Valid recipient") : t("licenseTransfer.invalidRecipient", "Invalid recipient"),
2705
+ recipientValidation.isExternal && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-orange-600", children: t("licenseTransfer.externalOrganization", "(External organization)") })
2649
2706
  ]
2650
2707
  }
2651
2708
  ),
2652
2709
  (_a = recipientValidation == null ? void 0 : recipientValidation.warnings) == null ? void 0 : _a.map((warning, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-sm text-orange-600", children: warning }, i))
2653
2710
  ] }),
2654
2711
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2655
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Recipient Name" }),
2712
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.recipientName", "Recipient Name") }),
2656
2713
  /* @__PURE__ */ jsxRuntime.jsx(
2657
2714
  "input",
2658
2715
  {
2659
2716
  type: "text",
2660
2717
  value: formData.recipientName,
2661
2718
  onChange: (e) => setFormData((f) => ({ ...f, recipientName: e.target.value })),
2662
- placeholder: "John Doe",
2719
+ placeholder: t("licenseTransfer.johnDoe", "John Doe"),
2663
2720
  className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
2664
2721
  }
2665
2722
  )
2666
2723
  ] }),
2667
2724
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2668
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Transfer Reason" }),
2725
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.transferReason", "Transfer Reason") }),
2669
2726
  /* @__PURE__ */ jsxRuntime.jsx(
2670
2727
  "select",
2671
2728
  {
@@ -2675,18 +2732,21 @@ const LicenseTransfer = (props) => {
2675
2732
  transferReason: e.target.value
2676
2733
  })),
2677
2734
  className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500",
2678
- children: TRANSFER_REASONS.map((reason) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: reason.value, children: reason.label }, reason.value))
2735
+ children: TRANSFER_REASONS.map((reason) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: reason.value, children: t(`licenseTransfer.reason.${reason.value}`, reason.label) }, reason.value))
2679
2736
  }
2680
2737
  )
2681
2738
  ] }),
2682
2739
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2683
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Notes (optional)" }),
2740
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.notesOptional", "Notes (optional)") }),
2684
2741
  /* @__PURE__ */ jsxRuntime.jsx(
2685
2742
  "textarea",
2686
2743
  {
2687
2744
  value: formData.notes,
2688
2745
  onChange: (e) => setFormData((f) => ({ ...f, notes: e.target.value })),
2689
- placeholder: "Any additional information...",
2746
+ placeholder: t(
2747
+ "licenseTransfer.anyAdditionalInformation",
2748
+ "Any additional information..."
2749
+ ),
2690
2750
  rows: 3,
2691
2751
  className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
2692
2752
  }
@@ -2698,7 +2758,7 @@ const LicenseTransfer = (props) => {
2698
2758
  {
2699
2759
  onClick: () => setStep("select-license"),
2700
2760
  className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2701
- children: "Back"
2761
+ children: t("licenseTransfer.back", "Back")
2702
2762
  }
2703
2763
  ),
2704
2764
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2707,36 +2767,42 @@ const LicenseTransfer = (props) => {
2707
2767
  onClick: proceedToReview,
2708
2768
  disabled: !(recipientValidation == null ? void 0 : recipientValidation.valid) || !formData.recipientName,
2709
2769
  className: "flex-1 px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:bg-gray-300",
2710
- children: "Review Transfer"
2770
+ children: t("licenseTransfer.reviewTransfer", "Review Transfer")
2711
2771
  }
2712
2772
  )
2713
2773
  ] })
2714
2774
  ] }),
2715
2775
  step === "review" && selectedLicense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2716
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: "Review Transfer Details" }),
2776
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: t("licenseTransfer.reviewTransferDetails", "Review Transfer Details") }),
2717
2777
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-gray-50 rounded-lg p-4 space-y-3", children: [
2718
2778
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 text-sm", children: [
2719
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "License Key:" }),
2779
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.licenseKey", "License Key:") }),
2720
2780
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: selectedLicense.key }),
2721
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Current Licensee:" }),
2781
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.currentLicensee", "Current Licensee:") }),
2722
2782
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: selectedLicense.licensee }),
2723
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Tier:" }),
2783
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.tier", "Tier:") }),
2724
2784
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "capitalize", children: selectedLicense.tier }),
2725
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Transfer To:" }),
2785
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.transferTo", "Transfer To:") }),
2726
2786
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: formData.recipientName }),
2727
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Recipient Email:" }),
2787
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.recipientEmail2", "Recipient Email:") }),
2728
2788
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: formData.recipientEmail }),
2729
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Reason:" }),
2730
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: (_b = TRANSFER_REASONS.find((r) => r.value === formData.transferReason)) == null ? void 0 : _b.label })
2789
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.reason", "Reason:") }),
2790
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: t(
2791
+ `licenseTransfer.reason.${formData.transferReason}`,
2792
+ ((_b = TRANSFER_REASONS.find((r) => r.value === formData.transferReason)) == null ? void 0 : _b.label) ?? formData.transferReason
2793
+ ) })
2731
2794
  ] }),
2732
2795
  formData.notes && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-gray-200", children: [
2733
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500 mb-1", children: "Notes:" }),
2796
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500 mb-1", children: t("licenseTransfer.notes", "Notes:") }),
2734
2797
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", children: formData.notes })
2735
2798
  ] })
2736
2799
  ] }),
2737
2800
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 bg-orange-50 border border-orange-200 rounded-lg", children: [
2738
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: "Important" }),
2739
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-orange-700", children: "Once the transfer is completed, this license will be deactivated from all your machines and the new owner will need to activate it." })
2801
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: t("licenseTransfer.important", "Important") }),
2802
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-orange-700", children: t(
2803
+ "licenseTransfer.onceTheTransferIsCompleted",
2804
+ "Once the transfer is completed, this license will be deactivated from all your machines and the new owner will need to activate it."
2805
+ ) })
2740
2806
  ] }),
2741
2807
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [
2742
2808
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2748,7 +2814,10 @@ const LicenseTransfer = (props) => {
2748
2814
  className: "mt-1 w-4 h-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500"
2749
2815
  }
2750
2816
  ),
2751
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700", children: "I understand that this license will be deactivated and transferred to the recipient. This action cannot be undone without admin intervention." })
2817
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700", children: t(
2818
+ "licenseTransfer.iUnderstandThatThisLicense",
2819
+ "I understand that this license will be deactivated and transferred to the recipient. This action cannot be undone without admin intervention."
2820
+ ) })
2752
2821
  ] }),
2753
2822
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3", children: [
2754
2823
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2756,7 +2825,7 @@ const LicenseTransfer = (props) => {
2756
2825
  {
2757
2826
  onClick: () => setStep("enter-recipient"),
2758
2827
  className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2759
- children: "Back"
2828
+ children: t("licenseTransfer.back", "Back")
2760
2829
  }
2761
2830
  ),
2762
2831
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2765,28 +2834,37 @@ const LicenseTransfer = (props) => {
2765
2834
  onClick: initiateTransfer,
2766
2835
  disabled: !formData.confirmDeactivation || loading,
2767
2836
  className: "flex-1 px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:bg-gray-300",
2768
- children: loading ? "Processing..." : "Initiate Transfer"
2837
+ children: loading ? t("licenseTransfer.processing", "Processing...") : t("licenseTransfer.initiateTransfer", "Initiate Transfer")
2769
2838
  }
2770
2839
  )
2771
2840
  ] })
2772
2841
  ] }),
2773
2842
  step === "processing" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-12", children: [
2774
2843
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin h-12 w-12 border-b-2 border-blue-500 rounded-full mx-auto" }),
2775
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: "Processing Transfer..." }),
2776
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500", children: "Please wait while we process your transfer request" })
2844
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: t("licenseTransfer.processingTransfer", "Processing Transfer...") }),
2845
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500", children: t(
2846
+ "licenseTransfer.pleaseWaitWhileWeProcess",
2847
+ "Please wait while we process your transfer request"
2848
+ ) })
2777
2849
  ] }),
2778
2850
  step === "complete" && transfer && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-6", children: [
2779
2851
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-green-500 text-6xl", children: /* @__PURE__ */ jsxRuntime.jsx(marks.CheckMark, {}) }),
2780
2852
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2781
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold", children: "Transfer Initiated" }),
2782
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: transfer.approvalRequired ? "Your transfer request has been submitted for approval." : "An email has been sent to the recipient with instructions to accept the transfer." })
2853
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold", children: t("licenseTransfer.transferInitiated", "Transfer Initiated") }),
2854
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: transfer.approvalRequired ? t(
2855
+ "licenseTransfer.yourTransferRequestHasBeen",
2856
+ "Your transfer request has been submitted for approval."
2857
+ ) : t(
2858
+ "licenseTransfer.anEmailHasBeenSent",
2859
+ "An email has been sent to the recipient with instructions to accept the transfer."
2860
+ ) })
2783
2861
  ] }),
2784
2862
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-gray-50 rounded-lg p-4 text-left", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm grid grid-cols-2 gap-2", children: [
2785
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Transfer ID:" }),
2863
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.transferId", "Transfer ID:") }),
2786
2864
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: transfer.id }),
2787
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Status:" }),
2865
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.status", "Status:") }),
2788
2866
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(TransferStatusBadge, { status: transfer.status }) }),
2789
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Expires:" }),
2867
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.expires", "Expires:") }),
2790
2868
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: new Date(transfer.expiresAt).toLocaleDateString() })
2791
2869
  ] }) }),
2792
2870
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2794,7 +2872,7 @@ const LicenseTransfer = (props) => {
2794
2872
  {
2795
2873
  onClick: reset,
2796
2874
  className: "px-8 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
2797
- children: "Done"
2875
+ children: t("licenseTransfer.done", "Done")
2798
2876
  }
2799
2877
  )
2800
2878
  ] })
@@ -3218,13 +3296,14 @@ const MetricCard = ({ title, value, change, suffix, loading }) => /* @__PURE__ *
3218
3296
  ] })
3219
3297
  ] });
3220
3298
  const TimeRangeSelector = ({ value, onChange }) => {
3299
+ const { t } = uiCore.useNiceTranslation();
3221
3300
  const options = [
3222
- { value: "24h", label: "24 Hours" },
3223
- { value: "7d", label: "7 Days" },
3224
- { value: "30d", label: "30 Days" },
3225
- { value: "90d", label: "90 Days" },
3226
- { value: "1y", label: "1 Year" },
3227
- { value: "all", label: "All Time" }
3301
+ { value: "24h", label: t("usageAnalyticsDashboard.n24Hours", "24 Hours") },
3302
+ { value: "7d", label: t("usageAnalyticsDashboard.n7Days", "7 Days") },
3303
+ { value: "30d", label: t("usageAnalyticsDashboard.n30Days", "30 Days") },
3304
+ { value: "90d", label: t("usageAnalyticsDashboard.n90Days", "90 Days") },
3305
+ { value: "1y", label: t("usageAnalyticsDashboard.n1Year", "1 Year") },
3306
+ { value: "all", label: t("usageAnalyticsDashboard.allTime", "All Time") }
3228
3307
  ];
3229
3308
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1 bg-gray-100 rounded-lg p-1", children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
3230
3309
  "button",
@@ -3236,93 +3315,101 @@ const TimeRangeSelector = ({ value, onChange }) => {
3236
3315
  opt.value
3237
3316
  )) });
3238
3317
  };
3239
- const FeatureUsageTable = ({ data, loading }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
3240
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Feature Usage" }) }),
3241
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
3242
- /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3243
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: "Feature" }),
3244
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Total Uses" }),
3245
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Users" }),
3246
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Avg/User" }),
3247
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Trend" })
3248
- ] }) }),
3249
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: "Loading..." }) }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: "No data available" }) }) : data.map((feature) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
3250
- /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
3251
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: feature.featureName }),
3252
- feature.category && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: feature.category })
3318
+ const FeatureUsageTable = ({ data, loading }) => {
3319
+ const { t } = uiCore.useNiceTranslation();
3320
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
3321
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("usageAnalyticsDashboard.featureUsage", "Feature Usage") }) }),
3322
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
3323
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3324
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.feature", "Feature") }),
3325
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.totalUses", "Total Uses") }),
3326
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.users2", "Users") }),
3327
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.avgUser", "Avg/User") }),
3328
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.trend", "Trend") })
3329
+ ] }) }),
3330
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: t("usageAnalyticsDashboard.loading", "Loading...") }) }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: t("usageAnalyticsDashboard.noDataAvailable", "No data available") }) }) : data.map((feature) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
3331
+ /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
3332
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: feature.featureName }),
3333
+ feature.category && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: feature.category })
3334
+ ] }),
3335
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.totalUses.toLocaleString() }),
3336
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.uniqueUsers.toLocaleString() }),
3337
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.avgUsesPerUser.toFixed(1) }),
3338
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsxs(
3339
+ "span",
3340
+ {
3341
+ className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${feature.trend > 0 ? "bg-green-100 text-green-800" : feature.trend < 0 ? "bg-red-100 text-red-800" : "bg-gray-100 text-gray-800"}`,
3342
+ children: [
3343
+ feature.trend > 0 ? "+" : "",
3344
+ feature.trend.toFixed(1),
3345
+ "%"
3346
+ ]
3347
+ }
3348
+ ) })
3349
+ ] }, feature.featureId)) })
3350
+ ] }) })
3351
+ ] });
3352
+ };
3353
+ const TopUsersTable = ({ data, loading }) => {
3354
+ const { t } = uiCore.useNiceTranslation();
3355
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
3356
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("usageAnalyticsDashboard.topActiveUsers", "Top Active Users") }) }),
3357
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
3358
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3359
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.user", "User") }),
3360
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.sessions", "Sessions") }),
3361
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.duration", "Duration") }),
3362
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.features", "Features") }),
3363
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.lastActive", "Last Active") })
3364
+ ] }) }),
3365
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: t("usageAnalyticsDashboard.loading", "Loading...") }) }) : data.map((user) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
3366
+ /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
3367
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: user.displayName || user.email }),
3368
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500 capitalize", children: user.tier })
3369
+ ] }),
3370
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.sessionCount.toLocaleString() }),
3371
+ /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3 text-right font-mono", children: [
3372
+ Math.round(user.totalDuration / 60),
3373
+ "h"
3374
+ ] }),
3375
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.featuresUsed }),
3376
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-sm text-gray-500", children: new Date(user.lastActive).toLocaleDateString() })
3377
+ ] }, user.userId)) })
3378
+ ] }) })
3379
+ ] });
3380
+ };
3381
+ const LicenseUtilizationChart = ({ data, loading }) => {
3382
+ const { t } = uiCore.useNiceTranslation();
3383
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
3384
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("usageAnalyticsDashboard.licenseUtilization", "License Utilization") }) }),
3385
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 space-y-4", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-gray-500", children: t("usageAnalyticsDashboard.loading", "Loading...") }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-gray-500", children: t("usageAnalyticsDashboard.noLicenses", "No licenses") }) : data.map((license) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3386
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm mb-1", children: [
3387
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium truncate max-w-[200px]", children: license.licensee }),
3388
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: t("usageAnalyticsDashboard.seats", "{usedSeats}/{totalSeats} seats").replace("{usedSeats}", String(license.usedSeats)).replace("{totalSeats}", String(license.totalSeats)) })
3253
3389
  ] }),
3254
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.totalUses.toLocaleString() }),
3255
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.uniqueUsers.toLocaleString() }),
3256
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.avgUsesPerUser.toFixed(1) }),
3257
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsxs(
3258
- "span",
3390
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-2 bg-gray-100 rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
3391
+ "div",
3259
3392
  {
3260
- className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${feature.trend > 0 ? "bg-green-100 text-green-800" : feature.trend < 0 ? "bg-red-100 text-red-800" : "bg-gray-100 text-gray-800"}`,
3261
- children: [
3262
- feature.trend > 0 ? "+" : "",
3263
- feature.trend.toFixed(1),
3264
- "%"
3265
- ]
3393
+ className: `h-full rounded-full ${license.utilizationPercent >= 90 ? "bg-red-500" : license.utilizationPercent >= 70 ? "bg-yellow-500" : "bg-green-500"}`,
3394
+ style: { width: `${license.utilizationPercent}%` }
3266
3395
  }
3267
3396
  ) })
3268
- ] }, feature.featureId)) })
3269
- ] }) })
3270
- ] });
3271
- const TopUsersTable = ({ data, loading }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
3272
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Top Active Users" }) }),
3273
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
3274
- /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3275
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: "User" }),
3276
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Sessions" }),
3277
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Duration" }),
3278
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Features" }),
3279
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: "Last Active" })
3280
- ] }) }),
3281
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: "Loading..." }) }) : data.map((user) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
3282
- /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
3283
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: user.displayName || user.email }),
3284
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500 capitalize", children: user.tier })
3285
- ] }),
3286
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.sessionCount.toLocaleString() }),
3287
- /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3 text-right font-mono", children: [
3288
- Math.round(user.totalDuration / 60),
3289
- "h"
3290
- ] }),
3291
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.featuresUsed }),
3292
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-sm text-gray-500", children: new Date(user.lastActive).toLocaleDateString() })
3293
- ] }, user.userId)) })
3294
- ] }) })
3295
- ] });
3296
- const LicenseUtilizationChart = ({ data, loading }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
3297
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "License Utilization" }) }),
3298
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 space-y-4", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-gray-500", children: "Loading..." }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-gray-500", children: "No licenses" }) : data.map((license) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3299
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm mb-1", children: [
3300
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium truncate max-w-[200px]", children: license.licensee }),
3301
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-gray-500", children: [
3302
- license.usedSeats,
3303
- "/",
3304
- license.totalSeats,
3305
- " seats"
3306
- ] })
3307
- ] }),
3308
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-2 bg-gray-100 rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
3309
- "div",
3310
- {
3311
- className: `h-full rounded-full ${license.utilizationPercent >= 90 ? "bg-red-500" : license.utilizationPercent >= 70 ? "bg-yellow-500" : "bg-green-500"}`,
3312
- style: { width: `${license.utilizationPercent}%` }
3313
- }
3314
- ) })
3315
- ] }, license.licenseKey)) })
3316
- ] });
3397
+ ] }, license.licenseKey)) })
3398
+ ] });
3399
+ };
3317
3400
  const UsageAnalyticsDashboard = (props) => {
3318
3401
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
3402
+ const { t } = uiCore.useNiceTranslation();
3319
3403
  const { className, style, ...config } = props;
3320
3404
  const { state, setTimeRange, refresh, exportData } = useUsageAnalytics(config);
3321
3405
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-usage-analytics ${className || ""}`, style, children: [
3322
3406
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
3323
3407
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3324
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: "Usage Analytics" }),
3325
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: "Monitor license usage and feature adoption" })
3408
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("usageAnalyticsDashboard.usageAnalytics", "Usage Analytics") }),
3409
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: t(
3410
+ "usageAnalyticsDashboard.monitorLicenseUsageAndFeature",
3411
+ "Monitor license usage and feature adoption"
3412
+ ) })
3326
3413
  ] }),
3327
3414
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
3328
3415
  /* @__PURE__ */ jsxRuntime.jsx(TimeRangeSelector, { value: state.timeRange, onChange: setTimeRange }),
@@ -3331,7 +3418,7 @@ const UsageAnalyticsDashboard = (props) => {
3331
3418
  {
3332
3419
  onClick: () => refresh(),
3333
3420
  className: "p-2 text-gray-500 hover:text-gray-700 rounded-lg hover:bg-gray-100",
3334
- title: "Refresh",
3421
+ title: t("usageAnalyticsDashboard.refresh", "Refresh"),
3335
3422
  children: /* @__PURE__ */ jsxRuntime.jsx(marks.RefreshMark, {})
3336
3423
  }
3337
3424
  ),
@@ -3340,7 +3427,7 @@ const UsageAnalyticsDashboard = (props) => {
3340
3427
  {
3341
3428
  className: "px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
3342
3429
  onClick: () => exportData("csv"),
3343
- children: "Export"
3430
+ children: t("usageAnalyticsDashboard.export", "Export")
3344
3431
  }
3345
3432
  ) })
3346
3433
  ] })
@@ -3350,7 +3437,7 @@ const UsageAnalyticsDashboard = (props) => {
3350
3437
  /* @__PURE__ */ jsxRuntime.jsx(
3351
3438
  MetricCard,
3352
3439
  {
3353
- title: "Active Licenses",
3440
+ title: t("usageAnalyticsDashboard.activeLicenses", "Active Licenses"),
3354
3441
  value: ((_a = state.overview) == null ? void 0 : _a.activeLicenses) ?? 0,
3355
3442
  change: (_b = state.overview) == null ? void 0 : _b.activeLicensesChange,
3356
3443
  loading: state.loading
@@ -3359,7 +3446,7 @@ const UsageAnalyticsDashboard = (props) => {
3359
3446
  /* @__PURE__ */ jsxRuntime.jsx(
3360
3447
  MetricCard,
3361
3448
  {
3362
- title: "Active Users",
3449
+ title: t("usageAnalyticsDashboard.activeUsers", "Active Users"),
3363
3450
  value: ((_c = state.overview) == null ? void 0 : _c.activeUsers) ?? 0,
3364
3451
  change: (_d = state.overview) == null ? void 0 : _d.activeUsersChange,
3365
3452
  loading: state.loading
@@ -3368,7 +3455,7 @@ const UsageAnalyticsDashboard = (props) => {
3368
3455
  /* @__PURE__ */ jsxRuntime.jsx(
3369
3456
  MetricCard,
3370
3457
  {
3371
- title: "Feature Uses",
3458
+ title: t("usageAnalyticsDashboard.featureUses", "Feature Uses"),
3372
3459
  value: ((_e = state.overview) == null ? void 0 : _e.featureUses) ?? 0,
3373
3460
  change: (_f = state.overview) == null ? void 0 : _f.featureUsesChange,
3374
3461
  loading: state.loading
@@ -3377,7 +3464,7 @@ const UsageAnalyticsDashboard = (props) => {
3377
3464
  /* @__PURE__ */ jsxRuntime.jsx(
3378
3465
  MetricCard,
3379
3466
  {
3380
- title: "Avg Session",
3467
+ title: t("usageAnalyticsDashboard.avgSession", "Avg Session"),
3381
3468
  value: ((_h = (_g = state.overview) == null ? void 0 : _g.avgSessionDuration) == null ? void 0 : _h.toFixed(1)) ?? "0",
3382
3469
  suffix: "min",
3383
3470
  change: (_i = state.overview) == null ? void 0 : _i.avgSessionDurationChange,
@@ -3387,7 +3474,7 @@ const UsageAnalyticsDashboard = (props) => {
3387
3474
  /* @__PURE__ */ jsxRuntime.jsx(
3388
3475
  MetricCard,
3389
3476
  {
3390
- title: "Utilization",
3477
+ title: t("usageAnalyticsDashboard.utilization", "Utilization"),
3391
3478
  value: `${((_k = (_j = state.overview) == null ? void 0 : _j.utilizationRate) == null ? void 0 : _k.toFixed(0)) ?? 0}%`,
3392
3479
  change: (_l = state.overview) == null ? void 0 : _l.utilizationRateChange,
3393
3480
  loading: state.loading
@@ -3400,14 +3487,14 @@ const UsageAnalyticsDashboard = (props) => {
3400
3487
  ] }),
3401
3488
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntime.jsx(TopUsersTable, { data: state.topUsers, loading: state.loading }) }),
3402
3489
  state.geoData.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 p-4", children: [
3403
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: "Geographic Distribution" }),
3490
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("usageAnalyticsDashboard.geographicDistribution", "Geographic Distribution") }),
3404
3491
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4", children: state.geoData.slice(0, 6).map((geo) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
3405
3492
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl mb-1", children: getCountryFlag(geo.countryCode) }),
3406
3493
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium", children: geo.country }),
3407
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-gray-500", children: [
3408
- geo.users,
3409
- " users"
3410
- ] })
3494
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: t("usageAnalyticsDashboard.users", "{users} users").replace(
3495
+ "{users}",
3496
+ String(geo.users)
3497
+ ) })
3411
3498
  ] }, geo.countryCode)) })
3412
3499
  ] })
3413
3500
  ] });