Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I was editing a PHP file when I found this javascript code linked to an external js file at the end of my file:
!function(n,e,t){function r(t,i){if(!e[t]){if(!n[t]){var a="function"==typeof __nr_require&&__nr_require;if(!i&&a)return a(t,!0);if(o)return o(t,!0);throw new Error("Cannot find module '"+t+"'")}var s=e[t]={exports:{}};n[t][0].call(s.exports,function(e){var o=n[t][1][e];return r(o||e)},s,s.exports)}return e[t].exports}for(var o="function"==typeof __nr_require&&__nr_require,i=0;i<t.length;i++)r(t[i]);return r}({1:[function(n,e,t){e.exports=function(n,e){return"addEventListener"in window?addEventListener(n,e,!1):"attachEvent"in window?attachEvent("on"+n,e):void 0}},{}],2:[function(n,e,t){function r(n,e,t,r){p("bstAgg",[n,e,t,r]),l[n]||(l[n]={});var i=l[n][e];return i||(i=l[n][e]={params:t||{}}),i.metrics=o(r,i.metrics),i}function o(n,e){return e||(e={count:0}),e.count+=1,c(n,function(n,t){e[n]=i(t,e[n])}),e}function i(n,e){return e?(e&&!e.c&&(e={t:e.t,min:e.t,max:e.t,sos:e.t*e.t,c:1}),e.c+=1,e.t+=n,e.sos+=n*n,n>e.max&&(e.max=n),n<e.min&&(e.min=n),e):{t:n}}function a(n,e){return e?l[n]&&l[n][e]:l[n]}function s(n){for(var e={},t="",r=!1,o=0;o<n.length;o++)t=n[o],e[t]=u(l[t]),e[t].length&&(r=!0),delete l[t];return r?e:null}function u(n){return"object"!=typeof n?[]:c(n,f)}function f(n,e){return e}var c=n(30),p=n("handle"),l={};e.exports={store:r,take:s,get:a}},{}],3:[function(n,e,t){function r(n,e,t){"string"==typeof e&&("/"!==e.charAt(0)&&(e="/"+e),d.customTransaction=(t||"http://custom.transaction")+e)}function o(n,e){var t=e||n;f.store("cm","finished",{name:"finished"},{time:t-d.offset}),i(n,{name:"finished",start:t,origin:"nr"}),m("api-addPageAction",[t,"finished"])}function i(n,e){if(e&&"object"==typeof e&&e.name&&e.start){var t={n:e.name,s:e.start-d.offset,e:(e.end||e.start)-d.offset,o:e.origin||"",t:"api"};m("bstApi",[t])}}function a(n,e,t,r,o,i,a){if(e=window.encodeURIComponent(e),v+=1,d.info.beacon){var s=d.proto+d.info.beacon+"/1/"+d.info.licenseKey;s+="?a="+d.info.applicationID+"&",s+="t="+e+"&",s+="qt="+~~t+"&",s+="ap="+~~r+"&",s+="be="+~~o+"&",s+="dc="+~~i+"&",s+="fe="+~~a+"&",s+="c="+v,p.img(s)}}var s=n(14),u=n(9),f=n(2),c=n(16),p=n(8),l=n(30),d=n("loader"),m=n("handle"),v=0;u.on("jserrors",function(){return{body:f.take(["cm"])}});var h={finished:c(o),setPageViewName:r,addToTrace:i,inlineHit:a};l(h,function(n,e){s("api-"+n,e,"api")})},{}],4:[function(n,e,t){var r=/#|\?/,o=/#.*|$/;e.exports=function(n,e){var t=n.split(r)[0];return e?t+o.exec(n)[0]:t}},{}],5:[function(n,e,t){function r(n,e){var t=n[1];i(e[t],function(e,t){var r=n[0],o=t[0];if(o===r){var i=t[1],a=n[3],s=n[2];i.apply(a,s)}})}var o=n("ee"),i=n(30),a=n(14).handlers;e.exports=function(n){var e=o.backlog[n],t=a[n];if(t){for(var s=0;e&&s<e.length;++s)r(e[s],t);i(t,function(n,e){i(e,function(e,t){t[0].on(n,t[1])})})}delete a[n],o.backlog[n]=null}},{}],6:[function(n,e,t){function r(n){return c[n]}function o(n){return null===n||void 0===n?"null":encodeURIComponent(n).replace(l,r)}function i(n,e){for(var t=0,r=0;r<n.length;r++)if(t+=n[r].length,t>e)return n.slice(0,r).join("");return n.join("")}function a(n,e){var t=0,r="";return u(n,function(n,i){var a,s,u=[];if("string"==typeof i)a="&"+n+"="+o(i),t+=a.length,r+=a;else if(i.length){for(t+=9,s=0;s<i.length&&(a=o(f(i[s])),t+=a.length,!("undefined"!=typeof e&&t>=e));s++)u.push(a);r+="&"+n+"=%5B"+u.join(",")+"%5D"}}),r}function s(n,e){return e&&"string"==typeof e?"&"+n+"="+o(e):""}var u=n(30),f=n(19),c={"%2C":",","%3A":":","%2F":"/","%40":"#","%24":"$","%3B":";"},p=u(c,function(n){return n}),l=new RegExp(p.join("|"),"g");e.exports={obj:a,fromArray:i,qs:o,param:s}},{}],7:[function(n,e,t){var r=n(30),o=n("ee"),i=n(5);e.exports=function(n){n&&"object"==typeof n&&(r(n,function(n,e){e&&!a[n]&&(o.emit("feat-"+n,[]),a[n]=!0)}),i("feature"))};var a=e.exports.active={}},{}],8:[function(n,e,t){var r=e.exports={};r.jsonp=function(n,e){var t=document.createElement("script");t.type="text/javascript",t.src=n+"&jsonp="+e;var r=document.getElementsByTagName("script")[0];return r.parentNode.insertBefore(t,r),t},r.xhr=function(n,e){var t=new XMLHttpRequest;return t.open("POST",n,!0),"withCredentials"in t&&(t.withCredentials=!0),t.setRequestHeader("content-type","text/plain"),t.send(e),t},r.img=function(n){var e=new Image;return e.src=n,e},r.beacon=function(n,e){return navigator.sendBeacon(n,e)}},{}],9:[function(n,e,t){function r(n){if(n.info.beacon){n.info.queueTime&&b.store("measures","qt",{value:n.info.queueTime}),n.info.applicationTime&&b.store("measures","ap",{value:n.info.applicationTime}),k.measure("be","starttime","firstbyte"),k.measure("fe","firstbyte","onload"),k.measure("dc","firstbyte","domContent");var e=b.get("measures"),t=v(e,function(n,e){return"&"+n+"="+e.params.value}).join("");if(t){var r="1",o=[l(n)];if(o.push(t),o.push(g.param("tt",n.info.ttGuid)),o.push(g.param("us",n.info.user)),o.push(g.param("ac",n.info.account)),o.push(g.param("pr",n.info.product)),o.push(g.param("af",v(n.features,function(n){return n}).join(","))),window.performance&&"undefined"!=typeof window.performance.timing){var i={timing:h.addPT(window.performance.timing,{}),navigation:h.addPN(window.performance.navigation,{})};o.push(g.param("perf",y(i)))}o.push(g.param("xx",n.info.extra)),o.push(g.param("ua",n.info.userAttributes)),o.push(g.param("at",n.info.atts));var a=y(n.info.jsAttributes);o.push(g.param("ja","{}"===a?null:a));var s=g.fromArray(o,n.maxBytes);w.jsonp(n.proto+n.info.beacon+"/"+r+"/"+n.info.licenseKey+s,T)}}}function o(n){var e=v(A,function(e){return a(e,n,{unload:!0})});return x(e,i)}function i(n,e){return n||e}function a(n,e,t){return u(e,n,s(n),t||{})}function s(n){for(var e=d({}),t=d({}),r=A[n]||[],o=0;o<r.length;o++){var i=r[o]();i.body&&v(i.body,e),i.qs&&v(i.qs,t)}return{body:e(),qs:t()}}function u(n,e,t,r){if(!n.info.errorBeacon||!t.body)return!1;var o="https://"+n.info.errorBeacon+"/"+e+"/1/"+n.info.licenseKey+l(n);t.qs&&(o+=g.obj(t.qs,n.maxBytes));var i,a,s;switch(e){case"jserrors":a=!1,i=q?w.beacon:w.img;break;default:if(r.needResponse)a=!0,i=w.xhr;else if(r.unload)a=q,i=q?w.beacon:w.img;else if(q)a=!0,i=w.beacon;else if(L)a=!0,i=w.xhr;else{if("events"!==e)return!1;i=w.img}}return a&&"events"===e?s=t.body.e:a?s=y(t.body):o+=g.obj(t.body,n.maxBytes),i(o,s)}function f(n){if(n&&n.info&&n.info.errorBeacon&&n.ieVersion){var e="https://"+n.info.errorBeacon+"/jserrors/ping/"+n.info.licenseKey+l(n);w.img(e)}}function c(n){return n.info.transactionName?g.param("to",n.info.transactionName):g.param("t",n.info.tNamePlain||"Unnamed Transaction")}function p(n,e){var t=A[n]||(A[n]=[]);t.push(e)}function l(n){return["?a="+n.info.applicationID,g.param("sa",n.info.sa?""+n.info.sa:""),g.param("v",S),c(n),g.param("ct",n.customTransaction),"&rst="+((new Date).getTime()-n.offset),g.param("ref",E(n.origin))].join("")}function d(n){var e=!1;return function(t,r){return r&&r.length&&(n[t]=r,e=!0),e?n:void 0}}var m=n(16),v=n(30),h=n(13),g=n(6),y=n(19),w=n(8),x=n(32),b=n(2),k=n(18),j=n("loader"),E=n(4),S="943.9bd99bf",T="NREUM.setToken",A={},q=!!navigator.sendBeacon;n(10);var L=j.xhrWrappable&&(j.ieVersion>9||0===j.ieVersion);e.exports={sendBeacon:m(r),sendFinal:o,pingErrors:f,sendX:a,on:p,xhrUsable:L}},{}],10:[function(n,e,t){var r=n("loader"),o=document.createElement("div");o.innerHTML="<!--[if lte IE 6]><div></div><![endif]--><!--[if lte IE 7]><div></div><![endif]--><!--[if lte IE 8]><div></div><![endif]--><!--[if lte IE 9]><div></div><![endif]-->";var i=o.getElementsByTagName("div").length;4===i?r.ieVersion=6:3===i?r.ieVersion=7:2===i?r.ieVersion=8:1===i?r.ieVersion=9:r.ieVersion=0,e.exports=r.ieVersion},{}],11:[function(n,e,t){function r(n){f.sendFinal(l,!1),a.navCookie&&(document.cookie="NREUM=s="+Number(new Date)+"&r="+o(document.location.href)+"&p="+o(document.referrer)+"; path=/")}var o=n(15),i=n(1),a=n(17),s=n(18),u=n(16),f=n(9),c=n(14),p=n(7),l=n("loader"),d=n(29),m=n(5);n(3);var v="undefined"!=typeof window.NREUM.autorun?window.NREUM.autorun:!0;window.NREUM.setToken=p,6===n(10)?l.maxBytes=2e3:l.maxBytes=3e4;var h=u(r);!d||navigator.sendBeacon?i("pagehide",h):i("beforeunload",h),i("unload",h),c("mark",s.mark,"api"),s.mark("done"),m("api"),v&&f.sendBeacon(l)},{}],12:[function(n,e,t){e.exports=function(n,e){setTimeout(function t(){try{n()}finally{setTimeout(t,e)}},e)}},{}],13:[function(n,e,t){function r(n,e){var t=n.navigationStart;return e.of=t,i(n.navigationStart,t,e,"n"),i(n.unloadEventStart,t,e,"u"),i(n.unloadEventEnd,t,e,"ue"),i(n.domLoading,t,e,"dl"),i(n.domInteractive,t,e,"di"),i(n.domContentLoadedEventStart,t,e,"ds"),i(n.domContentLoadedEventEnd,t,e,"de"),i(n.domComplete,t,e,"dc"),i(n.loadEventStart,t,e,"l"),i(n.loadEventEnd,t,e,"le"),i(n.redirectStart,t,e,"r"),i(n.redirectEnd,t,e,"re"),i(n.fetchStart,t,e,"f"),i(n.domainLookupStart,t,e,"dn"),i(n.domainLookupEnd,t,e,"dne"),i(n.connectStart,t,e,"c"),i(n.connectEnd,t,e,"ce"),i(n.secureConnectionStart,t,e,"s"),i(n.requestStart,t,e,"rq"),i(n.responseStart,t,e,"rp"),i(n.responseEnd,t,e,"rpe"),e}function o(n,e){return i(n.type,0,e,"ty"),i(n.redirectCount,0,e,"rc"),e}function i(n,e,t,r){"number"==typeof n&&n>0&&(t[r]=Math.round(n-e))}e.exports={addPT:r,addPN:o}},{}],14:[function(n,e,t){function r(n,e,t,r){o(r||i,n,e,t)}function o(n,e,t,r){r||(r="feature"),n||(n=i);var o=a[r]=a[r]||{},s=o[e]=o[e]||[];s.push([n,t])}var i=n("handle").ee;e.exports=r,r.on=o;var a=r.handlers={}},{}],15:[function(n,e,t){function r(n){var e,t=0;for(e=0;e<n.length;e++)t+=(e+1)*n.charCodeAt(e);return Math.abs(t)}e.exports=r},{}],16:[function(n,e,t){function r(n){var e,t=!1;return function(){return t?e:(t=!0,e=n.apply(this,o(arguments)))}}var o=n(31);e.exports=r},{}],17:[function(n,e,t){function r(){var n=o()||i();n&&(s.mark("starttime",n),u.offset=n)}function o(){return f&&9>f?void 0:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart?(e.exports.navCookie=!1,window.performance.timing.navigationStart):void 0}function i(){for(var n=document.cookie.split(" "),e=0;e<n.length;e++)if(0===n[e].indexOf("NREUM=")){for(var t,r,o,i,s=n[e].substring("NREUM=".length).split("&"),u=0;u<s.length;u++)0===s[u].indexOf("s=")?o=s[u].substring(2):0===s[u].indexOf("p=")?(r=s[u].substring(2),";"===r.charAt(r.length-1)&&(r=r.substr(0,r.length-1))):0===s[u].indexOf("r=")&&(t=s[u].substring(2),";"===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)));if(t){var f=a(document.referrer);i=f==t,i||(i=a(document.location.href)==t&&f==r)}if(i&&o){var c=(new Date).getTime();if(c-o>6e4)return;return o}}}var a=n(15),s=n(18),u=n("loader"),f=n(29);e.exports={navCookie:!0},r()},{}],18:[function(n,e,t){function r(n,e){"undefined"==typeof e&&(e=(new Date).getTime()),a[n]=e}function o(n,e,t){var r=a[e],o=a[t];"undefined"!=typeof r&&"undefined"!=typeof o&&i.store("measures",n,{value:o-r})}var i=n(2),a={};e.exports={mark:r,measure:o}},{}],19:[function(n,e,t){function r(n){try{return i("",{"":n})}catch(e){try{s.emit("internal-error",[e])}catch(t){}}}function o(n){return u.lastIndex=0,u.test(n)?'"'+n.replace(u,function(n){var e=f[n];return"string"==typeof e?e:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function i(n,e){var t=e[n];switch(typeof t){case"string":return o(t);case"number":return isFinite(t)?String(t):"null";case"boolean":return String(t);case"object":if(!t)return"null";var r=[];if("[object Array]"===Object.prototype.toString.apply(t)){for(var s=t.length,u=0;s>u;u+=1)r[u]=i(u,t)||"null";return 0===r.length?"[]":"["+r.join(",")+"]"}return a(t,function(n){var e=i(n,t);e&&r.push(o(n)+":"+e)}),0===r.length?"{}":"{"+r.join(",")+"}"}}var a=n(30),s=n("ee"),u=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};e.exports=r},{}],20:[function(n,e,t){function r(n){if(n){var e=n.match(o);return e?e[1]:void 0}}var o=/([a-z0-9]+)$/i;e.exports=r},{}],21:[function(n,e,t){function r(n){var e=null;try{if(e=p(n))return e}catch(t){if(h)throw t}try{if(e=o(n))return e}catch(t){if(h)throw t}try{if(e=l(n))return e}catch(t){if(h)throw t}try{if(e=s(n))return e}catch(t){if(h)throw t}try{if(e=u(n))return e}catch(t){if(h)throw t}return{mode:"failed",stackString:"",frames:[]}}function o(n){if(!n.stack)return null;var e=d(n.stack.split("\n"),i,{frames:[],stackLines:[],wrapperSeen:!1});return e.frames.length?{mode:"stack",name:n.name||f(n),message:n.message,stackString:m(e.stackLines),frames:e.frames}:null}function i(n,e){var t=a(e);return t?(c(t.func)?n.wrapperSeen=!0:n.stackLines.push(e),n.wrapperSeen||n.frames.push(t),n):(n.stackLines.push(e),n)}function a(n){var e=n.match(w);return e||(e=n.match(y)),e?{url:e[2],func:"Anonymous function"!==e[1]&&e[1]||null,line:+e[3],column:e[4]?+e[4]:null}:n.match(x)||n.match(b)||"anonymous"===n?{func:"evaluated code"}:void 0}function s(n){if(!("line"in n))return null;var e=n.name||f(n);if(!n.sourceURL)return{mode:"sourceline",name:e,message:n.message,stackString:f(n)+": "+n.message+"\n in evaluated code",frames:[{func:"evaluated code"}]};var t=e+": "+n.message+"\n at "+n.sourceURL;return n.line&&(t+=":"+n.line,n.column&&(t+=":"+n.column)),{mode:"sourceline",name:e,message:n.message,stackString:t,frames:[{url:n.sourceURL,line:n.line,column:n.column}]}}function u(n){var e=n.name||f(n);return e?{mode:"nameonly",name:e,message:n.message,stackString:e+": "+n.message,frames:[]}:null}function f(n){var e=g.exec(String(n.constructor));return e&&e.length>1?e[1]:"unknown"}function c(n){return n&&n.indexOf("nrWrapper")>=0}function p(n){for(var e,t=n.stacktrace,r=/ line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\(.*\) in (.*):\s*$/i,o=t.split("\n"),i=[],a=[],s=!1,u=0,p=o.length;p>u;u+=2)if(e=r.exec(o[u])){var l={line:+e[1],column:+e[2],func:e[3]||e[4],url:e[5]};c(l.func)?s=!0:a.push(o[u]),s||i.push(l)}else a.push(o[u]);return i.length?{mode:"stacktrace",name:n.name||f(n),message:n.message,stackString:m(a),frames:i}:null}function l(n){var e=n.message.split("\n");if(e.length<4)return null;var t,r,o,i=/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,s=/^\s*Line (\d+) of function script\s*$/i,u=[],p=[],l=document.getElementsByTagName("script"),d=[],h=!1;for(r in l)v.call(l,r)&&!l[r].src&&d.push(l[r]);for(r=2,o=e.length;o>r;r+=2){var g=null;if(t=i.exec(e[r]))g={url:t[2],func:t[3],line:+t[1]};else if(t=a.exec(e[r]))g={url:t[3],func:t[4]};else if(t=s.exec(e[r])){var y=window.location.href.replace(/#.*$/,""),w=t[1];g={url:y,line:w,func:""}}g&&(c(g.func)?h=!0:p.push(e[r]),h||u.push(g))}return u.length?{mode:"multiline",name:n.name||f(n),message:e[0],stackString:m(p),frames:u}:null}var d=n(32),m=n(22),v=Object.prototype.hasOwnProperty,h=!1,g=/function (.+?)\s*\(/,y=/^\s*at (?:((?:\[object object\])?(?:[^(]*\([^)]*\))*[^()]*(?: \[as \S+\])?) )?\(?((?:file|http|https|chrome-extension):.*?)?:(\d+)(?::(\d+))?\)?\s*$/i,w=/^\s*(?:(\S*)(?:\(.*?\))?#)?((?:file|http|https|chrome|safari-extension).*?):(\d+)(?::(\d+))?\s*$/i,x=/^\s*at .+ \(eval at \S+ \((?:(?:file|http|https):[^)]+)?\)(?:, [^:]*:\d+:\d+)?\)$/i,b=/^\s*at Function code \(Function code:\d+:\d+\)\s*/i;e.exports=r},{}],22:[function(n,e,t){var r=/^\n+|\n+$/g;e.exports=function(n){var e;if(n.length>100){var t=n.length-100;e=n.slice(0,50).join("\n"),e+="\n< ...truncated "+t+" lines... >\n",e+=n.slice(-50).join("\n")}else e=n.join("\n");return e.replace(r,"")}},{}],23:[function(n,e,t){function r(n){return l(n.exceptionClass)^n.stackHash}function o(n,e){if("string"!=typeof n)return"";var t=c(n);return t===e?"<inline>":t}function i(n,e){for(var t="",r=0;r<n.frames.length;r++){var o=n.frames[r],i=f(o.func);t&&(t+="\n"),i&&(t+=i+"#"),"string"==typeof o.url&&(t+=o.url),o.line&&(t+=":"+o.line)}return t}function a(n){for(var e=c(d.origin),t=0;t<n.frames.length;t++){var r=n.frames[t],i=r.url,a=o(i,e);a&&a!==r.url&&(r.url=a,n.stackString=n.stackString.split(i).join(a))}return n}function s(n,e,t){e||(e=(new Date).getTime());var o=a(p(n)),s=i(o),f={stackHash:l(s),exceptionClass:o.name,request_uri:window.location.pathname};o.message&&(f.message=""+o.message),v[f.stackHash]?f.browser_stack_hash=l(o.stackString):(v[f.stackHash]=!0,f.stack_trace=o.stackString);var c=r(f);h[c]||(f.pageview=1,h[c]=!0),u.store(t?"ierr":"err",c,f,{time:e-d.offset})}var u=n(2),f=n(20),c=n(4),p=n(21),l=n(24),d=n("loader"),m=n("ee"),v={},h={},g=n(14),y=n(9),w=n(12);if(n(17),d.features.err){var x=!1;y.on("jserrors",function(){var n=u.take(["err","ierr"]),e={body:n};return n&&n.err&&n.err.length&&!x&&(e.qs={pve:"1"},x=!0),e}),y.pingErrors(d),w(function(){var n=y.sendX("jserrors",d);n||y.pingErrors(d)},6e4),m.on("feat-err",function(){g("err",s),g("ierr",s)}),e.exports=s}},{}],24:[function(n,e,t){function r(n){var e,t=0;if(!n||!n.length)return t;for(var r=0;r<n.length;r++)e=n.charCodeAt(r),t=(t<<5)-t+e,t=0|t;return t}e.exports=r},{}],25:[function(n,e,t){function r(n,e,t){function r(n,e){t[n]||(t[n]=e)}if(!(g.length>=h)){e||(e=""),t&&"object"==typeof t||(t={});var o,a;"undefined"!=typeof window&&window.document&&window.document.documentElement&&(o=window.document.documentElement.clientWidth,a=window.document.documentElement.clientHeight);var c={timestamp:n,timeSinceLoad:(n-s.offset)/1e3,browserWidth:o,browserHeight:a,referrerUrl:i,currentUrl:l(""+location),pageUrl:l(s.origin),eventType:"PageAction"};u(y,r),u(c,r),t.actionName=e,u(t,function(n,e){e&&"object"==typeof e&&(t[n]=f(e))}),g.push(t)}}function o(n,e,t){y[e]=t}var i,a=n("ee"),s=n("loader"),u=n(30),f=n(19),c=n(14),p=n(9),l=n(4),d=n(12),m=120,v=10,h=m*v/60,g=[],y=s.info.jsAttributes={};document.referrer&&(i=l(document.referrer)),c("api-setCustomAttribute",o,"api"),a.on("feat-ins",function(){c("api-addPageAction",r),p.on("ins",function(){return{qs:{ua:s.info.userAttributes,at:s.info.atts},body:{ins:g.splice(0)}}}),d(function(){p.sendX("ins",s)},1e3*v),p.sendX("ins",s)})},{}],26:[function(n,e,t){function r(n){var e,t,r,o=Date.now();for(e in n)t=n[e],"number"==typeof t&&t>0&&o>t&&(r=n[e]-w.offset,p({n:e,s:r,e:r,o:"document",t:"timing"}))}function o(n,e,t,r){var o="timer";"requestAnimationFrame"===r&&(o=r);var i={n:r,s:e-w.offset,e:t-w.offset,o:"window",t:o};p(i)}function i(n,e,t,r){if(n.type in L)return!1;var o={n:a(n.type),s:t-w.offset,e:r-w.offset,o:s(n.target,e),t:"event"};p(o)}function a(n){var e=n;return k(C,function(t,r){n in r&&(e=t)}),e}function s(n,e){var t="unknown";if(n&&n instanceof XMLHttpRequest){var r=R.context(n).params;t=r.status+" "+r.method+": "+r.host+r.pathname}else n&&"string"==typeof n.tagName&&(t=n.tagName.toLowerCase(),n.id&&(t+="#"+n.id),n.className&&(t+="."+S(n.classList).join(".")));return"unknown"===t&&(e===document?t="document":e===window?t="window":e instanceof FileReader&&(t="FileReader")),t}function u(n,e,t){var r={n:"history.pushState",s:t-w.offset,e:t-w.offset,o:n,t:e};p(r)}function f(n){n.forEach(function(n){var e=T(n.name),t={n:n.initiatorType,s:0|n.fetchStart,e:0|n.responseEnd,o:e.protocol+"://"+e.hostname+":"+e.port+e.pathname,t:n.entryType};t.s<U||(U=t.s,p(t))})}function c(n,e,t,r){var o=null;"err"===n?o={n:"error",s:r.time,e:r.time,o:t.message,t:t.stackHash}:"xhr"===n&&(o={n:"Ajax",s:r.time,e:r.time+r.duration,o:t.status+" "+t.method+": "+t.host+t.pathname,t:"ajax"}),o&&p(o)}function p(n){var e=B[n.n];e||(e=B[n.n]=[]),e.push(n)}function l(n){var e=!0;return function(){return e||q?(e=!1,n()):{}}}function d(){f(window.performance.getEntriesByType("resource"));var n=j(k(B,function(n,e){return n in N?j(k(j(e.sort(m),v(n),{}),h),g,[]):e}),g,[]);if(0===n.length)return{};B={};var e={qs:{st:""+w.offset,ptid:q},body:{res:n}};if(!q){e.qs.ua=w.info.userAttributes,e.qs.at=w.info.atts;var t=E(w.info.jsAttributes);e.qs.ja="{}"===t?null:t}return e}function m(n,e){return n.s-e.s}function v(n){var e=N[n][0],t=N[n][1],r={};return function(o,i){var a=o[i.o];a||(a=o[i.o]=[]);var s=r[i.o];return"scrolling"!==n||y(i)?s&&i.s-s.s<t&&s.e>i.s-e?s.e=i.e:(r[i.o]=i,a.push(i)):(r[i.o]=null,i.n="scroll",a.push(i)),o}}function h(n,e){return e}function g(n,e){return n.concat(e)}function y(n){var e=4;return!!(n&&"number"==typeof n.e&&"number"==typeof n.s&&n.e-n.s<e)}var w=n("loader"),x=n(14),b=n(9),k=n(30),j=n(32),E=n(19),S=n(31),T=n(28),A=n(12);if(b.xhrUsable){var q="",L={mouseup:!0,mousedown:!0},N={typing:[1e3,2e3],scrolling:[100,1e3],mousing:[1e3,2e3],touching:[1e3,2e3]},C={typing:{keydown:!0,keyup:!0,keypress:!0},mousing:{mousemove:!0,mouseenter:!0,mouseleave:!0,mouseover:!0,mouseout:!0},scrolling:{scroll:!0},touching:{touchstart:!0,touchmove:!0,touchend:!0,touchcancel:!0,touchenter:!0,touchleave:!0}},B={},R=n("ee");if(e.exports={_takeSTNs:d},n(17),w.features.stn){R.on("feat-stn",function(){r(window.performance.timing),b.on("resources",l(d));var n=b.sendX("resources",w,{needResponse:!0});n.addEventListener("load",function(){q=this.responseText},!1),x("bst",i),x("bstTimer",o),x("bstResource",f),x("bstHist",u),x("bstAgg",c),x("bstApi",p),A(function(){var n=0;return Date.now()-w.offset>9e5?void(B={}):(k(B,function(e,t){t&&t.length&&(n+=t.length)}),n>30&&b.sendX("resources",w),void(n>1e3&&(B={})))},1e4)});var U=0}}},{}],27:[function(n,e,t){function r(n,e,t){e.time=t-u.offset,n.cat?o.store("xhr",s([n.status,n.cat]),n,e):o.store("xhr",s([n.status,n.host,n.pathname]),n,e)}var o=n(2),i=n(14),a=n(9),s=n(19),u=n("loader"),f=n("ee");u.features.xhr&&(a.on("jserrors",function(){return{body:o.take(["xhr"])}}),f.on("feat-err",function(){i("xhr",r)}),e.exports=r)},{}],28:[function(n,e,t){e.exports=function(n){var e=document.createElement("a"),t=window.location,r={};e.href=n,r.port=e.port;var o=e.href.split("://");!r.port&&o[1]&&(r.port=o[1].split("/")[0].split("#").pop().split(":")[1]),r.port&&"0"!==r.port||(r.port="https"===o[0]?"443":"80"),r.hostname=e.hostname||t.hostname,r.pathname=e.pathname,r.protocol=o[0],"/"!==r.pathname.charAt(0)&&(r.pathname="/"+r.pathname);var i=!e.protocol||":"===e.protocol||e.protocol===t.protocol,a=e.hostname===document.domain&&e.port===t.port;return r.sameOrigin=i&&(!e.hostname||a),r}},{}],29:[function(n,e,t){var r=0,o=navigator.userAgent.match(/Firefox[\/\s](\d+\.\d+)/);o&&(r=+o[1]),e.exports=r},{}],30:[function(n,e,t){function r(n,e){var t=[],r="",i=0;for(r in n)o.call(n,r)&&(t[i]=e(r,n[r]),i+=1);return t}var o=Object.prototype.hasOwnProperty;e.exports=r},{}],31:[function(n,e,t){function r(n,e,t){e||(e=0),"undefined"==typeof t&&(t=n?n.length:0);for(var r=-1,o=t-e||0,i=Array(0>o?0:o);++r<o;)i[r]=n[e+r];return i}e.exports=r},{}],32:[function(n,e,t){function r(n,e,t){var r=0;for("undefined"==typeof t&&(t=n[0],r=1),r;r<n.length;r++)t=e(t,n[r]);return t}e.exports=r},{}]},{},[23,27,26,25,11]);
This definitely seems malicious but I don't know what it is doing. Can anyone please tell me what this piece of code does?
This code looks like a normal part of New Relic's application performance analytics. It doesn't appear to be malicious.