@pdf-viewer/react 1.3.0-rc.1 → 1.3.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as E, useCallback as h, useEffect as A } from "react";
|
|
2
2
|
import { appConsole as c } from "../appConsole.js";
|
|
3
|
-
const b = /* @__PURE__ */ new Date("2025-04-
|
|
3
|
+
const b = /* @__PURE__ */ new Date("2025-04-04T09:09:49.665Z"), l = "Please visit https://www.react-pdf.dev/license-management/ to generate a new license key.", o = {
|
|
4
4
|
invalidLicense: `You are currently using without a valid license. ${l}`,
|
|
5
5
|
mismatchedDomain: `Your license key is not valid for the current domain / IP. ${l}`,
|
|
6
6
|
expired: `Your license key has expired. ${l}`,
|
|
@@ -55,7 +55,7 @@ const y = (r, t) => r === "specific" ? t === window.location.host : window.locat
|
|
|
55
55
|
invalidatedMessage: o.invalidLicense,
|
|
56
56
|
type: void 0
|
|
57
57
|
}, x = (r) => {
|
|
58
|
-
const [t, e] =
|
|
58
|
+
const [t, e] = E(d), n = h(async () => {
|
|
59
59
|
if (!r)
|
|
60
60
|
throw e(d), new Error("License is missing");
|
|
61
61
|
let i;
|
|
@@ -70,8 +70,8 @@ const y = (r, t) => r === "specific" ? t === window.location.host : window.locat
|
|
|
70
70
|
throw new Error("License is missing expiration timestamp");
|
|
71
71
|
if (s > Number.MAX_SAFE_INTEGER / 1e3)
|
|
72
72
|
throw new Error("Invalid expiration timestamp: value too large");
|
|
73
|
-
const v = new Date(s * 1e3),
|
|
74
|
-
if (v.getTime() <
|
|
73
|
+
const v = new Date(s * 1e3), g = (/* @__PURE__ */ new Date()).getTime();
|
|
74
|
+
if (v.getTime() < g)
|
|
75
75
|
throw new Error(o.expired);
|
|
76
76
|
if (!a)
|
|
77
77
|
throw new Error("License is missing available until version timestamp");
|
|
@@ -99,7 +99,7 @@ const y = (r, t) => r === "specific" ? t === window.location.host : window.locat
|
|
|
99
99
|
e({
|
|
100
100
|
...d,
|
|
101
101
|
isValid: !1
|
|
102
|
-
});
|
|
102
|
+
}), c.warn(i.message);
|
|
103
103
|
});
|
|
104
104
|
}, [n]), t;
|
|
105
105
|
};
|