@vercel/otel 1.10.0 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,18 +4,18 @@ import _nPath from 'path'
4
4
  const require = topLevelCreateRequire(import.meta.url);
5
5
  const __filename = fileURLToPath(import.meta.url);
6
6
  const __dirname = _nPath.dirname(__filename);
7
- var Ip=Object.create;var Is=Object.defineProperty;var Lp=Object.getOwnPropertyDescriptor;var Mp=Object.getOwnPropertyNames;var Cp=Object.getPrototypeOf,Np=Object.prototype.hasOwnProperty;var J=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Zu=(r,e)=>()=>(r&&(e=r(r=0)),e);var c=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Gr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Mp(e))!Np.call(r,i)&&i!==t&&Is(r,i,{get:()=>e[i],enumerable:!(n=Lp(e,i))||n.enumerable});return r},ht=(r,e,t)=>(Gr(r,e,"default"),t&&Gr(t,e,"default")),H=(r,e,t)=>(t=r!=null?Ip(Cp(r)):{},Gr(e||!r||!r.__esModule?Is(t,"default",{value:r,enumerable:!0}):t,r)),f=r=>Gr(Is({},"__esModule",{value:!0}),r);var d={};import*as HA from"@opentelemetry/api";var h=Zu(()=>{ht(d,HA)});var ur=c(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isTracingSuppressed=ye.unsuppressTracing=ye.suppressTracing=void 0;var wp=(h(),f(d)),Ls=(0,wp.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function xp(r){return r.setValue(Ls,!0)}ye.suppressTracing=xp;function Dp(r){return r.deleteValue(Ls)}ye.unsuppressTracing=Dp;function Bp(r){return r.getValue(Ls)===!0}ye.isTracingSuppressed=Bp});var Ms=c(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.BAGGAGE_MAX_TOTAL_LENGTH=k.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=k.BAGGAGE_MAX_NAME_VALUE_PAIRS=k.BAGGAGE_HEADER=k.BAGGAGE_ITEMS_SEPARATOR=k.BAGGAGE_PROPERTIES_SEPARATOR=k.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;k.BAGGAGE_KEY_PAIR_SEPARATOR="=";k.BAGGAGE_PROPERTIES_SEPARATOR=";";k.BAGGAGE_ITEMS_SEPARATOR=",";k.BAGGAGE_HEADER="baggage";k.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;k.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;k.BAGGAGE_MAX_TOTAL_LENGTH=8192});var Cs=c(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.parseKeyPairsIntoRecord=he.parsePairKeyValue=he.getKeyPairs=he.serializeKeyPairs=void 0;var Up=(h(),f(d)),je=Ms();function qp(r){return r.reduce((e,t)=>{let n=`${e}${e!==""?je.BAGGAGE_ITEMS_SEPARATOR:""}${t}`;return n.length>je.BAGGAGE_MAX_TOTAL_LENGTH?e:n},"")}he.serializeKeyPairs=qp;function Gp(r){return r.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=je.BAGGAGE_PROPERTIES_SEPARATOR+t.metadata.toString()),n})}he.getKeyPairs=Gp;function Ju(r){let e=r.split(je.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let t=e.shift();if(!t)return;let n=t.indexOf(je.BAGGAGE_KEY_PAIR_SEPARATOR);if(n<=0)return;let i=decodeURIComponent(t.substring(0,n).trim()),s=decodeURIComponent(t.substring(n+1).trim()),o;return e.length>0&&(o=(0,Up.baggageEntryMetadataFromString)(e.join(je.BAGGAGE_PROPERTIES_SEPARATOR))),{key:i,value:s,metadata:o}}he.parsePairKeyValue=Ju;function Vp(r){return typeof r!="string"||r.length===0?{}:r.split(je.BAGGAGE_ITEMS_SEPARATOR).map(e=>Ju(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}he.parseKeyPairsIntoRecord=Vp});var ec=c(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.W3CBaggagePropagator=void 0;var Ns=(h(),f(d)),jp=ur(),Fe=Ms(),ws=Cs(),xs=class{inject(e,t,n){let i=Ns.propagation.getBaggage(e);if(!i||(0,jp.isTracingSuppressed)(e))return;let s=(0,ws.getKeyPairs)(i).filter(a=>a.length<=Fe.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Fe.BAGGAGE_MAX_NAME_VALUE_PAIRS),o=(0,ws.serializeKeyPairs)(s);o.length>0&&n.set(t,Fe.BAGGAGE_HEADER,o)}extract(e,t,n){let i=n.get(t,Fe.BAGGAGE_HEADER),s=Array.isArray(i)?i.join(Fe.BAGGAGE_ITEMS_SEPARATOR):i;if(!s)return e;let o={};return s.length===0||(s.split(Fe.BAGGAGE_ITEMS_SEPARATOR).forEach(u=>{let l=(0,ws.parsePairKeyValue)(u);if(l){let _={value:l.value};l.metadata&&(_.metadata=l.metadata),o[l.key]=_}}),Object.entries(o).length===0)?e:Ns.propagation.setBaggage(e,Ns.propagation.createBaggage(o))}fields(){return[Fe.BAGGAGE_HEADER]}};Vr.W3CBaggagePropagator=xs});var tc=c(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.AnchoredClock=void 0;var Ds=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};jr.AnchoredClock=Ds});var oc=c(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.isAttributeValue=ve.isAttributeKey=ve.sanitizeAttributes=void 0;var rc=(h(),f(d));function Fp(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,n]of Object.entries(r)){if(!nc(t)){rc.diag.warn(`Invalid attribute key: ${t}`);continue}if(!ic(n)){rc.diag.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(n)?e[t]=n.slice():e[t]=n}return e}ve.sanitizeAttributes=Fp;function nc(r){return typeof r=="string"&&r.length>0}ve.isAttributeKey=nc;function ic(r){return r==null?!0:Array.isArray(r)?Hp(r):sc(r)}ve.isAttributeValue=ic;function Hp(r){let e;for(let t of r)if(t!=null){if(!e){if(sc(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function sc(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}});var Bs=c(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.loggingErrorHandler=void 0;var kp=(h(),f(d));function Xp(){return r=>{kp.diag.error($p(r))}}Fr.loggingErrorHandler=Xp;function $p(r){return typeof r=="string"?r:JSON.stringify(Wp(r))}function Wp(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(n=>{if(e[n])return;let i=t[n];i&&(e[n]=String(i))}),t=Object.getPrototypeOf(t);return e}});var Us=c(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.globalErrorHandler=pt.setGlobalErrorHandler=void 0;var Kp=Bs(),ac=(0,Kp.loggingErrorHandler)();function zp(r){ac=r}pt.setGlobalErrorHandler=zp;function Yp(r){try{ac(r)}catch{}}pt.globalErrorHandler=Yp});var qs=c(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.TracesSamplerValues=void 0;var Qp;(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Qp=cr.TracesSamplerValues||(cr.TracesSamplerValues={}))});var uc=c(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr._globalThis=void 0;Hr._globalThis=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});var kr=c(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.getEnvWithoutDefaults=y.parseEnvironment=y.DEFAULT_ENVIRONMENT=y.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=y.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=y.DEFAULT_ATTRIBUTE_COUNT_LIMIT=y.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=void 0;var Ie=(h(),f(d)),Zp=qs(),Jp=uc(),ef=",",tf=["OTEL_SDK_DISABLED"];function rf(r){return tf.indexOf(r)>-1}var nf=["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 sf(r){return nf.indexOf(r)>-1}var of=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function af(r){return of.indexOf(r)>-1}y.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;y.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;y.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;y.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;y.DEFAULT_ENVIRONMENT={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:Ie.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:y.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:y.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:y.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:y.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:y.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:y.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:y.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:y.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Zp.TracesSamplerValues.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"};function uf(r,e,t){if(typeof t[r]>"u")return;let n=String(t[r]);e[r]=n.toLowerCase()==="true"}function cf(r,e,t,n=-1/0,i=1/0){if(typeof t[r]<"u"){let s=Number(t[r]);isNaN(s)||(s<n?e[r]=n:s>i?e[r]=i:e[r]=s)}}function lf(r,e,t,n=ef){let i=t[r];typeof i=="string"&&(e[r]=i.split(n).map(s=>s.trim()))}var df={ALL:Ie.DiagLogLevel.ALL,VERBOSE:Ie.DiagLogLevel.VERBOSE,DEBUG:Ie.DiagLogLevel.DEBUG,INFO:Ie.DiagLogLevel.INFO,WARN:Ie.DiagLogLevel.WARN,ERROR:Ie.DiagLogLevel.ERROR,NONE:Ie.DiagLogLevel.NONE};function _f(r,e,t){let n=t[r];if(typeof n=="string"){let i=df[n.toUpperCase()];i!=null&&(e[r]=i)}}function Gs(r){let e={};for(let t in y.DEFAULT_ENVIRONMENT){let n=t;switch(n){case"OTEL_LOG_LEVEL":_f(n,e,r);break;default:if(rf(n))uf(n,e,r);else if(sf(n))cf(n,e,r);else if(af(n))lf(n,e,r);else{let i=r[n];typeof i<"u"&&i!==null&&(e[n]=String(i))}}}return e}y.parseEnvironment=Gs;function hf(){return typeof process<"u"&&process&&process.env?Gs(process.env):Gs(Jp._globalThis)}y.getEnvWithoutDefaults=hf});var lc=c(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.getEnv=void 0;var pf=J("os"),cc=kr();function ff(){let r=(0,cc.parseEnvironment)(process.env);return Object.assign({HOSTNAME:pf.hostname()},cc.DEFAULT_ENVIRONMENT,r)}Xr.getEnv=ff});var dc=c($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r._globalThis=void 0;$r._globalThis=typeof globalThis=="object"?globalThis:global});var hc=c(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.hexToBase64=void 0;function _c(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}var Ef=Buffer.alloc(8),mf=Buffer.alloc(16);function gf(r){let e;r.length===16?e=Ef:r.length===32?e=mf:e=Buffer.alloc(r.length/2);let t=0;for(let n=0;n<r.length;n+=2){let i=_c(r.charCodeAt(n)),s=_c(r.charCodeAt(n+1));e.writeUInt8(i<<4|s,t++)}return e.toString("base64")}Wr.hexToBase64=gf});var Ec=c(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.RandomIdGenerator=void 0;var Tf=8,fc=16,Vs=class{constructor(){this.generateTraceId=pc(fc),this.generateSpanId=pc(Tf)}};zr.RandomIdGenerator=Vs;var Kr=Buffer.allocUnsafe(fc);function pc(r){return function(){for(let t=0;t<r/4;t++)Kr.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(Kr[t]>0);t++)t===r-1&&(Kr[r-1]=1);return Kr.toString("hex",0,r)}}});var mc=c(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.otperformance=void 0;var Sf=J("perf_hooks");Yr.otperformance=Sf.performance});var js=c(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.VERSION=void 0;Qr.VERSION="1.19.0"});var gc=c(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.MessageTypeValues=R.RpcGrpcStatusCodeValues=R.MessagingOperationValues=R.MessagingDestinationKindValues=R.HttpFlavorValues=R.NetHostConnectionSubtypeValues=R.NetHostConnectionTypeValues=R.NetTransportValues=R.FaasInvokedProviderValues=R.FaasDocumentOperationValues=R.FaasTriggerValues=R.DbCassandraConsistencyLevelValues=R.DbSystemValues=R.SemanticAttributes=void 0;R.SemanticAttributes={AWS_LAMBDA_INVOKED_ARN:"aws.lambda.invoked_arn",DB_SYSTEM:"db.system",DB_CONNECTION_STRING:"db.connection_string",DB_USER:"db.user",DB_JDBC_DRIVER_CLASSNAME:"db.jdbc.driver_classname",DB_NAME:"db.name",DB_STATEMENT:"db.statement",DB_OPERATION:"db.operation",DB_MSSQL_INSTANCE_NAME:"db.mssql.instance_name",DB_CASSANDRA_KEYSPACE:"db.cassandra.keyspace",DB_CASSANDRA_PAGE_SIZE:"db.cassandra.page_size",DB_CASSANDRA_CONSISTENCY_LEVEL:"db.cassandra.consistency_level",DB_CASSANDRA_TABLE:"db.cassandra.table",DB_CASSANDRA_IDEMPOTENCE:"db.cassandra.idempotence",DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:"db.cassandra.speculative_execution_count",DB_CASSANDRA_COORDINATOR_ID:"db.cassandra.coordinator.id",DB_CASSANDRA_COORDINATOR_DC:"db.cassandra.coordinator.dc",DB_HBASE_NAMESPACE:"db.hbase.namespace",DB_REDIS_DATABASE_INDEX:"db.redis.database_index",DB_MONGODB_COLLECTION:"db.mongodb.collection",DB_SQL_TABLE:"db.sql.table",EXCEPTION_TYPE:"exception.type",EXCEPTION_MESSAGE:"exception.message",EXCEPTION_STACKTRACE:"exception.stacktrace",EXCEPTION_ESCAPED:"exception.escaped",FAAS_TRIGGER:"faas.trigger",FAAS_EXECUTION:"faas.execution",FAAS_DOCUMENT_COLLECTION:"faas.document.collection",FAAS_DOCUMENT_OPERATION:"faas.document.operation",FAAS_DOCUMENT_TIME:"faas.document.time",FAAS_DOCUMENT_NAME:"faas.document.name",FAAS_TIME:"faas.time",FAAS_CRON:"faas.cron",FAAS_COLDSTART:"faas.coldstart",FAAS_INVOKED_NAME:"faas.invoked_name",FAAS_INVOKED_PROVIDER:"faas.invoked_provider",FAAS_INVOKED_REGION:"faas.invoked_region",NET_TRANSPORT:"net.transport",NET_PEER_IP:"net.peer.ip",NET_PEER_PORT:"net.peer.port",NET_PEER_NAME:"net.peer.name",NET_HOST_IP:"net.host.ip",NET_HOST_PORT:"net.host.port",NET_HOST_NAME:"net.host.name",NET_HOST_CONNECTION_TYPE:"net.host.connection.type",NET_HOST_CONNECTION_SUBTYPE:"net.host.connection.subtype",NET_HOST_CARRIER_NAME:"net.host.carrier.name",NET_HOST_CARRIER_MCC:"net.host.carrier.mcc",NET_HOST_CARRIER_MNC:"net.host.carrier.mnc",NET_HOST_CARRIER_ICC:"net.host.carrier.icc",PEER_SERVICE:"peer.service",ENDUSER_ID:"enduser.id",ENDUSER_ROLE:"enduser.role",ENDUSER_SCOPE:"enduser.scope",THREAD_ID:"thread.id",THREAD_NAME:"thread.name",CODE_FUNCTION:"code.function",CODE_NAMESPACE:"code.namespace",CODE_FILEPATH:"code.filepath",CODE_LINENO:"code.lineno",HTTP_METHOD:"http.method",HTTP_URL:"http.url",HTTP_TARGET:"http.target",HTTP_HOST:"http.host",HTTP_SCHEME:"http.scheme",HTTP_STATUS_CODE:"http.status_code",HTTP_FLAVOR:"http.flavor",HTTP_USER_AGENT:"http.user_agent",HTTP_REQUEST_CONTENT_LENGTH:"http.request_content_length",HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:"http.request_content_length_uncompressed",HTTP_RESPONSE_CONTENT_LENGTH:"http.response_content_length",HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:"http.response_content_length_uncompressed",HTTP_SERVER_NAME:"http.server_name",HTTP_ROUTE:"http.route",HTTP_CLIENT_IP:"http.client_ip",AWS_DYNAMODB_TABLE_NAMES:"aws.dynamodb.table_names",AWS_DYNAMODB_CONSUMED_CAPACITY:"aws.dynamodb.consumed_capacity",AWS_DYNAMODB_ITEM_COLLECTION_METRICS:"aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:"aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:"aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_CONSISTENT_READ:"aws.dynamodb.consistent_read",AWS_DYNAMODB_PROJECTION:"aws.dynamodb.projection",AWS_DYNAMODB_LIMIT:"aws.dynamodb.limit",AWS_DYNAMODB_ATTRIBUTES_TO_GET:"aws.dynamodb.attributes_to_get",AWS_DYNAMODB_INDEX_NAME:"aws.dynamodb.index_name",AWS_DYNAMODB_SELECT:"aws.dynamodb.select",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:"aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:"aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_EXCLUSIVE_START_TABLE:"aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_TABLE_COUNT:"aws.dynamodb.table_count",AWS_DYNAMODB_SCAN_FORWARD:"aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT:"aws.dynamodb.segment",AWS_DYNAMODB_TOTAL_SEGMENTS:"aws.dynamodb.total_segments",AWS_DYNAMODB_COUNT:"aws.dynamodb.count",AWS_DYNAMODB_SCANNED_COUNT:"aws.dynamodb.scanned_count",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:"aws.dynamodb.attribute_definitions",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:"aws.dynamodb.global_secondary_index_updates",MESSAGING_SYSTEM:"messaging.system",MESSAGING_DESTINATION:"messaging.destination",MESSAGING_DESTINATION_KIND:"messaging.destination_kind",MESSAGING_TEMP_DESTINATION:"messaging.temp_destination",MESSAGING_PROTOCOL:"messaging.protocol",MESSAGING_PROTOCOL_VERSION:"messaging.protocol_version",MESSAGING_URL:"messaging.url",MESSAGING_MESSAGE_ID:"messaging.message_id",MESSAGING_CONVERSATION_ID:"messaging.conversation_id",MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:"messaging.message_payload_size_bytes",MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:"messaging.message_payload_compressed_size_bytes",MESSAGING_OPERATION:"messaging.operation",MESSAGING_CONSUMER_ID:"messaging.consumer_id",MESSAGING_RABBITMQ_ROUTING_KEY:"messaging.rabbitmq.routing_key",MESSAGING_KAFKA_MESSAGE_KEY:"messaging.kafka.message_key",MESSAGING_KAFKA_CONSUMER_GROUP:"messaging.kafka.consumer_group",MESSAGING_KAFKA_CLIENT_ID:"messaging.kafka.client_id",MESSAGING_KAFKA_PARTITION:"messaging.kafka.partition",MESSAGING_KAFKA_TOMBSTONE:"messaging.kafka.tombstone",RPC_SYSTEM:"rpc.system",RPC_SERVICE:"rpc.service",RPC_METHOD:"rpc.method",RPC_GRPC_STATUS_CODE:"rpc.grpc.status_code",RPC_JSONRPC_VERSION:"rpc.jsonrpc.version",RPC_JSONRPC_REQUEST_ID:"rpc.jsonrpc.request_id",RPC_JSONRPC_ERROR_CODE:"rpc.jsonrpc.error_code",RPC_JSONRPC_ERROR_MESSAGE:"rpc.jsonrpc.error_message",MESSAGE_TYPE:"message.type",MESSAGE_ID:"message.id",MESSAGE_COMPRESSED_SIZE:"message.compressed_size",MESSAGE_UNCOMPRESSED_SIZE:"message.uncompressed_size"};R.DbSystemValues={OTHER_SQL:"other_sql",MSSQL:"mssql",MYSQL:"mysql",ORACLE:"oracle",DB2:"db2",POSTGRESQL:"postgresql",REDSHIFT:"redshift",HIVE:"hive",CLOUDSCAPE:"cloudscape",HSQLDB:"hsqldb",PROGRESS:"progress",MAXDB:"maxdb",HANADB:"hanadb",INGRES:"ingres",FIRSTSQL:"firstsql",EDB:"edb",CACHE:"cache",ADABAS:"adabas",FIREBIRD:"firebird",DERBY:"derby",FILEMAKER:"filemaker",INFORMIX:"informix",INSTANTDB:"instantdb",INTERBASE:"interbase",MARIADB:"mariadb",NETEZZA:"netezza",PERVASIVE:"pervasive",POINTBASE:"pointbase",SQLITE:"sqlite",SYBASE:"sybase",TERADATA:"teradata",VERTICA:"vertica",H2:"h2",COLDFUSION:"coldfusion",CASSANDRA:"cassandra",HBASE:"hbase",MONGODB:"mongodb",REDIS:"redis",COUCHBASE:"couchbase",COUCHDB:"couchdb",COSMOSDB:"cosmosdb",DYNAMODB:"dynamodb",NEO4J:"neo4j",GEODE:"geode",ELASTICSEARCH:"elasticsearch",MEMCACHED:"memcached",COCKROACHDB:"cockroachdb"};R.DbCassandraConsistencyLevelValues={ALL:"all",EACH_QUORUM:"each_quorum",QUORUM:"quorum",LOCAL_QUORUM:"local_quorum",ONE:"one",TWO:"two",THREE:"three",LOCAL_ONE:"local_one",ANY:"any",SERIAL:"serial",LOCAL_SERIAL:"local_serial"};R.FaasTriggerValues={DATASOURCE:"datasource",HTTP:"http",PUBSUB:"pubsub",TIMER:"timer",OTHER:"other"};R.FaasDocumentOperationValues={INSERT:"insert",EDIT:"edit",DELETE:"delete"};R.FaasInvokedProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};R.NetTransportValues={IP_TCP:"ip_tcp",IP_UDP:"ip_udp",IP:"ip",UNIX:"unix",PIPE:"pipe",INPROC:"inproc",OTHER:"other"};R.NetHostConnectionTypeValues={WIFI:"wifi",WIRED:"wired",CELL:"cell",UNAVAILABLE:"unavailable",UNKNOWN:"unknown"};R.NetHostConnectionSubtypeValues={GPRS:"gprs",EDGE:"edge",UMTS:"umts",CDMA:"cdma",EVDO_0:"evdo_0",EVDO_A:"evdo_a",CDMA2000_1XRTT:"cdma2000_1xrtt",HSDPA:"hsdpa",HSUPA:"hsupa",HSPA:"hspa",IDEN:"iden",EVDO_B:"evdo_b",LTE:"lte",EHRPD:"ehrpd",HSPAP:"hspap",GSM:"gsm",TD_SCDMA:"td_scdma",IWLAN:"iwlan",NR:"nr",NRNSA:"nrnsa",LTE_CA:"lte_ca"};R.HttpFlavorValues={HTTP_1_0:"1.0",HTTP_1_1:"1.1",HTTP_2_0:"2.0",SPDY:"SPDY",QUIC:"QUIC"};R.MessagingDestinationKindValues={QUEUE:"queue",TOPIC:"topic"};R.MessagingOperationValues={RECEIVE:"receive",PROCESS:"process"};R.RpcGrpcStatusCodeValues={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16};R.MessageTypeValues={SENT:"SENT",RECEIVED:"RECEIVED"}});var Tc=c(He=>{"use strict";var Af=He&&He.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Of=He&&He.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Af(e,r,t)};Object.defineProperty(He,"__esModule",{value:!0});Of(gc(),He)});var Sc=c(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.TelemetrySdkLanguageValues=X.OsTypeValues=X.HostArchValues=X.AwsEcsLaunchtypeValues=X.CloudPlatformValues=X.CloudProviderValues=X.SemanticResourceAttributes=void 0;X.SemanticResourceAttributes={CLOUD_PROVIDER:"cloud.provider",CLOUD_ACCOUNT_ID:"cloud.account.id",CLOUD_REGION:"cloud.region",CLOUD_AVAILABILITY_ZONE:"cloud.availability_zone",CLOUD_PLATFORM:"cloud.platform",AWS_ECS_CONTAINER_ARN:"aws.ecs.container.arn",AWS_ECS_CLUSTER_ARN:"aws.ecs.cluster.arn",AWS_ECS_LAUNCHTYPE:"aws.ecs.launchtype",AWS_ECS_TASK_ARN:"aws.ecs.task.arn",AWS_ECS_TASK_FAMILY:"aws.ecs.task.family",AWS_ECS_TASK_REVISION:"aws.ecs.task.revision",AWS_EKS_CLUSTER_ARN:"aws.eks.cluster.arn",AWS_LOG_GROUP_NAMES:"aws.log.group.names",AWS_LOG_GROUP_ARNS:"aws.log.group.arns",AWS_LOG_STREAM_NAMES:"aws.log.stream.names",AWS_LOG_STREAM_ARNS:"aws.log.stream.arns",CONTAINER_NAME:"container.name",CONTAINER_ID:"container.id",CONTAINER_RUNTIME:"container.runtime",CONTAINER_IMAGE_NAME:"container.image.name",CONTAINER_IMAGE_TAG:"container.image.tag",DEPLOYMENT_ENVIRONMENT:"deployment.environment",DEVICE_ID:"device.id",DEVICE_MODEL_IDENTIFIER:"device.model.identifier",DEVICE_MODEL_NAME:"device.model.name",FAAS_NAME:"faas.name",FAAS_ID:"faas.id",FAAS_VERSION:"faas.version",FAAS_INSTANCE:"faas.instance",FAAS_MAX_MEMORY:"faas.max_memory",HOST_ID:"host.id",HOST_NAME:"host.name",HOST_TYPE:"host.type",HOST_ARCH:"host.arch",HOST_IMAGE_NAME:"host.image.name",HOST_IMAGE_ID:"host.image.id",HOST_IMAGE_VERSION:"host.image.version",K8S_CLUSTER_NAME:"k8s.cluster.name",K8S_NODE_NAME:"k8s.node.name",K8S_NODE_UID:"k8s.node.uid",K8S_NAMESPACE_NAME:"k8s.namespace.name",K8S_POD_UID:"k8s.pod.uid",K8S_POD_NAME:"k8s.pod.name",K8S_CONTAINER_NAME:"k8s.container.name",K8S_REPLICASET_UID:"k8s.replicaset.uid",K8S_REPLICASET_NAME:"k8s.replicaset.name",K8S_DEPLOYMENT_UID:"k8s.deployment.uid",K8S_DEPLOYMENT_NAME:"k8s.deployment.name",K8S_STATEFULSET_UID:"k8s.statefulset.uid",K8S_STATEFULSET_NAME:"k8s.statefulset.name",K8S_DAEMONSET_UID:"k8s.daemonset.uid",K8S_DAEMONSET_NAME:"k8s.daemonset.name",K8S_JOB_UID:"k8s.job.uid",K8S_JOB_NAME:"k8s.job.name",K8S_CRONJOB_UID:"k8s.cronjob.uid",K8S_CRONJOB_NAME:"k8s.cronjob.name",OS_TYPE:"os.type",OS_DESCRIPTION:"os.description",OS_NAME:"os.name",OS_VERSION:"os.version",PROCESS_PID:"process.pid",PROCESS_EXECUTABLE_NAME:"process.executable.name",PROCESS_EXECUTABLE_PATH:"process.executable.path",PROCESS_COMMAND:"process.command",PROCESS_COMMAND_LINE:"process.command_line",PROCESS_COMMAND_ARGS:"process.command_args",PROCESS_OWNER:"process.owner",PROCESS_RUNTIME_NAME:"process.runtime.name",PROCESS_RUNTIME_VERSION:"process.runtime.version",PROCESS_RUNTIME_DESCRIPTION:"process.runtime.description",SERVICE_NAME:"service.name",SERVICE_NAMESPACE:"service.namespace",SERVICE_INSTANCE_ID:"service.instance.id",SERVICE_VERSION:"service.version",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version",TELEMETRY_AUTO_VERSION:"telemetry.auto.version",WEBENGINE_NAME:"webengine.name",WEBENGINE_VERSION:"webengine.version",WEBENGINE_DESCRIPTION:"webengine.description"};X.CloudProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};X.CloudPlatformValues={ALIBABA_CLOUD_ECS:"alibaba_cloud_ecs",ALIBABA_CLOUD_FC:"alibaba_cloud_fc",AWS_EC2:"aws_ec2",AWS_ECS:"aws_ecs",AWS_EKS:"aws_eks",AWS_LAMBDA:"aws_lambda",AWS_ELASTIC_BEANSTALK:"aws_elastic_beanstalk",AZURE_VM:"azure_vm",AZURE_CONTAINER_INSTANCES:"azure_container_instances",AZURE_AKS:"azure_aks",AZURE_FUNCTIONS:"azure_functions",AZURE_APP_SERVICE:"azure_app_service",GCP_COMPUTE_ENGINE:"gcp_compute_engine",GCP_CLOUD_RUN:"gcp_cloud_run",GCP_KUBERNETES_ENGINE:"gcp_kubernetes_engine",GCP_CLOUD_FUNCTIONS:"gcp_cloud_functions",GCP_APP_ENGINE:"gcp_app_engine"};X.AwsEcsLaunchtypeValues={EC2:"ec2",FARGATE:"fargate"};X.HostArchValues={AMD64:"amd64",ARM32:"arm32",ARM64:"arm64",IA64:"ia64",PPC32:"ppc32",PPC64:"ppc64",X86:"x86"};X.OsTypeValues={WINDOWS:"windows",LINUX:"linux",DARWIN:"darwin",FREEBSD:"freebsd",NETBSD:"netbsd",OPENBSD:"openbsd",DRAGONFLYBSD:"dragonflybsd",HPUX:"hpux",AIX:"aix",SOLARIS:"solaris",Z_OS:"z_os"};X.TelemetrySdkLanguageValues={CPP:"cpp",DOTNET:"dotnet",ERLANG:"erlang",GO:"go",JAVA:"java",NODEJS:"nodejs",PHP:"php",PYTHON:"python",RUBY:"ruby",WEBJS:"webjs"}});var Ac=c(ke=>{"use strict";var Rf=ke&&ke.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),bf=ke&&ke.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Rf(e,r,t)};Object.defineProperty(ke,"__esModule",{value:!0});bf(Sc(),ke)});var ie=c(Le=>{"use strict";var Pf=Le&&Le.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Oc=Le&&Le.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Pf(e,r,t)};Object.defineProperty(Le,"__esModule",{value:!0});Oc(Tc(),Le);Oc(Ac(),Le)});var Rc=c(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.SDK_INFO=void 0;var yf=js(),lr=ie();Zr.SDK_INFO={[lr.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:"opentelemetry",[lr.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"node",[lr.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:lr.TelemetrySdkLanguageValues.NODEJS,[lr.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:yf.VERSION}});var bc=c(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.unrefTimer=void 0;function vf(r){r.unref()}Jr.unrefTimer=vf});var Pc=c(ee=>{"use strict";var If=ee&&ee.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Xe=ee&&ee.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&If(e,r,t)};Object.defineProperty(ee,"__esModule",{value:!0});Xe(lc(),ee);Xe(dc(),ee);Xe(hc(),ee);Xe(Ec(),ee);Xe(mc(),ee);Xe(Rc(),ee);Xe(bc(),ee)});var Fs=c($e=>{"use strict";var Lf=$e&&$e.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Mf=$e&&$e.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Lf(e,r,t)};Object.defineProperty($e,"__esModule",{value:!0});Mf(Pc(),$e)});var Lc=c(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.addHrTimes=P.isTimeInput=P.isTimeInputHrTime=P.hrTimeToMicroseconds=P.hrTimeToMilliseconds=P.hrTimeToNanoseconds=P.hrTimeToTimeStamp=P.hrTimeDuration=P.timeInputToHrTime=P.hrTime=P.getTimeOrigin=P.millisToHrTime=void 0;var Hs=Fs(),yc=9,Cf=6,Nf=Math.pow(10,Cf),en=Math.pow(10,yc);function dr(r){let e=r/1e3,t=Math.trunc(e),n=Math.round(r%1e3*Nf);return[t,n]}P.millisToHrTime=dr;function ks(){let r=Hs.otperformance.timeOrigin;if(typeof r!="number"){let e=Hs.otperformance;r=e.timing&&e.timing.fetchStart}return r}P.getTimeOrigin=ks;function vc(r){let e=dr(ks()),t=dr(typeof r=="number"?r:Hs.otperformance.now());return Ic(e,t)}P.hrTime=vc;function wf(r){if(Xs(r))return r;if(typeof r=="number")return r<ks()?vc(r):dr(r);if(r instanceof Date)return dr(r.getTime());throw TypeError("Invalid input type")}P.timeInputToHrTime=wf;function xf(r,e){let t=e[0]-r[0],n=e[1]-r[1];return n<0&&(t-=1,n+=en),[t,n]}P.hrTimeDuration=xf;function Df(r){let e=yc,t=`${"0".repeat(e)}${r[1]}Z`,n=t.substr(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",n)}P.hrTimeToTimeStamp=Df;function Bf(r){return r[0]*en+r[1]}P.hrTimeToNanoseconds=Bf;function Uf(r){return r[0]*1e3+r[1]/1e6}P.hrTimeToMilliseconds=Uf;function qf(r){return r[0]*1e6+r[1]/1e3}P.hrTimeToMicroseconds=qf;function Xs(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}P.isTimeInputHrTime=Xs;function Gf(r){return Xs(r)||typeof r=="number"||r instanceof Date}P.isTimeInput=Gf;function Ic(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=en&&(t[1]-=en,t[0]+=1),t}P.addHrTimes=Ic});var Cc=c(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0})});var Nc=c(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.ExportResultCode=void 0;var Vf;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(Vf=_r.ExportResultCode||(_r.ExportResultCode={}))});var xc=c(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.CompositePropagator=void 0;var wc=(h(),f(d)),$s=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,i)=>n.concat(i),[])))}inject(e,t,n){for(let i of this._propagators)try{i.inject(e,t,n)}catch(s){wc.diag.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,t,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,t,n)}catch(o){wc.diag.warn(`Failed to inject with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}};tn.CompositePropagator=$s});var Dc=c(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.validateValue=ft.validateKey=void 0;var Ws="[_0-9a-z-*/]",jf=`[a-z]${Ws}{0,255}`,Ff=`[a-z0-9]${Ws}{0,240}@[a-z]${Ws}{0,13}`,Hf=new RegExp(`^(?:${jf}|${Ff})$`),kf=/^[ -~]{0,255}[!-~]$/,Xf=/,|=/;function $f(r){return Hf.test(r)}ft.validateKey=$f;function Wf(r){return kf.test(r)&&!Xf.test(r)}ft.validateValue=Wf});var zs=c(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.TraceState=void 0;var Bc=Dc(),Uc=32,Kf=512,qc=",",Gc="=",Ks=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+Gc+this.get(t)),e),[]).join(qc)}_parse(e){e.length>Kf||(this._internalState=e.split(qc).reverse().reduce((t,n)=>{let i=n.trim(),s=i.indexOf(Gc);if(s!==-1){let o=i.slice(0,s),a=i.slice(s+1,n.length);(0,Bc.validateKey)(o)&&(0,Bc.validateValue)(a)&&t.set(o,a)}return t},new Map),this._internalState.size>Uc&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Uc))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}};rn.TraceState=Ks});var jc=c($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.W3CTraceContextPropagator=$.parseTraceParent=$.TRACE_STATE_HEADER=$.TRACE_PARENT_HEADER=void 0;var nn=(h(),f(d)),zf=ur(),Yf=zs();$.TRACE_PARENT_HEADER="traceparent";$.TRACE_STATE_HEADER="tracestate";var Qf="00",Zf="(?!ff)[\\da-f]{2}",Jf="(?![0]{32})[\\da-f]{32}",eE="(?![0]{16})[\\da-f]{16}",tE="[\\da-f]{2}",rE=new RegExp(`^\\s?(${Zf})-(${Jf})-(${eE})-(${tE})(-.*)?\\s?$`);function Vc(r){let e=rE.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}$.parseTraceParent=Vc;var Ys=class{inject(e,t,n){let i=nn.trace.getSpanContext(e);if(!i||(0,zf.isTracingSuppressed)(e)||!(0,nn.isSpanContextValid)(i))return;let s=`${Qf}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||nn.TraceFlags.NONE).toString(16)}`;n.set(t,$.TRACE_PARENT_HEADER,s),i.traceState&&n.set(t,$.TRACE_STATE_HEADER,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,$.TRACE_PARENT_HEADER);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=Vc(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,$.TRACE_STATE_HEADER);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=new Yf.TraceState(typeof u=="string"?u:void 0)}return nn.trace.setSpanContext(e,o)}fields(){return[$.TRACE_PARENT_HEADER,$.TRACE_STATE_HEADER]}};$.W3CTraceContextPropagator=Ys});var Hc=c(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0})});var kc=c(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.getRPCMetadata=ue.deleteRPCMetadata=ue.setRPCMetadata=ue.RPCType=void 0;var nE=(h(),f(d)),Qs=(0,nE.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),iE;(function(r){r.HTTP="http"})(iE=ue.RPCType||(ue.RPCType={}));function sE(r,e){return r.setValue(Qs,e)}ue.setRPCMetadata=sE;function oE(r){return r.deleteValue(Qs)}ue.deleteRPCMetadata=oE;function aE(r){return r.getValue(Qs)}ue.getRPCMetadata=aE});var Js=c(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.AlwaysOffSampler=void 0;var uE=(h(),f(d)),Zs=class{shouldSample(){return{decision:uE.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};sn.AlwaysOffSampler=Zs});var to=c(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.AlwaysOnSampler=void 0;var cE=(h(),f(d)),eo=class{shouldSample(){return{decision:cE.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};on.AlwaysOnSampler=eo});var $c=c(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.ParentBasedSampler=void 0;var an=(h(),f(d)),lE=Us(),Xc=Js(),ro=to(),no=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,lE.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ro.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new ro.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new Xc.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new ro.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new Xc.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=an.trace.getSpanContext(e);return!a||!(0,an.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&an.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&an.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};un.ParentBasedSampler=no});var Wc=c(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.TraceIdRatioBasedSampler=void 0;var io=(h(),f(d)),so=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,io.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?io.SamplingDecision.RECORD_AND_SAMPLED:io.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};cn.TraceIdRatioBasedSampler=so});var Zc=c(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.isPlainObject=void 0;var dE="[object Object]",_E="[object Null]",hE="[object Undefined]",pE=Function.prototype,Kc=pE.toString,fE=Kc.call(Object),EE=mE(Object.getPrototypeOf,Object),zc=Object.prototype,Yc=zc.hasOwnProperty,We=Symbol?Symbol.toStringTag:void 0,Qc=zc.toString;function mE(r,e){return function(t){return r(e(t))}}function gE(r){if(!TE(r)||SE(r)!==dE)return!1;let e=EE(r);if(e===null)return!0;let t=Yc.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Kc.call(t)===fE}ln.isPlainObject=gE;function TE(r){return r!=null&&typeof r=="object"}function SE(r){return r==null?r===void 0?hE:_E:We&&We in Object(r)?AE(r):OE(r)}function AE(r){let e=Yc.call(r,We),t=r[We],n=!1;try{r[We]=void 0,n=!0}catch{}let i=Qc.call(r);return n&&(e?r[We]=t:delete r[We]),i}function OE(r){return Qc.call(r)}});var nl=c(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.merge=void 0;var Jc=Zc(),RE=20;function bE(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=tl(e,r.shift(),0,t);return e}hn.merge=bE;function oo(r){return _n(r)?r.slice():r}function tl(r,e,t=0,n){let i;if(!(t>RE)){if(t++,dn(r)||dn(e)||rl(e))i=oo(e);else if(_n(r)){if(i=r.slice(),_n(e))for(let s=0,o=e.length;s<o;s++)i.push(oo(e[s]));else if(hr(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o];i[u]=oo(e[u])}}}else if(hr(r))if(hr(e)){if(!PE(r,e))return e;i=Object.assign({},r);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o],l=e[u];if(dn(l))typeof l>"u"?delete i[u]:i[u]=l;else{let _=i[u],E=l;if(el(r,u,n)||el(e,u,n))delete i[u];else{if(hr(_)&&hr(E)){let O=n.get(_)||[],D=n.get(E)||[];O.push({obj:r,key:u}),D.push({obj:e,key:u}),n.set(_,O),n.set(E,D)}i[u]=tl(i[u],l,t,n)}}}}else i=e;return i}}function el(r,e,t){let n=t.get(r[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===r)return!0}return!1}function _n(r){return Array.isArray(r)}function rl(r){return typeof r=="function"}function hr(r){return!dn(r)&&!_n(r)&&!rl(r)&&typeof r=="object"}function dn(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function PE(r,e){return!(!(0,Jc.isPlainObject)(r)||!(0,Jc.isPlainObject)(e))}});var il=c(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.callWithTimeout=Et.TimeoutError=void 0;var pn=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};Et.TimeoutError=pn;function yE(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new pn("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}Et.callWithTimeout=yE});var ol=c(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.isUrlIgnored=mt.urlMatches=void 0;function sl(r,e){return typeof e=="string"?r===e:!!r.match(e)}mt.urlMatches=sl;function vE(r,e){if(!e)return!1;for(let t of e)if(sl(r,t))return!0;return!1}mt.isUrlIgnored=vE});var al=c(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.isWrapped=void 0;function IE(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}fn.isWrapped=IE});var ul=c(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.Deferred=void 0;var ao=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};En.Deferred=ao});var cl=c(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.BindOnceFuture=void 0;var LE=ul(),uo=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new LE.Deferred}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};mn.BindOnceFuture=uo});var dl=c(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn._export=void 0;var ll=(h(),f(d)),ME=ur();function CE(r,e){return new Promise(t=>{ll.context.with((0,ME.suppressTracing)(ll.context.active()),()=>{r.export(e,n=>{t(n)})})})}gn._export=CE});var S=c(T=>{"use strict";var NE=T&&T.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),b=T&&T.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&NE(e,r,t)};Object.defineProperty(T,"__esModule",{value:!0});T.internal=T.baggageUtils=void 0;b(ec(),T);b(tc(),T);b(oc(),T);b(Us(),T);b(Bs(),T);b(Lc(),T);b(Cc(),T);b(Nc(),T);T.baggageUtils=Cs();b(Fs(),T);b(xc(),T);b(jc(),T);b(Hc(),T);b(kc(),T);b(Js(),T);b(to(),T);b($c(),T);b(Wc(),T);b(ur(),T);b(zs(),T);b(kr(),T);b(nl(),T);b(qs(),T);b(il(),T);b(ol(),T);b(al(),T);b(cl(),T);b(js(),T);var wE=dl();T.internal={_export:wE._export}});var _l=c(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.ExceptionEventName=void 0;Tn.ExceptionEventName="exception"});var lo=c(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.Span=void 0;var pe=(h(),f(d)),W=S(),Ke=ie(),xE=_l(),co=class{constructor(e,t,n,i,s,o,a=[],u,l,_){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:pe.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=o,this.kind=s,this.links=a;let E=Date.now();this._performanceStartTime=W.otperformance.now(),this._performanceOffset=E-(this._performanceStartTime+(0,W.getTimeOrigin)()),this._startTimeProvided=u!=null,this.startTime=this._getTime(u??E),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),_!=null&&this.setAttributes(_),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(pe.diag.warn(`Invalid attribute key: ${e}`),this):(0,W.isAttributeValue)(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(pe.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return pe.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(pe.diag.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,W.isTimeInput)(t)&&((0,W.isTimeInput)(n)||(n=t),t=void 0);let i=(0,W.sanitizeAttributes)(t);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}setStatus(e){return this._isSpanEnded()?this:(this.status=e,this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){pe.diag.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(e),this._duration=(0,W.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(pe.diag.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._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<W.otperformance.now())return(0,W.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,W.millisToHrTime)(e);if(e instanceof Date)return(0,W.millisToHrTime)(e.getTime());if((0,W.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,W.millisToHrTime)(Date.now());let t=W.otperformance.now()-this._performanceStartTime;return(0,W.addHrTimes)(this.startTime,(0,W.millisToHrTime)(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e=="string"?n[Ke.SemanticAttributes.EXCEPTION_MESSAGE]=e:e&&(e.code?n[Ke.SemanticAttributes.EXCEPTION_TYPE]=e.code.toString():e.name&&(n[Ke.SemanticAttributes.EXCEPTION_TYPE]=e.name),e.message&&(n[Ke.SemanticAttributes.EXCEPTION_MESSAGE]=e.message),e.stack&&(n[Ke.SemanticAttributes.EXCEPTION_STACKTRACE]=e.stack)),n[Ke.SemanticAttributes.EXCEPTION_TYPE]||n[Ke.SemanticAttributes.EXCEPTION_MESSAGE]?this.addEvent(xE.ExceptionEventName,n,t):pe.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&pe.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substr(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(pe.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}};Sn.Span=co});var fr=c(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.SamplingDecision=void 0;var DE;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(DE=pr.SamplingDecision||(pr.SamplingDecision={}))});var On=c(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.AlwaysOffSampler=void 0;var BE=fr(),_o=class{shouldSample(){return{decision:BE.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};An.AlwaysOffSampler=_o});var bn=c(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.AlwaysOnSampler=void 0;var UE=fr(),ho=class{shouldSample(){return{decision:UE.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Rn.AlwaysOnSampler=ho});var Eo=c(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.ParentBasedSampler=void 0;var Pn=(h(),f(d)),qE=S(),hl=On(),po=bn(),fo=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,qE.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new po.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new po.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new hl.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new po.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new hl.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=Pn.trace.getSpanContext(e);return!a||!(0,Pn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&Pn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&Pn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};yn.ParentBasedSampler=fo});var go=c(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.TraceIdRatioBasedSampler=void 0;var GE=(h(),f(d)),pl=fr(),mo=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,GE.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?pl.SamplingDecision.RECORD_AND_SAMPLED:pl.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};vn.TraceIdRatioBasedSampler=mo});var Ao=c(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.buildSamplerFromEnv=Tt.loadDefaultConfig=void 0;var In=(h(),f(d)),j=S(),fl=On(),To=bn(),So=Eo(),El=go(),VE=(0,j.getEnv)(),jE=j.TracesSamplerValues.AlwaysOn,gt=1;function FE(){return{sampler:gl(VE),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,j.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,j.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:(0,j.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,j.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:(0,j.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:(0,j.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:(0,j.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:(0,j.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}Tt.loadDefaultConfig=FE;function gl(r=(0,j.getEnv)()){switch(r.OTEL_TRACES_SAMPLER){case j.TracesSamplerValues.AlwaysOn:return new To.AlwaysOnSampler;case j.TracesSamplerValues.AlwaysOff:return new fl.AlwaysOffSampler;case j.TracesSamplerValues.ParentBasedAlwaysOn:return new So.ParentBasedSampler({root:new To.AlwaysOnSampler});case j.TracesSamplerValues.ParentBasedAlwaysOff:return new So.ParentBasedSampler({root:new fl.AlwaysOffSampler});case j.TracesSamplerValues.TraceIdRatio:return new El.TraceIdRatioBasedSampler(ml(r));case j.TracesSamplerValues.ParentBasedTraceIdRatio:return new So.ParentBasedSampler({root:new El.TraceIdRatioBasedSampler(ml(r))});default:return In.diag.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${jE}".`),new To.AlwaysOnSampler}}Tt.buildSamplerFromEnv=gl;function ml(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return In.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${gt}.`),gt;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(In.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${gt}.`),gt):e<0||e>1?(In.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${gt}.`),gt):e}});var Ro=c(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.reconfigureLimits=St.mergeConfig=void 0;var Tl=Ao(),Oo=S();function HE(r){let e={sampler:(0,Tl.buildSamplerFromEnv)()},t=(0,Tl.loadDefaultConfig)(),n=Object.assign({},t,e,r);return n.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),n.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),n}St.mergeConfig=HE;function kE(r){var e,t,n,i,s,o,a,u,l,_,E,O;let D=Object.assign({},r.spanLimits),z=(0,Oo.getEnvWithoutDefaults)();return D.attributeCountLimit=(o=(s=(i=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(n=r.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:z.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:z.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Oo.DEFAULT_ATTRIBUTE_COUNT_LIMIT,D.attributeValueLengthLimit=(O=(E=(_=(u=(a=r.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&u!==void 0?u:(l=r.generalLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&_!==void 0?_:z.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&E!==void 0?E:z.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&O!==void 0?O:Oo.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},r,{spanLimits:D})}St.reconfigureLimits=kE});var Sl=c(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.BatchSpanProcessorBase=void 0;var At=(h(),f(d)),ze=S(),bo=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let n=(0,ze.getEnv)();this._maxExportBatchSize=typeof t?.maxExportBatchSize=="number"?t.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof t?.maxQueueSize=="number"?t.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis=="number"?t.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis=="number"?t.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new ze.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(At.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&At.TraceFlags.SAMPLED&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&At.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(At.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,o=i;s<o;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);At.context.with((0,ze.suppressTracing)(At.context.active()),()=>{let i=this._finishedSpans.splice(0,this._maxExportBatchSize),s=()=>this._exporter.export(i,a=>{var u;clearTimeout(n),a.code===ze.ExportResultCode.SUCCESS?e():t((u=a.error)!==null&&u!==void 0?u:new Error("BatchSpanProcessor: span export failed"))}),o=i.map(a=>a.resource).filter(a=>a.asyncAttributesPending);o.length===0?s():Promise.all(o.map(a=>{var u;return(u=a.waitForAsyncAttributes)===null||u===void 0?void 0:u.call(a)})).then(s,a=>{(0,ze.globalErrorHandler)(a),t(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,(0,ze.globalErrorHandler)(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,ze.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};Ln.BatchSpanProcessorBase=bo});var Al=c(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.BatchSpanProcessor=void 0;var XE=Sl(),Po=class extends XE.BatchSpanProcessorBase{onShutdown(){}};Mn.BatchSpanProcessor=Po});var bl=c(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.RandomIdGenerator=void 0;var $E=8,Rl=16,yo=class{constructor(){this.generateTraceId=Ol(Rl),this.generateSpanId=Ol($E)}};Nn.RandomIdGenerator=yo;var Cn=Buffer.allocUnsafe(Rl);function Ol(r){return function(){for(let t=0;t<r/4;t++)Cn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(Cn[t]>0);t++)t===r-1&&(Cn[r-1]=1);return Cn.toString("hex",0,r)}}});var yl=c(Me=>{"use strict";var WE=Me&&Me.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Pl=Me&&Me.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&WE(e,r,t)};Object.defineProperty(Me,"__esModule",{value:!0});Pl(Al(),Me);Pl(bl(),Me)});var wn=c(Ye=>{"use strict";var KE=Ye&&Ye.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),zE=Ye&&Ye.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&KE(e,r,t)};Object.defineProperty(Ye,"__esModule",{value:!0});zE(yl(),Ye)});var vl=c(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.Tracer=void 0;var F=(h(),f(d)),xn=S(),YE=lo(),QE=Ro(),ZE=wn(),vo=class{constructor(e,t,n){this._tracerProvider=n;let i=(0,QE.mergeConfig)(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new ZE.RandomIdGenerator,this.resource=n.resource,this.instrumentationLibrary=e}startSpan(e,t={},n=F.context.active()){var i,s,o;t.root&&(n=F.trace.deleteSpan(n));let a=F.trace.getSpan(n);if((0,xn.isTracingSuppressed)(n))return F.diag.debug("Instrumentation suppressed, returning Noop Span"),F.trace.wrapSpanContext(F.INVALID_SPAN_CONTEXT);let u=a?.spanContext(),l=this._idGenerator.generateSpanId(),_,E,O;!u||!F.trace.isSpanContextValid(u)?_=this._idGenerator.generateTraceId():(_=u.traceId,E=u.traceState,O=u.spanId);let D=(i=t.kind)!==null&&i!==void 0?i:F.SpanKind.INTERNAL,z=((s=t.links)!==null&&s!==void 0?s:[]).map(dt=>({context:dt.context,attributes:(0,xn.sanitizeAttributes)(dt.attributes)})),I=(0,xn.sanitizeAttributes)(t.attributes),U=this._sampler.shouldSample(n,_,e,D,I,z);E=(o=U.traceState)!==null&&o!==void 0?o:E;let L=U.decision===F.SamplingDecision.RECORD_AND_SAMPLED?F.TraceFlags.SAMPLED:F.TraceFlags.NONE,m={traceId:_,spanId:l,traceFlags:L,traceState:E};if(U.decision===F.SamplingDecision.NOT_RECORD)return F.diag.debug("Recording is off, propagating context in a non-recording span"),F.trace.wrapSpanContext(m);let be=(0,xn.sanitizeAttributes)(Object.assign(I,U.attributes));return new YE.Span(this,n,e,m,D,O,z,t.startTime,void 0,be)}startActiveSpan(e,t,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=t:arguments.length===3?(s=t,a=n):(s=t,o=n,a=i);let u=o??F.context.active(),l=this.startSpan(e,s,u),_=F.trace.setSpan(u,l);return F.context.with(_,a,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};Dn.Tracer=vo});var Il=c(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.defaultServiceName=void 0;function JE(){return`unknown_service:${process.argv0}`}Bn.defaultServiceName=JE});var Io=c(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.normalizeType=Ot.normalizeArch=void 0;var em=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}};Ot.normalizeArch=em;var tm=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}};Ot.normalizeType=tm});var qn=c(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.execAsync=void 0;var rm=J("child_process"),nm=J("util");Un.execAsync=nm.promisify(rm.exec)});var Ll=c(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.getMachineId=void 0;var im=qn(),sm=(h(),f(d));async function om(){try{let e=(await(0,im.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
8
- `).find(n=>n.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){sm.diag.debug(`error reading machine id: ${r}`)}return""}Gn.getMachineId=om});var Ml=c(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.getMachineId=void 0;var am=J("fs"),um=(h(),f(d));async function cm(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await am.promises.readFile(e,{encoding:"utf8"})).trim()}catch(t){um.diag.debug(`error reading machine id: ${t}`)}return""}Vn.getMachineId=cm});var Nl=c(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.getMachineId=void 0;var lm=J("fs"),dm=qn(),Cl=(h(),f(d));async function _m(){try{return(await lm.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){Cl.diag.debug(`error reading machine id: ${r}`)}try{return(await(0,dm.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){Cl.diag.debug(`error reading machine id: ${r}`)}return""}jn.getMachineId=_m});var xl=c(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.getMachineId=void 0;var wl=J("process"),hm=qn(),pm=(h(),f(d));async function fm(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";wl.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in wl.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let n=(await(0,hm.execAsync)(`${e} ${r}`)).stdout.split("REG_SZ");if(n.length===2)return n[1].trim()}catch(t){pm.diag.debug(`error reading machine id: ${t}`)}return""}Fn.getMachineId=fm});var Dl=c(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.getMachineId=void 0;var Em=(h(),f(d));async function mm(){return Em.diag.debug("could not read machine-id: unsupported platform"),""}Hn.getMachineId=mm});var Bl=c(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.getMachineId=void 0;var gm=J("process"),Rt;Te.getMachineId=Rt;switch(gm.platform){case"darwin":Te.getMachineId=Rt=Ll().getMachineId;break;case"linux":Te.getMachineId=Rt=Ml().getMachineId;break;case"freebsd":Te.getMachineId=Rt=Nl().getMachineId;break;case"win32":Te.getMachineId=Rt=xl().getMachineId;break;default:Te.getMachineId=Rt=Dl().getMachineId}});var Co=c(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.hostDetectorSync=void 0;var Lo=ie(),Tm=Qe(),Ul=J("os"),Sm=Io(),Am=Bl(),Mo=class{detect(e){let t={[Lo.SemanticResourceAttributes.HOST_NAME]:(0,Ul.hostname)(),[Lo.SemanticResourceAttributes.HOST_ARCH]:(0,Sm.normalizeArch)((0,Ul.arch)())};return new Tm.Resource(t,this._getAsyncAttributes())}_getAsyncAttributes(){return(0,Am.getMachineId)().then(e=>{let t={};return e&&(t[Lo.SemanticResourceAttributes.HOST_ID]=e),t})}};kn.hostDetectorSync=new Mo});var ql=c(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.hostDetector=void 0;var Om=Co(),No=class{detect(e){return Promise.resolve(Om.hostDetectorSync.detect(e))}};Xn.hostDetector=new No});var xo=c($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.osDetectorSync=void 0;var Gl=ie(),Rm=Qe(),Vl=J("os"),bm=Io(),wo=class{detect(e){let t={[Gl.SemanticResourceAttributes.OS_TYPE]:(0,bm.normalizeType)((0,Vl.platform)()),[Gl.SemanticResourceAttributes.OS_VERSION]:(0,Vl.release)()};return new Rm.Resource(t)}};$n.osDetectorSync=new wo});var jl=c(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.osDetector=void 0;var Pm=xo(),Do=class{detect(e){return Promise.resolve(Pm.osDetectorSync.detect(e))}};Wn.osDetector=new Do});var Uo=c(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.processDetectorSync=void 0;var ym=(h(),f(d)),Se=ie(),vm=Qe(),Im=J("os"),Bo=class{detect(e){let t={[Se.SemanticResourceAttributes.PROCESS_PID]:process.pid,[Se.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]:process.title,[Se.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH]:process.execPath,[Se.SemanticResourceAttributes.PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Se.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:process.versions.node,[Se.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"nodejs",[Se.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(t[Se.SemanticResourceAttributes.PROCESS_COMMAND]=process.argv[1]);try{let n=Im.userInfo();t[Se.SemanticResourceAttributes.PROCESS_OWNER]=n.username}catch(n){ym.diag.debug(`error obtaining process owner: ${n}`)}return new vm.Resource(t)}};Kn.processDetectorSync=new Bo});var Fl=c(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.processDetector=void 0;var Lm=Uo(),qo=class{detect(e){return Promise.resolve(Lm.processDetectorSync.detect(e))}};zn.processDetector=new qo});var Hl=c(te=>{"use strict";var Mm=te&&te.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ze=te&&te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Mm(e,r,t)};Object.defineProperty(te,"__esModule",{value:!0});Ze(Il(),te);Ze(ql(),te);Ze(jl(),te);Ze(Co(),te);Ze(xo(),te);Ze(Fl(),te);Ze(Uo(),te)});var Go=c(Je=>{"use strict";var Cm=Je&&Je.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Nm=Je&&Je.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Cm(e,r,t)};Object.defineProperty(Je,"__esModule",{value:!0});Nm(Hl(),Je)});var Qe=c(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.Resource=void 0;var kl=(h(),f(d)),et=ie(),Vo=S(),wm=Go(),Er=class r{constructor(e,t){var n;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(n=this._attributes)!==null&&n!==void 0?n:{},this._asyncAttributesPromise=t?.then(i=>(this._attributes=Object.assign({},this._attributes,i),this.asyncAttributesPending=!1,i),i=>(kl.diag.debug("a resource's async attributes promise rejected: %s",i),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[et.SemanticResourceAttributes.SERVICE_NAME]:(0,wm.defaultServiceName)(),[et.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:Vo.SDK_INFO[et.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],[et.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:Vo.SDK_INFO[et.SemanticResourceAttributes.TELEMETRY_SDK_NAME],[et.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:Vo.SDK_INFO[et.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]})}get attributes(){var e;return this.asyncAttributesPending&&kl.diag.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let n=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(n);let i=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([s,o])=>{var a;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),s),(a=e._syncAttributes)!==null&&a!==void 0?a:e.attributes),o)});return new r(n,i)}};Yn.Resource=Er;Er.EMPTY=new Er({})});var $l=c(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0})});var Kl=c(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0})});var Yl=c(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0})});var Ql=c(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.browserDetector=void 0;var xm=tt(),jo=class{detect(e){return Promise.resolve(xm.browserDetectorSync.detect(e))}};Qn.browserDetector=new jo});var Ho=c(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.envDetectorSync=void 0;var Dm=(h(),f(d)),Bm=S(),Um=ie(),qm=Qe(),Fo=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},n=(0,Bm.getEnv)(),i=n.OTEL_RESOURCE_ATTRIBUTES,s=n.OTEL_SERVICE_NAME;if(i)try{let o=this._parseResourceAttributes(i);Object.assign(t,o)}catch(o){Dm.diag.debug(`EnvDetector failed: ${o.message}`)}return s&&(t[Um.SemanticResourceAttributes.SERVICE_NAME]=s),new qm.Resource(t)}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR,-1);for(let i of n){let s=i.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(s.length!==2)continue;let[o,a]=s;if(o=o.trim(),a=a.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(o))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(a))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[o]=decodeURIComponent(a)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<33||n===44||n===59||n===92||n>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};Zn.envDetectorSync=new Fo});var Zl=c(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.envDetector=void 0;var Gm=Ho(),ko=class{detect(e){return Promise.resolve(Gm.envDetectorSync.detect(e))}};Jn.envDetector=new ko});var Jl=c(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.browserDetectorSync=void 0;var ei=ie(),Xo=tt(),Vm=(h(),f(d)),$o=class{detect(e){if(!(typeof navigator<"u"))return Xo.Resource.empty();let n={[ei.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"browser",[ei.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[ei.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(n,e)}_getResourceAttributes(e,t){return e[ei.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]===""?(Vm.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),Xo.Resource.empty()):new Xo.Resource(Object.assign({},e))}};ti.browserDetectorSync=new $o});var ed=c(fe=>{"use strict";var jm=fe&&fe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ri=fe&&fe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&jm(e,r,t)};Object.defineProperty(fe,"__esModule",{value:!0});ri(Ql(),fe);ri(Zl(),fe);ri(Jl(),fe);ri(Ho(),fe)});var td=c(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.isPromiseLike=void 0;var Fm=r=>r!==null&&typeof r=="object"&&typeof r.then=="function";ni.isPromiseLike=Fm});var nd=c(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.detectResourcesSync=Pt.detectResources=void 0;var mr=Qe(),bt=(h(),f(d)),Hm=td(),km=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let n=await t.detect(r);return bt.diag.debug(`${t.constructor.name} found resource.`,n),n}catch(n){return bt.diag.debug(`${t.constructor.name} failed: ${n.message}`),mr.Resource.empty()}}));return rd(e),e.reduce((t,n)=>t.merge(n),mr.Resource.empty())};Pt.detectResources=km;var Xm=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(i=>{try{let s=i.detect(r),o;if((0,Hm.isPromiseLike)(s)){let a=async()=>(await s).attributes;o=new mr.Resource({},a())}else o=s;return o.waitForAsyncAttributes?o.waitForAsyncAttributes().then(()=>bt.diag.debug(`${i.constructor.name} found resource.`,o)):bt.diag.debug(`${i.constructor.name} found resource.`,o),o}catch(s){return bt.diag.error(`${i.constructor.name} failed: ${s.message}`),mr.Resource.empty()}}),n=t.reduce((i,s)=>i.merge(s),mr.Resource.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(()=>{rd(t)}),n};Pt.detectResourcesSync=Xm;var rd=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);bt.diag.verbose(t)}})}});var tt=c(re=>{"use strict";var $m=re&&re.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),rt=re&&re.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&$m(e,r,t)};Object.defineProperty(re,"__esModule",{value:!0});rt(Qe(),re);rt($l(),re);rt(Go(),re);rt(Kl(),re);rt(Yl(),re);rt(ed(),re);rt(nd(),re)});var id=c(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.MultiSpanProcessor=void 0;var Wm=S(),Wo=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(n=>{(0,Wm.globalErrorHandler)(n||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}};ii.MultiSpanProcessor=Wo});var zo=c(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.NoopSpanProcessor=void 0;var Ko=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};si.NoopSpanProcessor=Ko});var od=c(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.BasicTracerProvider=nt.ForceFlushState=void 0;var yt=(h(),f(d)),It=S(),sd=tt(),Km=Yo(),zm=Ao(),Ym=id(),Qm=zo(),Zm=wn(),Jm=Ro(),vt;(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(vt=nt.ForceFlushState||(nt.ForceFlushState={}));var gr=class{constructor(e={}){var t;this._registeredSpanProcessors=[],this._tracers=new Map;let n=(0,It.merge)({},(0,zm.loadDefaultConfig)(),(0,Jm.reconfigureLimits)(e));this.resource=(t=n.resource)!==null&&t!==void 0?t:sd.Resource.empty(),this.resource=sd.Resource.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});let i=this._buildExporterFromEnv();if(i!==void 0){let s=new Zm.BatchSpanProcessor(i);this.activeSpanProcessor=s}else this.activeSpanProcessor=new Qm.NoopSpanProcessor}getTracer(e,t,n){let i=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new Km.Tracer({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this)),this._tracers.get(i)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>yt.diag.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new Ym.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){yt.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&yt.context.setGlobalContextManager(e.contextManager),e.propagator&&yt.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(n=>new Promise(i=>{let s,o=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=vt.timeout},e);n.forceFlush().then(()=>{clearTimeout(o),s!==vt.timeout&&(s=vt.resolved,i(s))}).catch(a=>{clearTimeout(o),s=vt.error,i(a)})}));return new Promise((n,i)=>{Promise.all(t).then(s=>{let o=s.filter(a=>a!==vt.resolved);o.length>0?i(o):n()}).catch(s=>i([s]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,It.getEnv)().OTEL_PROPAGATORS)),n=e.map(i=>{let s=this._getPropagator(i);return s||yt.diag.warn(`Propagator "${i}" requested through environment variable is unavailable.`),s}).reduce((i,s)=>(s&&i.push(s),i),[]);if(n.length!==0)return e.length===1?n[0]:new It.CompositePropagator({propagators:n})}_buildExporterFromEnv(){let e=(0,It.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||yt.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};nt.BasicTracerProvider=gr;gr._registeredPropagators=new Map([["tracecontext",()=>new It.W3CTraceContextPropagator],["baggage",()=>new It.W3CBaggagePropagator]]);gr._registeredExporters=new Map});var ad=c(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.ConsoleSpanExporter=void 0;var Qo=S(),Zo=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,Qo.hrTimeToMicroseconds)(e.startTime),duration:(0,Qo.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(t)return t({code:Qo.ExportResultCode.SUCCESS})}};oi.ConsoleSpanExporter=Zo});var cd=c(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.InMemorySpanExporter=void 0;var ud=S(),Jo=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:ud.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:ud.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};ai.InMemorySpanExporter=Jo});var dd=c(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0})});var _d=c(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.SimpleSpanProcessor=void 0;var eg=(h(),f(d)),Lt=S(),ea=class{constructor(e){this._exporter=e,this._shutdownOnce=new Lt.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,n;if(this._shutdownOnce.isCalled||!(e.spanContext().traceFlags&eg.TraceFlags.SAMPLED))return;let i=()=>Lt.internal._export(this._exporter,[e]).then(s=>{var o;s.code!==Lt.ExportResultCode.SUCCESS&&(0,Lt.globalErrorHandler)((o=s.error)!==null&&o!==void 0?o:new Error(`SimpleSpanProcessor: span export failed (status ${s})`))}).catch(s=>{(0,Lt.globalErrorHandler)(s)});if(e.resource.asyncAttributesPending){let s=(n=(t=e.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(t).then(()=>(s!=null&&this._unresolvedExports.delete(s),i()),o=>(0,Lt.globalErrorHandler)(o));s!=null&&this._unresolvedExports.add(s)}else i()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};ui.SimpleSpanProcessor=ea});var pd=c(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0})});var Ed=c(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0})});var gd=c(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0})});var Sd=c(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0})});var Od=c(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0})});var Yo=c(v=>{"use strict";var tg=v&&v.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),B=v&&v.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tg(e,r,t)};Object.defineProperty(v,"__esModule",{value:!0});B(vl(),v);B(od(),v);B(wn(),v);B(ad(),v);B(cd(),v);B(dd(),v);B(_d(),v);B(pd(),v);B(zo(),v);B(On(),v);B(bn(),v);B(Eo(),v);B(go(),v);B(fr(),v);B(lo(),v);B(Ed(),v);B(gd(),v);B(Sd(),v);B(Od(),v)});var it={};import*as jR from"@opentelemetry/api-logs";var ta=Zu(()=>{ht(it,jR)});var bd=c(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.disableInstrumentations=Ce.enableInstrumentations=Ce.parseInstrumentationOptions=void 0;function Rd(r=[]){let e=[];for(let t=0,n=r.length;t<n;t++){let i=r[t];if(Array.isArray(i)){let s=Rd(i);e=e.concat(s.instrumentations)}else typeof i=="function"?e.push(new i):i.instrumentationName&&e.push(i)}return{instrumentations:e}}Ce.parseInstrumentationOptions=Rd;function rg(r,e,t){for(let n=0,i=r.length;n<i;n++){let s=r[n];e&&s.setTracerProvider(e),t&&s.setMeterProvider(t),s.getConfig().enabled||s.enable()}}Ce.enableInstrumentations=rg;function ng(r){r.forEach(e=>e.disable())}Ce.disableInstrumentations=ng});var yd=c(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.registerInstrumentations=void 0;var Pd=(h(),f(d)),ra=bd();function ig(r){let{instrumentations:e}=(0,ra.parseInstrumentationOptions)(r.instrumentations),t=r.tracerProvider||Pd.trace.getTracerProvider(),n=r.meterProvider||Pd.metrics.getMeterProvider();return(0,ra.enableInstrumentations)(e,t,n),()=>{(0,ra.disableInstrumentations)(e)}}ci.registerInstrumentations=ig});var ia=c(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.LogRecord=void 0;var sg=(h(),f(d)),Tr=(h(),f(d)),li=S(),na=class{constructor(e,t,n){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:i,observedTimestamp:s,severityNumber:o,severityText:a,body:u,attributes:l={},context:_}=n,E=Date.now();if(this.hrTime=(0,li.timeInputToHrTime)(i??E),this.hrTimeObserved=(0,li.timeInputToHrTime)(s??E),_){let O=Tr.trace.getSpanContext(_);O&&Tr.isSpanContextValid(O)&&(this.spanContext=O)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(l)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(Tr.diag.warn(`Invalid attribute key: ${e}`),this):!(0,li.isAttributeValue)(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(Tr.diag.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?this:((0,li.isAttributeValue)(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(Tr.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&sg.diag.warn("Can not execute the operation on emitted log record"),this._isReadonly}};di.LogRecord=na});var vd=c(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.Logger=void 0;var og=(h(),f(d)),ag=ia(),sa=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||og.context.active(),n=new ag.LogRecord(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}};_i.Logger=sa});var Id=c(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.reconfigureLimits=Mt.loadDefaultConfig=void 0;var Sr=S();function ug(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,Sr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,Sr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0}}Mt.loadDefaultConfig=ug;function cg(r){var e,t,n,i,s,o;let a=(0,Sr.getEnvWithoutDefaults)();return{attributeCountLimit:(n=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:a.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:a.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&n!==void 0?n:Sr.DEFAULT_ATTRIBUTE_COUNT_LIMIT,attributeValueLengthLimit:(o=(s=(i=r.attributeValueLengthLimit)!==null&&i!==void 0?i:a.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&s!==void 0?s:a.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&o!==void 0?o:Sr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}}Mt.reconfigureLimits=cg});var Ld=c(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.MultiLogRecordProcessor=void 0;var lg=S(),oa=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>(0,lg.callWithTimeout)(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}};hi.MultiLogRecordProcessor=oa});var ua=c(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.NoopLogRecordProcessor=void 0;var aa=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}};pi.NoopLogRecordProcessor=aa});var Md=c(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.LoggerProviderSharedState=void 0;var dg=ua(),ca=class{constructor(e,t,n){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new dg.NoopLogRecordProcessor}};fi.LoggerProviderSharedState=ca});var wd=c(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.LoggerProvider=st.DEFAULT_LOGGER_NAME=void 0;var Ar=(h(),f(d)),_g=(ta(),f(it)),hg=tt(),Cd=S(),pg=vd(),Nd=Id(),fg=Ld(),Eg=Md();st.DEFAULT_LOGGER_NAME="unknown";var la=class{constructor(e={}){let{resource:t=hg.Resource.default(),logRecordLimits:n,forceFlushTimeoutMillis:i}=(0,Cd.merge)({},(0,Nd.loadDefaultConfig)(),e);this._sharedState=new Eg.LoggerProviderSharedState(t,i,(0,Nd.reconfigureLimits)(n)),this._shutdownOnce=new Cd.BindOnceFuture(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return Ar.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),_g.NOOP_LOGGER;e||Ar.diag.warn("Logger requested without instrumentation scope name.");let i=e||st.DEFAULT_LOGGER_NAME,s=`${i}@${t||""}:${n?.schemaUrl||""}`;return this._sharedState.loggers.has(s)||this._sharedState.loggers.set(s,new pg.Logger({name:i,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(s)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>Ar.diag.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new fg.MultiLogRecordProcessor(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(Ar.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Ar.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};st.LoggerProvider=la});var xd=c(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ConsoleLogRecordExporter=void 0;var mg=S(),gg=S(),da=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,n,i;return{timestamp:(0,mg.hrTimeToMicroseconds)(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(n=e.spanContext)===null||n===void 0?void 0:n.spanId,traceFlags:(i=e.spanContext)===null||i===void 0?void 0:i.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});t?.({code:gg.ExportResultCode.SUCCESS})}};Ei.ConsoleLogRecordExporter=da});var Dd=c(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.SimpleLogRecordProcessor=void 0;var _a=S(),ha=class{constructor(e){this._exporter=e,this._shutdownOnce=new _a.BindOnceFuture(this._shutdown,this)}onEmit(e){this._shutdownOnce.isCalled||this._exporter.export([e],t=>{var n;if(t.code!==_a.ExportResultCode.SUCCESS){(0,_a.globalErrorHandler)((n=t.error)!==null&&n!==void 0?n:new Error(`SimpleLogRecordProcessor: log record export failed (status ${t})`));return}})}forceFlush(){return Promise.resolve()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};mi.SimpleLogRecordProcessor=ha});var Ud=c(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.InMemoryLogRecordExporter=void 0;var Bd=S(),pa=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Bd.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Bd.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}};gi.InMemoryLogRecordExporter=pa});var qd=c(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.BatchLogRecordProcessorBase=void 0;var Tg=(h(),f(d)),Ct=S(),fa=class{constructor(e,t){var n,i,s,o;this._exporter=e,this._finishedLogRecords=[];let a=(0,Ct.getEnv)();this._maxExportBatchSize=(n=t?.maxExportBatchSize)!==null&&n!==void 0?n:a.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(i=t?.maxQueueSize)!==null&&i!==void 0?i:a.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(s=t?.scheduledDelayMillis)!==null&&s!==void 0?s:a.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(o=t?.exportTimeoutMillis)!==null&&o!==void 0?o:a.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new Ct.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Tg.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let s=0;s<i;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{(0,Ct.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{(0,Ct.globalErrorHandler)(e)})},this._scheduledDelayMillis),(0,Ct.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){return new Promise((t,n)=>{this._exporter.export(e,i=>{var s;if(i.code!==Ct.ExportResultCode.SUCCESS){n((s=i.error)!==null&&s!==void 0?s:new Error(`BatchLogRecordProcessorBase: log record export failed (status ${i})`));return}t(i)})})}};Ti.BatchLogRecordProcessorBase=fa});var Gd=c(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.BatchLogRecordProcessor=void 0;var Sg=qd(),Ea=class extends Sg.BatchLogRecordProcessorBase{onShutdown(){}};Si.BatchLogRecordProcessor=Ea});var Vd=c(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.BatchLogRecordProcessor=void 0;var Ag=Gd();Object.defineProperty(Ai,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return Ag.BatchLogRecordProcessor}})});var jd=c(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.BatchLogRecordProcessor=void 0;var Og=Vd();Object.defineProperty(Oi,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return Og.BatchLogRecordProcessor}})});var Fd=c(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.BatchLogRecordProcessor=K.InMemoryLogRecordExporter=K.SimpleLogRecordProcessor=K.ConsoleLogRecordExporter=K.NoopLogRecordProcessor=K.LogRecord=K.LoggerProvider=void 0;var Rg=wd();Object.defineProperty(K,"LoggerProvider",{enumerable:!0,get:function(){return Rg.LoggerProvider}});var bg=ia();Object.defineProperty(K,"LogRecord",{enumerable:!0,get:function(){return bg.LogRecord}});var Pg=ua();Object.defineProperty(K,"NoopLogRecordProcessor",{enumerable:!0,get:function(){return Pg.NoopLogRecordProcessor}});var yg=xd();Object.defineProperty(K,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return yg.ConsoleLogRecordExporter}});var vg=Dd();Object.defineProperty(K,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return vg.SimpleLogRecordProcessor}});var Ig=Ud();Object.defineProperty(K,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return Ig.InMemoryLogRecordExporter}});var Lg=jd();Object.defineProperty(K,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return Lg.BatchLogRecordProcessor}})});var Ri=c(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.AggregationTemporality=void 0;var Mg;(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(Mg=Or.AggregationTemporality||(Or.AggregationTemporality={}))});var Nt=c(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.DataPointType=void 0;var Cg;(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(Cg=Rr.DataPointType||(Rr.DataPointType={}))});var Ee=c(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.equalsCaseInsensitive=M.binarySearchLB=M.setEquals=M.FlatMap=M.isPromiseAllSettledRejectionResult=M.PromiseAllSettled=M.callWithTimeout=M.TimeoutError=M.instrumentationScopeId=M.hashAttributes=M.isNotNullish=void 0;function Ng(r){return r!=null}M.isNotNullish=Ng;function wg(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}M.hashAttributes=wg;function xg(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}M.instrumentationScopeId=xg;var bi=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};M.TimeoutError=bi;function Dg(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new bi("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}M.callWithTimeout=Dg;async function Bg(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}M.PromiseAllSettled=Bg;function Ug(r){return r.status==="rejected"}M.isPromiseAllSettledRejectionResult=Ug;function qg(r,e){let t=[];return r.forEach(n=>{t.push(...e(n))}),t}M.FlatMap=qg;function Gg(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}M.setEquals=Gg;function Vg(r,e){let t=0,n=r.length-1;for(;n-t>1;){let i=Math.trunc((n+t)/2);r[i]<=e?t=i:n=i-1}return r[n]<=e?n:r[t]<=e?t:-1}M.binarySearchLB=Vg;function jg(r,e){return r.toLowerCase()===e.toLowerCase()}M.equalsCaseInsensitive=jg});var wt=c(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.AggregatorKind=void 0;var Fg;(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(Fg=br.AggregatorKind||(br.AggregatorKind={}))});var Hd=c(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.DropAggregator=void 0;var Hg=wt(),ma=class{constructor(){this.kind=Hg.AggregatorKind.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,i){}};Pi.DropAggregator=ma});var Ae=c(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.isValidName=ne.isDescriptorCompatibleWith=ne.createInstrumentDescriptorWithView=ne.createInstrumentDescriptor=ne.InstrumentType=void 0;var kd=(h(),f(d)),kg=Ee(),Xg;(function(r){r.COUNTER="COUNTER",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(Xg=ne.InstrumentType||(ne.InstrumentType={}));function $g(r,e,t){var n,i,s,o;return Xd(r)||kd.diag.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(n=t?.description)!==null&&n!==void 0?n:"",unit:(i=t?.unit)!==null&&i!==void 0?i:"",valueType:(s=t?.valueType)!==null&&s!==void 0?s:kd.ValueType.DOUBLE,advice:(o=t?.advice)!==null&&o!==void 0?o:{}}}ne.createInstrumentDescriptor=$g;function Wg(r,e){var t,n;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(n=r.description)!==null&&n!==void 0?n:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}ne.createInstrumentDescriptorWithView=Wg;function Kg(r,e){return(0,kg.equalsCaseInsensitive)(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}ne.isDescriptorCompatibleWith=Kg;var zg=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function Xd(r){return r.match(zg)!=null}ne.isValidName=Xd});var $d=c(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.HistogramAggregator=Dt.HistogramAccumulation=void 0;var Yg=wt(),Qg=Nt(),ga=Ae(),Zg=Ee();function Jg(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var xt=class{constructor(e,t,n=!0,i=Jg(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=i}record(e){this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=(0,Zg.binarySearchLB)(this._boundaries,e);this._current.buckets.counts[t+1]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Dt.HistogramAccumulation=xt;var Ta=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=Yg.AggregatorKind.HISTOGRAM}createAccumulation(e){return new xt(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let _=0;_<s.length;_++)a[_]=s[_]+o[_];let u=1/0,l=-1/0;return this._recordMinMax&&(n.hasMinMax&&i.hasMinMax?(u=Math.min(n.min,i.min),l=Math.max(n.max,i.max)):n.hasMinMax?(u=n.min,l=n.max):i.hasMinMax&&(u=i.min,l=i.max)),new xt(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:n.count+i.count,sum:n.sum+i.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||i.hasMinMax),min:u,max:l})}diff(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let u=0;u<s.length;u++)a[u]=o[u]-s[u];return new xt(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:i.count-n.count,sum:i.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:Qg.DataPointType.HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===ga.InstrumentType.UP_DOWN_COUNTER||e.type===ga.InstrumentType.OBSERVABLE_GAUGE||e.type===ga.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}};Dt.HistogramAggregator=Ta});var Wd=c(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.Buckets=void 0;var Sa=class r{constructor(e=new Aa,t=0,n=0,i=0){this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,i=0,s=0;for(let o=this.indexStart;o<=this.indexEnd;){let a=o%n;a<0&&(a+=n);for(let u=a;u<n&&i<t;u++)this._relocateBucket(s,i),i++,o++;s++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}};yi.Buckets=Sa;var Aa=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let i=new Array(e).fill(0);i.splice(n,this._counts.length-t,...this._counts.slice(t)),i.splice(0,t,...this._counts.slice(0,t)),this._counts=i}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let i=0;i<n;i++){let s=this._counts[e+i];this._counts[e+i]=this._counts[t-i-1],this._counts[t-i-1]=s}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});var Ra=c(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.getSignificand=Y.getNormalBase2=Y.MIN_VALUE=Y.MAX_NORMAL_EXPONENT=Y.MIN_NORMAL_EXPONENT=Y.SIGNIFICAND_WIDTH=void 0;Y.SIGNIFICAND_WIDTH=52;var eT=2146435072,tT=1048575,Oa=1023;Y.MIN_NORMAL_EXPONENT=-Oa+1;Y.MAX_NORMAL_EXPONENT=Oa;Y.MIN_VALUE=Math.pow(2,-1022);function rT(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&eT)>>20)-Oa}Y.getNormalBase2=rT;function nT(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),n=e.getUint32(4);return(t&tT)*Math.pow(2,32)+n}Y.getSignificand=nT});var vi=c(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.nextGreaterSquare=Bt.ldexp=void 0;function iT(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}Bt.ldexp=iT;function sT(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}Bt.nextGreaterSquare=sT});var Li=c(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.MappingError=void 0;var ba=class extends Error{};Ii.MappingError=ba});var zd=c(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.ExponentMapping=void 0;var Ut=Ra(),oT=vi(),Kd=Li(),Pa=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<Ut.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let t=Ut.getNormalBase2(e),n=this._rightShift(Ut.getSignificand(e)-1,Ut.SIGNIFICAND_WIDTH);return t+n>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new Kd.MappingError(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new Kd.MappingError(`overflow: ${e} is > maximum lower boundary: ${n}`);return oT.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=Ut.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return Ut.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}};Mi.ExponentMapping=Pa});var Zd=c(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.LogarithmMapping=void 0;var qt=Ra(),Yd=vi(),Qd=Li(),ya=class{constructor(e){this._scale=e,this._scaleFactor=Yd.ldexp(Math.LOG2E,e),this._inverseFactor=Yd.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=qt.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(qt.getSignificand(e)===0)return(qt.getNormalBase2(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new Qd.MappingError(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return qt.MIN_VALUE;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new Qd.MappingError(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return qt.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(qt.MAX_NORMAL_EXPONENT+1<<this._scale)-1}};Ci.LogarithmMapping=ya});var t_=c(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.getMapping=void 0;var aT=zd(),uT=Zd(),cT=Li(),Jd=-10,e_=20,lT=Array.from({length:31},(r,e)=>e>10?new uT.LogarithmMapping(e-10):new aT.ExponentMapping(e-10));function dT(r){if(r>e_||r<Jd)throw new cT.MappingError(`expected scale >= ${Jd} && <= ${e_}, got: ${r}`);return lT[r+10]}Ni.getMapping=dT});var i_=c(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.ExponentialHistogramAggregator=Vt.ExponentialHistogramAccumulation=void 0;var _T=wt(),hT=Nt(),pT=(h(),f(d)),va=Ae(),r_=Wd(),n_=t_(),fT=vi(),Gt=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},ET=20,mT=160,Ia=2,wi=class r{constructor(e=e,t=mT,n=!0,i=0,s=0,o=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,l=new r_.Buckets,_=new r_.Buckets,E=(0,n_.getMapping)(ET)){this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=o,this._min=a,this._max=u,this._positive=l,this._negative=_,this._mapping=E,this._maxSize<Ia&&(pT.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${Ia}`),this._maxSize=Ia)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let i=this._mapping.mapToIndex(t),s=!1,o=0,a=0;if(e.length===0?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i<e.indexStart&&e.indexEnd-i>=this._maxSize?(s=!0,a=i,o=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(s=!0,a=e.indexStart,o=i),s){let u=this._changeScale(o,a);this._downscale(u),i=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,i,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(t<e.indexStart){let s=e.indexEnd-t;s>=e.backing.length&&this._grow(e,s+1),e.indexStart=t}else if(t>e.indexEnd){let s=t-e.indexStart;s>=e.backing.length&&this._grow(e,s+1),e.indexEnd=t}let i=t-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,n)}_grow(e,t){let n=e.backing.length,i=e.indexBase-e.indexStart,s=n-i,o=(0,fT.nextGreaterSquare)(t);o>this._maxSize&&(o=this._maxSize);let a=o-i;e.backing.growTo(o,s,a)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=(0,n_.getMapping)(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=Gt.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),i=Gt.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(i.high,i.low))}_highLowAtScale(e,t,n){if(e.length===0)return new Gt(0,-1);let i=t-n;return new Gt(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++)this._incrementIndexBy(e,s+a>>o,n.at(a))}_diffBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++){let l=(s+a>>o)-e.indexBase;l<0&&(l+=e.backing.length),e.decrementBucket(l,n.at(a))}e.trim()}};Vt.ExponentialHistogramAccumulation=wi;var La=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=_T.AggregatorKind.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new wi(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:hT.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===va.InstrumentType.UP_DOWN_COUNTER||e.type===va.InstrumentType.OBSERVABLE_GAUGE||e.type===va.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}};Vt.ExponentialHistogramAggregator=La});var s_=c(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.LastValueAggregator=Ft.LastValueAccumulation=void 0;var gT=wt(),Pr=S(),TT=Nt(),jt=class{constructor(e,t=0,n=[0,0]){this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=(0,Pr.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ft.LastValueAccumulation=jt;var Ma=class{constructor(){this.kind=gT.AggregatorKind.LAST_VALUE}createAccumulation(e){return new jt(e)}merge(e,t){let n=(0,Pr.hrTimeToMicroseconds)(t.sampleTime)>=(0,Pr.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=(0,Pr.hrTimeToMicroseconds)(t.sampleTime)>=(0,Pr.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:TT.DataPointType.GAUGE,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()}))}}};Ft.LastValueAggregator=Ma});var o_=c(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.SumAggregator=Ht.SumAccumulation=void 0;var ST=wt(),AT=Nt(),Ne=class{constructor(e,t,n=0,i=!1){this.startTime=e,this.monotonic=t,this._current=n,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ht.SumAccumulation=Ne;var Ca=class{constructor(e){this.monotonic=e,this.kind=ST.AggregatorKind.SUM}createAccumulation(e){return new Ne(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue();return t.reset?new Ne(t.startTime,this.monotonic,i,t.reset):new Ne(e.startTime,this.monotonic,n+i)}diff(e,t){let n=e.toPointValue(),i=t.toPointValue();return this.monotonic&&n>i?new Ne(t.startTime,this.monotonic,i,!0):new Ne(t.startTime,this.monotonic,i-n)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:AT.DataPointType.SUM,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()})),isMonotonic:this.monotonic}}};Ht.SumAggregator=Ca});var a_=c(ce=>{"use strict";var OT=ce&&ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yr=ce&&ce.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&OT(e,r,t)};Object.defineProperty(ce,"__esModule",{value:!0});yr(Hd(),ce);yr($d(),ce);yr(i_(),ce);yr(s_(),ce);yr(o_(),ce)});var Ui=c(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.DefaultAggregation=G.ExponentialHistogramAggregation=G.ExplicitBucketHistogramAggregation=G.HistogramAggregation=G.LastValueAggregation=G.SumAggregation=G.DropAggregation=G.Aggregation=void 0;var RT=(h(),f(d)),ot=a_(),Oe=Ae(),me=class{static Drop(){return u_}static Sum(){return c_}static LastValue(){return l_}static Histogram(){return d_}static ExponentialHistogram(){return bT}static Default(){return PT}};G.Aggregation=me;var vr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};G.DropAggregation=vr;vr.DEFAULT_INSTANCE=new ot.DropAggregator;var kt=class r extends me{createAggregator(e){switch(e.type){case Oe.InstrumentType.COUNTER:case Oe.InstrumentType.OBSERVABLE_COUNTER:case Oe.InstrumentType.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};G.SumAggregation=kt;kt.MONOTONIC_INSTANCE=new ot.SumAggregator(!0);kt.NON_MONOTONIC_INSTANCE=new ot.SumAggregator(!1);var Ir=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};G.LastValueAggregation=Ir;Ir.DEFAULT_INSTANCE=new ot.LastValueAggregator;var Lr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};G.HistogramAggregation=Lr;Lr.DEFAULT_INSTANCE=new ot.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);var xi=class extends me{constructor(e,t=!0){if(super(),this._recordMinMax=t,e===void 0||e.length===0)throw new Error("HistogramAggregator should be created with boundaries.");e=e.concat(),e=e.sort((s,o)=>s-o);let n=e.lastIndexOf(-1/0),i=e.indexOf(1/0);i===-1&&(i=void 0),this._boundaries=e.slice(n+1,i)}createAggregator(e){return new ot.HistogramAggregator(this._boundaries,this._recordMinMax)}};G.ExplicitBucketHistogramAggregation=xi;var Di=class extends me{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new ot.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};G.ExponentialHistogramAggregation=Di;var Bi=class extends me{_resolve(e){switch(e.type){case Oe.InstrumentType.COUNTER:case Oe.InstrumentType.UP_DOWN_COUNTER:case Oe.InstrumentType.OBSERVABLE_COUNTER:case Oe.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return c_;case Oe.InstrumentType.OBSERVABLE_GAUGE:return l_;case Oe.InstrumentType.HISTOGRAM:return e.advice.explicitBucketBoundaries?new xi(e.advice.explicitBucketBoundaries):d_}return RT.diag.warn(`Unable to recognize instrument type: ${e.type}`),u_}createAggregator(e){return this._resolve(e).createAggregator(e)}};G.DefaultAggregation=Bi;var u_=new vr,c_=new kt,l_=new Ir,d_=new Lr,bT=new Di,PT=new Bi});var Na=c(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Xt.DEFAULT_AGGREGATION_SELECTOR=void 0;var yT=Ui(),vT=Ri(),IT=r=>yT.Aggregation.Default();Xt.DEFAULT_AGGREGATION_SELECTOR=IT;var LT=r=>vT.AggregationTemporality.CUMULATIVE;Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=LT});var xa=c(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.MetricReader=void 0;var __=(h(),f(d)),qi=Ee(),h_=Na(),wa=class{constructor(e){var t,n,i;this._shutdown=!1,this._aggregationSelector=(t=e?.aggregationSelector)!==null&&t!==void 0?t:h_.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=(n=e?.aggregationTemporalitySelector)!==null&&n!==void 0?n:h_.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=(i=e?.metricProducers)!==null&&i!==void 0?i:[]}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(a=>a.collect({timeoutMillis:e?.timeoutMillis}))]),i=t.errors.concat((0,qi.FlatMap)(n,a=>a.errors)),s=t.resourceMetrics.resource,o=t.resourceMetrics.scopeMetrics.concat((0,qi.FlatMap)(n,a=>a.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:s,scopeMetrics:o},errors:i}}async shutdown(e){if(this._shutdown){__.diag.error("Cannot call shutdown twice.");return}e?.timeoutMillis==null?await this.onShutdown():await(0,qi.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){__.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,qi.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}};Gi.MetricReader=wa});var E_=c(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.PeriodicExportingMetricReader=void 0;var p_=(h(),f(d)),Vi=S(),MT=xa(),f_=Ee(),CT=(h(),f(d)),Da=class extends MT.MetricReader{constructor(e){var t,n,i,s;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(n=e.exporter.selectAggregationTemporality)===null||n===void 0?void 0:n.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(i=e.exportIntervalMillis)!==null&&i!==void 0?i:6e4,this._exportTimeout=(s=e.exportTimeoutMillis)!==null&&s!==void 0?s:3e4,this._exporter=e.exporter}async _runOnce(){try{await(0,f_.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof f_.TimeoutError){p_.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,Vi.globalErrorHandler)(e)}}async _doRun(){var e,t;let{resourceMetrics:n,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});i.length>0&&p_.diag.error("PeriodicExportingMetricReader: metrics collection errors",...i);let s=async()=>{let o=await Vi.internal._export(this._exporter,n);if(o.code!==Vi.ExportResultCode.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${o.error})`)};n.resource.asyncAttributesPending?(t=(e=n.resource).waitForAsyncAttributes)===null||t===void 0||t.call(e).then(s,o=>CT.diag.debug("Error while resolving async portion of resource: ",o)):await s()}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),(0,Vi.unrefTimer)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}};ji.PeriodicExportingMetricReader=Da});var g_=c(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.InMemoryMetricExporter=void 0;var m_=S(),Ba=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:m_.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:m_.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}};Fi.InMemoryMetricExporter=Ba});var S_=c(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ConsoleMetricExporter=void 0;var T_=S(),NT=Na(),Ua=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e?.temporalitySelector)!==null&&t!==void 0?t:NT.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(e,t){if(this._shutdown){setImmediate(t,{code:T_.ExportResultCode.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let n of e.scopeMetrics)for(let i of n.metrics)console.dir({descriptor:i.descriptor,dataPointType:i.dataPointType,dataPoints:i.dataPoints});t({code:T_.ExportResultCode.SUCCESS})}};Hi.ConsoleMetricExporter=Ua});var A_=c(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.ViewRegistry=void 0;var qa=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(i=>this._matchInstrument(i.instrumentSelector,e)&&this._matchMeter(i.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}};ki.ViewRegistry=qa});var Xi=c(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.isObservableInstrument=x.ObservableUpDownCounterInstrument=x.ObservableGaugeInstrument=x.ObservableCounterInstrument=x.ObservableInstrument=x.HistogramInstrument=x.CounterInstrument=x.UpDownCounterInstrument=x.SyncInstrument=void 0;var $t=(h(),f(d)),wT=S(),Wt=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n=$t.context.active()){if(typeof e!="number"){$t.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===$t.ValueType.INT&&!Number.isInteger(e)&&($t.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,n,(0,wT.millisToHrTime)(Date.now()))}};x.SyncInstrument=Wt;var Ga=class extends Wt{add(e,t,n){this._record(e,t,n)}};x.UpDownCounterInstrument=Ga;var Va=class extends Wt{add(e,t,n){if(e<0){$t.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};x.CounterInstrument=Va;var ja=class extends Wt{record(e,t,n){if(e<0){$t.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};x.HistogramInstrument=ja;var at=class{constructor(e,t,n){this._observableRegistry=n,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};x.ObservableInstrument=at;var Fa=class extends at{};x.ObservableCounterInstrument=Fa;var Ha=class extends at{};x.ObservableGaugeInstrument=Ha;var ka=class extends at{};x.ObservableUpDownCounterInstrument=ka;function xT(r){return r instanceof at}x.isObservableInstrument=xT});var O_=c($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.Meter=void 0;var se=Ae(),Kt=Xi(),Xa=class{constructor(e){this._meterSharedState=e}createHistogram(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.HISTOGRAM,t),i=this._meterSharedState.registerMetricStorage(n);return new Kt.HistogramInstrument(i,n)}createCounter(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new Kt.CounterInstrument(i,n)}createUpDownCounter(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.UP_DOWN_COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new Kt.UpDownCounterInstrument(i,n)}createObservableGauge(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.OBSERVABLE_GAUGE,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new Kt.ObservableGaugeInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.OBSERVABLE_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new Kt.ObservableCounterInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new Kt.ObservableUpDownCounterInstrument(n,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};$i.Meter=Xa});var Wa=c(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.MetricStorage=void 0;var DT=Ae(),$a=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,DT.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};Wi.MetricStorage=$a});var Mr=c(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.AttributeHashMap=zt.HashMap=void 0;var BT=Ee(),Ki=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let i=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,i),i}set(e,t,n){n??(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}};zt.HashMap=Ki;var Ka=class extends Ki{constructor(){super(BT.hashAttributes)}};zt.AttributeHashMap=Ka});var Qa=c(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.DeltaMetricProcessor=void 0;var za=Mr(),Ya=class{constructor(e){this._aggregator=e,this._activeCollectionStorage=new za.AttributeHashMap,this._cumulativeMemoStorage=new za.AttributeHashMap}record(e,t,n,i){let s=this._activeCollectionStorage.getOrDefault(t,()=>this._aggregator.createAccumulation(i));s?.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([n,i,s])=>{let o=this._aggregator.createAccumulation(t);o?.record(i);let a=o;if(this._cumulativeMemoStorage.has(n,s)){let u=this._cumulativeMemoStorage.get(n,s);a=this._aggregator.diff(u,o)}if(this._activeCollectionStorage.has(n,s)){let u=this._activeCollectionStorage.get(n,s);a=this._aggregator.merge(u,a)}this._cumulativeMemoStorage.set(n,o,s),this._activeCollectionStorage.set(n,a,s)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new za.AttributeHashMap,e}};zi.DeltaMetricProcessor=Ya});var Ja=c(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.TemporalMetricProcessor=void 0;var UT=Ri(),qT=Mr(),Za=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(e,t,n,i){this._stashAccumulations(n);let s=this._getMergedUnreportedAccumulations(e),o=s,a;if(this._reportHistory.has(e)){let l=this._reportHistory.get(e),_=l.collectionTime;a=l.aggregationTemporality,a===UT.AggregationTemporality.CUMULATIVE?o=r.merge(l.accumulations,s,this._aggregator):o=r.calibrateStartTime(l.accumulations,s,_)}else a=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:o,collectionTime:i,aggregationTemporality:a});let u=GT(o);if(u.length!==0)return this._aggregator.toMetricData(t,a,u,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let i=this._unreportedAccumulations.get(n);i===void 0&&(i=[],this._unreportedAccumulations.set(n,i)),i.push(e)}}_getMergedUnreportedAccumulations(e){let t=new qT.AttributeHashMap,n=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),n===void 0)return t;for(let i of n)t=r.merge(t,i,this._aggregator);return t}static merge(e,t,n){let i=e,s=t.entries(),o=s.next();for(;o.done!==!0;){let[a,u,l]=o.value;if(e.has(a,l)){let _=e.get(a,l),E=n.merge(_,u);i.set(a,E,l)}else i.set(a,u,l);o=s.next()}return i}static calibrateStartTime(e,t,n){for(let[i,s]of e.keys()){let o=t.get(i,s);o?.setStartTime(n)}return t}};Yi.TemporalMetricProcessor=Za;function GT(r){return Array.from(r.entries())}});var R_=c(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.AsyncMetricStorage=void 0;var VT=Wa(),jT=Qa(),FT=Ja(),HT=Mr(),eu=class extends VT.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new jT.DeltaMetricProcessor(t),this._temporalMetricStorage=new FT.TemporalMetricProcessor(t,i)}record(e,t){let n=new HT.AttributeHashMap;Array.from(e.entries()).forEach(([i,s])=>{n.set(this._attributesProcessor.process(i),s)}),this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};Qi.AsyncMetricStorage=eu});var I_=c(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.getConflictResolutionRecipe=Q.getDescriptionResolutionRecipe=Q.getTypeConflictResolutionRecipe=Q.getUnitConflictResolutionRecipe=Q.getValueTypeConflictResolutionRecipe=Q.getIncompatibilityDetails=void 0;function kT(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}'
7
+ var sf=Object.create;var Ho=Object.defineProperty;var af=Object.getOwnPropertyDescriptor;var uf=Object.getOwnPropertyNames;var cf=Object.getPrototypeOf,lf=Object.prototype.hasOwnProperty;var ee=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var _c=(r,e)=>()=>(r&&(e=r(r=0)),e);var c=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Wr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uf(e))!lf.call(r,i)&&i!==t&&Ho(r,i,{get:()=>e[i],enumerable:!(n=af(e,i))||n.enumerable});return r},Et=(r,e,t)=>(Wr(r,e,"default"),t&&Wr(t,e,"default")),G=(r,e,t)=>(t=r!=null?sf(cf(r)):{},Wr(e||!r||!r.__esModule?Ho(t,"default",{value:r,enumerable:!0}):t,r)),f=r=>Wr(Ho({},"__esModule",{value:!0}),r);var d={};import*as qO from"@opentelemetry/api";var p=_c(()=>{Et(d,qO)});var pr=c(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.isTracingSuppressed=Ie.unsuppressTracing=Ie.suppressTracing=void 0;var df=(p(),f(d)),ko=(0,df.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function _f(r){return r.setValue(ko,!0)}Ie.suppressTracing=_f;function pf(r){return r.deleteValue(ko)}Ie.unsuppressTracing=pf;function hf(r){return r.getValue(ko)===!0}Ie.isTracingSuppressed=hf});var $o=c($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.BAGGAGE_MAX_TOTAL_LENGTH=$.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=$.BAGGAGE_MAX_NAME_VALUE_PAIRS=$.BAGGAGE_HEADER=$.BAGGAGE_ITEMS_SEPARATOR=$.BAGGAGE_PROPERTIES_SEPARATOR=$.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;$.BAGGAGE_KEY_PAIR_SEPARATOR="=";$.BAGGAGE_PROPERTIES_SEPARATOR=";";$.BAGGAGE_ITEMS_SEPARATOR=",";$.BAGGAGE_HEADER="baggage";$.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;$.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;$.BAGGAGE_MAX_TOTAL_LENGTH=8192});var Xo=c(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.parseKeyPairsIntoRecord=he.parsePairKeyValue=he.getKeyPairs=he.serializeKeyPairs=void 0;var ff=(p(),f(d)),ke=$o();function Ef(r){return r.reduce((e,t)=>{let n=`${e}${e!==""?ke.BAGGAGE_ITEMS_SEPARATOR:""}${t}`;return n.length>ke.BAGGAGE_MAX_TOTAL_LENGTH?e:n},"")}he.serializeKeyPairs=Ef;function mf(r){return r.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=ke.BAGGAGE_PROPERTIES_SEPARATOR+t.metadata.toString()),n})}he.getKeyPairs=mf;function pc(r){let e=r.split(ke.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let t=e.shift();if(!t)return;let n=t.indexOf(ke.BAGGAGE_KEY_PAIR_SEPARATOR);if(n<=0)return;let i=decodeURIComponent(t.substring(0,n).trim()),o=decodeURIComponent(t.substring(n+1).trim()),s;return e.length>0&&(s=(0,ff.baggageEntryMetadataFromString)(e.join(ke.BAGGAGE_PROPERTIES_SEPARATOR))),{key:i,value:o,metadata:s}}he.parsePairKeyValue=pc;function gf(r){return typeof r!="string"||r.length===0?{}:r.split(ke.BAGGAGE_ITEMS_SEPARATOR).map(e=>pc(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}he.parseKeyPairsIntoRecord=gf});var hc=c(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.W3CBaggagePropagator=void 0;var Wo=(p(),f(d)),Tf=pr(),$e=$o(),Ko=Xo(),zo=class{inject(e,t,n){let i=Wo.propagation.getBaggage(e);if(!i||(0,Tf.isTracingSuppressed)(e))return;let o=(0,Ko.getKeyPairs)(i).filter(a=>a.length<=$e.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,$e.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,Ko.serializeKeyPairs)(o);s.length>0&&n.set(t,$e.BAGGAGE_HEADER,s)}extract(e,t,n){let i=n.get(t,$e.BAGGAGE_HEADER),o=Array.isArray(i)?i.join($e.BAGGAGE_ITEMS_SEPARATOR):i;if(!o)return e;let s={};return o.length===0||(o.split($e.BAGGAGE_ITEMS_SEPARATOR).forEach(u=>{let l=(0,Ko.parsePairKeyValue)(u);if(l){let _={value:l.value};l.metadata&&(_.metadata=l.metadata),s[l.key]=_}}),Object.entries(s).length===0)?e:Wo.propagation.setBaggage(e,Wo.propagation.createBaggage(s))}fields(){return[$e.BAGGAGE_HEADER]}};Kr.W3CBaggagePropagator=zo});var fc=c(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.AnchoredClock=void 0;var Yo=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};zr.AnchoredClock=Yo});var Sc=c(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.isAttributeValue=Le.isAttributeKey=Le.sanitizeAttributes=void 0;var Ec=(p(),f(d));function Sf(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,n]of Object.entries(r)){if(!mc(t)){Ec.diag.warn(`Invalid attribute key: ${t}`);continue}if(!gc(n)){Ec.diag.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(n)?e[t]=n.slice():e[t]=n}return e}Le.sanitizeAttributes=Sf;function mc(r){return typeof r=="string"&&r.length>0}Le.isAttributeKey=mc;function gc(r){return r==null?!0:Array.isArray(r)?Af(r):Tc(r)}Le.isAttributeValue=gc;function Af(r){let e;for(let t of r)if(t!=null){if(!e){if(Tc(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Tc(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}});var Qo=c(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.loggingErrorHandler=void 0;var Of=(p(),f(d));function Rf(){return r=>{Of.diag.error(bf(r))}}Yr.loggingErrorHandler=Rf;function bf(r){return typeof r=="string"?r:JSON.stringify(Pf(r))}function Pf(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(n=>{if(e[n])return;let i=t[n];i&&(e[n]=String(i))}),t=Object.getPrototypeOf(t);return e}});var Zo=c(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.globalErrorHandler=mt.setGlobalErrorHandler=void 0;var yf=Qo(),Ac=(0,yf.loggingErrorHandler)();function vf(r){Ac=r}mt.setGlobalErrorHandler=vf;function If(r){try{Ac(r)}catch{}}mt.globalErrorHandler=If});var Jo=c(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.TracesSamplerValues=void 0;var Lf;(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Lf=hr.TracesSamplerValues||(hr.TracesSamplerValues={}))});var Oc=c(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr._globalThis=void 0;Qr._globalThis=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});var Zr=c(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.getEnvWithoutDefaults=v.parseEnvironment=v.DEFAULT_ENVIRONMENT=v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=void 0;var Me=(p(),f(d)),Mf=Jo(),Cf=Oc(),Nf=",",wf=["OTEL_SDK_DISABLED"];function xf(r){return wf.indexOf(r)>-1}var Df=["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 Uf(r){return Df.indexOf(r)>-1}var Bf=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function qf(r){return Bf.indexOf(r)>-1}v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;v.DEFAULT_ENVIRONMENT={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:Me.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Mf.TracesSamplerValues.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"};function Gf(r,e,t){if(typeof t[r]>"u")return;let n=String(t[r]);e[r]=n.toLowerCase()==="true"}function Vf(r,e,t,n=-1/0,i=1/0){if(typeof t[r]<"u"){let o=Number(t[r]);isNaN(o)||(o<n?e[r]=n:o>i?e[r]=i:e[r]=o)}}function jf(r,e,t,n=Nf){let i=t[r];typeof i=="string"&&(e[r]=i.split(n).map(o=>o.trim()))}var Ff={ALL:Me.DiagLogLevel.ALL,VERBOSE:Me.DiagLogLevel.VERBOSE,DEBUG:Me.DiagLogLevel.DEBUG,INFO:Me.DiagLogLevel.INFO,WARN:Me.DiagLogLevel.WARN,ERROR:Me.DiagLogLevel.ERROR,NONE:Me.DiagLogLevel.NONE};function Hf(r,e,t){let n=t[r];if(typeof n=="string"){let i=Ff[n.toUpperCase()];i!=null&&(e[r]=i)}}function es(r){let e={};for(let t in v.DEFAULT_ENVIRONMENT){let n=t;switch(n){case"OTEL_LOG_LEVEL":Hf(n,e,r);break;default:if(xf(n))Gf(n,e,r);else if(Uf(n))Vf(n,e,r);else if(qf(n))jf(n,e,r);else{let i=r[n];typeof i<"u"&&i!==null&&(e[n]=String(i))}}}return e}v.parseEnvironment=es;function kf(){return typeof process<"u"&&process&&process.env?es(process.env):es(Cf._globalThis)}v.getEnvWithoutDefaults=kf});var bc=c(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.getEnv=void 0;var $f=ee("os"),Rc=Zr();function Xf(){let r=(0,Rc.parseEnvironment)(process.env);return Object.assign({HOSTNAME:$f.hostname()},Rc.DEFAULT_ENVIRONMENT,r)}Jr.getEnv=Xf});var Pc=c(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en._globalThis=void 0;en._globalThis=typeof globalThis=="object"?globalThis:global});var vc=c(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.hexToBase64=void 0;function yc(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}var Wf=Buffer.alloc(8),Kf=Buffer.alloc(16);function zf(r){let e;r.length===16?e=Wf:r.length===32?e=Kf:e=Buffer.alloc(r.length/2);let t=0;for(let n=0;n<r.length;n+=2){let i=yc(r.charCodeAt(n)),o=yc(r.charCodeAt(n+1));e.writeUInt8(i<<4|o,t++)}return e.toString("base64")}tn.hexToBase64=zf});var Mc=c(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.RandomIdGenerator=void 0;var Yf=8,Lc=16,ts=class{constructor(){this.generateTraceId=Ic(Lc),this.generateSpanId=Ic(Yf)}};nn.RandomIdGenerator=ts;var rn=Buffer.allocUnsafe(Lc);function Ic(r){return function(){for(let t=0;t<r/4;t++)rn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(rn[t]>0);t++)t===r-1&&(rn[r-1]=1);return rn.toString("hex",0,r)}}});var Cc=c(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.otperformance=void 0;var Qf=ee("perf_hooks");on.otperformance=Qf.performance});var rs=c(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.VERSION=void 0;sn.VERSION="1.19.0"});var Nc=c(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.MessageTypeValues=R.RpcGrpcStatusCodeValues=R.MessagingOperationValues=R.MessagingDestinationKindValues=R.HttpFlavorValues=R.NetHostConnectionSubtypeValues=R.NetHostConnectionTypeValues=R.NetTransportValues=R.FaasInvokedProviderValues=R.FaasDocumentOperationValues=R.FaasTriggerValues=R.DbCassandraConsistencyLevelValues=R.DbSystemValues=R.SemanticAttributes=void 0;R.SemanticAttributes={AWS_LAMBDA_INVOKED_ARN:"aws.lambda.invoked_arn",DB_SYSTEM:"db.system",DB_CONNECTION_STRING:"db.connection_string",DB_USER:"db.user",DB_JDBC_DRIVER_CLASSNAME:"db.jdbc.driver_classname",DB_NAME:"db.name",DB_STATEMENT:"db.statement",DB_OPERATION:"db.operation",DB_MSSQL_INSTANCE_NAME:"db.mssql.instance_name",DB_CASSANDRA_KEYSPACE:"db.cassandra.keyspace",DB_CASSANDRA_PAGE_SIZE:"db.cassandra.page_size",DB_CASSANDRA_CONSISTENCY_LEVEL:"db.cassandra.consistency_level",DB_CASSANDRA_TABLE:"db.cassandra.table",DB_CASSANDRA_IDEMPOTENCE:"db.cassandra.idempotence",DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:"db.cassandra.speculative_execution_count",DB_CASSANDRA_COORDINATOR_ID:"db.cassandra.coordinator.id",DB_CASSANDRA_COORDINATOR_DC:"db.cassandra.coordinator.dc",DB_HBASE_NAMESPACE:"db.hbase.namespace",DB_REDIS_DATABASE_INDEX:"db.redis.database_index",DB_MONGODB_COLLECTION:"db.mongodb.collection",DB_SQL_TABLE:"db.sql.table",EXCEPTION_TYPE:"exception.type",EXCEPTION_MESSAGE:"exception.message",EXCEPTION_STACKTRACE:"exception.stacktrace",EXCEPTION_ESCAPED:"exception.escaped",FAAS_TRIGGER:"faas.trigger",FAAS_EXECUTION:"faas.execution",FAAS_DOCUMENT_COLLECTION:"faas.document.collection",FAAS_DOCUMENT_OPERATION:"faas.document.operation",FAAS_DOCUMENT_TIME:"faas.document.time",FAAS_DOCUMENT_NAME:"faas.document.name",FAAS_TIME:"faas.time",FAAS_CRON:"faas.cron",FAAS_COLDSTART:"faas.coldstart",FAAS_INVOKED_NAME:"faas.invoked_name",FAAS_INVOKED_PROVIDER:"faas.invoked_provider",FAAS_INVOKED_REGION:"faas.invoked_region",NET_TRANSPORT:"net.transport",NET_PEER_IP:"net.peer.ip",NET_PEER_PORT:"net.peer.port",NET_PEER_NAME:"net.peer.name",NET_HOST_IP:"net.host.ip",NET_HOST_PORT:"net.host.port",NET_HOST_NAME:"net.host.name",NET_HOST_CONNECTION_TYPE:"net.host.connection.type",NET_HOST_CONNECTION_SUBTYPE:"net.host.connection.subtype",NET_HOST_CARRIER_NAME:"net.host.carrier.name",NET_HOST_CARRIER_MCC:"net.host.carrier.mcc",NET_HOST_CARRIER_MNC:"net.host.carrier.mnc",NET_HOST_CARRIER_ICC:"net.host.carrier.icc",PEER_SERVICE:"peer.service",ENDUSER_ID:"enduser.id",ENDUSER_ROLE:"enduser.role",ENDUSER_SCOPE:"enduser.scope",THREAD_ID:"thread.id",THREAD_NAME:"thread.name",CODE_FUNCTION:"code.function",CODE_NAMESPACE:"code.namespace",CODE_FILEPATH:"code.filepath",CODE_LINENO:"code.lineno",HTTP_METHOD:"http.method",HTTP_URL:"http.url",HTTP_TARGET:"http.target",HTTP_HOST:"http.host",HTTP_SCHEME:"http.scheme",HTTP_STATUS_CODE:"http.status_code",HTTP_FLAVOR:"http.flavor",HTTP_USER_AGENT:"http.user_agent",HTTP_REQUEST_CONTENT_LENGTH:"http.request_content_length",HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:"http.request_content_length_uncompressed",HTTP_RESPONSE_CONTENT_LENGTH:"http.response_content_length",HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:"http.response_content_length_uncompressed",HTTP_SERVER_NAME:"http.server_name",HTTP_ROUTE:"http.route",HTTP_CLIENT_IP:"http.client_ip",AWS_DYNAMODB_TABLE_NAMES:"aws.dynamodb.table_names",AWS_DYNAMODB_CONSUMED_CAPACITY:"aws.dynamodb.consumed_capacity",AWS_DYNAMODB_ITEM_COLLECTION_METRICS:"aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:"aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:"aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_CONSISTENT_READ:"aws.dynamodb.consistent_read",AWS_DYNAMODB_PROJECTION:"aws.dynamodb.projection",AWS_DYNAMODB_LIMIT:"aws.dynamodb.limit",AWS_DYNAMODB_ATTRIBUTES_TO_GET:"aws.dynamodb.attributes_to_get",AWS_DYNAMODB_INDEX_NAME:"aws.dynamodb.index_name",AWS_DYNAMODB_SELECT:"aws.dynamodb.select",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:"aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:"aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_EXCLUSIVE_START_TABLE:"aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_TABLE_COUNT:"aws.dynamodb.table_count",AWS_DYNAMODB_SCAN_FORWARD:"aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT:"aws.dynamodb.segment",AWS_DYNAMODB_TOTAL_SEGMENTS:"aws.dynamodb.total_segments",AWS_DYNAMODB_COUNT:"aws.dynamodb.count",AWS_DYNAMODB_SCANNED_COUNT:"aws.dynamodb.scanned_count",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:"aws.dynamodb.attribute_definitions",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:"aws.dynamodb.global_secondary_index_updates",MESSAGING_SYSTEM:"messaging.system",MESSAGING_DESTINATION:"messaging.destination",MESSAGING_DESTINATION_KIND:"messaging.destination_kind",MESSAGING_TEMP_DESTINATION:"messaging.temp_destination",MESSAGING_PROTOCOL:"messaging.protocol",MESSAGING_PROTOCOL_VERSION:"messaging.protocol_version",MESSAGING_URL:"messaging.url",MESSAGING_MESSAGE_ID:"messaging.message_id",MESSAGING_CONVERSATION_ID:"messaging.conversation_id",MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:"messaging.message_payload_size_bytes",MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:"messaging.message_payload_compressed_size_bytes",MESSAGING_OPERATION:"messaging.operation",MESSAGING_CONSUMER_ID:"messaging.consumer_id",MESSAGING_RABBITMQ_ROUTING_KEY:"messaging.rabbitmq.routing_key",MESSAGING_KAFKA_MESSAGE_KEY:"messaging.kafka.message_key",MESSAGING_KAFKA_CONSUMER_GROUP:"messaging.kafka.consumer_group",MESSAGING_KAFKA_CLIENT_ID:"messaging.kafka.client_id",MESSAGING_KAFKA_PARTITION:"messaging.kafka.partition",MESSAGING_KAFKA_TOMBSTONE:"messaging.kafka.tombstone",RPC_SYSTEM:"rpc.system",RPC_SERVICE:"rpc.service",RPC_METHOD:"rpc.method",RPC_GRPC_STATUS_CODE:"rpc.grpc.status_code",RPC_JSONRPC_VERSION:"rpc.jsonrpc.version",RPC_JSONRPC_REQUEST_ID:"rpc.jsonrpc.request_id",RPC_JSONRPC_ERROR_CODE:"rpc.jsonrpc.error_code",RPC_JSONRPC_ERROR_MESSAGE:"rpc.jsonrpc.error_message",MESSAGE_TYPE:"message.type",MESSAGE_ID:"message.id",MESSAGE_COMPRESSED_SIZE:"message.compressed_size",MESSAGE_UNCOMPRESSED_SIZE:"message.uncompressed_size"};R.DbSystemValues={OTHER_SQL:"other_sql",MSSQL:"mssql",MYSQL:"mysql",ORACLE:"oracle",DB2:"db2",POSTGRESQL:"postgresql",REDSHIFT:"redshift",HIVE:"hive",CLOUDSCAPE:"cloudscape",HSQLDB:"hsqldb",PROGRESS:"progress",MAXDB:"maxdb",HANADB:"hanadb",INGRES:"ingres",FIRSTSQL:"firstsql",EDB:"edb",CACHE:"cache",ADABAS:"adabas",FIREBIRD:"firebird",DERBY:"derby",FILEMAKER:"filemaker",INFORMIX:"informix",INSTANTDB:"instantdb",INTERBASE:"interbase",MARIADB:"mariadb",NETEZZA:"netezza",PERVASIVE:"pervasive",POINTBASE:"pointbase",SQLITE:"sqlite",SYBASE:"sybase",TERADATA:"teradata",VERTICA:"vertica",H2:"h2",COLDFUSION:"coldfusion",CASSANDRA:"cassandra",HBASE:"hbase",MONGODB:"mongodb",REDIS:"redis",COUCHBASE:"couchbase",COUCHDB:"couchdb",COSMOSDB:"cosmosdb",DYNAMODB:"dynamodb",NEO4J:"neo4j",GEODE:"geode",ELASTICSEARCH:"elasticsearch",MEMCACHED:"memcached",COCKROACHDB:"cockroachdb"};R.DbCassandraConsistencyLevelValues={ALL:"all",EACH_QUORUM:"each_quorum",QUORUM:"quorum",LOCAL_QUORUM:"local_quorum",ONE:"one",TWO:"two",THREE:"three",LOCAL_ONE:"local_one",ANY:"any",SERIAL:"serial",LOCAL_SERIAL:"local_serial"};R.FaasTriggerValues={DATASOURCE:"datasource",HTTP:"http",PUBSUB:"pubsub",TIMER:"timer",OTHER:"other"};R.FaasDocumentOperationValues={INSERT:"insert",EDIT:"edit",DELETE:"delete"};R.FaasInvokedProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};R.NetTransportValues={IP_TCP:"ip_tcp",IP_UDP:"ip_udp",IP:"ip",UNIX:"unix",PIPE:"pipe",INPROC:"inproc",OTHER:"other"};R.NetHostConnectionTypeValues={WIFI:"wifi",WIRED:"wired",CELL:"cell",UNAVAILABLE:"unavailable",UNKNOWN:"unknown"};R.NetHostConnectionSubtypeValues={GPRS:"gprs",EDGE:"edge",UMTS:"umts",CDMA:"cdma",EVDO_0:"evdo_0",EVDO_A:"evdo_a",CDMA2000_1XRTT:"cdma2000_1xrtt",HSDPA:"hsdpa",HSUPA:"hsupa",HSPA:"hspa",IDEN:"iden",EVDO_B:"evdo_b",LTE:"lte",EHRPD:"ehrpd",HSPAP:"hspap",GSM:"gsm",TD_SCDMA:"td_scdma",IWLAN:"iwlan",NR:"nr",NRNSA:"nrnsa",LTE_CA:"lte_ca"};R.HttpFlavorValues={HTTP_1_0:"1.0",HTTP_1_1:"1.1",HTTP_2_0:"2.0",SPDY:"SPDY",QUIC:"QUIC"};R.MessagingDestinationKindValues={QUEUE:"queue",TOPIC:"topic"};R.MessagingOperationValues={RECEIVE:"receive",PROCESS:"process"};R.RpcGrpcStatusCodeValues={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16};R.MessageTypeValues={SENT:"SENT",RECEIVED:"RECEIVED"}});var wc=c(Xe=>{"use strict";var Zf=Xe&&Xe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Jf=Xe&&Xe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Zf(e,r,t)};Object.defineProperty(Xe,"__esModule",{value:!0});Jf(Nc(),Xe)});var xc=c(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.TelemetrySdkLanguageValues=X.OsTypeValues=X.HostArchValues=X.AwsEcsLaunchtypeValues=X.CloudPlatformValues=X.CloudProviderValues=X.SemanticResourceAttributes=void 0;X.SemanticResourceAttributes={CLOUD_PROVIDER:"cloud.provider",CLOUD_ACCOUNT_ID:"cloud.account.id",CLOUD_REGION:"cloud.region",CLOUD_AVAILABILITY_ZONE:"cloud.availability_zone",CLOUD_PLATFORM:"cloud.platform",AWS_ECS_CONTAINER_ARN:"aws.ecs.container.arn",AWS_ECS_CLUSTER_ARN:"aws.ecs.cluster.arn",AWS_ECS_LAUNCHTYPE:"aws.ecs.launchtype",AWS_ECS_TASK_ARN:"aws.ecs.task.arn",AWS_ECS_TASK_FAMILY:"aws.ecs.task.family",AWS_ECS_TASK_REVISION:"aws.ecs.task.revision",AWS_EKS_CLUSTER_ARN:"aws.eks.cluster.arn",AWS_LOG_GROUP_NAMES:"aws.log.group.names",AWS_LOG_GROUP_ARNS:"aws.log.group.arns",AWS_LOG_STREAM_NAMES:"aws.log.stream.names",AWS_LOG_STREAM_ARNS:"aws.log.stream.arns",CONTAINER_NAME:"container.name",CONTAINER_ID:"container.id",CONTAINER_RUNTIME:"container.runtime",CONTAINER_IMAGE_NAME:"container.image.name",CONTAINER_IMAGE_TAG:"container.image.tag",DEPLOYMENT_ENVIRONMENT:"deployment.environment",DEVICE_ID:"device.id",DEVICE_MODEL_IDENTIFIER:"device.model.identifier",DEVICE_MODEL_NAME:"device.model.name",FAAS_NAME:"faas.name",FAAS_ID:"faas.id",FAAS_VERSION:"faas.version",FAAS_INSTANCE:"faas.instance",FAAS_MAX_MEMORY:"faas.max_memory",HOST_ID:"host.id",HOST_NAME:"host.name",HOST_TYPE:"host.type",HOST_ARCH:"host.arch",HOST_IMAGE_NAME:"host.image.name",HOST_IMAGE_ID:"host.image.id",HOST_IMAGE_VERSION:"host.image.version",K8S_CLUSTER_NAME:"k8s.cluster.name",K8S_NODE_NAME:"k8s.node.name",K8S_NODE_UID:"k8s.node.uid",K8S_NAMESPACE_NAME:"k8s.namespace.name",K8S_POD_UID:"k8s.pod.uid",K8S_POD_NAME:"k8s.pod.name",K8S_CONTAINER_NAME:"k8s.container.name",K8S_REPLICASET_UID:"k8s.replicaset.uid",K8S_REPLICASET_NAME:"k8s.replicaset.name",K8S_DEPLOYMENT_UID:"k8s.deployment.uid",K8S_DEPLOYMENT_NAME:"k8s.deployment.name",K8S_STATEFULSET_UID:"k8s.statefulset.uid",K8S_STATEFULSET_NAME:"k8s.statefulset.name",K8S_DAEMONSET_UID:"k8s.daemonset.uid",K8S_DAEMONSET_NAME:"k8s.daemonset.name",K8S_JOB_UID:"k8s.job.uid",K8S_JOB_NAME:"k8s.job.name",K8S_CRONJOB_UID:"k8s.cronjob.uid",K8S_CRONJOB_NAME:"k8s.cronjob.name",OS_TYPE:"os.type",OS_DESCRIPTION:"os.description",OS_NAME:"os.name",OS_VERSION:"os.version",PROCESS_PID:"process.pid",PROCESS_EXECUTABLE_NAME:"process.executable.name",PROCESS_EXECUTABLE_PATH:"process.executable.path",PROCESS_COMMAND:"process.command",PROCESS_COMMAND_LINE:"process.command_line",PROCESS_COMMAND_ARGS:"process.command_args",PROCESS_OWNER:"process.owner",PROCESS_RUNTIME_NAME:"process.runtime.name",PROCESS_RUNTIME_VERSION:"process.runtime.version",PROCESS_RUNTIME_DESCRIPTION:"process.runtime.description",SERVICE_NAME:"service.name",SERVICE_NAMESPACE:"service.namespace",SERVICE_INSTANCE_ID:"service.instance.id",SERVICE_VERSION:"service.version",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version",TELEMETRY_AUTO_VERSION:"telemetry.auto.version",WEBENGINE_NAME:"webengine.name",WEBENGINE_VERSION:"webengine.version",WEBENGINE_DESCRIPTION:"webengine.description"};X.CloudProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};X.CloudPlatformValues={ALIBABA_CLOUD_ECS:"alibaba_cloud_ecs",ALIBABA_CLOUD_FC:"alibaba_cloud_fc",AWS_EC2:"aws_ec2",AWS_ECS:"aws_ecs",AWS_EKS:"aws_eks",AWS_LAMBDA:"aws_lambda",AWS_ELASTIC_BEANSTALK:"aws_elastic_beanstalk",AZURE_VM:"azure_vm",AZURE_CONTAINER_INSTANCES:"azure_container_instances",AZURE_AKS:"azure_aks",AZURE_FUNCTIONS:"azure_functions",AZURE_APP_SERVICE:"azure_app_service",GCP_COMPUTE_ENGINE:"gcp_compute_engine",GCP_CLOUD_RUN:"gcp_cloud_run",GCP_KUBERNETES_ENGINE:"gcp_kubernetes_engine",GCP_CLOUD_FUNCTIONS:"gcp_cloud_functions",GCP_APP_ENGINE:"gcp_app_engine"};X.AwsEcsLaunchtypeValues={EC2:"ec2",FARGATE:"fargate"};X.HostArchValues={AMD64:"amd64",ARM32:"arm32",ARM64:"arm64",IA64:"ia64",PPC32:"ppc32",PPC64:"ppc64",X86:"x86"};X.OsTypeValues={WINDOWS:"windows",LINUX:"linux",DARWIN:"darwin",FREEBSD:"freebsd",NETBSD:"netbsd",OPENBSD:"openbsd",DRAGONFLYBSD:"dragonflybsd",HPUX:"hpux",AIX:"aix",SOLARIS:"solaris",Z_OS:"z_os"};X.TelemetrySdkLanguageValues={CPP:"cpp",DOTNET:"dotnet",ERLANG:"erlang",GO:"go",JAVA:"java",NODEJS:"nodejs",PHP:"php",PYTHON:"python",RUBY:"ruby",WEBJS:"webjs"}});var Dc=c(We=>{"use strict";var eE=We&&We.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tE=We&&We.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&eE(e,r,t)};Object.defineProperty(We,"__esModule",{value:!0});tE(xc(),We)});var oe=c(Ce=>{"use strict";var rE=Ce&&Ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Uc=Ce&&Ce.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rE(e,r,t)};Object.defineProperty(Ce,"__esModule",{value:!0});Uc(wc(),Ce);Uc(Dc(),Ce)});var Bc=c(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.SDK_INFO=void 0;var nE=rs(),fr=oe();an.SDK_INFO={[fr.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:"opentelemetry",[fr.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"node",[fr.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:fr.TelemetrySdkLanguageValues.NODEJS,[fr.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:nE.VERSION}});var qc=c(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.unrefTimer=void 0;function iE(r){r.unref()}un.unrefTimer=iE});var Gc=c(te=>{"use strict";var oE=te&&te.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ke=te&&te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&oE(e,r,t)};Object.defineProperty(te,"__esModule",{value:!0});Ke(bc(),te);Ke(Pc(),te);Ke(vc(),te);Ke(Mc(),te);Ke(Cc(),te);Ke(Bc(),te);Ke(qc(),te)});var ns=c(ze=>{"use strict";var sE=ze&&ze.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),aE=ze&&ze.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&sE(e,r,t)};Object.defineProperty(ze,"__esModule",{value:!0});aE(Gc(),ze)});var Hc=c(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.addHrTimes=y.isTimeInput=y.isTimeInputHrTime=y.hrTimeToMicroseconds=y.hrTimeToMilliseconds=y.hrTimeToNanoseconds=y.hrTimeToTimeStamp=y.hrTimeDuration=y.timeInputToHrTime=y.hrTime=y.getTimeOrigin=y.millisToHrTime=void 0;var is=ns(),Vc=9,uE=6,cE=Math.pow(10,uE),cn=Math.pow(10,Vc);function Er(r){let e=r/1e3,t=Math.trunc(e),n=Math.round(r%1e3*cE);return[t,n]}y.millisToHrTime=Er;function os(){let r=is.otperformance.timeOrigin;if(typeof r!="number"){let e=is.otperformance;r=e.timing&&e.timing.fetchStart}return r}y.getTimeOrigin=os;function jc(r){let e=Er(os()),t=Er(typeof r=="number"?r:is.otperformance.now());return Fc(e,t)}y.hrTime=jc;function lE(r){if(ss(r))return r;if(typeof r=="number")return r<os()?jc(r):Er(r);if(r instanceof Date)return Er(r.getTime());throw TypeError("Invalid input type")}y.timeInputToHrTime=lE;function dE(r,e){let t=e[0]-r[0],n=e[1]-r[1];return n<0&&(t-=1,n+=cn),[t,n]}y.hrTimeDuration=dE;function _E(r){let e=Vc,t=`${"0".repeat(e)}${r[1]}Z`,n=t.substr(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",n)}y.hrTimeToTimeStamp=_E;function pE(r){return r[0]*cn+r[1]}y.hrTimeToNanoseconds=pE;function hE(r){return r[0]*1e3+r[1]/1e6}y.hrTimeToMilliseconds=hE;function fE(r){return r[0]*1e6+r[1]/1e3}y.hrTimeToMicroseconds=fE;function ss(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}y.isTimeInputHrTime=ss;function EE(r){return ss(r)||typeof r=="number"||r instanceof Date}y.isTimeInput=EE;function Fc(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=cn&&(t[1]-=cn,t[0]+=1),t}y.addHrTimes=Fc});var $c=c(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0})});var Xc=c(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.ExportResultCode=void 0;var mE;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(mE=mr.ExportResultCode||(mr.ExportResultCode={}))});var Kc=c(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.CompositePropagator=void 0;var Wc=(p(),f(d)),as=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,i)=>n.concat(i),[])))}inject(e,t,n){for(let i of this._propagators)try{i.inject(e,t,n)}catch(o){Wc.diag.warn(`Failed to inject with ${i.constructor.name}. Err: ${o.message}`)}}extract(e,t,n){return this._propagators.reduce((i,o)=>{try{return o.extract(i,t,n)}catch(s){Wc.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}return i},e)}fields(){return this._fields.slice()}};ln.CompositePropagator=as});var zc=c(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.validateValue=gt.validateKey=void 0;var us="[_0-9a-z-*/]",gE=`[a-z]${us}{0,255}`,TE=`[a-z0-9]${us}{0,240}@[a-z]${us}{0,13}`,SE=new RegExp(`^(?:${gE}|${TE})$`),AE=/^[ -~]{0,255}[!-~]$/,OE=/,|=/;function RE(r){return SE.test(r)}gt.validateKey=RE;function bE(r){return AE.test(r)&&!OE.test(r)}gt.validateValue=bE});var ls=c(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.TraceState=void 0;var Yc=zc(),Qc=32,PE=512,Zc=",",Jc="=",cs=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+Jc+this.get(t)),e),[]).join(Zc)}_parse(e){e.length>PE||(this._internalState=e.split(Zc).reverse().reduce((t,n)=>{let i=n.trim(),o=i.indexOf(Jc);if(o!==-1){let s=i.slice(0,o),a=i.slice(o+1,n.length);(0,Yc.validateKey)(s)&&(0,Yc.validateValue)(a)&&t.set(s,a)}return t},new Map),this._internalState.size>Qc&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Qc))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}};dn.TraceState=cs});var tl=c(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.W3CTraceContextPropagator=W.parseTraceParent=W.TRACE_STATE_HEADER=W.TRACE_PARENT_HEADER=void 0;var _n=(p(),f(d)),yE=pr(),vE=ls();W.TRACE_PARENT_HEADER="traceparent";W.TRACE_STATE_HEADER="tracestate";var IE="00",LE="(?!ff)[\\da-f]{2}",ME="(?![0]{32})[\\da-f]{32}",CE="(?![0]{16})[\\da-f]{16}",NE="[\\da-f]{2}",wE=new RegExp(`^\\s?(${LE})-(${ME})-(${CE})-(${NE})(-.*)?\\s?$`);function el(r){let e=wE.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}W.parseTraceParent=el;var ds=class{inject(e,t,n){let i=_n.trace.getSpanContext(e);if(!i||(0,yE.isTracingSuppressed)(e)||!(0,_n.isSpanContextValid)(i))return;let o=`${IE}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||_n.TraceFlags.NONE).toString(16)}`;n.set(t,W.TRACE_PARENT_HEADER,o),i.traceState&&n.set(t,W.TRACE_STATE_HEADER,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,W.TRACE_PARENT_HEADER);if(!i)return e;let o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;let s=el(o);if(!s)return e;s.isRemote=!0;let a=n.get(t,W.TRACE_STATE_HEADER);if(a){let u=Array.isArray(a)?a.join(","):a;s.traceState=new vE.TraceState(typeof u=="string"?u:void 0)}return _n.trace.setSpanContext(e,s)}fields(){return[W.TRACE_PARENT_HEADER,W.TRACE_STATE_HEADER]}};W.W3CTraceContextPropagator=ds});var nl=c(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0})});var il=c(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.getRPCMetadata=ce.deleteRPCMetadata=ce.setRPCMetadata=ce.RPCType=void 0;var xE=(p(),f(d)),_s=(0,xE.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),DE;(function(r){r.HTTP="http"})(DE=ce.RPCType||(ce.RPCType={}));function UE(r,e){return r.setValue(_s,e)}ce.setRPCMetadata=UE;function BE(r){return r.deleteValue(_s)}ce.deleteRPCMetadata=BE;function qE(r){return r.getValue(_s)}ce.getRPCMetadata=qE});var hs=c(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.AlwaysOffSampler=void 0;var GE=(p(),f(d)),ps=class{shouldSample(){return{decision:GE.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};pn.AlwaysOffSampler=ps});var Es=c(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.AlwaysOnSampler=void 0;var VE=(p(),f(d)),fs=class{shouldSample(){return{decision:VE.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};hn.AlwaysOnSampler=fs});var sl=c(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.ParentBasedSampler=void 0;var fn=(p(),f(d)),jE=Zo(),ol=hs(),ms=Es(),gs=class{constructor(e){var t,n,i,o;this._root=e.root,this._root||((0,jE.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ms.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new ms.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new ol.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new ms.AlwaysOnSampler,this._localParentNotSampled=(o=e.localParentNotSampled)!==null&&o!==void 0?o:new ol.AlwaysOffSampler}shouldSample(e,t,n,i,o,s){let a=fn.trace.getSpanContext(e);return!a||!(0,fn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,o,s):a.isRemote?a.traceFlags&fn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,t,n,i,o,s):a.traceFlags&fn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,o,s):this._localParentNotSampled.shouldSample(e,t,n,i,o,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};En.ParentBasedSampler=gs});var al=c(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.TraceIdRatioBasedSampler=void 0;var Ts=(p(),f(d)),Ss=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,Ts.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?Ts.SamplingDecision.RECORD_AND_SAMPLED:Ts.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,o=parseInt(e.slice(i,i+8),16);t=(t^o)>>>0}return t}};mn.TraceIdRatioBasedSampler=Ss});var _l=c(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.isPlainObject=void 0;var FE="[object Object]",HE="[object Null]",kE="[object Undefined]",$E=Function.prototype,ul=$E.toString,XE=ul.call(Object),WE=KE(Object.getPrototypeOf,Object),cl=Object.prototype,ll=cl.hasOwnProperty,Ye=Symbol?Symbol.toStringTag:void 0,dl=cl.toString;function KE(r,e){return function(t){return r(e(t))}}function zE(r){if(!YE(r)||QE(r)!==FE)return!1;let e=WE(r);if(e===null)return!0;let t=ll.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ul.call(t)===XE}gn.isPlainObject=zE;function YE(r){return r!=null&&typeof r=="object"}function QE(r){return r==null?r===void 0?kE:HE:Ye&&Ye in Object(r)?ZE(r):JE(r)}function ZE(r){let e=ll.call(r,Ye),t=r[Ye],n=!1;try{r[Ye]=void 0,n=!0}catch{}let i=dl.call(r);return n&&(e?r[Ye]=t:delete r[Ye]),i}function JE(r){return dl.call(r)}});var ml=c(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.merge=void 0;var pl=_l(),em=20;function tm(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=fl(e,r.shift(),0,t);return e}An.merge=tm;function As(r){return Sn(r)?r.slice():r}function fl(r,e,t=0,n){let i;if(!(t>em)){if(t++,Tn(r)||Tn(e)||El(e))i=As(e);else if(Sn(r)){if(i=r.slice(),Sn(e))for(let o=0,s=e.length;o<s;o++)i.push(As(e[o]));else if(gr(e)){let o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){let u=o[s];i[u]=As(e[u])}}}else if(gr(r))if(gr(e)){if(!rm(r,e))return e;i=Object.assign({},r);let o=Object.keys(e);for(let s=0,a=o.length;s<a;s++){let u=o[s],l=e[u];if(Tn(l))typeof l>"u"?delete i[u]:i[u]=l;else{let _=i[u],E=l;if(hl(r,u,n)||hl(e,u,n))delete i[u];else{if(gr(_)&&gr(E)){let O=n.get(_)||[],D=n.get(E)||[];O.push({obj:r,key:u}),D.push({obj:e,key:u}),n.set(_,O),n.set(E,D)}i[u]=fl(i[u],l,t,n)}}}}else i=e;return i}}function hl(r,e,t){let n=t.get(r[e])||[];for(let i=0,o=n.length;i<o;i++){let s=n[i];if(s.key===e&&s.obj===r)return!0}return!1}function Sn(r){return Array.isArray(r)}function El(r){return typeof r=="function"}function gr(r){return!Tn(r)&&!Sn(r)&&!El(r)&&typeof r=="object"}function Tn(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function rm(r,e){return!(!(0,pl.isPlainObject)(r)||!(0,pl.isPlainObject)(e))}});var gl=c(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.callWithTimeout=Tt.TimeoutError=void 0;var On=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};Tt.TimeoutError=On;function nm(r,e){let t,n=new Promise(function(o,s){t=setTimeout(function(){s(new On("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}Tt.callWithTimeout=nm});var Sl=c(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.isUrlIgnored=St.urlMatches=void 0;function Tl(r,e){return typeof e=="string"?r===e:!!r.match(e)}St.urlMatches=Tl;function im(r,e){if(!e)return!1;for(let t of e)if(Tl(r,t))return!0;return!1}St.isUrlIgnored=im});var Al=c(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.isWrapped=void 0;function om(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}Rn.isWrapped=om});var Ol=c(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.Deferred=void 0;var Os=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};bn.Deferred=Os});var Rl=c(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.BindOnceFuture=void 0;var sm=Ol(),Rs=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new sm.Deferred}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};Pn.BindOnceFuture=Rs});var Pl=c(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn._export=void 0;var bl=(p(),f(d)),am=pr();function um(r,e){return new Promise(t=>{bl.context.with((0,am.suppressTracing)(bl.context.active()),()=>{r.export(e,n=>{t(n)})})})}yn._export=um});var S=c(T=>{"use strict";var cm=T&&T.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),b=T&&T.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cm(e,r,t)};Object.defineProperty(T,"__esModule",{value:!0});T.internal=T.baggageUtils=void 0;b(hc(),T);b(fc(),T);b(Sc(),T);b(Zo(),T);b(Qo(),T);b(Hc(),T);b($c(),T);b(Xc(),T);T.baggageUtils=Xo();b(ns(),T);b(Kc(),T);b(tl(),T);b(nl(),T);b(il(),T);b(hs(),T);b(Es(),T);b(sl(),T);b(al(),T);b(pr(),T);b(ls(),T);b(Zr(),T);b(ml(),T);b(Jo(),T);b(gl(),T);b(Sl(),T);b(Al(),T);b(Rl(),T);b(rs(),T);var lm=Pl();T.internal={_export:lm._export}});var yl=c(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ExceptionEventName=void 0;vn.ExceptionEventName="exception"});var Ps=c(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.Span=void 0;var fe=(p(),f(d)),K=S(),Qe=oe(),dm=yl(),bs=class{constructor(e,t,n,i,o,s,a=[],u,l,_){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:fe.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=s,this.kind=o,this.links=a;let E=Date.now();this._performanceStartTime=K.otperformance.now(),this._performanceOffset=E-(this._performanceStartTime+(0,K.getTimeOrigin)()),this._startTimeProvided=u!=null,this.startTime=this._getTime(u??E),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),_!=null&&this.setAttributes(_),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(fe.diag.warn(`Invalid attribute key: ${e}`),this):(0,K.isAttributeValue)(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(fe.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return fe.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(fe.diag.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,K.isTimeInput)(t)&&((0,K.isTimeInput)(n)||(n=t),t=void 0);let i=(0,K.sanitizeAttributes)(t);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}setStatus(e){return this._isSpanEnded()?this:(this.status=e,this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){fe.diag.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(e),this._duration=(0,K.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(fe.diag.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._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<K.otperformance.now())return(0,K.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,K.millisToHrTime)(e);if(e instanceof Date)return(0,K.millisToHrTime)(e.getTime());if((0,K.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,K.millisToHrTime)(Date.now());let t=K.otperformance.now()-this._performanceStartTime;return(0,K.addHrTimes)(this.startTime,(0,K.millisToHrTime)(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e=="string"?n[Qe.SemanticAttributes.EXCEPTION_MESSAGE]=e:e&&(e.code?n[Qe.SemanticAttributes.EXCEPTION_TYPE]=e.code.toString():e.name&&(n[Qe.SemanticAttributes.EXCEPTION_TYPE]=e.name),e.message&&(n[Qe.SemanticAttributes.EXCEPTION_MESSAGE]=e.message),e.stack&&(n[Qe.SemanticAttributes.EXCEPTION_STACKTRACE]=e.stack)),n[Qe.SemanticAttributes.EXCEPTION_TYPE]||n[Qe.SemanticAttributes.EXCEPTION_MESSAGE]?this.addEvent(dm.ExceptionEventName,n,t):fe.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&fe.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substr(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(fe.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}};In.Span=bs});var Sr=c(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.SamplingDecision=void 0;var _m;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(_m=Tr.SamplingDecision||(Tr.SamplingDecision={}))});var Mn=c(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.AlwaysOffSampler=void 0;var pm=Sr(),ys=class{shouldSample(){return{decision:pm.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};Ln.AlwaysOffSampler=ys});var Nn=c(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.AlwaysOnSampler=void 0;var hm=Sr(),vs=class{shouldSample(){return{decision:hm.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Cn.AlwaysOnSampler=vs});var Ms=c(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.ParentBasedSampler=void 0;var wn=(p(),f(d)),fm=S(),vl=Mn(),Is=Nn(),Ls=class{constructor(e){var t,n,i,o;this._root=e.root,this._root||((0,fm.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Is.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Is.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new vl.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new Is.AlwaysOnSampler,this._localParentNotSampled=(o=e.localParentNotSampled)!==null&&o!==void 0?o:new vl.AlwaysOffSampler}shouldSample(e,t,n,i,o,s){let a=wn.trace.getSpanContext(e);return!a||!(0,wn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,o,s):a.isRemote?a.traceFlags&wn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,t,n,i,o,s):a.traceFlags&wn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,o,s):this._localParentNotSampled.shouldSample(e,t,n,i,o,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};xn.ParentBasedSampler=Ls});var Ns=c(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.TraceIdRatioBasedSampler=void 0;var Em=(p(),f(d)),Il=Sr(),Cs=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,Em.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?Il.SamplingDecision.RECORD_AND_SAMPLED:Il.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,o=parseInt(e.slice(i,i+8),16);t=(t^o)>>>0}return t}};Dn.TraceIdRatioBasedSampler=Cs});var Ds=c(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.buildSamplerFromEnv=Ot.loadDefaultConfig=void 0;var Un=(p(),f(d)),H=S(),Ll=Mn(),ws=Nn(),xs=Ms(),Ml=Ns(),mm=(0,H.getEnv)(),gm=H.TracesSamplerValues.AlwaysOn,At=1;function Tm(){return{sampler:Nl(mm),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:(0,H.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:(0,H.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}Ot.loadDefaultConfig=Tm;function Nl(r=(0,H.getEnv)()){switch(r.OTEL_TRACES_SAMPLER){case H.TracesSamplerValues.AlwaysOn:return new ws.AlwaysOnSampler;case H.TracesSamplerValues.AlwaysOff:return new Ll.AlwaysOffSampler;case H.TracesSamplerValues.ParentBasedAlwaysOn:return new xs.ParentBasedSampler({root:new ws.AlwaysOnSampler});case H.TracesSamplerValues.ParentBasedAlwaysOff:return new xs.ParentBasedSampler({root:new Ll.AlwaysOffSampler});case H.TracesSamplerValues.TraceIdRatio:return new Ml.TraceIdRatioBasedSampler(Cl(r));case H.TracesSamplerValues.ParentBasedTraceIdRatio:return new xs.ParentBasedSampler({root:new Ml.TraceIdRatioBasedSampler(Cl(r))});default:return Un.diag.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${gm}".`),new ws.AlwaysOnSampler}}Ot.buildSamplerFromEnv=Nl;function Cl(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return Un.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${At}.`),At;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Un.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${At}.`),At):e<0||e>1?(Un.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${At}.`),At):e}});var Bs=c(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.reconfigureLimits=Rt.mergeConfig=void 0;var wl=Ds(),Us=S();function Sm(r){let e={sampler:(0,wl.buildSamplerFromEnv)()},t=(0,wl.loadDefaultConfig)(),n=Object.assign({},t,e,r);return n.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),n.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),n}Rt.mergeConfig=Sm;function Am(r){var e,t,n,i,o,s,a,u,l,_,E,O;let D=Object.assign({},r.spanLimits),Y=(0,Us.getEnvWithoutDefaults)();return D.attributeCountLimit=(s=(o=(i=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(n=r.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:Y.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Y.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:Us.DEFAULT_ATTRIBUTE_COUNT_LIMIT,D.attributeValueLengthLimit=(O=(E=(_=(u=(a=r.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&u!==void 0?u:(l=r.generalLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&_!==void 0?_:Y.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&E!==void 0?E:Y.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&O!==void 0?O:Us.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},r,{spanLimits:D})}Rt.reconfigureLimits=Am});var xl=c(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.BatchSpanProcessorBase=void 0;var bt=(p(),f(d)),Ze=S(),qs=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let n=(0,Ze.getEnv)();this._maxExportBatchSize=typeof t?.maxExportBatchSize=="number"?t.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof t?.maxQueueSize=="number"?t.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis=="number"?t.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis=="number"?t.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Ze.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(bt.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&bt.TraceFlags.SAMPLED&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&bt.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(bt.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let o=0,s=i;o<s;o++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);bt.context.with((0,Ze.suppressTracing)(bt.context.active()),()=>{let i=this._finishedSpans.splice(0,this._maxExportBatchSize),o=()=>this._exporter.export(i,a=>{var u;clearTimeout(n),a.code===Ze.ExportResultCode.SUCCESS?e():t((u=a.error)!==null&&u!==void 0?u:new Error("BatchSpanProcessor: span export failed"))}),s=i.map(a=>a.resource).filter(a=>a.asyncAttributesPending);s.length===0?o():Promise.all(s.map(a=>{var u;return(u=a.waitForAsyncAttributes)===null||u===void 0?void 0:u.call(a)})).then(o,a=>{(0,Ze.globalErrorHandler)(a),t(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,(0,Ze.globalErrorHandler)(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,Ze.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};Bn.BatchSpanProcessorBase=qs});var Dl=c(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.BatchSpanProcessor=void 0;var Om=xl(),Gs=class extends Om.BatchSpanProcessorBase{onShutdown(){}};qn.BatchSpanProcessor=Gs});var ql=c(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.RandomIdGenerator=void 0;var Rm=8,Bl=16,Vs=class{constructor(){this.generateTraceId=Ul(Bl),this.generateSpanId=Ul(Rm)}};Vn.RandomIdGenerator=Vs;var Gn=Buffer.allocUnsafe(Bl);function Ul(r){return function(){for(let t=0;t<r/4;t++)Gn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(Gn[t]>0);t++)t===r-1&&(Gn[r-1]=1);return Gn.toString("hex",0,r)}}});var Vl=c(Ne=>{"use strict";var bm=Ne&&Ne.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Gl=Ne&&Ne.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bm(e,r,t)};Object.defineProperty(Ne,"__esModule",{value:!0});Gl(Dl(),Ne);Gl(ql(),Ne)});var jn=c(Je=>{"use strict";var Pm=Je&&Je.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ym=Je&&Je.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Pm(e,r,t)};Object.defineProperty(Je,"__esModule",{value:!0});ym(Vl(),Je)});var jl=c(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.Tracer=void 0;var k=(p(),f(d)),Fn=S(),vm=Ps(),Im=Bs(),Lm=jn(),js=class{constructor(e,t,n){this._tracerProvider=n;let i=(0,Im.mergeConfig)(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Lm.RandomIdGenerator,this.resource=n.resource,this.instrumentationLibrary=e}startSpan(e,t={},n=k.context.active()){var i,o,s;t.root&&(n=k.trace.deleteSpan(n));let a=k.trace.getSpan(n);if((0,Fn.isTracingSuppressed)(n))return k.diag.debug("Instrumentation suppressed, returning Noop Span"),k.trace.wrapSpanContext(k.INVALID_SPAN_CONTEXT);let u=a?.spanContext(),l=this._idGenerator.generateSpanId(),_,E,O;!u||!k.trace.isSpanContextValid(u)?_=this._idGenerator.generateTraceId():(_=u.traceId,E=u.traceState,O=u.spanId);let D=(i=t.kind)!==null&&i!==void 0?i:k.SpanKind.INTERNAL,Y=((o=t.links)!==null&&o!==void 0?o:[]).map(ht=>({context:ht.context,attributes:(0,Fn.sanitizeAttributes)(ht.attributes)})),L=(0,Fn.sanitizeAttributes)(t.attributes),B=this._sampler.shouldSample(n,_,e,D,L,Y);E=(s=B.traceState)!==null&&s!==void 0?s:E;let P=B.decision===k.SamplingDecision.RECORD_AND_SAMPLED?k.TraceFlags.SAMPLED:k.TraceFlags.NONE,m={traceId:_,spanId:l,traceFlags:P,traceState:E};if(B.decision===k.SamplingDecision.NOT_RECORD)return k.diag.debug("Recording is off, propagating context in a non-recording span"),k.trace.wrapSpanContext(m);let ye=(0,Fn.sanitizeAttributes)(Object.assign(L,B.attributes));return new vm.Span(this,n,e,m,D,O,Y,t.startTime,void 0,ye)}startActiveSpan(e,t,n,i){let o,s,a;if(arguments.length<2)return;arguments.length===2?a=t:arguments.length===3?(o=t,a=n):(o=t,s=n,a=i);let u=s??k.context.active(),l=this.startSpan(e,o,u),_=k.trace.setSpan(u,l);return k.context.with(_,a,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};Hn.Tracer=js});var Fl=c(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.defaultServiceName=void 0;function Mm(){return`unknown_service:${process.argv0}`}kn.defaultServiceName=Mm});var Fs=c(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.normalizeType=Pt.normalizeArch=void 0;var Cm=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}};Pt.normalizeArch=Cm;var Nm=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}};Pt.normalizeType=Nm});var Xn=c($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.execAsync=void 0;var wm=ee("child_process"),xm=ee("util");$n.execAsync=xm.promisify(wm.exec)});var Hl=c(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.getMachineId=void 0;var Dm=Xn(),Um=(p(),f(d));async function Bm(){try{let e=(await(0,Dm.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
8
+ `).find(n=>n.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){Um.diag.debug(`error reading machine id: ${r}`)}return""}Wn.getMachineId=Bm});var kl=c(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getMachineId=void 0;var qm=ee("fs"),Gm=(p(),f(d));async function Vm(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await qm.promises.readFile(e,{encoding:"utf8"})).trim()}catch(t){Gm.diag.debug(`error reading machine id: ${t}`)}return""}Kn.getMachineId=Vm});var Xl=c(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.getMachineId=void 0;var jm=ee("fs"),Fm=Xn(),$l=(p(),f(d));async function Hm(){try{return(await jm.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){$l.diag.debug(`error reading machine id: ${r}`)}try{return(await(0,Fm.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){$l.diag.debug(`error reading machine id: ${r}`)}return""}zn.getMachineId=Hm});var Kl=c(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getMachineId=void 0;var Wl=ee("process"),km=Xn(),$m=(p(),f(d));async function Xm(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Wl.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Wl.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let n=(await(0,km.execAsync)(`${e} ${r}`)).stdout.split("REG_SZ");if(n.length===2)return n[1].trim()}catch(t){$m.diag.debug(`error reading machine id: ${t}`)}return""}Yn.getMachineId=Xm});var zl=c(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.getMachineId=void 0;var Wm=(p(),f(d));async function Km(){return Wm.diag.debug("could not read machine-id: unsupported platform"),""}Qn.getMachineId=Km});var Yl=c(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getMachineId=void 0;var zm=ee("process"),yt;Ae.getMachineId=yt;switch(zm.platform){case"darwin":Ae.getMachineId=yt=Hl().getMachineId;break;case"linux":Ae.getMachineId=yt=kl().getMachineId;break;case"freebsd":Ae.getMachineId=yt=Xl().getMachineId;break;case"win32":Ae.getMachineId=yt=Kl().getMachineId;break;default:Ae.getMachineId=yt=zl().getMachineId}});var $s=c(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.hostDetectorSync=void 0;var Hs=oe(),Ym=et(),Ql=ee("os"),Qm=Fs(),Zm=Yl(),ks=class{detect(e){let t={[Hs.SemanticResourceAttributes.HOST_NAME]:(0,Ql.hostname)(),[Hs.SemanticResourceAttributes.HOST_ARCH]:(0,Qm.normalizeArch)((0,Ql.arch)())};return new Ym.Resource(t,this._getAsyncAttributes())}_getAsyncAttributes(){return(0,Zm.getMachineId)().then(e=>{let t={};return e&&(t[Hs.SemanticResourceAttributes.HOST_ID]=e),t})}};Zn.hostDetectorSync=new ks});var Zl=c(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.hostDetector=void 0;var Jm=$s(),Xs=class{detect(e){return Promise.resolve(Jm.hostDetectorSync.detect(e))}};Jn.hostDetector=new Xs});var Ks=c(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.osDetectorSync=void 0;var Jl=oe(),eg=et(),ed=ee("os"),tg=Fs(),Ws=class{detect(e){let t={[Jl.SemanticResourceAttributes.OS_TYPE]:(0,tg.normalizeType)((0,ed.platform)()),[Jl.SemanticResourceAttributes.OS_VERSION]:(0,ed.release)()};return new eg.Resource(t)}};ei.osDetectorSync=new Ws});var td=c(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.osDetector=void 0;var rg=Ks(),zs=class{detect(e){return Promise.resolve(rg.osDetectorSync.detect(e))}};ti.osDetector=new zs});var Qs=c(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.processDetectorSync=void 0;var ng=(p(),f(d)),Oe=oe(),ig=et(),og=ee("os"),Ys=class{detect(e){let t={[Oe.SemanticResourceAttributes.PROCESS_PID]:process.pid,[Oe.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]:process.title,[Oe.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH]:process.execPath,[Oe.SemanticResourceAttributes.PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Oe.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:process.versions.node,[Oe.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"nodejs",[Oe.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(t[Oe.SemanticResourceAttributes.PROCESS_COMMAND]=process.argv[1]);try{let n=og.userInfo();t[Oe.SemanticResourceAttributes.PROCESS_OWNER]=n.username}catch(n){ng.diag.debug(`error obtaining process owner: ${n}`)}return new ig.Resource(t)}};ri.processDetectorSync=new Ys});var rd=c(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.processDetector=void 0;var sg=Qs(),Zs=class{detect(e){return Promise.resolve(sg.processDetectorSync.detect(e))}};ni.processDetector=new Zs});var nd=c(re=>{"use strict";var ag=re&&re.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tt=re&&re.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ag(e,r,t)};Object.defineProperty(re,"__esModule",{value:!0});tt(Fl(),re);tt(Zl(),re);tt(td(),re);tt($s(),re);tt(Ks(),re);tt(rd(),re);tt(Qs(),re)});var Js=c(rt=>{"use strict";var ug=rt&&rt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),cg=rt&&rt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ug(e,r,t)};Object.defineProperty(rt,"__esModule",{value:!0});cg(nd(),rt)});var et=c(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.Resource=void 0;var id=(p(),f(d)),nt=oe(),ea=S(),lg=Js(),Ar=class r{constructor(e,t){var n;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(n=this._attributes)!==null&&n!==void 0?n:{},this._asyncAttributesPromise=t?.then(i=>(this._attributes=Object.assign({},this._attributes,i),this.asyncAttributesPending=!1,i),i=>(id.diag.debug("a resource's async attributes promise rejected: %s",i),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[nt.SemanticResourceAttributes.SERVICE_NAME]:(0,lg.defaultServiceName)(),[nt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:ea.SDK_INFO[nt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],[nt.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:ea.SDK_INFO[nt.SemanticResourceAttributes.TELEMETRY_SDK_NAME],[nt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:ea.SDK_INFO[nt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]})}get attributes(){var e;return this.asyncAttributesPending&&id.diag.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let n=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(n);let i=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([o,s])=>{var a;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),o),(a=e._syncAttributes)!==null&&a!==void 0?a:e.attributes),s)});return new r(n,i)}};ii.Resource=Ar;Ar.EMPTY=new Ar({})});var sd=c(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0})});var ud=c(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0})});var ld=c(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0})});var dd=c(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.browserDetector=void 0;var dg=it(),ta=class{detect(e){return Promise.resolve(dg.browserDetectorSync.detect(e))}};oi.browserDetector=new ta});var na=c(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.envDetectorSync=void 0;var _g=(p(),f(d)),pg=S(),hg=oe(),fg=et(),ra=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},n=(0,pg.getEnv)(),i=n.OTEL_RESOURCE_ATTRIBUTES,o=n.OTEL_SERVICE_NAME;if(i)try{let s=this._parseResourceAttributes(i);Object.assign(t,s)}catch(s){_g.diag.debug(`EnvDetector failed: ${s.message}`)}return o&&(t[hg.SemanticResourceAttributes.SERVICE_NAME]=o),new fg.Resource(t)}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR,-1);for(let i of n){let o=i.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(o.length!==2)continue;let[s,a]=o;if(s=s.trim(),a=a.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(s))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(a))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[s]=decodeURIComponent(a)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<33||n===44||n===59||n===92||n>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};si.envDetectorSync=new ra});var _d=c(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.envDetector=void 0;var Eg=na(),ia=class{detect(e){return Promise.resolve(Eg.envDetectorSync.detect(e))}};ai.envDetector=new ia});var pd=c(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.browserDetectorSync=void 0;var ui=oe(),oa=it(),mg=(p(),f(d)),sa=class{detect(e){if(!(typeof navigator<"u"))return oa.Resource.empty();let n={[ui.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"browser",[ui.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[ui.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(n,e)}_getResourceAttributes(e,t){return e[ui.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]===""?(mg.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),oa.Resource.empty()):new oa.Resource(Object.assign({},e))}};ci.browserDetectorSync=new sa});var hd=c(Ee=>{"use strict";var gg=Ee&&Ee.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),li=Ee&&Ee.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&gg(e,r,t)};Object.defineProperty(Ee,"__esModule",{value:!0});li(dd(),Ee);li(_d(),Ee);li(pd(),Ee);li(na(),Ee)});var fd=c(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.isPromiseLike=void 0;var Tg=r=>r!==null&&typeof r=="object"&&typeof r.then=="function";di.isPromiseLike=Tg});var md=c(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.detectResourcesSync=It.detectResources=void 0;var Or=et(),vt=(p(),f(d)),Sg=fd(),Ag=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let n=await t.detect(r);return vt.diag.debug(`${t.constructor.name} found resource.`,n),n}catch(n){return vt.diag.debug(`${t.constructor.name} failed: ${n.message}`),Or.Resource.empty()}}));return Ed(e),e.reduce((t,n)=>t.merge(n),Or.Resource.empty())};It.detectResources=Ag;var Og=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(i=>{try{let o=i.detect(r),s;if((0,Sg.isPromiseLike)(o)){let a=async()=>(await o).attributes;s=new Or.Resource({},a())}else s=o;return s.waitForAsyncAttributes?s.waitForAsyncAttributes().then(()=>vt.diag.debug(`${i.constructor.name} found resource.`,s)):vt.diag.debug(`${i.constructor.name} found resource.`,s),s}catch(o){return vt.diag.error(`${i.constructor.name} failed: ${o.message}`),Or.Resource.empty()}}),n=t.reduce((i,o)=>i.merge(o),Or.Resource.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(()=>{Ed(t)}),n};It.detectResourcesSync=Og;var Ed=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);vt.diag.verbose(t)}})}});var it=c(ne=>{"use strict";var Rg=ne&&ne.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ot=ne&&ne.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Rg(e,r,t)};Object.defineProperty(ne,"__esModule",{value:!0});ot(et(),ne);ot(sd(),ne);ot(Js(),ne);ot(ud(),ne);ot(ld(),ne);ot(hd(),ne);ot(md(),ne)});var gd=c(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.MultiSpanProcessor=void 0;var bg=S(),aa=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(n=>{(0,bg.globalErrorHandler)(n||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}};_i.MultiSpanProcessor=aa});var ca=c(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.NoopSpanProcessor=void 0;var ua=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};pi.NoopSpanProcessor=ua});var Sd=c(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.BasicTracerProvider=st.ForceFlushState=void 0;var Lt=(p(),f(d)),Ct=S(),Td=it(),Pg=la(),yg=Ds(),vg=gd(),Ig=ca(),Lg=jn(),Mg=Bs(),Mt;(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(Mt=st.ForceFlushState||(st.ForceFlushState={}));var Rr=class{constructor(e={}){var t;this._registeredSpanProcessors=[],this._tracers=new Map;let n=(0,Ct.merge)({},(0,yg.loadDefaultConfig)(),(0,Mg.reconfigureLimits)(e));this.resource=(t=n.resource)!==null&&t!==void 0?t:Td.Resource.empty(),this.resource=Td.Resource.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});let i=this._buildExporterFromEnv();if(i!==void 0){let o=new Lg.BatchSpanProcessor(i);this.activeSpanProcessor=o}else this.activeSpanProcessor=new Ig.NoopSpanProcessor}getTracer(e,t,n){let i=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new Pg.Tracer({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this)),this._tracers.get(i)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>Lt.diag.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new vg.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){Lt.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&Lt.context.setGlobalContextManager(e.contextManager),e.propagator&&Lt.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(n=>new Promise(i=>{let o,s=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),o=Mt.timeout},e);n.forceFlush().then(()=>{clearTimeout(s),o!==Mt.timeout&&(o=Mt.resolved,i(o))}).catch(a=>{clearTimeout(s),o=Mt.error,i(a)})}));return new Promise((n,i)=>{Promise.all(t).then(o=>{let s=o.filter(a=>a!==Mt.resolved);s.length>0?i(s):n()}).catch(o=>i([o]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,Ct.getEnv)().OTEL_PROPAGATORS)),n=e.map(i=>{let o=this._getPropagator(i);return o||Lt.diag.warn(`Propagator "${i}" requested through environment variable is unavailable.`),o}).reduce((i,o)=>(o&&i.push(o),i),[]);if(n.length!==0)return e.length===1?n[0]:new Ct.CompositePropagator({propagators:n})}_buildExporterFromEnv(){let e=(0,Ct.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||Lt.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};st.BasicTracerProvider=Rr;Rr._registeredPropagators=new Map([["tracecontext",()=>new Ct.W3CTraceContextPropagator],["baggage",()=>new Ct.W3CBaggagePropagator]]);Rr._registeredExporters=new Map});var Ad=c(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.ConsoleSpanExporter=void 0;var da=S(),_a=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,da.hrTimeToMicroseconds)(e.startTime),duration:(0,da.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(t)return t({code:da.ExportResultCode.SUCCESS})}};hi.ConsoleSpanExporter=_a});var Rd=c(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.InMemorySpanExporter=void 0;var Od=S(),pa=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Od.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:Od.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};fi.InMemorySpanExporter=pa});var Pd=c(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0})});var yd=c(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.SimpleSpanProcessor=void 0;var Cg=(p(),f(d)),Nt=S(),ha=class{constructor(e){this._exporter=e,this._shutdownOnce=new Nt.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,n;if(this._shutdownOnce.isCalled||!(e.spanContext().traceFlags&Cg.TraceFlags.SAMPLED))return;let i=()=>Nt.internal._export(this._exporter,[e]).then(o=>{var s;o.code!==Nt.ExportResultCode.SUCCESS&&(0,Nt.globalErrorHandler)((s=o.error)!==null&&s!==void 0?s:new Error(`SimpleSpanProcessor: span export failed (status ${o})`))}).catch(o=>{(0,Nt.globalErrorHandler)(o)});if(e.resource.asyncAttributesPending){let o=(n=(t=e.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(t).then(()=>(o!=null&&this._unresolvedExports.delete(o),i()),s=>(0,Nt.globalErrorHandler)(s));o!=null&&this._unresolvedExports.add(o)}else i()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};Ei.SimpleSpanProcessor=ha});var Id=c(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0})});var Md=c(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0})});var Nd=c(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0})});var xd=c(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0})});var Ud=c(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0})});var la=c(I=>{"use strict";var Ng=I&&I.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),U=I&&I.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ng(e,r,t)};Object.defineProperty(I,"__esModule",{value:!0});U(jl(),I);U(Sd(),I);U(jn(),I);U(Ad(),I);U(Rd(),I);U(Pd(),I);U(yd(),I);U(Id(),I);U(ca(),I);U(Mn(),I);U(Nn(),I);U(Ms(),I);U(Ns(),I);U(Sr(),I);U(Ps(),I);U(Md(),I);U(Nd(),I);U(xd(),I);U(Ud(),I)});var at={};import*as Ub from"@opentelemetry/api-logs";var fa=_c(()=>{Et(at,Ub)});var qd=c(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.disableInstrumentations=we.enableInstrumentations=we.parseInstrumentationOptions=void 0;function Bd(r=[]){let e=[];for(let t=0,n=r.length;t<n;t++){let i=r[t];if(Array.isArray(i)){let o=Bd(i);e=e.concat(o.instrumentations)}else typeof i=="function"?e.push(new i):i.instrumentationName&&e.push(i)}return{instrumentations:e}}we.parseInstrumentationOptions=Bd;function wg(r,e,t){for(let n=0,i=r.length;n<i;n++){let o=r[n];e&&o.setTracerProvider(e),t&&o.setMeterProvider(t),o.getConfig().enabled||o.enable()}}we.enableInstrumentations=wg;function xg(r){r.forEach(e=>e.disable())}we.disableInstrumentations=xg});var Vd=c(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.registerInstrumentations=void 0;var Gd=(p(),f(d)),Ea=qd();function Dg(r){let{instrumentations:e}=(0,Ea.parseInstrumentationOptions)(r.instrumentations),t=r.tracerProvider||Gd.trace.getTracerProvider(),n=r.meterProvider||Gd.metrics.getMeterProvider();return(0,Ea.enableInstrumentations)(e,t,n),()=>{(0,Ea.disableInstrumentations)(e)}}mi.registerInstrumentations=Dg});var ga=c(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.LogRecord=void 0;var Ug=(p(),f(d)),br=(p(),f(d)),gi=S(),ma=class{constructor(e,t,n){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:i,observedTimestamp:o,severityNumber:s,severityText:a,body:u,attributes:l={},context:_}=n,E=Date.now();if(this.hrTime=(0,gi.timeInputToHrTime)(i??E),this.hrTimeObserved=(0,gi.timeInputToHrTime)(o??E),_){let O=br.trace.getSpanContext(_);O&&br.isSpanContextValid(O)&&(this.spanContext=O)}this.severityNumber=s,this.severityText=a,this.body=u,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(l)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(br.diag.warn(`Invalid attribute key: ${e}`),this):!(0,gi.isAttributeValue)(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(br.diag.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?this:((0,gi.isAttributeValue)(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(br.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&Ug.diag.warn("Can not execute the operation on emitted log record"),this._isReadonly}};Ti.LogRecord=ma});var jd=c(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.Logger=void 0;var Bg=(p(),f(d)),qg=ga(),Ta=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||Bg.context.active(),n=new qg.LogRecord(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}};Si.Logger=Ta});var Fd=c(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.reconfigureLimits=wt.loadDefaultConfig=void 0;var Pr=S();function Gg(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,Pr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,Pr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0}}wt.loadDefaultConfig=Gg;function Vg(r){var e,t,n,i,o,s;let a=(0,Pr.getEnvWithoutDefaults)();return{attributeCountLimit:(n=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:a.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:a.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&n!==void 0?n:Pr.DEFAULT_ATTRIBUTE_COUNT_LIMIT,attributeValueLengthLimit:(s=(o=(i=r.attributeValueLengthLimit)!==null&&i!==void 0?i:a.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&o!==void 0?o:a.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&s!==void 0?s:Pr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}}wt.reconfigureLimits=Vg});var Hd=c(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.MultiLogRecordProcessor=void 0;var jg=S(),Sa=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>(0,jg.callWithTimeout)(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}};Ai.MultiLogRecordProcessor=Sa});var Oa=c(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.NoopLogRecordProcessor=void 0;var Aa=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}};Oi.NoopLogRecordProcessor=Aa});var kd=c(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.LoggerProviderSharedState=void 0;var Fg=Oa(),Ra=class{constructor(e,t,n){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Fg.NoopLogRecordProcessor}};Ri.LoggerProviderSharedState=Ra});var Wd=c(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.LoggerProvider=ut.DEFAULT_LOGGER_NAME=void 0;var yr=(p(),f(d)),Hg=(fa(),f(at)),kg=it(),$d=S(),$g=jd(),Xd=Fd(),Xg=Hd(),Wg=kd();ut.DEFAULT_LOGGER_NAME="unknown";var ba=class{constructor(e={}){let{resource:t=kg.Resource.default(),logRecordLimits:n,forceFlushTimeoutMillis:i}=(0,$d.merge)({},(0,Xd.loadDefaultConfig)(),e);this._sharedState=new Wg.LoggerProviderSharedState(t,i,(0,Xd.reconfigureLimits)(n)),this._shutdownOnce=new $d.BindOnceFuture(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return yr.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),Hg.NOOP_LOGGER;e||yr.diag.warn("Logger requested without instrumentation scope name.");let i=e||ut.DEFAULT_LOGGER_NAME,o=`${i}@${t||""}:${n?.schemaUrl||""}`;return this._sharedState.loggers.has(o)||this._sharedState.loggers.set(o,new $g.Logger({name:i,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(o)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>yr.diag.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new Xg.MultiLogRecordProcessor(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(yr.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(yr.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};ut.LoggerProvider=ba});var Kd=c(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.ConsoleLogRecordExporter=void 0;var Kg=S(),zg=S(),Pa=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,n,i;return{timestamp:(0,Kg.hrTimeToMicroseconds)(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(n=e.spanContext)===null||n===void 0?void 0:n.spanId,traceFlags:(i=e.spanContext)===null||i===void 0?void 0:i.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});t?.({code:zg.ExportResultCode.SUCCESS})}};bi.ConsoleLogRecordExporter=Pa});var zd=c(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.SimpleLogRecordProcessor=void 0;var ya=S(),va=class{constructor(e){this._exporter=e,this._shutdownOnce=new ya.BindOnceFuture(this._shutdown,this)}onEmit(e){this._shutdownOnce.isCalled||this._exporter.export([e],t=>{var n;if(t.code!==ya.ExportResultCode.SUCCESS){(0,ya.globalErrorHandler)((n=t.error)!==null&&n!==void 0?n:new Error(`SimpleLogRecordProcessor: log record export failed (status ${t})`));return}})}forceFlush(){return Promise.resolve()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};Pi.SimpleLogRecordProcessor=va});var Qd=c(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.InMemoryLogRecordExporter=void 0;var Yd=S(),Ia=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yd.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Yd.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}};yi.InMemoryLogRecordExporter=Ia});var Zd=c(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.BatchLogRecordProcessorBase=void 0;var Yg=(p(),f(d)),xt=S(),La=class{constructor(e,t){var n,i,o,s;this._exporter=e,this._finishedLogRecords=[];let a=(0,xt.getEnv)();this._maxExportBatchSize=(n=t?.maxExportBatchSize)!==null&&n!==void 0?n:a.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(i=t?.maxQueueSize)!==null&&i!==void 0?i:a.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(o=t?.scheduledDelayMillis)!==null&&o!==void 0?o:a.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(s=t?.exportTimeoutMillis)!==null&&s!==void 0?s:a.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new xt.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Yg.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let o=0;o<i;o++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{(0,xt.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{(0,xt.globalErrorHandler)(e)})},this._scheduledDelayMillis),(0,xt.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){return new Promise((t,n)=>{this._exporter.export(e,i=>{var o;if(i.code!==xt.ExportResultCode.SUCCESS){n((o=i.error)!==null&&o!==void 0?o:new Error(`BatchLogRecordProcessorBase: log record export failed (status ${i})`));return}t(i)})})}};vi.BatchLogRecordProcessorBase=La});var Jd=c(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.BatchLogRecordProcessor=void 0;var Qg=Zd(),Ma=class extends Qg.BatchLogRecordProcessorBase{onShutdown(){}};Ii.BatchLogRecordProcessor=Ma});var e_=c(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.BatchLogRecordProcessor=void 0;var Zg=Jd();Object.defineProperty(Li,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return Zg.BatchLogRecordProcessor}})});var t_=c(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.BatchLogRecordProcessor=void 0;var Jg=e_();Object.defineProperty(Mi,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return Jg.BatchLogRecordProcessor}})});var r_=c(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.BatchLogRecordProcessor=z.InMemoryLogRecordExporter=z.SimpleLogRecordProcessor=z.ConsoleLogRecordExporter=z.NoopLogRecordProcessor=z.LogRecord=z.LoggerProvider=void 0;var eT=Wd();Object.defineProperty(z,"LoggerProvider",{enumerable:!0,get:function(){return eT.LoggerProvider}});var tT=ga();Object.defineProperty(z,"LogRecord",{enumerable:!0,get:function(){return tT.LogRecord}});var rT=Oa();Object.defineProperty(z,"NoopLogRecordProcessor",{enumerable:!0,get:function(){return rT.NoopLogRecordProcessor}});var nT=Kd();Object.defineProperty(z,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return nT.ConsoleLogRecordExporter}});var iT=zd();Object.defineProperty(z,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return iT.SimpleLogRecordProcessor}});var oT=Qd();Object.defineProperty(z,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return oT.InMemoryLogRecordExporter}});var sT=t_();Object.defineProperty(z,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return sT.BatchLogRecordProcessor}})});var Ci=c(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.AggregationTemporality=void 0;var aT;(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(aT=vr.AggregationTemporality||(vr.AggregationTemporality={}))});var Dt=c(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.DataPointType=void 0;var uT;(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(uT=Ir.DataPointType||(Ir.DataPointType={}))});var me=c(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.equalsCaseInsensitive=M.binarySearchLB=M.setEquals=M.FlatMap=M.isPromiseAllSettledRejectionResult=M.PromiseAllSettled=M.callWithTimeout=M.TimeoutError=M.instrumentationScopeId=M.hashAttributes=M.isNotNullish=void 0;function cT(r){return r!=null}M.isNotNullish=cT;function lT(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}M.hashAttributes=lT;function dT(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}M.instrumentationScopeId=dT;var Ni=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};M.TimeoutError=Ni;function _T(r,e){let t,n=new Promise(function(o,s){t=setTimeout(function(){s(new Ni("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}M.callWithTimeout=_T;async function pT(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}M.PromiseAllSettled=pT;function hT(r){return r.status==="rejected"}M.isPromiseAllSettledRejectionResult=hT;function fT(r,e){let t=[];return r.forEach(n=>{t.push(...e(n))}),t}M.FlatMap=fT;function ET(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}M.setEquals=ET;function mT(r,e){let t=0,n=r.length-1;for(;n-t>1;){let i=Math.trunc((n+t)/2);r[i]<=e?t=i:n=i-1}return r[n]<=e?n:r[t]<=e?t:-1}M.binarySearchLB=mT;function gT(r,e){return r.toLowerCase()===e.toLowerCase()}M.equalsCaseInsensitive=gT});var Ut=c(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.AggregatorKind=void 0;var TT;(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(TT=Lr.AggregatorKind||(Lr.AggregatorKind={}))});var n_=c(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.DropAggregator=void 0;var ST=Ut(),Ca=class{constructor(){this.kind=ST.AggregatorKind.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,i){}};wi.DropAggregator=Ca});var Re=c(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.isValidName=ie.isDescriptorCompatibleWith=ie.createInstrumentDescriptorWithView=ie.createInstrumentDescriptor=ie.InstrumentType=void 0;var i_=(p(),f(d)),AT=me(),OT;(function(r){r.COUNTER="COUNTER",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(OT=ie.InstrumentType||(ie.InstrumentType={}));function RT(r,e,t){var n,i,o,s;return o_(r)||i_.diag.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(n=t?.description)!==null&&n!==void 0?n:"",unit:(i=t?.unit)!==null&&i!==void 0?i:"",valueType:(o=t?.valueType)!==null&&o!==void 0?o:i_.ValueType.DOUBLE,advice:(s=t?.advice)!==null&&s!==void 0?s:{}}}ie.createInstrumentDescriptor=RT;function bT(r,e){var t,n;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(n=r.description)!==null&&n!==void 0?n:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}ie.createInstrumentDescriptorWithView=bT;function PT(r,e){return(0,AT.equalsCaseInsensitive)(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}ie.isDescriptorCompatibleWith=PT;var yT=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function o_(r){return r.match(yT)!=null}ie.isValidName=o_});var s_=c(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.HistogramAggregator=qt.HistogramAccumulation=void 0;var vT=Ut(),IT=Dt(),Na=Re(),LT=me();function MT(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var Bt=class{constructor(e,t,n=!0,i=MT(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=i}record(e){this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=(0,LT.binarySearchLB)(this._boundaries,e);this._current.buckets.counts[t+1]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};qt.HistogramAccumulation=Bt;var wa=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=vT.AggregatorKind.HISTOGRAM}createAccumulation(e){return new Bt(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue(),o=n.buckets.counts,s=i.buckets.counts,a=new Array(o.length);for(let _=0;_<o.length;_++)a[_]=o[_]+s[_];let u=1/0,l=-1/0;return this._recordMinMax&&(n.hasMinMax&&i.hasMinMax?(u=Math.min(n.min,i.min),l=Math.max(n.max,i.max)):n.hasMinMax?(u=n.min,l=n.max):i.hasMinMax&&(u=i.min,l=i.max)),new Bt(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:n.count+i.count,sum:n.sum+i.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||i.hasMinMax),min:u,max:l})}diff(e,t){let n=e.toPointValue(),i=t.toPointValue(),o=n.buckets.counts,s=i.buckets.counts,a=new Array(o.length);for(let u=0;u<o.length;u++)a[u]=s[u]-o[u];return new Bt(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:i.count-n.count,sum:i.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:IT.DataPointType.HISTOGRAM,dataPoints:n.map(([o,s])=>{let a=s.toPointValue(),u=e.type===Na.InstrumentType.UP_DOWN_COUNTER||e.type===Na.InstrumentType.OBSERVABLE_GAUGE||e.type===Na.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:o,startTime:s.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}};qt.HistogramAggregator=wa});var a_=c(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.Buckets=void 0;var xa=class r{constructor(e=new Da,t=0,n=0,i=0){this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,i=0,o=0;for(let s=this.indexStart;s<=this.indexEnd;){let a=s%n;a<0&&(a+=n);for(let u=a;u<n&&i<t;u++)this._relocateBucket(o,i),i++,s++;o++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}};xi.Buckets=xa;var Da=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let i=new Array(e).fill(0);i.splice(n,this._counts.length-t,...this._counts.slice(t)),i.splice(0,t,...this._counts.slice(0,t)),this._counts=i}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let i=0;i<n;i++){let o=this._counts[e+i];this._counts[e+i]=this._counts[t-i-1],this._counts[t-i-1]=o}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});var Ba=c(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.getSignificand=Q.getNormalBase2=Q.MIN_VALUE=Q.MAX_NORMAL_EXPONENT=Q.MIN_NORMAL_EXPONENT=Q.SIGNIFICAND_WIDTH=void 0;Q.SIGNIFICAND_WIDTH=52;var CT=2146435072,NT=1048575,Ua=1023;Q.MIN_NORMAL_EXPONENT=-Ua+1;Q.MAX_NORMAL_EXPONENT=Ua;Q.MIN_VALUE=Math.pow(2,-1022);function wT(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&CT)>>20)-Ua}Q.getNormalBase2=wT;function xT(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),n=e.getUint32(4);return(t&NT)*Math.pow(2,32)+n}Q.getSignificand=xT});var Di=c(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.nextGreaterSquare=Gt.ldexp=void 0;function DT(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}Gt.ldexp=DT;function UT(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}Gt.nextGreaterSquare=UT});var Bi=c(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.MappingError=void 0;var qa=class extends Error{};Ui.MappingError=qa});var c_=c(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.ExponentMapping=void 0;var Vt=Ba(),BT=Di(),u_=Bi(),Ga=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<Vt.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let t=Vt.getNormalBase2(e),n=this._rightShift(Vt.getSignificand(e)-1,Vt.SIGNIFICAND_WIDTH);return t+n>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new u_.MappingError(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new u_.MappingError(`overflow: ${e} is > maximum lower boundary: ${n}`);return BT.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=Vt.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return Vt.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}};qi.ExponentMapping=Ga});var __=c(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.LogarithmMapping=void 0;var jt=Ba(),l_=Di(),d_=Bi(),Va=class{constructor(e){this._scale=e,this._scaleFactor=l_.ldexp(Math.LOG2E,e),this._inverseFactor=l_.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=jt.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(jt.getSignificand(e)===0)return(jt.getNormalBase2(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new d_.MappingError(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return jt.MIN_VALUE;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new d_.MappingError(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return jt.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(jt.MAX_NORMAL_EXPONENT+1<<this._scale)-1}};Gi.LogarithmMapping=Va});var f_=c(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.getMapping=void 0;var qT=c_(),GT=__(),VT=Bi(),p_=-10,h_=20,jT=Array.from({length:31},(r,e)=>e>10?new GT.LogarithmMapping(e-10):new qT.ExponentMapping(e-10));function FT(r){if(r>h_||r<p_)throw new VT.MappingError(`expected scale >= ${p_} && <= ${h_}, got: ${r}`);return jT[r+10]}Vi.getMapping=FT});var g_=c(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ExponentialHistogramAggregator=Ht.ExponentialHistogramAccumulation=void 0;var HT=Ut(),kT=Dt(),$T=(p(),f(d)),ja=Re(),E_=a_(),m_=f_(),XT=Di(),Ft=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},WT=20,KT=160,Fa=2,ji=class r{constructor(e=e,t=KT,n=!0,i=0,o=0,s=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,l=new E_.Buckets,_=new E_.Buckets,E=(0,m_.getMapping)(WT)){this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=i,this._count=o,this._zeroCount=s,this._min=a,this._max=u,this._positive=l,this._negative=_,this._mapping=E,this._maxSize<Fa&&($T.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${Fa}`),this._maxSize=Fa)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let i=this._mapping.mapToIndex(t),o=!1,s=0,a=0;if(e.length===0?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i<e.indexStart&&e.indexEnd-i>=this._maxSize?(o=!0,a=i,s=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(o=!0,a=e.indexStart,s=i),o){let u=this._changeScale(s,a);this._downscale(u),i=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,i,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(t<e.indexStart){let o=e.indexEnd-t;o>=e.backing.length&&this._grow(e,o+1),e.indexStart=t}else if(t>e.indexEnd){let o=t-e.indexStart;o>=e.backing.length&&this._grow(e,o+1),e.indexEnd=t}let i=t-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,n)}_grow(e,t){let n=e.backing.length,i=e.indexBase-e.indexStart,o=n-i,s=(0,XT.nextGreaterSquare)(t);s>this._maxSize&&(s=this._maxSize);let a=s-i;e.backing.growTo(s,o,a)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=(0,m_.getMapping)(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=Ft.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),i=Ft.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(i.high,i.low))}_highLowAtScale(e,t,n){if(e.length===0)return new Ft(0,-1);let i=t-n;return new Ft(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,t,n,i){let o=n.offset,s=t.scale-i;for(let a=0;a<n.length;a++)this._incrementIndexBy(e,o+a>>s,n.at(a))}_diffBuckets(e,t,n,i){let o=n.offset,s=t.scale-i;for(let a=0;a<n.length;a++){let l=(o+a>>s)-e.indexBase;l<0&&(l+=e.backing.length),e.decrementBucket(l,n.at(a))}e.trim()}};Ht.ExponentialHistogramAccumulation=ji;var Ha=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=HT.AggregatorKind.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new ji(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:kT.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([o,s])=>{let a=s.toPointValue(),u=e.type===ja.InstrumentType.UP_DOWN_COUNTER||e.type===ja.InstrumentType.OBSERVABLE_GAUGE||e.type===ja.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:o,startTime:s.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}};Ht.ExponentialHistogramAggregator=Ha});var T_=c($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.LastValueAggregator=$t.LastValueAccumulation=void 0;var zT=Ut(),Mr=S(),YT=Dt(),kt=class{constructor(e,t=0,n=[0,0]){this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=(0,Mr.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};$t.LastValueAccumulation=kt;var ka=class{constructor(){this.kind=zT.AggregatorKind.LAST_VALUE}createAccumulation(e){return new kt(e)}merge(e,t){let n=(0,Mr.hrTimeToMicroseconds)(t.sampleTime)>=(0,Mr.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new kt(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=(0,Mr.hrTimeToMicroseconds)(t.sampleTime)>=(0,Mr.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new kt(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:YT.DataPointType.GAUGE,dataPoints:n.map(([o,s])=>({attributes:o,startTime:s.startTime,endTime:i,value:s.toPointValue()}))}}};$t.LastValueAggregator=ka});var S_=c(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.SumAggregator=Xt.SumAccumulation=void 0;var QT=Ut(),ZT=Dt(),xe=class{constructor(e,t,n=0,i=!1){this.startTime=e,this.monotonic=t,this._current=n,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Xt.SumAccumulation=xe;var $a=class{constructor(e){this.monotonic=e,this.kind=QT.AggregatorKind.SUM}createAccumulation(e){return new xe(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue();return t.reset?new xe(t.startTime,this.monotonic,i,t.reset):new xe(e.startTime,this.monotonic,n+i)}diff(e,t){let n=e.toPointValue(),i=t.toPointValue();return this.monotonic&&n>i?new xe(t.startTime,this.monotonic,i,!0):new xe(t.startTime,this.monotonic,i-n)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:ZT.DataPointType.SUM,dataPoints:n.map(([o,s])=>({attributes:o,startTime:s.startTime,endTime:i,value:s.toPointValue()})),isMonotonic:this.monotonic}}};Xt.SumAggregator=$a});var A_=c(le=>{"use strict";var JT=le&&le.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Cr=le&&le.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&JT(e,r,t)};Object.defineProperty(le,"__esModule",{value:!0});Cr(n_(),le);Cr(s_(),le);Cr(g_(),le);Cr(T_(),le);Cr(S_(),le)});var $i=c(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.DefaultAggregation=V.ExponentialHistogramAggregation=V.ExplicitBucketHistogramAggregation=V.HistogramAggregation=V.LastValueAggregation=V.SumAggregation=V.DropAggregation=V.Aggregation=void 0;var eS=(p(),f(d)),ct=A_(),be=Re(),ge=class{static Drop(){return O_}static Sum(){return R_}static LastValue(){return b_}static Histogram(){return P_}static ExponentialHistogram(){return tS}static Default(){return rS}};V.Aggregation=ge;var Nr=class r extends ge{createAggregator(e){return r.DEFAULT_INSTANCE}};V.DropAggregation=Nr;Nr.DEFAULT_INSTANCE=new ct.DropAggregator;var Wt=class r extends ge{createAggregator(e){switch(e.type){case be.InstrumentType.COUNTER:case be.InstrumentType.OBSERVABLE_COUNTER:case be.InstrumentType.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};V.SumAggregation=Wt;Wt.MONOTONIC_INSTANCE=new ct.SumAggregator(!0);Wt.NON_MONOTONIC_INSTANCE=new ct.SumAggregator(!1);var wr=class r extends ge{createAggregator(e){return r.DEFAULT_INSTANCE}};V.LastValueAggregation=wr;wr.DEFAULT_INSTANCE=new ct.LastValueAggregator;var xr=class r extends ge{createAggregator(e){return r.DEFAULT_INSTANCE}};V.HistogramAggregation=xr;xr.DEFAULT_INSTANCE=new ct.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);var Fi=class extends ge{constructor(e,t=!0){if(super(),this._recordMinMax=t,e===void 0||e.length===0)throw new Error("HistogramAggregator should be created with boundaries.");e=e.concat(),e=e.sort((o,s)=>o-s);let n=e.lastIndexOf(-1/0),i=e.indexOf(1/0);i===-1&&(i=void 0),this._boundaries=e.slice(n+1,i)}createAggregator(e){return new ct.HistogramAggregator(this._boundaries,this._recordMinMax)}};V.ExplicitBucketHistogramAggregation=Fi;var Hi=class extends ge{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new ct.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};V.ExponentialHistogramAggregation=Hi;var ki=class extends ge{_resolve(e){switch(e.type){case be.InstrumentType.COUNTER:case be.InstrumentType.UP_DOWN_COUNTER:case be.InstrumentType.OBSERVABLE_COUNTER:case be.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return R_;case be.InstrumentType.OBSERVABLE_GAUGE:return b_;case be.InstrumentType.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Fi(e.advice.explicitBucketBoundaries):P_}return eS.diag.warn(`Unable to recognize instrument type: ${e.type}`),O_}createAggregator(e){return this._resolve(e).createAggregator(e)}};V.DefaultAggregation=ki;var O_=new Nr,R_=new Wt,b_=new wr,P_=new xr,tS=new Hi,rS=new ki});var Xa=c(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Kt.DEFAULT_AGGREGATION_SELECTOR=void 0;var nS=$i(),iS=Ci(),oS=r=>nS.Aggregation.Default();Kt.DEFAULT_AGGREGATION_SELECTOR=oS;var sS=r=>iS.AggregationTemporality.CUMULATIVE;Kt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=sS});var Ka=c(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.MetricReader=void 0;var y_=(p(),f(d)),Xi=me(),v_=Xa(),Wa=class{constructor(e){var t,n,i;this._shutdown=!1,this._aggregationSelector=(t=e?.aggregationSelector)!==null&&t!==void 0?t:v_.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=(n=e?.aggregationTemporalitySelector)!==null&&n!==void 0?n:v_.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=(i=e?.metricProducers)!==null&&i!==void 0?i:[]}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(a=>a.collect({timeoutMillis:e?.timeoutMillis}))]),i=t.errors.concat((0,Xi.FlatMap)(n,a=>a.errors)),o=t.resourceMetrics.resource,s=t.resourceMetrics.scopeMetrics.concat((0,Xi.FlatMap)(n,a=>a.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:o,scopeMetrics:s},errors:i}}async shutdown(e){if(this._shutdown){y_.diag.error("Cannot call shutdown twice.");return}e?.timeoutMillis==null?await this.onShutdown():await(0,Xi.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){y_.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,Xi.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}};Wi.MetricReader=Wa});var M_=c(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.PeriodicExportingMetricReader=void 0;var I_=(p(),f(d)),Ki=S(),aS=Ka(),L_=me(),uS=(p(),f(d)),za=class extends aS.MetricReader{constructor(e){var t,n,i,o;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(n=e.exporter.selectAggregationTemporality)===null||n===void 0?void 0:n.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(i=e.exportIntervalMillis)!==null&&i!==void 0?i:6e4,this._exportTimeout=(o=e.exportTimeoutMillis)!==null&&o!==void 0?o:3e4,this._exporter=e.exporter}async _runOnce(){try{await(0,L_.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof L_.TimeoutError){I_.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,Ki.globalErrorHandler)(e)}}async _doRun(){var e,t;let{resourceMetrics:n,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});i.length>0&&I_.diag.error("PeriodicExportingMetricReader: metrics collection errors",...i);let o=async()=>{let s=await Ki.internal._export(this._exporter,n);if(s.code!==Ki.ExportResultCode.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${s.error})`)};n.resource.asyncAttributesPending?(t=(e=n.resource).waitForAsyncAttributes)===null||t===void 0||t.call(e).then(o,s=>uS.diag.debug("Error while resolving async portion of resource: ",s)):await o()}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),(0,Ki.unrefTimer)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}};zi.PeriodicExportingMetricReader=za});var N_=c(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.InMemoryMetricExporter=void 0;var C_=S(),Ya=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:C_.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:C_.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}};Yi.InMemoryMetricExporter=Ya});var x_=c(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.ConsoleMetricExporter=void 0;var w_=S(),cS=Xa(),Qa=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e?.temporalitySelector)!==null&&t!==void 0?t:cS.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(e,t){if(this._shutdown){setImmediate(t,{code:w_.ExportResultCode.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let n of e.scopeMetrics)for(let i of n.metrics)console.dir({descriptor:i.descriptor,dataPointType:i.dataPointType,dataPoints:i.dataPoints});t({code:w_.ExportResultCode.SUCCESS})}};Qi.ConsoleMetricExporter=Qa});var D_=c(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.ViewRegistry=void 0;var Za=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(i=>this._matchInstrument(i.instrumentSelector,e)&&this._matchMeter(i.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}};Zi.ViewRegistry=Za});var Ji=c(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.isObservableInstrument=x.ObservableUpDownCounterInstrument=x.ObservableGaugeInstrument=x.ObservableCounterInstrument=x.ObservableInstrument=x.HistogramInstrument=x.CounterInstrument=x.UpDownCounterInstrument=x.SyncInstrument=void 0;var zt=(p(),f(d)),lS=S(),Yt=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n=zt.context.active()){if(typeof e!="number"){zt.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===zt.ValueType.INT&&!Number.isInteger(e)&&(zt.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,n,(0,lS.millisToHrTime)(Date.now()))}};x.SyncInstrument=Yt;var Ja=class extends Yt{add(e,t,n){this._record(e,t,n)}};x.UpDownCounterInstrument=Ja;var eu=class extends Yt{add(e,t,n){if(e<0){zt.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};x.CounterInstrument=eu;var tu=class extends Yt{record(e,t,n){if(e<0){zt.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};x.HistogramInstrument=tu;var lt=class{constructor(e,t,n){this._observableRegistry=n,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};x.ObservableInstrument=lt;var ru=class extends lt{};x.ObservableCounterInstrument=ru;var nu=class extends lt{};x.ObservableGaugeInstrument=nu;var iu=class extends lt{};x.ObservableUpDownCounterInstrument=iu;function dS(r){return r instanceof lt}x.isObservableInstrument=dS});var U_=c(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.Meter=void 0;var se=Re(),Qt=Ji(),ou=class{constructor(e){this._meterSharedState=e}createHistogram(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.HISTOGRAM,t),i=this._meterSharedState.registerMetricStorage(n);return new Qt.HistogramInstrument(i,n)}createCounter(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new Qt.CounterInstrument(i,n)}createUpDownCounter(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.UP_DOWN_COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new Qt.UpDownCounterInstrument(i,n)}createObservableGauge(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.OBSERVABLE_GAUGE,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new Qt.ObservableGaugeInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.OBSERVABLE_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new Qt.ObservableCounterInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=(0,se.createInstrumentDescriptor)(e,se.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new Qt.ObservableUpDownCounterInstrument(n,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};eo.Meter=ou});var au=c(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.MetricStorage=void 0;var _S=Re(),su=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,_S.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};to.MetricStorage=su});var Dr=c(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.AttributeHashMap=Zt.HashMap=void 0;var pS=me(),ro=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let i=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,i),i}set(e,t,n){n??(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}};Zt.HashMap=ro;var uu=class extends ro{constructor(){super(pS.hashAttributes)}};Zt.AttributeHashMap=uu});var du=c(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.DeltaMetricProcessor=void 0;var cu=Dr(),lu=class{constructor(e){this._aggregator=e,this._activeCollectionStorage=new cu.AttributeHashMap,this._cumulativeMemoStorage=new cu.AttributeHashMap}record(e,t,n,i){let o=this._activeCollectionStorage.getOrDefault(t,()=>this._aggregator.createAccumulation(i));o?.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([n,i,o])=>{let s=this._aggregator.createAccumulation(t);s?.record(i);let a=s;if(this._cumulativeMemoStorage.has(n,o)){let u=this._cumulativeMemoStorage.get(n,o);a=this._aggregator.diff(u,s)}if(this._activeCollectionStorage.has(n,o)){let u=this._activeCollectionStorage.get(n,o);a=this._aggregator.merge(u,a)}this._cumulativeMemoStorage.set(n,s,o),this._activeCollectionStorage.set(n,a,o)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new cu.AttributeHashMap,e}};no.DeltaMetricProcessor=lu});var pu=c(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.TemporalMetricProcessor=void 0;var hS=Ci(),fS=Dr(),_u=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(e,t,n,i){this._stashAccumulations(n);let o=this._getMergedUnreportedAccumulations(e),s=o,a;if(this._reportHistory.has(e)){let l=this._reportHistory.get(e),_=l.collectionTime;a=l.aggregationTemporality,a===hS.AggregationTemporality.CUMULATIVE?s=r.merge(l.accumulations,o,this._aggregator):s=r.calibrateStartTime(l.accumulations,o,_)}else a=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:s,collectionTime:i,aggregationTemporality:a});let u=ES(s);if(u.length!==0)return this._aggregator.toMetricData(t,a,u,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let i=this._unreportedAccumulations.get(n);i===void 0&&(i=[],this._unreportedAccumulations.set(n,i)),i.push(e)}}_getMergedUnreportedAccumulations(e){let t=new fS.AttributeHashMap,n=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),n===void 0)return t;for(let i of n)t=r.merge(t,i,this._aggregator);return t}static merge(e,t,n){let i=e,o=t.entries(),s=o.next();for(;s.done!==!0;){let[a,u,l]=s.value;if(e.has(a,l)){let _=e.get(a,l),E=n.merge(_,u);i.set(a,E,l)}else i.set(a,u,l);s=o.next()}return i}static calibrateStartTime(e,t,n){for(let[i,o]of e.keys()){let s=t.get(i,o);s?.setStartTime(n)}return t}};io.TemporalMetricProcessor=_u;function ES(r){return Array.from(r.entries())}});var B_=c(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.AsyncMetricStorage=void 0;var mS=au(),gS=du(),TS=pu(),SS=Dr(),hu=class extends mS.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new gS.DeltaMetricProcessor(t),this._temporalMetricStorage=new TS.TemporalMetricProcessor(t,i)}record(e,t){let n=new SS.AttributeHashMap;Array.from(e.entries()).forEach(([i,o])=>{n.set(this._attributesProcessor.process(i),o)}),this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};oo.AsyncMetricStorage=hu});var F_=c(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.getConflictResolutionRecipe=Z.getDescriptionResolutionRecipe=Z.getTypeConflictResolutionRecipe=Z.getUnitConflictResolutionRecipe=Z.getValueTypeConflictResolutionRecipe=Z.getIncompatibilityDetails=void 0;function AS(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}'
9
9
  `),r.type!==e.type&&(t+=` - Type '${r.type}' does not match '${e.type}'
10
10
  `),r.valueType!==e.valueType&&(t+=` - Value Type '${r.valueType}' does not match '${e.valueType}'
11
11
  `),r.description!==e.description&&(t+=` - Description '${r.description}' does not match '${e.description}'
12
- `),t}Q.getIncompatibilityDetails=kT;function b_(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}Q.getValueTypeConflictResolutionRecipe=b_;function P_(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}Q.getUnitConflictResolutionRecipe=P_;function y_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'`}Q.getTypeConflictResolutionRecipe=y_;function v_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'
12
+ `),t}Z.getIncompatibilityDetails=AS;function q_(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}Z.getValueTypeConflictResolutionRecipe=q_;function G_(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}Z.getUnitConflictResolutionRecipe=G_;function V_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'`}Z.getTypeConflictResolutionRecipe=V_;function j_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'
13
13
  - OR - create a new view with the name ${r.name} and description '${r.description}' and InstrumentSelector ${n}
14
- - OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${n}`}Q.getDescriptionResolutionRecipe=v_;function XT(r,e){return r.valueType!==e.valueType?b_(r,e):r.unit!==e.unit?P_(r,e):r.type!==e.type?y_(r,e):r.description!==e.description?v_(r,e):""}Q.getConflictResolutionRecipe=XT});var M_=c(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.MetricStorageRegistry=void 0;var $T=Ae(),L_=(h(),f(d)),Zi=I_(),tu=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let i of this._sharedRegistry.values())t=t.concat(i);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let i of n.values())t=t.concat(i);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n==null&&(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(t,n)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let i=n.get(t.name);return i===void 0?null:this._findOrUpdateCompatibleStorage(t,i)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),i=t.get(n.name);if(i===void 0){t.set(n.name,[e]);return}i.push(e)}_findOrUpdateCompatibleStorage(e,t){let n=null;for(let i of t){let s=i.getInstrumentDescriptor();(0,$T.isDescriptorCompatibleWith)(s,e)?(s.description!==e.description&&(e.description.length>s.description.length&&i.updateDescription(e.description),L_.diag.warn("A view or instrument with the name ",e.name,` has already been registered, but has a different description and is incompatible with another registered view.
14
+ - OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${n}`}Z.getDescriptionResolutionRecipe=j_;function OS(r,e){return r.valueType!==e.valueType?q_(r,e):r.unit!==e.unit?G_(r,e):r.type!==e.type?V_(r,e):r.description!==e.description?j_(r,e):""}Z.getConflictResolutionRecipe=OS});var k_=c(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.MetricStorageRegistry=void 0;var RS=Re(),H_=(p(),f(d)),so=F_(),fu=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let i of this._sharedRegistry.values())t=t.concat(i);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let i of n.values())t=t.concat(i);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n==null&&(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(t,n)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let i=n.get(t.name);return i===void 0?null:this._findOrUpdateCompatibleStorage(t,i)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),i=t.get(n.name);if(i===void 0){t.set(n.name,[e]);return}i.push(e)}_findOrUpdateCompatibleStorage(e,t){let n=null;for(let i of t){let o=i.getInstrumentDescriptor();(0,RS.isDescriptorCompatibleWith)(o,e)?(o.description!==e.description&&(e.description.length>o.description.length&&i.updateDescription(e.description),H_.diag.warn("A view or instrument with the name ",e.name,` has already been registered, but has a different description and is incompatible with another registered view.
15
15
  `,`Details:
16
- `,(0,Zi.getIncompatibilityDetails)(s,e),`The longer description will be used.
17
- To resolve the conflict:`,(0,Zi.getConflictResolutionRecipe)(s,e))),n=i):L_.diag.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
16
+ `,(0,so.getIncompatibilityDetails)(o,e),`The longer description will be used.
17
+ To resolve the conflict:`,(0,so.getConflictResolutionRecipe)(o,e))),n=i):H_.diag.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
18
18
  `,`Details:
19
- `,(0,Zi.getIncompatibilityDetails)(s,e),`To resolve the conflict:
20
- `,(0,Zi.getConflictResolutionRecipe)(s,e))}return n}};Ji.MetricStorageRegistry=tu});var C_=c(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.MultiMetricStorage=void 0;var ru=class{constructor(e){this._backingStorages=e}record(e,t,n,i){this._backingStorages.forEach(s=>{s.record(e,t,n,i)})}};es.MultiMetricStorage=ru});var w_=c(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.BatchObservableResultImpl=Qt.ObservableResultImpl=void 0;var Yt=(h(),f(d)),N_=Mr(),WT=Xi(),nu=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new N_.AttributeHashMap}observe(e,t={}){if(typeof e!="number"){Yt.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Yt.ValueType.INT&&!Number.isInteger(e)&&(Yt.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}};Qt.ObservableResultImpl=nu;var iu=class{constructor(){this._buffer=new Map}observe(e,t,n={}){if(!(0,WT.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new N_.AttributeHashMap,this._buffer.set(e,i)),typeof t!="number"){Yt.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Yt.ValueType.INT&&!Number.isInteger(t)&&(Yt.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||i.set(n,t)}};Qt.BatchObservableResultImpl=iu});var B_=c(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.ObservableRegistry=void 0;var KT=(h(),f(d)),x_=Xi(),D_=w_(),Cr=Ee(),su=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,t){let n=new Set(t.filter(x_.isObservableInstrument));if(n.size===0){KT.diag.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(x_.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await(0,Cr.PromiseAllSettled)([...n,...i])).filter(Cr.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let s=new D_.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),o=Promise.resolve(n(s));t!=null&&(o=(0,Cr.callWithTimeout)(o,t)),await o,i._metricStorages.forEach(a=>{a.record(s._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let s=new D_.BatchObservableResultImpl,o=Promise.resolve(n(s));t!=null&&(o=(0,Cr.callWithTimeout)(o,t)),await o,i.forEach(a=>{let u=s._buffer.get(a);u!=null&&a._metricStorages.forEach(l=>{l.record(u,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&(0,Cr.setEquals)(n.instruments,t))}};ts.ObservableRegistry=su});var U_=c(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.SyncMetricStorage=void 0;var zT=Wa(),YT=Qa(),QT=Ja(),ou=class extends zT.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new YT.DeltaMetricProcessor(t),this._temporalMetricStorage=new QT.TemporalMetricProcessor(t,i)}record(e,t,n,i){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,i)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};rs.SyncMetricStorage=ou});var uu=c(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.FilteringAttributesProcessor=we.NoopAttributesProcessor=we.AttributesProcessor=void 0;var Nr=class{static Noop(){return ZT}};we.AttributesProcessor=Nr;var ns=class extends Nr{process(e,t){return e}};we.NoopAttributesProcessor=ns;var au=class extends Nr{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};we.FilteringAttributesProcessor=au;var ZT=new ns});var q_=c(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.MeterSharedState=void 0;var JT=Ae(),eS=O_(),tS=Ee(),rS=R_(),nS=M_(),iS=C_(),sS=B_(),oS=U_(),aS=uu(),cu=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new nS.MetricStorageRegistry,this.observableRegistry=new sS.ObservableRegistry,this.meter=new eS.Meter(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,oS.SyncMetricStorage);return t.length===1?t[0]:new iS.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,rS.AsyncMetricStorage)}async collect(e,t,n){let i=await this.observableRegistry.observe(t,n?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(s.length===0)return null;let o=s.map(a=>a.collect(e,t)).filter(tS.isNotNullish);return o.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}}_registerMetricStorage(e,t){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(s=>{let o=(0,JT.createInstrumentDescriptorWithView)(s,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;let u=s.aggregation.createAggregator(o),l=new t(o,u,s.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(l),l});if(i.length===0){let o=this._meterProviderSharedState.selectAggregations(e.type).map(([a,u])=>{let l=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(l!=null)return l;let _=u.createAggregator(e),E=new t(e,_,aS.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,E),E});i=i.concat(o)}return i}};is.MeterSharedState=cu});var G_=c(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.MeterProviderSharedState=void 0;var uS=Ee(),cS=A_(),lS=q_(),lu=class{constructor(e){this.resource=e,this.viewRegistry=new cS.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=(0,uS.instrumentationScopeId)(e),n=this.meterSharedStates.get(t);return n==null&&(n=new lS.MeterSharedState(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,n.selectAggregation(e)]);return t}};ss.MeterProviderSharedState=lu});var V_=c(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.MetricCollector=void 0;var dS=S(),du=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,dS.millisToHrTime)(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{let a=await o.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};os.MetricCollector=du});var F_=c(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.MeterProvider=void 0;var as=(h(),f(d)),j_=tt(),_S=G_(),hS=V_(),_u=class{constructor(e){var t;this._shutdown=!1;let n=j_.Resource.default().merge((t=e?.resource)!==null&&t!==void 0?t:j_.Resource.empty());if(this._sharedState=new _S.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i)}getMeter(e,t="",n={}){return this._shutdown?(as.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,as.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let t=new hS.MetricCollector(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){as.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){as.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};us.MeterProvider=_u});var cs=c(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.ExactPredicate=Zt.PatternPredicate=void 0;var pS=/[\^$\\.+?()[\]{}|]/g,hu=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(pS,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};Zt.PatternPredicate=hu;var pu=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};Zt.ExactPredicate=pu});var k_=c(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.InstrumentSelector=void 0;var H_=cs(),fu=class{constructor(e){var t;this._nameFilter=new H_.PatternPredicate((t=e?.name)!==null&&t!==void 0?t:"*"),this._type=e?.type,this._unitFilter=new H_.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};ls.InstrumentSelector=fu});var X_=c(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.MeterSelector=void 0;var Eu=cs(),mu=class{constructor(e){this._nameFilter=new Eu.ExactPredicate(e?.name),this._versionFilter=new Eu.ExactPredicate(e?.version),this._schemaUrlFilter=new Eu.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};ds.MeterSelector=mu});var W_=c(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.View=void 0;var fS=cs(),$_=uu(),ES=k_(),mS=X_(),gS=Ui();function TS(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var gu=class{constructor(e){var t;if(TS(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||fS.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new $_.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=$_.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:gS.Aggregation.Default(),this.instrumentSelector=new ES.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new mS.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};_s.View=gu});var K_=c(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.TimeoutError=g.View=g.Aggregation=g.SumAggregation=g.LastValueAggregation=g.HistogramAggregation=g.DropAggregation=g.ExponentialHistogramAggregation=g.ExplicitBucketHistogramAggregation=g.DefaultAggregation=g.MeterProvider=g.InstrumentType=g.ConsoleMetricExporter=g.InMemoryMetricExporter=g.PeriodicExportingMetricReader=g.MetricReader=g.DataPointType=g.AggregationTemporality=void 0;var SS=Ri();Object.defineProperty(g,"AggregationTemporality",{enumerable:!0,get:function(){return SS.AggregationTemporality}});var AS=Nt();Object.defineProperty(g,"DataPointType",{enumerable:!0,get:function(){return AS.DataPointType}});var OS=xa();Object.defineProperty(g,"MetricReader",{enumerable:!0,get:function(){return OS.MetricReader}});var RS=E_();Object.defineProperty(g,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return RS.PeriodicExportingMetricReader}});var bS=g_();Object.defineProperty(g,"InMemoryMetricExporter",{enumerable:!0,get:function(){return bS.InMemoryMetricExporter}});var PS=S_();Object.defineProperty(g,"ConsoleMetricExporter",{enumerable:!0,get:function(){return PS.ConsoleMetricExporter}});var yS=Ae();Object.defineProperty(g,"InstrumentType",{enumerable:!0,get:function(){return yS.InstrumentType}});var vS=F_();Object.defineProperty(g,"MeterProvider",{enumerable:!0,get:function(){return vS.MeterProvider}});var xe=Ui();Object.defineProperty(g,"DefaultAggregation",{enumerable:!0,get:function(){return xe.DefaultAggregation}});Object.defineProperty(g,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return xe.ExplicitBucketHistogramAggregation}});Object.defineProperty(g,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return xe.ExponentialHistogramAggregation}});Object.defineProperty(g,"DropAggregation",{enumerable:!0,get:function(){return xe.DropAggregation}});Object.defineProperty(g,"HistogramAggregation",{enumerable:!0,get:function(){return xe.HistogramAggregation}});Object.defineProperty(g,"LastValueAggregation",{enumerable:!0,get:function(){return xe.LastValueAggregation}});Object.defineProperty(g,"SumAggregation",{enumerable:!0,get:function(){return xe.SumAggregation}});Object.defineProperty(g,"Aggregation",{enumerable:!0,get:function(){return xe.Aggregation}});var IS=W_();Object.defineProperty(g,"View",{enumerable:!0,get:function(){return IS.View}});var LS=Ee();Object.defineProperty(g,"TimeoutError",{enumerable:!0,get:function(){return LS.TimeoutError}})});var z_=c(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.AbstractAsyncHooksContextManager=void 0;var MS=J("events"),CS=["addListener","on","once","prependListener","prependOnceListener"],Tu=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof MS.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let n=this,i=function(...s){return n.with(e,()=>t.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),CS.forEach(i=>{t[i]!==void 0&&(t[i]=this._patchAddListener(t,t[i],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let n=this;return function(i,s){var o;let a=(o=n._getPatchMap(e))===null||o===void 0?void 0:o[i];if(a===void 0)return t.call(this,i,s);let u=a.get(s);return t.call(this,i,u||s)}}_patchRemoveAllListeners(e,t){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let i=this;return function(s,o){if(i._wrapped)return t.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let u=a[s];u===void 0&&(u=new WeakMap,a[s]=u);let l=i.bind(n,o);u.set(o,l),i._wrapped=!0;try{return t.call(this,s,l)}finally{i._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};hs.AbstractAsyncHooksContextManager=Tu});var Y_=c(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.AsyncLocalStorageContextManager=void 0;var NS=(h(),f(d)),wS=J("async_hooks"),xS=z_(),Su=class extends xS.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new wS.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:NS.ROOT_CONTEXT}with(e,t,n,...i){let s=n==null?t:t.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};ps.AsyncLocalStorageContextManager=Su});var bu=c(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.toAnyValue=De.toKeyValue=De.toAttributes=void 0;function VS(r){return Object.keys(r).map(e=>Ou(e,r[e]))}De.toAttributes=VS;function Ou(r,e){return{key:r,value:Ru(e)}}De.toKeyValue=Ou;function Ru(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(Ru)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,n])=>Ou(t,n))}}:{}}De.toAnyValue=Ru});var rh=c(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.toOtlpSpanEvent=Be.toOtlpLink=Be.sdkSpanToOtlpSpan=void 0;var Pu=bu();function jS(r,e){var t;let n=r.spanContext(),i=r.status;return{traceId:e.encodeSpanContext(n.traceId),spanId:e.encodeSpanContext(n.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=n.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:(0,Pu.toAttributes)(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(s=>th(s,e)),droppedEventsCount:r.droppedEventsCount,status:{code:i.code,message:i.message},links:r.links.map(s=>eh(s,e)),droppedLinksCount:r.droppedLinksCount}}Be.sdkSpanToOtlpSpan=jS;function eh(r,e){var t;return{attributes:r.attributes?(0,Pu.toAttributes)(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}Be.toOtlpLink=eh;function th(r,e){return{attributes:r.attributes?(0,Pu.toAttributes)(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}Be.toOtlpSpanEvent=th});var ah=c(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.getOtlpEncoder=oe.encodeAsString=oe.encodeAsLongBits=oe.toLongBits=oe.hrTimeToNanos=void 0;var ms=S(),FS=BigInt(1e9);function yu(r){return BigInt(r[0])*FS+BigInt(r[1])}oe.hrTimeToNanos=yu;function ih(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}oe.toLongBits=ih;function vu(r){let e=yu(r);return ih(e)}oe.encodeAsLongBits=vu;function sh(r){return yu(r).toString()}oe.encodeAsString=sh;var HS=typeof BigInt<"u"?sh:ms.hrTimeToNanoseconds;function nh(r){return r}function oh(r){if(r!==void 0)return(0,ms.hexToBase64)(r)}var kS={encodeHrTime:vu,encodeSpanContext:ms.hexToBase64,encodeOptionalSpanContext:oh};function XS(r){var e,t;if(r===void 0)return kS;let n=(e=r.useLongBits)!==null&&e!==void 0?e:!0,i=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:n?vu:HS,encodeSpanContext:i?nh:ms.hexToBase64,encodeOptionalSpanContext:i?nh:oh}}oe.getOtlpEncoder=XS});var Iu=c(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.createExportTraceServiceRequest=void 0;var $S=bu(),WS=rh(),KS=ah();function zS(r,e){let t=(0,KS.getOtlpEncoder)(e);return{resourceSpans:QS(r,t)}}gs.createExportTraceServiceRequest=zS;function YS(r){let e=new Map;for(let t of r){let n=e.get(t.resource);n||(n=new Map,e.set(t.resource,n));let i=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(t)}return e}function QS(r,e){let t=YS(r),n=[],i=t.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,u=[],l=a.values(),_=l.next();for(;!_.done;){let O=_.value;if(O.length>0){let{name:D,version:z,schemaUrl:I}=O[0].instrumentationLibrary,U=O.map(L=>(0,WS.sdkSpanToOtlpSpan)(L,e));u.push({scope:{name:D,version:z},spans:U,schemaUrl:I})}_=l.next()}let E={resource:{attributes:(0,$S.toAttributes)(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(E),s=i.next()}return n}});var lh=c(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.parseRetryAfterToMills=C.isExportRetryable=C.invalidTimeout=C.configureExporterTimeout=C.appendRootPathToUrlIfNeeded=C.appendResourcePathToUrl=C.parseHeaders=C.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=C.DEFAULT_EXPORT_MAX_BACKOFF=C.DEFAULT_EXPORT_INITIAL_BACKOFF=C.DEFAULT_EXPORT_MAX_ATTEMPTS=void 0;var Lu=(h(),f(d)),uh=S(),ch=1e4;C.DEFAULT_EXPORT_MAX_ATTEMPTS=5;C.DEFAULT_EXPORT_INITIAL_BACKOFF=1e3;C.DEFAULT_EXPORT_MAX_BACKOFF=5e3;C.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=1.5;function ZS(r={}){let e={};return Object.entries(r).forEach(([t,n])=>{typeof n<"u"?e[t]=String(n):Lu.diag.warn(`Header "${t}" has wrong value and will be ignored`)}),e}C.parseHeaders=ZS;function JS(r,e){return r.endsWith("/")||(r=r+"/"),r+e}C.appendResourcePathToUrl=JS;function eA(r){try{let e=new URL(r);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return Lu.diag.warn(`Could not parse export URL: '${r}'`),r}}C.appendRootPathToUrlIfNeeded=eA;function tA(r){return typeof r=="number"?r<=0?Mu(r,ch):r:rA()}C.configureExporterTimeout=tA;function rA(){var r;let e=Number((r=(0,uh.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&r!==void 0?r:(0,uh.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?Mu(e,ch):e}function Mu(r,e){return Lu.diag.warn("Timeout must be greater than 0",r),e}C.invalidTimeout=Mu;function nA(r){return[429,502,503,504].includes(r)}C.isExportRetryable=nA;function iA(r){if(r==null)return-1;let e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let t=new Date(r).getTime()-Date.now();return t>=0?t:0}C.parseRetryAfterToMills=iA});var _h=c(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.OTLPExporterBase=void 0;var dh=(h(),f(d)),xr=S(),sA=lh(),Cu=class{constructor(e={}){this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new xr.BindOnceFuture(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:30,this.timeoutMillis=(0,sA.configureExporterTimeout)(e.timeoutMillis),this.onInit(e)}export(e,t){if(this._shutdownOnce.isCalled){t({code:xr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:xr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:xr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:xr.ExportResultCode.FAILED,error:n})})}_export(e){return new Promise((t,n)=>{try{dh.diag.debug("items to be sent",e),this.send(e,t,n)}catch(i){n(i)}})}shutdown(){return this._shutdownOnce.call()}forceFlush(){return Promise.all(this._sendingPromises).then(()=>{})}_shutdown(){return dh.diag.debug("shutdown started"),this.onShutdown(),this.forceFlush()}};Ts.OTLPExporterBase=Cu});var Eh=c((vP,fh)=>{"use strict";fh.exports=uA;function uA(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(a,u){t[n]=function(_){if(s)if(s=!1,_)u(_);else{for(var E=new Array(arguments.length-1),O=0;O<E.length;)E[O++]=arguments[O];a.apply(null,E)}};try{r.apply(e||null,t)}catch(l){s&&(s=!1,u(l))}})}});var Sh=c(Th=>{"use strict";var As=Th;As.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)==="=";)++n;return Math.ceil(e.length*3)/4-n};var rr=new Array(64),gh=new Array(123);for(le=0;le<64;)gh[rr[le]=le<26?le+65:le<52?le+71:le<62?le-4:le-59|43]=le++;var le;As.encode=function(e,t,n){for(var i=null,s=[],o=0,a=0,u;t<n;){var l=e[t++];switch(a){case 0:s[o++]=rr[l>>2],u=(l&3)<<4,a=1;break;case 1:s[o++]=rr[u|l>>4],u=(l&15)<<2,a=2;break;case 2:s[o++]=rr[u|l>>6],s[o++]=rr[l&63],a=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=rr[u],s[o++]=61,a===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var mh="invalid encoding";As.decode=function(e,t,n){for(var i=n,s=0,o,a=0;a<e.length;){var u=e.charCodeAt(a++);if(u===61&&s>1)break;if((u=gh[u])===void 0)throw Error(mh);switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(u&48)>>4,o=u,s=2;break;case 2:t[n++]=(o&15)<<4|(u&60)>>2,o=u,s=3;break;case 3:t[n++]=(o&3)<<6|u,s=0;break}}if(s===1)throw Error(mh);return n-i};As.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var Oh=c((LP,Ah)=>{"use strict";Ah.exports=Os;function Os(){this._listeners={}}Os.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};Os.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};Os.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var Lh=c((MP,Ih)=>{"use strict";Ih.exports=Rh(Rh);function Rh(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(u,l,_){e[0]=u,l[_]=t[0],l[_+1]=t[1],l[_+2]=t[2],l[_+3]=t[3]}function s(u,l,_){e[0]=u,l[_]=t[3],l[_+1]=t[2],l[_+2]=t[1],l[_+3]=t[0]}r.writeFloatLE=n?i:s,r.writeFloatBE=n?s:i;function o(u,l){return t[0]=u[l],t[1]=u[l+1],t[2]=u[l+2],t[3]=u[l+3],e[0]}function a(u,l){return t[3]=u[l],t[2]=u[l+1],t[1]=u[l+2],t[0]=u[l+3],e[0]}r.readFloatLE=n?o:a,r.readFloatBE=n?a:o}():function(){function e(n,i,s,o){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,s,o);else if(isNaN(i))n(2143289344,s,o);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var u=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-u)*8388608)&8388607;n((a<<31|u+127<<23|l)>>>0,s,o)}}r.writeFloatLE=e.bind(null,bh),r.writeFloatBE=e.bind(null,Ph);function t(n,i,s){var o=n(i,s),a=(o>>31)*2+1,u=o>>>23&255,l=o&8388607;return u===255?l?NaN:a*(1/0):u===0?a*1401298464324817e-60*l:a*Math.pow(2,u-150)*(l+8388608)}r.readFloatLE=t.bind(null,yh),r.readFloatBE=t.bind(null,vh)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(u,l,_){e[0]=u,l[_]=t[0],l[_+1]=t[1],l[_+2]=t[2],l[_+3]=t[3],l[_+4]=t[4],l[_+5]=t[5],l[_+6]=t[6],l[_+7]=t[7]}function s(u,l,_){e[0]=u,l[_]=t[7],l[_+1]=t[6],l[_+2]=t[5],l[_+3]=t[4],l[_+4]=t[3],l[_+5]=t[2],l[_+6]=t[1],l[_+7]=t[0]}r.writeDoubleLE=n?i:s,r.writeDoubleBE=n?s:i;function o(u,l){return t[0]=u[l],t[1]=u[l+1],t[2]=u[l+2],t[3]=u[l+3],t[4]=u[l+4],t[5]=u[l+5],t[6]=u[l+6],t[7]=u[l+7],e[0]}function a(u,l){return t[7]=u[l],t[6]=u[l+1],t[5]=u[l+2],t[4]=u[l+3],t[3]=u[l+4],t[2]=u[l+5],t[1]=u[l+6],t[0]=u[l+7],e[0]}r.readDoubleLE=n?o:a,r.readDoubleBE=n?a:o}():function(){function e(n,i,s,o,a,u){var l=o<0?1:0;if(l&&(o=-o),o===0)n(0,a,u+i),n(1/o>0?0:2147483648,a,u+s);else if(isNaN(o))n(0,a,u+i),n(2146959360,a,u+s);else if(o>17976931348623157e292)n(0,a,u+i),n((l<<31|2146435072)>>>0,a,u+s);else{var _;if(o<22250738585072014e-324)_=o/5e-324,n(_>>>0,a,u+i),n((l<<31|_/4294967296)>>>0,a,u+s);else{var E=Math.floor(Math.log(o)/Math.LN2);E===1024&&(E=1023),_=o*Math.pow(2,-E),n(_*4503599627370496>>>0,a,u+i),n((l<<31|E+1023<<20|_*1048576&1048575)>>>0,a,u+s)}}}r.writeDoubleLE=e.bind(null,bh,0,4),r.writeDoubleBE=e.bind(null,Ph,4,0);function t(n,i,s,o,a){var u=n(o,a+i),l=n(o,a+s),_=(l>>31)*2+1,E=l>>>20&2047,O=4294967296*(l&1048575)+u;return E===2047?O?NaN:_*(1/0):E===0?_*5e-324*O:_*Math.pow(2,E-1075)*(O+4503599627370496)}r.readDoubleLE=t.bind(null,yh,0,4),r.readDoubleBE=t.bind(null,vh,4,0)}(),r}function bh(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Ph(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function yh(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function vh(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var Mh=c((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var Nh=c(Ch=>{"use strict";var wu=Ch;wu.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};wu.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var s=null,o=[],a=0,u;t<n;)u=e[t++],u<128?o[a++]=u:u>191&&u<224?o[a++]=(u&31)<<6|e[t++]&63:u>239&&u<365?(u=((u&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[a++]=55296+(u>>10),o[a++]=56320+(u&1023)):o[a++]=(u&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0);return s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};wu.write=function(e,t,n){for(var i=n,s,o,a=0;a<e.length;++a)s=e.charCodeAt(a),s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(a+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++a,t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128);return n-i}});var xh=c((NP,wh)=>{"use strict";wh.exports=cA;function cA(r,e,t){var n=t||8192,i=n>>>1,s=null,o=n;return function(u){if(u<1||u>i)return r(u);o+u>n&&(s=r(n),o=0);var l=e.call(s,o,o+=u);return o&7&&(o=(o|7)+1),l}}});var Bh=c((wP,Dh)=>{"use strict";Dh.exports=V;var Dr=qe();function V(r,e){this.lo=r>>>0,this.hi=e>>>0}var ut=V.zero=new V(0,0);ut.toNumber=function(){return 0};ut.zzEncode=ut.zzDecode=function(){return this};ut.length=function(){return 1};var lA=V.zeroHash="\0\0\0\0\0\0\0\0";V.fromNumber=function(e){if(e===0)return ut;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new V(n,i)};V.from=function(e){if(typeof e=="number")return V.fromNumber(e);if(Dr.isString(e))if(Dr.Long)e=Dr.Long.fromString(e);else return V.fromNumber(parseInt(e,10));return e.low||e.high?new V(e.low>>>0,e.high>>>0):ut};V.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296};V.prototype.toLong=function(e){return Dr.Long?new Dr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Ue=String.prototype.charCodeAt;V.fromHash=function(e){return e===lA?ut:new V((Ue.call(e,0)|Ue.call(e,1)<<8|Ue.call(e,2)<<16|Ue.call(e,3)<<24)>>>0,(Ue.call(e,4)|Ue.call(e,5)<<8|Ue.call(e,6)<<16|Ue.call(e,7)<<24)>>>0)};V.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};V.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};V.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};V.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}});var qe=c(xu=>{"use strict";var p=xu;p.asPromise=Eh();p.base64=Sh();p.EventEmitter=Oh();p.float=Lh();p.inquire=Mh();p.utf8=Nh();p.pool=xh();p.LongBits=Bh();p.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);p.global=p.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||xu;p.emptyArray=Object.freeze?Object.freeze([]):[];p.emptyObject=Object.freeze?Object.freeze({}):{};p.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};p.isString=function(e){return typeof e=="string"||e instanceof String};p.isObject=function(e){return e&&typeof e=="object"};p.isset=p.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};p.Buffer=function(){try{var r=p.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();p._Buffer_from=null;p._Buffer_allocUnsafe=null;p.newBuffer=function(e){return typeof e=="number"?p.Buffer?p._Buffer_allocUnsafe(e):new p.Array(e):p.Buffer?p._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};p.Array=typeof Uint8Array<"u"?Uint8Array:Array;p.Long=p.global.dcodeIO&&p.global.dcodeIO.Long||p.global.Long||p.inquire("long");p.key2Re=/^true|false|0|1$/;p.key32Re=/^-?(?:0|[1-9][0-9]*)$/;p.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;p.longToHash=function(e){return e?p.LongBits.from(e).toHash():p.LongBits.zeroHash};p.longFromHash=function(e,t){var n=p.LongBits.fromHash(e);return p.Long?p.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)};function Uh(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}p.merge=Uh;p.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function qh(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&Uh(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}p.newError=qh;p.ProtocolError=qh("ProtocolError");p.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),s=i.length-1;s>-1;--s)if(t[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};p.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};p.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};p._configure=function(){var r=p.Buffer;if(!r){p._Buffer_from=p._Buffer_allocUnsafe=null;return}p._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},p._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var ju=c((DP,Fh)=>{"use strict";Fh.exports=A;var ae=qe(),Du,Rs=ae.LongBits,Gh=ae.base64,Vh=ae.utf8;function Br(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Uu(){}function dA(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function A(){this.len=0,this.head=new Br(Uu,0,0),this.tail=this.head,this.states=null}var jh=function(){return ae.Buffer?function(){return(A.create=function(){return new Du})()}:function(){return new A}};A.create=jh();A.alloc=function(e){return new ae.Array(e)};ae.Array!==Array&&(A.alloc=ae.pool(A.alloc,ae.Array.prototype.subarray));A.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Br(e,t,n),this.len+=t,this};function qu(r,e,t){e[t]=r&255}function _A(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function Gu(r,e){this.len=r,this.next=void 0,this.val=e}Gu.prototype=Object.create(Br.prototype);Gu.prototype.fn=_A;A.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Gu((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};A.prototype.int32=function(e){return e<0?this._push(Vu,10,Rs.fromNumber(e)):this.uint32(e)};A.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function Vu(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}A.prototype.uint64=function(e){var t=Rs.from(e);return this._push(Vu,t.length(),t)};A.prototype.int64=A.prototype.uint64;A.prototype.sint64=function(e){var t=Rs.from(e).zzEncode();return this._push(Vu,t.length(),t)};A.prototype.bool=function(e){return this._push(qu,1,e?1:0)};function Bu(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}A.prototype.fixed32=function(e){return this._push(Bu,4,e>>>0)};A.prototype.sfixed32=A.prototype.fixed32;A.prototype.fixed64=function(e){var t=Rs.from(e);return this._push(Bu,4,t.lo)._push(Bu,4,t.hi)};A.prototype.sfixed64=A.prototype.fixed64;A.prototype.float=function(e){return this._push(ae.float.writeFloatLE,4,e)};A.prototype.double=function(e){return this._push(ae.float.writeDoubleLE,8,e)};var hA=ae.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};A.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(qu,1,0);if(ae.isString(e)){var n=A.alloc(t=Gh.length(e));Gh.decode(e,n,0),e=n}return this.uint32(t)._push(hA,t,e)};A.prototype.string=function(e){var t=Vh.length(e);return t?this.uint32(t)._push(Vh.write,t,e):this._push(qu,1,0)};A.prototype.fork=function(){return this.states=new dA(this),this.head=this.tail=new Br(Uu,0,0),this.len=0,this};A.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Br(Uu,0,0),this.len=0),this};A.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this};A.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t};A._configure=function(r){Du=r,A.create=jh(),Du._configure()}});var Xh=c((BP,kh)=>{"use strict";kh.exports=ge;var Hh=ju();(ge.prototype=Object.create(Hh.prototype)).constructor=ge;var Ge=qe();function ge(){Hh.call(this)}ge._configure=function(){ge.alloc=Ge._Buffer_allocUnsafe,ge.writeBytesBuffer=Ge.Buffer&&Ge.Buffer.prototype instanceof Uint8Array&&Ge.Buffer.prototype.set.name==="set"?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i<e.length;)t[n++]=e[i++]}};ge.prototype.bytes=function(e){Ge.isString(e)&&(e=Ge._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(ge.writeBytesBuffer,t,e),this};function pA(r,e,t){r.length<40?Ge.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}ge.prototype.string=function(e){var t=Ge.Buffer.byteLength(e);return this.uint32(t),t&&this._push(pA,t,e),this};ge._configure()});var ku=c((UP,Yh)=>{"use strict";Yh.exports=w;var de=qe(),Hu,Kh=de.LongBits,fA=de.utf8;function _e(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function w(r){this.buf=r,this.pos=0,this.len=r.length}var $h=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new w(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new w(e);throw Error("illegal buffer")},zh=function(){return de.Buffer?function(t){return(w.create=function(i){return de.Buffer.isBuffer(i)?new Hu(i):$h(i)})(t)}:$h};w.create=zh();w.prototype._slice=de.Array.prototype.subarray||de.Array.prototype.slice;w.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,_e(this,10);return e}}();w.prototype.int32=function(){return this.uint32()|0};w.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function Fu(){var r=new Kh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw _e(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw _e(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}w.prototype.bool=function(){return this.uint32()!==0};function bs(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}w.prototype.fixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return bs(this.buf,this.pos+=4)};w.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return bs(this.buf,this.pos+=4)|0};function Wh(){if(this.pos+8>this.len)throw _e(this,8);return new Kh(bs(this.buf,this.pos+=4),bs(this.buf,this.pos+=4))}w.prototype.float=function(){if(this.pos+4>this.len)throw _e(this,4);var e=de.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};w.prototype.double=function(){if(this.pos+8>this.len)throw _e(this,4);var e=de.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};w.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw _e(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=de.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)};w.prototype.string=function(){var e=this.bytes();return fA.read(e,0,e.length)};w.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw _e(this,e);this.pos+=e}else do if(this.pos>=this.len)throw _e(this);while(this.buf[this.pos++]&128);return this};w.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};w._configure=function(r){Hu=r,w.create=zh(),Hu._configure();var e=de.Long?"toLong":"toNumber";de.merge(w.prototype,{int64:function(){return Fu.call(this)[e](!1)},uint64:function(){return Fu.call(this)[e](!0)},sint64:function(){return Fu.call(this).zzDecode()[e](!1)},fixed64:function(){return Wh.call(this)[e](!0)},sfixed64:function(){return Wh.call(this)[e](!1)}})}});var ep=c((qP,Jh)=>{"use strict";Jh.exports=ct;var Zh=ku();(ct.prototype=Object.create(Zh.prototype)).constructor=ct;var Qh=qe();function ct(r){Zh.call(this,r)}ct._configure=function(){Qh.Buffer&&(ct.prototype._slice=Qh.Buffer.prototype.slice)};ct.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};ct._configure()});var rp=c((GP,tp)=>{"use strict";tp.exports=Ur;var Xu=qe();(Ur.prototype=Object.create(Xu.EventEmitter.prototype)).constructor=Ur;function Ur(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");Xu.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Ur.prototype.rpcCall=function r(e,t,n,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return Xu.asPromise(r,o,e,t,n,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,t[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,l){if(u)return o.emit("error",u,e),s(u);if(l===null){o.end(!0);return}if(!(l instanceof n))try{l=n[o.responseDelimited?"decodeDelimited":"decode"](l)}catch(_){return o.emit("error",_,e),s(_)}return o.emit("data",l,e),s(null,l)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};Ur.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var ip=c(np=>{"use strict";var EA=np;EA.Service=rp()});var op=c((jP,sp)=>{"use strict";sp.exports={}});var cp=c(up=>{"use strict";var Z=up;Z.build="minimal";Z.Writer=ju();Z.BufferWriter=Xh();Z.Reader=ku();Z.BufferReader=ep();Z.util=qe();Z.rpc=ip();Z.roots=op();Z.configure=ap;function ap(){Z.util._configure(),Z.Writer._configure(Z.BufferWriter),Z.Reader._configure(Z.BufferReader)}ap()});var dp=c((HP,lp)=>{"use strict";lp.exports=cp()});var N=H(Yo(),1);h();ta();var Ap=H(yd(),1),or=H(tt(),1),Op=H(Fd(),1),Rp=H(K_(),1),Yu=H(ie(),1),ar=H(kr(),1),bp=H(Y_(),1),Ve=H(S(),1);h();var DS=Symbol.for("@vercel/request-context");function Jt(){return globalThis[DS]?.get()}var Au=H(ie(),1);function fs(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>t!==void 0))}function Q_(r){return r?r.split("::").at(-1):void 0}function Z_(r=Jt(),e){if(!r)return;let t=e?US(e,r.headers):void 0;return fs({[Au.SemanticAttributes.HTTP_HOST]:r.headers.host,[Au.SemanticAttributes.HTTP_USER_AGENT]:r.headers["user-agent"],"http.referer":r.headers.referer,"vercel.request_id":Q_(r.headers["x-vercel-id"]),"vercel.matched_path":r.headers["x-matched-path"],"vercel.edge_region":r.headers["x-vercel-edge-region"],...t})}var BS={keys(r){return[]},get(r,e){return r[e.toLocaleLowerCase()]}};function US(r,e){if(typeof r=="function")return r(e,BS);let t={};for(let[n,i]of Object.entries(r)){let s=e[i.toLocaleLowerCase()];s!==void 0&&(t[n]=s)}return t}h();function wr(r){return(r&d.TraceFlags.SAMPLED)!==0}var Es=class{constructor(e,t){this.processors=e;this.attributesFromHeaders=t;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(t=>{d.diag.error("@vercel/otel: forceFlush failed:",t)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,t){let{traceId:n,spanId:i,traceFlags:s}=e.spanContext(),o=!e.parentSpanId||!this.rootSpanIds.has(n);if(o?this.rootSpanIds.set(n,{rootSpanId:i,open:[]}):this.rootSpanIds.get(n)?.open.push(e),o&&wr(s)){let a=Jt(),u=Z_(a,this.attributesFromHeaders);u&&e.setAttributes(u),a&&a.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let l=new Promise(E=>{this.waitSpanEnd.set(n,E)}),_;await Promise.race([l,new Promise(E=>{_=setTimeout(()=>{this.waitSpanEnd.delete(n),E(void 0)},50)})]),_&&clearTimeout(_)}return this.forceFlush()})}for(let a of this.processors)a.onStart(e,t)}onEnd(e){let{traceId:t,spanId:n,traceFlags:i}=e.spanContext(),s=wr(i),o=this.rootSpanIds.get(t),a=o?.rootSpanId===n;if(s){let u=GS(e);u&&Object.assign(e.attributes,u)}if(a){if(this.rootSpanIds.delete(t),o.open.length>0){for(let u of o.open)if(!u.ended&&u.spanContext().spanId!==n)try{u.end()}catch(l){d.diag.error("@vercel/otel: onEnd failed:",l)}}}else if(o)for(let u=0;u<o.open.length;u++)o.open[u]?.spanContext().spanId===n&&o.open.splice(u,1);for(let u of this.processors)u.onEnd(e);if(a){let u=this.waitSpanEnd.get(t);u&&(this.waitSpanEnd.delete(t),u())}}},qS={[d.SpanKind.INTERNAL]:"internal",[d.SpanKind.SERVER]:"server",[d.SpanKind.CLIENT]:"client",[d.SpanKind.PRODUCER]:"producer",[d.SpanKind.CONSUMER]:"consumer"};function GS(r){let{kind:e,attributes:t}=r,{"operation.name":n,"resource.name":i,"span.type":s,"next.span_type":o,"http.method":a,"http.route":u}=t;if(n)return;let l=i??(a&&typeof a=="string"&&u&&typeof u=="string"?`${a} ${u}`:u);if(r.kind===d.SpanKind.SERVER&&a&&u&&typeof a=="string"&&typeof u=="string")return{"operation.name":"web.request","resource.name":l};let _=r.instrumentationLibrary.name,E=o??s;if(E&&typeof E=="string"){let O=J_(_,E);return u?{"operation.name":O,"resource.name":l}:{"operation.name":O}}return{"operation.name":J_(_,e===d.SpanKind.INTERNAL?"":qS[e])}}function J_(r,e){if(!r)return e;let t=r.replace(/[ @./]/g,"_");return t.startsWith("_")&&(t=t.slice(1)),e?`${t}.${e}`:t}var ph=H(Iu(),1);var hh=H(_h(),1);h();var er=class extends hh.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){d.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){d.diag.debug("@vercel/otel/otlp: onInit")}send(e,t,n){if(this._shutdownOnce.isCalled){d.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let i=this.convert(e),s,o,a;try{({body:s,contentType:o,headers:a}=this.toMessage(i))}catch(l){d.diag.warn("@vercel/otel/otlp: no proto",l);return}let u=fetch(this.url,{method:"POST",body:s,headers:{...this._headers,...a,"Content-Type":o,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(l=>{d.diag.debug("@vercel/otel/otlp: onSuccess",l.status,l.statusText),t(),l.arrayBuffer().catch(()=>{})}).catch(l=>{d.diag.error("@vercel/otel/otlp: onError",l),n(l)}).finally(()=>{let l=this._sendingPromises.indexOf(u);this._sendingPromises.splice(l,1)});this._sendingPromises.push(u)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var oA="v1/traces",aA=`http://localhost:4318/${oA}`;function Ss(r){return typeof r.url=="string"?r.url:aA}var tr=class{constructor(e={}){this.impl=new Nu(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Nu=class extends er{convert(e){return(0,ph.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return Ss(e)}};var fp=H(Iu(),1);var _p=H(dp(),1);function hp(r){let e=new _p.Writer;return mA(r,e),e.finish()}function mA(r,e){if(r.resourceSpans!=null&&r.resourceSpans.length)for(let t=0;t<r.resourceSpans.length;++t)gA(r.resourceSpans[t],e.uint32(10).fork()).ldelim();return e}function gA(r,e){if(r.resource!=null&&TA(r.resource,e.uint32(10).fork()).ldelim(),r.scopeSpans!=null&&r.scopeSpans.length)for(let t=0;t<r.scopeSpans.length;++t)SA(r.scopeSpans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function TA(r,e){if(r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(10).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(16).uint32(r.droppedAttributesCount),e}function SA(r,e){if(r.scope!=null&&RA(r.scope,e.uint32(10).fork()).ldelim(),r.spans!=null&&r.spans.length)for(let t=0;t<r.spans.length;++t)bA(r.spans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function nr(r,e){return r.key!=null&&e.uint32(10).string(r.key),r.value!=null&&pp(r.value,e.uint32(18).fork()).ldelim(),e}function pp(r,e){return r.stringValue!=null&&e.uint32(10).string(r.stringValue),r.boolValue!=null&&e.uint32(16).bool(r.boolValue),r.intValue!=null&&e.uint32(24).int64(r.intValue),r.doubleValue!=null&&e.uint32(33).double(r.doubleValue),r.arrayValue!=null&&AA(r.arrayValue,e.uint32(42).fork()).ldelim(),r.kvlistValue!=null&&OA(r.kvlistValue,e.uint32(50).fork()).ldelim(),r.bytesValue!=null&&e.uint32(58).bytes(r.bytesValue),e}function AA(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)pp(r.values[t],e.uint32(10).fork()).ldelim();return e}function OA(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)nr(r.values[t],e.uint32(10).fork()).ldelim();return e}function RA(r,e){if(r.name!=null&&e.uint32(10).string(r.name),r.version!=null&&e.uint32(18).string(r.version),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function bA(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.parentSpanId!=null&&e.uint32(34).bytes(r.parentSpanId),r.name!=null&&e.uint32(42).string(r.name),r.kind!=null&&e.uint32(48).int32(r.kind),r.startTimeUnixNano!=null&&e.uint32(57).fixed64(r.startTimeUnixNano),r.endTimeUnixNano!=null&&e.uint32(65).fixed64(r.endTimeUnixNano),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(74).fork()).ldelim();if(r.droppedAttributesCount!=null&&e.uint32(80).uint32(r.droppedAttributesCount),r.events!=null&&r.events.length)for(let t=0;t<r.events.length;++t)yA(r.events[t],e.uint32(90).fork()).ldelim();if(r.droppedEventsCount!=null&&e.uint32(96).uint32(r.droppedEventsCount),r.links!=null&&r.links.length)for(let t=0;t<r.links.length;++t)vA(r.links[t],e.uint32(106).fork()).ldelim();return r.droppedLinksCount!=null&&e.uint32(112).uint32(r.droppedLinksCount),r.status!=null&&PA(r.status,e.uint32(122).fork()).ldelim(),e}function PA(r,e){return r.message!=null&&e.uint32(18).string(r.message),r.code!=null&&e.uint32(24).int32(r.code),e}function yA(r,e){if(r.timeUnixNano!=null&&e.uint32(9).fixed64(r.timeUnixNano),r.name!=null&&e.uint32(18).string(r.name),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function vA(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(34).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(40).uint32(r.droppedAttributesCount),e}var lt=class{constructor(e={}){this.impl=new $u(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},$u=class extends er{convert(e){return(0,fp.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:hp(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return Ss(e)}};h();var Re=H(ie(),1);function Ep(r,e){return r.replace(/\{(?<temp1>[^{}]+)\}/g,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}var ir=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}enable(){this.disable();let{tracerProvider:e}=this;if(!e)return;let t=e.getTracer(this.instrumentationName,this.instrumentationVersion),n=this.config.ignoreUrls??[],i=(I,U)=>{if(U?.opentelemetry?.ignore!==void 0)return U.opentelemetry.ignore;if(n.length===0)return!1;let L=I.toString();return n.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))},s=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,o=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,a=this.config.propagateContextUrls??[],u=this.config.dontPropagateContextUrls??[],l=this.config.resourceNameTemplate,{attributesFromRequestHeaders:_,attributesFromResponseHeaders:E}=this.config,O=(I,U)=>{if(U?.opentelemetry?.propagateContext)return U.opentelemetry.propagateContext;let L=I.toString();return u.length>0&&u.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))?!1:s&&I.protocol==="https:"&&(I.host===s||I.host===o||I.host===Jt()?.headers.host)||!s&&I.protocol==="http:"&&I.hostname==="localhost"?!0:a.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))};process.env.NEXT_OTEL_FETCH_DISABLED="1";let D=globalThis.fetch;this.originalFetch=D;let z=async(I,U)=>{let L=U;if(L?.next?.internal)return D(I,L);let m=new Request(I instanceof Request?I.clone():I,L),be=new URL(m.url);if(i(be,L))return D(I,L);let ys={[Re.SemanticAttributes.HTTP_METHOD]:m.method,[Re.SemanticAttributes.HTTP_URL]:m.url,[Re.SemanticAttributes.HTTP_HOST]:be.host,[Re.SemanticAttributes.HTTP_SCHEME]:be.protocol.replace(":",""),[Re.SemanticAttributes.NET_PEER_NAME]:be.hostname,[Re.SemanticAttributes.NET_PEER_PORT]:be.port},dt=l?Ep(l,ys):LA(m.url),yp=L?.opentelemetry?.spanName??`fetch ${m.method} ${m.url}`,Qu=d.context.active(),q=t.startSpan(yp,{kind:d.SpanKind.CLIENT,attributes:{...ys,"operation.name":`fetch.${m.method}`,"resource.name":dt,...L?.opentelemetry?.attributes}},Qu);if(!q.isRecording()||!wr(q.spanContext().traceFlags))return q.end(),D(I,L);if(O(be,L)){let _t=d.trace.setSpan(Qu,q);d.propagation.inject(_t,m.headers,IA)}_&&mp(q,_,m.headers);try{let _t=Date.now(),Pe=await D(I,{...L,headers:m.headers}),vp=Date.now()-_t;return q.setAttribute(Re.SemanticAttributes.HTTP_STATUS_CODE,Pe.status),q.setAttribute("http.response_time",vp),E&&mp(q,E,Pe.headers),Pe.status>=500&&Wu(q,`Status: ${Pe.status} (${Pe.statusText})`),Pe.body?MA(Pe).then(vs=>{q.isRecording()&&(q.setAttribute(Re.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,vs),q.end())},vs=>{q.isRecording()&&(Wu(q,vs),q.end())}):q.end(),Pe}catch(_t){throw Wu(q,_t),q.end(),_t}};globalThis.fetch=z}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},IA={set(r,e,t){r.set(e,t)}};function LA(r){let e=r.indexOf("?");return e===-1?r:r.substring(0,e)}function MA(r){let e=0,n=r.clone().body?.getReader();if(!n)return Promise.resolve(0);let i=()=>n.read().then(({done:s,value:o})=>{if(!s)return e+=o.byteLength,i()});return i().then(()=>e)}function Wu(r,e){if(e instanceof Error)r.recordException(e),r.setStatus({code:d.SpanStatusCode.ERROR,message:e.message});else{let t=String(e);r.setStatus({code:d.SpanStatusCode.ERROR,message:t})}}function mp(r,e,t){for(let[n,i]of Object.entries(e)){let s=t.get(i);s!==null&&r.setAttribute(n,s)}}h();var gp=H(S(),1),CA="00",Ku="traceparent",zu="tracestate",qr=class{fields(){return[Ku,zu]}inject(e,t,n){let i=d.trace.getSpanContext(e);if(!i||(0,gp.isTracingSuppressed)(e)||!(0,d.isSpanContextValid)(i))return;let s=`${CA}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||0).toString(16)}`;n.set(t,Ku,s),i.traceState&&n.set(t,zu,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,Ku);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=NA(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,zu);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=(0,d.createTraceState)(typeof u=="string"?u:void 0)}return d.trace.setSpanContext(e,o)}};function NA(r){let[e,t,n,i,s]=r.split("-");return!e||!t||!n||!i||e.length!==2||t.length!==32||n.length!==16||i.length!==2||e==="00"&&s?null:{traceId:t,spanId:n,traceFlags:parseInt(i,16)}}var Ps=class{constructor(e={}){this.configuration=e}start(){let e=wA(),t=(0,ar.getEnvWithoutDefaults)(),n=this.configuration,i=process.env.NEXT_RUNTIME||"nodejs",s=!!e.OTEL_SDK_DISABLED;if(t.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:t.OTEL_LOG_LEVEL}),s)return;let o=n.idGenerator??new N.RandomIdGenerator,a=n.contextManager??new bp.AsyncLocalStorageContextManager;a.enable(),this.contextManager=a;let u=e.OTEL_SERVICE_NAME||n.serviceName||"app",l=new or.Resource(fs({[Yu.SemanticResourceAttributes.SERVICE_NAME]:u,"node.ci":process.env.CI?!0:void 0,"node.env":process.env.NODE_ENV,env:process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,"vercel.region":process.env.VERCEL_REGION,"vercel.runtime":i,"vercel.sha":process.env.VERCEL_GIT_COMMIT_SHA||process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,"vercel.host":process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||void 0,"vercel.branch_host":process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,"vercel.deployment_id":process.env.VERCEL_DEPLOYMENT_ID||void 0,[Yu.SemanticResourceAttributes.SERVICE_VERSION]:process.env.VERCEL_DEPLOYMENT_ID,...n.attributes})),_=n.resourceDetectors??[or.envDetectorSync];if(n.autoDetectResources??!0){let m={detectors:_};l=l.merge((0,or.detectResourcesSync)(m))}let O=DA(n.propagators,e),D=BA(n.traceSampler,e),z=UA(n.spanProcessors,n,e);z.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let I=n.spanLimits,U=new N.BasicTracerProvider({resource:l,idGenerator:o,sampler:D,spanLimits:I});if(U.addSpanProcessor(new Es(z,n.attributesFromHeaders)),U.register({contextManager:a,propagator:new Ve.CompositePropagator({propagators:O})}),this.tracerProvider=U,n.logRecordProcessor){let m=new Op.LoggerProvider({resource:l});this.loggerProvider=m,m.addLogRecordProcessor(n.logRecordProcessor),it.logs.setGlobalLoggerProvider(m)}if(n.metricReader||n.views){let m=new Rp.MeterProvider({resource:l,views:n.views??[]});n.metricReader&&m.addMetricReader(n.metricReader),d.metrics.setGlobalMeterProvider(m),this.meterProvider=m}let L=xA(n.instrumentations,n.instrumentationConfig);this.disableInstrumentations=(0,Ap.registerInstrumentations)({instrumentations:L}),d.diag.info("@vercel/otel: started",u,i)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),d.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:t}=this;t&&t()}};function wA(){let r=(0,ar.parseEnvironment)(process.env);return{...ar.DEFAULT_ENVIRONMENT,...r}}function xA(r,e){return(r??["auto"]).map(t=>t==="auto"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new ir(e?.fetch)]):t==="fetch"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new ir(e?.fetch)):t).flat()}function DA(r,e){let t=e.OTEL_PROPAGATORS&&e.OTEL_PROPAGATORS.length>0?e.OTEL_PROPAGATORS:void 0;return(r??t??["auto"]).map(n=>{if(n==="none")return[];if(n==="auto")return d.diag.debug("@vercel/otel: Configure propagators: tracecontext, baggage"),[new qr,new Ve.W3CBaggagePropagator];if(n==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new qr;if(n==="baggage")return d.diag.debug("@vercel/otel: Configure propagator: baggage"),new Ve.W3CBaggagePropagator;if(typeof n=="string")throw new Error(`Unknown propagator: "${n}"`);return n}).flat()}var Tp="always_on",sr=1;function BA(r,e){if(r&&typeof r!="string")return r;let t=r&&r!=="auto"?r:e.OTEL_TRACES_SAMPLER||Tp;switch(d.diag.debug("@vercel/otel: Configure sampler: ",t),t){case"always_on":return new N.AlwaysOnSampler;case"always_off":return new N.AlwaysOffSampler;case"parentbased_always_on":return new N.ParentBasedSampler({root:new N.AlwaysOnSampler});case"parentbased_always_off":return new N.ParentBasedSampler({root:new N.AlwaysOffSampler});case"traceidratio":return new N.TraceIdRatioBasedSampler(Sp(e));case"parentbased_traceidratio":return new N.ParentBasedSampler({root:new N.TraceIdRatioBasedSampler(Sp(e))});default:return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${Tp}".`),new N.AlwaysOnSampler}}function Sp(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${sr}.`),sr;d.diag.debug("@vercel/otel: Configure sampler probability: ",r.OTEL_TRACES_SAMPLER_ARG);let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${sr}.`),sr):e<0||e>1?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${sr}.`),sr):e}function UA(r,e,t){return[...(r??["auto"]).map(n=>{if(n==="auto"){if(process.env.VERCEL_OTEL_ENDPOINTS){let i=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",s=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";d.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",i,s);let o={url:`http://localhost:${i}/v1/traces`,headers:{}},a=s==="http/protobuf"?new lt(o):new tr(o);return new N.BatchSpanProcessor(a)}return!e.traceExporter||e.traceExporter==="auto"||t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||t.OTEL_EXPORTER_OTLP_ENDPOINT?new N.BatchSpanProcessor(qA(t)):void 0}return n}).filter(jA),...e.traceExporter&&e.traceExporter!=="auto"?[new N.BatchSpanProcessor(e.traceExporter)]:[]]}function qA(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=VA(r),n={...Ve.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_HEADERS),...Ve.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(d.diag.debug("@vercel/otel: Configure trace exporter: ",e,t,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new tr({url:t,headers:n});case"http/protobuf":return new lt({url:t,headers:n});default:return d.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new lt}}var Pp="v1/traces",GA=`http://localhost:4318/${Pp}`;function VA(r){let e=r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let t=r.OTEL_EXPORTER_OTLP_ENDPOINT;return t&&typeof t=="string"?`${t}/${Pp}`:GA}function jA(r){return r!=null}function hy(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new Ps(e).start()}export{ir as FetchInstrumentation,tr as OTLPHttpJsonTraceExporter,lt as OTLPHttpProtoTraceExporter,hy as registerOTel};
19
+ `,(0,so.getIncompatibilityDetails)(o,e),`To resolve the conflict:
20
+ `,(0,so.getConflictResolutionRecipe)(o,e))}return n}};ao.MetricStorageRegistry=fu});var $_=c(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.MultiMetricStorage=void 0;var Eu=class{constructor(e){this._backingStorages=e}record(e,t,n,i){this._backingStorages.forEach(o=>{o.record(e,t,n,i)})}};uo.MultiMetricStorage=Eu});var W_=c(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.BatchObservableResultImpl=er.ObservableResultImpl=void 0;var Jt=(p(),f(d)),X_=Dr(),bS=Ji(),mu=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new X_.AttributeHashMap}observe(e,t={}){if(typeof e!="number"){Jt.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Jt.ValueType.INT&&!Number.isInteger(e)&&(Jt.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}};er.ObservableResultImpl=mu;var gu=class{constructor(){this._buffer=new Map}observe(e,t,n={}){if(!(0,bS.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new X_.AttributeHashMap,this._buffer.set(e,i)),typeof t!="number"){Jt.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Jt.ValueType.INT&&!Number.isInteger(t)&&(Jt.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||i.set(n,t)}};er.BatchObservableResultImpl=gu});var Y_=c(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.ObservableRegistry=void 0;var PS=(p(),f(d)),K_=Ji(),z_=W_(),Ur=me(),Tu=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,t){let n=new Set(t.filter(K_.isObservableInstrument));if(n.size===0){PS.diag.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(K_.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await(0,Ur.PromiseAllSettled)([...n,...i])).filter(Ur.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let o=new z_.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),s=Promise.resolve(n(o));t!=null&&(s=(0,Ur.callWithTimeout)(s,t)),await s,i._metricStorages.forEach(a=>{a.record(o._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let o=new z_.BatchObservableResultImpl,s=Promise.resolve(n(o));t!=null&&(s=(0,Ur.callWithTimeout)(s,t)),await s,i.forEach(a=>{let u=o._buffer.get(a);u!=null&&a._metricStorages.forEach(l=>{l.record(u,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&(0,Ur.setEquals)(n.instruments,t))}};co.ObservableRegistry=Tu});var Q_=c(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.SyncMetricStorage=void 0;var yS=au(),vS=du(),IS=pu(),Su=class extends yS.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new vS.DeltaMetricProcessor(t),this._temporalMetricStorage=new IS.TemporalMetricProcessor(t,i)}record(e,t,n,i){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,i)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};lo.SyncMetricStorage=Su});var Ou=c(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.FilteringAttributesProcessor=De.NoopAttributesProcessor=De.AttributesProcessor=void 0;var Br=class{static Noop(){return LS}};De.AttributesProcessor=Br;var _o=class extends Br{process(e,t){return e}};De.NoopAttributesProcessor=_o;var Au=class extends Br{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};De.FilteringAttributesProcessor=Au;var LS=new _o});var Z_=c(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.MeterSharedState=void 0;var MS=Re(),CS=U_(),NS=me(),wS=B_(),xS=k_(),DS=$_(),US=Y_(),BS=Q_(),qS=Ou(),Ru=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new xS.MetricStorageRegistry,this.observableRegistry=new US.ObservableRegistry,this.meter=new CS.Meter(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,BS.SyncMetricStorage);return t.length===1?t[0]:new DS.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,wS.AsyncMetricStorage)}async collect(e,t,n){let i=await this.observableRegistry.observe(t,n?.timeoutMillis),o=this.metricStorageRegistry.getStorages(e);if(o.length===0)return null;let s=o.map(a=>a.collect(e,t)).filter(NS.isNotNullish);return s.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:s},errors:i}}_registerMetricStorage(e,t){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(o=>{let s=(0,MS.createInstrumentDescriptorWithView)(o,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(s);if(a!=null)return a;let u=o.aggregation.createAggregator(s),l=new t(s,u,o.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(l),l});if(i.length===0){let s=this._meterProviderSharedState.selectAggregations(e.type).map(([a,u])=>{let l=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(l!=null)return l;let _=u.createAggregator(e),E=new t(e,_,qS.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,E),E});i=i.concat(s)}return i}};po.MeterSharedState=Ru});var J_=c(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.MeterProviderSharedState=void 0;var GS=me(),VS=D_(),jS=Z_(),bu=class{constructor(e){this.resource=e,this.viewRegistry=new VS.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=(0,GS.instrumentationScopeId)(e),n=this.meterSharedStates.get(t);return n==null&&(n=new jS.MeterSharedState(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,n.selectAggregation(e)]);return t}};ho.MeterProviderSharedState=bu});var ep=c(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.MetricCollector=void 0;var FS=S(),Pu=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,FS.millisToHrTime)(Date.now()),n=[],i=[],o=Array.from(this._sharedState.meterSharedStates.values()).map(async s=>{let a=await s.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(o),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};fo.MetricCollector=Pu});var rp=c(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.MeterProvider=void 0;var Eo=(p(),f(d)),tp=it(),HS=J_(),kS=ep(),yu=class{constructor(e){var t;this._shutdown=!1;let n=tp.Resource.default().merge((t=e?.resource)!==null&&t!==void 0?t:tp.Resource.empty());if(this._sharedState=new HS.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i)}getMeter(e,t="",n={}){return this._shutdown?(Eo.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,Eo.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let t=new kS.MetricCollector(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){Eo.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){Eo.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};mo.MeterProvider=yu});var go=c(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.ExactPredicate=tr.PatternPredicate=void 0;var $S=/[\^$\\.+?()[\]{}|]/g,vu=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace($S,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};tr.PatternPredicate=vu;var Iu=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};tr.ExactPredicate=Iu});var ip=c(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.InstrumentSelector=void 0;var np=go(),Lu=class{constructor(e){var t;this._nameFilter=new np.PatternPredicate((t=e?.name)!==null&&t!==void 0?t:"*"),this._type=e?.type,this._unitFilter=new np.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};To.InstrumentSelector=Lu});var op=c(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.MeterSelector=void 0;var Mu=go(),Cu=class{constructor(e){this._nameFilter=new Mu.ExactPredicate(e?.name),this._versionFilter=new Mu.ExactPredicate(e?.version),this._schemaUrlFilter=new Mu.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};So.MeterSelector=Cu});var ap=c(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.View=void 0;var XS=go(),sp=Ou(),WS=ip(),KS=op(),zS=$i();function YS(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var Nu=class{constructor(e){var t;if(YS(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||XS.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new sp.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=sp.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:zS.Aggregation.Default(),this.instrumentSelector=new WS.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new KS.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};Ao.View=Nu});var wu=c(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.TimeoutError=g.View=g.Aggregation=g.SumAggregation=g.LastValueAggregation=g.HistogramAggregation=g.DropAggregation=g.ExponentialHistogramAggregation=g.ExplicitBucketHistogramAggregation=g.DefaultAggregation=g.MeterProvider=g.InstrumentType=g.ConsoleMetricExporter=g.InMemoryMetricExporter=g.PeriodicExportingMetricReader=g.MetricReader=g.DataPointType=g.AggregationTemporality=void 0;var QS=Ci();Object.defineProperty(g,"AggregationTemporality",{enumerable:!0,get:function(){return QS.AggregationTemporality}});var ZS=Dt();Object.defineProperty(g,"DataPointType",{enumerable:!0,get:function(){return ZS.DataPointType}});var JS=Ka();Object.defineProperty(g,"MetricReader",{enumerable:!0,get:function(){return JS.MetricReader}});var eA=M_();Object.defineProperty(g,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return eA.PeriodicExportingMetricReader}});var tA=N_();Object.defineProperty(g,"InMemoryMetricExporter",{enumerable:!0,get:function(){return tA.InMemoryMetricExporter}});var rA=x_();Object.defineProperty(g,"ConsoleMetricExporter",{enumerable:!0,get:function(){return rA.ConsoleMetricExporter}});var nA=Re();Object.defineProperty(g,"InstrumentType",{enumerable:!0,get:function(){return nA.InstrumentType}});var iA=rp();Object.defineProperty(g,"MeterProvider",{enumerable:!0,get:function(){return iA.MeterProvider}});var Ue=$i();Object.defineProperty(g,"DefaultAggregation",{enumerable:!0,get:function(){return Ue.DefaultAggregation}});Object.defineProperty(g,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return Ue.ExplicitBucketHistogramAggregation}});Object.defineProperty(g,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return Ue.ExponentialHistogramAggregation}});Object.defineProperty(g,"DropAggregation",{enumerable:!0,get:function(){return Ue.DropAggregation}});Object.defineProperty(g,"HistogramAggregation",{enumerable:!0,get:function(){return Ue.HistogramAggregation}});Object.defineProperty(g,"LastValueAggregation",{enumerable:!0,get:function(){return Ue.LastValueAggregation}});Object.defineProperty(g,"SumAggregation",{enumerable:!0,get:function(){return Ue.SumAggregation}});Object.defineProperty(g,"Aggregation",{enumerable:!0,get:function(){return Ue.Aggregation}});var oA=ap();Object.defineProperty(g,"View",{enumerable:!0,get:function(){return oA.View}});var sA=me();Object.defineProperty(g,"TimeoutError",{enumerable:!0,get:function(){return sA.TimeoutError}})});var up=c(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.AbstractAsyncHooksContextManager=void 0;var aA=ee("events"),uA=["addListener","on","once","prependListener","prependOnceListener"],xu=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof aA.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let n=this,i=function(...o){return n.with(e,()=>t.apply(this,o))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),uA.forEach(i=>{t[i]!==void 0&&(t[i]=this._patchAddListener(t,t[i],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let n=this;return function(i,o){var s;let a=(s=n._getPatchMap(e))===null||s===void 0?void 0:s[i];if(a===void 0)return t.call(this,i,o);let u=a.get(o);return t.call(this,i,u||o)}}_patchRemoveAllListeners(e,t){let n=this;return function(i){let o=n._getPatchMap(e);return o!==void 0&&(arguments.length===0?n._createPatchMap(e):o[i]!==void 0&&delete o[i]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let i=this;return function(o,s){if(i._wrapped)return t.call(this,o,s);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let u=a[o];u===void 0&&(u=new WeakMap,a[o]=u);let l=i.bind(n,s);u.set(s,l),i._wrapped=!0;try{return t.call(this,o,l)}finally{i._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Oo.AbstractAsyncHooksContextManager=xu});var cp=c(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.AsyncLocalStorageContextManager=void 0;var cA=(p(),f(d)),lA=ee("async_hooks"),dA=up(),Du=class extends dA.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new lA.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:cA.ROOT_CONTEXT}with(e,t,n,...i){let o=n==null?t:t.bind(n);return this._asyncLocalStorage.run(e,o,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};Ro.AsyncLocalStorageContextManager=Du});var Gr=c(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.toAnyValue=Be.toKeyValue=Be.toAttributes=void 0;function mA(r){return Object.keys(r).map(e=>Bu(e,r[e]))}Be.toAttributes=mA;function Bu(r,e){return{key:r,value:qu(e)}}Be.toKeyValue=Bu;function qu(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(qu)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,n])=>Bu(t,n))}}:{}}Be.toAnyValue=qu});var fp=c(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.toOtlpSpanEvent=qe.toOtlpLink=qe.sdkSpanToOtlpSpan=void 0;var Gu=Gr();function gA(r,e){var t;let n=r.spanContext(),i=r.status;return{traceId:e.encodeSpanContext(n.traceId),spanId:e.encodeSpanContext(n.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=n.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:(0,Gu.toAttributes)(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(o=>hp(o,e)),droppedEventsCount:r.droppedEventsCount,status:{code:i.code,message:i.message},links:r.links.map(o=>pp(o,e)),droppedLinksCount:r.droppedLinksCount}}qe.sdkSpanToOtlpSpan=gA;function pp(r,e){var t;return{attributes:r.attributes?(0,Gu.toAttributes)(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}qe.toOtlpLink=pp;function hp(r,e){return{attributes:r.attributes?(0,Gu.toAttributes)(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}qe.toOtlpSpanEvent=hp});var Vr=c(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.getOtlpEncoder=ae.encodeAsString=ae.encodeAsLongBits=ae.toLongBits=ae.hrTimeToNanos=void 0;var yo=S(),TA=BigInt(1e9);function Vu(r){return BigInt(r[0])*TA+BigInt(r[1])}ae.hrTimeToNanos=Vu;function mp(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}ae.toLongBits=mp;function ju(r){let e=Vu(r);return mp(e)}ae.encodeAsLongBits=ju;function gp(r){return Vu(r).toString()}ae.encodeAsString=gp;var SA=typeof BigInt<"u"?gp:yo.hrTimeToNanoseconds;function Ep(r){return r}function Tp(r){if(r!==void 0)return(0,yo.hexToBase64)(r)}var AA={encodeHrTime:ju,encodeSpanContext:yo.hexToBase64,encodeOptionalSpanContext:Tp};function OA(r){var e,t;if(r===void 0)return AA;let n=(e=r.useLongBits)!==null&&e!==void 0?e:!0,i=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:n?ju:SA,encodeSpanContext:i?Ep:yo.hexToBase64,encodeOptionalSpanContext:i?Ep:Tp}}ae.getOtlpEncoder=OA});var Io=c(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.createExportTraceServiceRequest=void 0;var RA=Gr(),bA=fp(),PA=Vr();function yA(r,e){let t=(0,PA.getOtlpEncoder)(e);return{resourceSpans:IA(r,t)}}vo.createExportTraceServiceRequest=yA;function vA(r){let e=new Map;for(let t of r){let n=e.get(t.resource);n||(n=new Map,e.set(t.resource,n));let i=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,o=n.get(i);o||(o=[],n.set(i,o)),o.push(t)}return e}function IA(r,e){let t=vA(r),n=[],i=t.entries(),o=i.next();for(;!o.done;){let[s,a]=o.value,u=[],l=a.values(),_=l.next();for(;!_.done;){let O=_.value;if(O.length>0){let{name:D,version:Y,schemaUrl:L}=O[0].instrumentationLibrary,B=O.map(P=>(0,bA.sdkSpanToOtlpSpan)(P,e));u.push({scope:{name:D,version:Y},spans:B,schemaUrl:L})}_=l.next()}let E={resource:{attributes:(0,RA.toAttributes)(s.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(E),o=i.next()}return n}});var Op=c(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.parseRetryAfterToMills=C.isExportRetryable=C.invalidTimeout=C.configureExporterTimeout=C.appendRootPathToUrlIfNeeded=C.appendResourcePathToUrl=C.parseHeaders=C.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=C.DEFAULT_EXPORT_MAX_BACKOFF=C.DEFAULT_EXPORT_INITIAL_BACKOFF=C.DEFAULT_EXPORT_MAX_ATTEMPTS=void 0;var Fu=(p(),f(d)),Sp=S(),Ap=1e4;C.DEFAULT_EXPORT_MAX_ATTEMPTS=5;C.DEFAULT_EXPORT_INITIAL_BACKOFF=1e3;C.DEFAULT_EXPORT_MAX_BACKOFF=5e3;C.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=1.5;function LA(r={}){let e={};return Object.entries(r).forEach(([t,n])=>{typeof n<"u"?e[t]=String(n):Fu.diag.warn(`Header "${t}" has wrong value and will be ignored`)}),e}C.parseHeaders=LA;function MA(r,e){return r.endsWith("/")||(r=r+"/"),r+e}C.appendResourcePathToUrl=MA;function CA(r){try{let e=new URL(r);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return Fu.diag.warn(`Could not parse export URL: '${r}'`),r}}C.appendRootPathToUrlIfNeeded=CA;function NA(r){return typeof r=="number"?r<=0?Hu(r,Ap):r:wA()}C.configureExporterTimeout=NA;function wA(){var r;let e=Number((r=(0,Sp.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&r!==void 0?r:(0,Sp.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?Hu(e,Ap):e}function Hu(r,e){return Fu.diag.warn("Timeout must be greater than 0",r),e}C.invalidTimeout=Hu;function xA(r){return[429,502,503,504].includes(r)}C.isExportRetryable=xA;function DA(r){if(r==null)return-1;let e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let t=new Date(r).getTime()-Date.now();return t>=0?t:0}C.parseRetryAfterToMills=DA});var bp=c(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.OTLPExporterBase=void 0;var Rp=(p(),f(d)),jr=S(),UA=Op(),ku=class{constructor(e={}){this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new jr.BindOnceFuture(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:30,this.timeoutMillis=(0,UA.configureExporterTimeout)(e.timeoutMillis),this.onInit(e)}export(e,t){if(this._shutdownOnce.isCalled){t({code:jr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:jr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:jr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:jr.ExportResultCode.FAILED,error:n})})}_export(e){return new Promise((t,n)=>{try{Rp.diag.debug("items to be sent",e),this.send(e,t,n)}catch(i){n(i)}})}shutdown(){return this._shutdownOnce.call()}forceFlush(){return Promise.all(this._sendingPromises).then(()=>{})}_shutdown(){return Rp.diag.debug("shutdown started"),this.onShutdown(),this.forceFlush()}};Lo.OTLPExporterBase=ku});var Ip=c((Oy,vp)=>{"use strict";vp.exports=GA;function GA(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(a,u){t[n]=function(_){if(o)if(o=!1,_)u(_);else{for(var E=new Array(arguments.length-1),O=0;O<E.length;)E[O++]=arguments[O];a.apply(null,E)}};try{r.apply(e||null,t)}catch(l){o&&(o=!1,u(l))}})}});var Np=c(Cp=>{"use strict";var Co=Cp;Co.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)==="=";)++n;return Math.ceil(e.length*3)/4-n};var ir=new Array(64),Mp=new Array(123);for(de=0;de<64;)Mp[ir[de]=de<26?de+65:de<52?de+71:de<62?de-4:de-59|43]=de++;var de;Co.encode=function(e,t,n){for(var i=null,o=[],s=0,a=0,u;t<n;){var l=e[t++];switch(a){case 0:o[s++]=ir[l>>2],u=(l&3)<<4,a=1;break;case 1:o[s++]=ir[u|l>>4],u=(l&15)<<2,a=2;break;case 2:o[s++]=ir[u|l>>6],o[s++]=ir[l&63],a=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=ir[u],o[s++]=61,a===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var Lp="invalid encoding";Co.decode=function(e,t,n){for(var i=n,o=0,s,a=0;a<e.length;){var u=e.charCodeAt(a++);if(u===61&&o>1)break;if((u=Mp[u])===void 0)throw Error(Lp);switch(o){case 0:s=u,o=1;break;case 1:t[n++]=s<<2|(u&48)>>4,s=u,o=2;break;case 2:t[n++]=(s&15)<<4|(u&60)>>2,s=u,o=3;break;case 3:t[n++]=(s&3)<<6|u,o=0;break}}if(o===1)throw Error(Lp);return n-i};Co.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var xp=c((by,wp)=>{"use strict";wp.exports=No;function No(){this._listeners={}}No.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};No.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};No.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var jp=c((Py,Vp)=>{"use strict";Vp.exports=Dp(Dp);function Dp(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(u,l,_){e[0]=u,l[_]=t[0],l[_+1]=t[1],l[_+2]=t[2],l[_+3]=t[3]}function o(u,l,_){e[0]=u,l[_]=t[3],l[_+1]=t[2],l[_+2]=t[1],l[_+3]=t[0]}r.writeFloatLE=n?i:o,r.writeFloatBE=n?o:i;function s(u,l){return t[0]=u[l],t[1]=u[l+1],t[2]=u[l+2],t[3]=u[l+3],e[0]}function a(u,l){return t[3]=u[l],t[2]=u[l+1],t[1]=u[l+2],t[0]=u[l+3],e[0]}r.readFloatLE=n?s:a,r.readFloatBE=n?a:s}():function(){function e(n,i,o,s){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var u=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-u)*8388608)&8388607;n((a<<31|u+127<<23|l)>>>0,o,s)}}r.writeFloatLE=e.bind(null,Up),r.writeFloatBE=e.bind(null,Bp);function t(n,i,o){var s=n(i,o),a=(s>>31)*2+1,u=s>>>23&255,l=s&8388607;return u===255?l?NaN:a*(1/0):u===0?a*1401298464324817e-60*l:a*Math.pow(2,u-150)*(l+8388608)}r.readFloatLE=t.bind(null,qp),r.readFloatBE=t.bind(null,Gp)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(u,l,_){e[0]=u,l[_]=t[0],l[_+1]=t[1],l[_+2]=t[2],l[_+3]=t[3],l[_+4]=t[4],l[_+5]=t[5],l[_+6]=t[6],l[_+7]=t[7]}function o(u,l,_){e[0]=u,l[_]=t[7],l[_+1]=t[6],l[_+2]=t[5],l[_+3]=t[4],l[_+4]=t[3],l[_+5]=t[2],l[_+6]=t[1],l[_+7]=t[0]}r.writeDoubleLE=n?i:o,r.writeDoubleBE=n?o:i;function s(u,l){return t[0]=u[l],t[1]=u[l+1],t[2]=u[l+2],t[3]=u[l+3],t[4]=u[l+4],t[5]=u[l+5],t[6]=u[l+6],t[7]=u[l+7],e[0]}function a(u,l){return t[7]=u[l],t[6]=u[l+1],t[5]=u[l+2],t[4]=u[l+3],t[3]=u[l+4],t[2]=u[l+5],t[1]=u[l+6],t[0]=u[l+7],e[0]}r.readDoubleLE=n?s:a,r.readDoubleBE=n?a:s}():function(){function e(n,i,o,s,a,u){var l=s<0?1:0;if(l&&(s=-s),s===0)n(0,a,u+i),n(1/s>0?0:2147483648,a,u+o);else if(isNaN(s))n(0,a,u+i),n(2146959360,a,u+o);else if(s>17976931348623157e292)n(0,a,u+i),n((l<<31|2146435072)>>>0,a,u+o);else{var _;if(s<22250738585072014e-324)_=s/5e-324,n(_>>>0,a,u+i),n((l<<31|_/4294967296)>>>0,a,u+o);else{var E=Math.floor(Math.log(s)/Math.LN2);E===1024&&(E=1023),_=s*Math.pow(2,-E),n(_*4503599627370496>>>0,a,u+i),n((l<<31|E+1023<<20|_*1048576&1048575)>>>0,a,u+o)}}}r.writeDoubleLE=e.bind(null,Up,0,4),r.writeDoubleBE=e.bind(null,Bp,4,0);function t(n,i,o,s,a){var u=n(s,a+i),l=n(s,a+o),_=(l>>31)*2+1,E=l>>>20&2047,O=4294967296*(l&1048575)+u;return E===2047?O?NaN:_*(1/0):E===0?_*5e-324*O:_*Math.pow(2,E-1075)*(O+4503599627370496)}r.readDoubleLE=t.bind(null,qp,0,4),r.readDoubleBE=t.bind(null,Gp,4,0)}(),r}function Up(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Bp(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function qp(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function Gp(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var Fp=c((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var kp=c(Hp=>{"use strict";var Xu=Hp;Xu.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};Xu.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var o=null,s=[],a=0,u;t<n;)u=e[t++],u<128?s[a++]=u:u>191&&u<224?s[a++]=(u&31)<<6|e[t++]&63:u>239&&u<365?(u=((u&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,s[a++]=55296+(u>>10),s[a++]=56320+(u&1023)):s[a++]=(u&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};Xu.write=function(e,t,n){for(var i=n,o,s,a=0;a<e.length;++a)o=e.charCodeAt(a),o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=o&63|128):(o&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++a,t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=o&63|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=o&63|128);return n-i}});var Xp=c((vy,$p)=>{"use strict";$p.exports=VA;function VA(r,e,t){var n=t||8192,i=n>>>1,o=null,s=n;return function(u){if(u<1||u>i)return r(u);s+u>n&&(o=r(n),s=0);var l=e.call(o,s,s+=u);return s&7&&(s=(s|7)+1),l}}});var Kp=c((Iy,Wp)=>{"use strict";Wp.exports=j;var Fr=Ve();function j(r,e){this.lo=r>>>0,this.hi=e>>>0}var dt=j.zero=new j(0,0);dt.toNumber=function(){return 0};dt.zzEncode=dt.zzDecode=function(){return this};dt.length=function(){return 1};var jA=j.zeroHash="\0\0\0\0\0\0\0\0";j.fromNumber=function(e){if(e===0)return dt;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new j(n,i)};j.from=function(e){if(typeof e=="number")return j.fromNumber(e);if(Fr.isString(e))if(Fr.Long)e=Fr.Long.fromString(e);else return j.fromNumber(parseInt(e,10));return e.low||e.high?new j(e.low>>>0,e.high>>>0):dt};j.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296};j.prototype.toLong=function(e){return Fr.Long?new Fr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Ge=String.prototype.charCodeAt;j.fromHash=function(e){return e===jA?dt:new j((Ge.call(e,0)|Ge.call(e,1)<<8|Ge.call(e,2)<<16|Ge.call(e,3)<<24)>>>0,(Ge.call(e,4)|Ge.call(e,5)<<8|Ge.call(e,6)<<16|Ge.call(e,7)<<24)>>>0)};j.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};j.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};j.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};j.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}});var Ve=c(Wu=>{"use strict";var h=Wu;h.asPromise=Ip();h.base64=Np();h.EventEmitter=xp();h.float=jp();h.inquire=Fp();h.utf8=kp();h.pool=Xp();h.LongBits=Kp();h.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);h.global=h.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||Wu;h.emptyArray=Object.freeze?Object.freeze([]):[];h.emptyObject=Object.freeze?Object.freeze({}):{};h.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};h.isString=function(e){return typeof e=="string"||e instanceof String};h.isObject=function(e){return e&&typeof e=="object"};h.isset=h.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};h.Buffer=function(){try{var r=h.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();h._Buffer_from=null;h._Buffer_allocUnsafe=null;h.newBuffer=function(e){return typeof e=="number"?h.Buffer?h._Buffer_allocUnsafe(e):new h.Array(e):h.Buffer?h._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};h.Array=typeof Uint8Array<"u"?Uint8Array:Array;h.Long=h.global.dcodeIO&&h.global.dcodeIO.Long||h.global.Long||h.inquire("long");h.key2Re=/^true|false|0|1$/;h.key32Re=/^-?(?:0|[1-9][0-9]*)$/;h.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;h.longToHash=function(e){return e?h.LongBits.from(e).toHash():h.LongBits.zeroHash};h.longFromHash=function(e,t){var n=h.LongBits.fromHash(e);return h.Long?h.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)};function zp(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}h.merge=zp;h.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function Yp(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&zp(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}h.newError=Yp;h.ProtocolError=Yp("ProtocolError");h.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(t[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};h.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};h.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};h._configure=function(){var r=h.Buffer;if(!r){h._Buffer_from=h._Buffer_allocUnsafe=null;return}h._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},h._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var ec=c((My,eh)=>{"use strict";eh.exports=A;var ue=Ve(),Ku,wo=ue.LongBits,Qp=ue.base64,Zp=ue.utf8;function Hr(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Yu(){}function FA(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function A(){this.len=0,this.head=new Hr(Yu,0,0),this.tail=this.head,this.states=null}var Jp=function(){return ue.Buffer?function(){return(A.create=function(){return new Ku})()}:function(){return new A}};A.create=Jp();A.alloc=function(e){return new ue.Array(e)};ue.Array!==Array&&(A.alloc=ue.pool(A.alloc,ue.Array.prototype.subarray));A.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Hr(e,t,n),this.len+=t,this};function Qu(r,e,t){e[t]=r&255}function HA(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function Zu(r,e){this.len=r,this.next=void 0,this.val=e}Zu.prototype=Object.create(Hr.prototype);Zu.prototype.fn=HA;A.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Zu((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};A.prototype.int32=function(e){return e<0?this._push(Ju,10,wo.fromNumber(e)):this.uint32(e)};A.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function Ju(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}A.prototype.uint64=function(e){var t=wo.from(e);return this._push(Ju,t.length(),t)};A.prototype.int64=A.prototype.uint64;A.prototype.sint64=function(e){var t=wo.from(e).zzEncode();return this._push(Ju,t.length(),t)};A.prototype.bool=function(e){return this._push(Qu,1,e?1:0)};function zu(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}A.prototype.fixed32=function(e){return this._push(zu,4,e>>>0)};A.prototype.sfixed32=A.prototype.fixed32;A.prototype.fixed64=function(e){var t=wo.from(e);return this._push(zu,4,t.lo)._push(zu,4,t.hi)};A.prototype.sfixed64=A.prototype.fixed64;A.prototype.float=function(e){return this._push(ue.float.writeFloatLE,4,e)};A.prototype.double=function(e){return this._push(ue.float.writeDoubleLE,8,e)};var kA=ue.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};A.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Qu,1,0);if(ue.isString(e)){var n=A.alloc(t=Qp.length(e));Qp.decode(e,n,0),e=n}return this.uint32(t)._push(kA,t,e)};A.prototype.string=function(e){var t=Zp.length(e);return t?this.uint32(t)._push(Zp.write,t,e):this._push(Qu,1,0)};A.prototype.fork=function(){return this.states=new FA(this),this.head=this.tail=new Hr(Yu,0,0),this.len=0,this};A.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Hr(Yu,0,0),this.len=0),this};A.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this};A.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t};A._configure=function(r){Ku=r,A.create=Jp(),Ku._configure()}});var nh=c((Cy,rh)=>{"use strict";rh.exports=Se;var th=ec();(Se.prototype=Object.create(th.prototype)).constructor=Se;var je=Ve();function Se(){th.call(this)}Se._configure=function(){Se.alloc=je._Buffer_allocUnsafe,Se.writeBytesBuffer=je.Buffer&&je.Buffer.prototype instanceof Uint8Array&&je.Buffer.prototype.set.name==="set"?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i<e.length;)t[n++]=e[i++]}};Se.prototype.bytes=function(e){je.isString(e)&&(e=je._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Se.writeBytesBuffer,t,e),this};function $A(r,e,t){r.length<40?je.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Se.prototype.string=function(e){var t=je.Buffer.byteLength(e);return this.uint32(t),t&&this._push($A,t,e),this};Se._configure()});var nc=c((Ny,uh)=>{"use strict";uh.exports=w;var _e=Ve(),rc,sh=_e.LongBits,XA=_e.utf8;function pe(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function w(r){this.buf=r,this.pos=0,this.len=r.length}var ih=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new w(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new w(e);throw Error("illegal buffer")},ah=function(){return _e.Buffer?function(t){return(w.create=function(i){return _e.Buffer.isBuffer(i)?new rc(i):ih(i)})(t)}:ih};w.create=ah();w.prototype._slice=_e.Array.prototype.subarray||_e.Array.prototype.slice;w.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,pe(this,10);return e}}();w.prototype.int32=function(){return this.uint32()|0};w.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function tc(){var r=new sh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw pe(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw pe(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}w.prototype.bool=function(){return this.uint32()!==0};function xo(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}w.prototype.fixed32=function(){if(this.pos+4>this.len)throw pe(this,4);return xo(this.buf,this.pos+=4)};w.prototype.sfixed32=function(){if(this.pos+4>this.len)throw pe(this,4);return xo(this.buf,this.pos+=4)|0};function oh(){if(this.pos+8>this.len)throw pe(this,8);return new sh(xo(this.buf,this.pos+=4),xo(this.buf,this.pos+=4))}w.prototype.float=function(){if(this.pos+4>this.len)throw pe(this,4);var e=_e.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};w.prototype.double=function(){if(this.pos+8>this.len)throw pe(this,4);var e=_e.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};w.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw pe(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=_e.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)};w.prototype.string=function(){var e=this.bytes();return XA.read(e,0,e.length)};w.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw pe(this,e);this.pos+=e}else do if(this.pos>=this.len)throw pe(this);while(this.buf[this.pos++]&128);return this};w.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};w._configure=function(r){rc=r,w.create=ah(),rc._configure();var e=_e.Long?"toLong":"toNumber";_e.merge(w.prototype,{int64:function(){return tc.call(this)[e](!1)},uint64:function(){return tc.call(this)[e](!0)},sint64:function(){return tc.call(this).zzDecode()[e](!1)},fixed64:function(){return oh.call(this)[e](!0)},sfixed64:function(){return oh.call(this)[e](!1)}})}});var _h=c((wy,dh)=>{"use strict";dh.exports=_t;var lh=nc();(_t.prototype=Object.create(lh.prototype)).constructor=_t;var ch=Ve();function _t(r){lh.call(this,r)}_t._configure=function(){ch.Buffer&&(_t.prototype._slice=ch.Buffer.prototype.slice)};_t.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};_t._configure()});var hh=c((xy,ph)=>{"use strict";ph.exports=kr;var ic=Ve();(kr.prototype=Object.create(ic.EventEmitter.prototype)).constructor=kr;function kr(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");ic.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}kr.prototype.rpcCall=function r(e,t,n,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return ic.asPromise(r,s,e,t,n,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(e,t[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,l){if(u)return s.emit("error",u,e),o(u);if(l===null){s.end(!0);return}if(!(l instanceof n))try{l=n[s.responseDelimited?"decodeDelimited":"decode"](l)}catch(_){return s.emit("error",_,e),o(_)}return s.emit("data",l,e),o(null,l)})}catch(a){s.emit("error",a,e),setTimeout(function(){o(a)},0);return}};kr.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var Eh=c(fh=>{"use strict";var WA=fh;WA.Service=hh()});var gh=c((Uy,mh)=>{"use strict";mh.exports={}});var Ah=c(Sh=>{"use strict";var J=Sh;J.build="minimal";J.Writer=ec();J.BufferWriter=nh();J.Reader=nc();J.BufferReader=_h();J.util=Ve();J.rpc=Eh();J.roots=gh();J.configure=Th;function Th(){J.util._configure(),J.Writer._configure(J.BufferWriter),J.Reader._configure(J.BufferReader)}Th()});var Rh=c((qy,Oh)=>{"use strict";Oh.exports=Ah()});var Nh=c(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0})});var xh=c(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0})});var Uh=c(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0})});var Bh=c(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.ESpanKind=void 0;var lO;(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",r[r.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",r[r.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",r[r.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",r[r.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",r[r.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"})(lO=Xr.ESpanKind||(Xr.ESpanKind={}))});var Gh=c(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0})});var kh=c(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.toMetric=Fe.toScopeMetrics=Fe.toResourceMetrics=void 0;var Vh=(p(),f(d)),ar=wu(),Uo=Gr(),dO=Vr();function _O(r,e){let t=(0,dO.getOtlpEncoder)(e);return{resource:{attributes:(0,Uo.toAttributes)(r.resource.attributes),droppedAttributesCount:0},schemaUrl:void 0,scopeMetrics:Fh(r.scopeMetrics,t)}}Fe.toResourceMetrics=_O;function Fh(r,e){return Array.from(r.map(t=>({scope:{name:t.scope.name,version:t.scope.version},metrics:t.metrics.map(n=>Hh(n,e)),schemaUrl:t.scope.schemaUrl})))}Fe.toScopeMetrics=Fh;function Hh(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},n=EO(r.aggregationTemporality);switch(r.dataPointType){case ar.DataPointType.SUM:t.sum={aggregationTemporality:n,isMonotonic:r.isMonotonic,dataPoints:jh(r,e)};break;case ar.DataPointType.GAUGE:t.gauge={dataPoints:jh(r,e)};break;case ar.DataPointType.HISTOGRAM:t.histogram={aggregationTemporality:n,dataPoints:hO(r,e)};break;case ar.DataPointType.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:n,dataPoints:fO(r,e)};break}return t}Fe.toMetric=Hh;function pO(r,e,t){let n={attributes:(0,Uo.toAttributes)(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case Vh.ValueType.INT:n.asInt=r.value;break;case Vh.ValueType.DOUBLE:n.asDouble=r.value;break}return n}function jh(r,e){return r.dataPoints.map(t=>pO(t,r.descriptor.valueType,e))}function hO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Uo.toAttributes)(t.attributes),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function fO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Uo.toAttributes)(t.attributes),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function EO(r){switch(r){case ar.AggregationTemporality.DELTA:return 1;case ar.AggregationTemporality.CUMULATIVE:return 2}}});var $h=c(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.createExportMetricsServiceRequest=void 0;var mO=kh();function gO(r,e){return{resourceMetrics:r.map(t=>(0,mO.toResourceMetrics)(t,e))}}Bo.createExportMetricsServiceRequest=gO});var Wh=c(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.toLogAttributes=ur.createExportLogsServiceRequest=void 0;var TO=Vr(),cc=Gr();function SO(r,e){let t=(0,TO.getOtlpEncoder)(e);return{resourceLogs:OO(r,t)}}ur.createExportLogsServiceRequest=SO;function AO(r){let e=new Map;for(let t of r){let{resource:n,instrumentationScope:{name:i,version:o="",schemaUrl:s=""}}=t,a=e.get(n);a||(a=new Map,e.set(n,a));let u=`${i}@${o}:${s}`,l=a.get(u);l||(l=[],a.set(u,l)),l.push(t)}return e}function OO(r,e){let t=AO(r);return Array.from(t,([n,i])=>({resource:{attributes:(0,cc.toAttributes)(n.attributes),droppedAttributesCount:0},scopeLogs:Array.from(i,([,o])=>{let{instrumentationScope:{name:s,version:a,schemaUrl:u}}=o[0];return{scope:{name:s,version:a},logRecords:o.map(l=>RO(l,e)),schemaUrl:u}}),schemaUrl:void 0}))}function RO(r,e){var t,n,i;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:(0,cc.toAnyValue)(r.body),attributes:Xh(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((n=r.spanContext)===null||n===void 0?void 0:n.traceId),spanId:e.encodeOptionalSpanContext((i=r.spanContext)===null||i===void 0?void 0:i.spanId)}}function Xh(r){return Object.keys(r).map(e=>(0,cc.toKeyValue)(e,r[e]))}ur.toLogAttributes=Xh});var Kh=c(F=>{"use strict";var bO=F&&F.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),cr=F&&F.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bO(e,r,t)};Object.defineProperty(F,"__esModule",{value:!0});F.createExportLogsServiceRequest=F.createExportMetricsServiceRequest=F.createExportTraceServiceRequest=void 0;cr(Nh(),F);cr(Vr(),F);cr(xh(),F);cr(Uh(),F);cr(Bh(),F);cr(Gh(),F);var PO=Io();Object.defineProperty(F,"createExportTraceServiceRequest",{enumerable:!0,get:function(){return PO.createExportTraceServiceRequest}});var yO=$h();Object.defineProperty(F,"createExportMetricsServiceRequest",{enumerable:!0,get:function(){return yO.createExportMetricsServiceRequest}});var vO=Wh();Object.defineProperty(F,"createExportLogsServiceRequest",{enumerable:!0,get:function(){return vO.createExportLogsServiceRequest}})});var N=G(la(),1);p();fa();var Zh=G(Vd(),1),dr=G(it(),1),Jh=G(r_(),1),ef=G(wu(),1),lc=G(oe(),1),_r=G(Zr(),1),tf=G(cp(),1),He=G(S(),1);p();var _A=Symbol.for("@vercel/request-context");function Te(){return globalThis[_A]?.get()}var Uu=G(oe(),1);function bo(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>t!==void 0))}function lp(r){return r?r.split("::").at(-1):void 0}function dp(r=Te(),e){if(!r)return;let t=e?hA(e,r.headers):void 0;return bo({[Uu.SemanticAttributes.HTTP_HOST]:r.headers.host,[Uu.SemanticAttributes.HTTP_USER_AGENT]:r.headers["user-agent"],"http.referer":r.headers.referer,"vercel.request_id":lp(r.headers["x-vercel-id"]),"vercel.matched_path":r.headers["x-matched-path"],"vercel.edge_region":process.env.VERCEL_REGION,...t})}var pA={keys(r){return[]},get(r,e){return r[e.toLocaleLowerCase()]}};function hA(r,e){if(typeof r=="function")return r(e,pA);let t={};for(let[n,i]of Object.entries(r)){let o=e[i.toLocaleLowerCase()];o!==void 0&&(t[n]=o)}return t}p();function qr(r){return(r&d.TraceFlags.SAMPLED)!==0}var Po=class{constructor(e,t){this.processors=e;this.attributesFromHeaders=t;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(t=>{d.diag.error("@vercel/otel: forceFlush failed:",t)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,t){let{traceId:n,spanId:i,traceFlags:o}=e.spanContext(),s=!e.parentSpanId||!this.rootSpanIds.has(n);if(s?this.rootSpanIds.set(n,{rootSpanId:i,open:[]}):this.rootSpanIds.get(n)?.open.push(e),s&&qr(o)){let a=Te(),u=dp(a,this.attributesFromHeaders);u&&e.setAttributes(u),a&&a.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let l=new Promise(E=>{this.waitSpanEnd.set(n,E)}),_;await Promise.race([l,new Promise(E=>{_=setTimeout(()=>{this.waitSpanEnd.delete(n),E(void 0)},50)})]),_&&clearTimeout(_)}return this.forceFlush()})}for(let a of this.processors)a.onStart(e,t)}onEnd(e){let{traceId:t,spanId:n,traceFlags:i}=e.spanContext(),o=qr(i),s=this.rootSpanIds.get(t),a=s?.rootSpanId===n;if(o){let u=EA(e);u&&Object.assign(e.attributes,u)}if(a){if(this.rootSpanIds.delete(t),s.open.length>0){for(let u of s.open)if(!u.ended&&u.spanContext().spanId!==n)try{u.end()}catch(l){d.diag.error("@vercel/otel: onEnd failed:",l)}}}else if(s)for(let u=0;u<s.open.length;u++)s.open[u]?.spanContext().spanId===n&&s.open.splice(u,1);for(let u of this.processors)u.onEnd(e);if(a){let u=this.waitSpanEnd.get(t);u&&(this.waitSpanEnd.delete(t),u())}}},fA={[d.SpanKind.INTERNAL]:"internal",[d.SpanKind.SERVER]:"server",[d.SpanKind.CLIENT]:"client",[d.SpanKind.PRODUCER]:"producer",[d.SpanKind.CONSUMER]:"consumer"};function EA(r){let{kind:e,attributes:t}=r,{"operation.name":n,"resource.name":i,"span.type":o,"next.span_type":s,"http.method":a,"http.route":u}=t;if(n)return;let l=i??(a&&typeof a=="string"&&u&&typeof u=="string"?`${a} ${u}`:u);if(r.kind===d.SpanKind.SERVER&&a&&u&&typeof a=="string"&&typeof u=="string")return{"operation.name":"web.request","resource.name":l};let _=r.instrumentationLibrary.name,E=s??o;if(E&&typeof E=="string"){let O=_p(_,E);return u?{"operation.name":O,"resource.name":l}:{"operation.name":O}}return{"operation.name":_p(_,e===d.SpanKind.INTERNAL?"":fA[e])}}function _p(r,e){if(!r)return e;let t=r.replace(/[ @./]/g,"_");return t.startsWith("_")&&(t=t.slice(1)),e?`${t}.${e}`:t}var yp=G(Io(),1);var Pp=G(bp(),1);p();var rr=class extends Pp.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){d.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){d.diag.debug("@vercel/otel/otlp: onInit")}send(e,t,n){if(this._shutdownOnce.isCalled){d.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let i=this.convert(e),o,s,a;try{({body:o,contentType:s,headers:a}=this.toMessage(i))}catch(l){d.diag.warn("@vercel/otel/otlp: no proto",l);return}let u=fetch(this.url,{method:"POST",body:o,headers:{...this._headers,...a,"Content-Type":s,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(l=>{d.diag.debug("@vercel/otel/otlp: onSuccess",l.status,l.statusText),t(),l.arrayBuffer().catch(()=>{})}).catch(l=>{d.diag.error("@vercel/otel/otlp: onError",l),n(l)}).finally(()=>{let l=this._sendingPromises.indexOf(u);this._sendingPromises.splice(l,1)});this._sendingPromises.push(u)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var BA="v1/traces",qA=`http://localhost:4318/${BA}`;function Mo(r){return typeof r.url=="string"?r.url:qA}var nr=class{constructor(e={}){this.impl=new $u(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},$u=class extends rr{convert(e){return(0,yp.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return Mo(e)}};var vh=G(Io(),1);var bh=G(Rh(),1);function Ph(r){let e=new bh.Writer;return KA(r,e),e.finish()}function KA(r,e){if(r.resourceSpans!=null&&r.resourceSpans.length)for(let t=0;t<r.resourceSpans.length;++t)zA(r.resourceSpans[t],e.uint32(10).fork()).ldelim();return e}function zA(r,e){if(r.resource!=null&&YA(r.resource,e.uint32(10).fork()).ldelim(),r.scopeSpans!=null&&r.scopeSpans.length)for(let t=0;t<r.scopeSpans.length;++t)QA(r.scopeSpans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function YA(r,e){if(r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)or(r.attributes[t],e.uint32(10).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(16).uint32(r.droppedAttributesCount),e}function QA(r,e){if(r.scope!=null&&eO(r.scope,e.uint32(10).fork()).ldelim(),r.spans!=null&&r.spans.length)for(let t=0;t<r.spans.length;++t)tO(r.spans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function or(r,e){return r.key!=null&&e.uint32(10).string(r.key),r.value!=null&&yh(r.value,e.uint32(18).fork()).ldelim(),e}function yh(r,e){return r.stringValue!=null&&e.uint32(10).string(r.stringValue),r.boolValue!=null&&e.uint32(16).bool(r.boolValue),r.intValue!=null&&e.uint32(24).int64(r.intValue),r.doubleValue!=null&&e.uint32(33).double(r.doubleValue),r.arrayValue!=null&&ZA(r.arrayValue,e.uint32(42).fork()).ldelim(),r.kvlistValue!=null&&JA(r.kvlistValue,e.uint32(50).fork()).ldelim(),r.bytesValue!=null&&e.uint32(58).bytes(r.bytesValue),e}function ZA(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)yh(r.values[t],e.uint32(10).fork()).ldelim();return e}function JA(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)or(r.values[t],e.uint32(10).fork()).ldelim();return e}function eO(r,e){if(r.name!=null&&e.uint32(10).string(r.name),r.version!=null&&e.uint32(18).string(r.version),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)or(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function tO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.parentSpanId!=null&&e.uint32(34).bytes(r.parentSpanId),r.name!=null&&e.uint32(42).string(r.name),r.kind!=null&&e.uint32(48).int32(r.kind),r.startTimeUnixNano!=null&&e.uint32(57).fixed64(r.startTimeUnixNano),r.endTimeUnixNano!=null&&e.uint32(65).fixed64(r.endTimeUnixNano),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)or(r.attributes[t],e.uint32(74).fork()).ldelim();if(r.droppedAttributesCount!=null&&e.uint32(80).uint32(r.droppedAttributesCount),r.events!=null&&r.events.length)for(let t=0;t<r.events.length;++t)nO(r.events[t],e.uint32(90).fork()).ldelim();if(r.droppedEventsCount!=null&&e.uint32(96).uint32(r.droppedEventsCount),r.links!=null&&r.links.length)for(let t=0;t<r.links.length;++t)iO(r.links[t],e.uint32(106).fork()).ldelim();return r.droppedLinksCount!=null&&e.uint32(112).uint32(r.droppedLinksCount),r.status!=null&&rO(r.status,e.uint32(122).fork()).ldelim(),e}function rO(r,e){return r.message!=null&&e.uint32(18).string(r.message),r.code!=null&&e.uint32(24).int32(r.code),e}function nO(r,e){if(r.timeUnixNano!=null&&e.uint32(9).fixed64(r.timeUnixNano),r.name!=null&&e.uint32(18).string(r.name),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)or(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function iO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)or(r.attributes[t],e.uint32(34).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(40).uint32(r.droppedAttributesCount),e}var pt=class{constructor(e={}){this.impl=new oc(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},oc=class extends rr{convert(e){return(0,vh.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:Ph(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return Mo(e)}};p();var Pe=G(oe(),1);function Ih(r,e){return r.replace(/\{(?<temp1>[^{}]+)\}/g,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}var sr=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}enable(){this.disable();let{tracerProvider:e}=this;if(!e)return;let t=e.getTracer(this.instrumentationName,this.instrumentationVersion),n=this.config.ignoreUrls??[],i=(L,B)=>{if(B?.opentelemetry?.ignore!==void 0)return B.opentelemetry.ignore;if(n.length===0)return!1;let P=L.toString();return n.some(m=>typeof m=="string"?m==="*"?!0:P.startsWith(m):m.test(P))},o=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,s=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,a=this.config.propagateContextUrls??[],u=this.config.dontPropagateContextUrls??[],l=this.config.resourceNameTemplate,{attributesFromRequestHeaders:_,attributesFromResponseHeaders:E}=this.config,O=(L,B)=>{if(B?.opentelemetry?.propagateContext)return B.opentelemetry.propagateContext;let P=L.toString();return u.length>0&&u.some(m=>typeof m=="string"?m==="*"?!0:P.startsWith(m):m.test(P))?!1:o&&L.protocol==="https:"&&(L.host===o||L.host===s||L.host===Te()?.headers.host)||!o&&L.protocol==="http:"&&L.hostname==="localhost"?!0:a.some(m=>typeof m=="string"?m==="*"?!0:P.startsWith(m):m.test(P))};process.env.NEXT_OTEL_FETCH_DISABLED="1";let D=globalThis.fetch;this.originalFetch=D;let Y=async(L,B)=>{let P=B;if(P?.next?.internal)return D(L,P);let m=new Request(L instanceof Request?L.clone():L,P),ye=new URL(m.url);if(i(ye,P))return D(L,P);let jo={[Pe.SemanticAttributes.HTTP_METHOD]:m.method,[Pe.SemanticAttributes.HTTP_URL]:m.url,[Pe.SemanticAttributes.HTTP_HOST]:ye.host,[Pe.SemanticAttributes.HTTP_SCHEME]:ye.protocol.replace(":",""),[Pe.SemanticAttributes.NET_PEER_NAME]:ye.hostname,[Pe.SemanticAttributes.NET_PEER_PORT]:ye.port},ht=l?Ih(l,jo):sO(m.url),nf=P?.opentelemetry?.spanName??`fetch ${m.method} ${m.url}`,dc=d.context.active(),q=t.startSpan(nf,{kind:d.SpanKind.CLIENT,attributes:{...jo,"operation.name":`fetch.${m.method}`,"resource.name":ht,...P?.opentelemetry?.attributes}},dc);if(!q.isRecording()||!qr(q.spanContext().traceFlags))return q.end(),D(L,P);if(O(ye,P)){let ft=d.trace.setSpan(dc,q);d.propagation.inject(ft,m.headers,oO)}_&&Lh(q,_,m.headers);try{let ft=Date.now();P?.body&&P.body instanceof FormData&&m.headers.delete("content-type");let ve=await D(L,{...P,headers:m.headers}),of=Date.now()-ft;return q.setAttribute(Pe.SemanticAttributes.HTTP_STATUS_CODE,ve.status),q.setAttribute("http.response_time",of),E&&Lh(q,E,ve.headers),ve.status>=500&&sc(q,`Status: ${ve.status} (${ve.statusText})`),ve.body?aO(ve).then(Fo=>{q.isRecording()&&(q.setAttribute(Pe.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,Fo),q.end())},Fo=>{q.isRecording()&&(sc(q,Fo),q.end())}):q.end(),ve}catch(ft){throw sc(q,ft),q.end(),ft}};globalThis.fetch=Y}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},oO={set(r,e,t){r.set(e,t)}};function sO(r){let e=r.indexOf("?");return e===-1?r:r.substring(0,e)}function aO(r){let e=0,n=r.clone().body?.getReader();if(!n)return Promise.resolve(0);let i=()=>n.read().then(({done:o,value:s})=>{if(!o)return e+=s.byteLength,i()});return i().then(()=>e)}function sc(r,e){if(e instanceof Error)r.recordException(e),r.setStatus({code:d.SpanStatusCode.ERROR,message:e.message});else{let t=String(e);r.setStatus({code:d.SpanStatusCode.ERROR,message:t})}}function Lh(r,e,t){for(let[n,i]of Object.entries(e)){let o=t.get(i);o!==null&&r.setAttribute(n,o)}}p();var Mh=G(S(),1),uO="00",ac="traceparent",uc="tracestate",$r=class{fields(){return[ac,uc]}inject(e,t,n){let i=d.trace.getSpanContext(e);if(!i||(0,Mh.isTracingSuppressed)(e)||!(0,d.isSpanContextValid)(i))return;let o=`${uO}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||0).toString(16)}`;n.set(t,ac,o),i.traceState&&n.set(t,uc,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,ac);if(!i)return e;let o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;let s=cO(o);if(!s)return e;s.isRemote=!0;let a=n.get(t,uc);if(a){let u=Array.isArray(a)?a.join(","):a;s.traceState=(0,d.createTraceState)(typeof u=="string"?u:void 0)}return d.trace.setSpanContext(e,s)}};function cO(r){let[e,t,n,i,o]=r.split("-");return!e||!t||!n||!i||e.length!==2||t.length!==32||n.length!==16||i.length!==2||e==="00"&&o?null:{traceId:t,spanId:n,traceFlags:parseInt(i,16)}}p();var Do=class{fields(){return[]}inject(){}extract(e){let t=Te();if(!t?.telemetry)return d.diag.warn("@vercel/otel: Vercel telemetry extension not found."),e;let{rootSpanContext:n}=t.telemetry;return n?(d.diag.debug("@vercel/otel: Extracted root SpanContext from Vercel request context.",n),d.trace.setSpanContext(e,{...n,isRemote:!0,traceFlags:n.traceFlags||d.TraceFlags.SAMPLED})):e}};p();var qo=G(S(),1),zh=G(Kh(),1);var Go=class{export(e,t){let n=Te();if(!n?.telemetry){d.diag.warn("@vercel/otel: no telemetry context found"),t({code:qo.ExportResultCode.SUCCESS,error:void 0});return}try{let i=(0,zh.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1});n.telemetry.reportSpans(i),t({code:qo.ExportResultCode.SUCCESS,error:void 0})}catch(i){t({code:qo.ExportResultCode.FAILED,error:i instanceof Error?i:new Error(String(i))})}}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};var Vo=class{constructor(e={}){this.configuration=e}start(){let e=IO(),t=(0,_r.getEnvWithoutDefaults)(),n=this.configuration,i=process.env.NEXT_RUNTIME||"nodejs",o=!!e.OTEL_SDK_DISABLED;if(t.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:t.OTEL_LOG_LEVEL}),o)return;let s=n.idGenerator??new N.RandomIdGenerator,a=n.contextManager??new tf.AsyncLocalStorageContextManager;a.enable(),this.contextManager=a;let u=e.OTEL_SERVICE_NAME||n.serviceName||"app",l=new dr.Resource(bo({[lc.SemanticResourceAttributes.SERVICE_NAME]:u,"node.ci":process.env.CI?!0:void 0,"node.env":process.env.NODE_ENV,env:process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,"vercel.region":process.env.VERCEL_REGION,"vercel.runtime":i,"vercel.sha":process.env.VERCEL_GIT_COMMIT_SHA||process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,"vercel.host":process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||void 0,"vercel.branch_host":process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,"vercel.deployment_id":process.env.VERCEL_DEPLOYMENT_ID||void 0,[lc.SemanticResourceAttributes.SERVICE_VERSION]:process.env.VERCEL_DEPLOYMENT_ID,...n.attributes})),_=n.resourceDetectors??[dr.envDetectorSync];if(n.autoDetectResources??!0){let m={detectors:_};l=l.merge((0,dr.detectResourcesSync)(m))}let O=MO(n.propagators,n,e),D=CO(n.traceSampler,e),Y=NO(n.spanProcessors,n,e);Y.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let L=n.spanLimits,B=new N.BasicTracerProvider({resource:l,idGenerator:s,sampler:D,spanLimits:L});if(B.addSpanProcessor(new Po(Y,n.attributesFromHeaders)),B.register({contextManager:a,propagator:new He.CompositePropagator({propagators:O})}),this.tracerProvider=B,n.logRecordProcessor){let m=new Jh.LoggerProvider({resource:l});this.loggerProvider=m,m.addLogRecordProcessor(n.logRecordProcessor),at.logs.setGlobalLoggerProvider(m)}if(n.metricReader||n.views){let m=new ef.MeterProvider({resource:l,views:n.views??[]});n.metricReader&&m.addMetricReader(n.metricReader),d.metrics.setGlobalMeterProvider(m),this.meterProvider=m}let P=LO(n.instrumentations,n.instrumentationConfig);this.disableInstrumentations=(0,Zh.registerInstrumentations)({instrumentations:P}),d.diag.info("@vercel/otel: started",u,i)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),d.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:t}=this;t&&t()}};function IO(){let r=(0,_r.parseEnvironment)(process.env);return{..._r.DEFAULT_ENVIRONMENT,...r}}function LO(r,e){return(r??["auto"]).map(t=>t==="auto"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new sr(e?.fetch)]):t==="fetch"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new sr(e?.fetch)):t).flat()}function MO(r,e,t){let n=t.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS.length>0?t.OTEL_PROPAGATORS:void 0;return(r??n??["auto"]).map(i=>{if(i==="none")return[];if(i==="auto"){let o=[];return o.push({name:"tracecontext",propagator:new $r}),o.push({name:"baggage",propagator:new He.W3CBaggagePropagator}),e.experimental?.exportViaVercelRuntime&&o.push({name:"vercel-runtime",propagator:new Do}),d.diag.debug(`@vercel/otel: Configure propagators: ${o.map(s=>s.name).join(", ")}`),o.map(s=>s.propagator)}if(i==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new $r;if(i==="baggage")return d.diag.debug("@vercel/otel: Configure propagator: baggage"),new He.W3CBaggagePropagator;if(typeof i=="string")throw new Error(`Unknown propagator: "${i}"`);return i}).flat()}var Yh="always_on",lr=1;function CO(r,e){if(r&&typeof r!="string")return r;let t=r&&r!=="auto"?r:e.OTEL_TRACES_SAMPLER||Yh;switch(d.diag.debug("@vercel/otel: Configure sampler: ",t),t){case"always_on":return new N.AlwaysOnSampler;case"always_off":return new N.AlwaysOffSampler;case"parentbased_always_on":return new N.ParentBasedSampler({root:new N.AlwaysOnSampler});case"parentbased_always_off":return new N.ParentBasedSampler({root:new N.AlwaysOffSampler});case"traceidratio":return new N.TraceIdRatioBasedSampler(Qh(e));case"parentbased_traceidratio":return new N.ParentBasedSampler({root:new N.TraceIdRatioBasedSampler(Qh(e))});default:return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${Yh}".`),new N.AlwaysOnSampler}}function Qh(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${lr}.`),lr;d.diag.debug("@vercel/otel: Configure sampler probability: ",r.OTEL_TRACES_SAMPLER_ARG);let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${lr}.`),lr):e<0||e>1?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${lr}.`),lr):e}function NO(r,e,t){return[...(r??["auto"]).map(n=>{if(n==="auto"){if(e.experimental?.exportViaVercelRuntime)return d.diag.debug("@vercel/otel: Configure vercel-runtime exporter"),new N.BatchSpanProcessor(new Go);if(process.env.VERCEL_OTEL_ENDPOINTS){let i=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",o=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";d.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",i,o);let s={url:`http://localhost:${i}/v1/traces`,headers:{}},a=o==="http/protobuf"?new pt(s):new nr(s);return new N.BatchSpanProcessor(a)}return!e.traceExporter||e.traceExporter==="auto"||t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||t.OTEL_EXPORTER_OTLP_ENDPOINT?new N.BatchSpanProcessor(wO(t)):void 0}return n}).filter(UO),...e.traceExporter&&e.traceExporter!=="auto"?[new N.BatchSpanProcessor(e.traceExporter)]:[]]}function wO(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=DO(r),n={...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_HEADERS),...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(d.diag.debug("@vercel/otel: Configure trace exporter: ",e,t,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new nr({url:t,headers:n});case"http/protobuf":return new pt({url:t,headers:n});default:return d.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new pt}}var rf="v1/traces",xO=`http://localhost:4318/${rf}`;function DO(r){let e=r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let t=r.OTEL_EXPORTER_OTLP_ENDPOINT;return t&&typeof t=="string"?`${t}/${rf}`:xO}function UO(r){return r!=null}function Pv(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new Vo(e).start()}export{sr as FetchInstrumentation,nr as OTLPHttpJsonTraceExporter,pt as OTLPHttpProtoTraceExporter,Pv as registerOTel};
21
21
  //# sourceMappingURL=index.js.map