(()=>{var aS=Object.create;var ss=Object.defineProperty;var iS=Object.getOwnPropertyDescriptor;var sS=Object.getOwnPropertyNames;var ES=Object.getPrototypeOf,_S=Object.prototype.hasOwnProperty;var sn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var TS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of sS(t))!_S.call(e,o)&&o!==r&&ss(e,o,{get:()=>t[o],enumerable:!(n=iS(t,o))||n.enumerable});return e};var tr=(e,t,r)=>(r=e!=null?aS(ES(e)):{},TS(t||!e||!e.__esModule?ss(r,"default",{value:e,enumerable:!0}):r,e));var ua=sn((jd,ks)=>{"use strict";function Sa(e){return typeof e=="function"}var pe=console.error.bind(console);function Er(e,t,r){var n=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}function _r(e){e&&e.logger&&(Sa(e.logger)?pe=e.logger:pe("new logger isn't a function, not replacing"))}function Ys(e,t,r){if(!e||!e[t]){pe("no original function "+t+" to wrap");return}if(!r){pe("no wrapper function"),pe(new Error().stack);return}if(!Sa(e[t])||!Sa(r)){pe("original object and wrapper must be functions");return}var n=e[t],o=r(n,t);return Er(o,"__original",n),Er(o,"__unwrap",function(){e[t]===o&&Er(e,t,n)}),Er(o,"__wrapped",!0),Er(e,t,o),o}function $S(e,t,r){if(e)Array.isArray(e)||(e=[e]);else{pe("must provide one or more modules to patch"),pe(new Error().stack);return}if(!(t&&Array.isArray(t))){pe("must provide one or more functions to wrap on modules");return}e.forEach(function(n){t.forEach(function(o){Ys(n,o,r)})})}function Fs(e,t){if(!e||!e[t]){pe("no function to unwrap."),pe(new Error().stack);return}if(!e[t].__unwrap)pe("no original to unwrap to -- has "+t+" already been unwrapped?");else return e[t].__unwrap()}function QS(e,t){if(e)Array.isArray(e)||(e=[e]);else{pe("must provide one or more modules to patch"),pe(new Error().stack);return}if(!(t&&Array.isArray(t))){pe("must provide one or more functions to unwrap on modules");return}e.forEach(function(r){t.forEach(function(n){Fs(r,n)})})}_r.wrap=Ys;_r.massWrap=$S;_r.unwrap=Fs;_r.massUnwrap=QS;ks.exports=_r});var qE=sn((Ar,$n)=>{(function(e,t){"use strict";var r="1.0.41",n="",o="?",a="function",i="undefined",E="object",T="string",s="major",_="model",S="name",u="type",c="vendor",p="version",O="architecture",P="console",d="mobile",f="tablet",g="smarttv",x="wearable",X="embedded",q=500,$="Amazon",ee="Apple",_e="ASUS",Y="BlackBerry",re="Browser",A="Chrome",v="Edge",m="Firefox",h="Google",N="Honor",B="Huawei",b="Lenovo",L="LG",R="Microsoft",y="Motorola",M="Nvidia",w="OnePlus",ve="Opera",Te="OPPO",Se="Samsung",$e="Sharp",Qe="Sony",Qt="Xiaomi",Pt="Zebra",Ze="Facebook",nn="Chromium OS",ts="Mac OS",rs=" Browser",rS=function(G,F){var U={};for(var j in G)F[j]&&F[j].length%2===0?U[j]=F[j].concat(G[j]):U[j]=G[j];return U},on=function(G){for(var F={},U=0;U0?k.length===2?typeof k[1]==a?this[k[0]]=k[1].call(this,Ie):this[k[0]]=k[1]:k.length===3?typeof k[1]===a&&!(k[1].exec&&k[1].test)?this[k[0]]=Ie?k[1].call(this,Ie,k[2]):t:this[k[0]]=Ie?Ie.replace(k[1],k[2]):t:k.length===4&&(this[k[0]]=Ie?k[3].call(this,Ie.replace(k[1],k[2])):t):this[k]=Ie||t;U+=2}},er=function(G,F){for(var U in F)if(typeof F[U]===E&&F[U].length>0){for(var j=0;j2&&(D[_]="iPad",D[u]=f),D},this.getEngine=function(){var D={};return D[S]=t,D[p]=t,Jt.call(D,j,De.engine),D},this.getOS=function(){var D={};return D[S]=t,D[p]=t,Jt.call(D,j,De.os),k&&!D[S]&&Ye&&Ye.platform&&Ye.platform!="Unknown"&&(D[S]=Ye.platform.replace(/chrome os/i,nn).replace(/macos/i,ts)),D},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return j},this.setUA=function(D){return j=typeof D===T&&D.length>q?Wo(D,q):D,this},this.setUA(j),this};Re.VERSION=r,Re.BROWSER=on([S,p,s]),Re.CPU=on([O]),Re.DEVICE=on([_,c,u,P,d,g,f,x,X]),Re.ENGINE=Re.OS=on([S,p]),typeof Ar!==i?(typeof $n!==i&&$n.exports&&(Ar=$n.exports=Re),Ar.UAParser=Re):typeof define===a&&define.amd?define(function(){return Re}):typeof e!==i&&(e.UAParser=Re);var Mt=typeof e!==i&&(e.jQuery||e.Zepto);if(Mt&&!Mt.ua){var an=new Re;Mt.ua=an.getResult(),Mt.ua.get=function(){return an.getUA()},Mt.ua.set=function(G){an.setUA(G);var F=an.getResult();for(var U in F)Mt.ua[U]=F[U]}}})(typeof window=="object"?window:Ar)});var P_=sn((ym,fr)=>{(function(e,t){if(!e)return;var r={},n=e.TraceKit,o=[].slice,a="?",i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function E(s,_){return Object.prototype.hasOwnProperty.call(s,_)}function T(s){return typeof s>"u"}r.noConflict=function(){return e.TraceKit=n,r},r.wrap=function(_){function S(){try{return _.apply(this,arguments)}catch(u){throw r.report(u),u}}return S},r.report=function(){var _=[],S=null,u=null;function c(A){q(),ee(),_.push(A)}function p(A){for(var v=_.length-1;v>=0;--v)_[v]===A&&_.splice(v,1);_.length===0&&($(),_e())}function O(A,v,m){var h=null;if(!(v&&!r.collectWindowErrors)){for(var N in _)if(E(_,N))try{_[N](A,v,m)}catch(B){h=B}if(h)throw h}}var P,d,f,g;function x(A,v,m,h,N){var B=null;if(u)r.computeStackTrace.augmentStackTraceWithInitialElement(u,v,m,A),Y();else if(N)B=r.computeStackTrace(N),O(B,!0,N);else{var b={url:v,line:m,column:h},L,R=A;if({}.toString.call(A)==="[object String]"){var y=A.match(i);y&&(L=y[1],R=y[2])}b.func=r.computeStackTrace.guessFunctionName(b.url,b.line),b.context=r.computeStackTrace.gatherContext(b.url,b.line),B={name:L,message:R,mode:"onerror",stack:[b]},O(B,!0,null)}return P?P.apply(this,arguments):!1}function X(A){var v=r.computeStackTrace(A.reason);O(v,!0,A.reason)}function q(){d!==!0&&(P=e.onerror,e.onerror=x,d=!0)}function $(){d&&(e.onerror=P,d=!1)}function ee(){g!==!0&&(f=e.onunhandledrejection,e.onunhandledrejection=X,g=!0)}function _e(){g&&(e.onunhandledrejection=f,g=!1)}function Y(){var A=u,v=S;u=null,S=null,O(A,!1,v)}function re(A){if(u){if(S===A)return;Y()}var v=r.computeStackTrace(A);throw u=v,S=A,setTimeout(function(){S===A&&Y()},v.incomplete?2e3:0),A}return re.subscribe=c,re.unsubscribe=p,re}(),r.computeStackTrace=function(){var _=!1,S={};function u(A){if(!r.remoteFetching)return"";try{var v=function(){try{return new e.XMLHttpRequest}catch{return new e.ActiveXObject("Microsoft.XMLHTTP")}},m=v();return m.open("GET",A,!1),m.send(""),m.responseText}catch{return""}}function c(A){if(typeof A!="string")return[];if(!E(S,A)){var v="",m="";try{m=e.document.domain}catch{}var h=/(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(A);h&&h[2]===m&&(v=u(A)),S[A]=v?v.split(` `):[]}return S[A]}function p(A,v){var m=/function ([^(]*)\(([^)]*)\)/,h=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,N="",B=10,b=c(A),L;if(!b.length)return a;for(var R=0;R0?h:null}function P(A){return A.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function d(A){return P(A).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function f(A,v){for(var m,h,N=0,B=v.length;Nm&&(B=N.exec(h[m]))?B.index:null}function x(A){if(!T(e&&e.document)){for(var v=[e.location.href],m=e.document.getElementsByTagName("script"),h,N=""+A,B=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,b=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,L,R,y,M=0;M|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,m=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,h=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,N,B=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,b=/\((\S*)(?::(\d+))(?::(\d+))\)/,L=A.stack.split(` `),R=[],y,M,w,ve=/^(.*) is undefined$/.exec(A.message),Te=0,Se=L.length;Te eval")>-1,N&&(y=B.exec(M[3]))?(M[3]=y[1],M[4]=y[2],M[5]=null):Te===0&&!M[5]&&!T(A.columnNumber)&&(R[0].column=A.columnNumber+1),w={url:M[3],func:M[1]||a,args:M[2]?M[2].split(","):[],line:M[4]?+M[4]:null,column:M[5]?+M[5]:null};else continue;!w.func&&w.line&&(w.func=p(w.url,w.line)),w.context=w.line?O(w.url,w.line):null,R.push(w)}return R.length?(R[0]&&R[0].line&&!R[0].column&&ve&&(R[0].column=g(ve[1],R[0].url,R[0].line)),{mode:"stack",name:A.name,message:A.message,stack:R}):null}function q(A){var v=A.stacktrace;if(v){for(var m=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,h=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,N=v.split(` `),B=[],b,L=0;L=0&&(w.line=ve+Se.substring(0,$e).split(` `).length)}}}else if(R=N.exec(v[M])){var Qe=e.location.href.replace(/#.*$/,""),Qt=new RegExp(d(v[M+1])),Pt=f(Qt,[Qe]);w={url:Qe,func:"",args:[],line:Pt?Pt.line:R[1],column:null}}if(w){w.func||(w.func=p(w.url,w.line));var Ze=O(w.url,w.line),nn=Ze?Ze[Math.floor(Ze.length/2)]:null;Ze&&nn.replace(/^\s*/,"")===v[M+1].replace(/^\s*/,"")?w.context=Ze:w.context=[v[M+1]],B.push(w)}}return B.length?{mode:"multiline",name:A.name,message:v[0],stack:B}:null}function ee(A,v,m,h){var N={url:v,line:m};if(N.url&&N.line){A.incomplete=!1,N.func||(N.func=p(N.url,N.line)),N.context||(N.context=O(N.url,N.line));var B=/ '([^']+)' /.exec(h);if(B&&(N.column=g(B[1],N.url,N.line)),A.stack.length>0&&A.stack[0].url===N.url){if(A.stack[0].line===N.line)return!1;if(!A.stack[0].line&&A.stack[0].func===N.func)return A.stack[0].line=N.line,A.stack[0].context=N.context,!1}return A.stack.unshift(N),A.partial=!0,!0}else A.incomplete=!0;return!1}function _e(A,v){for(var m=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,h=[],N={},B=!1,b,L,R,y=_e.caller;y&&!B;y=y.caller)if(!(y===Y||y===r.report)){if(L={url:null,func:a,args:[],line:null,column:null},y.name?L.func=y.name:(b=m.exec(y.toString()))&&(L.func=b[1]),typeof L.func>"u")try{L.func=b.input.substring(0,b.input.indexOf("{"))}catch{}if(R=x(y)){L.url=R.url,L.line=R.line,L.func===a&&(L.func=p(L.url,L.line));var M=/ '([^']+)' /.exec(A.message||A.description);M&&(L.column=g(M[1],R.url,R.line))}N[""+y]?B=!0:N[""+y]=!0,h.push(L)}v&&h.splice(0,v);var w={mode:"callers",name:A.name,message:A.message,stack:h};return ee(w,A.sourceURL||A.fileName,A.line||A.lineNumber,A.message||A.description),w}function Y(A,v){var m=null;v=v==null?0:+v;try{if(m=q(A),m)return m}catch(h){if(_)throw h}try{if(m=X(A),m)return m}catch(h){if(_)throw h}try{if(m=$(A),m)return m}catch(h){if(_)throw h}try{if(m=_e(A,v+1),m)return m}catch(h){if(_)throw h}return{name:A.name,message:A.message,mode:"failed"}}function re(A){A=(A==null?0:+A)+1;try{throw new Error}catch(v){return Y(v,A+1)}}return Y.augmentStackTraceWithInitialElement=ee,Y.computeStackTraceFromStackProp=X,Y.guessFunctionName=p,Y.gatherContext=O,Y.ofCaller=re,Y.getSource=c,Y}(),r.extendToAsynchronousCallbacks=function(){var s=function(S){var u=e[S];e[S]=function(){var p=o.call(arguments),O=p[0];return typeof O=="function"&&(p[0]=r.wrap(O)),u.apply?u.apply(this,p):u(p[0],p[1])}};s("setTimeout"),s("setInterval")},r.remoteFetching||(r.remoteFetching=!0),r.collectWindowErrors||(r.collectWindowErrors=!0),(!r.linesOfContext||r.linesOfContext<1)&&(r.linesOfContext=11),typeof define=="function"&&define.amd?define("TraceKit",[],r):typeof fr<"u"&&fr.exports&&e.module!==fr?fr.exports=r:e.TraceKit=r})(typeof window<"u"?window:typeof global<"u"?global:globalThis)});var NT=sn(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.ATTR_HTTP_USER_AGENT=J.ATTR_HTTP_URL=J.ATTR_HTTP_STATUS_CODE=J.ATTR_HTTP_SCHEME=J.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=J.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=J.ATTR_HTTP_REQUEST_BODY_SIZE=J.ATTR_HTTP_METHOD=J.ATTR_HTTP_HOST=void 0;J.ATTR_HTTP_HOST="http.host";J.ATTR_HTTP_METHOD="http.method";J.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size";J.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";J.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";J.ATTR_HTTP_SCHEME="http.scheme";J.ATTR_HTTP_STATUS_CODE="http.status_code";J.ATTR_HTTP_URL="http.url";J.ATTR_HTTP_USER_AGENT="http.user_agent"});var Es=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var Fe="1.9.0";var _s=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function SS(e){var t=new Set([e]),r=new Set,n=e.match(_s);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return function(T){return T===e};function a(E){return r.add(E),!1}function i(E){return t.add(E),!0}return function(T){if(t.has(T))return!0;if(r.has(T))return!1;var s=T.match(_s);if(!s)return a(T);var _={major:+s[1],minor:+s[2],patch:+s[3],prerelease:s[4]};return _.prerelease!=null||o.major!==_.major?a(T):o.major===0?o.minor===_.minor&&o.patch<=_.patch?i(T):a(T):o.minor<=_.minor?i(T):a(T)}}var Ts=SS(Fe);var uS=Fe.split(".")[0],rr=Symbol.for("opentelemetry.js.api."+uS),nr=Es;function xe(e,t,r,n){var o;n===void 0&&(n=!1);var a=nr[rr]=(o=nr[rr])!==null&&o!==void 0?o:{version:Fe};if(!n&&a[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(i.stack||i.message),!1}if(a.version!==Fe){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+e+" does not match previously registered API v"+Fe);return r.error(i.stack||i.message),!1}return a[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Fe+"."),!0}function Oe(e){var t,r,n=(t=nr[rr])===null||t===void 0?void 0:t.version;if(!(!n||!Ts(n)))return(r=nr[rr])===null||r===void 0?void 0:r[e]}function Ue(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Fe+".");var r=nr[rr];r&&delete r[e]}var cS=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},pS=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;nV.ALL&&(e=V.ALL),t=t||{};function r(n,o){var a=t[n];return typeof a=="function"&&e>=o?a.bind(t):function(){}}return{error:r("error",V.ERROR),warn:r("warn",V.WARN),info:r("info",V.INFO),debug:r("debug",V.DEBUG),verbose:r("verbose",V.VERBOSE)}}var AS=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},lS=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n";_.warn("Current logger will be overwritten from "+u),S.warn("Current logger will overwrite one already registered from "+u)}return xe("diag",S,r,!0)};r.setLogger=n,r.disable=function(){Ue(fS,r)},r.createComponentLogger=function(o){return new Ss(o)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();var dS=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},vS=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},cs=function(){function e(t){this._entries=t?new Map(t):new Map}return e.prototype.getEntry=function(t){var r=this._entries.get(t);if(r)return Object.assign({},r)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var r=dS(t,2),n=r[0],o=r[1];return[n,o]})},e.prototype.setEntry=function(t,r){var n=new e(this._entries);return n._entries.set(t,r),n},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t,r,n=[],o=0;o0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},BS=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},HS=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a};function Qs(e){return e.reduce(function(t,r){var n=""+t+(t!==""?Tr:"")+r;return n.length>$s?t:n},"")}function Zs(e){return e.getAllEntries().map(function(t){var r=nu(t,2),n=r[0],o=r[1],a=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(a+=dn+o.metadata.toString()),a})}function Js(e){var t=e.split(dn);if(!(t.length<=0)){var r=t.shift();if(r){var n=r.indexOf(js);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),a=decodeURIComponent(r.substring(n+1).trim()),i;return t.length>0&&(i=jo(t.join(dn))),{key:o,value:a,metadata:i}}}}}var da=function(){function e(){}return e.prototype.inject=function(t,r,n){var o=Q.getBaggage(t);if(!(!o||St(t))){var a=Zs(o).filter(function(E){return E.length<=qs}).slice(0,zs),i=Qs(a);i.length>0&&n.set(r,vn,i)}},e.prototype.extract=function(t,r,n){var o=n.get(r,vn),a=Array.isArray(o)?o.join(Tr):o;if(!a)return t;var i={};if(a.length===0)return t;var E=a.split(Tr);return E.forEach(function(T){var s=Js(T);if(s){var _={value:s.value};s.metadata&&(_.metadata=s.metadata),i[s.key]=_}}),Object.entries(i).length===0?t:Q.setBaggage(t,Q.createBaggage(i))},e.prototype.fields=function(){return[vn]},e}();var eE=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ou=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a};function ut(e){var t,r,n={};if(typeof e!="object"||e==null)return n;try{for(var o=eE(Object.entries(e)),a=o.next();!a.done;a=o.next()){var i=ou(a.value,2),E=i[0],T=i[1];if(!tE(E)){l.warn("Invalid attribute key: "+E);continue}if(!Rn(T)){l.warn("Invalid attribute value set for key: "+E);continue}Array.isArray(T)?n[E]=T.slice():n[E]=T}}catch(s){t={error:s}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}function tE(e){return typeof e=="string"&&e.length>0}function Rn(e){return e==null?!0:Array.isArray(e)?au(e):rE(e)}function au(e){var t,r,n;try{for(var o=eE(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(i!=null){if(!n){if(rE(i)){n=typeof i;continue}return!1}if(typeof i!==n)return!1}}}catch(E){t={error:E}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return!0}function rE(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}function nE(){return function(e){l.error(iu(e))}}function iu(e){return typeof e=="string"?e:JSON.stringify(su(e))}function su(e){for(var t={},r=e;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!t[n]){var o=r[n];o&&(t[n]=String(o))}}),r=Object.getPrototypeOf(r);return t}var Eu=nE();function Le(e){try{Eu(e)}catch{}}var Ne;(function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"})(Ne||(Ne={}));var _u=",",Tu=["OTEL_SDK_DISABLED"];function Su(e){return Tu.indexOf(e)>-1}var uu=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function cu(e){return uu.indexOf(e)>-1}var pu=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];function Au(e){return pu.indexOf(e)>-1}var Ct=1/0,Dt=128,oE=128,aE=128,On={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:V.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ct,OTEL_ATTRIBUTE_COUNT_LIMIT:Dt,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ct,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Dt,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ct,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Dt,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:oE,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:aE,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Ne.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};function lu(e,t,r){if(!(typeof r[e]>"u")){var n=String(r[e]);t[e]=n.toLowerCase()==="true"}}function fu(e,t,r,n,o){if(n===void 0&&(n=-1/0),o===void 0&&(o=1/0),typeof r[e]<"u"){var a=Number(r[e]);isNaN(a)||(ao?t[e]=o:t[e]=a)}}function du(e,t,r,n){n===void 0&&(n=_u);var o=r[e];typeof o=="string"&&(t[e]=o.split(n).map(function(a){return a.trim()}))}var vu={ALL:V.ALL,VERBOSE:V.VERBOSE,DEBUG:V.DEBUG,INFO:V.INFO,WARN:V.WARN,ERROR:V.ERROR,NONE:V.NONE};function Ru(e,t,r){var n=r[e];if(typeof n=="string"){var o=vu[n.toUpperCase()];o!=null&&(t[e]=o)}}function Nn(e){var t={};for(var r in On){var n=r;switch(n){case"OTEL_LOG_LEVEL":Ru(n,t,e);break;default:if(Su(n))lu(n,t,e);else if(cu(n))fu(n,t,e);else if(Au(n))du(n,t,e);else{var o=e[n];typeof o<"u"&&o!==null&&(t[n]=String(o))}}}return t}var mn=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};function be(){var e=Nn(mn);return Object.assign({},On,e)}function Pn(){return Nn(mn)}function iE(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Sr(e){for(var t=new Uint8Array(e.length/2),r=0,n=0;n=Mn&&(r[1]-=Mn,r[0]+=1),r}var oe;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(oe||(oe={}));var Cu=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Na=function(){function e(t){t===void 0&&(t={});var r;this._propagators=(r=t.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,o){return n.concat(o)},[])))}return e.prototype.inject=function(t,r,n){var o,a;try{for(var i=Cu(this._propagators),E=i.next();!E.done;E=i.next()){var T=E.value;try{T.inject(t,r,n)}catch(s){l.warn("Failed to inject with "+T.constructor.name+". Err: "+s.message)}}}catch(s){o={error:s}}finally{try{E&&!E.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}},e.prototype.extract=function(t,r,n){return this._propagators.reduce(function(o,a){try{return a.extract(o,r,n)}catch(i){l.warn("Failed to extract with "+a.constructor.name+". Err: "+i.message)}return o},t)},e.prototype.fields=function(){return this._fields.slice()},e}();var ma="[_0-9a-z-*/]",Du="[a-z]"+ma+"{0,255}",Iu="[a-z0-9]"+ma+"{0,240}@[a-z]"+ma+"{0,13}",xu=new RegExp("^(?:"+Du+"|"+Iu+")$"),Uu=/^[ -~]{0,255}[!-~]$/,bu=/,|=/;function cE(e){return xu.test(e)}function pE(e){return Uu.test(e)&&!bu.test(e)}var AE=32,yu=512,lE=",",fE="=",dE=function(){function e(t){this._internalState=new Map,t&&this._parse(t)}return e.prototype.set=function(t,r){var n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,r),n},e.prototype.unset=function(t){var r=this._clone();return r._internalState.delete(t),r},e.prototype.get=function(t){return this._internalState.get(t)},e.prototype.serialize=function(){var t=this;return this._keys().reduce(function(r,n){return r.push(n+fE+t.get(n)),r},[]).join(lE)},e.prototype._parse=function(t){t.length>yu||(this._internalState=t.split(lE).reverse().reduce(function(r,n){var o=n.trim(),a=o.indexOf(fE);if(a!==-1){var i=o.slice(0,a),E=o.slice(a+1,n.length);cE(i)&&pE(E)&&r.set(i,E)}return r},new Map),this._internalState.size>AE&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,AE))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}();var Dn="traceparent",In="tracestate",Vu="00",wu="(?!ff)[\\da-f]{2}",Bu="(?![0]{32})[\\da-f]{32}",Gu="(?![0]{16})[\\da-f]{16}",Hu="[\\da-f]{2}",Yu=new RegExp("^\\s?("+wu+")-("+Bu+")-("+Gu+")-("+Hu+")(-.*)?\\s?$");function vE(e){var t=Yu.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Pa=function(){function e(){}return e.prototype.inject=function(t,r,n){var o=C.getSpanContext(t);if(!(!o||St(t)||!ke(o))){var a=Vu+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||ue.NONE).toString(16);n.set(r,Dn,a),o.traceState&&n.set(r,In,o.traceState.serialize())}},e.prototype.extract=function(t,r,n){var o=n.get(r,Dn);if(!o)return t;var a=Array.isArray(o)?o[0]:o;if(typeof a!="string")return t;var i=vE(a);if(!i)return t;i.isRemote=!0;var E=n.get(r,In);if(E){var T=Array.isArray(E)?E.join(","):E;i.traceState=new dE(typeof T=="string"?T:void 0)}return C.setSpanContext(t,i)},e.prototype.fields=function(){return[Dn,In]},e}();var Fu="[object Object]",ku="[object Null]",Ku="[object Undefined]",Wu=Function.prototype,RE=Wu.toString,Xu=RE.call(Object),ju=zu(Object.getPrototypeOf,Object),OE=Object.prototype,NE=OE.hasOwnProperty,ct=Symbol?Symbol.toStringTag:void 0,mE=OE.toString;function zu(e,t){return function(r){return e(t(r))}}function Ma(e){if(!qu(e)||$u(e)!==Fu)return!1;var t=ju(e);if(t===null)return!0;var r=NE.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&RE.call(r)===Xu}function qu(e){return e!=null&&typeof e=="object"}function $u(e){return e==null?e===void 0?Ku:ku:ct&&ct in Object(e)?Qu(e):Zu(e)}function Qu(e){var t=NE.call(e,ct),r=e[ct],n=!1;try{e[ct]=void 0,n=!0}catch{}var o=mE.call(e);return n&&(t?e[ct]=r:delete e[ct]),o}function Zu(e){return mE.call(e)}var Ju=20;function La(){for(var e=[],t=0;t0;)r=ME(r,e.shift(),0,n);return r}function ha(e){return Un(e)?e.slice():e}function ME(e,t,r,n){r===void 0&&(r=0);var o;if(!(r>Ju)){if(r++,xn(e)||xn(t)||hE(t))o=ha(t);else if(Un(e)){if(o=e.slice(),Un(t))for(var a=0,i=t.length;a"u"?delete o[T]:o[T]=s;else{var _=o[T],S=s;if(PE(e,T,n)||PE(t,T,n))delete o[T];else{if(ur(_)&&ur(S)){var u=n.get(_)||[],c=n.get(S)||[];u.push({obj:e,key:T}),c.push({obj:t,key:T}),n.set(_,u),n.set(S,c)}o[T]=ME(o[T],s,r,n)}}}}else o=t;return o}}function PE(e,t,r){for(var n=r.get(e[t])||[],o=0,a=n.length;o"u"||e instanceof Date||e instanceof RegExp||e===null}function ec(e,t){return!(!Ma(e)||!Ma(t))}var LE=function(){function e(){var t=this;this._promise=new Promise(function(r,n){t._resolve=r,t._reject=n})}return Object.defineProperty(e.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),e.prototype.resolve=function(t){this._resolve(t)},e.prototype.reject=function(t){this._reject(t)},e}();var tc=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},rc=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},z=function(){function e(t,r){var n=this,o;this._attributes=t,this.asyncAttributesPending=r!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=r?.then(function(a){return n._attributes=Object.assign({},n._attributes,a),n.asyncAttributesPending=!1,a},function(a){return l.debug("a resource's async attributes promise rejected: %s",a),n.asyncAttributesPending=!1,{}})}return e.empty=function(){return e.EMPTY},e.default=function(){var t;return new e((t={},t[Ws]=Ca(),t[Aa]=xt[Aa],t[pa]=xt[pa],t[la]=xt[la],t))},Object.defineProperty(e.prototype,"attributes",{get:function(){var t;return this.asyncAttributesPending&&l.error("Accessing resource attributes before async attributes settled"),(t=this._attributes)!==null&&t!==void 0?t:{}},enumerable:!1,configurable:!0}),e.prototype.waitForAsyncAttributes=function(){return oc(this,void 0,void 0,function(){return ac(this,function(t){switch(t.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},e.prototype.merge=function(t){var r=this,n;if(!t)return this;var o=nt(nt({},this._syncAttributes),(n=t._syncAttributes)!==null&&n!==void 0?n:t.attributes);if(!this._asyncAttributesPromise&&!t._asyncAttributesPromise)return new e(o);var a=Promise.all([this._asyncAttributesPromise,t._asyncAttributesPromise]).then(function(i){var E,T=ic(i,2),s=T[0],_=T[1];return nt(nt(nt(nt({},r._syncAttributes),s),(E=t._syncAttributes)!==null&&E!==void 0?E:t.attributes),_)});return new e(o,a)},e.EMPTY=new e({}),e}();var gE=function(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"};var sc=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function E(_){try{s(n.next(_))}catch(S){i(S)}}function T(_){try{s(n.throw(_))}catch(S){i(S)}}function s(_){_.done?a(_.value):o(_.value).then(E,T)}s((n=n.apply(e,t||[])).next())})},Ec=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function E(s){return function(_){return T([s,_])}}function T(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=s[0]&2?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]0){var r=JSON.stringify(t.attributes,null,4);l.verbose(r)}})};var Tc="exception.type",Sc="exception.message",uc="exception.stacktrace";var bn=Tc,yn=Sc,CE=uc;var DE="exception";var Ia=function(){return Ia=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},IE=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},pc=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(r),this):(l.warn("Invalid attribute value set for key: "+t),this)},e.prototype.setAttributes=function(t){var r,n;try{for(var o=cc(Object.entries(t)),a=o.next();!a.done;a=o.next()){var i=IE(a.value,2),E=i[0],T=i[1];this.setAttribute(E,T)}}catch(s){r={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return this},e.prototype.addEvent=function(t,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return l.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&l.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),gn(r)&&(gn(n)||(n=r),r=void 0);var o=ut(r);return this.events.push({name:t,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this},e.prototype.addLink=function(t){return this.links.push(t),this},e.prototype.addLinks=function(t){var r;return(r=this.links).push.apply(r,pc([],IE(t),!1)),this},e.prototype.setStatus=function(t){return this._isSpanEnded()?this:(this.status=Ia({},t),this.status.message!=null&&typeof t.message!="string"&&(l.warn("Dropping invalid status.message of type '"+typeof t.message+"', expected 'string'"),delete this.status.message),this)},e.prototype.updateName=function(t){return this._isSpanEnded()?this:(this.name=t,this)},e.prototype.end=function(t){if(this._isSpanEnded()){l.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(t),this._duration=Ra(this.startTime,this.endTime),this._duration[0]<0&&(l.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&&l.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},e.prototype._getTime=function(t){if(typeof t=="number"&&t<=ye.now())return va(t+this._performanceOffset);if(typeof t=="number")return rt(t);if(t instanceof Date)return rt(t.getTime());if(Ln(t))return t;if(this._startTimeProvided)return rt(Date.now());var r=ye.now()-this._performanceStartTime;return Cn(this.startTime,rt(r))},e.prototype.isRecording=function(){return this._ended===!1},e.prototype.recordException=function(t,r){var n={};typeof t=="string"?n[yn]=t:t&&(t.code?n[bn]=t.code.toString():t.name&&(n[bn]=t.name),t.message&&(n[yn]=t.message),t.stack&&(n[CE]=t.stack)),n[bn]||n[yn]?this.addEvent(DE,n,r):l.warn("Failed to record an exception "+t)},Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ended",{get:function(){return this._ended},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedAttributesCount",{get:function(){return this._droppedAttributesCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedEventsCount",{get:function(){return this._droppedEventsCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedLinksCount",{get:function(){return this._droppedLinksCount},enumerable:!1,configurable:!0}),e.prototype._isSpanEnded=function(){return this._ended&&l.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},e.prototype._truncateToLimitUtil=function(t,r){return t.length<=r?t:t.substring(0,r)},e.prototype._truncateToSize=function(t){var r=this,n=this._attributeValueLengthLimit;return n<=0?(l.warn("Attribute value limit must be positive, got "+n),t):typeof t=="string"?this._truncateToLimitUtil(t,n):Array.isArray(t)?t.map(function(o){return typeof o=="string"?r._truncateToLimitUtil(o,n):o}):t},e}();var We;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(We||(We={}));var Xe=function(){function e(){}return e.prototype.shouldSample=function(){return{decision:We.NOT_RECORD}},e.prototype.toString=function(){return"AlwaysOffSampler"},e}();var ge=function(){function e(){}return e.prototype.shouldSample=function(){return{decision:We.RECORD_AND_SAMPLED}},e.prototype.toString=function(){return"AlwaysOnSampler"},e}();var Vn=function(){function e(t){var r,n,o,a;this._root=t.root,this._root||(Le(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ge),this._remoteParentSampled=(r=t.remoteParentSampled)!==null&&r!==void 0?r:new ge,this._remoteParentNotSampled=(n=t.remoteParentNotSampled)!==null&&n!==void 0?n:new Xe,this._localParentSampled=(o=t.localParentSampled)!==null&&o!==void 0?o:new ge,this._localParentNotSampled=(a=t.localParentNotSampled)!==null&&a!==void 0?a:new Xe}return e.prototype.shouldSample=function(t,r,n,o,a,i){var E=C.getSpanContext(t);return!E||!ke(E)?this._root.shouldSample(t,r,n,o,a,i):E.isRemote?E.traceFlags&ue.SAMPLED?this._remoteParentSampled.shouldSample(t,r,n,o,a,i):this._remoteParentNotSampled.shouldSample(t,r,n,o,a,i):E.traceFlags&ue.SAMPLED?this._localParentSampled.shouldSample(t,r,n,o,a,i):this._localParentNotSampled.shouldSample(t,r,n,o,a,i)},e.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},e}();var Ut=function(){function e(t){t===void 0&&(t=0),this._ratio=t,this._ratio=this._normalize(t),this._upperBound=Math.floor(this._ratio*4294967295)}return e.prototype.shouldSample=function(t,r){return{decision:cn(r)&&this._accumulate(r)=1?1:t<=0?0:t},e.prototype._accumulate=function(t){for(var r=0,n=0;n>>0}return r},e}();var Ac=Ne.AlwaysOn,bt=1;function wn(){var e=be();return{sampler:xa(e),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:e.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:e.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:e.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:e.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:e.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:e.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:e.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:e.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function xa(e){switch(e===void 0&&(e=be()),e.OTEL_TRACES_SAMPLER){case Ne.AlwaysOn:return new ge;case Ne.AlwaysOff:return new Xe;case Ne.ParentBasedAlwaysOn:return new Vn({root:new ge});case Ne.ParentBasedAlwaysOff:return new Vn({root:new Xe});case Ne.TraceIdRatio:return new Ut(UE(e));case Ne.ParentBasedTraceIdRatio:return new Vn({root:new Ut(UE(e))});default:return l.error('OTEL_TRACES_SAMPLER value "'+e.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Ac+'".'),new ge}}function UE(e){if(e.OTEL_TRACES_SAMPLER_ARG===void 0||e.OTEL_TRACES_SAMPLER_ARG==="")return l.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+bt+"."),bt;var t=Number(e.OTEL_TRACES_SAMPLER_ARG);return isNaN(t)?(l.error("OTEL_TRACES_SAMPLER_ARG="+e.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+bt+"."),bt):t<0||t>1?(l.error("OTEL_TRACES_SAMPLER_ARG="+e.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+bt+"."),bt):t}function bE(e){var t={sampler:xa()},r=wn(),n=Object.assign({},r,t,e);return n.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),n}function yE(e){var t,r,n,o,a,i,E,T,s,_,S,u,c=Object.assign({},e.spanLimits),p=Pn();return c.attributeCountLimit=(i=(a=(o=(r=(t=e.spanLimits)===null||t===void 0?void 0:t.attributeCountLimit)!==null&&r!==void 0?r:(n=e.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&o!==void 0?o:p.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&a!==void 0?a:p.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&i!==void 0?i:Dt,c.attributeValueLengthLimit=(u=(S=(_=(T=(E=e.spanLimits)===null||E===void 0?void 0:E.attributeValueLengthLimit)!==null&&T!==void 0?T:(s=e.generalLimits)===null||s===void 0?void 0:s.attributeValueLengthLimit)!==null&&_!==void 0?_:p.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&S!==void 0?S:p.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&u!==void 0?u:Ct,Object.assign({},e,{spanLimits:c})}var VE=function(){function e(t,r){this._exporter=t,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=be();this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new ga(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(l.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return e.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},e.prototype.onStart=function(t,r){},e.prototype.onEnd=function(t){this._shutdownOnce.isCalled||t.spanContext().traceFlags&ue.SAMPLED&&this._addToBuffer(t)},e.prototype.shutdown=function(){return this._shutdownOnce.call()},e.prototype._shutdown=function(){var t=this;return Promise.resolve().then(function(){return t.onShutdown()}).then(function(){return t._flushAll()}).then(function(){return t._exporter.shutdown()})},e.prototype._addToBuffer=function(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&l.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(l.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()},e.prototype._flushAll=function(){var t=this;return new Promise(function(r,n){for(var o=[],a=Math.ceil(t._finishedSpans.length/t._maxExportBatchSize),i=0,E=a;i0&&(t._clearTimer(),t._maybeStartTimer())}).catch(function(n){t._isExporting=!1,Le(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),this._timer,void 0)}},e.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},e}();var lc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),pt=function(e){lc(t,e);function t(r,n){var o=e.call(this,r,n)||this;return o.onInit(n),o}return t.prototype.onInit=function(r){var n=this;r?.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=function(){document.visibilityState==="hidden"&&n.forceFlush().catch(function(o){Le(o)})},this._pageHideListener=function(){n.forceFlush().catch(function(o){Le(o)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))},t.prototype.onShutdown=function(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))},t}(VE);var fc=8,dc=16,Gn=function(){function e(){this.generateTraceId=wE(dc),this.generateSpanId=wE(fc)}return e}();var Bn=Array(32);function wE(e){return function(){for(var r=0;r=58&&(Bn[r]+=39);return String.fromCharCode.apply(null,Bn.slice(0,e*2))}}var BE=function(){function e(t,r,n){this._tracerProvider=n;var o=bE(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new Gn,this.resource=n.resource,this.instrumentationLibrary=t}return e.prototype.startSpan=function(t,r,n){var o,a,i;r===void 0&&(r={}),n===void 0&&(n=I.active()),r.root&&(n=C.deleteSpan(n));var E=C.getSpan(n);if(St(n)){l.debug("Instrumentation suppressed, returning Noop Span");var T=C.wrapSpanContext(ar);return T}var s=E?.spanContext(),_=this._idGenerator.generateSpanId(),S,u,c;!s||!C.isSpanContextValid(s)?S=this._idGenerator.generateTraceId():(S=s.traceId,u=s.traceState,c=s.spanId);var p=(o=r.kind)!==null&&o!==void 0?o:Ke.INTERNAL,O=((a=r.links)!==null&&a!==void 0?a:[]).map(function(q){return{context:q.context,attributes:ut(q.attributes)}}),P=ut(r.attributes),d=this._sampler.shouldSample(n,S,t,p,P,O);u=(i=d.traceState)!==null&&i!==void 0?i:u;var f=d.decision===ht.RECORD_AND_SAMPLED?ue.SAMPLED:ue.NONE,g={traceId:S,spanId:_,traceFlags:f,traceState:u};if(d.decision===ht.NOT_RECORD){l.debug("Recording is off, propagating context in a non-recording span");var T=C.wrapSpanContext(g);return T}var x=ut(Object.assign(P,d.attributes)),X=new xE(this,n,t,g,p,c,O,r.startTime,void 0,x);return X},e.prototype.startActiveSpan=function(t,r,n,o){var a,i,E;if(!(arguments.length<2)){arguments.length===2?E=r:arguments.length===3?(a=r,E=n):(a=r,i=n,E=o);var T=i??I.active(),s=this.startSpan(t,a,T),_=C.setSpan(T,s);return I.with(_,E,void 0,s)}},e.prototype.getGeneralLimits=function(){return this._generalLimits},e.prototype.getSpanLimits=function(){return this._spanLimits},e.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},e}();var Hn=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ua=function(){function e(t){this._spanProcessors=t}return e.prototype.forceFlush=function(){var t,r,n=[];try{for(var o=Hn(this._spanProcessors),a=o.next();!a.done;a=o.next()){var i=a.value;n.push(i.forceFlush())}}catch(E){t={error:E}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return new Promise(function(E){Promise.all(n).then(function(){E()}).catch(function(T){Le(T||new Error("MultiSpanProcessor: forceFlush failed")),E()})})},e.prototype.onStart=function(t,r){var n,o;try{for(var a=Hn(this._spanProcessors),i=a.next();!i.done;i=a.next()){var E=i.value;E.onStart(t,r)}}catch(T){n={error:T}}finally{try{i&&!i.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}},e.prototype.onEnd=function(t){var r,n;try{for(var o=Hn(this._spanProcessors),a=o.next();!a.done;a=o.next()){var i=a.value;i.onEnd(t)}}catch(E){r={error:E}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.shutdown=function(){var t,r,n=[];try{for(var o=Hn(this._spanProcessors),a=o.next();!a.done;a=o.next()){var i=a.value;n.push(i.shutdown())}}catch(E){t={error:E}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return new Promise(function(E,T){Promise.all(n).then(function(){E()},T)})},e}();var GE=function(){function e(){}return e.prototype.onStart=function(t,r){},e.prototype.onEnd=function(t){},e.prototype.shutdown=function(){return Promise.resolve()},e.prototype.forceFlush=function(){return Promise.resolve()},e}();var vc=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},Rc=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n0?o(i):n()}).catch(function(a){return o([a])})})},e.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},e.prototype._getPropagator=function(t){var r;return(r=this.constructor._registeredPropagators.get(t))===null||r===void 0?void 0:r()},e.prototype._getSpanExporter=function(t){var r;return(r=this.constructor._registeredExporters.get(t))===null||r===void 0?void 0:r()},e.prototype._buildPropagatorFromEnv=function(){var t=this,r=Array.from(new Set(be().OTEL_PROPAGATORS)),n=r.map(function(a){var i=t._getPropagator(a);return i||l.warn('Propagator "'+a+'" requested through environment variable is unavailable.'),i}),o=n.reduce(function(a,i){return i&&a.push(i),a},[]);if(o.length!==0)return r.length===1?o[0]:new Na({propagators:o})},e.prototype._buildExporterFromEnv=function(){var t=be().OTEL_TRACES_EXPORTER;if(!(t==="none"||t==="")){var r=this._getSpanExporter(t);return r||l.error('Exporter "'+t+'" requested through environment variable is unavailable.'),r}},e._registeredPropagators=new Map([["tracecontext",function(){return new Pa}],["baggage",function(){return new da}]]),e._registeredExporters=new Map,e}();var Oc=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},Nc=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n0)return r;var n="";return e.parentNode&&(n+=Yn(e.parentNode,!1)),n+=r,n}function Pc(e){if(!e.parentNode)return 0;var t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);var r=Array.from(e.parentNode.childNodes);return r=r.filter(function(n){var o=n.localName;return t.indexOf(n.nodeType)>=0&&o===e.localName}),r.length>=1?r.indexOf(e)+1:0}function Mc(e,t){var r=e.nodeType,n=Pc(e),o="";if(r===Node.ELEMENT_NODE){var a=e.getAttribute("id");if(t&&a)return'//*[@id="'+a+'"]';o=e.localName}else if(r===Node.TEXT_NODE||r===Node.CDATA_SECTION_NODE)o="text()";else if(r===Node.COMMENT_NODE)o="comment()";else return"";return o&&n>1?"/"+o+"["+n+"]":"/"+o}var hc="http.url";var Lc="http.user_agent";var Fn=hc;var YE=Lc;var gc="service.name";var FE=gc;var cr="error.type";var kE="exception.message",KE="exception.stacktrace",WE="exception.type";var kn="http.request.method";var Kn="http.request.method_original";var Wn="http.response.status_code";var Xn="server.address",jn="server.port";var zn="url.full";var at={PLATFORM:"browser.platform",BRANDS:"browser.brands",MOBILE:"browser.mobile",LANGUAGE:"browser.language",USER_AGENT:"browser.user_agent"};var Cc=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function E(_){try{s(n.next(_))}catch(S){i(S)}}function T(_){try{s(n.throw(_))}catch(S){i(S)}}function s(_){_.done?a(_.value):o(_.value).then(E,T)}s((n=n.apply(e,t||[])).next())})},Dc=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function E(s){return function(_){return T([s,_])}}function T(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=s[0]&2?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]{let a=o.target;if(n()===!1||e._eventMap.has(o)||!bc(o,a,t,r))return;let i=Yn(a),E=C.getTracer(XE);I.with(I.active(),()=>{E.startActiveSpan(t,{attributes:{event_type:t,target_element:a.tagName,target_xpath:i,"http.url":window.location.href}},T=>{jE(o,"stopPropagation",T),jE(o,"stopImmediatePropagation",T),e._eventMap.set(o,T)})})}}enable(){var t;if(this._isEnabled)return;let r=this.getRootNode();this._listeners=[],((t=this._config.eventNames)!==null&&t!==void 0?t:Uc).forEach(o=>{let a=e.createGlobalEventListener(o,this._config.rootNodeId,()=>this._isEnabled);this._listeners.push({eventName:o,handler:a}),r.addEventListener(o,a,{capture:!0}),r.addEventListener(o,e.handleEndSpan)}),this._isEnabled=!0}getRootNode(){if(this._config.rootNodeId){let t=document.getElementById(this._config.rootNodeId);return t===null?(this._diag.warn(`Root Node id: ${this._config.rootNodeId} not found!`),document):t}return document}disable(){this._isEnabled=!1,this._listeners.forEach(({eventName:t,handler:r})=>{document.removeEventListener(t,r,{capture:!0}),document.removeEventListener(t,e.handleEndSpan)}),this._listeners=[]}};qn._eventMap=new WeakMap;var bc=(e,t,r,n)=>{if(!(t instanceof HTMLElement))return!1;let o=`on${r}`;return!(!zE(t,o,n)||!t.getAttribute||t.hasAttribute("disabled"))},zE=(e,t,r)=>!e||r&&e.id===r?!1:e[t]?!0:zE(e.parentElement,t,r),jE=(e,t,r)=>{let n=e[t].bind(e);e[t]=()=>{r.end(),n()}};var B_=tr(qE());var wa=function(){function e(t){this._delegate=t}return e.prototype.export=function(t,r){this._delegate.export(t,r)},e.prototype.forceFlush=function(){return this._delegate.forceFlush()},e.prototype.shutdown=function(){return this._delegate.shutdown()},e}();var yc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ba=function(e){yc(t,e);function t(r,n,o){var a=e.call(this,r)||this;return a.name="OTLPExporterError",a.data=o,a.code=n,a}return t}(Error);function Vc(e){if(!Number.isNaN(e)&&Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}function $E(e){if(e!=null)return function(){return e}}function QE(e,t,r){var n,o,a,i,E,T;return{timeoutMillis:Vc((o=(n=e.timeoutMillis)!==null&&n!==void 0?n:t.timeoutMillis)!==null&&o!==void 0?o:r.timeoutMillis),concurrencyLimit:(i=(a=e.concurrencyLimit)!==null&&a!==void 0?a:t.concurrencyLimit)!==null&&i!==void 0?i:r.concurrencyLimit,compression:(T=(E=e.compression)!==null&&E!==void 0?E:t.compression)!==null&&T!==void 0?T:r.compression}}function ZE(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var wc=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function E(_){try{s(n.next(_))}catch(S){i(S)}}function T(_){try{s(n.throw(_))}catch(S){i(S)}}function s(_){_.done?a(_.value):o(_.value).then(E,T)}s((n=n.apply(e,t||[])).next())})},Bc=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function E(s){return function(_){return T([s,_])}}function T(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=s[0]&2?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]=this._concurrencyLimit},e.prototype.awaitAll=function(){return wc(this,void 0,void 0,function(){return Bc(this,function(t){switch(t.label){case 0:return[4,Promise.all(this._sendingPromises)];case 1:return t.sent(),[2]}})})},e}();function JE(e){return new Gc(e.concurrencyLimit)}function Hc(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function e_(){return{handleResponse:function(e){e==null||!Hc(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||l.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}var Yc=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function E(_){try{s(n.next(_))}catch(S){i(S)}}function T(_){try{s(n.throw(_))}catch(S){i(S)}}function s(_){_.done?a(_.value):o(_.value).then(E,T)}s((n=n.apply(e,t||[])).next())})},Fc=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function E(s){return function(_){return T([s,_])}}function T(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=s[0]&2?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]>BigInt(32)));return{low:t,high:r}}function o_(e){var t=n_(e);return Kc(t)}function Wc(e){var t=n_(e);return t.toString()}var Xc=typeof BigInt<"u"?Wc:Oa;function r_(e){return e}function a_(e){if(e!==void 0)return Sr(e)}var jc={encodeHrTime:o_,encodeSpanContext:Sr,encodeOptionalSpanContext:a_};function i_(e){var t,r;if(e===void 0)return jc;var n=(t=e.useLongBits)!==null&&t!==void 0?t:!0,o=(r=e.useHex)!==null&&r!==void 0?r:!1;return{encodeHrTime:n?o_:Xc,encodeSpanContext:o?r_:Sr,encodeOptionalSpanContext:o?r_:a_}}var zc=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a};function s_(e){return{attributes:lr(e.attributes),droppedAttributesCount:0}}function E_(e){return{name:e.name,version:e.version}}function lr(e){return Object.keys(e).map(function(t){return __(t,e[t])})}function __(e,t){return{key:e,value:T_(t)}}function T_(e){var t=typeof e;return t==="string"?{stringValue:e}:t==="number"?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t==="boolean"?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(T_)}}:t==="object"&&e!=null?{kvlistValue:{values:Object.entries(e).map(function(r){var n=zc(r,2),o=n[0],a=n[1];return __(o,a)})}}:{}}var qc=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$c=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a};function Qc(e,t){var r,n=e.spanContext(),o=e.status;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:t.encodeOptionalSpanContext(e.parentSpanId),traceState:(r=n.traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:lr(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(function(a){return Jc(a,t)}),droppedEventsCount:e.droppedEventsCount,status:{code:o.code,message:o.message},links:e.links.map(function(a){return Zc(a,t)}),droppedLinksCount:e.droppedLinksCount}}function Zc(e,t){var r;return{attributes:e.attributes?lr(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(r=e.context.traceState)===null||r===void 0?void 0:r.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Jc(e,t){return{attributes:e.attributes?lr(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function S_(e,t){var r=i_(t);return{resourceSpans:tp(e,r)}}function ep(e){var t,r,n=new Map;try{for(var o=qc(e),a=o.next();!a.done;a=o.next()){var i=a.value,E=n.get(i.resource);E||(E=new Map,n.set(i.resource,E));var T=i.instrumentationLibrary.name+"@"+(i.instrumentationLibrary.version||"")+":"+(i.instrumentationLibrary.schemaUrl||""),s=E.get(T);s||(s=[],E.set(T,s)),s.push(i)}}catch(_){t={error:_}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}function tp(e,t){for(var r=ep(e),n=[],o=r.entries(),a=o.next();!a.done;){for(var i=$c(a.value,2),E=i[0],T=i[1],s=[],_=T.values(),S=_.next();!S.done;){var u=S.value;if(u.length>0){var c=u.map(function(O){return Qc(O,t)});s.push({scope:E_(u[0].instrumentationLibrary),spans:c,schemaUrl:u[0].instrumentationLibrary.schemaUrl})}S=_.next()}var p={resource:s_(E),scopeSpans:s,schemaUrl:void 0};n.push(p),a=o.next()}return n}var Qn={serializeRequest:function(e){var t=S_(e,{useHex:!0,useLongBits:!1}),r=new TextEncoder;return r.encode(JSON.stringify(t))},deserializeResponse:function(e){var t=new TextDecoder;return JSON.parse(t.decode(e))}};var rp=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function E(_){try{s(n.next(_))}catch(S){i(S)}}function T(_){try{s(n.throw(_))}catch(S){i(S)}}function s(_){_.done?a(_.value):o(_.value).then(E,T)}s((n=n.apply(e,t||[])).next())})},np=function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function E(s){return function(_){return T([s,_])}}function T(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=s[0]&2?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]0?(i--,T=Math.max(Math.min(E,ip)+Ep(),0),E=E*sp,s=(n=a.retryInMillis)!==null&&n!==void 0?n:T,_=o-Date.now(),s>_?[2,a]:[4,this.retry(t,_,s)]):[3,4];case 3:return a=S.sent(),[3,2];case 4:return[2,a]}})})},e.prototype.shutdown=function(){return this._transport.shutdown()},e}();function Ha(e){return new _p(e.transport)}function c_(e){var t=[429,502,503,504];return t.includes(e)}function p_(e){if(e!=null){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;var r=new Date(e).getTime()-Date.now();return r>=0?r:0}}var Tp=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a},Sp=function(){function e(t){this._parameters=t}return e.prototype.send=function(t,r){var n=this;return new Promise(function(o){var a=new XMLHttpRequest;a.timeout=r,a.open("POST",n._parameters.url);var i=n._parameters.headers();Object.entries(i).forEach(function(E){var T=Tp(E,2),s=T[0],_=T[1];a.setRequestHeader(s,_)}),a.ontimeout=function(E){o({status:"failure",error:new Error("XHR request timed out")})},a.onreadystatechange=function(){a.status>=200&&a.status<=299?(l.debug("XHR success"),o({status:"success"})):a.status&&c_(a.status)?o({status:"retryable",retryInMillis:p_(a.getResponseHeader("Retry-After"))}):a.status!==0&&o({status:"failure",error:new Error("XHR request failed with non-retryable status")})},a.onabort=function(){o({status:"failure",error:new Error("XHR request aborted")})},a.onerror=function(){o({status:"failure",error:new Error("XHR request errored")})},a.send(t)})},e.prototype.shutdown=function(){},e}();function A_(e){return new Sp(e)}var up=function(){function e(t){this._params=t}return e.prototype.send=function(t){var r=this;return new Promise(function(n){navigator.sendBeacon(r._params.url,new Blob([t],{type:r._params.blobType}))?(l.debug("SendBeacon success"),n({status:"success"})):n({status:"failure",error:new Error("SendBeacon failed")})})},e.prototype.shutdown=function(){},e}();function l_(e){return new up(e)}function f_(e,t){return Ga(e,t,Ha({transport:A_(e)}))}function d_(e,t){return Ga(e,t,Ha({transport:l_({url:e.url,blobType:e.headers()["Content-Type"]})}))}var cp=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(E){i={error:E}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a};function v_(e){return function(){var t,r={};return Object.entries((t=e?.())!==null&&t!==void 0?t:{}).forEach(function(n){var o=cp(n,2),a=o[0],i=o[1];typeof i<"u"?r[a]=String(i):l.warn('Header "'+a+'" has invalid value ('+i+") and will be ignored")}),r}}var At=function(){return At=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=58&&(Zn[r]+=39);return String.fromCharCode.apply(null,Zn.slice(0,e*2))}}var Wa=class{constructor(t={}){var r,n,o,a;if(this._resource=(r=t.resource)!==null&&r!==void 0?r:new z({}),this._resourceDetectors=(n=t.resourceDetectors)!==null&&n!==void 0?n:[Va],this._serviceName=t.serviceName,this._autoDetectResources=(o=t.autoDetectResources)!==null&&o!==void 0?o:!0,t.spanProcessor||t.traceExporter){let E={};t.sampler&&(E.sampler=t.sampler),t.spanLimits&&(E.spanLimits=t.spanLimits),t.idGenerator&&(E.idGenerator=t.idGenerator);let T=(a=t.spanProcessor)!==null&&a!==void 0?a:new pt(t.traceExporter);this._tracerProviderConfig={tracerConfig:E,spanProcessor:T,contextManager:t.contextManager,textMapPropagator:t.textMapPropagator}}let i=[];t.instrumentations&&(i=t.instrumentations),this._instrumentations=i}start(){var t,r,n;if(this._disabled)return;if(Ta({instrumentations:this._instrumentations}),this._autoDetectResources){let a={detectors:this._resourceDetectors};this._resource=this._resource.merge(Da(a))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(new z({[FE]:this._serviceName}));let o=new ya(Object.assign(Object.assign({},(t=this._tracerProviderConfig)===null||t===void 0?void 0:t.tracerConfig),{resource:this._resource}));this._tracerProvider=o,this._tracerProviderConfig&&o.addSpanProcessor(this._tracerProviderConfig.spanProcessor),o.register({contextManager:(r=this._tracerProviderConfig)===null||r===void 0?void 0:r.contextManager,propagator:(n=this._tracerProviderConfig)===null||n===void 0?void 0:n.textMapPropagator}),o.addSpanProcessor(new Ka)}getResourceAttributes(){return this._resource.attributes}shutdown(){let t=[];return this._tracerProvider&&t.push(this._tracerProvider.shutdown()),Promise.all(t).then(()=>{})}};function vp(){return new z({"honeycomb.distro.version":pr,"honeycomb.distro.runtime_version":"browser"})}var M_={path:!0,hash:!0,hostname:!0,referrer:!0,url:!1,search:!1};function Rp(e){if(e===!1||!window?.location)return new z({});let t=Op(e),{href:r,pathname:n,search:o,hash:a,hostname:i}=window.location,E={"entry_page.url":yt(t.url,r),"entry_page.path":yt(t.path,n),"entry_page.search":yt(t.search,o),"entry_page.hash":yt(t.hash,a),"entry_page.hostname":yt(t.hostname,i),"entry_page.referrer":yt(t.referrer,document.referrer)};return new z(E)}function Op(e){return e?Object.assign(Object.assign({},M_),e):M_}function yt(e,t){if(e)return t}var Np=e=>e<=768?"small":e>768&&e<=1024?"medium":e>1024?"large":"unknown",mp=e=>{var t;return(t=e?.effectiveType)!==null&&t!==void 0?t:"unknown"},Pp=(e,t)=>!e&&!t?"unknown":e||"desktop",Mp=e=>{let t=new B_.default(e),{name:r,version:n}=t.getBrowser();return{browserName:r??"unknown",browserVersion:n??"unknown",deviceType:Pp(t.getDevice().type,r)}};function hp(){let{browserName:e,browserVersion:t,deviceType:r}=Mp(navigator.userAgent);return new z({"user_agent.original":navigator.userAgent,"browser.mobile":navigator.userAgent.includes("Mobi"),"browser.touch_screen_enabled":navigator.maxTouchPoints>0,"browser.language":navigator.language,"browser.name":e,"browser.version":t,"device.type":r,"network.effectiveType":mp(navigator.connection),"screen.width":window.screen.width,"screen.height":window.screen.height,"screen.size":Np(window.screen.width)})}function Lp(e){let t=h_(e[0]);for(let r=1;r`@honeycombio/opentelemetry-web: ${e}`,Ip=/^[a-f0-9]*$/,xp=/^hc[a-z]ic_[a-z0-9]*$/;function to(e){return e==null||e.length===0?!1:e.length===32?Ip.test(e):e.length===64?xp.test(e):!1}function Up(e){return e.endsWith(dr)||e.endsWith(`${dr}/`)?e:e.endsWith("/")?e+dr:e+"/"+dr}var io=e=>e?.tracesEndpoint?e.tracesEndpoint:e?.endpoint?Up(e.endpoint):Xa,ni=e=>e?.tracesApiKey||e?.apiKey,H_=e=>typeof e?.sampleRate=="number"&&Number.isSafeInteger(e?.sampleRate)&&e?.sampleRate>=0?e?.sampleRate:Dp,Y_=ae("\u274C Missing API Key. Set `apiKey` in HoneycombOptions. Telemetry will not be exported."),F_=ae(`\u274C Missing Service Name. Set \`serviceName\` in HoneycombOptions. Defaulting to '${eo.serviceName}'`),bp=ae("\u{1F515} Dataset is ignored in favor of service name."),yp=ae("\u274C Missing dataset. Specify either HONEYCOMB_DATASET environment variable or dataset in the options parameter."),Vp=ae("\u23ED\uFE0F Skipping options validation. To re-enable, set skipOptionsValidation option or HONEYCOMB_SKIP_OPTIONS_VALIDATION to false."),wp=ae("\u{1F528} Default deterministic sampler has been overridden. Honeycomb requires a resource attribute called SampleRate to properly show weighted values. Non-deterministic sampleRate could lead to missing spans in Honeycomb. See our docs for more details. https://docs.honeycomb.io/getting-data-in/opentelemetry/node-distro/#sampling-without-the-honeycomb-sdk"),Bp=ae("\u{1F515} Disabling local visualizations - must have both service name and API key configured."),Gp=ae("\u{1F515} Disabling local visualizations - cannot infer auth and ui url roots from endpoint url."),Hp=ae("\u{1F515} Failed to get proper auth response from Honeycomb. No local visualization available."),Yp=ae("\u{1F515} Default honeycomb exporter disabled but no exporters provided"),Fp=e=>{var t;let r=e?.logLevel?e.logLevel:V.DEBUG;if(e?.skipOptionsValidation){r>=V.DEBUG&&console.debug(Vp);return}return!e?.apiKey&&r>=V.WARN&&console.warn(Y_),!e?.serviceName&&r>=V.WARN&&console.warn(F_),e?.apiKey&&!to(e?.apiKey)&&e?.dataset&&r>=V.WARN&&console.warn(bp),e?.apiKey&&to(e?.apiKey)&&!e?.dataset&&r>=V.WARN&&console.warn(yp),e?.sampler&&r>=V.DEBUG&&console.debug(wp),e?.disableDefaultTraceExporter===!0&&!e?.traceExporter&&!(!((t=e?.traceExporters)===null||t===void 0)&&t.length)&&console.warn(Yp),e};function kp(e){if(!e?.debug)return;l.setLogger(new qo,V.DEBUG),l.debug(ae("\u{1F41D} Honeycomb Web SDK Debug Mode Enabled \u{1F41D}"));let t=io(e),r=Object.assign(Object.assign(Object.assign({},eo),e),{tracesEndpoint:t});Kp(r),Wp(r),Xp(r),jp(r)}function Kp(e){let t=ni(e)||"";if(!t){l.debug(Y_);return}l.debug(ae(`API Key configured for traces: '${t}'`))}function Wp(e){let t=e.serviceName||eo.serviceName;if(t===eo.serviceName){l.debug(F_);return}l.debug(`@honeycombio/opentelemetry-web: Service Name configured for traces: '${t}'`)}function Xp(e){let t=io(e);if(!t){l.debug(ae("No endpoint configured for traces"));return}l.debug(ae(`Endpoint configured for traces: '${t}'`))}function jp(e){let t=H_(e);if(!t){l.debug("No sampler configured for traces");return}l.debug(ae(`Sample Rate configured for traces: '${t}'`))}var ja=class{constructor(){}onStart(t,r){var n,o;((o=(n=Q.getBaggage(r))===null||n===void 0?void 0:n.getAllEntries())!==null&&o!==void 0?o:[]).forEach(a=>{t.setAttribute(a[0],a[1].value),l.debug(`@honeycombio/opentelemetry-web: \u{1F6A8} Baggage in all outgoing headers: ${a[0]}=${a[1].value} `)})}onEnd(){}forceFlush(){return Promise.resolve()}shutdown(){return Promise.resolve()}},za=class{constructor(){}onStart(t){let{href:r,pathname:n,search:o,hash:a,hostname:i}=window.location;t.setAttributes({"browser.width":window.innerWidth,"browser.height":window.innerHeight,"page.hash":a,"page.url":r,"page.route":n,"page.hostname":i,"page.search":o,"url.path":n})}onEnd(){}forceFlush(){return Promise.resolve()}shutdown(){return Promise.resolve()}},L_="x-honeycomb-team",zp="x-honeycomb-dataset";function qp(e){let t=ni(e);return new m_({url:io(e),headers:$p(e,t)})}function $p(e,t){let r=Object.assign({},e?.headers);return t&&!r[L_]&&(r[L_]=t),to(t)&&e?.dataset&&(r[zp]=e?.dataset),r}function Qp(e){return new qa(e)}var qa=class{constructor(t){this._exporters=t}export(t,r){this._exporters.forEach(n=>n.export(t,r)),r({code:oe.SUCCESS})}async shutdown(){let t=[];this._exporters.forEach(r=>t.push(r.shutdown())),await Promise.all(t)}};function Zp(e){let t=ni(e),{authRoot:r,uiRoot:n}=Jp(e?.tracesEndpoint||io(e));return new $a(e?.serviceName,t,e?.logLevel,r,n)}var Jp=(e="")=>{let t=new URL(e),n=/(api)([.|-])?(.*?)(\.?)(honeycomb\.io)(.*)/.exec(t.host);if(n===null)return{authRoot:void 0,uiRoot:void 0};let o=n[2]==="-",a,i;o?(a=`api-${n[3]}`,i=`ui-${n[3]}`):(a=n[3]?`api.${n[3]}`:"api",i=n[3]?`ui.${n[3]}`:"ui");let E=`${t.protocol}//${a}.honeycomb.io/1/auth`,T=`${t.protocol}//${i}.honeycomb.io`;return{authRoot:E,uiRoot:T}},$a=class{constructor(t,r,n,o,a){if(this._traceUrl="",this._logLevel=V.DEBUG,n&&(this._logLevel=n),!t||!r){this._logLevel>=V.DEBUG&&console.debug(Bp);return}if(!o||!a){this._logLevel>=V.DEBUG&&console.debug(Gp);return}fetch(o,{headers:{"x-honeycomb-team":r}}).then(E=>{if(E.ok)return E.json();throw new Error}).then(E=>{var T,s,_;let S=E;if(!((T=S.team)===null||T===void 0)&&T.slug)this._traceUrl=eA(r,t,(s=S.team)===null||s===void 0?void 0:s.slug,(_=S.environment)===null||_===void 0?void 0:_.slug,a);else throw new Error}).catch(()=>{this._logLevel>=V.INFO&&console.log(Hp)})}export(t,r){this._traceUrl&&t.forEach(n=>{!n.parentSpanId&&this._logLevel>=V.INFO&&console.log(ae(`Honeycomb link: ${this._traceUrl}=${n.spanContext().traceId}`))}),r({code:oe.SUCCESS})}shutdown(){return Promise.resolve()}};function eA(e,t,r,n,o){let a=`${o}/${r}`;return!to(e)&&n&&(a+=`/environments/${n}`),a+=`/datasets/${t}/trace?trace_id`,a}var tA=e=>{let t=new Qa,r=[];return e?.localVisualizations&&r.push(Zp(e)),e?.traceExporter&&r.push(e?.traceExporter),e?.traceExporters&&r.push(...e.traceExporters),e?.disableDefaultTraceExporter!==!0&&r.unshift(qp(e)),t.addProcessor(new pt(Qp([...r]))),t.addProcessor(new ja),t.addProcessor(new za),e?.spanProcessor&&t.addProcessor(e?.spanProcessor),e?.spanProcessors&&e.spanProcessors.forEach(n=>{t.addProcessor(n)}),t},Qa=class{constructor(){this.spanProcessors=[]}addProcessor(t){this.spanProcessors.push(t)}getSpanProcessors(){return this.spanProcessors}onStart(t,r){this.spanProcessors.forEach(n=>{n.onStart(t,r)})}onEnd(t){this.spanProcessors.forEach(r=>{r.onEnd(t)})}forceFlush(){return Promise.all(this.spanProcessors.map(t=>t.forceFlush())).then(()=>{})}shutdown(){return Promise.all(this.spanProcessors.map(t=>t.forceFlush())).then(()=>{})}},rA=e=>{let t=H_(e);return new Za(t)},Za=class{constructor(t){switch(this._sampleRate=t,t){case 0:this._sampler=new Xe;break;case 1:this._sampler=new ge;break;default:{let r=1/t;this._sampler=new Ut(r);break}}}shouldSample(t,r,n,o,a,i){let E=this._sampler.shouldSample(t,r,n,o,a,i);return Object.assign(Object.assign({},E),{attributes:Object.assign(Object.assign({},E.attributes),{SampleRate:this._sampleRate})})}toString(){return`DeterministicSampler(${this._sampler.toString()})`}},Ja,g_,Gt=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart(t||100)-1)return r||o;if(r=r?o+">"+r:o,n.id)break;e=n.parentNode}}catch{}return r},k_=-1,K_=function(){return k_},lt=function(e){addEventListener("pageshow",function(t){t.persisted&&(k_=t.timeStamp,e(t))},!0)},Eo=function(){var e=Gt();return e&&e.activationStart||0},Pe=function(e,t){var r=Gt(),n="navigate";return K_()>=0?n="back-forward-cache":r&&(document.prerendering||Eo()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},ft=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(o){Promise.resolve().then(function(){t(o.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch{}},Me=function(e,t,r,n){var o,a;return function(i){t.value>=0&&(i||n)&&((a=t.value-(o||0))||o===void 0)&&(o=t.value,t.delta=a,t.rating=function(E,T){return E>T[1]?"poor":E>T[0]?"needs-improvement":"good"}(t.value,r),e(t))}},oi=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Pr=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},_o=function(e){var t=!1;return function(){t||(e(),t=!0)}},Vt=-1,C_=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},ro=function(e){document.visibilityState==="hidden"&&Vt>-1&&(Vt=e.type==="visibilitychange"?e.timeStamp:0,oA())},D_=function(){addEventListener("visibilitychange",ro,!0),addEventListener("prerenderingchange",ro,!0)},oA=function(){removeEventListener("visibilitychange",ro,!0),removeEventListener("prerenderingchange",ro,!0)},ai=function(){return Vt<0&&(Vt=C_(),D_(),lt(function(){setTimeout(function(){Vt=C_(),D_()},0)})),{get firstHiddenTime(){return Vt}}},Mr=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},I_=[1800,3e3],W_=function(e,t){t=t||{},Mr(function(){var r,n=ai(),o=Pe("FCP"),a=ft("paint",function(i){i.forEach(function(E){E.name==="first-contentful-paint"&&(a.disconnect(),E.startTimea.value&&(a.value=i,a.entries=E,o())},s=ft("layout-shift",T);s&&(o=Me(r,a,x_,n.reportAllChanges),Pr(function(){T(s.takeRecords()),o(!0)}),lt(function(){i=0,a=Pe("CLS",0),o=Me(r,a,x_,n.reportAllChanges),oi(function(){return o()})}),setTimeout(o,0))}))})(function(r){var n=function(o){var a,i={};if(o.entries.length){var E=o.entries.reduce(function(s,_){return s&&s.value>_.value?s:_});if(E&&E.sources&&E.sources.length){var T=(a=E.sources).find(function(s){return s.node&&s.node.nodeType===1})||a[0];T&&(i={largestShiftTarget:so(T.node),largestShiftTime:E.startTime,largestShiftValue:E.value,largestShiftSource:T,largestShiftEntry:E,loadState:Nr(E.startTime)})}}return Object.assign(o,{attribution:i})}(r);e(n)},t)},iA=function(e,t){W_(function(r){var n=function(o){var a={timeToFirstByte:0,firstByteToFCP:o.value,loadState:Nr(K_())};if(o.entries.length){var i=Gt(),E=o.entries[o.entries.length-1];if(i){var T=i.activationStart||0,s=Math.max(0,i.responseStart-T);a={timeToFirstByte:s,firstByteToFCP:o.value-s,loadState:Nr(o.entries[0].startTime),navigationEntry:i,fcpEntry:E}}}return Object.assign(o,{attribution:a})}(r);e(n)},t)},X_=0,Fa=1/0,Jn=0,sA=function(e){e.forEach(function(t){t.interactionId&&(Fa=Math.min(Fa,t.interactionId),Jn=Math.max(Jn,t.interactionId),X_=Jn?(Jn-Fa)/7+1:0)})},j_=function(){return Ja?X_:performance.interactionCount||0},EA=function(){"interactionCount"in performance||Ja||(Ja=ft("event",sA,{type:"event",buffered:!0,durationThreshold:0}))},Ce=[],Rr=new Map,z_=0,_A=function(){var e=Math.min(Ce.length-1,Math.floor((j_()-z_)/50));return Ce[e]},q_=[],TA=function(e){if(q_.forEach(function(o){return o(e)}),e.interactionId||e.entryType==="first-input"){var t=Ce[Ce.length-1],r=Rr.get(e.interactionId);if(r||Ce.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};Rr.set(n.id,n),Ce.push(n)}Ce.sort(function(o,a){return a.latency-o.latency}),Ce.length>10&&Ce.splice(10).forEach(function(o){return Rr.delete(o.id)})}}},ii=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=_o(e),document.visibilityState==="hidden"?e():(r=t(e),Pr(e)),r},U_=[200,500],SA=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Mr(function(){var r;EA();var n,o=Pe("INP"),a=function(E){ii(function(){E.forEach(TA);var T=_A();T&&T.latency!==o.value&&(o.value=T.latency,o.entries=T.entries,n())})},i=ft("event",a,{durationThreshold:(r=t.durationThreshold)!==null&&r!==void 0?r:40});n=Me(e,o,U_,t.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),Pr(function(){a(i.takeRecords()),n(!0)}),lt(function(){z_=j_(),Ce.length=0,Rr.clear(),o=Pe("INP"),n=Me(e,o,U_,t.reportAllChanges)}))}))},wt=[],it=[],ei=0,si=new WeakMap,Bt=new Map,ti=-1,uA=function(e){wt=wt.concat(e),$_()},$_=function(){ti<0&&(ti=ii(cA))},cA=function(){Bt.size>10&&Bt.forEach(function(i,E){Rr.has(E)||Bt.delete(E)});var e=Ce.map(function(i){return si.get(i.entries[0])}),t=it.length-50;it=it.filter(function(i,E){return E>=t||e.includes(i)});for(var r=new Set,n=0;nei&&E>a||r.has(i)}),ti=-1};q_.push(function(e){e.interactionId&&e.target&&!Bt.has(e.interactionId)&&Bt.set(e.interactionId,e.target)},function(e){var t,r=e.startTime+e.duration;ei=Math.max(ei,e.processingEnd);for(var n=it.length-1;n>=0;n--){var o=it[n];if(Math.abs(r-o.renderTime)<=8){(t=o).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},it.push(t)),(e.interactionId||e.entryType==="first-input")&&si.set(e,t),$_()});var st,Or,Q_,no,Z_=function(e,t){for(var r,n=[],o=0;r=wt[o];o++)if(!(r.startTime+r.durationt)break;n.push(r)}return n},pA=function(e,t){g_||(g_=ft("long-animation-frame",uA)),SA(function(r){var n=function(o){var a=o.entries[0],i=si.get(a),E=a.processingStart,T=i.processingEnd,s=i.entries.sort(function(P,d){return P.processingStart-d.processingStart}),_=Z_(a.startTime,T),S=o.entries.find(function(P){return P.target}),u=S&&S.target||Bt.get(a.interactionId),c=[a.startTime+a.duration,T].concat(_.map(function(P){return P.startTime+P.duration})),p=Math.max.apply(Math,c),O={interactionTarget:so(u),interactionTargetElement:u,interactionType:a.name.startsWith("key")?"keyboard":"pointer",interactionTime:a.startTime,nextPaintTime:p,processedEventEntries:s,longAnimationFrameEntries:_,inputDelay:E-a.startTime,processingDuration:T-E,presentationDelay:Math.max(p-T,0),loadState:Nr(a.startTime)};return Object.assign(o,{attribution:O})}(r);e(n)},t)},b_=[2500,4e3],ka={},AA=function(e,t){(function(r,n){n=n||{},Mr(function(){var o,a=ai(),i=Pe("LCP"),E=function(_){n.reportAllChanges||(_=_.slice(-1)),_.forEach(function(S){S.startTime=0&&Or1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?function(r,n){var o=function(){V_(r,n),i()},a=function(){i()},i=function(){removeEventListener("pointerup",o,vr),removeEventListener("pointercancel",a,vr)};addEventListener("pointerup",o,vr),addEventListener("pointercancel",a,vr)}(t,e):V_(t,e)}},eT=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,RA,vr)})},w_=[100,300],OA=function(e,t){t=t||{},Mr(function(){var r,n=ai(),o=Pe("FID"),a=function(T){T.startTime{let{applyCustomAttributes:u}=S;if(!this.isEnabled())return;let{name:c,attribution:p}=_,{largestShiftTarget:O,largestShiftTime:P,largestShiftValue:d,loadState:f,largestShiftEntry:g}=p,x=this.getAttrPrefix(c),X=this.tracer.startSpan(c);X.setAttributes(Object.assign(Object.assign({},this.getSharedAttributes(_)),{[`${x}.largest_shift_target`]:O,[`${x}.element`]:O,[`${x}.largest_shift_time`]:P,[`${x}.largest_shift_value`]:d,[`${x}.load_state`]:f,[`${x}.had_recent_input`]:g?.hadRecentInput})),u&&u(_,X),X.end()},this.onReportLCP=(_,S={})=>{let{applyCustomAttributes:u,dataAttributes:c}=S;if(!this.isEnabled())return;let{name:p,attribution:O}=_,{element:P,url:d,timeToFirstByte:f,resourceLoadDelay:g,resourceLoadDuration:x,elementRenderDelay:X,lcpEntry:q}=O,$=this.getAttrPrefix(p),ee=this.tracer.startSpan(p);ee.setAttributes(Object.assign(Object.assign({},this.getSharedAttributes(_)),{[`${$}.element`]:P,[`${$}.url`]:d,[`${$}.time_to_first_byte`]:f,[`${$}.resource_load_delay`]:g,[`${$}.resource_load_duration`]:x,[`${$}.element_render_delay`]:X,[`${$}.resource_load_time`]:x}));let _e=q?.element;if(_e?.dataset)for(let Y in _e.dataset){let re=_e.dataset[Y];re!==void 0&&(c===void 0||c.includes(Y))&&ee.setAttribute(`${$}.element.data.${Y}`,re)}u&&u(_,ee),ee.end()},this.onReportINP=(_,S={includeTimingsAsSpans:!1})=>{let{applyCustomAttributes:u,includeTimingsAsSpans:c}=S;if(!this.isEnabled())return;let{name:p,attribution:O}=_,{inputDelay:P,interactionTarget:d,interactionTime:f,interactionType:g,loadState:x,nextPaintTime:X,presentationDelay:q,processingDuration:$,longAnimationFrameEntries:ee}=O,_e=ee,Y=this.getAttrPrefix(p),re=P+$+q;this.tracer.startActiveSpan(p,{startTime:f},A=>{let v=Object.assign(Object.assign({},this.getSharedAttributes(_)),{[`${Y}.input_delay`]:P,[`${Y}.interaction_target`]:d,[`${Y}.interaction_time`]:f,[`${Y}.interaction_type`]:g,[`${Y}.load_state`]:x,[`${Y}.next_paint_time`]:X,[`${Y}.presentation_delay`]:q,[`${Y}.processing_duration`]:$,[`${Y}.duration`]:re,[`${Y}.element`]:d,[`${Y}.event_type`]:g});A.setAttributes(v),u&&u(_,A),c&&_e.forEach(m=>{this.processPerformanceLongAnimationFrameTimingSpans(Y,m)}),A.end(f+re)})},this.onReportFCP=(_,S={})=>{let{applyCustomAttributes:u}=S;if(!this.isEnabled())return;let{name:c,attribution:p}=_,{timeToFirstByte:O,firstByteToFCP:P,loadState:d}=p,f=this.getAttrPrefix(c),g=this.tracer.startSpan(c);g.setAttributes(Object.assign(Object.assign({},this.getSharedAttributes(_)),{[`${f}.time_to_first_byte`]:O,[`${f}.time_since_first_byte`]:P,[`${f}.load_state`]:d})),u&&u(_,g),g.end()},this.onReportFID=(_,S={})=>{let{applyCustomAttributes:u}=S;if(!this.isEnabled())return;let{name:c,attribution:p}=_,{eventTarget:O,eventType:P,loadState:d}=p,f=this.getAttrPrefix(c),g=this.tracer.startSpan(c);g.setAttributes(Object.assign(Object.assign({},this.getSharedAttributes(_)),{[`${f}.element`]:O,[`${f}.event_type`]:P,[`${f}.load_state`]:d})),u&&u(_,g),g.end()},this.onReportTTFB=(_,S={})=>{let{applyCustomAttributes:u}=S;if(!this.isEnabled())return;let{name:c,attribution:p}=_,{cacheDuration:O,connectionDuration:P,dnsDuration:d,requestDuration:f,waitingDuration:g}=p,x=this.getAttrPrefix(c),X=Object.assign(Object.assign({},this.getSharedAttributes(_)),{[`${x}.waiting_duration`]:g,[`${x}.dns_duration`]:d,[`${x}.connection_duration`]:P,[`${x}.request_duration`]:f,[`${x}.cache_duration`]:O,[`${x}.waiting_time`]:g,[`${x}.dns_time`]:d,[`${x}.connection_time`]:P,[`${x}.request_time`]:f}),q=this.tracer.startSpan(c);q.setAttributes(X),u&&u(_,q),q.end()},this.vitalsToTrack=[...r],this.lcpOpts=n,this.clsOpts=o,this.inpOpts=a,this.fidOpts=i,this.fcpOpts=E,this.ttfbOpts=T,this._isEnabled=t,this._setupWebVitalsCallbacks()}init(){}_setupWebVitalsCallbacks(){this.vitalsToTrack.includes("CLS")&&aA(t=>{this.onReportCLS(t,this.clsOpts)},this.clsOpts),this.vitalsToTrack.includes("LCP")&&AA(t=>{this.onReportLCP(t,this.lcpOpts)},this.lcpOpts),this.vitalsToTrack.includes("INP")&&pA(t=>{this.onReportINP(t,this.inpOpts)},this.inpOpts),this.vitalsToTrack.includes("FID")&&NA(t=>{this.onReportFID(t,this.fidOpts)},this.fidOpts),this.vitalsToTrack.includes("TTFB")&&dA(t=>{this.onReportTTFB(t,this.ttfbOpts)},this.ttfbOpts),this.vitalsToTrack.includes("FCP")&&iA(t=>{this.onReportFCP(t,this.fcpOpts)},this.fcpOpts)}getAttrPrefix(t){return t.toLowerCase()}getSharedAttributes(t){let{name:r,id:n,delta:o,rating:a,value:i,navigationType:E}=t,T=this.getAttrPrefix(r);return{[`${T}.id`]:n,[`${T}.delta`]:o,[`${T}.value`]:i,[`${T}.rating`]:a,[`${T}.navigation_type`]:E}}getAttributesForPerformanceLongAnimationFrameTiming(t,r){return{[`${t}.duration`]:r.duration,[`${t}.entryType`]:r.entryType,[`${t}.name`]:r.name,[`${t}.renderStart`]:r.renderStart,[`${t}.startTime`]:r.startTime}}getAttributesForPerformanceScriptTiming(t,r){return{[`${t}.entry_type`]:r.entryType,[`${t}.start_time`]:r.startTime,[`${t}.execution_start`]:r.executionStart,[`${t}.duration`]:r.duration,[`${t}.forced_style_and_layout_duration`]:r.forcedStyleAndLayoutDuration,[`${t}.invoker`]:r.invoker,[`${t}.pause_duration`]:r.pauseDuration,[`${t}.source_url`]:r.sourceURL,[`${t}.source_function_name`]:r.sourceFunctionName,[`${t}.source_char_position`]:r.sourceCharPosition,[`${t}.window_attribution`]:r.windowAttribution}}processPerformanceLongAnimationFrameTimingSpans(t,r){if(!r)return;let n=`${t}.timing`,o=this.getAttributesForPerformanceLongAnimationFrameTiming(n,r);this.tracer.startActiveSpan(r.name,{startTime:r.startTime},a=>{a.setAttributes(o),this.processPerformanceScriptTimingSpans(n,r.scripts),a.end(r.startTime+r.duration)})}processPerformanceScriptTimingSpans(t,r){if(!r||!r?.length)return;let n=`${t}.script`;r.map(o=>{this.tracer.startActiveSpan(o.name,{startTime:o.startTime},a=>{let i=this.getAttributesForPerformanceScriptTiming(n,o);a.setAttributes(i),a.end(o.startTime+o.duration)})})}disable(){if(!this.isEnabled()){this._diag.debug("Instrumentation already disabled");return}this._isEnabled=!1,this._diag.debug("Instrumentation disabled")}enable(){if(this.isEnabled()){this._diag.debug("Instrumentation already enabled");return}this._isEnabled=!0,this._diag.debug("Instrumentation enabled"),this._diag.debug(`Sending spans for ${this.vitalsToTrack.join(",")}`)}isEnabled(){return this._isEnabled}},tT="@honeycombio/instrumentation-global-errors";function mA(e){if(!e)return{};let t=(0,G_.computeStackTrace)(e).stack,r=[],n=[],o=[],a=[];return Array.isArray(t)?(t.forEach(i=>{r.push(i.line),n.push(i.column),o.push(i.func),a.push(i.url)}),{"exception.structured_stacktrace.columns":n,"exception.structured_stacktrace.lines":r,"exception.structured_stacktrace.functions":o,"exception.structured_stacktrace.urls":a}):{}}function PA(e,t={},r=C.getTracer(tT),n){let o=e.message,a=e.name,i=Object.assign(Object.assign({[WE]:a,[kE]:o,[KE]:e.stack},mA(e)),t),E=r.startSpan("exception",{attributes:i},I.active());n&&n(E,e),E.setStatus({code:me.ERROR,message:o}),E.end()}var ri=class extends oo{constructor({enabled:t=!0,applyCustomAttributesOnSpan:r}={}){let n={enabled:t,applyCustomAttributesOnSpan:r};super(tT,pr,n),this.onError=o=>{let a="reason"in o?o.reason:o.error;console.log(this.applyCustomAttributesOnSpan),a&&PA(a,{},this.tracer,this.applyCustomAttributesOnSpan)},t&&this.enable(),this._isEnabled=t,this.applyCustomAttributesOnSpan=r}init(){}disable(){if(!this.isEnabled()){this._diag.debug("Instrumentation already disabled");return}this._isEnabled=!1,window.removeEventListener("error",this.onError),window.removeEventListener("unhandledrejection",this.onError),this._diag.debug("Instrumentation disabled")}enable(){if(this.isEnabled()){this._diag.debug("Instrumentation already enabled");return}this._isEnabled=!0,window.addEventListener("error",this.onError),window.addEventListener("unhandledrejection",this.onError),this._diag.debug("Instrumentation enabled")}isEnabled(){return this._isEnabled}},ao=class extends Wa{constructor(t){var r,n;let o=[...t?.instrumentations||[]];((r=t?.webVitalsInstrumentationConfig)===null||r===void 0?void 0:r.enabled)!==!1&&o.push(new mr(t?.webVitalsInstrumentationConfig)),((n=t?.globalErrorsInstrumentationConfig)===null||n===void 0?void 0:n.enabled)!==!1&&o.push(new ri(t?.globalErrorsInstrumentationConfig)),super(Object.assign(Object.assign({},t),{instrumentations:o,resource:Lp([hp(),Rp(t?.entryPageAttributes),t?.resource,t?.resourceAttributes,vp()]),sampler:rA(t),spanProcessor:tA(t)})),Fp(t),t?.debug&&kp(t)}};var dt=performance;var Ei="traceparent";var MA="(?!ff)[\\da-f]{2}",hA="(?![0]{32})[\\da-f]{32}",LA="(?![0]{16})[\\da-f]{16}",gA="[\\da-f]{2}",qm=new RegExp(`^\\s?(${MA})-(${hA})-(${LA})-(${gA})(-.*)?\\s?$`);var H;(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"})(H||(H={}));var rT="http.response_content_length",nT="http.response_content_length_uncompressed";function je(e,t){return t in e}function Z(e,t,r,n=!0){if(je(r,t)&&typeof r[t]=="number"&&!(n&&r[t]===0))return e.addEvent(t,r[t])}function To(e,t,r=!1,n,o){if(n===void 0&&(n=t[H.START_TIME]!==0),r||(Z(e,H.FETCH_START,t,n),Z(e,H.DOMAIN_LOOKUP_START,t,n),Z(e,H.DOMAIN_LOOKUP_END,t,n),Z(e,H.CONNECT_START,t,n),Z(e,H.SECURE_CONNECTION_START,t,n),Z(e,H.CONNECT_END,t,n),Z(e,H.REQUEST_START,t,n),Z(e,H.RESPONSE_START,t,n),Z(e,H.RESPONSE_END,t,n)),!o){let a=t[H.ENCODED_BODY_SIZE];a!==void 0&&e.setAttribute(rT,a);let i=t[H.DECODED_BODY_SIZE];i!==void 0&&a!==i&&e.setAttribute(nT,i)}}var hr=class{emit(t){}},oT=new hr;var _i=class{getLogger(t,r,n){return new hr}},So=new _i;var uo=class{constructor(t,r,n,o){this._provider=t,this.name=r,this.version=n,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):oT}};var Lr=class{getLogger(t,r,n){var o;return(o=this.getDelegateLogger(t,r,n))!==null&&o!==void 0?o:new uo(this,t,r,n)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:So}setDelegate(t){this._delegate=t}getDelegateLogger(t,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,r,n)}};var Ti=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var gr=Symbol.for("io.opentelemetry.js.api.logs"),Ht=Ti;function aT(e,t,r){return n=>n===e?t:r}var Si=1;var co=class e{constructor(){this._proxyLoggerProvider=new Lr}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Ht[gr]?this.getLoggerProvider():(Ht[gr]=aT(Si,t,So),this._proxyLoggerProvider.setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=Ht[gr])===null||t===void 0?void 0:t.call(Ht,Si))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete Ht[gr],this._proxyLoggerProvider=new Lr}};var iT=co.getInstance();var Ae=console.error.bind(console);function Cr(e,t,r){let n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}var po=(e,t,r)=>{if(!e||!e[t]){Ae("no original function "+String(t)+" to wrap");return}if(!r){Ae("no wrapper function"),Ae(new Error().stack);return}let n=e[t];if(typeof n!="function"||typeof r!="function"){Ae("original object and wrapper must be functions");return}let o=r(n,t);return Cr(o,"__original",n),Cr(o,"__unwrap",()=>{e[t]===o&&Cr(e,t,n)}),Cr(o,"__wrapped",!0),Cr(e,t,o),o},ui=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Ae("must provide one or more modules to patch"),Ae(new Error().stack);return}if(!(t&&Array.isArray(t))){Ae("must provide one or more functions to wrap on modules");return}e.forEach(n=>{t.forEach(o=>{po(n,o,r)})})},Ao=(e,t)=>{if(!e||!e[t]){Ae("no function to unwrap."),Ae(new Error().stack);return}let r=e[t];if(!r.__unwrap)Ae("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{r.__unwrap();return}},ci=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Ae("must provide one or more modules to patch"),Ae(new Error().stack);return}if(!(t&&Array.isArray(t))){Ae("must provide one or more functions to unwrap on modules");return}e.forEach(r=>{t.forEach(n=>{Ao(r,n)})})};function Dr(e){e&&e.logger&&(typeof e.logger!="function"?Ae("new logger isn't a function, not replacing"):Ae=e.logger)}Dr.wrap=po;Dr.massWrap=ui;Dr.unwrap=Ao;Dr.massUnwrap=ci;var lo=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,r,n){this.instrumentationName=t,this.instrumentationVersion=r,this.setConfig(n),this._diag=l.createComponentLogger({namespace:t}),this._tracer=C.getTracer(t,r),this._meter=ce.getMeter(t,r),this._logger=iT.getLogger(t,r),this._updateMetricInstruments()}_wrap=po;_unwrap=Ao;_massWrap=ui;_massUnwrap=ci;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,r,n,o){if(t)try{t(n,o)}catch(a){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},a)}}};var Yt=class extends lo{constructor(t,r,n){super(t,r,n),this._config.enabled&&this.enable()}};function fo(e,t,r){let n,o;try{o=e()}catch(a){n=a}finally{if(t(n,o),n&&!r)throw n;return o}}var vt;(function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"})(vt||(vt={}));var sT="0.48.0",ET="@opentelemetry/instrumentation-document-load";var Ir;(function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"})(Ir||(Ir={}));var TT=()=>{let e={},t=dt.getEntriesByType?.("navigation")[0];if(t)Object.values(H).forEach(n=>{if(je(t,n)){let o=t[n];typeof o=="number"&&(e[n]=o)}});else{let n=dt.timing;n&&Object.values(H).forEach(a=>{if(je(n,a)){let i=n[a];typeof i=="number"&&(e[a]=i)}})}return e},_T={"first-paint":Ir.FIRST_PAINT,"first-contentful-paint":Ir.FIRST_CONTENTFUL_PAINT},ST=e=>{let t=dt.getEntriesByType?.("paint");t&&t.forEach(({name:r,startTime:n})=>{je(_T,r)&&e.addEvent(_T[r],n)})};var xr=class extends Yt{component="document-load";version="1";moduleName=this.component;constructor(t={}){super(ET,sT,t)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(t){let r=dt.getEntriesByType?.("resource");r&&r.forEach(n=>{this._initResourceSpan(n,t)})}_collectPerformance(){let t=Array.from(document.getElementsByTagName("meta")).find(o=>o.getAttribute("name")===Ei),r=TT(),n=t&&t.content||"";I.with(Q.extract(he,{traceparent:n}),()=>{let o=this._startSpan(vt.DOCUMENT_LOAD,H.FETCH_START,r);o&&(I.with(C.setSpan(I.active(),o),()=>{let a=this._startSpan(vt.DOCUMENT_FETCH,H.FETCH_START,r);a&&(a.setAttribute(Fn,location.href),I.with(C.setSpan(I.active(),a),()=>{To(a,r,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(a,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(a,H.RESPONSE_END,r)}))}),o.setAttribute(Fn,location.href),o.setAttribute(YE,navigator.userAgent),this._addResourcesSpans(o),this.getConfig().ignoreNetworkEvents||(Z(o,H.FETCH_START,r),Z(o,H.UNLOAD_EVENT_START,r),Z(o,H.UNLOAD_EVENT_END,r),Z(o,H.DOM_INTERACTIVE,r),Z(o,H.DOM_CONTENT_LOADED_EVENT_START,r),Z(o,H.DOM_CONTENT_LOADED_EVENT_END,r),Z(o,H.DOM_COMPLETE,r),Z(o,H.LOAD_EVENT_START,r),Z(o,H.LOAD_EVENT_END,r)),this.getConfig().ignorePerformancePaintEvents||ST(o),this._addCustomAttributesOnSpan(o,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(o,H.LOAD_EVENT_END,r))})}_endSpan(t,r,n){t&&(je(n,r)?t.end(n[r]):t.end())}_initResourceSpan(t,r){let n=this._startSpan(vt.RESOURCE_FETCH,H.FETCH_START,t,r);n&&(n.setAttribute(Fn,t.name),To(n,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,t,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,H.RESPONSE_END,t))}_startSpan(t,r,n,o){if(je(n,r)&&typeof n[r]=="number")return this.tracer.startSpan(t,{startTime:n[r]},o?C.setSpan(I.active(),o):void 0)}_waitForPageLoad(){window.document.readyState==="complete"?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(t,r){r&&fo(()=>r(t),n=>{n&&this._diag.error("addCustomAttributesOnSpan",n)},!0)}_addCustomAttributesOnResourceSpan(t,r,n){n&&fo(()=>n(t,r),o=>{o&&this._diag.error("addCustomAttributesOnResourceSpan",o)},!0)}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}};var Ur=class{emit(t){}},uT=new Ur;var pi=class{getLogger(t,r,n){return new Ur}},vo=new pi;var Ro=class{constructor(t,r,n,o){this._provider=t,this.name=r,this.version=n,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):uT}};var br=class{getLogger(t,r,n){var o;return(o=this.getDelegateLogger(t,r,n))!==null&&o!==void 0?o:new Ro(this,t,r,n)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:vo}setDelegate(t){this._delegate=t}getDelegateLogger(t,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,r,n)}};var Ai=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var yr=Symbol.for("io.opentelemetry.js.api.logs"),Ft=Ai;function cT(e,t,r){return n=>n===e?t:r}var li=1;var Oo=class e{constructor(){this._proxyLoggerProvider=new br}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Ft[yr]?this.getLoggerProvider():(Ft[yr]=cT(li,t,vo),this._proxyLoggerProvider.setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=Ft[yr])===null||t===void 0?void 0:t.call(Ft,li))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete Ft[yr],this._proxyLoggerProvider=new br}};var pT=Oo.getInstance();var le=console.error.bind(console);function Vr(e,t,r){let n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}var No=(e,t,r)=>{if(!e||!e[t]){le("no original function "+String(t)+" to wrap");return}if(!r){le("no wrapper function"),le(new Error().stack);return}let n=e[t];if(typeof n!="function"||typeof r!="function"){le("original object and wrapper must be functions");return}let o=r(n,t);return Vr(o,"__original",n),Vr(o,"__unwrap",()=>{e[t]===o&&Vr(e,t,n)}),Vr(o,"__wrapped",!0),Vr(e,t,o),o},fi=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{le("must provide one or more modules to patch"),le(new Error().stack);return}if(!(t&&Array.isArray(t))){le("must provide one or more functions to wrap on modules");return}e.forEach(n=>{t.forEach(o=>{No(n,o,r)})})},mo=(e,t)=>{if(!e||!e[t]){le("no function to unwrap."),le(new Error().stack);return}let r=e[t];if(!r.__unwrap)le("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{r.__unwrap();return}},di=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{le("must provide one or more modules to patch"),le(new Error().stack);return}if(!(t&&Array.isArray(t))){le("must provide one or more functions to unwrap on modules");return}e.forEach(r=>{t.forEach(n=>{mo(r,n)})})};function wr(e){e&&e.logger&&(typeof e.logger!="function"?le("new logger isn't a function, not replacing"):le=e.logger)}wr.wrap=No;wr.massWrap=fi;wr.unwrap=mo;wr.massUnwrap=di;var Po=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,r,n){this.instrumentationName=t,this.instrumentationVersion=r,this.setConfig(n),this._diag=l.createComponentLogger({namespace:t}),this._tracer=C.getTracer(t,r),this._meter=ce.getMeter(t,r),this._logger=pT.getLogger(t,r),this._updateMetricInstruments()}_wrap=No;_unwrap=mo;_massWrap=fi;_massUnwrap=di;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,r,n,o){if(t)try{t(n,o)}catch(a){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},a)}}};var kt=class extends Po{constructor(t,r,n){super(t,r,n),this._config.enabled&&this.enable()}};function Mo(e,t,r){let n,o;try{o=e()}catch(a){n=a}finally{if(t(n,o),n&&!r)throw n;return o}}function vi(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}var ie;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(ie||(ie={}));function Ri(e,t){let r=ie.OLD,n=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of n??[])if(o.toLowerCase()===e+"/dup"){r=ie.DUPLICATE;break}else o.toLowerCase()===e&&(r=ie.STABLE);return r}var Kt=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var Wt=performance;var IA=9,xA=6,UA=Math.pow(10,xA),Oi=Math.pow(10,IA);function Rt(e){let t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*UA);return[r,n]}function Ni(){let e=Wt.timeOrigin;if(typeof e!="number"){let t=Wt;e=t.timing&&t.timing.fetchStart}return e}function Br(e){let t=Rt(Ni()),r=Rt(typeof e=="number"?e:Wt.now());return lT(t,r)}function Ot(e){if(AT(e))return e;if(typeof e=="number")return e=Oi&&(r[1]-=Oi,r[0]+=1),r}function ho(e,t){return typeof t=="string"?e===t:!!e.match(t)}function mi(e,t){if(!t)return!1;for(let r of t)if(ho(e,r))return!0;return!1}var K;(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"})(K||(K={}));var fT="http.response_content_length",dT="http.response_content_length_uncompressed";var Pi;function yA(){return Pi||(Pi=document.createElement("a")),Pi}function vT(e,t){return t in e}function we(e,t,r,n=!0){if(vT(r,t)&&typeof r[t]=="number"&&!(n&&r[t]===0))return e.addEvent(t,r[t])}function Lo(e,t,r=!1,n,o){if(n===void 0&&(n=t[K.START_TIME]!==0),r||(we(e,K.FETCH_START,t,n),we(e,K.DOMAIN_LOOKUP_START,t,n),we(e,K.DOMAIN_LOOKUP_END,t,n),we(e,K.CONNECT_START,t,n),we(e,K.SECURE_CONNECTION_START,t,n),we(e,K.CONNECT_END,t,n),we(e,K.REQUEST_START,t,n),we(e,K.RESPONSE_START,t,n),we(e,K.RESPONSE_END,t,n)),!o){let a=t[K.ENCODED_BODY_SIZE];a!==void 0&&e.setAttribute(fT,a);let i=t[K.DECODED_BODY_SIZE];i!==void 0&&a!==i&&e.setAttribute(dT,i)}}function RT(e){return e.slice().sort((t,r)=>{let n=t[K.FETCH_START],o=r[K.FETCH_START];return n>o?1:n1){let s=T[0],_=VA(T,s[K.RESPONSE_END],r),S=s[K.RESPONSE_END];return _[K.FETCH_START]=o&&(!i||u{let _=Ve(Ot(s[K.FETCH_START])),S=Ve(Ot(s[K.RESPONSE_END]));return s.initiatorType.toLowerCase()===(a||"xmlhttprequest")&&s.name===e&&_>=i&&S<=E});return T.length>0&&(T=T.filter(s=>!o.has(s))),T}function Xt(e){if(typeof URL=="function")return new URL(e,typeof document<"u"?document.baseURI:typeof location<"u"?location.href:void 0);let t=yA();return t.href=e,t}function hi(e,t){let r=t||[];return(typeof r=="string"||r instanceof RegExp)&&(r=[r]),Xt(e).origin===OT()?!0:r.some(o=>ho(e,o))}var Gr;(function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"})(Gr||(Gr={}));var se=tr(NT());var mT=l.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function PT(...e){if(e[0]instanceof URL||typeof e[0]=="string"){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:r,length:n}=GA(t.body);return t.body=r,n}else return Promise.resolve(YA(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(r=>Li(r)):Promise.resolve()}}function GA(e){if(!e.pipeThrough)return mT.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t=0,r,n=new Promise(a=>{r=a}),o=new TransformStream({start(){},async transform(a,i){let E=await a;t+=E.byteLength,i.enqueue(a)},flush(){r(t)}});return{body:e.pipeThrough(o),length:n}}function HA(e){return typeof Document<"u"&&e instanceof Document}function YA(e){if(HA(e))return new XMLSerializer().serializeToString(document).length;if(typeof e=="string")return Li(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return kA(e);if(e instanceof URLSearchParams)return Li(e.toString());if(e.byteLength!==void 0)return e.byteLength;mT.warn("unknown body type")}var FA=new TextEncoder;function Li(e){return FA.encode(e).byteLength}function kA(e){let t=0;for(let[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}function MT(e){let t=WA(),r=e.toUpperCase();return r in t?r:"_OTHER"}var KA={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Hr;function WA(){if(Hr===void 0){let e=void 0;e&&e.length>0?(Hr={},e.forEach(t=>{Hr[t]=!0})):Hr=KA}return Hr}var XA={"https:":"443","http:":"80"};function hT(e){let t=Number(e.port||XA[e.protocol]);if(t&&!isNaN(t))return t}var gi="0.203.0";var jA=300,LT=typeof process=="object"&&process.release?.name==="node",Yr=class extends kt{component="fetch";version=gi;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(t={}){super("@opentelemetry/instrumentation-fetch",gi,t),this._semconvStability=Ri("http",t?.semconvStabilityOptIn)}init(){}_addChildSpan(t,r){let n=this.tracer.startSpan("CORS Preflight",{startTime:r[K.FETCH_START]},C.setSpan(I.active(),t)),o=!(this._semconvStability&ie.OLD);Lo(n,r,this.getConfig().ignoreNetworkEvents,void 0,o),n.end(r[K.RESPONSE_END])}_addFinalSpanAttributes(t,r){let n=Xt(r.url);if(this._semconvStability&ie.OLD&&(t.setAttribute(se.ATTR_HTTP_STATUS_CODE,r.status),r.statusText!=null&&t.setAttribute(Gr.HTTP_STATUS_TEXT,r.statusText),t.setAttribute(se.ATTR_HTTP_HOST,n.host),t.setAttribute(se.ATTR_HTTP_SCHEME,n.protocol.replace(":","")),typeof navigator<"u"&&t.setAttribute(se.ATTR_HTTP_USER_AGENT,navigator.userAgent)),this._semconvStability&ie.STABLE){t.setAttribute(Wn,r.status),t.setAttribute(Xn,n.hostname);let o=hT(n);o&&t.setAttribute(jn,o)}}_addHeaders(t,r){if(!hi(r,this.getConfig().propagateTraceHeaderCorsUrls)){let n={};Q.inject(I.active(),n),Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}if(t instanceof Request)Q.inject(I.active(),t.headers,{set:(n,o,a)=>n.set(o,typeof a=="string"?a:String(a))});else if(t.headers instanceof Headers)Q.inject(I.active(),t.headers,{set:(n,o,a)=>n.set(o,typeof a=="string"?a:String(a))});else if(t.headers instanceof Map)Q.inject(I.active(),t.headers,{set:(n,o,a)=>n.set(o,typeof a=="string"?a:String(a))});else{let n={};Q.inject(I.active(),n),t.headers=Object.assign({},n,t.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(t,r={}){if(mi(t,this.getConfig().ignoreUrls)){this._diag.debug("ignoring span as url matches ignored url");return}let n="",o={};if(this._semconvStability&ie.OLD){let a=(r.method||"GET").toUpperCase();n=`HTTP ${a}`,o[Gr.COMPONENT]=this.moduleName,o[se.ATTR_HTTP_METHOD]=a,o[se.ATTR_HTTP_URL]=t}if(this._semconvStability&ie.STABLE){let a=r.method,i=MT(r.method||"GET");n||(n=i),o[kn]=i,i!==a&&(o[Kn]=a),o[zn]=t}return this.tracer.startSpan(n,{kind:Ke.CLIENT,attributes:o})}_findResourceAndAddNetworkEvents(t,r,n){let o=r.entries;if(!o.length){if(!performance.getEntriesByType)return;o=performance.getEntriesByType("resource")}let a=Mi(r.spanUrl,r.startTime,n,o,this._usedResources,"fetch");if(a.mainRequest){let i=a.mainRequest;this._markResourceAsUsed(i);let E=a.corsPreFlightRequest;E&&(this._addChildSpan(t,E),this._markResourceAsUsed(E));let T=!(this._semconvStability&ie.OLD);Lo(t,i,this.getConfig().ignoreNetworkEvents,void 0,T)}}_markResourceAsUsed(t){this._usedResources.add(t)}_endSpan(t,r,n){let o=Rt(Date.now()),a=Br();this._addFinalSpanAttributes(t,n),this._semconvStability&ie.STABLE&&n.status>=400&&(t.setStatus({code:me.ERROR}),t.setAttribute(cr,String(n.status))),setTimeout(()=>{r.observer?.disconnect(),this._findResourceAndAddNetworkEvents(t,r,a),this._tasksCount--,this._clearResources(),t.end(o)},jA)}_patchConstructor(){return t=>{let r=this;return function(...o){let a=this,i=Xt(o[0]instanceof Request?o[0].url:String(o[0])).href,E=o[0]instanceof Request?o[0]:o[1]||{},T=r._createSpan(i,E);if(!T)return t.apply(this,o);let s=r._prepareSpanData(i);r.getConfig().measureRequestSize&&PT(...o).then(p=>{p&&(r._semconvStability&ie.OLD&&T.setAttribute(se.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED,p),r._semconvStability&ie.STABLE&&T.setAttribute(se.ATTR_HTTP_REQUEST_BODY_SIZE,p))}).catch(p=>{r._diag.warn("getFetchBodyLength",p)});function _(p,O){r._applyAttributesAfterFetch(p,E,O),r._endSpan(p,s,{status:O.status||0,statusText:O.message,url:i})}function S(p,O){r._applyAttributesAfterFetch(p,E,O),O.status>=200&&O.status<400?r._endSpan(p,s,O):r._endSpan(p,s,{status:O.status,statusText:O.statusText,url:i})}function u(p,O,P){try{let f=P.clone().body;if(f){let g=f.getReader(),x=()=>{g.read().then(({done:X})=>{X?S(p,P):x()},X=>{_(p,X)})};x()}else S(p,P)}finally{O(P)}}function c(p,O,P){try{_(p,P)}finally{O(P)}}return new Promise((p,O)=>I.with(C.setSpan(I.active(),T),()=>(r._addHeaders(E,i),r._callRequestHook(T,E),r._tasksCount++,t.apply(a,E instanceof Request?[E]:[i,E]).then(u.bind(a,T,p),c.bind(a,T,O)))))}}}_applyAttributesAfterFetch(t,r,n){let o=this.getConfig().applyCustomAttributesOnSpan;o&&Mo(()=>o(t,r,n),a=>{a&&this._diag.error("applyCustomAttributesOnSpan",a)},!0)}_callRequestHook(t,r){let n=this.getConfig().requestHook;n&&Mo(()=>n(t,r),o=>{o&&this._diag.error("requestHook",o)},!0)}_prepareSpanData(t){let r=Br(),n=[];if(typeof PerformanceObserver!="function")return{entries:n,startTime:r,spanUrl:t};let o=new PerformanceObserver(a=>{a.getEntries().forEach(E=>{E.initiatorType==="fetch"&&E.name===t&&n.push(E)})});return o.observe({entryTypes:["resource"]}),{entries:n,observer:o,startTime:r,spanUrl:t}}enable(){if(LT){this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()");return}vi(fetch)&&(this._unwrap(Kt,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Kt,"fetch",this._patchConstructor())}disable(){LT||(this._unwrap(Kt,"fetch"),this._usedResources=new WeakSet)}};var Fr=class{emit(t){}},gT=new Fr;var Ci=class{getLogger(t,r,n){return new Fr}},go=new Ci;var Co=class{constructor(t,r,n,o){this._provider=t,this.name=r,this.version=n,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):gT}};var kr=class{getLogger(t,r,n){var o;return(o=this.getDelegateLogger(t,r,n))!==null&&o!==void 0?o:new Co(this,t,r,n)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:go}setDelegate(t){this._delegate=t}getDelegateLogger(t,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,r,n)}};var Di=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var Kr=Symbol.for("io.opentelemetry.js.api.logs"),jt=Di;function CT(e,t,r){return n=>n===e?t:r}var Ii=1;var Do=class e{constructor(){this._proxyLoggerProvider=new kr}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return jt[Kr]?this.getLoggerProvider():(jt[Kr]=CT(Ii,t,go),this._proxyLoggerProvider.setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=jt[Kr])===null||t===void 0?void 0:t.call(jt,Ii))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete jt[Kr],this._proxyLoggerProvider=new kr}};var DT=Do.getInstance();var fe=console.error.bind(console);function Wr(e,t,r){let n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}var Io=(e,t,r)=>{if(!e||!e[t]){fe("no original function "+String(t)+" to wrap");return}if(!r){fe("no wrapper function"),fe(new Error().stack);return}let n=e[t];if(typeof n!="function"||typeof r!="function"){fe("original object and wrapper must be functions");return}let o=r(n,t);return Wr(o,"__original",n),Wr(o,"__unwrap",()=>{e[t]===o&&Wr(e,t,n)}),Wr(o,"__wrapped",!0),Wr(e,t,o),o},xi=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{fe("must provide one or more modules to patch"),fe(new Error().stack);return}if(!(t&&Array.isArray(t))){fe("must provide one or more functions to wrap on modules");return}e.forEach(n=>{t.forEach(o=>{Io(n,o,r)})})},xo=(e,t)=>{if(!e||!e[t]){fe("no function to unwrap."),fe(new Error().stack);return}let r=e[t];if(!r.__unwrap)fe("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{r.__unwrap();return}},Ui=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{fe("must provide one or more modules to patch"),fe(new Error().stack);return}if(!(t&&Array.isArray(t))){fe("must provide one or more functions to unwrap on modules");return}e.forEach(r=>{t.forEach(n=>{xo(r,n)})})};function Xr(e){e&&e.logger&&(typeof e.logger!="function"?fe("new logger isn't a function, not replacing"):fe=e.logger)}Xr.wrap=Io;Xr.massWrap=xi;Xr.unwrap=xo;Xr.massUnwrap=Ui;var Uo=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,r,n){this.instrumentationName=t,this.instrumentationVersion=r,this.setConfig(n),this._diag=l.createComponentLogger({namespace:t}),this._tracer=C.getTracer(t,r),this._meter=ce.getMeter(t,r),this._logger=DT.getLogger(t,r),this._updateMetricInstruments()}_wrap=Io;_unwrap=xo;_massWrap=xi;_massUnwrap=Ui;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,r,n,o){if(t)try{t(n,o)}catch(a){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},a)}}};var zt=class extends Uo{constructor(t,r,n){super(t,r,n),this._config.enabled&&this.enable()}};function te(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}var bi=performance;var qA=9,$A=6,QA=Math.pow(10,$A),IT=Math.pow(10,qA);function yi(e){let t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*QA);return[r,n]}function Vi(e){let t=yi(bi.timeOrigin),r=yi(typeof e=="number"?e:bi.now());return xT(t,r)}function xT(e,t){let r=[e[0]+t[0],e[1]+t[1]];return r[1]>=IT&&(r[1]-=IT,r[0]+=1),r}function bo(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return"/";let r=JA(e,t);if(t&&r.indexOf("@id")>0)return r;let n="";return e.parentNode&&(n+=bo(e.parentNode,!1)),n+=r,n}function ZA(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let r=Array.from(e.parentNode.childNodes);return r=r.filter(n=>{let o=n.localName;return t.indexOf(n.nodeType)>=0&&o===e.localName}),r.length>=1?r.indexOf(e)+1:0}function JA(e,t){let r=e.nodeType,n=ZA(e),o="";if(r===Node.ELEMENT_NODE){let a=e.getAttribute("id");if(t&&a)return`//*[@id="${a}"]`;o=e.localName}else if(r===Node.TEXT_NODE||r===Node.CDATA_SECTION_NODE)o="text()";else if(r===Node.COMMENT_NODE)o="comment()";else return"";return o&&n>1?`/${o}[${n}]`:`/${o}`}var Nt;(function(e){e.EVENT_TYPE="event_type",e.TARGET_ELEMENT="target_element",e.TARGET_XPATH="target_xpath",e.HTTP_URL="http.url"})(Nt||(Nt={}));var wi="0.48.1",UT="@opentelemetry/instrumentation-user-interaction";var el="OT_ZONE_CONTEXT",tl="Navigation:",rl=["click"];function nl(){return!1}var jr=class extends zt{version=wi;moduleName="user-interaction";_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(t={}){super(UT,wi,t),this._eventNames=new Set(t?.eventNames??rl),this._shouldPreventSpanCreation=typeof t?.shouldPreventSpanCreation=="function"?t.shouldPreventSpanCreation:nl}init(){}_checkForTimeout(t,r){let n=this._spansData.get(r);n&&(t.source==="setTimeout"?n.hrTimeLastTimeout=Vi():t.source!=="Promise.then"&&t.source!=="setTimeout"&&(n.hrTimeLastTimeout=void 0))}_allowEventName(t){return this._eventNames.has(t)}_createSpan(t,r,n){if(!(t instanceof HTMLElement)||!t.getAttribute||t.hasAttribute("disabled")||!this._allowEventName(r))return;let o=bo(t,!0);try{let a=this.tracer.startSpan(r,{attributes:{[Nt.EVENT_TYPE]:r,[Nt.TARGET_ELEMENT]:t.tagName,[Nt.TARGET_XPATH]:o,[Nt.HTTP_URL]:window.location.href}},n?C.setSpan(I.active(),n):void 0);return this._shouldPreventSpanCreation(r,t,a)===!0?void 0:(this._spansData.set(a,{taskCount:0}),a)}catch(a){this._diag.error("failed to start create new user interaction span",a)}}_decrementTask(t){let r=this._spansData.get(t);r&&(r.taskCount--,r.taskCount===0&&this._tryToEndSpan(t,r.hrTimeLastTimeout))}_getCurrentSpan(t){let r=t.get(el);return r&&C.getSpan(r)}_incrementTask(t){let r=this._spansData.get(t);r&&r.taskCount++}addPatchedListener(t,r,n,o){let a=this._wrappedListeners.get(n);a||(a=new Map,this._wrappedListeners.set(n,a));let i=a.get(r);return i||(i=new Map,a.set(r,i)),i.has(t)?!1:(i.set(t,o),!0)}removePatchedListener(t,r,n){let o=this._wrappedListeners.get(n);if(!o)return;let a=o.get(r);if(!a)return;let i=a.get(t);return i&&(a.delete(t),a.size===0&&(o.delete(r),o.size===0&&this._wrappedListeners.delete(n))),i}_invokeListener(t,r,n){return typeof t=="function"?t.apply(r,n):t.handleEvent(n[0])}_patchAddEventListener(){let t=this;return r=>function(o,a,i){if(!a)return r.call(this,o,a,i);let E=i&&typeof i=="object"&&i.once,T=function(...s){let _,S=s[0],u=S?.target;S&&(_=t._eventsSpanMap.get(S)),E&&t.removePatchedListener(this,o,a);let c=t._createSpan(u,o,_);return c?(S&&t._eventsSpanMap.set(S,c),I.with(C.setSpan(I.active(),c),()=>{let p=t._invokeListener(a,this,s);return c.end(),p})):t._invokeListener(a,this,s)};if(t.addPatchedListener(this,o,a,T))return r.call(this,o,T,i)}}_patchRemoveEventListener(){let t=this;return r=>function(o,a,i){let E=t.removePatchedListener(this,o,a);return E?r.call(this,o,E,i):r.call(this,o,a,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,"replaceState",this._patchHistoryMethod()),this._wrap(history,"pushState",this._patchHistoryMethod()),this._wrap(history,"back",this._patchHistoryMethod()),this._wrap(history,"forward",this._patchHistoryMethod()),this._wrap(history,"go",this._patchHistoryMethod())}_patchHistoryMethod(){let t=this;return r=>function(...o){let a=`${location.pathname}${location.hash}${location.search}`,i=r.apply(this,o),E=`${location.pathname}${location.hash}${location.search}`;return a!==E&&t._updateInteractionName(E),i}}_unpatchHistoryApi(){te(history.replaceState)&&this._unwrap(history,"replaceState"),te(history.pushState)&&this._unwrap(history,"pushState"),te(history.back)&&this._unwrap(history,"back"),te(history.forward)&&this._unwrap(history,"forward"),te(history.go)&&this._unwrap(history,"go")}_updateInteractionName(t){let r=C.getSpan(I.active());r&&typeof r.updateName=="function"&&r.updateName(`${tl} ${t}`)}_patchZoneCancelTask(){let t=this;return r=>function(o){let a=Zone.current,i=t._getCurrentSpan(a);return i&&t._shouldCountTask(o,a)&&t._decrementTask(i),r.call(this,o)}}_patchZoneScheduleTask(){let t=this;return r=>function(o){let a=Zone.current,i=t._getCurrentSpan(a);return i&&t._shouldCountTask(o,a)&&(t._incrementTask(i),t._checkForTimeout(o,i)),r.call(this,o)}}_patchZoneRunTask(){let t=this;return r=>function(o,a,i){let T=(Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0)?.target,s,_=this;if(T){if(s=t._createSpan(T,o.eventName),s)return t._incrementTask(s),_.run(()=>{try{return I.with(C.setSpan(I.active(),s),()=>{let S=Zone.current;return o._zone=S,r.call(S,o,a,i)})}finally{t._decrementTask(s)}})}else s=t._getCurrentSpan(_);try{return r.call(_,o,a,i)}finally{s&&t._shouldCountTask(o,_)&&t._decrementTask(s)}}}_shouldCountTask(t,r){if(t._zone&&(r=t._zone),!r||!t.data||t.data.isPeriodic)return!1;let n=this._getCurrentSpan(r);return!n||!this._spansData.get(n)?!1:t.type==="macroTask"||t.type==="microTask"}_tryToEndSpan(t,r){t&&this._spansData.get(t)&&(t.end(r),this._spansData.delete(t))}enable(){let t=this._getZoneWithPrototype();this._diag.debug("applying patch to",this.moduleName,this.version,"zone:",!!t),t?(te(t.prototype.runTask)&&(this._unwrap(t.prototype,"runTask"),this._diag.debug("removing previous patch from method runTask")),te(t.prototype.scheduleTask)&&(this._unwrap(t.prototype,"scheduleTask"),this._diag.debug("removing previous patch from method scheduleTask")),te(t.prototype.cancelTask)&&(this._unwrap(t.prototype,"cancelTask"),this._diag.debug("removing previous patch from method cancelTask")),this._zonePatched=!0,this._wrap(t.prototype,"runTask",this._patchZoneRunTask()),this._wrap(t.prototype,"scheduleTask",this._patchZoneScheduleTask()),this._wrap(t.prototype,"cancelTask",this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(n=>{te(n.addEventListener)&&(this._unwrap(n,"addEventListener"),this._diag.debug("removing previous patch from method addEventListener")),te(n.removeEventListener)&&(this._unwrap(n,"removeEventListener"),this._diag.debug("removing previous patch from method removeEventListener")),this._wrap(n,"addEventListener",this._patchAddEventListener()),this._wrap(n,"removeEventListener",this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let t=this._getZoneWithPrototype();this._diag.debug("removing patch from",this.moduleName,this.version,"zone:",!!t),t&&this._zonePatched?(te(t.prototype.runTask)&&this._unwrap(t.prototype,"runTask"),te(t.prototype.scheduleTask)&&this._unwrap(t.prototype,"scheduleTask"),te(t.prototype.cancelTask)&&this._unwrap(t.prototype,"cancelTask")):this._getPatchableEventTargets().forEach(n=>{te(n.addEventListener)&&this._unwrap(n,"addEventListener"),te(n.removeEventListener)&&this._unwrap(n,"removeEventListener")}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}};var zr=class{emit(t){}},bT=new zr;var Bi=class{getLogger(t,r,n){return new zr}},yo=new Bi;var Vo=class{constructor(t,r,n,o){this._provider=t,this.name=r,this.version=n,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):bT}};var qr=class{getLogger(t,r,n){var o;return(o=this.getDelegateLogger(t,r,n))!==null&&o!==void 0?o:new Vo(this,t,r,n)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:yo}setDelegate(t){this._delegate=t}getDelegateLogger(t,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,r,n)}};var Gi=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var $r=Symbol.for("io.opentelemetry.js.api.logs"),qt=Gi;function yT(e,t,r){return n=>n===e?t:r}var Hi=1;var wo=class e{constructor(){this._proxyLoggerProvider=new qr}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return qt[$r]?this.getLoggerProvider():(qt[$r]=yT(Hi,t,yo),this._proxyLoggerProvider.setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=qt[$r])===null||t===void 0?void 0:t.call(qt,Hi))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete qt[$r],this._proxyLoggerProvider=new qr}};var VT=wo.getInstance();var de=console.error.bind(console);function Qr(e,t,r){let n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}var Bo=(e,t,r)=>{if(!e||!e[t]){de("no original function "+String(t)+" to wrap");return}if(!r){de("no wrapper function"),de(new Error().stack);return}let n=e[t];if(typeof n!="function"||typeof r!="function"){de("original object and wrapper must be functions");return}let o=r(n,t);return Qr(o,"__original",n),Qr(o,"__unwrap",()=>{e[t]===o&&Qr(e,t,n)}),Qr(o,"__wrapped",!0),Qr(e,t,o),o},Yi=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{de("must provide one or more modules to patch"),de(new Error().stack);return}if(!(t&&Array.isArray(t))){de("must provide one or more functions to wrap on modules");return}e.forEach(n=>{t.forEach(o=>{Bo(n,o,r)})})},Go=(e,t)=>{if(!e||!e[t]){de("no function to unwrap."),de(new Error().stack);return}let r=e[t];if(!r.__unwrap)de("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{r.__unwrap();return}},Fi=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{de("must provide one or more modules to patch"),de(new Error().stack);return}if(!(t&&Array.isArray(t))){de("must provide one or more functions to unwrap on modules");return}e.forEach(r=>{t.forEach(n=>{Go(r,n)})})};function Zr(e){e&&e.logger&&(typeof e.logger!="function"?de("new logger isn't a function, not replacing"):de=e.logger)}Zr.wrap=Bo;Zr.massWrap=Yi;Zr.unwrap=Go;Zr.massUnwrap=Fi;var Ho=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,r,n){this.instrumentationName=t,this.instrumentationVersion=r,this.setConfig(n),this._diag=l.createComponentLogger({namespace:t}),this._tracer=C.getTracer(t,r),this._meter=ce.getMeter(t,r),this._logger=VT.getLogger(t,r),this._updateMetricInstruments()}_wrap=Bo;_unwrap=Go;_massWrap=Yi;_massUnwrap=Fi;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,r,n,o){if(t)try{t(n,o)}catch(a){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},a)}}};var $t=class extends Ho{constructor(t,r,n){super(t,r,n),this._config.enabled&&this.enable()}};function ki(e,t,r){let n,o;try{o=e()}catch(a){n=a}finally{if(t(n,o),n&&!r)throw n;return o}}function Yo(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}var Ee;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(Ee||(Ee={}));function Ki(e,t){let r=Ee.OLD,n=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of n??[])if(o.toLowerCase()===e+"/dup"){r=Ee.DUPLICATE;break}else o.toLowerCase()===e&&(r=Ee.STABLE);return r}var ze=performance;var al=9,il=6,sl=Math.pow(10,il),Wi=Math.pow(10,al);function Jr(e){let t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*sl);return[r,n]}function Xi(){let e=ze.timeOrigin;if(typeof e!="number"){let t=ze;e=t.timing&&t.timing.fetchStart}return e}function en(e){let t=Jr(Xi()),r=Jr(typeof e=="number"?e:ze.now());return BT(t,r)}function mt(e){if(wT(e))return e;if(typeof e=="number")return e=Wi&&(r[1]-=Wi,r[0]+=1),r}function Fo(e,t){return typeof t=="string"?e===t:!!e.match(t)}function ji(e,t){if(!t)return!1;for(let r of t)if(Fo(e,r))return!0;return!1}var W;(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"})(W||(W={}));var GT="http.response_content_length",HT="http.response_content_length_uncompressed";var zi;function El(){return zi||(zi=document.createElement("a")),zi}function YT(e,t){return t in e}function Ge(e,t,r,n=!0){if(YT(r,t)&&typeof r[t]=="number"&&!(n&&r[t]===0))return e.addEvent(t,r[t])}function ko(e,t,r=!1,n,o){if(n===void 0&&(n=t[W.START_TIME]!==0),r||(Ge(e,W.FETCH_START,t,n),Ge(e,W.DOMAIN_LOOKUP_START,t,n),Ge(e,W.DOMAIN_LOOKUP_END,t,n),Ge(e,W.CONNECT_START,t,n),Ge(e,W.SECURE_CONNECTION_START,t,n),Ge(e,W.CONNECT_END,t,n),Ge(e,W.REQUEST_START,t,n),Ge(e,W.RESPONSE_START,t,n),Ge(e,W.RESPONSE_END,t,n)),!o){let a=t[W.ENCODED_BODY_SIZE];a!==void 0&&e.setAttribute(GT,a);let i=t[W.DECODED_BODY_SIZE];i!==void 0&&a!==i&&e.setAttribute(HT,i)}}function FT(e){return e.slice().sort((t,r)=>{let n=t[W.FETCH_START],o=r[W.FETCH_START];return n>o?1:n1){let s=T[0],_=_l(T,s[W.RESPONSE_END],r),S=s[W.RESPONSE_END];return _[W.FETCH_START]=o&&(!i||u{let _=Be(mt(s[W.FETCH_START])),S=Be(mt(s[W.RESPONSE_END]));return s.initiatorType.toLowerCase()===(a||"xmlhttprequest")&&s.name===e&&_>=i&&S<=E});return T.length>0&&(T=T.filter(s=>!o.has(s))),T}function qe(e){if(typeof URL=="function")return new URL(e,typeof document<"u"?document.baseURI:typeof location<"u"?location.href:void 0);let t=El();return t.href=e,t}function $i(e,t){let r=t||[];return(typeof r=="string"||r instanceof RegExp)&&(r=[r]),qe(e).origin===kT()?!0:r.some(o=>Fo(e,o))}var KT="http.host",WT="http.method",XT="http.request.body.size",jT="http.request_content_length_uncompressed";var zT="http.scheme",qT="http.status_code",$T="http.url",QT="http.user_agent";var He;(function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"})(He||(He={}));var Sl=l.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function ul(e){return typeof Document<"u"&&e instanceof Document}function JT(e){if(ul(e))return new XMLSerializer().serializeToString(document).length;if(typeof e=="string")return ZT(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return pl(e);if(e instanceof URLSearchParams)return ZT(e.toString());if(e.byteLength!==void 0)return e.byteLength;Sl.warn("unknown body type")}var cl=new TextEncoder;function ZT(e){return cl.encode(e).byteLength}function pl(e){let t=0;for(let[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}function eS(e){let t=ll(),r=e.toUpperCase();return r in t?r:"_OTHER"}var Al={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},tn;function ll(){if(tn===void 0){let e=void 0;e&&e.length>0?(tn={},e.forEach(t=>{tn[t]=!0})):tn=Al}return tn}var fl={"https:":"443","http:":"80"};function tS(e){let t=Number(e.port||fl[e.protocol]);if(t&&!isNaN(t))return t}var Qi="0.203.0";var Ko;(function(e){e.HTTP_STATUS_TEXT="http.status_text"})(Ko||(Ko={}));var dl=300,rn=class extends $t{component="xml-http-request";version=Qi;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(t={}){super("@opentelemetry/instrumentation-xml-http-request",Qi,t),this._semconvStability=Ki("http",t?.semconvStabilityOptIn)}init(){}_addHeaders(t,r){let n=qe(r).href;if(!$i(n,this.getConfig().propagateTraceHeaderCorsUrls)){let a={};Q.inject(I.active(),a),Object.keys(a).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}let o={};Q.inject(I.active(),o),Object.keys(o).forEach(a=>{t.setRequestHeader(a,String(o[a]))})}_addChildSpan(t,r){I.with(C.setSpan(I.active(),t),()=>{let n=this.tracer.startSpan("CORS Preflight",{startTime:r[W.FETCH_START]}),o=!(this._semconvStability&Ee.OLD);ko(n,r,this.getConfig().ignoreNetworkEvents,void 0,o),n.end(r[W.RESPONSE_END])})}_addFinalSpanAttributes(t,r,n){if(this._semconvStability&Ee.OLD){if(r.status!==void 0&&t.setAttribute(qT,r.status),r.statusText!==void 0&&t.setAttribute(Ko.HTTP_STATUS_TEXT,r.statusText),typeof n=="string"){let o=qe(n);t.setAttribute(KT,o.host),t.setAttribute(zT,o.protocol.replace(":",""))}t.setAttribute(QT,navigator.userAgent)}this._semconvStability&Ee.STABLE&&r.status&&t.setAttribute(Wn,r.status)}_applyAttributesAfterXHR(t,r){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n=="function"&&ki(()=>n(t,r),o=>{o&&this._diag.error("applyCustomAttributesOnSpan",o)},!0)}_addResourceObserver(t,r){let n=this._xhrMem.get(t);!n||typeof PerformanceObserver!="function"||typeof PerformanceResourceTiming!="function"||(n.createdResources={observer:new PerformanceObserver(o=>{let a=o.getEntries(),i=qe(r);a.forEach(E=>{E.initiatorType==="xmlhttprequest"&&E.name===i.href&&n.createdResources&&n.createdResources.entries.push(E)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(ze.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(t,r,n,o,a){if(!n||!o||!a||!t.createdResources)return;let i=t.createdResources.entries;(!i||!i.length)&&(i=ze.getEntriesByType("resource"));let E=qi(qe(n).href,o,a,i,this._usedResources);if(E.mainRequest){let T=E.mainRequest;this._markResourceAsUsed(T);let s=E.corsPreFlightRequest;s&&(this._addChildSpan(r,s),this._markResourceAsUsed(s));let _=!(this._semconvStability&Ee.OLD);ko(r,T,this.getConfig().ignoreNetworkEvents,void 0,_)}}_cleanPreviousSpanInformation(t){let r=this._xhrMem.get(t);if(r){let n=r.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(t)}}_createSpan(t,r,n){if(ji(r,this.getConfig().ignoreUrls)){this._diag.debug("ignoring span as url matches ignored url");return}let o="",a=qe(r),i={};if(this._semconvStability&Ee.OLD&&(o=n.toUpperCase(),i[WT]=n,i[$T]=a.toString()),this._semconvStability&Ee.STABLE){let T=n,s=eS(n);o||(o=s),i[kn]=s,s!==T&&(i[Kn]=T),i[zn]=a.toString(),i[Xn]=a.hostname;let _=tS(a);_&&(i[jn]=_)}let E=this.tracer.startSpan(o,{kind:Ke.CLIENT,attributes:i});return E.addEvent(He.METHOD_OPEN),this._cleanPreviousSpanInformation(t),this._xhrMem.set(t,{span:E,spanUrl:r}),E}_markResourceAsUsed(t){this._usedResources.add(t)}_patchOpen(){return t=>{let r=this;return function(...o){let a=o[0],i=o[1];return r._createSpan(this,i,a),t.apply(this,o)}}}_patchSend(){let t=this;function r(s,_,S,u){let c=_.callbackToRemoveEvents;typeof c=="function"&&c();let{span:p,spanUrl:O,sendStartTime:P}=_;p&&(t._findResourceAndAddNetworkEvents(_,p,O,P,S),p.addEvent(s,u),t._addFinalSpanAttributes(p,_,O),p.end(u),t._tasksCount--),t._clearResources()}function n(s,_,S,u){let c=t._xhrMem.get(_);if(!c)return;if(c.status=_.status,c.statusText=_.statusText,t._xhrMem.delete(_),c.span){let P=c.span;t._applyAttributesAfterXHR(P,_),t._semconvStability&Ee.STABLE&&(S?u&&(P.setStatus({code:me.ERROR,message:u}),P.setAttribute(cr,u)):c.status&&c.status>=400&&(P.setStatus({code:me.ERROR}),P.setAttribute(cr,String(c.status))))}let p=en(),O=Date.now();setTimeout(()=>{r(s,c,p,O)},dl)}function o(){n(He.EVENT_ERROR,this,!0,"error")}function a(){n(He.EVENT_ABORT,this,!1)}function i(){n(He.EVENT_TIMEOUT,this,!0,"timeout")}function E(){this.status<299?n(He.EVENT_LOAD,this,!1):n(He.EVENT_ERROR,this,!1)}function T(s){s.removeEventListener("abort",a),s.removeEventListener("error",o),s.removeEventListener("load",E),s.removeEventListener("timeout",i);let _=t._xhrMem.get(s);_&&(_.callbackToRemoveEvents=void 0)}return s=>function(...S){let u=t._xhrMem.get(this);if(!u)return s.apply(this,S);let c=u.span,p=u.spanUrl;if(c&&p){if(t.getConfig().measureRequestSize&&S?.[0]){let O=S[0],P=JT(O);P!==void 0&&(t._semconvStability&Ee.OLD&&c.setAttribute(jT,P),t._semconvStability&Ee.STABLE&&c.setAttribute(XT,P))}I.with(C.setSpan(I.active(),c),()=>{t._tasksCount++,u.sendStartTime=en(),c.addEvent(He.METHOD_SEND),this.addEventListener("abort",a),this.addEventListener("error",o),this.addEventListener("load",E),this.addEventListener("timeout",i),u.callbackToRemoveEvents=()=>{T(this),u.createdResources&&u.createdResources.observer.disconnect()},t._addHeaders(this,p),t._addResourceObserver(this,p)})}return s.apply(this,S)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),Yo(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Yo(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}};var Zi={"@opentelemetry/instrumentation-document-load":xr,"@opentelemetry/instrumentation-fetch":Yr,"@opentelemetry/instrumentation-user-interaction":jr,"@opentelemetry/instrumentation-xml-http-request":rn};function Ji(e={}){for(let r of Object.keys(e))if(!Object.prototype.hasOwnProperty.call(Zi,r)){l.error(`Provided instrumentation name "${r}" not found`);continue}let t=[];for(let r of Object.keys(Zi)){let n=Zi[r],o=e[r]??{};if(o.enabled===!1){l.debug(`Disabling instrumentation for ${r}`);continue}try{l.debug(`Loading instrumentation for ${r}`),t.push(new n(o))}catch(a){l.error(a)}}return t}var es={ignoreNetworkEvents:!0},vl=new ao({apiKey:"QliXW9F4wu0fxT0xksBebG",serviceName:"caffeine-lang-website",instrumentations:[Ji({"@opentelemetry/instrumentation-xml-http-request":es,"@opentelemetry/instrumentation-fetch":es,"@opentelemetry/instrumentation-document-load":es}),new mr]});vl.start();})(); /*! Bundled license information: tracekit/tracekit.js: (** * https://github.com/csnover/TraceKit * @license MIT * @namespace TraceKit *) */