@sailfish-ai/sf-veritas 0.1.23 → 0.1.25
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.
- package/README.md +25 -12
- package/dist/sf-veritas.cjs +20 -16
- package/dist/sf-veritas.mjs +638 -598
- package/dist/types/constants.d.ts +25 -1
- package/dist/types/contextManager.d.ts +7 -0
- package/dist/types/networkHopTransmitter.d.ts +10 -6
- package/dist/types/setupConfig.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ yarn add @sailfish/sf-veritas
|
|
|
45
45
|
|
|
46
46
|
- Prevents adding tracing headers (X-Sf3-Rid) to certain domains.
|
|
47
47
|
|
|
48
|
-
- `
|
|
48
|
+
- `nodeModulesToCollectLocalVariablesOn`: string[]
|
|
49
49
|
|
|
50
50
|
- Specify packages or modules for capturing local variable values during errors or exceptions. Use ['__all__'] to capture local variables globally.`
|
|
51
51
|
|
|
@@ -78,19 +78,19 @@ export async function register() {
|
|
|
78
78
|
|
|
79
79
|
try {
|
|
80
80
|
// Dynamically import to ensure it's only loaded in a Node.js environment
|
|
81
|
-
const { setupInterceptors } = await import("@sailfish/sf-veritas");
|
|
81
|
+
const { setupInterceptors } = await import("@sailfish-ai/sf-veritas");
|
|
82
82
|
|
|
83
83
|
setupInterceptors({
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
84
|
+
apiKey: "test-api-key",
|
|
85
|
+
serviceIdentifier: "your-service-name",
|
|
86
|
+
serviceVersion: "1.0.0",
|
|
87
|
+
serviceAdditionalMetadata: {
|
|
88
|
+
environment: "production",
|
|
89
|
+
cluster: "east-coast",
|
|
90
|
+
},
|
|
91
|
+
domainsToNotPropagateHeadersTo: ["example.com"],
|
|
92
|
+
nodeModulesToCollectLocalVariablesOn: ["@your-org/your-package"],
|
|
93
|
+
});
|
|
94
94
|
|
|
95
95
|
console.log(
|
|
96
96
|
"[Instrumentation] Server-side interceptors initialized successfully.",
|
|
@@ -104,3 +104,16 @@ export async function register() {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
```
|
|
107
|
+
|
|
108
|
+
## Network Hop Summary Statistics
|
|
109
|
+
|
|
110
|
+
### 📊 Response Time Analysis
|
|
111
|
+
|
|
112
|
+
To evaluate the performance impact of this package, we benchmarked over 1000 HTTP requests with and without the package enabled.
|
|
113
|
+
|
|
114
|
+
| Configuration | Mean (ms) | Median (ms) | Std Dev (ms) | Requests |
|
|
115
|
+
| ------------------ | --------- | ----------- | ------------ | -------- |
|
|
116
|
+
| ✅ With Package | 714.17 | 575.00 | 595.92 | 1000 |
|
|
117
|
+
| ❌ Without Package | 715.59 | 541.00 | 643.22 | 1000 |
|
|
118
|
+
|
|
119
|
+
> **Note:** Test results show that the package does not introduce a significant performance slowdown.
|
package/dist/sf-veritas.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Ye=Object.defineProperty;var Le=(s,r,l)=>r in s?Ye(s,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[r]=l;var b=(s,r,l)=>Le(s,typeof r!="symbol"?r+"":r,l);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("async_hooks"),we=require("fs"),Xe=require("worker_threads"),Z=[];for(let s=0;s<256;++s)Z.push((s+256).toString(16).slice(1));let j;const Je=new Uint8Array(16),ce={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function L(s,r,l){if(ce.randomUUID&&!s)return ce.randomUUID();const u=(s=s||{}).random??s.rng?.()??function(){if(!j){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");j=crypto.getRandomValues.bind(crypto)}return j(Je)}();if(u.length<16)throw new Error("Random bytes length must be >= 16");return u[6]=15&u[6]|64,u[8]=63&u[8]|128,function(o,n=0){return(Z[o[n+0]]+Z[o[n+1]]+Z[o[n+2]]+Z[o[n+3]]+"-"+Z[o[n+4]]+Z[o[n+5]]+"-"+Z[o[n+6]]+Z[o[n+7]]+"-"+Z[o[n+8]]+Z[o[n+9]]+"-"+Z[o[n+10]]+Z[o[n+11]]+Z[o[n+12]]+Z[o[n+13]]+Z[o[n+14]]+Z[o[n+15]]).toLowerCase()}(u)}class Ke{constructor(r){b(this,"apiKey");b(this,"apiGraphqlEndpoint");b(this,"sfDebug");b(this,"serviceIdentifier");b(this,"serviceVersion");b(this,"serviceUUID");b(this,"serviceAdditionalMetadata");b(this,"profilingModeEnabled");b(this,"profilingMaxDepth");b(this,"profilingMaxVariableSizeKb");b(this,"domainsToNotPropagateHeadersTo");b(this,"nodeModulesToCollectLocalVariablesOn");b(this,"printConfigurationStatuses");b(this,"logLevel");b(this,"stackDepthLocals");b(this,"stackDepthCodeTraceDepth");b(this,"packageLibraryType");b(this,"version");b(this,"_serviceIdentificationReceived",!1);this.apiKey=r.apiKey,this.apiGraphqlEndpoint=r?.apiGraphqlEndpoint||process.env.SAILFISH_GRAPHQL_ENDPOINT||"https://api-service.sailfishqa.com/graphql/",this.sfDebug=r?.debug===!0||process.env.SF_DEBUG==="true",this.serviceIdentifier=r?.serviceIdentifier||process.env.SERVICE_IDENTIFIER,this.serviceUUID=L(),this.serviceVersion=r?.serviceVersion||process.env.SERVICE_VERSION,this.serviceAdditionalMetadata=r?.serviceAdditionalMetadata||{},this.profilingModeEnabled=r?.profilingModeEnabled??!1,this.profilingMaxDepth=r?.profilingMaxDepth??5,this.profilingMaxVariableSizeKb=r?.profilingMaxVariableSizeKb??25,this.domainsToNotPropagateHeadersTo=r?.domainsToNotPropagateHeadersTo||[],this.nodeModulesToCollectLocalVariablesOn=r?.nodeModulesToCollectLocalVariablesOn||["_all_"],this.printConfigurationStatuses=process.env.PRINT_CONFIGURATION_STATUSES||"true",this.logLevel=process.env.LOG_LEVEL||"INFO",this.stackDepthLocals=process.env.SAILFISH_EXCEPTION_STACK_DEPTH_LOCALS!==void 0?parseInt(process.env.SAILFISH_EXCEPTION_STACK_DEPTH_LOCALS,10):5,isNaN(this.stackDepthLocals)&&(this.stackDepthLocals=-1),this.stackDepthCodeTraceDepth=process.env.SAILFISH_EXCEPTION_STACK_DEPTH_CODE_TRACE_DEPTH!==void 0?parseInt(process.env.SAILFISH_EXCEPTION_STACK_DEPTH_CODE_TRACE_DEPTH,10):-1,isNaN(this.stackDepthCodeTraceDepth)&&(this.stackDepthCodeTraceDepth=-1),this.packageLibraryType="JS/TS BACKEND",this.version=this.getPackageVersion()}getPackageVersion(){return"0.1.15"}get serviceIdentificationReceived(){return this._serviceIdentificationReceived}setServiceIdentificationReceived(r){this._serviceIdentificationReceived=r}}let x;function A(){if(!x)throw new Error("Configuration has not been initialized.");return x}new We.AsyncLocalStorage;const Ne=["identitytoolkit.googleapis.com","t.co","*.twitter.com","*.gravatar.com","*.googleapis.com","*.amazonaws.com","*.smooch.io","*.zendesk.com"],Q=new We.AsyncLocalStorage,ge={handledExceptions:new Set,reentrancyGuardLoggingActive:!1,reentrancyGuardLoggingPreActive:!1,reentrancyGuardPrintActive:!1,reentrancyGuardPrintPreActive:!1,reentrancyGuardExceptionActive:!1,reentrancyGuardExceptionPreActive:!1,excludedDomains:new Set(Ne),supportedDomains:new Set},V=class V{constructor(){}static getInstance(){return V.instance||(V.instance=new V),V.instance}getCurrentContext(){return Q.getStore()||ge}setCurrentContext(r){const l=Q.getStore()||ge;Q.enterWith({...l,...r})}getTraceId(){return this.getCurrentContext().traceId}getPageVisitUUID(){return this.getCurrentContext().pageVisitUUID}setTraceId(r){this.setCurrentContext({traceId:r})}setPageVisitUUID(r){this.setCurrentContext({pageVisitUUID:r})}getOrSetSfTraceId(r,l=!1){let u=this.getTraceId();return u||(u=r||(l?L():`nonsession-applogs-v3/${A().apiKey}/${L()}`),this.setTraceId(u),A().sfDebug&&console.log(" Created new trace ID:",u),u)}getOrSetPageVisitUUID(){let r=this.getPageVisitUUID();return r||(r=L(),this.setPageVisitUUID(r),A().sfDebug&&console.log(" Created new page visit UUID:",r),r)}getHandledExceptions(){return this.getCurrentContext().handledExceptions}markExceptionHandled(r){const l=this.getHandledExceptions();l.add(r),this.setCurrentContext({handledExceptions:l})}hasHandledException(r){return this.getHandledExceptions().has(r)}resetHandledExceptions(){this.setCurrentContext({handledExceptions:new Set})}getExcludedDomains(){return this.getCurrentContext().excludedDomains}addDynamicExcludedDomains(r){this.getCurrentContext().excludedDomains.add(r.toLowerCase().trim())}getSupportedDomains(){return this.getCurrentContext().supportedDomains}addSupportedDomains(r){this.getCurrentContext().supportedDomains.add(r.toLowerCase().trim())}};b(V,"instance");let z=V;class K{constructor(){b(this,"apiKey");b(this,"endpoint");b(this,"queryType","mutation");b(this,"operationName","");b(this,"serviceUUID",A().serviceUUID);b(this,"contextManager");this.apiKey=A().apiKey,this.endpoint=A().apiGraphqlEndpoint,this.contextManager=z.getInstance()}get queryName(){return this.operationName?this.operationName.charAt(0).toLowerCase()+this.operationName.slice(1):""}getDefaultVariables(){const r=Date.now().toString(),l=this.contextManager.getOrSetSfTraceId();return{apiKey:this.apiKey,serviceUuid:this.serviceUUID,sessionId:l,timestampMs:r}}getVariables(r={}){return{...this.getDefaultVariables(),...r}}setOperationName(r){this.operationName=r}setEndpoint(r){this.endpoint=r}setServiceUUID(r){this.serviceUUID=r}}const Ue=fetch;async function R(s,r,l,u){try{const o=A();let n;try{n=JSON.stringify({query:l,variables:u,operationName:r})}catch{n=JSON.stringify({query:l,operationName:r})}Ue(s,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).then(async t=>{if(!t.ok)return void(o.sfDebug&&console.error(`GraphQL request failed with status ${t.status} for ${r}`));const a=await t.json();a.errors?.length?function(I,C,h){const c=I&&typeof I=="object"&&!Array.isArray(I)?Object.keys(I)[0]:void 0;console.error(c==="identifyServiceDetails"?`IdentifyServiceDetails NOT sent successfully for service: UUID=${h.serviceUUID}`:`GraphQL request failed with errors: ${JSON.stringify(C)} for operation key ${c}`)}(a.data,a.errors,o):o.sfDebug&&function(I,C,h){const c=I&&typeof I=="object"&&!Array.isArray(I)?Object.keys(I)[0]:void 0,d=I[c]||!1;c==="identifyServiceDetails"&&(h.setServiceIdentificationReceived(d),A().sfDebug&&console.log(`IdentifyServiceDetails sent successfully for service: UUID=${h.serviceUUID}; serviceIdentificationReceived=${c==="identifyServiceDetails"?d:"N/A"}`))}(a.data,0,o)}).catch(t=>{o.sfDebug&&console.error("Fetch error:",t)})}catch(o){A().sfDebug&&console.error("Error sending data to GraphQL server:",o)}}class k extends K{constructor(){super(),this.setOperationName("IdentifyServiceDetails")}async doSend(r){if(!A().serviceIdentificationReceived)try{this.send()}catch(l){A().sfDebug&&console.error(" Error during service identification:",l)}}async send(){const r=`
|
|
2
2
|
${this.queryType} ${this.operationName}(
|
|
3
3
|
$apiKey: String!,
|
|
4
4
|
$timestampMs: String!,
|
|
@@ -20,23 +20,23 @@
|
|
|
20
20
|
version: $version,
|
|
21
21
|
)
|
|
22
22
|
}
|
|
23
|
-
`,l=this.getVariables({serviceIdentifier:A().serviceIdentifier,serviceVersion:A().serviceVersion,library:A().packageLibraryType,version:A().version,serviceAdditionalMetadata:A().serviceAdditionalMetadata});R(this.endpoint,this.operationName,r,l)}}function
|
|
23
|
+
`,l=this.getVariables({serviceIdentifier:A().serviceIdentifier,serviceVersion:A().serviceVersion,library:A().packageLibraryType,version:A().version,serviceAdditionalMetadata:A().serviceAdditionalMetadata});R(this.endpoint,this.operationName,r,l)}}function Ee(s){try{return JSON.stringify(s),!0}catch{return!1}}class Fe extends K{constructor(){super();b(this,"serviceIdentifier",new k);this.setOperationName("CollectMetadata")}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(l,u,o,n){this.sendAppIdentifier(),this.send(l,u,o,n)}async send(l,u,o,n){if(!u&&!n)throw new Error('Must pass in either traits or traits_json to "add_or_update_traits"');let t=[];if(!n){const I=function(C){const h={},c=[];if(C)for(const[d,e]of Object.entries(C))Ee(e)?h[d]=e:c.push(d);return{traitsJson:JSON.stringify(h),excludedFields:c}}(u);n=I.traitsJson,t=I.excludedFields}const a=this.getVariables({userId:l,traitsJson:n,excludedFields:t,override:o,library:A().packageLibraryType,version:A().version});R(this.endpoint,this.operationName,this.getQuery(),a)}getQuery(){return`
|
|
24
24
|
mutation ${this.operationName}($apiKey: String!, $serviceUuid: String!, $sessionId: String!, $userId: String!, $traitsJson: String!, $excludedFields: [String!]!, $library: String!, $timestampMs: String!, $version: String!, $override: Boolean!) {
|
|
25
25
|
${this.queryName}(apiKey: $apiKey, serviceUuid: $serviceUuid, sessionId: $sessionId, userId: $userId, traitsJson: $traitsJson, excludedFields: $excludedFields, library: $library, timestampMs: $timestampMs, version: $version, override: $override)
|
|
26
26
|
}
|
|
27
|
-
`}}class
|
|
27
|
+
`}}class le{constructor(r){b(this,"metadataTransmitter");this.apiKey=r,this.metadataTransmitter=new Fe}identify(r,l,u,o=!1){l||u?this.addOrUpdateMetadata(r,l,u,o):this.addOrUpdateMetadata(r,{},void 0,o)}addOrUpdateMetadata(r,l={},u,o=!1){if(!l&&!u)throw new Error('Must pass in either traits or traitsJson to "addOrUpdateMetadata"');A().sfDebug&&console.log(" [[DEBUG - addOrUpdateMetadata]] Starting operation"),A().sfDebug&&console.log(" addOrUpdateMetadata...SENDING DATA...",r,l,u),this.metadataTransmitter.doSend(r,l,o,u)}}class ae extends K{constructor(){super();b(this,"serviceIdentifier",new k)}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(l){this.sendAppIdentifier(),this.send(l)}async send(l){try{const u=Array.isArray(l)?l:[l,"default"],o=this.getVariables({contents:u[0],level:u[1]});R(this.endpoint,this.operationName,this.getQuery(),o)}catch(u){A().sfDebug&&console.error("🚨 Error in send():",u)}}getQuery(){return`
|
|
28
28
|
${this.queryType} ${this.operationName}($apiKey: String!, $serviceUuid: String!, $sessionId: String!, $timestampMs: String!, $level: String!, $contents: String!) {
|
|
29
29
|
${this.queryName}(apiKey: $apiKey, serviceUuid: $serviceUuid, sessionId: $sessionId, timestampMs: $timestampMs, level: $level, contents: $contents)
|
|
30
30
|
}
|
|
31
|
-
`}}var le,ue,E={},q={},M={},D={};function Fe(){if(le)return D;le=1;var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return D.encode=function(r){if(0<=r&&r<s.length)return s[r];throw new TypeError("Must be between 0 and 63: "+r)},D.decode=function(r){return 65<=r&&r<=90?r-65:97<=r&&r<=122?r-97+26:48<=r&&r<=57?r-48+52:r==43?62:r==47?63:-1},D}function we(){if(ue)return M;ue=1;var s=Fe();return M.encode=function(r){var l,u="",o=function(n){return n<0?1+(-n<<1):0+(n<<1)}(r);do l=31&o,(o>>>=5)>0&&(l|=32),u+=s.encode(l);while(o>0);return u},M.decode=function(r,l,u){var o,n,i,g,p=r.length,C=0,h=0;do{if(l>=p)throw new Error("Expected more digits in base 64 VLQ value.");if((n=s.decode(r.charCodeAt(l++)))===-1)throw new Error("Invalid base64 digit: "+r.charAt(l-1));o=!!(32&n),C+=(n&=31)<<h,h+=5}while(o);u.value=(g=(i=C)>>1,1&~i?g:-g),u.rest=l},M}var de,Ie={};function K(){return de||(de=1,function(s){s.getArg=function(e,t,I){if(t in e)return e[t];if(arguments.length===3)return I;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,l=/^data:.+\,.+$/;function u(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function o(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}s.urlParse=u,s.urlGenerate=o;var n,i,g=(n=function(e){var t=e,I=u(e);if(I){if(!I.path)return e;t=I.path}for(var c=s.isAbsolute(t),m=[],f=0,y=0;;){if(f=y,(y=t.indexOf("/",f))===-1){m.push(t.slice(f));break}for(m.push(t.slice(f,y));y<t.length&&t[y]==="/";)y++}var Z,v=0;for(y=m.length-1;y>=0;y--)(Z=m[y])==="."?m.splice(y,1):Z===".."?v++:v>0&&(Z===""?(m.splice(y+1,v),v=0):(m.splice(y,2),v--));return(t=m.join("/"))===""&&(t=c?"/":"."),I?(I.path=t,o(I)):t},i=[],function(e){for(var t=0;t<i.length;t++)if(i[t].input===e){var I=i[0];return i[0]=i[t],i[t]=I,i[0].result}var c=n(e);return i.unshift({input:e,result:c}),i.length>32&&i.pop(),c});function p(e,t){e===""&&(e="."),t===""&&(t=".");var I=u(t),c=u(e);if(c&&(e=c.path||"/"),I&&!I.scheme)return c&&(I.scheme=c.scheme),o(I);if(I||t.match(l))return t;if(c&&!c.host&&!c.path)return c.host=t,o(c);var m=t.charAt(0)==="/"?t:g(e.replace(/\/+$/,"")+"/"+t);return c?(c.path=m,o(c)):m}s.normalize=g,s.join=p,s.isAbsolute=function(e){return e.charAt(0)==="/"||r.test(e)},s.relative=function(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var I=0;t.indexOf(e+"/")!==0;){var c=e.lastIndexOf("/");if(c<0||(e=e.slice(0,c)).match(/^([^\/]+:\/)?\/*$/))return t;++I}return Array(I+1).join("../")+t.substr(e.length+1)};var C=!("__proto__"in Object.create(null));function h(e){return e}function a(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var I=t-10;I>=0;I--)if(e.charCodeAt(I)!==36)return!1;return!0}function d(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}s.toSetString=C?h:function(e){return a(e)?"$"+e:e},s.fromSetString=C?h:function(e){return a(e)?e.slice(1):e},s.compareByOriginalPositions=function(e,t,I){var c=d(e.source,t.source);return c!==0||(c=e.originalLine-t.originalLine)!==0||(c=e.originalColumn-t.originalColumn)!==0||I||(c=e.generatedColumn-t.generatedColumn)!==0||(c=e.generatedLine-t.generatedLine)!==0?c:d(e.name,t.name)},s.compareByOriginalPositionsNoSource=function(e,t,I){var c;return(c=e.originalLine-t.originalLine)!==0||(c=e.originalColumn-t.originalColumn)!==0||I||(c=e.generatedColumn-t.generatedColumn)!==0||(c=e.generatedLine-t.generatedLine)!==0?c:d(e.name,t.name)},s.compareByGeneratedPositionsDeflated=function(e,t,I){var c=e.generatedLine-t.generatedLine;return c!==0||(c=e.generatedColumn-t.generatedColumn)!==0||I||(c=d(e.source,t.source))!==0||(c=e.originalLine-t.originalLine)!==0||(c=e.originalColumn-t.originalColumn)!==0?c:d(e.name,t.name)},s.compareByGeneratedPositionsDeflatedNoLine=function(e,t,I){var c=e.generatedColumn-t.generatedColumn;return c!==0||I||(c=d(e.source,t.source))!==0||(c=e.originalLine-t.originalLine)!==0||(c=e.originalColumn-t.originalColumn)!==0?c:d(e.name,t.name)},s.compareByGeneratedPositionsInflated=function(e,t){var I=e.generatedLine-t.generatedLine;return I!==0||(I=e.generatedColumn-t.generatedColumn)!==0||(I=d(e.source,t.source))!==0||(I=e.originalLine-t.originalLine)!==0||(I=e.originalColumn-t.originalColumn)!==0?I:d(e.name,t.name)},s.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},s.computeSourceURL=function(e,t,I){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),I){var c=u(I);if(!c)throw new Error("sourceMapURL could not be parsed");if(c.path){var m=c.path.lastIndexOf("/");m>=0&&(c.path=c.path.substring(0,m+1))}t=p(o(c),t)}return g(t)}}(Ie)),Ie}var pe,ee={};function Ne(){if(pe)return ee;pe=1;var s=K(),r=Object.prototype.hasOwnProperty,l=typeof Map<"u";function u(){this._array=[],this._set=l?new Map:Object.create(null)}return u.fromArray=function(o,n){for(var i=new u,g=0,p=o.length;g<p;g++)i.add(o[g],n);return i},u.prototype.size=function(){return l?this._set.size:Object.getOwnPropertyNames(this._set).length},u.prototype.add=function(o,n){var i=l?o:s.toSetString(o),g=l?this.has(o):r.call(this._set,i),p=this._array.length;g&&!n||this._array.push(o),g||(l?this._set.set(o,p):this._set[i]=p)},u.prototype.has=function(o){if(l)return this._set.has(o);var n=s.toSetString(o);return r.call(this._set,n)},u.prototype.indexOf=function(o){if(l){var n=this._set.get(o);if(n>=0)return n}else{var i=s.toSetString(o);if(r.call(this._set,i))return this._set[i]}throw new Error('"'+o+'" is not in the set.')},u.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)},u.prototype.toArray=function(){return this._array.slice()},ee.ArraySet=u,ee}var Ce,he,ne={};function Ee(){if(Ce)return ne;Ce=1;var s=K();function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return r.prototype.unsortedForEach=function(l,u){this._array.forEach(l,u)},r.prototype.add=function(l){var u,o,n,i,g,p;u=this._last,o=l,n=u.generatedLine,i=o.generatedLine,g=u.generatedColumn,p=o.generatedColumn,i>n||i==n&&p>=g||s.compareByGeneratedPositionsInflated(u,o)<=0?(this._last=l,this._array.push(l)):(this._sorted=!1,this._array.push(l))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(s.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},ne.MappingList=r,ne}function me(){if(he)return q;he=1;var s=we(),r=K(),l=Ne().ArraySet,u=Ee().MappingList;function o(n){n||(n={}),this._file=r.getArg(n,"file",null),this._sourceRoot=r.getArg(n,"sourceRoot",null),this._skipValidation=r.getArg(n,"skipValidation",!1),this._ignoreInvalidMapping=r.getArg(n,"ignoreInvalidMapping",!1),this._sources=new l,this._names=new l,this._mappings=new u,this._sourcesContents=null}return o.prototype._version=3,o.fromSourceMap=function(n,i){var g=n.sourceRoot,p=new o(Object.assign(i||{},{file:n.file,sourceRoot:g}));return n.eachMapping(function(C){var h={generated:{line:C.generatedLine,column:C.generatedColumn}};C.source!=null&&(h.source=C.source,g!=null&&(h.source=r.relative(g,h.source)),h.original={line:C.originalLine,column:C.originalColumn},C.name!=null&&(h.name=C.name)),p.addMapping(h)}),n.sources.forEach(function(C){var h=C;g!==null&&(h=r.relative(g,C)),p._sources.has(h)||p._sources.add(h);var a=n.sourceContentFor(C);a!=null&&p.setSourceContent(C,a)}),p},o.prototype.addMapping=function(n){var i=r.getArg(n,"generated"),g=r.getArg(n,"original",null),p=r.getArg(n,"source",null),C=r.getArg(n,"name",null);(this._skipValidation||this._validateMapping(i,g,p,C)!==!1)&&(p!=null&&(p=String(p),this._sources.has(p)||this._sources.add(p)),C!=null&&(C=String(C),this._names.has(C)||this._names.add(C)),this._mappings.add({generatedLine:i.line,generatedColumn:i.column,originalLine:g!=null&&g.line,originalColumn:g!=null&&g.column,source:p,name:C}))},o.prototype.setSourceContent=function(n,i){var g=n;this._sourceRoot!=null&&(g=r.relative(this._sourceRoot,g)),i!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[r.toSetString(g)]=i):this._sourcesContents&&(delete this._sourcesContents[r.toSetString(g)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},o.prototype.applySourceMap=function(n,i,g){var p=i;if(i==null){if(n.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);p=n.file}var C=this._sourceRoot;C!=null&&(p=r.relative(C,p));var h=new l,a=new l;this._mappings.unsortedForEach(function(d){if(d.source===p&&d.originalLine!=null){var e=n.originalPositionFor({line:d.originalLine,column:d.originalColumn});e.source!=null&&(d.source=e.source,g!=null&&(d.source=r.join(g,d.source)),C!=null&&(d.source=r.relative(C,d.source)),d.originalLine=e.line,d.originalColumn=e.column,e.name!=null&&(d.name=e.name))}var t=d.source;t==null||h.has(t)||h.add(t);var I=d.name;I==null||a.has(I)||a.add(I)},this),this._sources=h,this._names=a,n.sources.forEach(function(d){var e=n.sourceContentFor(d);e!=null&&(g!=null&&(d=r.join(g,d)),C!=null&&(d=r.relative(C,d)),this.setSourceContent(d,e))},this)},o.prototype._validateMapping=function(n,i,g,p){if(i&&typeof i.line!="number"&&typeof i.column!="number"){var C="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(C),!1;throw new Error(C)}if((!(n&&"line"in n&&"column"in n&&n.line>0&&n.column>=0)||i||g||p)&&!(n&&"line"in n&&"column"in n&&i&&"line"in i&&"column"in i&&n.line>0&&n.column>=0&&i.line>0&&i.column>=0&&g)){if(C="Invalid mapping: "+JSON.stringify({generated:n,source:g,original:i,name:p}),this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(C),!1;throw new Error(C)}},o.prototype._serializeMappings=function(){for(var n,i,g,p,C=0,h=1,a=0,d=0,e=0,t=0,I="",c=this._mappings.toArray(),m=0,f=c.length;m<f;m++){if(n="",(i=c[m]).generatedLine!==h)for(C=0;i.generatedLine!==h;)n+=";",h++;else if(m>0){if(!r.compareByGeneratedPositionsInflated(i,c[m-1]))continue;n+=","}n+=s.encode(i.generatedColumn-C),C=i.generatedColumn,i.source!=null&&(p=this._sources.indexOf(i.source),n+=s.encode(p-t),t=p,n+=s.encode(i.originalLine-1-d),d=i.originalLine-1,n+=s.encode(i.originalColumn-a),a=i.originalColumn,i.name!=null&&(g=this._names.indexOf(i.name),n+=s.encode(g-e),e=g)),I+=n}return I},o.prototype._generateSourcesContent=function(n,i){return n.map(function(g){if(!this._sourcesContents)return null;i!=null&&(g=r.relative(i,g));var p=r.toSetString(g);return Object.prototype.hasOwnProperty.call(this._sourcesContents,p)?this._sourcesContents[p]:null},this)},o.prototype.toJSON=function(){var n={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(n.file=this._file),this._sourceRoot!=null&&(n.sourceRoot=this._sourceRoot),this._sourcesContents&&(n.sourcesContent=this._generateSourcesContent(n.sources,n.sourceRoot)),n},o.prototype.toString=function(){return JSON.stringify(this.toJSON())},q.SourceMapGenerator=o,q}var Ae,Y={},fe={};function Me(){return Ae||(Ae=1,function(s){function r(l,u,o,n,i,g){var p=Math.floor((u-l)/2)+l,C=i(o,n[p],!0);return C===0?p:C>0?u-p>1?r(p,u,o,n,i,g):g==s.LEAST_UPPER_BOUND?u<n.length?u:-1:p:p-l>1?r(l,p,o,n,i,g):g==s.LEAST_UPPER_BOUND?p:l<0?-1:l}s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.search=function(l,u,o,n){if(u.length===0)return-1;var i=r(-1,u.length,l,u,o,n||s.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&o(u[i],u[i-1],!0)===0;)--i;return i}}(fe)),fe}var be,ye,te={};function De(){if(be)return te;function s(l){function u(o,n,i){var g=o[n];o[n]=o[i],o[i]=g}return function o(n,i,g,p){if(g<p){var C=g-1;u(n,(e=g,t=p,Math.round(e+Math.random()*(t-e))),p);for(var h=n[p],a=g;a<p;a++)i(n[a],h,!1)<=0&&u(n,C+=1,a);u(n,C+1,a);var d=C+1;o(n,i,g,d-1),o(n,i,d+1,p)}var e,t}}be=1;let r=new WeakMap;return te.quickSort=function(l,u,o=0){let n=r.get(u);n===void 0&&(n=function(i){let g=s.toString();return new Function(`return ${g}`)()(i)}(u),r.set(u,n)),n(l,u,o,l.length-1)},te}var ve,Ze,ie={},Ve=(Ze||(Ze=1,E.SourceMapGenerator=me().SourceMapGenerator,E.SourceMapConsumer=function(){if(ye)return Y;ye=1;var s=K(),r=Me(),l=Ne().ArraySet,u=we(),o=De().quickSort;function n(a,d){var e=a;return typeof a=="string"&&(e=s.parseSourceMapInput(a)),e.sections!=null?new h(e,d):new i(e,d)}function i(a,d){var e=a;typeof a=="string"&&(e=s.parseSourceMapInput(a));var t=s.getArg(e,"version"),I=s.getArg(e,"sources"),c=s.getArg(e,"names",[]),m=s.getArg(e,"sourceRoot",null),f=s.getArg(e,"sourcesContent",null),y=s.getArg(e,"mappings"),Z=s.getArg(e,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);m&&(m=s.normalize(m)),I=I.map(String).map(s.normalize).map(function(v){return m&&s.isAbsolute(m)&&s.isAbsolute(v)?s.relative(m,v):v}),this._names=l.fromArray(c.map(String),!0),this._sources=l.fromArray(I,!0),this._absoluteSources=this._sources.toArray().map(function(v){return s.computeSourceURL(m,v,d)}),this.sourceRoot=m,this.sourcesContent=f,this._mappings=y,this._sourceMapURL=d,this.file=Z}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}n.fromSourceMap=function(a,d){return i.fromSourceMap(a,d)},n.prototype._version=3,n.prototype.__generatedMappings=null,Object.defineProperty(n.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),n.prototype.__originalMappings=null,Object.defineProperty(n.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),n.prototype._charIsMappingSeparator=function(a,d){var e=a.charAt(d);return e===";"||e===","},n.prototype._parseMappings=function(a,d){throw new Error("Subclasses must implement _parseMappings")},n.GENERATED_ORDER=1,n.ORIGINAL_ORDER=2,n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.prototype.eachMapping=function(a,d,e){var t,I=d||null;switch(e||n.GENERATED_ORDER){case n.GENERATED_ORDER:t=this._generatedMappings;break;case n.ORIGINAL_ORDER:t=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var c=this.sourceRoot,m=a.bind(I),f=this._names,y=this._sources,Z=this._sourceMapURL,v=0,B=t.length;v<B;v++){var W=t[v],S=W.source===null?null:y.at(W.source);S!==null&&(S=s.computeSourceURL(c,S,Z)),m({source:S,generatedLine:W.generatedLine,generatedColumn:W.generatedColumn,originalLine:W.originalLine,originalColumn:W.originalColumn,name:W.name===null?null:f.at(W.name)})}},n.prototype.allGeneratedPositionsFor=function(a){var d=s.getArg(a,"line"),e={source:s.getArg(a,"source"),originalLine:d,originalColumn:s.getArg(a,"column",0)};if(e.source=this._findSourceIndex(e.source),e.source<0)return[];var t=[],I=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,r.LEAST_UPPER_BOUND);if(I>=0){var c=this._originalMappings[I];if(a.column===void 0)for(var m=c.originalLine;c&&c.originalLine===m;)t.push({line:s.getArg(c,"generatedLine",null),column:s.getArg(c,"generatedColumn",null),lastColumn:s.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++I];else for(var f=c.originalColumn;c&&c.originalLine===d&&c.originalColumn==f;)t.push({line:s.getArg(c,"generatedLine",null),column:s.getArg(c,"generatedColumn",null),lastColumn:s.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++I]}return t},Y.SourceMapConsumer=n,i.prototype=Object.create(n.prototype),i.prototype.consumer=n,i.prototype._findSourceIndex=function(a){var d,e=a;if(this.sourceRoot!=null&&(e=s.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);for(d=0;d<this._absoluteSources.length;++d)if(this._absoluteSources[d]==a)return d;return-1},i.fromSourceMap=function(a,d){var e=Object.create(i.prototype),t=e._names=l.fromArray(a._names.toArray(),!0),I=e._sources=l.fromArray(a._sources.toArray(),!0);e.sourceRoot=a._sourceRoot,e.sourcesContent=a._generateSourcesContent(e._sources.toArray(),e.sourceRoot),e.file=a._file,e._sourceMapURL=d,e._absoluteSources=e._sources.toArray().map(function(W){return s.computeSourceURL(e.sourceRoot,W,d)});for(var c=a._mappings.toArray().slice(),m=e.__generatedMappings=[],f=e.__originalMappings=[],y=0,Z=c.length;y<Z;y++){var v=c[y],B=new g;B.generatedLine=v.generatedLine,B.generatedColumn=v.generatedColumn,v.source&&(B.source=I.indexOf(v.source),B.originalLine=v.originalLine,B.originalColumn=v.originalColumn,v.name&&(B.name=t.indexOf(v.name)),f.push(B)),m.push(B)}return o(e.__originalMappings,s.compareByOriginalPositions),e},i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});const p=s.compareByGeneratedPositionsDeflatedNoLine;function C(a,d){let e=a.length,t=a.length-d;if(!(t<=1))if(t==2){let I=a[d],c=a[d+1];p(I,c)>0&&(a[d]=c,a[d+1]=I)}else if(t<20)for(let I=d;I<e;I++)for(let c=I;c>d;c--){let m=a[c-1],f=a[c];if(p(m,f)<=0)break;a[c-1]=f,a[c]=m}else o(a,p,d)}function h(a,d){var e=a;typeof a=="string"&&(e=s.parseSourceMapInput(a));var t=s.getArg(e,"version"),I=s.getArg(e,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new l,this._names=new l;var c={line:-1,column:0};this._sections=I.map(function(m){if(m.url)throw new Error("Support for url field in sections not implemented.");var f=s.getArg(m,"offset"),y=s.getArg(f,"line"),Z=s.getArg(f,"column");if(y<c.line||y===c.line&&Z<c.column)throw new Error("Section offsets must be ordered and non-overlapping.");return c=f,{generatedOffset:{generatedLine:y+1,generatedColumn:Z+1},consumer:new n(s.getArg(m,"map"),d)}})}return i.prototype._parseMappings=function(a,d){var e,t,I,c,m=1,f=0,y=0,Z=0,v=0,B=0,W=a.length,S=0,P={},w=[],H=[];let $=0;for(;S<W;)if(a.charAt(S)===";")m++,S++,f=0,C(H,$),$=H.length;else if(a.charAt(S)===",")S++;else{for((e=new g).generatedLine=m,I=S;I<W&&!this._charIsMappingSeparator(a,I);I++);for(a.slice(S,I),t=[];S<I;)u.decode(a,S,P),c=P.value,S=P.rest,t.push(c);if(t.length===2)throw new Error("Found a source, but no line and column");if(t.length===3)throw new Error("Found a source and line, but no column");if(e.generatedColumn=f+t[0],f=e.generatedColumn,t.length>1&&(e.source=v+t[1],v+=t[1],e.originalLine=y+t[2],y=e.originalLine,e.originalLine+=1,e.originalColumn=Z+t[3],Z=e.originalColumn,t.length>4&&(e.name=B+t[4],B+=t[4])),H.push(e),typeof e.originalLine=="number"){let F=e.source;for(;w.length<=F;)w.push(null);w[F]===null&&(w[F]=[]),w[F].push(e)}}C(H,$),this.__generatedMappings=H;for(var U=0;U<w.length;U++)w[U]!=null&&o(w[U],s.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...w)},i.prototype._findMapping=function(a,d,e,t,I,c){if(a[e]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+a[e]);if(a[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+a[t]);return r.search(a,d,I,c)},i.prototype.computeColumnSpans=function(){for(var a=0;a<this._generatedMappings.length;++a){var d=this._generatedMappings[a];if(a+1<this._generatedMappings.length){var e=this._generatedMappings[a+1];if(d.generatedLine===e.generatedLine){d.lastGeneratedColumn=e.generatedColumn-1;continue}}d.lastGeneratedColumn=1/0}},i.prototype.originalPositionFor=function(a){var d={generatedLine:s.getArg(a,"line"),generatedColumn:s.getArg(a,"column")},e=this._findMapping(d,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(a,"bias",n.GREATEST_LOWER_BOUND));if(e>=0){var t=this._generatedMappings[e];if(t.generatedLine===d.generatedLine){var I=s.getArg(t,"source",null);I!==null&&(I=this._sources.at(I),I=s.computeSourceURL(this.sourceRoot,I,this._sourceMapURL));var c=s.getArg(t,"name",null);return c!==null&&(c=this._names.at(c)),{source:I,line:s.getArg(t,"originalLine",null),column:s.getArg(t,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null})},i.prototype.sourceContentFor=function(a,d){if(!this.sourcesContent)return null;var e=this._findSourceIndex(a);if(e>=0)return this.sourcesContent[e];var t,I=a;if(this.sourceRoot!=null&&(I=s.relative(this.sourceRoot,I)),this.sourceRoot!=null&&(t=s.urlParse(this.sourceRoot))){var c=I.replace(/^file:\/\//,"");if(t.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!t.path||t.path=="/")&&this._sources.has("/"+I))return this.sourcesContent[this._sources.indexOf("/"+I)]}if(d)return null;throw new Error('"'+I+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(a){var d=s.getArg(a,"source");if((d=this._findSourceIndex(d))<0)return{line:null,column:null,lastColumn:null};var e={source:d,originalLine:s.getArg(a,"line"),originalColumn:s.getArg(a,"column")},t=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(a,"bias",n.GREATEST_LOWER_BOUND));if(t>=0){var I=this._originalMappings[t];if(I.source===e.source)return{line:s.getArg(I,"generatedLine",null),column:s.getArg(I,"generatedColumn",null),lastColumn:s.getArg(I,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},Y.BasicSourceMapConsumer=i,h.prototype=Object.create(n.prototype),h.prototype.constructor=n,h.prototype._version=3,Object.defineProperty(h.prototype,"sources",{get:function(){for(var a=[],d=0;d<this._sections.length;d++)for(var e=0;e<this._sections[d].consumer.sources.length;e++)a.push(this._sections[d].consumer.sources[e]);return a}}),h.prototype.originalPositionFor=function(a){var d={generatedLine:s.getArg(a,"line"),generatedColumn:s.getArg(a,"column")},e=r.search(d,this._sections,function(I,c){return I.generatedLine-c.generatedOffset.generatedLine||I.generatedColumn-c.generatedOffset.generatedColumn}),t=this._sections[e];return t?t.consumer.originalPositionFor({line:d.generatedLine-(t.generatedOffset.generatedLine-1),column:d.generatedColumn-(t.generatedOffset.generatedLine===d.generatedLine?t.generatedOffset.generatedColumn-1:0),bias:a.bias}):{source:null,line:null,column:null,name:null}},h.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(a){return a.consumer.hasContentsOfAllSources()})},h.prototype.sourceContentFor=function(a,d){for(var e=0;e<this._sections.length;e++){var t=this._sections[e].consumer.sourceContentFor(a,!0);if(t||t==="")return t}if(d)return null;throw new Error('"'+a+'" is not in the SourceMap.')},h.prototype.generatedPositionFor=function(a){for(var d=0;d<this._sections.length;d++){var e=this._sections[d];if(e.consumer._findSourceIndex(s.getArg(a,"source"))!==-1){var t=e.consumer.generatedPositionFor(a);if(t)return{line:t.line+(e.generatedOffset.generatedLine-1),column:t.column+(e.generatedOffset.generatedLine===t.line?e.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},h.prototype._parseMappings=function(a,d){this.__generatedMappings=[],this.__originalMappings=[];for(var e=0;e<this._sections.length;e++)for(var t=this._sections[e],I=t.consumer._generatedMappings,c=0;c<I.length;c++){var m=I[c],f=t.consumer._sources.at(m.source);f!==null&&(f=s.computeSourceURL(t.consumer.sourceRoot,f,this._sourceMapURL)),this._sources.add(f),f=this._sources.indexOf(f);var y=null;m.name&&(y=t.consumer._names.at(m.name),this._names.add(y),y=this._names.indexOf(y));var Z={source:f,generatedLine:m.generatedLine+(t.generatedOffset.generatedLine-1),generatedColumn:m.generatedColumn+(t.generatedOffset.generatedLine===m.generatedLine?t.generatedOffset.generatedColumn-1:0),originalLine:m.originalLine,originalColumn:m.originalColumn,name:y};this.__generatedMappings.push(Z),typeof Z.originalLine=="number"&&this.__originalMappings.push(Z)}o(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),o(this.__originalMappings,s.compareByOriginalPositions)},Y.IndexedSourceMapConsumer=h,Y}().SourceMapConsumer,E.SourceNode=function(){if(ve)return ie;ve=1;var s=me().SourceMapGenerator,r=K(),l=/(\r?\n)/,u="$$$isSourceNode$$$";function o(n,i,g,p,C){this.children=[],this.sourceContents={},this.line=n??null,this.column=i??null,this.source=g??null,this.name=C??null,this[u]=!0,p!=null&&this.add(p)}return o.fromStringWithSourceMap=function(n,i,g){var p=new o,C=n.split(l),h=0,a=function(){return c()+(c()||"");function c(){return h<C.length?C[h++]:void 0}},d=1,e=0,t=null;return i.eachMapping(function(c){if(t!==null){if(!(d<c.generatedLine)){var m=(f=C[h]||"").substr(0,c.generatedColumn-e);return C[h]=f.substr(c.generatedColumn-e),e=c.generatedColumn,I(t,m),void(t=c)}I(t,a()),d++,e=0}for(;d<c.generatedLine;)p.add(a()),d++;if(e<c.generatedColumn){var f=C[h]||"";p.add(f.substr(0,c.generatedColumn)),C[h]=f.substr(c.generatedColumn),e=c.generatedColumn}t=c},this),h<C.length&&(t&&I(t,a()),p.add(C.splice(h).join(""))),i.sources.forEach(function(c){var m=i.sourceContentFor(c);m!=null&&(g!=null&&(c=r.join(g,c)),p.setSourceContent(c,m))}),p;function I(c,m){if(c===null||c.source===void 0)p.add(m);else{var f=g?r.join(g,c.source):c.source;p.add(new o(c.originalLine,c.originalColumn,f,m,c.name))}}},o.prototype.add=function(n){if(Array.isArray(n))n.forEach(function(i){this.add(i)},this);else{if(!n[u]&&typeof n!="string")throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);n&&this.children.push(n)}return this},o.prototype.prepend=function(n){if(Array.isArray(n))for(var i=n.length-1;i>=0;i--)this.prepend(n[i]);else{if(!n[u]&&typeof n!="string")throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);this.children.unshift(n)}return this},o.prototype.walk=function(n){for(var i,g=0,p=this.children.length;g<p;g++)(i=this.children[g])[u]?i.walk(n):i!==""&&n(i,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(n){var i,g,p=this.children.length;if(p>0){for(i=[],g=0;g<p-1;g++)i.push(this.children[g]),i.push(n);i.push(this.children[g]),this.children=i}return this},o.prototype.replaceRight=function(n,i){var g=this.children[this.children.length-1];return g[u]?g.replaceRight(n,i):typeof g=="string"?this.children[this.children.length-1]=g.replace(n,i):this.children.push("".replace(n,i)),this},o.prototype.setSourceContent=function(n,i){this.sourceContents[r.toSetString(n)]=i},o.prototype.walkSourceContents=function(n){for(var i=0,g=this.children.length;i<g;i++)this.children[i][u]&&this.children[i].walkSourceContents(n);var p=Object.keys(this.sourceContents);for(i=0,g=p.length;i<g;i++)n(r.fromSetString(p[i]),this.sourceContents[p[i]])},o.prototype.toString=function(){var n="";return this.walk(function(i){n+=i}),n},o.prototype.toStringWithSourceMap=function(n){var i={code:"",line:1,column:0},g=new s(n),p=!1,C=null,h=null,a=null,d=null;return this.walk(function(e,t){i.code+=e,t.source!==null&&t.line!==null&&t.column!==null?(C===t.source&&h===t.line&&a===t.column&&d===t.name||g.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:i.line,column:i.column},name:t.name}),C=t.source,h=t.line,a=t.column,d=t.name,p=!0):p&&(g.addMapping({generated:{line:i.line,column:i.column}}),C=null,p=!1);for(var I=0,c=e.length;I<c;I++)e.charCodeAt(I)===10?(i.line++,i.column=0,I+1===c?(C=null,p=!1):p&&g.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:i.line,column:i.column},name:t.name})):i.column++}),this.walkSourceContents(function(e,t){g.setSourceContent(e,t)}),{code:i.code,map:g}},ie.SourceNode=o,ie}().SourceNode),E);class J{constructor({file:r,line:l,function:u,code:o,locals:n={},offender:i=!1,column:g}){b(this,"file");b(this,"line");b(this,"function");b(this,"code");b(this,"locals");b(this,"offender");b(this,"column");this.file=r,this.line=l,this.function=u,this.code=o,this.locals=n,this.offender=i,this.column=g}toDict(){const r={file:this.file,line:this.line,function:this.function,code:this.code,locals:Object.fromEntries(Object.entries(this.locals).map(([l,u])=>[l,String(u)]))};return this.offender&&(r.offender=this.offender),this.column!==void 0&&(r.column=this.column),r}toJson(){return JSON.stringify(this.toDict())}}class k{static encode(r){return r instanceof J?r.toDict():Array.isArray(r)?r.map(l=>k.encode(l)):typeof r=="object"&&r!==null?JSON.stringify(r):r}static stringify(r){return JSON.stringify(k.encode(r),(l,u)=>u instanceof J?u.toDict():u)}}let _=0;function Te(s){A().sfDebug&&console.log("Initializing Exception Interceptor...");const r=new _e.Worker(new URL("data:application/javascript;base64,aW1wb3J0IHsgU2Vzc2lvbiB9IGZyb20gImluc3BlY3Rvci9wcm9taXNlcyI7CmltcG9ydCB7IHBhcmVudFBvcnQsIHdvcmtlckRhdGEgfSBmcm9tICJ3b3JrZXJfdGhyZWFkcyI7CgpnbG9iYWwuc2ZEZWJ1ZyA9IHVuZGVmaW5lZDsKZ2xvYmFsLnN0YWNrRGVwdGhMb2NhbHMgPSB1bmRlZmluZWQ7Cmdsb2JhbC5ub2RlTW9kdWxlc1RvQ29sbGVjdExvY2FsVmFyaWFibGVzT24gPSB1bmRlZmluZWQ7CgovKioKICogUHJvY2Vzc2VzIGNhbGwgZnJhbWVzIGZyb20gYW4gZXhjZXB0aW9uIGFuZCBwb3N0cyB0aGVtIHZpYSB0aGUgV29ya2Vy4oCZcyBwYXJlbnRQb3J0LgogKgogKiBAcGFyYW0gc2Vzc2lvbiAtIFRoZSBEZXZUb29scyBzZXNzaW9uIG9yIHNpbWlsYXIgb2JqZWN0IHlvdSB1c2UgdG8gcXVlcnkgZm9yIHNjcmlwdCBzb3VyY2VzLgogKiBAcGFyYW0gY2FsbEZyYW1lcyAtIEFuIGFycmF5IG9mIGNhbGwgZnJhbWUgb2JqZWN0cy4KICogQHBhcmFtIGRlc2NyaXB0aW9uTGluZXMgLSBBbiBhcnJheSBvZiBsaW5lcyBmcm9tIHRoZSBlcnJvcuKAmXMgZGVzY3JpcHRpb24sIGVhY2ggdHlwaWNhbGx5IGJlZ2lubmluZyB3aXRoICJhdCAiLgogKiBAcmV0dXJucyB7UHJvbWlzZTx2b2lkPn0KICovCmV4cG9ydCBhc3luYyBmdW5jdGlvbiBwcm9jZXNzQ2FsbEZyYW1lcyhzZXNzaW9uLCBjYWxsRnJhbWVzLCBkZXNjcmlwdGlvbkxpbmVzKSB7CiAgLyoqCiAgICogTGltaXQgdGhl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IGxvY2FsU2NvcGUub2JqZWN0Lm9iamVjdElkKQogICAgICAgICAgOiB7fTsKCiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgIGZ1bmN0aW9uOiBmdW5jdGlvbk5hbWUgfHwgIjxhbm9ueW1vdXM+IiwKICAgICAgICAgIGxvY2FscywKICAgICAgICAgIGZpbGUsCiAgICAgICAgICBsaW5lOiBsb2NhdGlvbj8ubGluZU51bWJlciB8fCAwLAogICAgICAgICAgY29kZSwKICAgICAgICB9OwogICAgICB9IGNhdGNoIChlcnJvcikgewogICAgICAgIGlmIChnbG9iYWwuc2ZEZWJ1ZykgewogICAgICAgICAgY29uc29sZS5lcnJvcigiW1dvcmtlcl0gRXJyb3IgcHJvY2Vzc2luZyBjYWxsIGZyYW1lOiIsIGVycm9yKTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgIGZ1bmN0aW9uOiAiPGVycm9yPiIsCiAgICAgICAgICBsb2NhbHM6IHt9LAogICAgICAgICAgZmlsZTogIjx1bmtub3duPiIsCiAgICAgICAgICBsaW5lOiAwLAogICAgICAgICAgY29kZTogIjxub3QgY2FwdHVyZWQ+IiwKICAgICAgICB9OwogICAgICB9CiAgICB9KSwKICApOwogIC8vIFBvc3QgZXhjZXB0aW9uIGRhdGEKICBwYXJlbnRQb3J0Py5wb3N0TWVzc2FnZSh7IHR5cGU6ICJleGNlcHRpb24iLCBmcmFtZXMgfSk7Cn0KCi8qKgogKiBIYW5kbGVzIHRoZSAicGF1c2VkIiBzdGF0ZSBvZiB0aGUgZGVidWdnZXIgYW5kIHByb2Nlc3NlcyBleGNlcHRpb25zIG9yIHByb21pc2UgcmVqZWN0aW9ucy4KICogQHBhcmFtIHtTZXNzaW9ufSBzZXNzaW9uIC0gVGhlIGRlYnVnZ2luZyBzZXNzaW9uIGluc3RhbmNlLgogKiBAcGFyYW0ge29iamVjdH0gcGFyYW1zIC0gUGFyYW1ldGVycyBmcm9tIHRoZSAicGF1c2VkIiBldmV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mFyaWFibGVzKTsKICAgICAgICB9IGVsc2UgaWYgKHByb3A/LnZhbHVlKSB7CiAgICAgICAgICB1bnJvbGxPdGhlcihwcm9wLCB2YXJpYWJsZXMpOwogICAgICAgIH0KICAgICAgfQogICAgICByZXR1cm4gdmFyaWFibGVzOwogICAgfQogIH0gY2F0Y2ggKGVycikgewogICAgaWYgKGdsb2JhbC5zZkRlYnVnKSB7CiAgICAgIGNvbnNvbGUuZXJyb3IoIltXb3JrZXJdIEZhaWxlZCB0byBmZXRjaCBsb2NhbCB2YXJpYWJsZXM6IiwgZXJyKTsKICAgIH0KICAgIHJldHVybiB7fTsKICB9Cn0KCnN0YXJ0RGVidWdnZXIoKS5jYXRjaCgoZXJyb3IpID0+IHsKICBpZiAoZ2xvYmFsLnNmRGVidWcpIHsKICAgIGNvbnNvbGUuZXJyb3IoIltXb3JrZXJdIEZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlcjoiLCBlcnJvcik7CiAgfQp9KTsKCi8vIEtlZXAgdGhlIHdvcmtlciBhbGl2ZQpzZXRJbnRlcnZhbCgoKSA9PiB7fSwgMTAwMDApOwo="),{workerData:{captureAllExceptions:!0}});let l=null;r.on("message",i=>{if(typeof i=="string"&&A().sfDebug&&console.log(`[Worker] ${i}`),i.readyToGetParameters&&r.postMessage({sfDebug:A().sfDebug,stackDepthLocals:A().stackDepthLocals,nodeModulesToCollectLocalVariablesOn:A().nodeModulesToCollectLocalVariablesOn}),i.type==="exception"){const{frames:g}=i,p=l;if(!p)return;const C=function(a){return a?a.split(`
|
|
32
|
-
`).slice(1).map(d=>{const e=/at (.+?) \((.+):(\d+):(\d+)\)/.exec(d)||/at (.+):(\d+):(\d+)/.exec(d);if(e){const[,
|
|
33
|
-
`)[1]?.trim()}`;return o.has(
|
|
34
|
-
`).slice(
|
|
35
|
-
`),name:
|
|
31
|
+
`}}var ue,de,F={},q={},D={},M={};function De(){if(ue)return M;ue=1;var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return M.encode=function(r){if(0<=r&&r<s.length)return s[r];throw new TypeError("Must be between 0 and 63: "+r)},M.decode=function(r){return 65<=r&&r<=90?r-65:97<=r&&r<=122?r-97+26:48<=r&&r<=57?r-48+52:r==43?62:r==47?63:-1},M}function Ve(){if(de)return D;de=1;var s=De();return D.encode=function(r){var l,u="",o=function(n){return n<0?1+(-n<<1):0+(n<<1)}(r);do l=31&o,(o>>>=5)>0&&(l|=32),u+=s.encode(l);while(o>0);return u},D.decode=function(r,l,u){var o,n,t,a,I=r.length,C=0,h=0;do{if(l>=I)throw new Error("Expected more digits in base 64 VLQ value.");if((n=s.decode(r.charCodeAt(l++)))===-1)throw new Error("Invalid base64 digit: "+r.charAt(l-1));o=!!(32&n),C+=(n&=31)<<h,h+=5}while(o);u.value=(a=(t=C)>>1,1&~t?a:-a),u.rest=l},D}var Ie,pe={};function J(){return Ie||(Ie=1,function(s){s.getArg=function(e,i,p){if(i in e)return e[i];if(arguments.length===3)return p;throw new Error('"'+i+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,l=/^data:.+\,.+$/;function u(e){var i=e.match(r);return i?{scheme:i[1],auth:i[2],host:i[3],port:i[4],path:i[5]}:null}function o(e){var i="";return e.scheme&&(i+=e.scheme+":"),i+="//",e.auth&&(i+=e.auth+"@"),e.host&&(i+=e.host),e.port&&(i+=":"+e.port),e.path&&(i+=e.path),i}s.urlParse=u,s.urlGenerate=o;var n,t,a=(n=function(e){var i=e,p=u(e);if(p){if(!p.path)return e;i=p.path}for(var g=s.isAbsolute(i),m=[],f=0,y=0;;){if(f=y,(y=i.indexOf("/",f))===-1){m.push(i.slice(f));break}for(m.push(i.slice(f,y));y<i.length&&i[y]==="/";)y++}var G,v=0;for(y=m.length-1;y>=0;y--)(G=m[y])==="."?m.splice(y,1):G===".."?v++:v>0&&(G===""?(m.splice(y+1,v),v=0):(m.splice(y,2),v--));return(i=m.join("/"))===""&&(i=g?"/":"."),p?(p.path=i,o(p)):i},t=[],function(e){for(var i=0;i<t.length;i++)if(t[i].input===e){var p=t[0];return t[0]=t[i],t[i]=p,t[0].result}var g=n(e);return t.unshift({input:e,result:g}),t.length>32&&t.pop(),g});function I(e,i){e===""&&(e="."),i===""&&(i=".");var p=u(i),g=u(e);if(g&&(e=g.path||"/"),p&&!p.scheme)return g&&(p.scheme=g.scheme),o(p);if(p||i.match(l))return i;if(g&&!g.host&&!g.path)return g.host=i,o(g);var m=i.charAt(0)==="/"?i:a(e.replace(/\/+$/,"")+"/"+i);return g?(g.path=m,o(g)):m}s.normalize=a,s.join=I,s.isAbsolute=function(e){return e.charAt(0)==="/"||r.test(e)},s.relative=function(e,i){e===""&&(e="."),e=e.replace(/\/$/,"");for(var p=0;i.indexOf(e+"/")!==0;){var g=e.lastIndexOf("/");if(g<0||(e=e.slice(0,g)).match(/^([^\/]+:\/)?\/*$/))return i;++p}return Array(p+1).join("../")+i.substr(e.length+1)};var C=!("__proto__"in Object.create(null));function h(e){return e}function c(e){if(!e)return!1;var i=e.length;if(i<9||e.charCodeAt(i-1)!==95||e.charCodeAt(i-2)!==95||e.charCodeAt(i-3)!==111||e.charCodeAt(i-4)!==116||e.charCodeAt(i-5)!==111||e.charCodeAt(i-6)!==114||e.charCodeAt(i-7)!==112||e.charCodeAt(i-8)!==95||e.charCodeAt(i-9)!==95)return!1;for(var p=i-10;p>=0;p--)if(e.charCodeAt(p)!==36)return!1;return!0}function d(e,i){return e===i?0:e===null?1:i===null?-1:e>i?1:-1}s.toSetString=C?h:function(e){return c(e)?"$"+e:e},s.fromSetString=C?h:function(e){return c(e)?e.slice(1):e},s.compareByOriginalPositions=function(e,i,p){var g=d(e.source,i.source);return g!==0||(g=e.originalLine-i.originalLine)!==0||(g=e.originalColumn-i.originalColumn)!==0||p||(g=e.generatedColumn-i.generatedColumn)!==0||(g=e.generatedLine-i.generatedLine)!==0?g:d(e.name,i.name)},s.compareByOriginalPositionsNoSource=function(e,i,p){var g;return(g=e.originalLine-i.originalLine)!==0||(g=e.originalColumn-i.originalColumn)!==0||p||(g=e.generatedColumn-i.generatedColumn)!==0||(g=e.generatedLine-i.generatedLine)!==0?g:d(e.name,i.name)},s.compareByGeneratedPositionsDeflated=function(e,i,p){var g=e.generatedLine-i.generatedLine;return g!==0||(g=e.generatedColumn-i.generatedColumn)!==0||p||(g=d(e.source,i.source))!==0||(g=e.originalLine-i.originalLine)!==0||(g=e.originalColumn-i.originalColumn)!==0?g:d(e.name,i.name)},s.compareByGeneratedPositionsDeflatedNoLine=function(e,i,p){var g=e.generatedColumn-i.generatedColumn;return g!==0||p||(g=d(e.source,i.source))!==0||(g=e.originalLine-i.originalLine)!==0||(g=e.originalColumn-i.originalColumn)!==0?g:d(e.name,i.name)},s.compareByGeneratedPositionsInflated=function(e,i){var p=e.generatedLine-i.generatedLine;return p!==0||(p=e.generatedColumn-i.generatedColumn)!==0||(p=d(e.source,i.source))!==0||(p=e.originalLine-i.originalLine)!==0||(p=e.originalColumn-i.originalColumn)!==0?p:d(e.name,i.name)},s.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},s.computeSourceURL=function(e,i,p){if(i=i||"",e&&(e[e.length-1]!=="/"&&i[0]!=="/"&&(e+="/"),i=e+i),p){var g=u(p);if(!g)throw new Error("sourceMapURL could not be parsed");if(g.path){var m=g.path.lastIndexOf("/");m>=0&&(g.path=g.path.substring(0,m+1))}i=I(o(g),i)}return a(i)}}(pe)),pe}var Ce,ee={};function Re(){if(Ce)return ee;Ce=1;var s=J(),r=Object.prototype.hasOwnProperty,l=typeof Map<"u";function u(){this._array=[],this._set=l?new Map:Object.create(null)}return u.fromArray=function(o,n){for(var t=new u,a=0,I=o.length;a<I;a++)t.add(o[a],n);return t},u.prototype.size=function(){return l?this._set.size:Object.getOwnPropertyNames(this._set).length},u.prototype.add=function(o,n){var t=l?o:s.toSetString(o),a=l?this.has(o):r.call(this._set,t),I=this._array.length;a&&!n||this._array.push(o),a||(l?this._set.set(o,I):this._set[t]=I)},u.prototype.has=function(o){if(l)return this._set.has(o);var n=s.toSetString(o);return r.call(this._set,n)},u.prototype.indexOf=function(o){if(l){var n=this._set.get(o);if(n>=0)return n}else{var t=s.toSetString(o);if(r.call(this._set,t))return this._set[t]}throw new Error('"'+o+'" is not in the set.')},u.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)},u.prototype.toArray=function(){return this._array.slice()},ee.ArraySet=u,ee}var he,me,ne={};function Me(){if(he)return ne;he=1;var s=J();function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return r.prototype.unsortedForEach=function(l,u){this._array.forEach(l,u)},r.prototype.add=function(l){var u,o,n,t,a,I;u=this._last,o=l,n=u.generatedLine,t=o.generatedLine,a=u.generatedColumn,I=o.generatedColumn,t>n||t==n&&I>=a||s.compareByGeneratedPositionsInflated(u,o)<=0?(this._last=l,this._array.push(l)):(this._sorted=!1,this._array.push(l))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(s.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},ne.MappingList=r,ne}function Ae(){if(me)return q;me=1;var s=Ve(),r=J(),l=Re().ArraySet,u=Me().MappingList;function o(n){n||(n={}),this._file=r.getArg(n,"file",null),this._sourceRoot=r.getArg(n,"sourceRoot",null),this._skipValidation=r.getArg(n,"skipValidation",!1),this._ignoreInvalidMapping=r.getArg(n,"ignoreInvalidMapping",!1),this._sources=new l,this._names=new l,this._mappings=new u,this._sourcesContents=null}return o.prototype._version=3,o.fromSourceMap=function(n,t){var a=n.sourceRoot,I=new o(Object.assign(t||{},{file:n.file,sourceRoot:a}));return n.eachMapping(function(C){var h={generated:{line:C.generatedLine,column:C.generatedColumn}};C.source!=null&&(h.source=C.source,a!=null&&(h.source=r.relative(a,h.source)),h.original={line:C.originalLine,column:C.originalColumn},C.name!=null&&(h.name=C.name)),I.addMapping(h)}),n.sources.forEach(function(C){var h=C;a!==null&&(h=r.relative(a,C)),I._sources.has(h)||I._sources.add(h);var c=n.sourceContentFor(C);c!=null&&I.setSourceContent(C,c)}),I},o.prototype.addMapping=function(n){var t=r.getArg(n,"generated"),a=r.getArg(n,"original",null),I=r.getArg(n,"source",null),C=r.getArg(n,"name",null);(this._skipValidation||this._validateMapping(t,a,I,C)!==!1)&&(I!=null&&(I=String(I),this._sources.has(I)||this._sources.add(I)),C!=null&&(C=String(C),this._names.has(C)||this._names.add(C)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:a!=null&&a.line,originalColumn:a!=null&&a.column,source:I,name:C}))},o.prototype.setSourceContent=function(n,t){var a=n;this._sourceRoot!=null&&(a=r.relative(this._sourceRoot,a)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[r.toSetString(a)]=t):this._sourcesContents&&(delete this._sourcesContents[r.toSetString(a)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},o.prototype.applySourceMap=function(n,t,a){var I=t;if(t==null){if(n.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);I=n.file}var C=this._sourceRoot;C!=null&&(I=r.relative(C,I));var h=new l,c=new l;this._mappings.unsortedForEach(function(d){if(d.source===I&&d.originalLine!=null){var e=n.originalPositionFor({line:d.originalLine,column:d.originalColumn});e.source!=null&&(d.source=e.source,a!=null&&(d.source=r.join(a,d.source)),C!=null&&(d.source=r.relative(C,d.source)),d.originalLine=e.line,d.originalColumn=e.column,e.name!=null&&(d.name=e.name))}var i=d.source;i==null||h.has(i)||h.add(i);var p=d.name;p==null||c.has(p)||c.add(p)},this),this._sources=h,this._names=c,n.sources.forEach(function(d){var e=n.sourceContentFor(d);e!=null&&(a!=null&&(d=r.join(a,d)),C!=null&&(d=r.relative(C,d)),this.setSourceContent(d,e))},this)},o.prototype._validateMapping=function(n,t,a,I){if(t&&typeof t.line!="number"&&typeof t.column!="number"){var C="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(C),!1;throw new Error(C)}if((!(n&&"line"in n&&"column"in n&&n.line>0&&n.column>=0)||t||a||I)&&!(n&&"line"in n&&"column"in n&&t&&"line"in t&&"column"in t&&n.line>0&&n.column>=0&&t.line>0&&t.column>=0&&a)){if(C="Invalid mapping: "+JSON.stringify({generated:n,source:a,original:t,name:I}),this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(C),!1;throw new Error(C)}},o.prototype._serializeMappings=function(){for(var n,t,a,I,C=0,h=1,c=0,d=0,e=0,i=0,p="",g=this._mappings.toArray(),m=0,f=g.length;m<f;m++){if(n="",(t=g[m]).generatedLine!==h)for(C=0;t.generatedLine!==h;)n+=";",h++;else if(m>0){if(!r.compareByGeneratedPositionsInflated(t,g[m-1]))continue;n+=","}n+=s.encode(t.generatedColumn-C),C=t.generatedColumn,t.source!=null&&(I=this._sources.indexOf(t.source),n+=s.encode(I-i),i=I,n+=s.encode(t.originalLine-1-d),d=t.originalLine-1,n+=s.encode(t.originalColumn-c),c=t.originalColumn,t.name!=null&&(a=this._names.indexOf(t.name),n+=s.encode(a-e),e=a)),p+=n}return p},o.prototype._generateSourcesContent=function(n,t){return n.map(function(a){if(!this._sourcesContents)return null;t!=null&&(a=r.relative(t,a));var I=r.toSetString(a);return Object.prototype.hasOwnProperty.call(this._sourcesContents,I)?this._sourcesContents[I]:null},this)},o.prototype.toJSON=function(){var n={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(n.file=this._file),this._sourceRoot!=null&&(n.sourceRoot=this._sourceRoot),this._sourcesContents&&(n.sourcesContent=this._generateSourcesContent(n.sources,n.sourceRoot)),n},o.prototype.toString=function(){return JSON.stringify(this.toJSON())},q.SourceMapGenerator=o,q}var fe,_={},be={};function Te(){return fe||(fe=1,function(s){function r(l,u,o,n,t,a){var I=Math.floor((u-l)/2)+l,C=t(o,n[I],!0);return C===0?I:C>0?u-I>1?r(I,u,o,n,t,a):a==s.LEAST_UPPER_BOUND?u<n.length?u:-1:I:I-l>1?r(l,I,o,n,t,a):a==s.LEAST_UPPER_BOUND?I:l<0?-1:l}s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.search=function(l,u,o,n){if(u.length===0)return-1;var t=r(-1,u.length,l,u,o,n||s.GREATEST_LOWER_BOUND);if(t<0)return-1;for(;t-1>=0&&o(u[t],u[t-1],!0)===0;)--t;return t}}(be)),be}var ye,ve,te={};function xe(){if(ye)return te;function s(l){function u(o,n,t){var a=o[n];o[n]=o[t],o[t]=a}return function o(n,t,a,I){if(a<I){var C=a-1;u(n,(e=a,i=I,Math.round(e+Math.random()*(i-e))),I);for(var h=n[I],c=a;c<I;c++)t(n[c],h,!1)<=0&&u(n,C+=1,c);u(n,C+1,c);var d=C+1;o(n,t,a,d-1),o(n,t,d+1,I)}var e,i}}ye=1;let r=new WeakMap;return te.quickSort=function(l,u,o=0){let n=r.get(u);n===void 0&&(n=function(t){let a=s.toString();return new Function(`return ${a}`)()(t)}(u),r.set(u,n)),n(l,u,o,l.length-1)},te}var Ge,Ze,ie={},He=(Ze||(Ze=1,F.SourceMapGenerator=Ae().SourceMapGenerator,F.SourceMapConsumer=function(){if(ve)return _;ve=1;var s=J(),r=Te(),l=Re().ArraySet,u=Ve(),o=xe().quickSort;function n(c,d){var e=c;return typeof c=="string"&&(e=s.parseSourceMapInput(c)),e.sections!=null?new h(e,d):new t(e,d)}function t(c,d){var e=c;typeof c=="string"&&(e=s.parseSourceMapInput(c));var i=s.getArg(e,"version"),p=s.getArg(e,"sources"),g=s.getArg(e,"names",[]),m=s.getArg(e,"sourceRoot",null),f=s.getArg(e,"sourcesContent",null),y=s.getArg(e,"mappings"),G=s.getArg(e,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);m&&(m=s.normalize(m)),p=p.map(String).map(s.normalize).map(function(v){return m&&s.isAbsolute(m)&&s.isAbsolute(v)?s.relative(m,v):v}),this._names=l.fromArray(g.map(String),!0),this._sources=l.fromArray(p,!0),this._absoluteSources=this._sources.toArray().map(function(v){return s.computeSourceURL(m,v,d)}),this.sourceRoot=m,this.sourcesContent=f,this._mappings=y,this._sourceMapURL=d,this.file=G}function a(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}n.fromSourceMap=function(c,d){return t.fromSourceMap(c,d)},n.prototype._version=3,n.prototype.__generatedMappings=null,Object.defineProperty(n.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),n.prototype.__originalMappings=null,Object.defineProperty(n.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),n.prototype._charIsMappingSeparator=function(c,d){var e=c.charAt(d);return e===";"||e===","},n.prototype._parseMappings=function(c,d){throw new Error("Subclasses must implement _parseMappings")},n.GENERATED_ORDER=1,n.ORIGINAL_ORDER=2,n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.prototype.eachMapping=function(c,d,e){var i,p=d||null;switch(e||n.GENERATED_ORDER){case n.GENERATED_ORDER:i=this._generatedMappings;break;case n.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var g=this.sourceRoot,m=c.bind(p),f=this._names,y=this._sources,G=this._sourceMapURL,v=0,B=i.length;v<B;v++){var W=i[v],S=W.source===null?null:y.at(W.source);S!==null&&(S=s.computeSourceURL(g,S,G)),m({source:S,generatedLine:W.generatedLine,generatedColumn:W.generatedColumn,originalLine:W.originalLine,originalColumn:W.originalColumn,name:W.name===null?null:f.at(W.name)})}},n.prototype.allGeneratedPositionsFor=function(c){var d=s.getArg(c,"line"),e={source:s.getArg(c,"source"),originalLine:d,originalColumn:s.getArg(c,"column",0)};if(e.source=this._findSourceIndex(e.source),e.source<0)return[];var i=[],p=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,r.LEAST_UPPER_BOUND);if(p>=0){var g=this._originalMappings[p];if(c.column===void 0)for(var m=g.originalLine;g&&g.originalLine===m;)i.push({line:s.getArg(g,"generatedLine",null),column:s.getArg(g,"generatedColumn",null),lastColumn:s.getArg(g,"lastGeneratedColumn",null)}),g=this._originalMappings[++p];else for(var f=g.originalColumn;g&&g.originalLine===d&&g.originalColumn==f;)i.push({line:s.getArg(g,"generatedLine",null),column:s.getArg(g,"generatedColumn",null),lastColumn:s.getArg(g,"lastGeneratedColumn",null)}),g=this._originalMappings[++p]}return i},_.SourceMapConsumer=n,t.prototype=Object.create(n.prototype),t.prototype.consumer=n,t.prototype._findSourceIndex=function(c){var d,e=c;if(this.sourceRoot!=null&&(e=s.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);for(d=0;d<this._absoluteSources.length;++d)if(this._absoluteSources[d]==c)return d;return-1},t.fromSourceMap=function(c,d){var e=Object.create(t.prototype),i=e._names=l.fromArray(c._names.toArray(),!0),p=e._sources=l.fromArray(c._sources.toArray(),!0);e.sourceRoot=c._sourceRoot,e.sourcesContent=c._generateSourcesContent(e._sources.toArray(),e.sourceRoot),e.file=c._file,e._sourceMapURL=d,e._absoluteSources=e._sources.toArray().map(function(W){return s.computeSourceURL(e.sourceRoot,W,d)});for(var g=c._mappings.toArray().slice(),m=e.__generatedMappings=[],f=e.__originalMappings=[],y=0,G=g.length;y<G;y++){var v=g[y],B=new a;B.generatedLine=v.generatedLine,B.generatedColumn=v.generatedColumn,v.source&&(B.source=p.indexOf(v.source),B.originalLine=v.originalLine,B.originalColumn=v.originalColumn,v.name&&(B.name=i.indexOf(v.name)),f.push(B)),m.push(B)}return o(e.__originalMappings,s.compareByOriginalPositions),e},t.prototype._version=3,Object.defineProperty(t.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});const I=s.compareByGeneratedPositionsDeflatedNoLine;function C(c,d){let e=c.length,i=c.length-d;if(!(i<=1))if(i==2){let p=c[d],g=c[d+1];I(p,g)>0&&(c[d]=g,c[d+1]=p)}else if(i<20)for(let p=d;p<e;p++)for(let g=p;g>d;g--){let m=c[g-1],f=c[g];if(I(m,f)<=0)break;c[g-1]=f,c[g]=m}else o(c,I,d)}function h(c,d){var e=c;typeof c=="string"&&(e=s.parseSourceMapInput(c));var i=s.getArg(e,"version"),p=s.getArg(e,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new l,this._names=new l;var g={line:-1,column:0};this._sections=p.map(function(m){if(m.url)throw new Error("Support for url field in sections not implemented.");var f=s.getArg(m,"offset"),y=s.getArg(f,"line"),G=s.getArg(f,"column");if(y<g.line||y===g.line&&G<g.column)throw new Error("Section offsets must be ordered and non-overlapping.");return g=f,{generatedOffset:{generatedLine:y+1,generatedColumn:G+1},consumer:new n(s.getArg(m,"map"),d)}})}return t.prototype._parseMappings=function(c,d){var e,i,p,g,m=1,f=0,y=0,G=0,v=0,B=0,W=c.length,S=0,$={},w=[],H=[];let P=0;for(;S<W;)if(c.charAt(S)===";")m++,S++,f=0,C(H,P),P=H.length;else if(c.charAt(S)===",")S++;else{for((e=new a).generatedLine=m,p=S;p<W&&!this._charIsMappingSeparator(c,p);p++);for(c.slice(S,p),i=[];S<p;)u.decode(c,S,$),g=$.value,S=$.rest,i.push(g);if(i.length===2)throw new Error("Found a source, but no line and column");if(i.length===3)throw new Error("Found a source and line, but no column");if(e.generatedColumn=f+i[0],f=e.generatedColumn,i.length>1&&(e.source=v+i[1],v+=i[1],e.originalLine=y+i[2],y=e.originalLine,e.originalLine+=1,e.originalColumn=G+i[3],G=e.originalColumn,i.length>4&&(e.name=B+i[4],B+=i[4])),H.push(e),typeof e.originalLine=="number"){let E=e.source;for(;w.length<=E;)w.push(null);w[E]===null&&(w[E]=[]),w[E].push(e)}}C(H,P),this.__generatedMappings=H;for(var U=0;U<w.length;U++)w[U]!=null&&o(w[U],s.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...w)},t.prototype._findMapping=function(c,d,e,i,p,g){if(c[e]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+c[e]);if(c[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+c[i]);return r.search(c,d,p,g)},t.prototype.computeColumnSpans=function(){for(var c=0;c<this._generatedMappings.length;++c){var d=this._generatedMappings[c];if(c+1<this._generatedMappings.length){var e=this._generatedMappings[c+1];if(d.generatedLine===e.generatedLine){d.lastGeneratedColumn=e.generatedColumn-1;continue}}d.lastGeneratedColumn=1/0}},t.prototype.originalPositionFor=function(c){var d={generatedLine:s.getArg(c,"line"),generatedColumn:s.getArg(c,"column")},e=this._findMapping(d,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(c,"bias",n.GREATEST_LOWER_BOUND));if(e>=0){var i=this._generatedMappings[e];if(i.generatedLine===d.generatedLine){var p=s.getArg(i,"source",null);p!==null&&(p=this._sources.at(p),p=s.computeSourceURL(this.sourceRoot,p,this._sourceMapURL));var g=s.getArg(i,"name",null);return g!==null&&(g=this._names.at(g)),{source:p,line:s.getArg(i,"originalLine",null),column:s.getArg(i,"originalColumn",null),name:g}}}return{source:null,line:null,column:null,name:null}},t.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(c){return c==null})},t.prototype.sourceContentFor=function(c,d){if(!this.sourcesContent)return null;var e=this._findSourceIndex(c);if(e>=0)return this.sourcesContent[e];var i,p=c;if(this.sourceRoot!=null&&(p=s.relative(this.sourceRoot,p)),this.sourceRoot!=null&&(i=s.urlParse(this.sourceRoot))){var g=p.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(g))return this.sourcesContent[this._sources.indexOf(g)];if((!i.path||i.path=="/")&&this._sources.has("/"+p))return this.sourcesContent[this._sources.indexOf("/"+p)]}if(d)return null;throw new Error('"'+p+'" is not in the SourceMap.')},t.prototype.generatedPositionFor=function(c){var d=s.getArg(c,"source");if((d=this._findSourceIndex(d))<0)return{line:null,column:null,lastColumn:null};var e={source:d,originalLine:s.getArg(c,"line"),originalColumn:s.getArg(c,"column")},i=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(c,"bias",n.GREATEST_LOWER_BOUND));if(i>=0){var p=this._originalMappings[i];if(p.source===e.source)return{line:s.getArg(p,"generatedLine",null),column:s.getArg(p,"generatedColumn",null),lastColumn:s.getArg(p,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},_.BasicSourceMapConsumer=t,h.prototype=Object.create(n.prototype),h.prototype.constructor=n,h.prototype._version=3,Object.defineProperty(h.prototype,"sources",{get:function(){for(var c=[],d=0;d<this._sections.length;d++)for(var e=0;e<this._sections[d].consumer.sources.length;e++)c.push(this._sections[d].consumer.sources[e]);return c}}),h.prototype.originalPositionFor=function(c){var d={generatedLine:s.getArg(c,"line"),generatedColumn:s.getArg(c,"column")},e=r.search(d,this._sections,function(p,g){return p.generatedLine-g.generatedOffset.generatedLine||p.generatedColumn-g.generatedOffset.generatedColumn}),i=this._sections[e];return i?i.consumer.originalPositionFor({line:d.generatedLine-(i.generatedOffset.generatedLine-1),column:d.generatedColumn-(i.generatedOffset.generatedLine===d.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:c.bias}):{source:null,line:null,column:null,name:null}},h.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(c){return c.consumer.hasContentsOfAllSources()})},h.prototype.sourceContentFor=function(c,d){for(var e=0;e<this._sections.length;e++){var i=this._sections[e].consumer.sourceContentFor(c,!0);if(i||i==="")return i}if(d)return null;throw new Error('"'+c+'" is not in the SourceMap.')},h.prototype.generatedPositionFor=function(c){for(var d=0;d<this._sections.length;d++){var e=this._sections[d];if(e.consumer._findSourceIndex(s.getArg(c,"source"))!==-1){var i=e.consumer.generatedPositionFor(c);if(i)return{line:i.line+(e.generatedOffset.generatedLine-1),column:i.column+(e.generatedOffset.generatedLine===i.line?e.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},h.prototype._parseMappings=function(c,d){this.__generatedMappings=[],this.__originalMappings=[];for(var e=0;e<this._sections.length;e++)for(var i=this._sections[e],p=i.consumer._generatedMappings,g=0;g<p.length;g++){var m=p[g],f=i.consumer._sources.at(m.source);f!==null&&(f=s.computeSourceURL(i.consumer.sourceRoot,f,this._sourceMapURL)),this._sources.add(f),f=this._sources.indexOf(f);var y=null;m.name&&(y=i.consumer._names.at(m.name),this._names.add(y),y=this._names.indexOf(y));var G={source:f,generatedLine:m.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:m.generatedColumn+(i.generatedOffset.generatedLine===m.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:m.originalLine,originalColumn:m.originalColumn,name:y};this.__generatedMappings.push(G),typeof G.originalLine=="number"&&this.__originalMappings.push(G)}o(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),o(this.__originalMappings,s.compareByOriginalPositions)},_.IndexedSourceMapConsumer=h,_}().SourceMapConsumer,F.SourceNode=function(){if(Ge)return ie;Ge=1;var s=Ae().SourceMapGenerator,r=J(),l=/(\r?\n)/,u="$$$isSourceNode$$$";function o(n,t,a,I,C){this.children=[],this.sourceContents={},this.line=n??null,this.column=t??null,this.source=a??null,this.name=C??null,this[u]=!0,I!=null&&this.add(I)}return o.fromStringWithSourceMap=function(n,t,a){var I=new o,C=n.split(l),h=0,c=function(){return g()+(g()||"");function g(){return h<C.length?C[h++]:void 0}},d=1,e=0,i=null;return t.eachMapping(function(g){if(i!==null){if(!(d<g.generatedLine)){var m=(f=C[h]||"").substr(0,g.generatedColumn-e);return C[h]=f.substr(g.generatedColumn-e),e=g.generatedColumn,p(i,m),void(i=g)}p(i,c()),d++,e=0}for(;d<g.generatedLine;)I.add(c()),d++;if(e<g.generatedColumn){var f=C[h]||"";I.add(f.substr(0,g.generatedColumn)),C[h]=f.substr(g.generatedColumn),e=g.generatedColumn}i=g},this),h<C.length&&(i&&p(i,c()),I.add(C.splice(h).join(""))),t.sources.forEach(function(g){var m=t.sourceContentFor(g);m!=null&&(a!=null&&(g=r.join(a,g)),I.setSourceContent(g,m))}),I;function p(g,m){if(g===null||g.source===void 0)I.add(m);else{var f=a?r.join(a,g.source):g.source;I.add(new o(g.originalLine,g.originalColumn,f,m,g.name))}}},o.prototype.add=function(n){if(Array.isArray(n))n.forEach(function(t){this.add(t)},this);else{if(!n[u]&&typeof n!="string")throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);n&&this.children.push(n)}return this},o.prototype.prepend=function(n){if(Array.isArray(n))for(var t=n.length-1;t>=0;t--)this.prepend(n[t]);else{if(!n[u]&&typeof n!="string")throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);this.children.unshift(n)}return this},o.prototype.walk=function(n){for(var t,a=0,I=this.children.length;a<I;a++)(t=this.children[a])[u]?t.walk(n):t!==""&&n(t,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(n){var t,a,I=this.children.length;if(I>0){for(t=[],a=0;a<I-1;a++)t.push(this.children[a]),t.push(n);t.push(this.children[a]),this.children=t}return this},o.prototype.replaceRight=function(n,t){var a=this.children[this.children.length-1];return a[u]?a.replaceRight(n,t):typeof a=="string"?this.children[this.children.length-1]=a.replace(n,t):this.children.push("".replace(n,t)),this},o.prototype.setSourceContent=function(n,t){this.sourceContents[r.toSetString(n)]=t},o.prototype.walkSourceContents=function(n){for(var t=0,a=this.children.length;t<a;t++)this.children[t][u]&&this.children[t].walkSourceContents(n);var I=Object.keys(this.sourceContents);for(t=0,a=I.length;t<a;t++)n(r.fromSetString(I[t]),this.sourceContents[I[t]])},o.prototype.toString=function(){var n="";return this.walk(function(t){n+=t}),n},o.prototype.toStringWithSourceMap=function(n){var t={code:"",line:1,column:0},a=new s(n),I=!1,C=null,h=null,c=null,d=null;return this.walk(function(e,i){t.code+=e,i.source!==null&&i.line!==null&&i.column!==null?(C===i.source&&h===i.line&&c===i.column&&d===i.name||a.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name}),C=i.source,h=i.line,c=i.column,d=i.name,I=!0):I&&(a.addMapping({generated:{line:t.line,column:t.column}}),C=null,I=!1);for(var p=0,g=e.length;p<g;p++)e.charCodeAt(p)===10?(t.line++,t.column=0,p+1===g?(C=null,I=!1):I&&a.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})):t.column++}),this.walkSourceContents(function(e,i){a.setSourceContent(e,i)}),{code:t.code,map:a}},ie.SourceNode=o,ie}().SourceNode),F);class X{constructor({file:r,line:l,function:u,code:o,locals:n={},offender:t=!1,column:a}){b(this,"file");b(this,"line");b(this,"function");b(this,"code");b(this,"locals");b(this,"offender");b(this,"column");this.file=r,this.line=l,this.function=u,this.code=o,this.locals=n,this.offender=t,this.column=a}toDict(){const r={file:this.file,line:this.line,function:this.function,code:this.code,locals:Object.fromEntries(Object.entries(this.locals).map(([l,u])=>[l,String(u)]))};return this.offender&&(r.offender=this.offender),this.column!==void 0&&(r.column=this.column),r}toJson(){return JSON.stringify(this.toDict())}}class O{static encode(r){return r instanceof X?r.toDict():Array.isArray(r)?r.map(l=>O.encode(l)):typeof r=="object"&&r!==null?JSON.stringify(r):r}static stringify(r){return JSON.stringify(O.encode(r),(l,u)=>u instanceof X?u.toDict():u)}}let Y=0;function ze(s){A().sfDebug&&console.log("Initializing Exception Interceptor...");const r=new Xe.Worker(new URL("data:application/javascript;base64,aW1wb3J0IHsgU2Vzc2lvbiB9IGZyb20gImluc3BlY3Rvci9wcm9taXNlcyI7CmltcG9ydCB7IHBhcmVudFBvcnQsIHdvcmtlckRhdGEgfSBmcm9tICJ3b3JrZXJfdGhyZWFkcyI7CgpnbG9iYWwuc2ZEZWJ1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cHRJZDsKICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgIGNvbnN0IHsgc2NyaXB0U291cmNlIH0gPSBhd2FpdCBzZXNzaW9uLnBvc3QoCiAgICAgICAgICAgICAgIkRlYnVnZ2VyLmdldFNjcmlwdFNvdXJjZSIsCiAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgc2NyaXB0SWQsCiAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgKTsKICAgICAgICAgICAgY29uc3Qgc291cmNlTGluZXMgPSBzY3JpcHRTb3VyY2Uuc3BsaXQoIlxuIik7CiAgICAgICAgICAgIGNvZGUgPSBzb3VyY2VMaW5lc1tsb2NhdGlvbi5saW5lTnVtYmVyXSB8fCAiPG5vdCBjYXB0dXJlZD4iOwogICAgICAgICAgfSBjYXRjaCAoZXJyKSB7CiAgICAgICAgICAgIGlmIChnbG9iYWwuc2ZEZWJ1ZykgewogICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoIltXb3JrZXJdIEZhaWxlZCB0byBmZXRjaCBzY3JpcHQgc291cmNlOiIsIGVycik7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIC8vIEZldGNoIGxvY2FsIHZhcmlhYmxlcyBpZiB0aGVyZSdzIGFuIG9iamVjdElkCiAgICAgICAgY29uc3QgbG9jYWxzID0gbG9jYWxTY29wZT8ub2JqZWN0Py5vYmplY3RJZAogICAgICAgICAgPyBhd2FpdCBmZXRjaExvY2FsVmFyaWFibGVzKHNlc3Npb24sIGxvY2FsU2NvcGUub2JqZWN0Lm9iamVjdElkKQogICAgICAgICAgOiB7fTsKCiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgIGZ1bmN0aW9uOiBmdW5jdGlvbk5hbWUgfHwgIjxhbm9ueW1vdXM+IiwKICAgICAgICAgIGxvY2FscywKICAgICAgICAgIGZpbGUsCiAgICAgICAgICBsaW5lOiBsb2NhdGlvbj8ubGluZU51bWJlciB8fCAwLAogICAgICAgICAg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NlcyBvbmUgb2YgdGhlIG1vZHVsZXMgd2UgYWxsb3cgY2FwdHVyaW5nIGZyb20KICAgICAgICBjb25zdCBpc0Zyb21BbGxvd2VkTm9kZU1vZHVsZSA9IG5vZGVNb2R1bGVzTGlzdC5zb21lKChtb2R1bGVOYW1lKSA9PgogICAgICAgICAgZmlyc3RGcmFtZUxpbmUuaW5jbHVkZXMoYCR7bW9kdWxlTmFtZX1gKSwKICAgICAgICApOwoKICAgICAgICBpZiAoIWlzRnJvbUFsbG93ZWROb2RlTW9kdWxlKSB7CiAgICAgICAgICAvLyBOb3QgZnJvbSBhbiBhbGxvd2VkIG5vZGUgbW9kdWxlID0+IHJldHVybiBlYXJseQogICAgICAgICAgaWYgKGdsb2JhbC5zZkRlYnVnKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKAogICAgICAgICAgICAgICJbV29ya2VyXSBFcnJvciBhcHBlYXJzIHRvIGJlIHRyaWdnZXJlZCBmcm9tIG5vbi1hcHBsaWNhdGlvbiBzb3VyY2VzOyBpZ25vcmluZy4iLAogICAgICAgICAgICApOwogICAgICAgICAgfQogICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICAvLyBPdGhlcndpc2UsIGl0J3MgZnJvbSBhbiBhbGxvd2VkIG5vZGUgbW9kdWxlLCBzbyBjb250aW51ZQogICAgICB9IGVsc2UgewogICAgICAgIC8vIElmIHRoZSBsaXN0IGlzIGVtcHR5LCBwcmVzZXJ2ZSBleGlzdGluZyBiZWhhdmlvciBhbmQgaWdub3JlIG5vbi1hcHBsaWNhdGlvbiBlcnJvcnMKICAgICAgICBpZiAoZ2xvYmFsLnNmRGVidWcpIHsKICAgICAgICAgIGNvbnNvbGUubG9nKAogICAgICAgICAgICAiW1dvcmtlcl0gRXJyb3IgYXBwZWFycyB0byBiZSB0cmlnZ2VyZWQgZnJvbSBub24tYXBwbGljYXRpb24gc291cmNlczsgaWdub3JpbmcuIiwKICAgICAgICAgICk7CiAgICAgICAgfQogICA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3JrZXJdIEZhaWxlZCB0byBmZXRjaCBsb2NhbCB2YXJpYWJsZXM6IiwgZXJyKTsKICAgIH0KICAgIHJldHVybiB7fTsKICB9Cn0KCnN0YXJ0RGVidWdnZXIoKS5jYXRjaCgoZXJyb3IpID0+IHsKICBpZiAoZ2xvYmFsLnNmRGVidWcpIHsKICAgIGNvbnNvbGUuZXJyb3IoIltXb3JrZXJdIEZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlcjoiLCBlcnJvcik7CiAgfQp9KTsKCi8vIEtlZXAgdGhlIHdvcmtlciBhbGl2ZQpzZXRJbnRlcnZhbCgoKSA9PiB7fSwgMTAwMDApOwo="),{workerData:{captureAllExceptions:!0}});let l=null;r.on("message",t=>{if(typeof t=="string"&&A().sfDebug&&console.log(`[Worker] ${t}`),t.readyToGetParameters&&r.postMessage({sfDebug:A().sfDebug,stackDepthLocals:A().stackDepthLocals,nodeModulesToCollectLocalVariablesOn:A().nodeModulesToCollectLocalVariablesOn}),t.type==="exception"){const{frames:a}=t,I=l;if(!I)return;const C=function(c){return c?c.split(`
|
|
32
|
+
`).slice(1).map(d=>{const e=/at (.+?) \((.+):(\d+):(\d+)\)/.exec(d)||/at (.+):(\d+):(\d+)/.exec(d);if(e){const[,i,p,g,m]=e;return new X({function:i||"<anonymous>",locals:{},file:p||"<unknown>",line:parseInt(g,10)||0,code:"<not captured>",column:parseInt(m)||0})}return new X({function:"<unknown>",locals:{},file:"<unknown>",line:0,code:"<not captured>",column:0})}):[]}(I.stack),h=function(c,d){const e=[];let i=-1,p=-1;for(let g=0;g<c.length;g++){const m=ke(c[g].file);if(p=g,m!=="<unknown>"){for(let f=0;f<d.length;f++){const y=d[f];if(_e(y,m)||typeof y.file=="string"&&y.file.includes(m)){i=f,Y=0,A().sfDebug&&console.log(`✅ Matched Frame Found: ${m} @ Debugger Frame ${f}`);break}}if(i!==-1)break}}if(i===-1)return Y===10?(Y=0,c):(++Y,A().sfDebug&&console.log(`"❌ No matching frame found. Checking once again, Attempt N ${Y}"`),[]);A().sfDebug&&console.log(`🔄 Merging from matched index ${i} onward...`);for(let g=0;g<d.length;g++){const m=c[p+g],f=d[i+g];e.push(new X({function:f?.function||m?.function||"<anonymous>",locals:f?.locals||m?.locals||{},file:m?.file||f?.file||"<unknown>",line:f?.line||m?.line||0,code:f?.code||m?.code||"<not captured>"}))}return e}(C,a||[]);if(h.length!==0){l=null;const c=A().stackDepthCodeTraceDepth,d=c===-1?h:h.slice(0,c+1),e=Math.min(d.length,C.length);for(let p=0;p<e;p++)(async()=>{const g=Oe(d[p].file,C[p].line,C[p].column);g&&(g.content!=null&&(d[p].code=g.content),g.file!=null&&(d[p].file=g.file))})();s.setOperationName("CollectExceptions");const i=I.message?`${I.name}: ${I.message}`:I.name;A().sfDebug&&console.log("error message is : ",i),s.doSend(i,d)}}}),r.on("error",t=>{console.error("[Worker Error]",t)}),r.on("exit",t=>{console.error(`[Worker] Exited with code ${t}`)}),r.unref();const u=Error,o=new Set;function n(...t){const a=Reflect.construct(u,t);Reflect.setPrototypeOf(a,n.prototype),u.captureStackTrace&&u.captureStackTrace(a,n);const I=`${a.message}:${a.stack?.split(`
|
|
33
|
+
`)[1]?.trim()}`;return o.has(I)||(o.add(I),l=a,r.postMessage({type:"processException",error:a.message})),a}n.prototype=Object.create(u.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(n,u),globalThis.Error=n}function Se(s){return s=(s=(s=s.replace(/^webpack:\/\/[^\/]+\/\.?\//,"")).replace(/^.*\/pages\//,"pages/")).replace(/\.(js|ts)$/,"")}function Oe(s,r,l){const u=function(n){n.startsWith("at ")&&(n=n.slice(3).trim());const t=n.match(/^(.*?)(:\d+)+(\.map)?$/);return t?t[1]:n}(s);if(!u||u==="<unknown>")return null;const o=u+".map";try{const n=we.readFileSync(o,"utf-8");if(n){const t=JSON.parse(n);let a=new He.SourceMapConsumer(t).originalPositionFor({line:r,column:l});if(u&&a.source){const I=Se(u),C=t.sources.findIndex(h=>Se(h)===I);if(C===-1)A().sfDebug&&console.log(`Source file "${u}" not found in the source map.`);else{const h=t.sourcesContent[C],c=t.names.join(",");if(h)return{content:h.split(`
|
|
34
|
+
`).slice(a.line-1,a.line+20).join(`
|
|
35
|
+
`),name:c,file:a.source};A().sfDebug&&console.log(`No source content available for file "${u}".`)}}return{content:t.sourcesContent[0],name:t.names[0],file:t.file}}}catch(n){A().sfDebug&&console.log(`Cant read/parse "${o}: Error - ".`,n)}return null}function ke(s){return s?.split("/").pop()||"<unknown>"}function _e(s,r){if(!s||typeof s!="object")return!1;for(const l of Object.values(s))if(typeof l=="string"&&l.includes(r)||typeof l=="object"&&_e(l,r))return!0;return!1}class $e extends K{constructor(){super();b(this,"serviceIdentifier",new k);this.setOperationName("CollectExceptions")}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(l,u){this.sendAppIdentifier(),this.send(l,u)}async send(l,u){A().sfDebug&&console.log(" SENDING EXCEPTION...");const o=JSON.stringify(O.encode(u)),n=this.getVariables({exceptionMessage:l,traceJson:o,reentrancyGuardPreactive:!1,library:A().packageLibraryType,version:A().version});R(this.endpoint,this.operationName,this.getQuery(),n)}getQuery(){return`
|
|
36
36
|
mutation ${this.operationName}($apiKey: String!, $serviceUuid: String!, $sessionId: String!, $exceptionMessage: String!, $traceJson: String!, $reentrancyGuardPreactive: Boolean!, $library: String!, $timestampMs: String!, $version: String!) {
|
|
37
37
|
${this.queryName}(apiKey: $apiKey, serviceUuid: $serviceUuid, sessionId: $sessionId, exceptionMessage: $exceptionMessage, traceJson: $traceJson, reentrancyGuardPreactive: $reentrancyGuardPreactive, library: $library, timestampMs: $timestampMs, version: $version)
|
|
38
38
|
}
|
|
39
|
-
`}}const N={},
|
|
39
|
+
`}}const N={},Be="getting request source code";var T=(s=>(s.UNKNOWN="unknown",s.ANONYMOUS="anonymous",s.NOT_CAPTURED="not captured",s))(T||{});const re="http:",oe="https:";class Pe extends ae{constructor(){super(),this.setOperationName("DomainsToNotPassHeaderTo")}async doSend(r){this.sendAppIdentifier(),this.send(r)}async send(r){const l=`
|
|
40
40
|
${this.queryType} ${this.operationName}(
|
|
41
41
|
$apiKey: String!,
|
|
42
42
|
$serviceUuid: String!,
|
|
@@ -48,26 +48,30 @@
|
|
|
48
48
|
domains: $domains
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
|
-
`,u={apiKey:this.apiKey,serviceUuid:this.serviceUUID,domains:r};R(this.endpoint,this.operationName,l,u)}}class
|
|
51
|
+
`,u={apiKey:this.apiKey,serviceUuid:this.serviceUUID,domains:r};R(this.endpoint,this.operationName,l,u)}}class je extends K{constructor(){super();b(this,"serviceIdentifier",new k);this.setOperationName("CollectNetworkHops")}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(l){this.sendAppIdentifier(),this.send(l)}async send(l){const{name:u,column:o,line:n,entrypoint:t}=l,a=this.getVariables({name:u,column:o,line:n,entrypoint:t});R(this.endpoint,this.operationName,this.getQuery(),a)}getQuery(){return`
|
|
52
52
|
mutation ${this.operationName}(
|
|
53
53
|
$apiKey: String!,
|
|
54
54
|
$sessionId: String!,
|
|
55
55
|
$timestampMs: String!,
|
|
56
|
-
$
|
|
56
|
+
$line: String!,
|
|
57
|
+
$column: String!,
|
|
58
|
+
$name: String!,
|
|
57
59
|
$entrypoint: String!,
|
|
58
|
-
$serviceUuid: String
|
|
60
|
+
$serviceUuid: String
|
|
59
61
|
) {
|
|
60
62
|
${this.queryName}(
|
|
61
63
|
apiKey: $apiKey,
|
|
62
64
|
sessionId: $sessionId,
|
|
63
65
|
timestampMs: $timestampMs,
|
|
64
|
-
|
|
66
|
+
line: $line,
|
|
67
|
+
column: $column,
|
|
68
|
+
name: $name,
|
|
65
69
|
entrypoint: $entrypoint,
|
|
66
70
|
serviceUuid: $serviceUuid
|
|
67
71
|
)
|
|
68
72
|
}
|
|
69
|
-
`}}const
|
|
70
|
-
`).slice(1),
|
|
73
|
+
`}}const se=[400,403];class Qe{constructor(r=[]){b(this,"HEADER_TRACING","X-Sf3-Rid");b(this,"HEADER_LOG_GUARD","reentrancy_guard_logging_preactive");b(this,"HEADER_PRINT_GUARD","reentrancy_guard_print_preactive");b(this,"HEADER_EXCEPTION_GUARD","reentrancy_guard_exception_preactive");b(this,"contextManager");this.contextManager=z.getInstance(),r?.forEach(l=>{typeof l=="string"&&l?.trim()&&this.contextManager.addDynamicExcludedDomains(l)}),A().sfDebug&&console.log("[RequestInterceptor] Initialized.")}parseStackFrame(r){const l=/\((.*):(\d+):(\d+)\)$/.exec(r.trim());if(!l)return null;const[,u,o,n]=l;return{filePath:u,line:parseInt(o,10),column:parseInt(n,10)}}async getOriginalPosition(r,l,u){let o={source:r,line:l,column:u,name:null};const n=r+".map";try{const t=JSON.parse(we.readFileSync(n,"utf-8"));let a=(await new He.SourceMapConsumer(t)).originalPositionFor({line:l,column:u});a.source&&(o=a)}catch(t){A().sfDebug&&console.error(`Could not read/parse map file at ${n}:`,t)}return{originalPos:o}}captureFirstUserLines(r,l=10){const u=A().sfDebug?10:l,o=Error.stackTraceLimit;Error.stackTraceLimit=Math.max(o,u);const n=new Error(Be);Be in Error&&Error.captureStackTrace(n,this.captureFirstUserLines);const t=n.stack||"";Error.stackTraceLimit=o;const a=t.split(`
|
|
74
|
+
`).slice(1),I=[];for(const C of a)if(!(C.includes("node:internal")||C.includes("internal/modules")||C.includes("internal/process")||C.includes("node_modules")||C.includes(".next/server/chunks")||C.includes("RequestInterceptor")||C.includes("contextManager")||C.includes("setupConfig"))&&(I.push(C.trim()),I.length>=l))break;for(const C of I){const h=this.parseStackFrame(C);h?(async()=>{const{originalPos:c}=await this.getOriginalPosition(h.filePath,h.line,h.column);if(c){A().sfDebug&&console.log("[RequestInterceptor] First user code line:",c);const d={line:c.line?.toString()||T.UNKNOWN,column:c.column?.toString()||T.NOT_CAPTURED,name:c.name||T.NOT_CAPTURED,entrypoint:c.source};r.doSend(d)}})():A().sfDebug&&console.error("Could not parse stack line:",C)}}addReentrancyGuardHeaders(r){r.set(this.HEADER_LOG_GUARD,"true"),r.set(this.HEADER_PRINT_GUARD,"true"),r.set(this.HEADER_EXCEPTION_GUARD,"true")}shouldPropagateHeaders(r){const l=Ne.some(o=>new RegExp(`^${o.replace(/\*/g,".*")}$`).test(r)),u=this.contextManager.getExcludedDomains().has(r);return!l&&!u}addTracingHeaders(r,l){const u=new URL(l).hostname,o=this.shouldPropagateHeaders(u);return o?this.addTracingHeader(r,l):A().sfDebug&&console.error(`[RequestInterceptor] Excluded domain: ${u}`),this.addReentrancyGuardHeaders(r),o}addTracingHeader(r,l){const u=this.contextManager.getOrSetSfTraceId(),o=this.contextManager.getOrSetPageVisitUUID(),n=L();r.set(this.HEADER_TRACING,`${u}/${o}/${n}`),A().sfDebug&&console.log(`[RequestInterceptor] Added tracing header for ${l}`)}patchFetch(r){const l=globalThis.fetch;typeof l=="function"?globalThis.fetch=async(u,o)=>{this.captureFirstUserLines(r);const n=Date.now(),t=new Headers(o?.headers);let a;typeof u=="string"||u instanceof URL?a=u.toString():u instanceof Request?(a=u.url,u.headers.forEach((e,i)=>{t.set(i,e)})):A().sfDebug&&console.error("[Sailfish RequestInterceptor] Invalid fetch input."),A().sfDebug&&console.log("[RequestInterceptor] Fetching request to:",a);const I=new URL(a).hostname,C=new Headers(t),h=this.addTracingHeaders(t,a),c={...o,headers:t};let d;try{d=await l(a,c),h&&se.includes(d.status)?(this.contextManager.addDynamicExcludedDomains(I),A().sfDebug&&console.warn(`[RequestInterceptor] Excluding host ${I} after status ${d.status}`),this.addTracingHeaders(C,a),d=await l(a,{...o,headers:C})):this.contextManager.addSupportedDomains(I);const e=Date.now();return A().sfDebug&&console.log(`[RequestInterceptor] Fetch completed: ${a}, Status: ${d.status}, Duration: ${e-n}ms`),d}catch(e){const i=Date.now();A().sfDebug&&console.error(`[RequestInterceptor] Fetch failed: ${a}, Error: ${e}, Duration: ${i-n}ms`)}}:A().sfDebug&&console.error("[RequestInterceptor] Fetch not available.")}patchHttp(r){if(A().sfDebug&&console.log("[RequestInterceptor] Initializing HTTP/HTTPS request patch..."),!N||typeof N.request!="function")return void(A().sfDebug&&console.log("[RequestInterceptor] HTTP/HTTPS not available."));const l=N.request.bind(N),u=N.request.bind(N);N.request=function(o,n){let t;try{if(typeof o=="string"){const a=new URL(o);t={protocol:a.protocol||re,hostname:a.hostname,path:a.pathname+a.search,headers:{}}}else o instanceof URL?t={protocol:o.protocol||re,hostname:o.hostname,path:o.pathname+o.search,headers:{}}:(t={...o},t.protocol||(t.protocol=re));if(t.headers){const a=`${t.protocol}//${t.hostname}`;this.addTracingHeaders(t.headers,a),this.captureFirstUserLines(r)}else A().sfDebug&&console.warn("[RequestInterceptor] No headers found in HTTP request options. Skipping header addition.")}catch(a){throw A().sfDebug&&console.error("[RequestInterceptor] Error while processing HTTP request options:",a),a}return l(t,a=>{const I=`${t.protocol}//${t.hostname}`;if(t.headers&&this.shouldPropagateHeaders(new URL(I).hostname)&&se.includes(a.statusCode||0)){const C=t.hostname;this.contextManager.addDynamicExcludedDomains(C);const h={...t,headers:{...t.headers}};delete h.headers[this.HEADER_TRACING],this.addReentrancyGuardHeaders(h.headers),l(h,n)}n?.(a)})},N.request=function(o,n){let t;try{if(typeof o=="string"){const a=new URL(o);t={protocol:a.protocol||oe,hostname:a.hostname,path:a.pathname+a.search,headers:{}}}else o instanceof URL?t={protocol:o.protocol||oe,hostname:o.hostname,path:o.pathname+o.search,headers:{}}:(t={...o},t.protocol||(t.protocol=oe));if(t.headers){const a=`${t.protocol}//${t.hostname}`;this.addTracingHeaders(t.headers,a)}else A().sfDebug&&console.warn("[RequestInterceptor] No headers found in HTTPS request options. Skipping header addition.")}catch(a){throw A().sfDebug&&console.error("[RequestInterceptor] Error while processing HTTPS request options:",a),a}return u(t,a=>{const I=`${t.protocol}//${t.hostname}`;if(t.headers&&this.shouldPropagateHeaders(new URL(I).hostname)&&se.includes(a.statusCode||0)){const C=t.hostname;this.contextManager.addDynamicExcludedDomains(C);const h={...t,headers:{...t.headers}};delete h.headers[this.HEADER_TRACING],this.addReentrancyGuardHeaders(h.headers),u(h,n)}n?.(a)})},A().sfDebug&&console.log("✅ HTTP and HTTPS request methods patched globally.")}tryPatch(r,l){try{require.resolve(l),r(),console.log(`[RequestInterceptor] Patched ${l}`)}catch(u){console.warn(`[RequestInterceptor] Could not patch ${l}: ${u.message}`)}}getExcludedDomains(){return[...this.contextManager.getExcludedDomains()]}}class qe extends ae{constructor(){super(),this.setOperationName("UpdateServiceDetails")}async doSend(){this.sendAppIdentifier(),this.send()}async send(){const r=`
|
|
71
75
|
${this.queryType} ${this.operationName}(
|
|
72
76
|
$apiKey: String!,
|
|
73
77
|
$serviceUuid: String!,
|
|
@@ -87,4 +91,4 @@
|
|
|
87
91
|
|
|
88
92
|
)
|
|
89
93
|
}
|
|
90
|
-
`,l=this.getVariables({serviceIdentifier:A().serviceIdentifier,serviceVersion:A().serviceVersion,serviceAdditionalMetadata:A().serviceAdditionalMetadata});R(this.endpoint,this.operationName,r,l)}}exports.addOrUpdateMetadata=function(s,r={},l,u=!1){const o=A();new
|
|
94
|
+
`,l=this.getVariables({serviceIdentifier:A().serviceIdentifier,serviceVersion:A().serviceVersion,serviceAdditionalMetadata:A().serviceAdditionalMetadata});R(this.endpoint,this.operationName,r,l)}}exports.addOrUpdateMetadata=function(s,r={},l,u=!1){const o=A();new le(o.apiKey).addOrUpdateMetadata(s,r,l,u)},exports.identify=function(s,r,l,u=!1){const o=A();new le(o.apiKey).identify(s,r,l,u)},exports.setupInterceptors=function(s){if(!s||!s.apiKey){const o=`The required API Key is not provided: ${JSON.stringify(s)}`;console.error(o)}const{config:r}=function(o){return x=new Ke(o),{config:x}}(s);if(r.sfDebug&&console.log("Updated configuration after applying options:",r),!r.apiKey||!r.apiGraphqlEndpoint){const o=`The required config is not provided: ${JSON.stringify(r)}`;throw console.error(o),new Error(o)}const l=new ae;l.setServiceUUID(r.serviceUUID),function(o){function n(c,d){o.setOperationName("CollectLogs"),o.doSend([d,c])}const t=console.log.bind(console),a=console.error.bind(console),I=console.warn.bind(console),C=console.info.bind(console),h=console.debug.bind(console);console.log=(...c)=>{n("INFO",c.join(" ")),t(...c)},console.error=(...c)=>{n("ERROR",c.join(" ")),a(...c)},console.warn=(...c)=>{n("WARN",c.join(" ")),I(...c)},console.info=(...c)=>{n("INFO",c.join(" ")),C(...c)},A().logLevel==="DEBUG"&&(console.debug=(...c)=>{n("DEBUG",c.join(" ")),h(...c)})}(l),function(o=[]){const n=new Qe(o);new Pe().doSend(n.getExcludedDomains());const t=new je;n.patchFetch(t)}(r.domainsToNotPropagateHeadersTo);const u=new $e;u.setServiceUUID(r.serviceUUID),ze(u),new qe().send()};
|