@nibssplc/cams-sdk-react 1.0.0-rc.34 → 1.0.0-rc.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +113 -141
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +113 -141
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -42,155 +42,127 @@ var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(LabelPrimi
|
|
|
42
42
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(DialogPrimitive);
|
|
43
43
|
|
|
44
44
|
// Crypto polyfill for MSAL browser compatibility
|
|
45
|
-
|
|
45
|
+
(function () {
|
|
46
|
+
var _this = this;
|
|
47
|
+
if (typeof window === 'undefined')
|
|
48
|
+
return;
|
|
46
49
|
// Ensure crypto object exists
|
|
47
50
|
if (!window.crypto) {
|
|
48
|
-
|
|
49
|
-
Object.defineProperty(window, 'crypto', {
|
|
50
|
-
value: {},
|
|
51
|
-
writable: true,
|
|
52
|
-
configurable: true
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
// Ignore if crypto cannot be defined
|
|
57
|
-
}
|
|
51
|
+
window.crypto = {};
|
|
58
52
|
}
|
|
59
53
|
// Polyfill getRandomValues
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return array;
|
|
69
|
-
},
|
|
70
|
-
writable: true,
|
|
71
|
-
configurable: true
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
// Ignore if getRandomValues cannot be defined
|
|
76
|
-
}
|
|
54
|
+
if (!window.crypto.getRandomValues) {
|
|
55
|
+
window.crypto.getRandomValues = function (array) {
|
|
56
|
+
var bytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);
|
|
57
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
58
|
+
bytes[i] = Math.floor(Math.random() * 256);
|
|
59
|
+
}
|
|
60
|
+
return array;
|
|
61
|
+
};
|
|
77
62
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
new
|
|
108
|
-
for (
|
|
109
|
-
w = new
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
s1 = ((w[j - 2] >>> 17) | (w[j - 2] << 15)) ^ ((w[j - 2] >>> 19) | (w[j - 2] << 13)) ^ (w[j - 2] >>> 10);
|
|
115
|
-
w[j] = (w[j - 16] + s0 + w[j - 7] + s1) >>> 0;
|
|
116
|
-
}
|
|
117
|
-
a = hash[0], b = hash[1], c = hash[2], d = hash[3], e = hash[4], f = hash[5], g = hash[6], h = hash[7];
|
|
118
|
-
for (j = 0; j < 64; j++) {
|
|
119
|
-
S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));
|
|
120
|
-
ch = (e & f) ^ (~e & g);
|
|
121
|
-
temp1 = (h + S1 + ch + k[j] + w[j]) >>> 0;
|
|
122
|
-
S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));
|
|
123
|
-
maj = (a & b) ^ (a & c) ^ (b & c);
|
|
124
|
-
temp2 = (S0 + maj) >>> 0;
|
|
125
|
-
h = g;
|
|
126
|
-
g = f;
|
|
127
|
-
f = e;
|
|
128
|
-
e = (d + temp1) >>> 0;
|
|
129
|
-
d = c;
|
|
130
|
-
c = b;
|
|
131
|
-
b = a;
|
|
132
|
-
a = (temp1 + temp2) >>> 0;
|
|
133
|
-
}
|
|
134
|
-
hash[0] = (hash[0] + a) >>> 0;
|
|
135
|
-
hash[1] = (hash[1] + b) >>> 0;
|
|
136
|
-
hash[2] = (hash[2] + c) >>> 0;
|
|
137
|
-
hash[3] = (hash[3] + d) >>> 0;
|
|
138
|
-
hash[4] = (hash[4] + e) >>> 0;
|
|
139
|
-
hash[5] = (hash[5] + f) >>> 0;
|
|
140
|
-
hash[6] = (hash[6] + g) >>> 0;
|
|
141
|
-
hash[7] = (hash[7] + h) >>> 0;
|
|
63
|
+
var sha256 = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
64
|
+
var bytes, hash, k, ml, msg, i, w, j, j, s0, s1, a, b, c, d, e, f, g, h, j, S1, ch, temp1, S0, maj, temp2, result, i;
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
bytes = new Uint8Array(data);
|
|
67
|
+
hash = new Uint32Array(8);
|
|
68
|
+
k = new Uint32Array([
|
|
69
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
70
|
+
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
|
71
|
+
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
72
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
|
73
|
+
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
74
|
+
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
75
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
76
|
+
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
|
|
77
|
+
]);
|
|
78
|
+
hash[0] = 0x6a09e667;
|
|
79
|
+
hash[1] = 0xbb67ae85;
|
|
80
|
+
hash[2] = 0x3c6ef372;
|
|
81
|
+
hash[3] = 0xa54ff53a;
|
|
82
|
+
hash[4] = 0x510e527f;
|
|
83
|
+
hash[5] = 0x9b05688c;
|
|
84
|
+
hash[6] = 0x1f83d9ab;
|
|
85
|
+
hash[7] = 0x5be0cd19;
|
|
86
|
+
ml = bytes.length * 8;
|
|
87
|
+
msg = new Uint8Array(bytes.length + 64 + ((64 - ((bytes.length + 9) % 64)) % 64));
|
|
88
|
+
msg.set(bytes);
|
|
89
|
+
msg[bytes.length] = 0x80;
|
|
90
|
+
new DataView(msg.buffer).setUint32(msg.length - 4, ml, false);
|
|
91
|
+
for (i = 0; i < msg.length; i += 64) {
|
|
92
|
+
w = new Uint32Array(64);
|
|
93
|
+
for (j = 0; j < 16; j++)
|
|
94
|
+
w[j] = new DataView(msg.buffer).getUint32(i + j * 4, false);
|
|
95
|
+
for (j = 16; j < 64; j++) {
|
|
96
|
+
s0 = ((w[j - 15] >>> 7) | (w[j - 15] << 25)) ^ ((w[j - 15] >>> 18) | (w[j - 15] << 14)) ^ (w[j - 15] >>> 3);
|
|
97
|
+
s1 = ((w[j - 2] >>> 17) | (w[j - 2] << 15)) ^ ((w[j - 2] >>> 19) | (w[j - 2] << 13)) ^ (w[j - 2] >>> 10);
|
|
98
|
+
w[j] = (w[j - 16] + s0 + w[j - 7] + s1) >>> 0;
|
|
142
99
|
}
|
|
143
|
-
|
|
144
|
-
for (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
100
|
+
a = hash[0], b = hash[1], c = hash[2], d = hash[3], e = hash[4], f = hash[5], g = hash[6], h = hash[7];
|
|
101
|
+
for (j = 0; j < 64; j++) {
|
|
102
|
+
S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));
|
|
103
|
+
ch = (e & f) ^ (~e & g);
|
|
104
|
+
temp1 = (h + S1 + ch + k[j] + w[j]) >>> 0;
|
|
105
|
+
S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));
|
|
106
|
+
maj = (a & b) ^ (a & c) ^ (b & c);
|
|
107
|
+
temp2 = (S0 + maj) >>> 0;
|
|
108
|
+
h = g;
|
|
109
|
+
g = f;
|
|
110
|
+
f = e;
|
|
111
|
+
e = (d + temp1) >>> 0;
|
|
112
|
+
d = c;
|
|
113
|
+
c = b;
|
|
114
|
+
b = a;
|
|
115
|
+
a = (temp1 + temp2) >>> 0;
|
|
116
|
+
}
|
|
117
|
+
hash[0] = (hash[0] + a) >>> 0;
|
|
118
|
+
hash[1] = (hash[1] + b) >>> 0;
|
|
119
|
+
hash[2] = (hash[2] + c) >>> 0;
|
|
120
|
+
hash[3] = (hash[3] + d) >>> 0;
|
|
121
|
+
hash[4] = (hash[4] + e) >>> 0;
|
|
122
|
+
hash[5] = (hash[5] + f) >>> 0;
|
|
123
|
+
hash[6] = (hash[6] + g) >>> 0;
|
|
124
|
+
hash[7] = (hash[7] + h) >>> 0;
|
|
125
|
+
}
|
|
126
|
+
result = new Uint8Array(32);
|
|
127
|
+
for (i = 0; i < 8; i++)
|
|
128
|
+
new DataView(result.buffer).setUint32(i * 4, hash[i], false);
|
|
129
|
+
return [2 /*return*/, result.buffer];
|
|
130
|
+
});
|
|
131
|
+
}); };
|
|
132
|
+
// Force override crypto.subtle
|
|
133
|
+
var originalSubtle = window.crypto.subtle;
|
|
134
|
+
Object.defineProperty(window.crypto, 'subtle', {
|
|
135
|
+
value: {
|
|
136
|
+
digest: function (algorithm, data) { return __awaiter(_this, void 0, void 0, function () {
|
|
137
|
+
var alg;
|
|
138
|
+
return __generator(this, function (_a) {
|
|
139
|
+
alg = typeof algorithm === 'string' ? algorithm : algorithm.name;
|
|
140
|
+
if (alg === 'SHA-256')
|
|
141
|
+
return [2 /*return*/, sha256(data)];
|
|
142
|
+
if (originalSubtle === null || originalSubtle === void 0 ? void 0 : originalSubtle.digest)
|
|
143
|
+
return [2 /*return*/, originalSubtle.digest(algorithm, data)];
|
|
144
|
+
throw new Error("Unsupported algorithm: ".concat(alg));
|
|
145
|
+
});
|
|
146
|
+
}); }
|
|
147
|
+
},
|
|
148
|
+
writable: true,
|
|
149
|
+
configurable: true
|
|
150
|
+
});
|
|
174
151
|
// Polyfill randomUUID
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
catch (e) {
|
|
190
|
-
// Ignore if randomUUID cannot be defined
|
|
191
|
-
}
|
|
152
|
+
if (!window.crypto.randomUUID) {
|
|
153
|
+
Object.defineProperty(window.crypto, 'randomUUID', {
|
|
154
|
+
value: function () {
|
|
155
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
156
|
+
var r = (Math.random() * 16) | 0;
|
|
157
|
+
var v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
158
|
+
return v.toString(16);
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
writable: true,
|
|
162
|
+
configurable: true
|
|
163
|
+
});
|
|
192
164
|
}
|
|
193
|
-
}
|
|
165
|
+
})();
|
|
194
166
|
|
|
195
167
|
/******************************************************************************
|
|
196
168
|
Copyright (c) Microsoft Corporation.
|