rollbar 3.0.0-beta.5 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/.git-blame-ignore-revs +3 -1
  2. package/AGENTS.md +21 -0
  3. package/CONTRIBUTING.md +68 -73
  4. package/babel.config.json +7 -0
  5. package/bower.json +1 -1
  6. package/dist/plugins/jquery.min.js +1 -1
  7. package/dist/rollbar.cjs +2216 -2022
  8. package/dist/rollbar.js +6098 -5886
  9. package/dist/rollbar.js.map +1 -1
  10. package/dist/rollbar.min.cjs +1 -1
  11. package/dist/rollbar.min.cjs.LICENSE.txt +1 -1
  12. package/dist/rollbar.min.js +1 -1
  13. package/dist/rollbar.min.js.LICENSE.txt +1 -1
  14. package/dist/rollbar.min.js.map +1 -1
  15. package/dist/rollbar.named-amd.js +6097 -5886
  16. package/dist/rollbar.named-amd.js.map +1 -1
  17. package/dist/rollbar.named-amd.min.js +1 -1
  18. package/dist/rollbar.named-amd.min.js.LICENSE.txt +1 -1
  19. package/dist/rollbar.named-amd.min.js.map +1 -1
  20. package/dist/rollbar.noconflict.umd.js +6097 -5886
  21. package/dist/rollbar.noconflict.umd.js.map +1 -1
  22. package/dist/rollbar.noconflict.umd.min.js +1 -1
  23. package/dist/rollbar.noconflict.umd.min.js.LICENSE.txt +1 -1
  24. package/dist/rollbar.noconflict.umd.min.js.map +1 -1
  25. package/dist/rollbar.replay.js +8123 -7924
  26. package/dist/rollbar.replay.js.map +1 -1
  27. package/dist/rollbar.replay.min.js +1 -1
  28. package/dist/rollbar.replay.min.js.LICENSE.txt +1 -1
  29. package/dist/rollbar.replay.min.js.map +1 -1
  30. package/dist/rollbar.replay.noconflict.umd.js +8122 -7924
  31. package/dist/rollbar.replay.noconflict.umd.js.map +1 -1
  32. package/dist/rollbar.replay.noconflict.umd.min.js +1 -1
  33. package/dist/rollbar.replay.noconflict.umd.min.js.LICENSE.txt +1 -1
  34. package/dist/rollbar.replay.noconflict.umd.min.js.map +1 -1
  35. package/dist/rollbar.replay.umd.js +8122 -7924
  36. package/dist/rollbar.replay.umd.js.map +1 -1
  37. package/dist/rollbar.replay.umd.min.js +1 -1
  38. package/dist/rollbar.replay.umd.min.js.LICENSE.txt +1 -1
  39. package/dist/rollbar.replay.umd.min.js.map +1 -1
  40. package/dist/rollbar.snippet.js +1 -1
  41. package/dist/rollbar.umd.js +6097 -5886
  42. package/dist/rollbar.umd.js.map +1 -1
  43. package/dist/rollbar.umd.min.js +1 -1
  44. package/dist/rollbar.umd.min.js.LICENSE.txt +1 -1
  45. package/dist/rollbar.umd.min.js.map +1 -1
  46. package/eslint.config.js +151 -0
  47. package/index.d.ts +45 -13
  48. package/package.json +26 -6
  49. package/src/api.js +130 -136
  50. package/src/apiUtility.js +2 -2
  51. package/src/browser/bundles/rollbar.snippet.js +1 -0
  52. package/src/browser/core.js +31 -42
  53. package/src/browser/domUtility.js +11 -17
  54. package/src/browser/globalSetup.js +3 -3
  55. package/src/browser/replay/checkoutWatchdog.js +104 -0
  56. package/src/browser/replay/recorder.d.ts +5 -2
  57. package/src/browser/replay/recorder.js +22 -4
  58. package/src/browser/replay/replay.js +8 -4
  59. package/src/browser/replay/replayPredicates.js +1 -1
  60. package/src/browser/rollbar.js +5 -4
  61. package/src/browser/rollbarReplay.js +6 -5
  62. package/src/browser/rollbarWrapper.js +2 -2
  63. package/src/browser/shim.js +15 -15
  64. package/src/browser/telemetry.js +26 -22
  65. package/src/browser/transforms.js +4 -4
  66. package/src/browser/transport/xhr.js +4 -4
  67. package/src/browser/transport.js +9 -10
  68. package/src/browser/wrapGlobals.js +3 -4
  69. package/src/defaults.js +1 -1
  70. package/src/errorParser.js +1 -1
  71. package/src/logger.js +1 -0
  72. package/src/notifier.js +102 -100
  73. package/src/predicates.js +3 -4
  74. package/src/rateLimiter.js +107 -104
  75. package/src/react-native/rollbar.js +9 -10
  76. package/src/react-native/transforms.js +4 -5
  77. package/src/react-native/transport.js +7 -7
  78. package/src/rollbar.js +7 -4
  79. package/src/scrub.js +16 -20
  80. package/src/server/locals.js +7 -7
  81. package/src/server/parser.js +9 -6
  82. package/src/server/rollbar.js +54 -49
  83. package/src/server/sourceMap/stackTrace.js +7 -6
  84. package/src/server/telemetry/urlHelpers.js +2 -1
  85. package/src/server/telemetry.js +10 -10
  86. package/src/server/transforms.js +10 -6
  87. package/src/server/transport.js +8 -7
  88. package/src/telemetry.js +22 -25
  89. package/src/tracing/tracer.js +2 -2
  90. package/src/tracing/tracing.js +2 -2
  91. package/src/truncation.js +6 -6
  92. package/src/utility/headers.js +4 -2
  93. package/src/utility/traverse.js +1 -1
  94. package/src/utility.js +111 -33
  95. package/tsconfig.json +16 -0
  96. package/tsconfig.test.json +10 -0
  97. package/{web-test-runner.config.mjs → web-test-runner.config.js} +10 -0
  98. package/{webpack.config.cjs → webpack.config.js} +39 -27
  99. package/.eslintrc +0 -27
  100. package/eslint.config.mjs +0 -33
  101. package/src/merge.js +0 -61
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see rollbar.umd.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rollbar=e():t.rollbar=e()}(this,(function(){return function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:function(){return qn}});var r={};t.r(r),t.d(r,{parse:function(){return jt}});var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=function(t){if(!t||"[object Object]"!==o.call(t))return!1;var e,r=n.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!i)return!1;for(e in t);return void 0===e||n.call(t,e)};var a=function t(){var e,r,n,o,a,s=Object.create(null),u=null,l=arguments.length;for(e=0;e<l;e++)if(null!=(u=arguments[e]))for(a in u)r=s[a],s!==(n=u[a])&&(n&&i(n)?(o=r&&i(r)?r:{},s[a]=t(o,n)):void 0!==n&&(s[a]=n));return s};function s(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function c(t,e){return e===f(t)}function f(t){var e=l(t);return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function p(t){return c(t,"function")}function h(t){var e=l(t);return null!=t&&("object"==e||"function"==e)}function d(t){return Number.isFinite(t)}function y(t){return c(t,"error")||c(t,"exception")}var v={debug:0,info:1,warning:2,error:3,critical:4};function m(t){var e=function(t){if(!c(t,"string"))return;for(var e=b,r=e.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=0,i=e.key.length;o<i;++o)n[e.key[o]]=r[o]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,(function(t,r,o){r&&(n[e.q.name][r]=o)})),n}(t);return e?(""===e.anchor&&(e.source=e.source.replace("#","")),t=e.source.replace("?"+e.query,"")):"(unknown)"}var b={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function g(t,e){if(!(e=e||t.protocol)&&t.port&&(80===t.port?e="http:":443===t.port&&(e="https:")),e=e||"https:",!t.hostname)return null;var r=e+"//"+t.hostname;return t.port&&(r=r+":"+t.port),t.path&&(r+=t.path),r}function w(t,e){var r,n;try{r=JSON.stringify(t)}catch(o){if(e&&p(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function k(t){var e,r;try{e=JSON.parse(t)}catch(t){r=t}return{error:r,value:e}}function _(t,e,r,n,o,i,a,s){var u={url:e||"",line:r,column:n};u.func=s.guessFunctionName(u.url,u.line),u.context=s.gatherContext(u.url,u.line);var l="undefined"!=typeof document&&document&&document.location&&document.location.href,c="undefined"!=typeof window&&window&&window.navigator&&window.navigator.userAgent;return{mode:i,message:o?String(o):t||a,url:l,stack:[u],useragent:c}}function S(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function O(t){return function t(e,r){var n,o,i,a={};try{for(o in e)(n=e[o])&&(c(n,"object")||c(n,"array"))?r.includes(n)?a[o]="Removed circular reference: "+f(n):((i=r.slice()).push(n),a[o]=t(n,i)):a[o]=n}catch(t){a="Failed cloning custom data: "+t.message}return a}(t,[t])}function x(t,e,r,n,o){for(var i,a,s,u,l,c,p=[],h=[],d=0,y=t.length;d<y;++d){var v=f(c=t[d]);switch(h.push(v),v){case"undefined":break;case"string":i?p.push(c):i=c;break;case"function":u=S(e,c);break;case"date":p.push(c);break;case"error":case"domexception":case"exception":a?p.push(c):a=c;break;case"object":case"array":if(c instanceof Error||"undefined"!=typeof DOMException&&c instanceof DOMException){a?p.push(c):a=c;break}if(n&&"object"===v&&!l){for(var m=0,b=n.length;m<b;++m)if(void 0!==c[n[m]]){l=c;break}if(l)break}s?p.push(c):s=c;break;default:if(c instanceof Error||"undefined"!=typeof DOMException&&c instanceof DOMException){a?p.push(c):a=c;break}p.push(c)}}s&&(s=O(s)),p.length>0&&(s||(s=O({})),s.extraArgs=O(p));var g,w={message:i,err:a,custom:s,timestamp:R(),callback:u,notifier:r,diagnostic:{},uuid:(g=R(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=(g+16*Math.random())%16|0;return g=Math.floor(g/16),("x"===t?e:7&e|8).toString(16)})))};return w.data=w.data||{},function(t,e){e&&void 0!==e.level&&(t.level=e.level,delete e.level);e&&void 0!==e.skipFrames&&(t.skipFrames=e.skipFrames,delete e.skipFrames)}(w,s),n&&l&&(w.request=l),o&&(w.lambdaContext=o),w._originalArgs=t,w.diagnostic.original_arg_types=h,w}var E=["log","network","dom","navigation","error","manual"],j=["critical","error","warning","info","debug"];function I(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1}function P(t,e){t.attributes=t.attributes||[];var r,n=s(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;void 0!==o.value&&t.attributes.push(o)}}catch(t){n.e(t)}finally{n.f()}}function T(t,e){if(t){var r=e.split("."),n=t;try{for(var o=0,i=r.length;o<i;++o)n=n[r[o]]}catch(t){n=void 0}return n}}function A(t,e,r){if(t){Object.setPrototypeOf(t,null);var n=e.split("."),o=n.length;if(!(o<1))if(1!==o)try{for(var i=t[n[0]]||{},a=i,s=1;s<o-1;++s)i[n[s]]=i[n[s]]||{},i=i[n[s]];i[n[o-1]]=r,t[n[0]]=a}catch(t){return}else t[n[0]]=r}}function R(){return Date.now?+Date.now():+new Date}function C(t,e,r,n){var o=a(t,e,r);return o=function(t,e){t.hostWhiteList&&!t.hostSafeList&&(t.hostSafeList=t.hostWhiteList,t.hostWhiteList=void 0,e&&e.log("hostWhiteList is deprecated. Use hostSafeList."));t.hostBlackList&&!t.hostBlockList&&(t.hostBlockList=t.hostBlackList,t.hostBlackList=void 0,e&&e.log("hostBlackList is deprecated. Use hostBlockList."));return t}(o,n),!e||e.overwriteScrubFields||e.scrubFields&&(o.scrubFields=(t.scrubFields||[]).concat(e.scrubFields)),o}function L(t){this.startTime=R(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(t)}function N(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function q(t,e,r,n,o,i,a){var s=null;return r&&(r=new Error(r)),r||n||(s=function(t,e,r,n,o){var i,a=e.environment||e.payload&&e.payload.environment;i=o?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.";var s={body:{message:{body:i,extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:a,notifier:{version:e.notifier&&e.notifier.version||e.version}};"browser"===t?(s.platform="browser",s.framework="browser-js",s.notifier.name="rollbar-browser-js"):"server"===t?(s.framework=e.framework||"node-js",s.notifier.name=e.notifier.name):"react-native"===t&&(s.framework=e.framework||"react-native",s.notifier.name=e.notifier.name);return s}(t,e,o,i,a)),{error:r,shouldSend:n,payload:s}}L.globalSettings={startTime:R(),maxItems:void 0,itemsPerMinute:void 0},L.prototype.configureGlobal=function(t){void 0!==t.startTime&&(L.globalSettings.startTime=t.startTime),void 0!==t.maxItems&&(L.globalSettings.maxItems=t.maxItems),void 0!==t.itemsPerMinute&&(L.globalSettings.itemsPerMinute=t.itemsPerMinute)},L.prototype.shouldSend=function(t,e){var r=(e=e||R())-this.startTime;(r<0||r>=6e4)&&(this.startTime=e,this.perMinCounter=0);var n=L.globalSettings.maxItems,o=L.globalSettings.itemsPerMinute;if(N(t,n,this.counter))return q(this.platform,this.platformOptions,n+" max items reached",!1);if(N(t,o,this.perMinCounter))return q(this.platform,this.platformOptions,o+" items per minute reached",!1);this.counter++,this.perMinCounter++;var i=!N(t,n,this.counter),a=i;return i=i&&!N(t,o,this.perMinCounter),q(this.platform,this.platformOptions,null,i,n,o,a)},L.prototype.setPlatformOptions=function(t,e){this.platform=t,this.platformOptions=e};var D=L;function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function U(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H(n.key),n)}}function H(t){var e=function(t,e){if("object"!=M(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==M(e)?e:e+""}var F,J,V,W=function(){function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rateLimiter=e,this.api=r,this.logger=n,this.options=o,this.replay=i,this.predicates=[],this.pendingItems=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}return e=t,r=[{key:"configure",value:function(t){var e;null===(e=this.api)||void 0===e||e.configure(t);var r=this.options;return this.options=a(r,t),this}},{key:"addPredicate",value:function(t){return p(t)&&this.predicates.push(t),this}},{key:"addPendingItem",value:function(t){this.pendingItems.push(t)}},{key:"removePendingItem",value:function(t){var e=this.pendingItems.indexOf(t);-1!==e&&this.pendingItems.splice(e,1)}},{key:"addItem",value:function(t,e,r,n){var o=this;e&&p(e)||(e=function(){});var i=t.data,a=this._applyPredicates(i);if(a.stop)return this.removePendingItem(n),void e(a.err);if(this._maybeLog(i,r),this.removePendingItem(n),this.options.transmit){this.replay&&i.body&&(t.replayId=this.replay.capture(null,i.uuid,{type:"occurrence",level:t.level}),t.replayId&&P(t.data,[{key:"replay_id",value:t.replayId}])),this.pendingRequests.push(i);try{this._makeApiRequest(i,(function(r,n,a){o._dequeuePendingRequest(i),t.replayId&&o.replay.sendOrDiscardReplay(t.replayId,r,n,a),e(r,n)}))}catch(r){var s;this._dequeuePendingRequest(i),t.replayId&&(null===(s=this.replay)||void 0===s||s.discard(t.replayId)),e(r)}}else e(new Error("Transmit disabled"))}},{key:"wait",value:function(t){var e=this;p(t)&&(this.waitCallback=t,this._maybeCallWait()||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval((function(){e._maybeCallWait()}),500)))}},{key:"_applyPredicates",value:function(t){for(var e=null,r=0,n=this.predicates.length;r<n;r++)if(!(e=this.predicates[r](t,this.options))||void 0!==e.err)return{stop:!0,err:e.err};return{stop:!1,err:null}}},{key:"_makeApiRequest",value:function(t,e){var r=this,n=this.rateLimiter.shouldSend(t);n.shouldSend?this.api.postItem(t,(function(n,o,i){n?r._maybeRetry(n,t,e):e(n,o,i)})):n.error?e(n.error):this.api.postItem(n.payload,e)}},{key:"_maybeRetry",value:function(e,r,n){var o=!1;if(this.options.retryInterval){for(var i=0,a=t.RETRIABLE_ERRORS.length;i<a;i++)if(e.code===t.RETRIABLE_ERRORS[i]){o=!0;break}o&&d(this.options.maxRetries)&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(o=!1))}o?this._retryApiRequest(r,n):n(e)}},{key:"_retryApiRequest",value:function(t,e){var r=this;this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval((function(){for(;r.retryQueue.length;){var t=r.retryQueue.shift();r._makeApiRequest(t.item,t.callback)}}),this.options.retryInterval))}},{key:"_dequeuePendingRequest",value:function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())}},{key:"_maybeLog",value:function(t,e){if(this.logger&&this.options.verbose){var r=e||T(t,"body.trace.exception.message")||T(t,"body.trace_chain.0.exception.message");if(r)return void this.logger.error(r);(r=T(t,"body.message.body"))&&this.logger.log(r)}}},{key:"_maybeCallWait",value:function(){return!(!p(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))}}],r&&U(e.prototype,r),n&&U(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();F=W,V=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(J=H(J="RETRIABLE_ERRORS"))in F?Object.defineProperty(F,J,{value:V,enumerable:!0,configurable:!0,writable:!0}):F[J]=V;var B=W;function G(t,e){this.queue=t,this.options=e,this.transforms=[],this.diagnostic={}}G.prototype.configure=function(t){this.queue&&this.queue.configure(t);var e=this.options;return this.options=a(e,t),this},G.prototype.addTransform=function(t){return p(t)&&this.transforms.push(t),this},G.prototype.log=function(t,e){if(e&&p(e)||(e=function(){}),!this.options.enabled)return e(new Error("Rollbar is not enabled"));this.queue.addPendingItem(t);var r=t.err;this._applyTransforms(t,function(n,o){if(n)return this.queue.removePendingItem(t),e(n,null);this.queue.addItem(o,e,r,t)}.bind(this))},G.prototype._applyTransforms=function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,a=function(t,s){t?e(t,null):++r!==n?o[r](s,i,a):e(null,s)};a(null,t)};var $=G;function z(t,e,r,n,o,i,s){this.options=a(t),this.logger=r,z.rateLimiter.configureGlobal(this.options),z.rateLimiter.setPlatformOptions(s,this.options),this.api=e,this.queue=new B(z.rateLimiter,e,r,this.options,i),this.tracing=o;var u=this.options.tracer||null;Z(u)?(this.tracer=u,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new $(this.queue,this.options),this.telemeter=n,X(t),this.lastError=null,this.lastErrorHash="none"}function X(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function Z(t){if(!t)return!1;if(!t.scope||"function"!=typeof t.scope)return!1;var e=t.scope();return!(!e||!e.active||"function"!=typeof e.active)}z.rateLimiter=new D({maxItems:0,itemsPerMinute:60}),z.prototype.global=function(t){return z.rateLimiter.configureGlobal(t),this},z.prototype.configure=function(t,e){var r=this.options,n={};e&&(n={payload:e}),this.options=a(r,t,n);var o=this.options.tracer||null;return Z(o)?(this.tracer=o,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier&&this.notifier.configure(this.options),this.telemeter&&this.telemeter.configure(this.options),X(t),this.global(this.options),Z(t.tracer)&&(this.tracer=t.tracer),this},z.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},z.prototype.debug=function(t){this._log("debug",t)},z.prototype.info=function(t){this._log("info",t)},z.prototype.warn=function(t){this._log("warning",t)},z.prototype.warning=function(t){this._log("warning",t)},z.prototype.error=function(t){this._log("error",t)},z.prototype.critical=function(t){this._log("critical",t)},z.prototype.wait=function(t){this.queue.wait(t)},z.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},z.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},z.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},z.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},z.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},z.prototype._log=function(t,e){var r;if(e.callback&&(r=e.callback,delete e.callback),this.options.ignoreDuplicateErrors&&this._sameAsLastError(e)){if(r){var n=new Error("ignored identical item");n.item=e,r(n)}}else try{e.level=e.level||t,this._addTracingAttributes(e),this._addTracingInfo(e);var o=this.telemeter;o&&(o._captureRollbarItem(e),e.telemetryEvents=o.copyEvents()||[]),this.notifier.log(e,r)}catch(t){r&&r(t),this.logger.error(t)}},z.prototype._addTracingAttributes=function(t){var e,r,n=null===(e=this.tracing)||void 0===e?void 0:e.getSpan(),o=[{key:"session_id",value:null===(r=this.tracing)||void 0===r?void 0:r.sessionId},{key:"span_id",value:null==n?void 0:n.spanId},{key:"trace_id",value:null==n?void 0:n.traceId}];P(t.data,o),null==n||n.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:t.uuid}])},z.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},z.prototype._sameAsLastError=function(t){if(!t._isUncaught)return!1;var e=function(t){var e=t.message||"",r=(t.err||{}).stack||String(t.err);return e+"::"+r}(t);return this.lastErrorHash===e||(this.lastError=t.err,this.lastErrorHash=e,!1)},z.prototype._addTracingInfo=function(t){if(this.tracer){var e=this.tracer.scope().active();if(function(t){if(!t||!t.context||"function"!=typeof t.context)return!1;var e=t.context();if(!e||!e.toSpanId||!e.toTraceId||"function"!=typeof e.toSpanId||"function"!=typeof e.toTraceId)return!1;return!0}(e)){e.setTag("rollbar.error_uuid",t.uuid),e.setTag("rollbar.has_error",!0),e.setTag("error",!0),e.setTag("rollbar.item_url","https://rollbar.com/item/uuid/?uuid=".concat(t.uuid)),e.setTag("rollbar.occurrence_url","https://rollbar.com/occurrence/uuid/?uuid=".concat(t.uuid));var r=e.context().toSpanId(),n=e.context().toTraceId();t.custom?(t.custom.opentracing_span_id=r,t.custom.opentracing_trace_id=n):t.custom={opentracing_span_id:r,opentracing_trace_id:n}}}};var Q=z;function K(t){if(!c(t.context,"string")){var e=w(t.context);e.error?t.context="Error: could not serialize 'context'":t.context=e.value||"",t.context.length>255&&(t.context=t.context.substr(0,255))}return{data:t}}function Y(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,a=e.path,s=e.search,u=t.timeout,l=function(t){var e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=t.defaultTransport||"xhr";void 0===e.fetch&&(r="xhr");void 0===e.XMLHttpRequest&&(r="fetch");return r}(t),c=t.proxy;if(t.endpoint){var f=r.parse(t.endpoint);n=f.hostname,o=f.protocol,i=f.port,a=f.pathname,s=f.search}return{timeout:u,hostname:n,protocol:o,port:i,path:a,search:s,proxy:c,transport:l}}function tt(t,e){var r=t.protocol||"https:",n=t.port||("http:"===r?80:"https:"===r?443:void 0),o=t.hostname,i=t.path,a=t.timeout,s=t.transport;return t.search&&(i+=t.search),t.proxy&&(i=r+"//"+o+i,o=t.proxy.host||t.proxy.hostname,n=t.proxy.port,r=t.proxy.protocol||r),{timeout:a,protocol:r,hostname:o,path:i,port:n,method:e,transport:s}}function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(r),!0).forEach((function(e){ot(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ot(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=et(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==et(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function it(){it=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new T(n||[]);return o(a,"_invoke",{value:E(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(A([])));_&&_!==r&&n.call(_,a)&&(w=_);var S=g.prototype=m.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==et(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function E(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=j(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(et(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(x.prototype),l(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function at(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}var st={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},ut={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443};function lt(t,e,r,n){this.options=t,this.transport=e,this.url=r,this.truncation=n,this.accessToken=t.accessToken,this.transportOptions=ct(t,r),this.OTLPTransportOptions=ft(t,r)}function ct(t,e){return Y(t,st,e)}function ft(t,e){var r;return Y(t=nt(nt({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),ut,e)}lt.prototype._postPromise=function(t){var e=t.accessToken,r=t.options,n=t.payload,o=t.headers,i=this;return new Promise((function(t,a){i.transport.post({accessToken:e,options:r,payload:n,headers:o,callback:function(e,r){return e?a(e):t(r)}})}))},lt.prototype.postItem=function(t,e){var r=tt(this.transportOptions,"POST"),n=K(t),o=this;setTimeout((function(){o.transport.post({accessToken:o.accessToken,options:r,payload:n,callback:e})}),0)},lt.prototype.postSpans=function(){var t,e=(t=it().mark((function t(e){var r,n,o=arguments;return it().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},n=tt(this.OTLPTransportOptions,"POST"),t.next=4,this._postPromise({accessToken:this.accessToken,options:n,payload:e,headers:r});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){at(i,n,o,a,s,"next",t)}function s(t){at(i,n,o,a,s,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}(),lt.prototype.buildJsonPayload=function(t,e){var r,n=K(t);return(r=this.truncation?this.truncation.truncate(n):w(n)).error?(e&&e(r.error),null):r.value},lt.prototype.postJsonPayload=function(t,e){var r=tt(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)},lt.prototype.configure=function(t){var e=this.oldOptions;return this.options=a(e,t),this.transportOptions=ct(this.options,this.url),this.OTLPTransportOptions=ft(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this};var pt=lt,ht=function(){},dt={debug:0,info:1,warn:2,error:3,disable:4},yt={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ht("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ht("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ht("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ht("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ht("info",e)},init:function(t){var e=t.logLevel;ht=function(t,r){dt[t]<dt[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}},vt=yt;function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function gt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=mt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==mt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wt=function(t){var e,r,n=t.accessToken,o=t.url,i=t.method,a=t.payload,s=t.headers,u=t.callback,l=t.timeout;d(l)&&(e=new AbortController,r=setTimeout((function(){e.abort()}),l)),s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?bt(Object(r),!0).forEach((function(e){gt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({"Content-Type":"application/json","X-Rollbar-Access-Token":n,signal:e&&e.signal},s),fetch(o,{method:i,headers:s,body:a}).then((function(t){r&&clearTimeout(r);var e=t.headers,n=o.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.get("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.get("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.get("Rollbar-Replay-RateLimit-Reset")}:{},i=t.json();u(null,i,n)})).catch((function(t){vt.error(t.message),u(t)}))};function kt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _t(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_t(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _t(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function St(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}var Ot=function(t){var e,r=t.accessToken,n=t.url,o=t.method,i=t.payload,a=t.headers,s=t.callback,u=t.requestFactory,l=t.timeout;if(!(e=u?u():function(){var t,e,r=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=r.length;for(e=0;e<n;e++)try{t=r[e]();break}catch(t){}return t}()))return s(new Error("No way to send a request"));try{try{var f=function(){try{if(f&&4===e.readyState){f=void 0;var t=k(e.responseText);if(function(t){return t&&t.status&&200===t.status}(e)){var r=n.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.getResponseHeader("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.getResponseHeader("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.getResponseHeader("Rollbar-Replay-RateLimit-Reset")}:{};return void s(t.error,t.value,r)}if(function(t){return t&&c(t.status,"number")&&t.status>=400&&t.status<600}(e)){if(403===e.status){var o=t.value&&t.value.message;vt.error(o)}s(new Error(String(e.status)))}else{s(St("XHR response had no status code (likely connection failure)"))}}}catch(t){var i;i=t&&t.stack?t:new Error(t),s(i)}};if(e.open(o,n,!0),e.setRequestHeader){e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("X-Rollbar-Access-Token",r);for(var p=0,h=Object.entries(null!=a?a:{});p<h.length;p++){var y=kt(h[p],2),v=y[0],m=y[1];e.setRequestHeader(v,m)}}d(l)&&(e.timeout=l),e.onreadystatechange=f,e.send(i)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return s(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===n.substring(0,5)&&(n="http"+n.substring(5));var b=new XDomainRequest;b.onprogress=function(){},b.ontimeout=function(){s(St("Request timed out","ETIMEDOUT"))},b.onerror=function(){s(new Error("Error during request"))},b.onload=function(){var t=k(b.responseText);s(t.error,t.value)},b.open(o,n,!0),b.send(i)}else s(new Error("Cannot find a method to transport a request"))}}catch(t){s(t)}};function xt(t){this.truncation=t}xt.prototype.get=function(t,e,r,n,o){n&&p(n)||(n=function(){}),function(t,e,r){(r=r||{}).access_token=t;var n,o=[];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&o.push([n,r[n]].join("="));var i="?"+o.sort().join("&");(e=e||{}).path=e.path||"";var a,s=e.path.indexOf("?"),u=e.path.indexOf("#");-1!==s&&(-1===u||u>s)?(a=e.path,e.path=a.substring(0,s)+i+"&"+a.substring(s+1)):-1!==u?(a=e.path,e.path=a.substring(0,u)+i+a.substring(u)):e.path=e.path+i}(t,e,r);var i=g(e);this._makeZoneRequest({accessToken:t,url:i,method:"GET",callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},xt.prototype.post=function(t){var e=this,r=t.accessToken,n=t.options,o=t.payload,i=t.headers,a=t.callback,s=t.requestFactory;return function(t){if(a&&p(a)||(a=function(){}),!t)return a(new Error("Cannot send empty request"));var o;if((o=e.truncation&&t.body?e.truncation.truncate(t):w(t)).error)return a(o.error);t=o.value;var u=g(n);e._makeZoneRequest({accessToken:r,url:u,method:"POST",payload:t,headers:i,callback:a,requestFactory:s,timeout:n.timeout,transport:n.transport})}(o)},xt.prototype.postJsonPayload=function(t,e,r,n,o){n&&p(n)||(n=function(){});var i=g(e);this._makeZoneRequest({accessToken:t,url:i,method:"POST",payload:r,callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},xt.prototype._makeZoneRequest=function(){var t="undefined"!=typeof window&&window||void 0!==n&&n,e=t&&t.Zone&&t.Zone.root,r=Array.prototype.slice.call(arguments);if(e){var n=this;e.run((function(){n._makeRequest.apply(void 0,r)}))}else this._makeRequest.apply(void 0,r)},xt.prototype._makeRequest=function(t){var e=t.payload,r=t.callback,n=t.transport;if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,(function(t){}),(function(t){e(new Error(t))}))}(e,r);"fetch"===n?wt(t):Ot(t)};var Et=xt;function jt(t){var e,r,n={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(-1!==(e=t.indexOf("//"))?(n.protocol=t.substring(0,e),r=e+2):r=0,-1!==(e=t.indexOf("@",r))&&(n.auth=t.substring(r,e),r=e+1),-1===(e=t.indexOf("/",r))){if(-1===(e=t.indexOf("?",r)))return-1===(e=t.indexOf("#",r))?n.host=t.substring(r):(n.host=t.substring(r,e),n.hash=t.substring(e)),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),n;n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e}else n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e;if(-1===(e=t.indexOf("#",r))?n.path=t.substring(r):(n.path=t.substring(r,e),n.hash=t.substring(e)),n.path){var o=n.path.split("?");n.pathname=o[0],n.query=o[1],n.search=n.query?"?"+n.query:null}return n}var It=/(^|@)\S+:\d+/,Pt=/^\s*at .*(\S+:\d+|\(native\))/m,Tt=/^(eval@)?(\[native code\])?$/;function At(t,e){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return function(t,e){return!t.stacktrace||t.message.includes("\n")&&t.message.split("\n").length>t.stacktrace.split("\n").length?function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({file:s[2],line:+s[1],raw:n[i]})}return Ct(o,e)}(t):t.stack?function(t,e){var r=Ct(t.stack.split("\n").filter((function(t){return!!t.match(It)&&!t.match(/^Error created at/)})),e);return r.map((function(t){var e,r=t.split("@"),n=Rt(r.pop()),o=r.shift()||"",i=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return o.match(/\(([^)]*)\)/)&&(e=o.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{function:i,args:void 0===e||"[arguments not available]"===e?void 0:e.split(","),file:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}}))}(t,e):function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({function:s[3]||void 0,file:s[2],line:s[1]?+s[1]:void 0,raw:n[i]})}return Ct(o,e)}(t)}(t,e);if(t.stack&&t.stack.match(Pt))return function(t,e){return Lt(t.stack,e)}(t,e);if(t.stack)return function(t,e){return Nt(t.stack,e)}(t,e);if(null!=e&&e.allowEmpty)return[];throw new Error("Cannot parse given Error object")}function Rt(t){if(!t.includes(":"))return[t,void 0,void 0];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]}function Ct(t,e){return e&&null!=e.slice?Array.isArray(e.slice)?t.slice(e.slice[0],e.slice[1]):t.slice(0,e.slice):t}function Lt(t,e){return Ct(t.split("\n").filter((function(t){return!!t.match(Pt)})),e).map((function(t){t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=e.match(/ (\(.+\)$)/);e=r?e.replace(r[0],""):e;var n=Rt(r?r[1]:e);return{function:r&&e||void 0,file:["eval","<anonymous>"].includes(n[0])?void 0:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}}))}function Nt(t,e){return Ct(t.split("\n").filter((function(t){return!t.match(Tt)})),e).map((function(t){if(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.includes("@")||t.includes(":")){var e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=t.match(e),n=r&&r[1]?r[1]:void 0,o=Rt(t.replace(e,""));return{function:n,file:o[0],line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:t}}return{function:t}}))}function qt(t){return t.map((function(t){return{functionName:t.function,args:t.args,fileName:t.file,lineNumber:t.line,columnNumber:t.col,source:t.raw}}))}var Dt=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function Mt(){return null}function Ut(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function Ht(t,e){return{stack:function(){var r=[];e=e||0;try{r=function(t,e){return qt(At(t,e))}(t)}catch(t){r=[]}for(var n=[],o=e;o<r.length;o++)n.push(new Ut(r[o]));return n}(),message:t.message,name:Ft(t),rawStack:t.stack,rawException:t}}function Ft(t){var e=t.name&&t.name.length&&t.name,r=t.constructor.name&&t.constructor.name.length&&t.constructor.name;return e&&r?"Error"===e?r:e:e||r}var Jt={guessFunctionName:function(){return"?"},guessErrorClass:function(t){if(!t||!t.match)return["Unknown error. There was no error message to display.",""];var e=t.match(Dt),r="(unknown)";return e&&(r=e[e.length-1],t=(t=t.replace((e[e.length-2]||"")+r+":","")).replace(/(^[\s]+|[\s]+$)/g,"")),[r,t]},gatherContext:Mt,parse:function(t,e){var r=t;if(r.nested||r.cause){for(var n=[];r;)n.push(new Ht(r,e)),r=r.nested||r.cause,e=0;return n[0].traceChain=n,n[0]}return new Ht(r,e)},Stack:Ht,Frame:Ut};function Vt(t,e,r){if(t.err&&"DOMException"===Jt.Stack(t.err).name){var n=new Error;n.name=t.err.name,n.message=t.err.message,n.stack=t.err.stack,n.nested=t.err,t.err=n}r(null,t)}function Wt(t,e,r){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||Jt.parse(t.err,t.skipFrames),e.addErrorContext&&function(t){var e=[],r=t.err;e.push(r);for(;r.nested||r.cause;)r=r.nested||r.cause,e.push(r);!function(t,e){var r=t.data.custom||{},n=!1;try{for(var o=0;o<e.length;++o)e[o].hasOwnProperty("rollbarContext")&&(r=a(r,O(e[o].rollbarContext)),n=!0);n&&(t.data.custom=r)}catch(e){t.diagnostic.error_context="Failed: "+e.message}}(t,e)}(t)}catch(e){vt.error("Error while parsing the error object.",e);try{t.message=t.err.message||t.err.description||t.message||String(t.err)}catch(e){t.message=String(t.err)||String(e)}delete t.err}r(null,t)}function Bt(t,e,r){t.message||t.stackInfo||t.custom||r(new Error("No message, stack info, or custom data"),null),r(null,t)}function Gt(t,e,r){var n=e.payload&&e.payload.environment||e.environment;t.data=a(t.data,{environment:n,level:t.level,endpoint:e.endpoint,platform:"browser",framework:"browser-js",language:"javascript",server:{},uuid:t.uuid,notifier:{name:"rollbar-browser-js",version:e.version},custom:t.custom}),r(null,t)}function $t(t,e,r){t.stackInfo?t.stackInfo.traceChain?function(t,e,r){for(var n=t.stackInfo.traceChain,o=[],i=n.length,a=0;a<i;a++){var s=Zt(t,n[a],e);o.push(s)}A(t,"data.body",{trace_chain:o}),r(null,t)}(t,e,r):function(t,e,r){var n=Xt(t);if(n){A(t,"data.body",{trace:Zt(t,t.stackInfo,e)}),r(null,t)}else{var o=t.stackInfo,i=Jt.guessErrorClass(o.message),a=Qt(o,i[0],e),s=i[1];t.message=a+": "+s,zt(t,e,r)}}(t,e,r):zt(t,e,r)}function zt(t,e,r){var n=t.message,o=t.custom;n||(n="Item sent with null or missing arguments.");var i={body:n};o&&(i.extra=a(o)),A(t,"data.body",{message:i}),r(null,t)}function Xt(t){var e=t.stackInfo.stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function Zt(t,e,r){var n=t&&t.data.description,o=t&&t.custom,i=Xt(t),s=Jt.guessErrorClass(e.message),u={exception:{class:Qt(e,s[0],r),message:s[1]}};if(n&&(u.exception.description=n),i){var l,c,f,p,h,d,y,v;for(0===i.length&&(u.exception.stack=e.rawStack,u.exception.raw=String(e.rawException)),u.frames=[],y=0;y<i.length;++y)c={filename:(l=i[y]).url?m(l.url):"(unknown)",lineno:l.line||null,method:l.func&&"?"!==l.func?l.func:"[anonymous]",colno:l.column},r.sendFrameUrl&&(c.url=l.url),c.method&&c.method.endsWith&&c.method.endsWith("_rollbar_wrapped")||(f=p=h=null,(d=l.context?l.context.length:0)&&(v=Math.floor(d/2),p=l.context.slice(0,v),f=l.context[v],h=l.context.slice(v)),f&&(c.code=f),(p||h)&&(c.context={},p&&p.length&&(c.context.pre=p),h&&h.length&&(c.context.post=h)),l.args&&(c.args=l.args),u.frames.push(c));u.frames.reverse(),o&&(u.extra=a(o))}return u}function Qt(t,e,r){return t.name?t.name:r.guessErrorClass?e:"(unknown)"}function Kt(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function Yt(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=a(t.data,n),r(null,t)}function te(t,e,r){t.telemetryEvents&&A(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function ee(t,e,r){if(t.message){var n="data.body.trace_chain.0",o=T(t,n);if(o||(o=T(t,n="data.body.trace")),o){if(!o.exception||!o.exception.description)return A(t,n+".exception.description",t.message),void r(null,t);var i=T(t,n+".extra")||{};A(t,n+".extra",a(i,{message:t.message}))}r(null,t)}else r(null,t)}function re(t){return function(e,r,n){var o,i=a(e),s=null;try{p(r.transform)&&(s=r.transform(i.data,e))}catch(o){return r.transform=null,t.error("Error while calling custom transform() function. Removing custom transform().",o),void n(null,e)}h(o=s)&&c(o.then,"function")?s.then((function(t){t&&(i.data=t),n(null,i)}),(function(t){n(t,e)})):n(null,i)}}function ne(t,e,r){if(!e.sendConfig)return r(null,t);var n=T(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,r(null,t)}function oe(t,e){p(t[e])&&(t[e]=t[e].toString())}function ie(t,e,r){var n=e._configuredOptions;oe(n,"transform"),oe(n,"checkIgnore"),oe(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function ae(t,e,r){var n=a(t.notifier.client.notifier.diagnostic,t.diagnostic);if(T(t,"err._isAnonymous")&&(n.is_anonymous=!0),t._isUncaught&&(n.is_uncaught=t._isUncaught),t.err)try{n.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){n.raw_error={failed:String(t)}}t.data.notifier.diagnostic=a(t.data.notifier.diagnostic,n),r(null,t)}function se(t,e){return!T(e,"plugins.jquery.ignoreAjaxErrors")||!T(t,"body.message.extra.isAjax")}function ue(t,e){var r=t.level,n=v[r]||0,o=e.reportLevel;return!(n<(v[o]||0))}function le(t,e,r){if(!t)return!r;var n,o,i=t.frames;if(!i||0===i.length)return!r;for(var a=e.length,s=i.length,u=0;u<s;u++){if(!c(n=i[u].filename,"string"))return!r;for(var l=0;l<a;l++)if(o=e[l],new RegExp(o).test(n))return!0}return!1}function ce(t,e,r,n){var o,i,a=!1;"blocklist"===r&&(a=!0);try{if(o=a?e.hostBlockList:e.hostSafeList,i=T(t,"body.trace_chain")||[T(t,"body.trace")],!o||0===o.length)return!a;if(0===i.length||!i[0])return!a;for(var s=i.length,u=0;u<s;u++)if(le(i[u],o,a))return!0}catch(t){a?e.hostBlockList=null:e.hostSafeList=null;var l=a?"hostBlockList":"hostSafeList";return n.error("Error while reading your configuration's "+l+" option. Removing custom "+l+".",t),!a}return!1}function fe(t){return function(e,r){var n,o,i,a,s,u;try{if(!(i=r.ignoredMessages)||0===i.length)return!0;if(u=function(t){var e=t.body,r=[];if(e.trace_chain)for(var n=e.trace_chain,o=0;o<n.length;o++){var i=n[o];r.push(T(i,"exception.message"))}e.trace&&r.push(T(e,"trace.exception.message"));e.message&&r.push(T(e,"message.body"));return r}(e),0===u.length)return!0;for(a=i.length,n=0;n<a;n++)for(s=new RegExp(i[n],"gi"),o=0;o<u.length;o++)if(s.test(u[o]))return!1}catch(e){r.ignoredMessages=null,t.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!0}}var pe="3.0.0-beta.5",he="api.rollbar.com/api/1/item/",de="debug",ye="debug",ve="error";function me(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var be,ge=[].concat(function(t){return function(t){if(Array.isArray(t))return me(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return me(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?me(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","X-Rollbar-Access-Token","secret_key","secretKey","secretToken"]),["cc-number","card number","cardnumber","cardnum","ccnum","ccnumber","cc num","creditcardnumber","credit card number","newcreditcardnumber","new credit card","creditcardno","credit card no","card#","card #","cc-csc","cvc","cvc2","cvv2","ccv2","security code","card verification","name on credit card","name on card","nameoncard","cardholder","card holder","name des karteninhabers","ccname","card type","cardtype","cc type","cctype","payment type","expiration date","expirationdate","expdate","cc-exp","ccmonth","ccyear"]),we={scrubFields:ge};function ke(t){return ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ke(t)}function _e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_e(Object(r),!0).forEach((function(e){xe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Oe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ee(n.key),n)}}function xe(t,e,r){return(e=Ee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ee(t){var e=function(t,e){if("object"!=ke(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ke(e)?e:e+""}var je=null,Ie=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),vt.init({logLevel:e.logLevel||"error"}),this.options=C(Te,e,null,vt),this.options._configuredOptions=e,this.components=this.components||{};var o=this.components.telemeter,i=this.components.instrumenter;this.wrapGlobals=this.components.wrapGlobals,this.scrub=this.components.scrub;var a=this.components.truncation,s=this.components.tracing,u=this.components.replay,l=new Et(a),c=new pt(this.options,l,r,a);if(s&&(this.tracing=new s(Pe(),c,this.options),this.tracing.initSession()),o&&(this.telemeter=new o(this.options,this.tracing)),u&&"undefined"!=typeof window){var f=this.options.replay;this.replay=new u({tracing:this.tracing,telemeter:this.telemeter,options:f}),f.enabled&&f.autoStart&&this.replay.recorder.start()}this.client=n||new Q(this.options,c,vt,this.telemeter,this.tracing,this.replay,"browser");var h=Pe(),d="undefined"!=typeof document&&document;this.isChrome=h.chrome&&h.chrome.runtime,this.anonymousErrorsPending=0,function(t,e,r){t.addTransform(Vt).addTransform(Wt).addTransform(Bt).addTransform(Gt).addTransform(function(t){return function(e,r,n){var o={};t&&t.location&&(o.url=t.location.href,o.query_string=t.location.search);var i="$remote_ip";r.captureIp?!0!==r.captureIp&&(i+="_anonymize"):i=null,i&&(o.user_ip=i),Object.keys(o).length>0&&A(e,"data.request",o),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t)return n(null,e);var o=t.navigator||{},i=t.screen||{};A(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:o.userAgent,language:o.language,cookie_enabled:o.cookieEnabled,screen:{width:i.width,height:i.height}}}),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t||!t.navigator)return n(null,e);for(var o,i=[],a=t.navigator.plugins||[],s=0,u=a.length;s<u;++s)o=a[s],i.push({name:o.name,description:o.description});A(e,"data.client.javascript.plugins",i),n(null,e)}}(r)).addTransform($t).addTransform(ee).addTransform(te).addTransform(ne).addTransform((n=e.scrub,function(t,e,r){if(n){var o=e.scrubFields||[],i=e.scrubPaths||[];t.data=n(t.data,o,i)}r(null,t)})).addTransform(Yt).addTransform(re(vt)).addTransform(ie).addTransform(ae).addTransform(Kt);var n}(this.client.notifier,this,h),function(t){t.addPredicate(ue).addPredicate(se).addPredicate(function(t){return function(e,r){var n=!!e._isUncaught;delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{p(r.onSendCallback)&&r.onSendCallback(n,o,e)}catch(e){r.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(p(r.checkIgnore)&&r.checkIgnore(n,o,e))return!1}catch(e){r.checkIgnore=null,t.error("Error while calling custom checkIgnore(), removing",e)}return!0}}(vt)).addPredicate(function(t){return function(e,r){return!ce(e,r,"blocklist",t)}}(vt)).addPredicate(function(t){return function(e,r){return ce(e,r,"safelist",t)}}(vt)).addPredicate(fe(vt))}(this.client.queue),this.setupUnhandledCapture(),i&&(this.instrumenter=new i(this.options,this.client.telemeter,this,h,d),this.instrumenter.instrument()),this.setSessionAttributesFromOptions(e),this.rollbar=this}return function(t,e,r){return e&&Oe(t.prototype,e),r&&Oe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"global",value:function(t){return this.client.global(t),this}},{key:"configure",value:function(t,e){var r,n,o;t.logLevel&&vt.init({logLevel:t.logLevel}),this.setSessionAttributesFromOptions(t);var i=this.options,a={};return e&&(a={payload:e}),this.options=C(i,t,a,vt),this.options._configuredOptions=C(i._configuredOptions,t,a),null===(r=this.tracing)||void 0===r||r.configure(this.options),null===(n=this.replay)||void 0===n||n.configure(this.options),this.client.configure(this.options,e),null===(o=this.instrumenter)||void 0===o||o.configure(this.options),this.setupUnhandledCapture(),this}},{key:"lastError",value:function(){return this.client.lastError}},{key:"log",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}}},{key:"debug",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}}},{key:"info",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}}},{key:"warn",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}}},{key:"warning",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}}},{key:"error",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}}},{key:"critical",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}}},{key:"buildJsonPayload",value:function(t){return this.client.buildJsonPayload(t)}},{key:"sendJsonPayload",value:function(t){return this.client.sendJsonPayload(t)}},{key:"triggerDirectReplay",value:function(t){return this.triggerReplay(Se({type:"direct"},t))}},{key:"triggerReplay",value:function(t){return this.replay?this.replay.triggerReplay(t):null}},{key:"setupUnhandledCapture",value:function(){var t=Pe();this.unhandledExceptionsInitialized||(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(!function(t,e,r){if(t){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(t.onerror){for(n=t.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var o=function(){var r=Array.prototype.slice.call(arguments,0);!function(t,e,r,n){t._rollbarWrappedError&&(n[4]||(n[4]=t._rollbarWrappedError),n[5]||(n[5]=t._rollbarWrappedError._rollbarContext),t._rollbarWrappedError=null);var o=e.handleUncaughtException.apply(e,n);r&&r.apply(t,n),"anonymous"===o&&(e.anonymousErrorsPending+=1)}(t,e,n,r)};r&&(o._rollbarOldOnError=n),t.onerror=o}}(t,this),this.wrapGlobals&&this.options.wrapGlobalEventHandlers&&this.wrapGlobals(t,this),this.unhandledExceptionsInitialized=!0),this.unhandledRejectionsInitialized||(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&(!function(t,e,r){if(t){"function"==typeof t._rollbarURH&&t._rollbarURH.belongsToShim&&t.removeEventListener("unhandledrejection",t._rollbarURH);var n=function(t){var r,n,o;try{r=t.reason}catch(t){r=void 0}try{n=t.promise}catch(t){n="[unhandledrejection] error getting `promise` from event"}try{o=t.detail,!r&&o&&(r=o.reason,n=o.promise)}catch(t){}r||(r="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(r,n)};n.belongsToShim=r,t._rollbarURH=n,t.addEventListener("unhandledrejection",n)}}(t,this),this.unhandledRejectionsInitialized=!0)}},{key:"handleUncaughtException",value:function(t,e,r,n,o,i){if(this.options.captureUncaught||this.options.handleUncaughtExceptions){if(this.options.inspectAnonymousErrors&&this.isChrome&&null===o&&""===e)return"anonymous";var a,s=_(t,e,r,n,o,"onerror","uncaught exception",Jt);y(o)?(a=this._createItem([t,o,i]))._unhandledStackInfo=s:y(e)?(a=this._createItem([t,e,i]))._unhandledStackInfo=s:(a=this._createItem([t,i])).stackInfo=s,a.level=this.options.uncaughtErrorLevel,a._isUncaught=!0,this.client.log(a)}}},{key:"handleAnonymousErrors",value:function(){if(this.options.inspectAnonymousErrors&&this.isChrome){var t=this;try{Error.prepareStackTrace=function(e,r){if(t.options.inspectAnonymousErrors&&t.anonymousErrorsPending){if(t.anonymousErrorsPending-=1,!e)return;e._isAnonymous=!0,t.handleUncaughtException(e.message,null,null,null,e)}return e.stack}}catch(t){this.options.inspectAnonymousErrors=!1,this.error("anonymous error handler failed",t)}}}},{key:"handleUnhandledRejection",value:function(t,e){if(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections){var r="unhandled rejection was null or undefined!";if(t)if(t.message)r=t.message;else{var n=w(t);n.value&&(r=n.value)}var o,i=t&&t._rollbarContext||e&&e._rollbarContext;y(t)?o=this._createItem([r,t,i]):(o=this._createItem([r,t,i])).stackInfo=_(r,"",0,0,null,"unhandledrejection","",Jt),o.level=this.options.uncaughtErrorLevel,o._isUncaught=!0,o._originalArgs=o._originalArgs||[],o._originalArgs.push(e),this.client.log(o)}}},{key:"wrap",value:function(t,e,r){try{var n;if(n=p(e)?e:function(){return e||{}},!p(t))return t;if(t._isWrap)return t;if(!t._rollbar_wrapped&&(t._rollbar_wrapped=function(){r&&p(r)&&r.apply(this,arguments);try{return t.apply(this,arguments)}catch(r){var e=r;throw e&&window._rollbarWrappedError!==e&&(c(e,"string")&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=t.toString(),window._rollbarWrappedError=e),e}},t._rollbar_wrapped._isWrap=!0,t.hasOwnProperty))for(var o in t)t.hasOwnProperty(o)&&"_rollbar_wrapped"!==o&&(t._rollbar_wrapped[o]=t[o]);return t._rollbar_wrapped}catch(e){return t}}},{key:"captureEvent",value:function(){var t=function(t){for(var e,r,n,o,i=0,a=t.length;i<a;++i)switch(f(o=t[i])){case"string":!e&&I(E,o)?e=o:!n&&I(j,o)&&(n=o);break;case"object":r=o}return{type:e||"manual",metadata:r||{},level:n}}(arguments);return this.client.captureEvent(t.type,t.metadata,t.level)}},{key:"setSessionUser",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&this.tracing.session.setUser(t)}},{key:"setSessionAttributes",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&(t=Se({},t),this.tracing.session.setAttributes(t))}},{key:"setSessionAttributesFromOptions",value:function(t){var e,r,n,o,i,a=t.person||(null===(e=t.payload)||void 0===e?void 0:e.person);a&&this.setSessionUser(a);var s=(null===(r=t.client)||void 0===r||null===(r=r.javascript)||void 0===r?void 0:r.code_version)||t.codeVersion||t.code_version||(null===(n=t.payload)||void 0===n||null===(n=n.client)||void 0===n||null===(n=n.javascript)||void 0===n?void 0:n.code_version)||(null===(o=t.payload)||void 0===o?void 0:o.code_version)||(null===(i=t.payload)||void 0===i?void 0:i.codeVersion);this.setSessionAttributes({"rollbar.codeVersion":s,"rollbar.notifier.name":"rollbar-browser-js","rollbar.notifier.version":t.version})}},{key:"captureDomContentLoaded",value:function(t,e){return e||(e=new Date),this.client.captureDomContentLoaded(e)}},{key:"captureLoad",value:function(t,e){return e||(e=new Date),this.client.captureLoad(e)}},{key:"loadFull",value:function(){vt.info("Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.")}},{key:"_createItem",value:function(t){return x(t,vt,this)}}],[{key:"init",value:function(e,r){return je?je.global(e).configure(e):je=new t(e,r)}},{key:"setComponents",value:function(e){t.prototype.components=e}},{key:"callInstance",value:function(t,e){if(je)return je[t].apply(je,e);var r="Rollbar is not initialized";vt.error(r);var n=function(t){for(var e=0,r=t.length;e<r;++e)if(p(t[e]))return t[e];return}(e);n&&n(new Error(r))}}])}();function Pe(){return"undefined"!=typeof window&&window||"undefined"!=typeof self&&self}be=Ie,xe(Ie,"global",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("global",e)})),xe(Ie,"configure",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("configure",e)})),xe(Ie,"lastError",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("lastError",e)})),xe(Ie,"log",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("log",e)})),xe(Ie,"debug",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("debug",e)})),xe(Ie,"info",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("info",e)})),xe(Ie,"warn",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("warn",e)})),xe(Ie,"warning",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("warning",e)})),xe(Ie,"error",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("error",e)})),xe(Ie,"critical",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("critical",e)})),xe(Ie,"buildJsonPayload",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("buildJsonPayload",e)})),xe(Ie,"sendJsonPayload",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("sendJsonPayload",e)})),xe(Ie,"wrap",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("wrap",e)})),xe(Ie,"captureEvent",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return be.callInstance("captureEvent",e)}));var Te={environment:"unknown",version:pe,scrubFields:we.scrubFields,logLevel:de,reportLevel:ye,uncaughtErrorLevel:ve,endpoint:he,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!0,captureIp:!0,inspectAnonymousErrors:!0,ignoreDuplicateErrors:!0,wrapGlobalEventHandlers:!1,replay:{enabled:!1,autoStart:!0,triggerDefaults:{samplingRatio:1,preDuration:300,postDuration:5},triggers:[{type:"occurrence",level:["error","critical"]}],debug:{logErrors:!0,logEmits:!1},inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,maskInputOptions:{password:!0,email:!1,tel:!1,text:!1,color:!1,date:!1,"datetime-local":!1,month:!1,number:!1,range:!1,search:!1,time:!1,url:!1,week:!1},maskAllInputs:!1,blockClass:"rb-block",maskTextClass:"rb-mask",ignoreClass:"rb-ignore",slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}},tracing:{enabled:!1,endpoint:"api.rollbar.com/api/1/session/"}},Ae=Ie,Re=["otelAttributes"];function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Le(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ne(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Le(Object(r),!0).forEach((function(e){qe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function qe(t,e,r){return(e=Me(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function De(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Me(n.key),n)}}function Me(t){var e=function(t,e){if("object"!=Ce(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ce(e)?e:e+""}var Ue=100;function He(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}var Fe=function(){return function(t,e,r){return e&&De(t.prototype,e),r&&De(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=[],this.options=a(e);var o=this.options.maxTelemetryEvents||Ue;this.maxQueueSize=Math.max(0,Math.min(o,Ue)),this.tracing=r,this.telemetrySpan=null===(n=this.tracing)||void 0===n?void 0:n.startSpan("rollbar-telemetry",{})}),[{key:"configure",value:function(t){var e=this.options;this.options=a(e,t);var r=this.options.maxTelemetryEvents||Ue,n=Math.max(0,Math.min(r,Ue)),o=0;this.queue.length>n&&(o=this.queue.length-n),this.maxQueueSize=n,this.queue.splice(0,o)}},{key:"copyEvents",value:function(){var t=Array.prototype.slice.call(this.queue,0);if(p(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t=t.filter((function(t){return"connectivity"!==t.type})),t=t.map((function(t){t.otelAttributes;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,Re);return e})),t}},{key:"exportTelemetrySpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.telemetrySpan&&(this.telemetrySpan.end(t),this.telemetrySpan=this.tracing.startSpan("rollbar-telemetry",{}))}},{key:"capture",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a={level:Je(t,r),type:t,timestamp_ms:o||R(),body:e,source:"client"};n&&(a.uuid=n),i&&(a.otelAttributes=i);try{if(p(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch(t){this.options.filterTelemetry=null}return this.push(a),a}},{key:"captureEvent",value:function(t,e,r,n){return this.capture(t,e,r,n)}},{key:"captureError",value:function(t,e,r,n){var o,i=t.message||String(t),a={message:i};t.stack&&(a.stack=t.stack);var s={message:i,level:e,type:"error",uuid:r};return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-occurrence-event",s,He(n)),this.capture("error",a,e,r,n,s)}},{key:"captureLog",value:function(t,e,r,n){var o,i,a=null;r?(a={message:t,level:e,type:"message",uuid:r},null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-occurrence-event",a,He(n))):(a={message:t,level:e},null===(i=this.telemetrySpan)||void 0===i||i.addEvent("rollbar-log-event",a,He(n)));return this.capture("log",{message:t},e,r,n,a)}},{key:"captureNetwork",value:function(t,e,r,n){var o,i;e=e||"xhr",t.subtype=t.subtype||e,n&&(t.request=n);var a=this.levelFromStatus(t.status_code),s=1e6*(t.end_time_ms||0),u={type:t.subtype,method:t.method,url:t.url,statusCode:t.status_code,"request.headers":JSON.stringify(t.request_headers||{}),"response.headers":JSON.stringify((null===(o=t.response)||void 0===o?void 0:o.headers)||{}),"response.timeUnixNano":s.toString()};return null===(i=this.telemetrySpan)||void 0===i||i.addEvent("rollbar-network-event",u,He(t.start_time_ms)),this.capture("network",t,a,r,t.start_time_ms,u)}},{key:"levelFromStatus",value:function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"}},{key:"captureDom",value:function(t,e,r,n,o){var i={subtype:t,element:e};return void 0!==r&&(i.value=r),void 0!==n&&(i.checked=n),this.capture("dom",i,"info",o)}},{key:"captureInput",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.value,a=t.timestamp,s="rollbar-input-event",u={type:s,subtype:r,element:o,value:i},l={type:r,isSynthetic:n,element:o,value:i,endTimeUnixNano:He(a)},c=this._getRepeatedEvent(s,l);return c?this._updateRepeatedEvent(c,l,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,l,He(a)),this.capture("dom",u,"info",null,a,l))}},{key:"captureClick",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-click-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o,endTimeUnixNano:He(i)},l=this._getRepeatedEvent(a,u);return l?this._updateRepeatedEvent(l,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,He(i)),this.capture("dom",s,"info",null,i,u))}},{key:"_getRepeatedEvent",value:function(t,e){var r=this._lastEvent(this.queue);if(r&&r.body.type===t&&r.otelAttributes.target===e.target)return r}},{key:"_updateRepeatedEvent",value:function(t,e,r){var n=Math.max(r-t.timestamp_ms,1);t.body.value=e.value,t.otelAttributes.value=e.value,t.otelAttributes.height=e.height,t.otelAttributes.width=e.width,t.otelAttributes.textZoomRatio=e.textZoomRatio,t.otelAttributes.endTimeUnixNano=He(r),t.otelAttributes.durationUnixNano=He(n),t.otelAttributes.count=(t.otelAttributes.count||1)+1,t.otelAttributes.rate=t.otelAttributes.count/(n/1e3)}},{key:"_lastEvent",value:function(t){return t.length>0?t[t.length-1]:null}},{key:"captureFocus",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-focus-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,He(i)),this.capture("dom",s,"info",null,i,u)}},{key:"captureResize",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.width,i=t.height,a=t.textZoomRatio,s=t.timestamp,u="rollbar-resize-event",l={type:u,subtype:r,width:o,height:i,textZoomRatio:a},c={type:r,isSynthetic:n,width:o,height:i,textZoomRatio:a},f=this._getRepeatedEvent(u,c);return f?this._updateRepeatedEvent(f,c,s):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(u,c,He(s)),this.capture("dom",l,"info",null,s,c))}},{key:"captureDragDrop",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.dropEffect,a=t.effectAllowed,s=t.kinds,u=t.mediaTypes,l=t.timestamp,c="rollbar-dragdrop-event",f={type:c,subtype:r,isSynthetic:n},p={type:r,isSynthetic:n};return"dragstart"===r&&(f=Ne(Ne({},f),{},{element:o,dropEffect:i,effectAllowed:a}),p=Ne(Ne({},p),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(f=Ne(Ne({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),p=Ne(Ne({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(c,p,He(l)),this.capture("dom",f,"info",null,l,p)}},{key:"captureNavigation",value:function(t,e,r,n){var o;return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-navigation-event",{"previous.url.full":t,"url.full":e},He(n)),this.capture("navigation",{from:t,to:e},"info",r,n)}},{key:"captureDomContentLoaded",value:function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())}},{key:"captureLoad",value:function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())}},{key:"captureConnectivityChange",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.timestamp,i="rollbar-connectivity-event",a={type:i,subtype:r},s={type:r,isSynthetic:n};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(i,s,He(o)),this.capture("connectivity",a,"info",null,o,s)}},{key:"_captureRollbarItem",value:function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0}},{key:"push",value:function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()}}])}();function Je(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}var Ve=Fe;function We(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function Be(t){this.map={},t instanceof Be?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}Be.prototype.append=function(t,e){t=We(t),e=function(t){return"string"!=typeof t&&(t=String(t)),t}(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},Be.prototype.get=function(t){return t=We(t),this.has(t)?this.map[t]:null},Be.prototype.has=function(t){return this.map.hasOwnProperty(We(t))},Be.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},Be.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),function(t){return{next:function(){var e=t.shift();return{done:void 0===e,value:e}}}}(t)};var Ge=function(t){return"undefined"==typeof Headers?new Be(t):new Headers(t)};var $e=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};var ze=function(t,e,r){var n,o,i,a,s=c(t,"object"),u=c(t,"array"),l=[];if(r=r||{obj:[],mapped:[]},s){if(a=r.obj.indexOf(t),s&&-1!==a)return r.mapped[a]||r.obj[a];r.obj.push(t),a=r.obj.length-1}if(s)for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&l.push(n);else if(u)for(i=0;i<t.length;++i)l.push(i);var f=s?{}:[],p=!0;for(i=0;i<l.length;++i)o=t[n=l[i]],f[n]=e(n,o,r),p=p&&f[n]===t[n];return s&&!p&&(r.mapped[a]=f),p?t:f};function Xe(t,e){var r=e.split("."),n=r.length-1;try{for(var o=0;o<=n;++o)o<n?t=t[r[o]]:t[r[o]]="********"}catch(t){}}var Ze=function(t,e,r){if(e=e||[],r)for(var n=0;n<r.length;++n)Xe(t,r[n]);var o=function(t){for(var e,r=[],n=0;n<t.length;++n)e="^\\[?(%5[bB])?"+t[n]+"\\[?(%5[bB])?\\]?(%5[dD])?$",r.push(new RegExp(e,"i"));return r}(e),i=function(t){for(var e,r=[],n=0;n<t.length;++n)e="\\[?(%5[bB])?"+t[n]+"\\[?(%5[bB])?\\]?(%5[dD])?",r.push(new RegExp("("+e+"=)([^&\\n]+)","igm"));return r}(e);function a(t,e){return e+"********"}return ze(t,(function t(e,r,n){var s=function(t,e){var r;for(r=0;r<o.length;++r)if(o[r].test(t)){e="********";break}return e}(e,r);return s===r?c(r,"object")||c(r,"array")?ze(r,t,n):function(t){var e;if(c(t,"string"))for(e=0;e<i.length;++e)t=t.replace(i[e],a);return t}(s):s}))};function Qe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ke(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ke(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ye(t){return function(t){for(var e,r,n=[],o=0,i=t.length-1;i>=0;i--){if(e=tr(t[i]),r=o+3*n.length+e.length,i<t.length-1&&r>=83){n.unshift("...");break}n.unshift(e),o+=e.length}return n.join(" > ")}(function(t){for(var e,r=[],n=0;t&&n<5&&"html"!==(e=er(t)).tagName;n++)r.unshift(e),t=t.parentNode;return r}(t))}function tr(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));for(var r=0;r<t.attributes.length;r++)e.push("["+t.attributes[r].key+'="'+t.attributes[r].value+'"]');return e.join("")}function er(t){if(!t||!t.tagName)return null;var e,r,n,o,i={};i.tagName=t.tagName.toLowerCase(),t.id&&(i.id=t.id),(e=t.className)&&"string"==typeof e&&(i.classes=e.split(/\s+/));var a=["type","name","title","alt"];for(i.attributes=[],o=0;o<a.length;o++)r=a[o],(n=t.getAttribute(r))&&i.attributes.push({key:r,value:n});return i}function rr(t){return rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rr(t)}function nr(t){return function(t){if(Array.isArray(t))return ur(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||sr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ir(n.key),n)}}function ir(t){var e=function(t,e){if("object"!=rr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=rr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==rr(e)?e:e+""}function ar(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=sr(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function sr(t,e){if(t){if("string"==typeof t)return ur(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ur(t,e):void 0}}function ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var lr={network:!0,networkResponseHeaders:!1,networkResponseBody:!1,networkRequestHeaders:!1,networkRequestBody:!1,networkErrorOnHttp5xx:!1,networkErrorOnHttp4xx:!1,networkErrorOnHttp0:!1,log:!0,dom:!0,navigation:!0,connectivity:!0,contentSecurityPolicy:!0,errorOnContentSecurityPolicy:!1};function cr(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function fr(t){var e,r=[],n=ar(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return function(t){var e=function(t){if(!t||!t.attributes)return null;var e,r=ar(t.attributes);try{for(r.s();!(e=r.n()).done;){var n=e.value;if("name"===n.key)return n.value}}catch(t){r.e(t)}finally{r.f()}return null}(t);if(!e)return!1;for(var n=0,o=r;n<o.length;n++){if(o[n].test(e))return!0}return!1}}var pr=function(){return function(t,e,r){return e&&or(t.prototype,e),r&&or(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(e=ir(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(this,"deinstrumentConnectivity",(function(){this.removeListeners("connectivity")})),this.options=e;var s=e.autoInstrument;!1===e.enabled||!1===s?this.autoInstrument={}:(c(s,"object")||(s=lr),this.autoInstrument=a(lr,s)),this.configureScrubbing(),this.telemeter=r,this.rollbar=n,this.diagnostic=n.client.notifier.diagnostic,this._window=o||{},this._document=i||{},this.replacements={network:[],log:[],navigation:[],connectivity:[]},this.eventRemovers={dom:[],connectivity:[],contentsecuritypolicy:[]},this._location=this._window.location,this._lastHref=this._location&&this._location.href}),[{key:"configureScrubbing",value:function(){var t,e,r,n,o,i,a,s,u,l,c=this.options;this.scrubTelemetryInputs=!!(null!==(t=c.scrubTelemetryInputs)&&void 0!==t?t:null===(e=c.replay)||void 0===e?void 0:e.maskAllInputs),this.telemetryScrubber=c.telemetryScrubber,this.defaultValueScrubber=fr(c.scrubFields),this.maskInputFn=null===(r=c.replay)||void 0===r?void 0:r.maskInputFn,this.maskInputOptions=(null===(n=c.replay)||void 0===n?void 0:n.maskInputOptions)||{},this.scrubClasses=[null===(o=c.replay)||void 0===o?void 0:o.blockClass,null===(i=c.replay)||void 0===i?void 0:i.ignoreClass,null===(a=c.replay)||void 0===a?void 0:a.maskTextClass].filter(Boolean),this.scrubSelectors=[null===(s=c.replay)||void 0===s?void 0:s.blockSelector,null===(u=c.replay)||void 0===u?void 0:u.ignoreSelector,null===(l=c.replay)||void 0===l?void 0:l.maskTextSelector].filter(Boolean)}},{key:"configure",value:function(t){this.options=a(this.options,t);var e=t.autoInstrument,r=a(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(c(e,"object")||(e=lr),this.autoInstrument=a(lr,e)),this.configureScrubbing(),this.instrument(r)}},{key:"instrument",value:function(t){!this.autoInstrument.network||t&&t.network?!this.autoInstrument.network&&t&&t.network&&this.deinstrumentNetwork():this.instrumentNetwork(),!this.autoInstrument.log||t&&t.log?!this.autoInstrument.log&&t&&t.log&&this.deinstrumentConsole():this.instrumentConsole(),!this.autoInstrument.dom||t&&t.dom?!this.autoInstrument.dom&&t&&t.dom&&this.deinstrumentDom():this.instrumentDom(),!this.autoInstrument.navigation||t&&t.navigation?!this.autoInstrument.navigation&&t&&t.navigation&&this.deinstrumentNavigation():this.instrumentNavigation(),!this.autoInstrument.connectivity||t&&t.connectivity?!this.autoInstrument.connectivity&&t&&t.connectivity&&this.deinstrumentConnectivity():this.instrumentConnectivity(),!this.autoInstrument.contentSecurityPolicy||t&&t.contentSecurityPolicy?!this.autoInstrument.contentSecurityPolicy&&t&&t.contentSecurityPolicy&&this.deinstrumentContentSecurityPolicy():this.instrumentContentSecurityPolicy()}},{key:"deinstrumentNetwork",value:function(){cr(this.replacements,"network")}},{key:"instrumentNetwork",value:function(){var t=this;function e(e,r){e in r&&p(r[e])&&$e(r,e,(function(e){return t.rollbar.wrap(e)}))}if("XMLHttpRequest"in this._window){var r=this._window.XMLHttpRequest.prototype;$e(r,"open",(function(t){return function(e,r){var n=hr(r);return(c(r,"string")||n)&&(r=n?r.toString():r,this.__rollbar_xhr?(this.__rollbar_xhr.method=e,this.__rollbar_xhr.url=r,this.__rollbar_xhr.status_code=null,this.__rollbar_xhr.start_time_ms=R(),this.__rollbar_xhr.end_time_ms=null):this.__rollbar_xhr={method:e,url:r,status_code:null,start_time_ms:R(),end_time_ms:null}),t.apply(this,arguments)}}),this.replacements,"network"),$e(r,"setRequestHeader",(function(e){return function(r,n){return this.__rollbar_xhr||(this.__rollbar_xhr={}),c(r,"string")&&c(n,"string")&&(t.autoInstrument.networkRequestHeaders&&(this.__rollbar_xhr.request_headers||(this.__rollbar_xhr.request_headers={}),this.__rollbar_xhr.request_headers[r]=n),"content-type"===r.toLowerCase()&&(this.__rollbar_xhr.request_content_type=n)),e.apply(this,arguments)}}),this.replacements,"network"),$e(r,"send",(function(r){return function(n){var o=this;function i(){if(o.__rollbar_xhr&&(null===o.__rollbar_xhr.status_code&&(o.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(o.__rollbar_xhr.request=n),o.__rollbar_event=t.captureNetwork(o.__rollbar_xhr,"xhr",void 0)),o.readyState<2&&(o.__rollbar_xhr.start_time_ms=R()),o.readyState>3)){var e=R();o.__rollbar_xhr.end_time_ms=e;var r=null;if(o.__rollbar_xhr.response_content_type=o.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var i=t.autoInstrument.networkResponseHeaders;r={};try{var a;if(!0===i){var s=o.getAllResponseHeaders();if(s){var u,l,c,f=ar(s.trim().split(/[\r\n]+/));try{for(f.s();!(c=f.n()).done;){a=(u=c.value.split(": ")).shift(),l=u.join(": "),r[a]=l}}catch(t){f.e(t)}finally{f.f()}}}else{var p,h=ar(i);try{for(h.s();!(p=h.n()).done;){var d=p.value;r[d]=o.getResponseHeader(d)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){}}var y=null;if(t.autoInstrument.networkResponseBody)try{y=o.responseText}catch(t){}var v=null;(y||r)&&(v={},y&&(t.isJsonContentType(o.__rollbar_xhr.response_content_type)?v.body=t.scrubJson(y):v.body=y),r&&(v.headers=r)),v&&(o.__rollbar_xhr.response=v);try{var m=o.status;m=1223===m?204:m,o.__rollbar_xhr.status_code=m,t.addOtelNetworkResponse(o.__rollbar_event,e,m),o.__rollbar_event.level=t.telemeter.levelFromStatus(m),t.errorOnHttpStatus(o.__rollbar_xhr)}catch(t){}}}return e("onload",o),e("onerror",o),e("onprogress",o),"onreadystatechange"in o&&p(o.onreadystatechange)?$e(o,"onreadystatechange",(function(e){return t.rollbar.wrap(e,void 0,i)})):o.onreadystatechange=i,o.__rollbar_xhr&&t.trackHttpErrors()&&(o.__rollbar_xhr.stack=(new Error).stack),r.apply(this,arguments)}}),this.replacements,"network")}"fetch"in this._window&&$e(this._window,"fetch",(function(e){return function(r,n){var o,i=Array.prototype.slice.call(arguments),a=i[0],s="GET",u=hr(a);c(a,"string")||u?o=u?a.toString():a:a&&(o=a.url,a.method&&(s=a.method)),i[1]&&i[1].method&&(s=i[1].method);var l={method:s,url:o,status_code:null,start_time_ms:R(),end_time_ms:null};if(i[1]&&i[1].headers){var f=Ge(i[1].headers);l.request_content_type=f.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(l.request_headers=t.fetchHeaders(f,t.autoInstrument.networkRequestHeaders))}t.autoInstrument.networkRequestBody&&(i[1]&&i[1].body?l.request=i[1].body:i[0]&&!c(i[0],"string")&&i[0].body&&(l.request=i[0].body));var p=t.captureNetwork(l,"fetch",void 0);return t.trackHttpErrors()&&(l.stack=(new Error).stack),e.apply(this,i).then((function(e){var r=R();l.end_time_ms=r,l.status_code=e.status,t.addOtelNetworkResponse(p,r,e.status),l.response_content_type=e.headers.get("Content-Type");var n=null;t.autoInstrument.networkResponseHeaders&&(n=t.fetchHeaders(e.headers,t.autoInstrument.networkResponseHeaders));var o=null;return t.autoInstrument.networkResponseBody&&"function"==typeof e.text&&(o=e.clone().text()),(n||o)&&(l.response={},o&&("function"==typeof o.then?o.then((function(e){e&&t.isJsonContentType(l.response_content_type)?l.response.body=t.scrubJson(e):l.response.body=e})):l.response.body=o),n&&(l.response.headers=n)),t.errorOnHttpStatus(l),e}))}}),this.replacements,"network")}},{key:"captureNetwork",value:function(t,e,r){return t.request&&this.isJsonContentType(t.request_content_type)&&(t.request=this.scrubJson(t.request)),this.telemeter.captureNetwork(t,e,r)}},{key:"isJsonContentType",value:function(t){return!!(t&&c(t,"string")&&t.toLowerCase().includes("json"))}},{key:"addOtelNetworkResponse",value:function(t,e,r){t.otelAttributes&&(t.otelAttributes["response.timeUnixNano"]=(1e6*e).toString(),t.otelAttributes.statusCode=r)}},{key:"scrubJson",value:function(t){return JSON.stringify(Ze(JSON.parse(t),this.options.scrubFields))}},{key:"fetchHeaders",value:function(t,e){var r={};try{if(!0===e){if("function"==typeof t.entries)for(var n=t.entries(),o=n.next();!o.done;)r[o.value[0]]=o.value[1],o=n.next()}else{var i,a=ar(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;r[s]=t.get(s)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){}return r}},{key:"trackHttpErrors",value:function(){return this.autoInstrument.networkErrorOnHttp5xx||this.autoInstrument.networkErrorOnHttp4xx||this.autoInstrument.networkErrorOnHttp0}},{key:"errorOnHttpStatus",value:function(t){var e=t.status_code;if(e>=500&&this.autoInstrument.networkErrorOnHttp5xx||e>=400&&this.autoInstrument.networkErrorOnHttp4xx||0===e&&this.autoInstrument.networkErrorOnHttp0){var r=new Error("HTTP request failed with Status "+e);r.stack=t.stack,this.rollbar.error(r,{skipFrames:1})}}},{key:"deinstrumentConsole",value:function(){for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]}},{key:"instrumentConsole",value:function(){var t;if(null!==(t=this._window)&&void 0!==t&&null!==(t=t.console)&&void 0!==t&&t.log){var e=this,r=this._window.console;try{for(var n=0,o=["debug","info","warn","error","log"];n<o.length;n++){i(o[n])}}catch(t){this.diagnostic.instrumentConsole={error:t.message}}}function i(t){var n=r[t],o=r,i="warn"===t?"warning":t;r[t]=function(){var t=Array.prototype.slice.call(arguments),r=function(t){var e,r,n,o=[];for(e=0,r=t.length;e<r;++e){switch(f(n=t[e])){case"object":(n=(n=w(n)).error||n.value).length>500&&(n=n.substr(0,497)+"...");break;case"null":n="null";break;case"undefined":n="undefined";break;case"symbol":n=n.toString()}o.push(n)}return o.join(" ")}(t);e.telemeter.captureLog(r,i,null,R()),n&&Function.prototype.apply.call(n,o,t)},e.replacements.log.push([t,n])}}},{key:"deinstrumentDom",value:function(){this.removeListeners("dom")}},{key:"instrumentDom",value:function(){var t=this;this.addListener("dom",this._window,["click","dblclick","contextmenu"],(function(e){return t.handleEvent("click",e)})),this.addListener("dom",this._window,["dragstart","dragend","dragenter","dragleave","drop"],(function(e){return t.handleEvent("dragdrop",e)})),this.addListener("dom",this._window,["blur","focus"],(function(e){return t.handleEvent("focus",e)})),this.addListener("dom",this._window,["submit","invalid"],(function(e){return t.handleEvent("form",e)})),this.addListener("dom",this._window,["input","change"],(function(e){return t.handleEvent("input",e)})),this.addListener("dom",this._window,["resize"],(function(e){return t.handleEvent("resize",e)})),this.addListener("dom",this._document,["DOMContentLoaded"],(function(e){return t.handleEvent("contentLoaded",e)}))}},{key:"handleEvent",value:function(t,e){try{return{click:this.handleClick,dragdrop:this.handleDrag,focus:this.handleFocus,form:this.handleForm,input:this.handleInput,resize:this.handleResize,contentLoaded:this.handleContentLoaded}[t].call(this,e)}catch(r){console.log("".concat(t," handler error"),e,r,r.stack)}}},{key:"handleContentLoaded",value:function(t){this.rollbar.triggerReplay({type:"navigation",path:new URL(this._location.href).pathname})}},{key:"handleClick",value:function(t){var e,r=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase();["input","select","textarea"].includes(r)||this.telemeter.captureClick({type:t.type,isSynthetic:!t.isTrusted,element:Ye(t.target),timestamp:R()})}},{key:"handleFocus",value:function(t){var e,r=t.type,n=null!==(e=t.target)&&void 0!==e&&e.window?"window":Ye(t.target);this.telemeter.captureFocus({type:r,isSynthetic:!t.isTrusted,element:n,timestamp:R()})}},{key:"handleForm",value:function(t){var e,r=t.type,n=null!==(e=t.target)&&void 0!==e&&e.window?"window":Ye(t.target);console.log("handleForm",r,n,t)}},{key:"handleResize",value:function(t){var e=window.screen.width/window.innerWidth;this.telemeter.captureResize({type:t.type,isSynthetic:!t.isTrusted,width:window.innerWidth,height:window.innerHeight,textZoomRatio:e,timestamp:R()})}},{key:"handleDrag",value:function(t){var e,r,n,o,i,a,s=t.type;if("drop"===s){e=[],r=[];var u,l=ar([].concat(nr(t.dataTransfer.files),nr(t.dataTransfer.items)));try{for(l.s();!(u=l.n()).done;){var c=u.value;c.kind&&c.type&&(e.push(c.kind),r.push(c.type))}}catch(t){l.e(t)}finally{l.f()}}["drop","dragstart"].includes(s)&&(n=null===(i=t.dataTransfer)||void 0===i?void 0:i.dropEffect,o=null===(a=t.dataTransfer)||void 0===a?void 0:a.effectAllowed);this.telemeter.captureDragDrop({type:s,isSynthetic:!t.isTrusted,element:Ye(t.target),dropEffect:n,effectAllowed:o,kinds:JSON.stringify(e),mediaTypes:JSON.stringify(r),timestamp:R()})}},{key:"scrubInputValue",value:function(t,e,r,n){var o="******";if("password"===n)return o;if(this.scrubTelemetryInputs)return o;var i=er(e);if(this.telemetryScrubber){if(this.telemetryScrubber(i))return o}else if(this.defaultValueScrubber(i))return o;return function(t,e,r){try{var n,o=Qe(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("string"==typeof i){if(t.classList.contains(i))return!0}else{var a,s=Qe(t.classList);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(i.test(u))return!0}}catch(t){s.e(t)}finally{s.f()}}}}catch(t){o.e(t)}finally{o.f()}var l,c=Qe(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(t.matches(f))return!0}}catch(t){c.e(t)}finally{c.f()}}catch(t){}return!1}(e,this.scrubClasses,this.scrubSelectors)?o:this.maskInputOptions[r.toLowerCase()]||this.maskInputOptions[n]?this.maskInputFn?this.maskInputFn(t,e):o:t}},{key:"handleInput",value:function(t){var e,r,n,o,i=t.type,a=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase(),s=null===(r=t.target)||void 0===r?void 0:r.value,u=(null===(n=t.target)||void 0===n||null===(n=n.attributes)||void 0===n||null===(n=n.type)||void 0===n?void 0:n.value)||(null===(o=t.target)||void 0===o?void 0:o.type);switch(void 0!==s&&(s=this.scrubInputValue(s,t.target,a,u)),i){case"input":if(["radio","checkbox"].includes(u))return;["select","textarea"].includes(a)&&(u=a);break;case"change":if(!["radio","checkbox"].includes(u))return;var l;if("checkbox"===u)s=null===(l=t.target)||void 0===l?void 0:l.checked}this.telemeter.captureInput({type:u,isSynthetic:!t.isTrusted,element:Ye(t.target),value:s,timestamp:R()})}},{key:"deinstrumentNavigation",value:function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&cr(this.replacements,"navigation")}},{key:"instrumentNavigation",value:function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;$e(this._window,"onpopstate",(function(t){return function(){var r=e._location.href;e.handleUrlChange(e._lastHref,r),t&&t.apply(this,arguments)}}),this.replacements,"navigation"),$e(this._window.history,"pushState",(function(t){return function(){var r=arguments.length>2?arguments[2]:void 0;return r&&e.handleUrlChange(e._lastHref,r+""),t.apply(this,arguments)}}),this.replacements,"navigation")}}},{key:"handleUrlChange",value:function(t,e){var r=jt(this._location.href),n=jt(e),o=jt(t);this._lastHref=e,r.protocol===n.protocol&&r.host===n.host&&(e=n.path+(n.hash||"")),r.protocol===o.protocol&&r.host===o.host&&(t=o.path+(o.hash||"")),this.telemeter.captureNavigation(t,e,null,R());this.rollbar.triggerReplay({type:"navigation",path:e})}},{key:"instrumentConnectivity",value:function(){var t=this;this.addListener("connectivity",this._window,["online","offline"],(function(e){return t.handleConnectivity(e)}))}},{key:"handleConnectivity",value:function(t){var e=t.type;this.telemeter.captureConnectivityChange({type:e,isSynthetic:!t.isTrusted,timestamp:R()})}},{key:"handleCspEvent",value:function(t){var e="Security Policy Violation: blockedURI: "+t.blockedURI+", violatedDirective: "+t.violatedDirective+", effectiveDirective: "+t.effectiveDirective+", ";t.sourceFile&&(e+="location: "+t.sourceFile+", line: "+t.lineNumber+", col: "+t.columnNumber+", "),e+="originalPolicy: "+t.originalPolicy,this.telemeter.captureLog(e,"error",null,R()),this.handleCspError(e)}},{key:"handleCspError",value:function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)}},{key:"deinstrumentContentSecurityPolicy",value:function(){this.removeListeners("contentsecuritypolicy")}},{key:"instrumentContentSecurityPolicy",value:function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,["securitypolicyviolation"],t)}}},{key:"addListener",value:function(t,e,r,n){var o=this;if(e.addEventListener){var i,a=ar(r);try{var s=function(){var r=i.value,a={capture:!0,passive:!0};e.addEventListener(r,n,a,!0),o.eventRemovers[t].push((function(){e.removeEventListener(r,n,a)}))};for(a.s();!(i=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}}}},{key:"removeListeners",value:function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()}}])}();function hr(t){return"undefined"!=typeof URL&&t instanceof URL}var dr=pr;function yr(t,e,r){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var o=function(e,r,o){n.call(this,e,t.wrap(r),o)};o._rollbarOldAdd=n,o.belongsToShim=r,e.addEventListener=o;for(var i=e.removeEventListener;i._rollbarOldRemove&&i.belongsToShim;)i=i._rollbarOldRemove;var a=function(t,e,r){i.call(this,t,e&&e._rollbar_wrapped||e,r)};a._rollbarOldRemove=i,a.belongsToShim=r,e.removeEventListener=a}}var vr=function(t,e,r){if(t){var n,o,i="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(n=0;n<i.length;++n)t[o=i[n]]&&t[o].prototype&&yr(e,t[o].prototype,r)}};function mr(t,e){return[t,w(t,e)]}function br(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function gr(t,e,r){r=void 0===r?30:r;var n,o=t.data.body;if(o.trace_chain)for(var i=o.trace_chain,a=0;a<i.length;a++)n=br(n=i[a].frames,r),i[a].frames=n;else o.trace&&(n=br(n=o.trace.frames,r),o.trace.frames=n);return[t,w(t,e)]}function wr(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function kr(t,e,r){return e=ze(e,(function e(r,n,o){switch(f(n)){case"string":return wr(t,n);case"object":case"array":return ze(n,e,o);default:return n}})),[e,w(e,r)]}function _r(t){return t.exception&&(delete t.exception.description,t.exception.message=wr(255,t.exception.message)),t.frames=br(t.frames,1),t}function Sr(t,e){var r=t.data.body;if(r.trace_chain)for(var n=r.trace_chain,o=0;o<n.length;o++)n[o]=_r(n[o]);else r.trace&&(r.trace=_r(r.trace));return[t,w(t,e)]}function Or(t,e){return function(t){for(var e=0,r=t.length,n=0;n<r;n++){var o=t.charCodeAt(n);o<128?e+=1:o<2048?e+=2:o<65536&&(e+=3)}return e}(t)>e}var xr={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[mr,gr,kr.bind(null,1024),kr.bind(null,512),kr.bind(null,256),Sr];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!Or(i.value,r))return i;return i},raw:mr,truncateFrames:gr,truncateStrings:kr,maybeTruncateValue:wr};function Er(t){return Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er(t)}function jr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ir(n.key),n)}}function Ir(t){var e=function(t,e){if("object"!=Er(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Er(e)?e:e+""}var Pr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._currentContext=e?new Map(e):new Map}return function(t,e,r){return e&&jr(t.prototype,e),r&&jr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"getValue",value:function(t){return this._currentContext.get(t)}},{key:"setValue",value:function(e,r){var n=new t(this._currentContext);return n._currentContext.set(e,r),n}},{key:"deleteValue",value:function(e){var r=new t(self._currentContext);return r._currentContext.delete(e),r}}])}(),Tr=new Pr;function Ar(t){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(t)}function Rr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Cr(n.key),n)}}function Cr(t){var e=function(t,e){if("object"!=Ar(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ar(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ar(e)?e:e+""}var Lr=function(){return function(t,e,r){return e&&Rr(t.prototype,e),r&&Rr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.currentContext=Tr}),[{key:"active",value:function(){return this.currentContext}},{key:"enterContext",value:function(t){var e=this.currentContext;return this.currentContext=t||Tr,e}},{key:"exitContext",value:function(t){return this.currentContext=t,this.currentContext}},{key:"with",value:function(t,e,r){var n=this.enterContext(t);try{for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return e.call.apply(e,[r].concat(i))}finally{this.exitContext(n)}}}])}();var Nr={gen:function(){var t=new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:16);return crypto.getRandomValues(t),Array.from(t,(function(t){return t.toString(16).padStart(2,"0")})).join("")}};function qr(t){return qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qr(t)}function Dr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dr(Object(r),!0).forEach((function(e){Hr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ur(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fr(n.key),n)}}function Hr(t,e,r){return(e=Fr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fr(t){var e=function(t,e){if("object"!=qr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=qr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==qr(e)?e:e+""}var Jr="RollbarSession",Vr=function(){return function(t,e,r){return e&&Ur(t.prototype,e),r&&Ur(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Hr(this,"_attributes",void 0),this.options=r,this.tracing=e,this.window=e.window,this.session=null,this._attributes={}}),[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.session||(this.getSession()||this.createSession(),this.initSessionAttributes(t)),this}},{key:"getSession",value:function(){try{var t=this.window.sessionStorage.getItem(Jr);if(!t)return null;this.session=JSON.parse(t)}catch(t){return null}return this}},{key:"createSession",value:function(){return this.session={id:Nr.gen(),createdAt:Date.now()},this.setSession(this.session)}},{key:"setSession",value:function(t){var e=JSON.stringify(t);try{this.window.sessionStorage.setItem(Jr,e)}catch(t){return null}return this}},{key:"attributes",get:function(){return this._attributes}},{key:"setAttributes",value:function(t){return this._attributes=Mr(Mr({},this._attributes),t),this}},{key:"setUser",value:function(t){return this.setAttributes({"user.id":null==t?void 0:t.id,"user.email":null==t?void 0:t.email,"user.name":(null==t?void 0:t.name)||(null==t?void 0:t.username)}),this}},{key:"initSessionAttributes",value:function(t){var e,r,n;return this.setAttributes(Mr({"session.id":this.session.id,"browser.brands":null===(e=navigator.userAgentData)||void 0===e?void 0:e.brands,"browser.language":navigator.language,"browser.mobile":null===(r=navigator.userAgentData)||void 0===r?void 0:r.mobile,"browser.platform":null===(n=navigator.userAgentData)||void 0===n?void 0:n.platform,"client.address":"$remote_ip","rollbar.notifier.framework":"browser-js","user_agent.original":navigator.userAgent},t)),this}}])}();function Wr(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}function Br(t,e){return[t[0]+e[0]+Math.trunc((t[1]+e[1])/1e9),(t[1]+e[1])%1e9]}var Gr={fromMillis:Wr,toMillis:function(t){return 1e3*t[0]+Math.round(t[1]/1e6)},toNanos:function(t){return 1e9*t[0]+t[1]},add:Br,now:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?Br(Wr(performance.timeOrigin),Wr(performance.now())):Wr(Date.now())},isHrTime:function(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}};function $r(t){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$r(t)}function zr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||Zr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xr(t){return function(t){if(Array.isArray(t))return Qr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Zr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(t,e){if(t){if("string"==typeof t)return Qr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qr(t,e):void 0}}function Qr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Kr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yr(n.key),n)}}function Yr(t){var e=function(t,e){if("object"!=$r(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$r(e)?e:e+""}var tn=function(){return function(t,e,r){return e&&Kr(t.prototype,e),r&&Kr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e,this.options=r}),[{key:"export",value:function(t,e){en.push.apply(en,Xr(t))}},{key:"toPayload",value:function(){var t=this,e=en.slice();if(en.length=0,!e||!e.length)return{resourceSpans:[]};var r,n=e[0]&&e[0].resource||{},o=new Map,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Zr(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value,s=a.instrumentationScope?"".concat(a.instrumentationScope.name,":").concat(a.instrumentationScope.version):"default:1.0.0";o.has(s)||o.set(s,{scope:a.instrumentationScope||{name:"default",version:"1.0.0",attributes:[]},spans:[]}),o.get(s).spans.push(this._transformSpan(a))}}catch(t){i.e(t)}finally{i.f()}return{resourceSpans:[{resource:this._transformResource(n),scopeSpans:Array.from(o.values()).map((function(e){return{scope:t._transformInstrumentationScope(e.scope),spans:e.spans}}))}]}}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.api.postSpans(t,e)}},{key:"_transformSpan",value:function(t){var e,r=this,n=function(t){return Object.entries(t||{}).map((function(t){var e=zr(t,2),n=e[0],o=e[1];return{key:n,value:r._transformAnyValue(o)}}))};return{traceId:t.spanContext.traceId,spanId:t.spanContext.spanId,parentSpanId:t.parentSpanId||"",name:t.name,kind:t.kind||1,startTimeUnixNano:Gr.toNanos(t.startTime),endTimeUnixNano:Gr.toNanos(t.endTime),attributes:n(t.attributes),events:(e=t.events,(e||[]).map((function(t){return{timeUnixNano:Gr.toNanos(t.time),name:t.name,attributes:n(t.attributes)}})))}}},{key:"_transformResource",value:function(t){var e=this,r=t.attributes||{};return{attributes:Object.entries(r).map((function(t){var r=zr(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}}))}}},{key:"_transformInstrumentationScope",value:function(t){var e=this;return{name:t.name||"",version:t.version||"",attributes:(t.attributes||[]).map((function(t){return{key:t.key,value:e._transformAnyValue(t.value)}}))}}},{key:"_transformAnyValue",value:function(t){var e=this;if(null==t)return{stringValue:""};var r=$r(t);return"string"===r?{stringValue:t}:"number"===r?Number.isInteger(t)?{intValue:t.toString()}:{doubleValue:t}:"boolean"===r?{boolValue:t}:Array.isArray(t)?{arrayValue:{values:t.map((function(t){return e._transformAnyValue(t)}))}}:"object"===r?{kvlistValue:{values:Object.entries(t).map((function(t){var r=zr(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}}))}}:{stringValue:String(t)}}}])}(),en=[];function rn(t){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rn(t)}function nn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return on(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?on(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function on(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function an(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,sn(n.key),n)}}function sn(t){var e=function(t,e){if("object"!=rn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==rn(e)?e:e+""}var un=function(){return function(t,e,r){return e&&an(t.prototype,e),r&&an(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.exporter=e,this.options=r,this.pendingSpans=new Map,this.transforms=[this.userTransform.bind(this)]}),[{key:"addTransform",value:function(t){this.transforms.unshift(t)}},{key:"userTransform",value:function(t){this.options.transformSpan&&this.options.transformSpan({span:t})}},{key:"applyTransforms",value:function(t){var e,r=nn(this.transforms);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{n(t)}catch(t){vt.error("Error running span transform callback",t)}}}catch(t){r.e(t)}finally{r.f()}}},{key:"onStart",value:function(t,e){this.pendingSpans.set(t.span.spanContext.spanId,t)}},{key:"onEnd",value:function(t){this.applyTransforms(t.span),this.exporter.export([t.export()]),this.pendingSpans.delete(t.span.spanContext.spanId)}}])}();function ln(t){return ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ln(t)}function cn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return fn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function pn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hn(n.key),n)}}function hn(t){var e=function(t,e){if("object"!=ln(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ln(e)?e:e+""}var dn=function(){return function(t,e,r){return e&&pn(t.prototype,e),r&&pn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.usePerformance=e.usePerformance,this.initReadableSpan(e),this.spanProcessor=e.spanProcessor,this.spanProcessor.onStart(this,e.context),e.attributes&&this.setAttributes(e.attributes),this}),[{key:"initReadableSpan",value:function(t){var e;this.span={name:t.name,kind:t.kind,spanContext:t.spanContext,parentSpanId:t.parentSpanId,startTime:t.startTime||Gr.now(t.usePerformance),endTime:[0,0],status:{code:0,message:""},attributes:{"session.id":null===(e=t.session)||void 0===e?void 0:e.id},links:[],events:[],duration:0,ended:!1,resource:t.resource,instrumentationScope:t.scope,droppedAttributesCount:0,droppedEventsCount:0,droppedLinksCount:0}}},{key:"spanContext",value:function(){return this.span.spanContext}},{key:"spanId",get:function(){return this.span.spanContext.spanId}},{key:"traceId",get:function(){return this.span.spanContext.traceId}},{key:"setAttribute",value:function(t,e){return null==e||this.span.ended||0===t.length||(this.span.attributes[t]=e),this}},{key:"setAttributes",value:function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=cn(r[e],2),o=n[0],i=n[1];this.setAttribute(o,i)}return this}},{key:"addEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return this.span.ended||this.span.events.push({name:t,attributes:e,time:r||Gr.now(),droppedAttributesCount:0}),this}},{key:"isRecording",value:function(){return!1===this.span.ended}},{key:"end",value:function(t,e){t&&this.setAttributes(t),this.span.endTime=e||Gr.now(this.usePerformance),this.span.ended=!0,this.spanProcessor.onEnd(this)}},{key:"export",value:function(){return this.span}}])}();function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function vn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(r),!0).forEach((function(e){bn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bn(t,e,r){return(e=wn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wn(n.key),n)}}function wn(t){var e=function(t,e){if("object"!=yn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==yn(e)?e:e+""}var kn=function(){return function(t,e,r){return e&&gn(t.prototype,e),r&&gn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.spanProcessor=r,this.tracing=e}),[{key:"startSpan",value:function(t){var e,r,n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tracing.contextManager.active(),s=this.tracing.getSpan(a),u=null==s?void 0:s.spanContext(),l=Nr.gen(8),c=null;u?(n=u.traceId,c=u.traceState,o=u.spanId):n=Nr.gen(16);var f={traceId:n,spanId:l,traceFlags:0,traceState:c},p={attributes:mn(mn({},(null===(e=this.tracing.resource)||void 0===e?void 0:e.attributes)||{}),(null===(r=i.resource)||void 0===r?void 0:r.attributes)||{})};return new dn({resource:p,scope:this.tracing.scope,session:this.tracing.session.session,context:a,spanContext:f,name:t,kind:0,parentSpanId:o,spanProcessor:this.spanProcessor,startTime:i.startTime,usePerformance:i.usePerformance})}}])}();function _n(t){return _n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_n(t)}function Sn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function On(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Sn(Object(r),!0).forEach((function(e){xn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function xn(t,e,r){return(e=jn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function En(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jn(n.key),n)}}function jn(t){var e=function(t,e){if("object"!=_n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==_n(e)?e:e+""}var In,Pn=(In="Rollbar Context Key SPAN",Symbol.for(In)),Tn=function(){return function(t,e,r){return e&&En(t.prototype,e),r&&En(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=r,this.options=n,this.window=e,this.window.sessionStorage&&(this.session=new Vr(this,n)),this.createTracer()}),[{key:"configure",value:function(t){this.options=t}},{key:"initSession",value:function(){this.session&&this.session.init()}},{key:"sessionId",get:function(){return this.session?this.session.session.id:null}},{key:"resource",get:function(){var t,e;return{attributes:On(On({},this.options.resource||{}),{},{"rollbar.environment":null!==(t=null===(e=this.options.payload)||void 0===e?void 0:e.environment)&&void 0!==t?t:this.options.environment})}}},{key:"scope",get:function(){return{name:"rollbar-browser-js",version:this.options.version}}},{key:"idGen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return Nr.gen(t)}},{key:"createTracer",value:function(){this.contextManager=new Lr,this.exporter=new tn(this.api,this.options),this.spanProcessor=new un(this.exporter,this.options.tracing),this.tracer=new kn(this,this.spanProcessor)}},{key:"getTracer",value:function(){return this.tracer}},{key:"addSpanTransform",value:function(t){this.spanProcessor.addTransform(t)}},{key:"getSpan",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active()).getValue(Pn)}},{key:"setSpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active(),e=arguments.length>1?arguments[1]:void 0;return t.setValue(Pn,e)}},{key:"startSpan",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.contextManager.active();return this.tracer.startSpan(t,e,r)}},{key:"with",value:function(t,e,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return(n=this.contextManager).with.apply(n,[t,e,r].concat(i))}},{key:"withSpan",value:function(t,e,r,n){var o=this.startSpan(t,e);return this.with(this.setSpan(this.contextManager.active(),o),r,n,o)}}])}();Ae.setComponents({telemeter:Ve,instrumenter:dr,wrapGlobals:vr,scrub:Ze,truncation:xr,tracing:Tn});var An=Ae,Rn="undefined"!=typeof window&&window._rollbarConfig,Cn=Rn&&Rn.globalAlias||"Rollbar",Ln="undefined"!=typeof window&&window[Cn]&&"function"==typeof window[Cn].shimId&&void 0!==window[Cn].shimId();if("undefined"==typeof window||window._rollbarStartTime||(window._rollbarStartTime=(new Date).getTime()),!Ln&&Rn){var Nn=new An(Rn);window[Cn]=Nn}else"undefined"!=typeof window?(window.rollbar=An,window._rollbarDidLoad=!0):"undefined"!=typeof self&&(self.rollbar=An,self._rollbarDidLoad=!0);var qn=An;return e=e.default}()}));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rollbar=e():t.rollbar=e()}(this,function(){return function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:function(){return Yn}});var r={};function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){return e===s(t)}function s(t){var e=i(t);return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function u(t){return a(t,"function")}function l(t){return null!=t&&("object"==i(t)||"function"==typeof t)}function c(t,e){return null!=t&&(Object.hasOwn?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e))}function f(t){return Number.isFinite(t)}function p(t){return a(t,"error")||a(t,"exception")}function d(){return"********"}t.r(r),t.d(r,{parse:function(){return pn}});var h={debug:0,info:1,warning:2,error:3,critical:4};function y(t){var e=function(t){if(!a(t,"string"))return;for(var e=v,r=e.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=0,i=e.key.length;o<i;++o)n[e.key[o]]=r[o]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(t,r,o){r&&(n[e.q.name][r]=o)}),n}(t);return e?(""===e.anchor&&(e.source=e.source.replace("#","")),t=e.source.replace("?"+e.query,"")):"(unknown)"}var v={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\d*))?))?((((?:[^?#/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@/]*@)([^:/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#/]*\.[^?#/.]+(?:[?#]|$)))*\/?)?([^?#/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function m(t,e){if(!(e=e||t.protocol)&&t.port&&(80===t.port?e="http:":443===t.port&&(e="https:")),e=e||"https:",!t.hostname)return null;var r=e+"//"+t.hostname;return t.port&&(r=r+":"+t.port),t.path&&(r+=t.path),r}function b(t,e){var r,n;try{r=JSON.stringify(t)}catch(o){if(e&&u(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function g(t){var e,r;try{e=JSON.parse(t)}catch(t){r=t}return{error:r,value:e}}function w(t,e,r,n,o,i,a,s){var u={url:e||"",line:r,column:n};u.func=s.guessFunctionName(u.url,u.line),u.context=s.gatherContext(u.url,u.line);var l="undefined"!=typeof document&&document&&document.location&&document.location.href,c="undefined"!=typeof window&&window&&window.navigator&&window.navigator.userAgent;return{mode:i,message:o?String(o):t||a,url:l,stack:[u],useragent:c}}function k(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function S(t){return function t(e,r){var n,o,i,u={};try{for(o in e)(n=e[o])&&(a(n,"object")||a(n,"array"))?r.includes(n)?u[o]="Removed circular reference: "+s(n):((i=r.slice()).push(n),u[o]=t(n,i)):u[o]=n}catch(t){u="Failed cloning custom data: "+t.message}return u}(t,[t])}function _(t,e,r,n,o){for(var i,a,u,l,c,f,p=[],d=[],h=0,y=t.length;h<y;++h){var v=s(f=t[h]);switch(d.push(v),v){case"undefined":break;case"string":i?p.push(f):i=f;break;case"function":l=k(e,f);break;case"date":p.push(f);break;case"error":case"domexception":case"exception":a?p.push(f):a=f;break;case"object":case"array":if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}if(n&&"object"===v&&!c){for(var m=0,b=n.length;m<b;++m)if(void 0!==f[n[m]]){c=f;break}if(c)break}u?p.push(f):u=f;break;default:if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}p.push(f)}}u&&(u=S(u)),p.length>0&&(u||(u=S({})),u.extraArgs=S(p));var g,w={message:i,err:a,custom:u,timestamp:P(),callback:l,notifier:r,diagnostic:{},uuid:(g=P(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(g+16*Math.random())%16|0;return g=Math.floor(g/16),("x"===t?e:7&e|8).toString(16)}))};return w.data=w.data||{},function(t,e){e&&void 0!==e.level&&(t.level=e.level,delete e.level);e&&void 0!==e.skipFrames&&(t.skipFrames=e.skipFrames,delete e.skipFrames)}(w,u),n&&c&&(w.request=c),o&&(w.lambdaContext=o),w._originalArgs=t,w.diagnostic.original_arg_types=d,w}var O=["log","network","dom","navigation","error","manual"],x=["critical","error","warning","info","debug"];function E(t,e){var r,o=n(t);try{for(o.s();!(r=o.n()).done;){if(r.value===e)return!0}}catch(t){o.e(t)}finally{o.f()}return!1}function j(t,e){t.attributes=t.attributes||[];var r,o=n(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;void 0!==i.value&&t.attributes.push(i)}}catch(t){o.e(t)}finally{o.f()}}function I(t,e){if(t){var r=e.split("."),n=t;try{for(var o=0,i=r.length;o<i;++o)n=n[r[o]]}catch(t){n=void 0}return n}}function T(t,e,r){if(t){Object.setPrototypeOf(t,null);var n=e.split("."),o=n.length;if(!(o<1))if(1!==o)try{for(var i=t[n[0]]||{},a=i,s=1;s<o-1;++s)i[n[s]]=i[n[s]]||{},i=i[n[s]];i[n[o-1]]=r,t[n[0]]=a}catch(t){return}else t[n[0]]=r}}function P(){return Date.now?Date.now():Number(new Date)}function A(t,e,r,n){var o=R(t,e,r);return o=function(t,e){t.hostWhiteList&&!t.hostSafeList&&(t.hostSafeList=t.hostWhiteList,t.hostWhiteList=void 0,e&&e.log("hostWhiteList is deprecated. Use hostSafeList."));t.hostBlackList&&!t.hostBlockList&&(t.hostBlockList=t.hostBlackList,t.hostBlackList=void 0,e&&e.log("hostBlackList is deprecated. Use hostBlockList."));return t}(o,n),!e||e.overwriteScrubFields||e.scrubFields&&(o.scrubFields=(t.scrubFields||[]).concat(e.scrubFields)),o}function R(){function t(t){if(!t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e,r=c(t,"constructor"),n=t.constructor&&t.constructor.prototype&&c(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||c(t,e)}var e,r,n,o,i,a=Object.create(null),s=null,u=arguments.length;for(e=0;e<u;e++)if(null!=(s=arguments[e]))for(i in s)r=a[i],a!==(n=s[i])&&(n&&t(n)?(o=r&&t(r)?r:{},a[i]=R(o,n)):void 0!==n&&(a[i]=n));return a}var C=function(t,e,r){var n,o,i,s,u=a(t,"object"),l=a(t,"array"),f=[];if(r=r||{obj:[],mapped:[]},u){if(s=r.obj.indexOf(t),u&&-1!==s)return r.mapped[s]||r.obj[s];r.obj.push(t),s=r.obj.length-1}if(u)for(n in t)c(t,n)&&f.push(n);else if(l)for(i=0;i<t.length;++i)f.push(i);var p=u?{}:[],d=!0;for(i=0;i<f.length;++i)o=t[n=f[i]],p[n]=e(n,o,r),d=d&&p[n]===t[n];return u&&!d&&(r.mapped[s]=p),d?t:p};function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||N(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=N(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function N(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function M(t,e){var r=e.split("."),n=r.length-1;try{var o,i=q(r.entries());try{for(i.s();!(o=i.n()).done;){var a=L(o.value,2),s=a[0],u=a[1];s<n?t=t[u]:t[u]=d()}}catch(t){i.e(t)}finally{i.f()}}catch(t){}}var U=function(t,e,r){if(e=e||[],r){var n,o=q(r);try{for(o.s();!(n=o.n()).done;){M(t,n.value)}}catch(t){o.e(t)}finally{o.f()}}var i=function(t){var e,r=[],n=q(t);try{for(n.s();!(e=n.n()).done;){var o="^\\[?(%5[bB])?"+e.value+"\\[?(%5[bB])?\\]?(%5[dD])?$";r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return r}(e),s=function(t){var e,r=[],n=q(t);try{for(n.s();!(e=n.n()).done;){var o="\\[?(%5[bB])?"+e.value+"\\[?(%5[bB])?\\]?(%5[dD])?";r.push(new RegExp("("+o+"=)([^&\\n]+)","igm"))}}catch(t){n.e(t)}finally{n.f()}return r}(e);function u(t,e){return e+"********"}return C(t,function t(e,r,n){var o=function(t,e){var r,n=q(i);try{for(n.s();!(r=n.n()).done;)if(r.value.test(t)){e=d();break}}catch(t){n.e(t)}finally{n.f()}return e}(e,r);return o===r?a(r,"object")||a(r,"array")?C(r,t,n):function(t){if(a(t,"string")){var e,r=q(s);try{for(r.s();!(e=r.n()).done;){var n=e.value;t=t.replace(n,u)}}catch(t){r.e(t)}finally{r.f()}}return t}(o):o})},H=["otelAttributes"];function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function V(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach(function(e){B(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function B(t,e,r){return(e=$(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function W(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$(n.key),n)}}function $(t){var e=function(t,e){if("object"!=F(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=F(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==F(e)?e:e+""}var G=100;function z(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}var X=function(){return t=function t(e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=[],this.options=R(e);var o=this.options.maxTelemetryEvents||G;this.maxQueueSize=Math.max(0,Math.min(o,G)),this.tracing=r,this.telemetrySpan=null===(n=this.tracing)||void 0===n?void 0:n.startSpan("rollbar-telemetry",{})},e=[{key:"configure",value:function(t){var e=this.options;this.options=R(e,t);var r=this.options.maxTelemetryEvents||G,n=Math.max(0,Math.min(r,G)),o=0;this.queue.length>n&&(o=this.queue.length-n),this.maxQueueSize=n,this.queue.splice(0,o)}},{key:"copyEvents",value:function(){var t=Array.prototype.slice.call(this.queue,0);if(u(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t=(t=t.filter(function(t){return"connectivity"!==t.type})).map(function(t){t.otelAttributes;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,H);return e}),t}},{key:"exportTelemetrySpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.telemetrySpan&&(this.telemetrySpan.end(t),this.telemetrySpan=this.tracing.startSpan("rollbar-telemetry",{}))}},{key:"capture",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a={level:Z(t,r),type:t,timestamp_ms:o||P(),body:e,source:"client"};n&&(a.uuid=n),i&&(a.otelAttributes=i);try{if(u(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch(t){this.options.filterTelemetry=null}return this.push(a),a}},{key:"captureEvent",value:function(t,e,r,n){return this.capture(t,e,r,n)}},{key:"captureError",value:function(t,e,r,n){var o,i=t.message||String(t),a={message:i};t.stack&&(a.stack=t.stack);var s={message:i,level:e,type:"error",uuid:r};return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-occurrence-event",s,z(n)),this.capture("error",a,e,r,n,s)}},{key:"captureLog",value:function(t,e,r,n){var o,i=r?"rollbar-occurrence-event":"rollbar-log-event",a=V({message:t,level:e},r?{type:"message",uuid:r}:{});return null===(o=this.telemetrySpan)||void 0===o||o.addEvent(i,a,z(n)),this.capture("log",{message:t},e,r,n,a)}},{key:"captureNetwork",value:function(t,e,r,n){var o,i,a;e=e||"xhr",t.subtype=t.subtype||e,n&&(t.request=n);var s=this.levelFromStatus(t.status_code),u=1e6*(t.end_time_ms||0),l={type:t.subtype,method:t.method,url:t.url,statusCode:t.status_code,"request.headers":JSON.stringify(t.request_headers||{}),"response.headers":JSON.stringify((null===(o=t.response)||void 0===o?void 0:o.headers)||{}),"response.timeUnixNano":u.toString()},c=t.request,f=null===(i=t.response)||void 0===i?void 0:i.body;return c&&(l["request.body"]=JSON.stringify(c)),f&&(l["response.body"]=JSON.stringify(f)),null===(a=this.telemetrySpan)||void 0===a||a.addEvent("rollbar-network-event",l,z(t.start_time_ms)),this.capture("network",t,s,r,t.start_time_ms,l)}},{key:"levelFromStatus",value:function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"}},{key:"captureDom",value:function(t,e,r,n,o){var i={subtype:t,element:e};return void 0!==r&&(i.value=r),void 0!==n&&(i.checked=n),this.capture("dom",i,"info",o)}},{key:"captureInput",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.value,a=t.timestamp,s="rollbar-input-event",u={type:s,subtype:r,element:o,value:i},l={type:r,isSynthetic:n,element:o,value:i,endTimeUnixNano:z(a)},c=this._getRepeatedEvent(s,l);return c?this._updateRepeatedEvent(c,l,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,l,z(a)),this.capture("dom",u,"info",null,a,l))}},{key:"captureClick",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-click-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o,endTimeUnixNano:z(i)},l=this._getRepeatedEvent(a,u);return l?this._updateRepeatedEvent(l,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,z(i)),this.capture("dom",s,"info",null,i,u))}},{key:"_getRepeatedEvent",value:function(t,e){var r=this._lastEvent(this.queue);if(r&&r.body.type===t&&r.otelAttributes.target===e.target)return r}},{key:"_updateRepeatedEvent",value:function(t,e,r){var n=Math.max(r-t.timestamp_ms,1);t.body.value=e.value,t.otelAttributes.value=e.value,t.otelAttributes.height=e.height,t.otelAttributes.width=e.width,t.otelAttributes.textZoomRatio=e.textZoomRatio,t.otelAttributes.endTimeUnixNano=z(r),t.otelAttributes.durationUnixNano=z(n),t.otelAttributes.count=(t.otelAttributes.count||1)+1,t.otelAttributes.rate=t.otelAttributes.count/(n/1e3)}},{key:"_lastEvent",value:function(t){return t.length>0?t[t.length-1]:null}},{key:"captureFocus",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-focus-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,z(i)),this.capture("dom",s,"info",null,i,u)}},{key:"captureResize",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.width,i=t.height,a=t.textZoomRatio,s=t.timestamp,u="rollbar-resize-event",l={type:u,subtype:r,width:o,height:i,textZoomRatio:a},c={type:r,isSynthetic:n,width:o,height:i,textZoomRatio:a},f=this._getRepeatedEvent(u,c);return f?this._updateRepeatedEvent(f,c,s):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(u,c,z(s)),this.capture("dom",l,"info",null,s,c))}},{key:"captureDragDrop",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.dropEffect,a=t.effectAllowed,s=t.kinds,u=t.mediaTypes,l=t.timestamp,c="rollbar-dragdrop-event",f={type:c,subtype:r,isSynthetic:n},p={type:r,isSynthetic:n};return"dragstart"===r&&(f=V(V({},f),{},{element:o,dropEffect:i,effectAllowed:a}),p=V(V({},p),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(f=V(V({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),p=V(V({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(c,p,z(l)),this.capture("dom",f,"info",null,l,p)}},{key:"captureNavigation",value:function(t,e,r,n){var o;return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-navigation-event",{"previous.url.full":t,"url.full":e},z(n)),this.capture("navigation",{from:t,to:e},"info",r,n)}},{key:"captureDomContentLoaded",value:function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())}},{key:"captureLoad",value:function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())}},{key:"captureConnectivityChange",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.timestamp,i="rollbar-connectivity-event",a={type:i,subtype:r},s={type:r,isSynthetic:n};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(i,s,z(o)),this.capture("connectivity",a,"info",null,o,s)}},{key:"_captureRollbarItem",value:function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0}},{key:"push",value:function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()}}],e&&W(t.prototype,e),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Z(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}var Q=X;function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tt(n.key),n)}}function tt(t){var e=function(t,e){if("object"!=K(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==K(e)?e:e+""}var et=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._currentContext=e?new Map(e):new Map}return e=t,(r=[{key:"getValue",value:function(t){return this._currentContext.get(t)}},{key:"setValue",value:function(e,r){var n=new t(this._currentContext);return n._currentContext.set(e,r),n}},{key:"deleteValue",value:function(e){var r=new t(self._currentContext);return r._currentContext.delete(e),r}}])&&Y(e.prototype,r),n&&Y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}(),rt=new et;function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function ot(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,it(n.key),n)}}function it(t){var e=function(t,e){if("object"!=nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nt(e)?e:e+""}var at=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.currentContext=rt},e=[{key:"active",value:function(){return this.currentContext}},{key:"enterContext",value:function(t){var e=this.currentContext;return this.currentContext=t||rt,e}},{key:"exitContext",value:function(t){return this.currentContext=t,this.currentContext}},{key:"with",value:function(t,e,r){var n=this.enterContext(t);try{for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return e.call.apply(e,[r].concat(i))}finally{this.exitContext(n)}}}],e&&ot(t.prototype,e),r&&ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function st(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}function ut(t,e){return[t[0]+e[0]+Math.trunc((t[1]+e[1])/1e9),(t[1]+e[1])%1e9]}var lt={fromMillis:st,toMillis:function(t){return 1e3*t[0]+Math.round(t[1]/1e6)},toNanos:function(t){return 1e9*t[0]+t[1]},add:ut,now:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?ut(st(performance.timeOrigin),st(performance.now())):st(Date.now())},isHrTime:function(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}};function ct(t){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(t)}function ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||dt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(t){return function(t){if(Array.isArray(t))return ht(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||dt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dt(t,e){if(t){if("string"==typeof t)return ht(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ht(t,e):void 0}}function ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function yt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vt(n.key),n)}}function vt(t){var e=function(t,e){if("object"!=ct(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ct(e)?e:e+""}var mt=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e,this.options=r},e=[{key:"export",value:function(t,e){bt.push.apply(bt,pt(t))}},{key:"toPayload",value:function(){var t=this,e=bt.slice();if(bt.length=0,!e||!e.length)return{resourceSpans:[]};var r,n=e[0]&&e[0].resource||{},o=new Map,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=dt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value,s=a.instrumentationScope?"".concat(a.instrumentationScope.name,":").concat(a.instrumentationScope.version):"default:1.0.0";o.has(s)||o.set(s,{scope:a.instrumentationScope||{name:"default",version:"1.0.0",attributes:[]},spans:[]}),o.get(s).spans.push(this._transformSpan(a))}}catch(t){i.e(t)}finally{i.f()}return{resourceSpans:[{resource:this._transformResource(n),scopeSpans:Array.from(o.values()).map(function(e){return{scope:t._transformInstrumentationScope(e.scope),spans:e.spans}})}]}}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.api.postSpans(t,e)}},{key:"_transformSpan",value:function(t){var e,r=this,n=function(t){return Object.entries(t||{}).map(function(t){var e=ft(t,2),n=e[0],o=e[1];return{key:n,value:r._transformAnyValue(o)}})};return{traceId:t.spanContext.traceId,spanId:t.spanContext.spanId,parentSpanId:t.parentSpanId||"",name:t.name,kind:t.kind||1,startTimeUnixNano:lt.toNanos(t.startTime),endTimeUnixNano:lt.toNanos(t.endTime),attributes:n(t.attributes),events:(e=t.events,(e||[]).map(function(t){return{timeUnixNano:lt.toNanos(t.time),name:t.name,attributes:n(t.attributes)}}))}}},{key:"_transformResource",value:function(t){var e=this,r=t.attributes||{};return{attributes:Object.entries(r).map(function(t){var r=ft(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}},{key:"_transformInstrumentationScope",value:function(t){var e=this;return{name:t.name||"",version:t.version||"",attributes:(t.attributes||[]).map(function(t){return{key:t.key,value:e._transformAnyValue(t.value)}})}}},{key:"_transformAnyValue",value:function(t){var e=this;if(null==t)return{stringValue:""};var r=ct(t);return"string"===r?{stringValue:t}:"number"===r?Number.isInteger(t)?{intValue:t.toString()}:{doubleValue:t}:"boolean"===r?{boolValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(function(t){return e._transformAnyValue(t)})}}:"object"===r?{kvlistValue:{values:Object.entries(t).map(function(t){var r=ft(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}:{stringValue:String(t)}}}],e&&yt(t.prototype,e),r&&yt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),bt=[];var gt={gen:function(){var t=new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:16);return crypto.getRandomValues(t),Array.from(t,function(t){return t.toString(16).padStart(2,"0")}).join("")}};function wt(t){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(t)}function kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function St(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kt(Object(r),!0).forEach(function(e){Ot(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xt(n.key),n)}}function Ot(t,e,r){return(e=xt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xt(t){var e=function(t,e){if("object"!=wt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==wt(e)?e:e+""}var Et="RollbarSession",jt=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ot(this,"_attributes",void 0),this.options=r,this.tracing=e,this.window=e.window,this.session=null,this._attributes={}},e=[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.session||(this.getSession()||this.createSession(),this.initSessionAttributes(t)),this}},{key:"getSession",value:function(){try{var t=this.window.sessionStorage.getItem(Et);if(!t)return null;this.session=JSON.parse(t)}catch(t){return null}return this}},{key:"createSession",value:function(){return this.session={id:gt.gen(),createdAt:Date.now()},this.setSession(this.session)}},{key:"setSession",value:function(t){var e=JSON.stringify(t);try{this.window.sessionStorage.setItem(Et,e)}catch(t){return null}return this}},{key:"attributes",get:function(){return this._attributes}},{key:"setAttributes",value:function(t){return this._attributes=St(St({},this._attributes),t),this}},{key:"setUser",value:function(t){return this.setAttributes({"user.id":null==t?void 0:t.id,"user.email":null==t?void 0:t.email,"user.name":(null==t?void 0:t.name)||(null==t?void 0:t.username)}),this}},{key:"initSessionAttributes",value:function(t){var e,r,n;return this.setAttributes(St({"session.id":this.session.id,"browser.brands":null===(e=navigator.userAgentData)||void 0===e?void 0:e.brands,"browser.language":navigator.language,"browser.mobile":null===(r=navigator.userAgentData)||void 0===r?void 0:r.mobile,"browser.platform":null===(n=navigator.userAgentData)||void 0===n?void 0:n.platform,"client.address":"$remote_ip","rollbar.notifier.framework":"browser-js","user_agent.original":navigator.userAgent},t)),this}}],e&&_t(t.prototype,e),r&&_t(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),It=function(){},Tt={debug:0,info:1,warn:2,error:3,disable:4},Pt={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return It("info",e)},init:function(t){var e=t.logLevel;It=function(t,r){Tt[t]<Tt[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}},At=Pt;function Rt(t){return Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rt(t)}function Ct(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Lt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function qt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nt(n.key),n)}}function Nt(t){var e=function(t,e){if("object"!=Rt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Rt(e)?e:e+""}var Dt=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.exporter=e,this.options=r,this.pendingSpans=new Map,this.transforms=[this.userTransform.bind(this)]},e=[{key:"addTransform",value:function(t){this.transforms.unshift(t)}},{key:"userTransform",value:function(t){this.options.transformSpan&&this.options.transformSpan({span:t})}},{key:"applyTransforms",value:function(t){var e,r=Ct(this.transforms);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{n(t)}catch(t){At.error("Error running span transform callback",t)}}}catch(t){r.e(t)}finally{r.f()}}},{key:"onStart",value:function(t,e){this.pendingSpans.set(t.span.spanContext.spanId,t)}},{key:"onEnd",value:function(t){this.applyTransforms(t.span),this.exporter.export([t.export()]),this.pendingSpans.delete(t.span.spanContext.spanId)}}],e&&qt(t.prototype,e),r&&qt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Mt(t){return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(t)}function Ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ht(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ht(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Jt(n.key),n)}}function Jt(t){var e=function(t,e){if("object"!=Mt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mt(e)?e:e+""}var Vt=function(){return t=function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.usePerformance=e.usePerformance,this.initReadableSpan(e),this.spanProcessor=e.spanProcessor,this.spanProcessor.onStart(this,e.context),e.attributes&&this.setAttributes(e.attributes),this},e=[{key:"initReadableSpan",value:function(t){var e;this.span={name:t.name,kind:t.kind,spanContext:t.spanContext,parentSpanId:t.parentSpanId,startTime:t.startTime||lt.now(t.usePerformance),endTime:[0,0],status:{code:0,message:""},attributes:{"session.id":null===(e=t.session)||void 0===e?void 0:e.id},links:[],events:[],duration:0,ended:!1,resource:t.resource,instrumentationScope:t.scope,droppedAttributesCount:0,droppedEventsCount:0,droppedLinksCount:0}}},{key:"spanContext",value:function(){return this.span.spanContext}},{key:"spanId",get:function(){return this.span.spanContext.spanId}},{key:"traceId",get:function(){return this.span.spanContext.traceId}},{key:"setAttribute",value:function(t,e){return null==e||this.span.ended||0===t.length||(this.span.attributes[t]=e),this}},{key:"setAttributes",value:function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=Ut(r[e],2),o=n[0],i=n[1];this.setAttribute(o,i)}return this}},{key:"addEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return this.span.ended||this.span.events.push({name:t,attributes:e,time:r||lt.now(),droppedAttributesCount:0}),this}},{key:"isRecording",value:function(){return!1===this.span.ended}},{key:"end",value:function(t,e){t&&this.setAttributes(t),this.span.endTime=e||lt.now(this.usePerformance),this.span.ended=!0,this.spanProcessor.onEnd(this)}},{key:"export",value:function(){return this.span}}],e&&Ft(t.prototype,e),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Bt(t){return Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(t)}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function $t(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wt(Object(r),!0).forEach(function(e){Gt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Gt(t,e,r){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xt(n.key),n)}}function Xt(t){var e=function(t,e){if("object"!=Bt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Bt(e)?e:e+""}var Zt=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.spanProcessor=r,this.tracing=e},e=[{key:"startSpan",value:function(t){var e,r,n,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tracing.contextManager.active(),u=this.tracing.getSpan(s),l=null==u?void 0:u.spanContext(),c=gt.gen(8),f=null;l?(o=l.traceId,f=l.traceState,i=l.spanId):o=gt.gen(16);var p={traceId:o,spanId:c,traceFlags:0,traceState:f},d={attributes:$t($t({},(null===(e=this.tracing.resource)||void 0===e?void 0:e.attributes)||{}),(null===(r=a.resource)||void 0===r?void 0:r.attributes)||{})};return new Vt({resource:d,scope:this.tracing.scope,session:null===(n=this.tracing.session)||void 0===n?void 0:n.session,context:s,spanContext:p,name:t,kind:0,parentSpanId:i,spanProcessor:this.spanProcessor,startTime:a.startTime,usePerformance:a.usePerformance})}}],e&&zt(t.prototype,e),r&&zt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Qt(t){return Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qt(t)}function Kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Kt(Object(r),!0).forEach(function(e){te(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function te(t,e,r){return(e=re(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,re(n.key),n)}}function re(t){var e=function(t,e){if("object"!=Qt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Qt(e)?e:e+""}var ne,oe=(ne="Rollbar Context Key SPAN",Symbol.for(ne)),ie=function(){return t=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=r,this.options=n,this.window=e,this.window.sessionStorage&&(this.session=new jt(this,n)),this.createTracer()},e=[{key:"configure",value:function(t){this.options=t}},{key:"initSession",value:function(){this.session&&this.session.init()}},{key:"sessionId",get:function(){return this.session?this.session.session.id:null}},{key:"resource",get:function(){var t,e;return{attributes:Yt(Yt({},this.options.resource||{}),{},{"rollbar.environment":null!==(t=null===(e=this.options.payload)||void 0===e?void 0:e.environment)&&void 0!==t?t:this.options.environment})}}},{key:"scope",get:function(){return{name:"rollbar-browser-js",version:this.options.version}}},{key:"idGen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return gt.gen(t)}},{key:"createTracer",value:function(){this.contextManager=new at,this.exporter=new mt(this.api,this.options),this.spanProcessor=new Dt(this.exporter,this.options.tracing),this.tracer=new Zt(this,this.spanProcessor)}},{key:"getTracer",value:function(){return this.tracer}},{key:"addSpanTransform",value:function(t){this.spanProcessor.addTransform(t)}},{key:"getSpan",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active()).getValue(oe)}},{key:"setSpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active(),e=arguments.length>1?arguments[1]:void 0;return t.setValue(oe,e)}},{key:"startSpan",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.contextManager.active();return this.tracer.startSpan(t,e,r)}},{key:"with",value:function(t,e,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return(n=this.contextManager).with.apply(n,[t,e,r].concat(i))}},{key:"withSpan",value:function(t,e,r,n){var o=this.startSpan(t,e);return this.with(this.setSpan(this.contextManager.active(),o),r,n,o)}}],e&&ee(t.prototype,e),r&&ee(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ae(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||ue(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function se(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ue(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ue(t,e){if(t){if("string"==typeof t)return le(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?le(t,e):void 0}}function le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ce(t,e){return[t,b(t,e)]}function fe(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function pe(t,e,r){r=void 0===r?30:r;var n,o=t.data.body;if(o.trace_chain){var i,a=se(o.trace_chain);try{for(a.s();!(i=a.n()).done;){var s=i.value;n=fe(n=s.frames,r),s.frames=n}}catch(t){a.e(t)}finally{a.f()}}else o.trace&&(n=fe(n=o.trace.frames,r),o.trace.frames=n);return[t,b(t,e)]}function de(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function he(t,e,r){return e=C(e,function e(r,n,o){switch(s(n)){case"string":return de(t,n);case"object":case"array":return C(n,e,o);default:return n}}),[e,b(e,r)]}function ye(t){return t.exception&&(delete t.exception.description,t.exception.message=de(255,t.exception.message)),t.frames=fe(t.frames,1),t}function ve(t,e){var r=t.data.body;if(r.trace_chain){var n,o=r.trace_chain,i=se(o.entries());try{for(i.s();!(n=i.n()).done;){var a=ae(n.value,2),s=a[0],u=a[1];o[s]=ye(u)}}catch(t){i.e(t)}finally{i.f()}}else r.trace&&(r.trace=ye(r.trace));return[t,b(t,e)]}function me(t,e){return function(t){for(var e=0,r=t.length,n=0;n<r;n++){var o=t.charCodeAt(n);o<128?e+=1:o<2048?e+=2:o<65536&&(e+=3)}return e}(t)>e}var be={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[ce,pe,he.bind(null,1024),he.bind(null,512),he.bind(null,256),ve];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!me(i.value,r))return i;return i},raw:ce,truncateFrames:pe,truncateStrings:he,maybeTruncateValue:de};function ge(t){if(!a(t.context,"string")){var e=b(t.context);e.error?t.context="Error: could not serialize 'context'":t.context=e.value||"",t.context.length>255&&(t.context=t.context.substr(0,255))}return{data:t}}function we(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,a=e.path,s=e.search,u=t.timeout,l=function(t){var e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=t.defaultTransport||"xhr";void 0===e.fetch&&(r="xhr");void 0===e.XMLHttpRequest&&(r="fetch");return r}(t),c=t.proxy;if(t.endpoint){var f=r.parse(t.endpoint);n=f.hostname,o=f.protocol,i=f.port,a=f.pathname,s=f.search}return{timeout:u,hostname:n,protocol:o,port:i,path:a,search:s,proxy:c,transport:l}}function ke(t,e){var r=t.protocol||"https:",n=t.port||("http:"===r?80:"https:"===r?443:void 0),o=t.hostname,i=t.path,a=t.timeout,s=t.transport;return t.search&&(i+=t.search),t.proxy&&(i=r+"//"+o+i,o=t.proxy.host||t.proxy.hostname,n=t.proxy.port,r=t.proxy.protocol||r),{timeout:a,protocol:r,hostname:o,path:i,port:n,method:e,transport:s}}function Se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _e(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Se(Object(r),!0).forEach(function(e){Oe(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Oe(t,e,r){return(e=Pe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xe(t){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(t)}function Ee(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return je(l,"_invoke",function(r,n,o){var i,s,u,l=0,c=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function d(r,n){for(s=r,u=n,e=0;!f&&l&&!o&&e<c.length;e++){var o,i=c[e],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,h),s=c,u=h;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(l=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,s=1,u=e}finally{l=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(je(e={},n,function(){return this}),e),f=l.prototype=s.prototype=Object.create(c);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,je(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,je(f,"constructor",l),je(l,"constructor",u),u.displayName="GeneratorFunction",je(l,o,"GeneratorFunction"),je(f),je(f,o,"Generator"),je(f,n,function(){return this}),je(f,"toString",function(){return"[object Generator]"}),(Ee=function(){return{w:i,m:p}})()}function je(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}je=function(t,e,r,n){function i(e,r){je(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},je(t,e,r,n)}function Ie(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Te(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Pe(n.key),n)}}function Pe(t){var e=function(t,e){if("object"!=xe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xe(e)?e:e+""}var Ae={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},Re={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443},Ce=function(){return t=function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.transport=r,this.url=n,this.truncation=o,this.accessToken=e.accessToken,this.transportOptions=Le(e,n),this.OTLPTransportOptions=qe(e,n)},e=[{key:"_postPromise",value:function(t){var e=this,r=t.accessToken,n=t.options,o=t.payload,i=t.headers;return new Promise(function(t,a){e.transport.post({accessToken:r,options:n,payload:o,headers:i,callback:function(e,r){return e?a(e):t(r)}})})}},{key:"postItem",value:function(t,e){var r=this,n=ke(this.transportOptions,"POST"),o=ge(t);setTimeout(function(){r.transport.post({accessToken:r.accessToken,options:n,payload:o,callback:e})},0)}},{key:"postSpans",value:(n=Ee().m(function t(e){var r,n,o=arguments;return Ee().w(function(t){for(;;)if(0===t.n)return r=o.length>1&&void 0!==o[1]?o[1]:{},n=ke(this.OTLPTransportOptions,"POST"),t.a(2,this._postPromise({accessToken:this.accessToken,options:n,payload:e,headers:r}))},t,this)}),o=function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){Ie(i,r,o,a,s,"next",t)}function s(t){Ie(i,r,o,a,s,"throw",t)}a(void 0)})},function(t){return o.apply(this,arguments)})},{key:"buildJsonPayload",value:function(t,e){var r,n=ge(t);return(r=this.truncation?this.truncation.truncate(n):b(n)).error?(e&&e(r.error),null):r.value}},{key:"postJsonPayload",value:function(t,e){var r=ke(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)}},{key:"configure",value:function(t){var e=this.options;return this.options=R(e,t),this.transportOptions=Le(this.options,this.url),this.OTLPTransportOptions=qe(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this}}],e&&Te(t.prototype,e),r&&Te(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function Le(t,e){return we(t,Ae,e)}function qe(t,e){var r;return we(t=_e(_e({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),Re,e)}var Ne=Ce,De="3.0.0",Me="api.rollbar.com/api/1/item/",Ue="debug",He="debug",Fe="error",Je=/(^|@)\S+:\d+/,Ve=/^\s*at .*(\S+:\d+|\(native\))/m,Be=/^(eval@)?(\[native code\])?$/;function We(t,e){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return function(t,e){return!t.stacktrace||t.message.includes("\n")&&t.message.split("\n").length>t.stacktrace.split("\n").length?function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({file:s[2],line:+s[1],raw:n[i]})}return Ge(o,e)}(t):t.stack?function(t,e){var r=Ge(t.stack.split("\n").filter(function(t){return!!t.match(Je)&&!t.match(/^Error created at/)}),e);return r.map(function(t){var e,r=t.split("@"),n=$e(r.pop()),o=r.shift()||"",i=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return o.match(/\(([^)]*)\)/)&&(e=o.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{function:i,args:void 0===e||"[arguments not available]"===e?void 0:e.split(","),file:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}})}(t,e):function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({function:s[3]||void 0,file:s[2],line:s[1]?+s[1]:void 0,raw:n[i]})}return Ge(o,e)}(t)}(t,e);if(t.stack&&t.stack.match(Ve))return function(t,e){return ze(t.stack,e)}(t,e);if(t.stack)return function(t,e){return Xe(t.stack,e)}(t,e);if(null!=e&&e.allowEmpty)return[];throw new Error("Cannot parse given Error object")}function $e(t){if(!t.includes(":"))return[t,void 0,void 0];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]}function Ge(t,e){return e&&null!=e.slice?Array.isArray(e.slice)?t.slice(e.slice[0],e.slice[1]):t.slice(0,e.slice):t}function ze(t,e){return Ge(t.split("\n").filter(function(t){return!!t.match(Ve)}),e).map(function(t){t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=e.match(/ (\(.+\)$)/);e=r?e.replace(r[0],""):e;var n=$e(r?r[1]:e);return{function:r&&e||void 0,file:["eval","<anonymous>"].includes(n[0])?void 0:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}})}function Xe(t,e){return Ge(t.split("\n").filter(function(t){return!t.match(Be)}),e).map(function(t){if(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.includes("@")||t.includes(":")){var e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=t.match(e),n=r&&r[1]?r[1]:void 0,o=$e(t.replace(e,""));return{function:n,file:o[0],line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:t}}return{function:t}})}function Ze(t){return t.map(function(t){return{functionName:t.function,args:t.args,fileName:t.file,lineNumber:t.line,columnNumber:t.col,source:t.raw}})}var Qe=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function Ke(){return null}function Ye(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function tr(t,e){return{stack:function(){var r=[];e=e||0;try{r=function(t,e){return Ze(We(t,e))}(t)}catch(t){r=[]}for(var n=[],o=e;o<r.length;o++)n.push(new Ye(r[o]));return n}(),message:t.message,name:er(t),rawStack:t.stack,rawException:t}}function er(t){var e=t.name&&t.name.length&&t.name,r=t.constructor.name&&t.constructor.name.length&&t.constructor.name;return e&&r?"Error"===e?r:e:e||r}var rr={guessFunctionName:function(){return"?"},guessErrorClass:function(t){if(!t||!t.match)return["Unknown error. There was no error message to display.",""];var e=t.match(Qe),r="(unknown)";return e&&(r=e[e.length-1],t=(t=t.replace((e[e.length-2]||"")+r+":","")).replace(/(^[\s]+|[\s]+$)/g,"")),[r,t]},gatherContext:Ke,parse:function(t,e){var r=t;if(r.nested||r.cause){for(var n=[];r;)n.push(new tr(r,e)),r=r.nested||r.cause,e=0;return n[0].traceChain=n,n[0]}return new tr(r,e)},Stack:tr,Frame:Ye};function nr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return or(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?or(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ir(t,e){var r=t.level,n=h[r]||0,o=e.reportLevel;return!(n<(h[o]||0))}function ar(t,e,r){if(!t)return!r;var n,o,i=t.frames;if(!i||0===i.length)return!r;for(var s=e.length,u=i.length,l=0;l<u;l++){if(!a(n=i[l].filename,"string"))return!r;for(var c=0;c<s;c++)if(o=e[c],new RegExp(o).test(n))return!0}return!1}function sr(t,e,r,n){var o,i,a=!1;"blocklist"===r&&(a=!0);try{if(o=a?e.hostBlockList:e.hostSafeList,i=I(t,"body.trace_chain")||[I(t,"body.trace")],!o||0===o.length)return!a;if(0===i.length||!i[0])return!a;for(var s=i.length,u=0;u<s;u++)if(ar(i[u],o,a))return!0}catch(t){a?e.hostBlockList=null:e.hostSafeList=null;var l=a?"hostBlockList":"hostSafeList";return n.error("Error while reading your configuration's "+l+" option. Removing custom "+l+".",t),!a}return!1}function ur(t){return function(e,r){var n,o,i,a,s,u;try{if(!(i=r.ignoredMessages)||0===i.length)return!0;if(u=function(t){var e=t.body,r=[];if(e.trace_chain){var n,o=nr(e.trace_chain);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.push(I(i,"exception.message"))}}catch(t){o.e(t)}finally{o.f()}}e.trace&&r.push(I(e,"trace.exception.message"));e.message&&r.push(I(e,"message.body"));return r}(e),0===u.length)return!0;for(a=i.length,n=0;n<a;n++)for(s=new RegExp(i[n],"gi"),o=0;o<u.length;o++)if(s.test(u[o]))return!1}catch(e){r.ignoredMessages=null,t.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!0}}function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function cr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fr(n.key),n)}}function fr(t){var e=function(t,e){if("object"!=lr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lr(e)?e:e+""}var pr=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=e,this.options=r,this.transforms=[],this.diagnostic={}},e=[{key:"configure",value:function(t){var e;null===(e=this.queue)||void 0===e||e.configure(t);var r=this.options;return this.options=R(r,t),this}},{key:"addTransform",value:function(t){return u(t)&&this.transforms.push(t),this}},{key:"log",value:function(t,e){var r=this;if(e=u(e)?e:function(){},!this.options.enabled)return e(new Error("Rollbar is not enabled"),null);this.queue.addPendingItem(t);var n=t.err;this._applyTransforms(t,function(o,i){if(o)return r.queue.removePendingItem(t),e(o,null);r.queue.addItem(i,e,n,t)})}},{key:"_applyTransforms",value:function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,a=function(t,s){t?e(t,null):++r!==n?o[r](s,i,a):e(null,s)};a(null,t)}}],e&&cr(t.prototype,e),r&&cr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function dr(t){return dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dr(t)}function hr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yr(n.key),n)}}function yr(t){var e=function(t,e){if("object"!=dr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dr(e)?e:e+""}var vr,mr,br,gr=function(){function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rateLimiter=e,this.api=r,this.logger=n,this.options=o,this.replay=i,this.predicates=[],this.pendingItems=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}return e=t,r=[{key:"configure",value:function(t){var e;null===(e=this.api)||void 0===e||e.configure(t);var r=this.options;return this.options=R(r,t),this}},{key:"addPredicate",value:function(t){return u(t)&&this.predicates.push(t),this}},{key:"addPendingItem",value:function(t){this.pendingItems.push(t)}},{key:"removePendingItem",value:function(t){var e=this.pendingItems.indexOf(t);-1!==e&&this.pendingItems.splice(e,1)}},{key:"addItem",value:function(t,e,r,n){var o=this;e&&u(e)||(e=function(){});var i=t.data,a=this._applyPredicates(i);if(a.stop)return this.removePendingItem(n),void e(a.err);if(this._maybeLog(i,r),this.removePendingItem(n),this.options.transmit){this.replay&&i.body&&(t.replayId=this.replay.capture(null,i.uuid,{type:"occurrence",level:t.level}),t.replayId&&j(t.data,[{key:"replay_id",value:t.replayId}])),this.pendingRequests.push(i);try{this._makeApiRequest(i,function(r,n,a){o._dequeuePendingRequest(i),t.replayId&&o.replay.sendOrDiscardReplay(t.replayId,r,n,a),e(r,n)})}catch(r){var s;this._dequeuePendingRequest(i),t.replayId&&(null===(s=this.replay)||void 0===s||s.discard(t.replayId)),e(r)}}else e(new Error("Transmit disabled"))}},{key:"wait",value:function(t){var e=this;u(t)&&(this.waitCallback=t,this._maybeCallWait()||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval(function(){e._maybeCallWait()},500)))}},{key:"_applyPredicates",value:function(t){for(var e=null,r=0,n=this.predicates.length;r<n;r++)if(!(e=this.predicates[r](t,this.options))||void 0!==e.err)return{stop:!0,err:e.err};return{stop:!1,err:null}}},{key:"_makeApiRequest",value:function(t,e){var r=this,n=this.rateLimiter.shouldSend(t);n.shouldSend?this.api.postItem(t,function(n,o,i){n?r._maybeRetry(n,t,e):e(n,o,i)}):n.error?e(n.error):this.api.postItem(n.payload,e)}},{key:"_maybeRetry",value:function(e,r,n){var o=!1;if(this.options.retryInterval){for(var i=0,a=t.RETRIABLE_ERRORS.length;i<a;i++)if(e.code===t.RETRIABLE_ERRORS[i]){o=!0;break}o&&f(this.options.maxRetries)&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(o=!1))}o?this._retryApiRequest(r,n):n(e)}},{key:"_retryApiRequest",value:function(t,e){var r=this;this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval(function(){for(;r.retryQueue.length;){var t=r.retryQueue.shift();r._makeApiRequest(t.item,t.callback)}},this.options.retryInterval))}},{key:"_dequeuePendingRequest",value:function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())}},{key:"_maybeLog",value:function(t,e){if(this.logger&&this.options.verbose){var r=e||I(t,"body.trace.exception.message")||I(t,"body.trace_chain.0.exception.message");if(r)return void this.logger.error(r);(r=I(t,"body.message.body"))&&this.logger.log(r)}}},{key:"_maybeCallWait",value:function(){return!(!u(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))}}],r&&hr(e.prototype,r),n&&hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();vr=gr,br=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(mr=yr(mr="RETRIABLE_ERRORS"))in vr?Object.defineProperty(vr,mr,{value:br,enumerable:!0,configurable:!0,writable:!0}):vr[mr]=br;var wr=gr;function kr(t){return kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(t)}function Sr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_r(n.key),n)}}function _r(t){var e=function(t,e){if("object"!=kr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=kr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kr(e)?e:e+""}var Or=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.startTime=Date.now(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(e)}return function(t,e,r){return e&&Sr(t.prototype,e),r&&Sr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"configureGlobal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.startTime,n=e.maxItems,o=e.itemsPerMinute;void 0!==r&&(t.globalSettings.startTime=r),void 0!==n&&(t.globalSettings.maxItems=n),void 0!==o&&(t.globalSettings.itemsPerMinute=o)}},{key:"shouldSend",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=r-this.startTime;(n<0||n>=6e4)&&(this.startTime=r,this.perMinCounter=0);var o=t.globalSettings.maxItems,i=t.globalSettings.itemsPerMinute;if(xr(e,o,this.counter))return Er(this.platform,this.platformOptions,"".concat(o," max items reached"),!1);if(xr(e,i,this.perMinCounter))return Er(this.platform,this.platformOptions,"".concat(i," items per minute reached"),!1);this.counter+=1,this.perMinCounter+=1;var a=!xr(e,o,this.counter),s=a,u=a&&!xr(e,i,this.perMinCounter);return Er(this.platform,this.platformOptions,null,u,o,i,s)}},{key:"setPlatformOptions",value:function(t,e){this.platform=t,this.platformOptions=e}}])}();function xr(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function Er(t,e,r,n,o,i,a){var s=null,u=r?new Error(r):null;return u||n||(s=function(t,e,r,n,o){var i=e.environment||e.payload&&e.payload.environment,a=o?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.",s={body:{message:{body:a,extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:i,notifier:{version:e.notifier&&e.notifier.version||e.version}};"browser"===t?(s.platform="browser",s.framework="browser-js",s.notifier.name="rollbar-browser-js"):"server"===t?(s.framework=e.framework||"node-js",s.notifier.name=e.notifier.name):"react-native"===t&&(s.framework=e.framework||"react-native",s.notifier.name=e.notifier.name);return s}(t,e,o,i,a)),{error:u,shouldSend:n,payload:s}}!function(t,e,r){(e=_r(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(Or,"globalSettings",{startTime:Date.now(),maxItems:void 0,itemsPerMinute:void 0});var jr=Or;function Ir(t,e,r,n,o,i,a){this.options=R(t),this.logger=r,Ir.rateLimiter.configureGlobal(this.options),Ir.rateLimiter.setPlatformOptions(a,this.options),this.api=e,this.queue=new wr(Ir.rateLimiter,e,r,this.options,i),this.tracing=o;var s=this.options.tracer||null;Pr(s)?(this.tracer=s,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new pr(this.queue,this.options),this.telemeter=n,Tr(t),this.lastError=null,this.lastErrorHash="none"}function Tr(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function Pr(t){if(!t)return!1;if(!t.scope||"function"!=typeof t.scope)return!1;var e=t.scope();return!(!e||!e.active||"function"!=typeof e.active)}Ir.rateLimiter=new jr({maxItems:0,itemsPerMinute:60}),Ir.prototype.global=function(t){return Ir.rateLimiter.configureGlobal(t),this},Ir.prototype.configure=function(t,e){var r=this.options,n={};e&&(n={payload:e}),this.options=R(r,t,n);var o=this.options.tracer||null;return Pr(o)?(this.tracer=o,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier&&this.notifier.configure(this.options),this.telemeter&&this.telemeter.configure(this.options),Tr(t),this.global(this.options),Pr(t.tracer)&&(this.tracer=t.tracer),this},Ir.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},Ir.prototype.debug=function(t){this._log("debug",t)},Ir.prototype.info=function(t){this._log("info",t)},Ir.prototype.warn=function(t){this._log("warning",t)},Ir.prototype.warning=function(t){this._log("warning",t)},Ir.prototype.error=function(t){this._log("error",t)},Ir.prototype.critical=function(t){this._log("critical",t)},Ir.prototype.wait=function(t){this.queue.wait(t)},Ir.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},Ir.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},Ir.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},Ir.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},Ir.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},Ir.prototype._log=function(t,e){var r;if(e.callback&&(r=e.callback,delete e.callback),this.options.ignoreDuplicateErrors&&this._sameAsLastError(e)){if(r){var n=new Error("ignored identical item");n.item=e,r(n)}}else try{e.level=e.level||t,this._addItemAttributes(e),this._addTracingInfo(e);var o=this.telemeter;o&&(o._captureRollbarItem(e),e.telemetryEvents=o.copyEvents()||[]),this.notifier.log(e,r)}catch(t){r&&r(t),this.logger.error(t)}},Ir.prototype._addItemAttributes=function(t){var e,r,n=null===(e=this.tracing)||void 0===e?void 0:e.getSpan(),o=[{key:"session_id",value:null===(r=this.tracing)||void 0===r?void 0:r.sessionId},{key:"span_id",value:null==n?void 0:n.spanId},{key:"trace_id",value:null==n?void 0:n.traceId}];t._isUncaught&&o.push({key:"is_uncaught",value:"true"}),j(t.data,o),null==n||n.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:t.uuid}])},Ir.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},Ir.prototype._sameAsLastError=function(t){if(!t._isUncaught)return!1;var e=function(t){var e=t.message||"",r=(t.err||{}).stack||String(t.err);return e+"::"+r}(t);return this.lastErrorHash===e||(this.lastError=t.err,this.lastErrorHash=e,!1)},Ir.prototype._addTracingInfo=function(t){if(this.tracer){var e=this.tracer.scope().active();if(function(t){if(!t||!t.context||"function"!=typeof t.context)return!1;var e=t.context();if(!e||!e.toSpanId||!e.toTraceId||"function"!=typeof e.toSpanId||"function"!=typeof e.toTraceId)return!1;return!0}(e)){e.setTag("rollbar.error_uuid",t.uuid),e.setTag("rollbar.has_error",!0),e.setTag("error",!0),e.setTag("rollbar.item_url","https://rollbar.com/item/uuid/?uuid=".concat(t.uuid)),e.setTag("rollbar.occurrence_url","https://rollbar.com/occurrence/uuid/?uuid=".concat(t.uuid));var r=e.context().toSpanId(),n=e.context().toTraceId();t.custom?(t.custom.opentracing_span_id=r,t.custom.opentracing_trace_id=n):t.custom={opentracing_span_id:r,opentracing_trace_id:n}}}};var Ar=Ir;function Rr(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function Cr(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=R(t.data,n),r(null,t)}function Lr(t,e,r){t.telemetryEvents&&T(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function qr(t,e,r){if(t.message){var n="data.body.trace_chain.0",o=I(t,n);if(o||(o=I(t,n="data.body.trace")),o){if(!o.exception||!o.exception.description)return T(t,n+".exception.description",t.message),void r(null,t);T(t,n+".extra",R(I(t,n+".extra")||{},{message:t.message}))}r(null,t)}else r(null,t)}function Nr(t){return function(e,r,n){var o,i=R(e),s=null;try{u(r.transform)&&(s=r.transform(i.data,e))}catch(o){return r.transform=null,t.error("Error while calling custom transform() function. Removing custom transform().",o),void n(null,e)}l(o=s)&&a(o.then,"function")?s.then(function(t){t&&(i.data=t),n(null,i)},function(t){n(t,e)}):n(null,i)}}function Dr(t,e,r){if(!e.sendConfig)return r(null,t);var n=I(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,r(null,t)}function Mr(t,e){u(t[e])&&(t[e]=t[e].toString())}function Ur(t,e,r){var n=e._configuredOptions;Mr(n,"transform"),Mr(n,"checkIgnore"),Mr(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function Hr(t,e,r){var n=R(t.notifier.client.notifier.diagnostic,t.diagnostic);if(I(t,"err._isAnonymous")&&(n.is_anonymous=!0),t._isUncaught&&(n.is_uncaught=t._isUncaught),t.err)try{n.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){n.raw_error={failed:String(t)}}t.data.notifier.diagnostic=R(t.data.notifier.diagnostic,n),r(null,t)}function Fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Jr=[].concat(function(t){return function(t){if(Array.isArray(t))return Fr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Fr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fr(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","X-Rollbar-Access-Token","secret_key","secretKey","secretToken"]),["cc-number","card number","cardnumber","cardnum","ccnum","ccnumber","cc num","creditcardnumber","credit card number","newcreditcardnumber","new credit card","creditcardno","credit card no","card#","card #","cc-csc","cvc","cvc2","cvv2","ccv2","security code","card verification","name on credit card","name on card","nameoncard","cardholder","card holder","name des karteninhabers","ccname","card type","cardtype","cc type","cctype","payment type","expiration date","expirationdate","expdate","cc-exp","ccmonth","ccyear"]),Vr={scrubFields:Jr};function Br(t,e){return!I(e,"plugins.jquery.ignoreAjaxErrors")||!I(t,"body.message.extra.isAjax")}function Wr(t,e,r){if(t.err&&"DOMException"===rr.Stack(t.err).name){var n=new Error;n.name=t.err.name,n.message=t.err.message,n.stack=t.err.stack,n.nested=t.err,t.err=n}r(null,t)}function $r(t,e,r){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||rr.parse(t.err,t.skipFrames),e.addErrorContext&&function(t){var e=[],r=t.err;e.push(r);for(;r.nested||r.cause;)r=r.nested||r.cause,e.push(r);!function(t,e){var r=t.data.custom||{},o=!1;try{var i,a=n(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;c(s,"rollbarContext")&&(r=R(r,S(s.rollbarContext)),o=!0)}}catch(t){a.e(t)}finally{a.f()}o&&(t.data.custom=r)}catch(e){t.diagnostic.error_context="Failed: "+e.message}}(t,e)}(t)}catch(e){At.error("Error while parsing the error object.",e);try{t.message=t.err.message||t.err.description||t.message||String(t.err)}catch(e){t.message=String(t.err)||String(e)}delete t.err}r(null,t)}function Gr(t,e,r){t.message||t.stackInfo||t.custom||r(new Error("No message, stack info, or custom data"),null),r(null,t)}function zr(t,e,r){var n=e.payload&&e.payload.environment||e.environment;t.data=R(t.data,{environment:n,level:t.level,endpoint:e.endpoint,platform:"browser",framework:"browser-js",language:"javascript",server:{},uuid:t.uuid,notifier:{name:"rollbar-browser-js",version:e.version},custom:t.custom}),r(null,t)}function Xr(t,e,r){t.stackInfo?t.stackInfo.traceChain?function(t,e,r){for(var n=t.stackInfo.traceChain,o=[],i=n.length,a=0;a<i;a++){var s=Kr(t,n[a],e);o.push(s)}T(t,"data.body",{trace_chain:o}),r(null,t)}(t,e,r):function(t,e,r){var n=Qr(t);if(n){T(t,"data.body",{trace:Kr(t,t.stackInfo,e)}),r(null,t)}else{var o=t.stackInfo,i=rr.guessErrorClass(o.message),a=Yr(o,i[0],e),s=i[1];t.message=a+": "+s,Zr(t,e,r)}}(t,e,r):Zr(t,e,r)}function Zr(t,e,r){var n=t.message,o=t.custom;n||(n="Item sent with null or missing arguments.");var i={body:n};o&&(i.extra=R(o)),T(t,"data.body",{message:i}),r(null,t)}function Qr(t){var e=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||t.stackInfo).stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function Kr(t,e,r){var n=t&&t.data.description,o=t&&t.custom,i=Qr(t,e),a=rr.guessErrorClass(e.message),s={exception:{class:Yr(e,a[0],r),message:a[1]}};if(n&&(s.exception.description=n),i){var u,l,c,f,p,d,h,v;for(0===i.length&&(s.exception.stack=e.rawStack,s.exception.raw=String(e.rawException)),s.frames=[],h=0;h<i.length;++h)l={filename:(u=i[h]).url?y(u.url):"(unknown)",lineno:u.line||null,method:u.func&&"?"!==u.func?u.func:"[anonymous]",colno:u.column},r.sendFrameUrl&&(l.url=u.url),l.method&&l.method.endsWith&&l.method.endsWith("_rollbar_wrapped")||(c=f=p=null,(d=u.context?u.context.length:0)&&(v=Math.floor(d/2),f=u.context.slice(0,v),c=u.context[v],p=u.context.slice(v)),c&&(l.code=c),(f||p)&&(l.context={},f&&f.length&&(l.context.pre=f),p&&p.length&&(l.context.post=p)),u.args&&(l.args=u.args),s.frames.push(l));s.frames.reverse(),o&&(s.extra=R(o))}return s}function Yr(t,e,r){return t.name?t.name:r.guessErrorClass?e:"(unknown)"}function tn(t){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(t)}function en(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function rn(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=tn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==tn(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var nn=function(t){var e,r,n=t.accessToken,o=t.url,i=t.method,a=t.payload,s=t.headers,u=t.callback,l=t.timeout;f(l)&&(e=new AbortController,r=setTimeout(function(){e.abort()},l)),s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?en(Object(r),!0).forEach(function(e){rn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({"Content-Type":"application/json","X-Rollbar-Access-Token":n,signal:e&&e.signal},s),fetch(o,{method:i,headers:s,body:a}).then(function(t){r&&clearTimeout(r);var e=t.headers,n=o.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.get("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.get("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.get("Rollbar-Replay-RateLimit-Reset")}:{},i=t.json();u(null,i,n)}).catch(function(t){At.error(t.message),u(t)})};function on(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return an(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?an(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function an(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function sn(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}var un=function(t){var e,r=t.accessToken,n=t.url,o=t.method,i=t.payload,s=t.headers,u=t.callback,l=t.requestFactory,c=t.timeout;if(!(e=l?l():function(){var t,e,r=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=r.length;for(e=0;e<n;e++)try{t=r[e]();break}catch(t){}return t}()))return u(new Error("No way to send a request"));try{try{var p=function(){try{if(p&&4===e.readyState){p=void 0;var t=g(e.responseText);if(function(t){return t&&t.status&&200===t.status}(e)){var r=n.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.getResponseHeader("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.getResponseHeader("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.getResponseHeader("Rollbar-Replay-RateLimit-Reset")}:{};return void u(t.error,t.value,r)}if(function(t){return t&&a(t.status,"number")&&t.status>=400&&t.status<600}(e)){if(403===e.status){var o=t.value&&t.value.message;At.error(o)}u(new Error(String(e.status)))}else{u(sn("XHR response had no status code (likely connection failure)"))}}}catch(t){var i;i=t&&t.stack?t:new Error(t),u(i)}};if(e.open(o,n,!0),e.setRequestHeader){e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("X-Rollbar-Access-Token",r);for(var d=0,h=Object.entries(null!=s?s:{});d<h.length;d++){var y=on(h[d],2),v=y[0],m=y[1];e.setRequestHeader(v,m)}}f(c)&&(e.timeout=c),e.onreadystatechange=p,e.send(i)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return u(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===n.substring(0,5)&&(n="http"+n.substring(5));var b=new XDomainRequest;b.onprogress=function(){},b.ontimeout=function(){u(sn("Request timed out","ETIMEDOUT"))},b.onerror=function(){u(new Error("Error during request"))},b.onload=function(){var t=g(b.responseText);u(t.error,t.value)},b.open(o,n,!0),b.send(i)}else u(new Error("Cannot find a method to transport a request"))}}catch(t){u(t)}};function ln(t){this.truncation=t}ln.prototype.get=function(t,e,r,n,o){n&&u(n)||(n=function(){}),function(t,e,r){(r=r||{}).access_token=t;var n,o=[];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&o.push([n,r[n]].join("="));var i="?"+o.sort().join("&");(e=e||{}).path=e.path||"";var a,s=e.path.indexOf("?"),u=e.path.indexOf("#");-1!==s&&(-1===u||u>s)?(a=e.path,e.path=a.substring(0,s)+i+"&"+a.substring(s+1)):-1!==u?(a=e.path,e.path=a.substring(0,u)+i+a.substring(u)):e.path=e.path+i}(t,e,r);var i=m(e);this._makeZoneRequest({accessToken:t,url:i,method:"GET",callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},ln.prototype.post=function(t){var e,r=t.accessToken,n=t.options,o=t.payload,i=t.headers,a=t.callback,s=t.requestFactory;if(a&&u(a)||(a=function(){}),!o)return a(new Error("Cannot send empty request"));if((e=this.truncation&&o.body?this.truncation.truncate(o):b(o)).error)return a(e.error);var l=m(n);this._makeZoneRequest({accessToken:r,url:l,method:"POST",payload:e.value,headers:i,callback:a,requestFactory:s,timeout:n.timeout,transport:n.transport})},ln.prototype.postJsonPayload=function(t,e,r,n,o){n&&u(n)||(n=function(){});var i=m(e);this._makeZoneRequest({accessToken:t,url:i,method:"POST",payload:r,callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},ln.prototype._makeZoneRequest=function(){var t=this,e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=e&&e.Zone&&e.Zone.root,n=Array.prototype.slice.call(arguments);r?r.run(function(){t._makeRequest.apply(void 0,n)}):this._makeRequest.apply(void 0,n)},ln.prototype._makeRequest=function(t){var e=t.payload,r=t.callback,n=t.transport;if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,function(t){},function(t){e(new Error(t))})}(e,r);"fetch"===n?nn(t):un(t)};var cn,fn=ln;function pn(t){var e,r,n={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(-1!==(e=t.indexOf("//"))?(n.protocol=t.substring(0,e),r=e+2):r=0,-1!==(e=t.indexOf("@",r))&&(n.auth=t.substring(r,e),r=e+1),-1===(e=t.indexOf("/",r))){if(-1===(e=t.indexOf("?",r)))return-1===(e=t.indexOf("#",r))?n.host=t.substring(r):(n.host=t.substring(r,e),n.hash=t.substring(e)),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),n;n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e}else n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e;if(-1===(e=t.indexOf("#",r))?n.path=t.substring(r):(n.path=t.substring(r,e),n.hash=t.substring(e)),n.path){var o=n.path.split("?");n.pathname=o[0],n.query=o[1],n.search=n.query?"?"+n.query:null}return n}function dn(t){return dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(t)}function hn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function yn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hn(Object(r),!0).forEach(function(e){mn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function vn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bn(n.key),n)}}function mn(t,e,r){return(e=bn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bn(t){var e=function(t,e){if("object"!=dn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dn(e)?e:e+""}var gn=null,wn=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),At.init({logLevel:e.logLevel||"error"}),this.options=A(Sn,e,null,At),this.options._configuredOptions=e,this.components=this.components||{};var o=this.components.telemeter,i=this.components.instrumenter;this.wrapGlobals=this.components.wrapGlobals,this.scrub=this.components.scrub;var a=this.components.truncation,s=this.components.tracing,l=this.components.replay,c=new fn(a),f=new Ne(this.options,c,r,a);if(s&&(this.tracing=new s(kn(),f,this.options),this.tracing.initSession()),o&&(this.telemeter=new o(this.options,this.tracing)),l&&"undefined"!=typeof window){var p=this.options.replay;this.replay=new l({tracing:this.tracing,telemeter:this.telemeter,options:p}),p.enabled&&p.autoStart&&this.replay.recorder.start()}this.client=n||new Ar(this.options,f,At,this.telemeter,this.tracing,this.replay,"browser");var d=kn(),h="undefined"!=typeof document&&document;this.isChrome=d.chrome&&d.chrome.runtime,this.anonymousErrorsPending=0,function(t,e,r){t.addTransform(Wr).addTransform($r).addTransform(Gr).addTransform(zr).addTransform(function(t){return function(e,r,n){var o={};t&&t.location&&(o.url=t.location.href,o.query_string=t.location.search);var i="$remote_ip";r.captureIp?!0!==r.captureIp&&(i+="_anonymize"):i=null,i&&(o.user_ip=i),Object.keys(o).length>0&&T(e,"data.request",o),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t)return n(null,e);var o=t.navigator||{},i=t.screen||{};T(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:o.userAgent,language:o.language,cookie_enabled:o.cookieEnabled,screen:{width:i.width,height:i.height}}}),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t||!t.navigator)return n(null,e);for(var o,i=[],a=t.navigator.plugins||[],s=0,u=a.length;s<u;++s)o=a[s],i.push({name:o.name,description:o.description});T(e,"data.client.javascript.plugins",i),n(null,e)}}(r)).addTransform(Xr).addTransform(qr).addTransform(Lr).addTransform(Dr).addTransform((n=e.scrub,function(t,e,r){if(n){var o=e.scrubFields||[],i=e.scrubPaths||[];t.data=n(t.data,o,i)}r(null,t)})).addTransform(Cr).addTransform(Nr(At)).addTransform(Ur).addTransform(Hr).addTransform(Rr);var n}(this.client.notifier,this,d),function(t){t.addPredicate(ir).addPredicate(Br).addPredicate(function(t){return function(e,r){var n=Boolean(e._isUncaught);delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{u(r.onSendCallback)&&r.onSendCallback(n,o,e)}catch(e){r.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(u(r.checkIgnore)&&r.checkIgnore(n,o,e))return!1}catch(e){r.checkIgnore=null,t.error("Error while calling custom checkIgnore(), removing",e)}return!0}}(At)).addPredicate(function(t){return function(e,r){return!sr(e,r,"blocklist",t)}}(At)).addPredicate(function(t){return function(e,r){return sr(e,r,"safelist",t)}}(At)).addPredicate(ur(At))}(this.client.queue),this.setupUnhandledCapture(),i&&(this.instrumenter=new i(this.options,this.client.telemeter,this,d,h),this.instrumenter.instrument()),this.setSessionAttributesFromOptions(e),this.rollbar=this}return function(t,e,r){return e&&vn(t.prototype,e),r&&vn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"global",value:function(t){return this.client.global(t),this}},{key:"configure",value:function(t,e){var r,n,o;t.logLevel&&At.init({logLevel:t.logLevel}),this.setSessionAttributesFromOptions(t);var i=this.options,a={};return e&&(a={payload:e}),this.options=A(i,t,a,At),this.options._configuredOptions=A(i._configuredOptions,t,a),null===(r=this.tracing)||void 0===r||r.configure(this.options),null===(n=this.replay)||void 0===n||n.configure(this.options.replay),this.client.configure(this.options,e),null===(o=this.instrumenter)||void 0===o||o.configure(this.options),this.setupUnhandledCapture(),this}},{key:"lastError",value:function(){return this.client.lastError}},{key:"log",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}}},{key:"debug",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}}},{key:"info",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}}},{key:"warn",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}}},{key:"warning",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}}},{key:"error",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}}},{key:"critical",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}}},{key:"buildJsonPayload",value:function(t){return this.client.buildJsonPayload(t)}},{key:"sendJsonPayload",value:function(t){return this.client.sendJsonPayload(t)}},{key:"triggerDirectReplay",value:function(t){return this.triggerReplay(yn({type:"direct"},t))}},{key:"triggerReplay",value:function(t){return this.replay?this.replay.triggerReplay(t):null}},{key:"setupUnhandledCapture",value:function(){var t=kn();this.unhandledExceptionsInitialized||(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(!function(t,e,r){if(t){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(t.onerror){for(n=t.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var o=function(){var r=Array.prototype.slice.call(arguments,0);!function(t,e,r,n){t._rollbarWrappedError&&(n[4]||(n[4]=t._rollbarWrappedError),n[5]||(n[5]=t._rollbarWrappedError._rollbarContext),t._rollbarWrappedError=null);var o=e.handleUncaughtException.apply(e,n);r&&r.apply(t,n),"anonymous"===o&&(e.anonymousErrorsPending+=1)}(t,e,n,r)};r&&(o._rollbarOldOnError=n),t.onerror=o}}(t,this),this.wrapGlobals&&this.options.wrapGlobalEventHandlers&&this.wrapGlobals(t,this),this.unhandledExceptionsInitialized=!0),this.unhandledRejectionsInitialized||(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&(!function(t,e,r){if(t){"function"==typeof t._rollbarURH&&t._rollbarURH.belongsToShim&&t.removeEventListener("unhandledrejection",t._rollbarURH);var n=function(t){var r,n,o;try{r=t.reason}catch(t){r=void 0}try{n=t.promise}catch(t){n="[unhandledrejection] error getting `promise` from event"}try{o=t.detail,!r&&o&&(r=o.reason,n=o.promise)}catch(t){}r||(r="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(r,n)};n.belongsToShim=r,t._rollbarURH=n,t.addEventListener("unhandledrejection",n)}}(t,this),this.unhandledRejectionsInitialized=!0)}},{key:"handleUncaughtException",value:function(t,e,r,n,o,i){if(this.options.captureUncaught||this.options.handleUncaughtExceptions){if(this.options.inspectAnonymousErrors&&this.isChrome&&null===o&&""===e)return"anonymous";var a,s=w(t,e,r,n,o,"onerror","uncaught exception",rr);p(o)?(a=this._createItem([t,o,i]))._unhandledStackInfo=s:p(e)?(a=this._createItem([t,e,i]))._unhandledStackInfo=s:(a=this._createItem([t,i])).stackInfo=s,a.level=this.options.uncaughtErrorLevel,a._isUncaught=!0,this.client.log(a)}}},{key:"handleAnonymousErrors",value:function(){var t=this;if(this.options.inspectAnonymousErrors&&this.isChrome){try{Error.prepareStackTrace=function(e,r){if(t.options.inspectAnonymousErrors&&t.anonymousErrorsPending){if(t.anonymousErrorsPending-=1,!e)return;e._isAnonymous=!0,t.handleUncaughtException(e.message,null,null,null,e)}return e.stack}}catch(t){this.options.inspectAnonymousErrors=!1,this.error("anonymous error handler failed",t)}}}},{key:"handleUnhandledRejection",value:function(t,e){if(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections){var r="unhandled rejection was null or undefined!";if(t)if(t.message)r=t.message;else{var n=b(t);n.value&&(r=n.value)}var o,i=t&&t._rollbarContext||e&&e._rollbarContext;p(t)?o=this._createItem([r,t,i]):(o=this._createItem([r,t,i])).stackInfo=w(r,"",0,0,null,"unhandledrejection","",rr),o.level=this.options.uncaughtErrorLevel,o._isUncaught=!0,o._originalArgs=o._originalArgs||[],o._originalArgs.push(e),this.client.log(o)}}},{key:"wrap",value:function(t,e,r){try{var n;if(n=u(e)?e:function(){return e||{}},!u(t))return t;if(t._isWrap)return t;if(!t._rollbar_wrapped)for(var o in t._rollbar_wrapped=function(){r&&u(r)&&r.apply(this,arguments);try{return t.apply(this,arguments)}catch(r){var e=r;throw e&&window._rollbarWrappedError!==e&&(a(e,"string")&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=t.toString(),window._rollbarWrappedError=e),e}},t._rollbar_wrapped._isWrap=!0,t)c(t,o)&&"_rollbar_wrapped"!==o&&(t._rollbar_wrapped[o]=t[o]);return t._rollbar_wrapped}catch(e){return t}}},{key:"captureEvent",value:function(){var t=function(t){for(var e,r,n,o,i=0,a=t.length;i<a;++i)switch(s(o=t[i])){case"string":!e&&E(O,o)?e=o:!n&&E(x,o)&&(n=o);break;case"object":r=o}return{type:e||"manual",metadata:r||{},level:n}}(arguments);return this.client.captureEvent(t.type,t.metadata,t.level)}},{key:"setSessionUser",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&this.tracing.session.setUser(t)}},{key:"setSessionAttributes",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&(t=yn({},t),this.tracing.session.setAttributes(t))}},{key:"setSessionAttributesFromOptions",value:function(t){var e,r,n,o,i,a=t.person||(null===(e=t.payload)||void 0===e?void 0:e.person);a&&this.setSessionUser(a);var s=(null===(r=t.client)||void 0===r||null===(r=r.javascript)||void 0===r?void 0:r.code_version)||t.codeVersion||t.code_version||(null===(n=t.payload)||void 0===n||null===(n=n.client)||void 0===n||null===(n=n.javascript)||void 0===n?void 0:n.code_version)||(null===(o=t.payload)||void 0===o?void 0:o.code_version)||(null===(i=t.payload)||void 0===i?void 0:i.codeVersion);this.setSessionAttributes({"rollbar.codeVersion":s,"rollbar.notifier.name":"rollbar-browser-js","rollbar.notifier.version":t.version})}},{key:"captureDomContentLoaded",value:function(t,e){return e||(e=new Date),this.client.captureDomContentLoaded(e)}},{key:"captureLoad",value:function(t,e){return e||(e=new Date),this.client.captureLoad(e)}},{key:"loadFull",value:function(){At.info("Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.")}},{key:"_createItem",value:function(t){return _(t,At,this)}}],[{key:"init",value:function(e,r){return gn?gn.global(e).configure(e):gn=new t(e,r)}},{key:"setComponents",value:function(e){t.prototype.components=e}},{key:"callInstance",value:function(t,e){if(gn)return gn[t].apply(gn,e);var r="Rollbar is not initialized";At.error(r);var n=function(t){for(var e=0,r=t.length;e<r;++e)if(u(t[e]))return t[e];return}(e);n&&n(new Error(r))}}])}();function kn(){return"undefined"!=typeof window&&window||"undefined"!=typeof self&&self}cn=wn,mn(wn,"global",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("global",e)}),mn(wn,"configure",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("configure",e)}),mn(wn,"lastError",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("lastError",e)}),mn(wn,"log",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("log",e)}),mn(wn,"debug",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("debug",e)}),mn(wn,"info",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("info",e)}),mn(wn,"warn",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("warn",e)}),mn(wn,"warning",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("warning",e)}),mn(wn,"error",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("error",e)}),mn(wn,"critical",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("critical",e)}),mn(wn,"buildJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("buildJsonPayload",e)}),mn(wn,"sendJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("sendJsonPayload",e)}),mn(wn,"wrap",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("wrap",e)}),mn(wn,"captureEvent",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return cn.callInstance("captureEvent",e)});var Sn={environment:"unknown",version:De,scrubFields:Vr.scrubFields,logLevel:Ue,reportLevel:He,uncaughtErrorLevel:Fe,endpoint:Me,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!0,captureIp:!0,inspectAnonymousErrors:!0,ignoreDuplicateErrors:!0,wrapGlobalEventHandlers:!1,replay:{enabled:!1,autoStart:!0,triggerDefaults:{samplingRatio:1,preDuration:300,postDuration:5},triggers:[{type:"occurrence",level:["error","critical"]}],debug:{logErrors:!0,logEmits:!1},inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,maskInputOptions:{password:!0,email:!1,tel:!1,text:!1,color:!1,date:!1,"datetime-local":!1,month:!1,number:!1,range:!1,search:!1,time:!1,url:!1,week:!1},maskAllInputs:!1,blockClass:"rb-block",maskTextClass:"rb-mask",ignoreClass:"rb-ignore",slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}},tracing:{enabled:!1,endpoint:"api.rollbar.com/api/1/session/"}},_n=wn;function On(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function xn(t){this.map={},t instanceof xn?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}xn.prototype.append=function(t,e){t=On(t),e=function(t){return"string"!=typeof t&&(t=String(t)),t}(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},xn.prototype.get=function(t){return t=On(t),this.has(t)?this.map[t]:null},xn.prototype.has=function(t){return c(this.map,On(t))},xn.prototype.forEach=function(t,e){for(var r in this.map)c(this.map,r)&&t.call(e,this.map[r],r,this)},xn.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),function(t){return{next:function(){var e=t.shift();return{done:void 0===e,value:e}}}}(t)};var En=function(t){return"undefined"==typeof Headers?new xn(t):new Headers(t)};var jn=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};function In(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Tn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Tn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Pn(t){return function(t){for(var e,r,n=[],o=0,i=t.length-1;i>=0;i--){if(e=An(t[i]),r=o+3*n.length+e.length,i<t.length-1&&r>=83){n.unshift("...");break}n.unshift(e),o+=e.length}return n.join(" > ")}(function(t){for(var e,r=[],n=0;t&&n<5&&(e=Rn(t))&&"html"!==e.tagName;n++)r.unshift(e),t=t.parentNode;return r}(t))}function An(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));var r,n=In(t.attributes);try{for(n.s();!(r=n.n()).done;){var o=r.value;e.push("["+o.key+'="'+o.value+'"]')}}catch(t){n.e(t)}finally{n.f()}return e.join("")}function Rn(t){if(!t||!t.tagName)return null;var e,r={};r.tagName=t.tagName.toLowerCase(),t.id&&(r.id=t.id),(e=t.className)&&"string"==typeof e&&(r.classes=e.split(/\s+/));r.attributes=[];for(var n=0,o=["type","name","title","alt"];n<o.length;n++){var i=o[n],a=t.getAttribute(i);a&&r.attributes.push({key:i,value:a})}return r}function Cn(t){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cn(t)}function Ln(t){return function(t){if(Array.isArray(t))return Un(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Mn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nn(n.key),n)}}function Nn(t){var e=function(t,e){if("object"!=Cn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Cn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Cn(e)?e:e+""}function Dn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Mn(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Mn(t,e){if(t){if("string"==typeof t)return Un(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Un(t,e):void 0}}function Un(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Hn={network:!0,networkResponseHeaders:!1,networkResponseBody:!1,networkRequestHeaders:!1,networkRequestBody:!1,networkErrorOnHttp5xx:!1,networkErrorOnHttp4xx:!1,networkErrorOnHttp0:!1,log:!0,dom:!0,navigation:!0,connectivity:!0,contentSecurityPolicy:!0,errorOnContentSecurityPolicy:!1};function Fn(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function Jn(t){var e,r=[],n=Dn(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return function(t){var e=function(t){if(!t||!t.attributes)return null;var e,r=Dn(t.attributes);try{for(r.s();!(e=r.n()).done;){var n=e.value;if("name"===n.key)return n.value}}catch(t){r.e(t)}finally{r.f()}return null}(t);if(!e)return!1;for(var n=0,o=r;n<o.length;n++){if(o[n].test(e))return!0}return!1}}var Vn=function(){return function(t,e,r){return e&&qn(t.prototype,e),r&&qn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(e=Nn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(this,"deinstrumentConnectivity",function(){this.removeListeners("connectivity")}),this.options=e;var s=e.autoInstrument;!1===e.enabled||!1===s?this.autoInstrument={}:(a(s,"object")||(s=Hn),this.autoInstrument=R(Hn,s)),this.configureScrubbing(),this.telemeter=r,this.rollbar=n,this.diagnostic=n.client.notifier.diagnostic,this._window=o||{},this._document=i||{},this.replacements={network:[],log:[],navigation:[],connectivity:[]},this.eventRemovers={dom:[],connectivity:[],contentsecuritypolicy:[]},this._location=this._window.location,this._lastHref=this._location&&this._location.href},[{key:"configureScrubbing",value:function(){var t,e,r,n,o,i,a,s,u,l,c=this.options;this.scrubTelemetryInputs=Boolean(null!==(t=c.scrubTelemetryInputs)&&void 0!==t?t:null===(e=c.replay)||void 0===e?void 0:e.maskAllInputs),this.telemetryScrubber=c.telemetryScrubber,this.defaultValueScrubber=Jn(c.scrubFields),this.maskInputFn=null===(r=c.replay)||void 0===r?void 0:r.maskInputFn,this.maskInputOptions=(null===(n=c.replay)||void 0===n?void 0:n.maskInputOptions)||{},this.scrubClasses=[null===(o=c.replay)||void 0===o?void 0:o.blockClass,null===(i=c.replay)||void 0===i?void 0:i.ignoreClass,null===(a=c.replay)||void 0===a?void 0:a.maskTextClass].filter(Boolean),this.scrubSelectors=[null===(s=c.replay)||void 0===s?void 0:s.blockSelector,null===(u=c.replay)||void 0===u?void 0:u.ignoreSelector,null===(l=c.replay)||void 0===l?void 0:l.maskTextSelector].filter(Boolean)}},{key:"configure",value:function(t){this.options=R(this.options,t);var e=t.autoInstrument,r=R(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(a(e,"object")||(e=Hn),this.autoInstrument=R(Hn,e)),this.configureScrubbing(),this.instrument(r)}},{key:"instrument",value:function(t){!this.autoInstrument.network||t&&t.network?!this.autoInstrument.network&&t&&t.network&&this.deinstrumentNetwork():this.instrumentNetwork(),!this.autoInstrument.log||t&&t.log?!this.autoInstrument.log&&t&&t.log&&this.deinstrumentConsole():this.instrumentConsole(),!this.autoInstrument.dom||t&&t.dom?!this.autoInstrument.dom&&t&&t.dom&&this.deinstrumentDom():this.instrumentDom(),!this.autoInstrument.navigation||t&&t.navigation?!this.autoInstrument.navigation&&t&&t.navigation&&this.deinstrumentNavigation():this.instrumentNavigation(),!this.autoInstrument.connectivity||t&&t.connectivity?!this.autoInstrument.connectivity&&t&&t.connectivity&&this.deinstrumentConnectivity():this.instrumentConnectivity(),!this.autoInstrument.contentSecurityPolicy||t&&t.contentSecurityPolicy?!this.autoInstrument.contentSecurityPolicy&&t&&t.contentSecurityPolicy&&this.deinstrumentContentSecurityPolicy():this.instrumentContentSecurityPolicy()}},{key:"deinstrumentNetwork",value:function(){Fn(this.replacements,"network")}},{key:"instrumentNetwork",value:function(){var t=this;function e(e,r){e in r&&u(r[e])&&jn(r,e,function(e){return t.rollbar.wrap(e)})}if("XMLHttpRequest"in this._window){var r=this._window.XMLHttpRequest.prototype;jn(r,"open",function(t){return function(e,r){var n=Bn(r);return(a(r,"string")||n)&&(r=n?r.toString():r,this.__rollbar_xhr?(this.__rollbar_xhr.method=e,this.__rollbar_xhr.url=r,this.__rollbar_xhr.status_code=null,this.__rollbar_xhr.start_time_ms=P(),this.__rollbar_xhr.end_time_ms=null):this.__rollbar_xhr={method:e,url:r,status_code:null,start_time_ms:P(),end_time_ms:null}),t.apply(this,arguments)}},this.replacements,"network"),jn(r,"setRequestHeader",function(e){return function(r,n){return this.__rollbar_xhr||(this.__rollbar_xhr={}),a(r,"string")&&a(n,"string")&&(t.autoInstrument.networkRequestHeaders&&(this.__rollbar_xhr.request_headers||(this.__rollbar_xhr.request_headers={}),this.__rollbar_xhr.request_headers[r]=n),"content-type"===r.toLowerCase()&&(this.__rollbar_xhr.request_content_type=n)),e.apply(this,arguments)}},this.replacements,"network"),jn(r,"send",function(r){return function(n){var o=this;function i(){if(o.__rollbar_xhr&&(null===o.__rollbar_xhr.status_code&&(o.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(o.__rollbar_xhr.request=n),o.__rollbar_event=t.captureNetwork(o.__rollbar_xhr,"xhr",void 0)),o.readyState<2&&(o.__rollbar_xhr.start_time_ms=P()),o.readyState>3)){var e=P();o.__rollbar_xhr.end_time_ms=e;var r=null;if(o.__rollbar_xhr.response_content_type=o.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var i=t.autoInstrument.networkResponseHeaders;r={};try{var a;if(!0===i){var s=o.getAllResponseHeaders();if(s){var u,l,c,f=Dn(s.trim().split(/[\r\n]+/));try{for(f.s();!(c=f.n()).done;){a=(u=c.value.split(": ")).shift(),l=u.join(": "),r[a]=l}}catch(t){f.e(t)}finally{f.f()}}}else{var p,d=Dn(i);try{for(d.s();!(p=d.n()).done;){var h=p.value;r[h]=o.getResponseHeader(h)}}catch(t){d.e(t)}finally{d.f()}}}catch(t){}}var y=null;if(t.autoInstrument.networkResponseBody)try{y=o.responseText}catch(t){}var v=null;(y||r)&&(v={},y&&(t.isJsonContentType(o.__rollbar_xhr.response_content_type)?v.body=t.scrubJson(y):v.body=y),r&&(v.headers=r)),v&&(o.__rollbar_xhr.response=v);try{var m=o.status;m=1223===m?204:m,o.__rollbar_xhr.status_code=m,t.addOtelNetworkResponse(o.__rollbar_event,e,m),o.__rollbar_event.level=t.telemeter.levelFromStatus(m),t.errorOnHttpStatus(o.__rollbar_xhr)}catch(t){}}}return e("onload",o),e("onerror",o),e("onprogress",o),"onreadystatechange"in o&&u(o.onreadystatechange)?jn(o,"onreadystatechange",function(e){return t.rollbar.wrap(e,void 0,i)}):o.onreadystatechange=i,o.__rollbar_xhr&&t.trackHttpErrors()&&(o.__rollbar_xhr.stack=(new Error).stack),r.apply(this,arguments)}},this.replacements,"network")}"fetch"in this._window&&jn(this._window,"fetch",function(e){return function(r,n){var o,i=Array.prototype.slice.call(arguments),s=i[0],u="GET",l=Bn(s);a(s,"string")||l?o=l?s.toString():s:s&&(o=s.url,s.method&&(u=s.method)),i[1]&&i[1].method&&(u=i[1].method);var c={method:u,url:o,status_code:null,start_time_ms:P(),end_time_ms:null};if(i[1]&&i[1].headers){var f=En(i[1].headers);c.request_content_type=f.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(c.request_headers=t.fetchHeaders(f,t.autoInstrument.networkRequestHeaders))}t.autoInstrument.networkRequestBody&&(i[1]&&i[1].body?c.request=i[1].body:i[0]&&!a(i[0],"string")&&i[0].body&&(c.request=i[0].body));var p=t.captureNetwork(c,"fetch",void 0);return t.trackHttpErrors()&&(c.stack=(new Error).stack),e.apply(this,i).then(function(e){var r=P();c.end_time_ms=r,c.status_code=e.status,t.addOtelNetworkResponse(p,r,e.status),c.response_content_type=e.headers.get("Content-Type");var n=null;t.autoInstrument.networkResponseHeaders&&(n=t.fetchHeaders(e.headers,t.autoInstrument.networkResponseHeaders));var o=null;return t.autoInstrument.networkResponseBody&&"function"==typeof e.text&&(o=e.clone().text()),(n||o)&&(c.response={},o&&("function"==typeof o.then?o.then(function(e){e&&t.isJsonContentType(c.response_content_type)?c.response.body=t.scrubJson(e):c.response.body=e}):c.response.body=o),n&&(c.response.headers=n)),t.errorOnHttpStatus(c),e})}},this.replacements,"network")}},{key:"captureNetwork",value:function(t,e,r){return t.request&&this.isJsonContentType(t.request_content_type)&&(t.request=this.scrubJson(t.request)),this.telemeter.captureNetwork(t,e,r)}},{key:"isJsonContentType",value:function(t){return!!(t&&a(t,"string")&&t.toLowerCase().includes("json"))}},{key:"addOtelNetworkResponse",value:function(t,e,r){t.otelAttributes&&(t.otelAttributes["response.timeUnixNano"]=(1e6*e).toString(),t.otelAttributes.statusCode=r)}},{key:"scrubJson",value:function(t){return JSON.stringify(U(JSON.parse(t),this.options.scrubFields))}},{key:"fetchHeaders",value:function(t,e){var r={};try{if(!0===e){if("function"==typeof t.entries)for(var n=t.entries(),o=n.next();!o.done;)r[o.value[0]]=o.value[1],o=n.next()}else{var i,a=Dn(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;r[s]=t.get(s)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){}return r}},{key:"trackHttpErrors",value:function(){return this.autoInstrument.networkErrorOnHttp5xx||this.autoInstrument.networkErrorOnHttp4xx||this.autoInstrument.networkErrorOnHttp0}},{key:"errorOnHttpStatus",value:function(t){var e=t.status_code;if(e>=500&&this.autoInstrument.networkErrorOnHttp5xx||e>=400&&this.autoInstrument.networkErrorOnHttp4xx||0===e&&this.autoInstrument.networkErrorOnHttp0){var r=new Error("HTTP request failed with Status "+e);r.stack=t.stack,this.rollbar.error(r,{skipFrames:1})}}},{key:"deinstrumentConsole",value:function(){for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]}},{key:"instrumentConsole",value:function(){var t;if(null!==(t=this._window)&&void 0!==t&&null!==(t=t.console)&&void 0!==t&&t.log){var e=this,r=this._window.console;try{for(var n=0,o=["debug","info","warn","error","log"];n<o.length;n++){i(o[n])}}catch(t){this.diagnostic.instrumentConsole={error:t.message}}}function i(t){var n=r[t],o=r,i="warn"===t?"warning":t;r[t]=function(){var t=Array.prototype.slice.call(arguments),r=function(t){var e,r,n,o=[];for(e=0,r=t.length;e<r;++e){switch(s(n=t[e])){case"object":(n=(n=b(n)).error||n.value).length>500&&(n=n.substr(0,497)+"...");break;case"null":n="null";break;case"undefined":n="undefined";break;case"symbol":n=n.toString()}o.push(n)}return o.join(" ")}(t);e.telemeter.captureLog(r,i,null,P()),n&&Function.prototype.apply.call(n,o,t)},e.replacements.log.push([t,n])}}},{key:"deinstrumentDom",value:function(){this.removeListeners("dom")}},{key:"instrumentDom",value:function(){var t=this;this.addListener("dom",this._window,["click","dblclick","contextmenu"],function(e){return t.handleEvent("click",e)}),this.addListener("dom",this._window,["dragstart","dragend","dragenter","dragleave","drop"],function(e){return t.handleEvent("dragdrop",e)}),this.addListener("dom",this._window,["blur","focus"],function(e){return t.handleEvent("focus",e)}),this.addListener("dom",this._window,["submit","invalid"],function(e){return t.handleEvent("form",e)}),this.addListener("dom",this._window,["input","change"],function(e){return t.handleEvent("input",e)}),this.addListener("dom",this._window,["resize"],function(e){return t.handleEvent("resize",e)}),this.addListener("dom",this._document,["DOMContentLoaded"],function(e){return t.handleEvent("contentLoaded",e)})}},{key:"handleEvent",value:function(t,e){try{return{click:this.handleClick,dragdrop:this.handleDrag,focus:this.handleFocus,form:this.handleForm,input:this.handleInput,resize:this.handleResize,contentLoaded:this.handleContentLoaded}[t].call(this,e)}catch(r){At.log("".concat(t," handler error"),e,r,r.stack)}}},{key:"handleContentLoaded",value:function(t){this.rollbar.triggerReplay({type:"navigation",path:new URL(this._location.href).pathname})}},{key:"handleClick",value:function(t){var e,r=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase();["input","select","textarea"].includes(r)||this.telemeter.captureClick({type:t.type,isSynthetic:!t.isTrusted,element:Pn(t.target),timestamp:P()})}},{key:"handleFocus",value:function(t){var e,r=t.type,n=null!==(e=t.target)&&void 0!==e&&e.window?"window":Pn(t.target);this.telemeter.captureFocus({type:r,isSynthetic:!t.isTrusted,element:n,timestamp:P()})}},{key:"handleForm",value:function(t){}},{key:"handleResize",value:function(t){var e=window.screen.width/window.innerWidth;this.telemeter.captureResize({type:t.type,isSynthetic:!t.isTrusted,width:window.innerWidth,height:window.innerHeight,textZoomRatio:e,timestamp:P()})}},{key:"handleDrag",value:function(t){var e,r,n,o,i,a,s=t.type;if("drop"===s){e=[],r=[];var u,l=Dn([].concat(Ln(t.dataTransfer.files),Ln(t.dataTransfer.items)));try{for(l.s();!(u=l.n()).done;){var c=u.value;c.kind&&c.type&&(e.push(c.kind),r.push(c.type))}}catch(t){l.e(t)}finally{l.f()}}["drop","dragstart"].includes(s)&&(n=null===(i=t.dataTransfer)||void 0===i?void 0:i.dropEffect,o=null===(a=t.dataTransfer)||void 0===a?void 0:a.effectAllowed);this.telemeter.captureDragDrop({type:s,isSynthetic:!t.isTrusted,element:Pn(t.target),dropEffect:n,effectAllowed:o,kinds:JSON.stringify(e),mediaTypes:JSON.stringify(r),timestamp:P()})}},{key:"scrubInputValue",value:function(t,e,r,n){var o="******";if("password"===n)return o;if(this.scrubTelemetryInputs)return o;var i=Rn(e);if(this.telemetryScrubber){if(this.telemetryScrubber(i))return o}else if(this.defaultValueScrubber(i))return o;return function(t,e,r){try{var n,o=In(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("string"==typeof i){if(t.classList.contains(i))return!0}else{var a,s=In(t.classList);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(i.test(u))return!0}}catch(t){s.e(t)}finally{s.f()}}}}catch(t){o.e(t)}finally{o.f()}var l,c=In(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(t.matches(f))return!0}}catch(t){c.e(t)}finally{c.f()}}catch(t){}return!1}(e,this.scrubClasses,this.scrubSelectors)?o:this.maskInputOptions[r.toLowerCase()]||this.maskInputOptions[n]?this.maskInputFn?this.maskInputFn(t,e):o:t}},{key:"handleInput",value:function(t){var e,r,n,o,i=t.type,a=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase(),s=null===(r=t.target)||void 0===r?void 0:r.value,u=(null===(n=t.target)||void 0===n||null===(n=n.attributes)||void 0===n||null===(n=n.type)||void 0===n?void 0:n.value)||(null===(o=t.target)||void 0===o?void 0:o.type);switch(void 0!==s&&(s=this.scrubInputValue(s,t.target,a,u)),i){case"input":if(["radio","checkbox"].includes(u))return;["select","textarea"].includes(a)&&(u=a);break;case"change":if(!["radio","checkbox"].includes(u))return;var l;if("checkbox"===u)s=null===(l=t.target)||void 0===l?void 0:l.checked}this.telemeter.captureInput({type:u,isSynthetic:!t.isTrusted,element:Pn(t.target),value:s,timestamp:P()})}},{key:"deinstrumentNavigation",value:function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&Fn(this.replacements,"navigation")}},{key:"instrumentNavigation",value:function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;jn(this._window,"onpopstate",function(t){return function(){var r=e._location.href;e.handleUrlChange(e._lastHref,r),t&&t.apply(this,arguments)}},this.replacements,"navigation"),jn(this._window.history,"pushState",function(t){return function(){var r=arguments.length>2?arguments[2]:void 0;return r&&e.handleUrlChange(e._lastHref,String(r)),t.apply(this,arguments)}},this.replacements,"navigation")}}},{key:"handleUrlChange",value:function(t,e){var r=pn(this._location.href),n=pn(e),o=pn(t);this._lastHref=e,r.protocol===n.protocol&&r.host===n.host&&(e=n.path+(n.hash||"")),r.protocol===o.protocol&&r.host===o.host&&(t=o.path+(o.hash||"")),this.telemeter.captureNavigation(t,e,null,P()),this.rollbar.triggerReplay({type:"navigation",path:e})}},{key:"instrumentConnectivity",value:function(){var t=this;this.addListener("connectivity",this._window,["online","offline"],function(e){return t.handleConnectivity(e)})}},{key:"handleConnectivity",value:function(t){var e=t.type;this.telemeter.captureConnectivityChange({type:e,isSynthetic:!t.isTrusted,timestamp:P()})}},{key:"handleCspEvent",value:function(t){var e="Security Policy Violation: blockedURI: "+t.blockedURI+", violatedDirective: "+t.violatedDirective+", effectiveDirective: "+t.effectiveDirective+", ";t.sourceFile&&(e+="location: "+t.sourceFile+", line: "+t.lineNumber+", col: "+t.columnNumber+", "),e+="originalPolicy: "+t.originalPolicy,this.telemeter.captureLog(e,"error",null,P()),this.handleCspError(e)}},{key:"handleCspError",value:function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)}},{key:"deinstrumentContentSecurityPolicy",value:function(){this.removeListeners("contentsecuritypolicy")}},{key:"instrumentContentSecurityPolicy",value:function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,["securitypolicyviolation"],t)}}},{key:"addListener",value:function(t,e,r,n){var o=this;if(e.addEventListener){var i,a=Dn(r);try{var s=function(){var r=i.value,a={capture:!0,passive:!0};e.addEventListener(r,n,a,!0),o.eventRemovers[t].push(function(){e.removeEventListener(r,n,a)})};for(a.s();!(i=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}}}},{key:"removeListeners",value:function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()}}])}();function Bn(t){return"undefined"!=typeof URL&&t instanceof URL}var Wn=Vn;function $n(t,e,r){if(c(e,"addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var o=function(e,r,o){n.call(this,e,t.wrap(r),o)};o._rollbarOldAdd=n,o.belongsToShim=r,e.addEventListener=o;for(var i=e.removeEventListener;i._rollbarOldRemove&&i.belongsToShim;)i=i._rollbarOldRemove;var a=function(t,e,r){i.call(this,t,e&&e._rollbar_wrapped||e,r)};a._rollbarOldRemove=i,a.belongsToShim=r,e.removeEventListener=a}}var Gn=function(t,e,r){if(t){var n,o,i="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(n=0;n<i.length;++n)t[o=i[n]]&&t[o].prototype&&$n(e,t[o].prototype,r)}};_n.setComponents({telemeter:Q,instrumenter:Wn,wrapGlobals:Gn,scrub:U,truncation:be,tracing:ie});var zn=_n,Xn="undefined"!=typeof window&&window._rollbarConfig,Zn=Xn&&Xn.globalAlias||"Rollbar",Qn="undefined"!=typeof window&&window[Zn]&&"function"==typeof window[Zn].shimId&&void 0!==window[Zn].shimId();if("undefined"==typeof window||window._rollbarStartTime||(window._rollbarStartTime=(new Date).getTime()),!Qn&&Xn){var Kn=new zn(Xn);window[Zn]=Kn}else"undefined"!=typeof window?(window.rollbar=zn,window._rollbarDidLoad=!0):"undefined"!=typeof self&&(self.rollbar=zn,self._rollbarDidLoad=!0);var Yn=zn;return e=e.default}()});
3
3
  //# sourceMappingURL=rollbar.umd.min.js.map