1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d7e2c2e0-e192-5bae-9033-a551224e18bd")}catch(e){}}(); 3(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6450],{603:(t,e,r)=>{"use strict";r.d(e,{I:()=>x});var n=r(51642).hp,o=void 0!==n&&n.from?function(t){return n.from(t,"utf8")}:t=>new TextEncoder().encode(t);function i(t){return t instanceof Uint8Array?t:"string"==typeof t?o(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function s(t){return"string"==typeof t?0===t.length:0===t.byteLength}var a={name:"SHA-256"},h={name:"HMAC",hash:a},c=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);let f={};function u(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:f}var l=function(){function t(t){this.toHash=new Uint8Array(0),this.secret=t,this.reset()}return t.prototype.update=function(t){if(!s(t)){var e=i(t),r=new Uint8Array(this.toHash.byteLength+e.byteLength);r.set(this.toHash,0),r.set(e,this.toHash.byteLength),this.toHash=r}},t.prototype.digest=function(){var t=this;return this.key?this.key.then(function(e){return u().crypto.subtle.sign(h,e,t.toHash).then(function(t){return new Uint8Array(t)})}):s(this.toHash)?Promise.resolve(c):Promise.resolve().then(function(){return u().crypto.subtle.digest(a,t.toHash)}).then(function(t){return Promise.resolve(new Uint8Array(t))})},t.prototype.reset=function(){var t=this;this.toHash=new Uint8Array(0),this.secret&&void 0!==this.secret&&(this.key=new Promise(function(e,r){u().crypto.subtle.importKey("raw",i(t.secret),h,!1,["sign"]).then(e,r)}),this.key.catch(function(){}))},t}(),d=r(13829),y=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),p=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],b=function(){function t(){this.state=Int32Array.from(p),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(t){if(this.finished)throw Error("Attempted to update an already finished hash.");var e=0,r=t.byteLength;if(this.bytesHashed+=r,8*this.bytesHashed>0x1fffffffffffff)throw Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=t[e++],r--,64===this.bufferLength&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var t=8*this.bytesHashed,e=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(e.setUint8(this.bufferLength++,128),r%64>=56){for(var n=this.bufferLength;n<64;n++)e.setUint8(n,0);this.hashBuffer(),this.bufferLength=0}for(var n=this.bufferLength;n<56;n++)e.setUint8(n,0);e.setUint32(56,Math.floor(t/0x100000000),!0),e.setUint32(60,t),this.hashBuffer(),this.finished=!0}for(var o=new Uint8Array(32),n=0;n<8;n++)o[4*n]=this.state[n]>>>24&255,o[4*n+1]=this.state[n]>>>16&255,o[4*n+2]=this.state[n]>>>8&255,o[4*n+3]=this.state[n]>>>0&255;return o},t.prototype.hashBuffer=function(){for(var t=this.buffer,e=this.state,r=e[0],n=e[1],o=e[2],i=e[3],s=e[4],a=e[5],h=e[6],c=e[7],f=0;f<64;f++){if(f<16)this.temp[f]=(255&t[4*f])<<24|(255&t[4*f+1])<<16|(255&t[4*f+2])<<8|255&t[4*f+3];else{var u=this.temp[f-2],l=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,d=((u=this.temp[f-15])>>>7|u<<25)^(u>>>18|u<<14)^u>>>3;this.temp[f]=(l+this.temp[f-7]|0)+(d+this.temp[f-16]|0)}var p=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&a^~s&h)|0)+(c+(y[f]+this.temp[f]|0)|0)|0,b=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&n^r&o^n&o)|0;c=h,h=a,a=s,s=i+p|0,i=o,o=n,n=r,r=p+b|0}e[0]+=r,e[1]+=n,e[2]+=o,e[3]+=i,e[4]+=s,e[5]+=a,e[6]+=h,e[7]+=c},t}(),g=function(){function t(t){this.secret=t,this.hash=new b,this.reset()}return t.prototype.update=function(t){if(!s(t)&&!this.error)try{this.hash.update(i(t))}catch(t){this.error=t}},t.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},t.prototype.digest=function(){return(0,d.sH)(this,void 0,void 0,function(){return(0,d.YH)(this,function(t){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new b,this.secret){this.outer=new b;var t=function(t){var e=i(t);if(e.byteLength>64){var r=new b;r.update(e),e=r.digest()}var n=new Uint8Array(64);return n.set(e),n}(this.secret),e=new Uint8Array(64);e.set(t);for(var r=0;r<64;r++)t[r]^=54,e[r]^=92;this.hash.update(t),this.outer.update(e);for(var r=0;r<t.byteLength;r++)t[r]=0}},t}(),w=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"],x=function(){function t(t){var e,r,n;if("object"==typeof(r=e=u())&&"object"==typeof r.crypto&&"function"==typeof r.crypto.getRandomValues&&"object"==typeof e.crypto.subtle&&(n=e.crypto.subtle)&&w.every(function(t){return"function"==typeof n[t]}))this.hash=new l(t);else this.hash=new g(t)}return t.prototype.update=function(t,e){this.hash.update(i(t))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t}()},45579:(t,e,r)=>{"use strict";var n=r(51642).hp;
3class o extends Error{constructor(t){super(o._prepareSuperMessage(t)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,o)}static _prepareSuperMessage(t){try{return JSON.stringify(t)}catch{return String(t)}}}let i=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],s=Symbol(".toJSON called"),a=({from:t,seen:e,to_:r,forceEnumerable:o,maxDepth:h,depth:c})=>{let f=r||(Array.isArray(t)?[]:{});if(e.push(t),c>=h)return f;if("function"==typeof t.toJSON&&!0!==t[s])return(t=>{t[s]=!0;let e=t.toJSON();return delete t[s],e})(t);for(let[r,i]of Object.entries(t)){if("function"==typeof n&&n.isBuffer(i)){f[r]="[object Buffer]";continue}if("function"!=typeof i){if(!i||"object"!=typeof i){f[r]=i;continue}if(!e.includes(t[r])){c++,f[r]=a({from:t[r],seen:e.slice(),forceEnumerable:o,maxDepth:h,depth:c});continue}f[r]="[Circular]"}}for(let{property:e,enumerable:r}of i)"string"==typeof t[e]&&Object.defineProperty(f,e,{value:t[e],enumerable:!!o||r,configurable:!0,writable:!0});return f};t.exports={serializeError:(t,e={})=>{let{maxDepth:r=1/0}=e;return"object"==typeof t&&null!==t?a({from:t,seen:[],forceEnumerable:!0,maxDepth:r,depth:0}):"function"==typeof t?`[Function: ${t.name||"anonymous"}]`:t},deserializeError:(t,e={})=>{let{maxDepth:r=1/0}=e;if(t instanceof Error)return t;if("object"==typeof t&&null!==t&&!Array.isArray(t)){let e=Error();return a({from:t,seen:[],to_:e,maxDepth:r,depth:0}),e}return new o(t)}}},47335:function(t,e,r){var n;n="undefined"!=typeof self?self:this,function(t){var e="undefined"!=typeof globalThis&&globalThis||void 0!==n&&n||void 0!==r.g&&r.g||{},o={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(o.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function a(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){if(2!=t.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function u(t){if(!t._noBody){if(t.bodyUsed)return Promise.reject(TypeError("Already read"));t.bodyUsed=!0}}function l(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function d(t){var e=new FileReader,r=l(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){if(this.bodyUsed=this.bodyUsed,this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(o.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(o.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else{var e;o.arrayBuffer&&o.blob&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t)}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=u(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=u(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(o.blob)return this.blob().then(d);throw Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,n,o,i=u(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,r=l(e=new FileReader),o=(n=/charset=([A-Za-z0-9_-]+)/.exec(t.type))?n[1]:"utf-8",e.readAsText(t,o),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},o.formData&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(t,e){t=a(t),e=h(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},f.prototype.delete=function(t){delete this.map[a(t)]},f.prototype.get=function(t){return t=a(t),this.has(t)?this.map[t]:null},f.prototype.has=function(t){return this.map.hasOwnProperty(a(t))},f.prototype.set=function(t,e){this.map[a(t)]=h(e)},f.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},f.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),c(t)},f.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),c(t)},f.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),c(t)},o.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);var b=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function g(t,r){if(!(this instanceof g))throw TypeError('Please use the "new" operator, this DOM object c
3onstructor cannot be called as a function.');var n,o,i=(r=r||{}).body;if(t instanceof g){if(t.bodyUsed)throw TypeError("Already read");this.url=t.url,this.credentials=t.credentials,r.headers||(this.headers=new f(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=r.credentials||this.credentials||"same-origin",(r.headers||!this.headers)&&(this.headers=new f(r.headers)),this.method=(o=(n=r.method||this.method||"GET").toUpperCase(),b.indexOf(o)>-1?o:n),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal||function(){if("AbortController"in e)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),("GET"===this.method||"HEAD"===this.method)&&("no-store"===r.cache||"no-cache"===r.cache)){var s=/([?&])_=[^&]*/;s.test(this.url)?this.url=this.url.replace(s,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function w(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function x(t,e){if(!(this instanceof x))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},p.call(g.prototype),p.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},x.error=function(){var t=new x(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var m=[301,302,303,307,308];x.redirect=function(t,e){if(-1===m.indexOf(e))throw RangeError("Invalid status code");return new x(null,{status:e,headers:{location:t}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function _(r,n){return new Promise(function(i,s){var c=new g(r,n);if(c.signal&&c.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function l(){u.abort()}if(u.onload=function(){var t,e,r={statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}
3).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(t){console.warn("Response "+t.message)}}}),e)};0===c.url.indexOf("file://")&&(u.status<200||u.status>599)?r.status=200:r.status=u.status,r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var n="response"in u?u.response:u.responseText;setTimeout(function(){i(new x(n,r))},0)},u.onerror=function(){setTimeout(function(){s(TypeError("Network request failed"))},0)},u.ontimeout=function(){setTimeout(function(){s(TypeError("Network request timed out"))},0)},u.onabort=function(){setTimeout(function(){s(new t.DOMException("Aborted","AbortError"))},0)},u.open(c.method,function(t){try{return""===t&&e.location.href?e.location.href:t}catch(e){return t}}(c.url),!0),"include"===c.credentials?u.withCredentials=!0:"omit"===c.credentials&&(u.withCredentials=!1),"responseType"in u&&(o.blob?u.responseType="blob":o.arrayBuffer&&(u.responseType="arraybuffer")),n&&"object"==typeof n.headers&&!(n.headers instanceof f||e.Headers&&n.headers instanceof e.Headers)){var d=[];Object.getOwnPropertyNames(n.headers).forEach(function(t){d.push(a(t)),u.setRequestHeader(t,h(n.headers[t]))}),c.headers.forEach(function(t,e){-1===d.indexOf(e)&&u.setRequestHeader(e,t)})}else c.headers.forEach(function(t,e){u.setRequestHeader(e,t)});c.signal&&(c.signal.addEventListener("abort",l),u.onreadystatechange=function(){4===u.readyState&&c.signal.removeEventListener("abort",l)}),u.send(void 0===c._bodyInit?null:c._bodyInit)})}_.polyfill=!0,e.fetch||(e.fetch=_,e.Headers=f,e.Request=g,e.Response=x),t.Headers=f,t.Request=g,t.Response=x,t.fetch=_,Object.defineProperty(t,"__esModule",{value:!0})}({})},55108:(t,e,r)=>{"use strict";r.d(e,{P:()=>f}),r(47335),function(t){t.Error="error",t.Warn="warn",t.Info="info",t.Debug="debug",t.Fatal="fatal",t.Http="http",t.Verbose="verbose",t.Silly="silly",t.Trace="trace"}(i||(i={}));let n=t=>JSON.stringify(t).length+1;class o{constructor(){this.length=0}push(t){let e={value:t};this.last=this.last?this.last.next=e:this.first=e,this.length++}shift(){if(this.first){let{value:t}=this.first;return this.first=this.first.next,--this.length||(this.last=void 0),t}}}var i,s=r(45579);let a={endpoint:"https://in.logs.betterstack.com",batchSize:1e3,batchSizeKiB:0,batchInterval:1e3,retryCount:3,retryBackoff:100,syncMax:5,burstProtectionMilliseconds:5e3,burstProtectionMax:1e4,ignoreExceptions:!1,throwExceptions:!1,contextObjectMaxDepth:50,contextObjectMaxDepthWarn:!0,contextObjectCircularRefWarn:!0,sendLogsToConsoleOutput:!1,sendLogsToBetterStack:!0,calculateLogSizeBytes:n};class h{constructor(t,e){if(this._middleware=[],this._countLogged=0,this._countSynced=0,this._countDropped=0,"string"!=typeof t||""===t)throw Error("Logtail source token missing");this._sourceToken=t,this._options=Object.assign(Object.assign({},a),e);let r=(function(t){let e=0,r=new o;return function(n){return async(...o)=>new Promise((i,s)=>{async function a(){if(e<t){e++;try{i(await n(...o))}catch(t){s(t)}e--,r.length>0&&r.shift()()}else r.push(a)}return a()})}})(this._options.syncMax)(t=>this._sync(t));this._logBurstProtection=function(t,e,r="The function"){if(t<=0||e<=0)return t=>t;let n=[0],o=0,i=Date.now();return s=>async(...a)=>{if(!function(){let e=Date.now(),r=t/64;if(e<i+r)return;let o=Math.floor((e-i)/r);n=Array(Math.min(o,64)).fill(0).concat(n).slice(0,64),i+=o*r}(),n.reduce((t,e)=>t+e)<e)return n[0]++,await s(...a);let h=Date.now();o<h-t&&(o=h,console.error(`${r} was called more than ${e} times during last ${t}ms. Ignoring.`))}}(this._options.burstProtectionMilliseconds,this._options.burstProtectionMax,"Logging"),this.log=this._logBurstProtection(this.log.bind(this));let i=function(t=1e3,e=1e3,r=3,o=100,i=0,s=n){let a,h,c=[],f=0,u=0,l=0;async function d(){a&&clearTimeout(a),a=null;let t=c,e=f;c=[],f=0;try{await h(t.map(t=>t.log)),t.forEach(t=>t.resolve(t.log)),u=0}catch(n){if(u<r){u++,l=Date.now()+o,c=c.concat(t),f+=e,await y();return}t.map(t=>t.reject(n)),u=0}}async function y(){if(!a)return new Promise(t=>{a=setTimeout(async function(){await d(),t()},e)})}return{initPusher:function(e){return h=e,async function(e){return new Promise(async(r,n)=>(c.push({log:e,resolve:r,reject:n}),i>0&&(f+=s(e)),(c.length>=t||i>0&&f>=i)&&Date.now()>l?await d():await y(),r))}},flush:d}}(this._options.batchSize,this._options.batchInterval,this._options.retryCount,this._options.retryBackoff,1024*this._options.batchSizeKiB,this._options.calculateLogSizeBytes);this._batch=i.initPusher(t=>r(t)),this._flush=i.flush}async flush(){return this._flush()}get logged(){return this._countLogged}get synced(){return this._countSynced}get dropped(){return this._countDropped}
3async log(t,e=i.Info,r={}){if("object"!=typeof r&&(r={extra:r}),r instanceof Error&&(r={error:r}),this._options.sendLogsToConsoleOutput)switch(e){case"debug":console.debug(t,r);break;case"info":console.info(t,r);break;case"warn":console.warn(t,r);break;case"error":console.error(t,r);break;default:console.log(`[${e.toUpperCase()}]`,t,r)}if("function"!=typeof this._sync)throw Error("No Logtail logger sync function provided");this._countLogged++;let n=Object.assign(Object.assign({dt:new Date,level:e},r),t instanceof Error?(0,s.serializeError)(t):{message:t});for(let t of this._middleware){let e=await t(n);if(null==e)return n;n=e}if(n=this.serialize(n,this._options.contextObjectMaxDepth),!this._options.sendLogsToBetterStack)return n;try{await this._batch(n),this._countSynced++}catch(t){if(this._countDropped++,!this._options.ignoreExceptions)if(this._options.throwExceptions)throw t;else console.error(t)}return n}serialize(t,e,r=new WeakSet){if(null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t)return t;if(t instanceof Date)return isNaN(t.getTime())?t.toString():t.toISOString();if(t instanceof Error)return(0,s.serializeError)(t);if(("object"==typeof t||Array.isArray(t))&&(e<1||r.has(t)))return r.has(t)?(this._options.contextObjectCircularRefWarn&&console.warn("[Logtail] Found a circular reference when serializing logs. Please do not use circular references in your logs."),"<omitted circular reference>"):(this._options.contextObjectMaxDepthWarn&&console.warn(`[Logtail] Max depth of ${this._options.contextObjectMaxDepth} reached when serializing logs. Please do not use excessive object depth in your logs.`),`<omitted context beyond configured max depth: ${this._options.contextObjectMaxDepth}>`);if(Array.isArray(t)){r.add(t);let n=t.map(t=>this.serialize(t,e-1,r));return r.delete(t),n}else if("object"==typeof t){let n={};return r.add(t),Object.entries(t).forEach(t=>{let o=t[0],i=t[1],s=this.serialize(i,e-1,r);void 0!==s&&(n[o]=s)}),r.delete(t),n}else if(void 0===t)return;else return`<omitted unserializable ${typeof t}>`}async debug(t,e={}){return this.log(t,i.Debug,e)}async info(t,e={}){return this.log(t,i.Info,e)}async warn(t,e={}){return this.log(t,i.Warn,e)}async error(t,e={}){return this.log(t,i.Error,e)}setSync(t){this._sync=t}use(t){this._middleware.push(t)}remove(t){this._middleware=this._middleware.filter(e=>e!==t)}}let c=class extends h{async log(t,e=i.Info,r={}){return super.log(t,e,r)}};class f extends c{constructor(t,e){super(t,Object.assign({batchSizeKiB:48},e));let r=async t=>{let e=await fetch(this._options.endpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this._sourceToken}`},body:JSON.stringify(t),keepalive:!0});if(e.ok)return t;throw Error(e.statusText)};this.setSync(r),this.configureFlushOnPageLeave()}async log(t,e,r={}){return"object"!=typeof r&&(r={extra:r}),r instanceof Error&&(r={error:r}),r=Object.assign(Object.assign({},this.getCurrentContext()),r),super.log(t,e,r)}getCurrentContext(){return{context:{url:window.location.href,user_locale:navigator.userLanguage||navigator.language,user_agent:navigator.userAgent,device_pixel_ratio:window.devicePixelRatio,screen_width:window.screen.width,screen_height:window.screen.height,window_width:window.innerWidth,window_height:window.innerHeight}}}configureFlushOnPageLeave(){"undefined"!=typeof document&&document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.flush()})}}}}]); 4//# sourceMappingURL=6450-b28678c30364cfcd.js.map 5//# debugId=d7e2c2e0-e192-5bae-9033-a551224e18bd
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.