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,2 +1,2 @@
1
1
  /*! For license information please see rollbar.min.cjs.LICENSE.txt */
2
- (()=>{"use strict";var t={d:(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:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>or});const r=require("util"),n=require("os");var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=function(t){if(!t||"[object Object]"!==i.call(t))return!1;var e,r=o.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&o.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||o.call(t,e)};const s=function t(){var e,r,n,o,i,s=Object.create(null),u=null,c=arguments.length;for(e=0;e<c;e++)if(null!=(u=arguments[e]))for(i in u)r=s[i],s!==(n=u[i])&&(n&&a(n)?(o=r&&a(r)?r:{},s[i]=t(o,n)):void 0!==n&&(s[i]=n));return s};function u(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 c(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)?c(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 c(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 p(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 h(t){return p(t,"function")}function d(t){var e=l(t);return null!=t&&("object"==e||"function"==e)}var m={debug:0,info:1,warning:2,error:3,critical:4};function v(t,e){var r,n;try{r=JSON.stringify(t)}catch(o){if(e&&h(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function y(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function g(t){return function t(e,r){var n,o,i,a={};try{for(o in e)(n=e[o])&&(p(n,"object")||p(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 b(t,e,r,n,o){for(var i,a,s,u,c,l,p=[],h=[],d=0,m=t.length;d<m;++d){var v=f(l=t[d]);switch(h.push(v),v){case"undefined":break;case"string":i?p.push(l):i=l;break;case"function":u=y(e,l);break;case"date":p.push(l);break;case"error":case"domexception":case"exception":a?p.push(l):a=l;break;case"object":case"array":if(l instanceof Error||"undefined"!=typeof DOMException&&l instanceof DOMException){a?p.push(l):a=l;break}if(n&&"object"===v&&!c){for(var b=0,w=n.length;b<w;++b)if(void 0!==l[n[b]]){c=l;break}if(c)break}s?p.push(l):s=l;break;default:if(l instanceof Error||"undefined"!=typeof DOMException&&l instanceof DOMException){a?p.push(l):a=l;break}p.push(l)}}s&&(s=g(s)),p.length>0&&(s||(s=g({})),s.extraArgs=g(p));var k,_={message:i,err:a,custom:s,timestamp:O(),callback:u,notifier:r,diagnostic:{},uuid:(k=O(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=(k+16*Math.random())%16|0;return k=Math.floor(k/16),("x"===t?e:7&e|8).toString(16)})))};return _.data=_.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)}(_,s),n&&c&&(_.request=c),o&&(_.lambdaContext=o),_._originalArgs=t,_.diagnostic.original_arg_types=h,_}var w=["log","network","dom","navigation","error","manual"],k=["critical","error","warning","info","debug"];function _(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1}function x(t,e){t.attributes=t.attributes||[];var r,n=u(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 E(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 S(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 O(){return Date.now?+Date.now():+new Date}function I(t,e,r,n){var o=s(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 T(t){this.startTime=O(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(t)}function L(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function P(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}}T.globalSettings={startTime:O(),maxItems:void 0,itemsPerMinute:void 0},T.prototype.configureGlobal=function(t){void 0!==t.startTime&&(T.globalSettings.startTime=t.startTime),void 0!==t.maxItems&&(T.globalSettings.maxItems=t.maxItems),void 0!==t.itemsPerMinute&&(T.globalSettings.itemsPerMinute=t.itemsPerMinute)},T.prototype.shouldSend=function(t,e){var r=(e=e||O())-this.startTime;(r<0||r>=6e4)&&(this.startTime=e,this.perMinCounter=0);var n=T.globalSettings.maxItems,o=T.globalSettings.itemsPerMinute;if(L(t,n,this.counter))return P(this.platform,this.platformOptions,n+" max items reached",!1);if(L(t,o,this.perMinCounter))return P(this.platform,this.platformOptions,o+" items per minute reached",!1);this.counter++,this.perMinCounter++;var i=!L(t,n,this.counter),a=i;return i=i&&!L(t,o,this.perMinCounter),P(this.platform,this.platformOptions,null,i,n,o,a)},T.prototype.setPlatformOptions=function(t,e){this.platform=t,this.platformOptions=e};const j=T;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 q(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,A(n.key),n)}}function A(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 C,M,U,D=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=s(r,t),this}},{key:"addPredicate",value:function(t){return h(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&&h(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&&x(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;h(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,i=!1;if(this.options.retryInterval){for(var a=0,s=t.RETRIABLE_ERRORS.length;a<s;a++)if(e.code===t.RETRIABLE_ERRORS[a]){i=!0;break}i&&(o=this.options.maxRetries,Number.isFinite(o))&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(i=!1))}i?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||E(t,"body.trace.exception.message")||E(t,"body.trace_chain.0.exception.message");if(r)return void this.logger.error(r);(r=E(t,"body.message.body"))&&this.logger.log(r)}}},{key:"_maybeCallWait",value:function(){return!(!h(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))}}])&&q(e.prototype,r),n&&q(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();C=D,U=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(M=A(M="RETRIABLE_ERRORS"))in C?Object.defineProperty(C,M,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[M]=U;const N=D;function F(t,e){this.queue=t,this.options=e,this.transforms=[],this.diagnostic={}}F.prototype.configure=function(t){this.queue&&this.queue.configure(t);var e=this.options;return this.options=s(e,t),this},F.prototype.addTransform=function(t){return h(t)&&this.transforms.push(t),this},F.prototype.log=function(t,e){if(e&&h(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))},F.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)};const H=F;function J(t,e,r,n,o,i,a){this.options=s(t),this.logger=r,J.rateLimiter.configureGlobal(this.options),J.rateLimiter.setPlatformOptions(a,this.options),this.api=e,this.queue=new N(J.rateLimiter,e,r,this.options,i),this.tracing=o;var u=this.options.tracer||null;W(u)?(this.tracer=u,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new H(this.queue,this.options),this.telemeter=n,B(t),this.lastError=null,this.lastErrorHash="none"}function B(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function W(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)}J.rateLimiter=new j({maxItems:0,itemsPerMinute:60}),J.prototype.global=function(t){return J.rateLimiter.configureGlobal(t),this},J.prototype.configure=function(t,e){var r=this.options,n={};e&&(n={payload:e}),this.options=s(r,t,n);var o=this.options.tracer||null;return W(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),B(t),this.global(this.options),W(t.tracer)&&(this.tracer=t.tracer),this},J.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},J.prototype.debug=function(t){this._log("debug",t)},J.prototype.info=function(t){this._log("info",t)},J.prototype.warn=function(t){this._log("warning",t)},J.prototype.warning=function(t){this._log("warning",t)},J.prototype.error=function(t){this._log("error",t)},J.prototype.critical=function(t){this._log("critical",t)},J.prototype.wait=function(t){this.queue.wait(t)},J.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},J.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},J.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},J.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},J.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},J.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)}},J.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}];x(t.data,o),null==n||n.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:t.uuid}])},J.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},J.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)},J.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}}}};const G=J;function z(t){if(!p(t.context,"string")){var e=v(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 $(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,a=e.path,s=e.search,u=t.timeout,c=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),l=t.proxy;if(t.endpoint){var p=r.parse(t.endpoint);n=p.hostname,o=p.protocol,i=p.port,a=p.pathname,s=p.search}return{timeout:u,hostname:n,protocol:o,port:i,path:a,search:s,proxy:l,transport:c}}function Q(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 Z(t){return Z="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},Z(t)}function V(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 X(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach((function(e){K(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function K(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Z(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y(){Y=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 c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:O(t,r,s)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",h="suspendedYield",d="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(j([])));_&&_!==r&&n.call(_,a)&&(w=_);var x=b.prototype=y.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var u=p(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Z(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(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 O(e,r,n){var o=f;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){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=I(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===f)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=p(e,r,n);if("normal"===c.type){if(o=n.done?m:h,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function I(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,I(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=p(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 T(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function j(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(Z(e)+" is not iterable")}return g.prototype=b,o(x,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},E(S.prototype),c(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(x),c(x,u,"Generator"),c(x,a,(function(){return this})),c(x,"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=j,P.prototype={constructor:P,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(L),!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"),c=n.call(a,"finallyLoc");if(u&&c){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(!c)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),L(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;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function tt(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 et={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},rt={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443};function nt(t,e,r,n){this.options=t,this.transport=e,this.url=r,this.truncation=n,this.accessToken=t.accessToken,this.transportOptions=ot(t,r),this.OTLPTransportOptions=it(t,r)}function ot(t,e){return $(t,et,e)}function it(t,e){var r;return $(t=X(X({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),rt,e)}nt.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)}})}))},nt.prototype.postItem=function(t,e){var r=Q(this.transportOptions,"POST"),n=z(t),o=this;setTimeout((function(){o.transport.post({accessToken:o.accessToken,options:r,payload:n,callback:e})}),0)},nt.prototype.postSpans=function(){var t,e=(t=Y().mark((function t(e){var r,n,o=arguments;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},n=Q(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){tt(i,n,o,a,s,"next",t)}function s(t){tt(i,n,o,a,s,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}(),nt.prototype.buildJsonPayload=function(t,e){var r,n=z(t);return(r=this.truncation?this.truncation.truncate(n):v(n)).error?(e&&e(r.error),null):r.value},nt.prototype.postJsonPayload=function(t,e){var r=Q(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)},nt.prototype.configure=function(t){var e=this.oldOptions;return this.options=s(e,t),this.transportOptions=ot(this.options,this.url),this.OTLPTransportOptions=it(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this};const at=nt;var st=function(){},ut={debug:0,info:1,warn:2,error:3,disable:4},ct={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return st("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return st("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return st("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return st("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return st("info",e)},init:function(t){var e=t.logLevel;st=function(t,r){ut[t]<ut[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}};const lt=ct;var pt="3.0.0-beta.5",ft="debug";function ht(t){return function(t){if(Array.isArray(t))return dt(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 dt(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)?dt(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.")}()}function dt(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 mt=["authorization","www-authorization","http_authorization","omniauth.auth","cookie","oauth-access-token","x-access-token","x_csrf_token","http_x_csrf_token","x-csrf-token"],vt=[].concat(ht(["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","X-Rollbar-Access-Token","secret_key","secretKey","secretToken"]),ht(["api_key","authenticity_token","oauth_token","token","user_session_secret"]),ht(["request.session.csrf","request.session._csrf","request.params._csrf","request.cookie","request.cookies"]));const yt=function(t,e,r){var n,o,i,a,s=p(t,"object"),u=p(t,"array"),c=[];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)&&c.push(n);else if(u)for(i=0;i<t.length;++i)c.push(i);var l=s?{}:[],f=!0;for(i=0;i<c.length;++i)o=t[n=c[i]],l[n]=e(n,o,r),f=f&&l[n]===t[n];return s&&!f&&(r.mapped[a]=l),f?t:l};function gt(t,e){return[t,v(t,e)]}function bt(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function wt(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=bt(n=i[a].frames,r),i[a].frames=n;else o.trace&&(n=bt(n=o.trace.frames,r),o.trace.frames=n);return[t,v(t,e)]}function kt(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function _t(t,e,r){return e=yt(e,(function e(r,n,o){switch(f(n)){case"string":return kt(t,n);case"object":case"array":return yt(n,e,o);default:return n}})),[e,v(e,r)]}function xt(t){return t.exception&&(delete t.exception.description,t.exception.message=kt(255,t.exception.message)),t.frames=bt(t.frames,1),t}function Et(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]=xt(n[o]);else r.trace&&(r.trace=xt(r.trace));return[t,v(t,e)]}function St(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}const Ot={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[gt,wt,_t.bind(null,1024),_t.bind(null,512),_t.bind(null,256),Et];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!St(i.value,r))return i;return i},raw:gt,truncateFrames:wt,truncateStrings:_t,maybeTruncateValue:kt},It=require("http"),Tt=require("https"),Lt=require("json-stringify-safe");function Pt(){this.rateLimitExpires=0}function jt(t,e,r){var n=e&&e.headers||{};if(n["Content-Type"]="application/json",r)try{n["Content-Length"]=Buffer.byteLength(r,"utf8")}catch(t){lt.error("Could not get the content length of the data")}return n["X-Rollbar-Access-Token"]=t,n}function Rt(t){return{"http:":It,"https:":Tt}[t.protocol]}function qt(){return Math.floor(Date.now()/1e3)}Pt.prototype.get=function(t,e,r,n,o){var i;if(n&&h(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=e||{},r),e.headers=jt(t,e),!(i=o?o(e):Rt(e)))return lt.error("Unknown transport based on given protocol: "+e.protocol),n(new Error("Unknown transport"));var a=i.request(e,function(t){this.handleResponse(t,n)}.bind(this));a.on("error",(function(t){n(t)})),a.end()},Pt.prototype.post=function(t){var e,r=t.accessToken,n=t.options,o=t.payload,i=t.callback,a=t.transportFactory;if(i&&h(i)||(i=function(){}),qt()<this.rateLimitExpires)return i(new Error("Exceeded rate limit"));if(n=n||{},!o)return i(new Error("Cannot send empty request"));var s=Ot.truncate(o,Lt);if(s.error)return lt.error("Problem stringifying payload. Giving up"),i(s.error);var u=s.value;if(n.headers=jt(r,n,u),!(e=a?a(n):Rt(n)))return lt.error("Unknown transport based on given protocol: "+n.protocol),i(new Error("Unknown transport"));var c=e.request(n,function(t){this.handleResponse(t,function(t){return function(e,r){if(e)return t(e);r.result&&r.result.uuid?lt.log(["Successful api response."," Link: https://rollbar.com/occurrence/uuid/?uuid="+r.result.uuid].join("")):lt.log("Successful api response"),t(null,r.result)}}(i))}.bind(this));c.on("error",(function(t){i(t)})),u&&c.write(u),c.end()},Pt.prototype.updateRateLimit=function(t){var e=parseInt(t.headers["x-rate-limit-remaining"]||0),r=Math.min(60,t.headers["x-rate-limit-remaining-seconds"]||0),n=qt();429===t.statusCode&&0===e?this.rateLimitExpires=n+r:this.rateLimitExpires=n},Pt.prototype.handleResponse=function(t,e){this.updateRateLimit(t);var r=[];t.setEncoding("utf8"),t.on("data",(function(t){r.push(t)})),t.on("end",(function(){!function(t,e){var r=function(t){var e,r;try{e=JSON.parse(t)}catch(t){r=t}return{error:r,value:e}}(t);if(r.error)return lt.error("Could not parse api response, err: "+r.error),e(r.error);if((t=r.value).err)return lt.error("Received error: "+t.message),e(new Error("Api error: "+(t.message||"Unknown error")));e(null,t)}(r=r.join(""),e)}))};const At=Pt,Ct=require("url");var Mt=["otelAttributes"];function Ut(t){return Ut="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},Ut(t)}function Dt(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?Dt(Object(r),!0).forEach((function(e){Ft(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ft(t,e,r){return(e=Jt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ht(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"!=Ut(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ut(e)?e:e+""}var Bt=100;function Wt(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}var Gt=function(){return function(t,e,r){return e&&Ht(t.prototype,e),r&&Ht(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=s(e);var o=this.options.maxTelemetryEvents||Bt;this.maxQueueSize=Math.max(0,Math.min(o,Bt)),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=s(e,t);var r=this.options.maxTelemetryEvents||Bt,n=Math.max(0,Math.min(r,Bt)),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(h(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,Mt);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:zt(t,r),type:t,timestamp_ms:o||O(),body:e,source:"client"};n&&(a.uuid=n),i&&(a.otelAttributes=i);try{if(h(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,Wt(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,Wt(n))):(a={message:t,level:e},null===(i=this.telemetrySpan)||void 0===i||i.addEvent("rollbar-log-event",a,Wt(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,Wt(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},c={type:r,isSynthetic:n,element:o,value:i,endTimeUnixNano:Wt(a)},l=this._getRepeatedEvent(s,c);return l?this._updateRepeatedEvent(l,c,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,c,Wt(a)),this.capture("dom",u,"info",null,a,c))}},{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:Wt(i)},c=this._getRepeatedEvent(a,u);return c?this._updateRepeatedEvent(c,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,Wt(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=Wt(r),t.otelAttributes.durationUnixNano=Wt(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,Wt(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",c={type:u,subtype:r,width:o,height:i,textZoomRatio:a},l={type:r,isSynthetic:n,width:o,height:i,textZoomRatio:a},p=this._getRepeatedEvent(u,l);return p?this._updateRepeatedEvent(p,l,s):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(u,l,Wt(s)),this.capture("dom",c,"info",null,s,l))}},{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,c=t.timestamp,l="rollbar-dragdrop-event",p={type:l,subtype:r,isSynthetic:n},f={type:r,isSynthetic:n};return"dragstart"===r&&(p=Nt(Nt({},p),{},{element:o,dropEffect:i,effectAllowed:a}),f=Nt(Nt({},f),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(p=Nt(Nt({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),f=Nt(Nt({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(l,f,Wt(c)),this.capture("dom",p,"info",null,c,f)}},{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},Wt(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,Wt(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 zt(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}const $t=Gt;const Qt=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};function Zt(t){var e={protocol:t.protocol,hostname:"string"==typeof t.hostname&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:"".concat(t.pathname||"").concat(t.search||""),href:t.href};return""!==t.port&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth="".concat(t.username,":").concat(t.password)),e}function Vt(t){var e=t.protocol||"http:";return e+="//",t.auth&&(e+="".concat(t.auth,"@")),e+=t.hostname||t.host||"localhost",t.port&&(e+=":".concat(t.port)),e+=t.path||"/"}var Xt={network:!0,networkResponseHeaders:!1,networkRequestHeaders:!1,log:!0};function Kt(t,e,r){this.options=t;var n=t.autoInstrument;!1===t.enabled||!1===n?this.autoInstrument={}:(p(n,"object")||(n=Xt),this.autoInstrument=s(Xt,n)),this.telemeter=e,this.rollbar=r,this.diagnostic=r.client.notifier.diagnostic,this.replacements={network:[],log:[]}}function Yt(t){var e=this.telemeter,r=this;return function(n,o,i){var a=function(t,e,r){if("string"==typeof t){var n=t;t=Zt(new Ct.URL(n))}else t&&t instanceof Ct.URL?t=Zt(t):(r=e,e=t,t=null);return"function"==typeof e?(r=e,e=t||{}):e=s(t||{},e),{options:e,cb:r}}(n,o,i),u={method:a.options.method||"GET",url:Vt(a.options),status_code:null,start_time_ms:O(),end_time_ms:null};r.autoInstrument.networkRequestHeaders&&(u.request_headers=a.options.headers),e.captureNetwork(u,"http");var c=Array.from(arguments),l=function(t,e,r){return function(n){if(e.end_time_ms=O(),e.status_code=n.statusCode,e.response={},t.networkResponseHeaders&&(e.response.headers=n.headers),r)return r.apply(void 0,arguments)}}(r.autoInstrument,u,a.cb);a.cb&&c.pop(),c.push(l);var p=t.apply(Tt,c);return p.on("error",(function(t){u.status_code=0,u.error=[t.name,t.message].join(": ")})),p}}function te(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}Kt.prototype.configure=function(t){this.options=s(this.options,t);var e=t.autoInstrument,r=s(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(p(e,"object")||(e=Xt),this.autoInstrument=s(Xt,e)),this.instrument(r)},Kt.prototype.instrument=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()},Kt.prototype.deinstrumentNetwork=function(){te(this.replacements,"network")},Kt.prototype.instrumentNetwork=function(){Qt(It,"request",Yt.bind(this),this.replacements,"network"),Qt(Tt,"request",Yt.bind(this),this.replacements,"network")},Kt.prototype.captureNetwork=function(t,e,r){return this.telemeter.captureNetwork(t,e,r)},Kt.prototype.deinstrumentConsole=function(){te(this.replacements,"log")},Kt.prototype.instrumentConsole=function(){var t=this.telemeter,e=process.stdout;Qt(e,"write",(function(r){return function(n){return t.captureLog(n,"info"),r.apply(e,arguments)}}),this.replacements,"log");var r=process.stderr;Qt(r,"write",(function(e){return function(n){return t.captureLog(n,"error"),e.apply(r,arguments)}}),this.replacements,"log")};const ee=Kt,re=require("async"),ne=require("fs"),oe=require("lru-cache"),ie=require("source-map"),ae=require("path");var se={},ue={},ce={},le=/^data:application\/json[^,]+base64,/;function pe(t){if(t=t.trim(),/^file:/.test(t)&&(t=t.replace(/file:\/\/\/(\w:)?/,(function(t,e){return e?"":"/"}))),t in se)return se[t];var e="";try{ne.existsSync(t)&&(e=ne.readFileSync(t,"utf8"))}catch(t){}return se[t]=e}function fe(t,e){if(!t)return e;var r=ae.dirname(t),n=/^\w+:\/\/[^\/]*/.exec(r),o=n?n[0]:"",i=r.slice(o.length);return o&&/^\/\w\:/.test(i)?(o+="/")+ae.resolve(r.slice(o.length),e).replace(/\\/g,"/"):o+ae.resolve(r.slice(o.length),e)}function he(t){var e,r=function(t){var e;e=pe(t);for(var r,n,o=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/gm;n=o.exec(e);)r=n;return r?r[1]:null}(t);if(!r)return null;if(le.test(r)){var n=r.slice(r.indexOf(",")+1);e=Buffer.from(n,"base64").toString(),r=t}else e=pe(r=fe(t,r));return e?{url:r,map:e}:null}function de(t,e){var r=ue[t.source];if(!r){var n=he(t.source);n?(r=ue[t.source]={url:n.url,map:new ie.SourceMapConsumer(n.map)},e.node_source_maps.source_mapping_urls[t.source]=n.url,r.map.sourcesContent&&r.map.sources.forEach((function(t,e){var n=r.map.sourcesContent[e];if(n){var o=fe(r.url,t);se[o]=n}}))):(r=ue[t.source]={url:null,map:null},e.node_source_maps.source_mapping_urls[t.source]="not found")}if(r&&r.map&&"function"==typeof r.map.originalPositionFor){var o=r.map.originalPositionFor(t);if(null!==o.source){var i=o.source;return o.source=fe(r.url,o.source),function(t,e,r){ce[r]||(ce[r]=t.map.sourceContentFor(e,!0))}(r,i,o.source),o}}return t}function me(t){return ce[t]}function ve(t){return ve="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},ve(t)}var ye=/^\s*at (?:([^(]+(?: \[\w\s+\])?(?:.*\)*)) )?\(?(.+?)(?::(\d+):(\d+)(?:, <js>:(\d+):(\d+))?)?\)?$/,ge=/^\s*at .+ \(.+ (at[^)]+\))\)$/,be=/^\s*(>?) [0-9]+\|(\s*.+)$/m,we=new oe({max:100}),ke={};function _e(t,e){var r,n,o,i,a;if((r=(n=t).match(ge))&&(n=r[1]),!(r=n.match(ye)))return e(null,null);var s={source:(o=r.slice(1))[1],line:Math.floor(o[2]),column:Math.floor(o[3])-1};a=this.useSourceMaps?function(t,e){return de({source:t.source,line:t.line,column:t.column},e)}(s,this.diagnostic):s,i={method:o[0]||"<unknown>",filename:a.source,lineno:a.line,colno:a.column,runtimePosition:s},o[4]&&(i.compiled_lineno=Math.floor(o[4])),o[5]&&(i.compiled_colno=Math.floor(o[5])),e(null,i)}function xe(t,e){var r,n;r="/"===t[0]||"."===t[0],n=!!we.get(t),e(null,r&&!n&&!!!ke[t])}function Ee(t,e){if(me(t))return e(null,!0);ne.stat(t,(function(t){e(null,!t)}))}function Se(t,e){var r=[];t.forEach((function(t){-1===r.indexOf(t.filename)&&r.push(t.filename)})),re.filter(r,xe,(function(r,n){if(r)return e(r);var o;function i(t,e){o[t]=e,we.set(t,e)}function a(t,e){var r=me(t);if(r)try{var n=r.split("\n");return i(t,n),e(null)}catch(t){return e(t)}!function(t,e){try{ne.readFile(t,(function(t,r){var n;return t?e(t):(n=r.toString("utf8").split("\n"),e(null,n))}))}catch(t){lt.log(t)}}(t,(function(r,n){return r?e(r):(i(t,n),e(null))}))}function s(t,e){var r=o[t.filename]||we.get(t.filename);r&&function(t,e){t.code=e[t.lineno-1],t.context={pre:e.slice(Math.max(0,t.lineno-4),t.lineno-1),post:e.slice(t.lineno,t.lineno+3)}}(t,r),e(null)}o={},re.filter(n,Ee,(function(r,n){if(r)return e(r);re.each(n,a,(function(r){if(r)return e(r);re.eachSeries(t,s,(function(r){if(r)return e(r);e(null,t)}))}))}))}))}function Oe(t,e,n,o){var i=function(t){var e,n;if(null==t)return null;if("object"!==ve(t))return null;if(r.isArray(t))return t;for(n in e=[],t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(t[n]);return e}(t.errors);return function(t,e,r,n){var o,i=t;for(;"object"===ve(i);)i=i&&i.stack;o=(i||"").split("\n").slice(1),e.nodeSourceMaps&&(r.diagnostic.node_source_maps={},r.diagnostic.node_source_maps.source_mapping_urls={});re.map(o,_e.bind({useSourceMaps:e.nodeSourceMaps,diagnostic:r.diagnostic}),(function(t,e){if(t)return n(t);e.reverse(),re.filter(e,(function(t,e){e(null,!!t)}),(function(t,e){if(t)return n(t);Se(e,n)}))}))}(t.stack,e,n,(function(e,r){var a,s,u,c,l;return e?(lt.error("could not parse exception, err: "+e),o(e)):(a=String(t.message||"<no message>"),s=String(t.name||"<unknown>"),u={class:s,message:a,frames:r},i&&i.length&&(c=i[0],u={class:s,message:String(c.message||"<no message>"),frames:r}),a.match(be)&&(l=function(t){var e,r,n,o,i,a,s,u,c,l,p;for(r=(e=t.split("\n"))[0].indexOf(":"),n=e[0].slice(0,r),o=parseInt(e[0].slice(r+1),10),a=e[(i=e.length)-1],e=e.slice(1,i-1),c=[],l=[],s=0;s<i-2;++s)(p=e[s].match(be))&&(">"===p[1]?u=p[2]:u?p[2]&&l.push(p[2]):p[2]&&c.push(p[2]));return{frame:{method:"<jade>",filename:n,lineno:o,code:u,context:{pre:c=c.slice(0,Math.min(c.length,3)),post:l=l.slice(0,Math.min(l.length,3))}},message:a}}(a),u.message=l.message,u.frames.push(l.frame)),n.localsMap?void n.notifier.locals.mergeLocals(n.localsMap,r,t.stack,(function(t){return t&&(lt.error("could not parse locals, err: "+t),n.diagnostic["error parsing locals"]=t),o(null,u)})):o(null,u))}))}const Ie=require("request-ip");function Te(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){}}const Le=function(t,e,r){if(e=e||[],r)for(var n=0;n<r.length;++n)Te(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 yt(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?p(r,"object")||p(r,"array")?yt(r,t,n):function(t){var e;if(p(t,"string"))for(e=0;e<i.length;++e)t=t.replace(i[e],a);return t}(s):s}))};function Pe(t,e,r){var n=e.payload&&e.payload.environment||e.environment,o={timestamp:Math.round(t.timestamp/1e3),environment:t.environment||n,level:t.level||"error",language:"javascript",framework:t.framework||e.framework,uuid:t.uuid,notifier:JSON.parse(JSON.stringify(e.notifier)),custom:t.custom};e.codeVersion?o.code_version=e.codeVersion:e.code_version&&(o.code_version=e.code_version),Object.getOwnPropertyNames(t.custom||{}).forEach((function(e){o.hasOwnProperty(e)||(o[e]=t.custom[e])})),o.server={host:e.host,argv:process.argv.concat(),pid:process.pid},e.branch&&(o.server.branch=e.branch),e.root&&(o.server.root=e.root),t.data=o,r(null,t)}function je(t,e,r){t.stackInfo?function(t,e,r){t.stackInfo&&(t.data=t.data||{},t.data.body=t.data.body||{},t.data.body.trace_chain=t.stackInfo),r(null,t)}(t,0,r):function(t,e,r){t.data=t.data||{},t.data.body=t.data.body||{};var n=t.message||"Item sent with null or missing arguments.";t.data.body.message={body:n},r(null,t)}(t,0,r)}function Re(t,e,r){if(!t.err)return r(null,t);var n=t.err,o=[],i=[];do{o.push(n),n=n.nested||n.cause}while(n);t.stackInfo=i,e.addErrorContext&&function(t,e){var r=t.data.custom||{},n=!1;try{for(var o=0;o<e.length;++o)e[o].hasOwnProperty("rollbarContext")&&(r=s(r,g(e[o].rollbarContext)),n=!0);n&&(t.data.custom=r)}catch(e){t.diagnostic.error_context="Failed: "+e.message}}(t,o);re.eachSeries(o,function(t,e,r){return function(n,o){Oe(n,e,r,(function(e,r){return e?o(e):(t.push({frames:r.frames,exception:{class:r.class,message:r.message}}),o(null))}))}}(i,e,t),(function(e){e&&(t.message=t.err.message||t.err.description||t.message||String(t.err),t.diagnostic.buildTraceData=e.message,delete t.stackInfo),r(null,t)}))}function qe(t,e,r){t.data=t.data||{};var n=t.request;if(n){var o=n.baseUrl||"";if(e.addRequestData&&h(e.addRequestData))return e.addRequestData(t.data,n),void r(null,t);var i,a=function(t){var e,r=t.headers||{},n=r.host||"<no host>",o=t.protocol||(t.socket&&t.socket.encrypted?"https":"http"),i=t.baseUrl||"";if(p(t.url,"string")){var a=i&&i.length?i+t.url:t.url;e=Ct.parse(a,!0)}else e=t.url||{};e.protocol=e.protocol||o,e.host=e.host||n;var s={url:Ct.format(e),user_ip:Ue(t),headers:r,method:t.method};e.search&&e.search.length>0&&(s.GET=e.query);var u=t.body||t.payload;if(u){var c={};if("object"===(h=f(u))||"array"===h){for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(c[l]=u[l]);s[t.method]=c}else s.body=u}var h;return s}(n);if(function(t,e){if(t&&t.user_ip&&!0!==e){var r=t.user_ip;if(e)try{var n;if(-1!==r.indexOf("."))(n=r.split(".")).pop(),n.push("0"),r=n.join(".");else if(-1!==r.indexOf(":")){if((n=r.split(":")).length>2){var o=n.slice(0,3),i=o[2].indexOf("/");-1!==i&&(o[2]=o[2].substring(0,i)),r=o.concat("0000:0000:0000:0000:0000").join(":")}}else r=null}catch(t){r=null}else r=null;t.user_ip=r}}(a,e.captureIp),t.data.request=a,n.route)i=n.route.path,t.data.context=o&&o.length?o+i:i;else try{i=n.app._router.matchRequest(n).path,t.data.context=o&&o.length?o+i:i}catch(t){}var s=e.captureEmail,u=e.captureUsername;if(n.rollbar_person){var c=n.rollbar_person;!s&&c.email&&(c.email=null),!u&&c.username&&(c.username=null),t.data.person=c}else if(n.user)t.data.person={id:n.user.id},n.user.username&&u&&(t.data.person.username=n.user.username),n.user.email&&s&&(t.data.person.email=n.user.email);else if(n.user_id||n.userId){var l=n.user_id||n.userId;h(l)&&(l=l()),t.data.person={id:l}}r(null,t)}else r(null,t)}function Ae(t,e,r){var n=t.lambdaContext;if(n){var o={remainingTimeInMillis:n.getRemainingTimeInMillis(),callbackWaitsForEmptyEventLoop:n.callbackWaitsForEmptyEventLoop,functionName:n.functionName,functionVersion:n.functionVersion,arn:n.invokedFunctionArn,requestId:n.awsRequestId};t.data=t.data||{},t.data.custom=t.data.custom||{},t.data.custom.lambda=o,r(null,t)}else r(null,t)}function Ce(t,e,r){var n=e.scrubHeaders||[],o=e.scrubFields||[],i=e.scrubPaths||[];o=n.concat(o),function(t,e){if(!t||!e.scrubRequestBody)return;try{("string"==typeof(r=t.body)||r instanceof String)&&Me(t)&&(t.body=JSON.parse(t.body))}catch(e){t.body=null,t.error="request.body parse failed: "+e.message}var r}(t.data.request,e),t.data=Le(t.data,o,i),function(t,e){if(!t||!e.scrubRequestBody)return;try{d(t.body)&&Me(t)&&(t.body=JSON.stringify(t.body))}catch(e){t.body=null,t.error="request.body serialization failed: "+e.message}}(t.data.request,e),r(null,t)}function Me(t){return t.headers&&t.headers["content-type"]&&t.headers["content-type"].includes("json")}function Ue(t){var e=t.ip;return e||(e=Ie.getClientIp(t)),e}function De(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function Ne(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=s(t.data,n),r(null,t)}function Fe(t,e,r){t.telemetryEvents&&S(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function He(t,e,r){if(t.message){var n="data.body.trace_chain.0",o=E(t,n);if(o||(o=E(t,n="data.body.trace")),o){if(!o.exception||!o.exception.description)return S(t,n+".exception.description",t.message),void r(null,t);var i=E(t,n+".extra")||{};S(t,n+".extra",s(i,{message:t.message}))}r(null,t)}else r(null,t)}function Je(t){return function(e,r,n){var o,i=s(e),a=null;try{h(r.transform)&&(a=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)}d(o=a)&&p(o.then,"function")?a.then((function(t){t&&(i.data=t),n(null,i)}),(function(t){n(t,e)})):n(null,i)}}function Be(t,e,r){if(!e.sendConfig)return r(null,t);var n=E(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,r(null,t)}function We(t,e){h(t[e])&&(t[e]=t[e].toString())}function Ge(t,e,r){var n=e._configuredOptions;We(n,"transform"),We(n,"checkIgnore"),We(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function ze(t,e,r){var n=s(t.notifier.client.notifier.diagnostic,t.diagnostic);if(E(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=s(t.data.notifier.diagnostic,n),r(null,t)}function $e(t,e){var r=t.level,n=m[r]||0,o=e.reportLevel;return!(n<(m[o]||0))}function Qe(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(!p(n=i[u].filename,"string"))return!r;for(var c=0;c<a;c++)if(o=e[c],new RegExp(o).test(n))return!0}return!1}function Ze(t,e,r,n){var o,i,a=!1;"blocklist"===r&&(a=!0);try{if(o=a?e.hostBlockList:e.hostSafeList,i=E(t,"body.trace_chain")||[E(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(Qe(i[u],o,a))return!0}catch(t){a?e.hostBlockList=null:e.hostSafeList=null;var c=a?"hostBlockList":"hostSafeList";return n.error("Error while reading your configuration's "+c+" option. Removing custom "+c+".",t),!a}return!1}function Ve(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(E(i,"exception.message"))}e.trace&&r.push(E(e,"trace.exception.message"));e.message&&r.push(E(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 Xe(t,e){if(p(t,"string")){var r=t;(t={}).accessToken=r}void 0!==t.minimumLevel&&(t.reportLevel=t.minimumLevel,delete t.minimumLevel),lt.init({logLevel:t.logLevel||"error"}),this.options=I(Xe.defaultOptions,t,null,lt),this.options._configuredOptions=t,delete this.options.maxItems,this.options.environment=this.options.environment||"unspecified",this.lambdaContext=null,this.lambdaTimeoutHandle=null;var n=new At,o=new at(this.options,n,Ct,Ot,Lt),i=new $t(this.options);this.client=e||new G(this.options,o,lt,i,null,null,"server"),this.instrumenter=new ee(this.options,this.client.telemeter,this),this.instrumenter.instrument(),this.options.locals&&(this.locals=Ke(this.options.locals,lt)),function(t){t.addTransform(Pe).addTransform(Re).addTransform(je).addTransform(He).addTransform(Fe).addTransform(qe).addTransform(Ae).addTransform(Be).addTransform(Ce).addTransform(Ne).addTransform(Je(lt)).addTransform(Ge).addTransform(ze).addTransform(De)}(this.client.notifier),function(t){t.addPredicate($e).addPredicate(function(t){return function(e,r){var n=!!e._isUncaught;delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{h(r.onSendCallback)&&r.onSendCallback(n,o,e)}catch(e){r.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(h(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}}(lt)).addPredicate(function(t){return function(e,r){return!Ze(e,r,"blocklist",t)}}(lt)).addPredicate(function(t){return function(e,r){return Ze(e,r,"safelist",t)}}(lt)).addPredicate(Ve(lt))}(this.client.queue),this.setupUnhandledCapture()}function Ke(t,e){var r;if(process.versions.node.split(".")[0]<10)return null;if("function"==typeof t)r=t,t=null;else{if(!p(t,"object"))return e.error("options.locals or options.locals.module must be a Locals module"),null;r=t.module,delete t.module}return new r(t,e)}var Ye=null;function tr(t){var e="Rollbar is not initialized";lt.error(e),t&&t(new Error(e))}function er(t){for(var e=0,r=t.length;e<r;++e)if(h(t[e]))return t[e]}function rr(t,e){var r=function(t,r){e(t,r)};r._rollbarHandler=!0;for(var n=process.listeners(t),o=n.length,i=0;i<o;++i)n[i]._rollbarHandler&&process.removeListener(t,n[i]);process.on(t,r)}function nr(t,e){Error.call(this),Error.captureStackTrace(this,this.constructor),this.message=t,this.nested=e,this.name=this.constructor.name}Xe.init=function(t,e){return Ye?Ye.global(t).configure(t):Ye=new Xe(t,e)},Xe.prototype.global=function(t){return delete(t=I(t)).maxItems,this.client.global(t),this},Xe.global=function(t){if(Ye)return Ye.global(t);tr()},Xe.prototype.configure=function(t,e){t.logLevel&&lt.init({logLevel:t.logLevel});var r=this.options,n={};return e&&(n={payload:e}),this.options=I(r,t,n,lt),this.options._configuredOptions=I(r._configuredOptions,t,n),delete this.options.maxItems,this.client.configure(t,e),this.setupUnhandledCapture(),this.options.locals&&(this.locals?this.locals.updateOptions(this.options.locals):this.locals=Ke(this.options.locals,lt)),this},Xe.configure=function(t,e){if(Ye)return Ye.configure(t,e);tr()},Xe.prototype.lastError=function(){return this.client.lastError},Xe.lastError=function(){if(Ye)return Ye.lastError();tr()},Xe.prototype.log=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}},Xe.log=function(){if(Ye)return Ye.log.apply(Ye,arguments);tr(er(arguments))},Xe.prototype.debug=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}},Xe.debug=function(){if(Ye)return Ye.debug.apply(Ye,arguments);tr(er(arguments))},Xe.prototype.info=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}},Xe.info=function(){if(Ye)return Ye.info.apply(Ye,arguments);tr(er(arguments))},Xe.prototype.warn=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}},Xe.warn=function(){if(Ye)return Ye.warn.apply(Ye,arguments);tr(er(arguments))},Xe.prototype.warning=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}},Xe.warning=function(){if(Ye)return Ye.warning.apply(Ye,arguments);tr(er(arguments))},Xe.prototype.error=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}},Xe.error=function(){if(Ye)return Ye.error.apply(Ye,arguments);tr(er(arguments))},Xe.prototype._uncaughtError=function(){var t=this._createItem(arguments);t._isUncaught=!0,t.level=this.options.uncaughtErrorLevel;var e=t.uuid;return this.client.log(t),{uuid:e}},Xe.prototype.critical=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}},Xe.critical=function(){if(Ye)return Ye.critical.apply(Ye,arguments);tr(er(arguments))},Xe.prototype.buildJsonPayload=function(t){return this.client.buildJsonPayload(t)},Xe.buildJsonPayload=function(){if(Ye)return Ye.buildJsonPayload.apply(Ye,arguments);tr()},Xe.prototype.sendJsonPayload=function(t){return this.client.sendJsonPayload(t)},Xe.sendJsonPayload=function(){if(Ye)return Ye.sendJsonPayload.apply(Ye,arguments);tr()},Xe.prototype.wait=function(t){this.client.wait(t)},Xe.wait=function(t){if(Ye)return Ye.wait(t);tr(er(arguments))},Xe.prototype.errorHandler=function(){return function(t,e,r,n){var o=function(o){return o&&lt.error("Error reporting to rollbar, ignoring: "+o),n(t,e,r)};return t?t instanceof Error?this.error(t,e,o):this.error("Error: "+t,e,o):n(t,e,r)}.bind(this)},Xe.errorHandler=function(){if(Ye)return Ye.errorHandler();tr()},Xe.prototype.lambdaHandler=function(t,e){return t.length<=2?this.asyncLambdaHandler(t,e):this.syncLambdaHandler(t,e)},Xe.prototype.asyncLambdaHandler=function(t,e){var r=this,n=function(t,e){var n={originalEvent:t,originalRequestId:e.awsRequestId};r.error("Function timed out",n)},o=r.options.captureLambdaTimeouts;return function(i,a){return new Promise((function(s,u){if(r.lambdaContext=a,o){var c=(e||n).bind(null,i,a);r.lambdaTimeoutHandle=setTimeout(c,a.getRemainingTimeInMillis()-1e3)}t(i,a).then((function(t){r.wait((function(){clearTimeout(r.lambdaTimeoutHandle),s(t)}))})).catch((function(t){r.error(t),r.wait((function(){clearTimeout(r.lambdaTimeoutHandle),u(t)}))}))}))}},Xe.prototype.syncLambdaHandler=function(t,e){var r=this,n=function(t,e,n){var o={originalEvent:t,originalRequestId:e.awsRequestId};r.error("Function timed out",o)},o=r.options.captureLambdaTimeouts;return function(i,a,s){if(r.lambdaContext=a,o){var u=(e||n).bind(null,i,a,s);r.lambdaTimeoutHandle=setTimeout(u,a.getRemainingTimeInMillis()-1e3)}try{t(i,a,(function(t,e){t&&r.error(t),r.wait((function(){clearTimeout(r.lambdaTimeoutHandle),s(t,e)}))}))}catch(t){r.error(t),r.wait((function(){throw clearTimeout(r.lambdaTimeoutHandle),t}))}}},Xe.lambdaHandler=function(t){if(Ye)return Ye.lambdaHandler(t);tr()},Xe.prototype.wrapCallback=function(t){return function(t,e){return function(){var r=arguments[0];return r&&t.error(r),e.apply(this,arguments)}}(this,t)},Xe.wrapCallback=function(t){if(Ye)return Ye.wrapCallback(t);tr()},Xe.prototype.captureEvent=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&&_(w,o)?e=o:!n&&_(k,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)},Xe.captureEvent=function(){if(Ye)return Ye.captureEvent.apply(Ye,arguments);tr()},Xe.prototype.reportMessage=function(t,e,r,n){return lt.log("reportMessage is deprecated"),h(this[e])?this[e](t,r,n):this.error(t,r,n)},Xe.reportMessage=function(t,e,r,n){if(Ye)return Ye.reportMessage(t,e,r,n);tr(n)},Xe.prototype.reportMessageWithPayloadData=function(t,e,r,n){return lt.log("reportMessageWithPayloadData is deprecated"),this.error(t,r,e,n)},Xe.reportMessageWithPayloadData=function(t,e,r,n){if(Ye)return Ye.reportMessageWithPayloadData(t,e,r,n);tr(n)},Xe.prototype.handleError=function(t,e,r){return lt.log("handleError is deprecated"),this.error(t,e,r)},Xe.handleError=function(t,e,r){if(Ye)return Ye.handleError(t,e,r);tr(r)},Xe.prototype.handleErrorWithPayloadData=function(t,e,r,n){return lt.log("handleErrorWithPayloadData is deprecated"),this.error(t,r,e,n)},Xe.handleErrorWithPayloadData=function(t,e,r,n){if(Ye)return Ye.handleErrorWithPayloadData(t,e,r,n);tr(n)},Xe.handleUncaughtExceptions=function(t,e){if(Ye)return(e=e||{}).accessToken=t,Ye.configure(e);tr()},Xe.handleUnhandledRejections=function(t,e){if(Ye)return(e=e||{}).accessToken=t,Ye.configure(e);tr()},Xe.handleUncaughtExceptionsAndRejections=function(t,e){if(Ye)return(e=e||{}).accessToken=t,Ye.configure(e);tr()},Xe.prototype._createItem=function(t){var e=b(t,lt,this,["headers","protocol","url","method","body","route"],this.lambdaContext);return e.err&&e.notifier.locals&&(e.localsMap=e.notifier.locals.currentLocalsMap()),e},Xe.prototype.setupUnhandledCapture=function(){(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&this.handleUncaughtExceptions(),(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&this.handleUnhandledRejections()},Xe.prototype.handleUncaughtExceptions=function(){var t=!!this.options.exitOnUncaughtException;delete this.options.exitOnUncaughtException,rr("uncaughtException",function(e){(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(this._uncaughtError(e,(function(t){t&&(lt.error("Encountered error while handling an uncaught exception."),lt.error(t))})),t&&setImmediate(function(){this.wait((function(){process.exit(1)}))}.bind(this)))}.bind(this))},Xe.prototype.handleUnhandledRejections=function(){rr("unhandledRejection",function(t){(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&this._uncaughtError(t,(function(t){t&&(lt.error("Encountered error while handling an uncaught exception."),lt.error(t))}))}.bind(this))},r.inherits(nr,Error),Xe.Error=nr,Xe.defaultOptions={host:n.hostname(),environment:"production",framework:"node-js",showReportedMessageTraces:!1,notifier:{name:"node_rollbar",version:pt},scrubHeaders:mt,scrubFields:vt,addRequestData:null,reportLevel:ft,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!1,captureEmail:!1,captureUsername:!1,captureIp:!0,captureLambdaTimeouts:!0,ignoreDuplicateErrors:!0,scrubRequestBody:!0,autoInstrument:!1};const or=Xe;module.exports=e.default})();
2
+ (()=>{"use strict";var t={d:(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:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>kr});const r=require("os"),n=require("url"),o=require("util"),i=require("json-stringify-safe");function a(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 s(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)?s(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,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function s(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 u(t){return u="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},u(t)}function l(t,e){return e===c(t)}function c(t){var e=u(t);return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function f(t){return l(t,"function")}function p(t){return null!=t&&("object"==u(t)||"function"==typeof t)}function h(t,e){return null!=t&&(Object.hasOwn?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e))}function d(){return"********"}var m={debug:0,info:1,warning:2,error:3,critical:4};function y(t,e){var r,n;try{r=JSON.stringify(t)}catch(o){if(e&&f(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function v(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function g(t){return function t(e,r){var n,o,i,a={};try{for(o in e)(n=e[o])&&(l(n,"object")||l(n,"array"))?r.includes(n)?a[o]="Removed circular reference: "+c(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 b(t,e,r,n,o){for(var i,a,s,u,l,f,p=[],h=[],d=0,m=t.length;d<m;++d){var y=c(f=t[d]);switch(h.push(y),y){case"undefined":break;case"string":i?p.push(f):i=f;break;case"function":u=v(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"===y&&!l){for(var b=0,w=n.length;b<w;++b)if(void 0!==f[n[b]]){l=f;break}if(l)break}s?p.push(f):s=f;break;default:if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}p.push(f)}}s&&(s=g(s)),p.length>0&&(s||(s=g({})),s.extraArgs=g(p));var k,_={message:i,err:a,custom:s,timestamp:O(),callback:u,notifier:r,diagnostic:{},uuid:(k=O(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(k+16*Math.random())%16|0;return k=Math.floor(k/16),("x"===t?e:7&e|8).toString(16)}))};return _.data=_.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)}(_,s),n&&l&&(_.request=l),o&&(_.lambdaContext=o),_._originalArgs=t,_.diagnostic.original_arg_types=h,_}var w=["log","network","dom","navigation","error","manual"],k=["critical","error","warning","info","debug"];function _(t,e){var r,n=a(t);try{for(n.s();!(r=n.n()).done;){if(r.value===e)return!0}}catch(t){n.e(t)}finally{n.f()}return!1}function S(t,e){t.attributes=t.attributes||[];var r,n=a(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 E(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 x(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 O(){return Date.now?Date.now():Number(new Date)}function I(t,e,r,n){var o=T(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 T(){function t(t){if(!t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e,r=h(t,"constructor"),n=t.constructor&&t.constructor.prototype&&h(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||h(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]=T(o,n)):void 0!==n&&(a[i]=n));return a}function j(t){if(!l(t.context,"string")){var e=y(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 P(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 R(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 L(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 A(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?L(Object(r),!0).forEach(function(e){q(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function q(t,e,r){return(e=F(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t){return C="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},C(t)}function M(){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 U(l,"_invoke",function(r,n,o){var i,s,u,l=0,c=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function h(r,n){for(s=r,u=n,e=0;!f&&l&&!o&&e<c.length;e++){var o,i=c[e],h=p.p,d=i[2];r>3?(o=d===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,c,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===c&&h(c,d),s=c,u=d;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(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]())):(U(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,U(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,U(f,"constructor",l),U(l,"constructor",u),u.displayName="GeneratorFunction",U(l,o,"GeneratorFunction"),U(f),U(f,o,"Generator"),U(f,n,function(){return this}),U(f,"toString",function(){return"[object Generator]"}),(M=function(){return{w:i,m:p}})()}function U(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}U=function(t,e,r,n){function i(e,r){U(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))},U(t,e,r,n)}function D(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 N(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,F(n.key),n)}}function F(t){var e=function(t,e){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==C(e)?e:e+""}var H={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},B={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443},J=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=W(e,n),this.OTLPTransportOptions=G(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=R(this.transportOptions,"POST"),o=j(t);setTimeout(function(){r.transport.post({accessToken:r.accessToken,options:n,payload:o,callback:e})},0)}},{key:"postSpans",value:(n=M().m(function t(e){var r,n,o=arguments;return M().w(function(t){for(;;)if(0===t.n)return r=o.length>1&&void 0!==o[1]?o[1]:{},n=R(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){D(i,r,o,a,s,"next",t)}function s(t){D(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=j(t);return(r=this.truncation?this.truncation.truncate(n):y(n)).error?(e&&e(r.error),null):r.value}},{key:"postJsonPayload",value:function(t,e){var r=R(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)}},{key:"configure",value:function(t){var e=this.options;return this.options=T(e,t),this.transportOptions=W(this.options,this.url),this.OTLPTransportOptions=G(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this}}],e&&N(t.prototype,e),r&&N(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function W(t,e){return P(t,H,e)}function G(t,e){var r;return P(t=A(A({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),B,e)}const z=J;var $="3.0.0",Q="debug";var Z=function(){},V={debug:0,info:1,warn:2,error:3,disable:4},X={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Z("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Z("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Z("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Z("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Z("info",e)},init:function(t){var e=t.logLevel;Z=function(t,r){V[t]<V[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}};const K=X;function Y(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 tt(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)?tt(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 tt(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 et(t,e){var r=t.level,n=m[r]||0,o=e.reportLevel;return!(n<(m[o]||0))}function rt(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(!l(n=i[u].filename,"string"))return!r;for(var c=0;c<a;c++)if(o=e[c],new RegExp(o).test(n))return!0}return!1}function nt(t,e,r,n){var o,i,a=!1;"blocklist"===r&&(a=!0);try{if(o=a?e.hostBlockList:e.hostSafeList,i=E(t,"body.trace_chain")||[E(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(rt(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 ot(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=Y(e.trace_chain);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.push(E(i,"exception.message"))}}catch(t){o.e(t)}finally{o.f()}}e.trace&&r.push(E(e,"trace.exception.message"));e.message&&r.push(E(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 it(t){return it="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},it(t)}function at(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,st(n.key),n)}}function st(t){var e=function(t,e){if("object"!=it(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=it(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==it(e)?e:e+""}var ut=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=T(r,t),this}},{key:"addTransform",value:function(t){return f(t)&&this.transforms.push(t),this}},{key:"log",value:function(t,e){var r=this;if(e=f(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)}}])&&at(t.prototype,e),r&&at(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function lt(t){return lt="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},lt(t)}function ct(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,ft(n.key),n)}}function ft(t){var e=function(t,e){if("object"!=lt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lt(e)?e:e+""}var pt,ht,dt,mt=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=T(r,t),this}},{key:"addPredicate",value:function(t){return f(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&&f(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&&S(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;f(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,i=!1;if(this.options.retryInterval){for(var a=0,s=t.RETRIABLE_ERRORS.length;a<s;a++)if(e.code===t.RETRIABLE_ERRORS[a]){i=!0;break}i&&(o=this.options.maxRetries,Number.isFinite(o))&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(i=!1))}i?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||E(t,"body.trace.exception.message")||E(t,"body.trace_chain.0.exception.message");if(r)return void this.logger.error(r);(r=E(t,"body.message.body"))&&this.logger.log(r)}}},{key:"_maybeCallWait",value:function(){return!(!f(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))}}])&&ct(e.prototype,r),n&&ct(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();pt=mt,dt=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(ht=ft(ht="RETRIABLE_ERRORS"))in pt?Object.defineProperty(pt,ht,{value:dt,enumerable:!0,configurable:!0,writable:!0}):pt[ht]=dt;const yt=mt;function vt(t){return vt="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},vt(t)}function gt(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,bt(n.key),n)}}function bt(t){var e=function(t,e){if("object"!=vt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vt(e)?e:e+""}var wt=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&&gt(t.prototype,e),r&&gt(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(kt(e,o,this.counter))return _t(this.platform,this.platformOptions,"".concat(o," max items reached"),!1);if(kt(e,i,this.perMinCounter))return _t(this.platform,this.platformOptions,"".concat(i," items per minute reached"),!1);this.counter+=1,this.perMinCounter+=1;var a=!kt(e,o,this.counter),s=a,u=a&&!kt(e,i,this.perMinCounter);return _t(this.platform,this.platformOptions,null,u,o,i,s)}},{key:"setPlatformOptions",value:function(t,e){this.platform=t,this.platformOptions=e}}])}();function kt(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function _t(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=bt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(wt,"globalSettings",{startTime:Date.now(),maxItems:void 0,itemsPerMinute:void 0});const St=wt;function Et(t,e,r,n,o,i,a){this.options=T(t),this.logger=r,Et.rateLimiter.configureGlobal(this.options),Et.rateLimiter.setPlatformOptions(a,this.options),this.api=e,this.queue=new yt(Et.rateLimiter,e,r,this.options,i),this.tracing=o;var s=this.options.tracer||null;Ot(s)?(this.tracer=s,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new ut(this.queue,this.options),this.telemeter=n,xt(t),this.lastError=null,this.lastErrorHash="none"}function xt(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function Ot(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)}Et.rateLimiter=new St({maxItems:0,itemsPerMinute:60}),Et.prototype.global=function(t){return Et.rateLimiter.configureGlobal(t),this},Et.prototype.configure=function(t,e){var r=this.options,n={};e&&(n={payload:e}),this.options=T(r,t,n);var o=this.options.tracer||null;return Ot(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),xt(t),this.global(this.options),Ot(t.tracer)&&(this.tracer=t.tracer),this},Et.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},Et.prototype.debug=function(t){this._log("debug",t)},Et.prototype.info=function(t){this._log("info",t)},Et.prototype.warn=function(t){this._log("warning",t)},Et.prototype.warning=function(t){this._log("warning",t)},Et.prototype.error=function(t){this._log("error",t)},Et.prototype.critical=function(t){this._log("critical",t)},Et.prototype.wait=function(t){this.queue.wait(t)},Et.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},Et.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},Et.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},Et.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},Et.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},Et.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)}},Et.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"}),S(t.data,o),null==n||n.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:t.uuid}])},Et.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},Et.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)},Et.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}}}};const It=Et;var Tt=["otelAttributes"];function jt(t){return jt="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},jt(t)}function Pt(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 Rt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Pt(Object(r),!0).forEach(function(e){Lt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Lt(t,e,r){return(e=qt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function At(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,qt(n.key),n)}}function qt(t){var e=function(t,e){if("object"!=jt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==jt(e)?e:e+""}var Ct=100;function Mt(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}var Ut=function(){return function(t,e,r){return e&&At(t.prototype,e),r&&At(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=T(e);var o=this.options.maxTelemetryEvents||Ct;this.maxQueueSize=Math.max(0,Math.min(o,Ct)),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=T(e,t);var r=this.options.maxTelemetryEvents||Ct,n=Math.max(0,Math.min(r,Ct)),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(f(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,Tt);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:Dt(t,r),type:t,timestamp_ms:o||O(),body:e,source:"client"};n&&(a.uuid=n),i&&(a.otelAttributes=i);try{if(f(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,Mt(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=Rt({message:t,level:e},r?{type:"message",uuid:r}:{});return null===(o=this.telemetrySpan)||void 0===o||o.addEvent(i,a,Mt(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,Mt(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:Mt(a)},c=this._getRepeatedEvent(s,l);return c?this._updateRepeatedEvent(c,l,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,l,Mt(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:Mt(i)},l=this._getRepeatedEvent(a,u);return l?this._updateRepeatedEvent(l,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,Mt(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=Mt(r),t.otelAttributes.durationUnixNano=Mt(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,Mt(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,Mt(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=Rt(Rt({},f),{},{element:o,dropEffect:i,effectAllowed:a}),p=Rt(Rt({},p),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(f=Rt(Rt({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),p=Rt(Rt({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(c,p,Mt(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},Mt(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,Mt(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 Dt(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}const Nt=Ut;function Ft(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function Ht(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=T(t.data,n),r(null,t)}function Bt(t,e,r){t.telemetryEvents&&x(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function Jt(t,e,r){if(t.message){var n="data.body.trace_chain.0",o=E(t,n);if(o||(o=E(t,n="data.body.trace")),o){if(!o.exception||!o.exception.description)return x(t,n+".exception.description",t.message),void r(null,t);x(t,n+".extra",T(E(t,n+".extra")||{},{message:t.message}))}r(null,t)}else r(null,t)}function Wt(t){return function(e,r,n){var o,i=T(e),a=null;try{f(r.transform)&&(a=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)}p(o=a)&&l(o.then,"function")?a.then(function(t){t&&(i.data=t),n(null,i)},function(t){n(t,e)}):n(null,i)}}function Gt(t,e,r){if(!e.sendConfig)return r(null,t);var n=E(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,r(null,t)}function zt(t,e){f(t[e])&&(t[e]=t[e].toString())}function $t(t,e,r){var n=e._configuredOptions;zt(n,"transform"),zt(n,"checkIgnore"),zt(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function Qt(t,e,r){var n=T(t.notifier.client.notifier.diagnostic,t.diagnostic);if(E(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=T(t.data.notifier.diagnostic,n),r(null,t)}const Zt=function(t,e,r){var n,o,i,a,s=l(t,"object"),u=l(t,"array"),c=[];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)h(t,n)&&c.push(n);else if(u)for(i=0;i<t.length;++i)c.push(i);var f=s?{}:[],p=!0;for(i=0;i<c.length;++i)o=t[n=c[i]],f[n]=e(n,o,r),p=p&&f[n]===t[n];return s&&!p&&(r.mapped[a]=f),p?t:f};function Vt(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)||Kt(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 Xt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Kt(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 Kt(t,e){if(t){if("string"==typeof t)return Yt(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)?Yt(t,e):void 0}}function Yt(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 te(t,e){return[t,y(t,e)]}function ee(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function re(t,e,r){r=void 0===r?30:r;var n,o=t.data.body;if(o.trace_chain){var i,a=Xt(o.trace_chain);try{for(a.s();!(i=a.n()).done;){var s=i.value;n=ee(n=s.frames,r),s.frames=n}}catch(t){a.e(t)}finally{a.f()}}else o.trace&&(n=ee(n=o.trace.frames,r),o.trace.frames=n);return[t,y(t,e)]}function ne(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function oe(t,e,r){return e=Zt(e,function e(r,n,o){switch(c(n)){case"string":return ne(t,n);case"object":case"array":return Zt(n,e,o);default:return n}}),[e,y(e,r)]}function ie(t){return t.exception&&(delete t.exception.description,t.exception.message=ne(255,t.exception.message)),t.frames=ee(t.frames,1),t}function ae(t,e){var r=t.data.body;if(r.trace_chain){var n,o=r.trace_chain,i=Xt(o.entries());try{for(i.s();!(n=i.n()).done;){var a=Vt(n.value,2),s=a[0],u=a[1];o[s]=ie(u)}}catch(t){i.e(t)}finally{i.f()}}else r.trace&&(r.trace=ie(r.trace));return[t,y(t,e)]}function se(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}const ue={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[te,re,oe.bind(null,1024),oe.bind(null,512),oe.bind(null,256),ae];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!se(i.value,r))return i;return i},raw:te,truncateFrames:re,truncateStrings:oe,maybeTruncateValue:ne};function le(t){return function(t){if(Array.isArray(t))return ce(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 ce(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)?ce(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.")}()}function ce(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 fe=["authorization","www-authorization","http_authorization","omniauth.auth","cookie","oauth-access-token","x-access-token","x_csrf_token","http_x_csrf_token","x-csrf-token"],pe=[].concat(le(["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","X-Rollbar-Access-Token","secret_key","secretKey","secretToken"]),le(["api_key","authenticity_token","oauth_token","token","user_session_secret"]),le(["request.session.csrf","request.session._csrf","request.params._csrf","request.cookie","request.cookies"]));const he=require("http"),de=require("https");const me=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};function ye(t){var e={protocol:t.protocol,hostname:"string"==typeof t.hostname&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:"".concat(t.pathname||"").concat(t.search||""),href:t.href};return""!==t.port&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth="".concat(t.username,":").concat(t.password)),e}function ve(t){var e=t.protocol||"http:";return e+="//",t.auth&&(e+="".concat(t.auth,"@")),e+=t.hostname||t.host||"localhost",t.port&&(e+=":".concat(t.port)),e+=t.path||"/"}var ge={network:!0,networkResponseHeaders:!1,networkRequestHeaders:!1,log:!0};function be(t,e,r){this.options=t;var n=t.autoInstrument;!1===t.enabled||!1===n?this.autoInstrument={}:(l(n,"object")||(n=ge),this.autoInstrument=T(ge,n)),this.telemeter=e,this.rollbar=r,this.diagnostic=r.client.notifier.diagnostic,this.replacements={network:[],log:[]}}function we(t){var e=this,r=this.telemeter;return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var s=function(t,e,r){if("string"==typeof t){var o=t;t=ye(new n.URL(o))}else t&&t instanceof n.URL?t=ye(t):(r=e,e=t,t=null);return"function"==typeof e?(r=e,e=t||{}):e=T(t||{},e),{options:e,cb:r}}(i[0],i[1],i[2]),u={method:s.options.method||"GET",url:ve(s.options),status_code:null,start_time_ms:O(),end_time_ms:null};e.autoInstrument.networkRequestHeaders&&(u.request_headers=s.options.headers),r.captureNetwork(u,"http");var l=function(t,e,r){return function(n){if(e.end_time_ms=O(),e.status_code=n.statusCode,e.response={},t.networkResponseHeaders&&(e.response.headers=n.headers),r)return r.apply(void 0,arguments)}}(e.autoInstrument,u,s.cb);s.cb&&i.pop(),i.push(l);var c=t.apply(de,i);return c.on("error",function(t){u.status_code=0,u.error=[t.name,t.message].join(": ")}),c}}function ke(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}be.prototype.configure=function(t){this.options=T(this.options,t);var e=t.autoInstrument,r=T(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(l(e,"object")||(e=ge),this.autoInstrument=T(ge,e)),this.instrument(r)},be.prototype.instrument=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()},be.prototype.deinstrumentNetwork=function(){ke(this.replacements,"network")},be.prototype.instrumentNetwork=function(){me(he,"request",we.bind(this),this.replacements,"network"),me(de,"request",we.bind(this),this.replacements,"network")},be.prototype.captureNetwork=function(t,e,r){return this.telemeter.captureNetwork(t,e,r)},be.prototype.deinstrumentConsole=function(){ke(this.replacements,"log")},be.prototype.instrumentConsole=function(){var t=this.telemeter,e=process.stdout;me(e,"write",function(r){return function(n){return t.captureLog(n,"info"),r.apply(e,arguments)}},this.replacements,"log");var r=process.stderr;me(r,"write",function(e){return function(n){return t.captureLog(n,"error"),e.apply(r,arguments)}},this.replacements,"log")};const _e=be,Se=require("async"),Ee=require("request-ip");function xe(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)||Ie(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 Oe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ie(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 Ie(t,e){if(t){if("string"==typeof t)return Te(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)?Te(t,e):void 0}}function Te(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 je(t,e){var r=e.split("."),n=r.length-1;try{var o,i=Oe(r.entries());try{for(i.s();!(o=i.n()).done;){var a=xe(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){}}const Pe=function(t,e,r){if(e=e||[],r){var n,o=Oe(r);try{for(o.s();!(n=o.n()).done;){je(t,n.value)}}catch(t){o.e(t)}finally{o.f()}}var i=function(t){var e,r=[],n=Oe(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),a=function(t){var e,r=[],n=Oe(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 s(t,e){return e+"********"}return Zt(t,function t(e,r,n){var o=function(t,e){var r,n=Oe(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?l(r,"object")||l(r,"array")?Zt(r,t,n):function(t){if(l(t,"string")){var e,r=Oe(a);try{for(r.s();!(e=r.n()).done;){var n=e.value;t=t.replace(n,s)}}catch(t){r.e(t)}finally{r.f()}}return t}(o):o})},Re=require("fs"),Le=require("lru-cache"),Ae=require("path"),qe=require("source-map");var Ce={},Me={},Ue={},De=/^data:application\/json[^,]+base64,/;function Ne(t){if(t=t.trim(),/^file:/.test(t)&&(t=t.replace(/file:\/\/\/(\w:)?/,function(t,e){return e?"":"/"})),t in Ce)return Ce[t];var e="";try{Re.existsSync(t)&&(e=Re.readFileSync(t,"utf8"))}catch(t){}return Ce[t]=e}function Fe(t,e){if(!t)return e;var r=Ae.dirname(t),n=/^\w+:\/\/[^/]*/.exec(r),o=n?n[0]:"",i=r.slice(o.length);return o&&/^\/\w:/.test(i)?(o+="/")+Ae.resolve(r.slice(o.length),e).replace(/\\/g,"/"):o+Ae.resolve(r.slice(o.length),e)}function He(t){var e,r=function(t){var e;e=Ne(t);for(var r,n,o=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/gm;n=o.exec(e);)r=n;return r?r[1]:null}(t);if(!r)return null;if(De.test(r)){var n=r.slice(r.indexOf(",")+1);e=Buffer.from(n,"base64").toString(),r=t}else e=Ne(r=Fe(t,r));return e?{url:r,map:e}:null}function Be(t,e){var r=Me[t.source];if(!r){var n=He(t.source);n?(r=Me[t.source]={url:n.url,map:new qe.SourceMapConsumer(n.map)},e.node_source_maps.source_mapping_urls[t.source]=n.url,r.map.sourcesContent&&r.map.sources.forEach(function(t,e){var n=r.map.sourcesContent[e];if(n){var o=Fe(r.url,t);Ce[o]=n}})):(r=Me[t.source]={url:null,map:null},e.node_source_maps.source_mapping_urls[t.source]="not found")}if(r&&r.map&&"function"==typeof r.map.originalPositionFor){var o=r.map.originalPositionFor(t);if(null!==o.source){var i=o.source;return o.source=Fe(r.url,o.source),function(t,e,r){Ue[r]||(Ue[r]=t.map.sourceContentFor(e,!0))}(r,i,o.source),o}}return t}function Je(t){return Ue[t]}function We(t){return We="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},We(t)}var Ge=/^\s*at (?:([^(]+(?: \[\w\s+\])?(?:.*\)*)) )?\(?(.+?)(?::(\d+):(\d+)(?:, <js>:(\d+):(\d+))?)?\)?$/,ze=/^\s*at .+ \(.+ (at[^)]+\))\)$/,$e=/^\s*(>?) [0-9]+\|(\s*.+)$/m,Qe=new Le({max:100}),Ze={};function Ve(t,e){var r,n,o,i,a;if((r=(n=t).match(ze))&&(n=r[1]),!(r=n.match(Ge)))return e(null,null);var s={source:(o=r.slice(1))[1],line:Math.floor(o[2]),column:Math.floor(o[3])-1};a=this.useSourceMaps?function(t,e){return Be({source:t.source,line:t.line,column:t.column},e)}(s,this.diagnostic):s,i={method:o[0]||"<unknown>",filename:a.source,lineno:a.line,colno:a.column,runtimePosition:s},o[4]&&(i.compiled_lineno=Math.floor(o[4])),o[5]&&(i.compiled_colno=Math.floor(o[5])),e(null,i)}function Xe(t,e){var r,n,o;r="/"===t[0]||"."===t[0],n=Boolean(Qe.get(t)),o=Boolean(Ze[t]),e(null,r&&!n&&!o)}function Ke(t,e){if(Je(t))return e(null,!0);Re.stat(t,function(t){e(null,!t)})}function Ye(t,e){var r=[];t.forEach(function(t){-1===r.indexOf(t.filename)&&r.push(t.filename)}),Se.filter(r,Xe,function(r,n){if(r)return e(r);var o;function i(t,e){o[t]=e,Qe.set(t,e)}function a(t,e){var r=Je(t);if(r)try{var n=r.split("\n");return i(t,n),e(null)}catch(t){return e(t)}!function(t,e){try{Re.readFile(t,function(t,r){var n;return t?e(t):(n=r.toString("utf8").split("\n"),e(null,n))})}catch(t){K.log(t)}}(t,function(r,n){return r?e(r):(i(t,n),e(null))})}function s(t,e){var r=o[t.filename]||Qe.get(t.filename);r&&function(t,e){t.code=e[t.lineno-1],t.context={pre:e.slice(Math.max(0,t.lineno-4),t.lineno-1),post:e.slice(t.lineno,t.lineno+3)}}(t,r),e(null)}o={},Se.filter(n,Ke,function(r,n){if(r)return e(r);Se.each(n,a,function(r){if(r)return e(r);Se.eachSeries(t,s,function(r){if(r)return e(r);e(null,t)})})})})}function tr(t,e,r,n){var i=function(t){var e,r;if(null==t)return null;if("object"!==We(t))return null;if(o.isArray(t))return t;for(r in e=[],t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(t[r]);return e}(t.errors);return function(t,e,r,n){var o,i=t;for(;"object"===We(i);)i=i&&i.stack;o=(i||"").split("\n").slice(1),e.nodeSourceMaps&&(r.diagnostic.node_source_maps={},r.diagnostic.node_source_maps.source_mapping_urls={});Se.map(o,Ve.bind({useSourceMaps:e.nodeSourceMaps,diagnostic:r.diagnostic}),function(t,e){if(t)return n(t);e.reverse(),Se.filter(e,function(t,e){e(null,Boolean(t))},function(t,e){if(t)return n(t);Ye(e,n)})})}(t.stack,e,r,function(e,o){var a,s,u,l,c;return e?(K.error("could not parse exception, err: "+e),n(e)):(a=String(t.message||"<no message>"),s=String(t.name||"<unknown>"),u={class:s,message:a,frames:o},i&&i.length&&(l=i[0],u={class:s,message:String(l.message||"<no message>"),frames:o}),a.match($e)&&(c=function(t){var e,r,n,o,i,a,s,u,l,c,f;for(r=(e=t.split("\n"))[0].indexOf(":"),n=e[0].slice(0,r),o=parseInt(e[0].slice(r+1),10),a=e[(i=e.length)-1],e=e.slice(1,i-1),l=[],c=[],s=0;s<i-2;++s)(f=e[s].match($e))&&(">"===f[1]?u=f[2]:u?f[2]&&c.push(f[2]):f[2]&&l.push(f[2]));return{frame:{method:"<jade>",filename:n,lineno:o,code:u,context:{pre:l=l.slice(0,Math.min(l.length,3)),post:c=c.slice(0,Math.min(c.length,3))}},message:a}}(a),u.message=c.message,u.frames.push(c.frame)),r.localsMap?void r.notifier.locals.mergeLocals(r.localsMap,o,t.stack,function(t){return t&&(K.error("could not parse locals, err: "+t),r.diagnostic["error parsing locals"]=t),n(null,u)}):n(null,u))})}function er(t,e,r){var n,o=e.payload&&e.payload.environment||e.environment,i={timestamp:Math.round(t.timestamp/1e3),environment:t.environment||o,level:t.level||"error",language:"javascript",framework:t.framework||e.framework,uuid:t.uuid,notifier:JSON.parse(JSON.stringify(e.notifier)),custom:t.custom,attributes:null===(n=t.data)||void 0===n?void 0:n.attributes};e.codeVersion?i.code_version=e.codeVersion:e.code_version&&(i.code_version=e.code_version),Object.getOwnPropertyNames(t.custom||{}).forEach(function(e){h(i,e)||(i[e]=t.custom[e])}),i.server={host:e.host,argv:process.argv.concat(),pid:process.pid},e.branch&&(i.server.branch=e.branch),e.root&&(i.server.root=e.root),t.data=i,r(null,t)}function rr(t,e,r){t.stackInfo?function(t,e,r){t.stackInfo&&(t.data=t.data||{},t.data.body=t.data.body||{},t.data.body.trace_chain=t.stackInfo),r(null,t)}(t,0,r):function(t,e,r){t.data=t.data||{},t.data.body=t.data.body||{};var n=t.message||"Item sent with null or missing arguments.";t.data.body.message={body:n},r(null,t)}(t,0,r)}function nr(t,e,r){if(!t.err)return r(null,t);var n=t.err,o=[],i=[];do{o.push(n),n=n.nested||n.cause}while(n);t.stackInfo=i,e.addErrorContext&&function(t,e){var r=t.data.custom||{},n=!1;try{var o,i=a(e);try{for(i.s();!(o=i.n()).done;){var s=o.value;h(s,"rollbarContext")&&(r=T(r,g(s.rollbarContext)),n=!0)}}catch(t){i.e(t)}finally{i.f()}n&&(t.data.custom=r)}catch(e){t.diagnostic.error_context="Failed: "+e.message}}(t,o);Se.eachSeries(o,function(t,e,r){return function(n,o){tr(n,e,r,function(e,r){return e?o(e):(t.push({frames:r.frames,exception:{class:r.class,message:r.message}}),o(null))})}}(i,e,t),function(e){e&&(t.message=t.err.message||t.err.description||t.message||String(t.err),t.diagnostic.buildTraceData=e.message,delete t.stackInfo),r(null,t)})}function or(t,e,r){t.data=t.data||{};var o=t.request;if(o){var i=o.baseUrl||"";if(e.addRequestData&&f(e.addRequestData))return e.addRequestData(t.data,o),void r(null,t);var a,s=function(t){var e,r=t.headers||{},o=r.host||"<no host>",i=t.protocol||(t.socket&&t.socket.encrypted?"https":"http"),a=t.baseUrl||"";if(l(t.url,"string")){var s=a&&a.length?a+t.url:t.url;e=n.parse(s,!0)}else e=t.url||{};e.protocol=e.protocol||i,e.host=e.host||o;var u={url:n.format(e),user_ip:ur(t),headers:r,method:t.method};e.search&&e.search.length>0&&(u.GET=e.query);var f=t.body||t.payload;if(f){var p={};if("object"===(m=c(f))||"array"===m){for(var d in f)h(f,d)&&(p[d]=f[d]);u[t.method]=p}else u.body=f}var m;return u}(o);if(function(t,e){if(t&&t.user_ip&&!0!==e){var r=t.user_ip;if(e)try{var n;if(-1!==r.indexOf("."))(n=r.split(".")).pop(),n.push("0"),r=n.join(".");else if(-1!==r.indexOf(":")){if((n=r.split(":")).length>2){var o=n.slice(0,3),i=o[2].indexOf("/");-1!==i&&(o[2]=o[2].substring(0,i)),r=o.concat("0000:0000:0000:0000:0000").join(":")}}else r=null}catch(t){r=null}else r=null;t.user_ip=r}}(s,e.captureIp),t.data.request=s,o.route)a=o.route.path,t.data.context=i&&i.length?i+a:a;else try{a=o.app._router.matchRequest(o).path,t.data.context=i&&i.length?i+a:a}catch(t){}var u=e.captureEmail,p=e.captureUsername;if(o.rollbar_person){var d=o.rollbar_person;!u&&d.email&&(d.email=null),!p&&d.username&&(d.username=null),t.data.person=d}else if(o.user)t.data.person={id:o.user.id},o.user.username&&p&&(t.data.person.username=o.user.username),o.user.email&&u&&(t.data.person.email=o.user.email);else if(o.user_id||o.userId){var m=o.user_id||o.userId;f(m)&&(m=m()),t.data.person={id:m}}r(null,t)}else r(null,t)}function ir(t,e,r){var n=t.lambdaContext;if(n){var o={remainingTimeInMillis:n.getRemainingTimeInMillis(),callbackWaitsForEmptyEventLoop:n.callbackWaitsForEmptyEventLoop,functionName:n.functionName,functionVersion:n.functionVersion,arn:n.invokedFunctionArn,requestId:n.awsRequestId};t.data=t.data||{},t.data.custom=t.data.custom||{},t.data.custom.lambda=o,r(null,t)}else r(null,t)}function ar(t,e,r){var n=e.scrubHeaders||[],o=e.scrubFields||[],i=e.scrubPaths||[];o=n.concat(o),function(t,e){if(!t||!e.scrubRequestBody)return;try{("string"==typeof(r=t.body)||r instanceof String)&&sr(t)&&(t.body=JSON.parse(t.body))}catch(e){t.body=null,t.error="request.body parse failed: "+e.message}var r}(t.data.request,e),t.data=Pe(t.data,o,i),function(t,e){if(!t||!e.scrubRequestBody)return;try{p(t.body)&&sr(t)&&(t.body=JSON.stringify(t.body))}catch(e){t.body=null,t.error="request.body serialization failed: "+e.message}}(t.data.request,e),r(null,t)}function sr(t){return t.headers&&t.headers["content-type"]&&t.headers["content-type"].includes("json")}function ur(t){var e=t.ip;return e||(e=Ee.getClientIp(t)),e}function lr(){this.rateLimitExpires=0}function cr(t,e,r){var n=e&&e.headers||{};if(n["Content-Type"]="application/json",r)try{n["Content-Length"]=Buffer.byteLength(r,"utf8")}catch(t){K.error("Could not get the content length of the data")}return n["X-Rollbar-Access-Token"]=t,n}function fr(t){return{"http:":he,"https:":de}[t.protocol]}function pr(){return Math.floor(Date.now()/1e3)}lr.prototype.get=function(t,e,r,n,o){var i;if(n&&f(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=e||{},r),e.headers=cr(t,e),!(i=o?o(e):fr(e)))return K.error("Unknown transport based on given protocol: "+e.protocol),n(new Error("Unknown transport"));var a=i.request(e,function(t){this.handleResponse(t,n)}.bind(this));a.on("error",function(t){n(t)}),a.end()},lr.prototype.post=function(t){var e,r=t.accessToken,n=t.options,o=t.payload,a=t.callback,s=t.transportFactory;if(a&&f(a)||(a=function(){}),pr()<this.rateLimitExpires)return a(new Error("Exceeded rate limit"));if(n=n||{},!o)return a(new Error("Cannot send empty request"));var u=ue.truncate(o,i);if(u.error)return K.error("Problem stringifying payload. Giving up"),a(u.error);var l=u.value;if(n.headers=cr(r,n,l),!(e=s?s(n):fr(n)))return K.error("Unknown transport based on given protocol: "+n.protocol),a(new Error("Unknown transport"));var c=e.request(n,function(t){this.handleResponse(t,function(t){return function(e,r){if(e)return t(e);r.result&&r.result.uuid?K.log(["Successful api response."," Link: https://rollbar.com/occurrence/uuid/?uuid="+r.result.uuid].join("")):K.log("Successful api response"),t(null,r.result)}}(a))}.bind(this));c.on("error",function(t){a(t)}),l&&c.write(l),c.end()},lr.prototype.updateRateLimit=function(t){var e=parseInt(t.headers["x-rate-limit-remaining"]||0),r=Math.min(60,t.headers["x-rate-limit-remaining-seconds"]||0),n=pr();429===t.statusCode&&0===e?this.rateLimitExpires=n+r:this.rateLimitExpires=n},lr.prototype.handleResponse=function(t,e){this.updateRateLimit(t);var r=[];t.setEncoding("utf8"),t.on("data",function(t){r.push(t)}),t.on("end",function(){!function(t,e){var r=function(t){var e,r;try{e=JSON.parse(t)}catch(t){r=t}return{error:r,value:e}}(t);if(r.error)return K.error("Could not parse api response, err: "+r.error),e(r.error);if((t=r.value).err)return K.error("Received error: "+t.message),e(new Error("Api error: "+(t.message||"Unknown error")));e(null,t)}(r=r.join(""),e)})};const hr=lr;function dr(t,e){if(l(t,"string")){var r=t;(t={}).accessToken=r}void 0!==t.minimumLevel&&(t.reportLevel=t.minimumLevel,delete t.minimumLevel),K.init({logLevel:t.logLevel||"error"}),this.options=I(dr.defaultOptions,t,null,K),this.options._configuredOptions=t,delete this.options.maxItems,this.options.environment=this.options.environment||"unspecified",this.lambdaContext=null,this.lambdaTimeoutHandle=null;var o=new hr,a=new z(this.options,o,n,ue,i),s=new Nt(this.options);this.client=e||new It(this.options,a,K,s,null,null,"server"),this.instrumenter=new _e(this.options,this.client.telemeter,this),this.instrumenter.instrument(),this.options.locals&&(this.locals=mr(this.options.locals,K)),this.client.notifier.addTransform(er).addTransform(nr).addTransform(rr).addTransform(Jt).addTransform(Bt).addTransform(or).addTransform(ir).addTransform(Gt).addTransform(ar).addTransform(Ht).addTransform(Wt(K)).addTransform($t).addTransform(Qt).addTransform(Ft),function(t){t.addPredicate(et).addPredicate(function(t){return function(e,r){var n=Boolean(e._isUncaught);delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{f(r.onSendCallback)&&r.onSendCallback(n,o,e)}catch(e){r.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(f(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}}(K)).addPredicate(function(t){return function(e,r){return!nt(e,r,"blocklist",t)}}(K)).addPredicate(function(t){return function(e,r){return nt(e,r,"safelist",t)}}(K)).addPredicate(ot(K))}(this.client.queue),this.setupUnhandledCapture()}function mr(t,e){var r;if(process.versions.node.split(".")[0]<10)return null;if("function"==typeof t)r=t,t=null;else{if(!l(t,"object"))return e.error("options.locals or options.locals.module must be a Locals module"),null;r=t.module,delete t.module}return new r(t,e)}var yr=null;function vr(t){var e="Rollbar is not initialized";K.error(e),t&&t(new Error(e))}function gr(t){for(var e=0,r=t.length;e<r;++e)if(f(t[e]))return t[e]}function br(t,e){var r=function(t,r){e(t,r)};r._rollbarHandler=!0;for(var n=process.listeners(t),o=n.length,i=0;i<o;++i)n[i]._rollbarHandler&&process.removeListener(t,n[i]);process.on(t,r)}function wr(t,e){Error.call(this),Error.captureStackTrace(this,this.constructor),this.message=t,this.nested=e,this.name=this.constructor.name}dr.init=function(t,e){return yr?yr.global(t).configure(t):yr=new dr(t,e)},dr.prototype.global=function(t){return delete(t=I(t)).maxItems,this.client.global(t),this},dr.global=function(t){if(yr)return yr.global(t);vr()},dr.prototype.configure=function(t,e){t.logLevel&&K.init({logLevel:t.logLevel});var r=this.options,n={};return e&&(n={payload:e}),this.options=I(r,t,n,K),this.options._configuredOptions=I(r._configuredOptions,t,n),delete this.options.maxItems,this.client.configure(t,e),this.setupUnhandledCapture(),this.options.locals&&(this.locals?this.locals.updateOptions(this.options.locals):this.locals=mr(this.options.locals,K)),this},dr.configure=function(t,e){if(yr)return yr.configure(t,e);vr()},dr.prototype.lastError=function(){return this.client.lastError},dr.lastError=function(){if(yr)return yr.lastError();vr()},dr.prototype.log=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}},dr.log=function(){if(yr)return yr.log.apply(yr,arguments);vr(gr(arguments))},dr.prototype.debug=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}},dr.debug=function(){if(yr)return yr.debug.apply(yr,arguments);vr(gr(arguments))},dr.prototype.info=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}},dr.info=function(){if(yr)return yr.info.apply(yr,arguments);vr(gr(arguments))},dr.prototype.warn=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}},dr.warn=function(){if(yr)return yr.warn.apply(yr,arguments);vr(gr(arguments))},dr.prototype.warning=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}},dr.warning=function(){if(yr)return yr.warning.apply(yr,arguments);vr(gr(arguments))},dr.prototype.error=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}},dr.error=function(){if(yr)return yr.error.apply(yr,arguments);vr(gr(arguments))},dr.prototype._uncaughtError=function(){var t=this._createItem(arguments);t._isUncaught=!0,t.level=this.options.uncaughtErrorLevel;var e=t.uuid;return this.client.log(t),{uuid:e}},dr.prototype.critical=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}},dr.critical=function(){if(yr)return yr.critical.apply(yr,arguments);vr(gr(arguments))},dr.prototype.buildJsonPayload=function(t){return this.client.buildJsonPayload(t)},dr.buildJsonPayload=function(){if(yr)return yr.buildJsonPayload.apply(yr,arguments);vr()},dr.prototype.sendJsonPayload=function(t){return this.client.sendJsonPayload(t)},dr.sendJsonPayload=function(){if(yr)return yr.sendJsonPayload.apply(yr,arguments);vr()},dr.prototype.wait=function(t){this.client.wait(t)},dr.wait=function(t){if(yr)return yr.wait(t);vr(gr(arguments))},dr.prototype.errorHandler=function(){return function(t,e,r,n){var o=function(o){return o&&K.error("Error reporting to rollbar, ignoring: "+o),n(t,e,r)};return t?t instanceof Error?this.error(t,e,o):this.error("Error: "+t,e,o):n(t,e,r)}.bind(this)},dr.errorHandler=function(){if(yr)return yr.errorHandler();vr()},dr.prototype.lambdaHandler=function(t,e){return t.length<=2?this.asyncLambdaHandler(t,e):this.syncLambdaHandler(t,e)},dr.prototype.asyncLambdaHandler=function(t,e){var r=this,n=function(t,e){var n={originalEvent:t,originalRequestId:e.awsRequestId};r.error("Function timed out",n)},o=this.options.captureLambdaTimeouts;return function(i,a){return new Promise(function(s,u){if(r.lambdaContext=a,o){var l=(e||n).bind(null,i,a);r.lambdaTimeoutHandle=setTimeout(l,a.getRemainingTimeInMillis()-1e3)}t(i,a).then(function(t){r.wait(function(){clearTimeout(r.lambdaTimeoutHandle),s(t)})}).catch(function(t){r.error(t),r.wait(function(){clearTimeout(r.lambdaTimeoutHandle),u(t)})})})}},dr.prototype.syncLambdaHandler=function(t,e){var r=this,n=function(t,e,n){var o={originalEvent:t,originalRequestId:e.awsRequestId};r.error("Function timed out",o)},o=this.options.captureLambdaTimeouts;return function(i,a,s){if(r.lambdaContext=a,o){var u=(e||n).bind(null,i,a,s);r.lambdaTimeoutHandle=setTimeout(u,a.getRemainingTimeInMillis()-1e3)}try{t(i,a,function(t,e){t&&r.error(t),r.wait(function(){clearTimeout(r.lambdaTimeoutHandle),s(t,e)})})}catch(t){r.error(t),r.wait(function(){throw clearTimeout(r.lambdaTimeoutHandle),t})}}},dr.lambdaHandler=function(t){if(yr)return yr.lambdaHandler(t);vr()},dr.prototype.wrapCallback=function(t){return function(t,e){return function(){var r=arguments[0];return r&&t.error(r),e.apply(this,arguments)}}(this,t)},dr.wrapCallback=function(t){if(yr)return yr.wrapCallback(t);vr()},dr.prototype.captureEvent=function(){var t=function(t){for(var e,r,n,o,i=0,a=t.length;i<a;++i)switch(c(o=t[i])){case"string":!e&&_(w,o)?e=o:!n&&_(k,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)},dr.captureEvent=function(){if(yr)return yr.captureEvent.apply(yr,arguments);vr()},dr.prototype.reportMessage=function(t,e,r,n){return K.log("reportMessage is deprecated"),f(this[e])?this[e](t,r,n):this.error(t,r,n)},dr.reportMessage=function(t,e,r,n){if(yr)return yr.reportMessage(t,e,r,n);vr(n)},dr.prototype.reportMessageWithPayloadData=function(t,e,r,n){return K.log("reportMessageWithPayloadData is deprecated"),this.error(t,r,e,n)},dr.reportMessageWithPayloadData=function(t,e,r,n){if(yr)return yr.reportMessageWithPayloadData(t,e,r,n);vr(n)},dr.prototype.handleError=function(t,e,r){return K.log("handleError is deprecated"),this.error(t,e,r)},dr.handleError=function(t,e,r){if(yr)return yr.handleError(t,e,r);vr(r)},dr.prototype.handleErrorWithPayloadData=function(t,e,r,n){return K.log("handleErrorWithPayloadData is deprecated"),this.error(t,r,e,n)},dr.handleErrorWithPayloadData=function(t,e,r,n){if(yr)return yr.handleErrorWithPayloadData(t,e,r,n);vr(n)},dr.handleUncaughtExceptions=function(t,e){if(yr)return(e=e||{}).accessToken=t,yr.configure(e);vr()},dr.handleUnhandledRejections=function(t,e){if(yr)return(e=e||{}).accessToken=t,yr.configure(e);vr()},dr.handleUncaughtExceptionsAndRejections=function(t,e){if(yr)return(e=e||{}).accessToken=t,yr.configure(e);vr()},dr.prototype._createItem=function(t){var e=b(t,K,this,["headers","protocol","url","method","body","route"],this.lambdaContext);return e.err&&e.notifier.locals&&(e.localsMap=e.notifier.locals.currentLocalsMap()),e},dr.prototype.setupUnhandledCapture=function(){(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&this.handleUncaughtExceptions(),(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&this.handleUnhandledRejections()},dr.prototype.handleUncaughtExceptions=function(){var t=Boolean(this.options.exitOnUncaughtException);delete this.options.exitOnUncaughtException,br("uncaughtException",function(e){(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(this._uncaughtError(e,function(t){t&&(K.error("Encountered error while handling an uncaught exception."),K.error(t))}),t&&setImmediate(function(){this.wait(function(){process.exit(1)})}.bind(this)))}.bind(this))},dr.prototype.handleUnhandledRejections=function(){br("unhandledRejection",function(t){(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&this._uncaughtError(t,function(t){t&&(K.error("Encountered error while handling an uncaught exception."),K.error(t))})}.bind(this))},o.inherits(wr,Error),dr.Error=wr,dr.defaultOptions={host:r.hostname(),environment:"production",framework:"node-js",showReportedMessageTraces:!1,notifier:{name:"node_rollbar",version:$},scrubHeaders:fe,scrubFields:pe,addRequestData:null,reportLevel:Q,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!1,captureEmail:!1,captureUsername:!1,captureIp:!0,captureLambdaTimeouts:!0,ignoreDuplicateErrors:!0,scrubRequestBody:!0,autoInstrument:!1};const kr=dr;module.exports=e.default})();
@@ -1 +1 @@
1
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
1
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */