@nibssplc/cams-sdk-react 1.0.0-rc.33 → 1.0.0-rc.35

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 CHANGED
@@ -42,155 +42,119 @@ 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
- if (typeof window !== 'undefined') {
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
- try {
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 (window.crypto && !window.crypto.getRandomValues) {
61
- try {
62
- Object.defineProperty(window.crypto, 'getRandomValues', {
63
- value: function (array) {
64
- var bytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);
65
- for (var i = 0; i < bytes.length; i++) {
66
- bytes[i] = Math.floor(Math.random() * 256);
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
- // Force polyfill crypto.subtle on localhost and non-HTTPS contexts
79
- if (window.crypto) {
80
- var sha256_1 = function (data) { return __awaiter(void 0, void 0, void 0, function () {
81
- 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;
82
- return __generator(this, function (_a) {
83
- bytes = new Uint8Array(data);
84
- hash = new Uint32Array(8);
85
- k = new Uint32Array([
86
- 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
87
- 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
88
- 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
89
- 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
90
- 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
91
- 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
92
- 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
93
- 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
94
- ]);
95
- hash[0] = 0x6a09e667;
96
- hash[1] = 0xbb67ae85;
97
- hash[2] = 0x3c6ef372;
98
- hash[3] = 0xa54ff53a;
99
- hash[4] = 0x510e527f;
100
- hash[5] = 0x9b05688c;
101
- hash[6] = 0x1f83d9ab;
102
- hash[7] = 0x5be0cd19;
103
- ml = bytes.length * 8;
104
- msg = new Uint8Array(bytes.length + 64 + ((64 - ((bytes.length + 9) % 64)) % 64));
105
- msg.set(bytes);
106
- msg[bytes.length] = 0x80;
107
- new DataView(msg.buffer).setUint32(msg.length - 4, ml, false);
108
- for (i = 0; i < msg.length; i += 64) {
109
- w = new Uint32Array(64);
110
- for (j = 0; j < 16; j++)
111
- w[j] = new DataView(msg.buffer).getUint32(i + j * 4, false);
112
- for (j = 16; j < 64; j++) {
113
- s0 = ((w[j - 15] >>> 7) | (w[j - 15] << 25)) ^ ((w[j - 15] >>> 18) | (w[j - 15] << 14)) ^ (w[j - 15] >>> 3);
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
- result = new Uint8Array(32);
144
- for (i = 0; i < 8; i++)
145
- new DataView(result.buffer).setUint32(i * 4, hash[i], false);
146
- return [2 /*return*/, result.buffer];
147
- });
148
- }); };
149
- var originalSubtle_1 = window.crypto.subtle;
150
- try {
151
- Object.defineProperty(window.crypto, 'subtle', {
152
- value: {
153
- digest: function (algorithm, data) { return __awaiter(void 0, void 0, void 0, function () {
154
- var alg;
155
- return __generator(this, function (_a) {
156
- alg = typeof algorithm === 'string' ? algorithm : algorithm.name;
157
- if (alg === 'SHA-256')
158
- return [2 /*return*/, sha256_1(data)];
159
- // Fallback to original if available
160
- if (originalSubtle_1 === null || originalSubtle_1 === void 0 ? void 0 : originalSubtle_1.digest)
161
- return [2 /*return*/, originalSubtle_1.digest(algorithm, data)];
162
- throw new Error("Unsupported algorithm: ".concat(alg));
163
- });
164
- }); }
165
- },
166
- writable: true,
167
- configurable: true
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
+ window.crypto.subtle = {
135
+ digest: function (algorithm, data) { return __awaiter(_this, void 0, void 0, function () {
136
+ var alg;
137
+ return __generator(this, function (_a) {
138
+ alg = typeof algorithm === 'string' ? algorithm : algorithm.name;
139
+ if (alg === 'SHA-256')
140
+ return [2 /*return*/, sha256(data)];
141
+ if (originalSubtle === null || originalSubtle === void 0 ? void 0 : originalSubtle.digest)
142
+ return [2 /*return*/, originalSubtle.digest(algorithm, data)];
143
+ throw new Error("Unsupported algorithm: ".concat(alg));
168
144
  });
169
- }
170
- catch (e) {
171
- // Ignore if subtle cannot be defined
172
- }
173
- }
145
+ }); }
146
+ };
174
147
  // Polyfill randomUUID
175
- if (window.crypto && !window.crypto.randomUUID) {
176
- try {
177
- Object.defineProperty(window.crypto, 'randomUUID', {
178
- value: function () {
179
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
180
- var r = (Math.random() * 16) | 0;
181
- var v = c === 'x' ? r : (r & 0x3) | 0x8;
182
- return v.toString(16);
183
- });
184
- },
185
- writable: true,
186
- configurable: true
148
+ if (!window.crypto.randomUUID) {
149
+ window.crypto.randomUUID = function () {
150
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
151
+ var r = (Math.random() * 16) | 0;
152
+ var v = c === 'x' ? r : (r & 0x3) | 0x8;
153
+ return v.toString(16);
187
154
  });
188
- }
189
- catch (e) {
190
- // Ignore if randomUUID cannot be defined
191
- }
155
+ };
192
156
  }
193
- }
157
+ })();
194
158
 
195
159
  /******************************************************************************
196
160
  Copyright (c) Microsoft Corporation.