@monoscopetech/browser 0.5.7 → 0.5.8
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/dist/monoscope.min.js
CHANGED
|
@@ -12,7 +12,7 @@ var Monoscope=function(){"use strict";var e,t=Object.defineProperty,n=(e,n,r)=>(
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function tc(e,t,n,r){return new(n||(n=Promise))(function(t,s){function o(e){try{a(r.next(e))}catch(e){s(e)}}function i(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(o,i)}a((r=r.apply(e,[])).next())})}for(var nc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),sc=0;sc<64;sc++)rc[nc.charCodeAt(sc)]=sc;const oc=new Map;const ic=(e,t,n)=>{if(!e||!cc(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=oc.get(e);return n||(n=new Map,oc.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let s=r.indexOf(e);return-1===s&&(s=r.length,r.push(e)),s};function ac(e,t,n){if(e instanceof Array)return e.map(e=>ac(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,s="";for(t=0;t<r;t+=3)s+=nc[n[t]>>2],s+=nc[(3&n[t])<<4|n[t+1]>>4],s+=nc[(15&n[t+1])<<2|n[t+2]>>6],s+=nc[63&n[t+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[ac(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[ac(e.data,t,n),e.width,e.height]}}if(cc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ic(e,t,n)}}return e}const lc=(e,t,n)=>[...e].map(e=>ac(e,t,n)),cc=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function uc(e,t,n){const r=[];try{const s=pl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r,...s){return ml(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...s])}});r.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function hc(e,t,n,r,s,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const o of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const l=pl(e,o,function(e){return function(...a){const l=e.apply(this,a);if(ic(l,i,this),!ml(this.canvas,r,s,!0)){const e=lc([...a],i,this),r={type:t,property:o,args:e};n(this.canvas,r)}return l}});a.push(l)}catch(r){const s=hl(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});a.push(s)}return a}var pc=null;try{var dc="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");pc=dc.Worker}catch(e){}function fc(e,t,n){var r=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),s=r.indexOf("\n",10)+1,o=r.substring(s)+"";return function(e){return new pc(o,Object.assign({},e,{eval:!0}))}}function mc(e,t,n){var r=function(e){return atob(e)}(e),s=r.indexOf("\n",10)+1,o=r.substring(s)+"",i=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(i)}var gc="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var yc=function(e){return gc?fc(e):function(e){var t;return function(n){return t=t||mc(e),new Worker(t,n)}}(e)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class vc{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,s,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,s){const o=uc(t,n,r),i=new Map,a=new yc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:s,height:o}=e.data;this.mutationCb({id:t,type:El["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{ml(t,n,r,!0)||e.push(t)}),e})().forEach(e=>tc(this,0,void 0,function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[r])}))),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=uc(e,t,n),s=function(e,t,n,r){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=pl(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return ml(this.canvas,n,r,!0)||setTimeout(()=>{const n=lc([...o],t,this);e(this.canvas,{type:El["2D"],property:i,args:n})},0),s.apply(this,o)}});s.push(o)}catch(n){const r=hl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:El["2D"],property:i,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){const s=[];return s.push(...hc(t.WebGLRenderingContext.prototype,El.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...hc(t.WebGL2RenderingContext.prototype,El.WebGL2,e,n,r,0,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),s(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(e,["type"]);return t}),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:r}),this.pendingCanvasMutations.delete(e)}}class bc{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Sl,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:Fa(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function wc(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Cc,Sc,_c,Ic=!1;const Ac=new Ba;function Ec(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:d,maskTextFn:f,hooks:m,packFn:g,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,userTriggeredOnInput:S=!1,collectFonts:_=!1,inlineImages:I=!1,plugins:A,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:k=new Set([])}=e,T=!C||window.parent===window;let O=!1;if(!T)try{window.parent.document,O=!1}catch(e){O=!0}if(T&&!t)throw new Error("emit function is required");void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),Ac.reset();const R=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},x=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let N;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let M=0;const L=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return g&&(e=g(e)),e};Cc=(e,s)=>{var o;if(!(null===(o=Pl[0])||void 0===o?void 0:o.isFrozen())||e.type===_l.FullSnapshot||e.type===_l.IncrementalSnapshot&&e.data.source===Il.Mutation||Pl.forEach(e=>e.unfreeze()),T)null==t||t(L(e),s);else if(O){const t={type:"rrweb",event:L(e),isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===_l.FullSnapshot)N=e,M=0;else if(e.type===_l.IncrementalSnapshot){if(e.data.source===Il.Mutation&&e.data.isAttachIframe)return;M++;const t=r&&M>=r,s=n&&e.timestamp-N.timestamp>n;(t||s)&&Sc(!0)}};const D=e=>{Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Mutation},e)}))},P=e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Scroll},e)})),F=e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.CanvasMutation},e)})),B=new bc({mutationCb:D,adoptedStyleSheetCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.AdoptedStyleSheet},e)}))}),U=new $l({mirror:Ac,mutationCb:D,stylesheetManager:B,recordCrossOriginIframes:C,wrappedEmit:Cc});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:Ac,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});_c=new vc({recordCanvas:w,mutationCb:F,win:window,blockClass:s,blockSelector:o,mirror:Ac,sampling:y.canvas,dataURLOptions:v});const Z=new ec({mutationCb:D,scrollCb:P,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:R,dataURLOptions:v,maskTextFn:f,maskInputFn:d,recordCanvas:w,inlineImages:I,sampling:y,slimDOMOptions:x,iframeManager:U,stylesheetManager:B,canvasManager:_c,keepIframeSrcFn:E},mirror:Ac});Sc=(e=!1)=>{var t,n,r,i,u,h;Cc(wc({type:_l.Meta,data:{href:window.location.href,width:fl(),height:dl()}}),e),B.reset(),Pl.forEach(e=>e.lock());const p=function(e,t){var n=t||{},r=n.mirror,s=void 0===r?new Ba:r,o=n.blockClass,i=void 0===o?"rr-block":o,a=n.blockSelector,l=void 0===a?null:a,c=n.maskTextClass,u=void 0===c?"rr-mask":c,h=n.maskTextSelector,p=void 0===h?null:h,d=n.inlineStylesheet,f=void 0===d||d,m=n.inlineImages,g=void 0!==m&&m,y=n.recordCanvas,v=void 0!==y&&y,b=n.maskAllInputs,w=void 0!==b&&b,C=n.maskTextFn,S=n.maskInputFn,_=n.slimDOM,I=void 0!==_&&_,A=n.dataURLOptions,E=n.preserveWhiteSpace,k=n.onSerialize,T=n.onIframeLoad,O=n.iframeLoadTimeout,R=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,N=n.keepIframeSrcFn;return il(e,{doc:e,mirror:s,blockClass:i,blockSelector:l,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===I,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===I?{}:I,dataURLOptions:A,inlineImages:g,recordCanvas:v,preserveWhiteSpace:E,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:O,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}(document,{mirror:Ac,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:R,maskTextFn:f,slimDOM:x,dataURLOptions:v,recordCanvas:w,inlineImages:I,onSerialize:e=>{bl(e,Ac)&&U.addIframe(e),wl(e,Ac)&&B.trackLinkElement(e),Cl(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{U.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!p)return console.warn("Failed to snapshot the document");Cc(wc({type:_l.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),Pl.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,Ac.getId(document))};try{const e=[];e.push(al("DOMContentLoaded",()=>{Cc(wc({type:_l.DomContentLoaded,data:{}}))}));const t=e=>{var t;return ql({mutationCb:D,mousemoveCb:(e,t)=>Cc(wc({type:_l.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.MouseInteraction},e)})),scrollCb:P,viewportResizeCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.ViewportResize},e)})),inputCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Input},e)})),mediaInteractionCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.MediaInteraction},e)})),styleSheetRuleCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.StyleSheetRule},e)})),styleDeclarationCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.StyleDeclaration},e)})),canvasMutationCb:F,fontCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Font},e)})),selectionCb:e=>{Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Selection},e)}))},blockClass:s,ignoreClass:i,maskTextClass:a,maskTextSelector:l,maskInputOptions:R,inlineStylesheet:c,sampling:y,recordCanvas:w,inlineImages:I,userTriggeredOnInput:S,collectFonts:_,doc:e,maskInputFn:d,maskTextFn:f,keepIframeSrcFn:E,blockSelector:o,slimDOMOptions:x,dataURLOptions:v,mirror:Ac,iframeManager:U,stylesheetManager:B,shadowDomManager:Z,canvasManager:_c,ignoreCSSAttributes:k,plugins:(null===(t=null==A?void 0:A.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Cc(wc({type:_l.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},m)};U.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{Sc(),e.push(t(document)),Ic=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(al("load",()=>{Cc(wc({type:_l.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),Ic=!1}}catch(e){console.warn(e)}}Ec.addCustomEvent=(e,t)=>{if(!Ic)throw new Error("please add custom event after start recording");Cc(wc({type:_l.Custom,data:{tag:e,payload:t}}))},Ec.freezePage=()=>{Pl.forEach(e=>e.freeze())},Ec.takeFullSnapshot=e=>{if(!Ic)throw new Error("please take full snapshot after start recording");Sc(e)},Ec.mirror=Ac;const kc=1e3;class Tc{constructor(e,t){this.events=[],this.stopRecording=void 0,this.saveInterval=null,this.isSaving=!1,this.isConfigured=!1,this.sessionId=t,this.config=e,this.events=[],this.save=this.save.bind(this),this.configure=this.configure.bind(this),this.handleUnload=this.handleUnload.bind(this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.setupEventListeners()}setupEventListeners(){window.addEventListener("beforeunload",this.handleUnload),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("pagehide",this.handleUnload)}handleUnload(){this.save(!0)}handleVisibilityChange(){"hidden"===document.visibilityState&&this.save()}configure(){var e;if(this.isConfigured)console.warn("MonoscopeReplay already configured");else try{this.stopRecording=Ec({emit:e=>{this.events.push(e),this.events.length>=50&&this.save()},blockClass:"rr-block",maskAllInputs:!0,maskInputOptions:{password:!0,email:!0,tel:!0},maskTextClass:"rr-mask",checkoutEveryNms:15e3,sampling:{mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!1,DblClick:!0,Focus:!1,Blur:!1,TouchStart:!0,TouchEnd:!1},mousemove:!0,scroll:150,media:800,input:"last"},plugins:[(e={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:2}},{name:"rrweb/console@1",observer:Na,options:e})]}),this.saveInterval=setInterval(()=>{this.save()},1e4),this.isConfigured=!0,console.log("MonoscopeReplay configured successfully")}catch(e){throw console.error("Failed to configure MonoscopeReplay:",e),e}}async save(e=!1){if(this.isSaving&&!e)return;if(0===this.events.length)return;this.events.length>kc&&(console.warn("Event queue exceeded 1000, dropping oldest events"),this.events=this.events.slice(-1e3)),this.isSaving=!0;const{replayEventsBaseUrl:t,projectId:n}=this.config;let r=t||"https://app.monoscope.tech";r=`${r}/rrweb/${n}`;const s=[...this.events];this.events=[];const o={events:s,sessionId:this.sessionId,timestamp:(new Date).toISOString(),eventCount:s.length};try{if(e&&navigator.sendBeacon){const e=new Blob([JSON.stringify(o)],{type:"application/json"});navigator.sendBeacon(r,e)||console.warn("sendBeacon failed, events may be lost")}else{const e=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o),keepalive:!0});if(!e.ok)throw new Error(`Failed to save replay events: ${e.status} ${e.statusText}`);console.log(`Successfully saved ${s.length} replay events`)}}catch(e){console.error("Failed to save replay events:",e),this.events=[...s,...this.events],this.events.length>kc&&(this.events=this.events.slice(-1e3))}finally{this.isSaving=!1}}stop(){this.save(!0),this.stopRecording&&(this.stopRecording(),this.stopRecording=void 0),this.saveInterval&&(clearInterval(this.saveInterval),this.saveInterval=null),window.removeEventListener("beforeunload",this.handleUnload),window.removeEventListener("pagehide",this.handleUnload),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.isConfigured=!1,console.log("MonoscopeReplay stopped")}getEventCount(){return this.events.length}getSessionId(){return this.sessionId}isRecording(){return this.isConfigured&&null!==this.stopRecording}}var Oc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Rc="1.9.0",xc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var Nc=function(e){var t=new Set([e]),n=new Set,r=e.match(xc);if(!r)return function(){return!1};var s=+r[1],o=+r[2],i=+r[3];if(null!=r[4])return function(t){return t===e};function a(e){return n.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(xc);if(!r)return a(e);var c=+r[1],u=+r[2],h=+r[3];return null!=r[4]||s!==c?a(e):0===s?o===u&&i<=h?l(e):a(e):o<=u?l(e):a(e)}}(Rc),Mc=Rc.split(".")[0],Lc=Symbol.for("opentelemetry.js.api."+Mc),Dc=Oc;function Pc(e,t,n,r){var s;void 0===r&&(r=!1);var o=Dc[Lc]=null!==(s=Dc[Lc])&&void 0!==s?s:{version:Rc};if(!r&&o[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(o.version!==Rc){i=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+e+" does not match previously registered API v"+Rc);return n.error(i.stack||i.message),!1}return o[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Rc+"."),!0}function Fc(e){var t,n,r=null===(t=Dc[Lc])||void 0===t?void 0:t.version;if(r&&Nc(r))return null===(n=Dc[Lc])||void 0===n?void 0:n[e]}function Bc(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Rc+".");var n=Dc[Lc];n&&delete n[e]}var Uc,Zc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},jc=function(e,t,n){if(n||2===arguments.length)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))},zc=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("verbose",this._namespace,e)},e}();function Vc(e,t,n){var r=Fc("diag");if(r)return n.unshift(t),r[e].apply(r,jc([],Zc(n),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Uc||(Uc={}));var Gc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},Wc=function(e,t,n){if(n||2===arguments.length)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))},Hc=function(){function e(){function e(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=Fc("diag");if(r)return r[e].apply(r,Wc([],Gc(t),!1))}}var t=this;t.setLogger=function(e,n){var r,s,o;if(void 0===n&&(n={logLevel:Uc.INFO}),e===t){var i=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(r=i.stack)&&void 0!==r?r:i.message),!1}"number"==typeof n&&(n={logLevel:n});var a=Fc("diag"),l=function(e,t){function n(n,r){var s=t[n];return"function"==typeof s&&e>=r?s.bind(t):function(){}}return e<Uc.NONE?e=Uc.NONE:e>Uc.ALL&&(e=Uc.ALL),t=t||{},{error:n("error",Uc.ERROR),warn:n("warn",Uc.WARN),info:n("info",Uc.INFO),debug:n("debug",Uc.DEBUG),verbose:n("verbose",Uc.VERBOSE)}}(null!==(s=n.logLevel)&&void 0!==s?s:Uc.INFO,e);if(a&&!n.suppressOverrideMessage){var c=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+c),l.warn("Current logger will overwrite one already registered from "+c)}return Pc("diag",l,t,!0)},t.disable=function(){Bc("diag",t)},t.createComponentLogger=function(e){return new zc(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),Yc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},Kc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Jc=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Yc(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];var o=new e(this._entries);try{for(var i=Kc(r),a=i.next();!a.done;a=i.next()){var l=a.value;o._entries.delete(l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o},e.prototype.clear=function(){return new e},e}(),Xc=Symbol("BaggageEntryMetadata"),qc=Hc.instance();function Qc(e){return void 0===e&&(e={}),new Jc(new Map(Object.entries(e)))}function $c(e){return Symbol.for(e)}var eu,tu,nu=function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var s=new e(n._currentContext);return s._currentContext.set(t,r),s},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}},ru=new nu,su=(eu=function(e,t){return eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},eu(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}eu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ou=function(){function e(){}return e.prototype.createGauge=function(e,t){return yu},e.prototype.createHistogram=function(e,t){return vu},e.prototype.createCounter=function(e,t){return gu},e.prototype.createUpDownCounter=function(e,t){return bu},e.prototype.createObservableGauge=function(e,t){return Cu},e.prototype.createObservableCounter=function(e,t){return wu},e.prototype.createObservableUpDownCounter=function(e,t){return Su},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),iu=function(){},au=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t.prototype.add=function(e,t){},t}(iu),lu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t.prototype.add=function(e,t){},t}(iu),cu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t.prototype.record=function(e,t){},t}(iu),uu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t.prototype.record=function(e,t){},t}(iu),hu=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),pu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t}(hu),du=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t}(hu),fu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t}(hu),mu=new ou,gu=new au,yu=new cu,vu=new uu,bu=new lu,wu=new pu,Cu=new du,Su=new fu,_u={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},Iu={set:function(e,t,n){null!=e&&(e[t]=n)}},Au=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},Eu=function(e,t,n){if(n||2===arguments.length)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))},ku=function(){function e(){}return e.prototype.active=function(){return ru},e.prototype.with=function(e,t,n){for(var r=[],s=3;s<arguments.length;s++)r[s-3]=arguments[s];return t.call.apply(t,Eu([n],Au(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Tu=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},Ou=function(e,t,n){if(n||2===arguments.length)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))},Ru="context",xu=new ku,Nu=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return Pc(Ru,e,Hc.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,s=[],o=3;o<arguments.length;o++)s[o-3]=arguments[o];return(r=this._getContextManager()).with.apply(r,Ou([e,t,n],Tu(s),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Fc(Ru)||xu},e.prototype.disable=function(){this._getContextManager().disable(),Bc(Ru,Hc.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(tu||(tu={}));var Mu="0000000000000000",Lu="00000000000000000000000000000000",Du={traceId:Lu,spanId:Mu,traceFlags:tu.NONE},Pu=function(){function e(e){void 0===e&&(e=Du),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),Fu=$c("OpenTelemetry Context Key SPAN");function Bu(e){return e.getValue(Fu)||void 0}function Uu(){return Bu(Nu.getInstance().active())}function Zu(e,t){return e.setValue(Fu,t)}function ju(e){return e.deleteValue(Fu)}function zu(e,t){return Zu(e,new Pu(t))}function Vu(e){var t;return null===(t=Bu(e))||void 0===t?void 0:t.spanContext()}var Gu=/^([0-9a-f]{32})$/i,Wu=/^[0-9a-f]{16}$/i;function Hu(e){return Gu.test(e)&&e!==Lu}function Yu(e){return Hu(e.traceId)&&(t=e.spanId,Wu.test(t)&&t!==Mu);var t}function Ku(e){return new Pu(e)}var Ju=Nu.getInstance(),Xu=function(){function e(){}return e.prototype.startSpan=function(e,t,n){if(void 0===n&&(n=Ju.active()),Boolean(null==t?void 0:t.root))return new Pu;var r,s=n&&Vu(n);return"object"==typeof(r=s)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&Yu(s)?new Pu(s):new Pu},e.prototype.startActiveSpan=function(e,t,n,r){var s,o,i;if(!(arguments.length<2)){2===arguments.length?i=t:3===arguments.length?(s=t,i=n):(s=t,o=n,i=r);var a=null!=o?o:Ju.active(),l=this.startSpan(e,s,a),c=Zu(a,l);return Ju.with(c,i,void 0,l)}},e}();var qu,Qu,$u,eh=new Xu,th=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):eh},e}(),nh=new(function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new Xu},e}()),rh=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new th(this,e,t,n)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:nh},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(qu||(qu={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(Qu||(Qu={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}($u||($u={}));var sh=Nu.getInstance(),oh=Hc.instance(),ih=new(function(){function e(){}return e.prototype.getMeter=function(e,t,n){return mu},e}()),ah="metrics",lh=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return Pc(ah,e,Hc.instance())},e.prototype.getMeterProvider=function(){return Fc(ah)||ih},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){Bc(ah,Hc.instance())},e}().getInstance(),ch=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),uh=$c("OpenTelemetry Baggage Key");function hh(e){return e.getValue(uh)||void 0}function ph(){return hh(Nu.getInstance().active())}function dh(e,t){return e.setValue(uh,t)}function fh(e){return e.deleteValue(uh)}var mh="propagation",gh=new ch,yh=function(){function e(){this.createBaggage=Qc,this.getBaggage=hh,this.getActiveBaggage=ph,this.setBaggage=dh,this.deleteBaggage=fh}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return Pc(mh,e,Hc.instance())},e.prototype.inject=function(e,t,n){return void 0===n&&(n=Iu),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return void 0===n&&(n=_u),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){Bc(mh,Hc.instance())},e.prototype._getGlobalPropagator=function(){return Fc(mh)||gh},e}(),vh=yh.getInstance(),bh="trace",wh=function(){function e(){this._proxyTracerProvider=new rh,this.wrapSpanContext=Ku,this.isSpanContextValid=Yu,this.deleteSpan=ju,this.getSpan=Bu,this.getActiveSpan=Uu,this.getSpanContext=Vu,this.setSpan=Zu,this.setSpanContext=zu}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=Pc(bh,this._proxyTracerProvider,Hc.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Fc(bh)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Bc(bh,Hc.instance()),this._proxyTracerProvider=new rh},e}().getInstance();const Ch=$c("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Sh(e){return!0===e.getValue(Ch)}const _h="baggage";function Ih(e){const t=e.split(";");if(t.length<=0)return;const n=t.shift();if(!n)return;const r=n.indexOf("=");if(r<=0)return;const s=decodeURIComponent(n.substring(0,r).trim()),o=decodeURIComponent(n.substring(r+1).trim());let i;var a;return t.length>0&&("string"!=typeof(a=t.join(";"))&&(qc.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),i={__TYPE__:Xc,toString:function(){return a}}),{key:s,value:o,metadata:i}}class Ah{inject(e,t,n){const r=vh.getBaggage(e);if(!r||Sh(e))return;const s=function(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(n+=";"+t.metadata.toString()),n})}(r).filter(e=>e.length<=4096).slice(0,180),o=function(e){return e.reduce((e,t)=>{const n=`${e}${""!==e?",":""}${t}`;return n.length>8192?e:n},"")}(s);o.length>0&&n.set(t,_h,o)}extract(e,t,n){const r=n.get(t,_h),s=Array.isArray(r)?r.join(","):r;if(!s)return e;const o={};if(0===s.length)return e;return s.split(",").forEach(e=>{const t=Ih(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),o[t.key]=e}}),0===Object.entries(o).length?e:vh.setBaggage(e,vh.createBaggage(o))}fields(){return[_h]}}function Eh(e){const t={};if("object"!=typeof e||null==e)return t;for(const[n,r]of Object.entries(e))kh(n)?Th(r)?Array.isArray(r)?t[n]=r.slice():t[n]=r:oh.warn(`Invalid attribute value set for key: ${n}`):oh.warn(`Invalid attribute key: ${n}`);return t}function kh(e){return"string"==typeof e&&e.length>0}function Th(e){return null==e||(Array.isArray(e)?function(e){let t;for(const n of e)if(null!=n){if(!t){if(Oh(n)){t=typeof n;continue}return!1}if(typeof n!==t)return!1}return!0}(e):Oh(e))}function Oh(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}let Rh=e=>{oh.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let n=e;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;const r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}(e))}(e))};function xh(e){try{Rh(e)}catch{}}const Nh="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Mh=performance,Lh="http.url",Dh="error.type",Ph="exception.message",Fh="exception.type",Bh="http.request.method",Uh="http.request.method_original",Zh="http.response.status_code",jh="server.address",zh="server.port",Vh="service.name",Gh="telemetry.sdk.language",Wh="telemetry.sdk.name",Hh="telemetry.sdk.version",Yh="url.full",Kh="process.runtime.name",Jh={[Wh]:"opentelemetry",[Kh]:"browser",[Gh]:"webjs",[Hh]:"2.0.1"};const Xh=Math.pow(10,6),qh=Math.pow(10,9);function Qh(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Xh)]}function $h(){let e=Mh.timeOrigin;if("number"!=typeof e){const t=Mh;e=t.timing&&t.timing.fetchStart}return e}function ep(e){return op(Qh($h()),Qh("number"==typeof e?e:Mh.now()))}function tp(e){if(rp(e))return e;if("number"==typeof e)return e<$h()?ep(e):Qh(e);if(e instanceof Date)return Qh(e.getTime());throw TypeError("Invalid input type")}function np(e){return e[0]*qh+e[1]}function rp(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function sp(e){return rp(e)||"number"==typeof e||e instanceof Date}function op(e,t){const n=[e[0]+t[0],e[1]+t[1]];return n[1]>=qh&&(n[1]-=qh,n[0]+=1),n}var ip;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(ip||(ip={}));class ap{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>"function"==typeof e.fields?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(const r of this._propagators)try{r.inject(e,t,n)}catch(e){oh.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){oh.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const lp="[_0-9a-z-*/]",cp=new RegExp(`^(?:${`[a-z]${lp}{0,255}`}|${`[a-z0-9]${lp}{0,240}@[a-z]${lp}{0,13}`})$`),up=/^[ -~]{0,255}[!-~]$/,hp=/,|=/;class pp{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){const t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){e.length>512||(this._internalState=e.split(",").reverse().reduce((e,t)=>{const n=t.trim(),r=n.indexOf("=");if(-1!==r){const s=n.slice(0,r),o=n.slice(r+1,t.length);(function(e){return cp.test(e)})(s)&&function(e){return up.test(e)&&!hp.test(e)}(o)&&e.set(s,o)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new pp;return e._internalState=new Map(this._internalState),e}}const dp="traceparent",fp="tracestate",mp=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class gp{inject(e,t,n){const r=wh.getSpanContext(e);if(!r||Sh(e)||!Yu(r))return;const s=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||tu.NONE).toString(16)}`;n.set(t,dp,s),r.traceState&&n.set(t,fp,r.traceState.serialize())}extract(e,t,n){const r=n.get(t,dp);if(!r)return e;const s=Array.isArray(r)?r[0]:r;if("string"!=typeof s)return e;const o=function(e){const t=mp.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}(s);if(!o)return e;o.isRemote=!0;const i=n.get(t,fp);if(i){const e=Array.isArray(i)?i.join(","):i;o.traceState=new pp("string"==typeof e?e:void 0)}return wh.setSpanContext(e,o)}fields(){return[dp,fp]}}const yp="[object Null]",vp="[object Undefined]",bp=Function.prototype.toString,wp=bp.call(Object),Cp=Object.getPrototypeOf,Sp=Object.prototype,_p=Sp.hasOwnProperty,Ip=Symbol?Symbol.toStringTag:void 0,Ap=Sp.toString;function Ep(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?vp:yp;return Ip&&Ip in Object(e)?function(e){const t=_p.call(e,Ip),n=e[Ip];let r=!1;try{e[Ip]=void 0,r=!0}catch(e){}const s=Ap.call(e);r&&(t?e[Ip]=n:delete e[Ip]);return s}(e):function(e){return Ap.call(e)}(e)}(e))return!1;const t=Cp(e);if(null===t)return!0;const n=_p.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&bp.call(n)===wp}function kp(e){return Rp(e)?e.slice():e}function Tp(e,t,n=0,r){let s;if(!(n>20)){if(n++,Mp(e)||Mp(t)||xp(t))s=kp(t);else if(Rp(e)){if(s=e.slice(),Rp(t))for(let e=0,n=t.length;e<n;e++)s.push(kp(t[e]));else if(Np(t)){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const r=e[n];s[r]=kp(t[r])}}}else if(Np(e))if(Np(t)){if(!function(e,t){if(!Ep(e)||!Ep(t))return!1;return!0}(e,t))return t;s=Object.assign({},e);const o=Object.keys(t);for(let i=0,a=o.length;i<a;i++){const a=o[i],l=t[a];if(Mp(l))void 0===l?delete s[a]:s[a]=l;else{const o=s[a],i=l;if(Op(e,a,r)||Op(t,a,r))delete s[a];else{if(Np(o)&&Np(i)){const n=r.get(o)||[],s=r.get(i)||[];n.push({obj:e,key:a}),s.push({obj:t,key:a}),r.set(o,n),r.set(i,s)}s[a]=Tp(s[a],l,n,r)}}}}else s=t;return s}}function Op(e,t,n){const r=n.get(e[t])||[];for(let n=0,s=r.length;n<s;n++){const s=r[n];if(s.key===t&&s.obj===e)return!0}return!1}function Rp(e){return Array.isArray(e)}function xp(e){return"function"==typeof e}function Np(e){return!Mp(e)&&!Rp(e)&&!xp(e)&&"object"==typeof e}function Mp(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}function Lp(e,t){return"string"==typeof t?e===t:!!e.match(t)}function Dp(e,t){if(!t)return!1;for(const n of t)if(Lp(e,n))return!0;return!1}class Pp{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class Fp{_callback;_that;_isCalled=!1;_deferred=new Pp;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}const Bp=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Up{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const t=new Up({});return t._rawAttributes=jp(e),t._asyncAttributesPending=e.filter(([e,t])=>Bp(t)).length>0,t}constructor(e){const t=e.attributes??{};this._rawAttributes=Object.entries(t).map(([e,t])=>(Bp(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=jp(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Bp(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&oh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,n]of this._rawAttributes)Bp(n)?oh.debug(`Unsettled resource attribute ${t} skipped`):null!=n&&(e[t]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return null==e?this:Up.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function Zp(e){return Up.FromAttributeList(Object.entries(e))}function jp(e){return e.map(([e,t])=>Bp(t)?[e,t.catch(t=>{oh.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class zp{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:$u.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=Mh.now(),this._performanceOffset=t-(this._performanceStartTime+$h()),this._startTimeProvided=null!=e.startTime,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,null!=e.attributes&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(null==t||this._isSpanEnded())return this;if(0===e.length)return oh.warn(`Invalid attribute key: ${e}`),this;if(!Th(t))return oh.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits;return void 0!==n&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this)}setAttributes(e){for(const[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return oh.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&oh.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),sp(t)&&(sp(n)||(n=t),t=void 0);const s=Eh(t);return this.events.push({name:e,attributes:s,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()||(this.status={...e},null!=this.status.message&&"string"!=typeof e.message&&(oh.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message)),this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?oh.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this._ended=!0,this.endTime=this._getTime(e),this._duration=function(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=qh),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(oh.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&oh.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=Mh.now())return ep(e+this._performanceOffset);if("number"==typeof e)return Qh(e);if(e instanceof Date)return Qh(e.getTime());if(rp(e))return e;if(this._startTimeProvided)return Qh(Date.now());const t=Mh.now()-this._performanceStartTime;return op(this.startTime,Qh(t))}isRecording(){return!1===this._ended}recordException(e,t){const n={};"string"==typeof e?n[Ph]=e:e&&(e.code?n[Fh]=e.code.toString():e.name&&(n[Fh]=e.name),e.message&&(n[Ph]=e.message),e.stack&&(n["exception.stacktrace"]=e.stack)),n[Fh]||n[Ph]?this.addEvent("exception",n,t):oh.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);oh.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){const t=this._attributeValueLengthLimit;return t<=0?(oh.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}}var Vp;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Vp||(Vp={}));class Gp{shouldSample(){return{decision:Vp.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Wp{shouldSample(){return{decision:Vp.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Hp{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(xh(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Wp),this._remoteParentSampled=e.remoteParentSampled??new Wp,this._remoteParentNotSampled=e.remoteParentNotSampled??new Gp,this._localParentSampled=e.localParentSampled??new Wp,this._localParentNotSampled=e.localParentNotSampled??new Gp}shouldSample(e,t,n,r,s,o){const i=wh.getSpanContext(e);return i&&Yu(i)?i.isRemote?i.traceFlags&tu.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,r,s,o):i.traceFlags&tu.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,s,o):this._localParentNotSampled.shouldSample(e,t,n,r,s,o):this._root.shouldSample(e,t,n,r,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Yp{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(e,t){return{decision:Hu(t)&&this._accumulate(t)<this._upperBound?Vp.RECORD_AND_SAMPLED:Vp.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){const r=8*n;t=(t^parseInt(e.slice(r,r+8),16))>>>0}return t}}function Kp(){return{sampler:Jp(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Jp(){const e="parentbased_always_on";switch(e){case"always_on":return new Wp;case"always_off":return new Gp;case"parentbased_always_on":return new Hp({root:new Wp});case"parentbased_always_off":return new Hp({root:new Gp});case"traceidratio":return new Yp(Xp());case"parentbased_traceidratio":return new Hp({root:new Yp(Xp())});default:return oh.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new Hp({root:new Wp})}}function Xp(){return oh.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const qp=1/0;class Qp{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:3e4,this._shutdownOnce=new Fp(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(oh.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||0!==(e.spanContext().traceFlags&tu.SAMPLED)&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&oh.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(oh.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{const n=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);sh.with(function(e){return e.setValue(Ch,!0)}(sh.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const s=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===ip.SUCCESS?e():t(r.error??new Error("BatchSpanProcessor: span export failed"))});let o=null;for(let e=0,t=r.length;e<t;e++){const t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(o??=[],o.push(t.resource.waitForAsyncAttributes()))}null===o?s():Promise.all(o).then(s,e=>{xh(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,xh(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer)}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class $p extends Qp{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){!0!==e?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(e=>{xh(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{xh(e)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}class ed{generateTraceId=nd(16);generateSpanId=nd(8)}const td=Array(32);function nd(e){return function(){for(let t=0;t<2*e;t++)td[t]=Math.floor(16*Math.random())+48,td[t]>=58&&(td[t]+=39);return String.fromCharCode.apply(null,td.slice(0,2*e))}}class rd{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,t,n,r){const s=function(e){const t={sampler:Jp()},n=Kp(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new ed,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,t={},n=sh.active()){t.root&&(n=wh.deleteSpan(n));const r=wh.getSpan(n);if(Sh(n)){oh.debug("Instrumentation suppressed, returning Noop Span");return wh.wrapSpanContext(Du)}const s=r?.spanContext(),o=this._idGenerator.generateSpanId();let i,a,l;s&&wh.isSpanContextValid(s)?(a=s.traceId,l=s.traceState,i=s):a=this._idGenerator.generateTraceId();const c=t.kind??Qu.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:Eh(e.attributes)})),h=Eh(t.attributes),p=this._sampler.shouldSample(n,a,e,c,h,u);l=p.traceState??l;const d={traceId:a,spanId:o,traceFlags:p.decision===qu.RECORD_AND_SAMPLED?tu.SAMPLED:tu.NONE,traceState:l};if(p.decision===qu.NOT_RECORD){oh.debug("Recording is off, propagating context in a non-recording span");return wh.wrapSpanContext(d)}const f=Eh(Object.assign(h,p.attributes));return new zp({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:d,name:e,kind:c,links:u,parentSpanContext:i,attributes:f,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,t,n,r){let s,o,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(s=t,i=n):(s=t,o=n,i=r);const a=o??sh.active(),l=this.startSpan(e,s,a),c=wh.setSpan(a,l);return sh.with(c,i,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class sd{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{xh(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(const t of this._spanProcessors)t.onEnd(e)}shutdown(){const e=[];for(const t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}var od,id;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(od||(od={}));class ad{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift();const n=new WeakMap;for(;e.length>0;)t=Tp(t,e.shift(),0,n);return t}({},Kp(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??qp,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??Zp({[Vh]:"unknown_service",[Gh]:Jh[Gh],[Wh]:Jh[Wh],[Hh]:Jh[Hh]}),this._config=Object.assign({},t,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new sd(n)}getTracer(e,t,n){const r=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new rd({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r;const s=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${e} ms`)),r=od.timeout},e);t.forceFlush().then(()=>{clearTimeout(s),r!==od.timeout&&(r=od.resolved,n(r))}).catch(e=>{clearTimeout(s),r=od.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{const r=t.filter(e=>e!==od.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class ld{_enabled=!1;_currentContext=ru;_bindFunction(e=ru,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):t}disable(){return this._currentContext=ru,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=ru),this}with(e,t,n,...r){const s=this._currentContext;this._currentContext=e||ru;try{return t.call(n,...r)}finally{this._currentContext=s}}}class cd extends ad{constructor(e={}){super(e)}register(e={}){var t;wh.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?vh.setGlobalPropagator(t):vh.setGlobalPropagator(new ap({propagators:[new gp,new Ah]}))),function(e){if(null!==e){if(void 0===e){const e=new ld;return e.enable(),void sh.setGlobalContextManager(e)}e.enable(),sh.setGlobalContextManager(e)}}(e.contextManager)}}!function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"}(id||(id={}));let ud;function hd(e,t){return t in e}function pd(e,t,n,r=!0){if(hd(n,t)&&"number"==typeof n[t]&&(!r||0!==n[t]))return e.addEvent(t,n[t])}function dd(e,t,n=!1,r,s){if(void 0===r&&(r=0!==t[id.START_TIME]),n||(pd(e,id.FETCH_START,t,r),pd(e,id.DOMAIN_LOOKUP_START,t,r),pd(e,id.DOMAIN_LOOKUP_END,t,r),pd(e,id.CONNECT_START,t,r),pd(e,id.SECURE_CONNECTION_START,t,r),pd(e,id.CONNECT_END,t,r),pd(e,id.REQUEST_START,t,r),pd(e,id.RESPONSE_START,t,r),pd(e,id.RESPONSE_END,t,r)),!s){const n=t[id.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[id.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function fd(){return"undefined"!=typeof location?location.origin:void 0}function md(e,t,n,r,s=new WeakSet,o){const i=gd(e),a=function(e,t,n,r,s,o){const i=np(t),a=np(n);let l=r.filter(t=>{const n=np(tp(t[id.FETCH_START])),r=np(tp(t[id.RESPONSE_END]));return t.initiatorType.toLowerCase()===(o||"xmlhttprequest")&&t.name===e&&n>=i&&r<=a});l.length>0&&(l=l.filter(e=>!s.has(e)));return l}(e=i.toString(),t,n,r,s,o);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const l=function(e){return e.slice().sort((e,t)=>{const n=e[id.FETCH_START],r=t[id.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(i.origin!==fd()&&l.length>1){let e=l[0],t=function(e,t,n){const r=np(n),s=np(tp(t));let o,i=e[1];const a=e.length;for(let t=1;t<a;t++){const n=e[t],a=np(tp(n[id.FETCH_START])),l=r-np(tp(n[id.RESPONSE_END]));a>=s&&(!o||l<o)&&(o=l,i=n)}return i}(l,e[id.RESPONSE_END],n);const r=e[id.RESPONSE_END];return t[id.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function gd(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(ud||(ud=document.createElement("a")),ud);return t.href=e,t}function yd(e,t){let n=t||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return gd(e).origin===fd()||n.some(t=>Lp(e,t))}class vd{emit(e){}}const bd=new vd;const wd=new class{getLogger(e,t,n){return new vd}};class Cd{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):bd}}class Sd{getLogger(e,t,n){var r;return null!==(r=this.getDelegateLogger(e,t,n))&&void 0!==r?r:new Cd(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:wd}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}}const _d="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Id=Symbol.for("io.opentelemetry.js.api.logs"),Ad=_d;class Ed{constructor(){this._proxyLoggerProvider=new Sd}static getInstance(){return this._instance||(this._instance=new Ed),this._instance}setGlobalLoggerProvider(e){return Ad[Id]?this.getLoggerProvider():(Ad[Id]=(t=1,n=e,r=wd,e=>e===t?n:r),this._proxyLoggerProvider.setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=Ad[Id])||void 0===e?void 0:e.call(Ad,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete Ad[Id],this._proxyLoggerProvider=new Sd}}const kd=Ed.getInstance();let Td=console.error.bind(console);function Od(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const Rd=(e,t,n)=>{if(!e||!e[t])return void Td("no original function "+String(t)+" to wrap");if(!n)return Td("no wrapper function"),void Td((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void Td("original object and wrapper must be functions");const s=n(r,t);return Od(s,"__original",r),Od(s,"__unwrap",()=>{e[t]===s&&Od(e,t,r)}),Od(s,"__wrapped",!0),Od(e,t,s),s},xd=(e,t,n)=>{if(!e)return Td("must provide one or more modules to patch"),void Td((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Rd(e,t,n)})}):Td("must provide one or more functions to wrap on modules")},Nd=(e,t)=>{if(!e||!e[t])return Td("no function to unwrap."),void Td((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():Td("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},Md=(e,t)=>{if(!e)return Td("must provide one or more modules to patch"),void Td((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Nd(e,t)})}):Td("must provide one or more functions to unwrap on modules")};class Ld{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=oh.createComponentLogger({namespace:e}),this._tracer=wh.getTracer(e,t),this._meter=lh.getMeter(e,t),this._logger=kd.getLogger(e,t),this._updateMetricInstruments()}_wrap=Rd;_unwrap=Nd;_massWrap=xd;_massUnwrap=Md;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class Dd extends Ld{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}}function Pd(e,t,n){let r,s;try{s=e()}catch(e){r=e}finally{return t(r,s),s}}function Fd(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var Bd,Ud;function Zd(e,t){let n=Bd.OLD;const r=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of r??[]){if(t.toLowerCase()===e+"/dup"){n=Bd.DUPLICATE;break}t.toLowerCase()===e&&(n=Bd.STABLE)}return n}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(Bd||(Bd={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(Ud||(Ud={}));var jd;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(jd||(jd={}));const zd={"first-paint":jd.FIRST_PAINT,"first-contentful-paint":jd.FIRST_CONTENTFUL_PAINT};class Vd extends Dd{component="document-load";version="1";moduleName=this.component;constructor(e={}){super("@opentelemetry/instrumentation-document-load","0.48.0",e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){const t=Mh.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===dp),t=(()=>{const e={},t=Mh.getEntriesByType?.("navigation")[0];if(t)Object.values(id).forEach(n=>{if(hd(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}});else{const t=Mh.timing;t&&Object.values(id).forEach(n=>{if(hd(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}})}return e})(),n=e&&e.content||"";sh.with(vh.extract(ru,{traceparent:n}),()=>{const e=this._startSpan(Ud.DOCUMENT_LOAD,id.FETCH_START,t);e&&(sh.with(wh.setSpan(sh.active(),e),()=>{const e=this._startSpan(Ud.DOCUMENT_FETCH,id.FETCH_START,t);e&&(e.setAttribute(Lh,location.href),sh.with(wh.setSpan(sh.active(),e),()=>{dd(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,id.RESPONSE_END,t)}))}),e.setAttribute(Lh,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(pd(e,id.FETCH_START,t),pd(e,id.UNLOAD_EVENT_START,t),pd(e,id.UNLOAD_EVENT_END,t),pd(e,id.DOM_INTERACTIVE,t),pd(e,id.DOM_CONTENT_LOADED_EVENT_START,t),pd(e,id.DOM_CONTENT_LOADED_EVENT_END,t),pd(e,id.DOM_COMPLETE,t),pd(e,id.LOAD_EVENT_START,t),pd(e,id.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=Mh.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:n})=>{hd(zd,t)&&e.addEvent(zd[t],n)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,id.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(hd(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){const n=this._startSpan(Ud.RESOURCE_FETCH,id.FETCH_START,e,t);n&&(n.setAttribute(Lh,e.name),dd(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,id.RESPONSE_END,e))}_startSpan(e,t,n,r){if(hd(n,t)&&"number"==typeof n[t]){return this.tracer.startSpan(e,{startTime:n[t]},r?wh.setSpan(sh.active(),r):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&Pd(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,n){n&&Pd(()=>n(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const Gd="OT_ZONE_CONTEXT";class Wd{_enabled=!1;_zoneCounter=0;_activeContextFromZone(e){return e&&e.get(Gd)||ru}_bindFunction(e,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindListener(e,t){const n=t;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"==typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),"function"==typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),t}_createZoneName(){this._zoneCounter++;const e=Math.random();return`${this._zoneCounter}-${e}`}_createZone(e,t){return Zone.current.fork({name:e,properties:{[Gd]:t}})}_getActiveZone(){return Zone.current}_patchAddEventListener(e,t,n){const r=this;return function(s,o,i){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[s];void 0===a&&(a=new WeakMap,e.__ot_listeners[s]=a);const l=r.bind(n,o);return a.set(o,l),t.call(this,s,l,i)}}_patchRemoveEventListener(e,t){return function(n,r){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[n])return t.call(this,n,r);const s=e.__ot_listeners[n],o=s.get(r);return s.delete(r),t.call(this,n,o||r)}}active(){if(!this._enabled)return ru;const e=this._getActiveZone(),t=this._activeContextFromZone(e);return t||ru}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):("object"==typeof(n=t)&&null!==n&&"addEventListener"in n&&"function"==typeof n.addEventListener&&"removeEventListener"in n&&"function"==typeof n.removeEventListener&&this._bindListener(e,t),t);var n}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){const s=this._createZoneName();return this._createZone(s,e).run(t,n,r)}}
|
|
15
|
+
***************************************************************************** */function tc(e,t,n,r){return new(n||(n=Promise))(function(t,s){function o(e){try{a(r.next(e))}catch(e){s(e)}}function i(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(o,i)}a((r=r.apply(e,[])).next())})}for(var nc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),sc=0;sc<64;sc++)rc[nc.charCodeAt(sc)]=sc;const oc=new Map;const ic=(e,t,n)=>{if(!e||!cc(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=oc.get(e);return n||(n=new Map,oc.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let s=r.indexOf(e);return-1===s&&(s=r.length,r.push(e)),s};function ac(e,t,n){if(e instanceof Array)return e.map(e=>ac(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,s="";for(t=0;t<r;t+=3)s+=nc[n[t]>>2],s+=nc[(3&n[t])<<4|n[t+1]>>4],s+=nc[(15&n[t+1])<<2|n[t+2]>>6],s+=nc[63&n[t+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[ac(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[ac(e.data,t,n),e.width,e.height]}}if(cc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ic(e,t,n)}}return e}const lc=(e,t,n)=>[...e].map(e=>ac(e,t,n)),cc=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function uc(e,t,n){const r=[];try{const s=pl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r,...s){return ml(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...s])}});r.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function hc(e,t,n,r,s,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const o of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const l=pl(e,o,function(e){return function(...a){const l=e.apply(this,a);if(ic(l,i,this),!ml(this.canvas,r,s,!0)){const e=lc([...a],i,this),r={type:t,property:o,args:e};n(this.canvas,r)}return l}});a.push(l)}catch(r){const s=hl(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});a.push(s)}return a}var pc=null;try{var dc="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");pc=dc.Worker}catch(e){}function fc(e,t,n){var r=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),s=r.indexOf("\n",10)+1,o=r.substring(s)+"";return function(e){return new pc(o,Object.assign({},e,{eval:!0}))}}function mc(e,t,n){var r=function(e){return atob(e)}(e),s=r.indexOf("\n",10)+1,o=r.substring(s)+"",i=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(i)}var gc="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var yc=function(e){return gc?fc(e):function(e){var t;return function(n){return t=t||mc(e),new Worker(t,n)}}(e)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class vc{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,s,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,s){const o=uc(t,n,r),i=new Map,a=new yc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:s,height:o}=e.data;this.mutationCb({id:t,type:El["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{ml(t,n,r,!0)||e.push(t)}),e})().forEach(e=>tc(this,0,void 0,function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[r])}))),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=uc(e,t,n),s=function(e,t,n,r){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=pl(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return ml(this.canvas,n,r,!0)||setTimeout(()=>{const n=lc([...o],t,this);e(this.canvas,{type:El["2D"],property:i,args:n})},0),s.apply(this,o)}});s.push(o)}catch(n){const r=hl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:El["2D"],property:i,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){const s=[];return s.push(...hc(t.WebGLRenderingContext.prototype,El.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...hc(t.WebGL2RenderingContext.prototype,El.WebGL2,e,n,r,0,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),s(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(e,["type"]);return t}),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:r}),this.pendingCanvasMutations.delete(e)}}class bc{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Sl,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:Fa(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function wc(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Cc,Sc,_c,Ic=!1;const Ac=new Ba;function Ec(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:d,maskTextFn:f,hooks:m,packFn:g,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,userTriggeredOnInput:S=!1,collectFonts:_=!1,inlineImages:I=!1,plugins:A,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:k=new Set([])}=e,T=!C||window.parent===window;let O=!1;if(!T)try{window.parent.document,O=!1}catch(e){O=!0}if(T&&!t)throw new Error("emit function is required");void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),Ac.reset();const R=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},x=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let N;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let M=0;const L=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return g&&(e=g(e)),e};Cc=(e,s)=>{var o;if(!(null===(o=Pl[0])||void 0===o?void 0:o.isFrozen())||e.type===_l.FullSnapshot||e.type===_l.IncrementalSnapshot&&e.data.source===Il.Mutation||Pl.forEach(e=>e.unfreeze()),T)null==t||t(L(e),s);else if(O){const t={type:"rrweb",event:L(e),isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===_l.FullSnapshot)N=e,M=0;else if(e.type===_l.IncrementalSnapshot){if(e.data.source===Il.Mutation&&e.data.isAttachIframe)return;M++;const t=r&&M>=r,s=n&&e.timestamp-N.timestamp>n;(t||s)&&Sc(!0)}};const D=e=>{Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Mutation},e)}))},P=e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Scroll},e)})),F=e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.CanvasMutation},e)})),B=new bc({mutationCb:D,adoptedStyleSheetCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.AdoptedStyleSheet},e)}))}),U=new $l({mirror:Ac,mutationCb:D,stylesheetManager:B,recordCrossOriginIframes:C,wrappedEmit:Cc});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:Ac,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});_c=new vc({recordCanvas:w,mutationCb:F,win:window,blockClass:s,blockSelector:o,mirror:Ac,sampling:y.canvas,dataURLOptions:v});const Z=new ec({mutationCb:D,scrollCb:P,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:R,dataURLOptions:v,maskTextFn:f,maskInputFn:d,recordCanvas:w,inlineImages:I,sampling:y,slimDOMOptions:x,iframeManager:U,stylesheetManager:B,canvasManager:_c,keepIframeSrcFn:E},mirror:Ac});Sc=(e=!1)=>{var t,n,r,i,u,h;Cc(wc({type:_l.Meta,data:{href:window.location.href,width:fl(),height:dl()}}),e),B.reset(),Pl.forEach(e=>e.lock());const p=function(e,t){var n=t||{},r=n.mirror,s=void 0===r?new Ba:r,o=n.blockClass,i=void 0===o?"rr-block":o,a=n.blockSelector,l=void 0===a?null:a,c=n.maskTextClass,u=void 0===c?"rr-mask":c,h=n.maskTextSelector,p=void 0===h?null:h,d=n.inlineStylesheet,f=void 0===d||d,m=n.inlineImages,g=void 0!==m&&m,y=n.recordCanvas,v=void 0!==y&&y,b=n.maskAllInputs,w=void 0!==b&&b,C=n.maskTextFn,S=n.maskInputFn,_=n.slimDOM,I=void 0!==_&&_,A=n.dataURLOptions,E=n.preserveWhiteSpace,k=n.onSerialize,T=n.onIframeLoad,O=n.iframeLoadTimeout,R=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,N=n.keepIframeSrcFn;return il(e,{doc:e,mirror:s,blockClass:i,blockSelector:l,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===I,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===I?{}:I,dataURLOptions:A,inlineImages:g,recordCanvas:v,preserveWhiteSpace:E,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:O,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}(document,{mirror:Ac,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:R,maskTextFn:f,slimDOM:x,dataURLOptions:v,recordCanvas:w,inlineImages:I,onSerialize:e=>{bl(e,Ac)&&U.addIframe(e),wl(e,Ac)&&B.trackLinkElement(e),Cl(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{U.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!p)return console.warn("Failed to snapshot the document");Cc(wc({type:_l.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),Pl.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,Ac.getId(document))};try{const e=[];e.push(al("DOMContentLoaded",()=>{Cc(wc({type:_l.DomContentLoaded,data:{}}))}));const t=e=>{var t;return ql({mutationCb:D,mousemoveCb:(e,t)=>Cc(wc({type:_l.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.MouseInteraction},e)})),scrollCb:P,viewportResizeCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.ViewportResize},e)})),inputCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Input},e)})),mediaInteractionCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.MediaInteraction},e)})),styleSheetRuleCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.StyleSheetRule},e)})),styleDeclarationCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.StyleDeclaration},e)})),canvasMutationCb:F,fontCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Font},e)})),selectionCb:e=>{Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Selection},e)}))},blockClass:s,ignoreClass:i,maskTextClass:a,maskTextSelector:l,maskInputOptions:R,inlineStylesheet:c,sampling:y,recordCanvas:w,inlineImages:I,userTriggeredOnInput:S,collectFonts:_,doc:e,maskInputFn:d,maskTextFn:f,keepIframeSrcFn:E,blockSelector:o,slimDOMOptions:x,dataURLOptions:v,mirror:Ac,iframeManager:U,stylesheetManager:B,shadowDomManager:Z,canvasManager:_c,ignoreCSSAttributes:k,plugins:(null===(t=null==A?void 0:A.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Cc(wc({type:_l.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},m)};U.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{Sc(),e.push(t(document)),Ic=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(al("load",()=>{Cc(wc({type:_l.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),Ic=!1}}catch(e){console.warn(e)}}Ec.addCustomEvent=(e,t)=>{if(!Ic)throw new Error("please add custom event after start recording");Cc(wc({type:_l.Custom,data:{tag:e,payload:t}}))},Ec.freezePage=()=>{Pl.forEach(e=>e.freeze())},Ec.takeFullSnapshot=e=>{if(!Ic)throw new Error("please take full snapshot after start recording");Sc(e)},Ec.mirror=Ac;const kc=1e3;class Tc{constructor(e,t){this.events=[],this.stopRecording=void 0,this.saveInterval=null,this.isSaving=!1,this.isConfigured=!1,this.sessionId=t,this.config=e,this.events=[],this.save=this.save.bind(this),this.configure=this.configure.bind(this),this.handleUnload=this.handleUnload.bind(this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.setupEventListeners()}setupEventListeners(){window.addEventListener("beforeunload",this.handleUnload),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("pagehide",this.handleUnload)}handleUnload(){this.save(!0)}handleVisibilityChange(){"hidden"===document.visibilityState&&this.save()}configure(){var e;if(this.isConfigured)console.warn("MonoscopeReplay already configured");else try{this.stopRecording=Ec({emit:e=>{this.events.push(e),this.events.length>=50&&this.save()},blockClass:"rr-block",maskAllInputs:!0,maskInputOptions:{password:!0,email:!0,tel:!0},maskTextClass:"rr-mask",checkoutEveryNms:15e3,sampling:{mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!1,DblClick:!0,Focus:!1,Blur:!1,TouchStart:!0,TouchEnd:!1},mousemove:!0,scroll:150,media:800,input:"last"},plugins:[(e={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:2}},{name:"rrweb/console@1",observer:Na,options:e})]}),this.saveInterval=setInterval(()=>{this.save()},1e4),this.isConfigured=!0,console.log("MonoscopeReplay configured successfully")}catch(e){throw console.error("Failed to configure MonoscopeReplay:",e),e}}async save(e=!1){if(this.isSaving&&!e)return;if(0===this.events.length)return;this.events.length>kc&&(console.warn("Event queue exceeded 1000, dropping oldest events"),this.events=this.events.slice(-1e3)),this.isSaving=!0;const{replayEventsBaseUrl:t,projectId:n}=this.config;let r=t||"https://app.apitoolkit.io";r=`${r}/rrweb/${n}`;const s=[...this.events];this.events=[];const o={events:s,sessionId:this.sessionId,timestamp:(new Date).toISOString(),eventCount:s.length};try{if(e&&navigator.sendBeacon){const e=new Blob([JSON.stringify(o)],{type:"application/json"});navigator.sendBeacon(r,e)||console.warn("sendBeacon failed, events may be lost")}else{const e=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!e.ok)throw console.log(e),new Error(`Failed to save replay events: ${e.status} ${e.statusText}`);console.log(`Successfully saved ${s.length} replay events`)}}catch(e){console.log(e),console.error("Failed to save replay events:",e),this.events=[...s,...this.events],this.events.length>kc&&(this.events=this.events.slice(-1e3))}finally{this.isSaving=!1}}stop(){this.save(!0),this.stopRecording&&(this.stopRecording(),this.stopRecording=void 0),this.saveInterval&&(clearInterval(this.saveInterval),this.saveInterval=null),window.removeEventListener("beforeunload",this.handleUnload),window.removeEventListener("pagehide",this.handleUnload),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.isConfigured=!1,console.log("MonoscopeReplay stopped")}getEventCount(){return this.events.length}getSessionId(){return this.sessionId}isRecording(){return this.isConfigured&&null!==this.stopRecording}}var Oc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Rc="1.9.0",xc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var Nc=function(e){var t=new Set([e]),n=new Set,r=e.match(xc);if(!r)return function(){return!1};var s=+r[1],o=+r[2],i=+r[3];if(null!=r[4])return function(t){return t===e};function a(e){return n.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(xc);if(!r)return a(e);var c=+r[1],u=+r[2],h=+r[3];return null!=r[4]||s!==c?a(e):0===s?o===u&&i<=h?l(e):a(e):o<=u?l(e):a(e)}}(Rc),Mc=Rc.split(".")[0],Lc=Symbol.for("opentelemetry.js.api."+Mc),Dc=Oc;function Pc(e,t,n,r){var s;void 0===r&&(r=!1);var o=Dc[Lc]=null!==(s=Dc[Lc])&&void 0!==s?s:{version:Rc};if(!r&&o[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(o.version!==Rc){i=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+e+" does not match previously registered API v"+Rc);return n.error(i.stack||i.message),!1}return o[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Rc+"."),!0}function Fc(e){var t,n,r=null===(t=Dc[Lc])||void 0===t?void 0:t.version;if(r&&Nc(r))return null===(n=Dc[Lc])||void 0===n?void 0:n[e]}function Bc(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Rc+".");var n=Dc[Lc];n&&delete n[e]}var Uc,Zc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},jc=function(e,t,n){if(n||2===arguments.length)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))},zc=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vc("verbose",this._namespace,e)},e}();function Vc(e,t,n){var r=Fc("diag");if(r)return n.unshift(t),r[e].apply(r,jc([],Zc(n),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Uc||(Uc={}));var Gc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},Wc=function(e,t,n){if(n||2===arguments.length)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))},Hc=function(){function e(){function e(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=Fc("diag");if(r)return r[e].apply(r,Wc([],Gc(t),!1))}}var t=this;t.setLogger=function(e,n){var r,s,o;if(void 0===n&&(n={logLevel:Uc.INFO}),e===t){var i=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(r=i.stack)&&void 0!==r?r:i.message),!1}"number"==typeof n&&(n={logLevel:n});var a=Fc("diag"),l=function(e,t){function n(n,r){var s=t[n];return"function"==typeof s&&e>=r?s.bind(t):function(){}}return e<Uc.NONE?e=Uc.NONE:e>Uc.ALL&&(e=Uc.ALL),t=t||{},{error:n("error",Uc.ERROR),warn:n("warn",Uc.WARN),info:n("info",Uc.INFO),debug:n("debug",Uc.DEBUG),verbose:n("verbose",Uc.VERBOSE)}}(null!==(s=n.logLevel)&&void 0!==s?s:Uc.INFO,e);if(a&&!n.suppressOverrideMessage){var c=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+c),l.warn("Current logger will overwrite one already registered from "+c)}return Pc("diag",l,t,!0)},t.disable=function(){Bc("diag",t)},t.createComponentLogger=function(e){return new zc(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),Yc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},Kc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Jc=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Yc(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];var o=new e(this._entries);try{for(var i=Kc(r),a=i.next();!a.done;a=i.next()){var l=a.value;o._entries.delete(l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o},e.prototype.clear=function(){return new e},e}(),Xc=Symbol("BaggageEntryMetadata"),qc=Hc.instance();function Qc(e){return void 0===e&&(e={}),new Jc(new Map(Object.entries(e)))}function $c(e){return Symbol.for(e)}var eu,tu,nu=function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var s=new e(n._currentContext);return s._currentContext.set(t,r),s},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}},ru=new nu,su=(eu=function(e,t){return eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},eu(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}eu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ou=function(){function e(){}return e.prototype.createGauge=function(e,t){return yu},e.prototype.createHistogram=function(e,t){return vu},e.prototype.createCounter=function(e,t){return gu},e.prototype.createUpDownCounter=function(e,t){return bu},e.prototype.createObservableGauge=function(e,t){return Cu},e.prototype.createObservableCounter=function(e,t){return wu},e.prototype.createObservableUpDownCounter=function(e,t){return Su},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),iu=function(){},au=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t.prototype.add=function(e,t){},t}(iu),lu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t.prototype.add=function(e,t){},t}(iu),cu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t.prototype.record=function(e,t){},t}(iu),uu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t.prototype.record=function(e,t){},t}(iu),hu=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),pu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t}(hu),du=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t}(hu),fu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return su(t,e),t}(hu),mu=new ou,gu=new au,yu=new cu,vu=new uu,bu=new lu,wu=new pu,Cu=new du,Su=new fu,_u={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},Iu={set:function(e,t,n){null!=e&&(e[t]=n)}},Au=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},Eu=function(e,t,n){if(n||2===arguments.length)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))},ku=function(){function e(){}return e.prototype.active=function(){return ru},e.prototype.with=function(e,t,n){for(var r=[],s=3;s<arguments.length;s++)r[s-3]=arguments[s];return t.call.apply(t,Eu([n],Au(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Tu=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},Ou=function(e,t,n){if(n||2===arguments.length)for(var r,s=0,o=t.length;s<o;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))},Ru="context",xu=new ku,Nu=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return Pc(Ru,e,Hc.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,s=[],o=3;o<arguments.length;o++)s[o-3]=arguments[o];return(r=this._getContextManager()).with.apply(r,Ou([e,t,n],Tu(s),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Fc(Ru)||xu},e.prototype.disable=function(){this._getContextManager().disable(),Bc(Ru,Hc.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(tu||(tu={}));var Mu="0000000000000000",Lu="00000000000000000000000000000000",Du={traceId:Lu,spanId:Mu,traceFlags:tu.NONE},Pu=function(){function e(e){void 0===e&&(e=Du),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),Fu=$c("OpenTelemetry Context Key SPAN");function Bu(e){return e.getValue(Fu)||void 0}function Uu(){return Bu(Nu.getInstance().active())}function Zu(e,t){return e.setValue(Fu,t)}function ju(e){return e.deleteValue(Fu)}function zu(e,t){return Zu(e,new Pu(t))}function Vu(e){var t;return null===(t=Bu(e))||void 0===t?void 0:t.spanContext()}var Gu=/^([0-9a-f]{32})$/i,Wu=/^[0-9a-f]{16}$/i;function Hu(e){return Gu.test(e)&&e!==Lu}function Yu(e){return Hu(e.traceId)&&(t=e.spanId,Wu.test(t)&&t!==Mu);var t}function Ku(e){return new Pu(e)}var Ju=Nu.getInstance(),Xu=function(){function e(){}return e.prototype.startSpan=function(e,t,n){if(void 0===n&&(n=Ju.active()),Boolean(null==t?void 0:t.root))return new Pu;var r,s=n&&Vu(n);return"object"==typeof(r=s)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&Yu(s)?new Pu(s):new Pu},e.prototype.startActiveSpan=function(e,t,n,r){var s,o,i;if(!(arguments.length<2)){2===arguments.length?i=t:3===arguments.length?(s=t,i=n):(s=t,o=n,i=r);var a=null!=o?o:Ju.active(),l=this.startSpan(e,s,a),c=Zu(a,l);return Ju.with(c,i,void 0,l)}},e}();var qu,Qu,$u,eh=new Xu,th=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):eh},e}(),nh=new(function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new Xu},e}()),rh=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new th(this,e,t,n)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:nh},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(qu||(qu={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(Qu||(Qu={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}($u||($u={}));var sh=Nu.getInstance(),oh=Hc.instance(),ih=new(function(){function e(){}return e.prototype.getMeter=function(e,t,n){return mu},e}()),ah="metrics",lh=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return Pc(ah,e,Hc.instance())},e.prototype.getMeterProvider=function(){return Fc(ah)||ih},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){Bc(ah,Hc.instance())},e}().getInstance(),ch=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),uh=$c("OpenTelemetry Baggage Key");function hh(e){return e.getValue(uh)||void 0}function ph(){return hh(Nu.getInstance().active())}function dh(e,t){return e.setValue(uh,t)}function fh(e){return e.deleteValue(uh)}var mh="propagation",gh=new ch,yh=function(){function e(){this.createBaggage=Qc,this.getBaggage=hh,this.getActiveBaggage=ph,this.setBaggage=dh,this.deleteBaggage=fh}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return Pc(mh,e,Hc.instance())},e.prototype.inject=function(e,t,n){return void 0===n&&(n=Iu),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return void 0===n&&(n=_u),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){Bc(mh,Hc.instance())},e.prototype._getGlobalPropagator=function(){return Fc(mh)||gh},e}(),vh=yh.getInstance(),bh="trace",wh=function(){function e(){this._proxyTracerProvider=new rh,this.wrapSpanContext=Ku,this.isSpanContextValid=Yu,this.deleteSpan=ju,this.getSpan=Bu,this.getActiveSpan=Uu,this.getSpanContext=Vu,this.setSpan=Zu,this.setSpanContext=zu}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=Pc(bh,this._proxyTracerProvider,Hc.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Fc(bh)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Bc(bh,Hc.instance()),this._proxyTracerProvider=new rh},e}().getInstance();const Ch=$c("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Sh(e){return!0===e.getValue(Ch)}const _h="baggage";function Ih(e){const t=e.split(";");if(t.length<=0)return;const n=t.shift();if(!n)return;const r=n.indexOf("=");if(r<=0)return;const s=decodeURIComponent(n.substring(0,r).trim()),o=decodeURIComponent(n.substring(r+1).trim());let i;var a;return t.length>0&&("string"!=typeof(a=t.join(";"))&&(qc.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),i={__TYPE__:Xc,toString:function(){return a}}),{key:s,value:o,metadata:i}}class Ah{inject(e,t,n){const r=vh.getBaggage(e);if(!r||Sh(e))return;const s=function(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(n+=";"+t.metadata.toString()),n})}(r).filter(e=>e.length<=4096).slice(0,180),o=function(e){return e.reduce((e,t)=>{const n=`${e}${""!==e?",":""}${t}`;return n.length>8192?e:n},"")}(s);o.length>0&&n.set(t,_h,o)}extract(e,t,n){const r=n.get(t,_h),s=Array.isArray(r)?r.join(","):r;if(!s)return e;const o={};if(0===s.length)return e;return s.split(",").forEach(e=>{const t=Ih(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),o[t.key]=e}}),0===Object.entries(o).length?e:vh.setBaggage(e,vh.createBaggage(o))}fields(){return[_h]}}function Eh(e){const t={};if("object"!=typeof e||null==e)return t;for(const[n,r]of Object.entries(e))kh(n)?Th(r)?Array.isArray(r)?t[n]=r.slice():t[n]=r:oh.warn(`Invalid attribute value set for key: ${n}`):oh.warn(`Invalid attribute key: ${n}`);return t}function kh(e){return"string"==typeof e&&e.length>0}function Th(e){return null==e||(Array.isArray(e)?function(e){let t;for(const n of e)if(null!=n){if(!t){if(Oh(n)){t=typeof n;continue}return!1}if(typeof n!==t)return!1}return!0}(e):Oh(e))}function Oh(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}let Rh=e=>{oh.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let n=e;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;const r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}(e))}(e))};function xh(e){try{Rh(e)}catch{}}const Nh="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Mh=performance,Lh="http.url",Dh="error.type",Ph="exception.message",Fh="exception.type",Bh="http.request.method",Uh="http.request.method_original",Zh="http.response.status_code",jh="server.address",zh="server.port",Vh="service.name",Gh="telemetry.sdk.language",Wh="telemetry.sdk.name",Hh="telemetry.sdk.version",Yh="url.full",Kh="process.runtime.name",Jh={[Wh]:"opentelemetry",[Kh]:"browser",[Gh]:"webjs",[Hh]:"2.0.1"};const Xh=Math.pow(10,6),qh=Math.pow(10,9);function Qh(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Xh)]}function $h(){let e=Mh.timeOrigin;if("number"!=typeof e){const t=Mh;e=t.timing&&t.timing.fetchStart}return e}function ep(e){return op(Qh($h()),Qh("number"==typeof e?e:Mh.now()))}function tp(e){if(rp(e))return e;if("number"==typeof e)return e<$h()?ep(e):Qh(e);if(e instanceof Date)return Qh(e.getTime());throw TypeError("Invalid input type")}function np(e){return e[0]*qh+e[1]}function rp(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function sp(e){return rp(e)||"number"==typeof e||e instanceof Date}function op(e,t){const n=[e[0]+t[0],e[1]+t[1]];return n[1]>=qh&&(n[1]-=qh,n[0]+=1),n}var ip;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(ip||(ip={}));class ap{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>"function"==typeof e.fields?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(const r of this._propagators)try{r.inject(e,t,n)}catch(e){oh.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){oh.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const lp="[_0-9a-z-*/]",cp=new RegExp(`^(?:${`[a-z]${lp}{0,255}`}|${`[a-z0-9]${lp}{0,240}@[a-z]${lp}{0,13}`})$`),up=/^[ -~]{0,255}[!-~]$/,hp=/,|=/;class pp{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){const t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){e.length>512||(this._internalState=e.split(",").reverse().reduce((e,t)=>{const n=t.trim(),r=n.indexOf("=");if(-1!==r){const s=n.slice(0,r),o=n.slice(r+1,t.length);(function(e){return cp.test(e)})(s)&&function(e){return up.test(e)&&!hp.test(e)}(o)&&e.set(s,o)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new pp;return e._internalState=new Map(this._internalState),e}}const dp="traceparent",fp="tracestate",mp=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class gp{inject(e,t,n){const r=wh.getSpanContext(e);if(!r||Sh(e)||!Yu(r))return;const s=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||tu.NONE).toString(16)}`;n.set(t,dp,s),r.traceState&&n.set(t,fp,r.traceState.serialize())}extract(e,t,n){const r=n.get(t,dp);if(!r)return e;const s=Array.isArray(r)?r[0]:r;if("string"!=typeof s)return e;const o=function(e){const t=mp.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}(s);if(!o)return e;o.isRemote=!0;const i=n.get(t,fp);if(i){const e=Array.isArray(i)?i.join(","):i;o.traceState=new pp("string"==typeof e?e:void 0)}return wh.setSpanContext(e,o)}fields(){return[dp,fp]}}const yp="[object Null]",vp="[object Undefined]",bp=Function.prototype.toString,wp=bp.call(Object),Cp=Object.getPrototypeOf,Sp=Object.prototype,_p=Sp.hasOwnProperty,Ip=Symbol?Symbol.toStringTag:void 0,Ap=Sp.toString;function Ep(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?vp:yp;return Ip&&Ip in Object(e)?function(e){const t=_p.call(e,Ip),n=e[Ip];let r=!1;try{e[Ip]=void 0,r=!0}catch(e){}const s=Ap.call(e);r&&(t?e[Ip]=n:delete e[Ip]);return s}(e):function(e){return Ap.call(e)}(e)}(e))return!1;const t=Cp(e);if(null===t)return!0;const n=_p.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&bp.call(n)===wp}function kp(e){return Rp(e)?e.slice():e}function Tp(e,t,n=0,r){let s;if(!(n>20)){if(n++,Mp(e)||Mp(t)||xp(t))s=kp(t);else if(Rp(e)){if(s=e.slice(),Rp(t))for(let e=0,n=t.length;e<n;e++)s.push(kp(t[e]));else if(Np(t)){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const r=e[n];s[r]=kp(t[r])}}}else if(Np(e))if(Np(t)){if(!function(e,t){if(!Ep(e)||!Ep(t))return!1;return!0}(e,t))return t;s=Object.assign({},e);const o=Object.keys(t);for(let i=0,a=o.length;i<a;i++){const a=o[i],l=t[a];if(Mp(l))void 0===l?delete s[a]:s[a]=l;else{const o=s[a],i=l;if(Op(e,a,r)||Op(t,a,r))delete s[a];else{if(Np(o)&&Np(i)){const n=r.get(o)||[],s=r.get(i)||[];n.push({obj:e,key:a}),s.push({obj:t,key:a}),r.set(o,n),r.set(i,s)}s[a]=Tp(s[a],l,n,r)}}}}else s=t;return s}}function Op(e,t,n){const r=n.get(e[t])||[];for(let n=0,s=r.length;n<s;n++){const s=r[n];if(s.key===t&&s.obj===e)return!0}return!1}function Rp(e){return Array.isArray(e)}function xp(e){return"function"==typeof e}function Np(e){return!Mp(e)&&!Rp(e)&&!xp(e)&&"object"==typeof e}function Mp(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}function Lp(e,t){return"string"==typeof t?e===t:!!e.match(t)}function Dp(e,t){if(!t)return!1;for(const n of t)if(Lp(e,n))return!0;return!1}class Pp{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class Fp{_callback;_that;_isCalled=!1;_deferred=new Pp;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}const Bp=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Up{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const t=new Up({});return t._rawAttributes=jp(e),t._asyncAttributesPending=e.filter(([e,t])=>Bp(t)).length>0,t}constructor(e){const t=e.attributes??{};this._rawAttributes=Object.entries(t).map(([e,t])=>(Bp(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=jp(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Bp(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&oh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,n]of this._rawAttributes)Bp(n)?oh.debug(`Unsettled resource attribute ${t} skipped`):null!=n&&(e[t]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return null==e?this:Up.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function Zp(e){return Up.FromAttributeList(Object.entries(e))}function jp(e){return e.map(([e,t])=>Bp(t)?[e,t.catch(t=>{oh.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class zp{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:$u.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=Mh.now(),this._performanceOffset=t-(this._performanceStartTime+$h()),this._startTimeProvided=null!=e.startTime,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,null!=e.attributes&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(null==t||this._isSpanEnded())return this;if(0===e.length)return oh.warn(`Invalid attribute key: ${e}`),this;if(!Th(t))return oh.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits;return void 0!==n&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this)}setAttributes(e){for(const[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return oh.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&oh.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),sp(t)&&(sp(n)||(n=t),t=void 0);const s=Eh(t);return this.events.push({name:e,attributes:s,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()||(this.status={...e},null!=this.status.message&&"string"!=typeof e.message&&(oh.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message)),this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?oh.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this._ended=!0,this.endTime=this._getTime(e),this._duration=function(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=qh),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(oh.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&oh.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=Mh.now())return ep(e+this._performanceOffset);if("number"==typeof e)return Qh(e);if(e instanceof Date)return Qh(e.getTime());if(rp(e))return e;if(this._startTimeProvided)return Qh(Date.now());const t=Mh.now()-this._performanceStartTime;return op(this.startTime,Qh(t))}isRecording(){return!1===this._ended}recordException(e,t){const n={};"string"==typeof e?n[Ph]=e:e&&(e.code?n[Fh]=e.code.toString():e.name&&(n[Fh]=e.name),e.message&&(n[Ph]=e.message),e.stack&&(n["exception.stacktrace"]=e.stack)),n[Fh]||n[Ph]?this.addEvent("exception",n,t):oh.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);oh.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){const t=this._attributeValueLengthLimit;return t<=0?(oh.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}}var Vp;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Vp||(Vp={}));class Gp{shouldSample(){return{decision:Vp.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Wp{shouldSample(){return{decision:Vp.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Hp{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(xh(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Wp),this._remoteParentSampled=e.remoteParentSampled??new Wp,this._remoteParentNotSampled=e.remoteParentNotSampled??new Gp,this._localParentSampled=e.localParentSampled??new Wp,this._localParentNotSampled=e.localParentNotSampled??new Gp}shouldSample(e,t,n,r,s,o){const i=wh.getSpanContext(e);return i&&Yu(i)?i.isRemote?i.traceFlags&tu.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,r,s,o):i.traceFlags&tu.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,s,o):this._localParentNotSampled.shouldSample(e,t,n,r,s,o):this._root.shouldSample(e,t,n,r,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Yp{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(e,t){return{decision:Hu(t)&&this._accumulate(t)<this._upperBound?Vp.RECORD_AND_SAMPLED:Vp.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){const r=8*n;t=(t^parseInt(e.slice(r,r+8),16))>>>0}return t}}function Kp(){return{sampler:Jp(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Jp(){const e="parentbased_always_on";switch(e){case"always_on":return new Wp;case"always_off":return new Gp;case"parentbased_always_on":return new Hp({root:new Wp});case"parentbased_always_off":return new Hp({root:new Gp});case"traceidratio":return new Yp(Xp());case"parentbased_traceidratio":return new Hp({root:new Yp(Xp())});default:return oh.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new Hp({root:new Wp})}}function Xp(){return oh.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const qp=1/0;class Qp{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:3e4,this._shutdownOnce=new Fp(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(oh.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||0!==(e.spanContext().traceFlags&tu.SAMPLED)&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&oh.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(oh.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{const n=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);sh.with(function(e){return e.setValue(Ch,!0)}(sh.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const s=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===ip.SUCCESS?e():t(r.error??new Error("BatchSpanProcessor: span export failed"))});let o=null;for(let e=0,t=r.length;e<t;e++){const t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(o??=[],o.push(t.resource.waitForAsyncAttributes()))}null===o?s():Promise.all(o).then(s,e=>{xh(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,xh(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer)}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class $p extends Qp{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){!0!==e?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(e=>{xh(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{xh(e)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}class ed{generateTraceId=nd(16);generateSpanId=nd(8)}const td=Array(32);function nd(e){return function(){for(let t=0;t<2*e;t++)td[t]=Math.floor(16*Math.random())+48,td[t]>=58&&(td[t]+=39);return String.fromCharCode.apply(null,td.slice(0,2*e))}}class rd{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,t,n,r){const s=function(e){const t={sampler:Jp()},n=Kp(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new ed,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,t={},n=sh.active()){t.root&&(n=wh.deleteSpan(n));const r=wh.getSpan(n);if(Sh(n)){oh.debug("Instrumentation suppressed, returning Noop Span");return wh.wrapSpanContext(Du)}const s=r?.spanContext(),o=this._idGenerator.generateSpanId();let i,a,l;s&&wh.isSpanContextValid(s)?(a=s.traceId,l=s.traceState,i=s):a=this._idGenerator.generateTraceId();const c=t.kind??Qu.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:Eh(e.attributes)})),h=Eh(t.attributes),p=this._sampler.shouldSample(n,a,e,c,h,u);l=p.traceState??l;const d={traceId:a,spanId:o,traceFlags:p.decision===qu.RECORD_AND_SAMPLED?tu.SAMPLED:tu.NONE,traceState:l};if(p.decision===qu.NOT_RECORD){oh.debug("Recording is off, propagating context in a non-recording span");return wh.wrapSpanContext(d)}const f=Eh(Object.assign(h,p.attributes));return new zp({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:d,name:e,kind:c,links:u,parentSpanContext:i,attributes:f,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,t,n,r){let s,o,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(s=t,i=n):(s=t,o=n,i=r);const a=o??sh.active(),l=this.startSpan(e,s,a),c=wh.setSpan(a,l);return sh.with(c,i,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class sd{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{xh(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(const t of this._spanProcessors)t.onEnd(e)}shutdown(){const e=[];for(const t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}var od,id;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(od||(od={}));class ad{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift();const n=new WeakMap;for(;e.length>0;)t=Tp(t,e.shift(),0,n);return t}({},Kp(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??qp,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??Zp({[Vh]:"unknown_service",[Gh]:Jh[Gh],[Wh]:Jh[Wh],[Hh]:Jh[Hh]}),this._config=Object.assign({},t,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new sd(n)}getTracer(e,t,n){const r=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new rd({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r;const s=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${e} ms`)),r=od.timeout},e);t.forceFlush().then(()=>{clearTimeout(s),r!==od.timeout&&(r=od.resolved,n(r))}).catch(e=>{clearTimeout(s),r=od.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{const r=t.filter(e=>e!==od.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class ld{_enabled=!1;_currentContext=ru;_bindFunction(e=ru,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):t}disable(){return this._currentContext=ru,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=ru),this}with(e,t,n,...r){const s=this._currentContext;this._currentContext=e||ru;try{return t.call(n,...r)}finally{this._currentContext=s}}}class cd extends ad{constructor(e={}){super(e)}register(e={}){var t;wh.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?vh.setGlobalPropagator(t):vh.setGlobalPropagator(new ap({propagators:[new gp,new Ah]}))),function(e){if(null!==e){if(void 0===e){const e=new ld;return e.enable(),void sh.setGlobalContextManager(e)}e.enable(),sh.setGlobalContextManager(e)}}(e.contextManager)}}!function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"}(id||(id={}));let ud;function hd(e,t){return t in e}function pd(e,t,n,r=!0){if(hd(n,t)&&"number"==typeof n[t]&&(!r||0!==n[t]))return e.addEvent(t,n[t])}function dd(e,t,n=!1,r,s){if(void 0===r&&(r=0!==t[id.START_TIME]),n||(pd(e,id.FETCH_START,t,r),pd(e,id.DOMAIN_LOOKUP_START,t,r),pd(e,id.DOMAIN_LOOKUP_END,t,r),pd(e,id.CONNECT_START,t,r),pd(e,id.SECURE_CONNECTION_START,t,r),pd(e,id.CONNECT_END,t,r),pd(e,id.REQUEST_START,t,r),pd(e,id.RESPONSE_START,t,r),pd(e,id.RESPONSE_END,t,r)),!s){const n=t[id.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[id.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function fd(){return"undefined"!=typeof location?location.origin:void 0}function md(e,t,n,r,s=new WeakSet,o){const i=gd(e),a=function(e,t,n,r,s,o){const i=np(t),a=np(n);let l=r.filter(t=>{const n=np(tp(t[id.FETCH_START])),r=np(tp(t[id.RESPONSE_END]));return t.initiatorType.toLowerCase()===(o||"xmlhttprequest")&&t.name===e&&n>=i&&r<=a});l.length>0&&(l=l.filter(e=>!s.has(e)));return l}(e=i.toString(),t,n,r,s,o);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const l=function(e){return e.slice().sort((e,t)=>{const n=e[id.FETCH_START],r=t[id.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(i.origin!==fd()&&l.length>1){let e=l[0],t=function(e,t,n){const r=np(n),s=np(tp(t));let o,i=e[1];const a=e.length;for(let t=1;t<a;t++){const n=e[t],a=np(tp(n[id.FETCH_START])),l=r-np(tp(n[id.RESPONSE_END]));a>=s&&(!o||l<o)&&(o=l,i=n)}return i}(l,e[id.RESPONSE_END],n);const r=e[id.RESPONSE_END];return t[id.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function gd(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(ud||(ud=document.createElement("a")),ud);return t.href=e,t}function yd(e,t){let n=t||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return gd(e).origin===fd()||n.some(t=>Lp(e,t))}class vd{emit(e){}}const bd=new vd;const wd=new class{getLogger(e,t,n){return new vd}};class Cd{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):bd}}class Sd{getLogger(e,t,n){var r;return null!==(r=this.getDelegateLogger(e,t,n))&&void 0!==r?r:new Cd(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:wd}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}}const _d="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Id=Symbol.for("io.opentelemetry.js.api.logs"),Ad=_d;class Ed{constructor(){this._proxyLoggerProvider=new Sd}static getInstance(){return this._instance||(this._instance=new Ed),this._instance}setGlobalLoggerProvider(e){return Ad[Id]?this.getLoggerProvider():(Ad[Id]=(t=1,n=e,r=wd,e=>e===t?n:r),this._proxyLoggerProvider.setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=Ad[Id])||void 0===e?void 0:e.call(Ad,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete Ad[Id],this._proxyLoggerProvider=new Sd}}const kd=Ed.getInstance();let Td=console.error.bind(console);function Od(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const Rd=(e,t,n)=>{if(!e||!e[t])return void Td("no original function "+String(t)+" to wrap");if(!n)return Td("no wrapper function"),void Td((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void Td("original object and wrapper must be functions");const s=n(r,t);return Od(s,"__original",r),Od(s,"__unwrap",()=>{e[t]===s&&Od(e,t,r)}),Od(s,"__wrapped",!0),Od(e,t,s),s},xd=(e,t,n)=>{if(!e)return Td("must provide one or more modules to patch"),void Td((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Rd(e,t,n)})}):Td("must provide one or more functions to wrap on modules")},Nd=(e,t)=>{if(!e||!e[t])return Td("no function to unwrap."),void Td((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():Td("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},Md=(e,t)=>{if(!e)return Td("must provide one or more modules to patch"),void Td((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Nd(e,t)})}):Td("must provide one or more functions to unwrap on modules")};class Ld{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=oh.createComponentLogger({namespace:e}),this._tracer=wh.getTracer(e,t),this._meter=lh.getMeter(e,t),this._logger=kd.getLogger(e,t),this._updateMetricInstruments()}_wrap=Rd;_unwrap=Nd;_massWrap=xd;_massUnwrap=Md;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class Dd extends Ld{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}}function Pd(e,t,n){let r,s;try{s=e()}catch(e){r=e}finally{return t(r,s),s}}function Fd(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var Bd,Ud;function Zd(e,t){let n=Bd.OLD;const r=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of r??[]){if(t.toLowerCase()===e+"/dup"){n=Bd.DUPLICATE;break}t.toLowerCase()===e&&(n=Bd.STABLE)}return n}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(Bd||(Bd={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(Ud||(Ud={}));var jd;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(jd||(jd={}));const zd={"first-paint":jd.FIRST_PAINT,"first-contentful-paint":jd.FIRST_CONTENTFUL_PAINT};class Vd extends Dd{component="document-load";version="1";moduleName=this.component;constructor(e={}){super("@opentelemetry/instrumentation-document-load","0.48.0",e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){const t=Mh.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===dp),t=(()=>{const e={},t=Mh.getEntriesByType?.("navigation")[0];if(t)Object.values(id).forEach(n=>{if(hd(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}});else{const t=Mh.timing;t&&Object.values(id).forEach(n=>{if(hd(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}})}return e})(),n=e&&e.content||"";sh.with(vh.extract(ru,{traceparent:n}),()=>{const e=this._startSpan(Ud.DOCUMENT_LOAD,id.FETCH_START,t);e&&(sh.with(wh.setSpan(sh.active(),e),()=>{const e=this._startSpan(Ud.DOCUMENT_FETCH,id.FETCH_START,t);e&&(e.setAttribute(Lh,location.href),sh.with(wh.setSpan(sh.active(),e),()=>{dd(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,id.RESPONSE_END,t)}))}),e.setAttribute(Lh,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(pd(e,id.FETCH_START,t),pd(e,id.UNLOAD_EVENT_START,t),pd(e,id.UNLOAD_EVENT_END,t),pd(e,id.DOM_INTERACTIVE,t),pd(e,id.DOM_CONTENT_LOADED_EVENT_START,t),pd(e,id.DOM_CONTENT_LOADED_EVENT_END,t),pd(e,id.DOM_COMPLETE,t),pd(e,id.LOAD_EVENT_START,t),pd(e,id.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=Mh.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:n})=>{hd(zd,t)&&e.addEvent(zd[t],n)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,id.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(hd(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){const n=this._startSpan(Ud.RESOURCE_FETCH,id.FETCH_START,e,t);n&&(n.setAttribute(Lh,e.name),dd(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,id.RESPONSE_END,e))}_startSpan(e,t,n,r){if(hd(n,t)&&"number"==typeof n[t]){return this.tracer.startSpan(e,{startTime:n[t]},r?wh.setSpan(sh.active(),r):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&Pd(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,n){n&&Pd(()=>n(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const Gd="OT_ZONE_CONTEXT";class Wd{_enabled=!1;_zoneCounter=0;_activeContextFromZone(e){return e&&e.get(Gd)||ru}_bindFunction(e,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindListener(e,t){const n=t;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"==typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),"function"==typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),t}_createZoneName(){this._zoneCounter++;const e=Math.random();return`${this._zoneCounter}-${e}`}_createZone(e,t){return Zone.current.fork({name:e,properties:{[Gd]:t}})}_getActiveZone(){return Zone.current}_patchAddEventListener(e,t,n){const r=this;return function(s,o,i){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[s];void 0===a&&(a=new WeakMap,e.__ot_listeners[s]=a);const l=r.bind(n,o);return a.set(o,l),t.call(this,s,l,i)}}_patchRemoveEventListener(e,t){return function(n,r){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[n])return t.call(this,n,r);const s=e.__ot_listeners[n],o=s.get(r);return s.delete(r),t.call(this,n,o||r)}}active(){if(!this._enabled)return ru;const e=this._getActiveZone(),t=this._activeContextFromZone(e);return t||ru}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):("object"==typeof(n=t)&&null!==n&&"addEventListener"in n&&"function"==typeof n.addEventListener&&"removeEventListener"in n&&"function"==typeof n.removeEventListener&&this._bindListener(e,t),t);var n}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){const s=this._createZoneName();return this._createZone(s,e).run(t,n,r)}}
|
|
16
16
|
/**
|
|
17
17
|
* @license Angular v<unknown>
|
|
18
18
|
* (c) 2010-2025 Google LLC. https://angular.io/
|