mp-front-cli 0.0.35 → 0.0.37
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/core/errors/error-catalog.d.ts +2 -1
- package/dist/core/errors/error-catalog.d.ts.map +1 -1
- package/dist/core/errors/index.d.ts +0 -1
- package/dist/core/errors/index.d.ts.map +1 -1
- package/dist/core/interfaces/message.d.ts +1 -0
- package/dist/core/interfaces/message.d.ts.map +1 -1
- package/dist/core/middleware/index.d.ts +6 -4
- package/dist/core/middleware/index.d.ts.map +1 -1
- package/dist/core/utils/api-request/fetch-service-be.d.ts +2 -5
- package/dist/core/utils/api-request/fetch-service-be.d.ts.map +1 -1
- package/dist/core/utils/api-request/fetch-service-fe.d.ts +5 -5
- package/dist/core/utils/api-request/fetch-service-fe.d.ts.map +1 -1
- package/dist/core/utils/custom-catch-error.d.ts +5 -0
- package/dist/core/utils/custom-catch-error.d.ts.map +1 -0
- package/dist/core/utils/custom-encoder.d.ts +1 -1
- package/dist/core/utils/custom-encoder.d.ts.map +1 -1
- package/dist/core/utils/custom-header.d.ts +5 -237
- package/dist/core/utils/custom-header.d.ts.map +1 -1
- package/dist/{custom-encoder-b2078b5c.js → custom-encoder-6737c6cb.js} +244 -245
- package/dist/{custom-header-9a9c64e2.js → custom-header-4aec1dac.js} +109 -99
- package/dist/{custom-validator-16ec563a.js → custom-validator-ae5da0a7.js} +436 -449
- package/dist/{index-6f6eb615.js → index-df4e0539.js} +4 -0
- package/dist/lang/common/errors/es_MX/index.d.ts +4 -0
- package/dist/lang/common/errors/es_MX/index.d.ts.map +1 -1
- package/dist/message-handler-d90f2bb6.js +35 -0
- package/dist/mp-front-cli-all.es.js +13 -13
- package/dist/mp-front-cli-core.es.js +196 -92
- package/dist/mp-front-cli-encoder.es.js +1 -1
- package/dist/mp-front-cli-header.es.js +6 -5
- package/dist/mp-front-cli-locale.es.js +1 -1
- package/dist/mp-front-cli-utils-rxjs.es.js +11 -36
- package/dist/mp-front-cli-validator.es.js +3 -3
- package/package.json +4 -2
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { CustomLogger as jt } from "./mp-front-cli-logger.es.js";
|
|
6
|
-
import { t as Qr } from "./index-6f6eb615.js";
|
|
7
|
-
const jr = {
|
|
1
|
+
import { g as ft, C as zr } from "./custom-encoder-6737c6cb.js";
|
|
2
|
+
import { t as qr } from "./index-df4e0539.js";
|
|
3
|
+
import { CustomLogger as Xr } from "./mp-front-cli-logger.es.js";
|
|
4
|
+
const Yr = {
|
|
8
5
|
type: "logger",
|
|
9
6
|
log(t) {
|
|
10
7
|
this.output("log", t);
|
|
@@ -26,7 +23,7 @@ class xe {
|
|
|
26
23
|
}
|
|
27
24
|
init(e) {
|
|
28
25
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
29
|
-
this.prefix = r.prefix || "i18next:", this.logger = e ||
|
|
26
|
+
this.prefix = r.prefix || "i18next:", this.logger = e || Yr, this.options = r, this.debug = r.debug;
|
|
30
27
|
}
|
|
31
28
|
log() {
|
|
32
29
|
for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
|
|
@@ -97,10 +94,10 @@ function he() {
|
|
|
97
94
|
});
|
|
98
95
|
return r.resolve = t, r.reject = e, r;
|
|
99
96
|
}
|
|
100
|
-
function
|
|
97
|
+
function Kt(t) {
|
|
101
98
|
return t == null ? "" : "" + t;
|
|
102
99
|
}
|
|
103
|
-
function
|
|
100
|
+
function Zr(t, e, r) {
|
|
104
101
|
t.forEach((n) => {
|
|
105
102
|
e[n] && (r[n] = e[n]);
|
|
106
103
|
});
|
|
@@ -124,14 +121,14 @@ function ht(t, e, r) {
|
|
|
124
121
|
k: n(s.shift())
|
|
125
122
|
};
|
|
126
123
|
}
|
|
127
|
-
function
|
|
124
|
+
function Rt(t, e, r) {
|
|
128
125
|
const {
|
|
129
126
|
obj: n,
|
|
130
127
|
k: a
|
|
131
128
|
} = ht(t, e, Object);
|
|
132
129
|
n[a] = r;
|
|
133
130
|
}
|
|
134
|
-
function
|
|
131
|
+
function Qr(t, e, r, n) {
|
|
135
132
|
const {
|
|
136
133
|
obj: a,
|
|
137
134
|
k: s
|
|
@@ -146,19 +143,19 @@ function Ce(t, e) {
|
|
|
146
143
|
if (r)
|
|
147
144
|
return r[n];
|
|
148
145
|
}
|
|
149
|
-
function
|
|
146
|
+
function jr(t, e, r) {
|
|
150
147
|
const n = Ce(t, r);
|
|
151
148
|
return n !== void 0 ? n : Ce(e, r);
|
|
152
149
|
}
|
|
153
|
-
function
|
|
150
|
+
function Qt(t, e, r) {
|
|
154
151
|
for (const n in e)
|
|
155
|
-
n !== "__proto__" && n !== "constructor" && (n in t ? typeof t[n] == "string" || t[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? r && (t[n] = e[n]) :
|
|
152
|
+
n !== "__proto__" && n !== "constructor" && (n in t ? typeof t[n] == "string" || t[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? r && (t[n] = e[n]) : Qt(t[n], e[n], r) : t[n] = e[n]);
|
|
156
153
|
return t;
|
|
157
154
|
}
|
|
158
155
|
function oe(t) {
|
|
159
156
|
return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
160
157
|
}
|
|
161
|
-
var
|
|
158
|
+
var en = {
|
|
162
159
|
"&": "&",
|
|
163
160
|
"<": "<",
|
|
164
161
|
">": ">",
|
|
@@ -166,13 +163,13 @@ var nn = {
|
|
|
166
163
|
"'": "'",
|
|
167
164
|
"/": "/"
|
|
168
165
|
};
|
|
169
|
-
function
|
|
170
|
-
return typeof t == "string" ? t.replace(/[&<>"'\/]/g, (e) =>
|
|
166
|
+
function tn(t) {
|
|
167
|
+
return typeof t == "string" ? t.replace(/[&<>"'\/]/g, (e) => en[e]) : t;
|
|
171
168
|
}
|
|
172
|
-
const
|
|
173
|
-
function
|
|
169
|
+
const rn = [" ", ",", "?", "!", ";"];
|
|
170
|
+
function nn(t, e, r) {
|
|
174
171
|
e = e || "", r = r || "";
|
|
175
|
-
const n =
|
|
172
|
+
const n = rn.filter((i) => e.indexOf(i) < 0 && r.indexOf(i) < 0);
|
|
176
173
|
if (n.length === 0)
|
|
177
174
|
return !0;
|
|
178
175
|
const a = new RegExp(`(${n.map((i) => i === "?" ? "\\?" : i).join("|")})`);
|
|
@@ -218,7 +215,7 @@ function _e(t, e) {
|
|
|
218
215
|
function Pe(t) {
|
|
219
216
|
return t && t.indexOf("_") > 0 ? t.replace("_", "-") : t;
|
|
220
217
|
}
|
|
221
|
-
class
|
|
218
|
+
class Ot extends Ue {
|
|
222
219
|
constructor(e) {
|
|
223
220
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
224
221
|
ns: ["translation"],
|
|
@@ -247,7 +244,7 @@ class Tt extends Ue {
|
|
|
247
244
|
};
|
|
248
245
|
const i = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator;
|
|
249
246
|
let o = [e, r];
|
|
250
|
-
n && (o = o.concat(i ? n.split(i) : n)), e.indexOf(".") > -1 && (o = e.split("."), a = r, r = o[1]), this.addNamespaces(r),
|
|
247
|
+
n && (o = o.concat(i ? n.split(i) : n)), e.indexOf(".") > -1 && (o = e.split("."), a = r, r = o[1]), this.addNamespaces(r), Rt(this.data, o, a), s.silent || this.emit("added", e, r, n, a);
|
|
251
248
|
}
|
|
252
249
|
addResources(e, r, n) {
|
|
253
250
|
let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
@@ -265,10 +262,10 @@ class Tt extends Ue {
|
|
|
265
262
|
}, o = [e, r];
|
|
266
263
|
e.indexOf(".") > -1 && (o = e.split("."), a = n, n = r, r = o[1]), this.addNamespaces(r);
|
|
267
264
|
let c = Ce(this.data, o) || {};
|
|
268
|
-
a ?
|
|
265
|
+
a ? Qt(c, n, s) : c = {
|
|
269
266
|
...c,
|
|
270
267
|
...n
|
|
271
|
-
},
|
|
268
|
+
}, Rt(this.data, o, c), i.silent || this.emit("added", e, r, n);
|
|
272
269
|
}
|
|
273
270
|
removeResourceBundle(e, r) {
|
|
274
271
|
this.hasResourceBundle(e, r) && delete this.data[e][r], this.removeNamespaces(r), this.emit("removed", e, r);
|
|
@@ -292,7 +289,7 @@ class Tt extends Ue {
|
|
|
292
289
|
return this.data;
|
|
293
290
|
}
|
|
294
291
|
}
|
|
295
|
-
var
|
|
292
|
+
var jt = {
|
|
296
293
|
processors: {},
|
|
297
294
|
addPostProcessor(t) {
|
|
298
295
|
this.processors[t.name] = t;
|
|
@@ -303,11 +300,11 @@ var tr = {
|
|
|
303
300
|
}), e;
|
|
304
301
|
}
|
|
305
302
|
};
|
|
306
|
-
const
|
|
303
|
+
const Tt = {};
|
|
307
304
|
class He extends Ue {
|
|
308
305
|
constructor(e) {
|
|
309
306
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
310
|
-
super(),
|
|
307
|
+
super(), Zr(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = r, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = Z.create("translator");
|
|
311
308
|
}
|
|
312
309
|
changeLanguage(e) {
|
|
313
310
|
e && (this.language = e);
|
|
@@ -326,7 +323,7 @@ class He extends Ue {
|
|
|
326
323
|
n === void 0 && (n = ":");
|
|
327
324
|
const a = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
|
|
328
325
|
let s = r.ns || this.options.defaultNS || [];
|
|
329
|
-
const i = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !r.keySeparator && !this.options.userDefinedNsSeparator && !r.nsSeparator && !
|
|
326
|
+
const i = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !r.keySeparator && !this.options.userDefinedNsSeparator && !r.nsSeparator && !nn(e, n, a);
|
|
330
327
|
if (i && !o) {
|
|
331
328
|
const c = e.match(this.interpolator.nestingRegexp);
|
|
332
329
|
if (c && c.length > 0)
|
|
@@ -406,7 +403,7 @@ class He extends Ue {
|
|
|
406
403
|
ordinal: !1
|
|
407
404
|
}) : "", q = _ && !r.ordinal && r.count === 0 && this.pluralResolver.shouldUseIntlApi(), Y = q && r[`defaultValue${this.options.pluralSeparator}zero`] || r[`defaultValue${R}`] || r[`defaultValue${F}`] || r.defaultValue;
|
|
408
405
|
!this.isValidLookup(d) && A && (m = !0, d = Y), this.isValidLookup(d) || (E = !0, d = i);
|
|
409
|
-
const
|
|
406
|
+
const Gr = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && E ? void 0 : d, le = A && Y !== d && this.options.updateMissing;
|
|
410
407
|
if (E || m || le) {
|
|
411
408
|
if (this.logger.log(le ? "updateKey" : "missingKey", u, c, i, le ? Y : d), s) {
|
|
412
409
|
const z = this.resolve(i, {
|
|
@@ -423,7 +420,7 @@ class He extends Ue {
|
|
|
423
420
|
else
|
|
424
421
|
this.options.saveMissingTo === "all" ? de = this.languageUtils.toResolveHierarchy(r.lng || this.language) : de.push(r.lng || this.language);
|
|
425
422
|
const Pt = (z, se, fe) => {
|
|
426
|
-
const Ht = A && fe !== d ? fe :
|
|
423
|
+
const Ht = A && fe !== d ? fe : Gr;
|
|
427
424
|
this.options.missingKeyHandler ? this.options.missingKeyHandler(z, c, se, Ht, le, r) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(z, c, se, Ht, le, r), this.emit("missingKey", z, c, se, d);
|
|
428
425
|
};
|
|
429
426
|
this.options.saveMissing && (this.options.saveMissingPlurals && _ ? de.forEach((z) => {
|
|
@@ -475,7 +472,7 @@ class He extends Ue {
|
|
|
475
472
|
}, n)), n.interpolation && this.interpolator.reset();
|
|
476
473
|
}
|
|
477
474
|
const o = n.postProcess || this.options.postProcess, c = typeof o == "string" ? [o] : o;
|
|
478
|
-
return e != null && c && c.length && n.applyPostProcessor !== !1 && (e =
|
|
475
|
+
return e != null && c && c.length && n.applyPostProcessor !== !1 && (e = jt.handle(c, e, r, this.options && this.options.postProcessPassResolved ? {
|
|
479
476
|
i18nResolved: {
|
|
480
477
|
...a,
|
|
481
478
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -494,7 +491,7 @@ class He extends Ue {
|
|
|
494
491
|
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
495
492
|
const d = r.count !== void 0 && typeof r.count != "string", p = d && !r.ordinal && r.count === 0 && this.pluralResolver.shouldUseIntlApi(), h = r.context !== void 0 && (typeof r.context == "string" || typeof r.context == "number") && r.context !== "", g = r.lngs ? r.lngs : this.languageUtils.toResolveHierarchy(r.lng || this.language, r.fallbackLng);
|
|
496
493
|
f.forEach((S) => {
|
|
497
|
-
this.isValidLookup(n) || (o = S, !
|
|
494
|
+
this.isValidLookup(n) || (o = S, !Tt[`${g[0]}-${S}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (Tt[`${g[0]}-${S}`] = !0, this.logger.warn(`key "${a}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), g.forEach((C) => {
|
|
498
495
|
if (this.isValidLookup(n))
|
|
499
496
|
return;
|
|
500
497
|
i = C;
|
|
@@ -557,7 +554,7 @@ class He extends Ue {
|
|
|
557
554
|
function Ge(t) {
|
|
558
555
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
559
556
|
}
|
|
560
|
-
class
|
|
557
|
+
class It {
|
|
561
558
|
constructor(e) {
|
|
562
559
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Z.create("languageUtils");
|
|
563
560
|
}
|
|
@@ -626,7 +623,7 @@ class Wt {
|
|
|
626
623
|
}), a;
|
|
627
624
|
}
|
|
628
625
|
}
|
|
629
|
-
let
|
|
626
|
+
let an = [{
|
|
630
627
|
lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
|
|
631
628
|
nr: [1, 2],
|
|
632
629
|
fc: 1
|
|
@@ -718,7 +715,7 @@ let cn = [{
|
|
|
718
715
|
lngs: ["he", "iw"],
|
|
719
716
|
nr: [1, 2, 20, 21],
|
|
720
717
|
fc: 22
|
|
721
|
-
}],
|
|
718
|
+
}], sn = {
|
|
722
719
|
1: function(t) {
|
|
723
720
|
return +(t > 1);
|
|
724
721
|
},
|
|
@@ -786,7 +783,7 @@ let cn = [{
|
|
|
786
783
|
return t == 1 ? 0 : t == 2 ? 1 : (t < 0 || t > 10) && t % 10 == 0 ? 2 : 3;
|
|
787
784
|
}
|
|
788
785
|
};
|
|
789
|
-
const
|
|
786
|
+
const on = ["v1", "v2", "v3"], cn = ["v4"], Wt = {
|
|
790
787
|
zero: 0,
|
|
791
788
|
one: 1,
|
|
792
789
|
two: 2,
|
|
@@ -794,21 +791,21 @@ const ln = ["v1", "v2", "v3"], dn = ["v4"], Ut = {
|
|
|
794
791
|
many: 4,
|
|
795
792
|
other: 5
|
|
796
793
|
};
|
|
797
|
-
function
|
|
794
|
+
function un() {
|
|
798
795
|
const t = {};
|
|
799
|
-
return
|
|
796
|
+
return an.forEach((e) => {
|
|
800
797
|
e.lngs.forEach((r) => {
|
|
801
798
|
t[r] = {
|
|
802
799
|
numbers: e.nr,
|
|
803
|
-
plurals:
|
|
800
|
+
plurals: sn[e.fc]
|
|
804
801
|
};
|
|
805
802
|
});
|
|
806
803
|
}), t;
|
|
807
804
|
}
|
|
808
|
-
class
|
|
805
|
+
class ln {
|
|
809
806
|
constructor(e) {
|
|
810
807
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
811
|
-
this.languageUtils = e, this.options = r, this.logger = Z.create("pluralResolver"), (!this.options.compatibilityJSON ||
|
|
808
|
+
this.languageUtils = e, this.options = r, this.logger = Z.create("pluralResolver"), (!this.options.compatibilityJSON || cn.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = un();
|
|
812
809
|
}
|
|
813
810
|
addRule(e, r) {
|
|
814
811
|
this.rules[e] = r;
|
|
@@ -837,7 +834,7 @@ class hn {
|
|
|
837
834
|
getSuffixes(e) {
|
|
838
835
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
839
836
|
const n = this.getRule(e, r);
|
|
840
|
-
return n ? this.shouldUseIntlApi() ? n.resolvedOptions().pluralCategories.sort((a, s) =>
|
|
837
|
+
return n ? this.shouldUseIntlApi() ? n.resolvedOptions().pluralCategories.sort((a, s) => Wt[a] - Wt[s]).map((a) => `${this.options.prepend}${r.ordinal ? `ordinal${this.options.prepend}` : ""}${a}`) : n.numbers.map((a) => this.getSuffix(e, a, r)) : [];
|
|
841
838
|
}
|
|
842
839
|
getSuffix(e, r) {
|
|
843
840
|
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
@@ -852,14 +849,14 @@ class hn {
|
|
|
852
849
|
return this.options.compatibilityJSON === "v1" ? a === 1 ? "" : typeof a == "number" ? `_plural_${a.toString()}` : s() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? s() : this.options.prepend && n.toString() ? this.options.prepend + n.toString() : n.toString();
|
|
853
850
|
}
|
|
854
851
|
shouldUseIntlApi() {
|
|
855
|
-
return !
|
|
852
|
+
return !on.includes(this.options.compatibilityJSON);
|
|
856
853
|
}
|
|
857
854
|
}
|
|
858
|
-
function
|
|
859
|
-
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s =
|
|
855
|
+
function Ut(t, e, r) {
|
|
856
|
+
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s = jr(t, e, r);
|
|
860
857
|
return !s && a && typeof r == "string" && (s = _e(t, r, n), s === void 0 && (s = _e(e, r, n))), s;
|
|
861
858
|
}
|
|
862
|
-
class
|
|
859
|
+
class dn {
|
|
863
860
|
constructor() {
|
|
864
861
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
865
862
|
this.logger = Z.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((r) => r), this.init(e);
|
|
@@ -870,7 +867,7 @@ class pn {
|
|
|
870
867
|
escapeValue: !0
|
|
871
868
|
});
|
|
872
869
|
const r = e.interpolation;
|
|
873
|
-
this.escape = r.escape !== void 0 ? r.escape :
|
|
870
|
+
this.escape = r.escape !== void 0 ? r.escape : tn, this.escapeValue = r.escapeValue !== void 0 ? r.escapeValue : !0, this.useRawValueToEscape = r.useRawValueToEscape !== void 0 ? r.useRawValueToEscape : !1, this.prefix = r.prefix ? oe(r.prefix) : r.prefixEscaped || "{{", this.suffix = r.suffix ? oe(r.suffix) : r.suffixEscaped || "}}", this.formatSeparator = r.formatSeparator ? r.formatSeparator : r.formatSeparator || ",", this.unescapePrefix = r.unescapeSuffix ? "" : r.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : r.unescapeSuffix || "", this.nestingPrefix = r.nestingPrefix ? oe(r.nestingPrefix) : r.nestingPrefixEscaped || oe("$t("), this.nestingSuffix = r.nestingSuffix ? oe(r.nestingSuffix) : r.nestingSuffixEscaped || oe(")"), this.nestingOptionsSeparator = r.nestingOptionsSeparator ? r.nestingOptionsSeparator : r.nestingOptionsSeparator || ",", this.maxReplaces = r.maxReplaces ? r.maxReplaces : 1e3, this.alwaysFormat = r.alwaysFormat !== void 0 ? r.alwaysFormat : !1, this.resetRegExp();
|
|
874
871
|
}
|
|
875
872
|
reset() {
|
|
876
873
|
this.options && this.init(this.options);
|
|
@@ -891,7 +888,7 @@ class pn {
|
|
|
891
888
|
}
|
|
892
889
|
const l = (h) => {
|
|
893
890
|
if (h.indexOf(this.formatSeparator) < 0) {
|
|
894
|
-
const v =
|
|
891
|
+
const v = Ut(r, c, h, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
895
892
|
return this.alwaysFormat ? this.format(v, void 0, n, {
|
|
896
893
|
...a,
|
|
897
894
|
...r,
|
|
@@ -899,7 +896,7 @@ class pn {
|
|
|
899
896
|
}) : v;
|
|
900
897
|
}
|
|
901
898
|
const g = h.split(this.formatSeparator), S = g.shift().trim(), C = g.join(this.formatSeparator).trim();
|
|
902
|
-
return this.format(
|
|
899
|
+
return this.format(Ut(r, c, S, this.options.keySeparator, this.options.ignoreJSONStructure), C, n, {
|
|
903
900
|
...a,
|
|
904
901
|
...r,
|
|
905
902
|
interpolationkey: S
|
|
@@ -928,7 +925,7 @@ class pn {
|
|
|
928
925
|
} else
|
|
929
926
|
this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`), i = "";
|
|
930
927
|
else
|
|
931
|
-
typeof i != "string" && !this.useRawValueToEscape && (i =
|
|
928
|
+
typeof i != "string" && !this.useRawValueToEscape && (i = Kt(i));
|
|
932
929
|
const S = h.safeValue(i);
|
|
933
930
|
if (e = e.replace(s[0], S), d ? (h.regex.lastIndex += i.length, h.regex.lastIndex -= s[0].length) : h.regex.lastIndex = 0, o++, o >= this.maxReplaces)
|
|
934
931
|
break;
|
|
@@ -968,7 +965,7 @@ class pn {
|
|
|
968
965
|
}
|
|
969
966
|
if (s = r(o.call(this, a[1].trim(), i), i), s && a[0] === e && typeof s != "string")
|
|
970
967
|
return s;
|
|
971
|
-
typeof s != "string" && (s =
|
|
968
|
+
typeof s != "string" && (s = Kt(s)), s || (this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`), s = ""), u && (s = c.reduce((l, f) => this.format(l, f, n.lng, {
|
|
972
969
|
...n,
|
|
973
970
|
interpolationkey: a[1].trim()
|
|
974
971
|
}), s.trim())), e = e.replace(a[0], s), this.regexp.lastIndex = 0;
|
|
@@ -976,7 +973,7 @@ class pn {
|
|
|
976
973
|
return e;
|
|
977
974
|
}
|
|
978
975
|
}
|
|
979
|
-
function
|
|
976
|
+
function fn(t) {
|
|
980
977
|
let e = t.toLowerCase().trim();
|
|
981
978
|
const r = {};
|
|
982
979
|
if (t.indexOf("(") > -1) {
|
|
@@ -1003,7 +1000,7 @@ function ce(t) {
|
|
|
1003
1000
|
return o || (o = t(Pe(a), s), e[i] = o), o(n);
|
|
1004
1001
|
};
|
|
1005
1002
|
}
|
|
1006
|
-
class
|
|
1003
|
+
class hn {
|
|
1007
1004
|
constructor() {
|
|
1008
1005
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1009
1006
|
this.logger = Z.create("formatter"), this.options = e, this.formats = {
|
|
@@ -1058,7 +1055,7 @@ class mn {
|
|
|
1058
1055
|
const {
|
|
1059
1056
|
formatName: u,
|
|
1060
1057
|
formatOptions: l
|
|
1061
|
-
} =
|
|
1058
|
+
} = fn(c);
|
|
1062
1059
|
if (this.formats[u]) {
|
|
1063
1060
|
let f = o;
|
|
1064
1061
|
try {
|
|
@@ -1078,10 +1075,10 @@ class mn {
|
|
|
1078
1075
|
}, e);
|
|
1079
1076
|
}
|
|
1080
1077
|
}
|
|
1081
|
-
function
|
|
1078
|
+
function pn(t, e) {
|
|
1082
1079
|
t.pending[e] !== void 0 && (delete t.pending[e], t.pendingCount--);
|
|
1083
1080
|
}
|
|
1084
|
-
class
|
|
1081
|
+
class gn extends Ue {
|
|
1085
1082
|
constructor(e, r, n) {
|
|
1086
1083
|
let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1087
1084
|
super(), this.backend = e, this.store = r, this.services = n, this.languageUtils = n.languageUtils, this.options = a, this.logger = Z.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = a.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = a.maxRetries >= 0 ? a.maxRetries : 5, this.retryTimeout = a.retryTimeout >= 1 ? a.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(n, a.backend, a);
|
|
@@ -1112,7 +1109,7 @@ class wn extends Ue {
|
|
|
1112
1109
|
r && this.emit("failedLoading", s, i, r), n && this.store.addResourceBundle(s, i, n), this.state[e] = r ? -1 : 2;
|
|
1113
1110
|
const o = {};
|
|
1114
1111
|
this.queue.forEach((c) => {
|
|
1115
|
-
|
|
1112
|
+
Qr(c.loaded, [s], i), pn(c, e), r && c.errors.push(r), c.pendingCount === 0 && !c.done && (Object.keys(c.loaded).forEach((u) => {
|
|
1116
1113
|
o[u] || (o[u] = {});
|
|
1117
1114
|
const l = c.loaded[u];
|
|
1118
1115
|
l.length && l.forEach((f) => {
|
|
@@ -1215,7 +1212,7 @@ class wn extends Ue {
|
|
|
1215
1212
|
}
|
|
1216
1213
|
}
|
|
1217
1214
|
}
|
|
1218
|
-
function
|
|
1215
|
+
function Lt() {
|
|
1219
1216
|
return {
|
|
1220
1217
|
debug: !1,
|
|
1221
1218
|
initImmediate: !0,
|
|
@@ -1274,12 +1271,12 @@ function Dt() {
|
|
|
1274
1271
|
}
|
|
1275
1272
|
};
|
|
1276
1273
|
}
|
|
1277
|
-
function
|
|
1274
|
+
function Dt(t) {
|
|
1278
1275
|
return typeof t.ns == "string" && (t.ns = [t.ns]), typeof t.fallbackLng == "string" && (t.fallbackLng = [t.fallbackLng]), typeof t.fallbackNS == "string" && (t.fallbackNS = [t.fallbackNS]), t.supportedLngs && t.supportedLngs.indexOf("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])), t;
|
|
1279
1276
|
}
|
|
1280
1277
|
function Se() {
|
|
1281
1278
|
}
|
|
1282
|
-
function
|
|
1279
|
+
function mn(t) {
|
|
1283
1280
|
Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((r) => {
|
|
1284
1281
|
typeof t[r] == "function" && (t[r] = t[r].bind(t));
|
|
1285
1282
|
});
|
|
@@ -1287,9 +1284,9 @@ function Sn(t) {
|
|
|
1287
1284
|
class pe extends Ue {
|
|
1288
1285
|
constructor() {
|
|
1289
1286
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 ? arguments[1] : void 0;
|
|
1290
|
-
if (super(), this.options =
|
|
1287
|
+
if (super(), this.options = Dt(e), this.services = {}, this.logger = Z, this.modules = {
|
|
1291
1288
|
external: []
|
|
1292
|
-
},
|
|
1289
|
+
}, mn(this), r && !this.isInitialized && !e.isClone) {
|
|
1293
1290
|
if (!this.options.initImmediate)
|
|
1294
1291
|
return this.init(e, r), this;
|
|
1295
1292
|
setTimeout(() => {
|
|
@@ -1301,11 +1298,11 @@ class pe extends Ue {
|
|
|
1301
1298
|
var e = this;
|
|
1302
1299
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
|
|
1303
1300
|
typeof r == "function" && (n = r, r = {}), !r.defaultNS && r.defaultNS !== !1 && r.ns && (typeof r.ns == "string" ? r.defaultNS = r.ns : r.ns.indexOf("translation") < 0 && (r.defaultNS = r.ns[0]));
|
|
1304
|
-
const a =
|
|
1301
|
+
const a = Lt();
|
|
1305
1302
|
this.options = {
|
|
1306
1303
|
...a,
|
|
1307
1304
|
...this.options,
|
|
1308
|
-
...
|
|
1305
|
+
...Dt(r)
|
|
1309
1306
|
}, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
|
|
1310
1307
|
...a.interpolation,
|
|
1311
1308
|
...this.options.interpolation
|
|
@@ -1316,17 +1313,17 @@ class pe extends Ue {
|
|
|
1316
1313
|
if (!this.options.isClone) {
|
|
1317
1314
|
this.modules.logger ? Z.init(s(this.modules.logger), this.options) : Z.init(null, this.options);
|
|
1318
1315
|
let l;
|
|
1319
|
-
this.modules.formatter ? l = this.modules.formatter : typeof Intl < "u" && (l =
|
|
1320
|
-
const f = new
|
|
1321
|
-
this.store = new
|
|
1316
|
+
this.modules.formatter ? l = this.modules.formatter : typeof Intl < "u" && (l = hn);
|
|
1317
|
+
const f = new It(this.options);
|
|
1318
|
+
this.store = new Ot(this.options.resources, this.options);
|
|
1322
1319
|
const d = this.services;
|
|
1323
|
-
d.logger = Z, d.resourceStore = this.store, d.languageUtils = f, d.pluralResolver = new
|
|
1320
|
+
d.logger = Z, d.resourceStore = this.store, d.languageUtils = f, d.pluralResolver = new ln(f, {
|
|
1324
1321
|
prepend: this.options.pluralSeparator,
|
|
1325
1322
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
1326
1323
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1327
|
-
}), l && (!this.options.interpolation.format || this.options.interpolation.format === a.interpolation.format) && (d.formatter = s(l), d.formatter.init(d, this.options), this.options.interpolation.format = d.formatter.format.bind(d.formatter)), d.interpolator = new
|
|
1324
|
+
}), l && (!this.options.interpolation.format || this.options.interpolation.format === a.interpolation.format) && (d.formatter = s(l), d.formatter.init(d, this.options), this.options.interpolation.format = d.formatter.format.bind(d.formatter)), d.interpolator = new dn(this.options), d.utils = {
|
|
1328
1325
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1329
|
-
}, d.backendConnector = new
|
|
1326
|
+
}, d.backendConnector = new gn(s(this.modules.backend), d.resourceStore, d, this.options), d.backendConnector.on("*", function(p) {
|
|
1330
1327
|
for (var h = arguments.length, g = new Array(h > 1 ? h - 1 : 0), S = 1; S < h; S++)
|
|
1331
1328
|
g[S - 1] = arguments[S];
|
|
1332
1329
|
e.emit(p, ...g);
|
|
@@ -1391,7 +1388,7 @@ class pe extends Ue {
|
|
|
1391
1388
|
throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1392
1389
|
if (!e.type)
|
|
1393
1390
|
throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1394
|
-
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" &&
|
|
1391
|
+
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && jt.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1395
1392
|
}
|
|
1396
1393
|
setResolvedLanguage(e) {
|
|
1397
1394
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
|
|
@@ -1492,7 +1489,7 @@ class pe extends Ue {
|
|
|
1492
1489
|
dir(e) {
|
|
1493
1490
|
if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e)
|
|
1494
1491
|
return "rtl";
|
|
1495
|
-
const r = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], n = this.services && this.services.languageUtils || new
|
|
1492
|
+
const r = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], n = this.services && this.services.languageUtils || new It(Lt());
|
|
1496
1493
|
return r.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1497
1494
|
}
|
|
1498
1495
|
static createInstance() {
|
|
@@ -1514,7 +1511,7 @@ class pe extends Ue {
|
|
|
1514
1511
|
...this.services
|
|
1515
1512
|
}, s.services.utils = {
|
|
1516
1513
|
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
1517
|
-
}, n && (s.store = new
|
|
1514
|
+
}, n && (s.store = new Ot(this.store.data, a), s.services.resourceStore = s.store), s.translator = new He(s.services, a), s.translator.on("*", function(o) {
|
|
1518
1515
|
for (var c = arguments.length, u = new Array(c > 1 ? c - 1 : 0), l = 1; l < c; l++)
|
|
1519
1516
|
u[l - 1] = arguments[l];
|
|
1520
1517
|
s.emit(o, ...u);
|
|
@@ -1548,15 +1545,15 @@ k.setDefaultNamespace;
|
|
|
1548
1545
|
k.hasLoadedNamespace;
|
|
1549
1546
|
k.loadNamespaces;
|
|
1550
1547
|
k.loadLanguages;
|
|
1551
|
-
const
|
|
1548
|
+
const yn = {
|
|
1552
1549
|
es: {
|
|
1553
1550
|
translation: {
|
|
1554
|
-
...
|
|
1551
|
+
...qr
|
|
1555
1552
|
}
|
|
1556
1553
|
}
|
|
1557
1554
|
};
|
|
1558
1555
|
k.init({
|
|
1559
|
-
resources:
|
|
1556
|
+
resources: yn,
|
|
1560
1557
|
lng: "es",
|
|
1561
1558
|
// language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
|
|
1562
1559
|
// you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage
|
|
@@ -1606,41 +1603,32 @@ const j = {
|
|
|
1606
1603
|
level: "warning"
|
|
1607
1604
|
}
|
|
1608
1605
|
};
|
|
1609
|
-
class
|
|
1610
|
-
get(e = "default") {
|
|
1611
|
-
var
|
|
1606
|
+
class wn extends Xr {
|
|
1607
|
+
get(e = "default", r) {
|
|
1608
|
+
var s, i;
|
|
1612
1609
|
if (e instanceof Error)
|
|
1613
1610
|
return this.logError(e.message), {
|
|
1614
1611
|
...j.internalError,
|
|
1615
1612
|
title: be(j.internalError.title),
|
|
1616
|
-
message: be(j.internalError.message)
|
|
1613
|
+
message: be(j.internalError.message),
|
|
1614
|
+
uuid: r
|
|
1617
1615
|
};
|
|
1618
|
-
const
|
|
1616
|
+
const n = typeof e == "string" ? e : e.code ?? e.errorType, a = typeof e == "string" ? {} : { ...e };
|
|
1619
1617
|
return {
|
|
1620
|
-
...j[
|
|
1618
|
+
...j[n] ?? j.default,
|
|
1621
1619
|
title: be(
|
|
1622
|
-
((
|
|
1623
|
-
|
|
1620
|
+
((s = j[n]) == null ? void 0 : s.title) ?? j.default.title,
|
|
1621
|
+
a
|
|
1624
1622
|
),
|
|
1625
1623
|
message: be(
|
|
1626
|
-
((
|
|
1627
|
-
|
|
1628
|
-
)
|
|
1624
|
+
((i = j[n]) == null ? void 0 : i.message) ?? j.default.message,
|
|
1625
|
+
a
|
|
1626
|
+
),
|
|
1627
|
+
uuid: r
|
|
1629
1628
|
};
|
|
1630
1629
|
}
|
|
1631
1630
|
}
|
|
1632
|
-
|
|
1633
|
-
constructor(r) {
|
|
1634
|
-
super();
|
|
1635
|
-
Kt(this, "messageError");
|
|
1636
|
-
const n = new vn();
|
|
1637
|
-
this.messageError = n.get(r), this.logError("MessageErrorBFF", JSON.stringify(this.messageError));
|
|
1638
|
-
}
|
|
1639
|
-
get() {
|
|
1640
|
-
return this.messageError;
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
var rr = {}, nr = { exports: {} };
|
|
1631
|
+
var er = {}, tr = { exports: {} };
|
|
1644
1632
|
(function(t) {
|
|
1645
1633
|
function e(r) {
|
|
1646
1634
|
return r && r.__esModule ? r : {
|
|
@@ -1648,9 +1636,9 @@ var rr = {}, nr = { exports: {} };
|
|
|
1648
1636
|
};
|
|
1649
1637
|
}
|
|
1650
1638
|
t.exports = e, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
1651
|
-
})(
|
|
1652
|
-
var
|
|
1653
|
-
const b = crypto, G = (t) => t instanceof CryptoKey,
|
|
1639
|
+
})(tr);
|
|
1640
|
+
var rr = tr.exports;
|
|
1641
|
+
const b = crypto, G = (t) => t instanceof CryptoKey, nr = async (t, e) => {
|
|
1654
1642
|
const r = `SHA-${t.slice(-3)}`;
|
|
1655
1643
|
return new Uint8Array(await b.subtle.digest(r, e));
|
|
1656
1644
|
}, K = new TextEncoder(), X = new TextDecoder(), Ke = 2 ** 32;
|
|
@@ -1661,7 +1649,7 @@ function Q(...t) {
|
|
|
1661
1649
|
r.set(a, n), n += a.length;
|
|
1662
1650
|
}), r;
|
|
1663
1651
|
}
|
|
1664
|
-
function
|
|
1652
|
+
function Sn(t, e) {
|
|
1665
1653
|
return Q(K.encode(t), new Uint8Array([0]), e);
|
|
1666
1654
|
}
|
|
1667
1655
|
function it(t, e, r) {
|
|
@@ -1669,7 +1657,7 @@ function it(t, e, r) {
|
|
|
1669
1657
|
throw new RangeError(`value must be >= 0 and <= ${Ke - 1}. Received ${e}`);
|
|
1670
1658
|
t.set([e >>> 24, e >>> 16, e >>> 8, e & 255], r);
|
|
1671
1659
|
}
|
|
1672
|
-
function
|
|
1660
|
+
function ar(t) {
|
|
1673
1661
|
const e = Math.floor(t / Ke), r = t % Ke, n = new Uint8Array(8);
|
|
1674
1662
|
return it(n, e, 0), it(n, r, 4), n;
|
|
1675
1663
|
}
|
|
@@ -1680,11 +1668,11 @@ function pt(t) {
|
|
|
1680
1668
|
function ze(t) {
|
|
1681
1669
|
return Q(pt(t.length), t);
|
|
1682
1670
|
}
|
|
1683
|
-
async function
|
|
1671
|
+
async function bn(t, e, r) {
|
|
1684
1672
|
const n = Math.ceil((e >> 3) / 32), a = new Uint8Array(n * 32);
|
|
1685
1673
|
for (let s = 0; s < n; s++) {
|
|
1686
1674
|
const i = new Uint8Array(4 + t.length + r.length);
|
|
1687
|
-
i.set(pt(s + 1)), i.set(t, 4), i.set(r, 4 + t.length), a.set(await
|
|
1675
|
+
i.set(pt(s + 1)), i.set(t, 4), i.set(r, 4 + t.length), a.set(await nr("sha256", i), s * 32);
|
|
1688
1676
|
}
|
|
1689
1677
|
return a.slice(0, e >> 3);
|
|
1690
1678
|
}
|
|
@@ -1695,7 +1683,7 @@ const gt = (t) => {
|
|
|
1695
1683
|
for (let a = 0; a < e.length; a += r)
|
|
1696
1684
|
n.push(String.fromCharCode.apply(null, e.subarray(a, a + r)));
|
|
1697
1685
|
return btoa(n.join(""));
|
|
1698
|
-
}, O = (t) => gt(t).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"),
|
|
1686
|
+
}, O = (t) => gt(t).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"), sr = (t) => {
|
|
1699
1687
|
const e = atob(t), r = new Uint8Array(e.length);
|
|
1700
1688
|
for (let n = 0; n < e.length; n++)
|
|
1701
1689
|
r[n] = e.charCodeAt(n);
|
|
@@ -1704,7 +1692,7 @@ const gt = (t) => {
|
|
|
1704
1692
|
let e = t;
|
|
1705
1693
|
e instanceof Uint8Array && (e = X.decode(e)), e = e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
1706
1694
|
try {
|
|
1707
|
-
return
|
|
1695
|
+
return sr(e);
|
|
1708
1696
|
} catch {
|
|
1709
1697
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
1710
1698
|
}
|
|
@@ -1782,7 +1770,7 @@ class B extends L {
|
|
|
1782
1770
|
return "ERR_JWT_INVALID";
|
|
1783
1771
|
}
|
|
1784
1772
|
}
|
|
1785
|
-
class
|
|
1773
|
+
class ir extends L {
|
|
1786
1774
|
constructor() {
|
|
1787
1775
|
super(...arguments), this.code = "ERR_JWK_INVALID";
|
|
1788
1776
|
}
|
|
@@ -1806,7 +1794,7 @@ class mt extends L {
|
|
|
1806
1794
|
return "ERR_JWKS_NO_MATCHING_KEY";
|
|
1807
1795
|
}
|
|
1808
1796
|
}
|
|
1809
|
-
class
|
|
1797
|
+
class or extends L {
|
|
1810
1798
|
constructor() {
|
|
1811
1799
|
super(...arguments), this.code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS", this.message = "multiple matching keys found in the JSON Web Key Set";
|
|
1812
1800
|
}
|
|
@@ -1814,7 +1802,7 @@ class ur extends L {
|
|
|
1814
1802
|
return "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
1815
1803
|
}
|
|
1816
1804
|
}
|
|
1817
|
-
class
|
|
1805
|
+
class cr extends L {
|
|
1818
1806
|
constructor() {
|
|
1819
1807
|
super(...arguments), this.code = "ERR_JWKS_TIMEOUT", this.message = "request timed out";
|
|
1820
1808
|
}
|
|
@@ -1830,25 +1818,25 @@ class yt extends L {
|
|
|
1830
1818
|
return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
1831
1819
|
}
|
|
1832
1820
|
}
|
|
1833
|
-
const
|
|
1821
|
+
const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1834
1822
|
__proto__: null,
|
|
1835
1823
|
JOSEAlgNotAllowed: Re,
|
|
1836
1824
|
JOSEError: L,
|
|
1837
1825
|
JOSENotSupported: x,
|
|
1838
1826
|
JWEDecryptionFailed: ge,
|
|
1839
1827
|
JWEInvalid: y,
|
|
1840
|
-
JWKInvalid:
|
|
1828
|
+
JWKInvalid: ir,
|
|
1841
1829
|
JWKSInvalid: Le,
|
|
1842
|
-
JWKSMultipleMatchingKeys:
|
|
1830
|
+
JWKSMultipleMatchingKeys: or,
|
|
1843
1831
|
JWKSNoMatchingKey: mt,
|
|
1844
|
-
JWKSTimeout:
|
|
1832
|
+
JWKSTimeout: cr,
|
|
1845
1833
|
JWSInvalid: P,
|
|
1846
1834
|
JWSSignatureVerificationFailed: yt,
|
|
1847
1835
|
JWTClaimValidationFailed: V,
|
|
1848
1836
|
JWTExpired: ot,
|
|
1849
1837
|
JWTInvalid: B
|
|
1850
1838
|
}, Symbol.toStringTag, { value: "Module" })), De = b.getRandomValues.bind(b);
|
|
1851
|
-
function
|
|
1839
|
+
function ur(t) {
|
|
1852
1840
|
switch (t) {
|
|
1853
1841
|
case "A128GCM":
|
|
1854
1842
|
case "A128GCMKW":
|
|
@@ -1865,14 +1853,14 @@ function dr(t) {
|
|
|
1865
1853
|
throw new x(`Unsupported JWE Algorithm: ${t}`);
|
|
1866
1854
|
}
|
|
1867
1855
|
}
|
|
1868
|
-
const
|
|
1869
|
-
if (e.length << 3 !==
|
|
1856
|
+
const lr = (t) => De(new Uint8Array(ur(t) >> 3)), dr = (t, e) => {
|
|
1857
|
+
if (e.length << 3 !== ur(t))
|
|
1870
1858
|
throw new y("Invalid Initialization Vector length");
|
|
1871
1859
|
}, Oe = (t, e) => {
|
|
1872
1860
|
const r = t.byteLength << 3;
|
|
1873
1861
|
if (r !== e)
|
|
1874
1862
|
throw new y(`Invalid Content Encryption Key length. Expected ${e} bits, got ${r} bits`);
|
|
1875
|
-
},
|
|
1863
|
+
}, En = (t, e) => {
|
|
1876
1864
|
if (!(t instanceof Uint8Array))
|
|
1877
1865
|
throw new TypeError("First argument must be a buffer");
|
|
1878
1866
|
if (!(e instanceof Uint8Array))
|
|
@@ -1894,7 +1882,7 @@ function re(t, e) {
|
|
|
1894
1882
|
function Ee(t) {
|
|
1895
1883
|
return parseInt(t.name.slice(4), 10);
|
|
1896
1884
|
}
|
|
1897
|
-
function
|
|
1885
|
+
function An(t) {
|
|
1898
1886
|
switch (t) {
|
|
1899
1887
|
case "ES256":
|
|
1900
1888
|
return "P-256";
|
|
@@ -1906,7 +1894,7 @@ function Pn(t) {
|
|
|
1906
1894
|
throw new Error("unreachable");
|
|
1907
1895
|
}
|
|
1908
1896
|
}
|
|
1909
|
-
function
|
|
1897
|
+
function fr(t, e) {
|
|
1910
1898
|
if (e.length && !e.some((r) => t.usages.includes(r))) {
|
|
1911
1899
|
let r = "CryptoKey does not support this operation, its usages must include ";
|
|
1912
1900
|
if (e.length > 2) {
|
|
@@ -1917,7 +1905,7 @@ function pr(t, e) {
|
|
|
1917
1905
|
throw new TypeError(r);
|
|
1918
1906
|
}
|
|
1919
1907
|
}
|
|
1920
|
-
function
|
|
1908
|
+
function xn(t, e, ...r) {
|
|
1921
1909
|
switch (e) {
|
|
1922
1910
|
case "HS256":
|
|
1923
1911
|
case "HS384":
|
|
@@ -1959,7 +1947,7 @@ function Hn(t, e, ...r) {
|
|
|
1959
1947
|
case "ES512": {
|
|
1960
1948
|
if (!re(t.algorithm, "ECDSA"))
|
|
1961
1949
|
throw U("ECDSA");
|
|
1962
|
-
const n =
|
|
1950
|
+
const n = An(e);
|
|
1963
1951
|
if (t.algorithm.namedCurve !== n)
|
|
1964
1952
|
throw U(n, "algorithm.namedCurve");
|
|
1965
1953
|
break;
|
|
@@ -1967,7 +1955,7 @@ function Hn(t, e, ...r) {
|
|
|
1967
1955
|
default:
|
|
1968
1956
|
throw new TypeError("CryptoKey does not support this operation");
|
|
1969
1957
|
}
|
|
1970
|
-
|
|
1958
|
+
fr(t, r);
|
|
1971
1959
|
}
|
|
1972
1960
|
function ae(t, e, ...r) {
|
|
1973
1961
|
switch (e) {
|
|
@@ -2022,9 +2010,9 @@ function ae(t, e, ...r) {
|
|
|
2022
2010
|
default:
|
|
2023
2011
|
throw new TypeError("CryptoKey does not support this operation");
|
|
2024
2012
|
}
|
|
2025
|
-
|
|
2013
|
+
fr(t, r);
|
|
2026
2014
|
}
|
|
2027
|
-
function
|
|
2015
|
+
function hr(t, e, ...r) {
|
|
2028
2016
|
if (r.length > 2) {
|
|
2029
2017
|
const n = r.pop();
|
|
2030
2018
|
t += `one of type ${r.join(", ")}, or ${n}.`;
|
|
@@ -2032,21 +2020,21 @@ function gr(t, e, ...r) {
|
|
|
2032
2020
|
r.length === 2 ? t += `one of type ${r[0]} or ${r[1]}.` : t += `of type ${r[0]}.`;
|
|
2033
2021
|
return e == null ? t += ` Received ${e}` : typeof e == "function" && e.name ? t += ` Received function ${e.name}` : typeof e == "object" && e != null && e.constructor && e.constructor.name && (t += ` Received an instance of ${e.constructor.name}`), t;
|
|
2034
2022
|
}
|
|
2035
|
-
const M = (t, ...e) =>
|
|
2036
|
-
function
|
|
2037
|
-
return
|
|
2023
|
+
const M = (t, ...e) => hr("Key must be ", t, ...e);
|
|
2024
|
+
function pr(t, e, ...r) {
|
|
2025
|
+
return hr(`Key for the ${t} algorithm must be `, e, ...r);
|
|
2038
2026
|
}
|
|
2039
|
-
const
|
|
2040
|
-
async function
|
|
2027
|
+
const gr = (t) => G(t), H = ["CryptoKey"];
|
|
2028
|
+
async function Cn(t, e, r, n, a, s) {
|
|
2041
2029
|
if (!(e instanceof Uint8Array))
|
|
2042
2030
|
throw new TypeError(M(e, "Uint8Array"));
|
|
2043
2031
|
const i = parseInt(t.slice(1, 4), 10), o = await b.subtle.importKey("raw", e.subarray(i >> 3), "AES-CBC", !1, ["decrypt"]), c = await b.subtle.importKey("raw", e.subarray(0, i >> 3), {
|
|
2044
2032
|
hash: `SHA-${i << 1}`,
|
|
2045
2033
|
name: "HMAC"
|
|
2046
|
-
}, !1, ["sign"]), u = Q(s, n, r,
|
|
2034
|
+
}, !1, ["sign"]), u = Q(s, n, r, ar(s.length << 3)), l = new Uint8Array((await b.subtle.sign("HMAC", c, u)).slice(0, i >> 3));
|
|
2047
2035
|
let f;
|
|
2048
2036
|
try {
|
|
2049
|
-
f =
|
|
2037
|
+
f = En(a, l);
|
|
2050
2038
|
} catch {
|
|
2051
2039
|
}
|
|
2052
2040
|
if (!f)
|
|
@@ -2060,7 +2048,7 @@ async function Kn(t, e, r, n, a, s) {
|
|
|
2060
2048
|
throw new ge();
|
|
2061
2049
|
return d;
|
|
2062
2050
|
}
|
|
2063
|
-
async function
|
|
2051
|
+
async function _n(t, e, r, n, a, s) {
|
|
2064
2052
|
let i;
|
|
2065
2053
|
e instanceof Uint8Array ? i = await b.subtle.importKey("raw", e, "AES-GCM", !1, ["decrypt"]) : (ae(e, t, "decrypt"), i = e);
|
|
2066
2054
|
try {
|
|
@@ -2074,24 +2062,24 @@ async function Rn(t, e, r, n, a, s) {
|
|
|
2074
2062
|
throw new ge();
|
|
2075
2063
|
}
|
|
2076
2064
|
}
|
|
2077
|
-
const
|
|
2065
|
+
const mr = async (t, e, r, n, a, s) => {
|
|
2078
2066
|
if (!G(e) && !(e instanceof Uint8Array))
|
|
2079
2067
|
throw new TypeError(M(e, ...H, "Uint8Array"));
|
|
2080
|
-
switch (
|
|
2068
|
+
switch (dr(t, n), t) {
|
|
2081
2069
|
case "A128CBC-HS256":
|
|
2082
2070
|
case "A192CBC-HS384":
|
|
2083
2071
|
case "A256CBC-HS512":
|
|
2084
|
-
return e instanceof Uint8Array && Oe(e, parseInt(t.slice(-3), 10)),
|
|
2072
|
+
return e instanceof Uint8Array && Oe(e, parseInt(t.slice(-3), 10)), Cn(t, e, r, n, a, s);
|
|
2085
2073
|
case "A128GCM":
|
|
2086
2074
|
case "A192GCM":
|
|
2087
2075
|
case "A256GCM":
|
|
2088
|
-
return e instanceof Uint8Array && Oe(e, parseInt(t.slice(1, 4), 10)),
|
|
2076
|
+
return e instanceof Uint8Array && Oe(e, parseInt(t.slice(1, 4), 10)), _n(t, e, r, n, a, s);
|
|
2089
2077
|
default:
|
|
2090
2078
|
throw new x("Unsupported JWE Content Encryption Algorithm");
|
|
2091
2079
|
}
|
|
2092
|
-
},
|
|
2080
|
+
}, Pn = async () => {
|
|
2093
2081
|
throw new x('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.');
|
|
2094
|
-
},
|
|
2082
|
+
}, Hn = async () => {
|
|
2095
2083
|
throw new x('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.');
|
|
2096
2084
|
}, me = (...t) => {
|
|
2097
2085
|
const e = t.filter(Boolean);
|
|
@@ -2112,11 +2100,11 @@ const wr = async (t, e, r, n, a, s) => {
|
|
|
2112
2100
|
}
|
|
2113
2101
|
return !0;
|
|
2114
2102
|
};
|
|
2115
|
-
function
|
|
2103
|
+
function Kn(t) {
|
|
2116
2104
|
return typeof t == "object" && t !== null;
|
|
2117
2105
|
}
|
|
2118
2106
|
function I(t) {
|
|
2119
|
-
if (!
|
|
2107
|
+
if (!Kn(t) || Object.prototype.toString.call(t) !== "[object Object]")
|
|
2120
2108
|
return !1;
|
|
2121
2109
|
if (Object.getPrototypeOf(t) === null)
|
|
2122
2110
|
return !0;
|
|
@@ -2130,11 +2118,11 @@ const Je = [
|
|
|
2130
2118
|
!0,
|
|
2131
2119
|
["sign"]
|
|
2132
2120
|
];
|
|
2133
|
-
function
|
|
2121
|
+
function yr(t, e) {
|
|
2134
2122
|
if (t.algorithm.length !== parseInt(e.slice(1, 4), 10))
|
|
2135
2123
|
throw new TypeError(`Invalid key size for alg: ${e}`);
|
|
2136
2124
|
}
|
|
2137
|
-
function
|
|
2125
|
+
function wr(t, e, r) {
|
|
2138
2126
|
if (G(t))
|
|
2139
2127
|
return ae(t, e, r), t;
|
|
2140
2128
|
if (t instanceof Uint8Array)
|
|
@@ -2142,17 +2130,17 @@ function br(t, e, r) {
|
|
|
2142
2130
|
throw new TypeError(M(t, ...H, "Uint8Array"));
|
|
2143
2131
|
}
|
|
2144
2132
|
const ct = async (t, e, r) => {
|
|
2145
|
-
const n = await
|
|
2146
|
-
|
|
2133
|
+
const n = await wr(e, t, "wrapKey");
|
|
2134
|
+
yr(n, t);
|
|
2147
2135
|
const a = await b.subtle.importKey("raw", r, ...Je);
|
|
2148
2136
|
return new Uint8Array(await b.subtle.wrapKey("raw", a, n, "AES-KW"));
|
|
2149
2137
|
}, ut = async (t, e, r) => {
|
|
2150
|
-
const n = await
|
|
2151
|
-
|
|
2138
|
+
const n = await wr(e, t, "unwrapKey");
|
|
2139
|
+
yr(n, t);
|
|
2152
2140
|
const a = await b.subtle.unwrapKey("raw", r, n, "AES-KW", ...Je);
|
|
2153
2141
|
return new Uint8Array(await b.subtle.exportKey("raw", a));
|
|
2154
2142
|
};
|
|
2155
|
-
async function
|
|
2143
|
+
async function Sr(t, e, r, n, a = new Uint8Array(0), s = new Uint8Array(0)) {
|
|
2156
2144
|
if (!G(t))
|
|
2157
2145
|
throw new TypeError(M(t, ...H));
|
|
2158
2146
|
if (ae(t, "ECDH"), !G(e))
|
|
@@ -2165,32 +2153,32 @@ async function vr(t, e, r, n, a = new Uint8Array(0), s = new Uint8Array(0)) {
|
|
|
2165
2153
|
name: t.algorithm.name,
|
|
2166
2154
|
public: t
|
|
2167
2155
|
}, e, o));
|
|
2168
|
-
return
|
|
2156
|
+
return bn(c, n, i);
|
|
2169
2157
|
}
|
|
2170
|
-
async function
|
|
2158
|
+
async function Rn(t) {
|
|
2171
2159
|
if (!G(t))
|
|
2172
2160
|
throw new TypeError(M(t, ...H));
|
|
2173
2161
|
return b.subtle.generateKey(t.algorithm, !0, ["deriveBits"]);
|
|
2174
2162
|
}
|
|
2175
|
-
function
|
|
2163
|
+
function br(t) {
|
|
2176
2164
|
if (!G(t))
|
|
2177
2165
|
throw new TypeError(M(t, ...H));
|
|
2178
2166
|
return ["P-256", "P-384", "P-521"].includes(t.algorithm.namedCurve) || t.algorithm.name === "X25519" || t.algorithm.name === "X448";
|
|
2179
2167
|
}
|
|
2180
|
-
function
|
|
2168
|
+
function On(t) {
|
|
2181
2169
|
if (!(t instanceof Uint8Array) || t.length < 8)
|
|
2182
2170
|
throw new y("PBES2 Salt Input must be 8 or more octets");
|
|
2183
2171
|
}
|
|
2184
|
-
function
|
|
2172
|
+
function Tn(t, e) {
|
|
2185
2173
|
if (t instanceof Uint8Array)
|
|
2186
2174
|
return b.subtle.importKey("raw", t, "PBKDF2", !1, ["deriveBits"]);
|
|
2187
2175
|
if (G(t))
|
|
2188
2176
|
return ae(t, e, "deriveBits", "deriveKey"), t;
|
|
2189
2177
|
throw new TypeError(M(t, ...H, "Uint8Array"));
|
|
2190
2178
|
}
|
|
2191
|
-
async function
|
|
2192
|
-
|
|
2193
|
-
const a =
|
|
2179
|
+
async function vr(t, e, r, n) {
|
|
2180
|
+
On(t);
|
|
2181
|
+
const a = Sn(e, t), s = parseInt(e.slice(13, 16), 10), i = {
|
|
2194
2182
|
hash: `SHA-${e.slice(8, 11)}`,
|
|
2195
2183
|
iterations: r,
|
|
2196
2184
|
name: "PBKDF2",
|
|
@@ -2198,18 +2186,18 @@ async function Ar(t, e, r, n) {
|
|
|
2198
2186
|
}, o = {
|
|
2199
2187
|
length: s,
|
|
2200
2188
|
name: "AES-KW"
|
|
2201
|
-
}, c = await
|
|
2189
|
+
}, c = await Tn(n, e);
|
|
2202
2190
|
if (c.usages.includes("deriveBits"))
|
|
2203
2191
|
return new Uint8Array(await b.subtle.deriveBits(i, c, s));
|
|
2204
2192
|
if (c.usages.includes("deriveKey"))
|
|
2205
2193
|
return b.subtle.deriveKey(i, c, o, !1, ["wrapKey", "unwrapKey"]);
|
|
2206
2194
|
throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');
|
|
2207
2195
|
}
|
|
2208
|
-
const
|
|
2209
|
-
const s = await
|
|
2196
|
+
const In = async (t, e, r, n = 2048, a = De(new Uint8Array(16))) => {
|
|
2197
|
+
const s = await vr(a, t, n, e);
|
|
2210
2198
|
return { encryptedKey: await ct(t.slice(-6), s, r), p2c: n, p2s: O(a) };
|
|
2211
|
-
},
|
|
2212
|
-
const s = await
|
|
2199
|
+
}, Wn = async (t, e, r, n, a) => {
|
|
2200
|
+
const s = await vr(a, t, n, e);
|
|
2213
2201
|
return ut(t.slice(-6), s, r);
|
|
2214
2202
|
};
|
|
2215
2203
|
function Te(t) {
|
|
@@ -2229,7 +2217,7 @@ const Ne = (t, e) => {
|
|
|
2229
2217
|
if (typeof r != "number" || r < 2048)
|
|
2230
2218
|
throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`);
|
|
2231
2219
|
}
|
|
2232
|
-
},
|
|
2220
|
+
}, Un = async (t, e, r) => {
|
|
2233
2221
|
if (!G(e))
|
|
2234
2222
|
throw new TypeError(M(e, ...H));
|
|
2235
2223
|
if (ae(e, t, "encrypt", "wrapKey"), Ne(t, e), e.usages.includes("encrypt"))
|
|
@@ -2239,7 +2227,7 @@ const Ne = (t, e) => {
|
|
|
2239
2227
|
return new Uint8Array(await b.subtle.wrapKey("raw", n, e, Te(t)));
|
|
2240
2228
|
}
|
|
2241
2229
|
throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation');
|
|
2242
|
-
},
|
|
2230
|
+
}, Ln = async (t, e, r) => {
|
|
2243
2231
|
if (!G(e))
|
|
2244
2232
|
throw new TypeError(M(e, ...H));
|
|
2245
2233
|
if (ae(e, t, "decrypt", "unwrapKey"), Ne(t, e), e.usages.includes("decrypt"))
|
|
@@ -2267,28 +2255,28 @@ function wt(t) {
|
|
|
2267
2255
|
throw new x(`Unsupported JWE Algorithm: ${t}`);
|
|
2268
2256
|
}
|
|
2269
2257
|
}
|
|
2270
|
-
const ie = (t) => De(new Uint8Array(wt(t) >> 3)),
|
|
2258
|
+
const ie = (t) => De(new Uint8Array(wt(t) >> 3)), Er = (t, e) => {
|
|
2271
2259
|
const r = (t.match(/.{1,64}/g) || []).join(`
|
|
2272
2260
|
`);
|
|
2273
2261
|
return `-----BEGIN ${e}-----
|
|
2274
2262
|
${r}
|
|
2275
2263
|
-----END ${e}-----`;
|
|
2276
|
-
},
|
|
2264
|
+
}, Ar = async (t, e, r) => {
|
|
2277
2265
|
if (!G(r))
|
|
2278
2266
|
throw new TypeError(M(r, ...H));
|
|
2279
2267
|
if (!r.extractable)
|
|
2280
2268
|
throw new TypeError("CryptoKey is not extractable");
|
|
2281
2269
|
if (r.type !== t)
|
|
2282
2270
|
throw new TypeError(`key is not a ${t} key`);
|
|
2283
|
-
return
|
|
2284
|
-
},
|
|
2271
|
+
return Er(gt(new Uint8Array(await b.subtle.exportKey(e, r))), `${t.toUpperCase()} KEY`);
|
|
2272
|
+
}, Dn = (t) => Ar("public", "spki", t), Jn = (t) => Ar("private", "pkcs8", t), te = (t, e, r = 0) => {
|
|
2285
2273
|
r === 0 && (e.unshift(e.length), e.unshift(6));
|
|
2286
2274
|
let n = t.indexOf(e[0], r);
|
|
2287
2275
|
if (n === -1)
|
|
2288
2276
|
return !1;
|
|
2289
2277
|
const a = t.subarray(n, n + e.length);
|
|
2290
2278
|
return a.length !== e.length ? !1 : a.every((s, i) => s === e[i]) || te(t, e, n + 1);
|
|
2291
|
-
},
|
|
2279
|
+
}, Jt = (t) => {
|
|
2292
2280
|
switch (!0) {
|
|
2293
2281
|
case te(t, [42, 134, 72, 206, 61, 3, 1, 7]):
|
|
2294
2282
|
return "P-256";
|
|
@@ -2307,7 +2295,7 @@ ${r}
|
|
|
2307
2295
|
default:
|
|
2308
2296
|
throw new x("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
2309
2297
|
}
|
|
2310
|
-
},
|
|
2298
|
+
}, xr = async (t, e, r, n, a) => {
|
|
2311
2299
|
var s;
|
|
2312
2300
|
let i, o;
|
|
2313
2301
|
const c = new Uint8Array(atob(r.replace(t, "")).split("").map((l) => l.charCodeAt(0))), u = e === "spki";
|
|
@@ -2344,27 +2332,27 @@ ${r}
|
|
|
2344
2332
|
case "ECDH-ES+A128KW":
|
|
2345
2333
|
case "ECDH-ES+A192KW":
|
|
2346
2334
|
case "ECDH-ES+A256KW": {
|
|
2347
|
-
const l =
|
|
2335
|
+
const l = Jt(c);
|
|
2348
2336
|
i = l.startsWith("P-") ? { name: "ECDH", namedCurve: l } : { name: l }, o = u ? [] : ["deriveBits"];
|
|
2349
2337
|
break;
|
|
2350
2338
|
}
|
|
2351
2339
|
case "EdDSA":
|
|
2352
|
-
i = { name:
|
|
2340
|
+
i = { name: Jt(c) }, o = u ? ["verify"] : ["sign"];
|
|
2353
2341
|
break;
|
|
2354
2342
|
default:
|
|
2355
2343
|
throw new x('Invalid or unsupported "alg" (Algorithm) value');
|
|
2356
2344
|
}
|
|
2357
2345
|
return b.subtle.importKey(e, c, i, (s = a == null ? void 0 : a.extractable) !== null && s !== void 0 ? s : !1, o);
|
|
2358
|
-
},
|
|
2359
|
-
function
|
|
2346
|
+
}, Nn = (t, e, r) => xr(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g, "pkcs8", t, e, r), Cr = (t, e, r) => xr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", t, e, r);
|
|
2347
|
+
function Nt(t) {
|
|
2360
2348
|
let e = [], r = 0;
|
|
2361
2349
|
for (; r < t.length; ) {
|
|
2362
|
-
let n =
|
|
2350
|
+
let n = _r(t.subarray(r));
|
|
2363
2351
|
e.push(n), r += n.byteLength;
|
|
2364
2352
|
}
|
|
2365
2353
|
return e;
|
|
2366
2354
|
}
|
|
2367
|
-
function
|
|
2355
|
+
function _r(t) {
|
|
2368
2356
|
let e = 0, r = t[0] & 31;
|
|
2369
2357
|
if (e++, r === 31) {
|
|
2370
2358
|
for (r = 0; t[e] >= 128; )
|
|
@@ -2399,24 +2387,24 @@ function Hr(t) {
|
|
|
2399
2387
|
raw: t.subarray(0, a)
|
|
2400
2388
|
};
|
|
2401
2389
|
}
|
|
2402
|
-
function
|
|
2403
|
-
const e =
|
|
2390
|
+
function $n(t) {
|
|
2391
|
+
const e = Nt(Nt(_r(t).contents)[0].contents);
|
|
2404
2392
|
return gt(e[e[0].raw[0] === 160 ? 6 : 5].raw);
|
|
2405
2393
|
}
|
|
2406
|
-
function
|
|
2407
|
-
const e = t.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, ""), r =
|
|
2408
|
-
return
|
|
2394
|
+
function Mn(t) {
|
|
2395
|
+
const e = t.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, ""), r = sr(e);
|
|
2396
|
+
return Er($n(r), "PUBLIC KEY");
|
|
2409
2397
|
}
|
|
2410
|
-
const
|
|
2398
|
+
const kn = (t, e, r) => {
|
|
2411
2399
|
let n;
|
|
2412
2400
|
try {
|
|
2413
|
-
n =
|
|
2401
|
+
n = Mn(t);
|
|
2414
2402
|
} catch (a) {
|
|
2415
2403
|
throw new TypeError("Failed to parse the X.509 certificate", { cause: a });
|
|
2416
2404
|
}
|
|
2417
|
-
return
|
|
2405
|
+
return Cr(n, e, r);
|
|
2418
2406
|
};
|
|
2419
|
-
function
|
|
2407
|
+
function Fn(t) {
|
|
2420
2408
|
let e, r;
|
|
2421
2409
|
switch (t.kty) {
|
|
2422
2410
|
case "oct": {
|
|
@@ -2522,11 +2510,11 @@ function zn(t) {
|
|
|
2522
2510
|
}
|
|
2523
2511
|
return { algorithm: e, keyUsages: r };
|
|
2524
2512
|
}
|
|
2525
|
-
const
|
|
2513
|
+
const Vn = async (t) => {
|
|
2526
2514
|
var e, r;
|
|
2527
2515
|
if (!t.alg)
|
|
2528
2516
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
2529
|
-
const { algorithm: n, keyUsages: a } =
|
|
2517
|
+
const { algorithm: n, keyUsages: a } = Fn(t), s = [
|
|
2530
2518
|
n,
|
|
2531
2519
|
(e = t.ext) !== null && e !== void 0 ? e : !1,
|
|
2532
2520
|
(r = t.key_ops) !== null && r !== void 0 ? r : a
|
|
@@ -2535,21 +2523,21 @@ const qn = async (t) => {
|
|
|
2535
2523
|
return b.subtle.importKey("raw", T(t.k), ...s);
|
|
2536
2524
|
const i = { ...t };
|
|
2537
2525
|
return delete i.alg, delete i.use, b.subtle.importKey("jwk", i, ...s);
|
|
2538
|
-
},
|
|
2539
|
-
async function
|
|
2526
|
+
}, $t = Vn;
|
|
2527
|
+
async function Bn(t, e, r) {
|
|
2540
2528
|
if (typeof t != "string" || t.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
2541
2529
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
2542
|
-
return
|
|
2530
|
+
return Cr(t, e, r);
|
|
2543
2531
|
}
|
|
2544
|
-
async function
|
|
2532
|
+
async function Gn(t, e, r) {
|
|
2545
2533
|
if (typeof t != "string" || t.indexOf("-----BEGIN CERTIFICATE-----") !== 0)
|
|
2546
2534
|
throw new TypeError('"x509" must be X.509 formatted string');
|
|
2547
|
-
return
|
|
2535
|
+
return kn(t, e, r);
|
|
2548
2536
|
}
|
|
2549
|
-
async function
|
|
2537
|
+
async function zn(t, e, r) {
|
|
2550
2538
|
if (typeof t != "string" || t.indexOf("-----BEGIN PRIVATE KEY-----") !== 0)
|
|
2551
2539
|
throw new TypeError('"pkcs8" must be PKCS#8 formatted string');
|
|
2552
|
-
return
|
|
2540
|
+
return Nn(t, e, r);
|
|
2553
2541
|
}
|
|
2554
2542
|
async function $e(t, e, r) {
|
|
2555
2543
|
var n;
|
|
@@ -2559,27 +2547,27 @@ async function $e(t, e, r) {
|
|
|
2559
2547
|
case "oct":
|
|
2560
2548
|
if (typeof t.k != "string" || !t.k)
|
|
2561
2549
|
throw new TypeError('missing "k" (Key Value) Parameter value');
|
|
2562
|
-
return r ?? (r = t.ext !== !0), r ?
|
|
2550
|
+
return r ?? (r = t.ext !== !0), r ? $t({ ...t, alg: e, ext: (n = t.ext) !== null && n !== void 0 ? n : !1 }) : T(t.k);
|
|
2563
2551
|
case "RSA":
|
|
2564
2552
|
if (t.oth !== void 0)
|
|
2565
2553
|
throw new x('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
|
|
2566
2554
|
case "EC":
|
|
2567
2555
|
case "OKP":
|
|
2568
|
-
return
|
|
2556
|
+
return $t({ ...t, alg: e });
|
|
2569
2557
|
default:
|
|
2570
2558
|
throw new x('Unsupported "kty" (Key Type) Parameter value');
|
|
2571
2559
|
}
|
|
2572
2560
|
}
|
|
2573
|
-
const
|
|
2561
|
+
const qn = (t, e) => {
|
|
2574
2562
|
if (!(e instanceof Uint8Array)) {
|
|
2575
|
-
if (!
|
|
2576
|
-
throw new TypeError(
|
|
2563
|
+
if (!gr(e))
|
|
2564
|
+
throw new TypeError(pr(t, e, ...H, "Uint8Array"));
|
|
2577
2565
|
if (e.type !== "secret")
|
|
2578
2566
|
throw new TypeError(`${H.join(" or ")} instances for symmetric algorithms must be of type "secret"`);
|
|
2579
2567
|
}
|
|
2580
|
-
},
|
|
2581
|
-
if (!
|
|
2582
|
-
throw new TypeError(
|
|
2568
|
+
}, Xn = (t, e, r) => {
|
|
2569
|
+
if (!gr(e))
|
|
2570
|
+
throw new TypeError(pr(t, e, ...H));
|
|
2583
2571
|
if (e.type === "secret")
|
|
2584
2572
|
throw new TypeError(`${H.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);
|
|
2585
2573
|
if (r === "sign" && e.type === "public")
|
|
@@ -2591,9 +2579,9 @@ const Qn = (t, e) => {
|
|
|
2591
2579
|
if (e.algorithm && r === "encrypt" && e.type === "private")
|
|
2592
2580
|
throw new TypeError(`${H.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
2593
2581
|
}, Me = (t, e, r) => {
|
|
2594
|
-
t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ?
|
|
2582
|
+
t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ? qn(t, e) : Xn(t, e, r);
|
|
2595
2583
|
};
|
|
2596
|
-
async function
|
|
2584
|
+
async function Yn(t, e, r, n, a) {
|
|
2597
2585
|
if (!(r instanceof Uint8Array))
|
|
2598
2586
|
throw new TypeError(M(r, "Uint8Array"));
|
|
2599
2587
|
const s = parseInt(t.slice(1, 4), 10), i = await b.subtle.importKey("raw", r.subarray(s >> 3), "AES-CBC", !1, ["encrypt"]), o = await b.subtle.importKey("raw", r.subarray(0, s >> 3), {
|
|
@@ -2602,10 +2590,10 @@ async function ea(t, e, r, n, a) {
|
|
|
2602
2590
|
}, !1, ["sign"]), c = new Uint8Array(await b.subtle.encrypt({
|
|
2603
2591
|
iv: n,
|
|
2604
2592
|
name: "AES-CBC"
|
|
2605
|
-
}, i, e)), u = Q(a, n, c,
|
|
2593
|
+
}, i, e)), u = Q(a, n, c, ar(a.length << 3)), l = new Uint8Array((await b.subtle.sign("HMAC", o, u)).slice(0, s >> 3));
|
|
2606
2594
|
return { ciphertext: c, tag: l };
|
|
2607
2595
|
}
|
|
2608
|
-
async function
|
|
2596
|
+
async function Zn(t, e, r, n, a) {
|
|
2609
2597
|
let s;
|
|
2610
2598
|
r instanceof Uint8Array ? s = await b.subtle.importKey("raw", r, "AES-GCM", !1, ["encrypt"]) : (ae(r, t, "encrypt"), s = r);
|
|
2611
2599
|
const i = new Uint8Array(await b.subtle.encrypt({
|
|
@@ -2619,30 +2607,30 @@ async function ta(t, e, r, n, a) {
|
|
|
2619
2607
|
const lt = async (t, e, r, n, a) => {
|
|
2620
2608
|
if (!G(r) && !(r instanceof Uint8Array))
|
|
2621
2609
|
throw new TypeError(M(r, ...H, "Uint8Array"));
|
|
2622
|
-
switch (
|
|
2610
|
+
switch (dr(t, n), t) {
|
|
2623
2611
|
case "A128CBC-HS256":
|
|
2624
2612
|
case "A192CBC-HS384":
|
|
2625
2613
|
case "A256CBC-HS512":
|
|
2626
|
-
return r instanceof Uint8Array && Oe(r, parseInt(t.slice(-3), 10)),
|
|
2614
|
+
return r instanceof Uint8Array && Oe(r, parseInt(t.slice(-3), 10)), Yn(t, e, r, n, a);
|
|
2627
2615
|
case "A128GCM":
|
|
2628
2616
|
case "A192GCM":
|
|
2629
2617
|
case "A256GCM":
|
|
2630
|
-
return r instanceof Uint8Array && Oe(r, parseInt(t.slice(1, 4), 10)),
|
|
2618
|
+
return r instanceof Uint8Array && Oe(r, parseInt(t.slice(1, 4), 10)), Zn(t, e, r, n, a);
|
|
2631
2619
|
default:
|
|
2632
2620
|
throw new x("Unsupported JWE Content Encryption Algorithm");
|
|
2633
2621
|
}
|
|
2634
2622
|
};
|
|
2635
|
-
async function
|
|
2623
|
+
async function Qn(t, e, r, n) {
|
|
2636
2624
|
const a = t.slice(0, 7);
|
|
2637
|
-
n || (n =
|
|
2625
|
+
n || (n = lr(a));
|
|
2638
2626
|
const { ciphertext: s, tag: i } = await lt(a, r, e, n, new Uint8Array(0));
|
|
2639
2627
|
return { encryptedKey: s, iv: O(n), tag: O(i) };
|
|
2640
2628
|
}
|
|
2641
|
-
async function
|
|
2629
|
+
async function jn(t, e, r, n, a) {
|
|
2642
2630
|
const s = t.slice(0, 7);
|
|
2643
|
-
return
|
|
2631
|
+
return mr(s, e, r, n, a, new Uint8Array(0));
|
|
2644
2632
|
}
|
|
2645
|
-
async function
|
|
2633
|
+
async function ea(t, e, r, n, a) {
|
|
2646
2634
|
switch (Me(t, e, "decrypt"), t) {
|
|
2647
2635
|
case "dir": {
|
|
2648
2636
|
if (r !== void 0)
|
|
@@ -2657,7 +2645,7 @@ async function aa(t, e, r, n, a) {
|
|
|
2657
2645
|
case "ECDH-ES+A256KW": {
|
|
2658
2646
|
if (!I(n.epk))
|
|
2659
2647
|
throw new y('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');
|
|
2660
|
-
if (!
|
|
2648
|
+
if (!br(e))
|
|
2661
2649
|
throw new x("ECDH with the provided key is not allowed or not supported by your javascript runtime");
|
|
2662
2650
|
const s = await $e(n.epk, t);
|
|
2663
2651
|
let i, o;
|
|
@@ -2679,7 +2667,7 @@ async function aa(t, e, r, n, a) {
|
|
|
2679
2667
|
throw new y("Failed to base64url decode the apv");
|
|
2680
2668
|
}
|
|
2681
2669
|
}
|
|
2682
|
-
const c = await
|
|
2670
|
+
const c = await Sr(s, e, t === "ECDH-ES" ? n.enc : t, t === "ECDH-ES" ? wt(n.enc) : parseInt(t.slice(-5, -2), 10), i, o);
|
|
2683
2671
|
if (t === "ECDH-ES")
|
|
2684
2672
|
return c;
|
|
2685
2673
|
if (r === void 0)
|
|
@@ -2693,7 +2681,7 @@ async function aa(t, e, r, n, a) {
|
|
|
2693
2681
|
case "RSA-OAEP-512": {
|
|
2694
2682
|
if (r === void 0)
|
|
2695
2683
|
throw new y("JWE Encrypted Key missing");
|
|
2696
|
-
return
|
|
2684
|
+
return Ln(t, e, r);
|
|
2697
2685
|
}
|
|
2698
2686
|
case "PBES2-HS256+A128KW":
|
|
2699
2687
|
case "PBES2-HS384+A192KW":
|
|
@@ -2713,7 +2701,7 @@ async function aa(t, e, r, n, a) {
|
|
|
2713
2701
|
} catch {
|
|
2714
2702
|
throw new y("Failed to base64url decode the p2s");
|
|
2715
2703
|
}
|
|
2716
|
-
return
|
|
2704
|
+
return Wn(t, e, r, n.p2c, i);
|
|
2717
2705
|
}
|
|
2718
2706
|
case "A128KW":
|
|
2719
2707
|
case "A192KW":
|
|
@@ -2743,7 +2731,7 @@ async function aa(t, e, r, n, a) {
|
|
|
2743
2731
|
} catch {
|
|
2744
2732
|
throw new y("Failed to base64url decode the tag");
|
|
2745
2733
|
}
|
|
2746
|
-
return
|
|
2734
|
+
return jn(t, e, r, s, i);
|
|
2747
2735
|
}
|
|
2748
2736
|
default:
|
|
2749
2737
|
throw new x('Invalid or unsupported "alg" (JWE Algorithm) header value');
|
|
@@ -2838,7 +2826,7 @@ async function St(t, e, r) {
|
|
|
2838
2826
|
typeof e == "function" && (e = await e(a, t), f = !0);
|
|
2839
2827
|
let d;
|
|
2840
2828
|
try {
|
|
2841
|
-
d = await
|
|
2829
|
+
d = await ea(i, e, l, s, r);
|
|
2842
2830
|
} catch (m) {
|
|
2843
2831
|
if (m instanceof TypeError || m instanceof y || m instanceof x)
|
|
2844
2832
|
throw m;
|
|
@@ -2864,8 +2852,8 @@ async function St(t, e, r) {
|
|
|
2864
2852
|
} catch {
|
|
2865
2853
|
throw new y("Failed to base64url decode the ciphertext");
|
|
2866
2854
|
}
|
|
2867
|
-
let v = await
|
|
2868
|
-
s.zip === "DEF" && (v = await ((r == null ? void 0 : r.inflateRaw) ||
|
|
2855
|
+
let v = await mr(o, d, C, p, h, S);
|
|
2856
|
+
s.zip === "DEF" && (v = await ((r == null ? void 0 : r.inflateRaw) || Pn)(v));
|
|
2869
2857
|
const w = { plaintext: v };
|
|
2870
2858
|
if (t.protected !== void 0 && (w.protectedHeader = a), t.aad !== void 0)
|
|
2871
2859
|
try {
|
|
@@ -2875,7 +2863,7 @@ async function St(t, e, r) {
|
|
|
2875
2863
|
}
|
|
2876
2864
|
return t.unprotected !== void 0 && (w.sharedUnprotectedHeader = t.unprotected), t.header !== void 0 && (w.unprotectedHeader = t.header), f ? { ...w, key: e } : w;
|
|
2877
2865
|
}
|
|
2878
|
-
async function
|
|
2866
|
+
async function Pr(t, e, r) {
|
|
2879
2867
|
if (t instanceof Uint8Array && (t = X.decode(t)), typeof t != "string")
|
|
2880
2868
|
throw new y("Compact JWE must be a string or Uint8Array");
|
|
2881
2869
|
const { 0: n, 1: a, 2: s, 3: i, 4: o, length: c } = t.split(".");
|
|
@@ -2890,7 +2878,7 @@ async function Kr(t, e, r) {
|
|
|
2890
2878
|
}, e, r), l = { plaintext: u.plaintext, protectedHeader: u.protectedHeader };
|
|
2891
2879
|
return typeof e == "function" ? { ...l, key: u.key } : l;
|
|
2892
2880
|
}
|
|
2893
|
-
async function
|
|
2881
|
+
async function ta(t, e, r) {
|
|
2894
2882
|
if (!I(t))
|
|
2895
2883
|
throw new y("General JWE must be an object");
|
|
2896
2884
|
if (!Array.isArray(t.recipients) || !t.recipients.every(I))
|
|
@@ -2913,7 +2901,7 @@ async function sa(t, e, r) {
|
|
|
2913
2901
|
}
|
|
2914
2902
|
throw new ge();
|
|
2915
2903
|
}
|
|
2916
|
-
const
|
|
2904
|
+
const ra = async (t) => {
|
|
2917
2905
|
if (t instanceof Uint8Array)
|
|
2918
2906
|
return {
|
|
2919
2907
|
kty: "oct",
|
|
@@ -2925,17 +2913,17 @@ const ia = async (t) => {
|
|
|
2925
2913
|
throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");
|
|
2926
2914
|
const { ext: e, key_ops: r, alg: n, use: a, ...s } = await b.subtle.exportKey("jwk", t);
|
|
2927
2915
|
return s;
|
|
2928
|
-
},
|
|
2929
|
-
async function
|
|
2930
|
-
return
|
|
2916
|
+
}, na = ra;
|
|
2917
|
+
async function aa(t) {
|
|
2918
|
+
return Dn(t);
|
|
2931
2919
|
}
|
|
2932
|
-
async function
|
|
2933
|
-
return
|
|
2920
|
+
async function sa(t) {
|
|
2921
|
+
return Jn(t);
|
|
2934
2922
|
}
|
|
2935
|
-
async function
|
|
2936
|
-
return
|
|
2923
|
+
async function Hr(t) {
|
|
2924
|
+
return na(t);
|
|
2937
2925
|
}
|
|
2938
|
-
async function
|
|
2926
|
+
async function Kr(t, e, r, n, a = {}) {
|
|
2939
2927
|
let s, i, o;
|
|
2940
2928
|
switch (Me(t, r, "encrypt"), t) {
|
|
2941
2929
|
case "dir": {
|
|
@@ -2946,12 +2934,12 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2946
2934
|
case "ECDH-ES+A128KW":
|
|
2947
2935
|
case "ECDH-ES+A192KW":
|
|
2948
2936
|
case "ECDH-ES+A256KW": {
|
|
2949
|
-
if (!
|
|
2937
|
+
if (!br(r))
|
|
2950
2938
|
throw new x("ECDH with the provided key is not allowed or not supported by your javascript runtime");
|
|
2951
2939
|
const { apu: c, apv: u } = a;
|
|
2952
2940
|
let { epk: l } = a;
|
|
2953
|
-
l || (l = (await
|
|
2954
|
-
const { x: f, y: d, crv: p, kty: h } = await
|
|
2941
|
+
l || (l = (await Rn(r)).privateKey);
|
|
2942
|
+
const { x: f, y: d, crv: p, kty: h } = await Hr(l), g = await Sr(r, l, t === "ECDH-ES" ? e : t, t === "ECDH-ES" ? wt(e) : parseInt(t.slice(-5, -2), 10), c, u);
|
|
2955
2943
|
if (i = { epk: { x: f, crv: p, kty: h } }, h === "EC" && (i.epk.y = d), c && (i.apu = O(c)), u && (i.apv = O(u)), t === "ECDH-ES") {
|
|
2956
2944
|
o = g;
|
|
2957
2945
|
break;
|
|
@@ -2966,7 +2954,7 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2966
2954
|
case "RSA-OAEP-256":
|
|
2967
2955
|
case "RSA-OAEP-384":
|
|
2968
2956
|
case "RSA-OAEP-512": {
|
|
2969
|
-
o = n || ie(e), s = await
|
|
2957
|
+
o = n || ie(e), s = await Un(t, r, o);
|
|
2970
2958
|
break;
|
|
2971
2959
|
}
|
|
2972
2960
|
case "PBES2-HS256+A128KW":
|
|
@@ -2974,7 +2962,7 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2974
2962
|
case "PBES2-HS512+A256KW": {
|
|
2975
2963
|
o = n || ie(e);
|
|
2976
2964
|
const { p2c: c, p2s: u } = a;
|
|
2977
|
-
({ encryptedKey: s, ...i } = await
|
|
2965
|
+
({ encryptedKey: s, ...i } = await In(t, r, o, c, u));
|
|
2978
2966
|
break;
|
|
2979
2967
|
}
|
|
2980
2968
|
case "A128KW":
|
|
@@ -2988,7 +2976,7 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2988
2976
|
case "A256GCMKW": {
|
|
2989
2977
|
o = n || ie(e);
|
|
2990
2978
|
const { iv: c } = a;
|
|
2991
|
-
({ encryptedKey: s, ...i } = await
|
|
2979
|
+
({ encryptedKey: s, ...i } = await Qn(t, r, o, c));
|
|
2992
2980
|
break;
|
|
2993
2981
|
}
|
|
2994
2982
|
default:
|
|
@@ -2996,7 +2984,7 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2996
2984
|
}
|
|
2997
2985
|
return { cek: o, encryptedKey: s, parameters: i };
|
|
2998
2986
|
}
|
|
2999
|
-
const
|
|
2987
|
+
const Rr = Symbol();
|
|
3000
2988
|
class Ie {
|
|
3001
2989
|
constructor(e) {
|
|
3002
2990
|
if (!(e instanceof Uint8Array))
|
|
@@ -3066,14 +3054,14 @@ class Ie {
|
|
|
3066
3054
|
let o;
|
|
3067
3055
|
{
|
|
3068
3056
|
let h;
|
|
3069
|
-
({ cek: o, encryptedKey: i, parameters: h } = await
|
|
3057
|
+
({ cek: o, encryptedKey: i, parameters: h } = await Kr(a, s, e, this._cek, this._keyManagementParameters)), h && (r && Rr in r ? this._unprotectedHeader ? this._unprotectedHeader = { ...this._unprotectedHeader, ...h } : this.setUnprotectedHeader(h) : this._protectedHeader ? this._protectedHeader = { ...this._protectedHeader, ...h } : this.setProtectedHeader(h));
|
|
3070
3058
|
}
|
|
3071
|
-
this._iv || (this._iv =
|
|
3059
|
+
this._iv || (this._iv = lr(s));
|
|
3072
3060
|
let c, u, l;
|
|
3073
3061
|
this._protectedHeader ? u = K.encode(O(JSON.stringify(this._protectedHeader))) : u = K.encode(""), this._aad ? (l = O(this._aad), c = Q(u, K.encode("."), K.encode(l))) : c = u;
|
|
3074
3062
|
let f, d;
|
|
3075
3063
|
if (n.zip === "DEF") {
|
|
3076
|
-
const h = await ((r == null ? void 0 : r.deflateRaw) ||
|
|
3064
|
+
const h = await ((r == null ? void 0 : r.deflateRaw) || Hn)(this._plaintext);
|
|
3077
3065
|
({ ciphertext: f, tag: d } = await lt(s, h, o, this._iv, c));
|
|
3078
3066
|
} else
|
|
3079
3067
|
({ ciphertext: f, tag: d } = await lt(s, this._plaintext, o, this._iv, c));
|
|
@@ -3085,7 +3073,7 @@ class Ie {
|
|
|
3085
3073
|
return i && (p.encrypted_key = O(i)), l && (p.aad = l), this._protectedHeader && (p.protected = X.decode(u)), this._sharedUnprotectedHeader && (p.unprotected = this._sharedUnprotectedHeader), this._unprotectedHeader && (p.header = this._unprotectedHeader), p;
|
|
3086
3074
|
}
|
|
3087
3075
|
}
|
|
3088
|
-
class
|
|
3076
|
+
class ia {
|
|
3089
3077
|
constructor(e, r, n) {
|
|
3090
3078
|
this.parent = e, this.key = r, this.options = n;
|
|
3091
3079
|
}
|
|
@@ -3104,12 +3092,12 @@ class la {
|
|
|
3104
3092
|
return this.parent;
|
|
3105
3093
|
}
|
|
3106
3094
|
}
|
|
3107
|
-
class
|
|
3095
|
+
class oa {
|
|
3108
3096
|
constructor(e) {
|
|
3109
3097
|
this._recipients = [], this._plaintext = e;
|
|
3110
3098
|
}
|
|
3111
3099
|
addRecipient(e, r) {
|
|
3112
|
-
const n = new
|
|
3100
|
+
const n = new ia(this, e, { crit: r == null ? void 0 : r.crit });
|
|
3113
3101
|
return this._recipients.push(n), n;
|
|
3114
3102
|
}
|
|
3115
3103
|
setProtectedHeader(e) {
|
|
@@ -3181,18 +3169,18 @@ class da {
|
|
|
3181
3169
|
const g = await new Ie(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(i).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(u.unprotectedHeader).setKeyManagementParameters({ p2c: d }).encrypt(u.key, {
|
|
3182
3170
|
...u.options,
|
|
3183
3171
|
...e,
|
|
3184
|
-
[
|
|
3172
|
+
[Rr]: !0
|
|
3185
3173
|
});
|
|
3186
3174
|
o.ciphertext = g.ciphertext, o.iv = g.iv, o.tag = g.tag, g.aad && (o.aad = g.aad), g.protected && (o.protected = g.protected), g.unprotected && (o.unprotected = g.unprotected), l.encrypted_key = g.encrypted_key, g.header && (l.header = g.header);
|
|
3187
3175
|
continue;
|
|
3188
3176
|
}
|
|
3189
|
-
const { encryptedKey: p, parameters: h } = await
|
|
3177
|
+
const { encryptedKey: p, parameters: h } = await Kr(((r = u.unprotectedHeader) === null || r === void 0 ? void 0 : r.alg) || ((n = this._protectedHeader) === null || n === void 0 ? void 0 : n.alg) || ((a = this._unprotectedHeader) === null || a === void 0 ? void 0 : a.alg), s, u.key, i, { p2c: d });
|
|
3190
3178
|
l.encrypted_key = O(p), (u.unprotectedHeader || h) && (l.header = { ...u.unprotectedHeader, ...h });
|
|
3191
3179
|
}
|
|
3192
3180
|
return o;
|
|
3193
3181
|
}
|
|
3194
3182
|
}
|
|
3195
|
-
function
|
|
3183
|
+
function Or(t, e) {
|
|
3196
3184
|
const r = `SHA-${t.slice(-3)}`;
|
|
3197
3185
|
switch (t) {
|
|
3198
3186
|
case "HS256":
|
|
@@ -3217,9 +3205,9 @@ function Ir(t, e) {
|
|
|
3217
3205
|
throw new x(`alg ${t} is not supported either by JOSE or your javascript runtime`);
|
|
3218
3206
|
}
|
|
3219
3207
|
}
|
|
3220
|
-
function
|
|
3208
|
+
function Tr(t, e, r) {
|
|
3221
3209
|
if (G(e))
|
|
3222
|
-
return
|
|
3210
|
+
return xn(e, t, r), e;
|
|
3223
3211
|
if (e instanceof Uint8Array) {
|
|
3224
3212
|
if (!t.startsWith("HS"))
|
|
3225
3213
|
throw new TypeError(M(e, ...H));
|
|
@@ -3227,10 +3215,10 @@ function Wr(t, e, r) {
|
|
|
3227
3215
|
}
|
|
3228
3216
|
throw new TypeError(M(e, ...H, "Uint8Array"));
|
|
3229
3217
|
}
|
|
3230
|
-
const
|
|
3231
|
-
const a = await
|
|
3218
|
+
const ca = async (t, e, r, n) => {
|
|
3219
|
+
const a = await Tr(t, e, "verify");
|
|
3232
3220
|
Ne(t, a);
|
|
3233
|
-
const s =
|
|
3221
|
+
const s = Or(t, a.algorithm);
|
|
3234
3222
|
try {
|
|
3235
3223
|
return await b.subtle.verify(s, a, r, n);
|
|
3236
3224
|
} catch {
|
|
@@ -3288,7 +3276,7 @@ async function bt(t, e, r) {
|
|
|
3288
3276
|
} catch {
|
|
3289
3277
|
throw new P("Failed to base64url decode the signature");
|
|
3290
3278
|
}
|
|
3291
|
-
if (!await
|
|
3279
|
+
if (!await ca(c, e, d, f))
|
|
3292
3280
|
throw new yt();
|
|
3293
3281
|
let h;
|
|
3294
3282
|
if (o)
|
|
@@ -3302,7 +3290,7 @@ async function bt(t, e, r) {
|
|
|
3302
3290
|
const g = { payload: h };
|
|
3303
3291
|
return t.protected !== void 0 && (g.protectedHeader = a), t.header !== void 0 && (g.unprotectedHeader = t.header), l ? { ...g, key: e } : g;
|
|
3304
3292
|
}
|
|
3305
|
-
async function
|
|
3293
|
+
async function Ir(t, e, r) {
|
|
3306
3294
|
if (t instanceof Uint8Array && (t = X.decode(t)), typeof t != "string")
|
|
3307
3295
|
throw new P("Compact JWS must be a string or Uint8Array");
|
|
3308
3296
|
const { 0: n, 1: a, 2: s, length: i } = t.split(".");
|
|
@@ -3311,7 +3299,7 @@ async function Ur(t, e, r) {
|
|
|
3311
3299
|
const o = await bt({ payload: a, protected: n, signature: s }, e, r), c = { payload: o.payload, protectedHeader: o.protectedHeader };
|
|
3312
3300
|
return typeof e == "function" ? { ...c, key: o.key } : c;
|
|
3313
3301
|
}
|
|
3314
|
-
async function
|
|
3302
|
+
async function ua(t, e, r) {
|
|
3315
3303
|
if (!I(t))
|
|
3316
3304
|
throw new P("General JWS must be an object");
|
|
3317
3305
|
if (!Array.isArray(t.signatures) || !t.signatures.every(I))
|
|
@@ -3328,8 +3316,8 @@ async function ha(t, e, r) {
|
|
|
3328
3316
|
}
|
|
3329
3317
|
throw new yt();
|
|
3330
3318
|
}
|
|
3331
|
-
const Ae = (t) => Math.floor(t.getTime() / 1e3),
|
|
3332
|
-
const e =
|
|
3319
|
+
const Ae = (t) => Math.floor(t.getTime() / 1e3), Wr = 60, Ur = Wr * 60, vt = Ur * 24, la = vt * 7, da = vt * 365.25, fa = /^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i, We = (t) => {
|
|
3320
|
+
const e = fa.exec(t);
|
|
3333
3321
|
if (!e)
|
|
3334
3322
|
throw new TypeError("Invalid time period format");
|
|
3335
3323
|
const r = parseFloat(e[1]);
|
|
@@ -3345,13 +3333,13 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3345
3333
|
case "min":
|
|
3346
3334
|
case "mins":
|
|
3347
3335
|
case "m":
|
|
3348
|
-
return Math.round(r *
|
|
3336
|
+
return Math.round(r * Wr);
|
|
3349
3337
|
case "hour":
|
|
3350
3338
|
case "hours":
|
|
3351
3339
|
case "hr":
|
|
3352
3340
|
case "hrs":
|
|
3353
3341
|
case "h":
|
|
3354
|
-
return Math.round(r *
|
|
3342
|
+
return Math.round(r * Ur);
|
|
3355
3343
|
case "day":
|
|
3356
3344
|
case "days":
|
|
3357
3345
|
case "d":
|
|
@@ -3359,13 +3347,13 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3359
3347
|
case "week":
|
|
3360
3348
|
case "weeks":
|
|
3361
3349
|
case "w":
|
|
3362
|
-
return Math.round(r *
|
|
3350
|
+
return Math.round(r * la);
|
|
3363
3351
|
default:
|
|
3364
|
-
return Math.round(r *
|
|
3352
|
+
return Math.round(r * da);
|
|
3365
3353
|
}
|
|
3366
|
-
},
|
|
3354
|
+
}, Mt = (t) => t.toLowerCase().replace(/^application\//, ""), ha = (t, e) => typeof t == "string" ? e.includes(t) : Array.isArray(t) ? e.some(Set.prototype.has.bind(new Set(t))) : !1, Et = (t, e, r = {}) => {
|
|
3367
3355
|
const { typ: n } = r;
|
|
3368
|
-
if (n && (typeof t.typ != "string" ||
|
|
3356
|
+
if (n && (typeof t.typ != "string" || Mt(t.typ) !== Mt(n)))
|
|
3369
3357
|
throw new V('unexpected "typ" JWT header value', "typ", "check_failed");
|
|
3370
3358
|
let a;
|
|
3371
3359
|
try {
|
|
@@ -3383,7 +3371,7 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3383
3371
|
throw new V('unexpected "iss" claim value', "iss", "check_failed");
|
|
3384
3372
|
if (o && a.sub !== o)
|
|
3385
3373
|
throw new V('unexpected "sub" claim value', "sub", "check_failed");
|
|
3386
|
-
if (c && !
|
|
3374
|
+
if (c && !ha(a.aud, typeof c == "string" ? [c] : c))
|
|
3387
3375
|
throw new V('unexpected "aud" claim value', "aud", "check_failed");
|
|
3388
3376
|
let l;
|
|
3389
3377
|
switch (typeof r.clockTolerance) {
|
|
@@ -3423,16 +3411,16 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3423
3411
|
}
|
|
3424
3412
|
return a;
|
|
3425
3413
|
};
|
|
3426
|
-
async function
|
|
3414
|
+
async function pa(t, e, r) {
|
|
3427
3415
|
var n;
|
|
3428
|
-
const a = await
|
|
3416
|
+
const a = await Ir(t, e, r);
|
|
3429
3417
|
if (!((n = a.protectedHeader.crit) === null || n === void 0) && n.includes("b64") && a.protectedHeader.b64 === !1)
|
|
3430
3418
|
throw new B("JWTs MUST NOT use unencoded payload");
|
|
3431
3419
|
const i = { payload: Et(a.protectedHeader, a.payload, r), protectedHeader: a.protectedHeader };
|
|
3432
3420
|
return typeof e == "function" ? { ...i, key: a.key } : i;
|
|
3433
3421
|
}
|
|
3434
|
-
async function
|
|
3435
|
-
const n = await
|
|
3422
|
+
async function ga(t, e, r) {
|
|
3423
|
+
const n = await Pr(t, e, r), a = Et(n.protectedHeader, n.plaintext, r), { protectedHeader: s } = n;
|
|
3436
3424
|
if (s.iss !== void 0 && s.iss !== a.iss)
|
|
3437
3425
|
throw new V('replicated "iss" claim header parameter mismatch', "iss", "mismatch");
|
|
3438
3426
|
if (s.sub !== void 0 && s.sub !== a.sub)
|
|
@@ -3442,7 +3430,7 @@ async function Sa(t, e, r) {
|
|
|
3442
3430
|
const i = { payload: a, protectedHeader: s };
|
|
3443
3431
|
return typeof e == "function" ? { ...i, key: n.key } : i;
|
|
3444
3432
|
}
|
|
3445
|
-
class
|
|
3433
|
+
class Lr {
|
|
3446
3434
|
constructor(e) {
|
|
3447
3435
|
this._flattened = new Ie(e);
|
|
3448
3436
|
}
|
|
@@ -3463,10 +3451,10 @@ class Jr {
|
|
|
3463
3451
|
return [n.protected, n.encrypted_key, n.iv, n.ciphertext, n.tag].join(".");
|
|
3464
3452
|
}
|
|
3465
3453
|
}
|
|
3466
|
-
const
|
|
3467
|
-
const n = await
|
|
3454
|
+
const ma = async (t, e, r) => {
|
|
3455
|
+
const n = await Tr(t, e, "sign");
|
|
3468
3456
|
Ne(t, n);
|
|
3469
|
-
const a = await b.subtle.sign(
|
|
3457
|
+
const a = await b.subtle.sign(Or(t, n.algorithm), n, r);
|
|
3470
3458
|
return new Uint8Array(a);
|
|
3471
3459
|
};
|
|
3472
3460
|
class At {
|
|
@@ -3505,14 +3493,14 @@ class At {
|
|
|
3505
3493
|
s && (o = K.encode(O(o)));
|
|
3506
3494
|
let c;
|
|
3507
3495
|
this._protectedHeader ? c = K.encode(O(JSON.stringify(this._protectedHeader))) : c = K.encode("");
|
|
3508
|
-
const u = Q(c, K.encode("."), o), l = await
|
|
3496
|
+
const u = Q(c, K.encode("."), o), l = await ma(i, e, u), f = {
|
|
3509
3497
|
signature: O(l),
|
|
3510
3498
|
payload: ""
|
|
3511
3499
|
};
|
|
3512
3500
|
return s && (f.payload = X.decode(o)), this._unprotectedHeader && (f.header = this._unprotectedHeader), this._protectedHeader && (f.protected = X.decode(c)), f;
|
|
3513
3501
|
}
|
|
3514
3502
|
}
|
|
3515
|
-
class
|
|
3503
|
+
class Dr {
|
|
3516
3504
|
constructor(e) {
|
|
3517
3505
|
this._flattened = new At(e);
|
|
3518
3506
|
}
|
|
@@ -3526,7 +3514,7 @@ class Nr {
|
|
|
3526
3514
|
return `${n.protected}.${n.payload}.${n.signature}`;
|
|
3527
3515
|
}
|
|
3528
3516
|
}
|
|
3529
|
-
class
|
|
3517
|
+
class ya {
|
|
3530
3518
|
constructor(e, r, n) {
|
|
3531
3519
|
this.parent = e, this.key = r, this.options = n;
|
|
3532
3520
|
}
|
|
@@ -3550,12 +3538,12 @@ class va {
|
|
|
3550
3538
|
return this.parent;
|
|
3551
3539
|
}
|
|
3552
3540
|
}
|
|
3553
|
-
class
|
|
3541
|
+
class wa {
|
|
3554
3542
|
constructor(e) {
|
|
3555
3543
|
this._signatures = [], this._payload = e;
|
|
3556
3544
|
}
|
|
3557
3545
|
addSignature(e, r) {
|
|
3558
|
-
const n = new
|
|
3546
|
+
const n = new ya(this, e, r);
|
|
3559
3547
|
return this._signatures.push(n), n;
|
|
3560
3548
|
}
|
|
3561
3549
|
async sign() {
|
|
@@ -3606,19 +3594,19 @@ class xt {
|
|
|
3606
3594
|
return typeof e > "u" ? this._payload = { ...this._payload, iat: Ae(/* @__PURE__ */ new Date()) } : this._payload = { ...this._payload, iat: e }, this;
|
|
3607
3595
|
}
|
|
3608
3596
|
}
|
|
3609
|
-
class
|
|
3597
|
+
class Sa extends xt {
|
|
3610
3598
|
setProtectedHeader(e) {
|
|
3611
3599
|
return this._protectedHeader = e, this;
|
|
3612
3600
|
}
|
|
3613
3601
|
async sign(e, r) {
|
|
3614
3602
|
var n;
|
|
3615
|
-
const a = new
|
|
3603
|
+
const a = new Dr(K.encode(JSON.stringify(this._payload)));
|
|
3616
3604
|
if (a.setProtectedHeader(this._protectedHeader), Array.isArray((n = this._protectedHeader) === null || n === void 0 ? void 0 : n.crit) && this._protectedHeader.crit.includes("b64") && this._protectedHeader.b64 === !1)
|
|
3617
3605
|
throw new B("JWTs MUST NOT use unencoded payload");
|
|
3618
3606
|
return a.sign(e, r);
|
|
3619
3607
|
}
|
|
3620
3608
|
}
|
|
3621
|
-
class
|
|
3609
|
+
class ba extends xt {
|
|
3622
3610
|
setProtectedHeader(e) {
|
|
3623
3611
|
if (this._protectedHeader)
|
|
3624
3612
|
throw new TypeError("setProtectedHeader can only be called once");
|
|
@@ -3649,15 +3637,15 @@ class xa extends xt {
|
|
|
3649
3637
|
return this._replicateAudienceAsHeader = !0, this;
|
|
3650
3638
|
}
|
|
3651
3639
|
async encrypt(e, r) {
|
|
3652
|
-
const n = new
|
|
3640
|
+
const n = new Lr(K.encode(JSON.stringify(this._payload)));
|
|
3653
3641
|
return this._replicateIssuerAsHeader && (this._protectedHeader = { ...this._protectedHeader, iss: this._payload.iss }), this._replicateSubjectAsHeader && (this._protectedHeader = { ...this._protectedHeader, sub: this._payload.sub }), this._replicateAudienceAsHeader && (this._protectedHeader = { ...this._protectedHeader, aud: this._payload.aud }), n.setProtectedHeader(this._protectedHeader), this._iv && n.setInitializationVector(this._iv), this._cek && n.setContentEncryptionKey(this._cek), this._keyManagementParameters && n.setKeyManagementParameters(this._keyManagementParameters), n.encrypt(e, r);
|
|
3654
3642
|
}
|
|
3655
3643
|
}
|
|
3656
3644
|
const ee = (t, e) => {
|
|
3657
3645
|
if (typeof t != "string" || !t)
|
|
3658
|
-
throw new
|
|
3646
|
+
throw new ir(`${e} missing or invalid`);
|
|
3659
3647
|
};
|
|
3660
|
-
async function
|
|
3648
|
+
async function Jr(t, e) {
|
|
3661
3649
|
if (!I(t))
|
|
3662
3650
|
throw new TypeError("JWK must be an object");
|
|
3663
3651
|
if (e ?? (e = "sha256"), e !== "sha256" && e !== "sha384" && e !== "sha512")
|
|
@@ -3680,14 +3668,14 @@ async function $r(t, e) {
|
|
|
3680
3668
|
throw new x('"kty" (Key Type) Parameter missing or unsupported');
|
|
3681
3669
|
}
|
|
3682
3670
|
const n = K.encode(JSON.stringify(r));
|
|
3683
|
-
return O(await
|
|
3671
|
+
return O(await nr(e, n));
|
|
3684
3672
|
}
|
|
3685
|
-
async function
|
|
3673
|
+
async function va(t, e) {
|
|
3686
3674
|
e ?? (e = "sha256");
|
|
3687
|
-
const r = await
|
|
3675
|
+
const r = await Jr(t, e);
|
|
3688
3676
|
return `urn:ietf:params:oauth:jwk-thumbprint:sha-${e.slice(-3)}:${r}`;
|
|
3689
3677
|
}
|
|
3690
|
-
async function
|
|
3678
|
+
async function Ea(t, e) {
|
|
3691
3679
|
const r = {
|
|
3692
3680
|
...t,
|
|
3693
3681
|
...e == null ? void 0 : e.header
|
|
@@ -3699,7 +3687,7 @@ async function _a(t, e) {
|
|
|
3699
3687
|
throw new P('"jwk" (JSON Web Key) Header Parameter must be a public key');
|
|
3700
3688
|
return n;
|
|
3701
3689
|
}
|
|
3702
|
-
function
|
|
3690
|
+
function Aa(t) {
|
|
3703
3691
|
switch (typeof t == "string" && t.slice(0, 2)) {
|
|
3704
3692
|
case "RS":
|
|
3705
3693
|
case "PS":
|
|
@@ -3712,23 +3700,23 @@ function Pa(t) {
|
|
|
3712
3700
|
throw new x('Unsupported "alg" value for a JSON Web Key Set');
|
|
3713
3701
|
}
|
|
3714
3702
|
}
|
|
3715
|
-
function
|
|
3716
|
-
return t && typeof t == "object" && Array.isArray(t.keys) && t.keys.every(
|
|
3703
|
+
function Nr(t) {
|
|
3704
|
+
return t && typeof t == "object" && Array.isArray(t.keys) && t.keys.every(xa);
|
|
3717
3705
|
}
|
|
3718
|
-
function
|
|
3706
|
+
function xa(t) {
|
|
3719
3707
|
return I(t);
|
|
3720
3708
|
}
|
|
3721
|
-
function
|
|
3709
|
+
function Ca(t) {
|
|
3722
3710
|
return typeof structuredClone == "function" ? structuredClone(t) : JSON.parse(JSON.stringify(t));
|
|
3723
3711
|
}
|
|
3724
|
-
class
|
|
3712
|
+
class $r {
|
|
3725
3713
|
constructor(e) {
|
|
3726
|
-
if (this._cached = /* @__PURE__ */ new WeakMap(), !
|
|
3714
|
+
if (this._cached = /* @__PURE__ */ new WeakMap(), !Nr(e))
|
|
3727
3715
|
throw new Le("JSON Web Key Set malformed");
|
|
3728
|
-
this._jwks =
|
|
3716
|
+
this._jwks = Ca(e);
|
|
3729
3717
|
}
|
|
3730
3718
|
async getKey(e, r) {
|
|
3731
|
-
const { alg: n, kid: a } = { ...e, ...r == null ? void 0 : r.header }, s =
|
|
3719
|
+
const { alg: n, kid: a } = { ...e, ...r == null ? void 0 : r.header }, s = Aa(n), i = this._jwks.keys.filter((u) => {
|
|
3732
3720
|
let l = s === u.kty;
|
|
3733
3721
|
if (l && typeof a == "string" && (l = a === u.kid), l && typeof u.alg == "string" && (l = n === u.alg), l && typeof u.use == "string" && (l = u.use === "sig"), l && Array.isArray(u.key_ops) && (l = u.key_ops.includes("verify")), l && n === "EdDSA" && (l = u.crv === "Ed25519" || u.crv === "Ed448"), l)
|
|
3734
3722
|
switch (n) {
|
|
@@ -3750,20 +3738,20 @@ class kr {
|
|
|
3750
3738
|
if (c === 0)
|
|
3751
3739
|
throw new mt();
|
|
3752
3740
|
if (c !== 1) {
|
|
3753
|
-
const u = new
|
|
3741
|
+
const u = new or(), { _cached: l } = this;
|
|
3754
3742
|
throw u[Symbol.asyncIterator] = async function* () {
|
|
3755
3743
|
for (const f of i)
|
|
3756
3744
|
try {
|
|
3757
|
-
yield await
|
|
3745
|
+
yield await kt(l, f, n);
|
|
3758
3746
|
} catch {
|
|
3759
3747
|
continue;
|
|
3760
3748
|
}
|
|
3761
3749
|
}, u;
|
|
3762
3750
|
}
|
|
3763
|
-
return
|
|
3751
|
+
return kt(this._cached, o, n);
|
|
3764
3752
|
}
|
|
3765
3753
|
}
|
|
3766
|
-
async function
|
|
3754
|
+
async function kt(t, e, r) {
|
|
3767
3755
|
const n = t.get(e) || t.set(e, {}).get(e);
|
|
3768
3756
|
if (n[r] === void 0) {
|
|
3769
3757
|
const a = await $e({ ...e, ext: !0 }, r);
|
|
@@ -3773,13 +3761,13 @@ async function Ft(t, e, r) {
|
|
|
3773
3761
|
}
|
|
3774
3762
|
return n[r];
|
|
3775
3763
|
}
|
|
3776
|
-
function
|
|
3777
|
-
const e = new
|
|
3764
|
+
function _a(t) {
|
|
3765
|
+
const e = new $r(t);
|
|
3778
3766
|
return async function(r, n) {
|
|
3779
3767
|
return e.getKey(r, n);
|
|
3780
3768
|
};
|
|
3781
3769
|
}
|
|
3782
|
-
const
|
|
3770
|
+
const Pa = async (t, e, r) => {
|
|
3783
3771
|
let n, a, s = !1;
|
|
3784
3772
|
typeof AbortController == "function" && (n = new AbortController(), a = setTimeout(() => {
|
|
3785
3773
|
s = !0, n.abort();
|
|
@@ -3789,7 +3777,7 @@ const Oa = async (t, e, r) => {
|
|
|
3789
3777
|
redirect: "manual",
|
|
3790
3778
|
headers: r.headers
|
|
3791
3779
|
}).catch((o) => {
|
|
3792
|
-
throw s ? new
|
|
3780
|
+
throw s ? new cr() : o;
|
|
3793
3781
|
});
|
|
3794
3782
|
if (a !== void 0 && clearTimeout(a), i.status !== 200)
|
|
3795
3783
|
throw new L("Expected 200 OK from the JSON Web Key Set HTTP response");
|
|
@@ -3799,10 +3787,10 @@ const Oa = async (t, e, r) => {
|
|
|
3799
3787
|
throw new L("Failed to parse the JSON Web Key Set HTTP response as JSON");
|
|
3800
3788
|
}
|
|
3801
3789
|
};
|
|
3802
|
-
function
|
|
3790
|
+
function Ha() {
|
|
3803
3791
|
return typeof WebSocketPair < "u" || typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime < "u" && EdgeRuntime === "vercel";
|
|
3804
3792
|
}
|
|
3805
|
-
class
|
|
3793
|
+
class Ka extends $r {
|
|
3806
3794
|
constructor(e, r) {
|
|
3807
3795
|
if (super({ keys: [] }), this._jwks = void 0, !(e instanceof URL))
|
|
3808
3796
|
throw new TypeError("url must be an instance of URL");
|
|
@@ -3825,8 +3813,8 @@ class Ia extends kr {
|
|
|
3825
3813
|
}
|
|
3826
3814
|
}
|
|
3827
3815
|
async reload() {
|
|
3828
|
-
this._pendingFetch &&
|
|
3829
|
-
if (!
|
|
3816
|
+
this._pendingFetch && Ha() && (this._pendingFetch = void 0), this._pendingFetch || (this._pendingFetch = Pa(this._url, this._timeoutDuration, this._options).then((e) => {
|
|
3817
|
+
if (!Nr(e))
|
|
3830
3818
|
throw new Le("JSON Web Key Set malformed");
|
|
3831
3819
|
this._jwks = { keys: e.keys }, this._jwksTimestamp = Date.now(), this._pendingFetch = void 0;
|
|
3832
3820
|
}).catch((e) => {
|
|
@@ -3834,13 +3822,13 @@ class Ia extends kr {
|
|
|
3834
3822
|
})), await this._pendingFetch;
|
|
3835
3823
|
}
|
|
3836
3824
|
}
|
|
3837
|
-
function
|
|
3838
|
-
const r = new
|
|
3825
|
+
function Ra(t, e) {
|
|
3826
|
+
const r = new Ka(t, e);
|
|
3839
3827
|
return async function(n, a) {
|
|
3840
3828
|
return r.getKey(n, a);
|
|
3841
3829
|
};
|
|
3842
3830
|
}
|
|
3843
|
-
class
|
|
3831
|
+
class Oa extends xt {
|
|
3844
3832
|
encode() {
|
|
3845
3833
|
const e = O(JSON.stringify({ alg: "none" })), r = O(JSON.stringify(this._payload));
|
|
3846
3834
|
return `${e}.${r}.`;
|
|
@@ -3861,12 +3849,12 @@ class Ua extends xt {
|
|
|
3861
3849
|
return { payload: Et(o, T(a), r), header: o };
|
|
3862
3850
|
}
|
|
3863
3851
|
}
|
|
3864
|
-
const
|
|
3852
|
+
const Ta = O, Ct = T, Ia = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3865
3853
|
__proto__: null,
|
|
3866
3854
|
decode: Ct,
|
|
3867
|
-
encode:
|
|
3855
|
+
encode: Ta
|
|
3868
3856
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3869
|
-
function
|
|
3857
|
+
function Wa(t) {
|
|
3870
3858
|
let e;
|
|
3871
3859
|
if (typeof t == "string") {
|
|
3872
3860
|
const r = t.split(".");
|
|
@@ -3887,7 +3875,7 @@ function Ja(t) {
|
|
|
3887
3875
|
throw new TypeError("Invalid Token or Protected Header formatting");
|
|
3888
3876
|
}
|
|
3889
3877
|
}
|
|
3890
|
-
function
|
|
3878
|
+
function Ua(t) {
|
|
3891
3879
|
if (typeof t != "string")
|
|
3892
3880
|
throw new B("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
3893
3881
|
const { 1: e, length: r } = t.split(".");
|
|
@@ -3913,7 +3901,7 @@ function Na(t) {
|
|
|
3913
3901
|
throw new B("Invalid JWT Claims Set");
|
|
3914
3902
|
return a;
|
|
3915
3903
|
}
|
|
3916
|
-
async function
|
|
3904
|
+
async function La(t, e) {
|
|
3917
3905
|
var r;
|
|
3918
3906
|
let n, a, s;
|
|
3919
3907
|
switch (t) {
|
|
@@ -3951,7 +3939,7 @@ function qe(t) {
|
|
|
3951
3939
|
throw new x("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");
|
|
3952
3940
|
return r;
|
|
3953
3941
|
}
|
|
3954
|
-
async function
|
|
3942
|
+
async function Da(t, e) {
|
|
3955
3943
|
var r, n, a;
|
|
3956
3944
|
let s, i;
|
|
3957
3945
|
switch (t) {
|
|
@@ -4034,51 +4022,51 @@ async function Ma(t, e) {
|
|
|
4034
4022
|
}
|
|
4035
4023
|
return b.subtle.generateKey(s, (a = e == null ? void 0 : e.extractable) !== null && a !== void 0 ? a : !1, i);
|
|
4036
4024
|
}
|
|
4037
|
-
async function
|
|
4038
|
-
return
|
|
4025
|
+
async function Ja(t, e) {
|
|
4026
|
+
return Da(t, e);
|
|
4039
4027
|
}
|
|
4040
|
-
async function
|
|
4041
|
-
return
|
|
4028
|
+
async function Na(t, e) {
|
|
4029
|
+
return La(t, e);
|
|
4042
4030
|
}
|
|
4043
|
-
const
|
|
4031
|
+
const $a = "WebCryptoAPI", Ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4044
4032
|
__proto__: null,
|
|
4045
|
-
CompactEncrypt:
|
|
4046
|
-
CompactSign:
|
|
4047
|
-
EmbeddedJWK:
|
|
4048
|
-
EncryptJWT:
|
|
4033
|
+
CompactEncrypt: Lr,
|
|
4034
|
+
CompactSign: Dr,
|
|
4035
|
+
EmbeddedJWK: Ea,
|
|
4036
|
+
EncryptJWT: ba,
|
|
4049
4037
|
FlattenedEncrypt: Ie,
|
|
4050
4038
|
FlattenedSign: At,
|
|
4051
|
-
GeneralEncrypt:
|
|
4052
|
-
GeneralSign:
|
|
4053
|
-
SignJWT:
|
|
4054
|
-
UnsecuredJWT:
|
|
4055
|
-
base64url:
|
|
4056
|
-
calculateJwkThumbprint:
|
|
4057
|
-
calculateJwkThumbprintUri:
|
|
4058
|
-
compactDecrypt:
|
|
4059
|
-
compactVerify:
|
|
4060
|
-
createLocalJWKSet:
|
|
4061
|
-
createRemoteJWKSet:
|
|
4062
|
-
cryptoRuntime:
|
|
4063
|
-
decodeJwt:
|
|
4064
|
-
decodeProtectedHeader:
|
|
4065
|
-
errors:
|
|
4066
|
-
exportJWK:
|
|
4067
|
-
exportPKCS8:
|
|
4068
|
-
exportSPKI:
|
|
4039
|
+
GeneralEncrypt: oa,
|
|
4040
|
+
GeneralSign: wa,
|
|
4041
|
+
SignJWT: Sa,
|
|
4042
|
+
UnsecuredJWT: Oa,
|
|
4043
|
+
base64url: Ia,
|
|
4044
|
+
calculateJwkThumbprint: Jr,
|
|
4045
|
+
calculateJwkThumbprintUri: va,
|
|
4046
|
+
compactDecrypt: Pr,
|
|
4047
|
+
compactVerify: Ir,
|
|
4048
|
+
createLocalJWKSet: _a,
|
|
4049
|
+
createRemoteJWKSet: Ra,
|
|
4050
|
+
cryptoRuntime: $a,
|
|
4051
|
+
decodeJwt: Ua,
|
|
4052
|
+
decodeProtectedHeader: Wa,
|
|
4053
|
+
errors: vn,
|
|
4054
|
+
exportJWK: Hr,
|
|
4055
|
+
exportPKCS8: sa,
|
|
4056
|
+
exportSPKI: aa,
|
|
4069
4057
|
flattenedDecrypt: St,
|
|
4070
4058
|
flattenedVerify: bt,
|
|
4071
|
-
generalDecrypt:
|
|
4072
|
-
generalVerify:
|
|
4073
|
-
generateKeyPair:
|
|
4074
|
-
generateSecret:
|
|
4059
|
+
generalDecrypt: ta,
|
|
4060
|
+
generalVerify: ua,
|
|
4061
|
+
generateKeyPair: Ja,
|
|
4062
|
+
generateSecret: Na,
|
|
4075
4063
|
importJWK: $e,
|
|
4076
|
-
importPKCS8:
|
|
4077
|
-
importSPKI:
|
|
4078
|
-
importX509:
|
|
4079
|
-
jwtDecrypt:
|
|
4080
|
-
jwtVerify:
|
|
4081
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4064
|
+
importPKCS8: zn,
|
|
4065
|
+
importSPKI: Bn,
|
|
4066
|
+
importX509: Gn,
|
|
4067
|
+
jwtDecrypt: ga,
|
|
4068
|
+
jwtVerify: pa
|
|
4069
|
+
}, Symbol.toStringTag, { value: "Module" })), ka = /* @__PURE__ */ ft(Ma), Fa = () => {
|
|
4082
4070
|
if (typeof globalThis < "u")
|
|
4083
4071
|
return globalThis;
|
|
4084
4072
|
if (typeof self < "u")
|
|
@@ -4086,8 +4074,8 @@ const Va = "WebCryptoAPI", Ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Ob
|
|
|
4086
4074
|
if (typeof window < "u")
|
|
4087
4075
|
return window;
|
|
4088
4076
|
throw new Error("unable to locate global object");
|
|
4089
|
-
},
|
|
4090
|
-
const { crypto: { subtle: s } } =
|
|
4077
|
+
}, Va = async (t, e, r, n, a) => {
|
|
4078
|
+
const { crypto: { subtle: s } } = Fa();
|
|
4091
4079
|
return new Uint8Array(await s.deriveBits({
|
|
4092
4080
|
name: "HKDF",
|
|
4093
4081
|
hash: `SHA-${t.substr(3)}`,
|
|
@@ -4095,7 +4083,7 @@ const Va = "WebCryptoAPI", Ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Ob
|
|
|
4095
4083
|
info: n
|
|
4096
4084
|
}, await s.importKey("raw", e, "HKDF", !1, ["deriveBits"]), a << 3));
|
|
4097
4085
|
};
|
|
4098
|
-
function
|
|
4086
|
+
function Ba(t) {
|
|
4099
4087
|
switch (t) {
|
|
4100
4088
|
case "sha256":
|
|
4101
4089
|
case "sha384":
|
|
@@ -4113,19 +4101,19 @@ function _t(t, e) {
|
|
|
4113
4101
|
throw new TypeError(`"${e}"" must be an instance of Uint8Array or a string`);
|
|
4114
4102
|
return t;
|
|
4115
4103
|
}
|
|
4116
|
-
function
|
|
4104
|
+
function Ga(t) {
|
|
4117
4105
|
const e = _t(t, "ikm");
|
|
4118
4106
|
if (!e.byteLength)
|
|
4119
4107
|
throw new TypeError('"ikm" must be at least one byte in length');
|
|
4120
4108
|
return e;
|
|
4121
4109
|
}
|
|
4122
|
-
function
|
|
4110
|
+
function za(t) {
|
|
4123
4111
|
const e = _t(t, "info");
|
|
4124
4112
|
if (e.byteLength > 1024)
|
|
4125
4113
|
throw TypeError('"info" must not contain more than 1024 bytes');
|
|
4126
4114
|
return e;
|
|
4127
4115
|
}
|
|
4128
|
-
function
|
|
4116
|
+
function qa(t, e) {
|
|
4129
4117
|
if (typeof t != "number" || !Number.isInteger(t) || t < 1)
|
|
4130
4118
|
throw new TypeError('"keylen" must be a positive integer');
|
|
4131
4119
|
const r = parseInt(e.substr(3), 10) >> 3 || 20;
|
|
@@ -4133,23 +4121,23 @@ function Qa(t, e) {
|
|
|
4133
4121
|
throw new TypeError('"keylen" too large');
|
|
4134
4122
|
return t;
|
|
4135
4123
|
}
|
|
4136
|
-
async function
|
|
4137
|
-
return
|
|
4124
|
+
async function Ft(t, e, r, n, a) {
|
|
4125
|
+
return Va(Ba(t), Ga(e), _t(r, "salt"), za(n), qa(a, t));
|
|
4138
4126
|
}
|
|
4139
|
-
const
|
|
4127
|
+
const Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4140
4128
|
__proto__: null,
|
|
4141
|
-
default:
|
|
4142
|
-
hkdf:
|
|
4143
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4144
|
-
var ve,
|
|
4145
|
-
function
|
|
4129
|
+
default: Ft,
|
|
4130
|
+
hkdf: Ft
|
|
4131
|
+
}, Symbol.toStringTag, { value: "Module" })), Ya = /* @__PURE__ */ ft(Xa);
|
|
4132
|
+
var ve, Za = new Uint8Array(16);
|
|
4133
|
+
function Mr() {
|
|
4146
4134
|
if (!ve && (ve = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !ve))
|
|
4147
4135
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
4148
|
-
return ve(
|
|
4136
|
+
return ve(Za);
|
|
4149
4137
|
}
|
|
4150
|
-
const
|
|
4138
|
+
const Qa = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
4151
4139
|
function ke(t) {
|
|
4152
|
-
return typeof t == "string" &&
|
|
4140
|
+
return typeof t == "string" && Qa.test(t);
|
|
4153
4141
|
}
|
|
4154
4142
|
var W = [];
|
|
4155
4143
|
for (var Xe = 0; Xe < 256; ++Xe)
|
|
@@ -4160,14 +4148,14 @@ function Fe(t) {
|
|
|
4160
4148
|
throw TypeError("Stringified UUID is invalid");
|
|
4161
4149
|
return r;
|
|
4162
4150
|
}
|
|
4163
|
-
var
|
|
4164
|
-
function
|
|
4151
|
+
var Vt, Ye, Ze = 0, Qe = 0;
|
|
4152
|
+
function ja(t, e, r) {
|
|
4165
4153
|
var n = e && r || 0, a = e || new Array(16);
|
|
4166
4154
|
t = t || {};
|
|
4167
|
-
var s = t.node ||
|
|
4155
|
+
var s = t.node || Vt, i = t.clockseq !== void 0 ? t.clockseq : Ye;
|
|
4168
4156
|
if (s == null || i == null) {
|
|
4169
|
-
var o = t.random || (t.rng ||
|
|
4170
|
-
s == null && (s =
|
|
4157
|
+
var o = t.random || (t.rng || Mr)();
|
|
4158
|
+
s == null && (s = Vt = [o[0] | 1, o[1], o[2], o[3], o[4], o[5]]), i == null && (i = Ye = (o[6] << 8 | o[7]) & 16383);
|
|
4171
4159
|
}
|
|
4172
4160
|
var c = t.msecs !== void 0 ? t.msecs : Date.now(), u = t.nsecs !== void 0 ? t.nsecs : Qe + 1, l = c - Ze + (u - Qe) / 1e4;
|
|
4173
4161
|
if (l < 0 && t.clockseq === void 0 && (i = i + 1 & 16383), (l < 0 || c > Ze) && t.nsecs === void 0 && (u = 0), u >= 1e4)
|
|
@@ -4181,22 +4169,22 @@ function ns(t, e, r) {
|
|
|
4181
4169
|
a[n + p] = s[p];
|
|
4182
4170
|
return e || Fe(a);
|
|
4183
4171
|
}
|
|
4184
|
-
function
|
|
4172
|
+
function kr(t) {
|
|
4185
4173
|
if (!ke(t))
|
|
4186
4174
|
throw TypeError("Invalid UUID");
|
|
4187
4175
|
var e, r = new Uint8Array(16);
|
|
4188
4176
|
return r[0] = (e = parseInt(t.slice(0, 8), 16)) >>> 24, r[1] = e >>> 16 & 255, r[2] = e >>> 8 & 255, r[3] = e & 255, r[4] = (e = parseInt(t.slice(9, 13), 16)) >>> 8, r[5] = e & 255, r[6] = (e = parseInt(t.slice(14, 18), 16)) >>> 8, r[7] = e & 255, r[8] = (e = parseInt(t.slice(19, 23), 16)) >>> 8, r[9] = e & 255, r[10] = (e = parseInt(t.slice(24, 36), 16)) / 1099511627776 & 255, r[11] = e / 4294967296 & 255, r[12] = e >>> 24 & 255, r[13] = e >>> 16 & 255, r[14] = e >>> 8 & 255, r[15] = e & 255, r;
|
|
4189
4177
|
}
|
|
4190
|
-
function
|
|
4178
|
+
function es(t) {
|
|
4191
4179
|
t = unescape(encodeURIComponent(t));
|
|
4192
4180
|
for (var e = [], r = 0; r < t.length; ++r)
|
|
4193
4181
|
e.push(t.charCodeAt(r));
|
|
4194
4182
|
return e;
|
|
4195
4183
|
}
|
|
4196
|
-
var
|
|
4197
|
-
function
|
|
4184
|
+
var ts = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", rs = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
4185
|
+
function Fr(t, e, r) {
|
|
4198
4186
|
function n(a, s, i, o) {
|
|
4199
|
-
if (typeof a == "string" && (a =
|
|
4187
|
+
if (typeof a == "string" && (a = es(a)), typeof s == "string" && (s = kr(s)), s.length !== 16)
|
|
4200
4188
|
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
|
|
4201
4189
|
var c = new Uint8Array(16 + a.length);
|
|
4202
4190
|
if (c.set(s), c.set(a, s.length), c = r(c), c[6] = c[6] & 15 | e, c[8] = c[8] & 63 | 128, i) {
|
|
@@ -4211,39 +4199,39 @@ function Br(t, e, r) {
|
|
|
4211
4199
|
n.name = t;
|
|
4212
4200
|
} catch {
|
|
4213
4201
|
}
|
|
4214
|
-
return n.DNS =
|
|
4202
|
+
return n.DNS = ts, n.URL = rs, n;
|
|
4215
4203
|
}
|
|
4216
|
-
function
|
|
4204
|
+
function ns(t) {
|
|
4217
4205
|
if (typeof t == "string") {
|
|
4218
4206
|
var e = unescape(encodeURIComponent(t));
|
|
4219
4207
|
t = new Uint8Array(e.length);
|
|
4220
4208
|
for (var r = 0; r < e.length; ++r)
|
|
4221
4209
|
t[r] = e.charCodeAt(r);
|
|
4222
4210
|
}
|
|
4223
|
-
return
|
|
4211
|
+
return as(ss(is(t), t.length * 8));
|
|
4224
4212
|
}
|
|
4225
|
-
function
|
|
4213
|
+
function as(t) {
|
|
4226
4214
|
for (var e = [], r = t.length * 32, n = "0123456789abcdef", a = 0; a < r; a += 8) {
|
|
4227
4215
|
var s = t[a >> 5] >>> a % 32 & 255, i = parseInt(n.charAt(s >>> 4 & 15) + n.charAt(s & 15), 16);
|
|
4228
4216
|
e.push(i);
|
|
4229
4217
|
}
|
|
4230
4218
|
return e;
|
|
4231
4219
|
}
|
|
4232
|
-
function
|
|
4220
|
+
function Vr(t) {
|
|
4233
4221
|
return (t + 64 >>> 9 << 4) + 14 + 1;
|
|
4234
4222
|
}
|
|
4235
|
-
function
|
|
4236
|
-
t[e >> 5] |= 128 << e % 32, t[
|
|
4223
|
+
function ss(t, e) {
|
|
4224
|
+
t[e >> 5] |= 128 << e % 32, t[Vr(e) - 1] = e;
|
|
4237
4225
|
for (var r = 1732584193, n = -271733879, a = -1732584194, s = 271733878, i = 0; i < t.length; i += 16) {
|
|
4238
4226
|
var o = r, c = n, u = a, l = s;
|
|
4239
4227
|
r = D(r, n, a, s, t[i], 7, -680876936), s = D(s, r, n, a, t[i + 1], 12, -389564586), a = D(a, s, r, n, t[i + 2], 17, 606105819), n = D(n, a, s, r, t[i + 3], 22, -1044525330), r = D(r, n, a, s, t[i + 4], 7, -176418897), s = D(s, r, n, a, t[i + 5], 12, 1200080426), a = D(a, s, r, n, t[i + 6], 17, -1473231341), n = D(n, a, s, r, t[i + 7], 22, -45705983), r = D(r, n, a, s, t[i + 8], 7, 1770035416), s = D(s, r, n, a, t[i + 9], 12, -1958414417), a = D(a, s, r, n, t[i + 10], 17, -42063), n = D(n, a, s, r, t[i + 11], 22, -1990404162), r = D(r, n, a, s, t[i + 12], 7, 1804603682), s = D(s, r, n, a, t[i + 13], 12, -40341101), a = D(a, s, r, n, t[i + 14], 17, -1502002290), n = D(n, a, s, r, t[i + 15], 22, 1236535329), r = J(r, n, a, s, t[i + 1], 5, -165796510), s = J(s, r, n, a, t[i + 6], 9, -1069501632), a = J(a, s, r, n, t[i + 11], 14, 643717713), n = J(n, a, s, r, t[i], 20, -373897302), r = J(r, n, a, s, t[i + 5], 5, -701558691), s = J(s, r, n, a, t[i + 10], 9, 38016083), a = J(a, s, r, n, t[i + 15], 14, -660478335), n = J(n, a, s, r, t[i + 4], 20, -405537848), r = J(r, n, a, s, t[i + 9], 5, 568446438), s = J(s, r, n, a, t[i + 14], 9, -1019803690), a = J(a, s, r, n, t[i + 3], 14, -187363961), n = J(n, a, s, r, t[i + 8], 20, 1163531501), r = J(r, n, a, s, t[i + 13], 5, -1444681467), s = J(s, r, n, a, t[i + 2], 9, -51403784), a = J(a, s, r, n, t[i + 7], 14, 1735328473), n = J(n, a, s, r, t[i + 12], 20, -1926607734), r = N(r, n, a, s, t[i + 5], 4, -378558), s = N(s, r, n, a, t[i + 8], 11, -2022574463), a = N(a, s, r, n, t[i + 11], 16, 1839030562), n = N(n, a, s, r, t[i + 14], 23, -35309556), r = N(r, n, a, s, t[i + 1], 4, -1530992060), s = N(s, r, n, a, t[i + 4], 11, 1272893353), a = N(a, s, r, n, t[i + 7], 16, -155497632), n = N(n, a, s, r, t[i + 10], 23, -1094730640), r = N(r, n, a, s, t[i + 13], 4, 681279174), s = N(s, r, n, a, t[i], 11, -358537222), a = N(a, s, r, n, t[i + 3], 16, -722521979), n = N(n, a, s, r, t[i + 6], 23, 76029189), r = N(r, n, a, s, t[i + 9], 4, -640364487), s = N(s, r, n, a, t[i + 12], 11, -421815835), a = N(a, s, r, n, t[i + 15], 16, 530742520), n = N(n, a, s, r, t[i + 2], 23, -995338651), r = $(r, n, a, s, t[i], 6, -198630844), s = $(s, r, n, a, t[i + 7], 10, 1126891415), a = $(a, s, r, n, t[i + 14], 15, -1416354905), n = $(n, a, s, r, t[i + 5], 21, -57434055), r = $(r, n, a, s, t[i + 12], 6, 1700485571), s = $(s, r, n, a, t[i + 3], 10, -1894986606), a = $(a, s, r, n, t[i + 10], 15, -1051523), n = $(n, a, s, r, t[i + 1], 21, -2054922799), r = $(r, n, a, s, t[i + 8], 6, 1873313359), s = $(s, r, n, a, t[i + 15], 10, -30611744), a = $(a, s, r, n, t[i + 6], 15, -1560198380), n = $(n, a, s, r, t[i + 13], 21, 1309151649), r = $(r, n, a, s, t[i + 4], 6, -145523070), s = $(s, r, n, a, t[i + 11], 10, -1120210379), a = $(a, s, r, n, t[i + 2], 15, 718787259), n = $(n, a, s, r, t[i + 9], 21, -343485551), r = ne(r, o), n = ne(n, c), a = ne(a, u), s = ne(s, l);
|
|
4240
4228
|
}
|
|
4241
4229
|
return [r, n, a, s];
|
|
4242
4230
|
}
|
|
4243
|
-
function
|
|
4231
|
+
function is(t) {
|
|
4244
4232
|
if (t.length === 0)
|
|
4245
4233
|
return [];
|
|
4246
|
-
for (var e = t.length * 8, r = new Uint32Array(
|
|
4234
|
+
for (var e = t.length * 8, r = new Uint32Array(Vr(e)), n = 0; n < e; n += 8)
|
|
4247
4235
|
r[n >> 5] |= (t[n / 8] & 255) << n % 32;
|
|
4248
4236
|
return r;
|
|
4249
4237
|
}
|
|
@@ -4251,11 +4239,11 @@ function ne(t, e) {
|
|
|
4251
4239
|
var r = (t & 65535) + (e & 65535), n = (t >> 16) + (e >> 16) + (r >> 16);
|
|
4252
4240
|
return n << 16 | r & 65535;
|
|
4253
4241
|
}
|
|
4254
|
-
function
|
|
4242
|
+
function os(t, e) {
|
|
4255
4243
|
return t << e | t >>> 32 - e;
|
|
4256
4244
|
}
|
|
4257
4245
|
function Ve(t, e, r, n, a, s) {
|
|
4258
|
-
return ne(
|
|
4246
|
+
return ne(os(ne(ne(e, t), ne(n, s)), a), r);
|
|
4259
4247
|
}
|
|
4260
4248
|
function D(t, e, r, n, a, s, i) {
|
|
4261
4249
|
return Ve(e & r | ~e & n, t, e, a, s, i);
|
|
@@ -4269,11 +4257,11 @@ function N(t, e, r, n, a, s, i) {
|
|
|
4269
4257
|
function $(t, e, r, n, a, s, i) {
|
|
4270
4258
|
return Ve(r ^ (e | ~n), t, e, a, s, i);
|
|
4271
4259
|
}
|
|
4272
|
-
var
|
|
4273
|
-
const
|
|
4274
|
-
function
|
|
4260
|
+
var cs = Fr("v3", 48, ns);
|
|
4261
|
+
const us = cs;
|
|
4262
|
+
function ls(t, e, r) {
|
|
4275
4263
|
t = t || {};
|
|
4276
|
-
var n = t.random || (t.rng ||
|
|
4264
|
+
var n = t.random || (t.rng || Mr)();
|
|
4277
4265
|
if (n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, e) {
|
|
4278
4266
|
r = r || 0;
|
|
4279
4267
|
for (var a = 0; a < 16; ++a)
|
|
@@ -4282,7 +4270,7 @@ function ps(t, e, r) {
|
|
|
4282
4270
|
}
|
|
4283
4271
|
return Fe(n);
|
|
4284
4272
|
}
|
|
4285
|
-
function
|
|
4273
|
+
function ds(t, e, r, n) {
|
|
4286
4274
|
switch (t) {
|
|
4287
4275
|
case 0:
|
|
4288
4276
|
return e & r ^ ~e & n;
|
|
@@ -4297,7 +4285,7 @@ function gs(t, e, r, n) {
|
|
|
4297
4285
|
function je(t, e) {
|
|
4298
4286
|
return t << e | t >>> 32 - e;
|
|
4299
4287
|
}
|
|
4300
|
-
function
|
|
4288
|
+
function fs(t) {
|
|
4301
4289
|
var e = [1518500249, 1859775393, 2400959708, 3395469782], r = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
|
|
4302
4290
|
if (typeof t == "string") {
|
|
4303
4291
|
var n = unescape(encodeURIComponent(t));
|
|
@@ -4319,44 +4307,44 @@ function ms(t) {
|
|
|
4319
4307
|
for (var h = 16; h < 80; ++h)
|
|
4320
4308
|
d[h] = je(d[h - 3] ^ d[h - 8] ^ d[h - 14] ^ d[h - 16], 1);
|
|
4321
4309
|
for (var g = r[0], S = r[1], C = r[2], v = r[3], w = r[4], m = 0; m < 80; ++m) {
|
|
4322
|
-
var E = Math.floor(m / 20), _ = je(g, 5) +
|
|
4310
|
+
var E = Math.floor(m / 20), _ = je(g, 5) + ds(E, S, C, v) + w + e[E] + d[m] >>> 0;
|
|
4323
4311
|
w = v, v = C, C = je(S, 30) >>> 0, S = g, g = _;
|
|
4324
4312
|
}
|
|
4325
4313
|
r[0] = r[0] + g >>> 0, r[1] = r[1] + S >>> 0, r[2] = r[2] + C >>> 0, r[3] = r[3] + v >>> 0, r[4] = r[4] + w >>> 0;
|
|
4326
4314
|
}
|
|
4327
4315
|
return [r[0] >> 24 & 255, r[0] >> 16 & 255, r[0] >> 8 & 255, r[0] & 255, r[1] >> 24 & 255, r[1] >> 16 & 255, r[1] >> 8 & 255, r[1] & 255, r[2] >> 24 & 255, r[2] >> 16 & 255, r[2] >> 8 & 255, r[2] & 255, r[3] >> 24 & 255, r[3] >> 16 & 255, r[3] >> 8 & 255, r[3] & 255, r[4] >> 24 & 255, r[4] >> 16 & 255, r[4] >> 8 & 255, r[4] & 255];
|
|
4328
4316
|
}
|
|
4329
|
-
var
|
|
4330
|
-
const
|
|
4331
|
-
function
|
|
4317
|
+
var hs = Fr("v5", 80, fs);
|
|
4318
|
+
const ps = hs, gs = "00000000-0000-0000-0000-000000000000";
|
|
4319
|
+
function ms(t) {
|
|
4332
4320
|
if (!ke(t))
|
|
4333
4321
|
throw TypeError("Invalid UUID");
|
|
4334
4322
|
return parseInt(t.substr(14, 1), 16);
|
|
4335
4323
|
}
|
|
4336
|
-
const
|
|
4324
|
+
const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4337
4325
|
__proto__: null,
|
|
4338
|
-
NIL:
|
|
4339
|
-
parse:
|
|
4326
|
+
NIL: gs,
|
|
4327
|
+
parse: kr,
|
|
4340
4328
|
stringify: Fe,
|
|
4341
|
-
v1:
|
|
4342
|
-
v3:
|
|
4343
|
-
v4:
|
|
4344
|
-
v5:
|
|
4329
|
+
v1: ja,
|
|
4330
|
+
v3: us,
|
|
4331
|
+
v4: ls,
|
|
4332
|
+
v5: ps,
|
|
4345
4333
|
validate: ke,
|
|
4346
|
-
version:
|
|
4347
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4348
|
-
var ue = {}, et = { exports: {} }, tt = { exports: {} },
|
|
4349
|
-
function
|
|
4350
|
-
return
|
|
4334
|
+
version: ms
|
|
4335
|
+
}, Symbol.toStringTag, { value: "Module" })), ws = /* @__PURE__ */ ft(ys);
|
|
4336
|
+
var ue = {}, et = { exports: {} }, tt = { exports: {} }, Bt;
|
|
4337
|
+
function Ss() {
|
|
4338
|
+
return Bt || (Bt = 1, function(t) {
|
|
4351
4339
|
function e(r, n) {
|
|
4352
4340
|
return n.get ? n.get.call(r) : n.value;
|
|
4353
4341
|
}
|
|
4354
4342
|
t.exports = e, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4355
4343
|
}(tt)), tt.exports;
|
|
4356
4344
|
}
|
|
4357
|
-
var rt = { exports: {} },
|
|
4358
|
-
function
|
|
4359
|
-
return
|
|
4345
|
+
var rt = { exports: {} }, Gt;
|
|
4346
|
+
function Br() {
|
|
4347
|
+
return Gt || (Gt = 1, function(t) {
|
|
4360
4348
|
function e(r, n, a) {
|
|
4361
4349
|
if (!n.has(r))
|
|
4362
4350
|
throw new TypeError("attempted to " + a + " private field on non-instance");
|
|
@@ -4365,10 +4353,10 @@ function zr() {
|
|
|
4365
4353
|
t.exports = e, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4366
4354
|
}(rt)), rt.exports;
|
|
4367
4355
|
}
|
|
4368
|
-
var
|
|
4369
|
-
function
|
|
4370
|
-
return
|
|
4371
|
-
var e =
|
|
4356
|
+
var zt;
|
|
4357
|
+
function bs() {
|
|
4358
|
+
return zt || (zt = 1, function(t) {
|
|
4359
|
+
var e = Ss(), r = Br();
|
|
4372
4360
|
function n(a, s) {
|
|
4373
4361
|
var i = r(a, s, "get");
|
|
4374
4362
|
return e(a, i);
|
|
@@ -4376,9 +4364,9 @@ function xs() {
|
|
|
4376
4364
|
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4377
4365
|
}(et)), et.exports;
|
|
4378
4366
|
}
|
|
4379
|
-
var nt = { exports: {} }, at = { exports: {} },
|
|
4380
|
-
function
|
|
4381
|
-
return
|
|
4367
|
+
var nt = { exports: {} }, at = { exports: {} }, qt;
|
|
4368
|
+
function vs() {
|
|
4369
|
+
return qt || (qt = 1, function(t) {
|
|
4382
4370
|
function e(r, n, a) {
|
|
4383
4371
|
if (n.set)
|
|
4384
4372
|
n.set.call(r, a);
|
|
@@ -4391,10 +4379,10 @@ function Cs() {
|
|
|
4391
4379
|
t.exports = e, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4392
4380
|
}(at)), at.exports;
|
|
4393
4381
|
}
|
|
4394
|
-
var
|
|
4395
|
-
function
|
|
4396
|
-
return
|
|
4397
|
-
var e =
|
|
4382
|
+
var Xt;
|
|
4383
|
+
function Es() {
|
|
4384
|
+
return Xt || (Xt = 1, function(t) {
|
|
4385
|
+
var e = vs(), r = Br();
|
|
4398
4386
|
function n(a, s, i) {
|
|
4399
4387
|
var o = r(a, s, "set");
|
|
4400
4388
|
return e(a, o, i), i;
|
|
@@ -4402,16 +4390,16 @@ function _s() {
|
|
|
4402
4390
|
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4403
4391
|
}(nt)), nt.exports;
|
|
4404
4392
|
}
|
|
4405
|
-
var
|
|
4406
|
-
function
|
|
4407
|
-
if (
|
|
4393
|
+
var Yt;
|
|
4394
|
+
function As() {
|
|
4395
|
+
if (Yt)
|
|
4408
4396
|
return ue;
|
|
4409
|
-
|
|
4410
|
-
var t =
|
|
4397
|
+
Yt = 1;
|
|
4398
|
+
var t = rr;
|
|
4411
4399
|
Object.defineProperty(ue, "__esModule", {
|
|
4412
4400
|
value: !0
|
|
4413
4401
|
}), ue.SessionStore = void 0, ue.defaultCookies = l;
|
|
4414
|
-
var e = t(
|
|
4402
|
+
var e = t(bs()), r = t(Es());
|
|
4415
4403
|
function n(w, m) {
|
|
4416
4404
|
s(w, m), m.add(w);
|
|
4417
4405
|
}
|
|
@@ -4582,14 +4570,14 @@ function Ps() {
|
|
|
4582
4570
|
}
|
|
4583
4571
|
return ue;
|
|
4584
4572
|
}
|
|
4585
|
-
var st = {},
|
|
4586
|
-
function
|
|
4587
|
-
return
|
|
4573
|
+
var st = {}, Zt;
|
|
4574
|
+
function xs() {
|
|
4575
|
+
return Zt || (Zt = 1, Object.defineProperty(st, "__esModule", {
|
|
4588
4576
|
value: !0
|
|
4589
4577
|
})), st;
|
|
4590
4578
|
}
|
|
4591
4579
|
(function(t) {
|
|
4592
|
-
var e =
|
|
4580
|
+
var e = rr;
|
|
4593
4581
|
Object.defineProperty(t, "__esModule", {
|
|
4594
4582
|
value: !0
|
|
4595
4583
|
});
|
|
@@ -4599,7 +4587,7 @@ function Hs() {
|
|
|
4599
4587
|
getToken: !0
|
|
4600
4588
|
};
|
|
4601
4589
|
t.decode = f, t.encode = l, t.getToken = d;
|
|
4602
|
-
var n =
|
|
4590
|
+
var n = ka, a = e(Ya), s = ws, i = As(), o = xs();
|
|
4603
4591
|
Object.keys(o).forEach(function(h) {
|
|
4604
4592
|
h === "default" || h === "__esModule" || Object.prototype.hasOwnProperty.call(r, h) || h in t && t[h] === o[h] || Object.defineProperty(t, h, {
|
|
4605
4593
|
enumerable: !0,
|
|
@@ -4679,18 +4667,17 @@ function Hs() {
|
|
|
4679
4667
|
async function p(h, g) {
|
|
4680
4668
|
return await (0, a.default)("sha256", h, g, `NextAuth.js Generated Encryption Key${g ? ` (${g})` : ""}`, 32);
|
|
4681
4669
|
}
|
|
4682
|
-
})(
|
|
4683
|
-
class
|
|
4670
|
+
})(er);
|
|
4671
|
+
class Hs extends zr {
|
|
4684
4672
|
async validateTokenFront(e) {
|
|
4685
4673
|
this.logDebug("entra validate Token Front");
|
|
4686
|
-
const r = await
|
|
4674
|
+
const r = await er.getToken({ req: e });
|
|
4687
4675
|
if (this.logDebug("Token Front", JSON.stringify(r)), !r)
|
|
4688
|
-
throw new
|
|
4676
|
+
throw new wn().get("UNAUTHORIZED");
|
|
4689
4677
|
return e;
|
|
4690
4678
|
}
|
|
4691
4679
|
}
|
|
4692
4680
|
export {
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
En as M
|
|
4681
|
+
Hs as C,
|
|
4682
|
+
wn as E
|
|
4696
4683
|
};
|