@nice2dev/licensing 1.2.1 → 1.3.0

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,16 +1409,20 @@ 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(
1416
1421
  "div",
1417
1422
  {
1423
+ role: onSelect ? "button" : void 0,
1424
+ tabIndex: onSelect ? 0 : void 0,
1425
+ onKeyDown: onSelect ? uiCore.clickOnActivationKey : void 0,
1418
1426
  className: `rounded-lg border p-4 transition-all cursor-pointer hover:shadow-md ${selected ? "border-blue-500 ring-2 ring-blue-200" : "border-gray-200"}`,
1419
1427
  onClick: onSelect,
1420
1428
  children: [
@@ -1427,7 +1435,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1427
1435
  ] })
1428
1436
  ] }),
1429
1437
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-right text-sm", children: [
1430
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Seats" }),
1438
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licensePortal.seats", "Seats") }),
1431
1439
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-semibold", children: [
1432
1440
  license.activeSeats,
1433
1441
  "/",
@@ -1436,25 +1444,16 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1436
1444
  ] })
1437
1445
  ] }),
1438
1446
  /* @__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
- ] })
1447
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: t("licensePortal.licensee", "Licensee: {licensee}").replace(
1448
+ "{licensee}",
1449
+ String(license.licensee)
1450
+ ) }),
1451
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: t("licensePortal.email", "Email: {email}").replace("{email}", String(license.email)) })
1447
1452
  ] }),
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
- ] }) }),
1453
+ 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(
1454
+ "{expiresAt}",
1455
+ String(formatDate(license.expiresAt))
1456
+ ) }) }),
1458
1457
  (onActivate || onDeactivate) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 mt-3 pt-3 border-t", children: [
1459
1458
  onActivate && license.status === "valid" && /* @__PURE__ */ jsxRuntime.jsx(
1460
1459
  "button",
@@ -1464,7 +1463,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1464
1463
  e.stopPropagation();
1465
1464
  onActivate();
1466
1465
  },
1467
- children: "Activate"
1466
+ children: t("licensePortal.activate", "Activate")
1468
1467
  }
1469
1468
  ),
1470
1469
  onDeactivate && /* @__PURE__ */ jsxRuntime.jsx(
@@ -1475,7 +1474,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1475
1474
  e.stopPropagation();
1476
1475
  onDeactivate();
1477
1476
  },
1478
- children: "Deactivate"
1477
+ children: t("licensePortal.deactivate", "Deactivate")
1479
1478
  }
1480
1479
  )
1481
1480
  ] })
@@ -1484,24 +1483,25 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
1484
1483
  );
1485
1484
  };
1486
1485
  const LicensePortal = (props) => {
1486
+ const { t } = uiCore.useNiceTranslation();
1487
1487
  const { className, style, ...config } = props;
1488
1488
  const { state, activateLicense, deactivateLicense, selectLicense, setActiveTab, loadData } = useLicensePortal(config);
1489
1489
  if (state.loading) {
1490
1490
  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
1491
  /* @__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..." })
1492
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-3 text-gray-600", children: t("licensePortal.loadingLicenses", "Loading licenses...") })
1493
1493
  ] }) });
1494
1494
  }
1495
1495
  if (state.error) {
1496
1496
  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" }),
1497
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-red-800 font-semibold", children: t("licensePortal.errorLoadingLicenses", "Error loading licenses") }),
1498
1498
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-600 text-sm mt-1", children: state.error.message }),
1499
1499
  /* @__PURE__ */ jsxRuntime.jsx(
1500
1500
  "button",
1501
1501
  {
1502
1502
  className: "mt-3 px-4 py-2 bg-red-100 text-red-700 rounded hover:bg-red-200",
1503
1503
  onClick: loadData,
1504
- children: "Retry"
1504
+ children: t("licensePortal.retry", "Retry")
1505
1505
  }
1506
1506
  )
1507
1507
  ] }) });
@@ -1511,17 +1511,20 @@ const LicensePortal = (props) => {
1511
1511
  return null;
1512
1512
  }
1513
1513
  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" }
1514
+ { id: "overview", label: t("licensePortal.overview", "Overview") },
1515
+ { id: "licenses", label: t("licensePortal.licenses", "Licenses") },
1516
+ { id: "seats", label: t("licensePortal.seatManagement", "Seat Management") },
1517
+ ...config.showBilling ? [{ id: "billing", label: t("licensePortal.billing", "Billing") }] : [],
1518
+ ...config.showAnalytics ? [{ id: "analytics", label: t("licensePortal.analytics", "Analytics") }] : [],
1519
+ { id: "settings", label: t("licensePortal.settings", "Settings") }
1520
1520
  ];
1521
1521
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-license-portal ${className || ""}`, style, children: [
1522
1522
  /* @__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" })
1523
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("licensePortal.licensePortal", "License Portal") }),
1524
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: t(
1525
+ "licensePortal.manageYourNice2devLicensesAnd",
1526
+ "Manage your Nice2Dev licenses and subscriptions"
1527
+ ) })
1525
1528
  ] }),
1526
1529
  /* @__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
1530
  "button",
@@ -1535,15 +1538,15 @@ const LicensePortal = (props) => {
1535
1538
  state.activeTab === "overview" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
1536
1539
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-4", children: [
1537
1540
  /* @__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" }),
1541
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.totalLicenses", "Total Licenses") }),
1539
1542
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold", children: overview.totalLicenses })
1540
1543
  ] }),
1541
1544
  /* @__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" }),
1545
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.active", "Active") }),
1543
1546
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold text-green-600", children: overview.activeLicenses })
1544
1547
  ] }),
1545
1548
  /* @__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" }),
1549
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.seatsUsed", "Seats Used") }),
1547
1550
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-2xl font-bold", children: [
1548
1551
  overview.usedSeats,
1549
1552
  "/",
@@ -1551,22 +1554,22 @@ const LicensePortal = (props) => {
1551
1554
  ] })
1552
1555
  ] }),
1553
1556
  /* @__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" }),
1557
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.expiringSoon", "Expiring Soon") }),
1555
1558
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold text-orange-600", children: overview.expiringSoon.length })
1556
1559
  ] })
1557
1560
  ] }),
1558
1561
  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" }),
1562
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: t("licensePortal.licensesExpiringSoon", "Licenses Expiring Soon") }),
1560
1563
  /* @__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
1564
  /* @__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
- ] })
1565
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-orange-600", children: t("licensePortal.daysRemainingCount", "{days} days remaining").replace(
1566
+ "{days}",
1567
+ String(getDaysUntilExpiration(license.expiresAt))
1568
+ ) })
1566
1569
  ] }, license.key)) })
1567
1570
  ] }),
1568
1571
  /* @__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" }) }),
1572
+ /* @__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
1573
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-gray-100", children: [
1571
1574
  state.actionHistory.slice(0, 5).map((action) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex items-center justify-between", children: [
1572
1575
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -1575,7 +1578,7 @@ const LicensePortal = (props) => {
1575
1578
  ] }),
1576
1579
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: formatDate(action.timestamp) })
1577
1580
  ] }, action.id)),
1578
- state.actionHistory.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: "No recent activity" })
1581
+ state.actionHistory.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: t("licensePortal.noRecentActivity", "No recent activity") })
1579
1582
  ] })
1580
1583
  ] })
1581
1584
  ] }),
@@ -1598,18 +1601,21 @@ const LicensePortal = (props) => {
1598
1601
  license.key
1599
1602
  );
1600
1603
  }),
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." })
1604
+ overview.licenses.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full text-center py-8 text-gray-500", children: t(
1605
+ "licensePortal.noLicensesFoundContactSupport",
1606
+ "No licenses found. Contact support to purchase a license."
1607
+ ) })
1602
1608
  ] }),
1603
1609
  state.activeTab === "billing" && config.showBilling && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
1604
1610
  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" }),
1611
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("licensePortal.currentSubscription", "Current Subscription") }),
1606
1612
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
1607
1613
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1608
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Plan" }),
1614
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.plan", "Plan") }),
1609
1615
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.subscription.plan })
1610
1616
  ] }),
1611
1617
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1612
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Status" }),
1618
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.status", "Status") }),
1613
1619
  /* @__PURE__ */ jsxRuntime.jsx(
1614
1620
  "div",
1615
1621
  {
@@ -1619,7 +1625,7 @@ const LicensePortal = (props) => {
1619
1625
  )
1620
1626
  ] }),
1621
1627
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1622
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Current Period" }),
1628
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.currentPeriod", "Current Period") }),
1623
1629
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-medium", children: [
1624
1630
  formatDate(state.subscription.currentPeriodStart),
1625
1631
  " -",
@@ -1628,13 +1634,13 @@ const LicensePortal = (props) => {
1628
1634
  ] })
1629
1635
  ] }),
1630
1636
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1631
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Seats" }),
1637
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.seats", "Seats") }),
1632
1638
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.subscription.seats })
1633
1639
  ] })
1634
1640
  ] })
1635
1641
  ] }),
1636
1642
  /* @__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" }) }),
1643
+ /* @__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
1644
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-gray-100", children: [
1639
1645
  state.invoices.map((invoice) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex items-center justify-between", children: [
1640
1646
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -1661,20 +1667,23 @@ const LicensePortal = (props) => {
1661
1667
  className: "text-blue-500 hover:text-blue-600",
1662
1668
  target: "_blank",
1663
1669
  rel: "noopener noreferrer",
1664
- children: "Download"
1670
+ children: t("licensePortal.download", "Download")
1665
1671
  }
1666
1672
  )
1667
1673
  ] })
1668
1674
  ] }, invoice.id)),
1669
- state.invoices.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: "No invoices" })
1675
+ state.invoices.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: t("licensePortal.noInvoices", "No invoices") })
1670
1676
  ] })
1671
1677
  ] })
1672
1678
  ] }),
1673
1679
  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." })
1680
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("licensePortal.seatManagement", "Seat Management") }),
1681
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mb-4", children: t(
1682
+ "licensePortal.selectALicenseToManage",
1683
+ "Select a license to manage seat assignments."
1684
+ ) })
1676
1685
  ] }),
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" }) })
1686
+ 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
1687
  ] });
1679
1688
  };
1680
1689
  class ActivationService {
@@ -1692,6 +1701,7 @@ class ActivationService {
1692
1701
  const error = await response.json().catch(() => ({}));
1693
1702
  throw {
1694
1703
  code: `HTTP_${response.status}`,
1704
+ // audit-allow: i18n — the service's fallback in the thrown ActivationError (API contract)
1695
1705
  message: error.message || "Request failed",
1696
1706
  retryable: response.status >= 500,
1697
1707
  supportRequired: response.status === 403
@@ -1765,6 +1775,7 @@ async function getDefaultMachineName() {
1765
1775
  return "Unknown Device";
1766
1776
  }
1767
1777
  function useActivationWizard(config) {
1778
+ const { t } = uiCore.useNiceTranslation();
1768
1779
  const [state, setState] = React.useState({
1769
1780
  step: "enter-key",
1770
1781
  licenseKey: "",
@@ -1794,7 +1805,10 @@ function useActivationWizard(config) {
1794
1805
  ...s,
1795
1806
  error: {
1796
1807
  code: "INVALID_FORMAT",
1797
- message: "License key format is invalid. Expected format: XXXX-XXXX-XXXX-XXXX-XXXX",
1808
+ message: t(
1809
+ "activationWizard.licenseKeyFormatIsInvalid",
1810
+ "License key format is invalid. Expected format: XXXX-XXXX-XXXX-XXXX-XXXX"
1811
+ ),
1798
1812
  retryable: true
1799
1813
  }
1800
1814
  }));
@@ -1809,7 +1823,7 @@ function useActivationWizard(config) {
1809
1823
  step: "error",
1810
1824
  error: {
1811
1825
  code: validation.errorCode || "VALIDATION_FAILED",
1812
- message: validation.errorMessage || "License key validation failed",
1826
+ message: validation.errorMessage || t("activationWizard.licenseKeyValidationFailed", "License key validation failed"),
1813
1827
  retryable: true
1814
1828
  }
1815
1829
  }));
@@ -1833,7 +1847,10 @@ function useActivationWizard(config) {
1833
1847
  step: "error",
1834
1848
  error: {
1835
1849
  code: "HARDWARE_LIMIT",
1836
- message: hwCheck.reason || "Maximum hardware activations reached",
1850
+ message: hwCheck.reason || t(
1851
+ "activationWizard.maximumHardwareActivationsReached",
1852
+ "Maximum hardware activations reached"
1853
+ ),
1837
1854
  retryable: false,
1838
1855
  supportRequired: true
1839
1856
  }
@@ -1848,7 +1865,7 @@ function useActivationWizard(config) {
1848
1865
  error
1849
1866
  }));
1850
1867
  }
1851
- }, [state.licenseKey, state.machineName, service]);
1868
+ }, [state.licenseKey, state.machineName, service, t]);
1852
1869
  const acceptTermsAndActivate = React.useCallback(async () => {
1853
1870
  var _a, _b;
1854
1871
  if (!state.termsAccepted) {
@@ -1856,7 +1873,10 @@ function useActivationWizard(config) {
1856
1873
  ...s,
1857
1874
  error: {
1858
1875
  code: "TERMS_NOT_ACCEPTED",
1859
- message: "Please accept the terms of service to continue",
1876
+ message: t(
1877
+ "activationWizard.pleaseAcceptTheTermsOf",
1878
+ "Please accept the terms of service to continue"
1879
+ ),
1860
1880
  retryable: true
1861
1881
  }
1862
1882
  }));
@@ -1885,7 +1905,7 @@ function useActivationWizard(config) {
1885
1905
  }));
1886
1906
  (_b = config.onActivationError) == null ? void 0 : _b.call(config, activationError);
1887
1907
  }
1888
- }, [state, service, config]);
1908
+ }, [state, service, config, t]);
1889
1909
  const startOfflineActivation = React.useCallback(async () => {
1890
1910
  if (!config.allowOfflineActivation) {
1891
1911
  return;
@@ -1974,13 +1994,14 @@ function useActivationWizard(config) {
1974
1994
  };
1975
1995
  }
1976
1996
  const StepIndicator = ({ currentStep }) => {
1997
+ const { t } = uiCore.useNiceTranslation();
1977
1998
  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" }
1999
+ { id: "enter-key", label: t("activationWizard.enterKey", "Enter Key") },
2000
+ { id: "validate", label: t("activationWizard.validate", "Validate") },
2001
+ { id: "hardware-check", label: t("activationWizard.hardware", "Hardware") },
2002
+ { id: "terms", label: t("activationWizard.terms", "Terms") },
2003
+ { id: "activating", label: t("activationWizard.activate", "Activate") },
2004
+ { id: "success", label: t("activationWizard.done", "Done") }
1984
2005
  ];
1985
2006
  const stepOrder = [
1986
2007
  "enter-key",
@@ -2012,6 +2033,7 @@ const StepIndicator = ({ currentStep }) => {
2012
2033
  };
2013
2034
  const ActivationWizard = (props) => {
2014
2035
  var _a;
2036
+ const { t } = uiCore.useNiceTranslation();
2015
2037
  const { className, style, ...config } = props;
2016
2038
  const {
2017
2039
  state,
@@ -2032,17 +2054,20 @@ const ActivationWizard = (props) => {
2032
2054
  style,
2033
2055
  children: [
2034
2056
  /* @__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" })
2057
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("activationWizard.activateLicense", "Activate License") }),
2058
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-1", children: t(
2059
+ "activationWizard.followTheStepsToActivate",
2060
+ "Follow the steps to activate your Nice2Dev license"
2061
+ ) })
2037
2062
  ] }),
2038
2063
  state.step !== "error" && /* @__PURE__ */ jsxRuntime.jsx(StepIndicator, { currentStep: state.step }),
2039
2064
  state.step === "error" && state.error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
2040
2065
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-6 text-center", children: [
2041
2066
  /* @__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" }),
2067
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-red-800", children: t("activationWizard.activationFailed", "Activation Failed") }),
2043
2068
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-600 mt-2", children: state.error.message }),
2044
2069
  state.error.supportRequired && config.supportEmail && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600 mt-4", children: [
2045
- "Please contact support at",
2070
+ t("activationWizard.pleaseContactSupportAt", "Please contact support at"),
2046
2071
  " ",
2047
2072
  /* @__PURE__ */ jsxRuntime.jsx("a", { href: `mailto:${config.supportEmail}`, className: "text-blue-500 hover:underline", children: config.supportEmail })
2048
2073
  ] })
@@ -2053,7 +2078,7 @@ const ActivationWizard = (props) => {
2053
2078
  {
2054
2079
  onClick: () => goBack(),
2055
2080
  className: "px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
2056
- children: "Try Again"
2081
+ children: t("activationWizard.tryAgain", "Try Again")
2057
2082
  }
2058
2083
  ),
2059
2084
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2061,14 +2086,14 @@ const ActivationWizard = (props) => {
2061
2086
  {
2062
2087
  onClick: reset,
2063
2088
  className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2064
- children: "Start Over"
2089
+ children: t("activationWizard.startOver", "Start Over")
2065
2090
  }
2066
2091
  )
2067
2092
  ] })
2068
2093
  ] }),
2069
2094
  state.step === "enter-key" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2070
2095
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2071
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "License Key" }),
2096
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("activationWizard.licenseKey", "License Key") }),
2072
2097
  /* @__PURE__ */ jsxRuntime.jsx(
2073
2098
  "input",
2074
2099
  {
@@ -2080,17 +2105,20 @@ const ActivationWizard = (props) => {
2080
2105
  maxLength: 29
2081
2106
  }
2082
2107
  ),
2083
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 mt-2", children: "Enter the license key you received upon purchase" })
2108
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 mt-2", children: t(
2109
+ "activationWizard.enterTheLicenseKeyYou",
2110
+ "Enter the license key you received upon purchase"
2111
+ ) })
2084
2112
  ] }),
2085
2113
  /* @__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)" }),
2114
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("activationWizard.machineNameOptional", "Machine Name (optional)") }),
2087
2115
  /* @__PURE__ */ jsxRuntime.jsx(
2088
2116
  "input",
2089
2117
  {
2090
2118
  type: "text",
2091
2119
  value: state.machineName,
2092
2120
  onChange: (e) => setMachineName(e.target.value),
2093
- placeholder: "My Work PC",
2121
+ placeholder: t("activationWizard.myWorkPc", "My Work PC"),
2094
2122
  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
2123
  }
2096
2124
  )
@@ -2103,7 +2131,7 @@ const ActivationWizard = (props) => {
2103
2131
  onClick: validateKey,
2104
2132
  disabled: !state.licenseKey,
2105
2133
  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"
2134
+ children: t("activationWizard.continue", "Continue")
2107
2135
  }
2108
2136
  ),
2109
2137
  config.onCancel && /* @__PURE__ */ jsxRuntime.jsx(
@@ -2111,7 +2139,7 @@ const ActivationWizard = (props) => {
2111
2139
  {
2112
2140
  onClick: config.onCancel,
2113
2141
  className: "px-6 py-3 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2114
- children: "Cancel"
2142
+ children: t("activationWizard.cancel", "Cancel")
2115
2143
  }
2116
2144
  )
2117
2145
  ] }),
@@ -2121,7 +2149,8 @@ const ActivationWizard = (props) => {
2121
2149
  onClick: startOfflineActivation,
2122
2150
  className: "w-full text-sm text-blue-500 hover:underline",
2123
2151
  children: [
2124
- "Activate offline ",
2152
+ t("activationWizard.activateOffline", "Activate offline"),
2153
+ " ",
2125
2154
  /* @__PURE__ */ jsxRuntime.jsx(icons.NtdArrowRight, { size: 14, style: { verticalAlign: "-2px" } })
2126
2155
  ]
2127
2156
  }
@@ -2129,26 +2158,35 @@ const ActivationWizard = (props) => {
2129
2158
  ] }),
2130
2159
  (state.step === "validate" || state.step === "hardware-check") && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", children: [
2131
2160
  /* @__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" })
2161
+ /* @__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...") }),
2162
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: state.step === "validate" ? t(
2163
+ "activationWizard.verifyingYourLicenseKeyWith",
2164
+ "Verifying your license key with the server"
2165
+ ) : t(
2166
+ "activationWizard.collectingHardwareInformationForActivati",
2167
+ "Collecting hardware information for activation"
2168
+ ) })
2134
2169
  ] }),
2135
2170
  state.step === "terms" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2136
2171
  /* @__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" }),
2172
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-3", children: t("activationWizard.licenseDetails", "License Details") }),
2138
2173
  ((_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:" }),
2174
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.tier", "Tier:") }),
2140
2175
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium capitalize", children: state.validation.license.tier }),
2141
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Licensee:" }),
2176
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.licensee", "Licensee:") }),
2142
2177
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.validation.license.licensee }),
2143
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Max Machines:" }),
2178
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.maxMachines", "Max Machines:") }),
2144
2179
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.validation.license.maxMachines }),
2145
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "This Machine:" }),
2180
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.thisMachine", "This Machine:") }),
2146
2181
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.machineName })
2147
2182
  ] })
2148
2183
  ] }),
2149
2184
  /* @__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." })
2185
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-gray-800 mb-2", children: t("activationWizard.termsOfService", "Terms of Service") }),
2186
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: t(
2187
+ "activationWizard.byActivatingThisLicenseYou",
2188
+ "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."
2189
+ ) })
2152
2190
  ] }),
2153
2191
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [
2154
2192
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2161,7 +2199,7 @@ const ActivationWizard = (props) => {
2161
2199
  }
2162
2200
  ),
2163
2201
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-gray-700", children: [
2164
- "I accept the",
2202
+ t("activationWizard.iAcceptThe", "I accept the"),
2165
2203
  " ",
2166
2204
  config.termsUrl ? /* @__PURE__ */ jsxRuntime.jsx(
2167
2205
  "a",
@@ -2170,12 +2208,12 @@ const ActivationWizard = (props) => {
2170
2208
  className: "text-blue-500 hover:underline",
2171
2209
  target: "_blank",
2172
2210
  rel: "noopener noreferrer",
2173
- children: "Terms of Service"
2211
+ children: t("activationWizard.termsOfService", "Terms of Service")
2174
2212
  }
2175
- ) : "Terms of Service",
2213
+ ) : t("activationWizard.termsOfService", "Terms of Service"),
2176
2214
  config.privacyUrl && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2177
2215
  " ",
2178
- "and",
2216
+ t("activationWizard.and", "and"),
2179
2217
  " ",
2180
2218
  /* @__PURE__ */ jsxRuntime.jsx(
2181
2219
  "a",
@@ -2184,7 +2222,7 @@ const ActivationWizard = (props) => {
2184
2222
  className: "text-blue-500 hover:underline",
2185
2223
  target: "_blank",
2186
2224
  rel: "noopener noreferrer",
2187
- children: "Privacy Policy"
2225
+ children: t("activationWizard.privacyPolicy", "Privacy Policy")
2188
2226
  }
2189
2227
  )
2190
2228
  ] })
@@ -2197,7 +2235,7 @@ const ActivationWizard = (props) => {
2197
2235
  {
2198
2236
  onClick: goBack,
2199
2237
  className: "px-6 py-3 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2200
- children: "Back"
2238
+ children: t("activationWizard.back", "Back")
2201
2239
  }
2202
2240
  ),
2203
2241
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2206,31 +2244,37 @@ const ActivationWizard = (props) => {
2206
2244
  onClick: acceptTermsAndActivate,
2207
2245
  disabled: !state.termsAccepted,
2208
2246
  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"
2247
+ children: t("activationWizard.activateLicense", "Activate License")
2210
2248
  }
2211
2249
  )
2212
2250
  ] })
2213
2251
  ] }),
2214
2252
  state.step === "activating" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", children: [
2215
2253
  /* @__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" })
2254
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: t("activationWizard.activatingLicense", "Activating License...") }),
2255
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: t(
2256
+ "activationWizard.pleaseWaitWhileWeActivate",
2257
+ "Please wait while we activate your license"
2258
+ ) })
2218
2259
  ] }),
2219
2260
  state.step === "success" && state.activatedLicense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-6", children: [
2220
2261
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-green-500 text-6xl", children: /* @__PURE__ */ jsxRuntime.jsx(marks.CheckMark, {}) }),
2221
2262
  /* @__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." })
2263
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold text-gray-900", children: t("activationWizard.licenseActivated", "License Activated!") }),
2264
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: t(
2265
+ "activationWizard.yourLicenseHasBeenSuccessfully",
2266
+ "Your license has been successfully activated on this machine."
2267
+ ) })
2224
2268
  ] }),
2225
2269
  /* @__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:" }),
2270
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.licenseKey2", "License Key:") }),
2227
2271
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: state.activatedLicense.key }),
2228
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Tier:" }),
2272
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.tier", "Tier:") }),
2229
2273
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "capitalize", children: state.activatedLicense.tier }),
2230
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Machine:" }),
2274
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.machine", "Machine:") }),
2231
2275
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: state.machineName }),
2232
2276
  state.activatedLicense.expiresAt && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2233
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Expires:" }),
2277
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.expires", "Expires:") }),
2234
2278
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: new Date(state.activatedLicense.expiresAt).toLocaleDateString() })
2235
2279
  ] })
2236
2280
  ] }) }),
@@ -2243,15 +2287,18 @@ const ActivationWizard = (props) => {
2243
2287
  (_a2 = config.onCancel) == null ? void 0 : _a2.call(config);
2244
2288
  },
2245
2289
  className: "px-8 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
2246
- children: "Done"
2290
+ children: t("activationWizard.done", "Done")
2247
2291
  }
2248
2292
  )
2249
2293
  ] }),
2250
2294
  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" }),
2295
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold mb-4", children: t("activationWizard.offlineActivation", "Offline Activation") }),
2252
2296
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
2253
2297
  /* @__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):" }),
2298
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t(
2299
+ "activationWizard.challengeCodeSendThisTo",
2300
+ "Challenge Code (send this to support):"
2301
+ ) }),
2255
2302
  /* @__PURE__ */ jsxRuntime.jsx(
2256
2303
  "textarea",
2257
2304
  {
@@ -2262,13 +2309,16 @@ const ActivationWizard = (props) => {
2262
2309
  )
2263
2310
  ] }),
2264
2311
  /* @__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):" }),
2312
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t("activationWizard.responseCodeFromSupport", "Response Code (from support):") }),
2266
2313
  /* @__PURE__ */ jsxRuntime.jsx(
2267
2314
  "textarea",
2268
2315
  {
2269
2316
  value: offlineResponse,
2270
2317
  onChange: (e) => setOfflineResponse(e.target.value),
2271
- placeholder: "Paste the response code here...",
2318
+ placeholder: t(
2319
+ "activationWizard.pasteTheResponseCodeHere",
2320
+ "Paste the response code here..."
2321
+ ),
2272
2322
  className: "w-full px-3 py-2 border border-gray-300 rounded font-mono text-xs h-20"
2273
2323
  }
2274
2324
  )
@@ -2281,7 +2331,7 @@ const ActivationWizard = (props) => {
2281
2331
  },
2282
2332
  disabled: !offlineResponse,
2283
2333
  className: "flex-1 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:bg-gray-300",
2284
- children: "Activate"
2334
+ children: t("activationWizard.activate", "Activate")
2285
2335
  }
2286
2336
  ),
2287
2337
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2291,7 +2341,7 @@ const ActivationWizard = (props) => {
2291
2341
  setOfflineResponse("");
2292
2342
  },
2293
2343
  className: "px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",
2294
- children: "Cancel"
2344
+ children: t("activationWizard.cancel", "Cancel")
2295
2345
  }
2296
2346
  )
2297
2347
  ] })
@@ -2316,6 +2366,7 @@ class LicenseTransferService {
2316
2366
  const error = await response.json().catch(() => ({}));
2317
2367
  throw {
2318
2368
  code: `HTTP_${response.status}`,
2369
+ // audit-allow: i18n — the service's fallback in the thrown TransferError (API contract)
2319
2370
  message: error.message || "Request failed"
2320
2371
  };
2321
2372
  }
@@ -2411,6 +2462,7 @@ const TRANSFER_REASONS = [
2411
2462
  { value: "other", label: "Other" }
2412
2463
  ];
2413
2464
  function useLicenseTransfer(config) {
2465
+ const { t } = uiCore.useNiceTranslation();
2414
2466
  const [step, setStep] = React.useState("select-license");
2415
2467
  const [licenses, setLicenses] = React.useState([]);
2416
2468
  const [formData, setFormData] = React.useState({
@@ -2481,7 +2533,13 @@ function useLicenseTransfer(config) {
2481
2533
  const initiateTransfer = React.useCallback(async () => {
2482
2534
  var _a, _b;
2483
2535
  if (!formData.confirmDeactivation) {
2484
- setError({ code: "CONFIRMATION_REQUIRED", message: "Please confirm license deactivation" });
2536
+ setError({
2537
+ code: "CONFIRMATION_REQUIRED",
2538
+ message: t(
2539
+ "licenseTransfer.pleaseConfirmLicenseDeactivation",
2540
+ "Please confirm license deactivation"
2541
+ )
2542
+ });
2485
2543
  return;
2486
2544
  }
2487
2545
  setStep("processing");
@@ -2505,7 +2563,7 @@ function useLicenseTransfer(config) {
2505
2563
  } finally {
2506
2564
  setLoading(false);
2507
2565
  }
2508
- }, [formData, service, config]);
2566
+ }, [formData, service, config, t]);
2509
2567
  const reset = React.useCallback(() => {
2510
2568
  setStep("select-license");
2511
2569
  setFormData({
@@ -2540,19 +2598,23 @@ function useLicenseTransfer(config) {
2540
2598
  reset
2541
2599
  };
2542
2600
  }
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
- );
2601
+ const TransferStatusBadge = ({ status }) => {
2602
+ const { t } = uiCore.useNiceTranslation();
2603
+ return /* @__PURE__ */ jsxRuntime.jsx(
2604
+ "span",
2605
+ {
2606
+ className: "inline-flex items-center px-2.5 py-1 rounded-full text-sm font-medium",
2607
+ style: {
2608
+ backgroundColor: `${getTransferStatusColor(status)}20`,
2609
+ color: getTransferStatusColor(status)
2610
+ },
2611
+ children: t(`licenseTransfer.status.${status}`, getTransferStatusLabel(status))
2612
+ }
2613
+ );
2614
+ };
2554
2615
  const LicenseTransfer = (props) => {
2555
2616
  var _a, _b;
2617
+ const { t } = uiCore.useNiceTranslation();
2556
2618
  const { className, style, ...config } = props;
2557
2619
  const {
2558
2620
  step,
@@ -2581,14 +2643,20 @@ const LicenseTransfer = (props) => {
2581
2643
  className: `nice-license-transfer bg-white rounded-lg shadow-lg p-8 max-w-2xl mx-auto ${className || ""}`,
2582
2644
  style,
2583
2645
  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" }),
2646
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-2", children: t("licenseTransfer.transferLicense", "Transfer License") }),
2647
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mb-6", children: t(
2648
+ "licenseTransfer.transferALicenseToAnother",
2649
+ "Transfer a license to another user or organization"
2650
+ ) }),
2586
2651
  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
2652
  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(
2653
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: t("licenseTransfer.selectALicenseToTransfer", "Select a license to transfer") }),
2654
+ 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
2655
  "div",
2591
2656
  {
2657
+ role: "button",
2658
+ tabIndex: 0,
2659
+ onKeyDown: uiCore.clickOnActivationKey,
2592
2660
  className: "p-4 border border-gray-200 rounded-lg hover:border-blue-500 cursor-pointer transition-colors",
2593
2661
  onClick: () => selectLicense(license),
2594
2662
  children: [
@@ -2599,12 +2667,7 @@ const LicenseTransfer = (props) => {
2599
2667
  ] }),
2600
2668
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 py-1 bg-blue-100 text-blue-700 rounded text-sm capitalize", children: license.tier })
2601
2669
  ] }),
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
- ] })
2670
+ /* @__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
2671
  ]
2609
2672
  },
2610
2673
  license.key
@@ -2612,11 +2675,11 @@ const LicenseTransfer = (props) => {
2612
2675
  ] }),
2613
2676
  step === "enter-recipient" && selectedLicense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
2614
2677
  /* @__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:" }),
2678
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licenseTransfer.transferringLicense", "Transferring license:") }),
2616
2679
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: selectedLicense.key })
2617
2680
  ] }),
2618
2681
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2619
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Recipient Email" }),
2682
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.recipientEmail", "Recipient Email") }),
2620
2683
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
2621
2684
  /* @__PURE__ */ jsxRuntime.jsx(
2622
2685
  "input",
@@ -2625,7 +2688,7 @@ const LicenseTransfer = (props) => {
2625
2688
  value: formData.recipientEmail,
2626
2689
  onChange: (e) => setFormData((f) => ({ ...f, recipientEmail: e.target.value })),
2627
2690
  onBlur: validateRecipient,
2628
- placeholder: "recipient@company.com",
2691
+ placeholder: t("licenseTransfer.recipientCompanyCom", "recipient@company.com"),
2629
2692
  className: "flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
2630
2693
  }
2631
2694
  ),
@@ -2635,7 +2698,7 @@ const LicenseTransfer = (props) => {
2635
2698
  onClick: validateRecipient,
2636
2699
  disabled: !formData.recipientEmail || loading,
2637
2700
  className: "px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 disabled:opacity-50",
2638
- children: "Validate"
2701
+ children: t("licenseTransfer.validate", "Validate")
2639
2702
  }
2640
2703
  )
2641
2704
  ] }),
@@ -2644,28 +2707,28 @@ const LicenseTransfer = (props) => {
2644
2707
  {
2645
2708
  className: `mt-2 text-sm ${recipientValidation.valid ? "text-green-600" : "text-red-600"}`,
2646
2709
  children: [
2647
- recipientValidation.valid ? "Valid recipient" : "Invalid recipient",
2648
- recipientValidation.isExternal && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-orange-600", children: "(External organization)" })
2710
+ recipientValidation.valid ? t("licenseTransfer.validRecipient", "Valid recipient") : t("licenseTransfer.invalidRecipient", "Invalid recipient"),
2711
+ recipientValidation.isExternal && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-orange-600", children: t("licenseTransfer.externalOrganization", "(External organization)") })
2649
2712
  ]
2650
2713
  }
2651
2714
  ),
2652
2715
  (_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
2716
  ] }),
2654
2717
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2655
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Recipient Name" }),
2718
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.recipientName", "Recipient Name") }),
2656
2719
  /* @__PURE__ */ jsxRuntime.jsx(
2657
2720
  "input",
2658
2721
  {
2659
2722
  type: "text",
2660
2723
  value: formData.recipientName,
2661
2724
  onChange: (e) => setFormData((f) => ({ ...f, recipientName: e.target.value })),
2662
- placeholder: "John Doe",
2725
+ placeholder: t("licenseTransfer.johnDoe", "John Doe"),
2663
2726
  className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
2664
2727
  }
2665
2728
  )
2666
2729
  ] }),
2667
2730
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2668
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Transfer Reason" }),
2731
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.transferReason", "Transfer Reason") }),
2669
2732
  /* @__PURE__ */ jsxRuntime.jsx(
2670
2733
  "select",
2671
2734
  {
@@ -2675,18 +2738,21 @@ const LicenseTransfer = (props) => {
2675
2738
  transferReason: e.target.value
2676
2739
  })),
2677
2740
  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))
2741
+ children: TRANSFER_REASONS.map((reason) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: reason.value, children: t(`licenseTransfer.reason.${reason.value}`, reason.label) }, reason.value))
2679
2742
  }
2680
2743
  )
2681
2744
  ] }),
2682
2745
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2683
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Notes (optional)" }),
2746
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.notesOptional", "Notes (optional)") }),
2684
2747
  /* @__PURE__ */ jsxRuntime.jsx(
2685
2748
  "textarea",
2686
2749
  {
2687
2750
  value: formData.notes,
2688
2751
  onChange: (e) => setFormData((f) => ({ ...f, notes: e.target.value })),
2689
- placeholder: "Any additional information...",
2752
+ placeholder: t(
2753
+ "licenseTransfer.anyAdditionalInformation",
2754
+ "Any additional information..."
2755
+ ),
2690
2756
  rows: 3,
2691
2757
  className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
2692
2758
  }
@@ -2698,7 +2764,7 @@ const LicenseTransfer = (props) => {
2698
2764
  {
2699
2765
  onClick: () => setStep("select-license"),
2700
2766
  className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2701
- children: "Back"
2767
+ children: t("licenseTransfer.back", "Back")
2702
2768
  }
2703
2769
  ),
2704
2770
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2707,36 +2773,42 @@ const LicenseTransfer = (props) => {
2707
2773
  onClick: proceedToReview,
2708
2774
  disabled: !(recipientValidation == null ? void 0 : recipientValidation.valid) || !formData.recipientName,
2709
2775
  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"
2776
+ children: t("licenseTransfer.reviewTransfer", "Review Transfer")
2711
2777
  }
2712
2778
  )
2713
2779
  ] })
2714
2780
  ] }),
2715
2781
  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" }),
2782
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: t("licenseTransfer.reviewTransferDetails", "Review Transfer Details") }),
2717
2783
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-gray-50 rounded-lg p-4 space-y-3", children: [
2718
2784
  /* @__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:" }),
2785
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.licenseKey", "License Key:") }),
2720
2786
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: selectedLicense.key }),
2721
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Current Licensee:" }),
2787
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.currentLicensee", "Current Licensee:") }),
2722
2788
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: selectedLicense.licensee }),
2723
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Tier:" }),
2789
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.tier", "Tier:") }),
2724
2790
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "capitalize", children: selectedLicense.tier }),
2725
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Transfer To:" }),
2791
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.transferTo", "Transfer To:") }),
2726
2792
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: formData.recipientName }),
2727
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Recipient Email:" }),
2793
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.recipientEmail2", "Recipient Email:") }),
2728
2794
  /* @__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 })
2795
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.reason", "Reason:") }),
2796
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: t(
2797
+ `licenseTransfer.reason.${formData.transferReason}`,
2798
+ ((_b = TRANSFER_REASONS.find((r) => r.value === formData.transferReason)) == null ? void 0 : _b.label) ?? formData.transferReason
2799
+ ) })
2731
2800
  ] }),
2732
2801
  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:" }),
2802
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500 mb-1", children: t("licenseTransfer.notes", "Notes:") }),
2734
2803
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", children: formData.notes })
2735
2804
  ] })
2736
2805
  ] }),
2737
2806
  /* @__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." })
2807
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: t("licenseTransfer.important", "Important") }),
2808
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-orange-700", children: t(
2809
+ "licenseTransfer.onceTheTransferIsCompleted",
2810
+ "Once the transfer is completed, this license will be deactivated from all your machines and the new owner will need to activate it."
2811
+ ) })
2740
2812
  ] }),
2741
2813
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [
2742
2814
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2748,7 +2820,10 @@ const LicenseTransfer = (props) => {
2748
2820
  className: "mt-1 w-4 h-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500"
2749
2821
  }
2750
2822
  ),
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." })
2823
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700", children: t(
2824
+ "licenseTransfer.iUnderstandThatThisLicense",
2825
+ "I understand that this license will be deactivated and transferred to the recipient. This action cannot be undone without admin intervention."
2826
+ ) })
2752
2827
  ] }),
2753
2828
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3", children: [
2754
2829
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2756,7 +2831,7 @@ const LicenseTransfer = (props) => {
2756
2831
  {
2757
2832
  onClick: () => setStep("enter-recipient"),
2758
2833
  className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
2759
- children: "Back"
2834
+ children: t("licenseTransfer.back", "Back")
2760
2835
  }
2761
2836
  ),
2762
2837
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2765,28 +2840,37 @@ const LicenseTransfer = (props) => {
2765
2840
  onClick: initiateTransfer,
2766
2841
  disabled: !formData.confirmDeactivation || loading,
2767
2842
  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"
2843
+ children: loading ? t("licenseTransfer.processing", "Processing...") : t("licenseTransfer.initiateTransfer", "Initiate Transfer")
2769
2844
  }
2770
2845
  )
2771
2846
  ] })
2772
2847
  ] }),
2773
2848
  step === "processing" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-12", children: [
2774
2849
  /* @__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" })
2850
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: t("licenseTransfer.processingTransfer", "Processing Transfer...") }),
2851
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500", children: t(
2852
+ "licenseTransfer.pleaseWaitWhileWeProcess",
2853
+ "Please wait while we process your transfer request"
2854
+ ) })
2777
2855
  ] }),
2778
2856
  step === "complete" && transfer && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-6", children: [
2779
2857
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-green-500 text-6xl", children: /* @__PURE__ */ jsxRuntime.jsx(marks.CheckMark, {}) }),
2780
2858
  /* @__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." })
2859
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold", children: t("licenseTransfer.transferInitiated", "Transfer Initiated") }),
2860
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: transfer.approvalRequired ? t(
2861
+ "licenseTransfer.yourTransferRequestHasBeen",
2862
+ "Your transfer request has been submitted for approval."
2863
+ ) : t(
2864
+ "licenseTransfer.anEmailHasBeenSent",
2865
+ "An email has been sent to the recipient with instructions to accept the transfer."
2866
+ ) })
2783
2867
  ] }),
2784
2868
  /* @__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:" }),
2869
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.transferId", "Transfer ID:") }),
2786
2870
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: transfer.id }),
2787
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Status:" }),
2871
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.status", "Status:") }),
2788
2872
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(TransferStatusBadge, { status: transfer.status }) }),
2789
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Expires:" }),
2873
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.expires", "Expires:") }),
2790
2874
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: new Date(transfer.expiresAt).toLocaleDateString() })
2791
2875
  ] }) }),
2792
2876
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2794,7 +2878,7 @@ const LicenseTransfer = (props) => {
2794
2878
  {
2795
2879
  onClick: reset,
2796
2880
  className: "px-8 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
2797
- children: "Done"
2881
+ children: t("licenseTransfer.done", "Done")
2798
2882
  }
2799
2883
  )
2800
2884
  ] })
@@ -3218,13 +3302,14 @@ const MetricCard = ({ title, value, change, suffix, loading }) => /* @__PURE__ *
3218
3302
  ] })
3219
3303
  ] });
3220
3304
  const TimeRangeSelector = ({ value, onChange }) => {
3305
+ const { t } = uiCore.useNiceTranslation();
3221
3306
  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" }
3307
+ { value: "24h", label: t("usageAnalyticsDashboard.n24Hours", "24 Hours") },
3308
+ { value: "7d", label: t("usageAnalyticsDashboard.n7Days", "7 Days") },
3309
+ { value: "30d", label: t("usageAnalyticsDashboard.n30Days", "30 Days") },
3310
+ { value: "90d", label: t("usageAnalyticsDashboard.n90Days", "90 Days") },
3311
+ { value: "1y", label: t("usageAnalyticsDashboard.n1Year", "1 Year") },
3312
+ { value: "all", label: t("usageAnalyticsDashboard.allTime", "All Time") }
3228
3313
  ];
3229
3314
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1 bg-gray-100 rounded-lg p-1", children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
3230
3315
  "button",
@@ -3236,93 +3321,101 @@ const TimeRangeSelector = ({ value, onChange }) => {
3236
3321
  opt.value
3237
3322
  )) });
3238
3323
  };
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 })
3324
+ const FeatureUsageTable = ({ data, loading }) => {
3325
+ const { t } = uiCore.useNiceTranslation();
3326
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
3327
+ /* @__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") }) }),
3328
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
3329
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3330
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.feature", "Feature") }),
3331
+ /* @__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") }),
3332
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.users2", "Users") }),
3333
+ /* @__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") }),
3334
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.trend", "Trend") })
3335
+ ] }) }),
3336
+ /* @__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: [
3337
+ /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
3338
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: feature.featureName }),
3339
+ feature.category && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: feature.category })
3340
+ ] }),
3341
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.totalUses.toLocaleString() }),
3342
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.uniqueUsers.toLocaleString() }),
3343
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.avgUsesPerUser.toFixed(1) }),
3344
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsxs(
3345
+ "span",
3346
+ {
3347
+ 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"}`,
3348
+ children: [
3349
+ feature.trend > 0 ? "+" : "",
3350
+ feature.trend.toFixed(1),
3351
+ "%"
3352
+ ]
3353
+ }
3354
+ ) })
3355
+ ] }, feature.featureId)) })
3356
+ ] }) })
3357
+ ] });
3358
+ };
3359
+ const TopUsersTable = ({ data, loading }) => {
3360
+ const { t } = uiCore.useNiceTranslation();
3361
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
3362
+ /* @__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") }) }),
3363
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
3364
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3365
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.user", "User") }),
3366
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.sessions", "Sessions") }),
3367
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.duration", "Duration") }),
3368
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.features", "Features") }),
3369
+ /* @__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") })
3370
+ ] }) }),
3371
+ /* @__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: [
3372
+ /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
3373
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: user.displayName || user.email }),
3374
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500 capitalize", children: user.tier })
3375
+ ] }),
3376
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.sessionCount.toLocaleString() }),
3377
+ /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3 text-right font-mono", children: [
3378
+ Math.round(user.totalDuration / 60),
3379
+ "h"
3380
+ ] }),
3381
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.featuresUsed }),
3382
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-sm text-gray-500", children: new Date(user.lastActive).toLocaleDateString() })
3383
+ ] }, user.userId)) })
3384
+ ] }) })
3385
+ ] });
3386
+ };
3387
+ const LicenseUtilizationChart = ({ data, loading }) => {
3388
+ const { t } = uiCore.useNiceTranslation();
3389
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
3390
+ /* @__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") }) }),
3391
+ /* @__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: [
3392
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm mb-1", children: [
3393
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium truncate max-w-[200px]", children: license.licensee }),
3394
+ /* @__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
3395
  ] }),
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",
3396
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-2 bg-gray-100 rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
3397
+ "div",
3259
3398
  {
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
- ]
3399
+ className: `h-full rounded-full ${license.utilizationPercent >= 90 ? "bg-red-500" : license.utilizationPercent >= 70 ? "bg-yellow-500" : "bg-green-500"}`,
3400
+ style: { width: `${license.utilizationPercent}%` }
3266
3401
  }
3267
3402
  ) })
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
- ] });
3403
+ ] }, license.licenseKey)) })
3404
+ ] });
3405
+ };
3317
3406
  const UsageAnalyticsDashboard = (props) => {
3318
3407
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
3408
+ const { t } = uiCore.useNiceTranslation();
3319
3409
  const { className, style, ...config } = props;
3320
3410
  const { state, setTimeRange, refresh, exportData } = useUsageAnalytics(config);
3321
3411
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-usage-analytics ${className || ""}`, style, children: [
3322
3412
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
3323
3413
  /* @__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" })
3414
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("usageAnalyticsDashboard.usageAnalytics", "Usage Analytics") }),
3415
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: t(
3416
+ "usageAnalyticsDashboard.monitorLicenseUsageAndFeature",
3417
+ "Monitor license usage and feature adoption"
3418
+ ) })
3326
3419
  ] }),
3327
3420
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
3328
3421
  /* @__PURE__ */ jsxRuntime.jsx(TimeRangeSelector, { value: state.timeRange, onChange: setTimeRange }),
@@ -3331,7 +3424,7 @@ const UsageAnalyticsDashboard = (props) => {
3331
3424
  {
3332
3425
  onClick: () => refresh(),
3333
3426
  className: "p-2 text-gray-500 hover:text-gray-700 rounded-lg hover:bg-gray-100",
3334
- title: "Refresh",
3427
+ title: t("usageAnalyticsDashboard.refresh", "Refresh"),
3335
3428
  children: /* @__PURE__ */ jsxRuntime.jsx(marks.RefreshMark, {})
3336
3429
  }
3337
3430
  ),
@@ -3340,7 +3433,7 @@ const UsageAnalyticsDashboard = (props) => {
3340
3433
  {
3341
3434
  className: "px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
3342
3435
  onClick: () => exportData("csv"),
3343
- children: "Export"
3436
+ children: t("usageAnalyticsDashboard.export", "Export")
3344
3437
  }
3345
3438
  ) })
3346
3439
  ] })
@@ -3350,7 +3443,7 @@ const UsageAnalyticsDashboard = (props) => {
3350
3443
  /* @__PURE__ */ jsxRuntime.jsx(
3351
3444
  MetricCard,
3352
3445
  {
3353
- title: "Active Licenses",
3446
+ title: t("usageAnalyticsDashboard.activeLicenses", "Active Licenses"),
3354
3447
  value: ((_a = state.overview) == null ? void 0 : _a.activeLicenses) ?? 0,
3355
3448
  change: (_b = state.overview) == null ? void 0 : _b.activeLicensesChange,
3356
3449
  loading: state.loading
@@ -3359,7 +3452,7 @@ const UsageAnalyticsDashboard = (props) => {
3359
3452
  /* @__PURE__ */ jsxRuntime.jsx(
3360
3453
  MetricCard,
3361
3454
  {
3362
- title: "Active Users",
3455
+ title: t("usageAnalyticsDashboard.activeUsers", "Active Users"),
3363
3456
  value: ((_c = state.overview) == null ? void 0 : _c.activeUsers) ?? 0,
3364
3457
  change: (_d = state.overview) == null ? void 0 : _d.activeUsersChange,
3365
3458
  loading: state.loading
@@ -3368,7 +3461,7 @@ const UsageAnalyticsDashboard = (props) => {
3368
3461
  /* @__PURE__ */ jsxRuntime.jsx(
3369
3462
  MetricCard,
3370
3463
  {
3371
- title: "Feature Uses",
3464
+ title: t("usageAnalyticsDashboard.featureUses", "Feature Uses"),
3372
3465
  value: ((_e = state.overview) == null ? void 0 : _e.featureUses) ?? 0,
3373
3466
  change: (_f = state.overview) == null ? void 0 : _f.featureUsesChange,
3374
3467
  loading: state.loading
@@ -3377,7 +3470,7 @@ const UsageAnalyticsDashboard = (props) => {
3377
3470
  /* @__PURE__ */ jsxRuntime.jsx(
3378
3471
  MetricCard,
3379
3472
  {
3380
- title: "Avg Session",
3473
+ title: t("usageAnalyticsDashboard.avgSession", "Avg Session"),
3381
3474
  value: ((_h = (_g = state.overview) == null ? void 0 : _g.avgSessionDuration) == null ? void 0 : _h.toFixed(1)) ?? "0",
3382
3475
  suffix: "min",
3383
3476
  change: (_i = state.overview) == null ? void 0 : _i.avgSessionDurationChange,
@@ -3387,7 +3480,7 @@ const UsageAnalyticsDashboard = (props) => {
3387
3480
  /* @__PURE__ */ jsxRuntime.jsx(
3388
3481
  MetricCard,
3389
3482
  {
3390
- title: "Utilization",
3483
+ title: t("usageAnalyticsDashboard.utilization", "Utilization"),
3391
3484
  value: `${((_k = (_j = state.overview) == null ? void 0 : _j.utilizationRate) == null ? void 0 : _k.toFixed(0)) ?? 0}%`,
3392
3485
  change: (_l = state.overview) == null ? void 0 : _l.utilizationRateChange,
3393
3486
  loading: state.loading
@@ -3400,14 +3493,14 @@ const UsageAnalyticsDashboard = (props) => {
3400
3493
  ] }),
3401
3494
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntime.jsx(TopUsersTable, { data: state.topUsers, loading: state.loading }) }),
3402
3495
  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" }),
3496
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("usageAnalyticsDashboard.geographicDistribution", "Geographic Distribution") }),
3404
3497
  /* @__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
3498
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl mb-1", children: getCountryFlag(geo.countryCode) }),
3406
3499
  /* @__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
- ] })
3500
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: t("usageAnalyticsDashboard.users", "{users} users").replace(
3501
+ "{users}",
3502
+ String(geo.users)
3503
+ ) })
3411
3504
  ] }, geo.countryCode)) })
3412
3505
  ] })
3413
3506
  ] });