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,IAC1B,IAAKC,EAAQC,GAAUF,EACvB,OAAOG,EAAAA,EAAAA,GAAgB,OAASF,EAAQC,EAAQ,MAAO1C,EAAW,IAgCpE,IAAI0B,EAAe,CAKrB,C","sources":["../node_modules/@newrelic/browser-agent/dist/esm/loaders/api/apiAsync.js"],"sourcesContent":["import { FEATURE_NAMES } from '../features/features';\nimport { getRuntime } from '../../common/config/config';\nimport { ee } from '../../common/event-emitter/contextual-ee';\nimport { handle } from '../../common/event-emitter/handle';\nimport { registerHandler } from '../../common/event-emitter/register-handler';\nimport { single } from '../../common/util/invoke';\nimport { CUSTOM_METRIC_CHANNEL } from '../../features/metrics/constants';\nexport function setAPI(agentIdentifier) {\n var instanceEE = ee.get(agentIdentifier);\n var api = {\n finished: single(finished),\n setErrorHandler,\n addToTrace,\n addRelease\n };\n\n // Hook all of the api functions up to the queues/stubs created in loader/api.js\n Object.entries(api).forEach(_ref => {\n let [fnName, fnCall] = _ref;\n return registerHandler('api-' + fnName, fnCall, 'api', instanceEE);\n });\n\n // All API functions get passed the time they were called as their\n // first parameter. These functions can be called asynchronously.\n\n function finished(t, providedTime) {\n var time = providedTime ? providedTime - getRuntime(agentIdentifier).offset : t;\n handle(CUSTOM_METRIC_CHANNEL, ['finished', {\n time\n }], undefined, FEATURE_NAMES.metrics, instanceEE);\n addToTrace(t, {\n name: 'finished',\n start: time + getRuntime(agentIdentifier).offset,\n origin: 'nr'\n });\n handle('api-addPageAction', [time, 'finished'], undefined, FEATURE_NAMES.pageAction, instanceEE);\n }\n function addToTrace(t, evt) {\n if (!(evt && typeof evt === 'object' && evt.name && evt.start)) return;\n var report = {\n n: evt.name,\n s: evt.start - getRuntime(agentIdentifier).offset,\n e: (evt.end || evt.start) - getRuntime(agentIdentifier).offset,\n o: evt.origin || '',\n t: 'api'\n };\n handle('bstApi', [report], undefined, FEATURE_NAMES.sessionTrace, instanceEE);\n }\n function setErrorHandler(t, handler) {\n getRuntime(agentIdentifier).onerror = handler;\n }\n var releaseCount = 0;\n function addRelease(t, name, id) {\n if (++releaseCount > 10) return;\n getRuntime(agentIdentifier).releaseIds[name.slice(-200)] = ('' + id).slice(-200);\n }\n}"],"names":["setAPI","agentIdentifier","instanceEE","ee","get","api","finished","single","t","providedTime","time","getRuntime","offset","handle","CUSTOM_METRIC_CHANNEL","undefined","FEATURE_NAMES","metrics","addToTrace","name","start","origin","pageAction","setErrorHandler","handler","onerror","addRelease","id","releaseCount","releaseIds","slice","evt","report","n","s","e","end","o","sessionTrace","Object","entries","forEach","_ref","fnName","fnCall","registerHandler"],"sourceRoot":""}