UNPKG

@exceptionless/vue

Version:
10 lines 69.1 kB
var Ot=Object.create;var We=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var $t=Object.getPrototypeOf,Lt=Object.prototype.hasOwnProperty;var C=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Mt=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Nt(e))!Lt.call(n,i)&&i!==t&&We(n,i,{get:()=>e[i],enumerable:!(r=At(e,i))||r.enumerable});return n};var Tt=(n,e,t)=>(t=n!=null?Ot($t(n)):{},Mt(e||!n||!n.__esModule?We(t,"default",{value:n,enumerable:!0}):t,n));var xe=C((Le,Ke)=>{(function(n,e){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],e):typeof Le=="object"?Ke.exports=e():n.StackFrame=e()})(Le,function(){"use strict";function n(l){return!isNaN(parseFloat(l))&&isFinite(l)}function e(l){return l.charAt(0).toUpperCase()+l.substring(1)}function t(l){return function(){return this[l]}}var r=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],s=["fileName","functionName","source"],o=["args"],u=["evalOrigin"],c=r.concat(i,s,o,u);function f(l){if(l)for(var h=0;h<c.length;h++)l[c[h]]!==void 0&&this["set"+e(c[h])](l[c[h]])}f.prototype={getArgs:function(){return this.args},setArgs:function(l){if(Object.prototype.toString.call(l)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=l},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(l){if(l instanceof f)this.evalOrigin=l;else if(l instanceof Object)this.evalOrigin=new f(l);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var l=this.getFileName()||"",h=this.getLineNumber()||"",p=this.getColumnNumber()||"",v=this.getFunctionName()||"";return this.getIsEval()?l?"[eval] ("+l+":"+h+":"+p+")":"[eval]:"+h+":"+p:v?v+" ("+l+":"+h+":"+p+")":l+":"+h+":"+p}},f.fromString=function(h){var p=h.indexOf("("),v=h.lastIndexOf(")"),_=h.substring(0,p),b=h.substring(p+1,v).split(","),S=h.substring(v+1);if(S.indexOf("@")===0)var P=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(S,""),O=P[1],G=P[2],It=P[3];return new f({functionName:_,args:b||void 0,fileName:O,lineNumber:G||void 0,columnNumber:It||void 0})};for(var a=0;a<r.length;a++)f.prototype["get"+e(r[a])]=t(r[a]),f.prototype["set"+e(r[a])]=function(l){return function(h){this[l]=!!h}}(r[a]);for(var g=0;g<i.length;g++)f.prototype["get"+e(i[g])]=t(i[g]),f.prototype["set"+e(i[g])]=function(l){return function(h){if(!n(h))throw new TypeError(l+" must be a Number");this[l]=Number(h)}}(i[g]);for(var d=0;d<s.length;d++)f.prototype["get"+e(s[d])]=t(s[d]),f.prototype["set"+e(s[d])]=function(l){return function(h){this[l]=String(h)}}(s[d]);return f})});var Xe=C((Me,Ze)=>{(function(n,e){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],e):typeof Me=="object"?Ze.exports=e(xe()):n.ErrorStackParser=e(n.StackFrame)})(Me,function(e){"use strict";var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:function(o){if(typeof o.stacktrace<"u"||typeof o["opera#sourceloc"]<"u")return this.parseOpera(o);if(o.stack&&o.stack.match(r))return this.parseV8OrIE(o);if(o.stack)return this.parseFFOrSafari(o);throw new Error("Cannot parse given Error object")},extractLocation:function(o){if(o.indexOf(":")===-1)return[o];var u=/(.+?)(?::(\d+))?(?::(\d+))?$/,c=u.exec(o.replace(/[()]/g,""));return[c[1],c[2]||void 0,c[3]||void 0]},parseV8OrIE:function(o){var u=o.stack.split(` `).filter(function(c){return!!c.match(r)},this);return u.map(function(c){c.indexOf("(eval ")>-1&&(c=c.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var f=c.replace(/^\s+/,"").replace(/\(eval code/g,"("),a=f.match(/ (\((.+):(\d+):(\d+)\)$)/);f=a?f.replace(a[0],""):f;var g=f.split(/\s+/).slice(1),d=this.extractLocation(a?a[1]:g.pop()),l=g.join(" ")||void 0,h=["eval","<anonymous>"].indexOf(d[0])>-1?void 0:d[0];return new e({functionName:l,fileName:h,lineNumber:d[1],columnNumber:d[2],source:c})},this)},parseFFOrSafari:function(o){var u=o.stack.split(` `).filter(function(c){return!c.match(i)},this);return u.map(function(c){if(c.indexOf(" > eval")>-1&&(c=c.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),c.indexOf("@")===-1&&c.indexOf(":")===-1)return new e({functionName:c});var f=/((.*".+"[^@]*)?[^@]*)(?:@)/,a=c.match(f),g=a&&a[1]?a[1]:void 0,d=this.extractLocation(c.replace(f,""));return new e({functionName:g,fileName:d[0],lineNumber:d[1],columnNumber:d[2],source:c})},this)},parseOpera:function(o){return!o.stacktrace||o.message.indexOf(` `)>-1&&o.message.split(` `).length>o.stacktrace.split(` `).length?this.parseOpera9(o):o.stack?this.parseOpera11(o):this.parseOpera10(o)},parseOpera9:function(o){for(var u=/Line (\d+).*script (?:in )?(\S+)/i,c=o.message.split(` `),f=[],a=2,g=c.length;a<g;a+=2){var d=u.exec(c[a]);d&&f.push(new e({fileName:d[2],lineNumber:d[1],source:c[a]}))}return f},parseOpera10:function(o){for(var u=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,c=o.stacktrace.split(` `),f=[],a=0,g=c.length;a<g;a+=2){var d=u.exec(c[a]);d&&f.push(new e({functionName:d[3]||void 0,fileName:d[2],lineNumber:d[1],source:c[a]}))}return f},parseOpera11:function(o){var u=o.stack.split(` `).filter(function(c){return!!c.match(t)&&!c.match(/^Error created at/)},this);return u.map(function(c){var f=c.split("@"),a=this.extractLocation(f.pop()),g=f.shift()||"",d=g.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,l;g.match(/\(([^)]*)\)/)&&(l=g.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var h=l===void 0||l==="[arguments not available]"?void 0:l.split(",");return new e({functionName:d,args:h,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:c})},this)}}})});var et=C((Te,Ye)=>{(function(n,e){"use strict";typeof define=="function"&&define.amd?define("stack-generator",["stackframe"],e):typeof Te=="object"?Ye.exports=e(xe()):n.StackGenerator=e(n.StackFrame)})(Te,function(n){return{backtrace:function(t){var r=[],i=10;typeof t=="object"&&typeof t.maxStackSize=="number"&&(i=t.maxStackSize);for(var s=arguments.callee;s&&r.length<i&&s.arguments;){for(var o=new Array(s.arguments.length),u=0;u<o.length;++u)o[u]=s.arguments[u];/function(?:\s+([\w$]+))+\s*\(/.test(s.toString())?r.push(new n({functionName:RegExp.$1||void 0,args:o})):r.push(new n({args:o}));try{s=s.caller}catch{break}}return r}}})});var ke=C(x=>{function Rt(n,e,t){if(e in n)return n[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}x.getArg=Rt;var rt=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,Ut=/^data:.+\,.+$/;function Ce(n){var e=n.match(rt);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}x.urlParse=Ce;function fe(n){var e="";return n.scheme&&(e+=n.scheme+":"),e+="//",n.auth&&(e+=n.auth+"@"),n.host&&(e+=n.host),n.port&&(e+=":"+n.port),n.path&&(e+=n.path),e}x.urlGenerate=fe;function nt(n){var e=n,t=Ce(n);if(t){if(!t.path)return n;e=t.path}for(var r=x.isAbsolute(e),i=e.split(/\/+/),s,o=0,u=i.length-1;u>=0;u--)s=i[u],s==="."?i.splice(u,1):s===".."?o++:o>0&&(s===""?(i.splice(u+1,o),o=0):(i.splice(u,2),o--));return e=i.join("/"),e===""&&(e=r?"/":"."),t?(t.path=e,fe(t)):e}x.normalize=nt;function Ft(n,e){n===""&&(n="."),e===""&&(e=".");var t=Ce(e),r=Ce(n);if(r&&(n=r.path||"/"),t&&!t.scheme)return r&&(t.scheme=r.scheme),fe(t);if(t||e.match(Ut))return e;if(r&&!r.host&&!r.path)return r.host=e,fe(r);var i=e.charAt(0)==="/"?e:nt(n.replace(/\/+$/,"")+"/"+e);return r?(r.path=i,fe(r)):i}x.join=Ft;x.isAbsolute=function(n){return n.charAt(0)==="/"||!!n.match(rt)};function Dt(n,e){n===""&&(n="."),n=n.replace(/\/$/,"");for(var t=0;e.indexOf(n+"/")!==0;){var r=n.lastIndexOf("/");if(r<0||(n=n.slice(0,r),n.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(n.length+1)}x.relative=Dt;var it=function(){var n=Object.create(null);return!("__proto__"in n)}();function st(n){return n}function qt(n){return ot(n)?"$"+n:n}x.toSetString=it?st:qt;function jt(n){return ot(n)?n.slice(1):n}x.fromSetString=it?st:jt;function ot(n){if(!n)return!1;var e=n.length;if(e<9||n.charCodeAt(e-1)!==95||n.charCodeAt(e-2)!==95||n.charCodeAt(e-3)!==111||n.charCodeAt(e-4)!==116||n.charCodeAt(e-5)!==111||n.charCodeAt(e-6)!==114||n.charCodeAt(e-7)!==112||n.charCodeAt(e-8)!==95||n.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(n.charCodeAt(t)!==36)return!1;return!0}function Gt(n,e,t){var r=n.source-e.source;return r!==0||(r=n.originalLine-e.originalLine,r!==0)||(r=n.originalColumn-e.originalColumn,r!==0||t)||(r=n.generatedColumn-e.generatedColumn,r!==0)||(r=n.generatedLine-e.generatedLine,r!==0)?r:n.name-e.name}x.compareByOriginalPositions=Gt;function Qt(n,e,t){var r=n.generatedLine-e.generatedLine;return r!==0||(r=n.generatedColumn-e.generatedColumn,r!==0||t)||(r=n.source-e.source,r!==0)||(r=n.originalLine-e.originalLine,r!==0)||(r=n.originalColumn-e.originalColumn,r!==0)?r:n.name-e.name}x.compareByGeneratedPositionsDeflated=Qt;function tt(n,e){return n===e?0:n>e?1:-1}function Bt(n,e){var t=n.generatedLine-e.generatedLine;return t!==0||(t=n.generatedColumn-e.generatedColumn,t!==0)||(t=tt(n.source,e.source),t!==0)||(t=n.originalLine-e.originalLine,t!==0)||(t=n.originalColumn-e.originalColumn,t!==0)?t:tt(n.name,e.name)}x.compareByGeneratedPositionsInflated=Bt});var at=C(j=>{j.GREATEST_LOWER_BOUND=1;j.LEAST_UPPER_BOUND=2;function Re(n,e,t,r,i,s){var o=Math.floor((e-n)/2)+n,u=i(t,r[o],!0);return u===0?o:u>0?e-o>1?Re(o,e,t,r,i,s):s==j.LEAST_UPPER_BOUND?e<r.length?e:-1:o:o-n>1?Re(n,o,t,r,i,s):s==j.LEAST_UPPER_BOUND?o:n<0?-1:n}j.search=function(e,t,r,i){if(t.length===0)return-1;var s=Re(-1,t.length,e,t,r,i||j.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&r(t[s],t[s-1],!0)===0;)--s;return s}});var ct=C(ut=>{var Ue=ke(),Fe=Object.prototype.hasOwnProperty;function R(){this._array=[],this._set=Object.create(null)}R.fromArray=function(e,t){for(var r=new R,i=0,s=e.length;i<s;i++)r.add(e[i],t);return r};R.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length};R.prototype.add=function(e,t){var r=Ue.toSetString(e),i=Fe.call(this._set,r),s=this._array.length;(!i||t)&&this._array.push(e),i||(this._set[r]=s)};R.prototype.has=function(e){var t=Ue.toSetString(e);return Fe.call(this._set,t)};R.prototype.indexOf=function(e){var t=Ue.toSetString(e);if(Fe.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')};R.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};R.prototype.toArray=function(){return this._array.slice()};ut.ArraySet=R});var ft=C(De=>{var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");De.encode=function(n){if(0<=n&&n<lt.length)return lt[n];throw new TypeError("Must be between 0 and 63: "+n)};De.decode=function(n){var e=65,t=90,r=97,i=122,s=48,o=57,u=43,c=47,f=26,a=52;return e<=n&&n<=t?n-e:r<=n&&n<=i?n-r+f:s<=n&&n<=o?n-s+a:n==u?62:n==c?63:-1}});var pt=C(je=>{var gt=ft(),qe=5,dt=1<<qe,ht=dt-1,mt=dt;function Vt(n){return n<0?(-n<<1)+1:(n<<1)+0}function zt(n){var e=(n&1)===1,t=n>>1;return e?-t:t}je.encode=function(e){var t="",r,i=Vt(e);do r=i&ht,i>>>=qe,i>0&&(r|=mt),t+=gt.encode(r);while(i>0);return t};je.decode=function(e,t,r){var i=e.length,s=0,o=0,u,c;do{if(t>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(c=gt.decode(e.charCodeAt(t++)),c===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));u=!!(c&mt),c&=ht,s=s+(c<<o),o+=qe}while(u);r.value=zt(s),r.rest=t}});var _t=C(vt=>{function Ge(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}function Wt(n,e){return Math.round(n+Math.random()*(e-n))}function Qe(n,e,t,r){if(t<r){var i=Wt(t,r),s=t-1;Ge(n,i,r);for(var o=n[r],u=t;u<r;u++)e(n[u],o)<=0&&(s+=1,Ge(n,s,u));Ge(n,s+1,u);var c=s+1;Qe(n,e,t,c-1),Qe(n,e,c+1,r)}}vt.quickSort=function(n,e){Qe(n,e,0,n.length-1)}});var St=C(Ie=>{var m=ke(),Be=at(),V=ct().ArraySet,Ht=pt(),ge=_t().quickSort;function E(n){var e=n;return typeof n=="string"&&(e=JSON.parse(n.replace(/^\)\]\}'/,""))),e.sections!=null?new A(e):new w(e)}E.fromSourceMap=function(n){return w.fromSourceMap(n)};E.prototype._version=3;E.prototype.__generatedMappings=null;Object.defineProperty(E.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});E.prototype.__originalMappings=null;Object.defineProperty(E.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});E.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return r===";"||r===","};E.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};E.GENERATED_ORDER=1;E.ORIGINAL_ORDER=2;E.GREATEST_LOWER_BOUND=1;E.LEAST_UPPER_BOUND=2;E.prototype.eachMapping=function(e,t,r){var i=t||null,s=r||E.GENERATED_ORDER,o;switch(s){case E.GENERATED_ORDER:o=this._generatedMappings;break;case E.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;o.map(function(c){var f=c.source===null?null:this._sources.at(c.source);return f!=null&&u!=null&&(f=m.join(u,f)),{source:f,generatedLine:c.generatedLine,generatedColumn:c.generatedColumn,originalLine:c.originalLine,originalColumn:c.originalColumn,name:c.name===null?null:this._names.at(c.name)}},this).forEach(e,i)};E.prototype.allGeneratedPositionsFor=function(e){var t=m.getArg(e,"line"),r={source:m.getArg(e,"source"),originalLine:t,originalColumn:m.getArg(e,"column",0)};if(this.sourceRoot!=null&&(r.source=m.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var i=[],s=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",m.compareByOriginalPositions,Be.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var u=o.originalLine;o&&o.originalLine===u;)i.push({line:m.getArg(o,"generatedLine",null),column:m.getArg(o,"generatedColumn",null),lastColumn:m.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var c=o.originalColumn;o&&o.originalLine===t&&o.originalColumn==c;)i.push({line:m.getArg(o,"generatedLine",null),column:m.getArg(o,"generatedColumn",null),lastColumn:m.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};Ie.SourceMapConsumer=E;function w(n){var e=n;typeof n=="string"&&(e=JSON.parse(n.replace(/^\)\]\}'/,"")));var t=m.getArg(e,"version"),r=m.getArg(e,"sources"),i=m.getArg(e,"names",[]),s=m.getArg(e,"sourceRoot",null),o=m.getArg(e,"sourcesContent",null),u=m.getArg(e,"mappings"),c=m.getArg(e,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);r=r.map(String).map(m.normalize).map(function(f){return s&&m.isAbsolute(s)&&m.isAbsolute(f)?m.relative(s,f):f}),this._names=V.fromArray(i.map(String),!0),this._sources=V.fromArray(r,!0),this.sourceRoot=s,this.sourcesContent=o,this._mappings=u,this.file=c}w.prototype=Object.create(E.prototype);w.prototype.consumer=E;w.fromSourceMap=function(e){var t=Object.create(w.prototype),r=t._names=V.fromArray(e._names.toArray(),!0),i=t._sources=V.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var s=e._mappings.toArray().slice(),o=t.__generatedMappings=[],u=t.__originalMappings=[],c=0,f=s.length;c<f;c++){var a=s[c],g=new yt;g.generatedLine=a.generatedLine,g.generatedColumn=a.generatedColumn,a.source&&(g.source=i.indexOf(a.source),g.originalLine=a.originalLine,g.originalColumn=a.originalColumn,a.name&&(g.name=r.indexOf(a.name)),u.push(g)),o.push(g)}return ge(t.__originalMappings,m.compareByOriginalPositions),t};w.prototype._version=3;Object.defineProperty(w.prototype,"sources",{get:function(){return this._sources.toArray().map(function(n){return this.sourceRoot!=null?m.join(this.sourceRoot,n):n},this)}});function yt(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}w.prototype._parseMappings=function(e,t){for(var r=1,i=0,s=0,o=0,u=0,c=0,f=e.length,a=0,g={},d={},l=[],h=[],p,v,_,b,S;a<f;)if(e.charAt(a)===";")r++,a++,i=0;else if(e.charAt(a)===",")a++;else{for(p=new yt,p.generatedLine=r,b=a;b<f&&!this._charIsMappingSeparator(e,b);b++);if(v=e.slice(a,b),_=g[v],_)a+=v.length;else{for(_=[];a<b;)Ht.decode(e,a,d),S=d.value,a=d.rest,_.push(S);if(_.length===2)throw new Error("Found a source, but no line and column");if(_.length===3)throw new Error("Found a source and line, but no column");g[v]=_}p.generatedColumn=i+_[0],i=p.generatedColumn,_.length>1&&(p.source=u+_[1],u+=_[1],p.originalLine=s+_[2],s=p.originalLine,p.originalLine+=1,p.originalColumn=o+_[3],o=p.originalColumn,_.length>4&&(p.name=c+_[4],c+=_[4])),h.push(p),typeof p.originalLine=="number"&&l.push(p)}ge(h,m.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,ge(l,m.compareByOriginalPositions),this.__originalMappings=l};w.prototype._findMapping=function(e,t,r,i,s,o){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return Be.search(e,t,s,o)};w.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};w.prototype.originalPositionFor=function(e){var t={generatedLine:m.getArg(e,"line"),generatedColumn:m.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",m.compareByGeneratedPositionsDeflated,m.getArg(e,"bias",E.GREATEST_LOWER_BOUND));if(r>=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var s=m.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),this.sourceRoot!=null&&(s=m.join(this.sourceRoot,s)));var o=m.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:m.getArg(i,"originalLine",null),column:m.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};w.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};w.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(this.sourceRoot!=null&&(e=m.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(this.sourceRoot!=null&&(r=m.urlParse(this.sourceRoot))){var i=e.replace(/^file:\/\//,"");if(r.scheme=="file"&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!r.path||r.path=="/")&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};w.prototype.generatedPositionFor=function(e){var t=m.getArg(e,"source");if(this.sourceRoot!=null&&(t=m.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var r={source:t,originalLine:m.getArg(e,"line"),originalColumn:m.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",m.compareByOriginalPositions,m.getArg(e,"bias",E.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===r.source)return{line:m.getArg(s,"generatedLine",null),column:m.getArg(s,"generatedColumn",null),lastColumn:m.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Ie.BasicSourceMapConsumer=w;function A(n){var e=n;typeof n=="string"&&(e=JSON.parse(n.replace(/^\)\]\}'/,"")));var t=m.getArg(e,"version"),r=m.getArg(e,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new V,this._names=new V;var i={line:-1,column:0};this._sections=r.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var o=m.getArg(s,"offset"),u=m.getArg(o,"line"),c=m.getArg(o,"column");if(u<i.line||u===i.line&&c<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=o,{generatedOffset:{generatedLine:u+1,generatedColumn:c+1},consumer:new E(m.getArg(s,"map"))}})}A.prototype=Object.create(E.prototype);A.prototype.constructor=E;A.prototype._version=3;Object.defineProperty(A.prototype,"sources",{get:function(){for(var n=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)n.push(this._sections[e].consumer.sources[t]);return n}});A.prototype.originalPositionFor=function(e){var t={generatedLine:m.getArg(e,"line"),generatedColumn:m.getArg(e,"column")},r=Be.search(t,this._sections,function(s,o){var u=s.generatedLine-o.generatedOffset.generatedLine;return u||s.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[r];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};A.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};A.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var i=this._sections[r],s=i.consumer.sourceContentFor(e,!0);if(s)return s}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};A.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(r.consumer.sources.indexOf(m.getArg(e,"source"))!==-1){var i=r.consumer.generatedPositionFor(e);if(i){var s={line:i.line+(r.generatedOffset.generatedLine-1),column:i.column+(r.generatedOffset.generatedLine===i.line?r.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};A.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var i=this._sections[r],s=i.consumer._generatedMappings,o=0;o<s.length;o++){var u=s[o],c=i.consumer._sources.at(u.source);i.consumer.sourceRoot!==null&&(c=m.join(i.consumer.sourceRoot,c)),this._sources.add(c),c=this._sources.indexOf(c);var f=i.consumer._names.at(u.name);this._names.add(f),f=this._names.indexOf(f);var a={source:c,generatedLine:u.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(i.generatedOffset.generatedLine===u.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:f};this.__generatedMappings.push(a),typeof a.originalLine=="number"&&this.__originalMappings.push(a)}ge(this.__generatedMappings,m.compareByGeneratedPositionsDeflated),ge(this.__originalMappings,m.compareByOriginalPositions)};Ie.IndexedSourceMapConsumer=A});var Et=C((Ve,bt)=>{(function(n,e){"use strict";typeof define=="function"&&define.amd?define("stacktrace-gps",["source-map","stackframe"],e):typeof Ve=="object"?bt.exports=e(St(),xe()):n.StackTraceGPS=e(n.SourceMap||n.sourceMap,n.StackFrame)})(Ve,function(n,e){"use strict";function t(a){return new Promise(function(g,d){var l=new XMLHttpRequest;l.open("get",a),l.onerror=d,l.onreadystatechange=function(){l.readyState===4&&(l.status>=200&&l.status<300||a.substr(0,7)==="file://"&&l.responseText?g(l.responseText):d(new Error("HTTP status: "+l.status+" retrieving "+a)))},l.send()})}function r(a){if(typeof window<"u"&&window.atob)return window.atob(a);throw new Error("You must supply a polyfill for window.atob in this environment")}function i(a){if(typeof JSON<"u"&&JSON.parse)return JSON.parse(a);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function s(a,g){for(var d=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],l=a.split(` `),h="",p=Math.min(g,20),v=0;v<p;++v){var _=l[g-v-1],b=_.indexOf("//");if(b>=0&&(_=_.substr(0,b)),_){h=_+h;for(var S=d.length,P=0;P<S;P++){var O=d[P].exec(h);if(O&&O[1])return O[1]}}}}function o(){if(typeof Object.defineProperty!="function"||typeof Object.create!="function")throw new Error("Unable to consume source maps in older browsers")}function u(a){if(typeof a!="object")throw new TypeError("Given StackFrame is not an object");if(typeof a.fileName!="string")throw new TypeError("Given file name is not a String");if(typeof a.lineNumber!="number"||a.lineNumber%1!==0||a.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if(typeof a.columnNumber!="number"||a.columnNumber%1!==0||a.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function c(a){for(var g=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/mg,d,l;l=g.exec(a);)d=l[1];if(d)return d;throw new Error("sourceMappingURL not found")}function f(a,g,d){return new Promise(function(l,h){var p=g.originalPositionFor({line:a.lineNumber,column:a.columnNumber});if(p.source){var v=g.sourceContentFor(p.source);v&&(d[p.source]=v),l(new e({functionName:p.name||a.functionName,args:a.args,fileName:p.source,lineNumber:p.line,columnNumber:p.column}))}else h(new Error("Could not get original source for given stackframe and source map"))})}return function a(g){if(!(this instanceof a))return new a(g);g=g||{},this.sourceCache=g.sourceCache||{},this.sourceMapConsumerCache=g.sourceMapConsumerCache||{},this.ajax=g.ajax||t,this._atob=g.atob||r,this._get=function(l){return new Promise(function(h,p){var v=l.substr(0,5)==="data:";if(this.sourceCache[l])h(this.sourceCache[l]);else if(g.offline&&!v)p(new Error("Cannot make network requests in offline mode"));else if(v){var _=/^data:application\/json;([\w=:"-]+;)*base64,/,b=l.match(_);if(b){var S=b[0].length,P=l.substr(S),O=this._atob(P);this.sourceCache[l]=O,h(O)}else p(new Error("The encoding of the inline sourcemap is not supported"))}else{var G=this.ajax(l,{method:"get"});this.sourceCache[l]=G,G.then(h,p)}}.bind(this))},this._getSourceMapConsumer=function(l,h){return new Promise(function(p){if(this.sourceMapConsumerCache[l])p(this.sourceMapConsumerCache[l]);else{var v=new Promise(function(_,b){return this._get(l).then(function(S){typeof S=="string"&&(S=i(S.replace(/^\)\]\}'/,""))),typeof S.sourceRoot>"u"&&(S.sourceRoot=h),_(new n.SourceMapConsumer(S))},b)}.bind(this));this.sourceMapConsumerCache[l]=v,p(v)}}.bind(this))},this.pinpoint=function(l){return new Promise(function(h,p){this.getMappedLocation(l).then(function(v){function _(){h(v)}this.findFunctionName(v).then(h,_).catch(_)}.bind(this),p)}.bind(this))},this.findFunctionName=function(l){return new Promise(function(h,p){u(l),this._get(l.fileName).then(function(_){var b=l.lineNumber,S=l.columnNumber,P=s(_,b,S);h(P?new e({functionName:P,args:l.args,fileName:l.fileName,lineNumber:b,columnNumber:S}):l)},p).catch(p)}.bind(this))},this.getMappedLocation=function(l){return new Promise(function(h,p){o(),u(l);var v=this.sourceCache,_=l.fileName;this._get(_).then(function(b){var S=c(b),P=S.substr(0,5)==="data:",O=_.substring(0,_.lastIndexOf("/")+1);return S[0]!=="/"&&!P&&!/^https?:\/\/|^\/\//i.test(S)&&(S=O+S),this._getSourceMapConsumer(S,O).then(function(G){return f(l,G,v).then(h).catch(function(){h(l)})})}.bind(this),p).catch(p)}.bind(this))}}})});var Pt=C((ze,wt)=>{(function(n,e){"use strict";typeof define=="function"&&define.amd?define("stacktrace",["error-stack-parser","stack-generator","stacktrace-gps"],e):typeof ze=="object"?wt.exports=e(Xe(),et(),Et()):n.StackTrace=e(n.ErrorStackParser,n.StackGenerator,n.StackTraceGPS)})(ze,function(e,t,r){var i={filter:function(f){return(f.functionName||"").indexOf("StackTrace$$")===-1&&(f.functionName||"").indexOf("ErrorStackParser$$")===-1&&(f.functionName||"").indexOf("StackTraceGPS$$")===-1&&(f.functionName||"").indexOf("StackGenerator$$")===-1},sourceCache:{}},s=function(){try{throw new Error}catch(a){return a}};function o(f,a){var g={};return[f,a].forEach(function(d){for(var l in d)Object.prototype.hasOwnProperty.call(d,l)&&(g[l]=d[l]);return g}),g}function u(f){return f.stack||f["opera#sourceloc"]}function c(f,a){return typeof a=="function"?f.filter(a):f}return{get:function(a){var g=s();return u(g)?this.fromError(g,a):this.generateArtificially(a)},getSync:function(a){a=o(i,a);var g=s(),d=u(g)?e.parse(g):t.backtrace(a);return c(d,a.filter)},fromError:function(a,g){g=o(i,g);var d=new r(g);return new Promise(function(l){var h=c(e.parse(a),g.filter);l(Promise.all(h.map(function(p){return new Promise(function(v){function _(){v(p)}d.pinpoint(p).then(v,_).catch(_)})})))}.bind(this))},generateArtificially:function(a){a=o(i,a);var g=t.backtrace(a);return typeof a.filter=="function"&&(g=g.filter(a.filter)),Promise.resolve(g)},instrument:function(a,g,d,l){if(typeof a!="function")throw new Error("Cannot instrument non-function object");if(typeof a.__stacktraceOriginalFn=="function")return a;var h=function(){try{return this.get().then(g,d).catch(d),a.apply(l||this,arguments)}catch(v){throw u(v)&&this.fromError(v).then(g,d).catch(d),v}}.bind(this);return h.__stacktraceOriginalFn=a,h},deinstrument:function(a){if(typeof a!="function")throw new Error("Cannot de-instrument non-function object");return typeof a.__stacktraceOriginalFn=="function"?a.__stacktraceOriginalFn:a},report:function(a,g,d,l){return new Promise(function(h,p){var v=new XMLHttpRequest;if(v.onerror=p,v.onreadystatechange=function(){v.readyState===4&&(v.status>=200&&v.status<400?h(v.responseText):p(new Error("POST to "+g+" failed with status: "+v.status)))},v.open("post",g),v.setRequestHeader("Content-Type","application/json"),l&&typeof l.headers=="object"){var _=l.headers;for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&v.setRequestHeader(b,_[b])}var S={stack:a};d!=null&&(S.message=d),v.send(JSON.stringify(S))})}}})});var z=class{_lastReferenceId=null;getLast(){return this._lastReferenceId}clearLast(){this._lastReferenceId=null}setLast(e){this._lastReferenceId=e}};var W=class{trace(e){this.log("debug",e)}info(e){this.log("info",e)}warn(e){this.log("warn",e)}error(e){this.log("error",e)}log(e,t){if(console){let r=`Exceptionless:${new Date().toISOString()} [${e}] ${t}`,i=console[e];i?i(r):console.log&&console.log(r)}}};var H=class{trace(e){}info(e){}warn(e){}error(e){}};var y;(function(n){n.Error="@error",n.SimpleError="@simple_error",n.RequestInfo="@request",n.TraceLog="@trace",n.EnvironmentInfo="@environment",n.UserInfo="@user",n.UserDescription="@user_description",n.Version="@version",n.Level="@level",n.SubmissionMethod="@submission_method",n.ManualStackingInfo="@stack"})(y||(y={}));function Q(n){if(!n||n.length===0)return 0;let e=0;for(let t=0;t<n.length;t++){let r=n.charCodeAt(t);e=(e<<5)-e+r,e|=0}return e}function Oe(n,e){let t={},r=(n||"").split("; ");for(let i of r){let s=i.split("=");U(s[0],e||[])||(t[s[0]]=s[1])}return I(t)?null:t}function D(){function n(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()}function Ae(n){if(!n)return null;let t=/(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?)/.exec(n);return t&&t.length>0?t[0]:null}function Ne(n,e){if(!n||n.length===0)return{};let t=n.split("&");if(t.length===0)return{};let r={};for(let i of t){let s=i.split("=");(!e||!U(s[0],e))&&(r[decodeURIComponent(s[0])]=decodeURIComponent(s[1]))}return I(r)?{}:r}function kt(){return Math.floor(Math.random()*9007199254740992)}function U(n,e,t=!0){if(typeof n!="string")return!1;let r=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;return n=(t?n.toLowerCase():n).replace(r,""),(e||[]).some(i=>{if(typeof i!="string")return!1;if(i&&(i=(t?i.toLowerCase():i).replace(r,"")),!i)return n==null;if(i==="*")return!0;if(n==null)return!1;let s=i[0]==="*";s&&(i=i.slice(1));let o=i[i.length-1]==="*";return o&&(i=i.substring(0,i.length-1)),s&&o?i.length<=n.length&&n.indexOf(i,0)!==-1:s?He(n,i):o?Se(n,i):n===i})}function I(n){if(n==null)return!0;if(typeof n=="object")return Array.isArray(n)?n.length===0:n instanceof Date?!1:Object.getOwnPropertyNames(n).length===0;if(typeof n=="string"){let e=n.trim();return e.length===0||e==="{}"||e==="[]"}return!1}function Se(n,e){return n.substring(0,e.length)===e}function He(n,e){return n.indexOf(e,n.length-e.length)!==-1}function Je(n,e=10){function t(s){if(s==null)return!1;switch(typeof s){case"function":return!0;case"object":switch(Object.prototype.toString.call(s)){case"[object AsyncGenerator]":case"[object Generator]":case"[object ArrayBuffer]":case"[object Buffer]":case"[object DataView]":case"[object Promise]":case"[object WeakMap]":case"[object WeakSet]":return!0}if("writeBigInt64LE"in s)return!0;break}return!1}function r(s){function o(u){return u!==null&&typeof u=="object"&&typeof u.toJSON=="function"}if(typeof s=="bigint")return`${s.toString()}n`;if(typeof s=="object"){if(Array.isArray(s)||s instanceof Date)return s;if(s instanceof Map){let c={};for(let[f,a]of s)c[f]=a;return c}if(s instanceof RegExp)return s.toString();if(s instanceof Set)return Array.from(s);let u=Object.getPrototypeOf(Uint8Array);return s instanceof u?Array.from(s):o(s)?r(s.toJSON()):s}return typeof s=="symbol"?s.description:s}function i(s,o,u=10,c=new WeakSet,f=!1){if(s==null)return s;if(u>o||t(s))return;let a=r(s);if(typeof a=="object"){if(u==o)return;if(Array.isArray(a)){let l=f?u+1:u;return a.map(h=>i(h,o,l,c,!0))}if(a instanceof Date)return a;if(Object.prototype.toString.call(a)==="[object Object]"){if(c.has(a))return;c.add(a)}let g=new Set([...Object.getOwnPropertyNames(a),...Object.getOwnPropertySymbols(a)]);for(let l in a)g.add(l);let d={};for(let l of g){let h=r(l),p=a[l];d[h]=i(p,o,u+1,c)}return d}return a}if(!(e<0))return i(n,e,0)}function N(n,e,t=10){function r(s,o){return JSON.stringify(s,(u,c)=>{if(!U(u,o))return c})}if(n===void 0)return n;let i=Je(n,t);return r(i,e||[])}function be(n,e=!1){if(typeof n=="boolean")return n;if(n===null||typeof n!="number"&&typeof n!="string")return e;switch((n+"").toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case null:return!1}return e}function Ee(n,e="Unknown Error"){if(n==null){let r=new Error(e);return r.stack=void 0,r}if(n instanceof Error)return n;if(typeof n=="string"){let r=new Error(n);return r.stack=void 0,r}let t=new Error(N(n)||e);return t.stack=void 0,t}function M(n){typeof n=="object"&&"unref"in n&&n.unref()}var J=class{priority=100;name="HeartbeatPlugin";_interval;_intervalId;constructor(e=6e4){this._interval=e>=3e4?e:6e4}startup(){return clearInterval(this._intervalId),this._intervalId=void 0,Promise.resolve()}suspend(){return clearInterval(this._intervalId),this._intervalId=void 0,Promise.resolve()}run(e){if(this._interval<=0)return Promise.resolve();clearInterval(this._intervalId),this._intervalId=void 0;let{config:t}=e.client;if(!t.currentSessionIdentifier){let r=e.event.data?.[y.UserInfo];if(!r?.identity)return Promise.resolve();t.currentSessionIdentifier=r.identity}return t.currentSessionIdentifier&&(this._intervalId=setInterval(()=>void e.client.submitSessionHeartbeat(t.currentSessionIdentifier),this._interval),M(this._intervalId)),Promise.resolve()}};var K=class{priority=25;name="SessionIdManagementPlugin";run(e){let t=e.event,r=t.type==="session",{config:i}=e.client;return(r||!i.currentSessionIdentifier)&&(i.currentSessionIdentifier=D().replaceAll("-","")),r?t.reference_id=i.currentSessionIdentifier:(t.data||(t.data={}),t.data["@ref:session"]=i.currentSessionIdentifier),Promise.resolve()}};var Z=class{priority=10;name="ConfigurationDefaultsPlugin";run(e){let{dataExclusions:t,defaultData:r,defaultTags:i}=e.client.config,s=e.event;if(i&&(s.tags=[...s.tags||[],...i]),r){s.data||(s.data={});for(let o in r){if(s.data[o]!==void 0||I(r[o]))continue;let u=N(r[o],t);I(u)||(s.data[o]=JSON.parse(u))}}return Promise.resolve()}};var X=class{priority=1010;name="DuplicateCheckerPlugin";_mergedEvents=[];_processedHashCodes=[];_getCurrentTime;_intervalId;_interval;constructor(e=()=>Date.now(),t=3e4){this._getCurrentTime=e,this._interval=t}startup(){return clearInterval(this._intervalId),this._intervalId=setInterval(()=>void this.submitEvents(),this._interval),M(this._intervalId),Promise.resolve()}async suspend(){clearInterval(this._intervalId),this._intervalId=void 0,await this.submitEvents()}run(e){function t(s){let o=0;for(;s;)s.message&&s.message.length&&(o+=o*397^Q(s.message)),s.stack_trace&&s.stack_trace.length&&(o+=o*397^Q(JSON.stringify(s.stack_trace))),s=s.inner;return o}let r=e.event.data?.[y.Error],i=t(r);if(i){let s=e.event.count||1,o=this._getCurrentTime(),u=this._mergedEvents.filter(c=>c.hashCode===i)[0];if(u&&(u.incrementCount(s),u.updateDate(e.event.date),e.log.info("Ignoring duplicate event with hash: "+i),e.cancelled=!0),!e.cancelled&&this._processedHashCodes.some(c=>c.hash===i&&c.timestamp>=o-this._interval)&&(e.log.trace("Adding event with hash: "+i),this._mergedEvents.push(new $e(i,e,s)),e.cancelled=!0),!e.cancelled)for(e.log.trace(`Enqueueing event with hash: ${i} to cache`),this._processedHashCodes.push({hash:i,timestamp:o});this._processedHashCodes.length>50;)this._processedHashCodes.shift()}return Promise.resolve()}async submitEvents(){for(;this._mergedEvents.length>0;)await this._mergedEvents.shift()?.resubmit()}},$e=class{hashCode;_count;_context;constructor(e,t,r){this.hashCode=e,this._context=t,this._count=r}incrementCount(e){this._count+=e}async resubmit(){this._context.event.count=this._count,await this._context.client.config.services.queue.enqueue(this._context.event)}updateDate(e){let t=this._context.event;e&&t.date&&e>t.date&&(t.date=e)}};var Y=class{priority=45;name="EventExclusionPlugin";run(e){let t=e.event,r=e.log,i=e.client.config.settings;if(t.type==="log"){let s=this.getMinLogLevel(i,t.source),o=this.getLogLevel(t.data&&t.data[y.Level]);o!==-1&&(o===6||o<s)&&(r.info("Cancelling log event due to minimum log level."),e.cancelled=!0)}else if(t.type==="error"){let s=t.data&&t.data[y.Error];for(;!e.cancelled&&s;)this.getTypeAndSourceSetting(i,t.type,s.type,!0)===!1&&(r.info(`Cancelling error from excluded exception type: ${s.type}`),e.cancelled=!0),s=s.inner}else this.getTypeAndSourceSetting(i,t.type,t.source,!0)===!1&&(r.info(`Cancelling event from excluded type: ${t.type} and source: ${t.source}`),e.cancelled=!0);return Promise.resolve()}getLogLevel(e){switch((e||"").toLowerCase().trim()){case"trace":case"true":case"1":case"yes":return 0;case"debug":return 1;case"info":return 2;case"warn":return 3;case"error":return 4;case"fatal":return 5;case"off":case"false":case"0":case"no":return 6;default:return-1}}getMinLogLevel(e,t){return this.getLogLevel(this.getTypeAndSourceSetting(e,"log",t,"other")+"")}getTypeAndSourceSetting(e={},t,r,i){if(!t)return i;r||(r="");let s=t==="log",o=`@@${t}:`,u=e[o+r];if(u)return s?u:be(u);let c=Object.keys(e).sort((f,a)=>a.length-f.length||f.localeCompare(a));for(let f of c){if(!Se(f.toLowerCase(),o))continue;let a=f.substring(o.length);if(U(r,[a]))return s?e[f]:be(e[f])}return i}};var ee=class{priority=20;name="ReferenceIdPlugin";run(e){return!e.event.reference_id&&e.event.type==="error"&&(e.event.reference_id=D().replaceAll("-","").substring(0,10)),Promise.resolve()}};var we=["arguments","column","columnNumber","description","fileName","message","name","number","line","lineNumber","opera#sourceloc","sourceId","sourceURL","stack","stackArray","stacktrace"],q=class{priority=30;name="SimpleErrorPlugin";async run(e){let t=e.eventContext.getException();if(t&&(e.event.type||(e.event.type="error"),e.event.data&&!e.event.data[y.SimpleError])){let r={type:t.name||"Error",message:t.message,stack_trace:t.stack,data:{}},i=e.client.config.dataExclusions.concat(we),s=N(t,i);I(s)||(r.data["@ext"]=JSON.parse(s)),e.event.data[y.SimpleError]=r}return Promise.resolve()}};var te=class{priority=100;name="SubmissionMethodPlugin";run(e){let t=e.eventContext.getSubmissionMethod();return t&&e.event.data&&(e.event.data[y.SubmissionMethod]=t),Promise.resolve()}};var T=class{static async startup(e){for(let t of e.client.config.plugins)if(t.startup)try{await t.startup(e)}catch(r){e.log.error(`Error running plugin startup"${t.name}": ${r instanceof Error?r.message:r+""}`)}}static async suspend(e){for(let t of e.client.config.plugins)if(t.suspend)try{await t.suspend(e)}catch(r){e.log.error(`Error running plugin suspend"${t.name}": ${r instanceof Error?r.message:r+""}`)}}static async run(e){for(let t of e.client.config.plugins){if(e.cancelled)break;if(t.run)try{await t.run(e)}catch(r){e.cancelled=!0,e.log.error(`Error running plugin "${t.name}": ${r instanceof Error?r.message:r+""}. Discarding Event.`)}}}static addDefaultPlugins(e){e.addPlugin(new Z),e.addPlugin(new q),e.addPlugin(new ee),e.addPlugin(new X),e.addPlugin(new Y),e.addPlugin(new te)}};var re=class{config;maxItems;_handlers=[];_suspendProcessingUntil;_discardQueuedItemsUntil;_processingQueue=!1;_queueIntervalId;QUEUE_PREFIX="q:";_lastFileTimestamp=0;_queue=[];_loadPersistedEvents=!0;constructor(e,t=250){this.config=e,this.maxItems=t}async enqueue(e){let t="The event will not be queued.",r=this.config,i=r.services.log;if(!r.enabled){i.info(`Configuration is disabled. ${t}`);return}if(!r.isValid){i.info(`Invalid Api Key. ${t}`);return}if(this.areQueuedItemsDiscarded()){i.info(`Queue items are currently being discarded. ${t}`);return}let s=await this.enqueueEvent(e),o=`type=${e.type} reference_id=${e.reference_id} source=${e.source} message=${e.message}`;i.info(`Enqueued event: ${s} (${o})`)}async process(){let e="The queue will not be processed",{log:t}=this.config.services;if(!this._processingQueue){if(t.trace("Processing queue..."),!this.config.enabled){t.info(`Configuration is disabled: ${e}`);return}if(!this.config.isValid){t.info(`Invalid Api Key: ${e}`);return}this._processingQueue=!0;try{this._loadPersistedEvents&&(this.config.usePersistedQueueStorage&&await this.loadEvents(),this._loadPersistedEvents=!1);let r=this._queue.slice(0,this.config.submissionBatchSize);if(!r||r.length===0){this._processingQueue=!1;return}t.info(`Sending ${r.length} events to ${this.config.serverUrl}`);let i=r.map(o=>o.event),s=await this.config.services.submissionClient.submitEvents(i);await this.processSubmissionResponse(s,r),await this.eventsPosted(i,s),t.trace("Finished processing queue"),this._processingQueue=!1}catch(r){t.error(`Error processing queue: ${r instanceof Error?r.message:r+""}`),await this.suspendProcessing(),this._processingQueue=!1}}}startup(){return this._queueIntervalId||(this._queueIntervalId=setInterval(()=>void this.onProcessQueue(),1e4),M(this._queueIntervalId)),Promise.resolve()}suspend(){return clearInterval(this._queueIntervalId),this._queueIntervalId=void 0,Promise.resolve()}async suspendProcessing(e,t,r){let i=this.config,s=new Date;(!e||e<=0)&&(e=Math.ceil(s.getMinutes()/15)*15-s.getMinutes()),i.services.log.info(`Suspending processing for ${e} minutes.`),this._suspendProcessingUntil=new Date(s.getTime()+e*6e4),t&&(this._discardQueuedItemsUntil=this._suspendProcessingUntil),r&&await this.removeEvents(this._queue)}onEventsPosted(e){e&&this._handlers.push(e)}async eventsPosted(e,t){let r=this._handlers;for(let i of r)try{await i(e,t)}catch(s){this.config.services.log.error(`Error calling onEventsPosted handler: ${s instanceof Error?s.message:s+""}`)}}areQueuedItemsDiscarded(){return this._discardQueuedItemsUntil&&this._discardQueuedItemsUntil>new Date||!1}isQueueProcessingSuspended(){return this._suspendProcessingUntil&&this._suspendProcessingUntil>new Date||!1}async onProcessQueue(){!this.isQueueProcessingSuspended()&&!this._processingQueue&&await this.process()}async processSubmissionResponse(e,t){let r="The event will not be submitted",i=this.config,s=i.services.log;if(e.status===202){s.info(`Sent ${t.length} events`),await this.removeEvents(t);return}if(e.status===429||e.rateLimitRemaining===0||e.status===503){s.error("Server returned service unavailable"),await this.suspendProcessing();return}if(e.status===402){s.info("Too many events have been submitted, please upgrade your plan"),await this.suspendProcessing(0,!0,!0);return}if(e.status===401||e.status===403){s.info(`Unable to authenticate, please check your configuration. ${r}`),await this.suspendProcessing(15),await this.removeEvents(t);return}if(e.status===400||e.status===404){s.error(`Error while trying to submit data: ${e.message}`),await this.suspendProcessing(60*4),await this.removeEvents(t);return}if(e.status===413){let o="Event submission discarded for being too large.";i.submissionBatchSize>1?(s.error(`${o} Retrying with smaller batch size.`),i.submissionBatchSize=Math.max(1,Math.round(i.submissionBatchSize/1.5))):(s.error(`${o} ${r}`),await this.removeEvents(t));return}s.error(`Error submitting events: ${e.message||"Please check the network tab for more info."}`),await this.suspendProcessing()}async loadEvents(){if(this.config.usePersistedQueueStorage){let{log:e,storage:t}=this.config.services;try{let r=await t.keys();for(let i of r)if(i?.startsWith(this.QUEUE_PREFIX)){let s=await t.getItem(i);s&&this._queue.push({file:i,event:JSON.parse(s)})}}catch(r){e.error(`Error loading queue items from storage: ${r instanceof Error?r.message:r+""}`)}}}async enqueueEvent(e){this._lastFileTimestamp=Math.max(Date.now(),this._lastFileTimestamp+1);let t=`${this.QUEUE_PREFIX}${this._lastFileTimestamp}.json`,{log:r,storage:i}=this.config.services,s=this.config.usePersistedQueueStorage;if(this._queue.push({file:t,event:e})>this.maxItems){r.trace("Removing oldest queue entry: maxItems exceeded");let o=this._queue.shift();if(s&&o)try{await i.removeItem(o.file)}catch(u){r.error(`Error removing oldest queue entry from storage: ${u instanceof Error?u.message:u+""}`)}}if(s)try{await i.setItem(t,JSON.stringify(e))}catch(o){r.error(`Error saving queue entry to storage: ${o instanceof Error?o.message:o+""}`)}return t}async removeEvents(e){let t=e.map(r=>r.file);if(this.config.usePersistedQueueStorage){let{log:r,storage:i}=this.config.services;for(let s of t)try{await i.removeItem(s)}catch(o){r.error(`Error removing queue item from storage: ${o instanceof Error?o.message:o+""}`)}}this._queue=this._queue.filter(r=>!t.includes(r.file))}};var Pe=class{settings;version;constructor(e,t){this.settings=e,this.version=t}},F=class n{static SettingsKey="settings";static _isUpdatingSettings=!1;static async applySavedServerSettings(e){if(!e?.isValid)return;let t=await this.getSavedServerSettings(e);t&&e.applyServerSettings(t)}static async updateSettings(e){if(!e?.enabled||this._isUpdatingSettings)return;this._isUpdatingSettings=!0;let{log:t,storage:r,submissionClient:i}=e.services;try{let s="Unable to update settings";if(!e.isValid){t.error(`${s}: ApiKey is not set`);return}let o=e.settingsVersion;t.trace(`Checking for updated settings from: v${o}`);let u=await i.getSettings(o);if(u.status===304){t.trace("Settings are up-to-date");return}if(!u?.success||!u.data){t.warn(`${s}: ${u.message}`);return}e.applyServerSettings(u.data),await r.setItem(n.SettingsKey,JSON.stringify(u.data)),t.trace(`Updated settings: v${u.data.version}`)}catch(s){t.error(`Error updating settings: ${s instanceof Error?s.message:s+""}`)}finally{this._isUpdatingSettings=!1}}static async getSavedServerSettings(e){let{log:t,storage:r}=e.services;try{let i=await r.getItem(n.SettingsKey);return i&&JSON.parse(i)||new Pe({},0)}catch(i){return t.error(`Error getting saved settings: ${i instanceof Error?i.message:i+""}`),new Pe({},0)}}};var ne=class{status;message;rateLimitRemaining;settingsVersion;data;constructor(e,t,r,i,s){this.status=e,this.message=t,this.rateLimitRemaining=r,this.settingsVersion=i,this.data=s}get success(){return this.status>=200&&this.status<=299}};var ie=class{config;fetch;RateLimitRemainingHeader="x-ratelimit-remaining";ConfigurationVersionHeader="x-exceptionless-configversion";constructor(e,t=globalThis.fetch?.bind(globalThis)){this.config=e,this.fetch=t}getSettings(e){let t=`${this.config.serverUrl}/api/v2/projects/config?v=${e}`;return this.apiFetch(t,{method:"GET"})}async submitEvents(e){let t=`${this.config.serverUrl}/api/v2/events`,r=await this.apiFetch(t,{method:"POST",body:JSON.stringify(e)});return await this.updateSettingsVersion(r.settingsVersion),r}async submitUserDescription(e,t){let r=`${this.config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(e)}/user-description`,i=await this.apiFetch(r,{method:"POST",body:JSON.stringify(t)});return await this.updateSettingsVersion(i.settingsVersion),i}async submitHeartbeat(e,t){let r=`${this.config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${e}&close=${t+""}`;return await this.apiFetch(r,{method:"GET"})}async updateSettingsVersion(e){isNaN(e)?this.config.services.log.error("No config version header was returned."):e>this.config.settingsVersion&&await F.updateSettings(this.config)}async apiFetch(e,t){let r={method:t.method,headers:{Accept:"application/json",Authorization:`Bearer ${this.config.apiKey}`,"User-Agent":this.config.userAgent},body:t.body??null};t.method==="POST"&&this.isHeaders(r.headers)&&(r.headers["Content-Type"]="application/json");let i=await this.fetch(e,r),s=parseInt(i.headers.get(this.RateLimitRemainingHeader)||"",10),o=parseInt(i.headers.get(this.ConfigurationVersionHeader)||"",10),u=await i.text(),c=u&&u.length>0?JSON.parse(u):null;return new ne(i.status,i.statusText,s,o,c)}isHeaders(e){return e!==void 0}};var se=class{items=new Map;length(){return Promise.resolve(this.items.size)}cl