PageSourceSearch

https://www.nbc.com/generetic/generated/generetic.4b9fef090869e4d7c4bb.js

js nbc.com collected 2026-09-24 07:21:03 UTC 3,226 bytes, 81 lines download raw bytes

1"use strict";
2(self["webpackChunkgeneretic"] = self["webpackChunkgeneretic"] || []).push([[6467],{
3
4/***/ 15666:
5/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6
7
8
9Object.defineProperty(exports, "__esModule", ({
10  value: true
11}));
12exports.initObfuscatedConfig = exports.getObfuscatedValue = void 0;
13__webpack_require__(9370);
14__webpack_require__(70670);
15__webpack_require__(27967);
16__webpack_require__(79755);
17__webpack_require__(60278);
18__webpack_require__(68508);
19var _get2 = _interopRequireDefault(__webpack_require__(73521));
20function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21const COMPATIBILITY_VERSION = 1;
22let obfuscatedConfig;
23const initObfuscatedConfig = async store => {
24  var _store$getState, _window;
25  const encodedPayload = (_store$getState = store.getState()) === null || _store$getState === void 0 || (_store$getState = _store$getState.client) === null || _store$getState === void 0 ? void 0 : _store$getState.oc;
26  if (!encodedPayload || !((_window = window) !== null && _window !== void 0 && (_window = _window.crypto) !== null && _window !== void 0 && _window.subtle)) {
27    return;
28  }
29
30  // the obfuscated config is provided as a Base-64 encoded byte sequence
31  // first we need to convert the Base-64 to ASCII, and then back to a byte squence
32  const decodedChars = atob(encodedPayload);
33  const payload = new Uint8Array(decodedChars.length);
34  for (let i = 0; i < decodedChars.length; i++) {
35    payload[i] = decodedChars.charCodeAt(i);
36  }
37  const payloadSize = payload.byteLength;
38  if (payloadSize <= 12 + 32 + 4) {
39    // payload is too small to be valid
40    return;
41  }
42
43  // the initialization vector is the first 12 bytes
44  const iv = payload.subarray(0, 12);
45  // the encryption key is the next 32 bytes (byte 12-44) - 32 bytes is 256 bits
46  const keyBytes = payload.subarray(12, 44);
47  // the encrypted config is the remaining bytes, except for the last 4 bytes
48  const encryptedBytes = payload.subarray(44, payloadSize - 4);
49  // the last 4 bytes (4 bytes = 32 bit integer) is a known integer value that should match the
50  // COMPATIBILITY_VERSION number - this allows us to detect breaking changes and stop
51  // execution early
52  const view = new DataView(payload.buffer, payloadSize - 4);
53  const compatibilityValue = view.getUint32(0);
54  if (compatibilityValue !== COMPATIBILITY_VERSION) {
55    // this is not a compatible obfuscated config payload
56    return;
57  }
58
59  // read the decryption key
60  const key = await window.crypto.subtle.importKey('raw', keyBytes, 'AES-GCM', true, ['decrypt']);
61
62  // use the decryption key to decrypt the encrypted config
63  const decryptedBytes = await crypto.subtle.decrypt({
64    name: 'AES-GCM',
65    iv
66  }, key, encryptedBytes);
67
68  // decode the decrypted byte array into a string
69  const decoder = new TextDecoder();
70  const decryptedString = decoder.decode(decryptedBytes);
71  // parse the string into JSON
72  const configValues = JSON.parse(decryptedString);
73  obfuscatedConfig = configValues;
74};
75exports.initObfuscatedConfig = initObfuscatedConfig;
76const getObfuscatedValue = path => (0, _get2.default)(obfuscatedConfig, path);
77exports.getObfuscatedValue = getObfuscatedValue;
78
79/***/ })
80
81}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.