@vercel/otel 1.10.2 → 1.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/edge/index.js +6 -6
- package/dist/edge/index.js.map +3 -3
- package/dist/node/index.js +8 -8
- package/dist/node/index.js.map +3 -3
- package/dist/types/types.d.ts +2 -8
- package/package.json +1 -1
package/dist/node/index.js
CHANGED
|
@@ -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 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}'
|
|
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 Xr=(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)=>(Xr(r,e,"default"),t&&Xr(t,e,"default")),q=(r,e,t)=>(t=r!=null?sf(cf(r)):{},Xr(e||!r||!r.__esModule?Ho(t,"default",{value:r,enumerable:!0}):t,r)),f=r=>Xr(Ho({},"__esModule",{value:!0}),r);var d={};import*as GO from"@opentelemetry/api";var p=_c(()=>{Et(d,GO)});var _r=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(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.W3CBaggagePropagator=void 0;var Wo=(p(),f(d)),Tf=_r(),$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]}};Wr.W3CBaggagePropagator=zo});var fc=c(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.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}};Kr.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(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.loggingErrorHandler=void 0;var Of=(p(),f(d));function Rf(){return r=>{Of.diag.error(bf(r))}}zr.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(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.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=pr.TracesSamplerValues||(pr.TracesSamplerValues={}))});var Oc=c(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr._globalThis=void 0;Yr._globalThis=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});var Qr=c(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.getEnvWithoutDefaults=I.parseEnvironment=I.DEFAULT_ENVIRONMENT=I.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=I.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=I.DEFAULT_ATTRIBUTE_COUNT_LIMIT=I.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}I.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;I.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;I.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;I.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;I.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:I.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:I.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:I.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:I.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:I.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:I.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:I.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:I.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 I.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}I.parseEnvironment=es;function kf(){return typeof process<"u"&&process&&process.env?es(process.env):es(Cf._globalThis)}I.getEnvWithoutDefaults=kf});var bc=c(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.getEnv=void 0;var $f=ee("os"),Rc=Qr();function Xf(){let r=(0,Rc.parseEnvironment)(process.env);return Object.assign({HOSTNAME:$f.hostname()},Rc.DEFAULT_ENVIRONMENT,r)}Zr.getEnv=Xf});var Pc=c(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr._globalThis=void 0;Jr._globalThis=typeof globalThis=="object"?globalThis:global});var vc=c(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.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")}en.hexToBase64=zf});var Mc=c(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.RandomIdGenerator=void 0;var Yf=8,Lc=16,ts=class{constructor(){this.generateTraceId=Ic(Lc),this.generateSpanId=Ic(Yf)}};rn.RandomIdGenerator=ts;var tn=Buffer.allocUnsafe(Lc);function Ic(r){return function(){for(let t=0;t<r/4;t++)tn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(tn[t]>0);t++)t===r-1&&(tn[r-1]=1);return tn.toString("hex",0,r)}}});var Cc=c(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.otperformance=void 0;var Qf=ee("perf_hooks");nn.otperformance=Qf.performance});var rs=c(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.VERSION=void 0;on.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(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.SDK_INFO=void 0;var nE=rs(),hr=oe();sn.SDK_INFO={[hr.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:"opentelemetry",[hr.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"node",[hr.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:hr.TelemetrySdkLanguageValues.NODEJS,[hr.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:nE.VERSION}});var qc=c(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.unrefTimer=void 0;function iE(r){r.unref()}an.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(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.addHrTimes=v.isTimeInput=v.isTimeInputHrTime=v.hrTimeToMicroseconds=v.hrTimeToMilliseconds=v.hrTimeToNanoseconds=v.hrTimeToTimeStamp=v.hrTimeDuration=v.timeInputToHrTime=v.hrTime=v.getTimeOrigin=v.millisToHrTime=void 0;var is=ns(),Vc=9,uE=6,cE=Math.pow(10,uE),un=Math.pow(10,Vc);function fr(r){let e=r/1e3,t=Math.trunc(e),n=Math.round(r%1e3*cE);return[t,n]}v.millisToHrTime=fr;function os(){let r=is.otperformance.timeOrigin;if(typeof r!="number"){let e=is.otperformance;r=e.timing&&e.timing.fetchStart}return r}v.getTimeOrigin=os;function jc(r){let e=fr(os()),t=fr(typeof r=="number"?r:is.otperformance.now());return Fc(e,t)}v.hrTime=jc;function lE(r){if(ss(r))return r;if(typeof r=="number")return r<os()?jc(r):fr(r);if(r instanceof Date)return fr(r.getTime());throw TypeError("Invalid input type")}v.timeInputToHrTime=lE;function dE(r,e){let t=e[0]-r[0],n=e[1]-r[1];return n<0&&(t-=1,n+=un),[t,n]}v.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)}v.hrTimeToTimeStamp=_E;function pE(r){return r[0]*un+r[1]}v.hrTimeToNanoseconds=pE;function hE(r){return r[0]*1e3+r[1]/1e6}v.hrTimeToMilliseconds=hE;function fE(r){return r[0]*1e6+r[1]/1e3}v.hrTimeToMicroseconds=fE;function ss(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}v.isTimeInputHrTime=ss;function EE(r){return ss(r)||typeof r=="number"||r instanceof Date}v.isTimeInput=EE;function Fc(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=un&&(t[1]-=un,t[0]+=1),t}v.addHrTimes=Fc});var $c=c(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0})});var Xc=c(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.ExportResultCode=void 0;var mE;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(mE=Er.ExportResultCode||(Er.ExportResultCode={}))});var Kc=c(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.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()}};cn.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(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.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}};ln.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 dn=(p(),f(d)),yE=_r(),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=dn.trace.getSpanContext(e);if(!i||(0,yE.isTracingSuppressed)(e)||!(0,dn.isSpanContextValid)(i))return;let o=`${IE}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||dn.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 dn.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(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.AlwaysOffSampler=void 0;var GE=(p(),f(d)),ps=class{shouldSample(){return{decision:GE.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};_n.AlwaysOffSampler=ps});var Es=c(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.AlwaysOnSampler=void 0;var VE=(p(),f(d)),fs=class{shouldSample(){return{decision:VE.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};pn.AlwaysOnSampler=fs});var sl=c(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.ParentBasedSampler=void 0;var hn=(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=hn.trace.getSpanContext(e);return!a||!(0,hn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,o,s):a.isRemote?a.traceFlags&hn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,t,n,i,o,s):a.traceFlags&hn.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()}}`}};fn.ParentBasedSampler=gs});var al=c(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.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}};En.TraceIdRatioBasedSampler=Ss});var _l=c(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.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}mn.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(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.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}Sn.merge=tm;function As(r){return Tn(r)?r.slice():r}function fl(r,e,t=0,n){let i;if(!(t>em)){if(t++,gn(r)||gn(e)||El(e))i=As(e);else if(Tn(r)){if(i=r.slice(),Tn(e))for(let o=0,s=e.length;o<s;o++)i.push(As(e[o]));else if(mr(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(mr(r))if(mr(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(gn(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(mr(_)&&mr(E)){let O=n.get(_)||[],x=n.get(E)||[];O.push({obj:r,key:u}),x.push({obj:e,key:u}),n.set(_,O),n.set(E,x)}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 Tn(r){return Array.isArray(r)}function El(r){return typeof r=="function"}function mr(r){return!gn(r)&&!Tn(r)&&!El(r)&&typeof r=="object"}function gn(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 An=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};Tt.TimeoutError=An;function nm(r,e){let t,n=new Promise(function(o,s){t=setTimeout(function(){s(new An("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(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.isWrapped=void 0;function om(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}On.isWrapped=om});var Ol=c(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.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)}};Rn.Deferred=Os});var Rl=c(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.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}};bn.BindOnceFuture=Rs});var Pl=c(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn._export=void 0;var bl=(p(),f(d)),am=_r();function um(r,e){return new Promise(t=>{bl.context.with((0,am.suppressTracing)(bl.context.active()),()=>{r.export(e,n=>{t(n)})})})}Pn._export=um});var T=c(g=>{"use strict";var cm=g&&g.__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]}),P=g&&g.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cm(e,r,t)};Object.defineProperty(g,"__esModule",{value:!0});g.internal=g.baggageUtils=void 0;P(hc(),g);P(fc(),g);P(Sc(),g);P(Zo(),g);P(Qo(),g);P(Hc(),g);P($c(),g);P(Xc(),g);g.baggageUtils=Xo();P(ns(),g);P(Kc(),g);P(tl(),g);P(nl(),g);P(il(),g);P(hs(),g);P(Es(),g);P(sl(),g);P(al(),g);P(_r(),g);P(ls(),g);P(Qr(),g);P(ml(),g);P(Jo(),g);P(gl(),g);P(Sl(),g);P(Al(),g);P(Rl(),g);P(rs(),g);var lm=Pl();g.internal={_export:lm._export}});var yl=c(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.ExceptionEventName=void 0;yn.ExceptionEventName="exception"});var Ps=c(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.Span=void 0;var fe=(p(),f(d)),K=T(),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}};vn.Span=bs});var Tr=c(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.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=gr.SamplingDecision||(gr.SamplingDecision={}))});var Ln=c(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.AlwaysOffSampler=void 0;var pm=Tr(),ys=class{shouldSample(){return{decision:pm.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};In.AlwaysOffSampler=ys});var Cn=c(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.AlwaysOnSampler=void 0;var hm=Tr(),vs=class{shouldSample(){return{decision:hm.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Mn.AlwaysOnSampler=vs});var Ms=c(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.ParentBasedSampler=void 0;var Nn=(p(),f(d)),fm=T(),vl=Ln(),Is=Cn(),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=Nn.trace.getSpanContext(e);return!a||!(0,Nn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,o,s):a.isRemote?a.traceFlags&Nn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,t,n,i,o,s):a.traceFlags&Nn.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()}}`}};wn.ParentBasedSampler=Ls});var Ns=c(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.TraceIdRatioBasedSampler=void 0;var Em=(p(),f(d)),Il=Tr(),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}};xn.TraceIdRatioBasedSampler=Cs});var Ds=c(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.buildSamplerFromEnv=Ot.loadDefaultConfig=void 0;var Dn=(p(),f(d)),F=T(),Ll=Ln(),ws=Cn(),xs=Ms(),Ml=Ns(),mm=(0,F.getEnv)(),gm=F.TracesSamplerValues.AlwaysOn,At=1;function Tm(){return{sampler:Nl(mm),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,F.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,F.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:(0,F.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,F.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:(0,F.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:(0,F.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:(0,F.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:(0,F.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}Ot.loadDefaultConfig=Tm;function Nl(r=(0,F.getEnv)()){switch(r.OTEL_TRACES_SAMPLER){case F.TracesSamplerValues.AlwaysOn:return new ws.AlwaysOnSampler;case F.TracesSamplerValues.AlwaysOff:return new Ll.AlwaysOffSampler;case F.TracesSamplerValues.ParentBasedAlwaysOn:return new xs.ParentBasedSampler({root:new ws.AlwaysOnSampler});case F.TracesSamplerValues.ParentBasedAlwaysOff:return new xs.ParentBasedSampler({root:new Ll.AlwaysOffSampler});case F.TracesSamplerValues.TraceIdRatio:return new Ml.TraceIdRatioBasedSampler(Cl(r));case F.TracesSamplerValues.ParentBasedTraceIdRatio:return new xs.ParentBasedSampler({root:new Ml.TraceIdRatioBasedSampler(Cl(r))});default:return Dn.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 Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${At}.`),At;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.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?(Dn.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=T();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 x=Object.assign({},r.spanLimits),J=(0,Us.getEnvWithoutDefaults)();return x.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:J.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:J.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:Us.DEFAULT_ATTRIBUTE_COUNT_LIMIT,x.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?_:J.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&E!==void 0?E:J.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&O!==void 0?O:Us.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},r,{spanLimits:x})}Rt.reconfigureLimits=Am});var xl=c(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.BatchSpanProcessorBase=void 0;var bt=(p(),f(d)),Ze=T(),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)}};Un.BatchSpanProcessorBase=qs});var Dl=c(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.BatchSpanProcessor=void 0;var Om=xl(),Gs=class extends Om.BatchSpanProcessorBase{onShutdown(){}};Bn.BatchSpanProcessor=Gs});var ql=c(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.RandomIdGenerator=void 0;var Rm=8,Bl=16,Vs=class{constructor(){this.generateTraceId=Ul(Bl),this.generateSpanId=Ul(Rm)}};Gn.RandomIdGenerator=Vs;var qn=Buffer.allocUnsafe(Bl);function Ul(r){return function(){for(let t=0;t<r/4;t++)qn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(qn[t]>0);t++)t===r-1&&(qn[r-1]=1);return qn.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 Vn=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(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Tracer=void 0;var H=(p(),f(d)),jn=T(),vm=Ps(),Im=Bs(),Lm=Vn(),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=H.context.active()){var i,o,s;t.root&&(n=H.trace.deleteSpan(n));let a=H.trace.getSpan(n);if((0,jn.isTracingSuppressed)(n))return H.diag.debug("Instrumentation suppressed, returning Noop Span"),H.trace.wrapSpanContext(H.INVALID_SPAN_CONTEXT);let u=a?.spanContext(),l=this._idGenerator.generateSpanId(),_,E,O;!u||!H.trace.isSpanContextValid(u)?_=this._idGenerator.generateTraceId():(_=u.traceId,E=u.traceState,O=u.spanId);let x=(i=t.kind)!==null&&i!==void 0?i:H.SpanKind.INTERNAL,J=((o=t.links)!==null&&o!==void 0?o:[]).map(ht=>({context:ht.context,attributes:(0,jn.sanitizeAttributes)(ht.attributes)})),y=(0,jn.sanitizeAttributes)(t.attributes),k=this._sampler.shouldSample(n,_,e,x,y,J);E=(s=k.traceState)!==null&&s!==void 0?s:E;let S=k.decision===H.SamplingDecision.RECORD_AND_SAMPLED?H.TraceFlags.SAMPLED:H.TraceFlags.NONE,b={traceId:_,spanId:l,traceFlags:S,traceState:E};if(k.decision===H.SamplingDecision.NOT_RECORD)return H.diag.debug("Recording is off, propagating context in a non-recording span"),H.trace.wrapSpanContext(b);let ye=(0,jn.sanitizeAttributes)(Object.assign(y,k.attributes));return new vm.Span(this,n,e,b,x,O,J,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??H.context.active(),l=this.startSpan(e,o,u),_=H.trace.setSpan(u,l);return H.context.with(_,a,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};Fn.Tracer=js});var Fl=c(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.defaultServiceName=void 0;function Mm(){return`unknown_service:${process.argv0}`}Hn.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 $n=c(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.execAsync=void 0;var wm=ee("child_process"),xm=ee("util");kn.execAsync=xm.promisify(wm.exec)});var Hl=c(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getMachineId=void 0;var Dm=$n(),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""}Xn.getMachineId=Bm});var kl=c(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.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""}Wn.getMachineId=Vm});var Xl=c(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getMachineId=void 0;var jm=ee("fs"),Fm=$n(),$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""}Kn.getMachineId=Hm});var Kl=c(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.getMachineId=void 0;var Wl=ee("process"),km=$n(),$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""}zn.getMachineId=Xm});var zl=c(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getMachineId=void 0;var Wm=(p(),f(d));async function Km(){return Wm.diag.debug("could not read machine-id: unsupported platform"),""}Yn.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(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.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})}};Qn.hostDetectorSync=new ks});var Zl=c(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.hostDetector=void 0;var Jm=$s(),Xs=class{detect(e){return Promise.resolve(Jm.hostDetectorSync.detect(e))}};Zn.hostDetector=new Xs});var Ks=c(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.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)}};Jn.osDetectorSync=new Ws});var td=c(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.osDetector=void 0;var rg=Ks(),zs=class{detect(e){return Promise.resolve(rg.osDetectorSync.detect(e))}};ei.osDetector=new zs});var Qs=c(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.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)}};ti.processDetectorSync=new Ys});var rd=c(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.processDetector=void 0;var sg=Qs(),Zs=class{detect(e){return Promise.resolve(sg.processDetectorSync.detect(e))}};ri.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(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Resource=void 0;var id=(p(),f(d)),nt=oe(),ea=T(),lg=Js(),Sr=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)}};ni.Resource=Sr;Sr.EMPTY=new Sr({})});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(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.browserDetector=void 0;var dg=it(),ta=class{detect(e){return Promise.resolve(dg.browserDetectorSync.detect(e))}};ii.browserDetector=new ta});var na=c(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.envDetectorSync=void 0;var _g=(p(),f(d)),pg=T(),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)}};oi.envDetectorSync=new ra});var _d=c(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.envDetector=void 0;var Eg=na(),ia=class{detect(e){return Promise.resolve(Eg.envDetectorSync.detect(e))}};si.envDetector=new ia});var pd=c(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.browserDetectorSync=void 0;var ai=oe(),oa=it(),mg=(p(),f(d)),sa=class{detect(e){if(!(typeof navigator<"u"))return oa.Resource.empty();let n={[ai.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(n,e)}_getResourceAttributes(e,t){return e[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]===""?(mg.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),oa.Resource.empty()):new oa.Resource(Object.assign({},e))}};ui.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]}),ci=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});ci(dd(),Ee);ci(_d(),Ee);ci(pd(),Ee);ci(na(),Ee)});var fd=c(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.isPromiseLike=void 0;var Tg=r=>r!==null&&typeof r=="object"&&typeof r.then=="function";li.isPromiseLike=Tg});var md=c(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.detectResourcesSync=It.detectResources=void 0;var Ar=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}`),Ar.Resource.empty()}}));return Ed(e),e.reduce((t,n)=>t.merge(n),Ar.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 Ar.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}`),Ar.Resource.empty()}}),n=t.reduce((i,o)=>i.merge(o),Ar.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(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.MultiSpanProcessor=void 0;var bg=T(),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)})}};di.MultiSpanProcessor=aa});var ca=c(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.NoopSpanProcessor=void 0;var ua=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};_i.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=T(),Td=it(),Pg=la(),yg=Ds(),vg=gd(),Ig=ca(),Lg=Vn(),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 Or=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=Or;Or._registeredPropagators=new Map([["tracecontext",()=>new Ct.W3CTraceContextPropagator],["baggage",()=>new Ct.W3CBaggagePropagator]]);Or._registeredExporters=new Map});var Ad=c(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ConsoleSpanExporter=void 0;var da=T(),_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})}};pi.ConsoleSpanExporter=_a});var Rd=c(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.InMemorySpanExporter=void 0;var Od=T(),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}};hi.InMemorySpanExporter=pa});var Pd=c(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0})});var yd=c(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.SimpleSpanProcessor=void 0;var Cg=(p(),f(d)),Nt=T(),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()}};fi.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(L=>{"use strict";var Ng=L&&L.__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=L&&L.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ng(e,r,t)};Object.defineProperty(L,"__esModule",{value:!0});U(jl(),L);U(Sd(),L);U(Vn(),L);U(Ad(),L);U(Rd(),L);U(Pd(),L);U(yd(),L);U(Id(),L);U(ca(),L);U(Ln(),L);U(Cn(),L);U(Ms(),L);U(Ns(),L);U(Tr(),L);U(Ps(),L);U(Md(),L);U(Nd(),L);U(xd(),L);U(Ud(),L)});var at={};import*as Bb from"@opentelemetry/api-logs";var fa=_c(()=>{Et(at,Bb)});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(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.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)}}Ei.registerInstrumentations=Dg});var ga=c(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.LogRecord=void 0;var Ug=(p(),f(d)),Rr=(p(),f(d)),mi=T(),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,mi.timeInputToHrTime)(i??E),this.hrTimeObserved=(0,mi.timeInputToHrTime)(o??E),_){let O=Rr.trace.getSpanContext(_);O&&Rr.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?(Rr.diag.warn(`Invalid attribute key: ${e}`),this):!(0,mi.isAttributeValue)(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(Rr.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,mi.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?(Rr.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}};gi.LogRecord=ma});var jd=c(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.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()}};Ti.Logger=Ta});var Fd=c(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.reconfigureLimits=wt.loadDefaultConfig=void 0;var br=T();function Gg(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,br.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,br.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0}}wt.loadDefaultConfig=Gg;function Vg(r){var e,t,n,i,o,s;let a=(0,br.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:br.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:br.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}}wt.reconfigureLimits=Vg});var Hd=c(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.MultiLogRecordProcessor=void 0;var jg=T(),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()))}};Si.MultiLogRecordProcessor=Sa});var Oa=c(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.NoopLogRecordProcessor=void 0;var Aa=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}};Ai.NoopLogRecordProcessor=Aa});var kd=c(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.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}};Oi.LoggerProviderSharedState=Ra});var Wd=c(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.LoggerProvider=ut.DEFAULT_LOGGER_NAME=void 0;var Pr=(p(),f(d)),Hg=(fa(),f(at)),kg=it(),$d=T(),$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 Pr.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),Hg.NOOP_LOGGER;e||Pr.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=>Pr.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?(Pr.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Pr.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(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ConsoleLogRecordExporter=void 0;var Kg=T(),zg=T(),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})}};Ri.ConsoleLogRecordExporter=Pa});var zd=c(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.SimpleLogRecordProcessor=void 0;var ya=T(),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()}};bi.SimpleLogRecordProcessor=va});var Qd=c(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.InMemoryLogRecordExporter=void 0;var Yd=T(),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=[]}};Pi.InMemoryLogRecordExporter=Ia});var Zd=c(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.BatchLogRecordProcessorBase=void 0;var Yg=(p(),f(d)),xt=T(),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)})})}};yi.BatchLogRecordProcessorBase=La});var Jd=c(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.BatchLogRecordProcessor=void 0;var Qg=Zd(),Ma=class extends Qg.BatchLogRecordProcessorBase{onShutdown(){}};vi.BatchLogRecordProcessor=Ma});var e_=c(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.BatchLogRecordProcessor=void 0;var Zg=Jd();Object.defineProperty(Ii,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return Zg.BatchLogRecordProcessor}})});var t_=c(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.BatchLogRecordProcessor=void 0;var Jg=e_();Object.defineProperty(Li,"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 Mi=c(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.AggregationTemporality=void 0;var aT;(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(aT=yr.AggregationTemporality||(yr.AggregationTemporality={}))});var Dt=c(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.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=vr.DataPointType||(vr.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 Ci=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};M.TimeoutError=Ci;function _T(r,e){let t,n=new Promise(function(o,s){t=setTimeout(function(){s(new Ci("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(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.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=Ir.AggregatorKind||(Ir.AggregatorKind={}))});var n_=c(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.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){}};Ni.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(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.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))}};wi.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(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 CT=2146435072,NT=1048575,Ua=1023;Y.MIN_NORMAL_EXPONENT=-Ua+1;Y.MAX_NORMAL_EXPONENT=Ua;Y.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}Y.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}Y.getSignificand=xT});var xi=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 Ui=c(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MappingError=void 0;var qa=class extends Error{};Di.MappingError=qa});var c_=c(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ExponentMapping=void 0;var Vt=Ba(),BT=xi(),u_=Ui(),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))}};Bi.ExponentMapping=Ga});var __=c(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.LogarithmMapping=void 0;var jt=Ba(),l_=xi(),d_=Ui(),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}};qi.LogarithmMapping=Va});var f_=c(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.getMapping=void 0;var qT=c_(),GT=__(),VT=Ui(),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]}Gi.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=xi(),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,Vi=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=Vi;var Ha=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=HT.AggregatorKind.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new Vi(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(),Lr=T(),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,Lr.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,Lr.hrTimeToMicroseconds)(t.sampleTime)>=(0,Lr.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new kt(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=(0,Lr.hrTimeToMicroseconds)(t.sampleTime)>=(0,Lr.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]}),Mr=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});Mr(n_(),le);Mr(s_(),le);Mr(g_(),le);Mr(T_(),le);Mr(S_(),le)});var ki=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 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}};G.Aggregation=ge;var Cr=class r extends ge{createAggregator(e){return r.DEFAULT_INSTANCE}};G.DropAggregation=Cr;Cr.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}}};G.SumAggregation=Wt;Wt.MONOTONIC_INSTANCE=new ct.SumAggregator(!0);Wt.NON_MONOTONIC_INSTANCE=new ct.SumAggregator(!1);var Nr=class r extends ge{createAggregator(e){return r.DEFAULT_INSTANCE}};G.LastValueAggregation=Nr;Nr.DEFAULT_INSTANCE=new ct.LastValueAggregator;var wr=class r extends ge{createAggregator(e){return r.DEFAULT_INSTANCE}};G.HistogramAggregation=wr;wr.DEFAULT_INSTANCE=new ct.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);var ji=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)}};G.ExplicitBucketHistogramAggregation=ji;var Fi=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)}};G.ExponentialHistogramAggregation=Fi;var Hi=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 ji(e.advice.explicitBucketBoundaries):P_}return eS.diag.warn(`Unable to recognize instrument type: ${e.type}`),O_}createAggregator(e){return this._resolve(e).createAggregator(e)}};G.DefaultAggregation=Hi;var O_=new Cr,R_=new Wt,b_=new Nr,P_=new wr,tS=new Fi,rS=new Hi});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=ki(),iS=Mi(),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(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.MetricReader=void 0;var y_=(p(),f(d)),$i=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,$i.FlatMap)(n,a=>a.errors)),o=t.resourceMetrics.resource,s=t.resourceMetrics.scopeMetrics.concat((0,$i.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,$i.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,$i.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}};Xi.MetricReader=Wa});var M_=c(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.PeriodicExportingMetricReader=void 0;var I_=(p(),f(d)),Wi=T(),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,Wi.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 Wi.internal._export(this._exporter,n);if(s.code!==Wi.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,Wi.unrefTimer)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}};Ki.PeriodicExportingMetricReader=za});var N_=c(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.InMemoryMetricExporter=void 0;var C_=T(),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()}};zi.InMemoryMetricExporter=Ya});var x_=c(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ConsoleMetricExporter=void 0;var w_=T(),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})}};Yi.ConsoleMetricExporter=Qa});var D_=c(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.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))}};Qi.ViewRegistry=Za});var Zi=c(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.isObservableInstrument=D.ObservableUpDownCounterInstrument=D.ObservableGaugeInstrument=D.ObservableCounterInstrument=D.ObservableInstrument=D.HistogramInstrument=D.CounterInstrument=D.UpDownCounterInstrument=D.SyncInstrument=void 0;var zt=(p(),f(d)),lS=T(),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()))}};D.SyncInstrument=Yt;var Ja=class extends Yt{add(e,t,n){this._record(e,t,n)}};D.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)}};D.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)}};D.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)}};D.ObservableInstrument=lt;var ru=class extends lt{};D.ObservableCounterInstrument=ru;var nu=class extends lt{};D.ObservableGaugeInstrument=nu;var iu=class extends lt{};D.ObservableUpDownCounterInstrument=iu;function dS(r){return r instanceof lt}D.isObservableInstrument=dS});var U_=c(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Meter=void 0;var se=Re(),Qt=Zi(),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)}};Ji.Meter=ou});var au=c(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.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})}};eo.MetricStorage=su});var xr=c(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.AttributeHashMap=Zt.HashMap=void 0;var pS=me(),to=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=to;var uu=class extends to{constructor(){super(pS.hashAttributes)}};Zt.AttributeHashMap=uu});var du=c(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.DeltaMetricProcessor=void 0;var cu=xr(),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}};ro.DeltaMetricProcessor=lu});var pu=c(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.TemporalMetricProcessor=void 0;var hS=Mi(),fS=xr(),_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}};no.TemporalMetricProcessor=_u;function ES(r){return Array.from(r.entries())}});var B_=c(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.AsyncMetricStorage=void 0;var mS=au(),gS=du(),TS=pu(),SS=xr(),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)}};io.AsyncMetricStorage=hu});var F_=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 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}
|
|
12
|
+
`),t}Q.getIncompatibilityDetails=AS;function q_(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}Q.getValueTypeConflictResolutionRecipe=q_;function G_(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}Q.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}'`}Q.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}`}
|
|
14
|
+
- OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${n}`}Q.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):""}Q.getConflictResolutionRecipe=OS});var k_=c(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.MetricStorageRegistry=void 0;var RS=Re(),H_=(p(),f(d)),oo=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,
|
|
17
|
-
To resolve the conflict:`,(0,
|
|
16
|
+
`,(0,oo.getIncompatibilityDetails)(o,e),`The longer description will be used.
|
|
17
|
+
To resolve the conflict:`,(0,oo.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,
|
|
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};
|
|
19
|
+
`,(0,oo.getIncompatibilityDetails)(o,e),`To resolve the conflict:
|
|
20
|
+
`,(0,oo.getConflictResolutionRecipe)(o,e))}return n}};so.MetricStorageRegistry=fu});var $_=c(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.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)})}};ao.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_=xr(),bS=Zi(),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(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.ObservableRegistry=void 0;var PS=(p(),f(d)),K_=Zi(),z_=W_(),Dr=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,Dr.PromiseAllSettled)([...n,...i])).filter(Dr.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,Dr.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,Dr.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,Dr.setEquals)(n.instruments,t))}};uo.ObservableRegistry=Tu});var Q_=c(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.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)}};co.SyncMetricStorage=Su});var Ou=c(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.FilteringAttributesProcessor=De.NoopAttributesProcessor=De.AttributesProcessor=void 0;var Ur=class{static Noop(){return LS}};De.AttributesProcessor=Ur;var lo=class extends Ur{process(e,t){return e}};De.NoopAttributesProcessor=lo;var Au=class extends Ur{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 lo});var Z_=c(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.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}};_o.MeterSharedState=Ru});var J_=c(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.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}};po.MeterProviderSharedState=bu});var ep=c(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.MetricCollector=void 0;var FS=T(),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)}};ho.MetricCollector=Pu});var rp=c(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.MeterProvider=void 0;var fo=(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?(fo.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,fo.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){fo.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){fo.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};Eo.MeterProvider=yu});var mo=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(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.InstrumentSelector=void 0;var np=mo(),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}};go.InstrumentSelector=Lu});var op=c(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.MeterSelector=void 0;var Mu=mo(),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}};To.MeterSelector=Cu});var ap=c(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.View=void 0;var XS=mo(),sp=Ou(),WS=ip(),KS=op(),zS=ki();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})}};So.View=Nu});var wu=c(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.TimeoutError=m.View=m.Aggregation=m.SumAggregation=m.LastValueAggregation=m.HistogramAggregation=m.DropAggregation=m.ExponentialHistogramAggregation=m.ExplicitBucketHistogramAggregation=m.DefaultAggregation=m.MeterProvider=m.InstrumentType=m.ConsoleMetricExporter=m.InMemoryMetricExporter=m.PeriodicExportingMetricReader=m.MetricReader=m.DataPointType=m.AggregationTemporality=void 0;var QS=Mi();Object.defineProperty(m,"AggregationTemporality",{enumerable:!0,get:function(){return QS.AggregationTemporality}});var ZS=Dt();Object.defineProperty(m,"DataPointType",{enumerable:!0,get:function(){return ZS.DataPointType}});var JS=Ka();Object.defineProperty(m,"MetricReader",{enumerable:!0,get:function(){return JS.MetricReader}});var eA=M_();Object.defineProperty(m,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return eA.PeriodicExportingMetricReader}});var tA=N_();Object.defineProperty(m,"InMemoryMetricExporter",{enumerable:!0,get:function(){return tA.InMemoryMetricExporter}});var rA=x_();Object.defineProperty(m,"ConsoleMetricExporter",{enumerable:!0,get:function(){return rA.ConsoleMetricExporter}});var nA=Re();Object.defineProperty(m,"InstrumentType",{enumerable:!0,get:function(){return nA.InstrumentType}});var iA=rp();Object.defineProperty(m,"MeterProvider",{enumerable:!0,get:function(){return iA.MeterProvider}});var Ue=ki();Object.defineProperty(m,"DefaultAggregation",{enumerable:!0,get:function(){return Ue.DefaultAggregation}});Object.defineProperty(m,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return Ue.ExplicitBucketHistogramAggregation}});Object.defineProperty(m,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return Ue.ExponentialHistogramAggregation}});Object.defineProperty(m,"DropAggregation",{enumerable:!0,get:function(){return Ue.DropAggregation}});Object.defineProperty(m,"HistogramAggregation",{enumerable:!0,get:function(){return Ue.HistogramAggregation}});Object.defineProperty(m,"LastValueAggregation",{enumerable:!0,get:function(){return Ue.LastValueAggregation}});Object.defineProperty(m,"SumAggregation",{enumerable:!0,get:function(){return Ue.SumAggregation}});Object.defineProperty(m,"Aggregation",{enumerable:!0,get:function(){return Ue.Aggregation}});var oA=ap();Object.defineProperty(m,"View",{enumerable:!0,get:function(){return oA.View}});var sA=me();Object.defineProperty(m,"TimeoutError",{enumerable:!0,get:function(){return sA.TimeoutError}})});var up=c(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.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]}};Ao.AbstractAsyncHooksContextManager=xu});var cp=c(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.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}};Oo.AsyncLocalStorageContextManager=Du});var qr=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=qr();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 Gr=c(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.getOtlpEncoder=ae.encodeAsString=ae.encodeAsLongBits=ae.toLongBits=ae.hrTimeToNanos=void 0;var Po=T(),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:Po.hrTimeToNanoseconds;function Ep(r){return r}function Tp(r){if(r!==void 0)return(0,Po.hexToBase64)(r)}var AA={encodeHrTime:ju,encodeSpanContext:Po.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:Po.hexToBase64,encodeOptionalSpanContext:i?Ep:Tp}}ae.getOtlpEncoder=OA});var vo=c(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.createExportTraceServiceRequest=void 0;var RA=qr(),bA=fp(),PA=Gr();function yA(r,e){let t=(0,PA.getOtlpEncoder)(e);return{resourceSpans:IA(r,t)}}yo.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:x,version:J,schemaUrl:y}=O[0].instrumentationLibrary,k=O.map(S=>(0,bA.sdkSpanToOtlpSpan)(S,e));u.push({scope:{name:x,version:J},spans:k,schemaUrl:y})}_=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=T(),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(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.OTLPExporterBase=void 0;var Rp=(p(),f(d)),Vr=T(),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 Vr.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:Vr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:Vr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:Vr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:Vr.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()}};Io.OTLPExporterBase=ku});var Ip=c((Ry,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 Mo=Cp;Mo.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;Mo.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";Mo.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};Mo.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var xp=c((Py,wp)=>{"use strict";wp.exports=Co;function Co(){this._listeners={}}Co.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};Co.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};Co.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((yy,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((Iy,$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((Ly,Wp)=>{"use strict";Wp.exports=V;var jr=Ve();function V(r,e){this.lo=r>>>0,this.hi=e>>>0}var dt=V.zero=new V(0,0);dt.toNumber=function(){return 0};dt.zzEncode=dt.zzDecode=function(){return this};dt.length=function(){return 1};var jA=V.zeroHash="\0\0\0\0\0\0\0\0";V.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 V(n,i)};V.from=function(e){if(typeof e=="number")return V.fromNumber(e);if(jr.isString(e))if(jr.Long)e=jr.Long.fromString(e);else return V.fromNumber(parseInt(e,10));return e.low||e.high?new V(e.low>>>0,e.high>>>0):dt};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 jr.Long?new jr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Ge=String.prototype.charCodeAt;V.fromHash=function(e){return e===jA?dt:new V((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)};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 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((Cy,eh)=>{"use strict";eh.exports=A;var ue=Ve(),Ku,No=ue.LongBits,Qp=ue.base64,Zp=ue.utf8;function Fr(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 Fr(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 Fr(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(Fr.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,No.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=No.from(e);return this._push(Ju,t.length(),t)};A.prototype.int64=A.prototype.uint64;A.prototype.sint64=function(e){var t=No.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=No.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 Fr(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 Fr(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((Ny,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((wy,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 wo(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 wo(this.buf,this.pos+=4)};w.prototype.sfixed32=function(){if(this.pos+4>this.len)throw pe(this,4);return wo(this.buf,this.pos+=4)|0};function oh(){if(this.pos+8>this.len)throw pe(this,8);return new sh(wo(this.buf,this.pos+=4),wo(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((xy,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((Dy,ph)=>{"use strict";ph.exports=Hr;var ic=Ve();(Hr.prototype=Object.create(ic.EventEmitter.prototype)).constructor=Hr;function Hr(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}Hr.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}};Hr.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((By,mh)=>{"use strict";mh.exports={}});var Ah=c(Sh=>{"use strict";var Z=Sh;Z.build="minimal";Z.Writer=ec();Z.BufferWriter=nh();Z.Reader=nc();Z.BufferReader=_h();Z.util=Ve();Z.rpc=Eh();Z.roots=gh();Z.configure=Th;function Th(){Z.util._configure(),Z.Writer._configure(Z.BufferWriter),Z.Reader._configure(Z.BufferReader)}Th()});var Rh=c((Gy,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($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.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=$r.ESpanKind||($r.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(),Do=qr(),dO=Gr();function _O(r,e){let t=(0,dO.getOtlpEncoder)(e);return{resource:{attributes:(0,Do.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,Do.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,Do.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,Do.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(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.createExportMetricsServiceRequest=void 0;var mO=kh();function gO(r,e){return{resourceMetrics:r.map(t=>(0,mO.toResourceMetrics)(t,e))}}Uo.createExportMetricsServiceRequest=gO});var Wh=c(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.toLogAttributes=ur.createExportLogsServiceRequest=void 0;var TO=Gr(),cc=qr();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(j=>{"use strict";var bO=j&&j.__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=j&&j.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bO(e,r,t)};Object.defineProperty(j,"__esModule",{value:!0});j.createExportLogsServiceRequest=j.createExportMetricsServiceRequest=j.createExportTraceServiceRequest=void 0;cr(Nh(),j);cr(Gr(),j);cr(xh(),j);cr(Uh(),j);cr(Bh(),j);cr(Gh(),j);var PO=vo();Object.defineProperty(j,"createExportTraceServiceRequest",{enumerable:!0,get:function(){return PO.createExportTraceServiceRequest}});var yO=$h();Object.defineProperty(j,"createExportMetricsServiceRequest",{enumerable:!0,get:function(){return yO.createExportMetricsServiceRequest}});var vO=Wh();Object.defineProperty(j,"createExportLogsServiceRequest",{enumerable:!0,get:function(){return vO.createExportLogsServiceRequest}})});var N=q(la(),1);p();fa();var Zh=q(Vd(),1),dr=q(it(),1),Jh=q(r_(),1),ef=q(wu(),1),lc=q(oe(),1),Vo=q(Qr(),1),tf=q(cp(),1),He=q(T(),1);p();var _A=Symbol.for("@vercel/request-context");function Te(){return globalThis[_A]?.get()}var Uu=q(oe(),1);function Ro(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 Ro({[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 Br(r){return(r&d.TraceFlags.SAMPLED)!==0}var bo=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&&Br(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=Br(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=q(vo(),1);var Pp=q(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 Lo(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 Lo(e)}};var vh=q(vo(),1);var bh=q(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 Lo(e)}};p();var Pe=q(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=(y,k)=>{if(k?.opentelemetry?.ignore!==void 0)return k.opentelemetry.ignore;if(n.length===0)return!1;let S=y.toString();return n.some(b=>typeof b=="string"?b==="*"?!0:S.startsWith(b):b.test(S))},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=(y,k)=>{if(k?.opentelemetry?.propagateContext)return k.opentelemetry.propagateContext;let S=y.toString();return u.length>0&&u.some(b=>typeof b=="string"?b==="*"?!0:S.startsWith(b):b.test(S))?!1:o&&y.protocol==="https:"&&(y.host===o||y.host===s||y.host===Te()?.headers.host)||!o&&y.protocol==="http:"&&y.hostname==="localhost"?!0:a.some(b=>typeof b=="string"?b==="*"?!0:S.startsWith(b):b.test(S))};process.env.NEXT_OTEL_FETCH_DISABLED="1";let x=globalThis.fetch;this.originalFetch=x;let J=async(y,k)=>{let S=k;if(S?.next?.internal)return x(y,S);let b=new Request(y instanceof Request?y.clone():y,S),ye=new URL(b.url);if(i(ye,S))return x(y,S);let jo={[Pe.SemanticAttributes.HTTP_METHOD]:b.method,[Pe.SemanticAttributes.HTTP_URL]:b.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(b.url),nf=S?.opentelemetry?.spanName??`fetch ${b.method} ${b.url}`,dc=d.context.active(),B=t.startSpan(nf,{kind:d.SpanKind.CLIENT,attributes:{...jo,"operation.name":`fetch.${b.method}`,"resource.name":ht,...S?.opentelemetry?.attributes}},dc);if(!B.isRecording()||!Br(B.spanContext().traceFlags))return B.end(),x(y,S);if(O(ye,S)){let ft=d.trace.setSpan(dc,B);d.propagation.inject(ft,b.headers,oO)}_&&Lh(B,_,b.headers);try{let ft=Date.now();S?.body&&S.body instanceof FormData&&b.headers.delete("content-type");let ve=await x(y,{...S,headers:b.headers}),of=Date.now()-ft;return B.setAttribute(Pe.SemanticAttributes.HTTP_STATUS_CODE,ve.status),B.setAttribute("http.response_time",of),E&&Lh(B,E,ve.headers),ve.status>=500&&sc(B,`Status: ${ve.status} (${ve.statusText})`),ve.body?aO(ve).then(Fo=>{B.isRecording()&&(B.setAttribute(Pe.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,Fo),B.end())},Fo=>{B.isRecording()&&(sc(B,Fo),B.end())}):B.end(),ve}catch(ft){throw sc(B,ft),B.end(),ft}};globalThis.fetch=J}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=q(T(),1),uO="00",ac="traceparent",uc="tracestate",kr=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 xo=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 Bo=q(T(),1),zh=q(Kh(),1);var qo=class{export(e,t){let n=Te();if(!n?.telemetry){d.diag.warn("@vercel/otel: no telemetry context found"),t({code:Bo.ExportResultCode.SUCCESS,error:void 0});return}try{let i=(0,zh.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1});n.telemetry.reportSpans(i),t({code:Bo.ExportResultCode.SUCCESS,error:void 0})}catch(i){t({code:Bo.ExportResultCode.FAILED,error:i instanceof Error?i:new Error(String(i))})}}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};var IO={ALL:d.DiagLogLevel.ALL,VERBOSE:d.DiagLogLevel.VERBOSE,DEBUG:d.DiagLogLevel.DEBUG,INFO:d.DiagLogLevel.INFO,WARN:d.DiagLogLevel.WARN,ERROR:d.DiagLogLevel.ERROR,NONE:d.DiagLogLevel.NONE},Go=class{constructor(e={}){this.configuration=e}start(){let e=LO(),t=this.configuration,n=process.env.NEXT_RUNTIME||"nodejs",i=!!e.OTEL_SDK_DISABLED;if(process.env.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:IO[process.env.OTEL_LOG_LEVEL.toUpperCase()]}),i)return;let o=t.idGenerator??new N.RandomIdGenerator,s=t.contextManager??new tf.AsyncLocalStorageContextManager;s.enable(),this.contextManager=s;let a=e.OTEL_SERVICE_NAME||t.serviceName||"app",u=new dr.Resource(Ro({[lc.SemanticResourceAttributes.SERVICE_NAME]:a,"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":n,"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,...t.attributes})),l=t.resourceDetectors??[dr.envDetectorSync];if(t.autoDetectResources??!0){let S={detectors:l};u=u.merge((0,dr.detectResourcesSync)(S))}let E=CO(t.propagators,t,e),O=NO(t.traceSampler,e),x=wO(t.spanProcessors,t,e);x.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let J=t.spanLimits,y=new N.BasicTracerProvider({resource:u,idGenerator:o,sampler:O,spanLimits:J});if(y.addSpanProcessor(new bo(x,t.attributesFromHeaders)),y.register({contextManager:s,propagator:new He.CompositePropagator({propagators:E})}),this.tracerProvider=y,t.logRecordProcessor){let S=new Jh.LoggerProvider({resource:u});this.loggerProvider=S,S.addLogRecordProcessor(t.logRecordProcessor),at.logs.setGlobalLoggerProvider(S)}if(t.metricReader||t.views){let S=new ef.MeterProvider({resource:u,views:t.views??[]});t.metricReader&&S.addMetricReader(t.metricReader),d.metrics.setGlobalMeterProvider(S),this.meterProvider=S}let k=MO(t.instrumentations,t.instrumentationConfig);this.disableInstrumentations=(0,Zh.registerInstrumentations)({instrumentations:k}),d.diag.info("@vercel/otel: started",a,n)}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 LO(){let r=(0,Vo.parseEnvironment)(process.env);return{...Vo.DEFAULT_ENVIRONMENT,...r}}function MO(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 CO(r,e,t){let n=process.env.OTEL_PROPAGATORS&&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 kr}),o.push({name:"baggage",propagator:new He.W3CBaggagePropagator}),d.diag.debug(`@vercel/otel: Configure propagators: ${o.map(s=>s.name).join(", ")}`),o.map(s=>s.propagator)}if(i==="experimental-vercel-trace")return d.diag.debug("@vercel/otel: Configure propagator: vercel-runtime"),new xo;if(i==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new kr;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 NO(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 wO(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",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(xO(t)):void 0}else if(n==="experimental-vercel-trace")return d.diag.debug("@vercel/otel: Configure vercel-runtime exporter"),new N.BatchSpanProcessor(new qo);return n}).filter(BO),...e.traceExporter&&e.traceExporter!=="auto"?[new N.BatchSpanProcessor(e.traceExporter)]:[]]}function xO(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=UO(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",DO=`http://localhost:4318/${rf}`;function UO(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}`:DO}function BO(r){return r!=null}function yv(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new Go(e).start()}export{sr as FetchInstrumentation,nr as OTLPHttpJsonTraceExporter,pt as OTLPHttpProtoTraceExporter,yv as registerOTel};
|
|
21
21
|
//# sourceMappingURL=index.js.map
|