mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
1 line
31 KiB
JSON
1 line
31 KiB
JSON
{"ast":null,"code":"import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';\nimport { logger, getNumberOfUrlSegments, extractPathForTransaction, isRegExp } from '@sentry/utils';\n\n/**\n * Express integration\n *\n * Provides an request and error handler for Express framework as well as tracing capabilities\n */\nclass Express {\n /**\n * @inheritDoc\n */\n static __initStatic() {\n this.id = 'Express';\n }\n\n /**\n * @inheritDoc\n */\n __init() {\n this.name = Express.id;\n }\n\n /**\n * Express App instance\n */\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {\n ;\n Express.prototype.__init.call(this);\n this._router = options.router || options.app;\n this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');\n }\n\n /**\n * @inheritDoc\n */\n setupOnce() {\n if (!this._router) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('ExpressIntegration is missing an Express instance');\n return;\n }\n instrumentMiddlewares(this._router, this._methods);\n instrumentRouter(this._router);\n }\n}\nExpress.__initStatic();\n\n/**\n * Wraps original middleware function in a tracing call, which stores the info about the call as a span,\n * and finishes it once the middleware is done invoking.\n *\n * Express middlewares have 3 various forms, thus we have to take care of all of them:\n * // sync\n * app.use(function (req, res) { ... })\n * // async\n * app.use(function (req, res, next) { ... })\n * // error handler\n * app.use(function (err, req, res, next) { ... })\n *\n * They all internally delegate to the `router[method]` of the given application instance.\n */\nfunction wrap(fn, method) {\n var arity = fn.length;\n switch (arity) {\n case 2:\n {\n return function (req, res) {\n var transaction = res.__sentry_transaction;\n if (transaction) {\n var span = transaction.startChild({\n description: fn.name,\n op: `express.middleware.${method}`\n });\n res.once('finish', () => {\n span.finish();\n });\n }\n return fn.call(this, req, res);\n };\n }\n case 3:\n {\n return function (req, res, next) {\n var transaction = res.__sentry_transaction;\n var span = _optionalChain([transaction, 'optionalAccess', _ => _.startChild, 'call', _2 => _2({\n description: fn.name,\n op: `express.middleware.${method}`\n })]);\n fn.call(this, req, res, function (...args) {\n _optionalChain([span, 'optionalAccess', _3 => _3.finish, 'call', _4 => _4()]);\n next.call(this, ...args);\n });\n };\n }\n case 4:\n {\n return function (err, req, res, next) {\n var transaction = res.__sentry_transaction;\n var span = _optionalChain([transaction, 'optionalAccess', _5 => _5.startChild, 'call', _6 => _6({\n description: fn.name,\n op: `express.middleware.${method}`\n })]);\n fn.call(this, err, req, res, function (...args) {\n _optionalChain([span, 'optionalAccess', _7 => _7.finish, 'call', _8 => _8()]);\n next.call(this, ...args);\n });\n };\n }\n default:\n {\n throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`);\n }\n }\n}\n\n/**\n * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`\n * and wraps every function, as well as array of functions with a call to our `wrap` method.\n * We have to take care of the arrays as well as iterate over all of the arguments,\n * as `app.use` can accept middlewares in few various forms.\n *\n * app.use([<path>], <fn>)\n * app.use([<path>], <fn>, ...<fn>)\n * app.use([<path>], ...<fn>[])\n */\nfunction wrapMiddlewareArgs(args, method) {\n return args.map(arg => {\n if (typeof arg === 'function') {\n return wrap(arg, method);\n }\n if (Array.isArray(arg)) {\n return arg.map(a => {\n if (typeof a === 'function') {\n return wrap(a, method);\n }\n return a;\n });\n }\n return arg;\n });\n}\n\n/**\n * Patches original router to utilize our tracing functionality\n */\nfunction patchMiddleware(router, method) {\n var originalCallback = router[method];\n router[method] = function (...args) {\n return originalCallback.call(this, ...wrapMiddlewareArgs(args, method));\n };\n return router;\n}\n\n/**\n * Patches original router methods\n */\nfunction instrumentMiddlewares(router, methods = []) {\n methods.forEach(method => patchMiddleware(router, method));\n}\n\n/**\n * Patches the prototype of Express.Router to accumulate the resolved route\n * if a layer instance's `match` function was called and it returned a successful match.\n *\n * @see https://github.com/expressjs/express/blob/master/lib/router/index.js\n *\n * @param appOrRouter the router instance which can either be an app (i.e. top-level) or a (nested) router.\n */\nfunction instrumentRouter(appOrRouter) {\n // This is how we can distinguish between app and routers\n var isApp = ('settings' in appOrRouter);\n\n // In case the app's top-level router hasn't been initialized yet, we have to do it now\n if (isApp && appOrRouter._router === undefined && appOrRouter.lazyrouter) {\n appOrRouter.lazyrouter();\n }\n var router = isApp ? appOrRouter._router : appOrRouter;\n if (!router) {\n /*\n If we end up here, this means likely that this integration is used with Express 3 or Express 5.\n For now, we don't support these versions (3 is very old and 5 is still in beta). To support Express 5,\n we'd need to make more changes to the routing instrumentation because the router is no longer part of\n the Express core package but maintained in its own package. The new router has different function\n signatures and works slightly differently, demanding more changes than just taking the router from\n `app.router` instead of `app._router`.\n @see https://github.com/pillarjs/router\n TODO: Proper Express 5 support\n */\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.debug('Cannot instrument router for URL Parameterization (did not find a valid router).');\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.debug('Routing instrumentation is currently only supported in Express 4.');\n return;\n }\n var routerProto = Object.getPrototypeOf(router);\n var originalProcessParams = routerProto.process_params;\n routerProto.process_params = function process_params(layer, called, req, res, done) {\n // Base case: We're in the first part of the URL (thus we start with the root '/')\n if (!req._reconstructedRoute) {\n req._reconstructedRoute = '';\n }\n\n // If the layer's partial route has params, is a regex or an array, the route is stored in layer.route.\n const {\n layerRoutePath,\n isRegex,\n isArray,\n numExtraSegments\n } = getLayerRoutePathInfo(layer);\n\n // Otherwise, the hardcoded path (i.e. a partial route without params) is stored in layer.path\n var partialRoute = layerRoutePath || layer.path || '';\n\n // Normalize the partial route so that it doesn't contain leading or trailing slashes\n // and exclude empty or '*' wildcard routes.\n // The exclusion of '*' routes is our best effort to not \"pollute\" the transaction name\n // with interim handlers (e.g. ones that check authentication or do other middleware stuff).\n // We want to end up with the parameterized URL of the incoming request without any extraneous path segments.\n var finalPartialRoute = partialRoute.split('/').filter(segment => segment.length > 0 && (isRegex || isArray || !segment.includes('*'))).join('/');\n\n // If we found a valid partial URL, we append it to the reconstructed route\n if (finalPartialRoute && finalPartialRoute.length > 0) {\n // If the partial route is from a regex route, we append a '/' to close the regex\n req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? '/' : ''}`;\n }\n\n // Now we check if we are in the \"last\" part of the route. We determine this by comparing the\n // number of URL segments from the original URL to that of our reconstructed parameterized URL.\n // If we've reached our final destination, we update the transaction name.\n var urlLength = getNumberOfUrlSegments(req.originalUrl || '') + numExtraSegments;\n var routeLength = getNumberOfUrlSegments(req._reconstructedRoute);\n if (urlLength === routeLength) {\n var transaction = res.__sentry_transaction;\n if (transaction && transaction.metadata.source !== 'custom') {\n // If the request URL is '/' or empty, the reconstructed route will be empty.\n // Therefore, we fall back to setting the final route to '/' in this case.\n var finalRoute = req._reconstructedRoute || '/';\n transaction.setName(...extractPathForTransaction(req, {\n path: true,\n method: true,\n customRoute: finalRoute\n }));\n }\n }\n return originalProcessParams.call(this, layer, called, req, res, done);\n };\n}\n\n/**\n * Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`),\n * a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\\/path[2-5]/, /path/:id]`). Additionally\n * returns extra information about the route, such as if the route is defined as regex or as an array.\n *\n * @param layer the layer to extract the stringified route from\n *\n * @returns an object containing the stringified route, a flag determining if the route was a regex\n * and the number of extra segments to the matched path that are additionally in the route,\n * if the route was an array (defaults to 0).\n */\nfunction getLayerRoutePathInfo(layer) {\n var lrp = _optionalChain([layer, 'access', _9 => _9.route, 'optionalAccess', _10 => _10.path]);\n var isRegex = isRegExp(lrp);\n var isArray = Array.isArray(lrp);\n if (!lrp) {\n return {\n isRegex,\n isArray,\n numExtraSegments: 0\n };\n }\n var numExtraSegments = isArray ? Math.max(getNumberOfArrayUrlSegments(lrp) - getNumberOfUrlSegments(layer.path || ''), 0) : 0;\n var layerRoutePath = getLayerRoutePathString(isArray, lrp);\n return {\n layerRoutePath,\n isRegex,\n isArray,\n numExtraSegments\n };\n}\n\n/**\n * Returns the number of URL segments in an array of routes\n *\n * Example: ['/api/test', /\\/api\\/post[0-9]/, '/users/:id/details`] -> 7\n */\nfunction getNumberOfArrayUrlSegments(routesArray) {\n return routesArray.reduce((accNumSegments, currentRoute) => {\n // array members can be a RegEx -> convert them toString\n return accNumSegments + getNumberOfUrlSegments(currentRoute.toString());\n }, 0);\n}\n\n/**\n * Extracts and returns the stringified version of the layers route path\n * Handles route arrays (by joining the paths together) as well as RegExp and normal\n * string values (in the latter case the toString conversion is technically unnecessary but\n * it doesn't hurt us either).\n */\nfunction getLayerRoutePathString(isArray, lrp) {\n if (isArray) {\n return lrp.map(r => r.toString()).join(',');\n }\n return lrp && lrp.toString();\n}\nexport { Express };","map":{"version":3,"names":["_optionalChain","logger","getNumberOfUrlSegments","extractPathForTransaction","isRegExp","Express","__initStatic","id","__init","name","constructor","options","prototype","call","_router","router","app","_methods","Array","isArray","methods","concat","setupOnce","__SENTRY_DEBUG__","error","instrumentMiddlewares","instrumentRouter","wrap","fn","method","arity","length","req","res","transaction","__sentry_transaction","span","startChild","description","op","once","finish","next","_","_2","args","_3","_4","err","_5","_6","_7","_8","Error","wrapMiddlewareArgs","map","arg","a","patchMiddleware","originalCallback","forEach","appOrRouter","isApp","undefined","lazyrouter","debug","routerProto","Object","getPrototypeOf","originalProcessParams","process_params","layer","called","done","_reconstructedRoute","layerRoutePath","isRegex","numExtraSegments","getLayerRoutePathInfo","partialRoute","path","finalPartialRoute","split","filter","segment","includes","join","urlLength","originalUrl","routeLength","metadata","source","finalRoute","setName","customRoute","lrp","_9","route","_10","Math","max","getNumberOfArrayUrlSegments","getLayerRoutePathString","routesArray","reduce","accNumSegments","currentRoute","toString","r"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@sentry/tracing/esm/integrations/node/express.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';\nimport { logger, getNumberOfUrlSegments, extractPathForTransaction, isRegExp } from '@sentry/utils';\n\n/**\n * Express integration\n *\n * Provides an request and error handler for Express framework as well as tracing capabilities\n */\nclass Express {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Express';}\n\n /**\n * @inheritDoc\n */\n __init() {this.name = Express.id;}\n\n /**\n * Express App instance\n */\n \n \n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {;Express.prototype.__init.call(this);\n this._router = options.router || options.app;\n this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');\n }\n\n /**\n * @inheritDoc\n */\n setupOnce() {\n if (!this._router) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('ExpressIntegration is missing an Express instance');\n return;\n }\n instrumentMiddlewares(this._router, this._methods);\n instrumentRouter(this._router );\n }\n}Express.__initStatic();\n\n/**\n * Wraps original middleware function in a tracing call, which stores the info about the call as a span,\n * and finishes it once the middleware is done invoking.\n *\n * Express middlewares have 3 various forms, thus we have to take care of all of them:\n * // sync\n * app.use(function (req, res) { ... })\n * // async\n * app.use(function (req, res, next) { ... })\n * // error handler\n * app.use(function (err, req, res, next) { ... })\n *\n * They all internally delegate to the `router[method]` of the given application instance.\n */\nfunction wrap(fn, method) {\n var arity = fn.length;\n\n switch (arity) {\n case 2: {\n return function ( req, res) {\n var transaction = res.__sentry_transaction;\n if (transaction) {\n var span = transaction.startChild({\n description: fn.name,\n op: `express.middleware.${method}`,\n });\n res.once('finish', () => {\n span.finish();\n });\n }\n return fn.call(this, req, res);\n };\n }\n case 3: {\n return function (\n \n req,\n res,\n next,\n ) {\n var transaction = res.__sentry_transaction;\n var span = _optionalChain([transaction, 'optionalAccess', _ => _.startChild, 'call', _2 => _2({\n description: fn.name,\n op: `express.middleware.${method}`,\n })]);\n fn.call(this, req, res, function ( ...args) {\n _optionalChain([span, 'optionalAccess', _3 => _3.finish, 'call', _4 => _4()]);\n next.call(this, ...args);\n });\n };\n }\n case 4: {\n return function (\n \n err,\n req,\n res,\n next,\n ) {\n var transaction = res.__sentry_transaction;\n var span = _optionalChain([transaction, 'optionalAccess', _5 => _5.startChild, 'call', _6 => _6({\n description: fn.name,\n op: `express.middleware.${method}`,\n })]);\n fn.call(this, err, req, res, function ( ...args) {\n _optionalChain([span, 'optionalAccess', _7 => _7.finish, 'call', _8 => _8()]);\n next.call(this, ...args);\n });\n };\n }\n default: {\n throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`);\n }\n }\n}\n\n/**\n * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`\n * and wraps every function, as well as array of functions with a call to our `wrap` method.\n * We have to take care of the arrays as well as iterate over all of the arguments,\n * as `app.use` can accept middlewares in few various forms.\n *\n * app.use([<path>], <fn>)\n * app.use([<path>], <fn>, ...<fn>)\n * app.use([<path>], ...<fn>[])\n */\nfunction wrapMiddlewareArgs(args, method) {\n return args.map((arg) => {\n if (typeof arg === 'function') {\n return wrap(arg, method);\n }\n\n if (Array.isArray(arg)) {\n return arg.map((a) => {\n if (typeof a === 'function') {\n return wrap(a, method);\n }\n return a;\n });\n }\n\n return arg;\n });\n}\n\n/**\n * Patches original router to utilize our tracing functionality\n */\nfunction patchMiddleware(router, method) {\n var originalCallback = router[method];\n\n router[method] = function (...args) {\n return originalCallback.call(this, ...wrapMiddlewareArgs(args, method));\n };\n\n return router;\n}\n\n/**\n * Patches original router methods\n */\nfunction instrumentMiddlewares(router, methods = []) {\n methods.forEach((method) => patchMiddleware(router, method));\n}\n\n/**\n * Patches the prototype of Express.Router to accumulate the resolved route\n * if a layer instance's `match` function was called and it returned a successful match.\n *\n * @see https://github.com/expressjs/express/blob/master/lib/router/index.js\n *\n * @param appOrRouter the router instance which can either be an app (i.e. top-level) or a (nested) router.\n */\nfunction instrumentRouter(appOrRouter) {\n // This is how we can distinguish between app and routers\n var isApp = 'settings' in appOrRouter;\n\n // In case the app's top-level router hasn't been initialized yet, we have to do it now\n if (isApp && appOrRouter._router === undefined && appOrRouter.lazyrouter) {\n appOrRouter.lazyrouter();\n }\n\n var router = isApp ? appOrRouter._router : appOrRouter;\n\n if (!router) {\n /*\n If we end up here, this means likely that this integration is used with Express 3 or Express 5.\n For now, we don't support these versions (3 is very old and 5 is still in beta). To support Express 5,\n we'd need to make more changes to the routing instrumentation because the router is no longer part of\n the Express core package but maintained in its own package. The new router has different function\n signatures and works slightly differently, demanding more changes than just taking the router from\n `app.router` instead of `app._router`.\n @see https://github.com/pillarjs/router\n\n TODO: Proper Express 5 support\n */\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.debug('Cannot instrument router for URL Parameterization (did not find a valid router).');\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.debug('Routing instrumentation is currently only supported in Express 4.');\n return;\n }\n\n var routerProto = Object.getPrototypeOf(router) ;\n\n var originalProcessParams = routerProto.process_params;\n routerProto.process_params = function process_params(\n layer,\n called,\n req,\n res,\n done,\n ) {\n // Base case: We're in the first part of the URL (thus we start with the root '/')\n if (!req._reconstructedRoute) {\n req._reconstructedRoute = '';\n }\n\n // If the layer's partial route has params, is a regex or an array, the route is stored in layer.route.\n const { layerRoutePath, isRegex, isArray, numExtraSegments } = getLayerRoutePathInfo(layer);\n\n // Otherwise, the hardcoded path (i.e. a partial route without params) is stored in layer.path\n var partialRoute = layerRoutePath || layer.path || '';\n\n // Normalize the partial route so that it doesn't contain leading or trailing slashes\n // and exclude empty or '*' wildcard routes.\n // The exclusion of '*' routes is our best effort to not \"pollute\" the transaction name\n // with interim handlers (e.g. ones that check authentication or do other middleware stuff).\n // We want to end up with the parameterized URL of the incoming request without any extraneous path segments.\n var finalPartialRoute = partialRoute\n .split('/')\n .filter(segment => segment.length > 0 && (isRegex || isArray || !segment.includes('*')))\n .join('/');\n\n // If we found a valid partial URL, we append it to the reconstructed route\n if (finalPartialRoute && finalPartialRoute.length > 0) {\n // If the partial route is from a regex route, we append a '/' to close the regex\n req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? '/' : ''}`;\n }\n\n // Now we check if we are in the \"last\" part of the route. We determine this by comparing the\n // number of URL segments from the original URL to that of our reconstructed parameterized URL.\n // If we've reached our final destination, we update the transaction name.\n var urlLength = getNumberOfUrlSegments(req.originalUrl || '') + numExtraSegments;\n var routeLength = getNumberOfUrlSegments(req._reconstructedRoute);\n\n if (urlLength === routeLength) {\n var transaction = res.__sentry_transaction;\n if (transaction && transaction.metadata.source !== 'custom') {\n // If the request URL is '/' or empty, the reconstructed route will be empty.\n // Therefore, we fall back to setting the final route to '/' in this case.\n var finalRoute = req._reconstructedRoute || '/';\n\n transaction.setName(...extractPathForTransaction(req, { path: true, method: true, customRoute: finalRoute }));\n }\n }\n\n return originalProcessParams.call(this, layer, called, req, res, done);\n };\n}\n\n/**\n * Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`),\n * a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\\/path[2-5]/, /path/:id]`). Additionally\n * returns extra information about the route, such as if the route is defined as regex or as an array.\n *\n * @param layer the layer to extract the stringified route from\n *\n * @returns an object containing the stringified route, a flag determining if the route was a regex\n * and the number of extra segments to the matched path that are additionally in the route,\n * if the route was an array (defaults to 0).\n */\nfunction getLayerRoutePathInfo(layer) {\n var lrp = _optionalChain([layer, 'access', _9 => _9.route, 'optionalAccess', _10 => _10.path]);\n\n var isRegex = isRegExp(lrp);\n var isArray = Array.isArray(lrp);\n\n if (!lrp) {\n return { isRegex, isArray, numExtraSegments: 0 };\n }\n\n var numExtraSegments = isArray\n ? Math.max(getNumberOfArrayUrlSegments(lrp ) - getNumberOfUrlSegments(layer.path || ''), 0)\n : 0;\n\n var layerRoutePath = getLayerRoutePathString(isArray, lrp);\n\n return { layerRoutePath, isRegex, isArray, numExtraSegments };\n}\n\n/**\n * Returns the number of URL segments in an array of routes\n *\n * Example: ['/api/test', /\\/api\\/post[0-9]/, '/users/:id/details`] -> 7\n */\nfunction getNumberOfArrayUrlSegments(routesArray) {\n return routesArray.reduce((accNumSegments, currentRoute) => {\n // array members can be a RegEx -> convert them toString\n return accNumSegments + getNumberOfUrlSegments(currentRoute.toString());\n }, 0);\n}\n\n/**\n * Extracts and returns the stringified version of the layers route path\n * Handles route arrays (by joining the paths together) as well as RegExp and normal\n * string values (in the latter case the toString conversion is technically unnecessary but\n * it doesn't hurt us either).\n */\nfunction getLayerRoutePathString(isArray, lrp) {\n if (isArray) {\n return (lrp ).map(r => r.toString()).join(',');\n }\n return lrp && lrp.toString();\n}\n\nexport { Express };\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,kCAAkC;AACjE,SAASC,MAAM,EAAEC,sBAAsB,EAAEC,yBAAyB,EAAEC,QAAQ,QAAQ,eAAe;;AAEnG;AACA;AACA;AACA;AACA;AACA,MAAMC,OAAO,CAAE;EACb;AACF;AACA;EACG,OAAOC,YAAYA,CAAA,EAAG;IAAC,IAAI,CAACC,EAAE,GAAG,SAAS;EAAC;;EAE5C;AACF;AACA;EACGC,MAAMA,CAAA,EAAG;IAAC,IAAI,CAACC,IAAI,GAAGJ,OAAO,CAACE,EAAE;EAAC;;EAElC;AACF;AACA;;EAIE;AACF;AACA;EACGG,WAAWA,CAACC,OAAO,GAAG,CAAC,CAAC,EAAE;IAAC;IAACN,OAAO,CAACO,SAAS,CAACJ,MAAM,CAACK,IAAI,CAAC,IAAI,CAAC;IAC9D,IAAI,CAACC,OAAO,GAAGH,OAAO,CAACI,MAAM,IAAIJ,OAAO,CAACK,GAAG;IAC5C,IAAI,CAACC,QAAQ,GAAG,CAACC,KAAK,CAACC,OAAO,CAACR,OAAO,CAACS,OAAO,CAAC,GAAGT,OAAO,CAACS,OAAO,GAAG,EAAE,EAAEC,MAAM,CAAC,KAAK,CAAC;EACvF;;EAEA;AACF;AACA;EACGC,SAASA,CAAA,EAAG;IACX,IAAI,CAAC,IAAI,CAACR,OAAO,EAAE;MACjB,CAAC,OAAOS,gBAAgB,KAAK,WAAW,IAAIA,gBAAgB,KAAKtB,MAAM,CAACuB,KAAK,CAAC,mDAAmD,CAAC;MAClI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