{"version":3,"file":"safeStableStringify-Dwy4pTtm.cjs","names":["isPlainObject","isBoolean","isNaN","isPlainObject","isBoolean","createMessage","getPreciseType","isNull","isObjectOrArray","isFunction","isNumberObject","isNaN","isInfinityNumber","isStringObject","isBooleanObject","isBigInt","isSet","isArray","isNumber","isObject"],"sources":["../src/predicates/is/isMap.ts","../src/predicates/is/isDate.ts","../src/predicates/is/isUndefined.ts","../src/predicates/is/isSymbol.ts","../src/conversions/stringify/safeStableStringify.ts"],"sourcesContent":["/** ---------------------------------------------------------\n * * ***Type guard: `isMap`.***\n * ----------------------------------------------------------\n * **Checks whether the given value is a **[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) object**.**\n *\n * ---\n * - **Behavior:**\n *     - Ensures that the provided value is an instance of **[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)**.\n *     - Useful in TypeScript for narrowing types when working with collections.\n *\n * ---\n * @param {*} value The value to check.\n *\n * ---\n * @returns {boolean} Returns `true` if `value` is instance of **[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)**, else `false`.\n *\n * ---\n * @example\n * isMap(new Map());\n * // ➔ true\n * isMap(new WeakMap());\n * // ➔ false\n * isMap({});\n * // ➔ false\n */\nexport function isMap<K = unknown, V = unknown>(\n  value: Map<K, V>\n): value is Map<K, V>;\nexport function isMap(value: unknown): value is Map<unknown, unknown>;\nexport function isMap(value: unknown): boolean {\n  return (\n    Object.prototype.toString.call(value) === \"[object Map]\" ||\n    value instanceof Map\n  );\n}\n","import { isNaN } from \"./isNaN\";\nimport { isBoolean } from \"./isBoolean\";\nimport { isPlainObject } from \"./isPlainObject\";\n\ntype isDateOptions = {\n  /** ----------------------------------------------------------\n   * * ***Skip the validity check (`!isNaN(date.getTime())`).***\n   * -----------------------------------------------------------\n   *\n   * When `true`, the function only checks that the value is an\n   * instance of `Date` without verifying that it represents a valid\n   * date value, default: `false`.\n   *\n   * ---\n   * @default false\n   */\n  skipInvalidDate?: boolean;\n};\n\n/** ----------------------------------------------------------\n * * ***Type guard: `isDate`.***\n * -----------------------------------------------------------\n * **Determines whether the given `value` is a real, valid JavaScript\n *   **[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** object.**\n *\n * ---\n * - #### *Behavior:*\n *     - #### Returns **true** only if:\n *       - `value` is an instance of `Date`.\n *       - and, unless `options.skipInvalidDate` is `true`,\n *         the underlying time value is valid (`!isNaN(value.getTime())`).\n *       ---\n *     - #### Returns **false** for:\n *       - non-Date values (strings, numbers, etc.).\n *       - `Date` instances that represent an invalid time value\n *         (e.g. `new Date(\"bad\")`), unless skipping is enabled.\n *\n * ---\n * @param {*} value - The value to check.\n * @param {isDateOptions} [options] - Optional settings.\n *\n * ---\n * @returns {boolean} Return `true` if value is a valid Date object.\n *\n * ---\n * @example\n * isDate(new Date());\n * // ➜ true\n * isDate(new Date(\"invalid\"));\n * // ➜ false\n * isDate(\"2024-01-01\");\n * // ➜ false\n *\n * // Skipping validity check:\n * isDate(new Date(\"invalid\"), { skipInvalidDate: true });\n * // ➜ true\n */\nexport const isDate = (\n  value: unknown,\n  options: isDateOptions = {}\n): value is Date => {\n  if (!isPlainObject(options)) options = {};\n\n  const skipInvalidDate =\n    isPlainObject(options) && isBoolean(options.skipInvalidDate)\n      ? options.skipInvalidDate\n      : false;\n\n  const instanceDate = value instanceof Date;\n\n  if (skipInvalidDate) return instanceDate;\n  return instanceDate && !isNaN(value.getTime());\n};\n","/** ---------------------------------------------------------\n * * ***Type guard: `isUndefined`.***\n * ----------------------------------------------------------\n * **Checks if a value is\n * **[`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)**.**\n *\n * ---\n * - **Behavior:**\n *     - Narrows type to `undefined` when true.\n *     - Excludes `null`, `objects`, `arrays`, `strings`, `numbers`, and\n *       `all other values`.\n *\n * ---\n * @param {*} value - The value to check.\n *\n * ---\n * @returns {boolean} Returns `true` if the value is `undefined`, otherwise `false`.\n *\n * ---\n * @example\n * isUndefined(undefined);\n * // ➔ true\n * isUndefined([]);\n * // ➔ false\n * isUndefined(123);\n * // ➔ false\n * isUndefined(null);\n * // ➔ false\n * isUndefined(\"abc\");\n * // ➔ false\n */\nexport const isUndefined = (value: unknown): value is undefined => {\n  return typeof value === \"undefined\";\n};\n","/** ----------------------------------------------------------\n * * ***Type guard: `isSymbol`.***\n * -----------------------------------------------------------\n * **Checks if a value is of type\n * **[`symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/Symbol)**.**\n *\n * ---\n * - **Behavior:**\n *     - Narrows type to `symbol` when true.\n *     - Uses the `typeof` operator for strict checking.\n *\n * ---\n * @param {*} value - The value to check.\n *\n * ---\n * @returns {boolean} Returns `true` if the value is a symbol, otherwise `false`.\n *\n * ---\n * @example\n * isSymbol(Symbol(\"id\"));\n * // ➔ true\n * isSymbol(\"not a symbol\");\n * // ➔ false\n * isSymbol(123);\n * // ➔ false\n * isSymbol(undefined);\n * // ➔ false\n */\nexport const isSymbol = (value: unknown): value is symbol => {\n  return typeof value === \"symbol\";\n};\n","import { createMessage } from \"@/_private/logger\";\n\nimport { isSet } from \"@/predicates/is/isSet\";\nimport { isMap } from \"@/predicates/is/isMap\";\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isNull } from \"@/predicates/is/isNull\";\nimport { isArray } from \"@/predicates/is/isArray\";\nimport { isSymbol } from \"@/predicates/is/isSymbol\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isObject } from \"@/predicates/is/isObject\";\nimport { isBigInt } from \"@/predicates/is/isBigInt\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isFunction } from \"@/predicates/is/isFunction\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNumberObject } from \"@/predicates/is/isNumberObject\";\nimport { isStringObject } from \"@/predicates/is/isStringObject\";\nimport { isBooleanObject } from \"@/predicates/is/isBooleanObject\";\nimport { isObjectOrArray } from \"@/predicates/is/isObjectOrArray\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isInfinityNumber } from \"@/predicates/is/isInfinityNumber\";\n\n/** ------------------------------------------------------------------------------------\n * * ***Type Options for **{@link safeStableStringify | `safeStableStringify`}**.***\n * -------------------------------------------------------------------------------------\n */\ntype SafeStableStringifyOptions = {\n  /** ----------------------------------------------------------------------------------\n   * * ***Whether to sort **object keys** alphabetically (recursively).***\n   * -----------------------------------------------------------------------------------\n   *\n   * - `true` ***(default)***: object keys are sorted to ensure stable output.\n   * - `false`: preserves original insertion order of keys.\n   *\n   * ---\n   * @default true\n   */\n  sortKeys?: boolean;\n  /** ----------------------------------------------------------------------------------\n   * * ***Whether to sort **primitive values inside arrays**.***\n   * -----------------------------------------------------------------------------------\n   *\n   * - `true`: primitive values in arrays are sorted to ensure stable output.\n   * - `false` ***(default)***: arrays retain their original order; objects and nested arrays\n   *    are not reordered.\n   *\n   * ---\n   * @default false\n   */\n  sortArray?: boolean;\n  /** ----------------------------------------------------------------------------------\n   * * ***Whether to pretty-print JSON output with 2-space indentation.***\n   * -----------------------------------------------------------------------------------\n   *\n   * - `true`: output is formatted with indentation and newlines.\n   * - `false` ***(default)***: produces compact single-line JSON.\n   *\n   * ---\n   * @default false\n   */\n  pretty?: boolean;\n  /** ----------------------------------------------------------------------------------\n   * * ***Preserve `undefined` values instead of converting them to `null`.***\n   * -----------------------------------------------------------------------------------\n   * **Controls how the internal `deepProcess` step rewrites values\n   * **before** the final `JSON.stringify` call.**\n   *\n   * - **Default (`false`):**\n   *      - Every `undefined` value (object properties **and** array elements)\n   *        is replaced with `null` **before** serialization, because this happens\n   *        first, the key is **not removed** by `JSON.stringify`.\n   * - **`true`** – Leaves `undefined` untouched so the final\n   *   `JSON.stringify` call behaves natively:\n   *      - Object properties with `undefined` are **removed**.\n   *      - Array elements that are `undefined` become `null`.\n   *\n   * ---\n   * @default\n   * ```ts\n   * false\n   * ```\n   *\n   * ---\n   * @example\n   * 1. #### keepUndefined = true: behaves like native JSON.stringify:\n   *    ```ts\n   *    safeStableStringify({ a: undefined }, { keepUndefined: true });\n   *    // ➔ '{}' (key removed)\n   *    ```\n   *    ---\n   * 2. #### Default (false) - convert undefined to null, key kept:\n   *    ```ts\n   *    safeStableStringify({ a: undefined });\n   *    // ➔ '{\"a\":null}' (key present, value null)\n   *    ```\n   *    ---\n   * 3. #### Arrays:\n   *    ```ts\n   *    safeStableStringify([undefined]);\n   *    // ➔ '[null]' (same, but via pre-replacement)\n   *    safeStableStringify([undefined], { keepUndefined: true });\n   *    // ➔ '[null]' (element becomes null)\n   *    ```\n   */\n  keepUndefined?: boolean;\n};\n\n/** ---------------------------------------------------------------------------------------------------------------\n * * ***Utility: `safeStableStringify`.***\n * ----------------------------------------------------------------------------------------------------------------\n * **Safely converts a JavaScript value into a stable, JSON-compatible string.**\n *\n * ---\n * - **This function is an enhanced version of `JSON.stringify` with additional guarantees:**\n *      - ***Features:***\n *           - Recursively sorts object keys **only if** `sortKeys` is `true` (default: `true`), to ensure stable\n *             key order.\n *               - If `sortKeys` is `false`, preserves the original insertion order of object keys.\n *           - Optionally sorts array primitive values **only if** `sortArray` is `true` (default: `false`).\n *           - Only primitive values in arrays are sorted.\n *           - Objects and nested arrays keep their original position and are appended after sorted primitives.\n *           - If `sortArray` is `false`, arrays retain their original order.\n *           - Converts JavaScript special values for JSON safety:\n *               - `undefined`, `NaN`, `Infinity`, `-Infinity` ➔ `null`.\n *               - `BigInt` ➔ string (JSON does not support BigInt).\n *           - Converts boxed primitives box into their primitive equivalents:\n *               - `new Number(42)` ➔ `Number(42)` ➔ `42`.\n *               - `new String(\"hi\")` ➔ `String(\"hi\")` ➔ `\"hi\"`.\n *               - `new Boolean(true)` ➔ `Boolean(true)` ➔ `true`.\n *           - Functions and Symbols are removed.\n *           - Circular references are replaced with the string `\"[Circular]\"`.\n *           - Serializes:\n *               - `Date` ➔ ISO string (`date.toISOString()`).\n *               - `Set` ➔ `{ set: [values...] }` (values are recursively processed).\n *               - `Map` ➔ `{ map: [ [key, value], ... ] }` (values are recursively processed).\n *           - Compared to `JSON.stringify`, this ensures **stable output**:\n *               - Same object structure always produces the same string.\n *               - Useful for deep equality checks, hashing, caching keys, or snapshot tests.\n *           - Controls how `undefined` is handled **before** the final `JSON.stringify` call, by `keepUndefined`\n *             options, default: `false`.\n *               - **false**: All `undefined` values (object properties and array elements) are replaced\n *               with `null`, so object keys remain.\n *               - **true**: Leaves `undefined` values as-is, and handling by native `JSON.stringify` then:\n *                    1. Removes object properties that are `undefined`.\n *                    2. Converts `undefined` array elements to `null`.\n *               - Use `true` when you need native removal of keys or to preserve sparse arrays\n *                 exactly as `JSON.stringify` would.\n *\n * ---\n * @param {*} value\n *   ***Any JavaScript value to serialize, can be:***\n *      - Primitives (`number`, `string`, `boolean`, `bigint`, `null`, `undefined`).\n *      - Boxed primitives (`new Number()`, `new String()`, `new Boolean()`).\n *      - Arrays, plain objects, nested structures.\n *      - Date, Map, Set.\n *      - Circular structures.\n * @param {SafeStableStringifyOptions} [options]\n *   ***Configuration options for `safeStableStringify`:***\n *      - `keepUndefined` ***(boolean)*** – Control how `undefined` is handled **before** the final `JSON.stringify`\n *         call, default: `false`.\n *      - `sortKeys` ***(boolean)*** – Whether to sort object keys alphabetically (recursively), default: `true`.\n *      - `sortArray` ***(boolean)*** – Whether to sort primitive values inside arrays, default: `false`.\n *      - `pretty` ***(boolean)*** – Whether to pretty-print JSON output with 2-space indentation, default: `false`.\n *\n * ---\n * @throws **{@link TypeError | `TypeError`}** if `sortKeys`, `sortArray`, or `pretty` are not strictly boolean.\n *\n * ---\n * @returns {string}\n *   A stable JSON string representation of the input value.\n *\n * ---\n * @example\n * 1. #### Basic object key sorting:\n *    ```ts\n *    safeStableStringify({\n *      b: 2,\n *      a: 1\n *    });\n *    // ➔ '{\"a\":1,\"b\":2}'\n *    ```\n *    ---\n * 2. #### Disable key sorting:\n *    ```ts\n *    safeStableStringify(\n *      {\n *        b: 2,\n *        a: 1\n *      },\n *      {\n *        sortKeys: false\n *      }\n *    );\n *    // ➔ '{\"b\":2,\"a\":1}'\n *    ```\n *    ---\n * 3. #### Sort array values:\n *    ```ts\n *    safeStableStringify(\n *      [3, 1, 2],\n *      {\n *        sortArray: true\n *      }\n *    );\n *    // ➔ '[1,2,3]'\n *    ```\n *    ---\n * 4. #### keepUndefined enabled:\n *    ```ts\n *    safeStableStringify(\n *      { a: undefined },\n *      {\n *        keepUndefined: true\n *      }\n *    );\n *    // ➔ '{}'\n *    ```\n *    ---\n * 5. #### Default keepUndefined behavior:\n *    ```ts\n *    safeStableStringify({\n *      a: undefined\n *    });\n *    // ➔ '{\"a\":null}'\n *    ```\n *    ---\n * 6. #### Nested object with sorted arrays:\n *    ```ts\n *    safeStableStringify(\n *      {\n *        z: [3, 1, 2],\n *        x: {\n *          d: 4,\n *          c: 3\n *        }\n *      },\n *      {\n *        sortKeys: true,\n *        sortArray: true\n *      }\n *    );\n *    // ➔ '{\"x\":{\"c\":3,\"d\":4},\"z\":[1,2,3]}'\n *    ```\n *    ---\n * 7. #### Disable key sorting but keep array sorting:\n *    ```ts\n *    safeStableStringify(\n *      {\n *        z: [3, 1, 2],\n *        x: {\n *          d: 4,\n *          c: 3\n *        }\n *      },\n *      {\n *        sortKeys: false,\n *        sortArray: true\n *      }\n *    );\n *    // ➔ '{\"z\":[1,2,3],\"x\":{\"d\":4,\"c\":3}}'\n *    ```\n *    ---\n * 8. #### Pretty print output:\n *    ```ts\n *    safeStableStringify(\n *      [3, 1, 2],\n *      {\n *        sortArray: true,\n *        pretty: true\n *      }\n *    );\n *    // ➔ [\n *    //      1,\n *    //      2,\n *    //      3\n *    //    ]\n *    ```\n *    ---\n * 9. #### Boxed primitives converted to primitive values:\n *    ```ts\n *    safeStableStringify({\n *      n: new Number(42),\n *      s: new String(\"hi\"),\n *      b: new Boolean(true)\n *    });\n *    // ➔ '{\"n\":42,\"s\":\"hi\",\"b\":true}'\n *    ```\n *    ---\n * 10. #### Handles Date, BigInt, Map, and Set:\n *     ```ts\n *     safeStableStringify({\n *       time: new Date(\"2025-01-01\"),\n *       big: BigInt(9007199254740991),\n *       data: new Map([\n *         [\"key\", new Set([1, 2])]\n *       ])\n *     });\n *     // ➔ '{\"big\":\"9007199254740991\",\"data\":{\"map\":[[\"key\",{\"set\":[1,2]}]]},\"time\":\"2025-01-01T00:00:00.000Z\"}'\n *     ```\n *     ---\n * 11. #### Remove functions and symbols:\n *     ```ts\n *     safeStableStringify({\n *       f: () => {},\n *       s: Symbol(\"wow\")\n *     });\n *     // ➔ '{}'\n *     ```\n *     ---\n * 12. #### Convert undefined, NaN, and Infinity:\n *     ```ts\n *     safeStableStringify([\n *       undefined,\n *       NaN,\n *       Infinity,\n *       -Infinity\n *     ]);\n *     // ➔ '[null,null,null,null]'\n *     ```\n *     ---\n * 13. #### Handle circular references:\n *     ```ts\n *     const obj = {\n *       name: \"A\"\n *     };\n *\n *     obj.self = obj;\n *\n *     safeStableStringify(obj);\n *     // ➔ '{\"name\":\"A\",\"self\":\"[Circular]\"}'\n *     ```\n *     ---\n * 14. #### Complex nested array sorting:\n *     ```ts\n *     const arr = [\n *       9,\n *       7,\n *       [4, 2, 3],\n *       { z: [5, 1, 6] }\n *     ];\n *\n *     safeStableStringify(arr, {\n *       sortArray: true,\n *       sortKeys: true\n *     });\n *\n *     // ➔ '[7,9,[2,3,4],{\"z\":[1,5,6]}]'\n *     ```\n */\nexport const safeStableStringify = (\n  value: unknown,\n  options: SafeStableStringifyOptions = {}\n): string => {\n  if (!isPlainObject(options)) options = {};\n\n  const pretty = options.pretty ?? false;\n  const sortKeys = options.sortKeys ?? true;\n  const sortArray = options.sortArray ?? false;\n  const keepUndefined = options.keepUndefined ?? false;\n\n  if (\n    !isBoolean(sortKeys) ||\n    !isBoolean(sortArray) ||\n    !isBoolean(pretty) ||\n    !isBoolean(keepUndefined)\n  ) {\n    throw new TypeError(\n      createMessage(\n        \"safeStableStringify\",\n        `Parameters \\`sortKeys\\`, \\`sortArray\\`, \\`keepUndefined\\` and \\`pretty\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\`, but received: \"['sortKeys': \\`${getPreciseType(\n          sortKeys\n        )}\\`, 'sortArray': \\`${getPreciseType(\n          sortArray\n        )}\\`, 'keepUndefined': \\`${getPreciseType(\n          keepUndefined\n        )}\\`, 'pretty': \\`${getPreciseType(pretty)}\\`]\".`\n      )\n    );\n  }\n\n  if (isUndefined(value)) {\n    return keepUndefined ? \"undefined\" : \"null\";\n  }\n\n  const seen = new WeakSet();\n\n  const isPrimitive = (val: unknown): boolean =>\n    isNull(val) || (!isObjectOrArray(val) && !isFunction(val));\n\n  const deepProcess = (val: unknown): unknown => {\n    if (isNumberObject(val)) {\n      const valOf = val.valueOf();\n      return isNaN(valOf) || isInfinityNumber(valOf) ? null : valOf;\n    }\n    if (isStringObject(val)) return val.valueOf();\n    if (isBooleanObject(val)) return val.valueOf();\n    if (isFunction(val) || isSymbol(val)) return undefined;\n    if (isBigInt(val)) return val.toString();\n    if (isNaN(val) || isInfinityNumber(val)) return null;\n    if (isUndefined(val)) {\n      return keepUndefined ? undefined : null;\n    }\n\n    if (isObjectOrArray(val)) {\n      if (seen.has(val)) return \"[Circular]\";\n      seen.add(val);\n\n      if (isDate(val)) return val.toISOString();\n      if (isMap(val)) {\n        return {\n          map: Array.from(val.entries()).map(([k, v]) => [k, deepProcess(v)])\n        };\n      }\n      if (isSet(val)) return { set: Array.from(val.values()).map(deepProcess) };\n\n      if (isArray(val)) {\n        const processedArr = val.map(deepProcess);\n        if (sortArray) {\n          const primitives: unknown[] = [];\n          const nonPrimitives: unknown[] = [];\n\n          for (const item of processedArr) {\n            if (isPrimitive(item)) primitives.push(item);\n            else nonPrimitives.push(item);\n          }\n          primitives.sort((a, b) => {\n            if (isNumber(a) && isNumber(b)) return a - b;\n            return String(a).localeCompare(String(b));\n          });\n          return [...primitives, ...nonPrimitives];\n        }\n        return processedArr;\n      }\n\n      const keys = Object.keys(val);\n      if (sortKeys) {\n        keys.sort((a, b) => {\n          const na = Number(a);\n          const nb = Number(b);\n          if (!isNaN(na) && !isNaN(nb)) return na - nb;\n          return a.localeCompare(b);\n        });\n      }\n\n      const result: Record<string, unknown> = {};\n\n      if (isObject(val)) {\n        for (const k of keys) {\n          const v = deepProcess(val[k]);\n          if (!isUndefined(v)) result[k] = v;\n        }\n      }\n\n      return result;\n    }\n\n    return val;\n  };\n\n  try {\n    return JSON.stringify(deepProcess(value), null, pretty ? 2 : 0);\n  } catch (err) {\n    console.warn(createMessage(\"safeStableStringify\", String(err)));\n    return \"{}\";\n  }\n};\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,SAAgB,MAAM,OAAyB;CAC7C,OACE,OAAO,UAAU,SAAS,KAAK,KAAK,MAAM,kBAC1C,iBAAiB;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACuBA,MAAa,UACX,OACA,UAAyB,CAAC,MACR;CAClB,IAAI,CAACA,6BAAc,OAAO,GAAG,UAAU,CAAC;CAExC,MAAM,kBACJA,6BAAc,OAAO,KAAKC,yBAAU,QAAQ,eAAe,IACvD,QAAQ,kBACR;CAEN,MAAM,eAAe,iBAAiB;CAEtC,IAAI,iBAAiB,OAAO;CAC5B,OAAO,gBAAgB,CAACC,qBAAM,MAAM,QAAQ,CAAC;AAC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzCA,MAAa,eAAe,UAAuC;CACjE,OAAO,OAAO,UAAU;AAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLA,MAAa,YAAY,UAAoC;CAC3D,OAAO,OAAO,UAAU;AAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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