zcode-app-cli 3.6.5-8 → 3.6.5-9
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/vendor/zcode.cjs
CHANGED
|
@@ -3217,7 +3217,7 @@ Slash Commands:
|
|
|
3217
3217
|
To resolve the conflict:`,(0,vAe.getConflictResolutionRecipe)(i,t))),o=n):lzn.diag.warn("A view or instrument with the name ",t.name,` has already been registered and is incompatible with another registered view.
|
|
3218
3218
|
`,`Details:
|
|
3219
3219
|
`,(0,vAe.getIncompatibilityDetails)(i,t),`To resolve the conflict:
|
|
3220
|
-
`,(0,vAe.getConflictResolutionRecipe)(i,t))}return o}};xAe.MetricStorageRegistry=xUt});var dzn=z(bAe=>{"use strict";Object.defineProperty(bAe,"__esModule",{value:!0});bAe.MultiMetricStorage=void 0;var bUt=class{static{s(this,"MultiMetricStorage")}_backingStorages;constructor(t){this._backingStorages=t}record(t,r,o,n){this._backingStorages.forEach(i=>{i.record(t,r,o,n)})}};bAe.MultiMetricStorage=bUt});var mzn=z(WL=>{"use strict";Object.defineProperty(WL,"__esModule",{value:!0});WL.BatchObservableResultImpl=WL.ObservableResultImpl=void 0;var GL=(fn(),Mr(co)),pzn=Iee(),Via=pAe(),wUt=class{static{s(this,"ObservableResultImpl")}_buffer=new pzn.AttributeHashMap;_instrumentName;_valueType;constructor(t,r){this._instrumentName=t,this._valueType=r}observe(t,r={}){if(typeof t!="number"){GL.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${t}`);return}this._valueType===GL.ValueType.INT&&!Number.isInteger(t)&&(GL.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._buffer.set(r,t)}};WL.ObservableResultImpl=wUt;var kUt=class{static{s(this,"BatchObservableResultImpl")}_buffer=new Map;observe(t,r,o={}){if(!(0,Via.isObservableInstrument)(t))return;let n=this._buffer.get(t);if(n==null&&(n=new pzn.AttributeHashMap,this._buffer.set(t,n)),typeof r!="number"){GL.diag.warn(`non-number value provided to metric ${t._descriptor.name}: ${r}`);return}t._descriptor.valueType===GL.ValueType.INT&&!Number.isInteger(r)&&(GL.diag.warn(`INT value type cannot accept a floating-point value for ${t._descriptor.name}, ignoring the fractional digits.`),r=Math.trunc(r),!Number.isInteger(r))||n.set(o,r)}};WL.BatchObservableResultImpl=kUt});var gzn=z(wAe=>{"use strict";Object.defineProperty(wAe,"__esModule",{value:!0});wAe.ObservableRegistry=void 0;var Gia=(fn(),Mr(co)),fzn=pAe(),hzn=mzn(),SUt=lx(),IUt=class{static{s(this,"ObservableRegistry")}_callbacks=[];_batchCallbacks=[];addCallback(t,r){this._findCallback(t,r)>=0||this._callbacks.push({callback:t,instrument:r})}removeCallback(t,r){let o=this._findCallback(t,r);o<0||this._callbacks.splice(o,1)}addBatchCallback(t,r){let o=new Set(r.filter(fzn.isObservableInstrument));if(o.size===0){Gia.diag.error("BatchObservableCallback is not associated with valid instruments",r);return}this._findBatchCallback(t,o)>=0||this._batchCallbacks.push({callback:t,instruments:o})}removeBatchCallback(t,r){let o=new Set(r.filter(fzn.isObservableInstrument)),n=this._findBatchCallback(t,o);n<0||this._batchCallbacks.splice(n,1)}async observe(t,r){let o=this._observeCallbacks(t,r),n=this._observeBatchCallbacks(t,r);return(await Promise.allSettled([...o,...n])).filter(u=>u.status==="rejected").map(u=>u.reason)}_observeCallbacks(t,r){return this._callbacks.map(async({callback:o,instrument:n})=>{let i=new hzn.ObservableResultImpl(n._descriptor.name,n._descriptor.valueType),a=Promise.resolve(o(i));r!=null&&(a=(0,SUt.callWithTimeout)(a,r)),await a,n._metricStorages.forEach(u=>{u.record(i._buffer,t)})})}_observeBatchCallbacks(t,r){return this._batchCallbacks.map(async({callback:o,instruments:n})=>{let i=new hzn.BatchObservableResultImpl,a=Promise.resolve(o(i));r!=null&&(a=(0,SUt.callWithTimeout)(a,r)),await a,n.forEach(u=>{let l=i._buffer.get(u);l!=null&&u._metricStorages.forEach(c=>{c.record(l,t)})})})}_findCallback(t,r){return this._callbacks.findIndex(o=>o.callback===t&&o.instrument===r)}_findBatchCallback(t,r){return this._batchCallbacks.findIndex(o=>o.callback===t&&(0,SUt.setEquals)(o.instruments,r))}};wAe.ObservableRegistry=IUt});var _zn=z(kAe=>{"use strict";Object.defineProperty(kAe,"__esModule",{value:!0});kAe.SyncMetricStorage=void 0;var Wia=pUt(),Hia=gUt(),Kia=yUt(),TUt=class extends Wia.MetricStorage{static{s(this,"SyncMetricStorage")}_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(t,r,o,n,i){super(t),this._aggregationCardinalityLimit=i,this._deltaMetricStorage=new Hia.DeltaMetricProcessor(r,this._aggregationCardinalityLimit),this._temporalMetricStorage=new Kia.TemporalMetricProcessor(r,n),this._attributesProcessor=o}record(t,r,o,n){r=this._attributesProcessor.process(r,o),this._deltaMetricStorage.record(t,r,o,n)}collect(t,r){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(t,this._instrumentDescriptor,o,r)}};kAe.SyncMetricStorage=TUt});var SAe=z(hx=>{"use strict";Object.defineProperty(hx,"__esModule",{value:!0});hx.createDenyListAttributesProcessor=hx.createAllowListAttributesProcessor=hx.createMultiAttributesProcessor=hx.createNoopAttributesProcessor=void 0;var EUt=class{static{s(this,"NoopAttributesProcessor")}process(t,r){return t}},CUt=class{static{s(this,"MultiAttributesProcessor")}_processors;constructor(t){this._processors=t}process(t,r){let o=t;for(let n of this._processors)o=n.process(o,r);return o}},AUt=class{static{s(this,"AllowListProcessor")}_allowedAttributeNames;constructor(t){this._allowedAttributeNames=t}process(t,r){let o={};return Object.keys(t).forEach(n=>{this._allowedAttributeNames.includes(n)&&(o[n]=t[n])}),o}},PUt=class{static{s(this,"DenyListProcessor")}_deniedAttributeNames;constructor(t){this._deniedAttributeNames=t}process(t,r){let o={};return Object.keys(t).forEach(n=>{this._deniedAttributeNames.includes(n)||(o[n]=t[n])}),o}};function Jia(){return eaa}s(Jia,"createNoopAttributesProcessor");hx.createNoopAttributesProcessor=Jia;function Qia(e){return new CUt(e)}s(Qia,"createMultiAttributesProcessor");hx.createMultiAttributesProcessor=Qia;function Yia(e){return new AUt(e)}s(Yia,"createAllowListAttributesProcessor");hx.createAllowListAttributesProcessor=Yia;function Xia(e){return new PUt(e)}s(Xia,"createDenyListAttributesProcessor");hx.createDenyListAttributesProcessor=Xia;var eaa=new EUt});var yzn=z(IAe=>{"use strict";Object.defineProperty(IAe,"__esModule",{value:!0});IAe.MeterSharedState=void 0;var taa=See(),raa=rzn(),naa=nzn(),oaa=czn(),iaa=dzn(),aaa=gzn(),saa=_zn(),uaa=SAe(),RUt=class{static{s(this,"MeterSharedState")}metricStorageRegistry=new oaa.MetricStorageRegistry;observableRegistry=new aaa.ObservableRegistry;meter;_meterProviderSharedState;_instrumentationScope;constructor(t,r){this.meter=new raa.Meter(this),this._meterProviderSharedState=t,this._instrumentationScope=r}registerMetricStorage(t){let r=this._registerMetricStorage(t,saa.SyncMetricStorage);return r.length===1?r[0]:new iaa.MultiMetricStorage(r)}registerAsyncMetricStorage(t){return this._registerMetricStorage(t,naa.AsyncMetricStorage)}async collect(t,r,o){let n=await this.observableRegistry.observe(r,o?.timeoutMillis),i=this.metricStorageRegistry.getStorages(t);if(i.length===0)return null;let a=[];return i.forEach(u=>{let l=u.collect(t,r);l!=null&&a.push(l)}),a.length===0?{errors:n}:{scopeMetrics:{scope:this._instrumentationScope,metrics:a},errors:n}}_registerMetricStorage(t,r){let n=this._meterProviderSharedState.viewRegistry.findViews(t,this._instrumentationScope).map(i=>{let a=(0,taa.createInstrumentDescriptorWithView)(i,t),u=this.metricStorageRegistry.findOrUpdateCompatibleStorage(a);if(u!=null)return u;let l=i.aggregation.createAggregator(a),c=new r(a,l,i.attributesProcessor,this._meterProviderSharedState.metricCollectors,i.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(n.length===0){let a=this._meterProviderSharedState.selectAggregations(t.type).map(([u,l])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(u,t);if(c!=null)return c;let d=l.createAggregator(t),p=u.selectCardinalityLimit(t.type),m=new r(t,d,(0,uaa.createNoopAttributesProcessor)(),[u],p);return this.metricStorageRegistry.registerForCollector(u,m),m});n=n.concat(a)}return n}};IAe.MeterSharedState=RUt});var vzn=z(TAe=>{"use strict";Object.defineProperty(TAe,"__esModule",{value:!0});TAe.MeterProviderSharedState=void 0;var laa=lx(),caa=XNn(),daa=yzn(),paa=yee(),MUt=class{static{s(this,"MeterProviderSharedState")}viewRegistry=new caa.ViewRegistry;metricCollectors=[];meterSharedStates=new Map;resource;constructor(t){this.resource=t}getMeterSharedState(t){let r=(0,laa.instrumentationScopeId)(t),o=this.meterSharedStates.get(r);return o==null&&(o=new daa.MeterSharedState(this,t),this.meterSharedStates.set(r,o)),o}selectAggregations(t){let r=[];for(let o of this.metricCollectors)r.push([o,(0,paa.toAggregation)(o.selectAggregation(t))]);return r}};TAe.MeterProviderSharedState=MUt});var xzn=z(EAe=>{"use strict";Object.defineProperty(EAe,"__esModule",{value:!0});EAe.MetricCollector=void 0;var maa=ps(),$Ut=class{static{s(this,"MetricCollector")}_sharedState;_metricReader;constructor(t,r){this._sharedState=t,this._metricReader=r}async collect(t){let r=(0,maa.millisToHrTime)(Date.now()),o=[],n=[],i=Array.from(this._sharedState.meterSharedStates.values()).map(async a=>{let u=await a.collect(this,r,t);u?.scopeMetrics!=null&&o.push(u.scopeMetrics),u?.errors!=null&&n.push(...u.errors)});return await Promise.all(i),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:n}}async forceFlush(t){await this._metricReader.forceFlush(t)}async shutdown(t){await this._metricReader.shutdown(t)}selectAggregationTemporality(t){return this._metricReader.selectAggregationTemporality(t)}selectAggregation(t){return this._metricReader.selectAggregation(t)}selectCardinalityLimit(t){return this._metricReader.selectCardinalityLimit?.(t)??2e3}};EAe.MetricCollector=$Ut});var CAe=z(HL=>{"use strict";Object.defineProperty(HL,"__esModule",{value:!0});HL.ExactPredicate=HL.PatternPredicate=void 0;var faa=/[\^$\\.+?()[\]{}|]/g,OUt=class e{static{s(this,"PatternPredicate")}_matchAll;_regexp;constructor(t){t==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(e.escapePattern(t)))}match(t){return this._matchAll?!0:this._regexp.test(t)}static escapePattern(t){return`^${t.replace(faa,"\\$&").replace("*",".*")}$`}static hasWildcard(t){return t.includes("*")}};HL.PatternPredicate=OUt;var DUt=class{static{s(this,"ExactPredicate")}_matchAll;_pattern;constructor(t){this._matchAll=t===void 0,this._pattern=t}match(t){return!!(this._matchAll||t===this._pattern)}};HL.ExactPredicate=DUt});var wzn=z(AAe=>{"use strict";Object.defineProperty(AAe,"__esModule",{value:!0});AAe.InstrumentSelector=void 0;var bzn=CAe(),NUt=class{static{s(this,"InstrumentSelector")}_nameFilter;_type;_unitFilter;constructor(t){this._nameFilter=new bzn.PatternPredicate(t?.name??"*"),this._type=t?.type,this._unitFilter=new bzn.ExactPredicate(t?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};AAe.InstrumentSelector=NUt});var kzn=z(PAe=>{"use strict";Object.defineProperty(PAe,"__esModule",{value:!0});PAe.MeterSelector=void 0;var zUt=CAe(),jUt=class{static{s(this,"MeterSelector")}_nameFilter;_versionFilter;_schemaUrlFilter;constructor(t){this._nameFilter=new zUt.ExactPredicate(t?.name),this._versionFilter=new zUt.ExactPredicate(t?.version),this._schemaUrlFilter=new zUt.ExactPredicate(t?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};PAe.MeterSelector=jUt});var Tzn=z(RAe=>{"use strict";Object.defineProperty(RAe,"__esModule",{value:!0});RAe.View=void 0;var haa=CAe(),Szn=SAe(),gaa=wzn(),_aa=kzn(),Izn=yee();function yaa(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}s(yaa,"isSelectorNotProvided");function vaa(e){if(yaa(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||haa.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.")}s(vaa,"validateViewOptions");var LUt=class{static{s(this,"View")}name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(t){vaa(t),t.attributesProcessors!=null?this.attributesProcessor=(0,Szn.createMultiAttributesProcessor)(t.attributesProcessors):this.attributesProcessor=(0,Szn.createNoopAttributesProcessor)(),this.name=t.name,this.description=t.description,this.aggregation=(0,Izn.toAggregation)(t.aggregation??{type:Izn.AggregationType.DEFAULT}),this.instrumentSelector=new gaa.InstrumentSelector({name:t.instrumentName,type:t.instrumentType,unit:t.instrumentUnit}),this.meterSelector=new _aa.MeterSelector({name:t.meterName,version:t.meterVersion,schemaUrl:t.meterSchemaUrl}),this.aggregationCardinalityLimit=t.aggregationCardinalityLimit}};RAe.View=LUt});var Ezn=z($Ae=>{"use strict";Object.defineProperty($Ae,"__esModule",{value:!0});$Ae.MeterProvider=void 0;var MAe=(fn(),Mr(co)),xaa=cAe(),baa=vzn(),waa=xzn(),kaa=Tzn(),BUt=class{static{s(this,"MeterProvider")}_sharedState;_shutdown=!1;constructor(t){if(this._sharedState=new baa.MeterProviderSharedState(t?.resource??(0,xaa.defaultResource)()),t?.views!=null&&t.views.length>0)for(let r of t.views)this._sharedState.viewRegistry.addView(new kaa.View(r));if(t?.readers!=null&&t.readers.length>0)for(let r of t.readers){let o=new waa.MetricCollector(this._sharedState,r);r.setMetricProducer(o),this._sharedState.metricCollectors.push(o)}}getMeter(t,r="",o={}){return this._shutdown?(MAe.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,MAe.createNoopMeter)()):this._sharedState.getMeterSharedState({name:t,version:r,schemaUrl:o.schemaUrl}).meter}async shutdown(t){if(this._shutdown){MAe.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(r=>r.shutdown(t)))}async forceFlush(t){if(this._shutdown){MAe.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(r=>r.forceFlush(t)))}};$Ae.MeterProvider=BUt});var OAe=z(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.TimeoutError=Qa.createDenyListAttributesProcessor=Qa.createAllowListAttributesProcessor=Qa.AggregationType=Qa.MeterProvider=Qa.ConsoleMetricExporter=Qa.InMemoryMetricExporter=Qa.PeriodicExportingMetricReader=Qa.MetricReader=Qa.InstrumentType=Qa.DataPointType=Qa.AggregationTemporality=void 0;var Saa=b4e();Object.defineProperty(Qa,"AggregationTemporality",{enumerable:!0,get:s(function(){return Saa.AggregationTemporality},"get")});var Czn=uE();Object.defineProperty(Qa,"DataPointType",{enumerable:!0,get:s(function(){return Czn.DataPointType},"get")});Object.defineProperty(Qa,"InstrumentType",{enumerable:!0,get:s(function(){return Czn.InstrumentType},"get")});var Iaa=LBt();Object.defineProperty(Qa,"MetricReader",{enumerable:!0,get:s(function(){return Iaa.MetricReader},"get")});var Taa=kNn();Object.defineProperty(Qa,"PeriodicExportingMetricReader",{enumerable:!0,get:s(function(){return Taa.PeriodicExportingMetricReader},"get")});var Eaa=INn();Object.defineProperty(Qa,"InMemoryMetricExporter",{enumerable:!0,get:s(function(){return Eaa.InMemoryMetricExporter},"get")});var Caa=ENn();Object.defineProperty(Qa,"ConsoleMetricExporter",{enumerable:!0,get:s(function(){return Caa.ConsoleMetricExporter},"get")});var Aaa=Ezn();Object.defineProperty(Qa,"MeterProvider",{enumerable:!0,get:s(function(){return Aaa.MeterProvider},"get")});var Paa=yee();Object.defineProperty(Qa,"AggregationType",{enumerable:!0,get:s(function(){return Paa.AggregationType},"get")});var Azn=SAe();Object.defineProperty(Qa,"createAllowListAttributesProcessor",{enumerable:!0,get:s(function(){return Azn.createAllowListAttributesProcessor},"get")});Object.defineProperty(Qa,"createDenyListAttributesProcessor",{enumerable:!0,get:s(function(){return Azn.createDenyListAttributesProcessor},"get")});var Raa=lx();Object.defineProperty(Qa,"TimeoutError",{enumerable:!0,get:s(function(){return Raa.TimeoutError},"get")})});var UUt=z(Tee=>{"use strict";Object.defineProperty(Tee,"__esModule",{value:!0});Tee.AggregationTemporalityPreference=void 0;var Maa;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE",e[e.LOWMEMORY=2]="LOWMEMORY"})(Maa=Tee.AggregationTemporalityPreference||(Tee.AggregationTemporalityPreference={}))});var DAe,Pzn=b(()=>{DAe=class{static{s(this,"OTLPExporterBase")}_delegate;constructor(t){this._delegate=t}export(t,r){this._delegate.export(t,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}});var g1,NAe=b(()=>{g1=class extends Error{static{s(this,"OTLPExporterError")}code;name="OTLPExporterError";data;constructor(t,r,o){super(t),this.data=o,this.code=r}}});function $aa(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function zAe(e){if(e!=null)return async()=>e}function jAe(e,t,r){return{timeoutMillis:$aa(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}function LAe(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var Eee=b(()=>{s($aa,"validateTimeoutMillis");s(zAe,"wrapStaticHeadersInFunction");s(jAe,"mergeOtlpSharedConfigurationWithDefaults");s(LAe,"getSharedConfigurationDefaults")});var J5,Rzn=b(()=>{(function(e){e.NONE="none",e.GZIP="gzip"})(J5||(J5={}))});function BAe(e){return new FUt(e.concurrencyLimit)}var FUt,qUt=b(()=>{FUt=class{static{s(this,"BoundedQueueExportPromiseHandler")}_concurrencyLimit;_sendingPromises=[];constructor(t){this._concurrencyLimit=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(t);let r=s(()=>{let o=this._sendingPromises.indexOf(t);this._sendingPromises.splice(o,1)},"popPromise");t.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};s(BAe,"createBoundedQueueExportPromiseHandler")});function Oaa(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function Mzn(){return{handleResponse(e){e==null||!Oaa(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||ns.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}var $zn=b(()=>{fn();s(Oaa,"isPartialSuccessResponse");s(Mzn,"createLoggingPartialSuccessResponseHandler")});function UAe(e,t){return new ZUt(e.transport,e.serializer,Mzn(),e.promiseHandler,t.timeout)}var cE,ZUt,VUt=b(()=>{cE=ht(ps());NAe();$zn();fn();ZUt=class{static{s(this,"OTLPExportDelegate")}_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(t,r,o,n,i){this._transport=t,this._serializer=r,this._responseHandler=o,this._promiseQueue=n,this._timeout=i,this._diagLogger=ns.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,r){if(this._diagLogger.debug("items to be sent",t),this._promiseQueue.hasReachedLimit()){r({code:cE.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}let o=this._serializer.serializeRequest(t);if(o==null){r({code:cE.ExportResultCode.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(o,this._timeout).then(n=>{if(n.status==="success"){if(n.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(n.data))}catch(i){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,n.data)}r({code:cE.ExportResultCode.SUCCESS});return}else if(n.status==="failure"&&n.error){r({code:cE.ExportResultCode.FAILED,error:n.error});return}else n.status==="retryable"?r({code:cE.ExportResultCode.FAILED,error:n.error??new g1("Export failed with retryable status")}):r({code:cE.ExportResultCode.FAILED,error:new g1("Export failed with unknown error")})},n=>r({code:cE.ExportResultCode.FAILED,error:n})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}};s(UAe,"createOtlpExportDelegate")});function Ozn(e,t,r){return UAe({transport:r,serializer:t,promiseHandler:BAe(e)},{timeout:e.timeoutMillis})}var Dzn=b(()=>{qUt();VUt();s(Ozn,"createOtlpNetworkExportDelegate")});var GUt={};mr(GUt,{CompressionAlgorithm:()=>J5,OTLPExporterBase:()=>DAe,OTLPExporterError:()=>g1,createOtlpNetworkExportDelegate:()=>Ozn,getSharedConfigurationDefaults:()=>LAe,mergeOtlpSharedConfigurationWithDefaults:()=>jAe});var FAe=b(()=>{Pzn();NAe();Eee();Rzn();Dzn()});var HUt=z(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.OTLPMetricExporterBase=_c.LowMemoryTemporalitySelector=_c.DeltaTemporalitySelector=_c.CumulativeTemporalitySelector=void 0;var Daa=ps(),Fu=OAe(),Nzn=UUt(),Naa=(FAe(),Mr(GUt)),zaa=(fn(),Mr(co)),jaa=s(()=>Fu.AggregationTemporality.CUMULATIVE,"CumulativeTemporalitySelector");_c.CumulativeTemporalitySelector=jaa;var Laa=s(e=>{switch(e){case Fu.InstrumentType.COUNTER:case Fu.InstrumentType.OBSERVABLE_COUNTER:case Fu.InstrumentType.GAUGE:case Fu.InstrumentType.HISTOGRAM:case Fu.InstrumentType.OBSERVABLE_GAUGE:return Fu.AggregationTemporality.DELTA;case Fu.InstrumentType.UP_DOWN_COUNTER:case Fu.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return Fu.AggregationTemporality.CUMULATIVE}},"DeltaTemporalitySelector");_c.DeltaTemporalitySelector=Laa;var Baa=s(e=>{switch(e){case Fu.InstrumentType.COUNTER:case Fu.InstrumentType.HISTOGRAM:return Fu.AggregationTemporality.DELTA;case Fu.InstrumentType.GAUGE:case Fu.InstrumentType.UP_DOWN_COUNTER:case Fu.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:case Fu.InstrumentType.OBSERVABLE_COUNTER:case Fu.InstrumentType.OBSERVABLE_GAUGE:return Fu.AggregationTemporality.CUMULATIVE}},"LowMemoryTemporalitySelector");_c.LowMemoryTemporalitySelector=Baa;function Uaa(){let e=((0,Daa.getStringFromEnv)("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE")??"cumulative").toLowerCase();return e==="cumulative"?_c.CumulativeTemporalitySelector:e==="delta"?_c.DeltaTemporalitySelector:e==="lowmemory"?_c.LowMemoryTemporalitySelector:(zaa.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${e}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),_c.CumulativeTemporalitySelector)}s(Uaa,"chooseTemporalitySelectorFromEnvironment");function Faa(e){return e!=null?e===Nzn.AggregationTemporalityPreference.DELTA?_c.DeltaTemporalitySelector:e===Nzn.AggregationTemporalityPreference.LOWMEMORY?_c.LowMemoryTemporalitySelector:_c.CumulativeTemporalitySelector:Uaa()}s(Faa,"chooseTemporalitySelector");var qaa=Object.freeze({type:Fu.AggregationType.DEFAULT});function Zaa(e){return e?.aggregationPreference??(()=>qaa)}s(Zaa,"chooseAggregationSelector");var WUt=class extends Naa.OTLPExporterBase{static{s(this,"OTLPMetricExporterBase")}_aggregationTemporalitySelector;_aggregationSelector;constructor(t,r){super(t),this._aggregationSelector=Zaa(r),this._aggregationTemporalitySelector=Faa(r?.temporalityPreference)}selectAggregation(t){return this._aggregationSelector(t)}selectAggregationTemporality(t){return this._aggregationTemporalitySelector(t)}};_c.OTLPMetricExporterBase=WUt});var jzn=z((RDu,zzn)=>{"use strict";zzn.exports=Vaa;function Vaa(e,t){for(var r=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)r[o++]=arguments[n++];return new Promise(s(function(u,l){r[o]=s(function(d){if(i)if(i=!1,d)l(d);else{for(var p=new Array(arguments.length-1),m=0;m<p.length;)p[m++]=arguments[m];u.apply(null,p)}},"callback");try{e.apply(t||null,r)}catch(c){i&&(i=!1,l(c))}},"executor"))}s(Vaa,"asPromise")});var Fzn=z(Uzn=>{"use strict";var qAe=Uzn;qAe.length=s(function(t){var r=t.length;if(!r)return 0;for(var o=0;--r%4>1&&t.charAt(r)==="=";)++o;return Math.ceil(t.length*3)/4-o},"length");var KL=new Array(64),Bzn=new Array(123);for(py=0;py<64;)Bzn[KL[py]=py<26?py+65:py<52?py+71:py<62?py-4:py-59|43]=py++;var py;qAe.encode=s(function(t,r,o){for(var n=null,i=[],a=0,u=0,l;r<o;){var c=t[r++];switch(u){case 0:i[a++]=KL[c>>2],l=(c&3)<<4,u=1;break;case 1:i[a++]=KL[l|c>>4],l=(c&15)<<2,u=2;break;case 2:i[a++]=KL[l|c>>6],i[a++]=KL[c&63],u=0;break}a>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),a=0)}return u&&(i[a++]=KL[l],i[a++]=61,u===1&&(i[a++]=61)),n?(a&&n.push(String.fromCharCode.apply(String,i.slice(0,a))),n.join("")):String.fromCharCode.apply(String,i.slice(0,a))},"encode");var Lzn="invalid encoding";qAe.decode=s(function(t,r,o){for(var n=o,i=0,a,u=0;u<t.length;){var l=t.charCodeAt(u++);if(l===61&&i>1)break;if((l=Bzn[l])===void 0)throw Error(Lzn);switch(i){case 0:a=l,i=1;break;case 1:r[o++]=a<<2|(l&48)>>4,a=l,i=2;break;case 2:r[o++]=(a&15)<<4|(l&60)>>2,a=l,i=3;break;case 3:r[o++]=(a&3)<<6|l,i=0;break}}if(i===1)throw Error(Lzn);return o-n},"decode");qAe.test=s(function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)},"test")});var Zzn=z((DDu,qzn)=>{"use strict";qzn.exports=ZAe;function ZAe(){this._listeners={}}s(ZAe,"EventEmitter");ZAe.prototype.on=s(function(t,r,o){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:r,ctx:o||this}),this},"on");ZAe.prototype.off=s(function(t,r){if(t===void 0)this._listeners={};else if(r===void 0)this._listeners[t]=[];else for(var o=this._listeners[t],n=0;n<o.length;)o[n].fn===r?o.splice(n,1):++n;return this},"off");ZAe.prototype.emit=s(function(t){var r=this._listeners[t];if(r){for(var o=[],n=1;n<arguments.length;)o.push(arguments[n++]);for(n=0;n<r.length;)r[n].fn.apply(r[n++].ctx,o)}return this},"emit")});var Qzn=z((zDu,Jzn)=>{"use strict";Jzn.exports=Vzn(Vzn);function Vzn(e){return typeof Float32Array<"u"?(function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),o=r[3]===128;function n(l,c,d){t[0]=l,c[d]=r[0],c[d+1]=r[1],c[d+2]=r[2],c[d+3]=r[3]}s(n,"writeFloat_f32_cpy");function i(l,c,d){t[0]=l,c[d]=r[3],c[d+1]=r[2],c[d+2]=r[1],c[d+3]=r[0]}s(i,"writeFloat_f32_rev"),e.writeFloatLE=o?n:i,e.writeFloatBE=o?i:n;function a(l,c){return r[0]=l[c],r[1]=l[c+1],r[2]=l[c+2],r[3]=l[c+3],t[0]}s(a,"readFloat_f32_cpy");function u(l,c){return r[3]=l[c],r[2]=l[c+1],r[1]=l[c+2],r[0]=l[c+3],t[0]}s(u,"readFloat_f32_rev"),e.readFloatLE=o?a:u,e.readFloatBE=o?u:a})():(function(){function t(o,n,i,a){var u=n<0?1:0;if(u&&(n=-n),n===0)o(1/n>0?0:2147483648,i,a);else if(isNaN(n))o(2143289344,i,a);else if(n>34028234663852886e22)o((u<<31|2139095040)>>>0,i,a);else if(n<11754943508222875e-54)o((u<<31|Math.round(n/1401298464324817e-60))>>>0,i,a);else{var l=Math.floor(Math.log(n)/Math.LN2),c=Math.round(n*Math.pow(2,-l)*8388608)&8388607;o((u<<31|l+127<<23|c)>>>0,i,a)}}s(t,"writeFloat_ieee754"),e.writeFloatLE=t.bind(null,Gzn),e.writeFloatBE=t.bind(null,Wzn);function r(o,n,i){var a=o(n,i),u=(a>>31)*2+1,l=a>>>23&255,c=a&8388607;return l===255?c?NaN:u*(1/0):l===0?u*1401298464324817e-60*c:u*Math.pow(2,l-150)*(c+8388608)}s(r,"readFloat_ieee754"),e.readFloatLE=r.bind(null,Hzn),e.readFloatBE=r.bind(null,Kzn)})(),typeof Float64Array<"u"?(function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),o=r[7]===128;function n(l,c,d){t[0]=l,c[d]=r[0],c[d+1]=r[1],c[d+2]=r[2],c[d+3]=r[3],c[d+4]=r[4],c[d+5]=r[5],c[d+6]=r[6],c[d+7]=r[7]}s(n,"writeDouble_f64_cpy");function i(l,c,d){t[0]=l,c[d]=r[7],c[d+1]=r[6],c[d+2]=r[5],c[d+3]=r[4],c[d+4]=r[3],c[d+5]=r[2],c[d+6]=r[1],c[d+7]=r[0]}s(i,"writeDouble_f64_rev"),e.writeDoubleLE=o?n:i,e.writeDoubleBE=o?i:n;function a(l,c){return r[0]=l[c],r[1]=l[c+1],r[2]=l[c+2],r[3]=l[c+3],r[4]=l[c+4],r[5]=l[c+5],r[6]=l[c+6],r[7]=l[c+7],t[0]}s(a,"readDouble_f64_cpy");function u(l,c){return r[7]=l[c],r[6]=l[c+1],r[5]=l[c+2],r[4]=l[c+3],r[3]=l[c+4],r[2]=l[c+5],r[1]=l[c+6],r[0]=l[c+7],t[0]}s(u,"readDouble_f64_rev"),e.readDoubleLE=o?a:u,e.readDoubleBE=o?u:a})():(function(){function t(o,n,i,a,u,l){var c=a<0?1:0;if(c&&(a=-a),a===0)o(0,u,l+n),o(1/a>0?0:2147483648,u,l+i);else if(isNaN(a))o(0,u,l+n),o(2146959360,u,l+i);else if(a>17976931348623157e292)o(0,u,l+n),o((c<<31|2146435072)>>>0,u,l+i);else{var d;if(a<22250738585072014e-324)d=a/5e-324,o(d>>>0,u,l+n),o((c<<31|d/4294967296)>>>0,u,l+i);else{var p=Math.floor(Math.log(a)/Math.LN2);p===1024&&(p=1023),d=a*Math.pow(2,-p),o(d*4503599627370496>>>0,u,l+n),o((c<<31|p+1023<<20|d*1048576&1048575)>>>0,u,l+i)}}}s(t,"writeDouble_ieee754"),e.writeDoubleLE=t.bind(null,Gzn,0,4),e.writeDoubleBE=t.bind(null,Wzn,4,0);function r(o,n,i,a,u){var l=o(a,u+n),c=o(a,u+i),d=(c>>31)*2+1,p=c>>>20&2047,m=4294967296*(c&1048575)+l;return p===2047?m?NaN:d*(1/0):p===0?d*5e-324*m:d*Math.pow(2,p-1075)*(m+4503599627370496)}s(r,"readDouble_ieee754"),e.readDoubleLE=r.bind(null,Hzn,0,4),e.readDoubleBE=r.bind(null,Kzn,4,0)})(),e}s(Vzn,"factory");function Gzn(e,t,r){t[r]=e&255,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}s(Gzn,"writeUintLE");function Wzn(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=e&255}s(Wzn,"writeUintBE");function Hzn(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}s(Hzn,"readUintLE");function Kzn(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}s(Kzn,"readUintBE")});var Yzn=z((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(e){}return null}s(inquire,"inquire")});var e8n=z(Xzn=>{"use strict";var KUt=Xzn;KUt.length=s(function(t){for(var r=0,o=0,n=0;n<t.length;++n)o=t.charCodeAt(n),o<128?r+=1:o<2048?r+=2:(o&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,r+=4):r+=3;return r},"utf8_length");KUt.read=s(function(t,r,o){var n=o-r;if(n<1)return"";for(var i=null,a=[],u=0,l;r<o;)l=t[r++],l<128?a[u++]=l:l>191&&l<224?a[u++]=(l&31)<<6|t[r++]&63:l>239&&l<365?(l=((l&7)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,a[u++]=55296+(l>>10),a[u++]=56320+(l&1023)):a[u++]=(l&15)<<12|(t[r++]&63)<<6|t[r++]&63,u>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),u=0);return i?(u&&i.push(String.fromCharCode.apply(String,a.slice(0,u))),i.join("")):String.fromCharCode.apply(String,a.slice(0,u))},"utf8_read");KUt.write=s(function(t,r,o){for(var n=o,i,a,u=0;u<t.length;++u)i=t.charCodeAt(u),i<128?r[o++]=i:i<2048?(r[o++]=i>>6|192,r[o++]=i&63|128):(i&64512)===55296&&((a=t.charCodeAt(u+1))&64512)===56320?(i=65536+((i&1023)<<10)+(a&1023),++u,r[o++]=i>>18|240,r[o++]=i>>12&63|128,r[o++]=i>>6&63|128,r[o++]=i&63|128):(r[o++]=i>>12|224,r[o++]=i>>6&63|128,r[o++]=i&63|128);return o-n},"utf8_write")});var r8n=z((FDu,t8n)=>{"use strict";t8n.exports=Gaa;function Gaa(e,t,r){var o=r||8192,n=o>>>1,i=null,a=o;return s(function(l){if(l<1||l>n)return e(l);a+l>o&&(i=e(o),a=0);var c=t.call(i,a,a+=l);return a&7&&(a=(a|7)+1),c},"pool_alloc")}s(Gaa,"pool")});var o8n=z((ZDu,n8n)=>{"use strict";n8n.exports=zl;var Cee=pE();function zl(e,t){this.lo=e>>>0,this.hi=t>>>0}s(zl,"LongBits");var Q5=zl.zero=new zl(0,0);Q5.toNumber=function(){return 0};Q5.zzEncode=Q5.zzDecode=function(){return this};Q5.length=function(){return 1};var Waa=zl.zeroHash="\0\0\0\0\0\0\0\0";zl.fromNumber=s(function(t){if(t===0)return Q5;var r=t<0;r&&(t=-t);var o=t>>>0,n=(t-o)/4294967296>>>0;return r&&(n=~n>>>0,o=~o>>>0,++o>4294967295&&(o=0,++n>4294967295&&(n=0))),new zl(o,n)},"fromNumber");zl.from=s(function(t){if(typeof t=="number")return zl.fromNumber(t);if(Cee.isString(t))if(Cee.Long)t=Cee.Long.fromString(t);else return zl.fromNumber(parseInt(t,10));return t.low||t.high?new zl(t.low>>>0,t.high>>>0):Q5},"from");zl.prototype.toNumber=s(function(t){if(!t&&this.hi>>>31){var r=~this.lo+1>>>0,o=~this.hi>>>0;return r||(o=o+1>>>0),-(r+o*4294967296)}return this.lo+this.hi*4294967296},"toNumber");zl.prototype.toLong=s(function(t){return Cee.Long?new Cee.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}},"toLong");var dE=String.prototype.charCodeAt;zl.fromHash=s(function(t){return t===Waa?Q5:new zl((dE.call(t,0)|dE.call(t,1)<<8|dE.call(t,2)<<16|dE.call(t,3)<<24)>>>0,(dE.call(t,4)|dE.call(t,5)<<8|dE.call(t,6)<<16|dE.call(t,7)<<24)>>>0)},"fromHash");zl.prototype.toHash=s(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)},"toHash");zl.prototype.zzEncode=s(function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},"zzEncode");zl.prototype.zzDecode=s(function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},"zzDecode");zl.prototype.length=s(function(){var t=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?r===0?t<16384?t<128?1:2:t<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:o<128?9:10},"length")});var pE=z(JUt=>{"use strict";var dn=JUt;dn.asPromise=jzn();dn.base64=Fzn();dn.EventEmitter=Zzn();dn.float=Qzn();dn.inquire=Yzn();dn.utf8=e8n();dn.pool=r8n();dn.LongBits=o8n();dn.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);dn.global=dn.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||JUt;dn.emptyArray=Object.freeze?Object.freeze([]):[];dn.emptyObject=Object.freeze?Object.freeze({}):{};dn.isInteger=Number.isInteger||s(function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t},"isInteger");dn.isString=s(function(t){return typeof t=="string"||t instanceof String},"isString");dn.isObject=s(function(t){return t&&typeof t=="object"},"isObject");dn.isset=dn.isSet=s(function(t,r){var o=t[r];return o!=null&&t.hasOwnProperty(r)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1},"isSet");dn.Buffer=(function(){try{var e=dn.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch{return null}})();dn._Buffer_from=null;dn._Buffer_allocUnsafe=null;dn.newBuffer=s(function(t){return typeof t=="number"?dn.Buffer?dn._Buffer_allocUnsafe(t):new dn.Array(t):dn.Buffer?dn._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)},"newBuffer");dn.Array=typeof Uint8Array<"u"?Uint8Array:Array;dn.Long=dn.global.dcodeIO&&dn.global.dcodeIO.Long||dn.global.Long||dn.inquire("long");dn.key2Re=/^true|false|0|1$/;dn.key32Re=/^-?(?:0|[1-9][0-9]*)$/;dn.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;dn.longToHash=s(function(t){return t?dn.LongBits.from(t).toHash():dn.LongBits.zeroHash},"longToHash");dn.longFromHash=s(function(t,r){var o=dn.LongBits.fromHash(t);return dn.Long?dn.Long.fromBits(o.lo,o.hi,r):o.toNumber(!!r)},"longFromHash");function i8n(e,t,r){for(var o=Object.keys(t),n=0;n<o.length;++n)(e[o[n]]===void 0||!r)&&(e[o[n]]=t[o[n]]);return e}s(i8n,"merge");dn.merge=i8n;dn.lcFirst=s(function(t){return t.charAt(0).toLowerCase()+t.substring(1)},"lcFirst");function a8n(e){function t(r,o){if(!(this instanceof t))return new t(r,o);Object.defineProperty(this,"message",{get:s(function(){return r},"get")}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&i8n(this,o)}return s(t,"CustomError"),t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:s(function(){return e},"get"),set:void 0,enumerable:!1,configurable:!0},toString:{value:s(function(){return this.name+": "+this.message},"value"),writable:!0,enumerable:!1,configurable:!0}}),t}s(a8n,"newError");dn.newError=a8n;dn.ProtocolError=a8n("ProtocolError");dn.oneOfGetter=s(function(t){for(var r={},o=0;o<t.length;++o)r[t[o]]=1;return function(){for(var n=Object.keys(this),i=n.length-1;i>-1;--i)if(r[n[i]]===1&&this[n[i]]!==void 0&&this[n[i]]!==null)return n[i]}},"getOneOf");dn.oneOfSetter=s(function(t){return function(r){for(var o=0;o<t.length;++o)t[o]!==r&&delete this[t[o]]}},"setOneOf");dn.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};dn._configure=function(){var e=dn.Buffer;if(!e){dn._Buffer_from=dn._Buffer_allocUnsafe=null;return}dn._Buffer_from=e.from!==Uint8Array.from&&e.from||s(function(r,o){return new e(r,o)},"Buffer_from"),dn._Buffer_allocUnsafe=e.allocUnsafe||s(function(r){return new e(r)},"Buffer_allocUnsafe")}});var nFt=z((HDu,c8n)=>{"use strict";c8n.exports=Si;var bg=pE(),QUt,VAe=bg.LongBits,s8n=bg.base64,u8n=bg.utf8;function Aee(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}s(Aee,"Op");function XUt(){}s(XUt,"noop");function Haa(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}s(Haa,"State");function Si(){this.len=0,this.head=new Aee(XUt,0,0),this.tail=this.head,this.states=null}s(Si,"Writer");var l8n=s(function(){return bg.Buffer?s(function(){return(Si.create=s(function(){return new QUt},"create_buffer"))()},"create_buffer_setup"):s(function(){return new Si},"create_array")},"create");Si.create=l8n();Si.alloc=s(function(t){return new bg.Array(t)},"alloc");bg.Array!==Array&&(Si.alloc=bg.pool(Si.alloc,bg.Array.prototype.subarray));Si.prototype._push=s(function(t,r,o){return this.tail=this.tail.next=new Aee(t,r,o),this.len+=r,this},"push");function eFt(e,t,r){t[r]=e&255}s(eFt,"writeByte");function Kaa(e,t,r){for(;e>127;)t[r++]=e&127|128,e>>>=7;t[r]=e}s(Kaa,"writeVarint32");function tFt(e,t){this.len=e,this.next=void 0,this.val=t}s(tFt,"VarintOp");tFt.prototype=Object.create(Aee.prototype);tFt.prototype.fn=Kaa;Si.prototype.uint32=s(function(t){return this.len+=(this.tail=this.tail.next=new tFt((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},"write_uint32");Si.prototype.int32=s(function(t){return t<0?this._push(rFt,10,VAe.fromNumber(t)):this.uint32(t)},"write_int32");Si.prototype.sint32=s(function(t){return this.uint32((t<<1^t>>31)>>>0)},"write_sint32");function rFt(e,t,r){for(;e.hi;)t[r++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=e.lo&127|128,e.lo=e.lo>>>7;t[r++]=e.lo}s(rFt,"writeVarint64");Si.prototype.uint64=s(function(t){var r=VAe.from(t);return this._push(rFt,r.length(),r)},"write_uint64");Si.prototype.int64=Si.prototype.uint64;Si.prototype.sint64=s(function(t){var r=VAe.from(t).zzEncode();return this._push(rFt,r.length(),r)},"write_sint64");Si.prototype.bool=s(function(t){return this._push(eFt,1,t?1:0)},"write_bool");function YUt(e,t,r){t[r]=e&255,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}s(YUt,"writeFixed32");Si.prototype.fixed32=s(function(t){return this._push(YUt,4,t>>>0)},"write_fixed32");Si.prototype.sfixed32=Si.prototype.fixed32;Si.prototype.fixed64=s(function(t){var r=VAe.from(t);return this._push(YUt,4,r.lo)._push(YUt,4,r.hi)},"write_fixed64");Si.prototype.sfixed64=Si.prototype.fixed64;Si.prototype.float=s(function(t){return this._push(bg.float.writeFloatLE,4,t)},"write_float");Si.prototype.double=s(function(t){return this._push(bg.float.writeDoubleLE,8,t)},"write_double");var Jaa=bg.Array.prototype.set?s(function(t,r,o){r.set(t,o)},"writeBytes_set"):s(function(t,r,o){for(var n=0;n<t.length;++n)r[o+n]=t[n]},"writeBytes_for");Si.prototype.bytes=s(function(t){var r=t.length>>>0;if(!r)return this._push(eFt,1,0);if(bg.isString(t)){var o=Si.alloc(r=s8n.length(t));s8n.decode(t,o,0),t=o}return this.uint32(r)._push(Jaa,r,t)},"write_bytes");Si.prototype.string=s(function(t){var r=u8n.length(t);return r?this.uint32(r)._push(u8n.write,r,t):this._push(eFt,1,0)},"write_string");Si.prototype.fork=s(function(){return this.states=new Haa(this),this.head=this.tail=new Aee(XUt,0,0),this.len=0,this},"fork");Si.prototype.reset=s(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 Aee(XUt,0,0),this.len=0),this},"reset");Si.prototype.ldelim=s(function(){var t=this.head,r=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=t.next,this.tail=r,this.len+=o),this},"ldelim");Si.prototype.finish=s(function(){for(var t=this.head.next,r=this.constructor.alloc(this.len),o=0;t;)t.fn(t.val,r,o),o+=t.len,t=t.next;return r},"finish");Si._configure=function(e){QUt=e,Si.create=l8n(),QUt._configure()}});var m8n=z((JDu,p8n)=>{"use strict";p8n.exports=gx;var d8n=nFt();(gx.prototype=Object.create(d8n.prototype)).constructor=gx;var mE=pE();function gx(){d8n.call(this)}s(gx,"BufferWriter");gx._configure=function(){gx.alloc=mE._Buffer_allocUnsafe,gx.writeBytesBuffer=mE.Buffer&&mE.Buffer.prototype instanceof Uint8Array&&mE.Buffer.prototype.set.name==="set"?s(function(t,r,o){r.set(t,o)},"writeBytesBuffer_set"):s(function(t,r,o){if(t.copy)t.copy(r,o,0,t.length);else for(var n=0;n<t.length;)r[o++]=t[n++]},"writeBytesBuffer_copy")};gx.prototype.bytes=s(function(t){mE.isString(t)&&(t=mE._Buffer_from(t,"base64"));var r=t.length>>>0;return this.uint32(r),r&&this._push(gx.writeBytesBuffer,r,t),this},"write_bytes_buffer");function Qaa(e,t,r){e.length<40?mE.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}s(Qaa,"writeStringBuffer");gx.prototype.string=s(function(t){var r=mE.Buffer.byteLength(t);return this.uint32(r),r&&this._push(Qaa,r,t),this},"write_string_buffer");gx._configure()});var aFt=z((YDu,y8n)=>{"use strict";y8n.exports=wu;var my=pE(),iFt,g8n=my.LongBits,Yaa=my.utf8;function fy(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}s(fy,"indexOutOfRange");function wu(e){this.buf=e,this.pos=0,this.len=e.length}s(wu,"Reader");var f8n=typeof Uint8Array<"u"?s(function(t){if(t instanceof Uint8Array||Array.isArray(t))return new wu(t);throw Error("illegal buffer")},"create_typed_array"):s(function(t){if(Array.isArray(t))return new wu(t);throw Error("illegal buffer")},"create_array"),_8n=s(function(){return my.Buffer?s(function(r){return(wu.create=s(function(n){return my.Buffer.isBuffer(n)?new iFt(n):f8n(n)},"create_buffer"))(r)},"create_buffer_setup"):f8n},"create");wu.create=_8n();wu.prototype._slice=my.Array.prototype.subarray||my.Array.prototype.slice;wu.prototype.uint32=s((function(){var t=4294967295;return s(function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,fy(this,10);return t},"read_uint32")}),"read_uint32_setup")();wu.prototype.int32=s(function(){return this.uint32()|0},"read_int32");wu.prototype.sint32=s(function(){var t=this.uint32();return t>>>1^-(t&1)|0},"read_sint32");function oFt(){var e=new g8n(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw fy(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw fy(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}s(oFt,"readLongVarint");wu.prototype.bool=s(function(){return this.uint32()!==0},"read_bool");function GAe(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s(GAe,"readFixed32_end");wu.prototype.fixed32=s(function(){if(this.pos+4>this.len)throw fy(this,4);return GAe(this.buf,this.pos+=4)},"read_fixed32");wu.prototype.sfixed32=s(function(){if(this.pos+4>this.len)throw fy(this,4);return GAe(this.buf,this.pos+=4)|0},"read_sfixed32");function h8n(){if(this.pos+8>this.len)throw fy(this,8);return new g8n(GAe(this.buf,this.pos+=4),GAe(this.buf,this.pos+=4))}s(h8n,"readFixed64");wu.prototype.float=s(function(){if(this.pos+4>this.len)throw fy(this,4);var t=my.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},"read_float");wu.prototype.double=s(function(){if(this.pos+8>this.len)throw fy(this,4);var t=my.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},"read_double");wu.prototype.bytes=s(function(){var t=this.uint32(),r=this.pos,o=this.pos+t;if(o>this.len)throw fy(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(r,o);if(r===o){var n=my.Buffer;return n?n.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,o)},"read_bytes");wu.prototype.string=s(function(){var t=this.bytes();return Yaa.read(t,0,t.length)},"read_string");wu.prototype.skip=s(function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw fy(this,t);this.pos+=t}else do if(this.pos>=this.len)throw fy(this);while(this.buf[this.pos++]&128);return this},"skip");wu.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this};wu._configure=function(e){iFt=e,wu.create=_8n(),iFt._configure();var t=my.Long?"toLong":"toNumber";my.merge(wu.prototype,{int64:s(function(){return oFt.call(this)[t](!1)},"read_int64"),uint64:s(function(){return oFt.call(this)[t](!0)},"read_uint64"),sint64:s(function(){return oFt.call(this).zzDecode()[t](!1)},"read_sint64"),fixed64:s(function(){return h8n.call(this)[t](!0)},"read_fixed64"),sfixed64:s(function(){return h8n.call(this)[t](!1)},"read_sfixed64")})}});var w8n=z((eNu,b8n)=>{"use strict";b8n.exports=Y5;var x8n=aFt();(Y5.prototype=Object.create(x8n.prototype)).constructor=Y5;var v8n=pE();function Y5(e){x8n.call(this,e)}s(Y5,"BufferReader");Y5._configure=function(){v8n.Buffer&&(Y5.prototype._slice=v8n.Buffer.prototype.slice)};Y5.prototype.string=s(function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},"read_string_buffer");Y5._configure()});var S8n=z((rNu,k8n)=>{"use strict";k8n.exports=Pee;var sFt=pE();(Pee.prototype=Object.create(sFt.EventEmitter.prototype)).constructor=Pee;function Pee(e,t,r){if(typeof e!="function")throw TypeError("rpcImpl must be a function");sFt.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}s(Pee,"Service");Pee.prototype.rpcCall=s(function e(t,r,o,n,i){if(!n)throw TypeError("request must be specified");var a=this;if(!i)return sFt.asPromise(e,a,t,r,o,n);if(!a.rpcImpl){setTimeout(function(){i(Error("already ended"))},0);return}try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](n).finish(),s(function(l,c){if(l)return a.emit("error",l,t),i(l);if(c===null){a.end(!0);return}if(!(c instanceof o))try{c=o[a.responseDelimited?"decodeDelimited":"decode"](c)}catch(d){return a.emit("error",d,t),i(d)}return a.emit("data",c,t),i(null,c)},"rpcCallback"))}catch(u){a.emit("error",u,t),setTimeout(function(){i(u)},0);return}},"rpcCall");Pee.prototype.end=s(function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},"end")});var T8n=z(I8n=>{"use strict";var Xaa=I8n;Xaa.Service=S8n()});var C8n=z((iNu,E8n)=>{"use strict";E8n.exports={}});var R8n=z(P8n=>{"use strict";var p0=P8n;p0.build="minimal";p0.Writer=nFt();p0.BufferWriter=m8n();p0.Reader=aFt();p0.BufferReader=w8n();p0.util=pE();p0.rpc=T8n();p0.roots=C8n();p0.configure=A8n;function A8n(){p0.util._configure(),p0.Writer._configure(p0.BufferWriter),p0.Reader._configure(p0.BufferReader)}s(A8n,"configure");A8n()});var $8n=z((uNu,M8n)=>{"use strict";M8n.exports=R8n()});var WAe=z((O8n,D8n)=>{"use strict";Object.defineProperty(O8n,"__esModule",{value:!0});var gn=$8n(),je=gn.Reader,Yn=gn.Writer,X=gn.util,J=gn.roots.default||(gn.roots.default={});J.opentelemetry=(function(){var e={};return e.proto=(function(){var t={};return t.common=(function(){var r={};return r.v1=(function(){var o={};return o.AnyValue=(function(){function n(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"AnyValue"),n.prototype.stringValue=null,n.prototype.boolValue=null,n.prototype.intValue=null,n.prototype.doubleValue=null,n.prototype.arrayValue=null,n.prototype.kvlistValue=null,n.prototype.bytesValue=null;var i;return Object.defineProperty(n.prototype,"value",{get:X.oneOfGetter(i=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){return l||(l=Yn.create()),u.stringValue!=null&&Object.hasOwnProperty.call(u,"stringValue")&&l.uint32(10).string(u.stringValue),u.boolValue!=null&&Object.hasOwnProperty.call(u,"boolValue")&&l.uint32(16).bool(u.boolValue),u.intValue!=null&&Object.hasOwnProperty.call(u,"intValue")&&l.uint32(24).int64(u.intValue),u.doubleValue!=null&&Object.hasOwnProperty.call(u,"doubleValue")&&l.uint32(33).double(u.doubleValue),u.arrayValue!=null&&Object.hasOwnProperty.call(u,"arrayValue")&&J.opentelemetry.proto.common.v1.ArrayValue.encode(u.arrayValue,l.uint32(42).fork()).ldelim(),u.kvlistValue!=null&&Object.hasOwnProperty.call(u,"kvlistValue")&&J.opentelemetry.proto.common.v1.KeyValueList.encode(u.kvlistValue,l.uint32(50).fork()).ldelim(),u.bytesValue!=null&&Object.hasOwnProperty.call(u,"bytesValue")&&l.uint32(58).bytes(u.bytesValue),l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.common.v1.AnyValue;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.stringValue=u.string();break}case 2:{p.boolValue=u.bool();break}case 3:{p.intValue=u.int64();break}case 4:{p.doubleValue=u.double();break}case 5:{p.arrayValue=J.opentelemetry.proto.common.v1.ArrayValue.decode(u,u.uint32());break}case 6:{p.kvlistValue=J.opentelemetry.proto.common.v1.KeyValueList.decode(u,u.uint32());break}case 7:{p.bytesValue=u.bytes();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.stringValue!=null&&u.hasOwnProperty("stringValue")&&(l.value=1,!X.isString(u.stringValue)))return"stringValue: string expected";if(u.boolValue!=null&&u.hasOwnProperty("boolValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof u.boolValue!="boolean")return"boolValue: boolean expected"}if(u.intValue!=null&&u.hasOwnProperty("intValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!X.isInteger(u.intValue)&&!(u.intValue&&X.isInteger(u.intValue.low)&&X.isInteger(u.intValue.high)))return"intValue: integer|Long expected"}if(u.doubleValue!=null&&u.hasOwnProperty("doubleValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof u.doubleValue!="number")return"doubleValue: number expected"}if(u.arrayValue!=null&&u.hasOwnProperty("arrayValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=J.opentelemetry.proto.common.v1.ArrayValue.verify(u.arrayValue);if(c)return"arrayValue."+c}}if(u.kvlistValue!=null&&u.hasOwnProperty("kvlistValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=J.opentelemetry.proto.common.v1.KeyValueList.verify(u.kvlistValue);if(c)return"kvlistValue."+c}}if(u.bytesValue!=null&&u.hasOwnProperty("bytesValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!(u.bytesValue&&typeof u.bytesValue.length=="number"||X.isString(u.bytesValue)))return"bytesValue: buffer expected"}return null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.common.v1.AnyValue)return u;var l=new J.opentelemetry.proto.common.v1.AnyValue;if(u.stringValue!=null&&(l.stringValue=String(u.stringValue)),u.boolValue!=null&&(l.boolValue=!!u.boolValue),u.intValue!=null&&(X.Long?(l.intValue=X.Long.fromValue(u.intValue)).unsigned=!1:typeof u.intValue=="string"?l.intValue=parseInt(u.intValue,10):typeof u.intValue=="number"?l.intValue=u.intValue:typeof u.intValue=="object"&&(l.intValue=new X.LongBits(u.intValue.low>>>0,u.intValue.high>>>0).toNumber())),u.doubleValue!=null&&(l.doubleValue=Number(u.doubleValue)),u.arrayValue!=null){if(typeof u.arrayValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");l.arrayValue=J.opentelemetry.proto.common.v1.ArrayValue.fromObject(u.arrayValue)}if(u.kvlistValue!=null){if(typeof u.kvlistValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");l.kvlistValue=J.opentelemetry.proto.common.v1.KeyValueList.fromObject(u.kvlistValue)}return u.bytesValue!=null&&(typeof u.bytesValue=="string"?X.base64.decode(u.bytesValue,l.bytesValue=X.newBuffer(X.base64.length(u.bytesValue)),0):u.bytesValue.length>=0&&(l.bytesValue=u.bytesValue)),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};return u.stringValue!=null&&u.hasOwnProperty("stringValue")&&(c.stringValue=u.stringValue,l.oneofs&&(c.value="stringValue")),u.boolValue!=null&&u.hasOwnProperty("boolValue")&&(c.boolValue=u.boolValue,l.oneofs&&(c.value="boolValue")),u.intValue!=null&&u.hasOwnProperty("intValue")&&(typeof u.intValue=="number"?c.intValue=l.longs===String?String(u.intValue):u.intValue:c.intValue=l.longs===String?X.Long.prototype.toString.call(u.intValue):l.longs===Number?new X.LongBits(u.intValue.low>>>0,u.intValue.high>>>0).toNumber():u.intValue,l.oneofs&&(c.value="intValue")),u.doubleValue!=null&&u.hasOwnProperty("doubleValue")&&(c.doubleValue=l.json&&!isFinite(u.doubleValue)?String(u.doubleValue):u.doubleValue,l.oneofs&&(c.value="doubleValue")),u.arrayValue!=null&&u.hasOwnProperty("arrayValue")&&(c.arrayValue=J.opentelemetry.proto.common.v1.ArrayValue.toObject(u.arrayValue,l),l.oneofs&&(c.value="arrayValue")),u.kvlistValue!=null&&u.hasOwnProperty("kvlistValue")&&(c.kvlistValue=J.opentelemetry.proto.common.v1.KeyValueList.toObject(u.kvlistValue,l),l.oneofs&&(c.value="kvlistValue")),u.bytesValue!=null&&u.hasOwnProperty("bytesValue")&&(c.bytesValue=l.bytes===String?X.base64.encode(u.bytesValue,0,u.bytesValue.length):l.bytes===Array?Array.prototype.slice.call(u.bytesValue):u.bytesValue,l.oneofs&&(c.value="bytesValue")),c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.common.v1.AnyValue"},"getTypeUrl"),n})(),o.ArrayValue=(function(){function n(i){if(this.values=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ArrayValue"),n.prototype.values=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.values!=null&&a.values.length)for(var l=0;l<a.values.length;++l)J.opentelemetry.proto.common.v1.AnyValue.encode(a.values[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.ArrayValue;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.values&&d.values.length||(d.values=[]),d.values.push(J.opentelemetry.proto.common.v1.AnyValue.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.values!=null&&a.hasOwnProperty("values")){if(!Array.isArray(a.values))return"values: array expected";for(var u=0;u<a.values.length;++u){var l=J.opentelemetry.proto.common.v1.AnyValue.verify(a.values[u]);if(l)return"values."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.ArrayValue)return a;var u=new J.opentelemetry.proto.common.v1.ArrayValue;if(a.values){if(!Array.isArray(a.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");u.values=[];for(var l=0;l<a.values.length;++l){if(typeof a.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");u.values[l]=J.opentelemetry.proto.common.v1.AnyValue.fromObject(a.values[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.values=[]),a.values&&a.values.length){l.values=[];for(var c=0;c<a.values.length;++c)l.values[c]=J.opentelemetry.proto.common.v1.AnyValue.toObject(a.values[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.ArrayValue"},"getTypeUrl"),n})(),o.KeyValueList=(function(){function n(i){if(this.values=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"KeyValueList"),n.prototype.values=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.values!=null&&a.values.length)for(var l=0;l<a.values.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.values[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.KeyValueList;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.values&&d.values.length||(d.values=[]),d.values.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.values!=null&&a.hasOwnProperty("values")){if(!Array.isArray(a.values))return"values: array expected";for(var u=0;u<a.values.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.values[u]);if(l)return"values."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.KeyValueList)return a;var u=new J.opentelemetry.proto.common.v1.KeyValueList;if(a.values){if(!Array.isArray(a.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");u.values=[];for(var l=0;l<a.values.length;++l){if(typeof a.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");u.values[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.values[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.values=[]),a.values&&a.values.length){l.values=[];for(var c=0;c<a.values.length;++c)l.values[c]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.values[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.KeyValueList"},"getTypeUrl"),n})(),o.KeyValue=(function(){function n(i){if(i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"KeyValue"),n.prototype.key=null,n.prototype.value=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){return u||(u=Yn.create()),a.key!=null&&Object.hasOwnProperty.call(a,"key")&&u.uint32(10).string(a.key),a.value!=null&&Object.hasOwnProperty.call(a,"value")&&J.opentelemetry.proto.common.v1.AnyValue.encode(a.value,u.uint32(18).fork()).ldelim(),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.KeyValue;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.key=a.string();break}case 2:{d.value=J.opentelemetry.proto.common.v1.AnyValue.decode(a,a.uint32());break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.key!=null&&a.hasOwnProperty("key")&&!X.isString(a.key))return"key: string expected";if(a.value!=null&&a.hasOwnProperty("value")){var u=J.opentelemetry.proto.common.v1.AnyValue.verify(a.value);if(u)return"value."+u}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.KeyValue)return a;var u=new J.opentelemetry.proto.common.v1.KeyValue;if(a.key!=null&&(u.key=String(a.key)),a.value!=null){if(typeof a.value!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");u.value=J.opentelemetry.proto.common.v1.AnyValue.fromObject(a.value)}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};return u.defaults&&(l.key="",l.value=null),a.key!=null&&a.hasOwnProperty("key")&&(l.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(l.value=J.opentelemetry.proto.common.v1.AnyValue.toObject(a.value,u)),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.KeyValue"},"getTypeUrl"),n})(),o.InstrumentationScope=(function(){function n(i){if(this.attributes=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"InstrumentationScope"),n.prototype.name=null,n.prototype.version=null,n.prototype.attributes=X.emptyArray,n.prototype.droppedAttributesCount=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.name!=null&&Object.hasOwnProperty.call(a,"name")&&u.uint32(10).string(a.name),a.version!=null&&Object.hasOwnProperty.call(a,"version")&&u.uint32(18).string(a.version),a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(26).fork()).ldelim();return a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&u.uint32(32).uint32(a.droppedAttributesCount),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.InstrumentationScope;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.name=a.string();break}case 2:{d.version=a.string();break}case 3:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 4:{d.droppedAttributesCount=a.uint32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.name!=null&&a.hasOwnProperty("name")&&!X.isString(a.name))return"name: string expected";if(a.version!=null&&a.hasOwnProperty("version")&&!X.isString(a.version))return"version: string expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(l)return"attributes."+l}}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(a.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.InstrumentationScope)return a;var u=new J.opentelemetry.proto.common.v1.InstrumentationScope;if(a.name!=null&&(u.name=String(a.name)),a.version!=null&&(u.version=String(a.version)),a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}return a.droppedAttributesCount!=null&&(u.droppedAttributesCount=a.droppedAttributesCount>>>0),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.attributes=[]),u.defaults&&(l.name="",l.version="",l.droppedAttributesCount=0),a.name!=null&&a.hasOwnProperty("name")&&(l.name=a.name),a.version!=null&&a.hasOwnProperty("version")&&(l.version=a.version),a.attributes&&a.attributes.length){l.attributes=[];for(var c=0;c<a.attributes.length;++c)l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[c],u)}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=a.droppedAttributesCount),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.InstrumentationScope"},"getTypeUrl"),n})(),o.EntityRef=(function(){function n(i){if(this.idKeys=[],this.descriptionKeys=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"EntityRef"),n.prototype.schemaUrl=null,n.prototype.type=null,n.prototype.idKeys=X.emptyArray,n.prototype.descriptionKeys=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(10).string(a.schemaUrl),a.type!=null&&Object.hasOwnProperty.call(a,"type")&&u.uint32(18).string(a.type),a.idKeys!=null&&a.idKeys.length)for(var l=0;l<a.idKeys.length;++l)u.uint32(26).string(a.idKeys[l]);if(a.descriptionKeys!=null&&a.descriptionKeys.length)for(var l=0;l<a.descriptionKeys.length;++l)u.uint32(34).string(a.descriptionKeys[l]);return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.EntityRef;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.schemaUrl=a.string();break}case 2:{d.type=a.string();break}case 3:{d.idKeys&&d.idKeys.length||(d.idKeys=[]),d.idKeys.push(a.string());break}case 4:{d.descriptionKeys&&d.descriptionKeys.length||(d.descriptionKeys=[]),d.descriptionKeys.push(a.string());break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl))return"schemaUrl: string expected";if(a.type!=null&&a.hasOwnProperty("type")&&!X.isString(a.type))return"type: string expected";if(a.idKeys!=null&&a.hasOwnProperty("idKeys")){if(!Array.isArray(a.idKeys))return"idKeys: array expected";for(var u=0;u<a.idKeys.length;++u)if(!X.isString(a.idKeys[u]))return"idKeys: string[] expected"}if(a.descriptionKeys!=null&&a.hasOwnProperty("descriptionKeys")){if(!Array.isArray(a.descriptionKeys))return"descriptionKeys: array expected";for(var u=0;u<a.descriptionKeys.length;++u)if(!X.isString(a.descriptionKeys[u]))return"descriptionKeys: string[] expected"}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.EntityRef)return a;var u=new J.opentelemetry.proto.common.v1.EntityRef;if(a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),a.type!=null&&(u.type=String(a.type)),a.idKeys){if(!Array.isArray(a.idKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected");u.idKeys=[];for(var l=0;l<a.idKeys.length;++l)u.idKeys[l]=String(a.idKeys[l])}if(a.descriptionKeys){if(!Array.isArray(a.descriptionKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected");u.descriptionKeys=[];for(var l=0;l<a.descriptionKeys.length;++l)u.descriptionKeys[l]=String(a.descriptionKeys[l])}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.idKeys=[],l.descriptionKeys=[]),u.defaults&&(l.schemaUrl="",l.type=""),a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),a.type!=null&&a.hasOwnProperty("type")&&(l.type=a.type),a.idKeys&&a.idKeys.length){l.idKeys=[];for(var c=0;c<a.idKeys.length;++c)l.idKeys[c]=a.idKeys[c]}if(a.descriptionKeys&&a.descriptionKeys.length){l.descriptionKeys=[];for(var c=0;c<a.descriptionKeys.length;++c)l.descriptionKeys[c]=a.descriptionKeys[c]}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.EntityRef"},"getTypeUrl"),n})(),o})(),r})(),t.resource=(function(){var r={};return r.v1=(function(){var o={};return o.Resource=(function(){function n(i){if(this.attributes=[],this.entityRefs=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Resource"),n.prototype.attributes=X.emptyArray,n.prototype.droppedAttributesCount=null,n.prototype.entityRefs=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(10).fork()).ldelim();if(a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&u.uint32(16).uint32(a.droppedAttributesCount),a.entityRefs!=null&&a.entityRefs.length)for(var l=0;l<a.entityRefs.length;++l)J.opentelemetry.proto.common.v1.EntityRef.encode(a.entityRefs[l],u.uint32(26).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.resource.v1.Resource;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 2:{d.droppedAttributesCount=a.uint32();break}case 3:{d.entityRefs&&d.entityRefs.length||(d.entityRefs=[]),d.entityRefs.push(J.opentelemetry.proto.common.v1.EntityRef.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(l)return"attributes."+l}}if(a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(a.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(a.entityRefs!=null&&a.hasOwnProperty("entityRefs")){if(!Array.isArray(a.entityRefs))return"entityRefs: array expected";for(var u=0;u<a.entityRefs.length;++u){var l=J.opentelemetry.proto.common.v1.EntityRef.verify(a.entityRefs[u]);if(l)return"entityRefs."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.resource.v1.Resource)return a;var u=new J.opentelemetry.proto.resource.v1.Resource;if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}if(a.droppedAttributesCount!=null&&(u.droppedAttributesCount=a.droppedAttributesCount>>>0),a.entityRefs){if(!Array.isArray(a.entityRefs))throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected");u.entityRefs=[];for(var l=0;l<a.entityRefs.length;++l){if(typeof a.entityRefs[l]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected");u.entityRefs[l]=J.opentelemetry.proto.common.v1.EntityRef.fromObject(a.entityRefs[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.attributes=[],l.entityRefs=[]),u.defaults&&(l.droppedAttributesCount=0),a.attributes&&a.attributes.length){l.attributes=[];for(var c=0;c<a.attributes.length;++c)l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[c],u)}if(a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=a.droppedAttributesCount),a.entityRefs&&a.entityRefs.length){l.entityRefs=[];for(var c=0;c<a.entityRefs.length;++c)l.entityRefs[c]=J.opentelemetry.proto.common.v1.EntityRef.toObject(a.entityRefs[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.resource.v1.Resource"},"getTypeUrl"),n})(),o})(),r})(),t.trace=(function(){var r={};return r.v1=(function(){var o={};return o.TracesData=(function(){function n(i){if(this.resourceSpans=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"TracesData"),n.prototype.resourceSpans=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resourceSpans!=null&&a.resourceSpans.length)for(var l=0;l<a.resourceSpans.length;++l)J.opentelemetry.proto.trace.v1.ResourceSpans.encode(a.resourceSpans[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.TracesData;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resourceSpans&&d.resourceSpans.length||(d.resourceSpans=[]),d.resourceSpans.push(J.opentelemetry.proto.trace.v1.ResourceSpans.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceSpans!=null&&a.hasOwnProperty("resourceSpans")){if(!Array.isArray(a.resourceSpans))return"resourceSpans: array expected";for(var u=0;u<a.resourceSpans.length;++u){var l=J.opentelemetry.proto.trace.v1.ResourceSpans.verify(a.resourceSpans[u]);if(l)return"resourceSpans."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.TracesData)return a;var u=new J.opentelemetry.proto.trace.v1.TracesData;if(a.resourceSpans){if(!Array.isArray(a.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");u.resourceSpans=[];for(var l=0;l<a.resourceSpans.length;++l){if(typeof a.resourceSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");u.resourceSpans[l]=J.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(a.resourceSpans[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.resourceSpans=[]),a.resourceSpans&&a.resourceSpans.length){l.resourceSpans=[];for(var c=0;c<a.resourceSpans.length;++c)l.resourceSpans[c]=J.opentelemetry.proto.trace.v1.ResourceSpans.toObject(a.resourceSpans[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.TracesData"},"getTypeUrl"),n})(),o.ResourceSpans=(function(){function n(i){if(this.scopeSpans=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ResourceSpans"),n.prototype.resource=null,n.prototype.scopeSpans=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resource!=null&&Object.hasOwnProperty.call(a,"resource")&&J.opentelemetry.proto.resource.v1.Resource.encode(a.resource,u.uint32(10).fork()).ldelim(),a.scopeSpans!=null&&a.scopeSpans.length)for(var l=0;l<a.scopeSpans.length;++l)J.opentelemetry.proto.trace.v1.ScopeSpans.encode(a.scopeSpans[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.ResourceSpans;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resource=J.opentelemetry.proto.resource.v1.Resource.decode(a,a.uint32());break}case 2:{d.scopeSpans&&d.scopeSpans.length||(d.scopeSpans=[]),d.scopeSpans.push(J.opentelemetry.proto.trace.v1.ScopeSpans.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resource!=null&&a.hasOwnProperty("resource")){var u=J.opentelemetry.proto.resource.v1.Resource.verify(a.resource);if(u)return"resource."+u}if(a.scopeSpans!=null&&a.hasOwnProperty("scopeSpans")){if(!Array.isArray(a.scopeSpans))return"scopeSpans: array expected";for(var l=0;l<a.scopeSpans.length;++l){var u=J.opentelemetry.proto.trace.v1.ScopeSpans.verify(a.scopeSpans[l]);if(u)return"scopeSpans."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.ResourceSpans)return a;var u=new J.opentelemetry.proto.trace.v1.ResourceSpans;if(a.resource!=null){if(typeof a.resource!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");u.resource=J.opentelemetry.proto.resource.v1.Resource.fromObject(a.resource)}if(a.scopeSpans){if(!Array.isArray(a.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");u.scopeSpans=[];for(var l=0;l<a.scopeSpans.length;++l){if(typeof a.scopeSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");u.scopeSpans[l]=J.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(a.scopeSpans[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.scopeSpans=[]),u.defaults&&(l.resource=null,l.schemaUrl=""),a.resource!=null&&a.hasOwnProperty("resource")&&(l.resource=J.opentelemetry.proto.resource.v1.Resource.toObject(a.resource,u)),a.scopeSpans&&a.scopeSpans.length){l.scopeSpans=[];for(var c=0;c<a.scopeSpans.length;++c)l.scopeSpans[c]=J.opentelemetry.proto.trace.v1.ScopeSpans.toObject(a.scopeSpans[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.ResourceSpans"},"getTypeUrl"),n})(),o.ScopeSpans=(function(){function n(i){if(this.spans=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ScopeSpans"),n.prototype.scope=null,n.prototype.spans=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.scope!=null&&Object.hasOwnProperty.call(a,"scope")&&J.opentelemetry.proto.common.v1.InstrumentationScope.encode(a.scope,u.uint32(10).fork()).ldelim(),a.spans!=null&&a.spans.length)for(var l=0;l<a.spans.length;++l)J.opentelemetry.proto.trace.v1.Span.encode(a.spans[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.ScopeSpans;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.decode(a,a.uint32());break}case 2:{d.spans&&d.spans.length||(d.spans=[]),d.spans.push(J.opentelemetry.proto.trace.v1.Span.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.scope!=null&&a.hasOwnProperty("scope")){var u=J.opentelemetry.proto.common.v1.InstrumentationScope.verify(a.scope);if(u)return"scope."+u}if(a.spans!=null&&a.hasOwnProperty("spans")){if(!Array.isArray(a.spans))return"spans: array expected";for(var l=0;l<a.spans.length;++l){var u=J.opentelemetry.proto.trace.v1.Span.verify(a.spans[l]);if(u)return"spans."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.ScopeSpans)return a;var u=new J.opentelemetry.proto.trace.v1.ScopeSpans;if(a.scope!=null){if(typeof a.scope!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");u.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(a.scope)}if(a.spans){if(!Array.isArray(a.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");u.spans=[];for(var l=0;l<a.spans.length;++l){if(typeof a.spans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");u.spans[l]=J.opentelemetry.proto.trace.v1.Span.fromObject(a.spans[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.spans=[]),u.defaults&&(l.scope=null,l.schemaUrl=""),a.scope!=null&&a.hasOwnProperty("scope")&&(l.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.toObject(a.scope,u)),a.spans&&a.spans.length){l.spans=[];for(var c=0;c<a.spans.length;++c)l.spans[c]=J.opentelemetry.proto.trace.v1.Span.toObject(a.spans[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.ScopeSpans"},"getTypeUrl"),n})(),o.Span=(function(){function n(i){if(this.attributes=[],this.events=[],this.links=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Span"),n.prototype.traceId=null,n.prototype.spanId=null,n.prototype.traceState=null,n.prototype.parentSpanId=null,n.prototype.flags=null,n.prototype.name=null,n.prototype.kind=null,n.prototype.startTimeUnixNano=null,n.prototype.endTimeUnixNano=null,n.prototype.attributes=X.emptyArray,n.prototype.droppedAttributesCount=null,n.prototype.events=X.emptyArray,n.prototype.droppedEventsCount=null,n.prototype.links=X.emptyArray,n.prototype.droppedLinksCount=null,n.prototype.status=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.traceId!=null&&Object.hasOwnProperty.call(a,"traceId")&&u.uint32(10).bytes(a.traceId),a.spanId!=null&&Object.hasOwnProperty.call(a,"spanId")&&u.uint32(18).bytes(a.spanId),a.traceState!=null&&Object.hasOwnProperty.call(a,"traceState")&&u.uint32(26).string(a.traceState),a.parentSpanId!=null&&Object.hasOwnProperty.call(a,"parentSpanId")&&u.uint32(34).bytes(a.parentSpanId),a.name!=null&&Object.hasOwnProperty.call(a,"name")&&u.uint32(42).string(a.name),a.kind!=null&&Object.hasOwnProperty.call(a,"kind")&&u.uint32(48).int32(a.kind),a.startTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"startTimeUnixNano")&&u.uint32(57).fixed64(a.startTimeUnixNano),a.endTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"endTimeUnixNano")&&u.uint32(65).fixed64(a.endTimeUnixNano),a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(74).fork()).ldelim();if(a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&u.uint32(80).uint32(a.droppedAttributesCount),a.events!=null&&a.events.length)for(var l=0;l<a.events.length;++l)J.opentelemetry.proto.trace.v1.Span.Event.encode(a.events[l],u.uint32(90).fork()).ldelim();if(a.droppedEventsCount!=null&&Object.hasOwnProperty.call(a,"droppedEventsCount")&&u.uint32(96).uint32(a.droppedEventsCount),a.links!=null&&a.links.length)for(var l=0;l<a.links.length;++l)J.opentelemetry.proto.trace.v1.Span.Link.encode(a.links[l],u.uint32(106).fork()).ldelim();return a.droppedLinksCount!=null&&Object.hasOwnProperty.call(a,"droppedLinksCount")&&u.uint32(112).uint32(a.droppedLinksCount),a.status!=null&&Object.hasOwnProperty.call(a,"status")&&J.opentelemetry.proto.trace.v1.Status.encode(a.status,u.uint32(122).fork()).ldelim(),a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&u.uint32(133).fixed32(a.flags),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.Span;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.traceId=a.bytes();break}case 2:{d.spanId=a.bytes();break}case 3:{d.traceState=a.string();break}case 4:{d.parentSpanId=a.bytes();break}case 16:{d.flags=a.fixed32();break}case 5:{d.name=a.string();break}case 6:{d.kind=a.int32();break}case 7:{d.startTimeUnixNano=a.fixed64();break}case 8:{d.endTimeUnixNano=a.fixed64();break}case 9:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 10:{d.droppedAttributesCount=a.uint32();break}case 11:{d.events&&d.events.length||(d.events=[]),d.events.push(J.opentelemetry.proto.trace.v1.Span.Event.decode(a,a.uint32()));break}case 12:{d.droppedEventsCount=a.uint32();break}case 13:{d.links&&d.links.length||(d.links=[]),d.links.push(J.opentelemetry.proto.trace.v1.Span.Link.decode(a,a.uint32()));break}case 14:{d.droppedLinksCount=a.uint32();break}case 15:{d.status=J.opentelemetry.proto.trace.v1.Status.decode(a,a.uint32());break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.traceId!=null&&a.hasOwnProperty("traceId")&&!(a.traceId&&typeof a.traceId.length=="number"||X.isString(a.traceId)))return"traceId: buffer expected";if(a.spanId!=null&&a.hasOwnProperty("spanId")&&!(a.spanId&&typeof a.spanId.length=="number"||X.isString(a.spanId)))return"spanId: buffer expected";if(a.traceState!=null&&a.hasOwnProperty("traceState")&&!X.isString(a.traceState))return"traceState: string expected";if(a.parentSpanId!=null&&a.hasOwnProperty("parentSpanId")&&!(a.parentSpanId&&typeof a.parentSpanId.length=="number"||X.isString(a.parentSpanId)))return"parentSpanId: buffer expected";if(a.flags!=null&&a.hasOwnProperty("flags")&&!X.isInteger(a.flags))return"flags: integer expected";if(a.name!=null&&a.hasOwnProperty("name")&&!X.isString(a.name))return"name: string expected";if(a.kind!=null&&a.hasOwnProperty("kind"))switch(a.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(a.startTimeUnixNano)&&!(a.startTimeUnixNano&&X.isInteger(a.startTimeUnixNano.low)&&X.isInteger(a.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(a.endTimeUnixNano!=null&&a.hasOwnProperty("endTimeUnixNano")&&!X.isInteger(a.endTimeUnixNano)&&!(a.endTimeUnixNano&&X.isInteger(a.endTimeUnixNano.low)&&X.isInteger(a.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(l)return"attributes."+l}}if(a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(a.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(a.events!=null&&a.hasOwnProperty("events")){if(!Array.isArray(a.events))return"events: array expected";for(var u=0;u<a.events.length;++u){var l=J.opentelemetry.proto.trace.v1.Span.Event.verify(a.events[u]);if(l)return"events."+l}}if(a.droppedEventsCount!=null&&a.hasOwnProperty("droppedEventsCount")&&!X.isInteger(a.droppedEventsCount))return"droppedEventsCount: integer expected";if(a.links!=null&&a.hasOwnProperty("links")){if(!Array.isArray(a.links))return"links: array expected";for(var u=0;u<a.links.length;++u){var l=J.opentelemetry.proto.trace.v1.Span.Link.verify(a.links[u]);if(l)return"links."+l}}if(a.droppedLinksCount!=null&&a.hasOwnProperty("droppedLinksCount")&&!X.isInteger(a.droppedLinksCount))return"droppedLinksCount: integer expected";if(a.status!=null&&a.hasOwnProperty("status")){var l=J.opentelemetry.proto.trace.v1.Status.verify(a.status);if(l)return"status."+l}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.Span)return a;var u=new J.opentelemetry.proto.trace.v1.Span;switch(a.traceId!=null&&(typeof a.traceId=="string"?X.base64.decode(a.traceId,u.traceId=X.newBuffer(X.base64.length(a.traceId)),0):a.traceId.length>=0&&(u.traceId=a.traceId)),a.spanId!=null&&(typeof a.spanId=="string"?X.base64.decode(a.spanId,u.spanId=X.newBuffer(X.base64.length(a.spanId)),0):a.spanId.length>=0&&(u.spanId=a.spanId)),a.traceState!=null&&(u.traceState=String(a.traceState)),a.parentSpanId!=null&&(typeof a.parentSpanId=="string"?X.base64.decode(a.parentSpanId,u.parentSpanId=X.newBuffer(X.base64.length(a.parentSpanId)),0):a.parentSpanId.length>=0&&(u.parentSpanId=a.parentSpanId)),a.flags!=null&&(u.flags=a.flags>>>0),a.name!=null&&(u.name=String(a.name)),a.kind){default:if(typeof a.kind=="number"){u.kind=a.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:u.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:u.kind=1;break;case"SPAN_KIND_SERVER":case 2:u.kind=2;break;case"SPAN_KIND_CLIENT":case 3:u.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:u.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:u.kind=5;break}if(a.startTimeUnixNano!=null&&(X.Long?(u.startTimeUnixNano=X.Long.fromValue(a.startTimeUnixNano)).unsigned=!1:typeof a.startTimeUnixNano=="string"?u.startTimeUnixNano=parseInt(a.startTimeUnixNano,10):typeof a.startTimeUnixNano=="number"?u.startTimeUnixNano=a.startTimeUnixNano:typeof a.startTimeUnixNano=="object"&&(u.startTimeUnixNano=new X.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber())),a.endTimeUnixNano!=null&&(X.Long?(u.endTimeUnixNano=X.Long.fromValue(a.endTimeUnixNano)).unsigned=!1:typeof a.endTimeUnixNano=="string"?u.endTimeUnixNano=parseInt(a.endTimeUnixNano,10):typeof a.endTimeUnixNano=="number"?u.endTimeUnixNano=a.endTimeUnixNano:typeof a.endTimeUnixNano=="object"&&(u.endTimeUnixNano=new X.LongBits(a.endTimeUnixNano.low>>>0,a.endTimeUnixNano.high>>>0).toNumber())),a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}if(a.droppedAttributesCount!=null&&(u.droppedAttributesCount=a.droppedAttributesCount>>>0),a.events){if(!Array.isArray(a.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");u.events=[];for(var l=0;l<a.events.length;++l){if(typeof a.events[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");u.events[l]=J.opentelemetry.proto.trace.v1.Span.Event.fromObject(a.events[l])}}if(a.droppedEventsCount!=null&&(u.droppedEventsCount=a.droppedEventsCount>>>0),a.links){if(!Array.isArray(a.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");u.links=[];for(var l=0;l<a.links.length;++l){if(typeof a.links[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");u.links[l]=J.opentelemetry.proto.trace.v1.Span.Link.fromObject(a.links[l])}}if(a.droppedLinksCount!=null&&(u.droppedLinksCount=a.droppedLinksCount>>>0),a.status!=null){if(typeof a.status!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");u.status=J.opentelemetry.proto.trace.v1.Status.fromObject(a.status)}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.attributes=[],l.events=[],l.links=[]),u.defaults){if(u.bytes===String?l.traceId="":(l.traceId=[],u.bytes!==Array&&(l.traceId=X.newBuffer(l.traceId))),u.bytes===String?l.spanId="":(l.spanId=[],u.bytes!==Array&&(l.spanId=X.newBuffer(l.spanId))),l.traceState="",u.bytes===String?l.parentSpanId="":(l.parentSpanId=[],u.bytes!==Array&&(l.parentSpanId=X.newBuffer(l.parentSpanId))),l.name="",l.kind=u.enums===String?"SPAN_KIND_UNSPECIFIED":0,X.Long){var c=new X.Long(0,0,!1);l.startTimeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.startTimeUnixNano=u.longs===String?"0":0;if(X.Long){var c=new X.Long(0,0,!1);l.endTimeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.endTimeUnixNano=u.longs===String?"0":0;l.droppedAttributesCount=0,l.droppedEventsCount=0,l.droppedLinksCount=0,l.status=null,l.flags=0}if(a.traceId!=null&&a.hasOwnProperty("traceId")&&(l.traceId=u.bytes===String?X.base64.encode(a.traceId,0,a.traceId.length):u.bytes===Array?Array.prototype.slice.call(a.traceId):a.traceId),a.spanId!=null&&a.hasOwnProperty("spanId")&&(l.spanId=u.bytes===String?X.base64.encode(a.spanId,0,a.spanId.length):u.bytes===Array?Array.prototype.slice.call(a.spanId):a.spanId),a.traceState!=null&&a.hasOwnProperty("traceState")&&(l.traceState=a.traceState),a.parentSpanId!=null&&a.hasOwnProperty("parentSpanId")&&(l.parentSpanId=u.bytes===String?X.base64.encode(a.parentSpanId,0,a.parentSpanId.length):u.bytes===Array?Array.prototype.slice.call(a.parentSpanId):a.parentSpanId),a.name!=null&&a.hasOwnProperty("name")&&(l.name=a.name),a.kind!=null&&a.hasOwnProperty("kind")&&(l.kind=u.enums===String?J.opentelemetry.proto.trace.v1.Span.SpanKind[a.kind]===void 0?a.kind:J.opentelemetry.proto.trace.v1.Span.SpanKind[a.kind]:a.kind),a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&(typeof a.startTimeUnixNano=="number"?l.startTimeUnixNano=u.longs===String?String(a.startTimeUnixNano):a.startTimeUnixNano:l.startTimeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.startTimeUnixNano):u.longs===Number?new X.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber():a.startTimeUnixNano),a.endTimeUnixNano!=null&&a.hasOwnProperty("endTimeUnixNano")&&(typeof a.endTimeUnixNano=="number"?l.endTimeUnixNano=u.longs===String?String(a.endTimeUnixNano):a.endTimeUnixNano:l.endTimeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.endTimeUnixNano):u.longs===Number?new X.LongBits(a.endTimeUnixNano.low>>>0,a.endTimeUnixNano.high>>>0).toNumber():a.endTimeUnixNano),a.attributes&&a.attributes.length){l.attributes=[];for(var d=0;d<a.attributes.length;++d)l.attributes[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[d],u)}if(a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=a.droppedAttributesCount),a.events&&a.events.length){l.events=[];for(var d=0;d<a.events.length;++d)l.events[d]=J.opentelemetry.proto.trace.v1.Span.Event.toObject(a.events[d],u)}if(a.droppedEventsCount!=null&&a.hasOwnProperty("droppedEventsCount")&&(l.droppedEventsCount=a.droppedEventsCount),a.links&&a.links.length){l.links=[];for(var d=0;d<a.links.length;++d)l.links[d]=J.opentelemetry.proto.trace.v1.Span.Link.toObject(a.links[d],u)}return a.droppedLinksCount!=null&&a.hasOwnProperty("droppedLinksCount")&&(l.droppedLinksCount=a.droppedLinksCount),a.status!=null&&a.hasOwnProperty("status")&&(l.status=J.opentelemetry.proto.trace.v1.Status.toObject(a.status,u)),a.flags!=null&&a.hasOwnProperty("flags")&&(l.flags=a.flags),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.Span"},"getTypeUrl"),n.SpanKind=(function(){var i={},a=Object.create(i);return a[i[0]="SPAN_KIND_UNSPECIFIED"]=0,a[i[1]="SPAN_KIND_INTERNAL"]=1,a[i[2]="SPAN_KIND_SERVER"]=2,a[i[3]="SPAN_KIND_CLIENT"]=3,a[i[4]="SPAN_KIND_PRODUCER"]=4,a[i[5]="SPAN_KIND_CONSUMER"]=5,a})(),n.Event=(function(){function i(a){if(this.attributes=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"Event"),i.prototype.timeUnixNano=null,i.prototype.name=null,i.prototype.attributes=X.emptyArray,i.prototype.droppedAttributesCount=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(9).fixed64(u.timeUnixNano),u.name!=null&&Object.hasOwnProperty.call(u,"name")&&l.uint32(18).string(u.name),u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(26).fork()).ldelim();return u.droppedAttributesCount!=null&&Object.hasOwnProperty.call(u,"droppedAttributesCount")&&l.uint32(32).uint32(u.droppedAttributesCount),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.trace.v1.Span.Event;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.timeUnixNano=u.fixed64();break}case 2:{p.name=u.string();break}case 3:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 4:{p.droppedAttributesCount=u.uint32();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.name!=null&&u.hasOwnProperty("name")&&!X.isString(u.name))return"name: string expected";if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var l=0;l<u.attributes.length;++l){var c=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[l]);if(c)return"attributes."+c}}return u.droppedAttributesCount!=null&&u.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(u.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.trace.v1.Span.Event)return u;var l=new J.opentelemetry.proto.trace.v1.Span.Event;if(u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.name!=null&&(l.name=String(u.name)),u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}return u.droppedAttributesCount!=null&&(l.droppedAttributesCount=u.droppedAttributesCount>>>0),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;c.name="",c.droppedAttributesCount=0}if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.name!=null&&u.hasOwnProperty("name")&&(c.name=u.name),u.attributes&&u.attributes.length){c.attributes=[];for(var p=0;p<u.attributes.length;++p)c.attributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[p],l)}return u.droppedAttributesCount!=null&&u.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=u.droppedAttributesCount),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.trace.v1.Span.Event"},"getTypeUrl"),i})(),n.Link=(function(){function i(a){if(this.attributes=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"Link"),i.prototype.traceId=null,i.prototype.spanId=null,i.prototype.traceState=null,i.prototype.attributes=X.emptyArray,i.prototype.droppedAttributesCount=null,i.prototype.flags=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.traceId!=null&&Object.hasOwnProperty.call(u,"traceId")&&l.uint32(10).bytes(u.traceId),u.spanId!=null&&Object.hasOwnProperty.call(u,"spanId")&&l.uint32(18).bytes(u.spanId),u.traceState!=null&&Object.hasOwnProperty.call(u,"traceState")&&l.uint32(26).string(u.traceState),u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(34).fork()).ldelim();return u.droppedAttributesCount!=null&&Object.hasOwnProperty.call(u,"droppedAttributesCount")&&l.uint32(40).uint32(u.droppedAttributesCount),u.flags!=null&&Object.hasOwnProperty.call(u,"flags")&&l.uint32(53).fixed32(u.flags),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.trace.v1.Span.Link;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.traceId=u.bytes();break}case 2:{p.spanId=u.bytes();break}case 3:{p.traceState=u.string();break}case 4:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 5:{p.droppedAttributesCount=u.uint32();break}case 6:{p.flags=u.fixed32();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.traceId!=null&&u.hasOwnProperty("traceId")&&!(u.traceId&&typeof u.traceId.length=="number"||X.isString(u.traceId)))return"traceId: buffer expected";if(u.spanId!=null&&u.hasOwnProperty("spanId")&&!(u.spanId&&typeof u.spanId.length=="number"||X.isString(u.spanId)))return"spanId: buffer expected";if(u.traceState!=null&&u.hasOwnProperty("traceState")&&!X.isString(u.traceState))return"traceState: string expected";if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var l=0;l<u.attributes.length;++l){var c=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[l]);if(c)return"attributes."+c}}return u.droppedAttributesCount!=null&&u.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(u.droppedAttributesCount)?"droppedAttributesCount: integer expected":u.flags!=null&&u.hasOwnProperty("flags")&&!X.isInteger(u.flags)?"flags: integer expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.trace.v1.Span.Link)return u;var l=new J.opentelemetry.proto.trace.v1.Span.Link;if(u.traceId!=null&&(typeof u.traceId=="string"?X.base64.decode(u.traceId,l.traceId=X.newBuffer(X.base64.length(u.traceId)),0):u.traceId.length>=0&&(l.traceId=u.traceId)),u.spanId!=null&&(typeof u.spanId=="string"?X.base64.decode(u.spanId,l.spanId=X.newBuffer(X.base64.length(u.spanId)),0):u.spanId.length>=0&&(l.spanId=u.spanId)),u.traceState!=null&&(l.traceState=String(u.traceState)),u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}return u.droppedAttributesCount!=null&&(l.droppedAttributesCount=u.droppedAttributesCount>>>0),u.flags!=null&&(l.flags=u.flags>>>0),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults&&(l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=X.newBuffer(c.traceId))),l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=X.newBuffer(c.spanId))),c.traceState="",c.droppedAttributesCount=0,c.flags=0),u.traceId!=null&&u.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?X.base64.encode(u.traceId,0,u.traceId.length):l.bytes===Array?Array.prototype.slice.call(u.traceId):u.traceId),u.spanId!=null&&u.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?X.base64.encode(u.spanId,0,u.spanId.length):l.bytes===Array?Array.prototype.slice.call(u.spanId):u.spanId),u.traceState!=null&&u.hasOwnProperty("traceState")&&(c.traceState=u.traceState),u.attributes&&u.attributes.length){c.attributes=[];for(var d=0;d<u.attributes.length;++d)c.attributes[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[d],l)}return u.droppedAttributesCount!=null&&u.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=u.droppedAttributesCount),u.flags!=null&&u.hasOwnProperty("flags")&&(c.flags=u.flags),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.trace.v1.Span.Link"},"getTypeUrl"),i})(),n})(),o.Status=(function(){function n(i){if(i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Status"),n.prototype.message=null,n.prototype.code=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){return u||(u=Yn.create()),a.message!=null&&Object.hasOwnProperty.call(a,"message")&&u.uint32(18).string(a.message),a.code!=null&&Object.hasOwnProperty.call(a,"code")&&u.uint32(24).int32(a.code),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.Status;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 2:{d.message=a.string();break}case 3:{d.code=a.int32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.message!=null&&a.hasOwnProperty("message")&&!X.isString(a.message))return"message: string expected";if(a.code!=null&&a.hasOwnProperty("code"))switch(a.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.Status)return a;var u=new J.opentelemetry.proto.trace.v1.Status;switch(a.message!=null&&(u.message=String(a.message)),a.code){default:if(typeof a.code=="number"){u.code=a.code;break}break;case"STATUS_CODE_UNSET":case 0:u.code=0;break;case"STATUS_CODE_OK":case 1:u.code=1;break;case"STATUS_CODE_ERROR":case 2:u.code=2;break}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};return u.defaults&&(l.message="",l.code=u.enums===String?"STATUS_CODE_UNSET":0),a.message!=null&&a.hasOwnProperty("message")&&(l.message=a.message),a.code!=null&&a.hasOwnProperty("code")&&(l.code=u.enums===String?J.opentelemetry.proto.trace.v1.Status.StatusCode[a.code]===void 0?a.code:J.opentelemetry.proto.trace.v1.Status.StatusCode[a.code]:a.code),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.Status"},"getTypeUrl"),n.StatusCode=(function(){var i={},a=Object.create(i);return a[i[0]="STATUS_CODE_UNSET"]=0,a[i[1]="STATUS_CODE_OK"]=1,a[i[2]="STATUS_CODE_ERROR"]=2,a})(),n})(),o.SpanFlags=(function(){var n={},i=Object.create(n);return i[n[0]="SPAN_FLAGS_DO_NOT_USE"]=0,i[n[255]="SPAN_FLAGS_TRACE_FLAGS_MASK"]=255,i[n[256]="SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"]=256,i[n[512]="SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"]=512,i})(),o})(),r})(),t.collector=(function(){var r={};return r.trace=(function(){var o={};return o.v1=(function(){var n={};return n.TraceService=(function(){function i(a,u,l){gn.rpc.Service.call(this,a,u,l)}return s(i,"TraceService"),(i.prototype=Object.create(gn.rpc.Service.prototype)).constructor=i,i.create=s(function(u,l,c){return new this(u,l,c)},"create"),Object.defineProperty(i.prototype.export=s(function a(u,l){return this.rpcCall(a,J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,u,l)},"export_"),"name",{value:"Export"}),i})(),n.ExportTraceServiceRequest=(function(){function i(a){if(this.resourceSpans=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportTraceServiceRequest"),i.prototype.resourceSpans=X.emptyArray,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.resourceSpans!=null&&u.resourceSpans.length)for(var c=0;c<u.resourceSpans.length;++c)J.opentelemetry.proto.trace.v1.ResourceSpans.encode(u.resourceSpans[c],l.uint32(10).fork()).ldelim();return l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.resourceSpans&&p.resourceSpans.length||(p.resourceSpans=[]),p.resourceSpans.push(J.opentelemetry.proto.trace.v1.ResourceSpans.decode(u,u.uint32()));break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.resourceSpans!=null&&u.hasOwnProperty("resourceSpans")){if(!Array.isArray(u.resourceSpans))return"resourceSpans: array expected";for(var l=0;l<u.resourceSpans.length;++l){var c=J.opentelemetry.proto.trace.v1.ResourceSpans.verify(u.resourceSpans[l]);if(c)return"resourceSpans."+c}}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return u;var l=new J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(u.resourceSpans){if(!Array.isArray(u.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");l.resourceSpans=[];for(var c=0;c<u.resourceSpans.length;++c){if(typeof u.resourceSpans[c]!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");l.resourceSpans[c]=J.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(u.resourceSpans[c])}}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceSpans=[]),u.resourceSpans&&u.resourceSpans.length){c.resourceSpans=[];for(var d=0;d<u.resourceSpans.length;++d)c.resourceSpans[d]=J.opentelemetry.proto.trace.v1.ResourceSpans.toObject(u.resourceSpans[d],l)}return c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},"getTypeUrl"),i})(),n.ExportTraceServiceResponse=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportTraceServiceResponse"),i.prototype.partialSuccess=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.partialSuccess!=null&&Object.hasOwnProperty.call(u,"partialSuccess")&&J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(u.partialSuccess,l.uint32(10).fork()).ldelim(),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.partialSuccess=J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(u,u.uint32());break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")){var l=J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(u.partialSuccess);if(l)return"partialSuccess."+l}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return u;var l=new J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(u.partialSuccess!=null){if(typeof u.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");l.partialSuccess=J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(u.partialSuccess)}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")&&(c.partialSuccess=J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(u.partialSuccess,l)),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},"getTypeUrl"),i})(),n.ExportTracePartialSuccess=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportTracePartialSuccess"),i.prototype.rejectedSpans=null,i.prototype.errorMessage=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.rejectedSpans!=null&&Object.hasOwnProperty.call(u,"rejectedSpans")&&l.uint32(8).int64(u.rejectedSpans),u.errorMessage!=null&&Object.hasOwnProperty.call(u,"errorMessage")&&l.uint32(18).string(u.errorMessage),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.rejectedSpans=u.int64();break}case 2:{p.errorMessage=u.string();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){return typeof u!="object"||u===null?"object expected":u.rejectedSpans!=null&&u.hasOwnProperty("rejectedSpans")&&!X.isInteger(u.rejectedSpans)&&!(u.rejectedSpans&&X.isInteger(u.rejectedSpans.low)&&X.isInteger(u.rejectedSpans.high))?"rejectedSpans: integer|Long expected":u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&!X.isString(u.errorMessage)?"errorMessage: string expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return u;var l=new J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return u.rejectedSpans!=null&&(X.Long?(l.rejectedSpans=X.Long.fromValue(u.rejectedSpans)).unsigned=!1:typeof u.rejectedSpans=="string"?l.rejectedSpans=parseInt(u.rejectedSpans,10):typeof u.rejectedSpans=="number"?l.rejectedSpans=u.rejectedSpans:typeof u.rejectedSpans=="object"&&(l.rejectedSpans=new X.LongBits(u.rejectedSpans.low>>>0,u.rejectedSpans.high>>>0).toNumber())),u.errorMessage!=null&&(l.errorMessage=String(u.errorMessage)),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if(l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.rejectedSpans=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.rejectedSpans=l.longs===String?"0":0;c.errorMessage=""}return u.rejectedSpans!=null&&u.hasOwnProperty("rejectedSpans")&&(typeof u.rejectedSpans=="number"?c.rejectedSpans=l.longs===String?String(u.rejectedSpans):u.rejectedSpans:c.rejectedSpans=l.longs===String?X.Long.prototype.toString.call(u.rejectedSpans):l.longs===Number?new X.LongBits(u.rejectedSpans.low>>>0,u.rejectedSpans.high>>>0).toNumber():u.rejectedSpans),u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&(c.errorMessage=u.errorMessage),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},"getTypeUrl"),i})(),n})(),o})(),r.metrics=(function(){var o={};return o.v1=(function(){var n={};return n.MetricsService=(function(){function i(a,u,l){gn.rpc.Service.call(this,a,u,l)}return s(i,"MetricsService"),(i.prototype=Object.create(gn.rpc.Service.prototype)).constructor=i,i.create=s(function(u,l,c){return new this(u,l,c)},"create"),Object.defineProperty(i.prototype.export=s(function a(u,l){return this.rpcCall(a,J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,u,l)},"export_"),"name",{value:"Export"}),i})(),n.ExportMetricsServiceRequest=(function(){function i(a){if(this.resourceMetrics=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportMetricsServiceRequest"),i.prototype.resourceMetrics=X.emptyArray,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.resourceMetrics!=null&&u.resourceMetrics.length)for(var c=0;c<u.resourceMetrics.length;++c)J.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(u.resourceMetrics[c],l.uint32(10).fork()).ldelim();return l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.resourceMetrics&&p.resourceMetrics.length||(p.resourceMetrics=[]),p.resourceMetrics.push(J.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(u,u.uint32()));break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.resourceMetrics!=null&&u.hasOwnProperty("resourceMetrics")){if(!Array.isArray(u.resourceMetrics))return"resourceMetrics: array expected";for(var l=0;l<u.resourceMetrics.length;++l){var c=J.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(u.resourceMetrics[l]);if(c)return"resourceMetrics."+c}}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return u;var l=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(u.resourceMetrics){if(!Array.isArray(u.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");l.resourceMetrics=[];for(var c=0;c<u.resourceMetrics.length;++c){if(typeof u.resourceMetrics[c]!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");l.resourceMetrics[c]=J.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(u.resourceMetrics[c])}}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceMetrics=[]),u.resourceMetrics&&u.resourceMetrics.length){c.resourceMetrics=[];for(var d=0;d<u.resourceMetrics.length;++d)c.resourceMetrics[d]=J.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(u.resourceMetrics[d],l)}return c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},"getTypeUrl"),i})(),n.ExportMetricsServiceResponse=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportMetricsServiceResponse"),i.prototype.partialSuccess=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.partialSuccess!=null&&Object.hasOwnProperty.call(u,"partialSuccess")&&J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(u.partialSuccess,l.uint32(10).fork()).ldelim(),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.partialSuccess=J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(u,u.uint32());break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")){var l=J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(u.partialSuccess);if(l)return"partialSuccess."+l}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return u;var l=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(u.partialSuccess!=null){if(typeof u.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");l.partialSuccess=J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(u.partialSuccess)}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")&&(c.partialSuccess=J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(u.partialSuccess,l)),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},"getTypeUrl"),i})(),n.ExportMetricsPartialSuccess=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportMetricsPartialSuccess"),i.prototype.rejectedDataPoints=null,i.prototype.errorMessage=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.rejectedDataPoints!=null&&Object.hasOwnProperty.call(u,"rejectedDataPoints")&&l.uint32(8).int64(u.rejectedDataPoints),u.errorMessage!=null&&Object.hasOwnProperty.call(u,"errorMessage")&&l.uint32(18).string(u.errorMessage),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.rejectedDataPoints=u.int64();break}case 2:{p.errorMessage=u.string();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){return typeof u!="object"||u===null?"object expected":u.rejectedDataPoints!=null&&u.hasOwnProperty("rejectedDataPoints")&&!X.isInteger(u.rejectedDataPoints)&&!(u.rejectedDataPoints&&X.isInteger(u.rejectedDataPoints.low)&&X.isInteger(u.rejectedDataPoints.high))?"rejectedDataPoints: integer|Long expected":u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&!X.isString(u.errorMessage)?"errorMessage: string expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return u;var l=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return u.rejectedDataPoints!=null&&(X.Long?(l.rejectedDataPoints=X.Long.fromValue(u.rejectedDataPoints)).unsigned=!1:typeof u.rejectedDataPoints=="string"?l.rejectedDataPoints=parseInt(u.rejectedDataPoints,10):typeof u.rejectedDataPoints=="number"?l.rejectedDataPoints=u.rejectedDataPoints:typeof u.rejectedDataPoints=="object"&&(l.rejectedDataPoints=new X.LongBits(u.rejectedDataPoints.low>>>0,u.rejectedDataPoints.high>>>0).toNumber())),u.errorMessage!=null&&(l.errorMessage=String(u.errorMessage)),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if(l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.rejectedDataPoints=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.rejectedDataPoints=l.longs===String?"0":0;c.errorMessage=""}return u.rejectedDataPoints!=null&&u.hasOwnProperty("rejectedDataPoints")&&(typeof u.rejectedDataPoints=="number"?c.rejectedDataPoints=l.longs===String?String(u.rejectedDataPoints):u.rejectedDataPoints:c.rejectedDataPoints=l.longs===String?X.Long.prototype.toString.call(u.rejectedDataPoints):l.longs===Number?new X.LongBits(u.rejectedDataPoints.low>>>0,u.rejectedDataPoints.high>>>0).toNumber():u.rejectedDataPoints),u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&(c.errorMessage=u.errorMessage),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},"getTypeUrl"),i})(),n})(),o})(),r.logs=(function(){var o={};return o.v1=(function(){var n={};return n.LogsService=(function(){function i(a,u,l){gn.rpc.Service.call(this,a,u,l)}return s(i,"LogsService"),(i.prototype=Object.create(gn.rpc.Service.prototype)).constructor=i,i.create=s(function(u,l,c){return new this(u,l,c)},"create"),Object.defineProperty(i.prototype.export=s(function a(u,l){return this.rpcCall(a,J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,u,l)},"export_"),"name",{value:"Export"}),i})(),n.ExportLogsServiceRequest=(function(){function i(a){if(this.resourceLogs=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportLogsServiceRequest"),i.prototype.resourceLogs=X.emptyArray,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.resourceLogs!=null&&u.resourceLogs.length)for(var c=0;c<u.resourceLogs.length;++c)J.opentelemetry.proto.logs.v1.ResourceLogs.encode(u.resourceLogs[c],l.uint32(10).fork()).ldelim();return l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.resourceLogs&&p.resourceLogs.length||(p.resourceLogs=[]),p.resourceLogs.push(J.opentelemetry.proto.logs.v1.ResourceLogs.decode(u,u.uint32()));break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.resourceLogs!=null&&u.hasOwnProperty("resourceLogs")){if(!Array.isArray(u.resourceLogs))return"resourceLogs: array expected";for(var l=0;l<u.resourceLogs.length;++l){var c=J.opentelemetry.proto.logs.v1.ResourceLogs.verify(u.resourceLogs[l]);if(c)return"resourceLogs."+c}}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return u;var l=new J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(u.resourceLogs){if(!Array.isArray(u.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");l.resourceLogs=[];for(var c=0;c<u.resourceLogs.length;++c){if(typeof u.resourceLogs[c]!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");l.resourceLogs[c]=J.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(u.resourceLogs[c])}}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceLogs=[]),u.resourceLogs&&u.resourceLogs.length){c.resourceLogs=[];for(var d=0;d<u.resourceLogs.length;++d)c.resourceLogs[d]=J.opentelemetry.proto.logs.v1.ResourceLogs.toObject(u.resourceLogs[d],l)}return c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},"getTypeUrl"),i})(),n.ExportLogsServiceResponse=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportLogsServiceResponse"),i.prototype.partialSuccess=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.partialSuccess!=null&&Object.hasOwnProperty.call(u,"partialSuccess")&&J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(u.partialSuccess,l.uint32(10).fork()).ldelim(),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.partialSuccess=J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(u,u.uint32());break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")){var l=J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(u.partialSuccess);if(l)return"partialSuccess."+l}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return u;var l=new J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(u.partialSuccess!=null){if(typeof u.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");l.partialSuccess=J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(u.partialSuccess)}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")&&(c.partialSuccess=J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(u.partialSuccess,l)),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},"getTypeUrl"),i})(),n.ExportLogsPartialSuccess=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportLogsPartialSuccess"),i.prototype.rejectedLogRecords=null,i.prototype.errorMessage=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.rejectedLogRecords!=null&&Object.hasOwnProperty.call(u,"rejectedLogRecords")&&l.uint32(8).int64(u.rejectedLogRecords),u.errorMessage!=null&&Object.hasOwnProperty.call(u,"errorMessage")&&l.uint32(18).string(u.errorMessage),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.rejectedLogRecords=u.int64();break}case 2:{p.errorMessage=u.string();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){return typeof u!="object"||u===null?"object expected":u.rejectedLogRecords!=null&&u.hasOwnProperty("rejectedLogRecords")&&!X.isInteger(u.rejectedLogRecords)&&!(u.rejectedLogRecords&&X.isInteger(u.rejectedLogRecords.low)&&X.isInteger(u.rejectedLogRecords.high))?"rejectedLogRecords: integer|Long expected":u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&!X.isString(u.errorMessage)?"errorMessage: string expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return u;var l=new J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return u.rejectedLogRecords!=null&&(X.Long?(l.rejectedLogRecords=X.Long.fromValue(u.rejectedLogRecords)).unsigned=!1:typeof u.rejectedLogRecords=="string"?l.rejectedLogRecords=parseInt(u.rejectedLogRecords,10):typeof u.rejectedLogRecords=="number"?l.rejectedLogRecords=u.rejectedLogRecords:typeof u.rejectedLogRecords=="object"&&(l.rejectedLogRecords=new X.LongBits(u.rejectedLogRecords.low>>>0,u.rejectedLogRecords.high>>>0).toNumber())),u.errorMessage!=null&&(l.errorMessage=String(u.errorMessage)),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if(l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.rejectedLogRecords=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.rejectedLogRecords=l.longs===String?"0":0;c.errorMessage=""}return u.rejectedLogRecords!=null&&u.hasOwnProperty("rejectedLogRecords")&&(typeof u.rejectedLogRecords=="number"?c.rejectedLogRecords=l.longs===String?String(u.rejectedLogRecords):u.rejectedLogRecords:c.rejectedLogRecords=l.longs===String?X.Long.prototype.toString.call(u.rejectedLogRecords):l.longs===Number?new X.LongBits(u.rejectedLogRecords.low>>>0,u.rejectedLogRecords.high>>>0).toNumber():u.rejectedLogRecords),u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&(c.errorMessage=u.errorMessage),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},"getTypeUrl"),i})(),n})(),o})(),r})(),t.metrics=(function(){var r={};return r.v1=(function(){var o={};return o.MetricsData=(function(){function n(i){if(this.resourceMetrics=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"MetricsData"),n.prototype.resourceMetrics=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resourceMetrics!=null&&a.resourceMetrics.length)for(var l=0;l<a.resourceMetrics.length;++l)J.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(a.resourceMetrics[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.MetricsData;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resourceMetrics&&d.resourceMetrics.length||(d.resourceMetrics=[]),d.resourceMetrics.push(J.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceMetrics!=null&&a.hasOwnProperty("resourceMetrics")){if(!Array.isArray(a.resourceMetrics))return"resourceMetrics: array expected";for(var u=0;u<a.resourceMetrics.length;++u){var l=J.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(a.resourceMetrics[u]);if(l)return"resourceMetrics."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.MetricsData)return a;var u=new J.opentelemetry.proto.metrics.v1.MetricsData;if(a.resourceMetrics){if(!Array.isArray(a.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");u.resourceMetrics=[];for(var l=0;l<a.resourceMetrics.length;++l){if(typeof a.resourceMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");u.resourceMetrics[l]=J.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(a.resourceMetrics[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.resourceMetrics=[]),a.resourceMetrics&&a.resourceMetrics.length){l.resourceMetrics=[];for(var c=0;c<a.resourceMetrics.length;++c)l.resourceMetrics[c]=J.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(a.resourceMetrics[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.MetricsData"},"getTypeUrl"),n})(),o.ResourceMetrics=(function(){function n(i){if(this.scopeMetrics=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ResourceMetrics"),n.prototype.resource=null,n.prototype.scopeMetrics=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resource!=null&&Object.hasOwnProperty.call(a,"resource")&&J.opentelemetry.proto.resource.v1.Resource.encode(a.resource,u.uint32(10).fork()).ldelim(),a.scopeMetrics!=null&&a.scopeMetrics.length)for(var l=0;l<a.scopeMetrics.length;++l)J.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(a.scopeMetrics[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.ResourceMetrics;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resource=J.opentelemetry.proto.resource.v1.Resource.decode(a,a.uint32());break}case 2:{d.scopeMetrics&&d.scopeMetrics.length||(d.scopeMetrics=[]),d.scopeMetrics.push(J.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resource!=null&&a.hasOwnProperty("resource")){var u=J.opentelemetry.proto.resource.v1.Resource.verify(a.resource);if(u)return"resource."+u}if(a.scopeMetrics!=null&&a.hasOwnProperty("scopeMetrics")){if(!Array.isArray(a.scopeMetrics))return"scopeMetrics: array expected";for(var l=0;l<a.scopeMetrics.length;++l){var u=J.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(a.scopeMetrics[l]);if(u)return"scopeMetrics."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.ResourceMetrics)return a;var u=new J.opentelemetry.proto.metrics.v1.ResourceMetrics;if(a.resource!=null){if(typeof a.resource!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");u.resource=J.opentelemetry.proto.resource.v1.Resource.fromObject(a.resource)}if(a.scopeMetrics){if(!Array.isArray(a.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");u.scopeMetrics=[];for(var l=0;l<a.scopeMetrics.length;++l){if(typeof a.scopeMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");u.scopeMetrics[l]=J.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(a.scopeMetrics[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.scopeMetrics=[]),u.defaults&&(l.resource=null,l.schemaUrl=""),a.resource!=null&&a.hasOwnProperty("resource")&&(l.resource=J.opentelemetry.proto.resource.v1.Resource.toObject(a.resource,u)),a.scopeMetrics&&a.scopeMetrics.length){l.scopeMetrics=[];for(var c=0;c<a.scopeMetrics.length;++c)l.scopeMetrics[c]=J.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(a.scopeMetrics[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},"getTypeUrl"),n})(),o.ScopeMetrics=(function(){function n(i){if(this.metrics=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ScopeMetrics"),n.prototype.scope=null,n.prototype.metrics=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.scope!=null&&Object.hasOwnProperty.call(a,"scope")&&J.opentelemetry.proto.common.v1.InstrumentationScope.encode(a.scope,u.uint32(10).fork()).ldelim(),a.metrics!=null&&a.metrics.length)for(var l=0;l<a.metrics.length;++l)J.opentelemetry.proto.metrics.v1.Metric.encode(a.metrics[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.ScopeMetrics;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.decode(a,a.uint32());break}case 2:{d.metrics&&d.metrics.length||(d.metrics=[]),d.metrics.push(J.opentelemetry.proto.metrics.v1.Metric.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.scope!=null&&a.hasOwnProperty("scope")){var u=J.opentelemetry.proto.common.v1.InstrumentationScope.verify(a.scope);if(u)return"scope."+u}if(a.metrics!=null&&a.hasOwnProperty("metrics")){if(!Array.isArray(a.metrics))return"metrics: array expected";for(var l=0;l<a.metrics.length;++l){var u=J.opentelemetry.proto.metrics.v1.Metric.verify(a.metrics[l]);if(u)return"metrics."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.ScopeMetrics)return a;var u=new J.opentelemetry.proto.metrics.v1.ScopeMetrics;if(a.scope!=null){if(typeof a.scope!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");u.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(a.scope)}if(a.metrics){if(!Array.isArray(a.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");u.metrics=[];for(var l=0;l<a.metrics.length;++l){if(typeof a.metrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");u.metrics[l]=J.opentelemetry.proto.metrics.v1.Metric.fromObject(a.metrics[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.metrics=[]),u.defaults&&(l.scope=null,l.schemaUrl=""),a.scope!=null&&a.hasOwnProperty("scope")&&(l.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.toObject(a.scope,u)),a.metrics&&a.metrics.length){l.metrics=[];for(var c=0;c<a.metrics.length;++c)l.metrics[c]=J.opentelemetry.proto.metrics.v1.Metric.toObject(a.metrics[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},"getTypeUrl"),n})(),o.Metric=(function(){function n(a){if(this.metadata=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"Metric"),n.prototype.name=null,n.prototype.description=null,n.prototype.unit=null,n.prototype.gauge=null,n.prototype.sum=null,n.prototype.histogram=null,n.prototype.exponentialHistogram=null,n.prototype.summary=null,n.prototype.metadata=X.emptyArray;var i;return Object.defineProperty(n.prototype,"data",{get:X.oneOfGetter(i=["gauge","sum","histogram","exponentialHistogram","summary"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.name!=null&&Object.hasOwnProperty.call(u,"name")&&l.uint32(10).string(u.name),u.description!=null&&Object.hasOwnProperty.call(u,"description")&&l.uint32(18).string(u.description),u.unit!=null&&Object.hasOwnProperty.call(u,"unit")&&l.uint32(26).string(u.unit),u.gauge!=null&&Object.hasOwnProperty.call(u,"gauge")&&J.opentelemetry.proto.metrics.v1.Gauge.encode(u.gauge,l.uint32(42).fork()).ldelim(),u.sum!=null&&Object.hasOwnProperty.call(u,"sum")&&J.opentelemetry.proto.metrics.v1.Sum.encode(u.sum,l.uint32(58).fork()).ldelim(),u.histogram!=null&&Object.hasOwnProperty.call(u,"histogram")&&J.opentelemetry.proto.metrics.v1.Histogram.encode(u.histogram,l.uint32(74).fork()).ldelim(),u.exponentialHistogram!=null&&Object.hasOwnProperty.call(u,"exponentialHistogram")&&J.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(u.exponentialHistogram,l.uint32(82).fork()).ldelim(),u.summary!=null&&Object.hasOwnProperty.call(u,"summary")&&J.opentelemetry.proto.metrics.v1.Summary.encode(u.summary,l.uint32(90).fork()).ldelim(),u.metadata!=null&&u.metadata.length)for(var c=0;c<u.metadata.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.metadata[c],l.uint32(98).fork()).ldelim();return l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.Metric;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.name=u.string();break}case 2:{p.description=u.string();break}case 3:{p.unit=u.string();break}case 5:{p.gauge=J.opentelemetry.proto.metrics.v1.Gauge.decode(u,u.uint32());break}case 7:{p.sum=J.opentelemetry.proto.metrics.v1.Sum.decode(u,u.uint32());break}case 9:{p.histogram=J.opentelemetry.proto.metrics.v1.Histogram.decode(u,u.uint32());break}case 10:{p.exponentialHistogram=J.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(u,u.uint32());break}case 11:{p.summary=J.opentelemetry.proto.metrics.v1.Summary.decode(u,u.uint32());break}case 12:{p.metadata&&p.metadata.length||(p.metadata=[]),p.metadata.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.name!=null&&u.hasOwnProperty("name")&&!X.isString(u.name))return"name: string expected";if(u.description!=null&&u.hasOwnProperty("description")&&!X.isString(u.description))return"description: string expected";if(u.unit!=null&&u.hasOwnProperty("unit")&&!X.isString(u.unit))return"unit: string expected";if(u.gauge!=null&&u.hasOwnProperty("gauge")){l.data=1;{var c=J.opentelemetry.proto.metrics.v1.Gauge.verify(u.gauge);if(c)return"gauge."+c}}if(u.sum!=null&&u.hasOwnProperty("sum")){if(l.data===1)return"data: multiple values";l.data=1;{var c=J.opentelemetry.proto.metrics.v1.Sum.verify(u.sum);if(c)return"sum."+c}}if(u.histogram!=null&&u.hasOwnProperty("histogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=J.opentelemetry.proto.metrics.v1.Histogram.verify(u.histogram);if(c)return"histogram."+c}}if(u.exponentialHistogram!=null&&u.hasOwnProperty("exponentialHistogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=J.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(u.exponentialHistogram);if(c)return"exponentialHistogram."+c}}if(u.summary!=null&&u.hasOwnProperty("summary")){if(l.data===1)return"data: multiple values";l.data=1;{var c=J.opentelemetry.proto.metrics.v1.Summary.verify(u.summary);if(c)return"summary."+c}}if(u.metadata!=null&&u.hasOwnProperty("metadata")){if(!Array.isArray(u.metadata))return"metadata: array expected";for(var d=0;d<u.metadata.length;++d){var c=J.opentelemetry.proto.common.v1.KeyValue.verify(u.metadata[d]);if(c)return"metadata."+c}}return null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.Metric)return u;var l=new J.opentelemetry.proto.metrics.v1.Metric;if(u.name!=null&&(l.name=String(u.name)),u.description!=null&&(l.description=String(u.description)),u.unit!=null&&(l.unit=String(u.unit)),u.gauge!=null){if(typeof u.gauge!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");l.gauge=J.opentelemetry.proto.metrics.v1.Gauge.fromObject(u.gauge)}if(u.sum!=null){if(typeof u.sum!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");l.sum=J.opentelemetry.proto.metrics.v1.Sum.fromObject(u.sum)}if(u.histogram!=null){if(typeof u.histogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");l.histogram=J.opentelemetry.proto.metrics.v1.Histogram.fromObject(u.histogram)}if(u.exponentialHistogram!=null){if(typeof u.exponentialHistogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");l.exponentialHistogram=J.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(u.exponentialHistogram)}if(u.summary!=null){if(typeof u.summary!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");l.summary=J.opentelemetry.proto.metrics.v1.Summary.fromObject(u.summary)}if(u.metadata){if(!Array.isArray(u.metadata))throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected");l.metadata=[];for(var c=0;c<u.metadata.length;++c){if(typeof u.metadata[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected");l.metadata[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.metadata[c])}}return l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.metadata=[]),l.defaults&&(c.name="",c.description="",c.unit=""),u.name!=null&&u.hasOwnProperty("name")&&(c.name=u.name),u.description!=null&&u.hasOwnProperty("description")&&(c.description=u.description),u.unit!=null&&u.hasOwnProperty("unit")&&(c.unit=u.unit),u.gauge!=null&&u.hasOwnProperty("gauge")&&(c.gauge=J.opentelemetry.proto.metrics.v1.Gauge.toObject(u.gauge,l),l.oneofs&&(c.data="gauge")),u.sum!=null&&u.hasOwnProperty("sum")&&(c.sum=J.opentelemetry.proto.metrics.v1.Sum.toObject(u.sum,l),l.oneofs&&(c.data="sum")),u.histogram!=null&&u.hasOwnProperty("histogram")&&(c.histogram=J.opentelemetry.proto.metrics.v1.Histogram.toObject(u.histogram,l),l.oneofs&&(c.data="histogram")),u.exponentialHistogram!=null&&u.hasOwnProperty("exponentialHistogram")&&(c.exponentialHistogram=J.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(u.exponentialHistogram,l),l.oneofs&&(c.data="exponentialHistogram")),u.summary!=null&&u.hasOwnProperty("summary")&&(c.summary=J.opentelemetry.proto.metrics.v1.Summary.toObject(u.summary,l),l.oneofs&&(c.data="summary")),u.metadata&&u.metadata.length){c.metadata=[];for(var d=0;d<u.metadata.length;++d)c.metadata[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.metadata[d],l)}return c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.Metric"},"getTypeUrl"),n})(),o.Gauge=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Gauge"),n.prototype.dataPoints=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.Gauge;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.Gauge)return a;var u=new J.opentelemetry.proto.metrics.v1.Gauge;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(a.dataPoints[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(a.dataPoints[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Gauge"},"getTypeUrl"),n})(),o.Sum=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Sum"),n.prototype.dataPoints=X.emptyArray,n.prototype.aggregationTemporality=null,n.prototype.isMonotonic=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return a.aggregationTemporality!=null&&Object.hasOwnProperty.call(a,"aggregationTemporality")&&u.uint32(16).int32(a.aggregationTemporality),a.isMonotonic!=null&&Object.hasOwnProperty.call(a,"isMonotonic")&&u.uint32(24).bool(a.isMonotonic),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.Sum;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(a,a.uint32()));break}case 2:{d.aggregationTemporality=a.int32();break}case 3:{d.isMonotonic=a.bool();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}if(a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality"))switch(a.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return a.isMonotonic!=null&&a.hasOwnProperty("isMonotonic")&&typeof a.isMonotonic!="boolean"?"isMonotonic: boolean expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.Sum)return a;var u=new J.opentelemetry.proto.metrics.v1.Sum;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(a.dataPoints[l])}}switch(a.aggregationTemporality){default:if(typeof a.aggregationTemporality=="number"){u.aggregationTemporality=a.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:u.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:u.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:u.aggregationTemporality=2;break}return a.isMonotonic!=null&&(u.isMonotonic=!!a.isMonotonic),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),u.defaults&&(l.aggregationTemporality=u.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,l.isMonotonic=!1),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(a.dataPoints[c],u)}return a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=u.enums===String?J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]===void 0?a.aggregationTemporality:J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]:a.aggregationTemporality),a.isMonotonic!=null&&a.hasOwnProperty("isMonotonic")&&(l.isMonotonic=a.isMonotonic),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Sum"},"getTypeUrl"),n})(),o.Histogram=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Histogram"),n.prototype.dataPoints=X.emptyArray,n.prototype.aggregationTemporality=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return a.aggregationTemporality!=null&&Object.hasOwnProperty.call(a,"aggregationTemporality")&&u.uint32(16).int32(a.aggregationTemporality),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.Histogram;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(a,a.uint32()));break}case 2:{d.aggregationTemporality=a.int32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}if(a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality"))switch(a.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.Histogram)return a;var u=new J.opentelemetry.proto.metrics.v1.Histogram;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(a.dataPoints[l])}}switch(a.aggregationTemporality){default:if(typeof a.aggregationTemporality=="number"){u.aggregationTemporality=a.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:u.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:u.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:u.aggregationTemporality=2;break}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),u.defaults&&(l.aggregationTemporality=u.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(a.dataPoints[c],u)}return a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=u.enums===String?J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]===void 0?a.aggregationTemporality:J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]:a.aggregationTemporality),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Histogram"},"getTypeUrl"),n})(),o.ExponentialHistogram=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ExponentialHistogram"),n.prototype.dataPoints=X.emptyArray,n.prototype.aggregationTemporality=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return a.aggregationTemporality!=null&&Object.hasOwnProperty.call(a,"aggregationTemporality")&&u.uint32(16).int32(a.aggregationTemporality),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.ExponentialHistogram;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(a,a.uint32()));break}case 2:{d.aggregationTemporality=a.int32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}if(a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality"))switch(a.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.ExponentialHistogram)return a;var u=new J.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(a.dataPoints[l])}}switch(a.aggregationTemporality){default:if(typeof a.aggregationTemporality=="number"){u.aggregationTemporality=a.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:u.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:u.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:u.aggregationTemporality=2;break}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),u.defaults&&(l.aggregationTemporality=u.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(a.dataPoints[c],u)}return a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=u.enums===String?J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]===void 0?a.aggregationTemporality:J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]:a.aggregationTemporality),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},"getTypeUrl"),n})(),o.Summary=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Summary"),n.prototype.dataPoints=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.Summary;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.Summary)return a;var u=new J.opentelemetry.proto.metrics.v1.Summary;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(a.dataPoints[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(a.dataPoints[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Summary"},"getTypeUrl"),n})(),o.AggregationTemporality=(function(){var n={},i=Object.create(n);return i[n[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,i[n[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,i[n[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,i})(),o.DataPointFlags=(function(){var n={},i=Object.create(n);return i[n[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,i[n[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,i})(),o.NumberDataPoint=(function(){function n(a){if(this.attributes=[],this.exemplars=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"NumberDataPoint"),n.prototype.attributes=X.emptyArray,n.prototype.startTimeUnixNano=null,n.prototype.timeUnixNano=null,n.prototype.asDouble=null,n.prototype.asInt=null,n.prototype.exemplars=X.emptyArray,n.prototype.flags=null;var i;return Object.defineProperty(n.prototype,"value",{get:X.oneOfGetter(i=["asDouble","asInt"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.startTimeUnixNano!=null&&Object.hasOwnProperty.call(u,"startTimeUnixNano")&&l.uint32(17).fixed64(u.startTimeUnixNano),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(25).fixed64(u.timeUnixNano),u.asDouble!=null&&Object.hasOwnProperty.call(u,"asDouble")&&l.uint32(33).double(u.asDouble),u.exemplars!=null&&u.exemplars.length)for(var c=0;c<u.exemplars.length;++c)J.opentelemetry.proto.metrics.v1.Exemplar.encode(u.exemplars[c],l.uint32(42).fork()).ldelim();if(u.asInt!=null&&Object.hasOwnProperty.call(u,"asInt")&&l.uint32(49).sfixed64(u.asInt),u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(58).fork()).ldelim();return u.flags!=null&&Object.hasOwnProperty.call(u,"flags")&&l.uint32(64).uint32(u.flags),l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.NumberDataPoint;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 7:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 2:{p.startTimeUnixNano=u.fixed64();break}case 3:{p.timeUnixNano=u.fixed64();break}case 4:{p.asDouble=u.double();break}case 6:{p.asInt=u.sfixed64();break}case 5:{p.exemplars&&p.exemplars.length||(p.exemplars=[]),p.exemplars.push(J.opentelemetry.proto.metrics.v1.Exemplar.decode(u,u.uint32()));break}case 8:{p.flags=u.uint32();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var c=0;c<u.attributes.length;++c){var d=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[c]);if(d)return"attributes."+d}}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(u.startTimeUnixNano)&&!(u.startTimeUnixNano&&X.isInteger(u.startTimeUnixNano.low)&&X.isInteger(u.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.asDouble!=null&&u.hasOwnProperty("asDouble")&&(l.value=1,typeof u.asDouble!="number"))return"asDouble: number expected";if(u.asInt!=null&&u.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!X.isInteger(u.asInt)&&!(u.asInt&&X.isInteger(u.asInt.low)&&X.isInteger(u.asInt.high)))return"asInt: integer|Long expected"}if(u.exemplars!=null&&u.hasOwnProperty("exemplars")){if(!Array.isArray(u.exemplars))return"exemplars: array expected";for(var c=0;c<u.exemplars.length;++c){var d=J.opentelemetry.proto.metrics.v1.Exemplar.verify(u.exemplars[c]);if(d)return"exemplars."+d}}return u.flags!=null&&u.hasOwnProperty("flags")&&!X.isInteger(u.flags)?"flags: integer expected":null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.NumberDataPoint)return u;var l=new J.opentelemetry.proto.metrics.v1.NumberDataPoint;if(u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}if(u.startTimeUnixNano!=null&&(X.Long?(l.startTimeUnixNano=X.Long.fromValue(u.startTimeUnixNano)).unsigned=!1:typeof u.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(u.startTimeUnixNano,10):typeof u.startTimeUnixNano=="number"?l.startTimeUnixNano=u.startTimeUnixNano:typeof u.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber())),u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.asDouble!=null&&(l.asDouble=Number(u.asDouble)),u.asInt!=null&&(X.Long?(l.asInt=X.Long.fromValue(u.asInt)).unsigned=!1:typeof u.asInt=="string"?l.asInt=parseInt(u.asInt,10):typeof u.asInt=="number"?l.asInt=u.asInt:typeof u.asInt=="object"&&(l.asInt=new X.LongBits(u.asInt.low>>>0,u.asInt.high>>>0).toNumber())),u.exemplars){if(!Array.isArray(u.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<u.exemplars.length;++c){if(typeof u.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");l.exemplars[c]=J.opentelemetry.proto.metrics.v1.Exemplar.fromObject(u.exemplars[c])}}return u.flags!=null&&(l.flags=u.flags>>>0),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.exemplars=[],c.attributes=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.startTimeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;c.flags=0}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&(typeof u.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(u.startTimeUnixNano):u.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.startTimeUnixNano):l.longs===Number?new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber():u.startTimeUnixNano),u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.asDouble!=null&&u.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(u.asDouble)?String(u.asDouble):u.asDouble,l.oneofs&&(c.value="asDouble")),u.exemplars&&u.exemplars.length){c.exemplars=[];for(var p=0;p<u.exemplars.length;++p)c.exemplars[p]=J.opentelemetry.proto.metrics.v1.Exemplar.toObject(u.exemplars[p],l)}if(u.asInt!=null&&u.hasOwnProperty("asInt")&&(typeof u.asInt=="number"?c.asInt=l.longs===String?String(u.asInt):u.asInt:c.asInt=l.longs===String?X.Long.prototype.toString.call(u.asInt):l.longs===Number?new X.LongBits(u.asInt.low>>>0,u.asInt.high>>>0).toNumber():u.asInt,l.oneofs&&(c.value="asInt")),u.attributes&&u.attributes.length){c.attributes=[];for(var p=0;p<u.attributes.length;++p)c.attributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[p],l)}return u.flags!=null&&u.hasOwnProperty("flags")&&(c.flags=u.flags),c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},"getTypeUrl"),n})(),o.HistogramDataPoint=(function(){function n(a){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"HistogramDataPoint"),n.prototype.attributes=X.emptyArray,n.prototype.startTimeUnixNano=null,n.prototype.timeUnixNano=null,n.prototype.count=null,n.prototype.sum=null,n.prototype.bucketCounts=X.emptyArray,n.prototype.explicitBounds=X.emptyArray,n.prototype.exemplars=X.emptyArray,n.prototype.flags=null,n.prototype.min=null,n.prototype.max=null;var i;return Object.defineProperty(n.prototype,"_sum",{get:X.oneOfGetter(i=["sum"]),set:X.oneOfSetter(i)}),Object.defineProperty(n.prototype,"_min",{get:X.oneOfGetter(i=["min"]),set:X.oneOfSetter(i)}),Object.defineProperty(n.prototype,"_max",{get:X.oneOfGetter(i=["max"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.startTimeUnixNano!=null&&Object.hasOwnProperty.call(u,"startTimeUnixNano")&&l.uint32(17).fixed64(u.startTimeUnixNano),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(25).fixed64(u.timeUnixNano),u.count!=null&&Object.hasOwnProperty.call(u,"count")&&l.uint32(33).fixed64(u.count),u.sum!=null&&Object.hasOwnProperty.call(u,"sum")&&l.uint32(41).double(u.sum),u.bucketCounts!=null&&u.bucketCounts.length){l.uint32(50).fork();for(var c=0;c<u.bucketCounts.length;++c)l.fixed64(u.bucketCounts[c]);l.ldelim()}if(u.explicitBounds!=null&&u.explicitBounds.length){l.uint32(58).fork();for(var c=0;c<u.explicitBounds.length;++c)l.double(u.explicitBounds[c]);l.ldelim()}if(u.exemplars!=null&&u.exemplars.length)for(var c=0;c<u.exemplars.length;++c)J.opentelemetry.proto.metrics.v1.Exemplar.encode(u.exemplars[c],l.uint32(66).fork()).ldelim();if(u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(74).fork()).ldelim();return u.flags!=null&&Object.hasOwnProperty.call(u,"flags")&&l.uint32(80).uint32(u.flags),u.min!=null&&Object.hasOwnProperty.call(u,"min")&&l.uint32(89).double(u.min),u.max!=null&&Object.hasOwnProperty.call(u,"max")&&l.uint32(97).double(u.max),l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.HistogramDataPoint;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 9:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 2:{p.startTimeUnixNano=u.fixed64();break}case 3:{p.timeUnixNano=u.fixed64();break}case 4:{p.count=u.fixed64();break}case 5:{p.sum=u.double();break}case 6:{if(p.bucketCounts&&p.bucketCounts.length||(p.bucketCounts=[]),(m&7)===2)for(var f=u.uint32()+u.pos;u.pos<f;)p.bucketCounts.push(u.fixed64());else p.bucketCounts.push(u.fixed64());break}case 7:{if(p.explicitBounds&&p.explicitBounds.length||(p.explicitBounds=[]),(m&7)===2)for(var f=u.uint32()+u.pos;u.pos<f;)p.explicitBounds.push(u.double());else p.explicitBounds.push(u.double());break}case 8:{p.exemplars&&p.exemplars.length||(p.exemplars=[]),p.exemplars.push(J.opentelemetry.proto.metrics.v1.Exemplar.decode(u,u.uint32()));break}case 10:{p.flags=u.uint32();break}case 11:{p.min=u.double();break}case 12:{p.max=u.double();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var c=0;c<u.attributes.length;++c){var d=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[c]);if(d)return"attributes."+d}}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(u.startTimeUnixNano)&&!(u.startTimeUnixNano&&X.isInteger(u.startTimeUnixNano.low)&&X.isInteger(u.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.count!=null&&u.hasOwnProperty("count")&&!X.isInteger(u.count)&&!(u.count&&X.isInteger(u.count.low)&&X.isInteger(u.count.high)))return"count: integer|Long expected";if(u.sum!=null&&u.hasOwnProperty("sum")&&(l._sum=1,typeof u.sum!="number"))return"sum: number expected";if(u.bucketCounts!=null&&u.hasOwnProperty("bucketCounts")){if(!Array.isArray(u.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<u.bucketCounts.length;++c)if(!X.isInteger(u.bucketCounts[c])&&!(u.bucketCounts[c]&&X.isInteger(u.bucketCounts[c].low)&&X.isInteger(u.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}if(u.explicitBounds!=null&&u.hasOwnProperty("explicitBounds")){if(!Array.isArray(u.explicitBounds))return"explicitBounds: array expected";for(var c=0;c<u.explicitBounds.length;++c)if(typeof u.explicitBounds[c]!="number")return"explicitBounds: number[] expected"}if(u.exemplars!=null&&u.hasOwnProperty("exemplars")){if(!Array.isArray(u.exemplars))return"exemplars: array expected";for(var c=0;c<u.exemplars.length;++c){var d=J.opentelemetry.proto.metrics.v1.Exemplar.verify(u.exemplars[c]);if(d)return"exemplars."+d}}return u.flags!=null&&u.hasOwnProperty("flags")&&!X.isInteger(u.flags)?"flags: integer expected":u.min!=null&&u.hasOwnProperty("min")&&(l._min=1,typeof u.min!="number")?"min: number expected":u.max!=null&&u.hasOwnProperty("max")&&(l._max=1,typeof u.max!="number")?"max: number expected":null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.HistogramDataPoint)return u;var l=new J.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}if(u.startTimeUnixNano!=null&&(X.Long?(l.startTimeUnixNano=X.Long.fromValue(u.startTimeUnixNano)).unsigned=!1:typeof u.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(u.startTimeUnixNano,10):typeof u.startTimeUnixNano=="number"?l.startTimeUnixNano=u.startTimeUnixNano:typeof u.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber())),u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.count!=null&&(X.Long?(l.count=X.Long.fromValue(u.count)).unsigned=!1:typeof u.count=="string"?l.count=parseInt(u.count,10):typeof u.count=="number"?l.count=u.count:typeof u.count=="object"&&(l.count=new X.LongBits(u.count.low>>>0,u.count.high>>>0).toNumber())),u.sum!=null&&(l.sum=Number(u.sum)),u.bucketCounts){if(!Array.isArray(u.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");l.bucketCounts=[];for(var c=0;c<u.bucketCounts.length;++c)X.Long?(l.bucketCounts[c]=X.Long.fromValue(u.bucketCounts[c])).unsigned=!1:typeof u.bucketCounts[c]=="string"?l.bucketCounts[c]=parseInt(u.bucketCounts[c],10):typeof u.bucketCounts[c]=="number"?l.bucketCounts[c]=u.bucketCounts[c]:typeof u.bucketCounts[c]=="object"&&(l.bucketCounts[c]=new X.LongBits(u.bucketCounts[c].low>>>0,u.bucketCounts[c].high>>>0).toNumber())}if(u.explicitBounds){if(!Array.isArray(u.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");l.explicitBounds=[];for(var c=0;c<u.explicitBounds.length;++c)l.explicitBounds[c]=Number(u.explicitBounds[c])}if(u.exemplars){if(!Array.isArray(u.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<u.exemplars.length;++c){if(typeof u.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");l.exemplars[c]=J.opentelemetry.proto.metrics.v1.Exemplar.fromObject(u.exemplars[c])}}return u.flags!=null&&(l.flags=u.flags>>>0),u.min!=null&&(l.min=Number(u.min)),u.max!=null&&(l.max=Number(u.max)),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.bucketCounts=[],c.explicitBounds=[],c.exemplars=[],c.attributes=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.startTimeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.count=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.count=l.longs===String?"0":0;c.flags=0}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&(typeof u.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(u.startTimeUnixNano):u.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.startTimeUnixNano):l.longs===Number?new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber():u.startTimeUnixNano),u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.count!=null&&u.hasOwnProperty("count")&&(typeof u.count=="number"?c.count=l.longs===String?String(u.count):u.count:c.count=l.longs===String?X.Long.prototype.toString.call(u.count):l.longs===Number?new X.LongBits(u.count.low>>>0,u.count.high>>>0).toNumber():u.count),u.sum!=null&&u.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(u.sum)?String(u.sum):u.sum,l.oneofs&&(c._sum="sum")),u.bucketCounts&&u.bucketCounts.length){c.bucketCounts=[];for(var p=0;p<u.bucketCounts.length;++p)typeof u.bucketCounts[p]=="number"?c.bucketCounts[p]=l.longs===String?String(u.bucketCounts[p]):u.bucketCounts[p]:c.bucketCounts[p]=l.longs===String?X.Long.prototype.toString.call(u.bucketCounts[p]):l.longs===Number?new X.LongBits(u.bucketCounts[p].low>>>0,u.bucketCounts[p].high>>>0).toNumber():u.bucketCounts[p]}if(u.explicitBounds&&u.explicitBounds.length){c.explicitBounds=[];for(var p=0;p<u.explicitBounds.length;++p)c.explicitBounds[p]=l.json&&!isFinite(u.explicitBounds[p])?String(u.explicitBounds[p]):u.explicitBounds[p]}if(u.exemplars&&u.exemplars.length){c.exemplars=[];for(var p=0;p<u.exemplars.length;++p)c.exemplars[p]=J.opentelemetry.proto.metrics.v1.Exemplar.toObject(u.exemplars[p],l)}if(u.attributes&&u.attributes.length){c.attributes=[];for(var p=0;p<u.attributes.length;++p)c.attributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[p],l)}return u.flags!=null&&u.hasOwnProperty("flags")&&(c.flags=u.flags),u.min!=null&&u.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(u.min)?String(u.min):u.min,l.oneofs&&(c._min="min")),u.max!=null&&u.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(u.max)?String(u.max):u.max,l.oneofs&&(c._max="max")),c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},"getTypeUrl"),n})(),o.ExponentialHistogramDataPoint=(function(){function n(a){if(this.attributes=[],this.exemplars=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"ExponentialHistogramDataPoint"),n.prototype.attributes=X.emptyArray,n.prototype.startTimeUnixNano=null,n.prototype.timeUnixNano=null,n.prototype.count=null,n.prototype.sum=null,n.prototype.scale=null,n.prototype.zeroCount=null,n.prototype.positive=null,n.prototype.negative=null,n.prototype.flags=null,n.prototype.exemplars=X.emptyArray,n.prototype.min=null,n.prototype.max=null,n.prototype.zeroThreshold=null;var i;return Object.defineProperty(n.prototype,"_sum",{get:X.oneOfGetter(i=["sum"]),set:X.oneOfSetter(i)}),Object.defineProperty(n.prototype,"_min",{get:X.oneOfGetter(i=["min"]),set:X.oneOfSetter(i)}),Object.defineProperty(n.prototype,"_max",{get:X.oneOfGetter(i=["max"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(10).fork()).ldelim();if(u.startTimeUnixNano!=null&&Object.hasOwnProperty.call(u,"startTimeUnixNano")&&l.uint32(17).fixed64(u.startTimeUnixNano),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(25).fixed64(u.timeUnixNano),u.count!=null&&Object.hasOwnProperty.call(u,"count")&&l.uint32(33).fixed64(u.count),u.sum!=null&&Object.hasOwnProperty.call(u,"sum")&&l.uint32(41).double(u.sum),u.scale!=null&&Object.hasOwnProperty.call(u,"scale")&&l.uint32(48).sint32(u.scale),u.zeroCount!=null&&Object.hasOwnProperty.call(u,"zeroCount")&&l.uint32(57).fixed64(u.zeroCount),u.positive!=null&&Object.hasOwnProperty.call(u,"positive")&&J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(u.positive,l.uint32(66).fork()).ldelim(),u.negative!=null&&Object.hasOwnProperty.call(u,"negative")&&J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(u.negative,l.uint32(74).fork()).ldelim(),u.flags!=null&&Object.hasOwnProperty.call(u,"flags")&&l.uint32(80).uint32(u.flags),u.exemplars!=null&&u.exemplars.length)for(var c=0;c<u.exemplars.length;++c)J.opentelemetry.proto.metrics.v1.Exemplar.encode(u.exemplars[c],l.uint32(90).fork()).ldelim();return u.min!=null&&Object.hasOwnProperty.call(u,"min")&&l.uint32(97).double(u.min),u.max!=null&&Object.hasOwnProperty.call(u,"max")&&l.uint32(105).double(u.max),u.zeroThreshold!=null&&Object.hasOwnProperty.call(u,"zeroThreshold")&&l.uint32(113).double(u.zeroThreshold),l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 2:{p.startTimeUnixNano=u.fixed64();break}case 3:{p.timeUnixNano=u.fixed64();break}case 4:{p.count=u.fixed64();break}case 5:{p.sum=u.double();break}case 6:{p.scale=u.sint32();break}case 7:{p.zeroCount=u.fixed64();break}case 8:{p.positive=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(u,u.uint32());break}case 9:{p.negative=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(u,u.uint32());break}case 10:{p.flags=u.uint32();break}case 11:{p.exemplars&&p.exemplars.length||(p.exemplars=[]),p.exemplars.push(J.opentelemetry.proto.metrics.v1.Exemplar.decode(u,u.uint32()));break}case 12:{p.min=u.double();break}case 13:{p.max=u.double();break}case 14:{p.zeroThreshold=u.double();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var c=0;c<u.attributes.length;++c){var d=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[c]);if(d)return"attributes."+d}}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(u.startTimeUnixNano)&&!(u.startTimeUnixNano&&X.isInteger(u.startTimeUnixNano.low)&&X.isInteger(u.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.count!=null&&u.hasOwnProperty("count")&&!X.isInteger(u.count)&&!(u.count&&X.isInteger(u.count.low)&&X.isInteger(u.count.high)))return"count: integer|Long expected";if(u.sum!=null&&u.hasOwnProperty("sum")&&(l._sum=1,typeof u.sum!="number"))return"sum: number expected";if(u.scale!=null&&u.hasOwnProperty("scale")&&!X.isInteger(u.scale))return"scale: integer expected";if(u.zeroCount!=null&&u.hasOwnProperty("zeroCount")&&!X.isInteger(u.zeroCount)&&!(u.zeroCount&&X.isInteger(u.zeroCount.low)&&X.isInteger(u.zeroCount.high)))return"zeroCount: integer|Long expected";if(u.positive!=null&&u.hasOwnProperty("positive")){var d=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(u.positive);if(d)return"positive."+d}if(u.negative!=null&&u.hasOwnProperty("negative")){var d=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(u.negative);if(d)return"negative."+d}if(u.flags!=null&&u.hasOwnProperty("flags")&&!X.isInteger(u.flags))return"flags: integer expected";if(u.exemplars!=null&&u.hasOwnProperty("exemplars")){if(!Array.isArray(u.exemplars))return"exemplars: array expected";for(var c=0;c<u.exemplars.length;++c){var d=J.opentelemetry.proto.metrics.v1.Exemplar.verify(u.exemplars[c]);if(d)return"exemplars."+d}}return u.min!=null&&u.hasOwnProperty("min")&&(l._min=1,typeof u.min!="number")?"min: number expected":u.max!=null&&u.hasOwnProperty("max")&&(l._max=1,typeof u.max!="number")?"max: number expected":u.zeroThreshold!=null&&u.hasOwnProperty("zeroThreshold")&&typeof u.zeroThreshold!="number"?"zeroThreshold: number expected":null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return u;var l=new J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}if(u.startTimeUnixNano!=null&&(X.Long?(l.startTimeUnixNano=X.Long.fromValue(u.startTimeUnixNano)).unsigned=!1:typeof u.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(u.startTimeUnixNano,10):typeof u.startTimeUnixNano=="number"?l.startTimeUnixNano=u.startTimeUnixNano:typeof u.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber())),u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.count!=null&&(X.Long?(l.count=X.Long.fromValue(u.count)).unsigned=!1:typeof u.count=="string"?l.count=parseInt(u.count,10):typeof u.count=="number"?l.count=u.count:typeof u.count=="object"&&(l.count=new X.LongBits(u.count.low>>>0,u.count.high>>>0).toNumber())),u.sum!=null&&(l.sum=Number(u.sum)),u.scale!=null&&(l.scale=u.scale|0),u.zeroCount!=null&&(X.Long?(l.zeroCount=X.Long.fromValue(u.zeroCount)).unsigned=!1:typeof u.zeroCount=="string"?l.zeroCount=parseInt(u.zeroCount,10):typeof u.zeroCount=="number"?l.zeroCount=u.zeroCount:typeof u.zeroCount=="object"&&(l.zeroCount=new X.LongBits(u.zeroCount.low>>>0,u.zeroCount.high>>>0).toNumber())),u.positive!=null){if(typeof u.positive!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");l.positive=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(u.positive)}if(u.negative!=null){if(typeof u.negative!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");l.negative=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(u.negative)}if(u.flags!=null&&(l.flags=u.flags>>>0),u.exemplars){if(!Array.isArray(u.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<u.exemplars.length;++c){if(typeof u.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");l.exemplars[c]=J.opentelemetry.proto.metrics.v1.Exemplar.fromObject(u.exemplars[c])}}return u.min!=null&&(l.min=Number(u.min)),u.max!=null&&(l.max=Number(u.max)),u.zeroThreshold!=null&&(l.zeroThreshold=Number(u.zeroThreshold)),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[],c.exemplars=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.startTimeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.count=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.count=l.longs===String?"0":0;if(c.scale=0,X.Long){var d=new X.Long(0,0,!1);c.zeroCount=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.zeroCount=l.longs===String?"0":0;c.positive=null,c.negative=null,c.flags=0,c.zeroThreshold=0}if(u.attributes&&u.attributes.length){c.attributes=[];for(var p=0;p<u.attributes.length;++p)c.attributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[p],l)}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&(typeof u.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(u.startTimeUnixNano):u.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.startTimeUnixNano):l.longs===Number?new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber():u.startTimeUnixNano),u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.count!=null&&u.hasOwnProperty("count")&&(typeof u.count=="number"?c.count=l.longs===String?String(u.count):u.count:c.count=l.longs===String?X.Long.prototype.toString.call(u.count):l.longs===Number?new X.LongBits(u.count.low>>>0,u.count.high>>>0).toNumber():u.count),u.sum!=null&&u.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(u.sum)?String(u.sum):u.sum,l.oneofs&&(c._sum="sum")),u.scale!=null&&u.hasOwnProperty("scale")&&(c.scale=u.scale),u.zeroCount!=null&&u.hasOwnProperty("zeroCount")&&(typeof u.zeroCount=="number"?c.zeroCount=l.longs===String?String(u.zeroCount):u.zeroCount:c.zeroCount=l.longs===String?X.Long.prototype.toString.call(u.zeroCount):l.longs===Number?new X.LongBits(u.zeroCount.low>>>0,u.zeroCount.high>>>0).toNumber():u.zeroCount),u.positive!=null&&u.hasOwnProperty("positive")&&(c.positive=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(u.positive,l)),u.negative!=null&&u.hasOwnProperty("negative")&&(c.negative=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(u.negative,l)),u.flags!=null&&u.hasOwnProperty("flags")&&(c.flags=u.flags),u.exemplars&&u.exemplars.length){c.exemplars=[];for(var p=0;p<u.exemplars.length;++p)c.exemplars[p]=J.opentelemetry.proto.metrics.v1.Exemplar.toObject(u.exemplars[p],l)}return u.min!=null&&u.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(u.min)?String(u.min):u.min,l.oneofs&&(c._min="min")),u.max!=null&&u.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(u.max)?String(u.max):u.max,l.oneofs&&(c._max="max")),u.zeroThreshold!=null&&u.hasOwnProperty("zeroThreshold")&&(c.zeroThreshold=l.json&&!isFinite(u.zeroThreshold)?String(u.zeroThreshold):u.zeroThreshold),c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},"getTypeUrl"),n.Buckets=(function(){function a(u){if(this.bucketCounts=[],u)for(var l=Object.keys(u),c=0;c<l.length;++c)u[l[c]]!=null&&(this[l[c]]=u[l[c]])}return s(a,"Buckets"),a.prototype.offset=null,a.prototype.bucketCounts=X.emptyArray,a.create=s(function(l){return new a(l)},"create"),a.encode=s(function(l,c){if(c||(c=Yn.create()),l.offset!=null&&Object.hasOwnProperty.call(l,"offset")&&c.uint32(8).sint32(l.offset),l.bucketCounts!=null&&l.bucketCounts.length){c.uint32(18).fork();for(var d=0;d<l.bucketCounts.length;++d)c.uint64(l.bucketCounts[d]);c.ldelim()}return c},"encode"),a.encodeDelimited=s(function(l,c){return this.encode(l,c).ldelim()},"encodeDelimited"),a.decode=s(function(l,c,d){l instanceof je||(l=je.create(l));for(var p=c===void 0?l.len:l.pos+c,m=new J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;l.pos<p;){var f=l.uint32();if(f===d)break;switch(f>>>3){case 1:{m.offset=l.sint32();break}case 2:{if(m.bucketCounts&&m.bucketCounts.length||(m.bucketCounts=[]),(f&7)===2)for(var h=l.uint32()+l.pos;l.pos<h;)m.bucketCounts.push(l.uint64());else m.bucketCounts.push(l.uint64());break}default:l.skipType(f&7);break}}return m},"decode"),a.decodeDelimited=s(function(l){return l instanceof je||(l=new je(l)),this.decode(l,l.uint32())},"decodeDelimited"),a.verify=s(function(l){if(typeof l!="object"||l===null)return"object expected";if(l.offset!=null&&l.hasOwnProperty("offset")&&!X.isInteger(l.offset))return"offset: integer expected";if(l.bucketCounts!=null&&l.hasOwnProperty("bucketCounts")){if(!Array.isArray(l.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<l.bucketCounts.length;++c)if(!X.isInteger(l.bucketCounts[c])&&!(l.bucketCounts[c]&&X.isInteger(l.bucketCounts[c].low)&&X.isInteger(l.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}return null},"verify"),a.fromObject=s(function(l){if(l instanceof J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return l;var c=new J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(l.offset!=null&&(c.offset=l.offset|0),l.bucketCounts){if(!Array.isArray(l.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");c.bucketCounts=[];for(var d=0;d<l.bucketCounts.length;++d)X.Long?(c.bucketCounts[d]=X.Long.fromValue(l.bucketCounts[d])).unsigned=!0:typeof l.bucketCounts[d]=="string"?c.bucketCounts[d]=parseInt(l.bucketCounts[d],10):typeof l.bucketCounts[d]=="number"?c.bucketCounts[d]=l.bucketCounts[d]:typeof l.bucketCounts[d]=="object"&&(c.bucketCounts[d]=new X.LongBits(l.bucketCounts[d].low>>>0,l.bucketCounts[d].high>>>0).toNumber(!0))}return c},"fromObject"),a.toObject=s(function(l,c){c||(c={});var d={};if((c.arrays||c.defaults)&&(d.bucketCounts=[]),c.defaults&&(d.offset=0),l.offset!=null&&l.hasOwnProperty("offset")&&(d.offset=l.offset),l.bucketCounts&&l.bucketCounts.length){d.bucketCounts=[];for(var p=0;p<l.bucketCounts.length;++p)typeof l.bucketCounts[p]=="number"?d.bucketCounts[p]=c.longs===String?String(l.bucketCounts[p]):l.bucketCounts[p]:d.bucketCounts[p]=c.longs===String?X.Long.prototype.toString.call(l.bucketCounts[p]):c.longs===Number?new X.LongBits(l.bucketCounts[p].low>>>0,l.bucketCounts[p].high>>>0).toNumber(!0):l.bucketCounts[p]}return d},"toObject"),a.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),a.getTypeUrl=s(function(l){return l===void 0&&(l="type.googleapis.com"),l+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},"getTypeUrl"),a})(),n})(),o.SummaryDataPoint=(function(){function n(i){if(this.attributes=[],this.quantileValues=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"SummaryDataPoint"),n.prototype.attributes=X.emptyArray,n.prototype.startTimeUnixNano=null,n.prototype.timeUnixNano=null,n.prototype.count=null,n.prototype.sum=null,n.prototype.quantileValues=X.emptyArray,n.prototype.flags=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.startTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"startTimeUnixNano")&&u.uint32(17).fixed64(a.startTimeUnixNano),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&u.uint32(25).fixed64(a.timeUnixNano),a.count!=null&&Object.hasOwnProperty.call(a,"count")&&u.uint32(33).fixed64(a.count),a.sum!=null&&Object.hasOwnProperty.call(a,"sum")&&u.uint32(41).double(a.sum),a.quantileValues!=null&&a.quantileValues.length)for(var l=0;l<a.quantileValues.length;++l)J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(a.quantileValues[l],u.uint32(50).fork()).ldelim();if(a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(58).fork()).ldelim();return a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&u.uint32(64).uint32(a.flags),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.SummaryDataPoint;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 7:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 2:{d.startTimeUnixNano=a.fixed64();break}case 3:{d.timeUnixNano=a.fixed64();break}case 4:{d.count=a.fixed64();break}case 5:{d.sum=a.double();break}case 6:{d.quantileValues&&d.quantileValues.length||(d.quantileValues=[]),d.quantileValues.push(J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(a,a.uint32()));break}case 8:{d.flags=a.uint32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(l)return"attributes."+l}}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(a.startTimeUnixNano)&&!(a.startTimeUnixNano&&X.isInteger(a.startTimeUnixNano.low)&&X.isInteger(a.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!X.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&X.isInteger(a.timeUnixNano.low)&&X.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.count!=null&&a.hasOwnProperty("count")&&!X.isInteger(a.count)&&!(a.count&&X.isInteger(a.count.low)&&X.isInteger(a.count.high)))return"count: integer|Long expected";if(a.sum!=null&&a.hasOwnProperty("sum")&&typeof a.sum!="number")return"sum: number expected";if(a.quantileValues!=null&&a.hasOwnProperty("quantileValues")){if(!Array.isArray(a.quantileValues))return"quantileValues: array expected";for(var u=0;u<a.quantileValues.length;++u){var l=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(a.quantileValues[u]);if(l)return"quantileValues."+l}}return a.flags!=null&&a.hasOwnProperty("flags")&&!X.isInteger(a.flags)?"flags: integer expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.SummaryDataPoint)return a;var u=new J.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}if(a.startTimeUnixNano!=null&&(X.Long?(u.startTimeUnixNano=X.Long.fromValue(a.startTimeUnixNano)).unsigned=!1:typeof a.startTimeUnixNano=="string"?u.startTimeUnixNano=parseInt(a.startTimeUnixNano,10):typeof a.startTimeUnixNano=="number"?u.startTimeUnixNano=a.startTimeUnixNano:typeof a.startTimeUnixNano=="object"&&(u.startTimeUnixNano=new X.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber())),a.timeUnixNano!=null&&(X.Long?(u.timeUnixNano=X.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?u.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?u.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(u.timeUnixNano=new X.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.count!=null&&(X.Long?(u.count=X.Long.fromValue(a.count)).unsigned=!1:typeof a.count=="string"?u.count=parseInt(a.count,10):typeof a.count=="number"?u.count=a.count:typeof a.count=="object"&&(u.count=new X.LongBits(a.count.low>>>0,a.count.high>>>0).toNumber())),a.sum!=null&&(u.sum=Number(a.sum)),a.quantileValues){if(!Array.isArray(a.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");u.quantileValues=[];for(var l=0;l<a.quantileValues.length;++l){if(typeof a.quantileValues[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");u.quantileValues[l]=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(a.quantileValues[l])}}return a.flags!=null&&(u.flags=a.flags>>>0),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.quantileValues=[],l.attributes=[]),u.defaults){if(X.Long){var c=new X.Long(0,0,!1);l.startTimeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.startTimeUnixNano=u.longs===String?"0":0;if(X.Long){var c=new X.Long(0,0,!1);l.timeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.timeUnixNano=u.longs===String?"0":0;if(X.Long){var c=new X.Long(0,0,!1);l.count=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.count=u.longs===String?"0":0;l.sum=0,l.flags=0}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&(typeof a.startTimeUnixNano=="number"?l.startTimeUnixNano=u.longs===String?String(a.startTimeUnixNano):a.startTimeUnixNano:l.startTimeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.startTimeUnixNano):u.longs===Number?new X.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber():a.startTimeUnixNano),a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?l.timeUnixNano=u.longs===String?String(a.timeUnixNano):a.timeUnixNano:l.timeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.timeUnixNano):u.longs===Number?new X.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.count!=null&&a.hasOwnProperty("count")&&(typeof a.count=="number"?l.count=u.longs===String?String(a.count):a.count:l.count=u.longs===String?X.Long.prototype.toString.call(a.count):u.longs===Number?new X.LongBits(a.count.low>>>0,a.count.high>>>0).toNumber():a.count),a.sum!=null&&a.hasOwnProperty("sum")&&(l.sum=u.json&&!isFinite(a.sum)?String(a.sum):a.sum),a.quantileValues&&a.quantileValues.length){l.quantileValues=[];for(var d=0;d<a.quantileValues.length;++d)l.quantileValues[d]=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(a.quantileValues[d],u)}if(a.attributes&&a.attributes.length){l.attributes=[];for(var d=0;d<a.attributes.length;++d)l.attributes[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[d],u)}return a.flags!=null&&a.hasOwnProperty("flags")&&(l.flags=a.flags),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},"getTypeUrl"),n.ValueAtQuantile=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ValueAtQuantile"),i.prototype.quantile=null,i.prototype.value=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.quantile!=null&&Object.hasOwnProperty.call(u,"quantile")&&l.uint32(9).double(u.quantile),u.value!=null&&Object.hasOwnProperty.call(u,"value")&&l.uint32(17).double(u.value),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.quantile=u.double();break}case 2:{p.value=u.double();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){return typeof u!="object"||u===null?"object expected":u.quantile!=null&&u.hasOwnProperty("quantile")&&typeof u.quantile!="number"?"quantile: number expected":u.value!=null&&u.hasOwnProperty("value")&&typeof u.value!="number"?"value: number expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return u;var l=new J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return u.quantile!=null&&(l.quantile=Number(u.quantile)),u.value!=null&&(l.value=Number(u.value)),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};return l.defaults&&(c.quantile=0,c.value=0),u.quantile!=null&&u.hasOwnProperty("quantile")&&(c.quantile=l.json&&!isFinite(u.quantile)?String(u.quantile):u.quantile),u.value!=null&&u.hasOwnProperty("value")&&(c.value=l.json&&!isFinite(u.value)?String(u.value):u.value),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},"getTypeUrl"),i})(),n})(),o.Exemplar=(function(){function n(a){if(this.filteredAttributes=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"Exemplar"),n.prototype.filteredAttributes=X.emptyArray,n.prototype.timeUnixNano=null,n.prototype.asDouble=null,n.prototype.asInt=null,n.prototype.spanId=null,n.prototype.traceId=null;var i;return Object.defineProperty(n.prototype,"value",{get:X.oneOfGetter(i=["asDouble","asInt"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(17).fixed64(u.timeUnixNano),u.asDouble!=null&&Object.hasOwnProperty.call(u,"asDouble")&&l.uint32(25).double(u.asDouble),u.spanId!=null&&Object.hasOwnProperty.call(u,"spanId")&&l.uint32(34).bytes(u.spanId),u.traceId!=null&&Object.hasOwnProperty.call(u,"traceId")&&l.uint32(42).bytes(u.traceId),u.asInt!=null&&Object.hasOwnProperty.call(u,"asInt")&&l.uint32(49).sfixed64(u.asInt),u.filteredAttributes!=null&&u.filteredAttributes.length)for(var c=0;c<u.filteredAttributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.filteredAttributes[c],l.uint32(58).fork()).ldelim();return l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.Exemplar;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 7:{p.filteredAttributes&&p.filteredAttributes.length||(p.filteredAttributes=[]),p.filteredAttributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 2:{p.timeUnixNano=u.fixed64();break}case 3:{p.asDouble=u.double();break}case 6:{p.asInt=u.sfixed64();break}case 4:{p.spanId=u.bytes();break}case 5:{p.traceId=u.bytes();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.filteredAttributes!=null&&u.hasOwnProperty("filteredAttributes")){if(!Array.isArray(u.filteredAttributes))return"filteredAttributes: array expected";for(var c=0;c<u.filteredAttributes.length;++c){var d=J.opentelemetry.proto.common.v1.KeyValue.verify(u.filteredAttributes[c]);if(d)return"filteredAttributes."+d}}if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.asDouble!=null&&u.hasOwnProperty("asDouble")&&(l.value=1,typeof u.asDouble!="number"))return"asDouble: number expected";if(u.asInt!=null&&u.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!X.isInteger(u.asInt)&&!(u.asInt&&X.isInteger(u.asInt.low)&&X.isInteger(u.asInt.high)))return"asInt: integer|Long expected"}return u.spanId!=null&&u.hasOwnProperty("spanId")&&!(u.spanId&&typeof u.spanId.length=="number"||X.isString(u.spanId))?"spanId: buffer expected":u.traceId!=null&&u.hasOwnProperty("traceId")&&!(u.traceId&&typeof u.traceId.length=="number"||X.isString(u.traceId))?"traceId: buffer expected":null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.Exemplar)return u;var l=new J.opentelemetry.proto.metrics.v1.Exemplar;if(u.filteredAttributes){if(!Array.isArray(u.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");l.filteredAttributes=[];for(var c=0;c<u.filteredAttributes.length;++c){if(typeof u.filteredAttributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");l.filteredAttributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.filteredAttributes[c])}}return u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.asDouble!=null&&(l.asDouble=Number(u.asDouble)),u.asInt!=null&&(X.Long?(l.asInt=X.Long.fromValue(u.asInt)).unsigned=!1:typeof u.asInt=="string"?l.asInt=parseInt(u.asInt,10):typeof u.asInt=="number"?l.asInt=u.asInt:typeof u.asInt=="object"&&(l.asInt=new X.LongBits(u.asInt.low>>>0,u.asInt.high>>>0).toNumber())),u.spanId!=null&&(typeof u.spanId=="string"?X.base64.decode(u.spanId,l.spanId=X.newBuffer(X.base64.length(u.spanId)),0):u.spanId.length>=0&&(l.spanId=u.spanId)),u.traceId!=null&&(typeof u.traceId=="string"?X.base64.decode(u.traceId,l.traceId=X.newBuffer(X.base64.length(u.traceId)),0):u.traceId.length>=0&&(l.traceId=u.traceId)),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.filteredAttributes=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=X.newBuffer(c.spanId))),l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=X.newBuffer(c.traceId)))}if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.asDouble!=null&&u.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(u.asDouble)?String(u.asDouble):u.asDouble,l.oneofs&&(c.value="asDouble")),u.spanId!=null&&u.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?X.base64.encode(u.spanId,0,u.spanId.length):l.bytes===Array?Array.prototype.slice.call(u.spanId):u.spanId),u.traceId!=null&&u.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?X.base64.encode(u.traceId,0,u.traceId.length):l.bytes===Array?Array.prototype.slice.call(u.traceId):u.traceId),u.asInt!=null&&u.hasOwnProperty("asInt")&&(typeof u.asInt=="number"?c.asInt=l.longs===String?String(u.asInt):u.asInt:c.asInt=l.longs===String?X.Long.prototype.toString.call(u.asInt):l.longs===Number?new X.LongBits(u.asInt.low>>>0,u.asInt.high>>>0).toNumber():u.asInt,l.oneofs&&(c.value="asInt")),u.filteredAttributes&&u.filteredAttributes.length){c.filteredAttributes=[];for(var p=0;p<u.filteredAttributes.length;++p)c.filteredAttributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.filteredAttributes[p],l)}return c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.Exemplar"},"getTypeUrl"),n})(),o})(),r})(),t.logs=(function(){var r={};return r.v1=(function(){var o={};return o.LogsData=(function(){function n(i){if(this.resourceLogs=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"LogsData"),n.prototype.resourceLogs=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resourceLogs!=null&&a.resourceLogs.length)for(var l=0;l<a.resourceLogs.length;++l)J.opentelemetry.proto.logs.v1.ResourceLogs.encode(a.resourceLogs[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.logs.v1.LogsData;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resourceLogs&&d.resourceLogs.length||(d.resourceLogs=[]),d.resourceLogs.push(J.opentelemetry.proto.logs.v1.ResourceLogs.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceLogs!=null&&a.hasOwnProperty("resourceLogs")){if(!Array.isArray(a.resourceLogs))return"resourceLogs: array expected";for(var u=0;u<a.resourceLogs.length;++u){var l=J.opentelemetry.proto.logs.v1.ResourceLogs.verify(a.resourceLogs[u]);if(l)return"resourceLogs."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.logs.v1.LogsData)return a;var u=new J.opentelemetry.proto.logs.v1.LogsData;if(a.resourceLogs){if(!Array.isArray(a.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");u.resourceLogs=[];for(var l=0;l<a.resourceLogs.length;++l){if(typeof a.resourceLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");u.resourceLogs[l]=J.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(a.resourceLogs[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.resourceLogs=[]),a.resourceLogs&&a.resourceLogs.length){l.resourceLogs=[];for(var c=0;c<a.resourceLogs.length;++c)l.resourceLogs[c]=J.opentelemetry.proto.logs.v1.ResourceLogs.toObject(a.resourceLogs[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.logs.v1.LogsData"},"getTypeUrl"),n})(),o.ResourceLogs=(function(){function n(i){if(this.scopeLogs=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ResourceLogs"),n.prototype.resource=null,n.prototype.scopeLogs=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resource!=null&&Object.hasOwnProperty.call(a,"resource")&&J.opentelemetry.proto.resource.v1.Resource.encode(a.resource,u.uint32(10).fork()).ldelim(),a.scopeLogs!=null&&a.scopeLogs.length)for(var l=0;l<a.scopeLogs.length;++l)J.opentelemetry.proto.logs.v1.ScopeLogs.encode(a.scopeLogs[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.logs.v1.ResourceLogs;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resource=J.opentelemetry.proto.resource.v1.Resource.decode(a,a.uint32());break}case 2:{d.scopeLogs&&d.scopeLogs.length||(d.scopeLogs=[]),d.scopeLogs.push(J.opentelemetry.proto.logs.v1.ScopeLogs.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resource!=null&&a.hasOwnProperty("resource")){var u=J.opentelemetry.proto.resource.v1.Resource.verify(a.resource);if(u)return"resource."+u}if(a.scopeLogs!=null&&a.hasOwnProperty("scopeLogs")){if(!Array.isArray(a.scopeLogs))return"scopeLogs: array expected";for(var l=0;l<a.scopeLogs.length;++l){var u=J.opentelemetry.proto.logs.v1.ScopeLogs.verify(a.scopeLogs[l]);if(u)return"scopeLogs."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.logs.v1.ResourceLogs)return a;var u=new J.opentelemetry.proto.logs.v1.ResourceLogs;if(a.resource!=null){if(typeof a.resource!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");u.resource=J.opentelemetry.proto.resource.v1.Resource.fromObject(a.resource)}if(a.scopeLogs){if(!Array.isArray(a.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");u.scopeLogs=[];for(var l=0;l<a.scopeLogs.length;++l){if(typeof a.scopeLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");u.scopeLogs[l]=J.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(a.scopeLogs[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.scopeLogs=[]),u.defaults&&(l.resource=null,l.schemaUrl=""),a.resource!=null&&a.hasOwnProperty("resource")&&(l.resource=J.opentelemetry.proto.resource.v1.Resource.toObject(a.resource,u)),a.scopeLogs&&a.scopeLogs.length){l.scopeLogs=[];for(var c=0;c<a.scopeLogs.length;++c)l.scopeLogs[c]=J.opentelemetry.proto.logs.v1.ScopeLogs.toObject(a.scopeLogs[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.logs.v1.ResourceLogs"},"getTypeUrl"),n})(),o.ScopeLogs=(function(){function n(i){if(this.logRecords=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ScopeLogs"),n.prototype.scope=null,n.prototype.logRecords=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.scope!=null&&Object.hasOwnProperty.call(a,"scope")&&J.opentelemetry.proto.common.v1.InstrumentationScope.encode(a.scope,u.uint32(10).fork()).ldelim(),a.logRecords!=null&&a.logRecords.length)for(var l=0;l<a.logRecords.length;++l)J.opentelemetry.proto.logs.v1.LogRecord.encode(a.logRecords[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.logs.v1.ScopeLogs;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.decode(a,a.uint32());break}case 2:{d.logRecords&&d.logRecords.length||(d.logRecords=[]),d.logRecords.push(J.opentelemetry.proto.logs.v1.LogRecord.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.scope!=null&&a.hasOwnProperty("scope")){var u=J.opentelemetry.proto.common.v1.InstrumentationScope.verify(a.scope);if(u)return"scope."+u}if(a.logRecords!=null&&a.hasOwnProperty("logRecords")){if(!Array.isArray(a.logRecords))return"logRecords: array expected";for(var l=0;l<a.logRecords.length;++l){var u=J.opentelemetry.proto.logs.v1.LogRecord.verify(a.logRecords[l]);if(u)return"logRecords."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.logs.v1.ScopeLogs)return a;var u=new J.opentelemetry.proto.logs.v1.ScopeLogs;if(a.scope!=null){if(typeof a.scope!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");u.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(a.scope)}if(a.logRecords){if(!Array.isArray(a.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");u.logRecords=[];for(var l=0;l<a.logRecords.length;++l){if(typeof a.logRecords[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");u.logRecords[l]=J.opentelemetry.proto.logs.v1.LogRecord.fromObject(a.logRecords[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.logRecords=[]),u.defaults&&(l.scope=null,l.schemaUrl=""),a.scope!=null&&a.hasOwnProperty("scope")&&(l.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.toObject(a.scope,u)),a.logRecords&&a.logRecords.length){l.logRecords=[];for(var c=0;c<a.logRecords.length;++c)l.logRecords[c]=J.opentelemetry.proto.logs.v1.LogRecord.toObject(a.logRecords[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.logs.v1.ScopeLogs"},"getTypeUrl"),n})(),o.SeverityNumber=(function(){var n={},i=Object.create(n);return i[n[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,i[n[1]="SEVERITY_NUMBER_TRACE"]=1,i[n[2]="SEVERITY_NUMBER_TRACE2"]=2,i[n[3]="SEVERITY_NUMBER_TRACE3"]=3,i[n[4]="SEVERITY_NUMBER_TRACE4"]=4,i[n[5]="SEVERITY_NUMBER_DEBUG"]=5,i[n[6]="SEVERITY_NUMBER_DEBUG2"]=6,i[n[7]="SEVERITY_NUMBER_DEBUG3"]=7,i[n[8]="SEVERITY_NUMBER_DEBUG4"]=8,i[n[9]="SEVERITY_NUMBER_INFO"]=9,i[n[10]="SEVERITY_NUMBER_INFO2"]=10,i[n[11]="SEVERITY_NUMBER_INFO3"]=11,i[n[12]="SEVERITY_NUMBER_INFO4"]=12,i[n[13]="SEVERITY_NUMBER_WARN"]=13,i[n[14]="SEVERITY_NUMBER_WARN2"]=14,i[n[15]="SEVERITY_NUMBER_WARN3"]=15,i[n[16]="SEVERITY_NUMBER_WARN4"]=16,i[n[17]="SEVERITY_NUMBER_ERROR"]=17,i[n[18]="SEVERITY_NUMBER_ERROR2"]=18,i[n[19]="SEVERITY_NUMBER_ERROR3"]=19,i[n[20]="SEVERITY_NUMBER_ERROR4"]=20,i[n[21]="SEVERITY_NUMBER_FATAL"]=21,i[n[22]="SEVERITY_NUMBER_FATAL2"]=22,i[n[23]="SEVERITY_NUMBER_FATAL3"]=23,i[n[24]="SEVERITY_NUMBER_FATAL4"]=24,i})(),o.LogRecordFlags=(function(){var n={},i=Object.create(n);return i[n[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,i[n[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,i})(),o.LogRecord=(function(){function n(i){if(this.attributes=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"LogRecord"),n.prototype.timeUnixNano=null,n.prototype.observedTimeUnixNano=null,n.prototype.severityNumber=null,n.prototype.severityText=null,n.prototype.body=null,n.prototype.attributes=X.emptyArray,n.prototype.droppedAttributesCount=null,n.prototype.flags=null,n.prototype.traceId=null,n.prototype.spanId=null,n.prototype.eventName=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&u.uint32(9).fixed64(a.timeUnixNano),a.severityNumber!=null&&Object.hasOwnProperty.call(a,"severityNumber")&&u.uint32(16).int32(a.severityNumber),a.severityText!=null&&Object.hasOwnProperty.call(a,"severityText")&&u.uint32(26).string(a.severityText),a.body!=null&&Object.hasOwnProperty.call(a,"body")&&J.opentelemetry.proto.common.v1.AnyValue.encode(a.body,u.uint32(42).fork()).ldelim(),a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(50).fork()).ldelim();return a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&u.uint32(56).uint32(a.droppedAttributesCount),a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&u.uint32(69).fixed32(a.flags),a.traceId!=null&&Object.hasOwnProperty.call(a,"traceId")&&u.uint32(74).bytes(a.traceId),a.spanId!=null&&Object.hasOwnProperty.call(a,"spanId")&&u.uint32(82).bytes(a.spanId),a.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"observedTimeUnixNano")&&u.uint32(89).fixed64(a.observedTimeUnixNano),a.eventName!=null&&Object.hasOwnProperty.call(a,"eventName")&&u.uint32(98).string(a.eventName),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.logs.v1.LogRecord;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.timeUnixNano=a.fixed64();break}case 11:{d.observedTimeUnixNano=a.fixed64();break}case 2:{d.severityNumber=a.int32();break}case 3:{d.severityText=a.string();break}case 5:{d.body=J.opentelemetry.proto.common.v1.AnyValue.decode(a,a.uint32());break}case 6:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 7:{d.droppedAttributesCount=a.uint32();break}case 8:{d.flags=a.fixed32();break}case 9:{d.traceId=a.bytes();break}case 10:{d.spanId=a.bytes();break}case 12:{d.eventName=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!X.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&X.isInteger(a.timeUnixNano.low)&&X.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.observedTimeUnixNano!=null&&a.hasOwnProperty("observedTimeUnixNano")&&!X.isInteger(a.observedTimeUnixNano)&&!(a.observedTimeUnixNano&&X.isInteger(a.observedTimeUnixNano.low)&&X.isInteger(a.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected";if(a.severityNumber!=null&&a.hasOwnProperty("severityNumber"))switch(a.severityNumber){default:return"severityNumber: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(a.severityText!=null&&a.hasOwnProperty("severityText")&&!X.isString(a.severityText))return"severityText: string expected";if(a.body!=null&&a.hasOwnProperty("body")){var u=J.opentelemetry.proto.common.v1.AnyValue.verify(a.body);if(u)return"body."+u}if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var l=0;l<a.attributes.length;++l){var u=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[l]);if(u)return"attributes."+u}}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(a.droppedAttributesCount)?"droppedAttributesCount: integer expected":a.flags!=null&&a.hasOwnProperty("flags")&&!X.isInteger(a.flags)?"flags: integer expected":a.traceId!=null&&a.hasOwnProperty("traceId")&&!(a.traceId&&typeof a.traceId.length=="number"||X.isString(a.traceId))?"traceId: buffer expected":a.spanId!=null&&a.hasOwnProperty("spanId")&&!(a.spanId&&typeof a.spanId.length=="number"||X.isString(a.spanId))?"spanId: buffer expected":a.eventName!=null&&a.hasOwnProperty("eventName")&&!X.isString(a.eventName)?"eventName: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.logs.v1.LogRecord)return a;var u=new J.opentelemetry.proto.logs.v1.LogRecord;switch(a.timeUnixNano!=null&&(X.Long?(u.timeUnixNano=X.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?u.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?u.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(u.timeUnixNano=new X.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.observedTimeUnixNano!=null&&(X.Long?(u.observedTimeUnixNano=X.Long.fromValue(a.observedTimeUnixNano)).unsigned=!1:typeof a.observedTimeUnixNano=="string"?u.observedTimeUnixNano=parseInt(a.observedTimeUnixNano,10):typeof a.observedTimeUnixNano=="number"?u.observedTimeUnixNano=a.observedTimeUnixNano:typeof a.observedTimeUnixNano=="object"&&(u.observedTimeUnixNano=new X.LongBits(a.observedTimeUnixNano.low>>>0,a.observedTimeUnixNano.high>>>0).toNumber())),a.severityNumber){default:if(typeof a.severityNumber=="number"){u.severityNumber=a.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:u.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:u.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:u.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:u.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:u.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:u.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:u.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:u.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:u.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:u.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:u.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:u.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:u.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:u.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:u.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:u.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:u.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:u.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:u.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:u.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:u.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:u.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:u.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:u.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:u.severityNumber=24;break}if(a.severityText!=null&&(u.severityText=String(a.severityText)),a.body!=null){if(typeof a.body!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");u.body=J.opentelemetry.proto.common.v1.AnyValue.fromObject(a.body)}if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}return a.droppedAttributesCount!=null&&(u.droppedAttributesCount=a.droppedAttributesCount>>>0),a.flags!=null&&(u.flags=a.flags>>>0),a.traceId!=null&&(typeof a.traceId=="string"?X.base64.decode(a.traceId,u.traceId=X.newBuffer(X.base64.length(a.traceId)),0):a.traceId.length>=0&&(u.traceId=a.traceId)),a.spanId!=null&&(typeof a.spanId=="string"?X.base64.decode(a.spanId,u.spanId=X.newBuffer(X.base64.length(a.spanId)),0):a.spanId.length>=0&&(u.spanId=a.spanId)),a.eventName!=null&&(u.eventName=String(a.eventName)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.attributes=[]),u.defaults){if(X.Long){var c=new X.Long(0,0,!1);l.timeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.timeUnixNano=u.longs===String?"0":0;if(l.severityNumber=u.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,l.severityText="",l.body=null,l.droppedAttributesCount=0,l.flags=0,u.bytes===String?l.traceId="":(l.traceId=[],u.bytes!==Array&&(l.traceId=X.newBuffer(l.traceId))),u.bytes===String?l.spanId="":(l.spanId=[],u.bytes!==Array&&(l.spanId=X.newBuffer(l.spanId))),X.Long){var c=new X.Long(0,0,!1);l.observedTimeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.observedTimeUnixNano=u.longs===String?"0":0;l.eventName=""}if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?l.timeUnixNano=u.longs===String?String(a.timeUnixNano):a.timeUnixNano:l.timeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.timeUnixNano):u.longs===Number?new X.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.severityNumber!=null&&a.hasOwnProperty("severityNumber")&&(l.severityNumber=u.enums===String?J.opentelemetry.proto.logs.v1.SeverityNumber[a.severityNumber]===void 0?a.severityNumber:J.opentelemetry.proto.logs.v1.SeverityNumber[a.severityNumber]:a.severityNumber),a.severityText!=null&&a.hasOwnProperty("severityText")&&(l.severityText=a.severityText),a.body!=null&&a.hasOwnProperty("body")&&(l.body=J.opentelemetry.proto.common.v1.AnyValue.toObject(a.body,u)),a.attributes&&a.attributes.length){l.attributes=[];for(var d=0;d<a.attributes.length;++d)l.attributes[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[d],u)}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=a.droppedAttributesCount),a.flags!=null&&a.hasOwnProperty("flags")&&(l.flags=a.flags),a.traceId!=null&&a.hasOwnProperty("traceId")&&(l.traceId=u.bytes===String?X.base64.encode(a.traceId,0,a.traceId.length):u.bytes===Array?Array.prototype.slice.call(a.traceId):a.traceId),a.spanId!=null&&a.hasOwnProperty("spanId")&&(l.spanId=u.bytes===String?X.base64.encode(a.spanId,0,a.spanId.length):u.bytes===Array?Array.prototype.slice.call(a.spanId):a.spanId),a.observedTimeUnixNano!=null&&a.hasOwnProperty("observedTimeUnixNano")&&(typeof a.observedTimeUnixNano=="number"?l.observedTimeUnixNano=u.longs===String?String(a.observedTimeUnixNano):a.observedTimeUnixNano:l.observedTimeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.observedTimeUnixNano):u.longs===Number?new X.LongBits(a.observedTimeUnixNano.low>>>0,a.observedTimeUnixNano.high>>>0).toNumber():a.observedTimeUnixNano),a.eventName!=null&&a.hasOwnProperty("eventName")&&(l.eventName=a.eventName),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.logs.v1.LogRecord"},"getTypeUrl"),n})(),o})(),r})(),t})(),e})();D8n.exports=J});var KAe=z(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.toAnyValue=wg.toKeyValue=wg.toAttributes=wg.createInstrumentationScope=wg.createResource=void 0;function esa(e,t){let r={attributes:N8n(e.attributes,t),droppedAttributesCount:0},o=e.schemaUrl;return o&&o!==""&&(r.schemaUrl=o),r}s(esa,"createResource");wg.createResource=esa;function tsa(e){return{name:e.name,version:e.version}}s(tsa,"createInstrumentationScope");wg.createInstrumentationScope=tsa;function N8n(e,t){return Object.keys(e).map(r=>z8n(r,e[r],t))}s(N8n,"toAttributes");wg.toAttributes=N8n;function z8n(e,t,r){return{key:e,value:HAe(t,r)}}s(z8n,"toKeyValue");wg.toKeyValue=z8n;function HAe(e,t){let r=typeof e;if(r==="string")return{stringValue:e};if(r==="number")return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(r==="boolean")return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let o=new Array(e.length);for(let n=0;n<e.length;n++)o[n]=HAe(e[n],t);return{arrayValue:{values:o}}}if(r==="object"&&e!=null){let o=Object.keys(e),n=new Array(o.length);for(let i=0;i<o.length;i++)n[i]={key:o[i],value:HAe(e[o[i]],t)};return{kvlistValue:{values:n}}}return{}}s(HAe,"toAnyValue");wg.toAnyValue=HAe});var uFt=z(JL=>{"use strict";Object.defineProperty(JL,"__esModule",{value:!0});JL.toLogAttributes=JL.createExportLogsServiceRequest=void 0;var JAe=KAe();function rsa(e,t){return{resourceLogs:osa(e,t)}}s(rsa,"createExportLogsServiceRequest");JL.createExportLogsServiceRequest=rsa;function nsa(e){let t=new Map;for(let r of e){let{resource:o,instrumentationScope:{name:n,version:i="",schemaUrl:a=""}}=r,u=t.get(o);u||(u=new Map,t.set(o,u));let l=`${n}@${i}:${a}`,c=u.get(l);c||(c=[],u.set(l,c)),c.push(r)}return t}s(nsa,"createResourceMap");function osa(e,t){let r=nsa(e);return Array.from(r,([o,n])=>{let i=(0,JAe.createResource)(o,t);return{resource:i,scopeLogs:Array.from(n,([,a])=>({scope:(0,JAe.createInstrumentationScope)(a[0].instrumentationScope),logRecords:a.map(u=>isa(u,t)),schemaUrl:a[0].instrumentationScope.schemaUrl})),schemaUrl:i.schemaUrl}})}s(osa,"logRecordsToResourceLogs");function isa(e,t){return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:(0,JAe.toAnyValue)(e.body,t),eventName:e.eventName,attributes:j8n(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:e.spanContext?.traceFlags,traceId:t.encodeOptionalSpanContext(e.spanContext?.traceId),spanId:t.encodeOptionalSpanContext(e.spanContext?.spanId)}}s(isa,"toLogRecord");function j8n(e,t){return Object.keys(e).map(r=>(0,JAe.toKeyValue)(r,e[r],t))}s(j8n,"toLogAttributes");JL.toLogAttributes=j8n});var B8n=z(QAe=>{"use strict";Object.defineProperty(QAe,"__esModule",{value:!0});QAe.hexToBinary=void 0;function L8n(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}s(L8n,"intValue");function asa(e){let t=new Uint8Array(e.length/2),r=0;for(let o=0;o<e.length;o+=2){let n=L8n(e.charCodeAt(o)),i=L8n(e.charCodeAt(o+1));t[r++]=n<<4|i}return t}s(asa,"hexToBinary");QAe.hexToBinary=asa});var X5=z(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});m0.JSON_ENCODER=m0.PROTOBUF_ENCODER=m0.encodeAsString=m0.encodeAsLongBits=m0.toLongBits=m0.hrTimeToNanos=void 0;var ssa=ps(),U8n=B8n();function cFt(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}s(cFt,"hrTimeToNanos");m0.hrTimeToNanos=cFt;function F8n(e){let t=Number(BigInt.asUintN(32,e)),r=Number(BigInt.asUintN(32,e>>BigInt(32)));return{low:t,high:r}}s(F8n,"toLongBits");m0.toLongBits=F8n;function q8n(e){let t=cFt(e);return F8n(t)}s(q8n,"encodeAsLongBits");m0.encodeAsLongBits=q8n;function Z8n(e){return cFt(e).toString()}s(Z8n,"encodeAsString");m0.encodeAsString=Z8n;var usa=typeof BigInt<"u"?Z8n:ssa.hrTimeToNanoseconds;function lFt(e){return e}s(lFt,"identity");function lsa(e){if(e!==void 0)return(0,U8n.hexToBinary)(e)}s(lsa,"optionalHexToBinary");m0.PROTOBUF_ENCODER={encodeHrTime:q8n,encodeSpanContext:U8n.hexToBinary,encodeOptionalSpanContext:lsa,encodeUint8Array:lFt};m0.JSON_ENCODER={encodeHrTime:usa,encodeSpanContext:lFt,encodeOptionalSpanContext:lFt,encodeUint8Array:s(e=>{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");let t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=String.fromCharCode(e[r]);return btoa(t.join(""))},"encodeUint8Array")}});var G8n=z(YAe=>{"use strict";Object.defineProperty(YAe,"__esModule",{value:!0});YAe.ProtobufLogsSerializer=void 0;var V8n=WAe(),csa=uFt(),dsa=X5(),psa=V8n.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,msa=V8n.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;YAe.ProtobufLogsSerializer={serializeRequest:s(e=>{let t=(0,csa.createExportLogsServiceRequest)(e,dsa.PROTOBUF_ENCODER);return msa.encode(t).finish()},"serializeRequest"),deserializeResponse:s(e=>psa.decode(e),"deserializeResponse")}});var W8n=z(XAe=>{"use strict";Object.defineProperty(XAe,"__esModule",{value:!0});XAe.ProtobufLogsSerializer=void 0;var fsa=G8n();Object.defineProperty(XAe,"ProtobufLogsSerializer",{enumerable:!0,get:s(function(){return fsa.ProtobufLogsSerializer},"get")})});var H8n=z(Ree=>{"use strict";Object.defineProperty(Ree,"__esModule",{value:!0});Ree.EAggregationTemporality=void 0;var hsa;(function(e){e[e.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",e[e.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",e[e.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(hsa=Ree.EAggregationTemporality||(Ree.EAggregationTemporality={}))});var dFt=z(_x=>{"use strict";Object.defineProperty(_x,"__esModule",{value:!0});_x.createExportMetricsServiceRequest=_x.toMetric=_x.toScopeMetrics=_x.toResourceMetrics=void 0;var K8n=(fn(),Mr(co)),QL=OAe(),J8n=H8n(),Mee=KAe();function Y8n(e,t){let r=(0,Mee.createResource)(e.resource,t);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:X8n(e.scopeMetrics,t)}}s(Y8n,"toResourceMetrics");_x.toResourceMetrics=Y8n;function X8n(e,t){return Array.from(e.map(r=>({scope:(0,Mee.createInstrumentationScope)(r.scope),metrics:r.metrics.map(o=>ejn(o,t)),schemaUrl:r.scope.schemaUrl})))}s(X8n,"toScopeMetrics");_x.toScopeMetrics=X8n;function ejn(e,t){let r={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},o=vsa(e.aggregationTemporality);switch(e.dataPointType){case QL.DataPointType.SUM:r.sum={aggregationTemporality:o,isMonotonic:e.isMonotonic,dataPoints:Q8n(e,t)};break;case QL.DataPointType.GAUGE:r.gauge={dataPoints:Q8n(e,t)};break;case QL.DataPointType.HISTOGRAM:r.histogram={aggregationTemporality:o,dataPoints:_sa(e,t)};break;case QL.DataPointType.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:o,dataPoints:ysa(e,t)};break}return r}s(ejn,"toMetric");_x.toMetric=ejn;function gsa(e,t,r){let o={attributes:(0,Mee.toAttributes)(e.attributes,r),startTimeUnixNano:r.encodeHrTime(e.startTime),timeUnixNano:r.encodeHrTime(e.endTime)};switch(t){case K8n.ValueType.INT:o.asInt=e.value;break;case K8n.ValueType.DOUBLE:o.asDouble=e.value;break}return o}s(gsa,"toSingularDataPoint");function Q8n(e,t){return e.dataPoints.map(r=>gsa(r,e.descriptor.valueType,t))}s(Q8n,"toSingularDataPoints");function _sa(e,t){return e.dataPoints.map(r=>{let o=r.value;return{attributes:(0,Mee.toAttributes)(r.attributes,t),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}s(_sa,"toHistogramDataPoints");function ysa(e,t){return e.dataPoints.map(r=>{let o=r.value;return{attributes:(0,Mee.toAttributes)(r.attributes,t),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}s(ysa,"toExponentialHistogramDataPoints");function vsa(e){switch(e){case QL.AggregationTemporality.DELTA:return J8n.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA;case QL.AggregationTemporality.CUMULATIVE:return J8n.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE}}s(vsa,"toAggregationTemporality");function xsa(e,t){return{resourceMetrics:e.map(r=>Y8n(r,t))}}s(xsa,"createExportMetricsServiceRequest");_x.createExportMetricsServiceRequest=xsa});var rjn=z(ePe=>{"use strict";Object.defineProperty(ePe,"__esModule",{value:!0});ePe.ProtobufMetricsSerializer=void 0;var tjn=WAe(),bsa=dFt(),wsa=X5(),ksa=tjn.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Ssa=tjn.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;ePe.ProtobufMetricsSerializer={serializeRequest:s(e=>{let t=(0,bsa.createExportMetricsServiceRequest)([e],wsa.PROTOBUF_ENCODER);return Ssa.encode(t).finish()},"serializeRequest"),deserializeResponse:s(e=>ksa.decode(e),"deserializeResponse")}});var njn=z(tPe=>{"use strict";Object.defineProperty(tPe,"__esModule",{value:!0});tPe.ProtobufMetricsSerializer=void 0;var Isa=rjn();Object.defineProperty(tPe,"ProtobufMetricsSerializer",{enumerable:!0,get:s(function(){return Isa.ProtobufMetricsSerializer},"get")})});var pFt=z(yx=>{"use strict";Object.defineProperty(yx,"__esModule",{value:!0});yx.createExportTraceServiceRequest=yx.toOtlpSpanEvent=yx.toOtlpLink=yx.sdkSpanToOtlpSpan=void 0;var $ee=KAe(),Tsa=256,Esa=512;function ojn(e,t){let r=e&255|Tsa;return t&&(r|=Esa),r}s(ojn,"buildSpanFlagsFrom");function ijn(e,t){let r=e.spanContext(),o=e.status,n=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:n,traceState:r.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:(0,$ee.toAttributes)(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(i=>sjn(i,t)),droppedEventsCount:e.droppedEventsCount,status:{code:o.code,message:o.message},links:e.links.map(i=>ajn(i,t)),droppedLinksCount:e.droppedLinksCount,flags:ojn(r.traceFlags,e.parentSpanContext?.isRemote)}}s(ijn,"sdkSpanToOtlpSpan");yx.sdkSpanToOtlpSpan=ijn;function ajn(e,t){return{attributes:e.attributes?(0,$ee.toAttributes)(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:ojn(e.context.traceFlags,e.context.isRemote)}}s(ajn,"toOtlpLink");yx.toOtlpLink=ajn;function sjn(e,t){return{attributes:e.attributes?(0,$ee.toAttributes)(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}s(sjn,"toOtlpSpanEvent");yx.toOtlpSpanEvent=sjn;function Csa(e,t){return{resourceSpans:Psa(e,t)}}s(Csa,"createExportTraceServiceRequest");yx.createExportTraceServiceRequest=Csa;function Asa(e){let t=new Map;for(let r of e){let o=t.get(r.resource);o||(o=new Map,t.set(r.resource,o));let n=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,i=o.get(n);i||(i=[],o.set(n,i)),i.push(r)}return t}s(Asa,"createResourceMap");function Psa(e,t){let r=Asa(e),o=[],n=r.entries(),i=n.next();for(;!i.done;){let[a,u]=i.value,l=[],c=u.values(),d=c.next();for(;!d.done;){let f=d.value;if(f.length>0){let h=f.map(_=>ijn(_,t));l.push({scope:(0,$ee.createInstrumentationScope)(f[0].instrumentationScope),spans:h,schemaUrl:f[0].instrumentationScope.schemaUrl})}d=c.next()}let p=(0,$ee.createResource)(a,t),m={resource:p,scopeSpans:l,schemaUrl:p.schemaUrl};o.push(m),i=n.next()}return o}s(Psa,"spanRecordsToResourceSpans")});var ljn=z(rPe=>{"use strict";Object.defineProperty(rPe,"__esModule",{value:!0});rPe.ProtobufTraceSerializer=void 0;var ujn=WAe(),Rsa=pFt(),Msa=X5(),$sa=ujn.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Osa=ujn.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;rPe.ProtobufTraceSerializer={serializeRequest:s(e=>{let t=(0,Rsa.createExportTraceServiceRequest)(e,Msa.PROTOBUF_ENCODER);return Osa.encode(t).finish()},"serializeRequest"),deserializeResponse:s(e=>$sa.decode(e),"deserializeResponse")}});var cjn=z(nPe=>{"use strict";Object.defineProperty(nPe,"__esModule",{value:!0});nPe.ProtobufTraceSerializer=void 0;var Dsa=ljn();Object.defineProperty(nPe,"ProtobufTraceSerializer",{enumerable:!0,get:s(function(){return Dsa.ProtobufTraceSerializer},"get")})});var djn=z(oPe=>{"use strict";Object.defineProperty(oPe,"__esModule",{value:!0});oPe.JsonLogsSerializer=void 0;var Nsa=uFt(),zsa=X5();oPe.JsonLogsSerializer={serializeRequest:s(e=>{let t=(0,Nsa.createExportLogsServiceRequest)(e,zsa.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(t))},"serializeRequest"),deserializeResponse:s(e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))},"deserializeResponse")}});var pjn=z(iPe=>{"use strict";Object.defineProperty(iPe,"__esModule",{value:!0});iPe.JsonLogsSerializer=void 0;var jsa=djn();Object.defineProperty(iPe,"JsonLogsSerializer",{enumerable:!0,get:s(function(){return jsa.JsonLogsSerializer},"get")})});var mjn=z(aPe=>{"use strict";Object.defineProperty(aPe,"__esModule",{value:!0});aPe.JsonMetricsSerializer=void 0;var Lsa=dFt(),Bsa=X5();aPe.JsonMetricsSerializer={serializeRequest:s(e=>{let t=(0,Lsa.createExportMetricsServiceRequest)([e],Bsa.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(t))},"serializeRequest"),deserializeResponse:s(e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))},"deserializeResponse")}});var fjn=z(sPe=>{"use strict";Object.defineProperty(sPe,"__esModule",{value:!0});sPe.JsonMetricsSerializer=void 0;var Usa=mjn();Object.defineProperty(sPe,"JsonMetricsSerializer",{enumerable:!0,get:s(function(){return Usa.JsonMetricsSerializer},"get")})});var hjn=z(uPe=>{"use strict";Object.defineProperty(uPe,"__esModule",{value:!0});uPe.JsonTraceSerializer=void 0;var Fsa=pFt(),qsa=X5();uPe.JsonTraceSerializer={serializeRequest:s(e=>{let t=(0,Fsa.createExportTraceServiceRequest)(e,qsa.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(t))},"serializeRequest"),deserializeResponse:s(e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))},"deserializeResponse")}});var gjn=z(lPe=>{"use strict";Object.defineProperty(lPe,"__esModule",{value:!0});lPe.JsonTraceSerializer=void 0;var Zsa=hjn();Object.defineProperty(lPe,"JsonTraceSerializer",{enumerable:!0,get:s(function(){return Zsa.JsonTraceSerializer},"get")})});var cPe=z(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.JsonTraceSerializer=f0.JsonMetricsSerializer=f0.JsonLogsSerializer=f0.ProtobufTraceSerializer=f0.ProtobufMetricsSerializer=f0.ProtobufLogsSerializer=void 0;var Vsa=W8n();Object.defineProperty(f0,"ProtobufLogsSerializer",{enumerable:!0,get:s(function(){return Vsa.ProtobufLogsSerializer},"get")});var Gsa=njn();Object.defineProperty(f0,"ProtobufMetricsSerializer",{enumerable:!0,get:s(function(){return Gsa.ProtobufMetricsSerializer},"get")});var Wsa=cjn();Object.defineProperty(f0,"ProtobufTraceSerializer",{enumerable:!0,get:s(function(){return Wsa.ProtobufTraceSerializer},"get")});var Hsa=pjn();Object.defineProperty(f0,"JsonLogsSerializer",{enumerable:!0,get:s(function(){return Hsa.JsonLogsSerializer},"get")});var Ksa=fjn();Object.defineProperty(f0,"JsonMetricsSerializer",{enumerable:!0,get:s(function(){return Ksa.JsonMetricsSerializer},"get")});var Jsa=gjn();Object.defineProperty(f0,"JsonTraceSerializer",{enumerable:!0,get:s(function(){return Jsa.JsonTraceSerializer},"get")})});function _jn(e){let t={};return Object.entries(e??{}).forEach(([r,o])=>{typeof o<"u"?t[r]=String(o):ns.warn(`Header "${r}" has invalid value (${o}) and will be ignored`)}),t}var yjn=b(()=>{fn();s(_jn,"validateAndNormalizeHeaders")});function Qsa(e,t,r){return async()=>{let o={...await r()},n={};return t!=null&&Object.assign(n,await t()),e!=null&&Object.assign(n,_jn(await e())),Object.assign(n,o)}}function Ysa(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function vjn(e,t,r){return{...jAe(e,t,r),headers:Qsa(e.headers,t.headers,r.headers),url:Ysa(e.url)??t.url??r.url}}function xjn(e,t){return{...LAe(),headers:s(async()=>e,"headers"),url:"http://localhost:4318/"+t}}var bjn=b(()=>{Eee();yjn();s(Qsa,"mergeHeaders");s(Ysa,"validateUserProvidedUrl");s(vjn,"mergeOtlpHttpConfigurationWithDefaults");s(xjn,"getHttpConfigurationDefaults")});function eR(e){return async t=>{let r=t==="http:",o=r?import("http"):import("https"),{Agent:n}=await o;if(r){let{ca:i,cert:a,key:u,...l}=e;return new n(l)}return new n(e)}}function wjn(e,t,r){return{...vjn(e,t,r),agentFactory:e.agentFactory??t.agentFactory??r.agentFactory,userAgent:e.userAgent}}function kjn(e,t){return{...xjn(e,t),agentFactory:eR({keepAlive:!0})}}var dPe=b(()=>{bjn();s(eR,"httpAgentFactoryFromOptions");s(wjn,"mergeOtlpNodeHttpConfigurationWithDefaults");s(kjn,"getNodeHttpConfigurationDefaults")});function mFt(e){return e===429||e===502||e===503||e===504}function fFt(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let r=new Date(e).getTime()-Date.now();return r>=0?r:0}var Sjn=b(()=>{s(mFt,"isExportHTTPErrorRetryable");s(fFt,"parseRetryAfterToMills")});var Ijn,Tjn=b(()=>{Ijn="0.214.0"});function Pjn(e,t,r,o,n,i,a,u){return new Promise(l=>{let c=new URL(t);n?r["User-Agent"]=`${n} ${Ejn}`:r["User-Agent"]=Ejn;let d={hostname:c.hostname,port:c.port,path:c.pathname,method:"POST",headers:r,agent:i},p=e(d,m=>{let f=[];m.on("data",h=>f.push(h)),m.on("end",()=>{if(m.statusCode&&m.statusCode<=299)l({status:"success",data:Buffer.concat(f)});else if(m.statusCode&&mFt(m.statusCode))l({status:"retryable",retryInMillis:fFt(m.headers["retry-after"])});else{let h=new g1(m.statusMessage,m.statusCode,Buffer.concat(f).toString());l({status:"failure",error:h})}}),m.on("error",h=>{m.statusCode&&m.statusCode<=299?l({status:"success"}):m.statusCode&&mFt(m.statusCode)?l({status:"retryable",error:h,retryInMillis:fFt(m.headers["retry-after"])}):l({status:"failure",error:h})})});p.setTimeout(u,()=>{p.destroy(),l({status:"retryable",error:new Error("Request timed out")})}),p.on("error",m=>{tua(m)?l({status:"retryable",error:m}):l({status:"failure",error:m})}),Xsa(p,o,a,m=>{l({status:"failure",error:m})})})}function Xsa(e,t,r,o){let n=eua(r);t==="gzip"&&(e.setHeader("Content-Encoding","gzip"),n=n.on("error",o).pipe(Cjn.createGzip()).on("error",o)),n.pipe(e).on("error",o)}function eua(e){let t=new Ajn.Readable;return t.push(e),t.push(null),t}function tua(e){let t=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);return"code"in e&&typeof e.code=="string"?t.has(e.code):!1}var Cjn,Ajn,Ejn,Rjn=b(()=>{Cjn=ht(require("zlib")),Ajn=require("stream");Sjn();NAe();Tjn();Ejn=`OTel-OTLP-Exporter-JavaScript/${Ijn}`;s(Pjn,"sendWithHttp");s(Xsa,"compressAndSend");s(eua,"readableFromUint8Array");s(tua,"isHttpTransportNetworkErrorRetryable")});async function rua(e){let t=e==="http:"?import("http"):import("https"),{request:r}=await t;return r}function Mjn(e){return new hFt(e)}var hFt,$jn=b(()=>{Rjn();hFt=class{static{s(this,"HttpExporterTransport")}_utils=null;_parameters;constructor(t){this._parameters=t}async send(t,r){let{agent:o,request:n}=await this._loadUtils(),i=await this._parameters.headers();return Pjn(n,this._parameters.url,i,this._parameters.compression,this._parameters.userAgent,o,t,r)}shutdown(){}async _loadUtils(){let t=this._utils;if(t===null){let r=new URL(this._parameters.url).protocol,[o,n]=await Promise.all([this._parameters.agentFactory(r),rua(r)]);t=this._utils={agent:o,request:n}}return t}};s(rua,"requestFunctionFactory");s(Mjn,"createHttpExporterTransport")});function aua(){return Math.random()*(2*Ojn)-Ojn}function Djn(e){return new _Ft(e.transport)}var gFt,nua,oua,iua,Ojn,_Ft,Njn=b(()=>{fn();gFt=5,nua=1e3,oua=5e3,iua=1.5,Ojn=.2;s(aua,"getJitter");_Ft=class{static{s(this,"RetryingTransport")}_transport;constructor(t){this._transport=t}retry(t,r,o){return new Promise((n,i)=>{setTimeout(()=>{this._transport.send(t,r).then(n,i)},o)})}async send(t,r){let o=gFt,n=nua,i=Date.now()+r,a=await this._transport.send(t,r);for(;a.status==="retryable"&&o>0;){o--;let u=Math.max(Math.min(n*(1+aua()),oua),0);n=n*iua;let l=a.retryInMillis??u,c=i-Date.now();if(l>c)return ns.info(`Export retry time ${Math.round(l)}ms exceeds remaining timeout ${Math.round(c)}ms, not retrying further.`),a;ns.verbose(`Scheduling export retry in ${Math.round(l)}ms`),a=await this.retry(t,c,l)}return a.status==="success"?ns.verbose(`Export succeeded after ${gFt-o} retry attempts.`):a.status==="retryable"?ns.info(`Export failed after maximum retry attempts (${gFt}).`):ns.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}};s(Djn,"createRetryingTransport")});function zjn(e,t){return UAe({transport:Djn({transport:Mjn(e)}),serializer:t,promiseHandler:BAe(e)},{timeout:e.timeoutMillis})}var jjn=b(()=>{VUt();$jn();qUt();Njn();s(zjn,"createOtlpHttpExportDelegate")});function Ljn(e){let t=(0,pPe.getNumberFromEnv)(e);if(t!=null){if(Number.isFinite(t)&&t>0)return t;ns.warn(`Configuration: ${e} is invalid, expected number greater than 0 (actual: ${t})`)}}function sua(e){let t=Ljn(`OTEL_EXPORTER_OTLP_${e}_TIMEOUT`),r=Ljn("OTEL_EXPORTER_OTLP_TIMEOUT");return t??r}function Bjn(e){let t=(0,pPe.getStringFromEnv)(e)?.trim();if(t==null||t==="none"||t==="gzip")return t;ns.warn(`Configuration: ${e} is invalid, expected 'none' or 'gzip' (actual: '${t}')`)}function uua(e){let t=Bjn(`OTEL_EXPORTER_OTLP_${e}_COMPRESSION`),r=Bjn("OTEL_EXPORTER_OTLP_COMPRESSION");return t??r}function mPe(e){return{timeoutMillis:sua(e),compression:uua(e)}}var pPe,yFt=b(()=>{pPe=ht(ps());fn();s(Ljn,"parseAndValidateTimeoutFromEnv");s(sua,"getTimeoutFromEnv");s(Bjn,"parseAndValidateCompressionFromEnv");s(uua,"getCompressionFromEnv");s(mPe,"getSharedConfigurationFromEnvironment")});function lua(e){let t=(0,kg.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${e}_HEADERS`),r=(0,kg.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"),o=(0,kg.parseKeyPairsIntoRecord)(t),n=(0,kg.parseKeyPairsIntoRecord)(r);if(!(Object.keys(o).length===0&&Object.keys(n).length===0))return Object.assign({},(0,kg.parseKeyPairsIntoRecord)(r),(0,kg.parseKeyPairsIntoRecord)(t))}function cua(e){try{return new URL(e).toString()}catch{ns.warn(`Configuration: Could not parse environment-provided export URL: '${e}', falling back to undefined`);return}}function dua(e,t){try{new URL(e)}catch{ns.warn(`Configuration: Could not parse environment-provided export URL: '${e}', falling back to undefined`);return}e.endsWith("/")||(e=e+"/"),e+=t;try{new URL(e)}catch{ns.warn(`Configuration: Provided URL appended with '${t}' is not a valid URL, using 'undefined' instead of '${e}'`);return}return e}function pua(e){let t=(0,kg.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT");if(t!==void 0)return dua(t,e)}function mua(e){let t=(0,kg.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`);if(t!==void 0)return cua(t)}function vFt(e,t,r){let o=(0,kg.getStringFromEnv)(e),n=(0,kg.getStringFromEnv)(t),i=o??n;if(i!=null)try{return Ujn.readFileSync(Fjn.resolve(process.cwd(),i))}catch{ns.warn(r);return}else return}function fua(e){return vFt(`OTEL_EXPORTER_OTLP_${e}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function hua(e){return vFt(`OTEL_EXPORTER_OTLP_${e}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function gua(e){return vFt(`OTEL_EXPORTER_OTLP_${e}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function qjn(e,t){return{...mPe(e),url:mua(e)??pua(t),headers:zAe(lua(e)),agentFactory:eR({keepAlive:!0,ca:gua(e),cert:fua(e),key:hua(e)})}}var Ujn,Fjn,kg,Zjn=b(()=>{Ujn=ht(require("fs")),Fjn=ht(require("path")),kg=ht(ps());fn();yFt();Eee();dPe();s(lua,"getStaticHeadersFromEnv");s(cua,"appendRootPathToUrlIfNeeded");s(dua,"appendResourcePathToUrl");s(pua,"getNonSpecificUrlFromEnv");s(mua,"getSpecificUrlFromEnv");s(vFt,"readFileFromEnv");s(fua,"getClientCertificateFromEnv");s(hua,"getClientKeyFromEnv");s(gua,"getRootCertificateFromEnv");s(qjn,"getNodeHttpConfigurationFromEnvironment")});function Vjn(e){return typeof e.headers=="function"?e.headers:zAe(e.headers)}var Gjn=b(()=>{Eee();s(Vjn,"convertLegacyHeaders")});function _ua(e){if(typeof e.httpAgentOptions=="function")return e.httpAgentOptions;let t=e.httpAgentOptions;if(e.keepAlive!=null&&(t={keepAlive:e.keepAlive,...t}),t!=null)return eR(t)}function Wjn(e,t,r,o){return e.metadata&&ns.warn("Metadata cannot be set when using http"),wjn({url:e.url,headers:Vjn(e),concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis,compression:e.compression,agentFactory:_ua(e),userAgent:e.userAgent},qjn(t,r),kjn(o,r))}var Hjn=b(()=>{fn();dPe();Oee();Zjn();Gjn();s(_ua,"convertLegacyAgentOptions");s(Wjn,"convertLegacyHttpOptions")});var fPe={};mr(fPe,{convertLegacyHttpOptions:()=>Wjn,createOtlpHttpExportDelegate:()=>zjn,getSharedConfigurationFromEnvironment:()=>mPe,httpAgentFactoryFromOptions:()=>eR});var Oee=b(()=>{dPe();jjn();yFt();Hjn()});var Jjn=z(hPe=>{"use strict";Object.defineProperty(hPe,"__esModule",{value:!0});hPe.OTLPMetricExporter=void 0;var yua=HUt(),vua=cPe(),Kjn=(Oee(),Mr(fPe)),xFt=class extends yua.OTLPMetricExporterBase{static{s(this,"OTLPMetricExporter")}constructor(t){super((0,Kjn.createOtlpHttpExportDelegate)((0,Kjn.convertLegacyHttpOptions)(t??{},"METRICS","v1/metrics",{"Content-Type":"application/json"}),vua.JsonMetricsSerializer),t)}};hPe.OTLPMetricExporter=xFt});var Qjn=z(gPe=>{"use strict";Object.defineProperty(gPe,"__esModule",{value:!0});gPe.OTLPMetricExporter=void 0;var xua=Jjn();Object.defineProperty(gPe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return xua.OTLPMetricExporter},"get")})});var Yjn=z(_Pe=>{"use strict";Object.defineProperty(_Pe,"__esModule",{value:!0});_Pe.OTLPMetricExporter=void 0;var bua=Qjn();Object.defineProperty(_Pe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return bua.OTLPMetricExporter},"get")})});var Xjn=z(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});h0.OTLPMetricExporterBase=h0.LowMemoryTemporalitySelector=h0.DeltaTemporalitySelector=h0.CumulativeTemporalitySelector=h0.AggregationTemporalityPreference=h0.OTLPMetricExporter=void 0;var wua=Yjn();Object.defineProperty(h0,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return wua.OTLPMetricExporter},"get")});var kua=UUt();Object.defineProperty(h0,"AggregationTemporalityPreference",{enumerable:!0,get:s(function(){return kua.AggregationTemporalityPreference},"get")});var yPe=HUt();Object.defineProperty(h0,"CumulativeTemporalitySelector",{enumerable:!0,get:s(function(){return yPe.CumulativeTemporalitySelector},"get")});Object.defineProperty(h0,"DeltaTemporalitySelector",{enumerable:!0,get:s(function(){return yPe.DeltaTemporalitySelector},"get")});Object.defineProperty(h0,"LowMemoryTemporalitySelector",{enumerable:!0,get:s(function(){return yPe.LowMemoryTemporalitySelector},"get")});Object.defineProperty(h0,"OTLPMetricExporterBase",{enumerable:!0,get:s(function(){return yPe.OTLPMetricExporterBase},"get")})});var tLn=z(vPe=>{"use strict";Object.defineProperty(vPe,"__esModule",{value:!0});vPe.OTLPMetricExporter=void 0;var Sua=Xjn(),Iua=cPe(),eLn=(Oee(),Mr(fPe)),bFt=class extends Sua.OTLPMetricExporterBase{static{s(this,"OTLPMetricExporter")}constructor(t){super((0,eLn.createOtlpHttpExportDelegate)((0,eLn.convertLegacyHttpOptions)(t??{},"METRICS","v1/metrics",{"Content-Type":"application/x-protobuf"}),Iua.ProtobufMetricsSerializer),t)}};vPe.OTLPMetricExporter=bFt});var rLn=z(xPe=>{"use strict";Object.defineProperty(xPe,"__esModule",{value:!0});xPe.OTLPMetricExporter=void 0;var Tua=tLn();Object.defineProperty(xPe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return Tua.OTLPMetricExporter},"get")})});var nLn=z(bPe=>{"use strict";Object.defineProperty(bPe,"__esModule",{value:!0});bPe.OTLPMetricExporter=void 0;var Eua=rLn();Object.defineProperty(bPe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return Eua.OTLPMetricExporter},"get")})});var oLn=z(wPe=>{"use strict";Object.defineProperty(wPe,"__esModule",{value:!0});wPe.OTLPMetricExporter=void 0;var Cua=nLn();Object.defineProperty(wPe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return Cua.OTLPMetricExporter},"get")})});var aLn=z(kPe=>{"use strict";Object.defineProperty(kPe,"__esModule",{value:!0});kPe.OTLPTraceExporter=void 0;var Aua=(FAe(),Mr(GUt)),Pua=cPe(),iLn=(Oee(),Mr(fPe)),wFt=class extends Aua.OTLPExporterBase{static{s(this,"OTLPTraceExporter")}constructor(t={}){super((0,iLn.createOtlpHttpExportDelegate)((0,iLn.convertLegacyHttpOptions)(t,"TRACES","v1/traces",{"Content-Type":"application/x-protobuf"}),Pua.ProtobufTraceSerializer))}};kPe.OTLPTraceExporter=wFt});var sLn=z(SPe=>{"use strict";Object.defineProperty(SPe,"__esModule",{value:!0});SPe.OTLPTraceExporter=void 0;var Rua=aLn();Object.defineProperty(SPe,"OTLPTraceExporter",{enumerable:!0,get:s(function(){return Rua.OTLPTraceExporter},"get")})});var uLn=z(IPe=>{"use strict";Object.defineProperty(IPe,"__esModule",{value:!0});IPe.OTLPTraceExporter=void 0;var Mua=sLn();Object.defineProperty(IPe,"OTLPTraceExporter",{enumerable:!0,get:s(function(){return Mua.OTLPTraceExporter},"get")})});var lLn=z(TPe=>{"use strict";Object.defineProperty(TPe,"__esModule",{value:!0});TPe.OTLPTraceExporter=void 0;var $ua=uLn();Object.defineProperty(TPe,"OTLPTraceExporter",{enumerable:!0,get:s(function(){return $ua.OTLPTraceExporter},"get")})});var cLn=z(EPe=>{"use strict";Object.defineProperty(EPe,"__esModule",{value:!0});EPe.ExceptionEventName=void 0;EPe.ExceptionEventName="exception"});var dLn=z(CPe=>{"use strict";Object.defineProperty(CPe,"__esModule",{value:!0});CPe.SpanImpl=void 0;var yc=(fn(),Mr(co)),vc=ps(),tR=(lee(),Mr(uee)),Oua=cLn(),kFt=class{static{s(this,"SpanImpl")}_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:yc.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(t){let r=Date.now();if(this._spanContext=t.spanContext,this._performanceStartTime=vc.otperformance.now(),this._performanceOffset=r-(this._performanceStartTime+vc.otperformance.timeOrigin),this._startTimeProvided=t.startTime!=null,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,t.links)for(let o of t.links)this.addLink(o);this.startTime=this._getTime(t.startTime??r),this.resource=t.resource,this.instrumentationScope=t.scope,this._recordEndMetrics=t.recordEndMetrics,t.attributes!=null&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,r){if(r==null||this._isSpanEnded())return this;if(t.length===0)return yc.diag.warn(`Invalid attribute key: ${t}`),this;if(!(0,vc.isAttributeValue)(r))return yc.diag.warn(`Invalid attribute value set for key: ${t}`),this;let{attributeCountLimit:o}=this._spanLimits,n=!Object.prototype.hasOwnProperty.call(this.attributes,t);return o!==void 0&&this._attributesCount>=o&&n?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(r),n&&this._attributesCount++,this)}setAttributes(t){for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.setAttribute(r,t[r]);return this}addEvent(t,r,o){if(this._isSpanEnded())return this;let{eventCountLimit:n}=this._spanLimits;if(n===0)return yc.diag.warn("No events allowed."),this._droppedEventsCount++,this;n!==void 0&&this.events.length>=n&&(this._droppedEventsCount===0&&yc.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,vc.isTimeInput)(r)&&((0,vc.isTimeInput)(o)||(o=r),r=void 0);let i=(0,vc.sanitizeAttributes)(r),{attributePerEventCountLimit:a}=this._spanLimits,u={},l=0,c=0;for(let d in i){if(!Object.prototype.hasOwnProperty.call(i,d))continue;let p=i[d];if(a!==void 0&&c>=a){l++;continue}u[d]=this._truncateToSize(p),c++}return this.events.push({name:t,attributes:u,time:this._getTime(o),droppedAttributesCount:l}),this}addLink(t){if(this._isSpanEnded())return this;let{linkCountLimit:r}=this._spanLimits;if(r===0)return this._droppedLinksCount++,this;r!==void 0&&this.links.length>=r&&(this._droppedLinksCount===0&&yc.diag.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:o}=this._spanLimits,n=(0,vc.sanitizeAttributes)(t.attributes),i={},a=0,u=0;for(let c in n){if(!Object.prototype.hasOwnProperty.call(n,c))continue;let d=n[c];if(o!==void 0&&u>=o){a++;continue}i[c]=this._truncateToSize(d),u++}let l={context:t.context};return u>0&&(l.attributes=i),a>0&&(l.droppedAttributesCount=a),this.links.push(l),this}addLinks(t){for(let r of t)this.addLink(r);return this}setStatus(t){if(this._isSpanEnded())return this;if(t.code===yc.SpanStatusCode.UNSET)return this;if(this.status.code===yc.SpanStatusCode.OK)return this;let r={code:t.code};return t.code===yc.SpanStatusCode.ERROR&&(typeof t.message=="string"?r.message=t.message:t.message!=null&&yc.diag.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`)),this.status=r,this}updateName(t){return this._isSpanEnded()?this:(this.name=t,this)}end(t){if(this._isSpanEnded()){yc.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(t),this._duration=(0,vc.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(yc.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._droppedEventsCount>0&&yc.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&yc.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(t){if(typeof t=="number"&&t<=vc.otperformance.now())return(0,vc.hrTime)(t+this._performanceOffset);if(typeof t=="number")return(0,vc.millisToHrTime)(t);if(t instanceof Date)return(0,vc.millisToHrTime)(t.getTime());if((0,vc.isTimeInputHrTime)(t))return t;if(this._startTimeProvided)return(0,vc.millisToHrTime)(Date.now());let r=vc.otperformance.now()-this._performanceStartTime;return(0,vc.addHrTimes)(this.startTime,(0,vc.millisToHrTime)(r))}isRecording(){return this._ended===!1}recordException(t,r){let o={};typeof t=="string"?o[tR.ATTR_EXCEPTION_MESSAGE]=t:t&&(t.code?o[tR.ATTR_EXCEPTION_TYPE]=t.code.toString():t.name&&(o[tR.ATTR_EXCEPTION_TYPE]=t.name),t.message&&(o[tR.ATTR_EXCEPTION_MESSAGE]=t.message),t.stack&&(o[tR.ATTR_EXCEPTION_STACKTRACE]=t.stack)),o[tR.ATTR_EXCEPTION_TYPE]||o[tR.ATTR_EXCEPTION_MESSAGE]?this.addEvent(Oua.ExceptionEventName,o,r):yc.diag.warn(`Failed to record an exception ${t}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);yc.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,r){return t.length<=r?t:t.substring(0,r)}_truncateToSize(t){let r=this._attributeValueLengthLimit;return r<=0?(yc.diag.warn(`Attribute value limit must be positive, got ${r}`),t):typeof t=="string"?this._truncateToLimitUtil(t,r):Array.isArray(t)?t.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,r):o):t}};CPe.SpanImpl=kFt});var YL=z(Dee=>{"use strict";Object.defineProperty(Dee,"__esModule",{value:!0});Dee.SamplingDecision=void 0;var Dua;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Dua=Dee.SamplingDecision||(Dee.SamplingDecision={}))});var PPe=z(APe=>{"use strict";Object.defineProperty(APe,"__esModule",{value:!0});APe.AlwaysOffSampler=void 0;var Nua=YL(),SFt=class{static{s(this,"AlwaysOffSampler")}shouldSample(){return{decision:Nua.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};APe.AlwaysOffSampler=SFt});var MPe=z(RPe=>{"use strict";Object.defineProperty(RPe,"__esModule",{value:!0});RPe.AlwaysOnSampler=void 0;var zua=YL(),IFt=class{static{s(this,"AlwaysOnSampler")}shouldSample(){return{decision:zua.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};RPe.AlwaysOnSampler=IFt});var CFt=z(OPe=>{"use strict";Object.defineProperty(OPe,"__esModule",{value:!0});OPe.ParentBasedSampler=void 0;var $Pe=(fn(),Mr(co)),jua=ps(),pLn=PPe(),TFt=MPe(),EFt=class{static{s(this,"ParentBasedSampler")}_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(t){this._root=t.root,this._root||((0,jua.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new TFt.AlwaysOnSampler),this._remoteParentSampled=t.remoteParentSampled??new TFt.AlwaysOnSampler,this._remoteParentNotSampled=t.remoteParentNotSampled??new pLn.AlwaysOffSampler,this._localParentSampled=t.localParentSampled??new TFt.AlwaysOnSampler,this._localParentNotSampled=t.localParentNotSampled??new pLn.AlwaysOffSampler}shouldSample(t,r,o,n,i,a){let u=$Pe.trace.getSpanContext(t);return!u||!(0,$Pe.isSpanContextValid)(u)?this._root.shouldSample(t,r,o,n,i,a):u.isRemote?u.traceFlags&$Pe.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(t,r,o,n,i,a):this._remoteParentNotSampled.shouldSample(t,r,o,n,i,a):u.traceFlags&$Pe.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(t,r,o,n,i,a):this._localParentNotSampled.shouldSample(t,r,o,n,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};OPe.ParentBasedSampler=EFt});var PFt=z(DPe=>{"use strict";Object.defineProperty(DPe,"__esModule",{value:!0});DPe.TraceIdRatioBasedSampler=void 0;var Lua=(fn(),Mr(co)),mLn=YL(),AFt=class{static{s(this,"TraceIdRatioBasedSampler")}_ratio;_upperBound;constructor(t=0){this._ratio=this._normalize(t),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(t,r){return{decision:(0,Lua.isValidTraceId)(r)&&this._accumulate(r)<this._upperBound?mLn.SamplingDecision.RECORD_AND_SAMPLED:mLn.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return typeof t!="number"||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let r=0;for(let o=0;o<t.length/8;o++){let n=o*8,i=parseInt(t.slice(n,n+8),16);r=(r^i)>>>0}return r}};DPe.TraceIdRatioBasedSampler=AFt});var $Ft=z(XL=>{"use strict";Object.defineProperty(XL,"__esModule",{value:!0});XL.buildSamplerFromEnv=XL.loadDefaultConfig=void 0;var MFt=(fn(),Mr(co)),vx=ps(),fLn=PPe(),RFt=MPe(),NPe=CFt(),hLn=PFt(),xx;(function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"})(xx||(xx={}));var zPe=1;function Bua(){return{sampler:_Ln(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,vx.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,vx.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}s(Bua,"loadDefaultConfig");XL.loadDefaultConfig=Bua;function _Ln(){let e=(0,vx.getStringFromEnv)("OTEL_TRACES_SAMPLER")??xx.ParentBasedAlwaysOn;switch(e){case xx.AlwaysOn:return new RFt.AlwaysOnSampler;case xx.AlwaysOff:return new fLn.AlwaysOffSampler;case xx.ParentBasedAlwaysOn:return new NPe.ParentBasedSampler({root:new RFt.AlwaysOnSampler});case xx.ParentBasedAlwaysOff:return new NPe.ParentBasedSampler({root:new fLn.AlwaysOffSampler});case xx.TraceIdRatio:return new hLn.TraceIdRatioBasedSampler(gLn());case xx.ParentBasedTraceIdRatio:return new NPe.ParentBasedSampler({root:new hLn.TraceIdRatioBasedSampler(gLn())});default:return MFt.diag.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${xx.ParentBasedAlwaysOn}".`),new NPe.ParentBasedSampler({root:new RFt.AlwaysOnSampler})}}s(_Ln,"buildSamplerFromEnv");XL.buildSamplerFromEnv=_Ln;function gLn(){let e=(0,vx.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");return e==null?(MFt.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${zPe}.`),zPe):e<0||e>1?(MFt.diag.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to ${zPe}.`),zPe):e}s(gLn,"getSamplerProbabilityFromEnv")});var OFt=z(Sg=>{"use strict";Object.defineProperty(Sg,"__esModule",{value:!0});Sg.reconfigureLimits=Sg.mergeConfig=Sg.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=Sg.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var yLn=$Ft(),jPe=ps();Sg.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;Sg.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function Uua(e){let t={sampler:(0,yLn.buildSamplerFromEnv)()},r=(0,yLn.loadDefaultConfig)(),o=Object.assign({},r,t,e);return o.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),o.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),o}s(Uua,"mergeConfig");Sg.mergeConfig=Uua;function Fua(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??(0,jPe.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,jPe.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??Sg.DEFAULT_ATTRIBUTE_COUNT_LIMIT,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??(0,jPe.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,jPe.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Sg.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},e,{spanLimits:t})}s(Fua,"reconfigureLimits");Sg.reconfigureLimits=Fua});var vLn=z(LPe=>{"use strict";Object.defineProperty(LPe,"__esModule",{value:!0});LPe.BatchSpanProcessorBase=void 0;var eB=(fn(),Mr(co)),_1=ps(),DFt=class{static{s(this,"BatchSpanProcessorBase")}_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(t,r){this._exporter=t,this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:(0,_1.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:(0,_1.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:(0,_1.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:(0,_1.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new _1.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(eB.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(t,r){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&eB.TraceFlags.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&eB.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(eB.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,r)=>{let o=[],n=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let i=0,a=n;i<a;i++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{t()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((t,r)=>{let o=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);eB.context.with((0,_1.suppressTracing)(eB.context.active()),()=>{let n;this._finishedSpans.length<=this._maxExportBatchSize?(n=this._finishedSpans,this._finishedSpans=[]):n=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=s(()=>this._exporter.export(n,u=>{clearTimeout(o),u.code===_1.ExportResultCode.SUCCESS?t():r(u.error??new Error("BatchSpanProcessor: span export failed"))}),"doExport"),a=null;for(let u=0,l=n.length;u<l;u++){let c=n[u];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(a??=[],a.push(c.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,u=>{(0,_1.globalErrorHandler)(u),r(u)})})})}_maybeStartTimer(){if(this._isExporting)return;let t=s(()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,(0,_1.globalErrorHandler)(r)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return t();this._timer===void 0&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};LPe.BatchSpanProcessorBase=DFt});var xLn=z(BPe=>{"use strict";Object.defineProperty(BPe,"__esModule",{value:!0});BPe.BatchSpanProcessor=void 0;var qua=vLn(),NFt=class extends qua.BatchSpanProcessorBase{static{s(this,"BatchSpanProcessor")}onShutdown(){}};BPe.BatchSpanProcessor=NFt});var kLn=z(FPe=>{"use strict";Object.defineProperty(FPe,"__esModule",{value:!0});FPe.RandomIdGenerator=void 0;var Zua=8,wLn=16,zFt=class{static{s(this,"RandomIdGenerator")}generateTraceId=bLn(wLn);generateSpanId=bLn(Zua)};FPe.RandomIdGenerator=zFt;var UPe=Buffer.allocUnsafe(wLn);function bLn(e){return s(function(){for(let r=0;r<e/4;r++)UPe.writeUInt32BE(Math.random()*2**32>>>0,r*4);for(let r=0;r<e&&!(UPe[r]>0);r++)r===e-1&&(UPe[e-1]=1);return UPe.toString("hex",0,e)},"generateId")}s(bLn,"getIdGenerator")});var SLn=z(tB=>{"use strict";Object.defineProperty(tB,"__esModule",{value:!0});tB.RandomIdGenerator=tB.BatchSpanProcessor=void 0;var Vua=xLn();Object.defineProperty(tB,"BatchSpanProcessor",{enumerable:!0,get:s(function(){return Vua.BatchSpanProcessor},"get")});var Gua=kLn();Object.defineProperty(tB,"RandomIdGenerator",{enumerable:!0,get:s(function(){return Gua.RandomIdGenerator},"get")})});var jFt=z(rB=>{"use strict";Object.defineProperty(rB,"__esModule",{value:!0});rB.RandomIdGenerator=rB.BatchSpanProcessor=void 0;var ILn=SLn();Object.defineProperty(rB,"BatchSpanProcessor",{enumerable:!0,get:s(function(){return ILn.BatchSpanProcessor},"get")});Object.defineProperty(rB,"RandomIdGenerator",{enumerable:!0,get:s(function(){return ILn.RandomIdGenerator},"get")})});var TLn=z(bx=>{"use strict";Object.defineProperty(bx,"__esModule",{value:!0});bx.METRIC_OTEL_SDK_SPAN_STARTED=bx.METRIC_OTEL_SDK_SPAN_LIVE=bx.ATTR_OTEL_SPAN_SAMPLING_RESULT=bx.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0;bx.ATTR_OTEL_SPAN_PARENT_ORIGIN="otel.span.parent.origin";bx.ATTR_OTEL_SPAN_SAMPLING_RESULT="otel.span.sampling_result";bx.METRIC_OTEL_SDK_SPAN_LIVE="otel.sdk.span.live";bx.METRIC_OTEL_SDK_SPAN_STARTED="otel.sdk.span.started"});var ELn=z(ZPe=>{"use strict";Object.defineProperty(ZPe,"__esModule",{value:!0});ZPe.TracerMetrics=void 0;var qPe=YL(),Nee=TLn(),LFt=class{static{s(this,"TracerMetrics")}startedSpans;liveSpans;constructor(t){this.startedSpans=t.createCounter(Nee.METRIC_OTEL_SDK_SPAN_STARTED,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=t.createUpDownCounter(Nee.METRIC_OTEL_SDK_SPAN_LIVE,{unit:"{span}",description:"The number of currently live spans."})}startSpan(t,r){let o=Hua(r);if(this.startedSpans.add(1,{[Nee.ATTR_OTEL_SPAN_PARENT_ORIGIN]:Wua(t),[Nee.ATTR_OTEL_SPAN_SAMPLING_RESULT]:o}),r===qPe.SamplingDecision.NOT_RECORD)return()=>{};let n={[Nee.ATTR_OTEL_SPAN_SAMPLING_RESULT]:o};return this.liveSpans.add(1,n),()=>{this.liveSpans.add(-1,n)}}};ZPe.TracerMetrics=LFt;function Wua(e){return e?e.isRemote?"remote":"local":"none"}s(Wua,"parentOrigin");function Hua(e){switch(e){case qPe.SamplingDecision.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case qPe.SamplingDecision.RECORD:return"RECORD_ONLY";case qPe.SamplingDecision.NOT_RECORD:return"DROP"}}s(Hua,"samplingDecisionToString")});var CLn=z(VPe=>{"use strict";Object.defineProperty(VPe,"__esModule",{value:!0});VPe.VERSION=void 0;VPe.VERSION="2.6.1"});var ALn=z(WPe=>{"use strict";Object.defineProperty(WPe,"__esModule",{value:!0});WPe.Tracer=void 0;var jl=(fn(),Mr(co)),GPe=ps(),Kua=dLn(),Jua=OFt(),Qua=jFt(),Yua=ELn(),Xua=CLn(),BFt=class{static{s(this,"Tracer")}_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(t,r,o,n){let i=(0,Jua.mergeConfig)(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new Qua.RandomIdGenerator,this._resource=o,this._spanProcessor=n,this.instrumentationScope=t;let a=i.meterProvider?i.meterProvider.getMeter("@opentelemetry/sdk-trace",Xua.VERSION):jl.createNoopMeter();this._tracerMetrics=new Yua.TracerMetrics(a)}startSpan(t,r={},o=jl.context.active()){r.root&&(o=jl.trace.deleteSpan(o));let n=jl.trace.getSpan(o);if((0,GPe.isTracingSuppressed)(o))return jl.diag.debug("Instrumentation suppressed, returning Noop Span"),jl.trace.wrapSpanContext(jl.INVALID_SPAN_CONTEXT);let i=n?.spanContext(),a=this._idGenerator.generateSpanId(),u,l,c;!i||!jl.trace.isSpanContextValid(i)?l=this._idGenerator.generateTraceId():(l=i.traceId,c=i.traceState,u=i);let d=r.kind??jl.SpanKind.INTERNAL,p=(r.links??[]).map(x=>({context:x.context,attributes:(0,GPe.sanitizeAttributes)(x.attributes)})),m=(0,GPe.sanitizeAttributes)(r.attributes),f=this._sampler.shouldSample(o,l,t,d,m,p),h=this._tracerMetrics.startSpan(i,f.decision);c=f.traceState??c;let _=f.decision===jl.SamplingDecision.RECORD_AND_SAMPLED?jl.TraceFlags.SAMPLED:jl.TraceFlags.NONE,y={traceId:l,spanId:a,traceFlags:_,traceState:c};if(f.decision===jl.SamplingDecision.NOT_RECORD)return jl.diag.debug("Recording is off, propagating context in a non-recording span"),jl.trace.wrapSpanContext(y);let v=(0,GPe.sanitizeAttributes)(Object.assign(m,f.attributes));return new Kua.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:o,spanContext:y,name:t,kind:d,links:p,parentSpanContext:u,attributes:v,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:h})}startActiveSpan(t,r,o,n){let i,a,u;if(arguments.length<2)return;arguments.length===2?u=r:arguments.length===3?(i=r,u=o):(i=r,a=o,u=n);let l=a??jl.context.active(),c=this.startSpan(t,i,l),d=jl.trace.setSpan(l,c);return jl.context.with(d,u,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};WPe.Tracer=BFt});var PLn=z(HPe=>{"use strict";Object.defineProperty(HPe,"__esModule",{value:!0});HPe.MultiSpanProcessor=void 0;var ela=ps(),UFt=class{static{s(this,"MultiSpanProcessor")}_spanProcessors;constructor(t){this._spanProcessors=t}forceFlush(){let t=[];for(let r of this._spanProcessors)t.push(r.forceFlush());return new Promise(r=>{Promise.all(t).then(()=>{r()}).catch(o=>{(0,ela.globalErrorHandler)(o||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(t,r){for(let o of this._spanProcessors)o.onStart(t,r)}onEnding(t){for(let r of this._spanProcessors)r.onEnding&&r.onEnding(t)}onEnd(t){for(let r of this._spanProcessors)r.onEnd(t)}shutdown(){let t=[];for(let r of this._spanProcessors)t.push(r.shutdown());return new Promise((r,o)=>{Promise.all(t).then(()=>{r()},o)})}};HPe.MultiSpanProcessor=UFt});var RLn=z(rR=>{"use strict";Object.defineProperty(rR,"__esModule",{value:!0});rR.BasicTracerProvider=rR.ForceFlushState=void 0;var tla=ps(),rla=cAe(),nla=ALn(),ola=$Ft(),ila=PLn(),ala=OFt(),nB;(function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"})(nB=rR.ForceFlushState||(rR.ForceFlushState={}));var FFt=class{static{s(this,"BasicTracerProvider")}_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(t={}){let r=(0,tla.merge)({},(0,ola.loadDefaultConfig)(),(0,ala.reconfigureLimits)(t));this._resource=r.resource??(0,rla.defaultResource)(),this._config=Object.assign({},r,{resource:this._resource});let o=[];t.spanProcessors?.length&&o.push(...t.spanProcessors),this._activeSpanProcessor=new ila.MultiSpanProcessor(o)}getTracer(t,r,o){let n=`${t}@${r||""}:${o?.schemaUrl||""}`;return this._tracers.has(n)||this._tracers.set(n,new nla.Tracer({name:t,version:r,schemaUrl:o?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(n)}forceFlush(){let t=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(o=>new Promise(n=>{let i,a=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${t} ms`)),i=nB.timeout},t);o.forceFlush().then(()=>{clearTimeout(a),i!==nB.timeout&&(i=nB.resolved,n(i))}).catch(u=>{clearTimeout(a),i=nB.error,n(u)})}));return new Promise((o,n)=>{Promise.all(r).then(i=>{let a=i.filter(u=>u!==nB.resolved);a.length>0?n(a):o()}).catch(i=>n([i]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};rR.BasicTracerProvider=FFt});var MLn=z(KPe=>{"use strict";Object.defineProperty(KPe,"__esModule",{value:!0});KPe.ConsoleSpanExporter=void 0;var qFt=ps(),ZFt=class{static{s(this,"ConsoleSpanExporter")}export(t,r){return this._sendSpans(t,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(t){return{resource:{attributes:t.resource.attributes},instrumentationScope:t.instrumentationScope,traceId:t.spanContext().traceId,parentSpanContext:t.parentSpanContext,traceState:t.spanContext().traceState?.serialize(),name:t.name,id:t.spanContext().spanId,kind:t.kind,timestamp:(0,qFt.hrTimeToMicroseconds)(t.startTime),duration:(0,qFt.hrTimeToMicroseconds)(t.duration),attributes:t.attributes,status:t.status,events:t.events,links:t.links}}_sendSpans(t,r){for(let o of t)console.dir(this._exportInfo(o),{depth:3});if(r)return r({code:qFt.ExportResultCode.SUCCESS})}};KPe.ConsoleSpanExporter=ZFt});var OLn=z(JPe=>{"use strict";Object.defineProperty(JPe,"__esModule",{value:!0});JPe.InMemorySpanExporter=void 0;var $Ln=ps(),VFt=class{static{s(this,"InMemorySpanExporter")}_finishedSpans=[];_stopped=!1;export(t,r){if(this._stopped)return r({code:$Ln.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...t),setTimeout(()=>r({code:$Ln.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};JPe.InMemorySpanExporter=VFt});var DLn=z(YPe=>{"use strict";Object.defineProperty(YPe,"__esModule",{value:!0});YPe.SimpleSpanProcessor=void 0;var sla=(fn(),Mr(co)),QPe=ps(),GFt=class{static{s(this,"SimpleSpanProcessor")}_exporter;_shutdownOnce;_pendingExports;constructor(t){this._exporter=t,this._shutdownOnce=new QPe.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(t,r){}onEnd(t){if(this._shutdownOnce.isCalled||(t.spanContext().traceFlags&sla.TraceFlags.SAMPLED)===0)return;let r=this._doExport(t).catch(o=>(0,QPe.globalErrorHandler)(o));this._pendingExports.add(r),r.finally(()=>this._pendingExports.delete(r))}async _doExport(t){t.resource.asyncAttributesPending&&await t.resource.waitForAsyncAttributes?.();let r=await QPe.internal._export(this._exporter,[t]);if(r.code!==QPe.ExportResultCode.SUCCESS)throw r.error??new Error(`SimpleSpanProcessor: span export failed (status ${r})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};YPe.SimpleSpanProcessor=GFt});var NLn=z(XPe=>{"use strict";Object.defineProperty(XPe,"__esModule",{value:!0});XPe.NoopSpanProcessor=void 0;var WFt=class{static{s(this,"NoopSpanProcessor")}onStart(t,r){}onEnd(t){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};XPe.NoopSpanProcessor=WFt});var jLn=z(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.SamplingDecision=Ya.TraceIdRatioBasedSampler=Ya.ParentBasedSampler=Ya.AlwaysOnSampler=Ya.AlwaysOffSampler=Ya.NoopSpanProcessor=Ya.SimpleSpanProcessor=Ya.InMemorySpanExporter=Ya.ConsoleSpanExporter=Ya.RandomIdGenerator=Ya.BatchSpanProcessor=Ya.BasicTracerProvider=void 0;var ula=RLn();Object.defineProperty(Ya,"BasicTracerProvider",{enumerable:!0,get:s(function(){return ula.BasicTracerProvider},"get")});var zLn=jFt();Object.defineProperty(Ya,"BatchSpanProcessor",{enumerable:!0,get:s(function(){return zLn.BatchSpanProcessor},"get")});Object.defineProperty(Ya,"RandomIdGenerator",{enumerable:!0,get:s(function(){return zLn.RandomIdGenerator},"get")});var lla=MLn();Object.defineProperty(Ya,"ConsoleSpanExporter",{enumerable:!0,get:s(function(){return lla.ConsoleSpanExporter},"get")});var cla=OLn();Object.defineProperty(Ya,"InMemorySpanExporter",{enumerable:!0,get:s(function(){return cla.InMemorySpanExporter},"get")});var dla=DLn();Object.defineProperty(Ya,"SimpleSpanProcessor",{enumerable:!0,get:s(function(){return dla.SimpleSpanProcessor},"get")});var pla=NLn();Object.defineProperty(Ya,"NoopSpanProcessor",{enumerable:!0,get:s(function(){return pla.NoopSpanProcessor},"get")});var mla=PPe();Object.defineProperty(Ya,"AlwaysOffSampler",{enumerable:!0,get:s(function(){return mla.AlwaysOffSampler},"get")});var fla=MPe();Object.defineProperty(Ya,"AlwaysOnSampler",{enumerable:!0,get:s(function(){return fla.AlwaysOnSampler},"get")});var hla=CFt();Object.defineProperty(Ya,"ParentBasedSampler",{enumerable:!0,get:s(function(){return hla.ParentBasedSampler},"get")});var gla=PFt();Object.defineProperty(Ya,"TraceIdRatioBasedSampler",{enumerable:!0,get:s(function(){return gla.TraceIdRatioBasedSampler},"get")});var _la=YL();Object.defineProperty(Ya,"SamplingDecision",{enumerable:!0,get:s(function(){return _la.SamplingDecision},"get")})});function kla(e){if(!(e.length>4096))try{let t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return;t.username="",t.password="",t.search="",t.hash="",t.hostname=t.hostname.toLowerCase(),(t.protocol==="https:"&&t.port==="443"||t.protocol==="http:"&&t.port==="80")&&(t.port="");let r=t.origin,o=Sla(t.pathname).slice(0,1024);return{origin:r,route:o,sanitizerVersion:"1"}}catch{return}}function Sla(e){return e.split("/").map(o=>Tla(Ila(o))).join("/")||"/"}function Ila(e){try{return decodeURIComponent(e)}catch{return e}}function Tla(e){return yla.test(e)?"{email}":vla.test(e)?"{uuid}":xla.test(e)?"{id}":bla.test(e)?"{hash}":wla.test(e)?"{token}":e.slice(0,128)}var yla,vla,xla,bla,wla,e5e,HFt=b(()=>{"use strict";yla=/^[^/@\s]+@[^/@\s]+\.[^/@\s]+$/u,vla=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,xla=/^\d{7,}$/u,bla=/^[0-9a-f]{16,}$/iu,wla=/^(?=.{20,}$)(?=.*[a-z])(?=.*[A-Z0-9])[-._~+/A-Za-z0-9]+=*$/u,e5e=class{static{s(this,"ProviderEndpointIdentityCache")}limit;values=new Map;constructor(t=256){this.limit=t}resolve(t,r){let o=r?.trim();if(!o)return;let n=`${t??"unknown"}\0${o}`,i=this.values.get(n);if(i!==void 0)return this.values.delete(n),this.values.set(n,i),i??void 0;let a=kla(o)??null;if(this.values.set(n,a),this.values.size>this.limit){let u=this.values.keys().next().value;u&&this.values.delete(u)}return a??void 0}get size(){return this.values.size}};s(kla,"sanitizeProviderEndpoint");s(Sla,"sanitizePathname");s(Ila,"safeDecodeURIComponent");s(Tla,"sanitizePathSegment")});function LLn(e,t){return e!==void 0&&Number.isFinite(e)&&e>0?Math.trunc(e):t}function Ela(e,t){e.setEffectiveReasoningState(t.reasoning.effectiveState),e.setEffectiveReasoningControl(t.reasoning.effectiveControl),t.reasoning.effectiveLevel&&e.setEffectiveReasoningLevel(t.reasoning.effectiveLevel),t.reasoning.effectiveBudgetTokens!==void 0&&e.setEffectiveReasoningBudgetTokens(t.reasoning.effectiveBudgetTokens)}function BLn(e){let t=e?.toLowerCase()??"";return t.includes("/chat/completions")?"chat_completions":t.includes("/responses")?"responses":t.includes("/messages")?"messages":t.includes(":generatecontent")||t.includes(":streamgeneratecontent")?"generate_content":"unknown"}function Cla(e){return e.errorPhase==="prepare"?"configuration":e.errorPhase??"unhandled"}function ULn(e){switch(e.reason){case cr.AuthFailed:return"authentication";case cr.ProviderNotConfigured:case cr.InvalidRequest:return"configuration";case cr.RateLimited:return"rate_limit";case cr.Timeout:case cr.StreamIdleTimeout:return"timeout";case cr.NetworkError:case cr.StaleConnection:case cr.TlsError:return"network";case cr.Cancelled:return"cancelled";case cr.ContextExceeded:case cr.ProviderOverloaded:case cr.ServerError:case cr.ProxyError:case cr.AuthRefresh:case cr.OffpeakQueued:return"provider";default:return"unknown"}}var t5e,KFt=b(()=>{"use strict";iC();HFt();t5e=class{static{s(this,"ModelApiTelemetryStatusSink")}calls=new Map;endpointCache=new e5e;maxActiveCallAgeMs;maxActiveCalls;modelExecution;now;nextCapacityWarningAtMs=0;nextSweepAtMs=0;onWarning;constructor(t){this.maxActiveCallAgeMs=LLn(t.maxActiveCallAgeMs,30*6e4),this.maxActiveCalls=LLn(t.maxActiveCalls,1e3),this.modelExecution=t.modelExecution,this.now=t.now??Date.now,this.onWarning=t.onWarning}publish(t){this.publishObserved(t)}publishFailure(t,r){this.publishObserved(t,r)}publishObserved(t,r){try{this.publishSafely(t,r)}catch(o){try{this.onWarning?.("Model telemetry status processing failed",{eventType:t.type,errorType:o instanceof Error?o.name:typeof o})}catch{}}}shutdown(){for(let t of this.calls.values())this.abandonCall(t,"process_shutdown")}abandonSession(t){for(let r of this.calls.values())r.sessionId===t&&this.abandonCall(r,"session_shutdown")}get activeCallCount(){return this.calls.size}publishSafely(t,r){let o=this.now();this.sweepExpiredCalls(o);let n=t.modelCall;if(!n)return;let i=this.calls.get(n.logicalCallId);if(t.type==="model_request_started"){if(!i){this.ensureCapacity(o);let u=this.resolveTarget(t),l=n.callCause??"initial",c=this.modelExecution.startCall(l==="initial"||!n.previousLogicalCallId?{callCause:"initial",logicalCallId:n.logicalCallId,modelRole:t.model.role,operation:n.operation,requested:u,streaming:t.transport!==Q1.Http}:{callCause:l,logicalCallId:n.logicalCallId,modelRole:t.model.role,operation:n.operation,previousLogicalCallId:n.previousLogicalCallId,requested:u,streaming:t.transport!==Q1.Http});i={attempts:new Map,lastActivityAtMs:o,logicalCallId:n.logicalCallId,sessionId:t.sessionId,writer:c},this.calls.set(n.logicalCallId,i)}i.lastActivityAtMs=o,this.startAttempt(i,t);return}if(!i)return;i.lastActivityAtMs=o;let a=i.attempts.get(t.requestId);switch(t.type){case"model_first_provider_event":a?.writer.markFirstProviderEvent();return;case"model_first_content":a?.writer.markFirstContent();return;case"model_first_text":a?.writer.markFirstText();return;case"model_stream_stalled":a?.writer.markStreamStalled(t.idleMs);return;case"model_retry_scheduled":i.pendingRetryDelayMs=t.delayMs;return;case"model_request_failed":if(!a)return;this.finishFailedAttempt(i,a,t,r),i.attempts.delete(t.requestId),t.retryable||this.finishFailedCall(i,t,r);return;case"model_request_completed":if(!a)return;this.finishCompletedAttempt(a.writer,t),i.attempts.delete(t.requestId),i.writer.finishCompleted(),this.calls.delete(i.logicalCallId)}}startAttempt(t,r){if(t.attempts.has(r.requestId))return;let o=this.resolveTarget(r),n=t.lastRequestId,i=r.attempt<=1||!n,a=t.writer.startAttempt(i?{apiOperation:BLn(o.providerRoute),attemptCause:"initial",attemptNumber:r.attempt,maxAttempts:r.maxAttempts,requestId:r.requestId,target:o,transport:r.transport}:{apiOperation:BLn(o.providerRoute),attemptCause:"retry",attemptNumber:r.attempt,maxAttempts:r.maxAttempts,previousRequestId:n,requestId:r.requestId,retryDelayMs:t.pendingRetryDelayMs,target:o,transport:r.transport});Ela(a,o),t.attempts.set(r.requestId,{requestId:r.requestId,writer:a}),t.lastRequestId=r.requestId,t.pendingRetryDelayMs=void 0}finishCompletedAttempt(t,r){r.providerRequestId&&t.setProviderRequestId(r.providerRequestId),r.finishReason&&t.setFinishReason(r.finishReason),r.usage&&(r.usage.inputTokens!==void 0&&t.setInputTokens(r.usage.inputTokens),r.usage.outputTokens!==void 0&&t.setOutputTokens(r.usage.outputTokens),r.usage.reasoningTokens!==void 0&&t.setReasoningTokens(r.usage.reasoningTokens),r.usage.cacheReadTokens!==void 0&&t.setCacheReadTokens(r.usage.cacheReadTokens),r.usage.cacheWriteTokens!==void 0&&t.setCacheWriteTokens(r.usage.cacheWriteTokens)),t.setStreamOutputCommitted(r.streamOutputCommitted??!1),t.finishCompleted()}finishFailedAttempt(t,r,o,n){if(o.statusCode!==void 0&&r.writer.setHttpStatusCode(o.statusCode),o.providerRequestId&&r.writer.setProviderRequestId(o.providerRequestId),o.providerErrorCode&&r.writer.setProviderErrorCode(o.providerErrorCode),o.providerErrorMessage&&r.writer.setProviderErrorMessage(o.providerErrorMessage),o.retryAfterMs!==void 0&&r.writer.setRetryAfterMs(o.retryAfterMs),r.writer.setStreamOutputCommitted(o.streamOutputCommitted??!1),o.reason===cr.Cancelled){r.writer.finishCancelled("abort_signal");return}r.writer.finishFailed(Cla(o),ULn(o),n??{code:o.providerErrorCode??o.errorCode,message:o.providerErrorMessage??o.message,name:o.exceptionType??"ModelProviderError",statusCode:o.statusCode})}finishFailedCall(t,r,o){r.reason===cr.Cancelled?t.writer.finishCancelled("abort_signal"):t.writer.finishFailed("attempts",ULn(r),o??{code:r.providerErrorCode??r.errorCode,message:r.providerErrorMessage??r.message,name:r.exceptionType??"ModelProviderError"}),this.calls.delete(t.logicalCallId)}resolveTarget(t){let r=this.endpointCache.resolve(t.providerKind,t.baseURL),o=t.modelCall?.reasoning??{capability:"unknown",effectiveControl:"unknown",effectiveState:"unknown",requestedControl:"unknown",requestedState:"unknown"};return{providerId:String(t.model.providerId),providerKind:t.providerKind?.trim()||"unknown",providerOrigin:r?.origin,providerRoute:r?.route,reasoning:o,requestedModel:String(t.model.modelId)}}sweepExpiredCalls(t){if(t<this.nextSweepAtMs)return;this.nextSweepAtMs=t+Math.min(this.maxActiveCallAgeMs,6e4);let r=0;for(let o of this.calls.values())t-o.lastActivityAtMs<this.maxActiveCallAgeMs||(this.abandonCall(o,"missing_terminal"),r+=1);r>0&&this.warn("Expired model telemetry calls were abandoned",{abandonedCount:r,maxActiveCallAgeMs:this.maxActiveCallAgeMs})}ensureCapacity(t){let r=0;for(;this.calls.size>=this.maxActiveCalls;){let o=[...this.calls.values()].reduce((n,i)=>!n||i.lastActivityAtMs<n.lastActivityAtMs?i:n,void 0);if(!o)return;this.abandonCall(o,"missing_terminal"),r+=1}r>0&&t>=this.nextCapacityWarningAtMs&&(this.nextCapacityWarningAtMs=t+6e4,this.warn("Model telemetry active call capacity was reached",{abandonedCount:r,maxActiveCalls:this.maxActiveCalls}))}abandonCall(t,r){for(let o of t.attempts.values())o.writer.finishAbandoned(r);t.attempts.clear(),t.writer.finishAbandoned(r),this.calls.delete(t.logicalCallId)}warn(t,r){try{this.onWarning?.(t,r)}catch{}}};s(LLn,"positiveInteger");s(Ela,"setEffectiveReasoning");s(BLn,"apiOperationFromRoute");s(Cla,"failureStage");s(ULn,"errorCategory")});var KLn={};mr(KLn,{createOwnedAgentTelemetryRuntime:()=>Ala,metricResourceAttributes:()=>WLn,resourceAttributes:()=>GLn});function Ala(e){let t=e.timeoutMs??3e3,r=new VLn.OTLPTraceExporter({compression:J5.GZIP,headers:e.headers,timeoutMillis:t,url:e.endpoint}),o=new n5e.BatchSpanProcessor(r,{exportTimeoutMillis:t,maxExportBatchSize:e.maxBatchSize??100,maxQueueSize:e.maxQueueSize??2e3,scheduledDelayMillis:5e3}),n=(0,QFt.resourceFromAttributes)(GLn(e.resource)),i=(0,QFt.resourceFromAttributes)(WLn(e.resource)),a=new n5e.BasicTracerProvider({forceFlushTimeoutMillis:t,resource:n,spanProcessors:[o]}),u=new ZLn.OTLPMetricExporter({compression:J5.GZIP,headers:e.metricHeaders??e.headers,temporalityPreference:fE.AggregationTemporality.DELTA,timeoutMillis:t,url:e.metricEndpoint??e.endpoint}),l=new fE.PeriodicExportingMetricReader({exporter:u,exportIntervalMillis:e.metricExportIntervalMs??6e4,exportTimeoutMillis:t}),c=new fE.MeterProvider({readers:[l],resource:i,views:Pla()}),d=new qLn.AsyncLocalStorageContextManager,p=nc.setGlobalContextManager(d.enable());p||d.disable();let m=a.getTracer("@zcode/cli-agent-telemetry",String(5)),f=c.getMeter("@zcode/cli-agent-telemetry",String(5)),h=new FCe(f),_=new qCe({identity:e.identity,metrics:h,onWarning:e.onWarning,tracer:m}),y=new t5e({modelExecution:_,onWarning:e.onWarning}),v=!1;return{abandonSession(S){_.abandonSession(S),y.abandonSession(S)},agentExecution:_,enabled:!0,modelExecution:_,statusSink:y,async flush(S){v||await FLn(Promise.all([a.forceFlush(),c.forceFlush()]),S?.timeoutMs??t)},async shutdown(S){if(!v){v=!0,y.shutdown(),_.abandonProcess();try{await FLn(Promise.all([a.shutdown(),c.shutdown()]),S?.timeoutMs??t)}finally{p&&d.disable()}}},updateIdentity(S){_.updateIdentity(S)}}}function Pla(){return[y1("zcode.agent.turn.duration",[.5,1,2,5,10,30,60,120,300,600]),y1("zcode.model.*.duration",[.1,.25,.5,1,2,5,10,30,60,120]),y1("zcode.context.compaction.duration",[.001,.005,.01,.025,.05,.1,.25,.5,1,2.5,5,10,30,60,120,300,600]),y1("zcode.detached.operation.duration",[.001,.005,.01,.025,.05,.1,.25,.5,1,2.5,5,10,30,60,120,300,600]),y1("zcode.agent.step.duration",[.001,.005,.01,.025,.05,.1,.25,.5,1,2.5,5,10,30,60,120,300,600]),y1("zcode.tool.execution.duration",[.001,.005,.01,.05,.1,.5,1,5,30,120,300]),y1("zcode.command.execution.duration",[.01,.05,.1,.5,1,5,30,120,300,600]),y1("zcode.*.time_to_first_*",[.1,.25,.5,1,2,5,10,30,60,120]),y1("zcode.model.call.attempts",[1,2,3,4,5,8,13]),r5e("zcode.model.attempt.tokens"),r5e("zcode.model.attempt.stream_stall.count"),r5e("zcode.telemetry.creation_drop.count"),r5e("zcode.telemetry.abandoned.count")]}function y1(e,t){return{aggregation:{options:{boundaries:t,recordMinMax:!0},type:fE.AggregationType.EXPLICIT_BUCKET_HISTOGRAM},aggregationCardinalityLimit:250,instrumentName:e}}function r5e(e){return{aggregationCardinalityLimit:250,instrumentName:e}}function GLn(e){return HLn(e,{includeInstallationId:!0,includeServiceInstanceId:!0})}function WLn(e){return HLn(e,{includeInstallationId:!1,includeServiceInstanceId:!1})}function HLn(e,t){return Mla({"deployment.environment.name":e.deploymentEnvironment,"host.arch":Rla(),"os.type":process.platform,"process.runtime.name":"nodejs","process.runtime.version":process.version.replace(/^v/u,""),"service.instance.id":t.includeServiceInstanceId?e.serviceInstanceId:void 0,"service.name":e.serviceName,"service.version":e.cliVersion,"zcode.build.commit_id":e.buildCommitId,"zcode.device.installation_id":t.includeInstallationId?e.installationId:void 0,"zcode.product.version":e.productVersion,"zcode.runtime.distribution":e.runtimeDistribution,"zcode.runtime.surface":e.runtimeSurface,"zcode.telemetry.schema_owner":"cli","zcode.telemetry.schema_version":5})}function Rla(){switch(process.arch){case"x64":return"amd64";case"ia32":return"x86";default:return process.arch}}function Mla(e){let t={};for(let[r,o]of Object.entries(e))o!==void 0&&o!==""&&(t[r]=o);return t}async function FLn(e,t){let r;try{return await Promise.race([e,new Promise(o=>{r=setTimeout(o,Math.max(1,t))})])}finally{r&&clearTimeout(r)}}var qLn,ZLn,VLn,QFt,fE,n5e,JLn=b(()=>{"use strict";fn();qLn=ht(TPn(),1),ZLn=ht(oLn(),1),VLn=ht(lLn(),1);FAe();QFt=ht(cAe(),1),fE=ht(OAe(),1),n5e=ht(jLn(),1);Q8e();VCe();qLt();KFt();s(Ala,"createOwnedAgentTelemetryRuntime");s(Pla,"metricViews");s(y1,"histogramView");s(r5e,"cardinalityView");s(GLn,"resourceAttributes");s(WLn,"metricResourceAttributes");s(HLn,"telemetryResourceAttributes");s(Rla,"hostArchitecture");s(Mla,"compactResourceAttributes");s(FLn,"withTimeout")});function tBn(e={}){let t=e.owner??jee;return t?{agentExecution:t.agentExecution,enabled:t.enabled,modelExecution:t.modelExecution,statusSink:t.statusSink,async shutdown(){e.sessionId&&t.abandonSession(e.sessionId),await t.flush({timeoutMs:1500})}}:{agentExecution:QLn,enabled:!1,modelExecution:QLn,async shutdown(){}}}function YFt(e){let t=e.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT?.trim();if(t)return a5e(t);let r=e.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();if(!r)return;let o=a5e(r);if(!o)return;let n=new URL(o);return n.pathname=`${n.pathname.replace(/\/$/u,"")}/v1/traces`,n.toString()}function Nla(e){let t=e.OTEL_EXPORTER_OTLP_METRICS_ENDPOINT?.trim();if(t)return a5e(t);let r=e.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();if(r){let o=a5e(r);if(!o)return;let n=new URL(o);return n.pathname=`${n.pathname.replace(/\/$/u,"")}/v1/metrics`,n.toString()}return YFt(e)}function YLn(e){if(!e?.trim())return;let t={};for(let r of e.split(",")){let o=r.indexOf("=");if(o<=0)continue;let n=s5e(r.slice(0,o).trim()),i=s5e(r.slice(o+1).trim());n&&i&&(t[n]=i)}return Object.keys(t).length>0?t:void 0}async function rBn(e,t={}){if(!YFt(e)||Kla(e.ZCODE_MODEL_TELEMETRY_ENABLED))return e;let o=XFt(e.ZCODE_TELEMETRY_DEVICE_MID)??await Lla(e.ZCODE_HOME?.trim()),n=o?{...e,ZCODE_TELEMETRY_DEVICE_MID:o}:e;return!zee&&!jee&&(zee=zla(n,t)),jee=await zee,n}async function u5e(){let e=jee??await zee;jee=void 0,zee=void 0,await e?.shutdown({timeoutMs:1500})}async function zla(e,t){let r=YFt(e);if(!r)return;let o=Nla(e),n=jla(e),i={buildCommitId:Wla(t.buildCommitId??e.ZCODE_BUILD_COMMIT_ID),cliVersion:XLn(t.cliVersion),deploymentEnvironment:e.ZCODE_ENV??e.ZCODE_RUNTIME_ENV??Hla(e)["deployment.environment.name"],installationId:XFt(e.ZCODE_TELEMETRY_DEVICE_MID),productVersion:XLn(t.productVersion??e.ZCODE_APP_VERSION),runtimeDistribution:t.runtimeDistribution??Gla(e.ZCODE_TELEMETRY_RUNTIME_DISTRIBUTION),runtimeSurface:t.runtimeSurface??Vla(e.ZCODE_TELEMETRY_RUNTIME_SURFACE),serviceInstanceId:(0,i5e.randomUUID)(),serviceName:e.OTEL_SERVICE_NAME?.trim()||"zcode-cli-agent"};try{let{createOwnedAgentTelemetryRuntime:a}=await Promise.resolve().then(()=>(JLn(),KLn));return a({endpoint:r,headers:YLn(e.OTEL_EXPORTER_OTLP_TRACES_HEADERS??e.OTEL_EXPORTER_OTLP_HEADERS),identity:n,metricEndpoint:o,metricHeaders:YLn(e.OTEL_EXPORTER_OTLP_METRICS_HEADERS??e.OTEL_EXPORTER_OTLP_HEADERS),onWarning:t.onWarning,resource:i})}catch(a){t.onWarning?.("Agent telemetry runtime initialization failed",{errorType:a instanceof Error?a.name:typeof a});return}}function jla(e){let t=nBn(e.ZCODE_TELEMETRY_USER_SUBJECT_ID),r=e.ZCODE_TELEMETRY_IDENTITY_STATE?.trim();return{identityState:r==="authenticated"||r==="anonymous"||r==="unknown"?r:t?"authenticated":XFt(e.ZCODE_TELEMETRY_DEVICE_MID)?"anonymous":"unknown",...t?{userSubjectId:t}:{}}}function XFt(e){return nBn(e)}function nBn(e){let t=e?.trim();return t&&Ola.test(t)?t:void 0}async function Lla(e){let t=e?(0,nR.join)(e,"v2","telemetry-state.json"):(0,nR.join)((0,eBn.homedir)(),".zcode","v2","telemetry-state.json"),r=o5e.get(t);if(r)return r;let o=Bla(t);o5e.set(t,o);try{return await o}finally{o5e.get(t)===o&&o5e.delete(t)}}async function Bla(e){try{let t=await oBn(e);return t||await Ula(e,async()=>{let r=await e9t(e),o=iBn(r);if(o)return o;let n=(0,i5e.randomUUID)();r.deviceMid=n;let i=`${e}.${process.pid}.${(0,i5e.randomUUID)()}.tmp`;return await(0,Kp.writeFile)(i,JSON.stringify(r,null,2),"utf8"),await(0,Kp.rename)(i,e),n})}catch{return}}async function Ula(e,t){let r=(0,nR.join)((0,nR.dirname)(e),"telemetry-state.lock");await(0,Kp.mkdir)((0,nR.dirname)(e),{recursive:!0});for(let o=0;o<2;o+=1){let n;try{return n=await(0,Kp.open)(r,"wx"),await n.writeFile(JSON.stringify({createdAt:Date.now(),pid:process.pid}),"utf8"),await t()}catch(i){if(!Zla(i)||!await Fla(r))throw i}finally{if(n!==void 0){await n.close();try{await(0,Kp.unlink)(r)}catch{}}}}return await oBn(e)}async function Fla(e){try{let t=await(0,Kp.stat)(e);if(Date.now()-t.mtimeMs<$la){let r=await e9t(e),o=typeof r.pid=="number"&&Number.isInteger(r.pid)?r.pid:void 0;if(!o||qla(o))return!1}return await(0,Kp.unlink)(e),!0}catch{return!1}}function qla(e){try{return process.kill(e,0),!0}catch(t){return!(t instanceof Error&&"code"in t&&t.code==="ESRCH")}}function Zla(e){return e instanceof Error&&"code"in e&&e.code==="EEXIST"}async function e9t(e){try{let t=JSON.parse(await(0,Kp.readFile)(e,"utf8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}async function oBn(e){return iBn(await e9t(e))}function iBn(e){return typeof e.deviceMid=="string"&&e.deviceMid.trim()?e.deviceMid.trim():void 0}function Vla(e){switch(e?.trim()){case"standalone_cli":case"desktop_local_host":case"remote_workspace_host":return e.trim();default:return"standalone_cli"}}function Gla(e){switch(e?.trim()){case"source":case"development_bundle":case"packaged":case"unknown":return e.trim();default:return"unknown"}}function XLn(e){let t=e?.trim();return t&&/^[0-9A-Za-z][0-9A-Za-z.+_-]{0,63}$/u.test(t)?t:void 0}function Wla(e){let t=e?.trim();return t&&Dla.test(t)?t.toLowerCase():void 0}function Hla(e){let t={};for(let r of e.OTEL_RESOURCE_ATTRIBUTES?.split(",")??[]){let o=r.indexOf("=");o<=0||(t[s5e(r.slice(0,o).trim())]=s5e(r.slice(o+1).trim()))}return t}function a5e(e){try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?t.toString():void 0}catch{return}}function Kla(e){return["0","false","off","disabled"].includes(e?.trim().toLowerCase()??"")}function s5e(e){try{return decodeURIComponent(e)}catch{return e}}var i5e,Kp,eBn,nR,$la,Ola,Dla,o5e,jee,zee,QLn,aBn=b(()=>{"use strict";i5e=require("node:crypto"),Kp=require("node:fs/promises"),eBn=require("node:os"),nR=require("node:path");VCe();$la=5*6e4,Ola=/^[A-Za-z0-9._:-]{1,128}$/u,Dla=/^[0-9a-f]{7,64}$/iu,o5e=new Map,QLn=new ZCe;s(tBn,"createModelTelemetry");s(YFt,"resolveOtlpTraceEndpoint");s(Nla,"resolveOtlpMetricEndpoint");s(YLn,"parseOtlpHeaders");s(rBn,"prepareModelTelemetryEnv");s(u5e,"shutdownPreparedModelTelemetry");s(zla,"createPreparedOwner");s(jla,"resolveTelemetryIdentity");s(XFt,"normalizeTelemetryDeviceMid");s(nBn,"normalizeTelemetryId");s(Lla,"resolveStandaloneDeviceMid");s(Bla,"resolveStandaloneDeviceMidFromFile");s(Ula,"withTelemetryStateLock");s(Fla,"removeStaleTelemetryStateLock");s(qla,"isProcessAlive");s(Zla,"isFileExistsError");s(e9t,"readTelemetryState");s(oBn,"readDeviceMid");s(iBn,"deviceMidFromState");s(Vla,"resolveRuntimeSurface");s(Gla,"resolveRuntimeDistribution");s(XLn,"normalizeVersion");s(Wla,"normalizeBuildCommitId");s(Hla,"resourceAttributesFromEnv");s(a5e,"validHttpUrl");s(Kla,"isExplicitlyDisabled");s(s5e,"safeDecode")});var l5e=b(()=>{"use strict";VCe();aBn();BCe();KFt();HFt()});function sBn(e){let t=lBn(e);return t?Jla.includes(t):!1}function uBn(e){return sBn(e)||Yla(e)}function Yla(e){let t=Xla(e);return t?Qla.some(r=>t===r||t.endsWith(`.${r}`)):!1}function Xla(e){let t=e?.trim();if(t)try{return new URL(t).hostname.toLowerCase()}catch{try{return new URL(`https://${t}`).hostname.toLowerCase()}catch{return}}}function lBn(e){return e?.trim().replace(/\/+$/,"").toLowerCase()??""}var Jla,Qla,t9t=b(()=>{"use strict";qr();Jla=(()=>{let e=qne(process.env);return[e.zcodePlanOpenAiBaseUrl,e.zcodePlanAnthropicBaseUrl].map(lBn)})(),Qla=["bigmodel.cn","z.ai","chatglm.site"];s(sBn,"isZcodePlanRuntimeBaseUrl");s(uBn,"isOfficialGlmProviderSideMediaBaseUrl");s(Yla,"isOfficialGlmProviderSideMediaHost");s(Xla,"hostnameFromBaseURL");s(lBn,"normalizeRuntimeBaseUrl")});function Jp(e,t={}){let r=new $N({modelsDev:t.modelsDev,overrides:e.overrides});return r.initialize(),r}function wx(e,t,r){if(!e)return;let o={},n=String(e.providerId),i=String(e.modelId),a=r??Jp(t);rca(o,t.overrides[oca(e)]),nca(o,a.getCatalogCapability(n,i));let u=RN({modelId:i,providerId:n});return o.supportsImages===void 0&&u.supportsImages!==void 0&&(o.supportsImages=u.supportsImages),ica(o,{apiFormat:e.apiFormat,baseURL:e.baseURL,modelId:i,providerId:n}),c5e(o)?o:void 0}function c5e(e){return e?.supportsImages!==void 0||e?.supportsPdf!==void 0}function d5e(e){let t={};return e?.supportsImages!==void 0&&(t.supportsImages=e.supportsImages),e?.supportsPdf!==void 0&&(t.supportsPdf=e.supportsPdf),c5e(t)?t:void 0}function rca(e,t){let r=d5e(t);r&&(r.supportsImages!==void 0&&(e.supportsImages=r.supportsImages),r.supportsPdf!==void 0&&(e.supportsPdf=r.supportsPdf))}function nca(e,t){let r=d5e(t);r&&(e.supportsImages===void 0&&r.supportsImages!==void 0&&(e.supportsImages=r.supportsImages),e.supportsPdf===void 0&&r.supportsPdf!==void 0&&(e.supportsPdf=r.supportsPdf))}function oca(e){return`${String(e.providerId)}/${String(e.modelId)}`}function ica(e,t){if(e.supportsImages===void 0&&uca(t.modelId)){if(t.apiFormat==="openai-chat-completions"){e.supportsImages=!1;return}lca(t.modelId)||t.apiFormat==="anthropic-messages"&&aca(t)||(e.supportsImages=!1)}}function aca(e){return sca(e.providerId)||uBn(e.baseURL)}function sca(e){return tca.has(e.trim().toLowerCase())}function uca(e){return cca(e).some(t=>t.includes("glm"))}function lca(e){let t=e.trim().split("/").filter(Boolean).at(-1);return t?eca.test(nht(t)):!1}function cca(e){let t=e.trim().toLowerCase();if(!t)return[];let r=t.split("/").filter(Boolean).at(-1);return!r||r===t?[t]:[t,r]}var eca,tca,p5e=b(()=>{"use strict";lw();qr();t9t();eca=/^glm-5\.2-.+$/i,tca=new Set([soe,"zai",ia.bigmodel,ia.bigmodelCodingPlan,ia.bigmodelStartPlan,ia.zai,ia.zaiCodingPlan,ia.zaiStartPlan,ia.zapi].map(e=>e.toLowerCase()));s(Jp,"createRuntimeModelCapabilityProvider");s(wx,"resolveRuntimeModelInputCapabilities");s(c5e,"hasRuntimeModelInputCapabilities");s(d5e,"pickRuntimeModelInputCapabilities");s(rca,"applyMediaFacts");s(nca,"applyMissingMediaFacts");s(oca,"modelCapabilityKey");s(ica,"applyProviderAwareMediaFallback");s(aca,"hasOfficialGlmProviderSideMedia");s(sca,"isOfficialGlmProviderSideMediaProvider");s(uca,"isGlmFamilyModelId");s(lca,"isGlm52SuffixedVariant");s(cca,"modelIdCandidates")});function cBn(){let e=Lee(process.platform),t=Lee((0,m5e.arch)()),r=Lee((0,m5e.release)());return{...e&&t?{"X-Platform":`${e}-${t}`}:{},"X-Os-Category":pca(process.platform),...r?{"X-Os-Version":r}:{}}}function Lee(e){let t=e?.trim();if(!(!t||!dca.test(t)))return t}function pca(e){switch(e){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}var m5e,dca,dBn=b(()=>{"use strict";m5e=require("node:os"),dca=/^[\x20-\x7e]+$/;s(cBn,"createRuntimePlatformHeaders");s(Lee,"normalizePrintableHeaderValue");s(pca,"normalizeOsCategory")});function f5e(e){let t=e??"~/.zcode/cli/config.json";return new qx(ir.ModelConfigMissing,`Model config is missing. Create ${t} with an explicit model provider before running ZCode.`,{configPath:t})}function mca(e,t=process.env,r={}){let o={};r9t(o,e.main,t,r),e.lite&&r9t(o,e.lite,t,r);for(let n of e.available??[])r9t(o,n,t,r);return{defaultProviderId:e.main.provider,inputMediaCapabilities:hca(e,r.modelCatalog),providers:o,env:t}}function h5e(e,t=process.env,r={}){let o=mca(e,t,r),n=fca(r.network);return{...o,...n?{network:n}:{},...r.endpointRoutingPort?{endpointRoutingPort:r.endpointRoutingPort}:{}}}function fca(e){if(!(!e?.caCertFile&&!e?.httpProxy&&!e?.noProxy))return{...e.caCertFile?{caCertFile:e.caCertFile}:{},...e.httpProxy?{httpProxy:e.httpProxy}:{},...e.noProxy?{noProxy:e.noProxy}:{}}}function hca(e,t){if(!t)return;let r=Jp(t),o=[];for(let n of gca(e)){let i=wx({apiFormat:n.kind?Ry(n.kind):void 0,baseURL:n.baseURL,modelId:n.model,providerId:n.provider},t,r);c5e(i)&&o.push([_ca(n),i])}return o.length>0?Object.fromEntries(o):void 0}function gca(e){return[e.main,...e.lite?[e.lite]:[],...e.available??[]]}function _ca(e){return`${e.provider}/${e.model}`}function r9t(e,t,r,o){let n=t.provider,i=e[n],a=kca(t,r,i,o);if(!i){e[n]=a;return}e[n]=Aca(n,i,a)}function yca(e,t,r){let n=`Z Code@${t.sourceTitle??bca()}`,i=xca(e,t);return QYt({"HTTP-Referer":vca(e),"User-Agent":`ZCode/${i??"unknown"}`,...i?{"X-ZCode-App-Version":i}:{},"X-Title":n,"X-ZCode-Agent":"glm",...cBn()},r)}function vca(e){return V1(e)}function xca(e,t){let r=e[VB]??t.appVersion;return Lee(r)}function bca(){return process.argv.includes("app-server")||process.argv.includes("agent-server")?"electron":"cli"}function wca(e,t){let r={...e};if(t)for(let[o,n]of Object.entries(t))r[o]=n;return Object.keys(r).length>0?r:void 0}function kca(e,t,r,o={}){let n=e.kind??Sca(r)??Ica(e),i=e.baseURL??r?.baseURL,a=e.apiKey??Eca(e,n,t)??r?.apiKey,u=wca(yca(t,o,i),e.headers),l=e.providerOptions,c=e.providerName??Tca(r)??e.provider;if(n==="openai-compatible"){if(!i)throw new Error(`Model provider ${e.provider} is missing baseURL`);return{kind:n,name:c,baseURL:i,apiKey:a,apiKeyRequired:e.apiKeyRequired??r?.apiKeyRequired,...e.includeUsage!==void 0?{includeUsage:e.includeUsage}:{},headers:u,providerOptions:l}}return{kind:n,baseURL:i,apiKey:a,apiKeyRequired:e.apiKeyRequired??r?.apiKeyRequired,headers:u,providerOptions:l}}function Sca(e){if(e&&(e.kind==="anthropic"||e.kind==="openai"||e.kind==="openai-compatible"))return e.kind}function Ica(e){return e.kind?e.kind:e.provider==="anthropic"&&!e.baseURL?"anthropic":e.provider==="openai"&&!e.baseURL?"openai":"openai-compatible"}function Tca(e){return e&&"name"in e?e.name:void 0}function Eca(e,t,r){for(let o of Cca(e,t)){let n=r[o];if(n)return n}}function Cca(e,t){let r=new Set;t==="openai"&&r.add("OPENAI_API_KEY"),t==="anthropic"&&r.add("ANTHROPIC_API_KEY");for(let o of[e.providerName,e.provider,e.provider.replace(/^default[-_]/,"")]){let n=Mca(o);n&&r.add(`${n}_API_KEY`)}return r.add("ZCODE_API_KEY"),[...r]}function Aca(e,t,r){let o={...t};for(let[n,i]of Object.entries(r)){if(i===void 0)continue;if(n==="headers"){o.headers=Pca(e,"headers",t.headers,i);continue}if(n==="providerOptions"){o.providerOptions=Rca(e,"providerOptions",t.providerOptions,i);continue}let a=t[n];if(a!==void 0&&!pBn(a,i))throw new Error(`Conflicting model provider config for ${e}.${n}`);o[n]=a??i}return o}function Pca(e,t,r,o){let n={...r};for(let[i,a]of Object.entries(o)){if(n[i]!==void 0&&n[i]!==a)throw new Error(`Conflicting model provider config for ${e}.${t}.${i}`);n[i]=a}return n}function Rca(e,t,r,o){if(r&&!pBn(r,o))throw new Error(`Conflicting model provider config for ${e}.${t}`);return{...o}}function Mca(e){if(!e)return;let t=e.trim().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").toUpperCase();return t.length>0?t:void 0}function pBn(e,t){return JSON.stringify(e)===JSON.stringify(t)}var g5e=b(()=>{"use strict";qr();ze();p5e();dBn();iC();s(f5e,"createModelConfigMissingError");s(mca,"createAiSdkModelRegistryConfig");s(h5e,"createRuntimeAiSdkModelRegistryConfig");s(fca,"normalizeAiSdkNetworkConfig");s(hca,"createInputMediaCapabilities");s(gca,"modelTargets");s(_ca,"modelTargetKey");s(r9t,"mergeProvider");s(yca,"createDefaultProviderHeaders");s(vca,"resolveCliZCodeEndpointOrigin");s(xca,"resolveAppVersionForHeaders");s(bca,"detectDefaultProviderSourceTitle");s(wca,"mergeHeaders");s(kca,"targetToProviderConfig");s(Sca,"currentConfigKind");s(Ica,"inferProviderKind");s(Tca,"getProviderName");s(Eca,"resolveApiKeyFromEnv");s(Cca,"apiKeyEnvCandidates");s(Aca,"mergeProviderConfig");s(Pca,"mergeStringRecord");s(Rca,"mergeObject");s(Mca,"toEnvKey");s(pBn,"valuesEqual")});function hE(e={}){let t=e.modelConfig?void 0:Ni({env:e.env}),r=e.modelConfig??t?.config.model;if(!r)throw f5e(t?.sources.user.path);let o=h5e(r,e.env,{appVersion:e.appVersion,endpointRoutingPort:e.endpointRoutingPort,modelCatalog:e.modelCatalog??t?.config.modelCatalog,network:e.network??t?.config.network,sourceTitle:e.sourceTitle}),n=new qD(o);return new LN({debugDir:e.modelIoDir,env:e.env,logger:e.logger,modelCatalog:e.modelCatalog??t?.config.modelCatalog,registry:n,streamIdleTimeoutMs:e.streamIdleTimeoutMs??t?.config.modelStream.idleTimeoutMs,statusSink:e.statusSink})}var Bee=b(()=>{"use strict";lw();lw();Ou();g5e();s(hE,"createModelAdapter")});function hy(){return mBn.performance.now()}function $ca(e){return e instanceof Error?e:new Error(String(e))}function _5e(e,t){return Math.max(0,Math.round(t-e))}var mBn,gE,y5e=b(()=>{"use strict";mBn=require("node:perf_hooks"),gE=class{static{s(this,"StartupTimer")}logger;baseContext;startedAt;lastMarkAt;constructor(t,r,o=hy()){this.logger=t,this.baseContext=r,this.startedAt=o,this.lastMarkAt=o}start(t,r){let o=hy();this.logger.info(t,this.createContext(r,o,0,"started"))}mark(t,r){let o=hy(),n=_5e(this.lastMarkAt,o);this.lastMarkAt=o,this.logger.info(t,this.createContext(r,o,n,"completed"))}complete(t,r){let o=hy();this.logger.info(t,this.createContext(r,o,_5e(this.startedAt,o),"completed"))}fail(t,r,o){let n=hy();this.logger.error(t,$ca(r),this.createContext(o,n,_5e(this.startedAt,n),"failed"))}createContext(t,r,o,n){return{...this.baseContext,...t.context,durationMs:o,event:t.event,stage:t.stage,status:n,totalDurationMs:_5e(this.startedAt,r)}}};s(hy,"startupNow");s($ca,"toError");s(_5e,"elapsedMs")});function v5e(e,t){Oca(e)&&e.scheduleLogRetentionCleanup({logger:t.child({module:"adapters.logging"})})}function Oca(e){return"scheduleLogRetentionCleanup"in e&&typeof e.scheduleLogRetentionCleanup=="function"}var n9t=b(()=>{"use strict";s(v5e,"scheduleStartupLogRetentionCleanup");s(Oca,"hasRetentionScheduler")});function fBn(e){return e.ZCODE_MESSAGE_ENABLED==="1"||e.ZCODE_MESSAGE_ENABLED==="true"}function hBn(e){let t={},r={};return e.runtimeConfig?.mode&&(r.mode=e.runtimeConfig.mode),e.runtimeConfig?.toolAllowlist&&(r.allowedTools=[...e.runtimeConfig.toolAllowlist]),e.runtimeConfig?.toolDisallowlist&&(r.disallowedTools=[...e.runtimeConfig.toolDisallowlist]),Object.keys(r).length>0&&(t.permission=r),e.uiLocale&&(t.ui={locale:e.uiLocale}),Object.keys(t).length>0?t:void 0}function gBn(e,t){let r=e.config.ui.locale,o=o9t(r,t);return o===r?e:{...e,config:{...e.config,ui:{...e.config.ui,locale:o}}}}function o9t(e,t){let r=e==="auto"?Dca(t):void 0;return rx(e,r)}function Dca(e){return e.uiDetectedLocale!==void 0?vL({intlLocale:e.uiDetectedLocale}):vL({env:e.env??process.env,intlLocale:Nca()})}function Nca(){try{return Intl.DateTimeFormat().resolvedOptions().locale}catch{return}}var _Bn=b(()=>{"use strict";vg();s(fBn,"isMessageEnabled");s(hBn,"createConfigCliOverrides");s(gBn,"resolveEffectiveConfigResult");s(o9t,"resolveEffectiveLocale");s(Dca,"detectAppLocale");s(Nca,"resolveIntlLocale")});function kx(e){return(0,oB.basename)(e)==="cli"?e:(0,oB.join)(e,"cli")}function iB(e){return(0,oB.join)(e,"plugins")}function x5e(e,t){return(0,oB.join)(e,t?"debug":"rollout")}function yBn(e,t,r){return fQ({cliStorageRoot:e,workspaceIdentity:r,workspacePath:t})}function Uee(e){return rF(e.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)||"default")}var oB,v1=b(()=>{"use strict";oB=require("node:path");ze();md();s(kx,"getCliStorageRoot");s(iB,"getPluginStorageRoot");s(x5e,"getModelIoDir");s(yBn,"getProjectMemoryRoot");s(Uee,"projectIdFromDirectory")});function Fee(e){return"close"in e&&typeof e.close=="function"}function vBn(e){let t=e;return typeof t.recordInputHistory=="function"&&typeof t.recallPreviousInputHistory=="function"?e:void 0}function xBn(e){let t=e;return typeof t.getProjectPermissionMode=="function"&&typeof t.saveProjectPermissionMode=="function"&&typeof t.getGlobalReasoningLevel=="function"&&typeof t.saveGlobalReasoningLevel=="function"?e:void 0}function bBn(e,t){if(!e)return;let r=e.getProjectPermissionMode(t);return IBn(r)?void 0:r??void 0}function b5e(e){if(!e)return;let t=e.getGlobalReasoningLevel();return IBn(t)?void 0:t??void 0}function wBn(e){e.close()}function kBn(e,t){let r=qee(e);t.start("ZCode SQLite migration started",{context:{dbPath:r},event:"bootstrap.app.startup.sqlite_migration.started",stage:"migrate_session_db"});let o=PC({dbPath:r});return t.mark("ZCode SQLite migration completed",{context:{dbPath:r},event:"bootstrap.app.startup.sqlite_migration.completed",stage:"migrate_session_db"}),o}function SBn(e,t){let r=qee(e);t.start("ZCode Protocol SQLite migration started",{context:{dbPath:r},event:"zcode_protocol.startup.sqlite_migration.started",stage:"migrate_session_db"});let o=PC({dbPath:r});return t.mark("ZCode Protocol SQLite migration completed",{context:{dbPath:r},event:"zcode_protocol.startup.sqlite_migration.completed",stage:"migrate_session_db"}),o}function qee(e){return $a(e.config.storage.sessionDbPath)}function IBn(e){return typeof e=="object"&&e!==null&&typeof e.then=="function"}var Zee=b(()=>{"use strict";Xx();Ou();s(Fee,"isClosableSessionStore");s(vBn,"asInputHistoryStore");s(xBn,"asLocalSettingStore");s(bBn,"readProjectPermissionMode");s(b5e,"readGlobalReasoningLevel");s(wBn,"closeSessionStore");s(kBn,"openStartupSessionStore");s(SBn,"openStartupZCodeProtocolSessionStore");s(qee,"getSessionDbPath");s(IBn,"isPromiseLike")});function Sx(e){return e?Object.entries(e).filter(([,t])=>t?.enable===!1).map(([t])=>t):[]}var aB=b(()=>{"use strict";s(Sx,"collectDisabledPaths")});function TBn(e){let{builtInExpertWorkflowDefinition:t}=e;return{expertWorkflowStatus:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind})).status({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind}),"expertWorkflowStatus"),workflowStatus:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind})).status({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind}),"workflowStatus"),retryWorkflow:s(async r=>(await e.prepareUserExecutionBoundary(r),(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind})).retry({abortSignal:r?.abortSignal,activityId:r?.activityId,cwd:e.workingDirectory,definitionId:r?.definitionId,nodeId:r?.nodeId,onEvent:r?.onEvent,phase:r?.phase,runId:r?.runId,traceContext:r?.traceContext??e.traceContext,workflowKind:r?.workflowKind})),"retryWorkflow"),listExpertWorkflows:s(async r=>e.listWorkflowRuns({abortSignal:r?.abortSignal,definitionId:r?.definitionId,limit:r?.limit,workflowKind:r?.workflowKind??t.kind}),"listExpertWorkflows"),listWorkflows:e.listWorkflowRuns,readExpertWorkflowEvents:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r.abortSignal,runId:r.runId})).events({abortSignal:r.abortSignal,limit:r.limit,runId:r.runId}),"readExpertWorkflowEvents"),readWorkflowEvents:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r.abortSignal,runId:r.runId})).events({abortSignal:r.abortSignal,limit:r.limit,runId:r.runId}),"readWorkflowEvents"),resumeExpertWorkflow:s(async r=>(await e.prepareUserExecutionBoundary(r),e.switchWorkflowToYolo(),(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind})).resume({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,onEvent:r?.onEvent,runId:r?.runId,traceContext:r?.traceContext??e.traceContext,workflowKind:r?.workflowKind??t.kind})),"resumeExpertWorkflow"),resumeWorkflow:s(async r=>(await e.prepareUserExecutionBoundary(r),e.switchWorkflowToYolo(),(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind})).resume({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,onEvent:r?.onEvent,runId:r?.runId,traceContext:r?.traceContext??e.traceContext,workflowKind:r?.workflowKind})),"resumeWorkflow"),stopExpertWorkflow:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind})).cancel({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind}),"stopExpertWorkflow"),stopWorkflow:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind})).cancel({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind}),"stopWorkflow"),runExpertWorkflowBackground:s(async(r,o)=>{await e.prepareUserExecutionBoundary(o),e.switchWorkflowToYolo();let{definition:n,workflow:i}=await e.createStartInput(r,t.kind);return await e.persistWorkflowActivity(n,r.task,o?.traceContext??e.traceContext),i.startBackground({abortSignal:o?.abortSignal,cwd:e.workingDirectory,definitionId:r.definitionId,onEvent:o?.onEvent,sessionId:e.sessionId,task:r.task,traceContext:o?.traceContext??e.traceContext,workflowKind:r.workflowKind??n.kind})},"runExpertWorkflowBackground"),runWorkflowBackground:s(async(r,o)=>{await e.prepareUserExecutionBoundary(o),e.switchWorkflowToYolo();let{definition:n,workflow:i}=await e.createStartInput(r);return await e.persistWorkflowActivity(n,r.task,o?.traceContext??e.traceContext),i.startBackground({abortSignal:o?.abortSignal,cwd:e.workingDirectory,definitionId:r.definitionId??n.definitionId,onEvent:o?.onEvent,sessionId:e.sessionId,task:r.task,traceContext:o?.traceContext??e.traceContext,workflowKind:r.workflowKind??n.kind})},"runWorkflowBackground"),runExpertWorkflow:s(async(r,o)=>{await e.prepareUserExecutionBoundary(o),e.switchWorkflowToYolo();let{definition:n,workflow:i}=await e.createStartInput(r,t.kind);return await e.persistWorkflowActivity(n,r.task,o?.traceContext??e.traceContext),i.start({abortSignal:o?.abortSignal,cwd:e.workingDirectory,definitionId:r.definitionId??n.definitionId,onEvent:o?.onEvent,sessionId:e.sessionId,task:r.task,traceContext:o?.traceContext??e.traceContext,workflowKind:r.workflowKind??n.kind})},"runExpertWorkflow"),runWorkflow:s(async(r,o)=>{await e.prepareUserExecutionBoundary(o),e.switchWorkflowToYolo();let{definition:n,workflow:i}=await e.createStartInput(r);return await e.persistWorkflowActivity(n,r.task,o?.traceContext??e.traceContext),i.start({abortSignal:o?.abortSignal,cwd:e.workingDirectory,definitionId:r.definitionId??n.definitionId,onEvent:o?.onEvent,sessionId:e.sessionId,task:r.task,traceContext:o?.traceContext??e.traceContext,workflowKind:r.workflowKind??n.kind})},"runWorkflow")}}var EBn=b(()=>{"use strict";s(TBn,"createWorkflowMethods")});function CBn(e){let t=Yun({rootDir:(0,w5e.join)(e.cliStorageRoot,"workflows")}),r=Xun({rootDir:(0,w5e.join)(e.cliStorageRoot,"workflows")}),o=oX(),n=new Map,i={run:s(async _=>{await e.prepareUserExecutionBoundary({traceContext:_.traceContext});let y=_.workflowKind??o.kind,v=Iu(`workflow_${_.activityId}`),S=Hu(_.traceContext??e.traceContext,{attributes:{parentSessionId:e.sessionId,workflowActivityId:_.activityId,workflowKind:y,workflowPhase:_.phase,workflowRunId:_.runId},sessionId:v});await _.onChildSessionStarted?.({model:Sn(e.runtime.getModelRef()),sessionId:v,traceId:S.traceId});let x=zca(e,{childSessionId:v,childTraceContext:S,workflowKind:y}),k=_.onEvent?x.subscribeEvents({onSessionEvent:_.onEvent}):void 0;try{let w=await x.executeTurn(_.prompt,void 0,{abortSignal:_.abortSignal,inputSource:"subagent",traceContext:S});return{model:Sn(x.getModelRef()),response:w.response,sessionId:v,traceId:w.traceId,turnId:w.turnId}}finally{k?.()}},"run")},a=s(async _=>{let y=_?.workflowKind??o.kind,v=_?.definitionId;if(!v&&y===o.kind)return o;let S=v??y,x=await r.readDefinition(S);if(!x)throw new Error(`Workflow definition not found: ${S}`);if(_?.workflowKind&&x.kind!==_.workflowKind)throw new Error(`Workflow definition ${x.definitionId} has kind ${x.kind}, expected ${_.workflowKind}`);return x},"resolveWorkflowDefinition"),u=s(_=>{let y=[_.definitionId,_.definitionVersion,_.kind].join(":"),v=n.get(y);if(v)return v;let S=new jj({agentRunner:i,definition:_,onWorkflowEvent:e.appOptions.onWorkflowEvent,store:t});return n.set(y,S),S},"workflowRuntimeForDefinition"),l=s(async _=>u(await a(_)),"workflowRuntimeForRequest"),c=s(async _=>{if(_?.runId){let y=await t.readRun(_.runId,{signal:_.abortSignal});if(y)return y.kind===o.kind&&(y.definitionId===void 0||y.definitionId===o.definitionId)?u(o):u(await a({definitionId:y.definitionId,workflowKind:y.kind}))}return l({definitionId:_?.definitionId,workflowKind:_?.workflowKind})},"workflowRuntimeForLookup"),d=s(async _=>{let y=_?.workflowKind;return _?.definitionId&&(y=(await a({definitionId:_.definitionId,workflowKind:y})).kind),t.listRuns({cwd:e.workingDirectory,kind:y,limit:_?.limit},{signal:_?.abortSignal})},"listWorkflowRuns"),p=s((_,y)=>_.kind===o.kind?`/expert ${y}`:`/workflow ${_.kind} ${y}`,"workflowExternalActivityPrompt"),m=s(()=>{e.runtime.getMode()!=="yolo"&&e.runtime.updateConfig({mode:"yolo"})},"switchWorkflowToYolo"),f=s(async(_,y)=>{let v=await a({definitionId:_.definitionId,workflowKind:_.workflowKind??y}),S=u(v);return{definition:v,workflow:S}},"createStartInput"),h=s(async(_,y,v)=>{await e.runtime.ensureSessionPersistedForExternalActivity(p(_,y),{traceContext:v})},"persistWorkflowActivity");return TBn({builtInExpertWorkflowDefinition:o,createStartInput:f,listWorkflowRuns:d,prepareUserExecutionBoundary:e.prepareUserExecutionBoundary,persistWorkflowActivity:h,sessionId:e.sessionId,switchWorkflowToYolo:m,traceContext:e.traceContext,workflowRuntimeForLookup:c,workingDirectory:e.workingDirectory})}function zca(e,t){return new $f(t.childSessionId,{...e.runtimeConfig,agentName:t.workflowKind==="expert"?"zcode-expert":"zcode-workflow",mode:"yolo",modelProviderOptions:e.runtime.getModelProviderOptions(),modelRef:e.runtime.getModelRef(),parentSessionId:e.sessionId,taskType:"workflow_child",workingDirectory:e.workingDirectory},{agentTelemetry:e.agentTelemetry,agentTelemetryCausation:e.agentTelemetry.captureCausation(),agentTelemetryCausationMode:"linked_root",eventStore:Fg(),sessionStore:e.sessionStore,logger:e.logger,executionPort:e.appOptions.executionPort??g6({network:{httpProxy:e.configResult.config.network.httpProxy,noProxy:e.configResult.config.network.noProxy,caCertFile:e.configResult.config.network.caCertFile},outputRootDir:(0,w5e.join)(e.storageRoot,"cli","exec"),processEnv:e.appOptions.env??process.env}),fileSystemPort:e.appOptions.fileSystemPort??pk(),httpClientPort:e.appOptions.httpClientPort??xk({env:e.appOptions.env??process.env,timeoutMs:e.configResult.config.network.timeout,proxyUrl:e.configResult.config.network.httpProxy,noProxy:e.configResult.config.network.noProxy,caCertFile:e.configResult.config.network.caCertFile}),imageProcessorPort:e.imageProcessorPort,artifactStore:e.artifactStore,contextSourcePort:e.appOptions.contextSourcePort??p6({env:e.appOptions.env}),skillPort:e.configResult.config.features.skill&&e.configResult.config.skills.enabled?e.appOptions.skillPort??kI({extraRoots:e.configResult.config.skills.roots,disabledPaths:Sx(e.configResult.config.skillOverrides)}):void 0,mcpPort:e.mcpPort,eventSink:e.eventSink,modelAdapter:e.appOptions.modelAdapter??hE({appVersion:e.appVersion,env:e.appOptions.env,logger:e.modelLogger,modelCatalog:e.configResult.config.modelCatalog,modelConfig:e.modelConfig,endpointRoutingPort:e.providerEndpointRoutingPort,network:e.configResult.config.network,sourceTitle:e.appOptions.sourceTitle,statusSink:e.modelStatusSink,streamIdleTimeoutMs:e.configResult.config.modelStream.idleTimeoutMs}),providerRuntimeHeadersPort:e.appOptions.providerRuntimeHeadersPort,permissionBroker:e.permissionBroker,permissionService:e.permissionService,appVersion:e.appVersion,traceContext:t.childTraceContext})}var w5e,ABn=b(()=>{"use strict";w5e=require("node:path");ZF();_6();c6();bk();xz();Xx();q6t();md();ze();Bee();aB();EBn();s(CBn,"createWorkflowFacade");s(zca,"createWorkflowChildRuntime")});function k5e(e){return typeof e=="string"?{text:e}:{text:e.text,attachments:e.attachments}}async function a9t(e,t){let r=await Promise.all((e??[]).map(async(o,n)=>{if(!jca(o))return o;if(!t.artifactStore)return i9t(o);try{let i=await t.artifactStore.writeToolResultArtifact({content:o.content,contentType:"text/plain",retention:"session",sessionId:t.sessionId,toolCallId:Lca(o,n),toolName:"prompt-attachment:image",trace:t.traceContext});return{...o,content:i.uri}}catch{return i9t(o)}}));return r.length>0?r:void 0}async function RBn(e,t){if(!e?.attachments||!t)return e;let r=await Promise.all(e.attachments.map(async o=>{if(!o.content?.startsWith("zcode-artifact://"))return o;try{let n=await t.readToolResultArtifact({uri:o.content});return{...o,content:n.content}}catch{return i9t(o)}}));return{...e,attachments:r}}function jca(e){return e.type==="image"&&e.content?.startsWith("data:")===!0}function i9t(e){let{content:t,...r}=e;return r}function Lca(e,t){let r=(0,PBn.createHash)("sha256").update(e.content).digest("hex").slice(0,16);return`prompt-attachment-${t+1}-${r}`}var PBn,MBn=b(()=>{"use strict";PBn=require("node:crypto");s(k5e,"normalizePromptInput");s(a9t,"externalizePromptAttachments");s(RBn,"materializeInputHistoryEntry");s(jca,"isInlineImageAttachment");s(i9t,"attachmentWithoutInlineContent");s(Lca,"attachmentArtifactCallId")});function $Bn(e){let t=s(async i=>{await e.prepareUserExecutionBoundary(i)},"preparePromptBoundary"),r=s(async(i,a,u,l)=>{if(!e.inputHistoryStore)return null;try{return await e.inputHistoryStore.recordInputHistory({attachments:l,kind:a,projectID:e.runtime.getProjectId(),sessionID:e.sessionId,text:i})}catch(c){return e.logger.warn("Input history write failed",{...Ar(u),error:c instanceof Error?c.message:String(c),event:"input_history.record.failed",kind:a,module:"bootstrap",projectId:e.runtime.getProjectId(),status:"failed"}),null}},"recordAcceptedInputHistory"),o=s(async i=>{if(!e.inputHistoryStore)return null;let a=await e.inputHistoryStore.recallPreviousInputHistory({projectID:e.runtime.getProjectId(),skip:i});return await RBn(a,e.artifactStore)},"recallPreviousInputHistory"),n=s(async(i,a)=>{let u=await a9t(i.attachments,{artifactStore:e.artifactStore,sessionId:e.sessionId,traceContext:a?.traceContext??e.traceContext});await r(i.text,"prompt",a?.traceContext??e.traceContext,u);let l=await e.customCommandPromptResolver?.(i.text,{abortSignal:a?.abortSignal,traceContext:a?.traceContext??e.traceContext}),c=l??i.text,d=a?.automationId?{automationId:a.automationId}:a?.offPeakTaskId?{offPeakTaskId:a.offPeakTaskId,...a.offPeakRunType?{offPeakRunType:a.offPeakRunType}:{}}:{};return await e.runtime.executeTurn(c,u,{abortSignal:a?.abortSignal,browserAmbientContext:a?.browserAmbientContext,continueActiveTargetAfterTurn:!0,...l!==void 0?{displayInput:i.text}:{},inputId:a?.inputId,...d,intent:a?.intent,queryId:a?.queryId,toolDisallowlist:a?.toolDisallowlist,traceContext:a?.traceContext??e.traceContext})},"runPromptTurn");return{continueActiveTarget:s(async i=>{await t(i);let a=i?.onEvent?e.runtime.subscribeEvents({onSessionEvent:i.onEvent}):void 0;try{return await e.runtime.continueActiveTargetLoop({abortSignal:i?.abortSignal,inputId:i?.inputId,traceContext:i?.traceContext??e.traceContext,trigger:"manual",verifyBeforeFirstContinue:!1})}finally{a?.()}},"continueActiveTarget"),recordInputHistory:s(async(i,a="slash_command")=>{let u=k5e(i),l=await a9t(u.attachments,{artifactStore:e.artifactStore,sessionId:e.sessionId,traceContext:e.traceContext});return r(u.text,a,e.traceContext,l)},"recordInputHistory"),recallPreviousInputHistory:o,sendInput:s(async(i,a)=>{let u=k5e(i),l=a?.delivery??"auto",c=e.runtime.getActiveTurnInfo(),d=(u.attachments?.length??0)>0;if(!d&&(l==="steer_active_turn"||l==="auto"&&c)){let m=a?.onEvent?e.runtime.subscribeEvents({onSessionEvent:a.onEvent}):void 0;try{let f=await e.runtime.steerTurn({commandKind:a?.commandKind,inputId:a?.inputId,queryId:a?.queryId,expectedTurnId:a?.expectedTurnId,input:u.text,toolDisallowlist:a?.toolDisallowlist,traceContext:a?.traceContext??e.traceContext});return f.kind==="queued"&&await r(u.text,"steered_input",a?.traceContext??e.traceContext),f}finally{m?.()}}if((l==="start_turn"||d)&&c)return{activeTurnId:c.turnId,kind:"rejected",reason:"turn_not_steerable"};await t(a);let p=a?.onEvent||a?.onTurnStartedObserved?e.runtime.subscribeEvents({onSessionEvent:s(async m=>{await a.onEvent?.(m),m.type===F.TurnStarted&&m.payload.inputId===a.inputId&&a.onTurnStartedObserved?.(m)},"onSessionEvent")}):void 0;try{return{kind:"started_turn",result:await n(u,a)}}finally{p?.()}},"sendInput"),enqueueDeferredInput:s(async(i,a)=>{let u=await e.runtime.enqueueDeferredInput({input:i,...a?.commandKind?{commandKind:a.commandKind}:{},...a?.delivery?{delivery:a.delivery}:{},...a?.intent?{intent:a.intent}:{},...a?.attachments?{attachments:a.attachments}:{},...a?.toolDisallowlist?{toolDisallowlist:a.toolDisallowlist}:{},...a?.intent?.queueItemId?{pendingInputId:a.intent.queueItemId}:{},...a?.inputId?{inputId:a.inputId}:{},...a?.queryId?{queryId:a.queryId}:{},traceContext:a?.traceContext??e.traceContext});return u.kind==="queued"&&await r(i,"steered_input",a?.traceContext??e.traceContext),u},"enqueueDeferredInput"),steerTurn:s(async(i,a)=>{let u=a?.onEvent?e.runtime.subscribeEvents({onSessionEvent:a.onEvent}):void 0;try{let l=await e.runtime.steerTurn({commandKind:a?.commandKind,inputId:a?.inputId,queryId:a?.queryId,expectedTurnId:a?.expectedTurnId,delivery:a?.delivery,intent:a?.intent,attachments:a?.attachments,pendingInputId:a?.intent?.queueItemId,input:i,toolDisallowlist:a?.toolDisallowlist,traceContext:a?.traceContext??e.traceContext});return l.kind==="queued"&&await r(i,"steered_input",a?.traceContext??e.traceContext),l}finally{u?.()}},"steerTurn"),removeQueueItem:s(async(i,a)=>e.runtime.removePendingInputById({pendingInputId:i,reason:a?.reason??"user_removed",reservationId:a?.reservationId,traceContext:a?.traceContext??e.traceContext}),"removeQueueItem"),reserveQueueItem:s(async(i,a,u)=>e.runtime.reservePendingInputById({pendingInputId:i,reservationId:a,traceContext:u?.traceContext??e.traceContext}),"reserveQueueItem"),markQueueItemPromoting:s(async(i,a,u)=>e.runtime.markPendingInputPromoting({pendingInputId:i,reservationId:a,traceContext:u?.traceContext??e.traceContext}),"markQueueItemPromoting"),releaseQueueItemReservation:s(async(i,a,u)=>e.runtime.releasePendingInputReservation({pendingInputId:i,reservationId:a,traceContext:u?.traceContext??e.traceContext}),"releaseQueueItemReservation"),editQueueItem:s(async(i,a,u)=>e.runtime.editPendingInputById({pendingInputId:i,newText:a,traceContext:u?.traceContext??e.traceContext}),"editQueueItem"),reorderQueueItem:s(async(i,a,u)=>e.runtime.reorderPendingInput({pendingInputId:i,beforePendingInputId:a,traceContext:u?.traceContext??e.traceContext}),"reorderQueueItem"),clearQueueItems:s(async i=>e.runtime.clearAllPendingInputs(i?.traceContext??e.traceContext),"clearQueueItems"),setQueueAutoDrain:s(async(i,a)=>{await e.runtime.setQueueAutoDrain({autoDrain:i,traceContext:a?.traceContext??e.traceContext})},"setQueueAutoDrain"),completeExternalQueueDrain:s(()=>{e.runtime.completeExternalQueueDrain()},"completeExternalQueueDrain"),setFollowupMode:s(async(i,a)=>{await e.runtime.setFollowupMode({mode:i,traceContext:a?.traceContext??e.traceContext})},"setFollowupMode"),submitPrompt:s(async(i,a)=>{let u=k5e(i);await t(a);let l=a?.onEvent?e.runtime.subscribeEvents({onSessionEvent:a.onEvent}):void 0;try{return await n(u,a)}finally{l?.()}},"submitPrompt")}}var OBn=b(()=>{"use strict";ze();MBn();s($Bn,"createInputFacade")});function sB(e){let t=e?.now??Date.now;return{deadlineAt:t()+(e?.durationMs??Bca),now:t,sleep:e?.sleep??Zca}}function Vee(e){return typeof e=="object"&&e!==null&&Fca.has(String(e.code))}function NBn(e){if(typeof e!="object"||e===null)return 1;let t=e[DBn];return typeof t=="number"&&Number.isFinite(t)?t:1}function s9t(e,t){let r=t?.budget??sB(),o=0;for(;;){o+=1;try{return e()}catch(n){qca(n,o);let i=Uca[o-1];if(!Vee(n)||i===void 0||r.now()+i>r.deadlineAt)throw n;r.sleep(i)}}}function _E(e,t=sB()){s9t(()=>{(0,oR.rmSync)(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:25})},{budget:t})}function Gee(e,t,r){s9t(()=>(0,oR.renameSync)(e,t),{budget:r})}function zBn(e,t,r){let o=(0,S5e.join)((0,S5e.dirname)(e),`.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`);try{s9t(()=>(0,oR.writeFileSync)(o,t),{budget:r}),Gee(o,e,r)}catch(n){try{(0,oR.rmSync)(o,{force:!0})}catch{}throw n}}function qca(e,t){if(!(typeof e!="object"||e===null))try{Object.defineProperty(e,DBn,{configurable:!0,value:t,writable:!0})}catch{}}function Zca(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}var oR,S5e,Bca,Uca,DBn,Fca,u9t=b(()=>{"use strict";oR=require("node:fs"),S5e=require("node:path"),Bca=1500,Uca=[25,50,100],DBn="zcodeOfficialPluginCacheAttempts",Fca=new Set(["EACCES","EBUSY","EEXIST","ENOTEMPTY","EPERM"]);s(sB,"createOfficialPluginCacheRetryBudget");s(Vee,"isTransientOfficialPluginCacheFsError");s(NBn,"getOfficialPluginCacheRetryAttempts");s(s9t,"retryOfficialPluginCacheFs");s(_E,"removeOfficialPluginCacheDirectory");s(Gee,"renameOfficialPluginCachePath");s(zBn,"writeTextFileAtomicallyWithRetry");s(qca,"setRetryAttempts");s(Zca,"sleepSync")});function LBn(e){let t=sR.find(r=>`${r.name}@${Li}`===e);return t?.hostMcpServerNames?[...t.hostMcpServerNames]:[]}var jBn,I5e,iR,aR,sR,T5e,uR=b(()=>{"use strict";ze();jBn="browser-use",I5e=`${jBn}@${Li}`,iR={name:"Z.ai",url:"https://z.ai"},aR="https://cdn-zcode.z.ai/zcode/official-plugin/assets",sR=[{listing:{author:iR,category:"developer-tools",displayName:"Android Emulator",displayName_i18n:{"zh-CN":"Android \u6A21\u62DF\u5668"},icon:`${aR}/android-emulator/icon.png`},name:"android-emulator",rootCandidates:["packages/android-emulator-plugin","../android-emulator-plugin","../../android-emulator-plugin","../../../android-emulator-plugin"],version:"0.1.0"},{defaultEnabled:!0,hostMcpServerNames:["node_repl"],listing:{author:iR,category:"developer-tools",displayName:"Browser Use",displayName_i18n:{"zh-CN":"\u6D4F\u89C8\u5668\u64CD\u4F5C"},icon:`${aR}/browser-use/icon.png`},name:jBn,rootCandidates:["packages/browser-use-plugin","../browser-use-plugin","../../browser-use-plugin","../../../browser-use-plugin"],version:"0.1.2"},{defaultEnabled:!0,listing:{author:iR,category:"productivity",displayName:"Document Skills",displayName_i18n:{"zh-CN":"\u6587\u6863\u6280\u80FD"},icon:`${aR}/document-skills/icon.png`,examplePrompts:["Create a formatted Word document from my notes","Extract the tables from this PDF into a spreadsheet"],examplePrompts_i18n:{"zh-CN":["\u628A\u6211\u7684\u7B14\u8BB0\u6574\u7406\u6210\u4E00\u4EFD\u6392\u7248\u597D\u7684 Word \u6587\u6863","\u628A\u8FD9\u4EFD PDF \u91CC\u7684\u8868\u683C\u63D0\u53D6\u6210\u7535\u5B50\u8868\u683C"]}},name:"document-skills",rootCandidates:["packages/document-skills-plugin","../document-skills-plugin","../../document-skills-plugin","../../../document-skills-plugin"],version:"0.1.0"},{listing:{author:iR,category:"developer-tools",displayName:"iOS Simulator",displayName_i18n:{"zh-CN":"iOS \u6A21\u62DF\u5668"},icon:`${aR}/ios-simulator/icon.png`},name:"ios-simulator",rootCandidates:["packages/ios-simulator-plugin","../ios-simulator-plugin","../../ios-simulator-plugin","../../../ios-simulator-plugin"],version:"0.1.0"},{listing:{author:iR,category:"utilities",displayName:"Restore Legacy Sessions",displayName_i18n:{"zh-CN":"\u6062\u590D\u65E7\u7248\u4F1A\u8BDD"},icon:`${aR}/restore-legacy-sessions/icon.png`},name:"restore-legacy-sessions",rootCandidates:["packages/restore-legacy-sessions-plugin","../restore-legacy-sessions-plugin","../../restore-legacy-sessions-plugin","../../../restore-legacy-sessions-plugin"],version:"0.1.0"},{defaultEnabled:!0,listing:{author:iR,category:"developer-tools",displayName:"Skill Creator",displayName_i18n:{"zh-CN":"\u6280\u80FD\u521B\u5EFA\u5668"},icon:`${aR}/skill-creator/icon.png`},name:"skill-creator",rootCandidates:["packages/skill-creator-plugin","../skill-creator-plugin","../../skill-creator-plugin","../../../skill-creator-plugin"],version:"0.1.0"},{defaultEnabled:!0,listing:{author:iR,category:"guides",displayName:"ZCode Guide",displayName_i18n:{"zh-CN":"ZCode \u4F7F\u7528\u6307\u5357"},icon:`${aR}/zcode-guide/icon.png`,examplePrompts:["How do I configure MCP servers in ZCode?","Diagnose my current ZCode setup"],examplePrompts_i18n:{"zh-CN":["ZCode \u91CC\u600E\u4E48\u914D\u7F6E MCP \u670D\u52A1\u5668\uFF1F","\u5E2E\u6211\u8BCA\u65AD\u5F53\u524D\u7684 ZCode \u914D\u7F6E"]}},name:"zcode-guide",rootCandidates:["packages/zcode-guide-plugin","../zcode-guide-plugin","../../zcode-guide-plugin","../../../zcode-guide-plugin"],version:"0.1.0"}],T5e=new Set(sR.filter(e=>e.defaultEnabled).map(e=>`${e.name}@${Li}`));s(LBn,"resolveOfficialPluginHostMcpServerNames")});function qBn(e){let t=ZBn();if(t)return{args:[...t,(0,uB.join)(e.rootPath,...FBn)],command:process.execPath,cwd:e.cwd,env:{...e.env,ELECTRON_RUN_AS_NODE:"1"},timeoutMs:e.timeoutMs,type:"stdio"}}function l9t(e){let t=(0,uB.join)(e.rootPath,".zcode-plugin","plugin.json"),r=(0,UBn.readFileSync)(t,"utf8"),o=JSON.parse(r);if(o.mcpServers===void 0)return;let n=BBn(o.mcpServers),i=BBn(n[e.pluginName]),a=ZBn();if(!a)return;let u=VBn(i.env)?i.env:{};i.command=process.execPath,i.args=[...a,(0,uB.join)(e.rootPath,...FBn)],i.env={...u,ELECTRON_RUN_AS_NODE:"1"},n[e.pluginName]=i,o.mcpServers=n;let l=`${JSON.stringify(o,null,2)}
|
|
3220
|
+
`,(0,vAe.getConflictResolutionRecipe)(i,t))}return o}};xAe.MetricStorageRegistry=xUt});var dzn=z(bAe=>{"use strict";Object.defineProperty(bAe,"__esModule",{value:!0});bAe.MultiMetricStorage=void 0;var bUt=class{static{s(this,"MultiMetricStorage")}_backingStorages;constructor(t){this._backingStorages=t}record(t,r,o,n){this._backingStorages.forEach(i=>{i.record(t,r,o,n)})}};bAe.MultiMetricStorage=bUt});var mzn=z(WL=>{"use strict";Object.defineProperty(WL,"__esModule",{value:!0});WL.BatchObservableResultImpl=WL.ObservableResultImpl=void 0;var GL=(fn(),Mr(co)),pzn=Iee(),Via=pAe(),wUt=class{static{s(this,"ObservableResultImpl")}_buffer=new pzn.AttributeHashMap;_instrumentName;_valueType;constructor(t,r){this._instrumentName=t,this._valueType=r}observe(t,r={}){if(typeof t!="number"){GL.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${t}`);return}this._valueType===GL.ValueType.INT&&!Number.isInteger(t)&&(GL.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._buffer.set(r,t)}};WL.ObservableResultImpl=wUt;var kUt=class{static{s(this,"BatchObservableResultImpl")}_buffer=new Map;observe(t,r,o={}){if(!(0,Via.isObservableInstrument)(t))return;let n=this._buffer.get(t);if(n==null&&(n=new pzn.AttributeHashMap,this._buffer.set(t,n)),typeof r!="number"){GL.diag.warn(`non-number value provided to metric ${t._descriptor.name}: ${r}`);return}t._descriptor.valueType===GL.ValueType.INT&&!Number.isInteger(r)&&(GL.diag.warn(`INT value type cannot accept a floating-point value for ${t._descriptor.name}, ignoring the fractional digits.`),r=Math.trunc(r),!Number.isInteger(r))||n.set(o,r)}};WL.BatchObservableResultImpl=kUt});var gzn=z(wAe=>{"use strict";Object.defineProperty(wAe,"__esModule",{value:!0});wAe.ObservableRegistry=void 0;var Gia=(fn(),Mr(co)),fzn=pAe(),hzn=mzn(),SUt=lx(),IUt=class{static{s(this,"ObservableRegistry")}_callbacks=[];_batchCallbacks=[];addCallback(t,r){this._findCallback(t,r)>=0||this._callbacks.push({callback:t,instrument:r})}removeCallback(t,r){let o=this._findCallback(t,r);o<0||this._callbacks.splice(o,1)}addBatchCallback(t,r){let o=new Set(r.filter(fzn.isObservableInstrument));if(o.size===0){Gia.diag.error("BatchObservableCallback is not associated with valid instruments",r);return}this._findBatchCallback(t,o)>=0||this._batchCallbacks.push({callback:t,instruments:o})}removeBatchCallback(t,r){let o=new Set(r.filter(fzn.isObservableInstrument)),n=this._findBatchCallback(t,o);n<0||this._batchCallbacks.splice(n,1)}async observe(t,r){let o=this._observeCallbacks(t,r),n=this._observeBatchCallbacks(t,r);return(await Promise.allSettled([...o,...n])).filter(u=>u.status==="rejected").map(u=>u.reason)}_observeCallbacks(t,r){return this._callbacks.map(async({callback:o,instrument:n})=>{let i=new hzn.ObservableResultImpl(n._descriptor.name,n._descriptor.valueType),a=Promise.resolve(o(i));r!=null&&(a=(0,SUt.callWithTimeout)(a,r)),await a,n._metricStorages.forEach(u=>{u.record(i._buffer,t)})})}_observeBatchCallbacks(t,r){return this._batchCallbacks.map(async({callback:o,instruments:n})=>{let i=new hzn.BatchObservableResultImpl,a=Promise.resolve(o(i));r!=null&&(a=(0,SUt.callWithTimeout)(a,r)),await a,n.forEach(u=>{let l=i._buffer.get(u);l!=null&&u._metricStorages.forEach(c=>{c.record(l,t)})})})}_findCallback(t,r){return this._callbacks.findIndex(o=>o.callback===t&&o.instrument===r)}_findBatchCallback(t,r){return this._batchCallbacks.findIndex(o=>o.callback===t&&(0,SUt.setEquals)(o.instruments,r))}};wAe.ObservableRegistry=IUt});var _zn=z(kAe=>{"use strict";Object.defineProperty(kAe,"__esModule",{value:!0});kAe.SyncMetricStorage=void 0;var Wia=pUt(),Hia=gUt(),Kia=yUt(),TUt=class extends Wia.MetricStorage{static{s(this,"SyncMetricStorage")}_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(t,r,o,n,i){super(t),this._aggregationCardinalityLimit=i,this._deltaMetricStorage=new Hia.DeltaMetricProcessor(r,this._aggregationCardinalityLimit),this._temporalMetricStorage=new Kia.TemporalMetricProcessor(r,n),this._attributesProcessor=o}record(t,r,o,n){r=this._attributesProcessor.process(r,o),this._deltaMetricStorage.record(t,r,o,n)}collect(t,r){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(t,this._instrumentDescriptor,o,r)}};kAe.SyncMetricStorage=TUt});var SAe=z(hx=>{"use strict";Object.defineProperty(hx,"__esModule",{value:!0});hx.createDenyListAttributesProcessor=hx.createAllowListAttributesProcessor=hx.createMultiAttributesProcessor=hx.createNoopAttributesProcessor=void 0;var EUt=class{static{s(this,"NoopAttributesProcessor")}process(t,r){return t}},CUt=class{static{s(this,"MultiAttributesProcessor")}_processors;constructor(t){this._processors=t}process(t,r){let o=t;for(let n of this._processors)o=n.process(o,r);return o}},AUt=class{static{s(this,"AllowListProcessor")}_allowedAttributeNames;constructor(t){this._allowedAttributeNames=t}process(t,r){let o={};return Object.keys(t).forEach(n=>{this._allowedAttributeNames.includes(n)&&(o[n]=t[n])}),o}},PUt=class{static{s(this,"DenyListProcessor")}_deniedAttributeNames;constructor(t){this._deniedAttributeNames=t}process(t,r){let o={};return Object.keys(t).forEach(n=>{this._deniedAttributeNames.includes(n)||(o[n]=t[n])}),o}};function Jia(){return eaa}s(Jia,"createNoopAttributesProcessor");hx.createNoopAttributesProcessor=Jia;function Qia(e){return new CUt(e)}s(Qia,"createMultiAttributesProcessor");hx.createMultiAttributesProcessor=Qia;function Yia(e){return new AUt(e)}s(Yia,"createAllowListAttributesProcessor");hx.createAllowListAttributesProcessor=Yia;function Xia(e){return new PUt(e)}s(Xia,"createDenyListAttributesProcessor");hx.createDenyListAttributesProcessor=Xia;var eaa=new EUt});var yzn=z(IAe=>{"use strict";Object.defineProperty(IAe,"__esModule",{value:!0});IAe.MeterSharedState=void 0;var taa=See(),raa=rzn(),naa=nzn(),oaa=czn(),iaa=dzn(),aaa=gzn(),saa=_zn(),uaa=SAe(),RUt=class{static{s(this,"MeterSharedState")}metricStorageRegistry=new oaa.MetricStorageRegistry;observableRegistry=new aaa.ObservableRegistry;meter;_meterProviderSharedState;_instrumentationScope;constructor(t,r){this.meter=new raa.Meter(this),this._meterProviderSharedState=t,this._instrumentationScope=r}registerMetricStorage(t){let r=this._registerMetricStorage(t,saa.SyncMetricStorage);return r.length===1?r[0]:new iaa.MultiMetricStorage(r)}registerAsyncMetricStorage(t){return this._registerMetricStorage(t,naa.AsyncMetricStorage)}async collect(t,r,o){let n=await this.observableRegistry.observe(r,o?.timeoutMillis),i=this.metricStorageRegistry.getStorages(t);if(i.length===0)return null;let a=[];return i.forEach(u=>{let l=u.collect(t,r);l!=null&&a.push(l)}),a.length===0?{errors:n}:{scopeMetrics:{scope:this._instrumentationScope,metrics:a},errors:n}}_registerMetricStorage(t,r){let n=this._meterProviderSharedState.viewRegistry.findViews(t,this._instrumentationScope).map(i=>{let a=(0,taa.createInstrumentDescriptorWithView)(i,t),u=this.metricStorageRegistry.findOrUpdateCompatibleStorage(a);if(u!=null)return u;let l=i.aggregation.createAggregator(a),c=new r(a,l,i.attributesProcessor,this._meterProviderSharedState.metricCollectors,i.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(n.length===0){let a=this._meterProviderSharedState.selectAggregations(t.type).map(([u,l])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(u,t);if(c!=null)return c;let d=l.createAggregator(t),p=u.selectCardinalityLimit(t.type),m=new r(t,d,(0,uaa.createNoopAttributesProcessor)(),[u],p);return this.metricStorageRegistry.registerForCollector(u,m),m});n=n.concat(a)}return n}};IAe.MeterSharedState=RUt});var vzn=z(TAe=>{"use strict";Object.defineProperty(TAe,"__esModule",{value:!0});TAe.MeterProviderSharedState=void 0;var laa=lx(),caa=XNn(),daa=yzn(),paa=yee(),MUt=class{static{s(this,"MeterProviderSharedState")}viewRegistry=new caa.ViewRegistry;metricCollectors=[];meterSharedStates=new Map;resource;constructor(t){this.resource=t}getMeterSharedState(t){let r=(0,laa.instrumentationScopeId)(t),o=this.meterSharedStates.get(r);return o==null&&(o=new daa.MeterSharedState(this,t),this.meterSharedStates.set(r,o)),o}selectAggregations(t){let r=[];for(let o of this.metricCollectors)r.push([o,(0,paa.toAggregation)(o.selectAggregation(t))]);return r}};TAe.MeterProviderSharedState=MUt});var xzn=z(EAe=>{"use strict";Object.defineProperty(EAe,"__esModule",{value:!0});EAe.MetricCollector=void 0;var maa=ps(),$Ut=class{static{s(this,"MetricCollector")}_sharedState;_metricReader;constructor(t,r){this._sharedState=t,this._metricReader=r}async collect(t){let r=(0,maa.millisToHrTime)(Date.now()),o=[],n=[],i=Array.from(this._sharedState.meterSharedStates.values()).map(async a=>{let u=await a.collect(this,r,t);u?.scopeMetrics!=null&&o.push(u.scopeMetrics),u?.errors!=null&&n.push(...u.errors)});return await Promise.all(i),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:n}}async forceFlush(t){await this._metricReader.forceFlush(t)}async shutdown(t){await this._metricReader.shutdown(t)}selectAggregationTemporality(t){return this._metricReader.selectAggregationTemporality(t)}selectAggregation(t){return this._metricReader.selectAggregation(t)}selectCardinalityLimit(t){return this._metricReader.selectCardinalityLimit?.(t)??2e3}};EAe.MetricCollector=$Ut});var CAe=z(HL=>{"use strict";Object.defineProperty(HL,"__esModule",{value:!0});HL.ExactPredicate=HL.PatternPredicate=void 0;var faa=/[\^$\\.+?()[\]{}|]/g,OUt=class e{static{s(this,"PatternPredicate")}_matchAll;_regexp;constructor(t){t==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(e.escapePattern(t)))}match(t){return this._matchAll?!0:this._regexp.test(t)}static escapePattern(t){return`^${t.replace(faa,"\\$&").replace("*",".*")}$`}static hasWildcard(t){return t.includes("*")}};HL.PatternPredicate=OUt;var DUt=class{static{s(this,"ExactPredicate")}_matchAll;_pattern;constructor(t){this._matchAll=t===void 0,this._pattern=t}match(t){return!!(this._matchAll||t===this._pattern)}};HL.ExactPredicate=DUt});var wzn=z(AAe=>{"use strict";Object.defineProperty(AAe,"__esModule",{value:!0});AAe.InstrumentSelector=void 0;var bzn=CAe(),NUt=class{static{s(this,"InstrumentSelector")}_nameFilter;_type;_unitFilter;constructor(t){this._nameFilter=new bzn.PatternPredicate(t?.name??"*"),this._type=t?.type,this._unitFilter=new bzn.ExactPredicate(t?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};AAe.InstrumentSelector=NUt});var kzn=z(PAe=>{"use strict";Object.defineProperty(PAe,"__esModule",{value:!0});PAe.MeterSelector=void 0;var zUt=CAe(),jUt=class{static{s(this,"MeterSelector")}_nameFilter;_versionFilter;_schemaUrlFilter;constructor(t){this._nameFilter=new zUt.ExactPredicate(t?.name),this._versionFilter=new zUt.ExactPredicate(t?.version),this._schemaUrlFilter=new zUt.ExactPredicate(t?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};PAe.MeterSelector=jUt});var Tzn=z(RAe=>{"use strict";Object.defineProperty(RAe,"__esModule",{value:!0});RAe.View=void 0;var haa=CAe(),Szn=SAe(),gaa=wzn(),_aa=kzn(),Izn=yee();function yaa(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}s(yaa,"isSelectorNotProvided");function vaa(e){if(yaa(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||haa.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.")}s(vaa,"validateViewOptions");var LUt=class{static{s(this,"View")}name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(t){vaa(t),t.attributesProcessors!=null?this.attributesProcessor=(0,Szn.createMultiAttributesProcessor)(t.attributesProcessors):this.attributesProcessor=(0,Szn.createNoopAttributesProcessor)(),this.name=t.name,this.description=t.description,this.aggregation=(0,Izn.toAggregation)(t.aggregation??{type:Izn.AggregationType.DEFAULT}),this.instrumentSelector=new gaa.InstrumentSelector({name:t.instrumentName,type:t.instrumentType,unit:t.instrumentUnit}),this.meterSelector=new _aa.MeterSelector({name:t.meterName,version:t.meterVersion,schemaUrl:t.meterSchemaUrl}),this.aggregationCardinalityLimit=t.aggregationCardinalityLimit}};RAe.View=LUt});var Ezn=z($Ae=>{"use strict";Object.defineProperty($Ae,"__esModule",{value:!0});$Ae.MeterProvider=void 0;var MAe=(fn(),Mr(co)),xaa=cAe(),baa=vzn(),waa=xzn(),kaa=Tzn(),BUt=class{static{s(this,"MeterProvider")}_sharedState;_shutdown=!1;constructor(t){if(this._sharedState=new baa.MeterProviderSharedState(t?.resource??(0,xaa.defaultResource)()),t?.views!=null&&t.views.length>0)for(let r of t.views)this._sharedState.viewRegistry.addView(new kaa.View(r));if(t?.readers!=null&&t.readers.length>0)for(let r of t.readers){let o=new waa.MetricCollector(this._sharedState,r);r.setMetricProducer(o),this._sharedState.metricCollectors.push(o)}}getMeter(t,r="",o={}){return this._shutdown?(MAe.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,MAe.createNoopMeter)()):this._sharedState.getMeterSharedState({name:t,version:r,schemaUrl:o.schemaUrl}).meter}async shutdown(t){if(this._shutdown){MAe.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(r=>r.shutdown(t)))}async forceFlush(t){if(this._shutdown){MAe.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(r=>r.forceFlush(t)))}};$Ae.MeterProvider=BUt});var OAe=z(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.TimeoutError=Qa.createDenyListAttributesProcessor=Qa.createAllowListAttributesProcessor=Qa.AggregationType=Qa.MeterProvider=Qa.ConsoleMetricExporter=Qa.InMemoryMetricExporter=Qa.PeriodicExportingMetricReader=Qa.MetricReader=Qa.InstrumentType=Qa.DataPointType=Qa.AggregationTemporality=void 0;var Saa=b4e();Object.defineProperty(Qa,"AggregationTemporality",{enumerable:!0,get:s(function(){return Saa.AggregationTemporality},"get")});var Czn=uE();Object.defineProperty(Qa,"DataPointType",{enumerable:!0,get:s(function(){return Czn.DataPointType},"get")});Object.defineProperty(Qa,"InstrumentType",{enumerable:!0,get:s(function(){return Czn.InstrumentType},"get")});var Iaa=LBt();Object.defineProperty(Qa,"MetricReader",{enumerable:!0,get:s(function(){return Iaa.MetricReader},"get")});var Taa=kNn();Object.defineProperty(Qa,"PeriodicExportingMetricReader",{enumerable:!0,get:s(function(){return Taa.PeriodicExportingMetricReader},"get")});var Eaa=INn();Object.defineProperty(Qa,"InMemoryMetricExporter",{enumerable:!0,get:s(function(){return Eaa.InMemoryMetricExporter},"get")});var Caa=ENn();Object.defineProperty(Qa,"ConsoleMetricExporter",{enumerable:!0,get:s(function(){return Caa.ConsoleMetricExporter},"get")});var Aaa=Ezn();Object.defineProperty(Qa,"MeterProvider",{enumerable:!0,get:s(function(){return Aaa.MeterProvider},"get")});var Paa=yee();Object.defineProperty(Qa,"AggregationType",{enumerable:!0,get:s(function(){return Paa.AggregationType},"get")});var Azn=SAe();Object.defineProperty(Qa,"createAllowListAttributesProcessor",{enumerable:!0,get:s(function(){return Azn.createAllowListAttributesProcessor},"get")});Object.defineProperty(Qa,"createDenyListAttributesProcessor",{enumerable:!0,get:s(function(){return Azn.createDenyListAttributesProcessor},"get")});var Raa=lx();Object.defineProperty(Qa,"TimeoutError",{enumerable:!0,get:s(function(){return Raa.TimeoutError},"get")})});var UUt=z(Tee=>{"use strict";Object.defineProperty(Tee,"__esModule",{value:!0});Tee.AggregationTemporalityPreference=void 0;var Maa;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE",e[e.LOWMEMORY=2]="LOWMEMORY"})(Maa=Tee.AggregationTemporalityPreference||(Tee.AggregationTemporalityPreference={}))});var DAe,Pzn=b(()=>{DAe=class{static{s(this,"OTLPExporterBase")}_delegate;constructor(t){this._delegate=t}export(t,r){this._delegate.export(t,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}});var g1,NAe=b(()=>{g1=class extends Error{static{s(this,"OTLPExporterError")}code;name="OTLPExporterError";data;constructor(t,r,o){super(t),this.data=o,this.code=r}}});function $aa(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function zAe(e){if(e!=null)return async()=>e}function jAe(e,t,r){return{timeoutMillis:$aa(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}function LAe(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var Eee=b(()=>{s($aa,"validateTimeoutMillis");s(zAe,"wrapStaticHeadersInFunction");s(jAe,"mergeOtlpSharedConfigurationWithDefaults");s(LAe,"getSharedConfigurationDefaults")});var J5,Rzn=b(()=>{(function(e){e.NONE="none",e.GZIP="gzip"})(J5||(J5={}))});function BAe(e){return new FUt(e.concurrencyLimit)}var FUt,qUt=b(()=>{FUt=class{static{s(this,"BoundedQueueExportPromiseHandler")}_concurrencyLimit;_sendingPromises=[];constructor(t){this._concurrencyLimit=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(t);let r=s(()=>{let o=this._sendingPromises.indexOf(t);this._sendingPromises.splice(o,1)},"popPromise");t.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};s(BAe,"createBoundedQueueExportPromiseHandler")});function Oaa(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function Mzn(){return{handleResponse(e){e==null||!Oaa(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||ns.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}var $zn=b(()=>{fn();s(Oaa,"isPartialSuccessResponse");s(Mzn,"createLoggingPartialSuccessResponseHandler")});function UAe(e,t){return new ZUt(e.transport,e.serializer,Mzn(),e.promiseHandler,t.timeout)}var cE,ZUt,VUt=b(()=>{cE=ht(ps());NAe();$zn();fn();ZUt=class{static{s(this,"OTLPExportDelegate")}_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(t,r,o,n,i){this._transport=t,this._serializer=r,this._responseHandler=o,this._promiseQueue=n,this._timeout=i,this._diagLogger=ns.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,r){if(this._diagLogger.debug("items to be sent",t),this._promiseQueue.hasReachedLimit()){r({code:cE.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}let o=this._serializer.serializeRequest(t);if(o==null){r({code:cE.ExportResultCode.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(o,this._timeout).then(n=>{if(n.status==="success"){if(n.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(n.data))}catch(i){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,n.data)}r({code:cE.ExportResultCode.SUCCESS});return}else if(n.status==="failure"&&n.error){r({code:cE.ExportResultCode.FAILED,error:n.error});return}else n.status==="retryable"?r({code:cE.ExportResultCode.FAILED,error:n.error??new g1("Export failed with retryable status")}):r({code:cE.ExportResultCode.FAILED,error:new g1("Export failed with unknown error")})},n=>r({code:cE.ExportResultCode.FAILED,error:n})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}};s(UAe,"createOtlpExportDelegate")});function Ozn(e,t,r){return UAe({transport:r,serializer:t,promiseHandler:BAe(e)},{timeout:e.timeoutMillis})}var Dzn=b(()=>{qUt();VUt();s(Ozn,"createOtlpNetworkExportDelegate")});var GUt={};mr(GUt,{CompressionAlgorithm:()=>J5,OTLPExporterBase:()=>DAe,OTLPExporterError:()=>g1,createOtlpNetworkExportDelegate:()=>Ozn,getSharedConfigurationDefaults:()=>LAe,mergeOtlpSharedConfigurationWithDefaults:()=>jAe});var FAe=b(()=>{Pzn();NAe();Eee();Rzn();Dzn()});var HUt=z(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.OTLPMetricExporterBase=_c.LowMemoryTemporalitySelector=_c.DeltaTemporalitySelector=_c.CumulativeTemporalitySelector=void 0;var Daa=ps(),Fu=OAe(),Nzn=UUt(),Naa=(FAe(),Mr(GUt)),zaa=(fn(),Mr(co)),jaa=s(()=>Fu.AggregationTemporality.CUMULATIVE,"CumulativeTemporalitySelector");_c.CumulativeTemporalitySelector=jaa;var Laa=s(e=>{switch(e){case Fu.InstrumentType.COUNTER:case Fu.InstrumentType.OBSERVABLE_COUNTER:case Fu.InstrumentType.GAUGE:case Fu.InstrumentType.HISTOGRAM:case Fu.InstrumentType.OBSERVABLE_GAUGE:return Fu.AggregationTemporality.DELTA;case Fu.InstrumentType.UP_DOWN_COUNTER:case Fu.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return Fu.AggregationTemporality.CUMULATIVE}},"DeltaTemporalitySelector");_c.DeltaTemporalitySelector=Laa;var Baa=s(e=>{switch(e){case Fu.InstrumentType.COUNTER:case Fu.InstrumentType.HISTOGRAM:return Fu.AggregationTemporality.DELTA;case Fu.InstrumentType.GAUGE:case Fu.InstrumentType.UP_DOWN_COUNTER:case Fu.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:case Fu.InstrumentType.OBSERVABLE_COUNTER:case Fu.InstrumentType.OBSERVABLE_GAUGE:return Fu.AggregationTemporality.CUMULATIVE}},"LowMemoryTemporalitySelector");_c.LowMemoryTemporalitySelector=Baa;function Uaa(){let e=((0,Daa.getStringFromEnv)("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE")??"cumulative").toLowerCase();return e==="cumulative"?_c.CumulativeTemporalitySelector:e==="delta"?_c.DeltaTemporalitySelector:e==="lowmemory"?_c.LowMemoryTemporalitySelector:(zaa.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${e}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),_c.CumulativeTemporalitySelector)}s(Uaa,"chooseTemporalitySelectorFromEnvironment");function Faa(e){return e!=null?e===Nzn.AggregationTemporalityPreference.DELTA?_c.DeltaTemporalitySelector:e===Nzn.AggregationTemporalityPreference.LOWMEMORY?_c.LowMemoryTemporalitySelector:_c.CumulativeTemporalitySelector:Uaa()}s(Faa,"chooseTemporalitySelector");var qaa=Object.freeze({type:Fu.AggregationType.DEFAULT});function Zaa(e){return e?.aggregationPreference??(()=>qaa)}s(Zaa,"chooseAggregationSelector");var WUt=class extends Naa.OTLPExporterBase{static{s(this,"OTLPMetricExporterBase")}_aggregationTemporalitySelector;_aggregationSelector;constructor(t,r){super(t),this._aggregationSelector=Zaa(r),this._aggregationTemporalitySelector=Faa(r?.temporalityPreference)}selectAggregation(t){return this._aggregationSelector(t)}selectAggregationTemporality(t){return this._aggregationTemporalitySelector(t)}};_c.OTLPMetricExporterBase=WUt});var jzn=z((RDu,zzn)=>{"use strict";zzn.exports=Vaa;function Vaa(e,t){for(var r=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)r[o++]=arguments[n++];return new Promise(s(function(u,l){r[o]=s(function(d){if(i)if(i=!1,d)l(d);else{for(var p=new Array(arguments.length-1),m=0;m<p.length;)p[m++]=arguments[m];u.apply(null,p)}},"callback");try{e.apply(t||null,r)}catch(c){i&&(i=!1,l(c))}},"executor"))}s(Vaa,"asPromise")});var Fzn=z(Uzn=>{"use strict";var qAe=Uzn;qAe.length=s(function(t){var r=t.length;if(!r)return 0;for(var o=0;--r%4>1&&t.charAt(r)==="=";)++o;return Math.ceil(t.length*3)/4-o},"length");var KL=new Array(64),Bzn=new Array(123);for(py=0;py<64;)Bzn[KL[py]=py<26?py+65:py<52?py+71:py<62?py-4:py-59|43]=py++;var py;qAe.encode=s(function(t,r,o){for(var n=null,i=[],a=0,u=0,l;r<o;){var c=t[r++];switch(u){case 0:i[a++]=KL[c>>2],l=(c&3)<<4,u=1;break;case 1:i[a++]=KL[l|c>>4],l=(c&15)<<2,u=2;break;case 2:i[a++]=KL[l|c>>6],i[a++]=KL[c&63],u=0;break}a>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),a=0)}return u&&(i[a++]=KL[l],i[a++]=61,u===1&&(i[a++]=61)),n?(a&&n.push(String.fromCharCode.apply(String,i.slice(0,a))),n.join("")):String.fromCharCode.apply(String,i.slice(0,a))},"encode");var Lzn="invalid encoding";qAe.decode=s(function(t,r,o){for(var n=o,i=0,a,u=0;u<t.length;){var l=t.charCodeAt(u++);if(l===61&&i>1)break;if((l=Bzn[l])===void 0)throw Error(Lzn);switch(i){case 0:a=l,i=1;break;case 1:r[o++]=a<<2|(l&48)>>4,a=l,i=2;break;case 2:r[o++]=(a&15)<<4|(l&60)>>2,a=l,i=3;break;case 3:r[o++]=(a&3)<<6|l,i=0;break}}if(i===1)throw Error(Lzn);return o-n},"decode");qAe.test=s(function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)},"test")});var Zzn=z((DDu,qzn)=>{"use strict";qzn.exports=ZAe;function ZAe(){this._listeners={}}s(ZAe,"EventEmitter");ZAe.prototype.on=s(function(t,r,o){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:r,ctx:o||this}),this},"on");ZAe.prototype.off=s(function(t,r){if(t===void 0)this._listeners={};else if(r===void 0)this._listeners[t]=[];else for(var o=this._listeners[t],n=0;n<o.length;)o[n].fn===r?o.splice(n,1):++n;return this},"off");ZAe.prototype.emit=s(function(t){var r=this._listeners[t];if(r){for(var o=[],n=1;n<arguments.length;)o.push(arguments[n++]);for(n=0;n<r.length;)r[n].fn.apply(r[n++].ctx,o)}return this},"emit")});var Qzn=z((zDu,Jzn)=>{"use strict";Jzn.exports=Vzn(Vzn);function Vzn(e){return typeof Float32Array<"u"?(function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),o=r[3]===128;function n(l,c,d){t[0]=l,c[d]=r[0],c[d+1]=r[1],c[d+2]=r[2],c[d+3]=r[3]}s(n,"writeFloat_f32_cpy");function i(l,c,d){t[0]=l,c[d]=r[3],c[d+1]=r[2],c[d+2]=r[1],c[d+3]=r[0]}s(i,"writeFloat_f32_rev"),e.writeFloatLE=o?n:i,e.writeFloatBE=o?i:n;function a(l,c){return r[0]=l[c],r[1]=l[c+1],r[2]=l[c+2],r[3]=l[c+3],t[0]}s(a,"readFloat_f32_cpy");function u(l,c){return r[3]=l[c],r[2]=l[c+1],r[1]=l[c+2],r[0]=l[c+3],t[0]}s(u,"readFloat_f32_rev"),e.readFloatLE=o?a:u,e.readFloatBE=o?u:a})():(function(){function t(o,n,i,a){var u=n<0?1:0;if(u&&(n=-n),n===0)o(1/n>0?0:2147483648,i,a);else if(isNaN(n))o(2143289344,i,a);else if(n>34028234663852886e22)o((u<<31|2139095040)>>>0,i,a);else if(n<11754943508222875e-54)o((u<<31|Math.round(n/1401298464324817e-60))>>>0,i,a);else{var l=Math.floor(Math.log(n)/Math.LN2),c=Math.round(n*Math.pow(2,-l)*8388608)&8388607;o((u<<31|l+127<<23|c)>>>0,i,a)}}s(t,"writeFloat_ieee754"),e.writeFloatLE=t.bind(null,Gzn),e.writeFloatBE=t.bind(null,Wzn);function r(o,n,i){var a=o(n,i),u=(a>>31)*2+1,l=a>>>23&255,c=a&8388607;return l===255?c?NaN:u*(1/0):l===0?u*1401298464324817e-60*c:u*Math.pow(2,l-150)*(c+8388608)}s(r,"readFloat_ieee754"),e.readFloatLE=r.bind(null,Hzn),e.readFloatBE=r.bind(null,Kzn)})(),typeof Float64Array<"u"?(function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),o=r[7]===128;function n(l,c,d){t[0]=l,c[d]=r[0],c[d+1]=r[1],c[d+2]=r[2],c[d+3]=r[3],c[d+4]=r[4],c[d+5]=r[5],c[d+6]=r[6],c[d+7]=r[7]}s(n,"writeDouble_f64_cpy");function i(l,c,d){t[0]=l,c[d]=r[7],c[d+1]=r[6],c[d+2]=r[5],c[d+3]=r[4],c[d+4]=r[3],c[d+5]=r[2],c[d+6]=r[1],c[d+7]=r[0]}s(i,"writeDouble_f64_rev"),e.writeDoubleLE=o?n:i,e.writeDoubleBE=o?i:n;function a(l,c){return r[0]=l[c],r[1]=l[c+1],r[2]=l[c+2],r[3]=l[c+3],r[4]=l[c+4],r[5]=l[c+5],r[6]=l[c+6],r[7]=l[c+7],t[0]}s(a,"readDouble_f64_cpy");function u(l,c){return r[7]=l[c],r[6]=l[c+1],r[5]=l[c+2],r[4]=l[c+3],r[3]=l[c+4],r[2]=l[c+5],r[1]=l[c+6],r[0]=l[c+7],t[0]}s(u,"readDouble_f64_rev"),e.readDoubleLE=o?a:u,e.readDoubleBE=o?u:a})():(function(){function t(o,n,i,a,u,l){var c=a<0?1:0;if(c&&(a=-a),a===0)o(0,u,l+n),o(1/a>0?0:2147483648,u,l+i);else if(isNaN(a))o(0,u,l+n),o(2146959360,u,l+i);else if(a>17976931348623157e292)o(0,u,l+n),o((c<<31|2146435072)>>>0,u,l+i);else{var d;if(a<22250738585072014e-324)d=a/5e-324,o(d>>>0,u,l+n),o((c<<31|d/4294967296)>>>0,u,l+i);else{var p=Math.floor(Math.log(a)/Math.LN2);p===1024&&(p=1023),d=a*Math.pow(2,-p),o(d*4503599627370496>>>0,u,l+n),o((c<<31|p+1023<<20|d*1048576&1048575)>>>0,u,l+i)}}}s(t,"writeDouble_ieee754"),e.writeDoubleLE=t.bind(null,Gzn,0,4),e.writeDoubleBE=t.bind(null,Wzn,4,0);function r(o,n,i,a,u){var l=o(a,u+n),c=o(a,u+i),d=(c>>31)*2+1,p=c>>>20&2047,m=4294967296*(c&1048575)+l;return p===2047?m?NaN:d*(1/0):p===0?d*5e-324*m:d*Math.pow(2,p-1075)*(m+4503599627370496)}s(r,"readDouble_ieee754"),e.readDoubleLE=r.bind(null,Hzn,0,4),e.readDoubleBE=r.bind(null,Kzn,4,0)})(),e}s(Vzn,"factory");function Gzn(e,t,r){t[r]=e&255,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}s(Gzn,"writeUintLE");function Wzn(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=e&255}s(Wzn,"writeUintBE");function Hzn(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}s(Hzn,"readUintLE");function Kzn(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}s(Kzn,"readUintBE")});var Yzn=z((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(e){}return null}s(inquire,"inquire")});var e8n=z(Xzn=>{"use strict";var KUt=Xzn;KUt.length=s(function(t){for(var r=0,o=0,n=0;n<t.length;++n)o=t.charCodeAt(n),o<128?r+=1:o<2048?r+=2:(o&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,r+=4):r+=3;return r},"utf8_length");KUt.read=s(function(t,r,o){var n=o-r;if(n<1)return"";for(var i=null,a=[],u=0,l;r<o;)l=t[r++],l<128?a[u++]=l:l>191&&l<224?a[u++]=(l&31)<<6|t[r++]&63:l>239&&l<365?(l=((l&7)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,a[u++]=55296+(l>>10),a[u++]=56320+(l&1023)):a[u++]=(l&15)<<12|(t[r++]&63)<<6|t[r++]&63,u>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),u=0);return i?(u&&i.push(String.fromCharCode.apply(String,a.slice(0,u))),i.join("")):String.fromCharCode.apply(String,a.slice(0,u))},"utf8_read");KUt.write=s(function(t,r,o){for(var n=o,i,a,u=0;u<t.length;++u)i=t.charCodeAt(u),i<128?r[o++]=i:i<2048?(r[o++]=i>>6|192,r[o++]=i&63|128):(i&64512)===55296&&((a=t.charCodeAt(u+1))&64512)===56320?(i=65536+((i&1023)<<10)+(a&1023),++u,r[o++]=i>>18|240,r[o++]=i>>12&63|128,r[o++]=i>>6&63|128,r[o++]=i&63|128):(r[o++]=i>>12|224,r[o++]=i>>6&63|128,r[o++]=i&63|128);return o-n},"utf8_write")});var r8n=z((FDu,t8n)=>{"use strict";t8n.exports=Gaa;function Gaa(e,t,r){var o=r||8192,n=o>>>1,i=null,a=o;return s(function(l){if(l<1||l>n)return e(l);a+l>o&&(i=e(o),a=0);var c=t.call(i,a,a+=l);return a&7&&(a=(a|7)+1),c},"pool_alloc")}s(Gaa,"pool")});var o8n=z((ZDu,n8n)=>{"use strict";n8n.exports=zl;var Cee=pE();function zl(e,t){this.lo=e>>>0,this.hi=t>>>0}s(zl,"LongBits");var Q5=zl.zero=new zl(0,0);Q5.toNumber=function(){return 0};Q5.zzEncode=Q5.zzDecode=function(){return this};Q5.length=function(){return 1};var Waa=zl.zeroHash="\0\0\0\0\0\0\0\0";zl.fromNumber=s(function(t){if(t===0)return Q5;var r=t<0;r&&(t=-t);var o=t>>>0,n=(t-o)/4294967296>>>0;return r&&(n=~n>>>0,o=~o>>>0,++o>4294967295&&(o=0,++n>4294967295&&(n=0))),new zl(o,n)},"fromNumber");zl.from=s(function(t){if(typeof t=="number")return zl.fromNumber(t);if(Cee.isString(t))if(Cee.Long)t=Cee.Long.fromString(t);else return zl.fromNumber(parseInt(t,10));return t.low||t.high?new zl(t.low>>>0,t.high>>>0):Q5},"from");zl.prototype.toNumber=s(function(t){if(!t&&this.hi>>>31){var r=~this.lo+1>>>0,o=~this.hi>>>0;return r||(o=o+1>>>0),-(r+o*4294967296)}return this.lo+this.hi*4294967296},"toNumber");zl.prototype.toLong=s(function(t){return Cee.Long?new Cee.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}},"toLong");var dE=String.prototype.charCodeAt;zl.fromHash=s(function(t){return t===Waa?Q5:new zl((dE.call(t,0)|dE.call(t,1)<<8|dE.call(t,2)<<16|dE.call(t,3)<<24)>>>0,(dE.call(t,4)|dE.call(t,5)<<8|dE.call(t,6)<<16|dE.call(t,7)<<24)>>>0)},"fromHash");zl.prototype.toHash=s(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)},"toHash");zl.prototype.zzEncode=s(function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},"zzEncode");zl.prototype.zzDecode=s(function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},"zzDecode");zl.prototype.length=s(function(){var t=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?r===0?t<16384?t<128?1:2:t<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:o<128?9:10},"length")});var pE=z(JUt=>{"use strict";var dn=JUt;dn.asPromise=jzn();dn.base64=Fzn();dn.EventEmitter=Zzn();dn.float=Qzn();dn.inquire=Yzn();dn.utf8=e8n();dn.pool=r8n();dn.LongBits=o8n();dn.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);dn.global=dn.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||JUt;dn.emptyArray=Object.freeze?Object.freeze([]):[];dn.emptyObject=Object.freeze?Object.freeze({}):{};dn.isInteger=Number.isInteger||s(function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t},"isInteger");dn.isString=s(function(t){return typeof t=="string"||t instanceof String},"isString");dn.isObject=s(function(t){return t&&typeof t=="object"},"isObject");dn.isset=dn.isSet=s(function(t,r){var o=t[r];return o!=null&&t.hasOwnProperty(r)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1},"isSet");dn.Buffer=(function(){try{var e=dn.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch{return null}})();dn._Buffer_from=null;dn._Buffer_allocUnsafe=null;dn.newBuffer=s(function(t){return typeof t=="number"?dn.Buffer?dn._Buffer_allocUnsafe(t):new dn.Array(t):dn.Buffer?dn._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)},"newBuffer");dn.Array=typeof Uint8Array<"u"?Uint8Array:Array;dn.Long=dn.global.dcodeIO&&dn.global.dcodeIO.Long||dn.global.Long||dn.inquire("long");dn.key2Re=/^true|false|0|1$/;dn.key32Re=/^-?(?:0|[1-9][0-9]*)$/;dn.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;dn.longToHash=s(function(t){return t?dn.LongBits.from(t).toHash():dn.LongBits.zeroHash},"longToHash");dn.longFromHash=s(function(t,r){var o=dn.LongBits.fromHash(t);return dn.Long?dn.Long.fromBits(o.lo,o.hi,r):o.toNumber(!!r)},"longFromHash");function i8n(e,t,r){for(var o=Object.keys(t),n=0;n<o.length;++n)(e[o[n]]===void 0||!r)&&(e[o[n]]=t[o[n]]);return e}s(i8n,"merge");dn.merge=i8n;dn.lcFirst=s(function(t){return t.charAt(0).toLowerCase()+t.substring(1)},"lcFirst");function a8n(e){function t(r,o){if(!(this instanceof t))return new t(r,o);Object.defineProperty(this,"message",{get:s(function(){return r},"get")}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&i8n(this,o)}return s(t,"CustomError"),t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:s(function(){return e},"get"),set:void 0,enumerable:!1,configurable:!0},toString:{value:s(function(){return this.name+": "+this.message},"value"),writable:!0,enumerable:!1,configurable:!0}}),t}s(a8n,"newError");dn.newError=a8n;dn.ProtocolError=a8n("ProtocolError");dn.oneOfGetter=s(function(t){for(var r={},o=0;o<t.length;++o)r[t[o]]=1;return function(){for(var n=Object.keys(this),i=n.length-1;i>-1;--i)if(r[n[i]]===1&&this[n[i]]!==void 0&&this[n[i]]!==null)return n[i]}},"getOneOf");dn.oneOfSetter=s(function(t){return function(r){for(var o=0;o<t.length;++o)t[o]!==r&&delete this[t[o]]}},"setOneOf");dn.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};dn._configure=function(){var e=dn.Buffer;if(!e){dn._Buffer_from=dn._Buffer_allocUnsafe=null;return}dn._Buffer_from=e.from!==Uint8Array.from&&e.from||s(function(r,o){return new e(r,o)},"Buffer_from"),dn._Buffer_allocUnsafe=e.allocUnsafe||s(function(r){return new e(r)},"Buffer_allocUnsafe")}});var nFt=z((HDu,c8n)=>{"use strict";c8n.exports=Si;var bg=pE(),QUt,VAe=bg.LongBits,s8n=bg.base64,u8n=bg.utf8;function Aee(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}s(Aee,"Op");function XUt(){}s(XUt,"noop");function Haa(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}s(Haa,"State");function Si(){this.len=0,this.head=new Aee(XUt,0,0),this.tail=this.head,this.states=null}s(Si,"Writer");var l8n=s(function(){return bg.Buffer?s(function(){return(Si.create=s(function(){return new QUt},"create_buffer"))()},"create_buffer_setup"):s(function(){return new Si},"create_array")},"create");Si.create=l8n();Si.alloc=s(function(t){return new bg.Array(t)},"alloc");bg.Array!==Array&&(Si.alloc=bg.pool(Si.alloc,bg.Array.prototype.subarray));Si.prototype._push=s(function(t,r,o){return this.tail=this.tail.next=new Aee(t,r,o),this.len+=r,this},"push");function eFt(e,t,r){t[r]=e&255}s(eFt,"writeByte");function Kaa(e,t,r){for(;e>127;)t[r++]=e&127|128,e>>>=7;t[r]=e}s(Kaa,"writeVarint32");function tFt(e,t){this.len=e,this.next=void 0,this.val=t}s(tFt,"VarintOp");tFt.prototype=Object.create(Aee.prototype);tFt.prototype.fn=Kaa;Si.prototype.uint32=s(function(t){return this.len+=(this.tail=this.tail.next=new tFt((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},"write_uint32");Si.prototype.int32=s(function(t){return t<0?this._push(rFt,10,VAe.fromNumber(t)):this.uint32(t)},"write_int32");Si.prototype.sint32=s(function(t){return this.uint32((t<<1^t>>31)>>>0)},"write_sint32");function rFt(e,t,r){for(;e.hi;)t[r++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=e.lo&127|128,e.lo=e.lo>>>7;t[r++]=e.lo}s(rFt,"writeVarint64");Si.prototype.uint64=s(function(t){var r=VAe.from(t);return this._push(rFt,r.length(),r)},"write_uint64");Si.prototype.int64=Si.prototype.uint64;Si.prototype.sint64=s(function(t){var r=VAe.from(t).zzEncode();return this._push(rFt,r.length(),r)},"write_sint64");Si.prototype.bool=s(function(t){return this._push(eFt,1,t?1:0)},"write_bool");function YUt(e,t,r){t[r]=e&255,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}s(YUt,"writeFixed32");Si.prototype.fixed32=s(function(t){return this._push(YUt,4,t>>>0)},"write_fixed32");Si.prototype.sfixed32=Si.prototype.fixed32;Si.prototype.fixed64=s(function(t){var r=VAe.from(t);return this._push(YUt,4,r.lo)._push(YUt,4,r.hi)},"write_fixed64");Si.prototype.sfixed64=Si.prototype.fixed64;Si.prototype.float=s(function(t){return this._push(bg.float.writeFloatLE,4,t)},"write_float");Si.prototype.double=s(function(t){return this._push(bg.float.writeDoubleLE,8,t)},"write_double");var Jaa=bg.Array.prototype.set?s(function(t,r,o){r.set(t,o)},"writeBytes_set"):s(function(t,r,o){for(var n=0;n<t.length;++n)r[o+n]=t[n]},"writeBytes_for");Si.prototype.bytes=s(function(t){var r=t.length>>>0;if(!r)return this._push(eFt,1,0);if(bg.isString(t)){var o=Si.alloc(r=s8n.length(t));s8n.decode(t,o,0),t=o}return this.uint32(r)._push(Jaa,r,t)},"write_bytes");Si.prototype.string=s(function(t){var r=u8n.length(t);return r?this.uint32(r)._push(u8n.write,r,t):this._push(eFt,1,0)},"write_string");Si.prototype.fork=s(function(){return this.states=new Haa(this),this.head=this.tail=new Aee(XUt,0,0),this.len=0,this},"fork");Si.prototype.reset=s(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 Aee(XUt,0,0),this.len=0),this},"reset");Si.prototype.ldelim=s(function(){var t=this.head,r=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=t.next,this.tail=r,this.len+=o),this},"ldelim");Si.prototype.finish=s(function(){for(var t=this.head.next,r=this.constructor.alloc(this.len),o=0;t;)t.fn(t.val,r,o),o+=t.len,t=t.next;return r},"finish");Si._configure=function(e){QUt=e,Si.create=l8n(),QUt._configure()}});var m8n=z((JDu,p8n)=>{"use strict";p8n.exports=gx;var d8n=nFt();(gx.prototype=Object.create(d8n.prototype)).constructor=gx;var mE=pE();function gx(){d8n.call(this)}s(gx,"BufferWriter");gx._configure=function(){gx.alloc=mE._Buffer_allocUnsafe,gx.writeBytesBuffer=mE.Buffer&&mE.Buffer.prototype instanceof Uint8Array&&mE.Buffer.prototype.set.name==="set"?s(function(t,r,o){r.set(t,o)},"writeBytesBuffer_set"):s(function(t,r,o){if(t.copy)t.copy(r,o,0,t.length);else for(var n=0;n<t.length;)r[o++]=t[n++]},"writeBytesBuffer_copy")};gx.prototype.bytes=s(function(t){mE.isString(t)&&(t=mE._Buffer_from(t,"base64"));var r=t.length>>>0;return this.uint32(r),r&&this._push(gx.writeBytesBuffer,r,t),this},"write_bytes_buffer");function Qaa(e,t,r){e.length<40?mE.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}s(Qaa,"writeStringBuffer");gx.prototype.string=s(function(t){var r=mE.Buffer.byteLength(t);return this.uint32(r),r&&this._push(Qaa,r,t),this},"write_string_buffer");gx._configure()});var aFt=z((YDu,y8n)=>{"use strict";y8n.exports=wu;var my=pE(),iFt,g8n=my.LongBits,Yaa=my.utf8;function fy(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}s(fy,"indexOutOfRange");function wu(e){this.buf=e,this.pos=0,this.len=e.length}s(wu,"Reader");var f8n=typeof Uint8Array<"u"?s(function(t){if(t instanceof Uint8Array||Array.isArray(t))return new wu(t);throw Error("illegal buffer")},"create_typed_array"):s(function(t){if(Array.isArray(t))return new wu(t);throw Error("illegal buffer")},"create_array"),_8n=s(function(){return my.Buffer?s(function(r){return(wu.create=s(function(n){return my.Buffer.isBuffer(n)?new iFt(n):f8n(n)},"create_buffer"))(r)},"create_buffer_setup"):f8n},"create");wu.create=_8n();wu.prototype._slice=my.Array.prototype.subarray||my.Array.prototype.slice;wu.prototype.uint32=s((function(){var t=4294967295;return s(function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,fy(this,10);return t},"read_uint32")}),"read_uint32_setup")();wu.prototype.int32=s(function(){return this.uint32()|0},"read_int32");wu.prototype.sint32=s(function(){var t=this.uint32();return t>>>1^-(t&1)|0},"read_sint32");function oFt(){var e=new g8n(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw fy(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw fy(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}s(oFt,"readLongVarint");wu.prototype.bool=s(function(){return this.uint32()!==0},"read_bool");function GAe(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s(GAe,"readFixed32_end");wu.prototype.fixed32=s(function(){if(this.pos+4>this.len)throw fy(this,4);return GAe(this.buf,this.pos+=4)},"read_fixed32");wu.prototype.sfixed32=s(function(){if(this.pos+4>this.len)throw fy(this,4);return GAe(this.buf,this.pos+=4)|0},"read_sfixed32");function h8n(){if(this.pos+8>this.len)throw fy(this,8);return new g8n(GAe(this.buf,this.pos+=4),GAe(this.buf,this.pos+=4))}s(h8n,"readFixed64");wu.prototype.float=s(function(){if(this.pos+4>this.len)throw fy(this,4);var t=my.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},"read_float");wu.prototype.double=s(function(){if(this.pos+8>this.len)throw fy(this,4);var t=my.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},"read_double");wu.prototype.bytes=s(function(){var t=this.uint32(),r=this.pos,o=this.pos+t;if(o>this.len)throw fy(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(r,o);if(r===o){var n=my.Buffer;return n?n.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,o)},"read_bytes");wu.prototype.string=s(function(){var t=this.bytes();return Yaa.read(t,0,t.length)},"read_string");wu.prototype.skip=s(function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw fy(this,t);this.pos+=t}else do if(this.pos>=this.len)throw fy(this);while(this.buf[this.pos++]&128);return this},"skip");wu.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this};wu._configure=function(e){iFt=e,wu.create=_8n(),iFt._configure();var t=my.Long?"toLong":"toNumber";my.merge(wu.prototype,{int64:s(function(){return oFt.call(this)[t](!1)},"read_int64"),uint64:s(function(){return oFt.call(this)[t](!0)},"read_uint64"),sint64:s(function(){return oFt.call(this).zzDecode()[t](!1)},"read_sint64"),fixed64:s(function(){return h8n.call(this)[t](!0)},"read_fixed64"),sfixed64:s(function(){return h8n.call(this)[t](!1)},"read_sfixed64")})}});var w8n=z((eNu,b8n)=>{"use strict";b8n.exports=Y5;var x8n=aFt();(Y5.prototype=Object.create(x8n.prototype)).constructor=Y5;var v8n=pE();function Y5(e){x8n.call(this,e)}s(Y5,"BufferReader");Y5._configure=function(){v8n.Buffer&&(Y5.prototype._slice=v8n.Buffer.prototype.slice)};Y5.prototype.string=s(function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},"read_string_buffer");Y5._configure()});var S8n=z((rNu,k8n)=>{"use strict";k8n.exports=Pee;var sFt=pE();(Pee.prototype=Object.create(sFt.EventEmitter.prototype)).constructor=Pee;function Pee(e,t,r){if(typeof e!="function")throw TypeError("rpcImpl must be a function");sFt.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}s(Pee,"Service");Pee.prototype.rpcCall=s(function e(t,r,o,n,i){if(!n)throw TypeError("request must be specified");var a=this;if(!i)return sFt.asPromise(e,a,t,r,o,n);if(!a.rpcImpl){setTimeout(function(){i(Error("already ended"))},0);return}try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](n).finish(),s(function(l,c){if(l)return a.emit("error",l,t),i(l);if(c===null){a.end(!0);return}if(!(c instanceof o))try{c=o[a.responseDelimited?"decodeDelimited":"decode"](c)}catch(d){return a.emit("error",d,t),i(d)}return a.emit("data",c,t),i(null,c)},"rpcCallback"))}catch(u){a.emit("error",u,t),setTimeout(function(){i(u)},0);return}},"rpcCall");Pee.prototype.end=s(function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},"end")});var T8n=z(I8n=>{"use strict";var Xaa=I8n;Xaa.Service=S8n()});var C8n=z((iNu,E8n)=>{"use strict";E8n.exports={}});var R8n=z(P8n=>{"use strict";var p0=P8n;p0.build="minimal";p0.Writer=nFt();p0.BufferWriter=m8n();p0.Reader=aFt();p0.BufferReader=w8n();p0.util=pE();p0.rpc=T8n();p0.roots=C8n();p0.configure=A8n;function A8n(){p0.util._configure(),p0.Writer._configure(p0.BufferWriter),p0.Reader._configure(p0.BufferReader)}s(A8n,"configure");A8n()});var $8n=z((uNu,M8n)=>{"use strict";M8n.exports=R8n()});var WAe=z((O8n,D8n)=>{"use strict";Object.defineProperty(O8n,"__esModule",{value:!0});var gn=$8n(),je=gn.Reader,Yn=gn.Writer,X=gn.util,J=gn.roots.default||(gn.roots.default={});J.opentelemetry=(function(){var e={};return e.proto=(function(){var t={};return t.common=(function(){var r={};return r.v1=(function(){var o={};return o.AnyValue=(function(){function n(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"AnyValue"),n.prototype.stringValue=null,n.prototype.boolValue=null,n.prototype.intValue=null,n.prototype.doubleValue=null,n.prototype.arrayValue=null,n.prototype.kvlistValue=null,n.prototype.bytesValue=null;var i;return Object.defineProperty(n.prototype,"value",{get:X.oneOfGetter(i=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){return l||(l=Yn.create()),u.stringValue!=null&&Object.hasOwnProperty.call(u,"stringValue")&&l.uint32(10).string(u.stringValue),u.boolValue!=null&&Object.hasOwnProperty.call(u,"boolValue")&&l.uint32(16).bool(u.boolValue),u.intValue!=null&&Object.hasOwnProperty.call(u,"intValue")&&l.uint32(24).int64(u.intValue),u.doubleValue!=null&&Object.hasOwnProperty.call(u,"doubleValue")&&l.uint32(33).double(u.doubleValue),u.arrayValue!=null&&Object.hasOwnProperty.call(u,"arrayValue")&&J.opentelemetry.proto.common.v1.ArrayValue.encode(u.arrayValue,l.uint32(42).fork()).ldelim(),u.kvlistValue!=null&&Object.hasOwnProperty.call(u,"kvlistValue")&&J.opentelemetry.proto.common.v1.KeyValueList.encode(u.kvlistValue,l.uint32(50).fork()).ldelim(),u.bytesValue!=null&&Object.hasOwnProperty.call(u,"bytesValue")&&l.uint32(58).bytes(u.bytesValue),l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.common.v1.AnyValue;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.stringValue=u.string();break}case 2:{p.boolValue=u.bool();break}case 3:{p.intValue=u.int64();break}case 4:{p.doubleValue=u.double();break}case 5:{p.arrayValue=J.opentelemetry.proto.common.v1.ArrayValue.decode(u,u.uint32());break}case 6:{p.kvlistValue=J.opentelemetry.proto.common.v1.KeyValueList.decode(u,u.uint32());break}case 7:{p.bytesValue=u.bytes();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.stringValue!=null&&u.hasOwnProperty("stringValue")&&(l.value=1,!X.isString(u.stringValue)))return"stringValue: string expected";if(u.boolValue!=null&&u.hasOwnProperty("boolValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof u.boolValue!="boolean")return"boolValue: boolean expected"}if(u.intValue!=null&&u.hasOwnProperty("intValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!X.isInteger(u.intValue)&&!(u.intValue&&X.isInteger(u.intValue.low)&&X.isInteger(u.intValue.high)))return"intValue: integer|Long expected"}if(u.doubleValue!=null&&u.hasOwnProperty("doubleValue")){if(l.value===1)return"value: multiple values";if(l.value=1,typeof u.doubleValue!="number")return"doubleValue: number expected"}if(u.arrayValue!=null&&u.hasOwnProperty("arrayValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=J.opentelemetry.proto.common.v1.ArrayValue.verify(u.arrayValue);if(c)return"arrayValue."+c}}if(u.kvlistValue!=null&&u.hasOwnProperty("kvlistValue")){if(l.value===1)return"value: multiple values";l.value=1;{var c=J.opentelemetry.proto.common.v1.KeyValueList.verify(u.kvlistValue);if(c)return"kvlistValue."+c}}if(u.bytesValue!=null&&u.hasOwnProperty("bytesValue")){if(l.value===1)return"value: multiple values";if(l.value=1,!(u.bytesValue&&typeof u.bytesValue.length=="number"||X.isString(u.bytesValue)))return"bytesValue: buffer expected"}return null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.common.v1.AnyValue)return u;var l=new J.opentelemetry.proto.common.v1.AnyValue;if(u.stringValue!=null&&(l.stringValue=String(u.stringValue)),u.boolValue!=null&&(l.boolValue=!!u.boolValue),u.intValue!=null&&(X.Long?(l.intValue=X.Long.fromValue(u.intValue)).unsigned=!1:typeof u.intValue=="string"?l.intValue=parseInt(u.intValue,10):typeof u.intValue=="number"?l.intValue=u.intValue:typeof u.intValue=="object"&&(l.intValue=new X.LongBits(u.intValue.low>>>0,u.intValue.high>>>0).toNumber())),u.doubleValue!=null&&(l.doubleValue=Number(u.doubleValue)),u.arrayValue!=null){if(typeof u.arrayValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");l.arrayValue=J.opentelemetry.proto.common.v1.ArrayValue.fromObject(u.arrayValue)}if(u.kvlistValue!=null){if(typeof u.kvlistValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");l.kvlistValue=J.opentelemetry.proto.common.v1.KeyValueList.fromObject(u.kvlistValue)}return u.bytesValue!=null&&(typeof u.bytesValue=="string"?X.base64.decode(u.bytesValue,l.bytesValue=X.newBuffer(X.base64.length(u.bytesValue)),0):u.bytesValue.length>=0&&(l.bytesValue=u.bytesValue)),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};return u.stringValue!=null&&u.hasOwnProperty("stringValue")&&(c.stringValue=u.stringValue,l.oneofs&&(c.value="stringValue")),u.boolValue!=null&&u.hasOwnProperty("boolValue")&&(c.boolValue=u.boolValue,l.oneofs&&(c.value="boolValue")),u.intValue!=null&&u.hasOwnProperty("intValue")&&(typeof u.intValue=="number"?c.intValue=l.longs===String?String(u.intValue):u.intValue:c.intValue=l.longs===String?X.Long.prototype.toString.call(u.intValue):l.longs===Number?new X.LongBits(u.intValue.low>>>0,u.intValue.high>>>0).toNumber():u.intValue,l.oneofs&&(c.value="intValue")),u.doubleValue!=null&&u.hasOwnProperty("doubleValue")&&(c.doubleValue=l.json&&!isFinite(u.doubleValue)?String(u.doubleValue):u.doubleValue,l.oneofs&&(c.value="doubleValue")),u.arrayValue!=null&&u.hasOwnProperty("arrayValue")&&(c.arrayValue=J.opentelemetry.proto.common.v1.ArrayValue.toObject(u.arrayValue,l),l.oneofs&&(c.value="arrayValue")),u.kvlistValue!=null&&u.hasOwnProperty("kvlistValue")&&(c.kvlistValue=J.opentelemetry.proto.common.v1.KeyValueList.toObject(u.kvlistValue,l),l.oneofs&&(c.value="kvlistValue")),u.bytesValue!=null&&u.hasOwnProperty("bytesValue")&&(c.bytesValue=l.bytes===String?X.base64.encode(u.bytesValue,0,u.bytesValue.length):l.bytes===Array?Array.prototype.slice.call(u.bytesValue):u.bytesValue,l.oneofs&&(c.value="bytesValue")),c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.common.v1.AnyValue"},"getTypeUrl"),n})(),o.ArrayValue=(function(){function n(i){if(this.values=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ArrayValue"),n.prototype.values=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.values!=null&&a.values.length)for(var l=0;l<a.values.length;++l)J.opentelemetry.proto.common.v1.AnyValue.encode(a.values[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.ArrayValue;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.values&&d.values.length||(d.values=[]),d.values.push(J.opentelemetry.proto.common.v1.AnyValue.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.values!=null&&a.hasOwnProperty("values")){if(!Array.isArray(a.values))return"values: array expected";for(var u=0;u<a.values.length;++u){var l=J.opentelemetry.proto.common.v1.AnyValue.verify(a.values[u]);if(l)return"values."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.ArrayValue)return a;var u=new J.opentelemetry.proto.common.v1.ArrayValue;if(a.values){if(!Array.isArray(a.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");u.values=[];for(var l=0;l<a.values.length;++l){if(typeof a.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");u.values[l]=J.opentelemetry.proto.common.v1.AnyValue.fromObject(a.values[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.values=[]),a.values&&a.values.length){l.values=[];for(var c=0;c<a.values.length;++c)l.values[c]=J.opentelemetry.proto.common.v1.AnyValue.toObject(a.values[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.ArrayValue"},"getTypeUrl"),n})(),o.KeyValueList=(function(){function n(i){if(this.values=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"KeyValueList"),n.prototype.values=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.values!=null&&a.values.length)for(var l=0;l<a.values.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.values[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.KeyValueList;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.values&&d.values.length||(d.values=[]),d.values.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.values!=null&&a.hasOwnProperty("values")){if(!Array.isArray(a.values))return"values: array expected";for(var u=0;u<a.values.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.values[u]);if(l)return"values."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.KeyValueList)return a;var u=new J.opentelemetry.proto.common.v1.KeyValueList;if(a.values){if(!Array.isArray(a.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");u.values=[];for(var l=0;l<a.values.length;++l){if(typeof a.values[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");u.values[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.values[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.values=[]),a.values&&a.values.length){l.values=[];for(var c=0;c<a.values.length;++c)l.values[c]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.values[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.KeyValueList"},"getTypeUrl"),n})(),o.KeyValue=(function(){function n(i){if(i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"KeyValue"),n.prototype.key=null,n.prototype.value=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){return u||(u=Yn.create()),a.key!=null&&Object.hasOwnProperty.call(a,"key")&&u.uint32(10).string(a.key),a.value!=null&&Object.hasOwnProperty.call(a,"value")&&J.opentelemetry.proto.common.v1.AnyValue.encode(a.value,u.uint32(18).fork()).ldelim(),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.KeyValue;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.key=a.string();break}case 2:{d.value=J.opentelemetry.proto.common.v1.AnyValue.decode(a,a.uint32());break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.key!=null&&a.hasOwnProperty("key")&&!X.isString(a.key))return"key: string expected";if(a.value!=null&&a.hasOwnProperty("value")){var u=J.opentelemetry.proto.common.v1.AnyValue.verify(a.value);if(u)return"value."+u}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.KeyValue)return a;var u=new J.opentelemetry.proto.common.v1.KeyValue;if(a.key!=null&&(u.key=String(a.key)),a.value!=null){if(typeof a.value!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");u.value=J.opentelemetry.proto.common.v1.AnyValue.fromObject(a.value)}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};return u.defaults&&(l.key="",l.value=null),a.key!=null&&a.hasOwnProperty("key")&&(l.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(l.value=J.opentelemetry.proto.common.v1.AnyValue.toObject(a.value,u)),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.KeyValue"},"getTypeUrl"),n})(),o.InstrumentationScope=(function(){function n(i){if(this.attributes=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"InstrumentationScope"),n.prototype.name=null,n.prototype.version=null,n.prototype.attributes=X.emptyArray,n.prototype.droppedAttributesCount=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.name!=null&&Object.hasOwnProperty.call(a,"name")&&u.uint32(10).string(a.name),a.version!=null&&Object.hasOwnProperty.call(a,"version")&&u.uint32(18).string(a.version),a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(26).fork()).ldelim();return a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&u.uint32(32).uint32(a.droppedAttributesCount),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.InstrumentationScope;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.name=a.string();break}case 2:{d.version=a.string();break}case 3:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 4:{d.droppedAttributesCount=a.uint32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.name!=null&&a.hasOwnProperty("name")&&!X.isString(a.name))return"name: string expected";if(a.version!=null&&a.hasOwnProperty("version")&&!X.isString(a.version))return"version: string expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(l)return"attributes."+l}}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(a.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.InstrumentationScope)return a;var u=new J.opentelemetry.proto.common.v1.InstrumentationScope;if(a.name!=null&&(u.name=String(a.name)),a.version!=null&&(u.version=String(a.version)),a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}return a.droppedAttributesCount!=null&&(u.droppedAttributesCount=a.droppedAttributesCount>>>0),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.attributes=[]),u.defaults&&(l.name="",l.version="",l.droppedAttributesCount=0),a.name!=null&&a.hasOwnProperty("name")&&(l.name=a.name),a.version!=null&&a.hasOwnProperty("version")&&(l.version=a.version),a.attributes&&a.attributes.length){l.attributes=[];for(var c=0;c<a.attributes.length;++c)l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[c],u)}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=a.droppedAttributesCount),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.InstrumentationScope"},"getTypeUrl"),n})(),o.EntityRef=(function(){function n(i){if(this.idKeys=[],this.descriptionKeys=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"EntityRef"),n.prototype.schemaUrl=null,n.prototype.type=null,n.prototype.idKeys=X.emptyArray,n.prototype.descriptionKeys=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(10).string(a.schemaUrl),a.type!=null&&Object.hasOwnProperty.call(a,"type")&&u.uint32(18).string(a.type),a.idKeys!=null&&a.idKeys.length)for(var l=0;l<a.idKeys.length;++l)u.uint32(26).string(a.idKeys[l]);if(a.descriptionKeys!=null&&a.descriptionKeys.length)for(var l=0;l<a.descriptionKeys.length;++l)u.uint32(34).string(a.descriptionKeys[l]);return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.common.v1.EntityRef;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.schemaUrl=a.string();break}case 2:{d.type=a.string();break}case 3:{d.idKeys&&d.idKeys.length||(d.idKeys=[]),d.idKeys.push(a.string());break}case 4:{d.descriptionKeys&&d.descriptionKeys.length||(d.descriptionKeys=[]),d.descriptionKeys.push(a.string());break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl))return"schemaUrl: string expected";if(a.type!=null&&a.hasOwnProperty("type")&&!X.isString(a.type))return"type: string expected";if(a.idKeys!=null&&a.hasOwnProperty("idKeys")){if(!Array.isArray(a.idKeys))return"idKeys: array expected";for(var u=0;u<a.idKeys.length;++u)if(!X.isString(a.idKeys[u]))return"idKeys: string[] expected"}if(a.descriptionKeys!=null&&a.hasOwnProperty("descriptionKeys")){if(!Array.isArray(a.descriptionKeys))return"descriptionKeys: array expected";for(var u=0;u<a.descriptionKeys.length;++u)if(!X.isString(a.descriptionKeys[u]))return"descriptionKeys: string[] expected"}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.common.v1.EntityRef)return a;var u=new J.opentelemetry.proto.common.v1.EntityRef;if(a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),a.type!=null&&(u.type=String(a.type)),a.idKeys){if(!Array.isArray(a.idKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected");u.idKeys=[];for(var l=0;l<a.idKeys.length;++l)u.idKeys[l]=String(a.idKeys[l])}if(a.descriptionKeys){if(!Array.isArray(a.descriptionKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected");u.descriptionKeys=[];for(var l=0;l<a.descriptionKeys.length;++l)u.descriptionKeys[l]=String(a.descriptionKeys[l])}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.idKeys=[],l.descriptionKeys=[]),u.defaults&&(l.schemaUrl="",l.type=""),a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),a.type!=null&&a.hasOwnProperty("type")&&(l.type=a.type),a.idKeys&&a.idKeys.length){l.idKeys=[];for(var c=0;c<a.idKeys.length;++c)l.idKeys[c]=a.idKeys[c]}if(a.descriptionKeys&&a.descriptionKeys.length){l.descriptionKeys=[];for(var c=0;c<a.descriptionKeys.length;++c)l.descriptionKeys[c]=a.descriptionKeys[c]}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.EntityRef"},"getTypeUrl"),n})(),o})(),r})(),t.resource=(function(){var r={};return r.v1=(function(){var o={};return o.Resource=(function(){function n(i){if(this.attributes=[],this.entityRefs=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Resource"),n.prototype.attributes=X.emptyArray,n.prototype.droppedAttributesCount=null,n.prototype.entityRefs=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(10).fork()).ldelim();if(a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&u.uint32(16).uint32(a.droppedAttributesCount),a.entityRefs!=null&&a.entityRefs.length)for(var l=0;l<a.entityRefs.length;++l)J.opentelemetry.proto.common.v1.EntityRef.encode(a.entityRefs[l],u.uint32(26).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.resource.v1.Resource;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 2:{d.droppedAttributesCount=a.uint32();break}case 3:{d.entityRefs&&d.entityRefs.length||(d.entityRefs=[]),d.entityRefs.push(J.opentelemetry.proto.common.v1.EntityRef.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(l)return"attributes."+l}}if(a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(a.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(a.entityRefs!=null&&a.hasOwnProperty("entityRefs")){if(!Array.isArray(a.entityRefs))return"entityRefs: array expected";for(var u=0;u<a.entityRefs.length;++u){var l=J.opentelemetry.proto.common.v1.EntityRef.verify(a.entityRefs[u]);if(l)return"entityRefs."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.resource.v1.Resource)return a;var u=new J.opentelemetry.proto.resource.v1.Resource;if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}if(a.droppedAttributesCount!=null&&(u.droppedAttributesCount=a.droppedAttributesCount>>>0),a.entityRefs){if(!Array.isArray(a.entityRefs))throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected");u.entityRefs=[];for(var l=0;l<a.entityRefs.length;++l){if(typeof a.entityRefs[l]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected");u.entityRefs[l]=J.opentelemetry.proto.common.v1.EntityRef.fromObject(a.entityRefs[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.attributes=[],l.entityRefs=[]),u.defaults&&(l.droppedAttributesCount=0),a.attributes&&a.attributes.length){l.attributes=[];for(var c=0;c<a.attributes.length;++c)l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[c],u)}if(a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=a.droppedAttributesCount),a.entityRefs&&a.entityRefs.length){l.entityRefs=[];for(var c=0;c<a.entityRefs.length;++c)l.entityRefs[c]=J.opentelemetry.proto.common.v1.EntityRef.toObject(a.entityRefs[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.resource.v1.Resource"},"getTypeUrl"),n})(),o})(),r})(),t.trace=(function(){var r={};return r.v1=(function(){var o={};return o.TracesData=(function(){function n(i){if(this.resourceSpans=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"TracesData"),n.prototype.resourceSpans=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resourceSpans!=null&&a.resourceSpans.length)for(var l=0;l<a.resourceSpans.length;++l)J.opentelemetry.proto.trace.v1.ResourceSpans.encode(a.resourceSpans[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.TracesData;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resourceSpans&&d.resourceSpans.length||(d.resourceSpans=[]),d.resourceSpans.push(J.opentelemetry.proto.trace.v1.ResourceSpans.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceSpans!=null&&a.hasOwnProperty("resourceSpans")){if(!Array.isArray(a.resourceSpans))return"resourceSpans: array expected";for(var u=0;u<a.resourceSpans.length;++u){var l=J.opentelemetry.proto.trace.v1.ResourceSpans.verify(a.resourceSpans[u]);if(l)return"resourceSpans."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.TracesData)return a;var u=new J.opentelemetry.proto.trace.v1.TracesData;if(a.resourceSpans){if(!Array.isArray(a.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");u.resourceSpans=[];for(var l=0;l<a.resourceSpans.length;++l){if(typeof a.resourceSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");u.resourceSpans[l]=J.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(a.resourceSpans[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.resourceSpans=[]),a.resourceSpans&&a.resourceSpans.length){l.resourceSpans=[];for(var c=0;c<a.resourceSpans.length;++c)l.resourceSpans[c]=J.opentelemetry.proto.trace.v1.ResourceSpans.toObject(a.resourceSpans[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.TracesData"},"getTypeUrl"),n})(),o.ResourceSpans=(function(){function n(i){if(this.scopeSpans=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ResourceSpans"),n.prototype.resource=null,n.prototype.scopeSpans=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resource!=null&&Object.hasOwnProperty.call(a,"resource")&&J.opentelemetry.proto.resource.v1.Resource.encode(a.resource,u.uint32(10).fork()).ldelim(),a.scopeSpans!=null&&a.scopeSpans.length)for(var l=0;l<a.scopeSpans.length;++l)J.opentelemetry.proto.trace.v1.ScopeSpans.encode(a.scopeSpans[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.ResourceSpans;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resource=J.opentelemetry.proto.resource.v1.Resource.decode(a,a.uint32());break}case 2:{d.scopeSpans&&d.scopeSpans.length||(d.scopeSpans=[]),d.scopeSpans.push(J.opentelemetry.proto.trace.v1.ScopeSpans.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resource!=null&&a.hasOwnProperty("resource")){var u=J.opentelemetry.proto.resource.v1.Resource.verify(a.resource);if(u)return"resource."+u}if(a.scopeSpans!=null&&a.hasOwnProperty("scopeSpans")){if(!Array.isArray(a.scopeSpans))return"scopeSpans: array expected";for(var l=0;l<a.scopeSpans.length;++l){var u=J.opentelemetry.proto.trace.v1.ScopeSpans.verify(a.scopeSpans[l]);if(u)return"scopeSpans."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.ResourceSpans)return a;var u=new J.opentelemetry.proto.trace.v1.ResourceSpans;if(a.resource!=null){if(typeof a.resource!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");u.resource=J.opentelemetry.proto.resource.v1.Resource.fromObject(a.resource)}if(a.scopeSpans){if(!Array.isArray(a.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");u.scopeSpans=[];for(var l=0;l<a.scopeSpans.length;++l){if(typeof a.scopeSpans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");u.scopeSpans[l]=J.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(a.scopeSpans[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.scopeSpans=[]),u.defaults&&(l.resource=null,l.schemaUrl=""),a.resource!=null&&a.hasOwnProperty("resource")&&(l.resource=J.opentelemetry.proto.resource.v1.Resource.toObject(a.resource,u)),a.scopeSpans&&a.scopeSpans.length){l.scopeSpans=[];for(var c=0;c<a.scopeSpans.length;++c)l.scopeSpans[c]=J.opentelemetry.proto.trace.v1.ScopeSpans.toObject(a.scopeSpans[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.ResourceSpans"},"getTypeUrl"),n})(),o.ScopeSpans=(function(){function n(i){if(this.spans=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ScopeSpans"),n.prototype.scope=null,n.prototype.spans=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.scope!=null&&Object.hasOwnProperty.call(a,"scope")&&J.opentelemetry.proto.common.v1.InstrumentationScope.encode(a.scope,u.uint32(10).fork()).ldelim(),a.spans!=null&&a.spans.length)for(var l=0;l<a.spans.length;++l)J.opentelemetry.proto.trace.v1.Span.encode(a.spans[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.ScopeSpans;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.decode(a,a.uint32());break}case 2:{d.spans&&d.spans.length||(d.spans=[]),d.spans.push(J.opentelemetry.proto.trace.v1.Span.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.scope!=null&&a.hasOwnProperty("scope")){var u=J.opentelemetry.proto.common.v1.InstrumentationScope.verify(a.scope);if(u)return"scope."+u}if(a.spans!=null&&a.hasOwnProperty("spans")){if(!Array.isArray(a.spans))return"spans: array expected";for(var l=0;l<a.spans.length;++l){var u=J.opentelemetry.proto.trace.v1.Span.verify(a.spans[l]);if(u)return"spans."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.ScopeSpans)return a;var u=new J.opentelemetry.proto.trace.v1.ScopeSpans;if(a.scope!=null){if(typeof a.scope!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");u.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(a.scope)}if(a.spans){if(!Array.isArray(a.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");u.spans=[];for(var l=0;l<a.spans.length;++l){if(typeof a.spans[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");u.spans[l]=J.opentelemetry.proto.trace.v1.Span.fromObject(a.spans[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.spans=[]),u.defaults&&(l.scope=null,l.schemaUrl=""),a.scope!=null&&a.hasOwnProperty("scope")&&(l.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.toObject(a.scope,u)),a.spans&&a.spans.length){l.spans=[];for(var c=0;c<a.spans.length;++c)l.spans[c]=J.opentelemetry.proto.trace.v1.Span.toObject(a.spans[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.ScopeSpans"},"getTypeUrl"),n})(),o.Span=(function(){function n(i){if(this.attributes=[],this.events=[],this.links=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Span"),n.prototype.traceId=null,n.prototype.spanId=null,n.prototype.traceState=null,n.prototype.parentSpanId=null,n.prototype.flags=null,n.prototype.name=null,n.prototype.kind=null,n.prototype.startTimeUnixNano=null,n.prototype.endTimeUnixNano=null,n.prototype.attributes=X.emptyArray,n.prototype.droppedAttributesCount=null,n.prototype.events=X.emptyArray,n.prototype.droppedEventsCount=null,n.prototype.links=X.emptyArray,n.prototype.droppedLinksCount=null,n.prototype.status=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.traceId!=null&&Object.hasOwnProperty.call(a,"traceId")&&u.uint32(10).bytes(a.traceId),a.spanId!=null&&Object.hasOwnProperty.call(a,"spanId")&&u.uint32(18).bytes(a.spanId),a.traceState!=null&&Object.hasOwnProperty.call(a,"traceState")&&u.uint32(26).string(a.traceState),a.parentSpanId!=null&&Object.hasOwnProperty.call(a,"parentSpanId")&&u.uint32(34).bytes(a.parentSpanId),a.name!=null&&Object.hasOwnProperty.call(a,"name")&&u.uint32(42).string(a.name),a.kind!=null&&Object.hasOwnProperty.call(a,"kind")&&u.uint32(48).int32(a.kind),a.startTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"startTimeUnixNano")&&u.uint32(57).fixed64(a.startTimeUnixNano),a.endTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"endTimeUnixNano")&&u.uint32(65).fixed64(a.endTimeUnixNano),a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(74).fork()).ldelim();if(a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&u.uint32(80).uint32(a.droppedAttributesCount),a.events!=null&&a.events.length)for(var l=0;l<a.events.length;++l)J.opentelemetry.proto.trace.v1.Span.Event.encode(a.events[l],u.uint32(90).fork()).ldelim();if(a.droppedEventsCount!=null&&Object.hasOwnProperty.call(a,"droppedEventsCount")&&u.uint32(96).uint32(a.droppedEventsCount),a.links!=null&&a.links.length)for(var l=0;l<a.links.length;++l)J.opentelemetry.proto.trace.v1.Span.Link.encode(a.links[l],u.uint32(106).fork()).ldelim();return a.droppedLinksCount!=null&&Object.hasOwnProperty.call(a,"droppedLinksCount")&&u.uint32(112).uint32(a.droppedLinksCount),a.status!=null&&Object.hasOwnProperty.call(a,"status")&&J.opentelemetry.proto.trace.v1.Status.encode(a.status,u.uint32(122).fork()).ldelim(),a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&u.uint32(133).fixed32(a.flags),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.Span;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.traceId=a.bytes();break}case 2:{d.spanId=a.bytes();break}case 3:{d.traceState=a.string();break}case 4:{d.parentSpanId=a.bytes();break}case 16:{d.flags=a.fixed32();break}case 5:{d.name=a.string();break}case 6:{d.kind=a.int32();break}case 7:{d.startTimeUnixNano=a.fixed64();break}case 8:{d.endTimeUnixNano=a.fixed64();break}case 9:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 10:{d.droppedAttributesCount=a.uint32();break}case 11:{d.events&&d.events.length||(d.events=[]),d.events.push(J.opentelemetry.proto.trace.v1.Span.Event.decode(a,a.uint32()));break}case 12:{d.droppedEventsCount=a.uint32();break}case 13:{d.links&&d.links.length||(d.links=[]),d.links.push(J.opentelemetry.proto.trace.v1.Span.Link.decode(a,a.uint32()));break}case 14:{d.droppedLinksCount=a.uint32();break}case 15:{d.status=J.opentelemetry.proto.trace.v1.Status.decode(a,a.uint32());break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.traceId!=null&&a.hasOwnProperty("traceId")&&!(a.traceId&&typeof a.traceId.length=="number"||X.isString(a.traceId)))return"traceId: buffer expected";if(a.spanId!=null&&a.hasOwnProperty("spanId")&&!(a.spanId&&typeof a.spanId.length=="number"||X.isString(a.spanId)))return"spanId: buffer expected";if(a.traceState!=null&&a.hasOwnProperty("traceState")&&!X.isString(a.traceState))return"traceState: string expected";if(a.parentSpanId!=null&&a.hasOwnProperty("parentSpanId")&&!(a.parentSpanId&&typeof a.parentSpanId.length=="number"||X.isString(a.parentSpanId)))return"parentSpanId: buffer expected";if(a.flags!=null&&a.hasOwnProperty("flags")&&!X.isInteger(a.flags))return"flags: integer expected";if(a.name!=null&&a.hasOwnProperty("name")&&!X.isString(a.name))return"name: string expected";if(a.kind!=null&&a.hasOwnProperty("kind"))switch(a.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(a.startTimeUnixNano)&&!(a.startTimeUnixNano&&X.isInteger(a.startTimeUnixNano.low)&&X.isInteger(a.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(a.endTimeUnixNano!=null&&a.hasOwnProperty("endTimeUnixNano")&&!X.isInteger(a.endTimeUnixNano)&&!(a.endTimeUnixNano&&X.isInteger(a.endTimeUnixNano.low)&&X.isInteger(a.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(l)return"attributes."+l}}if(a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(a.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(a.events!=null&&a.hasOwnProperty("events")){if(!Array.isArray(a.events))return"events: array expected";for(var u=0;u<a.events.length;++u){var l=J.opentelemetry.proto.trace.v1.Span.Event.verify(a.events[u]);if(l)return"events."+l}}if(a.droppedEventsCount!=null&&a.hasOwnProperty("droppedEventsCount")&&!X.isInteger(a.droppedEventsCount))return"droppedEventsCount: integer expected";if(a.links!=null&&a.hasOwnProperty("links")){if(!Array.isArray(a.links))return"links: array expected";for(var u=0;u<a.links.length;++u){var l=J.opentelemetry.proto.trace.v1.Span.Link.verify(a.links[u]);if(l)return"links."+l}}if(a.droppedLinksCount!=null&&a.hasOwnProperty("droppedLinksCount")&&!X.isInteger(a.droppedLinksCount))return"droppedLinksCount: integer expected";if(a.status!=null&&a.hasOwnProperty("status")){var l=J.opentelemetry.proto.trace.v1.Status.verify(a.status);if(l)return"status."+l}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.Span)return a;var u=new J.opentelemetry.proto.trace.v1.Span;switch(a.traceId!=null&&(typeof a.traceId=="string"?X.base64.decode(a.traceId,u.traceId=X.newBuffer(X.base64.length(a.traceId)),0):a.traceId.length>=0&&(u.traceId=a.traceId)),a.spanId!=null&&(typeof a.spanId=="string"?X.base64.decode(a.spanId,u.spanId=X.newBuffer(X.base64.length(a.spanId)),0):a.spanId.length>=0&&(u.spanId=a.spanId)),a.traceState!=null&&(u.traceState=String(a.traceState)),a.parentSpanId!=null&&(typeof a.parentSpanId=="string"?X.base64.decode(a.parentSpanId,u.parentSpanId=X.newBuffer(X.base64.length(a.parentSpanId)),0):a.parentSpanId.length>=0&&(u.parentSpanId=a.parentSpanId)),a.flags!=null&&(u.flags=a.flags>>>0),a.name!=null&&(u.name=String(a.name)),a.kind){default:if(typeof a.kind=="number"){u.kind=a.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:u.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:u.kind=1;break;case"SPAN_KIND_SERVER":case 2:u.kind=2;break;case"SPAN_KIND_CLIENT":case 3:u.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:u.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:u.kind=5;break}if(a.startTimeUnixNano!=null&&(X.Long?(u.startTimeUnixNano=X.Long.fromValue(a.startTimeUnixNano)).unsigned=!1:typeof a.startTimeUnixNano=="string"?u.startTimeUnixNano=parseInt(a.startTimeUnixNano,10):typeof a.startTimeUnixNano=="number"?u.startTimeUnixNano=a.startTimeUnixNano:typeof a.startTimeUnixNano=="object"&&(u.startTimeUnixNano=new X.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber())),a.endTimeUnixNano!=null&&(X.Long?(u.endTimeUnixNano=X.Long.fromValue(a.endTimeUnixNano)).unsigned=!1:typeof a.endTimeUnixNano=="string"?u.endTimeUnixNano=parseInt(a.endTimeUnixNano,10):typeof a.endTimeUnixNano=="number"?u.endTimeUnixNano=a.endTimeUnixNano:typeof a.endTimeUnixNano=="object"&&(u.endTimeUnixNano=new X.LongBits(a.endTimeUnixNano.low>>>0,a.endTimeUnixNano.high>>>0).toNumber())),a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}if(a.droppedAttributesCount!=null&&(u.droppedAttributesCount=a.droppedAttributesCount>>>0),a.events){if(!Array.isArray(a.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");u.events=[];for(var l=0;l<a.events.length;++l){if(typeof a.events[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");u.events[l]=J.opentelemetry.proto.trace.v1.Span.Event.fromObject(a.events[l])}}if(a.droppedEventsCount!=null&&(u.droppedEventsCount=a.droppedEventsCount>>>0),a.links){if(!Array.isArray(a.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");u.links=[];for(var l=0;l<a.links.length;++l){if(typeof a.links[l]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");u.links[l]=J.opentelemetry.proto.trace.v1.Span.Link.fromObject(a.links[l])}}if(a.droppedLinksCount!=null&&(u.droppedLinksCount=a.droppedLinksCount>>>0),a.status!=null){if(typeof a.status!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");u.status=J.opentelemetry.proto.trace.v1.Status.fromObject(a.status)}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.attributes=[],l.events=[],l.links=[]),u.defaults){if(u.bytes===String?l.traceId="":(l.traceId=[],u.bytes!==Array&&(l.traceId=X.newBuffer(l.traceId))),u.bytes===String?l.spanId="":(l.spanId=[],u.bytes!==Array&&(l.spanId=X.newBuffer(l.spanId))),l.traceState="",u.bytes===String?l.parentSpanId="":(l.parentSpanId=[],u.bytes!==Array&&(l.parentSpanId=X.newBuffer(l.parentSpanId))),l.name="",l.kind=u.enums===String?"SPAN_KIND_UNSPECIFIED":0,X.Long){var c=new X.Long(0,0,!1);l.startTimeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.startTimeUnixNano=u.longs===String?"0":0;if(X.Long){var c=new X.Long(0,0,!1);l.endTimeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.endTimeUnixNano=u.longs===String?"0":0;l.droppedAttributesCount=0,l.droppedEventsCount=0,l.droppedLinksCount=0,l.status=null,l.flags=0}if(a.traceId!=null&&a.hasOwnProperty("traceId")&&(l.traceId=u.bytes===String?X.base64.encode(a.traceId,0,a.traceId.length):u.bytes===Array?Array.prototype.slice.call(a.traceId):a.traceId),a.spanId!=null&&a.hasOwnProperty("spanId")&&(l.spanId=u.bytes===String?X.base64.encode(a.spanId,0,a.spanId.length):u.bytes===Array?Array.prototype.slice.call(a.spanId):a.spanId),a.traceState!=null&&a.hasOwnProperty("traceState")&&(l.traceState=a.traceState),a.parentSpanId!=null&&a.hasOwnProperty("parentSpanId")&&(l.parentSpanId=u.bytes===String?X.base64.encode(a.parentSpanId,0,a.parentSpanId.length):u.bytes===Array?Array.prototype.slice.call(a.parentSpanId):a.parentSpanId),a.name!=null&&a.hasOwnProperty("name")&&(l.name=a.name),a.kind!=null&&a.hasOwnProperty("kind")&&(l.kind=u.enums===String?J.opentelemetry.proto.trace.v1.Span.SpanKind[a.kind]===void 0?a.kind:J.opentelemetry.proto.trace.v1.Span.SpanKind[a.kind]:a.kind),a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&(typeof a.startTimeUnixNano=="number"?l.startTimeUnixNano=u.longs===String?String(a.startTimeUnixNano):a.startTimeUnixNano:l.startTimeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.startTimeUnixNano):u.longs===Number?new X.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber():a.startTimeUnixNano),a.endTimeUnixNano!=null&&a.hasOwnProperty("endTimeUnixNano")&&(typeof a.endTimeUnixNano=="number"?l.endTimeUnixNano=u.longs===String?String(a.endTimeUnixNano):a.endTimeUnixNano:l.endTimeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.endTimeUnixNano):u.longs===Number?new X.LongBits(a.endTimeUnixNano.low>>>0,a.endTimeUnixNano.high>>>0).toNumber():a.endTimeUnixNano),a.attributes&&a.attributes.length){l.attributes=[];for(var d=0;d<a.attributes.length;++d)l.attributes[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[d],u)}if(a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=a.droppedAttributesCount),a.events&&a.events.length){l.events=[];for(var d=0;d<a.events.length;++d)l.events[d]=J.opentelemetry.proto.trace.v1.Span.Event.toObject(a.events[d],u)}if(a.droppedEventsCount!=null&&a.hasOwnProperty("droppedEventsCount")&&(l.droppedEventsCount=a.droppedEventsCount),a.links&&a.links.length){l.links=[];for(var d=0;d<a.links.length;++d)l.links[d]=J.opentelemetry.proto.trace.v1.Span.Link.toObject(a.links[d],u)}return a.droppedLinksCount!=null&&a.hasOwnProperty("droppedLinksCount")&&(l.droppedLinksCount=a.droppedLinksCount),a.status!=null&&a.hasOwnProperty("status")&&(l.status=J.opentelemetry.proto.trace.v1.Status.toObject(a.status,u)),a.flags!=null&&a.hasOwnProperty("flags")&&(l.flags=a.flags),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.Span"},"getTypeUrl"),n.SpanKind=(function(){var i={},a=Object.create(i);return a[i[0]="SPAN_KIND_UNSPECIFIED"]=0,a[i[1]="SPAN_KIND_INTERNAL"]=1,a[i[2]="SPAN_KIND_SERVER"]=2,a[i[3]="SPAN_KIND_CLIENT"]=3,a[i[4]="SPAN_KIND_PRODUCER"]=4,a[i[5]="SPAN_KIND_CONSUMER"]=5,a})(),n.Event=(function(){function i(a){if(this.attributes=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"Event"),i.prototype.timeUnixNano=null,i.prototype.name=null,i.prototype.attributes=X.emptyArray,i.prototype.droppedAttributesCount=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(9).fixed64(u.timeUnixNano),u.name!=null&&Object.hasOwnProperty.call(u,"name")&&l.uint32(18).string(u.name),u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(26).fork()).ldelim();return u.droppedAttributesCount!=null&&Object.hasOwnProperty.call(u,"droppedAttributesCount")&&l.uint32(32).uint32(u.droppedAttributesCount),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.trace.v1.Span.Event;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.timeUnixNano=u.fixed64();break}case 2:{p.name=u.string();break}case 3:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 4:{p.droppedAttributesCount=u.uint32();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.name!=null&&u.hasOwnProperty("name")&&!X.isString(u.name))return"name: string expected";if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var l=0;l<u.attributes.length;++l){var c=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[l]);if(c)return"attributes."+c}}return u.droppedAttributesCount!=null&&u.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(u.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.trace.v1.Span.Event)return u;var l=new J.opentelemetry.proto.trace.v1.Span.Event;if(u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.name!=null&&(l.name=String(u.name)),u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}return u.droppedAttributesCount!=null&&(l.droppedAttributesCount=u.droppedAttributesCount>>>0),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;c.name="",c.droppedAttributesCount=0}if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.name!=null&&u.hasOwnProperty("name")&&(c.name=u.name),u.attributes&&u.attributes.length){c.attributes=[];for(var p=0;p<u.attributes.length;++p)c.attributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[p],l)}return u.droppedAttributesCount!=null&&u.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=u.droppedAttributesCount),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.trace.v1.Span.Event"},"getTypeUrl"),i})(),n.Link=(function(){function i(a){if(this.attributes=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"Link"),i.prototype.traceId=null,i.prototype.spanId=null,i.prototype.traceState=null,i.prototype.attributes=X.emptyArray,i.prototype.droppedAttributesCount=null,i.prototype.flags=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.traceId!=null&&Object.hasOwnProperty.call(u,"traceId")&&l.uint32(10).bytes(u.traceId),u.spanId!=null&&Object.hasOwnProperty.call(u,"spanId")&&l.uint32(18).bytes(u.spanId),u.traceState!=null&&Object.hasOwnProperty.call(u,"traceState")&&l.uint32(26).string(u.traceState),u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(34).fork()).ldelim();return u.droppedAttributesCount!=null&&Object.hasOwnProperty.call(u,"droppedAttributesCount")&&l.uint32(40).uint32(u.droppedAttributesCount),u.flags!=null&&Object.hasOwnProperty.call(u,"flags")&&l.uint32(53).fixed32(u.flags),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.trace.v1.Span.Link;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.traceId=u.bytes();break}case 2:{p.spanId=u.bytes();break}case 3:{p.traceState=u.string();break}case 4:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 5:{p.droppedAttributesCount=u.uint32();break}case 6:{p.flags=u.fixed32();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.traceId!=null&&u.hasOwnProperty("traceId")&&!(u.traceId&&typeof u.traceId.length=="number"||X.isString(u.traceId)))return"traceId: buffer expected";if(u.spanId!=null&&u.hasOwnProperty("spanId")&&!(u.spanId&&typeof u.spanId.length=="number"||X.isString(u.spanId)))return"spanId: buffer expected";if(u.traceState!=null&&u.hasOwnProperty("traceState")&&!X.isString(u.traceState))return"traceState: string expected";if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var l=0;l<u.attributes.length;++l){var c=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[l]);if(c)return"attributes."+c}}return u.droppedAttributesCount!=null&&u.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(u.droppedAttributesCount)?"droppedAttributesCount: integer expected":u.flags!=null&&u.hasOwnProperty("flags")&&!X.isInteger(u.flags)?"flags: integer expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.trace.v1.Span.Link)return u;var l=new J.opentelemetry.proto.trace.v1.Span.Link;if(u.traceId!=null&&(typeof u.traceId=="string"?X.base64.decode(u.traceId,l.traceId=X.newBuffer(X.base64.length(u.traceId)),0):u.traceId.length>=0&&(l.traceId=u.traceId)),u.spanId!=null&&(typeof u.spanId=="string"?X.base64.decode(u.spanId,l.spanId=X.newBuffer(X.base64.length(u.spanId)),0):u.spanId.length>=0&&(l.spanId=u.spanId)),u.traceState!=null&&(l.traceState=String(u.traceState)),u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}return u.droppedAttributesCount!=null&&(l.droppedAttributesCount=u.droppedAttributesCount>>>0),u.flags!=null&&(l.flags=u.flags>>>0),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[]),l.defaults&&(l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=X.newBuffer(c.traceId))),l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=X.newBuffer(c.spanId))),c.traceState="",c.droppedAttributesCount=0,c.flags=0),u.traceId!=null&&u.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?X.base64.encode(u.traceId,0,u.traceId.length):l.bytes===Array?Array.prototype.slice.call(u.traceId):u.traceId),u.spanId!=null&&u.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?X.base64.encode(u.spanId,0,u.spanId.length):l.bytes===Array?Array.prototype.slice.call(u.spanId):u.spanId),u.traceState!=null&&u.hasOwnProperty("traceState")&&(c.traceState=u.traceState),u.attributes&&u.attributes.length){c.attributes=[];for(var d=0;d<u.attributes.length;++d)c.attributes[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[d],l)}return u.droppedAttributesCount!=null&&u.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=u.droppedAttributesCount),u.flags!=null&&u.hasOwnProperty("flags")&&(c.flags=u.flags),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.trace.v1.Span.Link"},"getTypeUrl"),i})(),n})(),o.Status=(function(){function n(i){if(i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Status"),n.prototype.message=null,n.prototype.code=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){return u||(u=Yn.create()),a.message!=null&&Object.hasOwnProperty.call(a,"message")&&u.uint32(18).string(a.message),a.code!=null&&Object.hasOwnProperty.call(a,"code")&&u.uint32(24).int32(a.code),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.trace.v1.Status;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 2:{d.message=a.string();break}case 3:{d.code=a.int32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.message!=null&&a.hasOwnProperty("message")&&!X.isString(a.message))return"message: string expected";if(a.code!=null&&a.hasOwnProperty("code"))switch(a.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.trace.v1.Status)return a;var u=new J.opentelemetry.proto.trace.v1.Status;switch(a.message!=null&&(u.message=String(a.message)),a.code){default:if(typeof a.code=="number"){u.code=a.code;break}break;case"STATUS_CODE_UNSET":case 0:u.code=0;break;case"STATUS_CODE_OK":case 1:u.code=1;break;case"STATUS_CODE_ERROR":case 2:u.code=2;break}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};return u.defaults&&(l.message="",l.code=u.enums===String?"STATUS_CODE_UNSET":0),a.message!=null&&a.hasOwnProperty("message")&&(l.message=a.message),a.code!=null&&a.hasOwnProperty("code")&&(l.code=u.enums===String?J.opentelemetry.proto.trace.v1.Status.StatusCode[a.code]===void 0?a.code:J.opentelemetry.proto.trace.v1.Status.StatusCode[a.code]:a.code),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.Status"},"getTypeUrl"),n.StatusCode=(function(){var i={},a=Object.create(i);return a[i[0]="STATUS_CODE_UNSET"]=0,a[i[1]="STATUS_CODE_OK"]=1,a[i[2]="STATUS_CODE_ERROR"]=2,a})(),n})(),o.SpanFlags=(function(){var n={},i=Object.create(n);return i[n[0]="SPAN_FLAGS_DO_NOT_USE"]=0,i[n[255]="SPAN_FLAGS_TRACE_FLAGS_MASK"]=255,i[n[256]="SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"]=256,i[n[512]="SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"]=512,i})(),o})(),r})(),t.collector=(function(){var r={};return r.trace=(function(){var o={};return o.v1=(function(){var n={};return n.TraceService=(function(){function i(a,u,l){gn.rpc.Service.call(this,a,u,l)}return s(i,"TraceService"),(i.prototype=Object.create(gn.rpc.Service.prototype)).constructor=i,i.create=s(function(u,l,c){return new this(u,l,c)},"create"),Object.defineProperty(i.prototype.export=s(function a(u,l){return this.rpcCall(a,J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,u,l)},"export_"),"name",{value:"Export"}),i})(),n.ExportTraceServiceRequest=(function(){function i(a){if(this.resourceSpans=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportTraceServiceRequest"),i.prototype.resourceSpans=X.emptyArray,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.resourceSpans!=null&&u.resourceSpans.length)for(var c=0;c<u.resourceSpans.length;++c)J.opentelemetry.proto.trace.v1.ResourceSpans.encode(u.resourceSpans[c],l.uint32(10).fork()).ldelim();return l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.resourceSpans&&p.resourceSpans.length||(p.resourceSpans=[]),p.resourceSpans.push(J.opentelemetry.proto.trace.v1.ResourceSpans.decode(u,u.uint32()));break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.resourceSpans!=null&&u.hasOwnProperty("resourceSpans")){if(!Array.isArray(u.resourceSpans))return"resourceSpans: array expected";for(var l=0;l<u.resourceSpans.length;++l){var c=J.opentelemetry.proto.trace.v1.ResourceSpans.verify(u.resourceSpans[l]);if(c)return"resourceSpans."+c}}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return u;var l=new J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(u.resourceSpans){if(!Array.isArray(u.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");l.resourceSpans=[];for(var c=0;c<u.resourceSpans.length;++c){if(typeof u.resourceSpans[c]!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");l.resourceSpans[c]=J.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(u.resourceSpans[c])}}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceSpans=[]),u.resourceSpans&&u.resourceSpans.length){c.resourceSpans=[];for(var d=0;d<u.resourceSpans.length;++d)c.resourceSpans[d]=J.opentelemetry.proto.trace.v1.ResourceSpans.toObject(u.resourceSpans[d],l)}return c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},"getTypeUrl"),i})(),n.ExportTraceServiceResponse=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportTraceServiceResponse"),i.prototype.partialSuccess=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.partialSuccess!=null&&Object.hasOwnProperty.call(u,"partialSuccess")&&J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(u.partialSuccess,l.uint32(10).fork()).ldelim(),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.partialSuccess=J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(u,u.uint32());break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")){var l=J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(u.partialSuccess);if(l)return"partialSuccess."+l}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return u;var l=new J.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(u.partialSuccess!=null){if(typeof u.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");l.partialSuccess=J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(u.partialSuccess)}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")&&(c.partialSuccess=J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(u.partialSuccess,l)),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},"getTypeUrl"),i})(),n.ExportTracePartialSuccess=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportTracePartialSuccess"),i.prototype.rejectedSpans=null,i.prototype.errorMessage=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.rejectedSpans!=null&&Object.hasOwnProperty.call(u,"rejectedSpans")&&l.uint32(8).int64(u.rejectedSpans),u.errorMessage!=null&&Object.hasOwnProperty.call(u,"errorMessage")&&l.uint32(18).string(u.errorMessage),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.rejectedSpans=u.int64();break}case 2:{p.errorMessage=u.string();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){return typeof u!="object"||u===null?"object expected":u.rejectedSpans!=null&&u.hasOwnProperty("rejectedSpans")&&!X.isInteger(u.rejectedSpans)&&!(u.rejectedSpans&&X.isInteger(u.rejectedSpans.low)&&X.isInteger(u.rejectedSpans.high))?"rejectedSpans: integer|Long expected":u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&!X.isString(u.errorMessage)?"errorMessage: string expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return u;var l=new J.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return u.rejectedSpans!=null&&(X.Long?(l.rejectedSpans=X.Long.fromValue(u.rejectedSpans)).unsigned=!1:typeof u.rejectedSpans=="string"?l.rejectedSpans=parseInt(u.rejectedSpans,10):typeof u.rejectedSpans=="number"?l.rejectedSpans=u.rejectedSpans:typeof u.rejectedSpans=="object"&&(l.rejectedSpans=new X.LongBits(u.rejectedSpans.low>>>0,u.rejectedSpans.high>>>0).toNumber())),u.errorMessage!=null&&(l.errorMessage=String(u.errorMessage)),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if(l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.rejectedSpans=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.rejectedSpans=l.longs===String?"0":0;c.errorMessage=""}return u.rejectedSpans!=null&&u.hasOwnProperty("rejectedSpans")&&(typeof u.rejectedSpans=="number"?c.rejectedSpans=l.longs===String?String(u.rejectedSpans):u.rejectedSpans:c.rejectedSpans=l.longs===String?X.Long.prototype.toString.call(u.rejectedSpans):l.longs===Number?new X.LongBits(u.rejectedSpans.low>>>0,u.rejectedSpans.high>>>0).toNumber():u.rejectedSpans),u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&(c.errorMessage=u.errorMessage),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},"getTypeUrl"),i})(),n})(),o})(),r.metrics=(function(){var o={};return o.v1=(function(){var n={};return n.MetricsService=(function(){function i(a,u,l){gn.rpc.Service.call(this,a,u,l)}return s(i,"MetricsService"),(i.prototype=Object.create(gn.rpc.Service.prototype)).constructor=i,i.create=s(function(u,l,c){return new this(u,l,c)},"create"),Object.defineProperty(i.prototype.export=s(function a(u,l){return this.rpcCall(a,J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,u,l)},"export_"),"name",{value:"Export"}),i})(),n.ExportMetricsServiceRequest=(function(){function i(a){if(this.resourceMetrics=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportMetricsServiceRequest"),i.prototype.resourceMetrics=X.emptyArray,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.resourceMetrics!=null&&u.resourceMetrics.length)for(var c=0;c<u.resourceMetrics.length;++c)J.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(u.resourceMetrics[c],l.uint32(10).fork()).ldelim();return l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.resourceMetrics&&p.resourceMetrics.length||(p.resourceMetrics=[]),p.resourceMetrics.push(J.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(u,u.uint32()));break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.resourceMetrics!=null&&u.hasOwnProperty("resourceMetrics")){if(!Array.isArray(u.resourceMetrics))return"resourceMetrics: array expected";for(var l=0;l<u.resourceMetrics.length;++l){var c=J.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(u.resourceMetrics[l]);if(c)return"resourceMetrics."+c}}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return u;var l=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(u.resourceMetrics){if(!Array.isArray(u.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");l.resourceMetrics=[];for(var c=0;c<u.resourceMetrics.length;++c){if(typeof u.resourceMetrics[c]!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");l.resourceMetrics[c]=J.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(u.resourceMetrics[c])}}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceMetrics=[]),u.resourceMetrics&&u.resourceMetrics.length){c.resourceMetrics=[];for(var d=0;d<u.resourceMetrics.length;++d)c.resourceMetrics[d]=J.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(u.resourceMetrics[d],l)}return c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},"getTypeUrl"),i})(),n.ExportMetricsServiceResponse=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportMetricsServiceResponse"),i.prototype.partialSuccess=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.partialSuccess!=null&&Object.hasOwnProperty.call(u,"partialSuccess")&&J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(u.partialSuccess,l.uint32(10).fork()).ldelim(),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.partialSuccess=J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(u,u.uint32());break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")){var l=J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(u.partialSuccess);if(l)return"partialSuccess."+l}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return u;var l=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(u.partialSuccess!=null){if(typeof u.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");l.partialSuccess=J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(u.partialSuccess)}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")&&(c.partialSuccess=J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(u.partialSuccess,l)),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},"getTypeUrl"),i})(),n.ExportMetricsPartialSuccess=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportMetricsPartialSuccess"),i.prototype.rejectedDataPoints=null,i.prototype.errorMessage=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.rejectedDataPoints!=null&&Object.hasOwnProperty.call(u,"rejectedDataPoints")&&l.uint32(8).int64(u.rejectedDataPoints),u.errorMessage!=null&&Object.hasOwnProperty.call(u,"errorMessage")&&l.uint32(18).string(u.errorMessage),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.rejectedDataPoints=u.int64();break}case 2:{p.errorMessage=u.string();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){return typeof u!="object"||u===null?"object expected":u.rejectedDataPoints!=null&&u.hasOwnProperty("rejectedDataPoints")&&!X.isInteger(u.rejectedDataPoints)&&!(u.rejectedDataPoints&&X.isInteger(u.rejectedDataPoints.low)&&X.isInteger(u.rejectedDataPoints.high))?"rejectedDataPoints: integer|Long expected":u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&!X.isString(u.errorMessage)?"errorMessage: string expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return u;var l=new J.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return u.rejectedDataPoints!=null&&(X.Long?(l.rejectedDataPoints=X.Long.fromValue(u.rejectedDataPoints)).unsigned=!1:typeof u.rejectedDataPoints=="string"?l.rejectedDataPoints=parseInt(u.rejectedDataPoints,10):typeof u.rejectedDataPoints=="number"?l.rejectedDataPoints=u.rejectedDataPoints:typeof u.rejectedDataPoints=="object"&&(l.rejectedDataPoints=new X.LongBits(u.rejectedDataPoints.low>>>0,u.rejectedDataPoints.high>>>0).toNumber())),u.errorMessage!=null&&(l.errorMessage=String(u.errorMessage)),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if(l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.rejectedDataPoints=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.rejectedDataPoints=l.longs===String?"0":0;c.errorMessage=""}return u.rejectedDataPoints!=null&&u.hasOwnProperty("rejectedDataPoints")&&(typeof u.rejectedDataPoints=="number"?c.rejectedDataPoints=l.longs===String?String(u.rejectedDataPoints):u.rejectedDataPoints:c.rejectedDataPoints=l.longs===String?X.Long.prototype.toString.call(u.rejectedDataPoints):l.longs===Number?new X.LongBits(u.rejectedDataPoints.low>>>0,u.rejectedDataPoints.high>>>0).toNumber():u.rejectedDataPoints),u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&(c.errorMessage=u.errorMessage),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},"getTypeUrl"),i})(),n})(),o})(),r.logs=(function(){var o={};return o.v1=(function(){var n={};return n.LogsService=(function(){function i(a,u,l){gn.rpc.Service.call(this,a,u,l)}return s(i,"LogsService"),(i.prototype=Object.create(gn.rpc.Service.prototype)).constructor=i,i.create=s(function(u,l,c){return new this(u,l,c)},"create"),Object.defineProperty(i.prototype.export=s(function a(u,l){return this.rpcCall(a,J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,u,l)},"export_"),"name",{value:"Export"}),i})(),n.ExportLogsServiceRequest=(function(){function i(a){if(this.resourceLogs=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportLogsServiceRequest"),i.prototype.resourceLogs=X.emptyArray,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){if(l||(l=Yn.create()),u.resourceLogs!=null&&u.resourceLogs.length)for(var c=0;c<u.resourceLogs.length;++c)J.opentelemetry.proto.logs.v1.ResourceLogs.encode(u.resourceLogs[c],l.uint32(10).fork()).ldelim();return l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.resourceLogs&&p.resourceLogs.length||(p.resourceLogs=[]),p.resourceLogs.push(J.opentelemetry.proto.logs.v1.ResourceLogs.decode(u,u.uint32()));break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.resourceLogs!=null&&u.hasOwnProperty("resourceLogs")){if(!Array.isArray(u.resourceLogs))return"resourceLogs: array expected";for(var l=0;l<u.resourceLogs.length;++l){var c=J.opentelemetry.proto.logs.v1.ResourceLogs.verify(u.resourceLogs[l]);if(c)return"resourceLogs."+c}}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return u;var l=new J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(u.resourceLogs){if(!Array.isArray(u.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");l.resourceLogs=[];for(var c=0;c<u.resourceLogs.length;++c){if(typeof u.resourceLogs[c]!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");l.resourceLogs[c]=J.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(u.resourceLogs[c])}}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.resourceLogs=[]),u.resourceLogs&&u.resourceLogs.length){c.resourceLogs=[];for(var d=0;d<u.resourceLogs.length;++d)c.resourceLogs[d]=J.opentelemetry.proto.logs.v1.ResourceLogs.toObject(u.resourceLogs[d],l)}return c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},"getTypeUrl"),i})(),n.ExportLogsServiceResponse=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportLogsServiceResponse"),i.prototype.partialSuccess=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.partialSuccess!=null&&Object.hasOwnProperty.call(u,"partialSuccess")&&J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(u.partialSuccess,l.uint32(10).fork()).ldelim(),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.partialSuccess=J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(u,u.uint32());break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";if(u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")){var l=J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(u.partialSuccess);if(l)return"partialSuccess."+l}return null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return u;var l=new J.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(u.partialSuccess!=null){if(typeof u.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");l.partialSuccess=J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(u.partialSuccess)}return l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};return l.defaults&&(c.partialSuccess=null),u.partialSuccess!=null&&u.hasOwnProperty("partialSuccess")&&(c.partialSuccess=J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(u.partialSuccess,l)),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},"getTypeUrl"),i})(),n.ExportLogsPartialSuccess=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ExportLogsPartialSuccess"),i.prototype.rejectedLogRecords=null,i.prototype.errorMessage=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.rejectedLogRecords!=null&&Object.hasOwnProperty.call(u,"rejectedLogRecords")&&l.uint32(8).int64(u.rejectedLogRecords),u.errorMessage!=null&&Object.hasOwnProperty.call(u,"errorMessage")&&l.uint32(18).string(u.errorMessage),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.rejectedLogRecords=u.int64();break}case 2:{p.errorMessage=u.string();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){return typeof u!="object"||u===null?"object expected":u.rejectedLogRecords!=null&&u.hasOwnProperty("rejectedLogRecords")&&!X.isInteger(u.rejectedLogRecords)&&!(u.rejectedLogRecords&&X.isInteger(u.rejectedLogRecords.low)&&X.isInteger(u.rejectedLogRecords.high))?"rejectedLogRecords: integer|Long expected":u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&!X.isString(u.errorMessage)?"errorMessage: string expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return u;var l=new J.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return u.rejectedLogRecords!=null&&(X.Long?(l.rejectedLogRecords=X.Long.fromValue(u.rejectedLogRecords)).unsigned=!1:typeof u.rejectedLogRecords=="string"?l.rejectedLogRecords=parseInt(u.rejectedLogRecords,10):typeof u.rejectedLogRecords=="number"?l.rejectedLogRecords=u.rejectedLogRecords:typeof u.rejectedLogRecords=="object"&&(l.rejectedLogRecords=new X.LongBits(u.rejectedLogRecords.low>>>0,u.rejectedLogRecords.high>>>0).toNumber())),u.errorMessage!=null&&(l.errorMessage=String(u.errorMessage)),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};if(l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.rejectedLogRecords=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.rejectedLogRecords=l.longs===String?"0":0;c.errorMessage=""}return u.rejectedLogRecords!=null&&u.hasOwnProperty("rejectedLogRecords")&&(typeof u.rejectedLogRecords=="number"?c.rejectedLogRecords=l.longs===String?String(u.rejectedLogRecords):u.rejectedLogRecords:c.rejectedLogRecords=l.longs===String?X.Long.prototype.toString.call(u.rejectedLogRecords):l.longs===Number?new X.LongBits(u.rejectedLogRecords.low>>>0,u.rejectedLogRecords.high>>>0).toNumber():u.rejectedLogRecords),u.errorMessage!=null&&u.hasOwnProperty("errorMessage")&&(c.errorMessage=u.errorMessage),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},"getTypeUrl"),i})(),n})(),o})(),r})(),t.metrics=(function(){var r={};return r.v1=(function(){var o={};return o.MetricsData=(function(){function n(i){if(this.resourceMetrics=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"MetricsData"),n.prototype.resourceMetrics=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resourceMetrics!=null&&a.resourceMetrics.length)for(var l=0;l<a.resourceMetrics.length;++l)J.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(a.resourceMetrics[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.MetricsData;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resourceMetrics&&d.resourceMetrics.length||(d.resourceMetrics=[]),d.resourceMetrics.push(J.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceMetrics!=null&&a.hasOwnProperty("resourceMetrics")){if(!Array.isArray(a.resourceMetrics))return"resourceMetrics: array expected";for(var u=0;u<a.resourceMetrics.length;++u){var l=J.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(a.resourceMetrics[u]);if(l)return"resourceMetrics."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.MetricsData)return a;var u=new J.opentelemetry.proto.metrics.v1.MetricsData;if(a.resourceMetrics){if(!Array.isArray(a.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");u.resourceMetrics=[];for(var l=0;l<a.resourceMetrics.length;++l){if(typeof a.resourceMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");u.resourceMetrics[l]=J.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(a.resourceMetrics[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.resourceMetrics=[]),a.resourceMetrics&&a.resourceMetrics.length){l.resourceMetrics=[];for(var c=0;c<a.resourceMetrics.length;++c)l.resourceMetrics[c]=J.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(a.resourceMetrics[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.MetricsData"},"getTypeUrl"),n})(),o.ResourceMetrics=(function(){function n(i){if(this.scopeMetrics=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ResourceMetrics"),n.prototype.resource=null,n.prototype.scopeMetrics=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resource!=null&&Object.hasOwnProperty.call(a,"resource")&&J.opentelemetry.proto.resource.v1.Resource.encode(a.resource,u.uint32(10).fork()).ldelim(),a.scopeMetrics!=null&&a.scopeMetrics.length)for(var l=0;l<a.scopeMetrics.length;++l)J.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(a.scopeMetrics[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.ResourceMetrics;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resource=J.opentelemetry.proto.resource.v1.Resource.decode(a,a.uint32());break}case 2:{d.scopeMetrics&&d.scopeMetrics.length||(d.scopeMetrics=[]),d.scopeMetrics.push(J.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resource!=null&&a.hasOwnProperty("resource")){var u=J.opentelemetry.proto.resource.v1.Resource.verify(a.resource);if(u)return"resource."+u}if(a.scopeMetrics!=null&&a.hasOwnProperty("scopeMetrics")){if(!Array.isArray(a.scopeMetrics))return"scopeMetrics: array expected";for(var l=0;l<a.scopeMetrics.length;++l){var u=J.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(a.scopeMetrics[l]);if(u)return"scopeMetrics."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.ResourceMetrics)return a;var u=new J.opentelemetry.proto.metrics.v1.ResourceMetrics;if(a.resource!=null){if(typeof a.resource!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");u.resource=J.opentelemetry.proto.resource.v1.Resource.fromObject(a.resource)}if(a.scopeMetrics){if(!Array.isArray(a.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");u.scopeMetrics=[];for(var l=0;l<a.scopeMetrics.length;++l){if(typeof a.scopeMetrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");u.scopeMetrics[l]=J.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(a.scopeMetrics[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.scopeMetrics=[]),u.defaults&&(l.resource=null,l.schemaUrl=""),a.resource!=null&&a.hasOwnProperty("resource")&&(l.resource=J.opentelemetry.proto.resource.v1.Resource.toObject(a.resource,u)),a.scopeMetrics&&a.scopeMetrics.length){l.scopeMetrics=[];for(var c=0;c<a.scopeMetrics.length;++c)l.scopeMetrics[c]=J.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(a.scopeMetrics[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},"getTypeUrl"),n})(),o.ScopeMetrics=(function(){function n(i){if(this.metrics=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ScopeMetrics"),n.prototype.scope=null,n.prototype.metrics=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.scope!=null&&Object.hasOwnProperty.call(a,"scope")&&J.opentelemetry.proto.common.v1.InstrumentationScope.encode(a.scope,u.uint32(10).fork()).ldelim(),a.metrics!=null&&a.metrics.length)for(var l=0;l<a.metrics.length;++l)J.opentelemetry.proto.metrics.v1.Metric.encode(a.metrics[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.ScopeMetrics;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.decode(a,a.uint32());break}case 2:{d.metrics&&d.metrics.length||(d.metrics=[]),d.metrics.push(J.opentelemetry.proto.metrics.v1.Metric.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.scope!=null&&a.hasOwnProperty("scope")){var u=J.opentelemetry.proto.common.v1.InstrumentationScope.verify(a.scope);if(u)return"scope."+u}if(a.metrics!=null&&a.hasOwnProperty("metrics")){if(!Array.isArray(a.metrics))return"metrics: array expected";for(var l=0;l<a.metrics.length;++l){var u=J.opentelemetry.proto.metrics.v1.Metric.verify(a.metrics[l]);if(u)return"metrics."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.ScopeMetrics)return a;var u=new J.opentelemetry.proto.metrics.v1.ScopeMetrics;if(a.scope!=null){if(typeof a.scope!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");u.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(a.scope)}if(a.metrics){if(!Array.isArray(a.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");u.metrics=[];for(var l=0;l<a.metrics.length;++l){if(typeof a.metrics[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");u.metrics[l]=J.opentelemetry.proto.metrics.v1.Metric.fromObject(a.metrics[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.metrics=[]),u.defaults&&(l.scope=null,l.schemaUrl=""),a.scope!=null&&a.hasOwnProperty("scope")&&(l.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.toObject(a.scope,u)),a.metrics&&a.metrics.length){l.metrics=[];for(var c=0;c<a.metrics.length;++c)l.metrics[c]=J.opentelemetry.proto.metrics.v1.Metric.toObject(a.metrics[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},"getTypeUrl"),n})(),o.Metric=(function(){function n(a){if(this.metadata=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"Metric"),n.prototype.name=null,n.prototype.description=null,n.prototype.unit=null,n.prototype.gauge=null,n.prototype.sum=null,n.prototype.histogram=null,n.prototype.exponentialHistogram=null,n.prototype.summary=null,n.prototype.metadata=X.emptyArray;var i;return Object.defineProperty(n.prototype,"data",{get:X.oneOfGetter(i=["gauge","sum","histogram","exponentialHistogram","summary"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.name!=null&&Object.hasOwnProperty.call(u,"name")&&l.uint32(10).string(u.name),u.description!=null&&Object.hasOwnProperty.call(u,"description")&&l.uint32(18).string(u.description),u.unit!=null&&Object.hasOwnProperty.call(u,"unit")&&l.uint32(26).string(u.unit),u.gauge!=null&&Object.hasOwnProperty.call(u,"gauge")&&J.opentelemetry.proto.metrics.v1.Gauge.encode(u.gauge,l.uint32(42).fork()).ldelim(),u.sum!=null&&Object.hasOwnProperty.call(u,"sum")&&J.opentelemetry.proto.metrics.v1.Sum.encode(u.sum,l.uint32(58).fork()).ldelim(),u.histogram!=null&&Object.hasOwnProperty.call(u,"histogram")&&J.opentelemetry.proto.metrics.v1.Histogram.encode(u.histogram,l.uint32(74).fork()).ldelim(),u.exponentialHistogram!=null&&Object.hasOwnProperty.call(u,"exponentialHistogram")&&J.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(u.exponentialHistogram,l.uint32(82).fork()).ldelim(),u.summary!=null&&Object.hasOwnProperty.call(u,"summary")&&J.opentelemetry.proto.metrics.v1.Summary.encode(u.summary,l.uint32(90).fork()).ldelim(),u.metadata!=null&&u.metadata.length)for(var c=0;c<u.metadata.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.metadata[c],l.uint32(98).fork()).ldelim();return l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.Metric;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.name=u.string();break}case 2:{p.description=u.string();break}case 3:{p.unit=u.string();break}case 5:{p.gauge=J.opentelemetry.proto.metrics.v1.Gauge.decode(u,u.uint32());break}case 7:{p.sum=J.opentelemetry.proto.metrics.v1.Sum.decode(u,u.uint32());break}case 9:{p.histogram=J.opentelemetry.proto.metrics.v1.Histogram.decode(u,u.uint32());break}case 10:{p.exponentialHistogram=J.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(u,u.uint32());break}case 11:{p.summary=J.opentelemetry.proto.metrics.v1.Summary.decode(u,u.uint32());break}case 12:{p.metadata&&p.metadata.length||(p.metadata=[]),p.metadata.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.name!=null&&u.hasOwnProperty("name")&&!X.isString(u.name))return"name: string expected";if(u.description!=null&&u.hasOwnProperty("description")&&!X.isString(u.description))return"description: string expected";if(u.unit!=null&&u.hasOwnProperty("unit")&&!X.isString(u.unit))return"unit: string expected";if(u.gauge!=null&&u.hasOwnProperty("gauge")){l.data=1;{var c=J.opentelemetry.proto.metrics.v1.Gauge.verify(u.gauge);if(c)return"gauge."+c}}if(u.sum!=null&&u.hasOwnProperty("sum")){if(l.data===1)return"data: multiple values";l.data=1;{var c=J.opentelemetry.proto.metrics.v1.Sum.verify(u.sum);if(c)return"sum."+c}}if(u.histogram!=null&&u.hasOwnProperty("histogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=J.opentelemetry.proto.metrics.v1.Histogram.verify(u.histogram);if(c)return"histogram."+c}}if(u.exponentialHistogram!=null&&u.hasOwnProperty("exponentialHistogram")){if(l.data===1)return"data: multiple values";l.data=1;{var c=J.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(u.exponentialHistogram);if(c)return"exponentialHistogram."+c}}if(u.summary!=null&&u.hasOwnProperty("summary")){if(l.data===1)return"data: multiple values";l.data=1;{var c=J.opentelemetry.proto.metrics.v1.Summary.verify(u.summary);if(c)return"summary."+c}}if(u.metadata!=null&&u.hasOwnProperty("metadata")){if(!Array.isArray(u.metadata))return"metadata: array expected";for(var d=0;d<u.metadata.length;++d){var c=J.opentelemetry.proto.common.v1.KeyValue.verify(u.metadata[d]);if(c)return"metadata."+c}}return null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.Metric)return u;var l=new J.opentelemetry.proto.metrics.v1.Metric;if(u.name!=null&&(l.name=String(u.name)),u.description!=null&&(l.description=String(u.description)),u.unit!=null&&(l.unit=String(u.unit)),u.gauge!=null){if(typeof u.gauge!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");l.gauge=J.opentelemetry.proto.metrics.v1.Gauge.fromObject(u.gauge)}if(u.sum!=null){if(typeof u.sum!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");l.sum=J.opentelemetry.proto.metrics.v1.Sum.fromObject(u.sum)}if(u.histogram!=null){if(typeof u.histogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");l.histogram=J.opentelemetry.proto.metrics.v1.Histogram.fromObject(u.histogram)}if(u.exponentialHistogram!=null){if(typeof u.exponentialHistogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");l.exponentialHistogram=J.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(u.exponentialHistogram)}if(u.summary!=null){if(typeof u.summary!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");l.summary=J.opentelemetry.proto.metrics.v1.Summary.fromObject(u.summary)}if(u.metadata){if(!Array.isArray(u.metadata))throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected");l.metadata=[];for(var c=0;c<u.metadata.length;++c){if(typeof u.metadata[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected");l.metadata[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.metadata[c])}}return l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.metadata=[]),l.defaults&&(c.name="",c.description="",c.unit=""),u.name!=null&&u.hasOwnProperty("name")&&(c.name=u.name),u.description!=null&&u.hasOwnProperty("description")&&(c.description=u.description),u.unit!=null&&u.hasOwnProperty("unit")&&(c.unit=u.unit),u.gauge!=null&&u.hasOwnProperty("gauge")&&(c.gauge=J.opentelemetry.proto.metrics.v1.Gauge.toObject(u.gauge,l),l.oneofs&&(c.data="gauge")),u.sum!=null&&u.hasOwnProperty("sum")&&(c.sum=J.opentelemetry.proto.metrics.v1.Sum.toObject(u.sum,l),l.oneofs&&(c.data="sum")),u.histogram!=null&&u.hasOwnProperty("histogram")&&(c.histogram=J.opentelemetry.proto.metrics.v1.Histogram.toObject(u.histogram,l),l.oneofs&&(c.data="histogram")),u.exponentialHistogram!=null&&u.hasOwnProperty("exponentialHistogram")&&(c.exponentialHistogram=J.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(u.exponentialHistogram,l),l.oneofs&&(c.data="exponentialHistogram")),u.summary!=null&&u.hasOwnProperty("summary")&&(c.summary=J.opentelemetry.proto.metrics.v1.Summary.toObject(u.summary,l),l.oneofs&&(c.data="summary")),u.metadata&&u.metadata.length){c.metadata=[];for(var d=0;d<u.metadata.length;++d)c.metadata[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.metadata[d],l)}return c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.Metric"},"getTypeUrl"),n})(),o.Gauge=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Gauge"),n.prototype.dataPoints=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.Gauge;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.Gauge)return a;var u=new J.opentelemetry.proto.metrics.v1.Gauge;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(a.dataPoints[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(a.dataPoints[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Gauge"},"getTypeUrl"),n})(),o.Sum=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Sum"),n.prototype.dataPoints=X.emptyArray,n.prototype.aggregationTemporality=null,n.prototype.isMonotonic=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return a.aggregationTemporality!=null&&Object.hasOwnProperty.call(a,"aggregationTemporality")&&u.uint32(16).int32(a.aggregationTemporality),a.isMonotonic!=null&&Object.hasOwnProperty.call(a,"isMonotonic")&&u.uint32(24).bool(a.isMonotonic),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.Sum;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(a,a.uint32()));break}case 2:{d.aggregationTemporality=a.int32();break}case 3:{d.isMonotonic=a.bool();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}if(a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality"))switch(a.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return a.isMonotonic!=null&&a.hasOwnProperty("isMonotonic")&&typeof a.isMonotonic!="boolean"?"isMonotonic: boolean expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.Sum)return a;var u=new J.opentelemetry.proto.metrics.v1.Sum;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(a.dataPoints[l])}}switch(a.aggregationTemporality){default:if(typeof a.aggregationTemporality=="number"){u.aggregationTemporality=a.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:u.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:u.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:u.aggregationTemporality=2;break}return a.isMonotonic!=null&&(u.isMonotonic=!!a.isMonotonic),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),u.defaults&&(l.aggregationTemporality=u.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,l.isMonotonic=!1),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(a.dataPoints[c],u)}return a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=u.enums===String?J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]===void 0?a.aggregationTemporality:J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]:a.aggregationTemporality),a.isMonotonic!=null&&a.hasOwnProperty("isMonotonic")&&(l.isMonotonic=a.isMonotonic),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Sum"},"getTypeUrl"),n})(),o.Histogram=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Histogram"),n.prototype.dataPoints=X.emptyArray,n.prototype.aggregationTemporality=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return a.aggregationTemporality!=null&&Object.hasOwnProperty.call(a,"aggregationTemporality")&&u.uint32(16).int32(a.aggregationTemporality),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.Histogram;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(a,a.uint32()));break}case 2:{d.aggregationTemporality=a.int32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}if(a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality"))switch(a.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.Histogram)return a;var u=new J.opentelemetry.proto.metrics.v1.Histogram;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(a.dataPoints[l])}}switch(a.aggregationTemporality){default:if(typeof a.aggregationTemporality=="number"){u.aggregationTemporality=a.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:u.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:u.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:u.aggregationTemporality=2;break}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),u.defaults&&(l.aggregationTemporality=u.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(a.dataPoints[c],u)}return a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=u.enums===String?J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]===void 0?a.aggregationTemporality:J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]:a.aggregationTemporality),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Histogram"},"getTypeUrl"),n})(),o.ExponentialHistogram=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ExponentialHistogram"),n.prototype.dataPoints=X.emptyArray,n.prototype.aggregationTemporality=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return a.aggregationTemporality!=null&&Object.hasOwnProperty.call(a,"aggregationTemporality")&&u.uint32(16).int32(a.aggregationTemporality),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.ExponentialHistogram;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(a,a.uint32()));break}case 2:{d.aggregationTemporality=a.int32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}if(a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality"))switch(a.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.ExponentialHistogram)return a;var u=new J.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(a.dataPoints[l])}}switch(a.aggregationTemporality){default:if(typeof a.aggregationTemporality=="number"){u.aggregationTemporality=a.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:u.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:u.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:u.aggregationTemporality=2;break}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),u.defaults&&(l.aggregationTemporality=u.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(a.dataPoints[c],u)}return a.aggregationTemporality!=null&&a.hasOwnProperty("aggregationTemporality")&&(l.aggregationTemporality=u.enums===String?J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]===void 0?a.aggregationTemporality:J.opentelemetry.proto.metrics.v1.AggregationTemporality[a.aggregationTemporality]:a.aggregationTemporality),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},"getTypeUrl"),n})(),o.Summary=(function(){function n(i){if(this.dataPoints=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"Summary"),n.prototype.dataPoints=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.dataPoints!=null&&a.dataPoints.length)for(var l=0;l<a.dataPoints.length;++l)J.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(a.dataPoints[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.Summary;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.dataPoints&&d.dataPoints.length||(d.dataPoints=[]),d.dataPoints.push(J.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.dataPoints!=null&&a.hasOwnProperty("dataPoints")){if(!Array.isArray(a.dataPoints))return"dataPoints: array expected";for(var u=0;u<a.dataPoints.length;++u){var l=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(a.dataPoints[u]);if(l)return"dataPoints."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.Summary)return a;var u=new J.opentelemetry.proto.metrics.v1.Summary;if(a.dataPoints){if(!Array.isArray(a.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");u.dataPoints=[];for(var l=0;l<a.dataPoints.length;++l){if(typeof a.dataPoints[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");u.dataPoints[l]=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(a.dataPoints[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.dataPoints=[]),a.dataPoints&&a.dataPoints.length){l.dataPoints=[];for(var c=0;c<a.dataPoints.length;++c)l.dataPoints[c]=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(a.dataPoints[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Summary"},"getTypeUrl"),n})(),o.AggregationTemporality=(function(){var n={},i=Object.create(n);return i[n[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,i[n[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,i[n[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,i})(),o.DataPointFlags=(function(){var n={},i=Object.create(n);return i[n[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,i[n[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,i})(),o.NumberDataPoint=(function(){function n(a){if(this.attributes=[],this.exemplars=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"NumberDataPoint"),n.prototype.attributes=X.emptyArray,n.prototype.startTimeUnixNano=null,n.prototype.timeUnixNano=null,n.prototype.asDouble=null,n.prototype.asInt=null,n.prototype.exemplars=X.emptyArray,n.prototype.flags=null;var i;return Object.defineProperty(n.prototype,"value",{get:X.oneOfGetter(i=["asDouble","asInt"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.startTimeUnixNano!=null&&Object.hasOwnProperty.call(u,"startTimeUnixNano")&&l.uint32(17).fixed64(u.startTimeUnixNano),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(25).fixed64(u.timeUnixNano),u.asDouble!=null&&Object.hasOwnProperty.call(u,"asDouble")&&l.uint32(33).double(u.asDouble),u.exemplars!=null&&u.exemplars.length)for(var c=0;c<u.exemplars.length;++c)J.opentelemetry.proto.metrics.v1.Exemplar.encode(u.exemplars[c],l.uint32(42).fork()).ldelim();if(u.asInt!=null&&Object.hasOwnProperty.call(u,"asInt")&&l.uint32(49).sfixed64(u.asInt),u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(58).fork()).ldelim();return u.flags!=null&&Object.hasOwnProperty.call(u,"flags")&&l.uint32(64).uint32(u.flags),l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.NumberDataPoint;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 7:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 2:{p.startTimeUnixNano=u.fixed64();break}case 3:{p.timeUnixNano=u.fixed64();break}case 4:{p.asDouble=u.double();break}case 6:{p.asInt=u.sfixed64();break}case 5:{p.exemplars&&p.exemplars.length||(p.exemplars=[]),p.exemplars.push(J.opentelemetry.proto.metrics.v1.Exemplar.decode(u,u.uint32()));break}case 8:{p.flags=u.uint32();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var c=0;c<u.attributes.length;++c){var d=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[c]);if(d)return"attributes."+d}}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(u.startTimeUnixNano)&&!(u.startTimeUnixNano&&X.isInteger(u.startTimeUnixNano.low)&&X.isInteger(u.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.asDouble!=null&&u.hasOwnProperty("asDouble")&&(l.value=1,typeof u.asDouble!="number"))return"asDouble: number expected";if(u.asInt!=null&&u.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!X.isInteger(u.asInt)&&!(u.asInt&&X.isInteger(u.asInt.low)&&X.isInteger(u.asInt.high)))return"asInt: integer|Long expected"}if(u.exemplars!=null&&u.hasOwnProperty("exemplars")){if(!Array.isArray(u.exemplars))return"exemplars: array expected";for(var c=0;c<u.exemplars.length;++c){var d=J.opentelemetry.proto.metrics.v1.Exemplar.verify(u.exemplars[c]);if(d)return"exemplars."+d}}return u.flags!=null&&u.hasOwnProperty("flags")&&!X.isInteger(u.flags)?"flags: integer expected":null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.NumberDataPoint)return u;var l=new J.opentelemetry.proto.metrics.v1.NumberDataPoint;if(u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}if(u.startTimeUnixNano!=null&&(X.Long?(l.startTimeUnixNano=X.Long.fromValue(u.startTimeUnixNano)).unsigned=!1:typeof u.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(u.startTimeUnixNano,10):typeof u.startTimeUnixNano=="number"?l.startTimeUnixNano=u.startTimeUnixNano:typeof u.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber())),u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.asDouble!=null&&(l.asDouble=Number(u.asDouble)),u.asInt!=null&&(X.Long?(l.asInt=X.Long.fromValue(u.asInt)).unsigned=!1:typeof u.asInt=="string"?l.asInt=parseInt(u.asInt,10):typeof u.asInt=="number"?l.asInt=u.asInt:typeof u.asInt=="object"&&(l.asInt=new X.LongBits(u.asInt.low>>>0,u.asInt.high>>>0).toNumber())),u.exemplars){if(!Array.isArray(u.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<u.exemplars.length;++c){if(typeof u.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");l.exemplars[c]=J.opentelemetry.proto.metrics.v1.Exemplar.fromObject(u.exemplars[c])}}return u.flags!=null&&(l.flags=u.flags>>>0),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.exemplars=[],c.attributes=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.startTimeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;c.flags=0}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&(typeof u.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(u.startTimeUnixNano):u.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.startTimeUnixNano):l.longs===Number?new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber():u.startTimeUnixNano),u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.asDouble!=null&&u.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(u.asDouble)?String(u.asDouble):u.asDouble,l.oneofs&&(c.value="asDouble")),u.exemplars&&u.exemplars.length){c.exemplars=[];for(var p=0;p<u.exemplars.length;++p)c.exemplars[p]=J.opentelemetry.proto.metrics.v1.Exemplar.toObject(u.exemplars[p],l)}if(u.asInt!=null&&u.hasOwnProperty("asInt")&&(typeof u.asInt=="number"?c.asInt=l.longs===String?String(u.asInt):u.asInt:c.asInt=l.longs===String?X.Long.prototype.toString.call(u.asInt):l.longs===Number?new X.LongBits(u.asInt.low>>>0,u.asInt.high>>>0).toNumber():u.asInt,l.oneofs&&(c.value="asInt")),u.attributes&&u.attributes.length){c.attributes=[];for(var p=0;p<u.attributes.length;++p)c.attributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[p],l)}return u.flags!=null&&u.hasOwnProperty("flags")&&(c.flags=u.flags),c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},"getTypeUrl"),n})(),o.HistogramDataPoint=(function(){function n(a){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"HistogramDataPoint"),n.prototype.attributes=X.emptyArray,n.prototype.startTimeUnixNano=null,n.prototype.timeUnixNano=null,n.prototype.count=null,n.prototype.sum=null,n.prototype.bucketCounts=X.emptyArray,n.prototype.explicitBounds=X.emptyArray,n.prototype.exemplars=X.emptyArray,n.prototype.flags=null,n.prototype.min=null,n.prototype.max=null;var i;return Object.defineProperty(n.prototype,"_sum",{get:X.oneOfGetter(i=["sum"]),set:X.oneOfSetter(i)}),Object.defineProperty(n.prototype,"_min",{get:X.oneOfGetter(i=["min"]),set:X.oneOfSetter(i)}),Object.defineProperty(n.prototype,"_max",{get:X.oneOfGetter(i=["max"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.startTimeUnixNano!=null&&Object.hasOwnProperty.call(u,"startTimeUnixNano")&&l.uint32(17).fixed64(u.startTimeUnixNano),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(25).fixed64(u.timeUnixNano),u.count!=null&&Object.hasOwnProperty.call(u,"count")&&l.uint32(33).fixed64(u.count),u.sum!=null&&Object.hasOwnProperty.call(u,"sum")&&l.uint32(41).double(u.sum),u.bucketCounts!=null&&u.bucketCounts.length){l.uint32(50).fork();for(var c=0;c<u.bucketCounts.length;++c)l.fixed64(u.bucketCounts[c]);l.ldelim()}if(u.explicitBounds!=null&&u.explicitBounds.length){l.uint32(58).fork();for(var c=0;c<u.explicitBounds.length;++c)l.double(u.explicitBounds[c]);l.ldelim()}if(u.exemplars!=null&&u.exemplars.length)for(var c=0;c<u.exemplars.length;++c)J.opentelemetry.proto.metrics.v1.Exemplar.encode(u.exemplars[c],l.uint32(66).fork()).ldelim();if(u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(74).fork()).ldelim();return u.flags!=null&&Object.hasOwnProperty.call(u,"flags")&&l.uint32(80).uint32(u.flags),u.min!=null&&Object.hasOwnProperty.call(u,"min")&&l.uint32(89).double(u.min),u.max!=null&&Object.hasOwnProperty.call(u,"max")&&l.uint32(97).double(u.max),l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.HistogramDataPoint;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 9:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 2:{p.startTimeUnixNano=u.fixed64();break}case 3:{p.timeUnixNano=u.fixed64();break}case 4:{p.count=u.fixed64();break}case 5:{p.sum=u.double();break}case 6:{if(p.bucketCounts&&p.bucketCounts.length||(p.bucketCounts=[]),(m&7)===2)for(var f=u.uint32()+u.pos;u.pos<f;)p.bucketCounts.push(u.fixed64());else p.bucketCounts.push(u.fixed64());break}case 7:{if(p.explicitBounds&&p.explicitBounds.length||(p.explicitBounds=[]),(m&7)===2)for(var f=u.uint32()+u.pos;u.pos<f;)p.explicitBounds.push(u.double());else p.explicitBounds.push(u.double());break}case 8:{p.exemplars&&p.exemplars.length||(p.exemplars=[]),p.exemplars.push(J.opentelemetry.proto.metrics.v1.Exemplar.decode(u,u.uint32()));break}case 10:{p.flags=u.uint32();break}case 11:{p.min=u.double();break}case 12:{p.max=u.double();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var c=0;c<u.attributes.length;++c){var d=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[c]);if(d)return"attributes."+d}}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(u.startTimeUnixNano)&&!(u.startTimeUnixNano&&X.isInteger(u.startTimeUnixNano.low)&&X.isInteger(u.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.count!=null&&u.hasOwnProperty("count")&&!X.isInteger(u.count)&&!(u.count&&X.isInteger(u.count.low)&&X.isInteger(u.count.high)))return"count: integer|Long expected";if(u.sum!=null&&u.hasOwnProperty("sum")&&(l._sum=1,typeof u.sum!="number"))return"sum: number expected";if(u.bucketCounts!=null&&u.hasOwnProperty("bucketCounts")){if(!Array.isArray(u.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<u.bucketCounts.length;++c)if(!X.isInteger(u.bucketCounts[c])&&!(u.bucketCounts[c]&&X.isInteger(u.bucketCounts[c].low)&&X.isInteger(u.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}if(u.explicitBounds!=null&&u.hasOwnProperty("explicitBounds")){if(!Array.isArray(u.explicitBounds))return"explicitBounds: array expected";for(var c=0;c<u.explicitBounds.length;++c)if(typeof u.explicitBounds[c]!="number")return"explicitBounds: number[] expected"}if(u.exemplars!=null&&u.hasOwnProperty("exemplars")){if(!Array.isArray(u.exemplars))return"exemplars: array expected";for(var c=0;c<u.exemplars.length;++c){var d=J.opentelemetry.proto.metrics.v1.Exemplar.verify(u.exemplars[c]);if(d)return"exemplars."+d}}return u.flags!=null&&u.hasOwnProperty("flags")&&!X.isInteger(u.flags)?"flags: integer expected":u.min!=null&&u.hasOwnProperty("min")&&(l._min=1,typeof u.min!="number")?"min: number expected":u.max!=null&&u.hasOwnProperty("max")&&(l._max=1,typeof u.max!="number")?"max: number expected":null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.HistogramDataPoint)return u;var l=new J.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}if(u.startTimeUnixNano!=null&&(X.Long?(l.startTimeUnixNano=X.Long.fromValue(u.startTimeUnixNano)).unsigned=!1:typeof u.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(u.startTimeUnixNano,10):typeof u.startTimeUnixNano=="number"?l.startTimeUnixNano=u.startTimeUnixNano:typeof u.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber())),u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.count!=null&&(X.Long?(l.count=X.Long.fromValue(u.count)).unsigned=!1:typeof u.count=="string"?l.count=parseInt(u.count,10):typeof u.count=="number"?l.count=u.count:typeof u.count=="object"&&(l.count=new X.LongBits(u.count.low>>>0,u.count.high>>>0).toNumber())),u.sum!=null&&(l.sum=Number(u.sum)),u.bucketCounts){if(!Array.isArray(u.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");l.bucketCounts=[];for(var c=0;c<u.bucketCounts.length;++c)X.Long?(l.bucketCounts[c]=X.Long.fromValue(u.bucketCounts[c])).unsigned=!1:typeof u.bucketCounts[c]=="string"?l.bucketCounts[c]=parseInt(u.bucketCounts[c],10):typeof u.bucketCounts[c]=="number"?l.bucketCounts[c]=u.bucketCounts[c]:typeof u.bucketCounts[c]=="object"&&(l.bucketCounts[c]=new X.LongBits(u.bucketCounts[c].low>>>0,u.bucketCounts[c].high>>>0).toNumber())}if(u.explicitBounds){if(!Array.isArray(u.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");l.explicitBounds=[];for(var c=0;c<u.explicitBounds.length;++c)l.explicitBounds[c]=Number(u.explicitBounds[c])}if(u.exemplars){if(!Array.isArray(u.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<u.exemplars.length;++c){if(typeof u.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");l.exemplars[c]=J.opentelemetry.proto.metrics.v1.Exemplar.fromObject(u.exemplars[c])}}return u.flags!=null&&(l.flags=u.flags>>>0),u.min!=null&&(l.min=Number(u.min)),u.max!=null&&(l.max=Number(u.max)),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.bucketCounts=[],c.explicitBounds=[],c.exemplars=[],c.attributes=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.startTimeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.count=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.count=l.longs===String?"0":0;c.flags=0}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&(typeof u.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(u.startTimeUnixNano):u.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.startTimeUnixNano):l.longs===Number?new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber():u.startTimeUnixNano),u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.count!=null&&u.hasOwnProperty("count")&&(typeof u.count=="number"?c.count=l.longs===String?String(u.count):u.count:c.count=l.longs===String?X.Long.prototype.toString.call(u.count):l.longs===Number?new X.LongBits(u.count.low>>>0,u.count.high>>>0).toNumber():u.count),u.sum!=null&&u.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(u.sum)?String(u.sum):u.sum,l.oneofs&&(c._sum="sum")),u.bucketCounts&&u.bucketCounts.length){c.bucketCounts=[];for(var p=0;p<u.bucketCounts.length;++p)typeof u.bucketCounts[p]=="number"?c.bucketCounts[p]=l.longs===String?String(u.bucketCounts[p]):u.bucketCounts[p]:c.bucketCounts[p]=l.longs===String?X.Long.prototype.toString.call(u.bucketCounts[p]):l.longs===Number?new X.LongBits(u.bucketCounts[p].low>>>0,u.bucketCounts[p].high>>>0).toNumber():u.bucketCounts[p]}if(u.explicitBounds&&u.explicitBounds.length){c.explicitBounds=[];for(var p=0;p<u.explicitBounds.length;++p)c.explicitBounds[p]=l.json&&!isFinite(u.explicitBounds[p])?String(u.explicitBounds[p]):u.explicitBounds[p]}if(u.exemplars&&u.exemplars.length){c.exemplars=[];for(var p=0;p<u.exemplars.length;++p)c.exemplars[p]=J.opentelemetry.proto.metrics.v1.Exemplar.toObject(u.exemplars[p],l)}if(u.attributes&&u.attributes.length){c.attributes=[];for(var p=0;p<u.attributes.length;++p)c.attributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[p],l)}return u.flags!=null&&u.hasOwnProperty("flags")&&(c.flags=u.flags),u.min!=null&&u.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(u.min)?String(u.min):u.min,l.oneofs&&(c._min="min")),u.max!=null&&u.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(u.max)?String(u.max):u.max,l.oneofs&&(c._max="max")),c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},"getTypeUrl"),n})(),o.ExponentialHistogramDataPoint=(function(){function n(a){if(this.attributes=[],this.exemplars=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"ExponentialHistogramDataPoint"),n.prototype.attributes=X.emptyArray,n.prototype.startTimeUnixNano=null,n.prototype.timeUnixNano=null,n.prototype.count=null,n.prototype.sum=null,n.prototype.scale=null,n.prototype.zeroCount=null,n.prototype.positive=null,n.prototype.negative=null,n.prototype.flags=null,n.prototype.exemplars=X.emptyArray,n.prototype.min=null,n.prototype.max=null,n.prototype.zeroThreshold=null;var i;return Object.defineProperty(n.prototype,"_sum",{get:X.oneOfGetter(i=["sum"]),set:X.oneOfSetter(i)}),Object.defineProperty(n.prototype,"_min",{get:X.oneOfGetter(i=["min"]),set:X.oneOfSetter(i)}),Object.defineProperty(n.prototype,"_max",{get:X.oneOfGetter(i=["max"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.attributes!=null&&u.attributes.length)for(var c=0;c<u.attributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.attributes[c],l.uint32(10).fork()).ldelim();if(u.startTimeUnixNano!=null&&Object.hasOwnProperty.call(u,"startTimeUnixNano")&&l.uint32(17).fixed64(u.startTimeUnixNano),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(25).fixed64(u.timeUnixNano),u.count!=null&&Object.hasOwnProperty.call(u,"count")&&l.uint32(33).fixed64(u.count),u.sum!=null&&Object.hasOwnProperty.call(u,"sum")&&l.uint32(41).double(u.sum),u.scale!=null&&Object.hasOwnProperty.call(u,"scale")&&l.uint32(48).sint32(u.scale),u.zeroCount!=null&&Object.hasOwnProperty.call(u,"zeroCount")&&l.uint32(57).fixed64(u.zeroCount),u.positive!=null&&Object.hasOwnProperty.call(u,"positive")&&J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(u.positive,l.uint32(66).fork()).ldelim(),u.negative!=null&&Object.hasOwnProperty.call(u,"negative")&&J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(u.negative,l.uint32(74).fork()).ldelim(),u.flags!=null&&Object.hasOwnProperty.call(u,"flags")&&l.uint32(80).uint32(u.flags),u.exemplars!=null&&u.exemplars.length)for(var c=0;c<u.exemplars.length;++c)J.opentelemetry.proto.metrics.v1.Exemplar.encode(u.exemplars[c],l.uint32(90).fork()).ldelim();return u.min!=null&&Object.hasOwnProperty.call(u,"min")&&l.uint32(97).double(u.min),u.max!=null&&Object.hasOwnProperty.call(u,"max")&&l.uint32(105).double(u.max),u.zeroThreshold!=null&&Object.hasOwnProperty.call(u,"zeroThreshold")&&l.uint32(113).double(u.zeroThreshold),l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.attributes&&p.attributes.length||(p.attributes=[]),p.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 2:{p.startTimeUnixNano=u.fixed64();break}case 3:{p.timeUnixNano=u.fixed64();break}case 4:{p.count=u.fixed64();break}case 5:{p.sum=u.double();break}case 6:{p.scale=u.sint32();break}case 7:{p.zeroCount=u.fixed64();break}case 8:{p.positive=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(u,u.uint32());break}case 9:{p.negative=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(u,u.uint32());break}case 10:{p.flags=u.uint32();break}case 11:{p.exemplars&&p.exemplars.length||(p.exemplars=[]),p.exemplars.push(J.opentelemetry.proto.metrics.v1.Exemplar.decode(u,u.uint32()));break}case 12:{p.min=u.double();break}case 13:{p.max=u.double();break}case 14:{p.zeroThreshold=u.double();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.attributes!=null&&u.hasOwnProperty("attributes")){if(!Array.isArray(u.attributes))return"attributes: array expected";for(var c=0;c<u.attributes.length;++c){var d=J.opentelemetry.proto.common.v1.KeyValue.verify(u.attributes[c]);if(d)return"attributes."+d}}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(u.startTimeUnixNano)&&!(u.startTimeUnixNano&&X.isInteger(u.startTimeUnixNano.low)&&X.isInteger(u.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.count!=null&&u.hasOwnProperty("count")&&!X.isInteger(u.count)&&!(u.count&&X.isInteger(u.count.low)&&X.isInteger(u.count.high)))return"count: integer|Long expected";if(u.sum!=null&&u.hasOwnProperty("sum")&&(l._sum=1,typeof u.sum!="number"))return"sum: number expected";if(u.scale!=null&&u.hasOwnProperty("scale")&&!X.isInteger(u.scale))return"scale: integer expected";if(u.zeroCount!=null&&u.hasOwnProperty("zeroCount")&&!X.isInteger(u.zeroCount)&&!(u.zeroCount&&X.isInteger(u.zeroCount.low)&&X.isInteger(u.zeroCount.high)))return"zeroCount: integer|Long expected";if(u.positive!=null&&u.hasOwnProperty("positive")){var d=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(u.positive);if(d)return"positive."+d}if(u.negative!=null&&u.hasOwnProperty("negative")){var d=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(u.negative);if(d)return"negative."+d}if(u.flags!=null&&u.hasOwnProperty("flags")&&!X.isInteger(u.flags))return"flags: integer expected";if(u.exemplars!=null&&u.hasOwnProperty("exemplars")){if(!Array.isArray(u.exemplars))return"exemplars: array expected";for(var c=0;c<u.exemplars.length;++c){var d=J.opentelemetry.proto.metrics.v1.Exemplar.verify(u.exemplars[c]);if(d)return"exemplars."+d}}return u.min!=null&&u.hasOwnProperty("min")&&(l._min=1,typeof u.min!="number")?"min: number expected":u.max!=null&&u.hasOwnProperty("max")&&(l._max=1,typeof u.max!="number")?"max: number expected":u.zeroThreshold!=null&&u.hasOwnProperty("zeroThreshold")&&typeof u.zeroThreshold!="number"?"zeroThreshold: number expected":null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return u;var l=new J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(u.attributes){if(!Array.isArray(u.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");l.attributes=[];for(var c=0;c<u.attributes.length;++c){if(typeof u.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");l.attributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.attributes[c])}}if(u.startTimeUnixNano!=null&&(X.Long?(l.startTimeUnixNano=X.Long.fromValue(u.startTimeUnixNano)).unsigned=!1:typeof u.startTimeUnixNano=="string"?l.startTimeUnixNano=parseInt(u.startTimeUnixNano,10):typeof u.startTimeUnixNano=="number"?l.startTimeUnixNano=u.startTimeUnixNano:typeof u.startTimeUnixNano=="object"&&(l.startTimeUnixNano=new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber())),u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.count!=null&&(X.Long?(l.count=X.Long.fromValue(u.count)).unsigned=!1:typeof u.count=="string"?l.count=parseInt(u.count,10):typeof u.count=="number"?l.count=u.count:typeof u.count=="object"&&(l.count=new X.LongBits(u.count.low>>>0,u.count.high>>>0).toNumber())),u.sum!=null&&(l.sum=Number(u.sum)),u.scale!=null&&(l.scale=u.scale|0),u.zeroCount!=null&&(X.Long?(l.zeroCount=X.Long.fromValue(u.zeroCount)).unsigned=!1:typeof u.zeroCount=="string"?l.zeroCount=parseInt(u.zeroCount,10):typeof u.zeroCount=="number"?l.zeroCount=u.zeroCount:typeof u.zeroCount=="object"&&(l.zeroCount=new X.LongBits(u.zeroCount.low>>>0,u.zeroCount.high>>>0).toNumber())),u.positive!=null){if(typeof u.positive!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");l.positive=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(u.positive)}if(u.negative!=null){if(typeof u.negative!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");l.negative=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(u.negative)}if(u.flags!=null&&(l.flags=u.flags>>>0),u.exemplars){if(!Array.isArray(u.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");l.exemplars=[];for(var c=0;c<u.exemplars.length;++c){if(typeof u.exemplars[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");l.exemplars[c]=J.opentelemetry.proto.metrics.v1.Exemplar.fromObject(u.exemplars[c])}}return u.min!=null&&(l.min=Number(u.min)),u.max!=null&&(l.max=Number(u.max)),u.zeroThreshold!=null&&(l.zeroThreshold=Number(u.zeroThreshold)),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.attributes=[],c.exemplars=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.startTimeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.startTimeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;if(X.Long){var d=new X.Long(0,0,!1);c.count=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.count=l.longs===String?"0":0;if(c.scale=0,X.Long){var d=new X.Long(0,0,!1);c.zeroCount=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.zeroCount=l.longs===String?"0":0;c.positive=null,c.negative=null,c.flags=0,c.zeroThreshold=0}if(u.attributes&&u.attributes.length){c.attributes=[];for(var p=0;p<u.attributes.length;++p)c.attributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.attributes[p],l)}if(u.startTimeUnixNano!=null&&u.hasOwnProperty("startTimeUnixNano")&&(typeof u.startTimeUnixNano=="number"?c.startTimeUnixNano=l.longs===String?String(u.startTimeUnixNano):u.startTimeUnixNano:c.startTimeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.startTimeUnixNano):l.longs===Number?new X.LongBits(u.startTimeUnixNano.low>>>0,u.startTimeUnixNano.high>>>0).toNumber():u.startTimeUnixNano),u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.count!=null&&u.hasOwnProperty("count")&&(typeof u.count=="number"?c.count=l.longs===String?String(u.count):u.count:c.count=l.longs===String?X.Long.prototype.toString.call(u.count):l.longs===Number?new X.LongBits(u.count.low>>>0,u.count.high>>>0).toNumber():u.count),u.sum!=null&&u.hasOwnProperty("sum")&&(c.sum=l.json&&!isFinite(u.sum)?String(u.sum):u.sum,l.oneofs&&(c._sum="sum")),u.scale!=null&&u.hasOwnProperty("scale")&&(c.scale=u.scale),u.zeroCount!=null&&u.hasOwnProperty("zeroCount")&&(typeof u.zeroCount=="number"?c.zeroCount=l.longs===String?String(u.zeroCount):u.zeroCount:c.zeroCount=l.longs===String?X.Long.prototype.toString.call(u.zeroCount):l.longs===Number?new X.LongBits(u.zeroCount.low>>>0,u.zeroCount.high>>>0).toNumber():u.zeroCount),u.positive!=null&&u.hasOwnProperty("positive")&&(c.positive=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(u.positive,l)),u.negative!=null&&u.hasOwnProperty("negative")&&(c.negative=J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(u.negative,l)),u.flags!=null&&u.hasOwnProperty("flags")&&(c.flags=u.flags),u.exemplars&&u.exemplars.length){c.exemplars=[];for(var p=0;p<u.exemplars.length;++p)c.exemplars[p]=J.opentelemetry.proto.metrics.v1.Exemplar.toObject(u.exemplars[p],l)}return u.min!=null&&u.hasOwnProperty("min")&&(c.min=l.json&&!isFinite(u.min)?String(u.min):u.min,l.oneofs&&(c._min="min")),u.max!=null&&u.hasOwnProperty("max")&&(c.max=l.json&&!isFinite(u.max)?String(u.max):u.max,l.oneofs&&(c._max="max")),u.zeroThreshold!=null&&u.hasOwnProperty("zeroThreshold")&&(c.zeroThreshold=l.json&&!isFinite(u.zeroThreshold)?String(u.zeroThreshold):u.zeroThreshold),c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},"getTypeUrl"),n.Buckets=(function(){function a(u){if(this.bucketCounts=[],u)for(var l=Object.keys(u),c=0;c<l.length;++c)u[l[c]]!=null&&(this[l[c]]=u[l[c]])}return s(a,"Buckets"),a.prototype.offset=null,a.prototype.bucketCounts=X.emptyArray,a.create=s(function(l){return new a(l)},"create"),a.encode=s(function(l,c){if(c||(c=Yn.create()),l.offset!=null&&Object.hasOwnProperty.call(l,"offset")&&c.uint32(8).sint32(l.offset),l.bucketCounts!=null&&l.bucketCounts.length){c.uint32(18).fork();for(var d=0;d<l.bucketCounts.length;++d)c.uint64(l.bucketCounts[d]);c.ldelim()}return c},"encode"),a.encodeDelimited=s(function(l,c){return this.encode(l,c).ldelim()},"encodeDelimited"),a.decode=s(function(l,c,d){l instanceof je||(l=je.create(l));for(var p=c===void 0?l.len:l.pos+c,m=new J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;l.pos<p;){var f=l.uint32();if(f===d)break;switch(f>>>3){case 1:{m.offset=l.sint32();break}case 2:{if(m.bucketCounts&&m.bucketCounts.length||(m.bucketCounts=[]),(f&7)===2)for(var h=l.uint32()+l.pos;l.pos<h;)m.bucketCounts.push(l.uint64());else m.bucketCounts.push(l.uint64());break}default:l.skipType(f&7);break}}return m},"decode"),a.decodeDelimited=s(function(l){return l instanceof je||(l=new je(l)),this.decode(l,l.uint32())},"decodeDelimited"),a.verify=s(function(l){if(typeof l!="object"||l===null)return"object expected";if(l.offset!=null&&l.hasOwnProperty("offset")&&!X.isInteger(l.offset))return"offset: integer expected";if(l.bucketCounts!=null&&l.hasOwnProperty("bucketCounts")){if(!Array.isArray(l.bucketCounts))return"bucketCounts: array expected";for(var c=0;c<l.bucketCounts.length;++c)if(!X.isInteger(l.bucketCounts[c])&&!(l.bucketCounts[c]&&X.isInteger(l.bucketCounts[c].low)&&X.isInteger(l.bucketCounts[c].high)))return"bucketCounts: integer|Long[] expected"}return null},"verify"),a.fromObject=s(function(l){if(l instanceof J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return l;var c=new J.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(l.offset!=null&&(c.offset=l.offset|0),l.bucketCounts){if(!Array.isArray(l.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");c.bucketCounts=[];for(var d=0;d<l.bucketCounts.length;++d)X.Long?(c.bucketCounts[d]=X.Long.fromValue(l.bucketCounts[d])).unsigned=!0:typeof l.bucketCounts[d]=="string"?c.bucketCounts[d]=parseInt(l.bucketCounts[d],10):typeof l.bucketCounts[d]=="number"?c.bucketCounts[d]=l.bucketCounts[d]:typeof l.bucketCounts[d]=="object"&&(c.bucketCounts[d]=new X.LongBits(l.bucketCounts[d].low>>>0,l.bucketCounts[d].high>>>0).toNumber(!0))}return c},"fromObject"),a.toObject=s(function(l,c){c||(c={});var d={};if((c.arrays||c.defaults)&&(d.bucketCounts=[]),c.defaults&&(d.offset=0),l.offset!=null&&l.hasOwnProperty("offset")&&(d.offset=l.offset),l.bucketCounts&&l.bucketCounts.length){d.bucketCounts=[];for(var p=0;p<l.bucketCounts.length;++p)typeof l.bucketCounts[p]=="number"?d.bucketCounts[p]=c.longs===String?String(l.bucketCounts[p]):l.bucketCounts[p]:d.bucketCounts[p]=c.longs===String?X.Long.prototype.toString.call(l.bucketCounts[p]):c.longs===Number?new X.LongBits(l.bucketCounts[p].low>>>0,l.bucketCounts[p].high>>>0).toNumber(!0):l.bucketCounts[p]}return d},"toObject"),a.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),a.getTypeUrl=s(function(l){return l===void 0&&(l="type.googleapis.com"),l+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},"getTypeUrl"),a})(),n})(),o.SummaryDataPoint=(function(){function n(i){if(this.attributes=[],this.quantileValues=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"SummaryDataPoint"),n.prototype.attributes=X.emptyArray,n.prototype.startTimeUnixNano=null,n.prototype.timeUnixNano=null,n.prototype.count=null,n.prototype.sum=null,n.prototype.quantileValues=X.emptyArray,n.prototype.flags=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.startTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"startTimeUnixNano")&&u.uint32(17).fixed64(a.startTimeUnixNano),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&u.uint32(25).fixed64(a.timeUnixNano),a.count!=null&&Object.hasOwnProperty.call(a,"count")&&u.uint32(33).fixed64(a.count),a.sum!=null&&Object.hasOwnProperty.call(a,"sum")&&u.uint32(41).double(a.sum),a.quantileValues!=null&&a.quantileValues.length)for(var l=0;l<a.quantileValues.length;++l)J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(a.quantileValues[l],u.uint32(50).fork()).ldelim();if(a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(58).fork()).ldelim();return a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&u.uint32(64).uint32(a.flags),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.metrics.v1.SummaryDataPoint;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 7:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 2:{d.startTimeUnixNano=a.fixed64();break}case 3:{d.timeUnixNano=a.fixed64();break}case 4:{d.count=a.fixed64();break}case 5:{d.sum=a.double();break}case 6:{d.quantileValues&&d.quantileValues.length||(d.quantileValues=[]),d.quantileValues.push(J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(a,a.uint32()));break}case 8:{d.flags=a.uint32();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var l=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(l)return"attributes."+l}}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&!X.isInteger(a.startTimeUnixNano)&&!(a.startTimeUnixNano&&X.isInteger(a.startTimeUnixNano.low)&&X.isInteger(a.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!X.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&X.isInteger(a.timeUnixNano.low)&&X.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.count!=null&&a.hasOwnProperty("count")&&!X.isInteger(a.count)&&!(a.count&&X.isInteger(a.count.low)&&X.isInteger(a.count.high)))return"count: integer|Long expected";if(a.sum!=null&&a.hasOwnProperty("sum")&&typeof a.sum!="number")return"sum: number expected";if(a.quantileValues!=null&&a.hasOwnProperty("quantileValues")){if(!Array.isArray(a.quantileValues))return"quantileValues: array expected";for(var u=0;u<a.quantileValues.length;++u){var l=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(a.quantileValues[u]);if(l)return"quantileValues."+l}}return a.flags!=null&&a.hasOwnProperty("flags")&&!X.isInteger(a.flags)?"flags: integer expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.metrics.v1.SummaryDataPoint)return a;var u=new J.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}if(a.startTimeUnixNano!=null&&(X.Long?(u.startTimeUnixNano=X.Long.fromValue(a.startTimeUnixNano)).unsigned=!1:typeof a.startTimeUnixNano=="string"?u.startTimeUnixNano=parseInt(a.startTimeUnixNano,10):typeof a.startTimeUnixNano=="number"?u.startTimeUnixNano=a.startTimeUnixNano:typeof a.startTimeUnixNano=="object"&&(u.startTimeUnixNano=new X.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber())),a.timeUnixNano!=null&&(X.Long?(u.timeUnixNano=X.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?u.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?u.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(u.timeUnixNano=new X.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.count!=null&&(X.Long?(u.count=X.Long.fromValue(a.count)).unsigned=!1:typeof a.count=="string"?u.count=parseInt(a.count,10):typeof a.count=="number"?u.count=a.count:typeof a.count=="object"&&(u.count=new X.LongBits(a.count.low>>>0,a.count.high>>>0).toNumber())),a.sum!=null&&(u.sum=Number(a.sum)),a.quantileValues){if(!Array.isArray(a.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");u.quantileValues=[];for(var l=0;l<a.quantileValues.length;++l){if(typeof a.quantileValues[l]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");u.quantileValues[l]=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(a.quantileValues[l])}}return a.flags!=null&&(u.flags=a.flags>>>0),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.quantileValues=[],l.attributes=[]),u.defaults){if(X.Long){var c=new X.Long(0,0,!1);l.startTimeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.startTimeUnixNano=u.longs===String?"0":0;if(X.Long){var c=new X.Long(0,0,!1);l.timeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.timeUnixNano=u.longs===String?"0":0;if(X.Long){var c=new X.Long(0,0,!1);l.count=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.count=u.longs===String?"0":0;l.sum=0,l.flags=0}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&(typeof a.startTimeUnixNano=="number"?l.startTimeUnixNano=u.longs===String?String(a.startTimeUnixNano):a.startTimeUnixNano:l.startTimeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.startTimeUnixNano):u.longs===Number?new X.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber():a.startTimeUnixNano),a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?l.timeUnixNano=u.longs===String?String(a.timeUnixNano):a.timeUnixNano:l.timeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.timeUnixNano):u.longs===Number?new X.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.count!=null&&a.hasOwnProperty("count")&&(typeof a.count=="number"?l.count=u.longs===String?String(a.count):a.count:l.count=u.longs===String?X.Long.prototype.toString.call(a.count):u.longs===Number?new X.LongBits(a.count.low>>>0,a.count.high>>>0).toNumber():a.count),a.sum!=null&&a.hasOwnProperty("sum")&&(l.sum=u.json&&!isFinite(a.sum)?String(a.sum):a.sum),a.quantileValues&&a.quantileValues.length){l.quantileValues=[];for(var d=0;d<a.quantileValues.length;++d)l.quantileValues[d]=J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(a.quantileValues[d],u)}if(a.attributes&&a.attributes.length){l.attributes=[];for(var d=0;d<a.attributes.length;++d)l.attributes[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[d],u)}return a.flags!=null&&a.hasOwnProperty("flags")&&(l.flags=a.flags),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},"getTypeUrl"),n.ValueAtQuantile=(function(){function i(a){if(a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}return s(i,"ValueAtQuantile"),i.prototype.quantile=null,i.prototype.value=null,i.create=s(function(u){return new i(u)},"create"),i.encode=s(function(u,l){return l||(l=Yn.create()),u.quantile!=null&&Object.hasOwnProperty.call(u,"quantile")&&l.uint32(9).double(u.quantile),u.value!=null&&Object.hasOwnProperty.call(u,"value")&&l.uint32(17).double(u.value),l},"encode"),i.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),i.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 1:{p.quantile=u.double();break}case 2:{p.value=u.double();break}default:u.skipType(m&7);break}}return p},"decode"),i.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),i.verify=s(function(u){return typeof u!="object"||u===null?"object expected":u.quantile!=null&&u.hasOwnProperty("quantile")&&typeof u.quantile!="number"?"quantile: number expected":u.value!=null&&u.hasOwnProperty("value")&&typeof u.value!="number"?"value: number expected":null},"verify"),i.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return u;var l=new J.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return u.quantile!=null&&(l.quantile=Number(u.quantile)),u.value!=null&&(l.value=Number(u.value)),l},"fromObject"),i.toObject=s(function(u,l){l||(l={});var c={};return l.defaults&&(c.quantile=0,c.value=0),u.quantile!=null&&u.hasOwnProperty("quantile")&&(c.quantile=l.json&&!isFinite(u.quantile)?String(u.quantile):u.quantile),u.value!=null&&u.hasOwnProperty("value")&&(c.value=l.json&&!isFinite(u.value)?String(u.value):u.value),c},"toObject"),i.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),i.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},"getTypeUrl"),i})(),n})(),o.Exemplar=(function(){function n(a){if(this.filteredAttributes=[],a)for(var u=Object.keys(a),l=0;l<u.length;++l)a[u[l]]!=null&&(this[u[l]]=a[u[l]])}s(n,"Exemplar"),n.prototype.filteredAttributes=X.emptyArray,n.prototype.timeUnixNano=null,n.prototype.asDouble=null,n.prototype.asInt=null,n.prototype.spanId=null,n.prototype.traceId=null;var i;return Object.defineProperty(n.prototype,"value",{get:X.oneOfGetter(i=["asDouble","asInt"]),set:X.oneOfSetter(i)}),n.create=s(function(u){return new n(u)},"create"),n.encode=s(function(u,l){if(l||(l=Yn.create()),u.timeUnixNano!=null&&Object.hasOwnProperty.call(u,"timeUnixNano")&&l.uint32(17).fixed64(u.timeUnixNano),u.asDouble!=null&&Object.hasOwnProperty.call(u,"asDouble")&&l.uint32(25).double(u.asDouble),u.spanId!=null&&Object.hasOwnProperty.call(u,"spanId")&&l.uint32(34).bytes(u.spanId),u.traceId!=null&&Object.hasOwnProperty.call(u,"traceId")&&l.uint32(42).bytes(u.traceId),u.asInt!=null&&Object.hasOwnProperty.call(u,"asInt")&&l.uint32(49).sfixed64(u.asInt),u.filteredAttributes!=null&&u.filteredAttributes.length)for(var c=0;c<u.filteredAttributes.length;++c)J.opentelemetry.proto.common.v1.KeyValue.encode(u.filteredAttributes[c],l.uint32(58).fork()).ldelim();return l},"encode"),n.encodeDelimited=s(function(u,l){return this.encode(u,l).ldelim()},"encodeDelimited"),n.decode=s(function(u,l,c){u instanceof je||(u=je.create(u));for(var d=l===void 0?u.len:u.pos+l,p=new J.opentelemetry.proto.metrics.v1.Exemplar;u.pos<d;){var m=u.uint32();if(m===c)break;switch(m>>>3){case 7:{p.filteredAttributes&&p.filteredAttributes.length||(p.filteredAttributes=[]),p.filteredAttributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(u,u.uint32()));break}case 2:{p.timeUnixNano=u.fixed64();break}case 3:{p.asDouble=u.double();break}case 6:{p.asInt=u.sfixed64();break}case 4:{p.spanId=u.bytes();break}case 5:{p.traceId=u.bytes();break}default:u.skipType(m&7);break}}return p},"decode"),n.decodeDelimited=s(function(u){return u instanceof je||(u=new je(u)),this.decode(u,u.uint32())},"decodeDelimited"),n.verify=s(function(u){if(typeof u!="object"||u===null)return"object expected";var l={};if(u.filteredAttributes!=null&&u.hasOwnProperty("filteredAttributes")){if(!Array.isArray(u.filteredAttributes))return"filteredAttributes: array expected";for(var c=0;c<u.filteredAttributes.length;++c){var d=J.opentelemetry.proto.common.v1.KeyValue.verify(u.filteredAttributes[c]);if(d)return"filteredAttributes."+d}}if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&!X.isInteger(u.timeUnixNano)&&!(u.timeUnixNano&&X.isInteger(u.timeUnixNano.low)&&X.isInteger(u.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(u.asDouble!=null&&u.hasOwnProperty("asDouble")&&(l.value=1,typeof u.asDouble!="number"))return"asDouble: number expected";if(u.asInt!=null&&u.hasOwnProperty("asInt")){if(l.value===1)return"value: multiple values";if(l.value=1,!X.isInteger(u.asInt)&&!(u.asInt&&X.isInteger(u.asInt.low)&&X.isInteger(u.asInt.high)))return"asInt: integer|Long expected"}return u.spanId!=null&&u.hasOwnProperty("spanId")&&!(u.spanId&&typeof u.spanId.length=="number"||X.isString(u.spanId))?"spanId: buffer expected":u.traceId!=null&&u.hasOwnProperty("traceId")&&!(u.traceId&&typeof u.traceId.length=="number"||X.isString(u.traceId))?"traceId: buffer expected":null},"verify"),n.fromObject=s(function(u){if(u instanceof J.opentelemetry.proto.metrics.v1.Exemplar)return u;var l=new J.opentelemetry.proto.metrics.v1.Exemplar;if(u.filteredAttributes){if(!Array.isArray(u.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");l.filteredAttributes=[];for(var c=0;c<u.filteredAttributes.length;++c){if(typeof u.filteredAttributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");l.filteredAttributes[c]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(u.filteredAttributes[c])}}return u.timeUnixNano!=null&&(X.Long?(l.timeUnixNano=X.Long.fromValue(u.timeUnixNano)).unsigned=!1:typeof u.timeUnixNano=="string"?l.timeUnixNano=parseInt(u.timeUnixNano,10):typeof u.timeUnixNano=="number"?l.timeUnixNano=u.timeUnixNano:typeof u.timeUnixNano=="object"&&(l.timeUnixNano=new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber())),u.asDouble!=null&&(l.asDouble=Number(u.asDouble)),u.asInt!=null&&(X.Long?(l.asInt=X.Long.fromValue(u.asInt)).unsigned=!1:typeof u.asInt=="string"?l.asInt=parseInt(u.asInt,10):typeof u.asInt=="number"?l.asInt=u.asInt:typeof u.asInt=="object"&&(l.asInt=new X.LongBits(u.asInt.low>>>0,u.asInt.high>>>0).toNumber())),u.spanId!=null&&(typeof u.spanId=="string"?X.base64.decode(u.spanId,l.spanId=X.newBuffer(X.base64.length(u.spanId)),0):u.spanId.length>=0&&(l.spanId=u.spanId)),u.traceId!=null&&(typeof u.traceId=="string"?X.base64.decode(u.traceId,l.traceId=X.newBuffer(X.base64.length(u.traceId)),0):u.traceId.length>=0&&(l.traceId=u.traceId)),l},"fromObject"),n.toObject=s(function(u,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.filteredAttributes=[]),l.defaults){if(X.Long){var d=new X.Long(0,0,!1);c.timeUnixNano=l.longs===String?d.toString():l.longs===Number?d.toNumber():d}else c.timeUnixNano=l.longs===String?"0":0;l.bytes===String?c.spanId="":(c.spanId=[],l.bytes!==Array&&(c.spanId=X.newBuffer(c.spanId))),l.bytes===String?c.traceId="":(c.traceId=[],l.bytes!==Array&&(c.traceId=X.newBuffer(c.traceId)))}if(u.timeUnixNano!=null&&u.hasOwnProperty("timeUnixNano")&&(typeof u.timeUnixNano=="number"?c.timeUnixNano=l.longs===String?String(u.timeUnixNano):u.timeUnixNano:c.timeUnixNano=l.longs===String?X.Long.prototype.toString.call(u.timeUnixNano):l.longs===Number?new X.LongBits(u.timeUnixNano.low>>>0,u.timeUnixNano.high>>>0).toNumber():u.timeUnixNano),u.asDouble!=null&&u.hasOwnProperty("asDouble")&&(c.asDouble=l.json&&!isFinite(u.asDouble)?String(u.asDouble):u.asDouble,l.oneofs&&(c.value="asDouble")),u.spanId!=null&&u.hasOwnProperty("spanId")&&(c.spanId=l.bytes===String?X.base64.encode(u.spanId,0,u.spanId.length):l.bytes===Array?Array.prototype.slice.call(u.spanId):u.spanId),u.traceId!=null&&u.hasOwnProperty("traceId")&&(c.traceId=l.bytes===String?X.base64.encode(u.traceId,0,u.traceId.length):l.bytes===Array?Array.prototype.slice.call(u.traceId):u.traceId),u.asInt!=null&&u.hasOwnProperty("asInt")&&(typeof u.asInt=="number"?c.asInt=l.longs===String?String(u.asInt):u.asInt:c.asInt=l.longs===String?X.Long.prototype.toString.call(u.asInt):l.longs===Number?new X.LongBits(u.asInt.low>>>0,u.asInt.high>>>0).toNumber():u.asInt,l.oneofs&&(c.value="asInt")),u.filteredAttributes&&u.filteredAttributes.length){c.filteredAttributes=[];for(var p=0;p<u.filteredAttributes.length;++p)c.filteredAttributes[p]=J.opentelemetry.proto.common.v1.KeyValue.toObject(u.filteredAttributes[p],l)}return c},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(u){return u===void 0&&(u="type.googleapis.com"),u+"/opentelemetry.proto.metrics.v1.Exemplar"},"getTypeUrl"),n})(),o})(),r})(),t.logs=(function(){var r={};return r.v1=(function(){var o={};return o.LogsData=(function(){function n(i){if(this.resourceLogs=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"LogsData"),n.prototype.resourceLogs=X.emptyArray,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resourceLogs!=null&&a.resourceLogs.length)for(var l=0;l<a.resourceLogs.length;++l)J.opentelemetry.proto.logs.v1.ResourceLogs.encode(a.resourceLogs[l],u.uint32(10).fork()).ldelim();return u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.logs.v1.LogsData;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resourceLogs&&d.resourceLogs.length||(d.resourceLogs=[]),d.resourceLogs.push(J.opentelemetry.proto.logs.v1.ResourceLogs.decode(a,a.uint32()));break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceLogs!=null&&a.hasOwnProperty("resourceLogs")){if(!Array.isArray(a.resourceLogs))return"resourceLogs: array expected";for(var u=0;u<a.resourceLogs.length;++u){var l=J.opentelemetry.proto.logs.v1.ResourceLogs.verify(a.resourceLogs[u]);if(l)return"resourceLogs."+l}}return null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.logs.v1.LogsData)return a;var u=new J.opentelemetry.proto.logs.v1.LogsData;if(a.resourceLogs){if(!Array.isArray(a.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");u.resourceLogs=[];for(var l=0;l<a.resourceLogs.length;++l){if(typeof a.resourceLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");u.resourceLogs[l]=J.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(a.resourceLogs[l])}}return u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.resourceLogs=[]),a.resourceLogs&&a.resourceLogs.length){l.resourceLogs=[];for(var c=0;c<a.resourceLogs.length;++c)l.resourceLogs[c]=J.opentelemetry.proto.logs.v1.ResourceLogs.toObject(a.resourceLogs[c],u)}return l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.logs.v1.LogsData"},"getTypeUrl"),n})(),o.ResourceLogs=(function(){function n(i){if(this.scopeLogs=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ResourceLogs"),n.prototype.resource=null,n.prototype.scopeLogs=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.resource!=null&&Object.hasOwnProperty.call(a,"resource")&&J.opentelemetry.proto.resource.v1.Resource.encode(a.resource,u.uint32(10).fork()).ldelim(),a.scopeLogs!=null&&a.scopeLogs.length)for(var l=0;l<a.scopeLogs.length;++l)J.opentelemetry.proto.logs.v1.ScopeLogs.encode(a.scopeLogs[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.logs.v1.ResourceLogs;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.resource=J.opentelemetry.proto.resource.v1.Resource.decode(a,a.uint32());break}case 2:{d.scopeLogs&&d.scopeLogs.length||(d.scopeLogs=[]),d.scopeLogs.push(J.opentelemetry.proto.logs.v1.ScopeLogs.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resource!=null&&a.hasOwnProperty("resource")){var u=J.opentelemetry.proto.resource.v1.Resource.verify(a.resource);if(u)return"resource."+u}if(a.scopeLogs!=null&&a.hasOwnProperty("scopeLogs")){if(!Array.isArray(a.scopeLogs))return"scopeLogs: array expected";for(var l=0;l<a.scopeLogs.length;++l){var u=J.opentelemetry.proto.logs.v1.ScopeLogs.verify(a.scopeLogs[l]);if(u)return"scopeLogs."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.logs.v1.ResourceLogs)return a;var u=new J.opentelemetry.proto.logs.v1.ResourceLogs;if(a.resource!=null){if(typeof a.resource!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");u.resource=J.opentelemetry.proto.resource.v1.Resource.fromObject(a.resource)}if(a.scopeLogs){if(!Array.isArray(a.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");u.scopeLogs=[];for(var l=0;l<a.scopeLogs.length;++l){if(typeof a.scopeLogs[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");u.scopeLogs[l]=J.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(a.scopeLogs[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.scopeLogs=[]),u.defaults&&(l.resource=null,l.schemaUrl=""),a.resource!=null&&a.hasOwnProperty("resource")&&(l.resource=J.opentelemetry.proto.resource.v1.Resource.toObject(a.resource,u)),a.scopeLogs&&a.scopeLogs.length){l.scopeLogs=[];for(var c=0;c<a.scopeLogs.length;++c)l.scopeLogs[c]=J.opentelemetry.proto.logs.v1.ScopeLogs.toObject(a.scopeLogs[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.logs.v1.ResourceLogs"},"getTypeUrl"),n})(),o.ScopeLogs=(function(){function n(i){if(this.logRecords=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"ScopeLogs"),n.prototype.scope=null,n.prototype.logRecords=X.emptyArray,n.prototype.schemaUrl=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.scope!=null&&Object.hasOwnProperty.call(a,"scope")&&J.opentelemetry.proto.common.v1.InstrumentationScope.encode(a.scope,u.uint32(10).fork()).ldelim(),a.logRecords!=null&&a.logRecords.length)for(var l=0;l<a.logRecords.length;++l)J.opentelemetry.proto.logs.v1.LogRecord.encode(a.logRecords[l],u.uint32(18).fork()).ldelim();return a.schemaUrl!=null&&Object.hasOwnProperty.call(a,"schemaUrl")&&u.uint32(26).string(a.schemaUrl),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.logs.v1.ScopeLogs;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.decode(a,a.uint32());break}case 2:{d.logRecords&&d.logRecords.length||(d.logRecords=[]),d.logRecords.push(J.opentelemetry.proto.logs.v1.LogRecord.decode(a,a.uint32()));break}case 3:{d.schemaUrl=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.scope!=null&&a.hasOwnProperty("scope")){var u=J.opentelemetry.proto.common.v1.InstrumentationScope.verify(a.scope);if(u)return"scope."+u}if(a.logRecords!=null&&a.hasOwnProperty("logRecords")){if(!Array.isArray(a.logRecords))return"logRecords: array expected";for(var l=0;l<a.logRecords.length;++l){var u=J.opentelemetry.proto.logs.v1.LogRecord.verify(a.logRecords[l]);if(u)return"logRecords."+u}}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&!X.isString(a.schemaUrl)?"schemaUrl: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.logs.v1.ScopeLogs)return a;var u=new J.opentelemetry.proto.logs.v1.ScopeLogs;if(a.scope!=null){if(typeof a.scope!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");u.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(a.scope)}if(a.logRecords){if(!Array.isArray(a.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");u.logRecords=[];for(var l=0;l<a.logRecords.length;++l){if(typeof a.logRecords[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");u.logRecords[l]=J.opentelemetry.proto.logs.v1.LogRecord.fromObject(a.logRecords[l])}}return a.schemaUrl!=null&&(u.schemaUrl=String(a.schemaUrl)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.logRecords=[]),u.defaults&&(l.scope=null,l.schemaUrl=""),a.scope!=null&&a.hasOwnProperty("scope")&&(l.scope=J.opentelemetry.proto.common.v1.InstrumentationScope.toObject(a.scope,u)),a.logRecords&&a.logRecords.length){l.logRecords=[];for(var c=0;c<a.logRecords.length;++c)l.logRecords[c]=J.opentelemetry.proto.logs.v1.LogRecord.toObject(a.logRecords[c],u)}return a.schemaUrl!=null&&a.hasOwnProperty("schemaUrl")&&(l.schemaUrl=a.schemaUrl),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.logs.v1.ScopeLogs"},"getTypeUrl"),n})(),o.SeverityNumber=(function(){var n={},i=Object.create(n);return i[n[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,i[n[1]="SEVERITY_NUMBER_TRACE"]=1,i[n[2]="SEVERITY_NUMBER_TRACE2"]=2,i[n[3]="SEVERITY_NUMBER_TRACE3"]=3,i[n[4]="SEVERITY_NUMBER_TRACE4"]=4,i[n[5]="SEVERITY_NUMBER_DEBUG"]=5,i[n[6]="SEVERITY_NUMBER_DEBUG2"]=6,i[n[7]="SEVERITY_NUMBER_DEBUG3"]=7,i[n[8]="SEVERITY_NUMBER_DEBUG4"]=8,i[n[9]="SEVERITY_NUMBER_INFO"]=9,i[n[10]="SEVERITY_NUMBER_INFO2"]=10,i[n[11]="SEVERITY_NUMBER_INFO3"]=11,i[n[12]="SEVERITY_NUMBER_INFO4"]=12,i[n[13]="SEVERITY_NUMBER_WARN"]=13,i[n[14]="SEVERITY_NUMBER_WARN2"]=14,i[n[15]="SEVERITY_NUMBER_WARN3"]=15,i[n[16]="SEVERITY_NUMBER_WARN4"]=16,i[n[17]="SEVERITY_NUMBER_ERROR"]=17,i[n[18]="SEVERITY_NUMBER_ERROR2"]=18,i[n[19]="SEVERITY_NUMBER_ERROR3"]=19,i[n[20]="SEVERITY_NUMBER_ERROR4"]=20,i[n[21]="SEVERITY_NUMBER_FATAL"]=21,i[n[22]="SEVERITY_NUMBER_FATAL2"]=22,i[n[23]="SEVERITY_NUMBER_FATAL3"]=23,i[n[24]="SEVERITY_NUMBER_FATAL4"]=24,i})(),o.LogRecordFlags=(function(){var n={},i=Object.create(n);return i[n[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,i[n[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,i})(),o.LogRecord=(function(){function n(i){if(this.attributes=[],i)for(var a=Object.keys(i),u=0;u<a.length;++u)i[a[u]]!=null&&(this[a[u]]=i[a[u]])}return s(n,"LogRecord"),n.prototype.timeUnixNano=null,n.prototype.observedTimeUnixNano=null,n.prototype.severityNumber=null,n.prototype.severityText=null,n.prototype.body=null,n.prototype.attributes=X.emptyArray,n.prototype.droppedAttributesCount=null,n.prototype.flags=null,n.prototype.traceId=null,n.prototype.spanId=null,n.prototype.eventName=null,n.create=s(function(a){return new n(a)},"create"),n.encode=s(function(a,u){if(u||(u=Yn.create()),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&u.uint32(9).fixed64(a.timeUnixNano),a.severityNumber!=null&&Object.hasOwnProperty.call(a,"severityNumber")&&u.uint32(16).int32(a.severityNumber),a.severityText!=null&&Object.hasOwnProperty.call(a,"severityText")&&u.uint32(26).string(a.severityText),a.body!=null&&Object.hasOwnProperty.call(a,"body")&&J.opentelemetry.proto.common.v1.AnyValue.encode(a.body,u.uint32(42).fork()).ldelim(),a.attributes!=null&&a.attributes.length)for(var l=0;l<a.attributes.length;++l)J.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[l],u.uint32(50).fork()).ldelim();return a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&u.uint32(56).uint32(a.droppedAttributesCount),a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&u.uint32(69).fixed32(a.flags),a.traceId!=null&&Object.hasOwnProperty.call(a,"traceId")&&u.uint32(74).bytes(a.traceId),a.spanId!=null&&Object.hasOwnProperty.call(a,"spanId")&&u.uint32(82).bytes(a.spanId),a.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"observedTimeUnixNano")&&u.uint32(89).fixed64(a.observedTimeUnixNano),a.eventName!=null&&Object.hasOwnProperty.call(a,"eventName")&&u.uint32(98).string(a.eventName),u},"encode"),n.encodeDelimited=s(function(a,u){return this.encode(a,u).ldelim()},"encodeDelimited"),n.decode=s(function(a,u,l){a instanceof je||(a=je.create(a));for(var c=u===void 0?a.len:a.pos+u,d=new J.opentelemetry.proto.logs.v1.LogRecord;a.pos<c;){var p=a.uint32();if(p===l)break;switch(p>>>3){case 1:{d.timeUnixNano=a.fixed64();break}case 11:{d.observedTimeUnixNano=a.fixed64();break}case 2:{d.severityNumber=a.int32();break}case 3:{d.severityText=a.string();break}case 5:{d.body=J.opentelemetry.proto.common.v1.AnyValue.decode(a,a.uint32());break}case 6:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(J.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 7:{d.droppedAttributesCount=a.uint32();break}case 8:{d.flags=a.fixed32();break}case 9:{d.traceId=a.bytes();break}case 10:{d.spanId=a.bytes();break}case 12:{d.eventName=a.string();break}default:a.skipType(p&7);break}}return d},"decode"),n.decodeDelimited=s(function(a){return a instanceof je||(a=new je(a)),this.decode(a,a.uint32())},"decodeDelimited"),n.verify=s(function(a){if(typeof a!="object"||a===null)return"object expected";if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!X.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&X.isInteger(a.timeUnixNano.low)&&X.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.observedTimeUnixNano!=null&&a.hasOwnProperty("observedTimeUnixNano")&&!X.isInteger(a.observedTimeUnixNano)&&!(a.observedTimeUnixNano&&X.isInteger(a.observedTimeUnixNano.low)&&X.isInteger(a.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected";if(a.severityNumber!=null&&a.hasOwnProperty("severityNumber"))switch(a.severityNumber){default:return"severityNumber: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(a.severityText!=null&&a.hasOwnProperty("severityText")&&!X.isString(a.severityText))return"severityText: string expected";if(a.body!=null&&a.hasOwnProperty("body")){var u=J.opentelemetry.proto.common.v1.AnyValue.verify(a.body);if(u)return"body."+u}if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var l=0;l<a.attributes.length;++l){var u=J.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[l]);if(u)return"attributes."+u}}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!X.isInteger(a.droppedAttributesCount)?"droppedAttributesCount: integer expected":a.flags!=null&&a.hasOwnProperty("flags")&&!X.isInteger(a.flags)?"flags: integer expected":a.traceId!=null&&a.hasOwnProperty("traceId")&&!(a.traceId&&typeof a.traceId.length=="number"||X.isString(a.traceId))?"traceId: buffer expected":a.spanId!=null&&a.hasOwnProperty("spanId")&&!(a.spanId&&typeof a.spanId.length=="number"||X.isString(a.spanId))?"spanId: buffer expected":a.eventName!=null&&a.hasOwnProperty("eventName")&&!X.isString(a.eventName)?"eventName: string expected":null},"verify"),n.fromObject=s(function(a){if(a instanceof J.opentelemetry.proto.logs.v1.LogRecord)return a;var u=new J.opentelemetry.proto.logs.v1.LogRecord;switch(a.timeUnixNano!=null&&(X.Long?(u.timeUnixNano=X.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?u.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?u.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(u.timeUnixNano=new X.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.observedTimeUnixNano!=null&&(X.Long?(u.observedTimeUnixNano=X.Long.fromValue(a.observedTimeUnixNano)).unsigned=!1:typeof a.observedTimeUnixNano=="string"?u.observedTimeUnixNano=parseInt(a.observedTimeUnixNano,10):typeof a.observedTimeUnixNano=="number"?u.observedTimeUnixNano=a.observedTimeUnixNano:typeof a.observedTimeUnixNano=="object"&&(u.observedTimeUnixNano=new X.LongBits(a.observedTimeUnixNano.low>>>0,a.observedTimeUnixNano.high>>>0).toNumber())),a.severityNumber){default:if(typeof a.severityNumber=="number"){u.severityNumber=a.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:u.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:u.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:u.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:u.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:u.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:u.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:u.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:u.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:u.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:u.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:u.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:u.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:u.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:u.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:u.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:u.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:u.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:u.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:u.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:u.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:u.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:u.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:u.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:u.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:u.severityNumber=24;break}if(a.severityText!=null&&(u.severityText=String(a.severityText)),a.body!=null){if(typeof a.body!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");u.body=J.opentelemetry.proto.common.v1.AnyValue.fromObject(a.body)}if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");u.attributes=[];for(var l=0;l<a.attributes.length;++l){if(typeof a.attributes[l]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");u.attributes[l]=J.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[l])}}return a.droppedAttributesCount!=null&&(u.droppedAttributesCount=a.droppedAttributesCount>>>0),a.flags!=null&&(u.flags=a.flags>>>0),a.traceId!=null&&(typeof a.traceId=="string"?X.base64.decode(a.traceId,u.traceId=X.newBuffer(X.base64.length(a.traceId)),0):a.traceId.length>=0&&(u.traceId=a.traceId)),a.spanId!=null&&(typeof a.spanId=="string"?X.base64.decode(a.spanId,u.spanId=X.newBuffer(X.base64.length(a.spanId)),0):a.spanId.length>=0&&(u.spanId=a.spanId)),a.eventName!=null&&(u.eventName=String(a.eventName)),u},"fromObject"),n.toObject=s(function(a,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.attributes=[]),u.defaults){if(X.Long){var c=new X.Long(0,0,!1);l.timeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.timeUnixNano=u.longs===String?"0":0;if(l.severityNumber=u.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,l.severityText="",l.body=null,l.droppedAttributesCount=0,l.flags=0,u.bytes===String?l.traceId="":(l.traceId=[],u.bytes!==Array&&(l.traceId=X.newBuffer(l.traceId))),u.bytes===String?l.spanId="":(l.spanId=[],u.bytes!==Array&&(l.spanId=X.newBuffer(l.spanId))),X.Long){var c=new X.Long(0,0,!1);l.observedTimeUnixNano=u.longs===String?c.toString():u.longs===Number?c.toNumber():c}else l.observedTimeUnixNano=u.longs===String?"0":0;l.eventName=""}if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?l.timeUnixNano=u.longs===String?String(a.timeUnixNano):a.timeUnixNano:l.timeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.timeUnixNano):u.longs===Number?new X.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.severityNumber!=null&&a.hasOwnProperty("severityNumber")&&(l.severityNumber=u.enums===String?J.opentelemetry.proto.logs.v1.SeverityNumber[a.severityNumber]===void 0?a.severityNumber:J.opentelemetry.proto.logs.v1.SeverityNumber[a.severityNumber]:a.severityNumber),a.severityText!=null&&a.hasOwnProperty("severityText")&&(l.severityText=a.severityText),a.body!=null&&a.hasOwnProperty("body")&&(l.body=J.opentelemetry.proto.common.v1.AnyValue.toObject(a.body,u)),a.attributes&&a.attributes.length){l.attributes=[];for(var d=0;d<a.attributes.length;++d)l.attributes[d]=J.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[d],u)}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(l.droppedAttributesCount=a.droppedAttributesCount),a.flags!=null&&a.hasOwnProperty("flags")&&(l.flags=a.flags),a.traceId!=null&&a.hasOwnProperty("traceId")&&(l.traceId=u.bytes===String?X.base64.encode(a.traceId,0,a.traceId.length):u.bytes===Array?Array.prototype.slice.call(a.traceId):a.traceId),a.spanId!=null&&a.hasOwnProperty("spanId")&&(l.spanId=u.bytes===String?X.base64.encode(a.spanId,0,a.spanId.length):u.bytes===Array?Array.prototype.slice.call(a.spanId):a.spanId),a.observedTimeUnixNano!=null&&a.hasOwnProperty("observedTimeUnixNano")&&(typeof a.observedTimeUnixNano=="number"?l.observedTimeUnixNano=u.longs===String?String(a.observedTimeUnixNano):a.observedTimeUnixNano:l.observedTimeUnixNano=u.longs===String?X.Long.prototype.toString.call(a.observedTimeUnixNano):u.longs===Number?new X.LongBits(a.observedTimeUnixNano.low>>>0,a.observedTimeUnixNano.high>>>0).toNumber():a.observedTimeUnixNano),a.eventName!=null&&a.hasOwnProperty("eventName")&&(l.eventName=a.eventName),l},"toObject"),n.prototype.toJSON=s(function(){return this.constructor.toObject(this,gn.util.toJSONOptions)},"toJSON"),n.getTypeUrl=s(function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.logs.v1.LogRecord"},"getTypeUrl"),n})(),o})(),r})(),t})(),e})();D8n.exports=J});var KAe=z(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.toAnyValue=wg.toKeyValue=wg.toAttributes=wg.createInstrumentationScope=wg.createResource=void 0;function esa(e,t){let r={attributes:N8n(e.attributes,t),droppedAttributesCount:0},o=e.schemaUrl;return o&&o!==""&&(r.schemaUrl=o),r}s(esa,"createResource");wg.createResource=esa;function tsa(e){return{name:e.name,version:e.version}}s(tsa,"createInstrumentationScope");wg.createInstrumentationScope=tsa;function N8n(e,t){return Object.keys(e).map(r=>z8n(r,e[r],t))}s(N8n,"toAttributes");wg.toAttributes=N8n;function z8n(e,t,r){return{key:e,value:HAe(t,r)}}s(z8n,"toKeyValue");wg.toKeyValue=z8n;function HAe(e,t){let r=typeof e;if(r==="string")return{stringValue:e};if(r==="number")return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(r==="boolean")return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let o=new Array(e.length);for(let n=0;n<e.length;n++)o[n]=HAe(e[n],t);return{arrayValue:{values:o}}}if(r==="object"&&e!=null){let o=Object.keys(e),n=new Array(o.length);for(let i=0;i<o.length;i++)n[i]={key:o[i],value:HAe(e[o[i]],t)};return{kvlistValue:{values:n}}}return{}}s(HAe,"toAnyValue");wg.toAnyValue=HAe});var uFt=z(JL=>{"use strict";Object.defineProperty(JL,"__esModule",{value:!0});JL.toLogAttributes=JL.createExportLogsServiceRequest=void 0;var JAe=KAe();function rsa(e,t){return{resourceLogs:osa(e,t)}}s(rsa,"createExportLogsServiceRequest");JL.createExportLogsServiceRequest=rsa;function nsa(e){let t=new Map;for(let r of e){let{resource:o,instrumentationScope:{name:n,version:i="",schemaUrl:a=""}}=r,u=t.get(o);u||(u=new Map,t.set(o,u));let l=`${n}@${i}:${a}`,c=u.get(l);c||(c=[],u.set(l,c)),c.push(r)}return t}s(nsa,"createResourceMap");function osa(e,t){let r=nsa(e);return Array.from(r,([o,n])=>{let i=(0,JAe.createResource)(o,t);return{resource:i,scopeLogs:Array.from(n,([,a])=>({scope:(0,JAe.createInstrumentationScope)(a[0].instrumentationScope),logRecords:a.map(u=>isa(u,t)),schemaUrl:a[0].instrumentationScope.schemaUrl})),schemaUrl:i.schemaUrl}})}s(osa,"logRecordsToResourceLogs");function isa(e,t){return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:(0,JAe.toAnyValue)(e.body,t),eventName:e.eventName,attributes:j8n(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:e.spanContext?.traceFlags,traceId:t.encodeOptionalSpanContext(e.spanContext?.traceId),spanId:t.encodeOptionalSpanContext(e.spanContext?.spanId)}}s(isa,"toLogRecord");function j8n(e,t){return Object.keys(e).map(r=>(0,JAe.toKeyValue)(r,e[r],t))}s(j8n,"toLogAttributes");JL.toLogAttributes=j8n});var B8n=z(QAe=>{"use strict";Object.defineProperty(QAe,"__esModule",{value:!0});QAe.hexToBinary=void 0;function L8n(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}s(L8n,"intValue");function asa(e){let t=new Uint8Array(e.length/2),r=0;for(let o=0;o<e.length;o+=2){let n=L8n(e.charCodeAt(o)),i=L8n(e.charCodeAt(o+1));t[r++]=n<<4|i}return t}s(asa,"hexToBinary");QAe.hexToBinary=asa});var X5=z(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});m0.JSON_ENCODER=m0.PROTOBUF_ENCODER=m0.encodeAsString=m0.encodeAsLongBits=m0.toLongBits=m0.hrTimeToNanos=void 0;var ssa=ps(),U8n=B8n();function cFt(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}s(cFt,"hrTimeToNanos");m0.hrTimeToNanos=cFt;function F8n(e){let t=Number(BigInt.asUintN(32,e)),r=Number(BigInt.asUintN(32,e>>BigInt(32)));return{low:t,high:r}}s(F8n,"toLongBits");m0.toLongBits=F8n;function q8n(e){let t=cFt(e);return F8n(t)}s(q8n,"encodeAsLongBits");m0.encodeAsLongBits=q8n;function Z8n(e){return cFt(e).toString()}s(Z8n,"encodeAsString");m0.encodeAsString=Z8n;var usa=typeof BigInt<"u"?Z8n:ssa.hrTimeToNanoseconds;function lFt(e){return e}s(lFt,"identity");function lsa(e){if(e!==void 0)return(0,U8n.hexToBinary)(e)}s(lsa,"optionalHexToBinary");m0.PROTOBUF_ENCODER={encodeHrTime:q8n,encodeSpanContext:U8n.hexToBinary,encodeOptionalSpanContext:lsa,encodeUint8Array:lFt};m0.JSON_ENCODER={encodeHrTime:usa,encodeSpanContext:lFt,encodeOptionalSpanContext:lFt,encodeUint8Array:s(e=>{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");let t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=String.fromCharCode(e[r]);return btoa(t.join(""))},"encodeUint8Array")}});var G8n=z(YAe=>{"use strict";Object.defineProperty(YAe,"__esModule",{value:!0});YAe.ProtobufLogsSerializer=void 0;var V8n=WAe(),csa=uFt(),dsa=X5(),psa=V8n.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,msa=V8n.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;YAe.ProtobufLogsSerializer={serializeRequest:s(e=>{let t=(0,csa.createExportLogsServiceRequest)(e,dsa.PROTOBUF_ENCODER);return msa.encode(t).finish()},"serializeRequest"),deserializeResponse:s(e=>psa.decode(e),"deserializeResponse")}});var W8n=z(XAe=>{"use strict";Object.defineProperty(XAe,"__esModule",{value:!0});XAe.ProtobufLogsSerializer=void 0;var fsa=G8n();Object.defineProperty(XAe,"ProtobufLogsSerializer",{enumerable:!0,get:s(function(){return fsa.ProtobufLogsSerializer},"get")})});var H8n=z(Ree=>{"use strict";Object.defineProperty(Ree,"__esModule",{value:!0});Ree.EAggregationTemporality=void 0;var hsa;(function(e){e[e.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",e[e.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",e[e.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(hsa=Ree.EAggregationTemporality||(Ree.EAggregationTemporality={}))});var dFt=z(_x=>{"use strict";Object.defineProperty(_x,"__esModule",{value:!0});_x.createExportMetricsServiceRequest=_x.toMetric=_x.toScopeMetrics=_x.toResourceMetrics=void 0;var K8n=(fn(),Mr(co)),QL=OAe(),J8n=H8n(),Mee=KAe();function Y8n(e,t){let r=(0,Mee.createResource)(e.resource,t);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:X8n(e.scopeMetrics,t)}}s(Y8n,"toResourceMetrics");_x.toResourceMetrics=Y8n;function X8n(e,t){return Array.from(e.map(r=>({scope:(0,Mee.createInstrumentationScope)(r.scope),metrics:r.metrics.map(o=>ejn(o,t)),schemaUrl:r.scope.schemaUrl})))}s(X8n,"toScopeMetrics");_x.toScopeMetrics=X8n;function ejn(e,t){let r={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},o=vsa(e.aggregationTemporality);switch(e.dataPointType){case QL.DataPointType.SUM:r.sum={aggregationTemporality:o,isMonotonic:e.isMonotonic,dataPoints:Q8n(e,t)};break;case QL.DataPointType.GAUGE:r.gauge={dataPoints:Q8n(e,t)};break;case QL.DataPointType.HISTOGRAM:r.histogram={aggregationTemporality:o,dataPoints:_sa(e,t)};break;case QL.DataPointType.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:o,dataPoints:ysa(e,t)};break}return r}s(ejn,"toMetric");_x.toMetric=ejn;function gsa(e,t,r){let o={attributes:(0,Mee.toAttributes)(e.attributes,r),startTimeUnixNano:r.encodeHrTime(e.startTime),timeUnixNano:r.encodeHrTime(e.endTime)};switch(t){case K8n.ValueType.INT:o.asInt=e.value;break;case K8n.ValueType.DOUBLE:o.asDouble=e.value;break}return o}s(gsa,"toSingularDataPoint");function Q8n(e,t){return e.dataPoints.map(r=>gsa(r,e.descriptor.valueType,t))}s(Q8n,"toSingularDataPoints");function _sa(e,t){return e.dataPoints.map(r=>{let o=r.value;return{attributes:(0,Mee.toAttributes)(r.attributes,t),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}s(_sa,"toHistogramDataPoints");function ysa(e,t){return e.dataPoints.map(r=>{let o=r.value;return{attributes:(0,Mee.toAttributes)(r.attributes,t),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}s(ysa,"toExponentialHistogramDataPoints");function vsa(e){switch(e){case QL.AggregationTemporality.DELTA:return J8n.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA;case QL.AggregationTemporality.CUMULATIVE:return J8n.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE}}s(vsa,"toAggregationTemporality");function xsa(e,t){return{resourceMetrics:e.map(r=>Y8n(r,t))}}s(xsa,"createExportMetricsServiceRequest");_x.createExportMetricsServiceRequest=xsa});var rjn=z(ePe=>{"use strict";Object.defineProperty(ePe,"__esModule",{value:!0});ePe.ProtobufMetricsSerializer=void 0;var tjn=WAe(),bsa=dFt(),wsa=X5(),ksa=tjn.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Ssa=tjn.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;ePe.ProtobufMetricsSerializer={serializeRequest:s(e=>{let t=(0,bsa.createExportMetricsServiceRequest)([e],wsa.PROTOBUF_ENCODER);return Ssa.encode(t).finish()},"serializeRequest"),deserializeResponse:s(e=>ksa.decode(e),"deserializeResponse")}});var njn=z(tPe=>{"use strict";Object.defineProperty(tPe,"__esModule",{value:!0});tPe.ProtobufMetricsSerializer=void 0;var Isa=rjn();Object.defineProperty(tPe,"ProtobufMetricsSerializer",{enumerable:!0,get:s(function(){return Isa.ProtobufMetricsSerializer},"get")})});var pFt=z(yx=>{"use strict";Object.defineProperty(yx,"__esModule",{value:!0});yx.createExportTraceServiceRequest=yx.toOtlpSpanEvent=yx.toOtlpLink=yx.sdkSpanToOtlpSpan=void 0;var $ee=KAe(),Tsa=256,Esa=512;function ojn(e,t){let r=e&255|Tsa;return t&&(r|=Esa),r}s(ojn,"buildSpanFlagsFrom");function ijn(e,t){let r=e.spanContext(),o=e.status,n=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:n,traceState:r.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:(0,$ee.toAttributes)(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(i=>sjn(i,t)),droppedEventsCount:e.droppedEventsCount,status:{code:o.code,message:o.message},links:e.links.map(i=>ajn(i,t)),droppedLinksCount:e.droppedLinksCount,flags:ojn(r.traceFlags,e.parentSpanContext?.isRemote)}}s(ijn,"sdkSpanToOtlpSpan");yx.sdkSpanToOtlpSpan=ijn;function ajn(e,t){return{attributes:e.attributes?(0,$ee.toAttributes)(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:ojn(e.context.traceFlags,e.context.isRemote)}}s(ajn,"toOtlpLink");yx.toOtlpLink=ajn;function sjn(e,t){return{attributes:e.attributes?(0,$ee.toAttributes)(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}s(sjn,"toOtlpSpanEvent");yx.toOtlpSpanEvent=sjn;function Csa(e,t){return{resourceSpans:Psa(e,t)}}s(Csa,"createExportTraceServiceRequest");yx.createExportTraceServiceRequest=Csa;function Asa(e){let t=new Map;for(let r of e){let o=t.get(r.resource);o||(o=new Map,t.set(r.resource,o));let n=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,i=o.get(n);i||(i=[],o.set(n,i)),i.push(r)}return t}s(Asa,"createResourceMap");function Psa(e,t){let r=Asa(e),o=[],n=r.entries(),i=n.next();for(;!i.done;){let[a,u]=i.value,l=[],c=u.values(),d=c.next();for(;!d.done;){let f=d.value;if(f.length>0){let h=f.map(_=>ijn(_,t));l.push({scope:(0,$ee.createInstrumentationScope)(f[0].instrumentationScope),spans:h,schemaUrl:f[0].instrumentationScope.schemaUrl})}d=c.next()}let p=(0,$ee.createResource)(a,t),m={resource:p,scopeSpans:l,schemaUrl:p.schemaUrl};o.push(m),i=n.next()}return o}s(Psa,"spanRecordsToResourceSpans")});var ljn=z(rPe=>{"use strict";Object.defineProperty(rPe,"__esModule",{value:!0});rPe.ProtobufTraceSerializer=void 0;var ujn=WAe(),Rsa=pFt(),Msa=X5(),$sa=ujn.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Osa=ujn.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;rPe.ProtobufTraceSerializer={serializeRequest:s(e=>{let t=(0,Rsa.createExportTraceServiceRequest)(e,Msa.PROTOBUF_ENCODER);return Osa.encode(t).finish()},"serializeRequest"),deserializeResponse:s(e=>$sa.decode(e),"deserializeResponse")}});var cjn=z(nPe=>{"use strict";Object.defineProperty(nPe,"__esModule",{value:!0});nPe.ProtobufTraceSerializer=void 0;var Dsa=ljn();Object.defineProperty(nPe,"ProtobufTraceSerializer",{enumerable:!0,get:s(function(){return Dsa.ProtobufTraceSerializer},"get")})});var djn=z(oPe=>{"use strict";Object.defineProperty(oPe,"__esModule",{value:!0});oPe.JsonLogsSerializer=void 0;var Nsa=uFt(),zsa=X5();oPe.JsonLogsSerializer={serializeRequest:s(e=>{let t=(0,Nsa.createExportLogsServiceRequest)(e,zsa.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(t))},"serializeRequest"),deserializeResponse:s(e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))},"deserializeResponse")}});var pjn=z(iPe=>{"use strict";Object.defineProperty(iPe,"__esModule",{value:!0});iPe.JsonLogsSerializer=void 0;var jsa=djn();Object.defineProperty(iPe,"JsonLogsSerializer",{enumerable:!0,get:s(function(){return jsa.JsonLogsSerializer},"get")})});var mjn=z(aPe=>{"use strict";Object.defineProperty(aPe,"__esModule",{value:!0});aPe.JsonMetricsSerializer=void 0;var Lsa=dFt(),Bsa=X5();aPe.JsonMetricsSerializer={serializeRequest:s(e=>{let t=(0,Lsa.createExportMetricsServiceRequest)([e],Bsa.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(t))},"serializeRequest"),deserializeResponse:s(e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))},"deserializeResponse")}});var fjn=z(sPe=>{"use strict";Object.defineProperty(sPe,"__esModule",{value:!0});sPe.JsonMetricsSerializer=void 0;var Usa=mjn();Object.defineProperty(sPe,"JsonMetricsSerializer",{enumerable:!0,get:s(function(){return Usa.JsonMetricsSerializer},"get")})});var hjn=z(uPe=>{"use strict";Object.defineProperty(uPe,"__esModule",{value:!0});uPe.JsonTraceSerializer=void 0;var Fsa=pFt(),qsa=X5();uPe.JsonTraceSerializer={serializeRequest:s(e=>{let t=(0,Fsa.createExportTraceServiceRequest)(e,qsa.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(t))},"serializeRequest"),deserializeResponse:s(e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))},"deserializeResponse")}});var gjn=z(lPe=>{"use strict";Object.defineProperty(lPe,"__esModule",{value:!0});lPe.JsonTraceSerializer=void 0;var Zsa=hjn();Object.defineProperty(lPe,"JsonTraceSerializer",{enumerable:!0,get:s(function(){return Zsa.JsonTraceSerializer},"get")})});var cPe=z(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.JsonTraceSerializer=f0.JsonMetricsSerializer=f0.JsonLogsSerializer=f0.ProtobufTraceSerializer=f0.ProtobufMetricsSerializer=f0.ProtobufLogsSerializer=void 0;var Vsa=W8n();Object.defineProperty(f0,"ProtobufLogsSerializer",{enumerable:!0,get:s(function(){return Vsa.ProtobufLogsSerializer},"get")});var Gsa=njn();Object.defineProperty(f0,"ProtobufMetricsSerializer",{enumerable:!0,get:s(function(){return Gsa.ProtobufMetricsSerializer},"get")});var Wsa=cjn();Object.defineProperty(f0,"ProtobufTraceSerializer",{enumerable:!0,get:s(function(){return Wsa.ProtobufTraceSerializer},"get")});var Hsa=pjn();Object.defineProperty(f0,"JsonLogsSerializer",{enumerable:!0,get:s(function(){return Hsa.JsonLogsSerializer},"get")});var Ksa=fjn();Object.defineProperty(f0,"JsonMetricsSerializer",{enumerable:!0,get:s(function(){return Ksa.JsonMetricsSerializer},"get")});var Jsa=gjn();Object.defineProperty(f0,"JsonTraceSerializer",{enumerable:!0,get:s(function(){return Jsa.JsonTraceSerializer},"get")})});function _jn(e){let t={};return Object.entries(e??{}).forEach(([r,o])=>{typeof o<"u"?t[r]=String(o):ns.warn(`Header "${r}" has invalid value (${o}) and will be ignored`)}),t}var yjn=b(()=>{fn();s(_jn,"validateAndNormalizeHeaders")});function Qsa(e,t,r){return async()=>{let o={...await r()},n={};return t!=null&&Object.assign(n,await t()),e!=null&&Object.assign(n,_jn(await e())),Object.assign(n,o)}}function Ysa(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function vjn(e,t,r){return{...jAe(e,t,r),headers:Qsa(e.headers,t.headers,r.headers),url:Ysa(e.url)??t.url??r.url}}function xjn(e,t){return{...LAe(),headers:s(async()=>e,"headers"),url:"http://localhost:4318/"+t}}var bjn=b(()=>{Eee();yjn();s(Qsa,"mergeHeaders");s(Ysa,"validateUserProvidedUrl");s(vjn,"mergeOtlpHttpConfigurationWithDefaults");s(xjn,"getHttpConfigurationDefaults")});function eR(e){return async t=>{let r=t==="http:",o=r?import("http"):import("https"),{Agent:n}=await o;if(r){let{ca:i,cert:a,key:u,...l}=e;return new n(l)}return new n(e)}}function wjn(e,t,r){return{...vjn(e,t,r),agentFactory:e.agentFactory??t.agentFactory??r.agentFactory,userAgent:e.userAgent}}function kjn(e,t){return{...xjn(e,t),agentFactory:eR({keepAlive:!0})}}var dPe=b(()=>{bjn();s(eR,"httpAgentFactoryFromOptions");s(wjn,"mergeOtlpNodeHttpConfigurationWithDefaults");s(kjn,"getNodeHttpConfigurationDefaults")});function mFt(e){return e===429||e===502||e===503||e===504}function fFt(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let r=new Date(e).getTime()-Date.now();return r>=0?r:0}var Sjn=b(()=>{s(mFt,"isExportHTTPErrorRetryable");s(fFt,"parseRetryAfterToMills")});var Ijn,Tjn=b(()=>{Ijn="0.214.0"});function Pjn(e,t,r,o,n,i,a,u){return new Promise(l=>{let c=new URL(t);n?r["User-Agent"]=`${n} ${Ejn}`:r["User-Agent"]=Ejn;let d={hostname:c.hostname,port:c.port,path:c.pathname,method:"POST",headers:r,agent:i},p=e(d,m=>{let f=[];m.on("data",h=>f.push(h)),m.on("end",()=>{if(m.statusCode&&m.statusCode<=299)l({status:"success",data:Buffer.concat(f)});else if(m.statusCode&&mFt(m.statusCode))l({status:"retryable",retryInMillis:fFt(m.headers["retry-after"])});else{let h=new g1(m.statusMessage,m.statusCode,Buffer.concat(f).toString());l({status:"failure",error:h})}}),m.on("error",h=>{m.statusCode&&m.statusCode<=299?l({status:"success"}):m.statusCode&&mFt(m.statusCode)?l({status:"retryable",error:h,retryInMillis:fFt(m.headers["retry-after"])}):l({status:"failure",error:h})})});p.setTimeout(u,()=>{p.destroy(),l({status:"retryable",error:new Error("Request timed out")})}),p.on("error",m=>{tua(m)?l({status:"retryable",error:m}):l({status:"failure",error:m})}),Xsa(p,o,a,m=>{l({status:"failure",error:m})})})}function Xsa(e,t,r,o){let n=eua(r);t==="gzip"&&(e.setHeader("Content-Encoding","gzip"),n=n.on("error",o).pipe(Cjn.createGzip()).on("error",o)),n.pipe(e).on("error",o)}function eua(e){let t=new Ajn.Readable;return t.push(e),t.push(null),t}function tua(e){let t=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);return"code"in e&&typeof e.code=="string"?t.has(e.code):!1}var Cjn,Ajn,Ejn,Rjn=b(()=>{Cjn=ht(require("zlib")),Ajn=require("stream");Sjn();NAe();Tjn();Ejn=`OTel-OTLP-Exporter-JavaScript/${Ijn}`;s(Pjn,"sendWithHttp");s(Xsa,"compressAndSend");s(eua,"readableFromUint8Array");s(tua,"isHttpTransportNetworkErrorRetryable")});async function rua(e){let t=e==="http:"?import("http"):import("https"),{request:r}=await t;return r}function Mjn(e){return new hFt(e)}var hFt,$jn=b(()=>{Rjn();hFt=class{static{s(this,"HttpExporterTransport")}_utils=null;_parameters;constructor(t){this._parameters=t}async send(t,r){let{agent:o,request:n}=await this._loadUtils(),i=await this._parameters.headers();return Pjn(n,this._parameters.url,i,this._parameters.compression,this._parameters.userAgent,o,t,r)}shutdown(){}async _loadUtils(){let t=this._utils;if(t===null){let r=new URL(this._parameters.url).protocol,[o,n]=await Promise.all([this._parameters.agentFactory(r),rua(r)]);t=this._utils={agent:o,request:n}}return t}};s(rua,"requestFunctionFactory");s(Mjn,"createHttpExporterTransport")});function aua(){return Math.random()*(2*Ojn)-Ojn}function Djn(e){return new _Ft(e.transport)}var gFt,nua,oua,iua,Ojn,_Ft,Njn=b(()=>{fn();gFt=5,nua=1e3,oua=5e3,iua=1.5,Ojn=.2;s(aua,"getJitter");_Ft=class{static{s(this,"RetryingTransport")}_transport;constructor(t){this._transport=t}retry(t,r,o){return new Promise((n,i)=>{setTimeout(()=>{this._transport.send(t,r).then(n,i)},o)})}async send(t,r){let o=gFt,n=nua,i=Date.now()+r,a=await this._transport.send(t,r);for(;a.status==="retryable"&&o>0;){o--;let u=Math.max(Math.min(n*(1+aua()),oua),0);n=n*iua;let l=a.retryInMillis??u,c=i-Date.now();if(l>c)return ns.info(`Export retry time ${Math.round(l)}ms exceeds remaining timeout ${Math.round(c)}ms, not retrying further.`),a;ns.verbose(`Scheduling export retry in ${Math.round(l)}ms`),a=await this.retry(t,c,l)}return a.status==="success"?ns.verbose(`Export succeeded after ${gFt-o} retry attempts.`):a.status==="retryable"?ns.info(`Export failed after maximum retry attempts (${gFt}).`):ns.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}};s(Djn,"createRetryingTransport")});function zjn(e,t){return UAe({transport:Djn({transport:Mjn(e)}),serializer:t,promiseHandler:BAe(e)},{timeout:e.timeoutMillis})}var jjn=b(()=>{VUt();$jn();qUt();Njn();s(zjn,"createOtlpHttpExportDelegate")});function Ljn(e){let t=(0,pPe.getNumberFromEnv)(e);if(t!=null){if(Number.isFinite(t)&&t>0)return t;ns.warn(`Configuration: ${e} is invalid, expected number greater than 0 (actual: ${t})`)}}function sua(e){let t=Ljn(`OTEL_EXPORTER_OTLP_${e}_TIMEOUT`),r=Ljn("OTEL_EXPORTER_OTLP_TIMEOUT");return t??r}function Bjn(e){let t=(0,pPe.getStringFromEnv)(e)?.trim();if(t==null||t==="none"||t==="gzip")return t;ns.warn(`Configuration: ${e} is invalid, expected 'none' or 'gzip' (actual: '${t}')`)}function uua(e){let t=Bjn(`OTEL_EXPORTER_OTLP_${e}_COMPRESSION`),r=Bjn("OTEL_EXPORTER_OTLP_COMPRESSION");return t??r}function mPe(e){return{timeoutMillis:sua(e),compression:uua(e)}}var pPe,yFt=b(()=>{pPe=ht(ps());fn();s(Ljn,"parseAndValidateTimeoutFromEnv");s(sua,"getTimeoutFromEnv");s(Bjn,"parseAndValidateCompressionFromEnv");s(uua,"getCompressionFromEnv");s(mPe,"getSharedConfigurationFromEnvironment")});function lua(e){let t=(0,kg.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${e}_HEADERS`),r=(0,kg.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"),o=(0,kg.parseKeyPairsIntoRecord)(t),n=(0,kg.parseKeyPairsIntoRecord)(r);if(!(Object.keys(o).length===0&&Object.keys(n).length===0))return Object.assign({},(0,kg.parseKeyPairsIntoRecord)(r),(0,kg.parseKeyPairsIntoRecord)(t))}function cua(e){try{return new URL(e).toString()}catch{ns.warn(`Configuration: Could not parse environment-provided export URL: '${e}', falling back to undefined`);return}}function dua(e,t){try{new URL(e)}catch{ns.warn(`Configuration: Could not parse environment-provided export URL: '${e}', falling back to undefined`);return}e.endsWith("/")||(e=e+"/"),e+=t;try{new URL(e)}catch{ns.warn(`Configuration: Provided URL appended with '${t}' is not a valid URL, using 'undefined' instead of '${e}'`);return}return e}function pua(e){let t=(0,kg.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT");if(t!==void 0)return dua(t,e)}function mua(e){let t=(0,kg.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`);if(t!==void 0)return cua(t)}function vFt(e,t,r){let o=(0,kg.getStringFromEnv)(e),n=(0,kg.getStringFromEnv)(t),i=o??n;if(i!=null)try{return Ujn.readFileSync(Fjn.resolve(process.cwd(),i))}catch{ns.warn(r);return}else return}function fua(e){return vFt(`OTEL_EXPORTER_OTLP_${e}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function hua(e){return vFt(`OTEL_EXPORTER_OTLP_${e}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function gua(e){return vFt(`OTEL_EXPORTER_OTLP_${e}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function qjn(e,t){return{...mPe(e),url:mua(e)??pua(t),headers:zAe(lua(e)),agentFactory:eR({keepAlive:!0,ca:gua(e),cert:fua(e),key:hua(e)})}}var Ujn,Fjn,kg,Zjn=b(()=>{Ujn=ht(require("fs")),Fjn=ht(require("path")),kg=ht(ps());fn();yFt();Eee();dPe();s(lua,"getStaticHeadersFromEnv");s(cua,"appendRootPathToUrlIfNeeded");s(dua,"appendResourcePathToUrl");s(pua,"getNonSpecificUrlFromEnv");s(mua,"getSpecificUrlFromEnv");s(vFt,"readFileFromEnv");s(fua,"getClientCertificateFromEnv");s(hua,"getClientKeyFromEnv");s(gua,"getRootCertificateFromEnv");s(qjn,"getNodeHttpConfigurationFromEnvironment")});function Vjn(e){return typeof e.headers=="function"?e.headers:zAe(e.headers)}var Gjn=b(()=>{Eee();s(Vjn,"convertLegacyHeaders")});function _ua(e){if(typeof e.httpAgentOptions=="function")return e.httpAgentOptions;let t=e.httpAgentOptions;if(e.keepAlive!=null&&(t={keepAlive:e.keepAlive,...t}),t!=null)return eR(t)}function Wjn(e,t,r,o){return e.metadata&&ns.warn("Metadata cannot be set when using http"),wjn({url:e.url,headers:Vjn(e),concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis,compression:e.compression,agentFactory:_ua(e),userAgent:e.userAgent},qjn(t,r),kjn(o,r))}var Hjn=b(()=>{fn();dPe();Oee();Zjn();Gjn();s(_ua,"convertLegacyAgentOptions");s(Wjn,"convertLegacyHttpOptions")});var fPe={};mr(fPe,{convertLegacyHttpOptions:()=>Wjn,createOtlpHttpExportDelegate:()=>zjn,getSharedConfigurationFromEnvironment:()=>mPe,httpAgentFactoryFromOptions:()=>eR});var Oee=b(()=>{dPe();jjn();yFt();Hjn()});var Jjn=z(hPe=>{"use strict";Object.defineProperty(hPe,"__esModule",{value:!0});hPe.OTLPMetricExporter=void 0;var yua=HUt(),vua=cPe(),Kjn=(Oee(),Mr(fPe)),xFt=class extends yua.OTLPMetricExporterBase{static{s(this,"OTLPMetricExporter")}constructor(t){super((0,Kjn.createOtlpHttpExportDelegate)((0,Kjn.convertLegacyHttpOptions)(t??{},"METRICS","v1/metrics",{"Content-Type":"application/json"}),vua.JsonMetricsSerializer),t)}};hPe.OTLPMetricExporter=xFt});var Qjn=z(gPe=>{"use strict";Object.defineProperty(gPe,"__esModule",{value:!0});gPe.OTLPMetricExporter=void 0;var xua=Jjn();Object.defineProperty(gPe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return xua.OTLPMetricExporter},"get")})});var Yjn=z(_Pe=>{"use strict";Object.defineProperty(_Pe,"__esModule",{value:!0});_Pe.OTLPMetricExporter=void 0;var bua=Qjn();Object.defineProperty(_Pe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return bua.OTLPMetricExporter},"get")})});var Xjn=z(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});h0.OTLPMetricExporterBase=h0.LowMemoryTemporalitySelector=h0.DeltaTemporalitySelector=h0.CumulativeTemporalitySelector=h0.AggregationTemporalityPreference=h0.OTLPMetricExporter=void 0;var wua=Yjn();Object.defineProperty(h0,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return wua.OTLPMetricExporter},"get")});var kua=UUt();Object.defineProperty(h0,"AggregationTemporalityPreference",{enumerable:!0,get:s(function(){return kua.AggregationTemporalityPreference},"get")});var yPe=HUt();Object.defineProperty(h0,"CumulativeTemporalitySelector",{enumerable:!0,get:s(function(){return yPe.CumulativeTemporalitySelector},"get")});Object.defineProperty(h0,"DeltaTemporalitySelector",{enumerable:!0,get:s(function(){return yPe.DeltaTemporalitySelector},"get")});Object.defineProperty(h0,"LowMemoryTemporalitySelector",{enumerable:!0,get:s(function(){return yPe.LowMemoryTemporalitySelector},"get")});Object.defineProperty(h0,"OTLPMetricExporterBase",{enumerable:!0,get:s(function(){return yPe.OTLPMetricExporterBase},"get")})});var tLn=z(vPe=>{"use strict";Object.defineProperty(vPe,"__esModule",{value:!0});vPe.OTLPMetricExporter=void 0;var Sua=Xjn(),Iua=cPe(),eLn=(Oee(),Mr(fPe)),bFt=class extends Sua.OTLPMetricExporterBase{static{s(this,"OTLPMetricExporter")}constructor(t){super((0,eLn.createOtlpHttpExportDelegate)((0,eLn.convertLegacyHttpOptions)(t??{},"METRICS","v1/metrics",{"Content-Type":"application/x-protobuf"}),Iua.ProtobufMetricsSerializer),t)}};vPe.OTLPMetricExporter=bFt});var rLn=z(xPe=>{"use strict";Object.defineProperty(xPe,"__esModule",{value:!0});xPe.OTLPMetricExporter=void 0;var Tua=tLn();Object.defineProperty(xPe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return Tua.OTLPMetricExporter},"get")})});var nLn=z(bPe=>{"use strict";Object.defineProperty(bPe,"__esModule",{value:!0});bPe.OTLPMetricExporter=void 0;var Eua=rLn();Object.defineProperty(bPe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return Eua.OTLPMetricExporter},"get")})});var oLn=z(wPe=>{"use strict";Object.defineProperty(wPe,"__esModule",{value:!0});wPe.OTLPMetricExporter=void 0;var Cua=nLn();Object.defineProperty(wPe,"OTLPMetricExporter",{enumerable:!0,get:s(function(){return Cua.OTLPMetricExporter},"get")})});var aLn=z(kPe=>{"use strict";Object.defineProperty(kPe,"__esModule",{value:!0});kPe.OTLPTraceExporter=void 0;var Aua=(FAe(),Mr(GUt)),Pua=cPe(),iLn=(Oee(),Mr(fPe)),wFt=class extends Aua.OTLPExporterBase{static{s(this,"OTLPTraceExporter")}constructor(t={}){super((0,iLn.createOtlpHttpExportDelegate)((0,iLn.convertLegacyHttpOptions)(t,"TRACES","v1/traces",{"Content-Type":"application/x-protobuf"}),Pua.ProtobufTraceSerializer))}};kPe.OTLPTraceExporter=wFt});var sLn=z(SPe=>{"use strict";Object.defineProperty(SPe,"__esModule",{value:!0});SPe.OTLPTraceExporter=void 0;var Rua=aLn();Object.defineProperty(SPe,"OTLPTraceExporter",{enumerable:!0,get:s(function(){return Rua.OTLPTraceExporter},"get")})});var uLn=z(IPe=>{"use strict";Object.defineProperty(IPe,"__esModule",{value:!0});IPe.OTLPTraceExporter=void 0;var Mua=sLn();Object.defineProperty(IPe,"OTLPTraceExporter",{enumerable:!0,get:s(function(){return Mua.OTLPTraceExporter},"get")})});var lLn=z(TPe=>{"use strict";Object.defineProperty(TPe,"__esModule",{value:!0});TPe.OTLPTraceExporter=void 0;var $ua=uLn();Object.defineProperty(TPe,"OTLPTraceExporter",{enumerable:!0,get:s(function(){return $ua.OTLPTraceExporter},"get")})});var cLn=z(EPe=>{"use strict";Object.defineProperty(EPe,"__esModule",{value:!0});EPe.ExceptionEventName=void 0;EPe.ExceptionEventName="exception"});var dLn=z(CPe=>{"use strict";Object.defineProperty(CPe,"__esModule",{value:!0});CPe.SpanImpl=void 0;var yc=(fn(),Mr(co)),vc=ps(),tR=(lee(),Mr(uee)),Oua=cLn(),kFt=class{static{s(this,"SpanImpl")}_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:yc.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(t){let r=Date.now();if(this._spanContext=t.spanContext,this._performanceStartTime=vc.otperformance.now(),this._performanceOffset=r-(this._performanceStartTime+vc.otperformance.timeOrigin),this._startTimeProvided=t.startTime!=null,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,t.links)for(let o of t.links)this.addLink(o);this.startTime=this._getTime(t.startTime??r),this.resource=t.resource,this.instrumentationScope=t.scope,this._recordEndMetrics=t.recordEndMetrics,t.attributes!=null&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,r){if(r==null||this._isSpanEnded())return this;if(t.length===0)return yc.diag.warn(`Invalid attribute key: ${t}`),this;if(!(0,vc.isAttributeValue)(r))return yc.diag.warn(`Invalid attribute value set for key: ${t}`),this;let{attributeCountLimit:o}=this._spanLimits,n=!Object.prototype.hasOwnProperty.call(this.attributes,t);return o!==void 0&&this._attributesCount>=o&&n?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(r),n&&this._attributesCount++,this)}setAttributes(t){for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.setAttribute(r,t[r]);return this}addEvent(t,r,o){if(this._isSpanEnded())return this;let{eventCountLimit:n}=this._spanLimits;if(n===0)return yc.diag.warn("No events allowed."),this._droppedEventsCount++,this;n!==void 0&&this.events.length>=n&&(this._droppedEventsCount===0&&yc.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,vc.isTimeInput)(r)&&((0,vc.isTimeInput)(o)||(o=r),r=void 0);let i=(0,vc.sanitizeAttributes)(r),{attributePerEventCountLimit:a}=this._spanLimits,u={},l=0,c=0;for(let d in i){if(!Object.prototype.hasOwnProperty.call(i,d))continue;let p=i[d];if(a!==void 0&&c>=a){l++;continue}u[d]=this._truncateToSize(p),c++}return this.events.push({name:t,attributes:u,time:this._getTime(o),droppedAttributesCount:l}),this}addLink(t){if(this._isSpanEnded())return this;let{linkCountLimit:r}=this._spanLimits;if(r===0)return this._droppedLinksCount++,this;r!==void 0&&this.links.length>=r&&(this._droppedLinksCount===0&&yc.diag.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:o}=this._spanLimits,n=(0,vc.sanitizeAttributes)(t.attributes),i={},a=0,u=0;for(let c in n){if(!Object.prototype.hasOwnProperty.call(n,c))continue;let d=n[c];if(o!==void 0&&u>=o){a++;continue}i[c]=this._truncateToSize(d),u++}let l={context:t.context};return u>0&&(l.attributes=i),a>0&&(l.droppedAttributesCount=a),this.links.push(l),this}addLinks(t){for(let r of t)this.addLink(r);return this}setStatus(t){if(this._isSpanEnded())return this;if(t.code===yc.SpanStatusCode.UNSET)return this;if(this.status.code===yc.SpanStatusCode.OK)return this;let r={code:t.code};return t.code===yc.SpanStatusCode.ERROR&&(typeof t.message=="string"?r.message=t.message:t.message!=null&&yc.diag.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`)),this.status=r,this}updateName(t){return this._isSpanEnded()?this:(this.name=t,this)}end(t){if(this._isSpanEnded()){yc.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(t),this._duration=(0,vc.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(yc.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._droppedEventsCount>0&&yc.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&yc.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(t){if(typeof t=="number"&&t<=vc.otperformance.now())return(0,vc.hrTime)(t+this._performanceOffset);if(typeof t=="number")return(0,vc.millisToHrTime)(t);if(t instanceof Date)return(0,vc.millisToHrTime)(t.getTime());if((0,vc.isTimeInputHrTime)(t))return t;if(this._startTimeProvided)return(0,vc.millisToHrTime)(Date.now());let r=vc.otperformance.now()-this._performanceStartTime;return(0,vc.addHrTimes)(this.startTime,(0,vc.millisToHrTime)(r))}isRecording(){return this._ended===!1}recordException(t,r){let o={};typeof t=="string"?o[tR.ATTR_EXCEPTION_MESSAGE]=t:t&&(t.code?o[tR.ATTR_EXCEPTION_TYPE]=t.code.toString():t.name&&(o[tR.ATTR_EXCEPTION_TYPE]=t.name),t.message&&(o[tR.ATTR_EXCEPTION_MESSAGE]=t.message),t.stack&&(o[tR.ATTR_EXCEPTION_STACKTRACE]=t.stack)),o[tR.ATTR_EXCEPTION_TYPE]||o[tR.ATTR_EXCEPTION_MESSAGE]?this.addEvent(Oua.ExceptionEventName,o,r):yc.diag.warn(`Failed to record an exception ${t}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);yc.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,r){return t.length<=r?t:t.substring(0,r)}_truncateToSize(t){let r=this._attributeValueLengthLimit;return r<=0?(yc.diag.warn(`Attribute value limit must be positive, got ${r}`),t):typeof t=="string"?this._truncateToLimitUtil(t,r):Array.isArray(t)?t.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,r):o):t}};CPe.SpanImpl=kFt});var YL=z(Dee=>{"use strict";Object.defineProperty(Dee,"__esModule",{value:!0});Dee.SamplingDecision=void 0;var Dua;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Dua=Dee.SamplingDecision||(Dee.SamplingDecision={}))});var PPe=z(APe=>{"use strict";Object.defineProperty(APe,"__esModule",{value:!0});APe.AlwaysOffSampler=void 0;var Nua=YL(),SFt=class{static{s(this,"AlwaysOffSampler")}shouldSample(){return{decision:Nua.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};APe.AlwaysOffSampler=SFt});var MPe=z(RPe=>{"use strict";Object.defineProperty(RPe,"__esModule",{value:!0});RPe.AlwaysOnSampler=void 0;var zua=YL(),IFt=class{static{s(this,"AlwaysOnSampler")}shouldSample(){return{decision:zua.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};RPe.AlwaysOnSampler=IFt});var CFt=z(OPe=>{"use strict";Object.defineProperty(OPe,"__esModule",{value:!0});OPe.ParentBasedSampler=void 0;var $Pe=(fn(),Mr(co)),jua=ps(),pLn=PPe(),TFt=MPe(),EFt=class{static{s(this,"ParentBasedSampler")}_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(t){this._root=t.root,this._root||((0,jua.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new TFt.AlwaysOnSampler),this._remoteParentSampled=t.remoteParentSampled??new TFt.AlwaysOnSampler,this._remoteParentNotSampled=t.remoteParentNotSampled??new pLn.AlwaysOffSampler,this._localParentSampled=t.localParentSampled??new TFt.AlwaysOnSampler,this._localParentNotSampled=t.localParentNotSampled??new pLn.AlwaysOffSampler}shouldSample(t,r,o,n,i,a){let u=$Pe.trace.getSpanContext(t);return!u||!(0,$Pe.isSpanContextValid)(u)?this._root.shouldSample(t,r,o,n,i,a):u.isRemote?u.traceFlags&$Pe.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(t,r,o,n,i,a):this._remoteParentNotSampled.shouldSample(t,r,o,n,i,a):u.traceFlags&$Pe.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(t,r,o,n,i,a):this._localParentNotSampled.shouldSample(t,r,o,n,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};OPe.ParentBasedSampler=EFt});var PFt=z(DPe=>{"use strict";Object.defineProperty(DPe,"__esModule",{value:!0});DPe.TraceIdRatioBasedSampler=void 0;var Lua=(fn(),Mr(co)),mLn=YL(),AFt=class{static{s(this,"TraceIdRatioBasedSampler")}_ratio;_upperBound;constructor(t=0){this._ratio=this._normalize(t),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(t,r){return{decision:(0,Lua.isValidTraceId)(r)&&this._accumulate(r)<this._upperBound?mLn.SamplingDecision.RECORD_AND_SAMPLED:mLn.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return typeof t!="number"||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let r=0;for(let o=0;o<t.length/8;o++){let n=o*8,i=parseInt(t.slice(n,n+8),16);r=(r^i)>>>0}return r}};DPe.TraceIdRatioBasedSampler=AFt});var $Ft=z(XL=>{"use strict";Object.defineProperty(XL,"__esModule",{value:!0});XL.buildSamplerFromEnv=XL.loadDefaultConfig=void 0;var MFt=(fn(),Mr(co)),vx=ps(),fLn=PPe(),RFt=MPe(),NPe=CFt(),hLn=PFt(),xx;(function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"})(xx||(xx={}));var zPe=1;function Bua(){return{sampler:_Ln(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,vx.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,vx.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,vx.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}s(Bua,"loadDefaultConfig");XL.loadDefaultConfig=Bua;function _Ln(){let e=(0,vx.getStringFromEnv)("OTEL_TRACES_SAMPLER")??xx.ParentBasedAlwaysOn;switch(e){case xx.AlwaysOn:return new RFt.AlwaysOnSampler;case xx.AlwaysOff:return new fLn.AlwaysOffSampler;case xx.ParentBasedAlwaysOn:return new NPe.ParentBasedSampler({root:new RFt.AlwaysOnSampler});case xx.ParentBasedAlwaysOff:return new NPe.ParentBasedSampler({root:new fLn.AlwaysOffSampler});case xx.TraceIdRatio:return new hLn.TraceIdRatioBasedSampler(gLn());case xx.ParentBasedTraceIdRatio:return new NPe.ParentBasedSampler({root:new hLn.TraceIdRatioBasedSampler(gLn())});default:return MFt.diag.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${xx.ParentBasedAlwaysOn}".`),new NPe.ParentBasedSampler({root:new RFt.AlwaysOnSampler})}}s(_Ln,"buildSamplerFromEnv");XL.buildSamplerFromEnv=_Ln;function gLn(){let e=(0,vx.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");return e==null?(MFt.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${zPe}.`),zPe):e<0||e>1?(MFt.diag.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to ${zPe}.`),zPe):e}s(gLn,"getSamplerProbabilityFromEnv")});var OFt=z(Sg=>{"use strict";Object.defineProperty(Sg,"__esModule",{value:!0});Sg.reconfigureLimits=Sg.mergeConfig=Sg.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=Sg.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var yLn=$Ft(),jPe=ps();Sg.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;Sg.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function Uua(e){let t={sampler:(0,yLn.buildSamplerFromEnv)()},r=(0,yLn.loadDefaultConfig)(),o=Object.assign({},r,t,e);return o.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),o.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),o}s(Uua,"mergeConfig");Sg.mergeConfig=Uua;function Fua(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??(0,jPe.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,jPe.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??Sg.DEFAULT_ATTRIBUTE_COUNT_LIMIT,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??(0,jPe.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,jPe.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Sg.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},e,{spanLimits:t})}s(Fua,"reconfigureLimits");Sg.reconfigureLimits=Fua});var vLn=z(LPe=>{"use strict";Object.defineProperty(LPe,"__esModule",{value:!0});LPe.BatchSpanProcessorBase=void 0;var eB=(fn(),Mr(co)),_1=ps(),DFt=class{static{s(this,"BatchSpanProcessorBase")}_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(t,r){this._exporter=t,this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:(0,_1.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:(0,_1.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:(0,_1.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:(0,_1.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new _1.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(eB.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(t,r){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&eB.TraceFlags.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&eB.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(eB.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,r)=>{let o=[],n=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let i=0,a=n;i<a;i++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{t()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((t,r)=>{let o=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);eB.context.with((0,_1.suppressTracing)(eB.context.active()),()=>{let n;this._finishedSpans.length<=this._maxExportBatchSize?(n=this._finishedSpans,this._finishedSpans=[]):n=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=s(()=>this._exporter.export(n,u=>{clearTimeout(o),u.code===_1.ExportResultCode.SUCCESS?t():r(u.error??new Error("BatchSpanProcessor: span export failed"))}),"doExport"),a=null;for(let u=0,l=n.length;u<l;u++){let c=n[u];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(a??=[],a.push(c.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,u=>{(0,_1.globalErrorHandler)(u),r(u)})})})}_maybeStartTimer(){if(this._isExporting)return;let t=s(()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,(0,_1.globalErrorHandler)(r)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return t();this._timer===void 0&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};LPe.BatchSpanProcessorBase=DFt});var xLn=z(BPe=>{"use strict";Object.defineProperty(BPe,"__esModule",{value:!0});BPe.BatchSpanProcessor=void 0;var qua=vLn(),NFt=class extends qua.BatchSpanProcessorBase{static{s(this,"BatchSpanProcessor")}onShutdown(){}};BPe.BatchSpanProcessor=NFt});var kLn=z(FPe=>{"use strict";Object.defineProperty(FPe,"__esModule",{value:!0});FPe.RandomIdGenerator=void 0;var Zua=8,wLn=16,zFt=class{static{s(this,"RandomIdGenerator")}generateTraceId=bLn(wLn);generateSpanId=bLn(Zua)};FPe.RandomIdGenerator=zFt;var UPe=Buffer.allocUnsafe(wLn);function bLn(e){return s(function(){for(let r=0;r<e/4;r++)UPe.writeUInt32BE(Math.random()*2**32>>>0,r*4);for(let r=0;r<e&&!(UPe[r]>0);r++)r===e-1&&(UPe[e-1]=1);return UPe.toString("hex",0,e)},"generateId")}s(bLn,"getIdGenerator")});var SLn=z(tB=>{"use strict";Object.defineProperty(tB,"__esModule",{value:!0});tB.RandomIdGenerator=tB.BatchSpanProcessor=void 0;var Vua=xLn();Object.defineProperty(tB,"BatchSpanProcessor",{enumerable:!0,get:s(function(){return Vua.BatchSpanProcessor},"get")});var Gua=kLn();Object.defineProperty(tB,"RandomIdGenerator",{enumerable:!0,get:s(function(){return Gua.RandomIdGenerator},"get")})});var jFt=z(rB=>{"use strict";Object.defineProperty(rB,"__esModule",{value:!0});rB.RandomIdGenerator=rB.BatchSpanProcessor=void 0;var ILn=SLn();Object.defineProperty(rB,"BatchSpanProcessor",{enumerable:!0,get:s(function(){return ILn.BatchSpanProcessor},"get")});Object.defineProperty(rB,"RandomIdGenerator",{enumerable:!0,get:s(function(){return ILn.RandomIdGenerator},"get")})});var TLn=z(bx=>{"use strict";Object.defineProperty(bx,"__esModule",{value:!0});bx.METRIC_OTEL_SDK_SPAN_STARTED=bx.METRIC_OTEL_SDK_SPAN_LIVE=bx.ATTR_OTEL_SPAN_SAMPLING_RESULT=bx.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0;bx.ATTR_OTEL_SPAN_PARENT_ORIGIN="otel.span.parent.origin";bx.ATTR_OTEL_SPAN_SAMPLING_RESULT="otel.span.sampling_result";bx.METRIC_OTEL_SDK_SPAN_LIVE="otel.sdk.span.live";bx.METRIC_OTEL_SDK_SPAN_STARTED="otel.sdk.span.started"});var ELn=z(ZPe=>{"use strict";Object.defineProperty(ZPe,"__esModule",{value:!0});ZPe.TracerMetrics=void 0;var qPe=YL(),Nee=TLn(),LFt=class{static{s(this,"TracerMetrics")}startedSpans;liveSpans;constructor(t){this.startedSpans=t.createCounter(Nee.METRIC_OTEL_SDK_SPAN_STARTED,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=t.createUpDownCounter(Nee.METRIC_OTEL_SDK_SPAN_LIVE,{unit:"{span}",description:"The number of currently live spans."})}startSpan(t,r){let o=Hua(r);if(this.startedSpans.add(1,{[Nee.ATTR_OTEL_SPAN_PARENT_ORIGIN]:Wua(t),[Nee.ATTR_OTEL_SPAN_SAMPLING_RESULT]:o}),r===qPe.SamplingDecision.NOT_RECORD)return()=>{};let n={[Nee.ATTR_OTEL_SPAN_SAMPLING_RESULT]:o};return this.liveSpans.add(1,n),()=>{this.liveSpans.add(-1,n)}}};ZPe.TracerMetrics=LFt;function Wua(e){return e?e.isRemote?"remote":"local":"none"}s(Wua,"parentOrigin");function Hua(e){switch(e){case qPe.SamplingDecision.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case qPe.SamplingDecision.RECORD:return"RECORD_ONLY";case qPe.SamplingDecision.NOT_RECORD:return"DROP"}}s(Hua,"samplingDecisionToString")});var CLn=z(VPe=>{"use strict";Object.defineProperty(VPe,"__esModule",{value:!0});VPe.VERSION=void 0;VPe.VERSION="2.6.1"});var ALn=z(WPe=>{"use strict";Object.defineProperty(WPe,"__esModule",{value:!0});WPe.Tracer=void 0;var jl=(fn(),Mr(co)),GPe=ps(),Kua=dLn(),Jua=OFt(),Qua=jFt(),Yua=ELn(),Xua=CLn(),BFt=class{static{s(this,"Tracer")}_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(t,r,o,n){let i=(0,Jua.mergeConfig)(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new Qua.RandomIdGenerator,this._resource=o,this._spanProcessor=n,this.instrumentationScope=t;let a=i.meterProvider?i.meterProvider.getMeter("@opentelemetry/sdk-trace",Xua.VERSION):jl.createNoopMeter();this._tracerMetrics=new Yua.TracerMetrics(a)}startSpan(t,r={},o=jl.context.active()){r.root&&(o=jl.trace.deleteSpan(o));let n=jl.trace.getSpan(o);if((0,GPe.isTracingSuppressed)(o))return jl.diag.debug("Instrumentation suppressed, returning Noop Span"),jl.trace.wrapSpanContext(jl.INVALID_SPAN_CONTEXT);let i=n?.spanContext(),a=this._idGenerator.generateSpanId(),u,l,c;!i||!jl.trace.isSpanContextValid(i)?l=this._idGenerator.generateTraceId():(l=i.traceId,c=i.traceState,u=i);let d=r.kind??jl.SpanKind.INTERNAL,p=(r.links??[]).map(x=>({context:x.context,attributes:(0,GPe.sanitizeAttributes)(x.attributes)})),m=(0,GPe.sanitizeAttributes)(r.attributes),f=this._sampler.shouldSample(o,l,t,d,m,p),h=this._tracerMetrics.startSpan(i,f.decision);c=f.traceState??c;let _=f.decision===jl.SamplingDecision.RECORD_AND_SAMPLED?jl.TraceFlags.SAMPLED:jl.TraceFlags.NONE,y={traceId:l,spanId:a,traceFlags:_,traceState:c};if(f.decision===jl.SamplingDecision.NOT_RECORD)return jl.diag.debug("Recording is off, propagating context in a non-recording span"),jl.trace.wrapSpanContext(y);let v=(0,GPe.sanitizeAttributes)(Object.assign(m,f.attributes));return new Kua.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:o,spanContext:y,name:t,kind:d,links:p,parentSpanContext:u,attributes:v,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:h})}startActiveSpan(t,r,o,n){let i,a,u;if(arguments.length<2)return;arguments.length===2?u=r:arguments.length===3?(i=r,u=o):(i=r,a=o,u=n);let l=a??jl.context.active(),c=this.startSpan(t,i,l),d=jl.trace.setSpan(l,c);return jl.context.with(d,u,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};WPe.Tracer=BFt});var PLn=z(HPe=>{"use strict";Object.defineProperty(HPe,"__esModule",{value:!0});HPe.MultiSpanProcessor=void 0;var ela=ps(),UFt=class{static{s(this,"MultiSpanProcessor")}_spanProcessors;constructor(t){this._spanProcessors=t}forceFlush(){let t=[];for(let r of this._spanProcessors)t.push(r.forceFlush());return new Promise(r=>{Promise.all(t).then(()=>{r()}).catch(o=>{(0,ela.globalErrorHandler)(o||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(t,r){for(let o of this._spanProcessors)o.onStart(t,r)}onEnding(t){for(let r of this._spanProcessors)r.onEnding&&r.onEnding(t)}onEnd(t){for(let r of this._spanProcessors)r.onEnd(t)}shutdown(){let t=[];for(let r of this._spanProcessors)t.push(r.shutdown());return new Promise((r,o)=>{Promise.all(t).then(()=>{r()},o)})}};HPe.MultiSpanProcessor=UFt});var RLn=z(rR=>{"use strict";Object.defineProperty(rR,"__esModule",{value:!0});rR.BasicTracerProvider=rR.ForceFlushState=void 0;var tla=ps(),rla=cAe(),nla=ALn(),ola=$Ft(),ila=PLn(),ala=OFt(),nB;(function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"})(nB=rR.ForceFlushState||(rR.ForceFlushState={}));var FFt=class{static{s(this,"BasicTracerProvider")}_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(t={}){let r=(0,tla.merge)({},(0,ola.loadDefaultConfig)(),(0,ala.reconfigureLimits)(t));this._resource=r.resource??(0,rla.defaultResource)(),this._config=Object.assign({},r,{resource:this._resource});let o=[];t.spanProcessors?.length&&o.push(...t.spanProcessors),this._activeSpanProcessor=new ila.MultiSpanProcessor(o)}getTracer(t,r,o){let n=`${t}@${r||""}:${o?.schemaUrl||""}`;return this._tracers.has(n)||this._tracers.set(n,new nla.Tracer({name:t,version:r,schemaUrl:o?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(n)}forceFlush(){let t=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(o=>new Promise(n=>{let i,a=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${t} ms`)),i=nB.timeout},t);o.forceFlush().then(()=>{clearTimeout(a),i!==nB.timeout&&(i=nB.resolved,n(i))}).catch(u=>{clearTimeout(a),i=nB.error,n(u)})}));return new Promise((o,n)=>{Promise.all(r).then(i=>{let a=i.filter(u=>u!==nB.resolved);a.length>0?n(a):o()}).catch(i=>n([i]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};rR.BasicTracerProvider=FFt});var MLn=z(KPe=>{"use strict";Object.defineProperty(KPe,"__esModule",{value:!0});KPe.ConsoleSpanExporter=void 0;var qFt=ps(),ZFt=class{static{s(this,"ConsoleSpanExporter")}export(t,r){return this._sendSpans(t,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(t){return{resource:{attributes:t.resource.attributes},instrumentationScope:t.instrumentationScope,traceId:t.spanContext().traceId,parentSpanContext:t.parentSpanContext,traceState:t.spanContext().traceState?.serialize(),name:t.name,id:t.spanContext().spanId,kind:t.kind,timestamp:(0,qFt.hrTimeToMicroseconds)(t.startTime),duration:(0,qFt.hrTimeToMicroseconds)(t.duration),attributes:t.attributes,status:t.status,events:t.events,links:t.links}}_sendSpans(t,r){for(let o of t)console.dir(this._exportInfo(o),{depth:3});if(r)return r({code:qFt.ExportResultCode.SUCCESS})}};KPe.ConsoleSpanExporter=ZFt});var OLn=z(JPe=>{"use strict";Object.defineProperty(JPe,"__esModule",{value:!0});JPe.InMemorySpanExporter=void 0;var $Ln=ps(),VFt=class{static{s(this,"InMemorySpanExporter")}_finishedSpans=[];_stopped=!1;export(t,r){if(this._stopped)return r({code:$Ln.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...t),setTimeout(()=>r({code:$Ln.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};JPe.InMemorySpanExporter=VFt});var DLn=z(YPe=>{"use strict";Object.defineProperty(YPe,"__esModule",{value:!0});YPe.SimpleSpanProcessor=void 0;var sla=(fn(),Mr(co)),QPe=ps(),GFt=class{static{s(this,"SimpleSpanProcessor")}_exporter;_shutdownOnce;_pendingExports;constructor(t){this._exporter=t,this._shutdownOnce=new QPe.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(t,r){}onEnd(t){if(this._shutdownOnce.isCalled||(t.spanContext().traceFlags&sla.TraceFlags.SAMPLED)===0)return;let r=this._doExport(t).catch(o=>(0,QPe.globalErrorHandler)(o));this._pendingExports.add(r),r.finally(()=>this._pendingExports.delete(r))}async _doExport(t){t.resource.asyncAttributesPending&&await t.resource.waitForAsyncAttributes?.();let r=await QPe.internal._export(this._exporter,[t]);if(r.code!==QPe.ExportResultCode.SUCCESS)throw r.error??new Error(`SimpleSpanProcessor: span export failed (status ${r})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};YPe.SimpleSpanProcessor=GFt});var NLn=z(XPe=>{"use strict";Object.defineProperty(XPe,"__esModule",{value:!0});XPe.NoopSpanProcessor=void 0;var WFt=class{static{s(this,"NoopSpanProcessor")}onStart(t,r){}onEnd(t){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};XPe.NoopSpanProcessor=WFt});var jLn=z(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.SamplingDecision=Ya.TraceIdRatioBasedSampler=Ya.ParentBasedSampler=Ya.AlwaysOnSampler=Ya.AlwaysOffSampler=Ya.NoopSpanProcessor=Ya.SimpleSpanProcessor=Ya.InMemorySpanExporter=Ya.ConsoleSpanExporter=Ya.RandomIdGenerator=Ya.BatchSpanProcessor=Ya.BasicTracerProvider=void 0;var ula=RLn();Object.defineProperty(Ya,"BasicTracerProvider",{enumerable:!0,get:s(function(){return ula.BasicTracerProvider},"get")});var zLn=jFt();Object.defineProperty(Ya,"BatchSpanProcessor",{enumerable:!0,get:s(function(){return zLn.BatchSpanProcessor},"get")});Object.defineProperty(Ya,"RandomIdGenerator",{enumerable:!0,get:s(function(){return zLn.RandomIdGenerator},"get")});var lla=MLn();Object.defineProperty(Ya,"ConsoleSpanExporter",{enumerable:!0,get:s(function(){return lla.ConsoleSpanExporter},"get")});var cla=OLn();Object.defineProperty(Ya,"InMemorySpanExporter",{enumerable:!0,get:s(function(){return cla.InMemorySpanExporter},"get")});var dla=DLn();Object.defineProperty(Ya,"SimpleSpanProcessor",{enumerable:!0,get:s(function(){return dla.SimpleSpanProcessor},"get")});var pla=NLn();Object.defineProperty(Ya,"NoopSpanProcessor",{enumerable:!0,get:s(function(){return pla.NoopSpanProcessor},"get")});var mla=PPe();Object.defineProperty(Ya,"AlwaysOffSampler",{enumerable:!0,get:s(function(){return mla.AlwaysOffSampler},"get")});var fla=MPe();Object.defineProperty(Ya,"AlwaysOnSampler",{enumerable:!0,get:s(function(){return fla.AlwaysOnSampler},"get")});var hla=CFt();Object.defineProperty(Ya,"ParentBasedSampler",{enumerable:!0,get:s(function(){return hla.ParentBasedSampler},"get")});var gla=PFt();Object.defineProperty(Ya,"TraceIdRatioBasedSampler",{enumerable:!0,get:s(function(){return gla.TraceIdRatioBasedSampler},"get")});var _la=YL();Object.defineProperty(Ya,"SamplingDecision",{enumerable:!0,get:s(function(){return _la.SamplingDecision},"get")})});function kla(e){if(!(e.length>4096))try{let t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return;t.username="",t.password="",t.search="",t.hash="",t.hostname=t.hostname.toLowerCase(),(t.protocol==="https:"&&t.port==="443"||t.protocol==="http:"&&t.port==="80")&&(t.port="");let r=t.origin,o=Sla(t.pathname).slice(0,1024);return{origin:r,route:o,sanitizerVersion:"1"}}catch{return}}function Sla(e){return e.split("/").map(o=>Tla(Ila(o))).join("/")||"/"}function Ila(e){try{return decodeURIComponent(e)}catch{return e}}function Tla(e){return yla.test(e)?"{email}":vla.test(e)?"{uuid}":xla.test(e)?"{id}":bla.test(e)?"{hash}":wla.test(e)?"{token}":e.slice(0,128)}var yla,vla,xla,bla,wla,e5e,HFt=b(()=>{"use strict";yla=/^[^/@\s]+@[^/@\s]+\.[^/@\s]+$/u,vla=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,xla=/^\d{7,}$/u,bla=/^[0-9a-f]{16,}$/iu,wla=/^(?=.{20,}$)(?=.*[a-z])(?=.*[A-Z0-9])[-._~+/A-Za-z0-9]+=*$/u,e5e=class{static{s(this,"ProviderEndpointIdentityCache")}limit;values=new Map;constructor(t=256){this.limit=t}resolve(t,r){let o=r?.trim();if(!o)return;let n=`${t??"unknown"}\0${o}`,i=this.values.get(n);if(i!==void 0)return this.values.delete(n),this.values.set(n,i),i??void 0;let a=kla(o)??null;if(this.values.set(n,a),this.values.size>this.limit){let u=this.values.keys().next().value;u&&this.values.delete(u)}return a??void 0}get size(){return this.values.size}};s(kla,"sanitizeProviderEndpoint");s(Sla,"sanitizePathname");s(Ila,"safeDecodeURIComponent");s(Tla,"sanitizePathSegment")});function LLn(e,t){return e!==void 0&&Number.isFinite(e)&&e>0?Math.trunc(e):t}function Ela(e,t){e.setEffectiveReasoningState(t.reasoning.effectiveState),e.setEffectiveReasoningControl(t.reasoning.effectiveControl),t.reasoning.effectiveLevel&&e.setEffectiveReasoningLevel(t.reasoning.effectiveLevel),t.reasoning.effectiveBudgetTokens!==void 0&&e.setEffectiveReasoningBudgetTokens(t.reasoning.effectiveBudgetTokens)}function BLn(e){let t=e?.toLowerCase()??"";return t.includes("/chat/completions")?"chat_completions":t.includes("/responses")?"responses":t.includes("/messages")?"messages":t.includes(":generatecontent")||t.includes(":streamgeneratecontent")?"generate_content":"unknown"}function Cla(e){return e.errorPhase==="prepare"?"configuration":e.errorPhase??"unhandled"}function ULn(e){switch(e.reason){case cr.AuthFailed:return"authentication";case cr.ProviderNotConfigured:case cr.InvalidRequest:return"configuration";case cr.RateLimited:return"rate_limit";case cr.Timeout:case cr.StreamIdleTimeout:return"timeout";case cr.NetworkError:case cr.StaleConnection:case cr.TlsError:return"network";case cr.Cancelled:return"cancelled";case cr.ContextExceeded:case cr.ProviderOverloaded:case cr.ServerError:case cr.ProxyError:case cr.AuthRefresh:case cr.OffpeakQueued:return"provider";default:return"unknown"}}var t5e,KFt=b(()=>{"use strict";iC();HFt();t5e=class{static{s(this,"ModelApiTelemetryStatusSink")}calls=new Map;endpointCache=new e5e;maxActiveCallAgeMs;maxActiveCalls;modelExecution;now;nextCapacityWarningAtMs=0;nextSweepAtMs=0;onWarning;constructor(t){this.maxActiveCallAgeMs=LLn(t.maxActiveCallAgeMs,30*6e4),this.maxActiveCalls=LLn(t.maxActiveCalls,1e3),this.modelExecution=t.modelExecution,this.now=t.now??Date.now,this.onWarning=t.onWarning}publish(t){this.publishObserved(t)}publishFailure(t,r){this.publishObserved(t,r)}publishObserved(t,r){try{this.publishSafely(t,r)}catch(o){try{this.onWarning?.("Model telemetry status processing failed",{eventType:t.type,errorType:o instanceof Error?o.name:typeof o})}catch{}}}shutdown(){for(let t of this.calls.values())this.abandonCall(t,"process_shutdown")}abandonSession(t){for(let r of this.calls.values())r.sessionId===t&&this.abandonCall(r,"session_shutdown")}get activeCallCount(){return this.calls.size}publishSafely(t,r){let o=this.now();this.sweepExpiredCalls(o);let n=t.modelCall;if(!n)return;let i=this.calls.get(n.logicalCallId);if(t.type==="model_request_started"){if(!i){this.ensureCapacity(o);let u=this.resolveTarget(t),l=n.callCause??"initial",c=this.modelExecution.startCall(l==="initial"||!n.previousLogicalCallId?{callCause:"initial",logicalCallId:n.logicalCallId,modelRole:t.model.role,operation:n.operation,requested:u,streaming:t.transport!==Q1.Http}:{callCause:l,logicalCallId:n.logicalCallId,modelRole:t.model.role,operation:n.operation,previousLogicalCallId:n.previousLogicalCallId,requested:u,streaming:t.transport!==Q1.Http});i={attempts:new Map,lastActivityAtMs:o,logicalCallId:n.logicalCallId,sessionId:t.sessionId,writer:c},this.calls.set(n.logicalCallId,i)}i.lastActivityAtMs=o,this.startAttempt(i,t);return}if(!i)return;i.lastActivityAtMs=o;let a=i.attempts.get(t.requestId);switch(t.type){case"model_first_provider_event":a?.writer.markFirstProviderEvent();return;case"model_first_content":a?.writer.markFirstContent();return;case"model_first_text":a?.writer.markFirstText();return;case"model_stream_stalled":a?.writer.markStreamStalled(t.idleMs);return;case"model_retry_scheduled":i.pendingRetryDelayMs=t.delayMs;return;case"model_request_failed":if(!a)return;this.finishFailedAttempt(i,a,t,r),i.attempts.delete(t.requestId),t.retryable||this.finishFailedCall(i,t,r);return;case"model_request_completed":if(!a)return;this.finishCompletedAttempt(a.writer,t),i.attempts.delete(t.requestId),i.writer.finishCompleted(),this.calls.delete(i.logicalCallId)}}startAttempt(t,r){if(t.attempts.has(r.requestId))return;let o=this.resolveTarget(r),n=t.lastRequestId,i=r.attempt<=1||!n,a=t.writer.startAttempt(i?{apiOperation:BLn(o.providerRoute),attemptCause:"initial",attemptNumber:r.attempt,maxAttempts:r.maxAttempts,requestId:r.requestId,target:o,transport:r.transport}:{apiOperation:BLn(o.providerRoute),attemptCause:"retry",attemptNumber:r.attempt,maxAttempts:r.maxAttempts,previousRequestId:n,requestId:r.requestId,retryDelayMs:t.pendingRetryDelayMs,target:o,transport:r.transport});Ela(a,o),t.attempts.set(r.requestId,{requestId:r.requestId,writer:a}),t.lastRequestId=r.requestId,t.pendingRetryDelayMs=void 0}finishCompletedAttempt(t,r){r.providerRequestId&&t.setProviderRequestId(r.providerRequestId),r.finishReason&&t.setFinishReason(r.finishReason),r.usage&&(r.usage.inputTokens!==void 0&&t.setInputTokens(r.usage.inputTokens),r.usage.outputTokens!==void 0&&t.setOutputTokens(r.usage.outputTokens),r.usage.reasoningTokens!==void 0&&t.setReasoningTokens(r.usage.reasoningTokens),r.usage.cacheReadTokens!==void 0&&t.setCacheReadTokens(r.usage.cacheReadTokens),r.usage.cacheWriteTokens!==void 0&&t.setCacheWriteTokens(r.usage.cacheWriteTokens)),t.setStreamOutputCommitted(r.streamOutputCommitted??!1),t.finishCompleted()}finishFailedAttempt(t,r,o,n){if(o.statusCode!==void 0&&r.writer.setHttpStatusCode(o.statusCode),o.providerRequestId&&r.writer.setProviderRequestId(o.providerRequestId),o.providerErrorCode&&r.writer.setProviderErrorCode(o.providerErrorCode),o.providerErrorMessage&&r.writer.setProviderErrorMessage(o.providerErrorMessage),o.retryAfterMs!==void 0&&r.writer.setRetryAfterMs(o.retryAfterMs),r.writer.setStreamOutputCommitted(o.streamOutputCommitted??!1),o.reason===cr.Cancelled){r.writer.finishCancelled("abort_signal");return}r.writer.finishFailed(Cla(o),ULn(o),n??{code:o.providerErrorCode??o.errorCode,message:o.providerErrorMessage??o.message,name:o.exceptionType??"ModelProviderError",statusCode:o.statusCode})}finishFailedCall(t,r,o){r.reason===cr.Cancelled?t.writer.finishCancelled("abort_signal"):t.writer.finishFailed("attempts",ULn(r),o??{code:r.providerErrorCode??r.errorCode,message:r.providerErrorMessage??r.message,name:r.exceptionType??"ModelProviderError"}),this.calls.delete(t.logicalCallId)}resolveTarget(t){let r=this.endpointCache.resolve(t.providerKind,t.baseURL),o=t.modelCall?.reasoning??{capability:"unknown",effectiveControl:"unknown",effectiveState:"unknown",requestedControl:"unknown",requestedState:"unknown"};return{providerId:String(t.model.providerId),providerKind:t.providerKind?.trim()||"unknown",providerOrigin:r?.origin,providerRoute:r?.route,reasoning:o,requestedModel:String(t.model.modelId)}}sweepExpiredCalls(t){if(t<this.nextSweepAtMs)return;this.nextSweepAtMs=t+Math.min(this.maxActiveCallAgeMs,6e4);let r=0;for(let o of this.calls.values())t-o.lastActivityAtMs<this.maxActiveCallAgeMs||(this.abandonCall(o,"missing_terminal"),r+=1);r>0&&this.warn("Expired model telemetry calls were abandoned",{abandonedCount:r,maxActiveCallAgeMs:this.maxActiveCallAgeMs})}ensureCapacity(t){let r=0;for(;this.calls.size>=this.maxActiveCalls;){let o=[...this.calls.values()].reduce((n,i)=>!n||i.lastActivityAtMs<n.lastActivityAtMs?i:n,void 0);if(!o)return;this.abandonCall(o,"missing_terminal"),r+=1}r>0&&t>=this.nextCapacityWarningAtMs&&(this.nextCapacityWarningAtMs=t+6e4,this.warn("Model telemetry active call capacity was reached",{abandonedCount:r,maxActiveCalls:this.maxActiveCalls}))}abandonCall(t,r){for(let o of t.attempts.values())o.writer.finishAbandoned(r);t.attempts.clear(),t.writer.finishAbandoned(r),this.calls.delete(t.logicalCallId)}warn(t,r){try{this.onWarning?.(t,r)}catch{}}};s(LLn,"positiveInteger");s(Ela,"setEffectiveReasoning");s(BLn,"apiOperationFromRoute");s(Cla,"failureStage");s(ULn,"errorCategory")});var KLn={};mr(KLn,{createOwnedAgentTelemetryRuntime:()=>Ala,metricResourceAttributes:()=>WLn,resourceAttributes:()=>GLn});function Ala(e){let t=e.timeoutMs??3e3,r=new VLn.OTLPTraceExporter({compression:J5.GZIP,headers:e.headers,timeoutMillis:t,url:e.endpoint}),o=new n5e.BatchSpanProcessor(r,{exportTimeoutMillis:t,maxExportBatchSize:e.maxBatchSize??100,maxQueueSize:e.maxQueueSize??2e3,scheduledDelayMillis:5e3}),n=(0,QFt.resourceFromAttributes)(GLn(e.resource)),i=(0,QFt.resourceFromAttributes)(WLn(e.resource)),a=new n5e.BasicTracerProvider({forceFlushTimeoutMillis:t,resource:n,spanProcessors:[o]}),u=new ZLn.OTLPMetricExporter({compression:J5.GZIP,headers:e.metricHeaders??e.headers,temporalityPreference:fE.AggregationTemporality.DELTA,timeoutMillis:t,url:e.metricEndpoint??e.endpoint}),l=new fE.PeriodicExportingMetricReader({exporter:u,exportIntervalMillis:e.metricExportIntervalMs??6e4,exportTimeoutMillis:t}),c=new fE.MeterProvider({readers:[l],resource:i,views:Pla()}),d=new qLn.AsyncLocalStorageContextManager,p=nc.setGlobalContextManager(d.enable());p||d.disable();let m=a.getTracer("@zcode/cli-agent-telemetry",String(5)),f=c.getMeter("@zcode/cli-agent-telemetry",String(5)),h=new FCe(f),_=new qCe({identity:e.identity,metrics:h,onWarning:e.onWarning,tracer:m}),y=new t5e({modelExecution:_,onWarning:e.onWarning}),v=!1;return{abandonSession(S){_.abandonSession(S),y.abandonSession(S)},agentExecution:_,enabled:!0,modelExecution:_,statusSink:y,async flush(S){v||await FLn(Promise.all([a.forceFlush(),c.forceFlush()]),S?.timeoutMs??t)},async shutdown(S){if(!v){v=!0,y.shutdown(),_.abandonProcess();try{await FLn(Promise.all([a.shutdown(),c.shutdown()]),S?.timeoutMs??t)}finally{p&&d.disable()}}},updateIdentity(S){_.updateIdentity(S)}}}function Pla(){return[y1("zcode.agent.turn.duration",[.5,1,2,5,10,30,60,120,300,600]),y1("zcode.model.*.duration",[.1,.25,.5,1,2,5,10,30,60,120]),y1("zcode.context.compaction.duration",[.001,.005,.01,.025,.05,.1,.25,.5,1,2.5,5,10,30,60,120,300,600]),y1("zcode.detached.operation.duration",[.001,.005,.01,.025,.05,.1,.25,.5,1,2.5,5,10,30,60,120,300,600]),y1("zcode.agent.step.duration",[.001,.005,.01,.025,.05,.1,.25,.5,1,2.5,5,10,30,60,120,300,600]),y1("zcode.tool.execution.duration",[.001,.005,.01,.05,.1,.5,1,5,30,120,300]),y1("zcode.command.execution.duration",[.01,.05,.1,.5,1,5,30,120,300,600]),y1("zcode.*.time_to_first_*",[.1,.25,.5,1,2,5,10,30,60,120]),y1("zcode.model.call.attempts",[1,2,3,4,5,8,13]),r5e("zcode.model.attempt.tokens"),r5e("zcode.model.attempt.stream_stall.count"),r5e("zcode.telemetry.creation_drop.count"),r5e("zcode.telemetry.abandoned.count")]}function y1(e,t){return{aggregation:{options:{boundaries:t,recordMinMax:!0},type:fE.AggregationType.EXPLICIT_BUCKET_HISTOGRAM},aggregationCardinalityLimit:250,instrumentName:e}}function r5e(e){return{aggregationCardinalityLimit:250,instrumentName:e}}function GLn(e){return HLn(e,{includeInstallationId:!0,includeServiceInstanceId:!0})}function WLn(e){return HLn(e,{includeInstallationId:!1,includeServiceInstanceId:!1})}function HLn(e,t){return Mla({"deployment.environment.name":e.deploymentEnvironment,"host.arch":Rla(),"os.type":process.platform,"process.runtime.name":"nodejs","process.runtime.version":process.version.replace(/^v/u,""),"service.instance.id":t.includeServiceInstanceId?e.serviceInstanceId:void 0,"service.name":e.serviceName,"service.version":e.cliVersion,"zcode.build.commit_id":e.buildCommitId,"zcode.device.installation_id":t.includeInstallationId?e.installationId:void 0,"zcode.product.version":e.productVersion,"zcode.runtime.distribution":e.runtimeDistribution,"zcode.runtime.surface":e.runtimeSurface,"zcode.telemetry.schema_owner":"cli","zcode.telemetry.schema_version":5})}function Rla(){switch(process.arch){case"x64":return"amd64";case"ia32":return"x86";default:return process.arch}}function Mla(e){let t={};for(let[r,o]of Object.entries(e))o!==void 0&&o!==""&&(t[r]=o);return t}async function FLn(e,t){let r;try{return await Promise.race([e,new Promise(o=>{r=setTimeout(o,Math.max(1,t))})])}finally{r&&clearTimeout(r)}}var qLn,ZLn,VLn,QFt,fE,n5e,JLn=b(()=>{"use strict";fn();qLn=ht(TPn(),1),ZLn=ht(oLn(),1),VLn=ht(lLn(),1);FAe();QFt=ht(cAe(),1),fE=ht(OAe(),1),n5e=ht(jLn(),1);Q8e();VCe();qLt();KFt();s(Ala,"createOwnedAgentTelemetryRuntime");s(Pla,"metricViews");s(y1,"histogramView");s(r5e,"cardinalityView");s(GLn,"resourceAttributes");s(WLn,"metricResourceAttributes");s(HLn,"telemetryResourceAttributes");s(Rla,"hostArchitecture");s(Mla,"compactResourceAttributes");s(FLn,"withTimeout")});function tBn(e={}){let t=e.owner??jee;return t?{agentExecution:t.agentExecution,enabled:t.enabled,modelExecution:t.modelExecution,statusSink:t.statusSink,async shutdown(){e.sessionId&&t.abandonSession(e.sessionId),await t.flush({timeoutMs:1500})}}:{agentExecution:QLn,enabled:!1,modelExecution:QLn,async shutdown(){}}}function YFt(e){let t=e.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT?.trim();if(t)return a5e(t);let r=e.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();if(!r)return;let o=a5e(r);if(!o)return;let n=new URL(o);return n.pathname=`${n.pathname.replace(/\/$/u,"")}/v1/traces`,n.toString()}function Nla(e){let t=e.OTEL_EXPORTER_OTLP_METRICS_ENDPOINT?.trim();if(t)return a5e(t);let r=e.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();if(r){let o=a5e(r);if(!o)return;let n=new URL(o);return n.pathname=`${n.pathname.replace(/\/$/u,"")}/v1/metrics`,n.toString()}return YFt(e)}function YLn(e){if(!e?.trim())return;let t={};for(let r of e.split(",")){let o=r.indexOf("=");if(o<=0)continue;let n=s5e(r.slice(0,o).trim()),i=s5e(r.slice(o+1).trim());n&&i&&(t[n]=i)}return Object.keys(t).length>0?t:void 0}async function rBn(e,t={}){if(!YFt(e)||Kla(e.ZCODE_MODEL_TELEMETRY_ENABLED))return e;let o=XFt(e.ZCODE_TELEMETRY_DEVICE_MID)??await Lla(e.ZCODE_HOME?.trim()),n=o?{...e,ZCODE_TELEMETRY_DEVICE_MID:o}:e;return!zee&&!jee&&(zee=zla(n,t)),jee=await zee,n}async function u5e(){let e=jee??await zee;jee=void 0,zee=void 0,await e?.shutdown({timeoutMs:1500})}async function zla(e,t){let r=YFt(e);if(!r)return;let o=Nla(e),n=jla(e),i={buildCommitId:Wla(t.buildCommitId??e.ZCODE_BUILD_COMMIT_ID),cliVersion:XLn(t.cliVersion),deploymentEnvironment:e.ZCODE_ENV??e.ZCODE_RUNTIME_ENV??Hla(e)["deployment.environment.name"],installationId:XFt(e.ZCODE_TELEMETRY_DEVICE_MID),productVersion:XLn(t.productVersion??e.ZCODE_APP_VERSION),runtimeDistribution:t.runtimeDistribution??Gla(e.ZCODE_TELEMETRY_RUNTIME_DISTRIBUTION),runtimeSurface:t.runtimeSurface??Vla(e.ZCODE_TELEMETRY_RUNTIME_SURFACE),serviceInstanceId:(0,i5e.randomUUID)(),serviceName:e.OTEL_SERVICE_NAME?.trim()||"zcode-cli-agent"};try{let{createOwnedAgentTelemetryRuntime:a}=await Promise.resolve().then(()=>(JLn(),KLn));return a({endpoint:r,headers:YLn(e.OTEL_EXPORTER_OTLP_TRACES_HEADERS??e.OTEL_EXPORTER_OTLP_HEADERS),identity:n,metricEndpoint:o,metricHeaders:YLn(e.OTEL_EXPORTER_OTLP_METRICS_HEADERS??e.OTEL_EXPORTER_OTLP_HEADERS),onWarning:t.onWarning,resource:i})}catch(a){t.onWarning?.("Agent telemetry runtime initialization failed",{errorType:a instanceof Error?a.name:typeof a});return}}function jla(e){let t=nBn(e.ZCODE_TELEMETRY_USER_SUBJECT_ID),r=e.ZCODE_TELEMETRY_IDENTITY_STATE?.trim();return{identityState:r==="authenticated"||r==="anonymous"||r==="unknown"?r:t?"authenticated":XFt(e.ZCODE_TELEMETRY_DEVICE_MID)?"anonymous":"unknown",...t?{userSubjectId:t}:{}}}function XFt(e){return nBn(e)}function nBn(e){let t=e?.trim();return t&&Ola.test(t)?t:void 0}async function Lla(e){let t=e?(0,nR.join)(e,"v2","telemetry-state.json"):(0,nR.join)((0,eBn.homedir)(),".zcode","v2","telemetry-state.json"),r=o5e.get(t);if(r)return r;let o=Bla(t);o5e.set(t,o);try{return await o}finally{o5e.get(t)===o&&o5e.delete(t)}}async function Bla(e){try{let t=await oBn(e);return t||await Ula(e,async()=>{let r=await e9t(e),o=iBn(r);if(o)return o;let n=(0,i5e.randomUUID)();r.deviceMid=n;let i=`${e}.${process.pid}.${(0,i5e.randomUUID)()}.tmp`;return await(0,Kp.writeFile)(i,JSON.stringify(r,null,2),"utf8"),await(0,Kp.rename)(i,e),n})}catch{return}}async function Ula(e,t){let r=(0,nR.join)((0,nR.dirname)(e),"telemetry-state.lock");await(0,Kp.mkdir)((0,nR.dirname)(e),{recursive:!0});for(let o=0;o<2;o+=1){let n;try{return n=await(0,Kp.open)(r,"wx"),await n.writeFile(JSON.stringify({createdAt:Date.now(),pid:process.pid}),"utf8"),await t()}catch(i){if(!Zla(i)||!await Fla(r))throw i}finally{if(n!==void 0){await n.close();try{await(0,Kp.unlink)(r)}catch{}}}}return await oBn(e)}async function Fla(e){try{let t=await(0,Kp.stat)(e);if(Date.now()-t.mtimeMs<$la){let r=await e9t(e),o=typeof r.pid=="number"&&Number.isInteger(r.pid)?r.pid:void 0;if(!o||qla(o))return!1}return await(0,Kp.unlink)(e),!0}catch{return!1}}function qla(e){try{return process.kill(e,0),!0}catch(t){return!(t instanceof Error&&"code"in t&&t.code==="ESRCH")}}function Zla(e){return e instanceof Error&&"code"in e&&e.code==="EEXIST"}async function e9t(e){try{let t=JSON.parse(await(0,Kp.readFile)(e,"utf8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}async function oBn(e){return iBn(await e9t(e))}function iBn(e){return typeof e.deviceMid=="string"&&e.deviceMid.trim()?e.deviceMid.trim():void 0}function Vla(e){switch(e?.trim()){case"standalone_cli":case"desktop_local_host":case"remote_workspace_host":return e.trim();default:return"standalone_cli"}}function Gla(e){switch(e?.trim()){case"source":case"development_bundle":case"packaged":case"unknown":return e.trim();default:return"unknown"}}function XLn(e){let t=e?.trim();return t&&/^[0-9A-Za-z][0-9A-Za-z.+_-]{0,63}$/u.test(t)?t:void 0}function Wla(e){let t=e?.trim();return t&&Dla.test(t)?t.toLowerCase():void 0}function Hla(e){let t={};for(let r of e.OTEL_RESOURCE_ATTRIBUTES?.split(",")??[]){let o=r.indexOf("=");o<=0||(t[s5e(r.slice(0,o).trim())]=s5e(r.slice(o+1).trim()))}return t}function a5e(e){try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?t.toString():void 0}catch{return}}function Kla(e){return["0","false","off","disabled"].includes(e?.trim().toLowerCase()??"")}function s5e(e){try{return decodeURIComponent(e)}catch{return e}}var i5e,Kp,eBn,nR,$la,Ola,Dla,o5e,jee,zee,QLn,aBn=b(()=>{"use strict";i5e=require("node:crypto"),Kp=require("node:fs/promises"),eBn=require("node:os"),nR=require("node:path");VCe();$la=5*6e4,Ola=/^[A-Za-z0-9._:-]{1,128}$/u,Dla=/^[0-9a-f]{7,64}$/iu,o5e=new Map,QLn=new ZCe;s(tBn,"createModelTelemetry");s(YFt,"resolveOtlpTraceEndpoint");s(Nla,"resolveOtlpMetricEndpoint");s(YLn,"parseOtlpHeaders");s(rBn,"prepareModelTelemetryEnv");s(u5e,"shutdownPreparedModelTelemetry");s(zla,"createPreparedOwner");s(jla,"resolveTelemetryIdentity");s(XFt,"normalizeTelemetryDeviceMid");s(nBn,"normalizeTelemetryId");s(Lla,"resolveStandaloneDeviceMid");s(Bla,"resolveStandaloneDeviceMidFromFile");s(Ula,"withTelemetryStateLock");s(Fla,"removeStaleTelemetryStateLock");s(qla,"isProcessAlive");s(Zla,"isFileExistsError");s(e9t,"readTelemetryState");s(oBn,"readDeviceMid");s(iBn,"deviceMidFromState");s(Vla,"resolveRuntimeSurface");s(Gla,"resolveRuntimeDistribution");s(XLn,"normalizeVersion");s(Wla,"normalizeBuildCommitId");s(Hla,"resourceAttributesFromEnv");s(a5e,"validHttpUrl");s(Kla,"isExplicitlyDisabled");s(s5e,"safeDecode")});var l5e=b(()=>{"use strict";VCe();aBn();BCe();KFt();HFt()});function sBn(e){let t=lBn(e);return t?Jla.includes(t):!1}function uBn(e){return sBn(e)||Yla(e)}function Yla(e){let t=Xla(e);return t?Qla.some(r=>t===r||t.endsWith(`.${r}`)):!1}function Xla(e){let t=e?.trim();if(t)try{return new URL(t).hostname.toLowerCase()}catch{try{return new URL(`https://${t}`).hostname.toLowerCase()}catch{return}}}function lBn(e){return e?.trim().replace(/\/+$/,"").toLowerCase()??""}var Jla,Qla,t9t=b(()=>{"use strict";qr();Jla=(()=>{let e=qne(process.env);return[e.zcodePlanOpenAiBaseUrl,e.zcodePlanAnthropicBaseUrl].map(lBn)})(),Qla=["bigmodel.cn","z.ai","chatglm.site"];s(sBn,"isZcodePlanRuntimeBaseUrl");s(uBn,"isOfficialGlmProviderSideMediaBaseUrl");s(Yla,"isOfficialGlmProviderSideMediaHost");s(Xla,"hostnameFromBaseURL");s(lBn,"normalizeRuntimeBaseUrl")});function Jp(e,t={}){let r=new $N({modelsDev:t.modelsDev,overrides:e.overrides});return r.initialize(),r}function wx(e,t,r){if(!e)return;let o={},n=String(e.providerId),i=String(e.modelId),a=r??Jp(t);rca(o,t.overrides[oca(e)]),nca(o,a.getCatalogCapability(n,i));let u=RN({modelId:i,providerId:n});return o.supportsImages===void 0&&u.supportsImages!==void 0&&(o.supportsImages=u.supportsImages),ica(o,{apiFormat:e.apiFormat,baseURL:e.baseURL,modelId:i,providerId:n}),c5e(o)?o:void 0}function c5e(e){return e?.supportsImages!==void 0||e?.supportsPdf!==void 0}function d5e(e){let t={};return e?.supportsImages!==void 0&&(t.supportsImages=e.supportsImages),e?.supportsPdf!==void 0&&(t.supportsPdf=e.supportsPdf),c5e(t)?t:void 0}function rca(e,t){let r=d5e(t);r&&(r.supportsImages!==void 0&&(e.supportsImages=r.supportsImages),r.supportsPdf!==void 0&&(e.supportsPdf=r.supportsPdf))}function nca(e,t){let r=d5e(t);r&&(e.supportsImages===void 0&&r.supportsImages!==void 0&&(e.supportsImages=r.supportsImages),e.supportsPdf===void 0&&r.supportsPdf!==void 0&&(e.supportsPdf=r.supportsPdf))}function oca(e){return`${String(e.providerId)}/${String(e.modelId)}`}function ica(e,t){if(e.supportsImages===void 0&&uca(t.modelId)){if(t.apiFormat==="openai-chat-completions"){e.supportsImages=!1;return}lca(t.modelId)||t.apiFormat==="anthropic-messages"&&aca(t)||(e.supportsImages=!1)}}function aca(e){return sca(e.providerId)||uBn(e.baseURL)}function sca(e){return tca.has(e.trim().toLowerCase())}function uca(e){return cca(e).some(t=>t.includes("glm"))}function lca(e){let t=e.trim().split("/").filter(Boolean).at(-1);return t?eca.test(nht(t)):!1}function cca(e){let t=e.trim().toLowerCase();if(!t)return[];let r=t.split("/").filter(Boolean).at(-1);return!r||r===t?[t]:[t,r]}var eca,tca,p5e=b(()=>{"use strict";lw();qr();t9t();eca=/^glm-5\.2-.+$/i,tca=new Set([soe,"zai",ia.bigmodel,ia.bigmodelCodingPlan,ia.bigmodelStartPlan,ia.zai,ia.zaiCodingPlan,ia.zaiStartPlan,ia.zapi].map(e=>e.toLowerCase()));s(Jp,"createRuntimeModelCapabilityProvider");s(wx,"resolveRuntimeModelInputCapabilities");s(c5e,"hasRuntimeModelInputCapabilities");s(d5e,"pickRuntimeModelInputCapabilities");s(rca,"applyMediaFacts");s(nca,"applyMissingMediaFacts");s(oca,"modelCapabilityKey");s(ica,"applyProviderAwareMediaFallback");s(aca,"hasOfficialGlmProviderSideMedia");s(sca,"isOfficialGlmProviderSideMediaProvider");s(uca,"isGlmFamilyModelId");s(lca,"isGlm52SuffixedVariant");s(cca,"modelIdCandidates")});function cBn(){let e=Lee(process.platform),t=Lee((0,m5e.arch)()),r=Lee((0,m5e.release)());return{...e&&t?{"X-Platform":`${e}-${t}`}:{},"X-Os-Category":pca(process.platform),...r?{"X-Os-Version":r}:{}}}function Lee(e){let t=e?.trim();if(!(!t||!dca.test(t)))return t}function pca(e){switch(e){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}var m5e,dca,dBn=b(()=>{"use strict";m5e=require("node:os"),dca=/^[\x20-\x7e]+$/;s(cBn,"createRuntimePlatformHeaders");s(Lee,"normalizePrintableHeaderValue");s(pca,"normalizeOsCategory")});function f5e(e){let t=e??"~/.zcode/cli/config.json";return new qx(ir.ModelConfigMissing,`Model config is missing. Create ${t} with an explicit model provider before running ZCode.`,{configPath:t})}function mca(e,t=process.env,r={}){let o={};r9t(o,e.main,t,r),e.lite&&r9t(o,e.lite,t,r);for(let n of e.available??[])r9t(o,n,t,r);return{defaultProviderId:e.main.provider,inputMediaCapabilities:hca(e,r.modelCatalog),providers:o,env:t}}function h5e(e,t=process.env,r={}){let o=mca(e,t,r),n=fca(r.network);return{...o,...n?{network:n}:{},...r.endpointRoutingPort?{endpointRoutingPort:r.endpointRoutingPort}:{}}}function fca(e){if(!(!e?.caCertFile&&!e?.httpProxy&&!e?.noProxy))return{...e.caCertFile?{caCertFile:e.caCertFile}:{},...e.httpProxy?{httpProxy:e.httpProxy}:{},...e.noProxy?{noProxy:e.noProxy}:{}}}function hca(e,t){if(!t)return;let r=Jp(t),o=[];for(let n of gca(e)){let i=wx({apiFormat:n.kind?Ry(n.kind):void 0,baseURL:n.baseURL,modelId:n.model,providerId:n.provider},t,r);c5e(i)&&o.push([_ca(n),i])}return o.length>0?Object.fromEntries(o):void 0}function gca(e){return[e.main,...e.lite?[e.lite]:[],...e.available??[]]}function _ca(e){return`${e.provider}/${e.model}`}function r9t(e,t,r,o){let n=t.provider,i=e[n],a=kca(t,r,i,o);if(!i){e[n]=a;return}e[n]=Aca(n,i,a)}function yca(e,t,r){let n=`Z Code@${t.sourceTitle??bca()}`,i=xca(e,t);return QYt({"HTTP-Referer":vca(e),"User-Agent":`ZCode/${i??"unknown"}`,...i?{"X-ZCode-App-Version":i}:{},"X-Title":n,"X-ZCode-Agent":"glm",...cBn()},r)}function vca(e){return V1(e)}function xca(e,t){let r=e[VB]??t.appVersion;return Lee(r)}function bca(){return process.argv.includes("app-server")||process.argv.includes("agent-server")?"electron":"cli"}function wca(e,t){let r={...e};if(t)for(let[o,n]of Object.entries(t))r[o]=n;return Object.keys(r).length>0?r:void 0}function kca(e,t,r,o={}){let n=e.kind??Sca(r)??Ica(e),i=e.baseURL??r?.baseURL,a=e.apiKey??Eca(e,n,t)??r?.apiKey,u=wca(yca(t,o,i),e.headers),l=e.providerOptions,c=e.providerName??Tca(r)??e.provider;if(n==="openai-compatible"){if(!i)throw new Error(`Model provider ${e.provider} is missing baseURL`);return{kind:n,name:c,baseURL:i,apiKey:a,apiKeyRequired:e.apiKeyRequired??r?.apiKeyRequired,...e.includeUsage!==void 0?{includeUsage:e.includeUsage}:{},headers:u,providerOptions:l}}return{kind:n,baseURL:i,apiKey:a,apiKeyRequired:e.apiKeyRequired??r?.apiKeyRequired,headers:u,providerOptions:l}}function Sca(e){if(e&&(e.kind==="anthropic"||e.kind==="openai"||e.kind==="openai-compatible"))return e.kind}function Ica(e){return e.kind?e.kind:e.provider==="anthropic"&&!e.baseURL?"anthropic":e.provider==="openai"&&!e.baseURL?"openai":"openai-compatible"}function Tca(e){return e&&"name"in e?e.name:void 0}function Eca(e,t,r){for(let o of Cca(e,t)){let n=r[o];if(n)return n}}function Cca(e,t){let r=new Set;t==="openai"&&r.add("OPENAI_API_KEY"),t==="anthropic"&&r.add("ANTHROPIC_API_KEY");for(let o of[e.providerName,e.provider,e.provider.replace(/^default[-_]/,"")]){let n=Mca(o);n&&r.add(`${n}_API_KEY`)}return r.add("ZCODE_API_KEY"),[...r]}function Aca(e,t,r){let o={...t};for(let[n,i]of Object.entries(r)){if(i===void 0)continue;if(n==="headers"){o.headers=Pca(e,"headers",t.headers,i);continue}if(n==="providerOptions"){o.providerOptions=Rca(e,"providerOptions",t.providerOptions,i);continue}let a=t[n];if(a!==void 0&&!pBn(a,i))throw new Error(`Conflicting model provider config for ${e}.${n}`);o[n]=a??i}return o}function Pca(e,t,r,o){let n={...r};for(let[i,a]of Object.entries(o)){if(n[i]!==void 0&&n[i]!==a)throw new Error(`Conflicting model provider config for ${e}.${t}.${i}`);n[i]=a}return n}function Rca(e,t,r,o){if(r&&!pBn(r,o))throw new Error(`Conflicting model provider config for ${e}.${t}`);return{...o}}function Mca(e){if(!e)return;let t=e.trim().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").toUpperCase();return t.length>0?t:void 0}function pBn(e,t){return JSON.stringify(e)===JSON.stringify(t)}var g5e=b(()=>{"use strict";qr();ze();p5e();dBn();iC();s(f5e,"createModelConfigMissingError");s(mca,"createAiSdkModelRegistryConfig");s(h5e,"createRuntimeAiSdkModelRegistryConfig");s(fca,"normalizeAiSdkNetworkConfig");s(hca,"createInputMediaCapabilities");s(gca,"modelTargets");s(_ca,"modelTargetKey");s(r9t,"mergeProvider");s(yca,"createDefaultProviderHeaders");s(vca,"resolveCliZCodeEndpointOrigin");s(xca,"resolveAppVersionForHeaders");s(bca,"detectDefaultProviderSourceTitle");s(wca,"mergeHeaders");s(kca,"targetToProviderConfig");s(Sca,"currentConfigKind");s(Ica,"inferProviderKind");s(Tca,"getProviderName");s(Eca,"resolveApiKeyFromEnv");s(Cca,"apiKeyEnvCandidates");s(Aca,"mergeProviderConfig");s(Pca,"mergeStringRecord");s(Rca,"mergeObject");s(Mca,"toEnvKey");s(pBn,"valuesEqual")});function hE(e={}){let t=e.modelConfig?void 0:Ni({env:e.env}),r=e.modelConfig??t?.config.model;if(!r)throw f5e(t?.sources.user.path);let o=h5e(r,e.env,{appVersion:e.appVersion,endpointRoutingPort:e.endpointRoutingPort,modelCatalog:e.modelCatalog??t?.config.modelCatalog,network:e.network??t?.config.network,sourceTitle:e.sourceTitle}),n=new qD(o);return new LN({debugDir:e.modelIoDir,env:e.env,logger:e.logger,modelCatalog:e.modelCatalog??t?.config.modelCatalog,registry:n,streamIdleTimeoutMs:e.streamIdleTimeoutMs??t?.config.modelStream.idleTimeoutMs,statusSink:e.statusSink})}var Bee=b(()=>{"use strict";lw();lw();Ou();g5e();s(hE,"createModelAdapter")});function hy(){return mBn.performance.now()}function $ca(e){return e instanceof Error?e:new Error(String(e))}function _5e(e,t){return Math.max(0,Math.round(t-e))}var mBn,gE,y5e=b(()=>{"use strict";mBn=require("node:perf_hooks"),gE=class{static{s(this,"StartupTimer")}logger;baseContext;startedAt;lastMarkAt;constructor(t,r,o=hy()){this.logger=t,this.baseContext=r,this.startedAt=o,this.lastMarkAt=o}start(t,r){let o=hy();this.logger.info(t,this.createContext(r,o,0,"started"))}mark(t,r){let o=hy(),n=_5e(this.lastMarkAt,o);this.lastMarkAt=o,this.logger.info(t,this.createContext(r,o,n,"completed"))}complete(t,r){let o=hy();this.logger.info(t,this.createContext(r,o,_5e(this.startedAt,o),"completed"))}fail(t,r,o){let n=hy();this.logger.error(t,$ca(r),this.createContext(o,n,_5e(this.startedAt,n),"failed"))}createContext(t,r,o,n){return{...this.baseContext,...t.context,durationMs:o,event:t.event,stage:t.stage,status:n,totalDurationMs:_5e(this.startedAt,r)}}};s(hy,"startupNow");s($ca,"toError");s(_5e,"elapsedMs")});function v5e(e,t){Oca(e)&&e.scheduleLogRetentionCleanup({logger:t.child({module:"adapters.logging"})})}function Oca(e){return"scheduleLogRetentionCleanup"in e&&typeof e.scheduleLogRetentionCleanup=="function"}var n9t=b(()=>{"use strict";s(v5e,"scheduleStartupLogRetentionCleanup");s(Oca,"hasRetentionScheduler")});function fBn(e){return e.ZCODE_MESSAGE_ENABLED==="1"||e.ZCODE_MESSAGE_ENABLED==="true"}function hBn(e){let t={},r={};return e.runtimeConfig?.mode&&(r.mode=e.runtimeConfig.mode),e.runtimeConfig?.toolAllowlist&&(r.allowedTools=[...e.runtimeConfig.toolAllowlist]),e.runtimeConfig?.toolDisallowlist&&(r.disallowedTools=[...e.runtimeConfig.toolDisallowlist]),Object.keys(r).length>0&&(t.permission=r),e.uiLocale&&(t.ui={locale:e.uiLocale}),Object.keys(t).length>0?t:void 0}function gBn(e,t){let r=e.config.ui.locale,o=o9t(r,t);return o===r?e:{...e,config:{...e.config,ui:{...e.config.ui,locale:o}}}}function o9t(e,t){let r=e==="auto"?Dca(t):void 0;return rx(e,r)}function Dca(e){return e.uiDetectedLocale!==void 0?vL({intlLocale:e.uiDetectedLocale}):vL({env:e.env??process.env,intlLocale:Nca()})}function Nca(){try{return Intl.DateTimeFormat().resolvedOptions().locale}catch{return}}var _Bn=b(()=>{"use strict";vg();s(fBn,"isMessageEnabled");s(hBn,"createConfigCliOverrides");s(gBn,"resolveEffectiveConfigResult");s(o9t,"resolveEffectiveLocale");s(Dca,"detectAppLocale");s(Nca,"resolveIntlLocale")});function kx(e){return(0,oB.basename)(e)==="cli"?e:(0,oB.join)(e,"cli")}function iB(e){return(0,oB.join)(e,"plugins")}function x5e(e,t){return(0,oB.join)(e,t?"debug":"rollout")}function yBn(e,t,r){return fQ({cliStorageRoot:e,workspaceIdentity:r,workspacePath:t})}function Uee(e){return rF(e.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)||"default")}var oB,v1=b(()=>{"use strict";oB=require("node:path");ze();md();s(kx,"getCliStorageRoot");s(iB,"getPluginStorageRoot");s(x5e,"getModelIoDir");s(yBn,"getProjectMemoryRoot");s(Uee,"projectIdFromDirectory")});function Fee(e){return"close"in e&&typeof e.close=="function"}function vBn(e){let t=e;return typeof t.recordInputHistory=="function"&&typeof t.recallPreviousInputHistory=="function"?e:void 0}function xBn(e){let t=e;return typeof t.getProjectPermissionMode=="function"&&typeof t.saveProjectPermissionMode=="function"&&typeof t.getGlobalReasoningLevel=="function"&&typeof t.saveGlobalReasoningLevel=="function"?e:void 0}function bBn(e,t){if(!e)return;let r=e.getProjectPermissionMode(t);return IBn(r)?void 0:r??void 0}function b5e(e){if(!e)return;let t=e.getGlobalReasoningLevel();return IBn(t)?void 0:t??void 0}function wBn(e){e.close()}function kBn(e,t){let r=qee(e);t.start("ZCode SQLite migration started",{context:{dbPath:r},event:"bootstrap.app.startup.sqlite_migration.started",stage:"migrate_session_db"});let o=PC({dbPath:r});return t.mark("ZCode SQLite migration completed",{context:{dbPath:r},event:"bootstrap.app.startup.sqlite_migration.completed",stage:"migrate_session_db"}),o}function SBn(e,t){let r=qee(e);t.start("ZCode Protocol SQLite migration started",{context:{dbPath:r},event:"zcode_protocol.startup.sqlite_migration.started",stage:"migrate_session_db"});let o=PC({dbPath:r});return t.mark("ZCode Protocol SQLite migration completed",{context:{dbPath:r},event:"zcode_protocol.startup.sqlite_migration.completed",stage:"migrate_session_db"}),o}function qee(e){return $a(e.config.storage.sessionDbPath)}function IBn(e){return typeof e=="object"&&e!==null&&typeof e.then=="function"}var Zee=b(()=>{"use strict";Xx();Ou();s(Fee,"isClosableSessionStore");s(vBn,"asInputHistoryStore");s(xBn,"asLocalSettingStore");s(bBn,"readProjectPermissionMode");s(b5e,"readGlobalReasoningLevel");s(wBn,"closeSessionStore");s(kBn,"openStartupSessionStore");s(SBn,"openStartupZCodeProtocolSessionStore");s(qee,"getSessionDbPath");s(IBn,"isPromiseLike")});function Sx(e){return e?Object.entries(e).filter(([,t])=>t?.enable===!1).map(([t])=>t):[]}var aB=b(()=>{"use strict";s(Sx,"collectDisabledPaths")});function TBn(e){let{builtInExpertWorkflowDefinition:t}=e;return{expertWorkflowStatus:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind})).status({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind}),"expertWorkflowStatus"),workflowStatus:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind})).status({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind}),"workflowStatus"),retryWorkflow:s(async r=>(await e.prepareUserExecutionBoundary(r),(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind})).retry({abortSignal:r?.abortSignal,activityId:r?.activityId,cwd:e.workingDirectory,definitionId:r?.definitionId,nodeId:r?.nodeId,onEvent:r?.onEvent,phase:r?.phase,runId:r?.runId,traceContext:r?.traceContext??e.traceContext,workflowKind:r?.workflowKind})),"retryWorkflow"),listExpertWorkflows:s(async r=>e.listWorkflowRuns({abortSignal:r?.abortSignal,definitionId:r?.definitionId,limit:r?.limit,workflowKind:r?.workflowKind??t.kind}),"listExpertWorkflows"),listWorkflows:e.listWorkflowRuns,readExpertWorkflowEvents:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r.abortSignal,runId:r.runId})).events({abortSignal:r.abortSignal,limit:r.limit,runId:r.runId}),"readExpertWorkflowEvents"),readWorkflowEvents:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r.abortSignal,runId:r.runId})).events({abortSignal:r.abortSignal,limit:r.limit,runId:r.runId}),"readWorkflowEvents"),resumeExpertWorkflow:s(async r=>(await e.prepareUserExecutionBoundary(r),e.switchWorkflowToYolo(),(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind})).resume({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,onEvent:r?.onEvent,runId:r?.runId,traceContext:r?.traceContext??e.traceContext,workflowKind:r?.workflowKind??t.kind})),"resumeExpertWorkflow"),resumeWorkflow:s(async r=>(await e.prepareUserExecutionBoundary(r),e.switchWorkflowToYolo(),(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind})).resume({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,onEvent:r?.onEvent,runId:r?.runId,traceContext:r?.traceContext??e.traceContext,workflowKind:r?.workflowKind})),"resumeWorkflow"),stopExpertWorkflow:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind})).cancel({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind??t.kind}),"stopExpertWorkflow"),stopWorkflow:s(async r=>(await e.workflowRuntimeForLookup({abortSignal:r?.abortSignal,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind})).cancel({abortSignal:r?.abortSignal,cwd:e.workingDirectory,definitionId:r?.definitionId,runId:r?.runId,workflowKind:r?.workflowKind}),"stopWorkflow"),runExpertWorkflowBackground:s(async(r,o)=>{await e.prepareUserExecutionBoundary(o),e.switchWorkflowToYolo();let{definition:n,workflow:i}=await e.createStartInput(r,t.kind);return await e.persistWorkflowActivity(n,r.task,o?.traceContext??e.traceContext),i.startBackground({abortSignal:o?.abortSignal,cwd:e.workingDirectory,definitionId:r.definitionId,onEvent:o?.onEvent,sessionId:e.sessionId,task:r.task,traceContext:o?.traceContext??e.traceContext,workflowKind:r.workflowKind??n.kind})},"runExpertWorkflowBackground"),runWorkflowBackground:s(async(r,o)=>{await e.prepareUserExecutionBoundary(o),e.switchWorkflowToYolo();let{definition:n,workflow:i}=await e.createStartInput(r);return await e.persistWorkflowActivity(n,r.task,o?.traceContext??e.traceContext),i.startBackground({abortSignal:o?.abortSignal,cwd:e.workingDirectory,definitionId:r.definitionId??n.definitionId,onEvent:o?.onEvent,sessionId:e.sessionId,task:r.task,traceContext:o?.traceContext??e.traceContext,workflowKind:r.workflowKind??n.kind})},"runWorkflowBackground"),runExpertWorkflow:s(async(r,o)=>{await e.prepareUserExecutionBoundary(o),e.switchWorkflowToYolo();let{definition:n,workflow:i}=await e.createStartInput(r,t.kind);return await e.persistWorkflowActivity(n,r.task,o?.traceContext??e.traceContext),i.start({abortSignal:o?.abortSignal,cwd:e.workingDirectory,definitionId:r.definitionId??n.definitionId,onEvent:o?.onEvent,sessionId:e.sessionId,task:r.task,traceContext:o?.traceContext??e.traceContext,workflowKind:r.workflowKind??n.kind})},"runExpertWorkflow"),runWorkflow:s(async(r,o)=>{await e.prepareUserExecutionBoundary(o),e.switchWorkflowToYolo();let{definition:n,workflow:i}=await e.createStartInput(r);return await e.persistWorkflowActivity(n,r.task,o?.traceContext??e.traceContext),i.start({abortSignal:o?.abortSignal,cwd:e.workingDirectory,definitionId:r.definitionId??n.definitionId,onEvent:o?.onEvent,sessionId:e.sessionId,task:r.task,traceContext:o?.traceContext??e.traceContext,workflowKind:r.workflowKind??n.kind})},"runWorkflow")}}var EBn=b(()=>{"use strict";s(TBn,"createWorkflowMethods")});function CBn(e){let t=Yun({rootDir:(0,w5e.join)(e.cliStorageRoot,"workflows")}),r=Xun({rootDir:(0,w5e.join)(e.cliStorageRoot,"workflows")}),o=oX(),n=new Map,i={run:s(async _=>{await e.prepareUserExecutionBoundary({traceContext:_.traceContext});let y=_.workflowKind??o.kind,v=Iu(`workflow_${_.activityId}`),S=Hu(_.traceContext??e.traceContext,{attributes:{parentSessionId:e.sessionId,workflowActivityId:_.activityId,workflowKind:y,workflowPhase:_.phase,workflowRunId:_.runId},sessionId:v});await _.onChildSessionStarted?.({model:Sn(e.runtime.getModelRef()),sessionId:v,traceId:S.traceId});let x=zca(e,{childSessionId:v,childTraceContext:S,workflowKind:y}),k=_.onEvent?x.subscribeEvents({onSessionEvent:_.onEvent}):void 0;try{let w=await x.executeTurn(_.prompt,void 0,{abortSignal:_.abortSignal,inputSource:"subagent",traceContext:S});return{model:Sn(x.getModelRef()),response:w.response,sessionId:v,traceId:w.traceId,turnId:w.turnId}}finally{k?.()}},"run")},a=s(async _=>{let y=_?.workflowKind??o.kind,v=_?.definitionId;if(!v&&y===o.kind)return o;let S=v??y,x=await r.readDefinition(S);if(!x)throw new Error(`Workflow definition not found: ${S}`);if(_?.workflowKind&&x.kind!==_.workflowKind)throw new Error(`Workflow definition ${x.definitionId} has kind ${x.kind}, expected ${_.workflowKind}`);return x},"resolveWorkflowDefinition"),u=s(_=>{let y=[_.definitionId,_.definitionVersion,_.kind].join(":"),v=n.get(y);if(v)return v;let S=new jj({agentRunner:i,definition:_,onWorkflowEvent:e.appOptions.onWorkflowEvent,store:t});return n.set(y,S),S},"workflowRuntimeForDefinition"),l=s(async _=>u(await a(_)),"workflowRuntimeForRequest"),c=s(async _=>{if(_?.runId){let y=await t.readRun(_.runId,{signal:_.abortSignal});if(y)return y.kind===o.kind&&(y.definitionId===void 0||y.definitionId===o.definitionId)?u(o):u(await a({definitionId:y.definitionId,workflowKind:y.kind}))}return l({definitionId:_?.definitionId,workflowKind:_?.workflowKind})},"workflowRuntimeForLookup"),d=s(async _=>{let y=_?.workflowKind;return _?.definitionId&&(y=(await a({definitionId:_.definitionId,workflowKind:y})).kind),t.listRuns({cwd:e.workingDirectory,kind:y,limit:_?.limit},{signal:_?.abortSignal})},"listWorkflowRuns"),p=s((_,y)=>_.kind===o.kind?`/expert ${y}`:`/workflow ${_.kind} ${y}`,"workflowExternalActivityPrompt"),m=s(()=>{e.runtime.getMode()!=="yolo"&&e.runtime.updateConfig({mode:"yolo"})},"switchWorkflowToYolo"),f=s(async(_,y)=>{let v=await a({definitionId:_.definitionId,workflowKind:_.workflowKind??y}),S=u(v);return{definition:v,workflow:S}},"createStartInput"),h=s(async(_,y,v)=>{await e.runtime.ensureSessionPersistedForExternalActivity(p(_,y),{traceContext:v})},"persistWorkflowActivity");return TBn({builtInExpertWorkflowDefinition:o,createStartInput:f,listWorkflowRuns:d,prepareUserExecutionBoundary:e.prepareUserExecutionBoundary,persistWorkflowActivity:h,sessionId:e.sessionId,switchWorkflowToYolo:m,traceContext:e.traceContext,workflowRuntimeForLookup:c,workingDirectory:e.workingDirectory})}function zca(e,t){return new $f(t.childSessionId,{...e.runtimeConfig,agentName:t.workflowKind==="expert"?"zcode-expert":"zcode-workflow",mode:"yolo",modelProviderOptions:e.runtime.getModelProviderOptions(),modelRef:e.runtime.getModelRef(),parentSessionId:e.sessionId,taskType:"workflow_child",workingDirectory:e.workingDirectory},{agentTelemetry:e.agentTelemetry,agentTelemetryCausation:e.agentTelemetry.captureCausation(),agentTelemetryCausationMode:"linked_root",eventStore:Fg(),sessionStore:e.sessionStore,logger:e.logger,executionPort:e.appOptions.executionPort??g6({network:{httpProxy:e.configResult.config.network.httpProxy,noProxy:e.configResult.config.network.noProxy,caCertFile:e.configResult.config.network.caCertFile},outputRootDir:(0,w5e.join)(e.storageRoot,"cli","exec"),processEnv:e.appOptions.env??process.env}),fileSystemPort:e.appOptions.fileSystemPort??pk(),httpClientPort:e.appOptions.httpClientPort??xk({env:e.appOptions.env??process.env,timeoutMs:e.configResult.config.network.timeout,proxyUrl:e.configResult.config.network.httpProxy,noProxy:e.configResult.config.network.noProxy,caCertFile:e.configResult.config.network.caCertFile}),imageProcessorPort:e.imageProcessorPort,artifactStore:e.artifactStore,contextSourcePort:e.appOptions.contextSourcePort??p6({env:e.appOptions.env}),skillPort:e.configResult.config.features.skill&&e.configResult.config.skills.enabled?e.appOptions.skillPort??kI({extraRoots:e.configResult.config.skills.roots,disabledPaths:Sx(e.configResult.config.skillOverrides)}):void 0,mcpPort:e.mcpPort,eventSink:e.eventSink,modelAdapter:e.appOptions.modelAdapter??hE({appVersion:e.appVersion,env:e.appOptions.env,logger:e.modelLogger,modelCatalog:e.configResult.config.modelCatalog,modelConfig:e.modelConfig,endpointRoutingPort:e.providerEndpointRoutingPort,network:e.configResult.config.network,sourceTitle:e.appOptions.sourceTitle,statusSink:e.modelStatusSink,streamIdleTimeoutMs:e.configResult.config.modelStream.idleTimeoutMs}),providerRuntimeHeadersPort:e.appOptions.providerRuntimeHeadersPort,permissionBroker:e.permissionBroker,permissionService:e.permissionService,appVersion:e.appVersion,traceContext:t.childTraceContext})}var w5e,ABn=b(()=>{"use strict";w5e=require("node:path");ZF();_6();c6();bk();xz();Xx();q6t();md();ze();Bee();aB();EBn();s(CBn,"createWorkflowFacade");s(zca,"createWorkflowChildRuntime")});function k5e(e){return typeof e=="string"?{text:e}:{text:e.text,attachments:e.attachments}}async function a9t(e,t){let r=await Promise.all((e??[]).map(async(o,n)=>{if(!jca(o))return o;if(!t.artifactStore)return i9t(o);try{let i=await t.artifactStore.writeToolResultArtifact({content:o.content,contentType:"text/plain",retention:"session",sessionId:t.sessionId,toolCallId:Lca(o,n),toolName:"prompt-attachment:image",trace:t.traceContext});return{...o,content:i.uri}}catch{return i9t(o)}}));return r.length>0?r:void 0}async function RBn(e,t){if(!e?.attachments||!t)return e;let r=await Promise.all(e.attachments.map(async o=>{if(!o.content?.startsWith("zcode-artifact://"))return o;try{let n=await t.readToolResultArtifact({uri:o.content});return{...o,content:n.content}}catch{return i9t(o)}}));return{...e,attachments:r}}function jca(e){return e.type==="image"&&e.content?.startsWith("data:")===!0}function i9t(e){let{content:t,...r}=e;return r}function Lca(e,t){let r=(0,PBn.createHash)("sha256").update(e.content).digest("hex").slice(0,16);return`prompt-attachment-${t+1}-${r}`}var PBn,MBn=b(()=>{"use strict";PBn=require("node:crypto");s(k5e,"normalizePromptInput");s(a9t,"externalizePromptAttachments");s(RBn,"materializeInputHistoryEntry");s(jca,"isInlineImageAttachment");s(i9t,"attachmentWithoutInlineContent");s(Lca,"attachmentArtifactCallId")});function $Bn(e){let t=s(async i=>{await e.prepareUserExecutionBoundary(i)},"preparePromptBoundary"),r=s(async(i,a,u,l)=>{if(!e.inputHistoryStore)return null;try{return await e.inputHistoryStore.recordInputHistory({attachments:l,kind:a,projectID:e.runtime.getProjectId(),sessionID:e.sessionId,text:i})}catch(c){return e.logger.warn("Input history write failed",{...Ar(u),error:c instanceof Error?c.message:String(c),event:"input_history.record.failed",kind:a,module:"bootstrap",projectId:e.runtime.getProjectId(),status:"failed"}),null}},"recordAcceptedInputHistory"),o=s(async i=>{if(!e.inputHistoryStore)return null;let a=await e.inputHistoryStore.recallPreviousInputHistory({projectID:e.runtime.getProjectId(),skip:i});return await RBn(a,e.artifactStore)},"recallPreviousInputHistory"),n=s(async(i,a)=>{let u=await a9t(i.attachments,{artifactStore:e.artifactStore,sessionId:e.sessionId,traceContext:a?.traceContext??e.traceContext});await r(i.text,"prompt",a?.traceContext??e.traceContext,u);let l=await e.customCommandPromptResolver?.(i.text,{abortSignal:a?.abortSignal,traceContext:a?.traceContext??e.traceContext}),c=l??i.text,d=a?.automationId?{automationId:a.automationId}:a?.offPeakTaskId?{offPeakTaskId:a.offPeakTaskId,...a.offPeakRunType?{offPeakRunType:a.offPeakRunType}:{}}:{};return await e.runtime.executeTurn(c,u,{abortSignal:a?.abortSignal,browserAmbientContext:a?.browserAmbientContext,continueActiveTargetAfterTurn:!0,...l!==void 0?{displayInput:i.text}:{},inputId:a?.inputId,...d,intent:a?.intent,queryId:a?.queryId,toolDisallowlist:a?.toolDisallowlist,traceContext:a?.traceContext??e.traceContext})},"runPromptTurn");return{continueActiveTarget:s(async i=>{await t(i);let a=i?.onEvent?e.runtime.subscribeEvents({onSessionEvent:i.onEvent}):void 0;try{return await e.runtime.continueActiveTargetLoop({abortSignal:i?.abortSignal,inputId:i?.inputId,traceContext:i?.traceContext??e.traceContext,trigger:"manual",verifyBeforeFirstContinue:!1})}finally{a?.()}},"continueActiveTarget"),recordInputHistory:s(async(i,a="slash_command")=>{let u=k5e(i),l=await a9t(u.attachments,{artifactStore:e.artifactStore,sessionId:e.sessionId,traceContext:e.traceContext});return r(u.text,a,e.traceContext,l)},"recordInputHistory"),recallPreviousInputHistory:o,sendInput:s(async(i,a)=>{let u=k5e(i),l=a?.delivery??"auto",c=e.runtime.getActiveTurnInfo(),d=(u.attachments?.length??0)>0;if(!d&&(l==="steer_active_turn"||l==="auto"&&c)){let m=a?.onEvent?e.runtime.subscribeEvents({onSessionEvent:a.onEvent}):void 0;try{let f=await e.runtime.steerTurn({commandKind:a?.commandKind,inputId:a?.inputId,queryId:a?.queryId,expectedTurnId:a?.expectedTurnId,delivery:"guide",pendingInputId:a?.pendingInputId,input:u.text,toolDisallowlist:a?.toolDisallowlist,traceContext:a?.traceContext??e.traceContext});return f.kind==="queued"&&await r(u.text,"steered_input",a?.traceContext??e.traceContext),f}finally{m?.()}}if((l==="start_turn"||d)&&c)return{activeTurnId:c.turnId,kind:"rejected",reason:"turn_not_steerable"};await t(a);let p=a?.onEvent||a?.onTurnStartedObserved?e.runtime.subscribeEvents({onSessionEvent:s(async m=>{await a.onEvent?.(m),m.type===F.TurnStarted&&m.payload.inputId===a.inputId&&a.onTurnStartedObserved?.(m)},"onSessionEvent")}):void 0;try{return{kind:"started_turn",result:await n(u,a)}}finally{p?.()}},"sendInput"),enqueueDeferredInput:s(async(i,a)=>{let u=await e.runtime.enqueueDeferredInput({input:i,...a?.commandKind?{commandKind:a.commandKind}:{},...a?.delivery?{delivery:a.delivery}:{},...a?.intent?{intent:a.intent}:{},...a?.attachments?{attachments:a.attachments}:{},...a?.toolDisallowlist?{toolDisallowlist:a.toolDisallowlist}:{},...a?.intent?.queueItemId?{pendingInputId:a.intent.queueItemId}:{},...a?.inputId?{inputId:a.inputId}:{},...a?.queryId?{queryId:a.queryId}:{},traceContext:a?.traceContext??e.traceContext});return u.kind==="queued"&&await r(i,"steered_input",a?.traceContext??e.traceContext),u},"enqueueDeferredInput"),steerTurn:s(async(i,a)=>{let u=a?.onEvent?e.runtime.subscribeEvents({onSessionEvent:a.onEvent}):void 0;try{let l=await e.runtime.steerTurn({commandKind:a?.commandKind,inputId:a?.inputId,queryId:a?.queryId,expectedTurnId:a?.expectedTurnId,delivery:a?.delivery,intent:a?.intent,attachments:a?.attachments,pendingInputId:a?.intent?.queueItemId,input:i,toolDisallowlist:a?.toolDisallowlist,traceContext:a?.traceContext??e.traceContext});return l.kind==="queued"&&await r(i,"steered_input",a?.traceContext??e.traceContext),l}finally{u?.()}},"steerTurn"),removeQueueItem:s(async(i,a)=>e.runtime.removePendingInputById({pendingInputId:i,reason:a?.reason??"user_removed",reservationId:a?.reservationId,traceContext:a?.traceContext??e.traceContext}),"removeQueueItem"),reserveQueueItem:s(async(i,a,u)=>e.runtime.reservePendingInputById({pendingInputId:i,reservationId:a,traceContext:u?.traceContext??e.traceContext}),"reserveQueueItem"),markQueueItemPromoting:s(async(i,a,u)=>e.runtime.markPendingInputPromoting({pendingInputId:i,reservationId:a,traceContext:u?.traceContext??e.traceContext}),"markQueueItemPromoting"),releaseQueueItemReservation:s(async(i,a,u)=>e.runtime.releasePendingInputReservation({pendingInputId:i,reservationId:a,traceContext:u?.traceContext??e.traceContext}),"releaseQueueItemReservation"),editQueueItem:s(async(i,a,u)=>e.runtime.editPendingInputById({pendingInputId:i,newText:a,traceContext:u?.traceContext??e.traceContext}),"editQueueItem"),reorderQueueItem:s(async(i,a,u)=>e.runtime.reorderPendingInput({pendingInputId:i,beforePendingInputId:a,traceContext:u?.traceContext??e.traceContext}),"reorderQueueItem"),clearQueueItems:s(async i=>e.runtime.clearAllPendingInputs(i?.traceContext??e.traceContext),"clearQueueItems"),setQueueAutoDrain:s(async(i,a)=>{await e.runtime.setQueueAutoDrain({autoDrain:i,traceContext:a?.traceContext??e.traceContext})},"setQueueAutoDrain"),completeExternalQueueDrain:s(()=>{e.runtime.completeExternalQueueDrain()},"completeExternalQueueDrain"),setFollowupMode:s(async(i,a)=>{await e.runtime.setFollowupMode({mode:i,traceContext:a?.traceContext??e.traceContext})},"setFollowupMode"),submitPrompt:s(async(i,a)=>{let u=k5e(i);await t(a);let l=a?.onEvent?e.runtime.subscribeEvents({onSessionEvent:a.onEvent}):void 0;try{return await n(u,a)}finally{l?.()}},"submitPrompt")}}var OBn=b(()=>{"use strict";ze();MBn();s($Bn,"createInputFacade")});function sB(e){let t=e?.now??Date.now;return{deadlineAt:t()+(e?.durationMs??Bca),now:t,sleep:e?.sleep??Zca}}function Vee(e){return typeof e=="object"&&e!==null&&Fca.has(String(e.code))}function NBn(e){if(typeof e!="object"||e===null)return 1;let t=e[DBn];return typeof t=="number"&&Number.isFinite(t)?t:1}function s9t(e,t){let r=t?.budget??sB(),o=0;for(;;){o+=1;try{return e()}catch(n){qca(n,o);let i=Uca[o-1];if(!Vee(n)||i===void 0||r.now()+i>r.deadlineAt)throw n;r.sleep(i)}}}function _E(e,t=sB()){s9t(()=>{(0,oR.rmSync)(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:25})},{budget:t})}function Gee(e,t,r){s9t(()=>(0,oR.renameSync)(e,t),{budget:r})}function zBn(e,t,r){let o=(0,S5e.join)((0,S5e.dirname)(e),`.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`);try{s9t(()=>(0,oR.writeFileSync)(o,t),{budget:r}),Gee(o,e,r)}catch(n){try{(0,oR.rmSync)(o,{force:!0})}catch{}throw n}}function qca(e,t){if(!(typeof e!="object"||e===null))try{Object.defineProperty(e,DBn,{configurable:!0,value:t,writable:!0})}catch{}}function Zca(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}var oR,S5e,Bca,Uca,DBn,Fca,u9t=b(()=>{"use strict";oR=require("node:fs"),S5e=require("node:path"),Bca=1500,Uca=[25,50,100],DBn="zcodeOfficialPluginCacheAttempts",Fca=new Set(["EACCES","EBUSY","EEXIST","ENOTEMPTY","EPERM"]);s(sB,"createOfficialPluginCacheRetryBudget");s(Vee,"isTransientOfficialPluginCacheFsError");s(NBn,"getOfficialPluginCacheRetryAttempts");s(s9t,"retryOfficialPluginCacheFs");s(_E,"removeOfficialPluginCacheDirectory");s(Gee,"renameOfficialPluginCachePath");s(zBn,"writeTextFileAtomicallyWithRetry");s(qca,"setRetryAttempts");s(Zca,"sleepSync")});function LBn(e){let t=sR.find(r=>`${r.name}@${Li}`===e);return t?.hostMcpServerNames?[...t.hostMcpServerNames]:[]}var jBn,I5e,iR,aR,sR,T5e,uR=b(()=>{"use strict";ze();jBn="browser-use",I5e=`${jBn}@${Li}`,iR={name:"Z.ai",url:"https://z.ai"},aR="https://cdn-zcode.z.ai/zcode/official-plugin/assets",sR=[{listing:{author:iR,category:"developer-tools",displayName:"Android Emulator",displayName_i18n:{"zh-CN":"Android \u6A21\u62DF\u5668"},icon:`${aR}/android-emulator/icon.png`},name:"android-emulator",rootCandidates:["packages/android-emulator-plugin","../android-emulator-plugin","../../android-emulator-plugin","../../../android-emulator-plugin"],version:"0.1.0"},{defaultEnabled:!0,hostMcpServerNames:["node_repl"],listing:{author:iR,category:"developer-tools",displayName:"Browser Use",displayName_i18n:{"zh-CN":"\u6D4F\u89C8\u5668\u64CD\u4F5C"},icon:`${aR}/browser-use/icon.png`},name:jBn,rootCandidates:["packages/browser-use-plugin","../browser-use-plugin","../../browser-use-plugin","../../../browser-use-plugin"],version:"0.1.2"},{defaultEnabled:!0,listing:{author:iR,category:"productivity",displayName:"Document Skills",displayName_i18n:{"zh-CN":"\u6587\u6863\u6280\u80FD"},icon:`${aR}/document-skills/icon.png`,examplePrompts:["Create a formatted Word document from my notes","Extract the tables from this PDF into a spreadsheet"],examplePrompts_i18n:{"zh-CN":["\u628A\u6211\u7684\u7B14\u8BB0\u6574\u7406\u6210\u4E00\u4EFD\u6392\u7248\u597D\u7684 Word \u6587\u6863","\u628A\u8FD9\u4EFD PDF \u91CC\u7684\u8868\u683C\u63D0\u53D6\u6210\u7535\u5B50\u8868\u683C"]}},name:"document-skills",rootCandidates:["packages/document-skills-plugin","../document-skills-plugin","../../document-skills-plugin","../../../document-skills-plugin"],version:"0.1.0"},{listing:{author:iR,category:"developer-tools",displayName:"iOS Simulator",displayName_i18n:{"zh-CN":"iOS \u6A21\u62DF\u5668"},icon:`${aR}/ios-simulator/icon.png`},name:"ios-simulator",rootCandidates:["packages/ios-simulator-plugin","../ios-simulator-plugin","../../ios-simulator-plugin","../../../ios-simulator-plugin"],version:"0.1.0"},{listing:{author:iR,category:"utilities",displayName:"Restore Legacy Sessions",displayName_i18n:{"zh-CN":"\u6062\u590D\u65E7\u7248\u4F1A\u8BDD"},icon:`${aR}/restore-legacy-sessions/icon.png`},name:"restore-legacy-sessions",rootCandidates:["packages/restore-legacy-sessions-plugin","../restore-legacy-sessions-plugin","../../restore-legacy-sessions-plugin","../../../restore-legacy-sessions-plugin"],version:"0.1.0"},{defaultEnabled:!0,listing:{author:iR,category:"developer-tools",displayName:"Skill Creator",displayName_i18n:{"zh-CN":"\u6280\u80FD\u521B\u5EFA\u5668"},icon:`${aR}/skill-creator/icon.png`},name:"skill-creator",rootCandidates:["packages/skill-creator-plugin","../skill-creator-plugin","../../skill-creator-plugin","../../../skill-creator-plugin"],version:"0.1.0"},{defaultEnabled:!0,listing:{author:iR,category:"guides",displayName:"ZCode Guide",displayName_i18n:{"zh-CN":"ZCode \u4F7F\u7528\u6307\u5357"},icon:`${aR}/zcode-guide/icon.png`,examplePrompts:["How do I configure MCP servers in ZCode?","Diagnose my current ZCode setup"],examplePrompts_i18n:{"zh-CN":["ZCode \u91CC\u600E\u4E48\u914D\u7F6E MCP \u670D\u52A1\u5668\uFF1F","\u5E2E\u6211\u8BCA\u65AD\u5F53\u524D\u7684 ZCode \u914D\u7F6E"]}},name:"zcode-guide",rootCandidates:["packages/zcode-guide-plugin","../zcode-guide-plugin","../../zcode-guide-plugin","../../../zcode-guide-plugin"],version:"0.1.0"}],T5e=new Set(sR.filter(e=>e.defaultEnabled).map(e=>`${e.name}@${Li}`));s(LBn,"resolveOfficialPluginHostMcpServerNames")});function qBn(e){let t=ZBn();if(t)return{args:[...t,(0,uB.join)(e.rootPath,...FBn)],command:process.execPath,cwd:e.cwd,env:{...e.env,ELECTRON_RUN_AS_NODE:"1"},timeoutMs:e.timeoutMs,type:"stdio"}}function l9t(e){let t=(0,uB.join)(e.rootPath,".zcode-plugin","plugin.json"),r=(0,UBn.readFileSync)(t,"utf8"),o=JSON.parse(r);if(o.mcpServers===void 0)return;let n=BBn(o.mcpServers),i=BBn(n[e.pluginName]),a=ZBn();if(!a)return;let u=VBn(i.env)?i.env:{};i.command=process.execPath,i.args=[...a,(0,uB.join)(e.rootPath,...FBn)],i.env={...u,ELECTRON_RUN_AS_NODE:"1"},n[e.pluginName]=i,o.mcpServers=n;let l=`${JSON.stringify(o,null,2)}
|
|
3221
3221
|
`;l!==r&&zBn(t,l,e.retryBudget??sB())}function ZBn(){if(Vca())return[Z3];let e=process.argv[1];if(e)return[...process.execArgv,(0,uB.resolve)(e),Z3]}function Vca(){let e=process.getBuiltinModule;try{return e?.("node:sea").isSea()===!0}catch{return!1}}function BBn(e){if(VBn(e))return e;throw new Error("Official plugin manifest has invalid mcpServers.")}function VBn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var UBn,uB,FBn,c9t=b(()=>{"use strict";UBn=require("node:fs"),uB=require("node:path");ze();u9t();FBn=["dist","mcp","server.js"];s(qBn,"createBundledMcpRuntimeConfig");s(l9t,"writeOfficialPluginRuntimeManifest");s(ZBn,"officialPluginHostPrefixArgs");s(Vca,"isSeaRuntime");s(BBn,"asRecord");s(VBn,"isRecord")});function Hca(e){let t=Jca();if(!t)return;rda(e.storageRoot,t,e.suppressedBuiltins);let r=sB();for(let o of t.plugins){let n=`${o.definition.name}@${lR}`,i=XBn(e.storageRoot,o.definition);if(e.suppressedBuiltins.has(n)){try{_E(i,r)}catch(a){if(!Vee(a))throw a;GBn(e.logger,{error:a,operation:"remove_suppressed_plugin",pluginId:n,targetRoot:i})}continue}try{if(d9t(i,o)&&(p9t(i,r),Kca({pluginName:o.definition.name,retryBudget:r,rootPath:i})))continue;let a=`${i}.tmp-${process.pid}-${Date.now()}`;_E(a,r),(0,ms.mkdirSync)(a,{recursive:!0});try{for(let u of o.files){let l=YBn(t,o,u);if(f9t(l)!==u.sha256)throw new Error(`Bundled plugin asset hash mismatch: ${o.definition.name}/${u.path}`);let c=(0,Qp.join)(a,...u.path.split("/"));(0,ms.mkdirSync)((0,Qp.dirname)(c),{recursive:!0}),(0,ms.writeFileSync)(c,l),(0,ms.chmodSync)(c,m9t(u.path,u.mode))}(0,ms.writeFileSync)((0,Qp.join)(a,KBn),JSON.stringify(sda(t,o),null,2)),oda(a,i,o,r),l9t({pluginName:o.definition.name,retryBudget:r,rootPath:i})}catch(u){try{_E(a,r)}catch{}throw u}}catch(a){if(Vee(a)&&(!(0,ms.existsSync)(i)||d9t(i,o))){GBn(e.logger,{error:a,operation:"seed_plugin",pluginId:n,targetRoot:i});continue}throw a}}}function Kca(e){try{return l9t(e),!0}catch(t){if(Vee(t))throw t;return!1}}function Wee(e){return Hca({logger:e.logger,storageRoot:e.storageRoot,suppressedBuiltins:e.suppressedBuiltins??new Set}),mda(e.extraRoots??[])}function Jca(){let e=Qca();return e||Yca()}function Qca(){let e=JBn();if(!e?.isSea())return;let t=Xca(e);if(!t)return;let r=sR.flatMap(o=>{let n=t.plugins.find(i=>i.marketplace===lR&&i.name===o.name&&i.version===o.version);return n?[{definition:o,files:n.files,hash:eUn(n.files)}]:[]});if(r.length!==0)return{kind:"sea",plugins:r}}function Yca(){let e=sR.flatMap(t=>{let r=eda(t);if(!r)return[];let o=tda(r);return[{definition:t,files:o,hash:eUn(o),rootPath:r}]});if(e.length!==0)return{kind:"filesystem",plugins:e}}function JBn(){let e=process.getBuiltinModule;try{return e?.("node:sea")}catch{return}}function Xca(e){try{let t=e.getAsset(Gca,"utf8"),r=JSON.parse(t);return r.version===1&&Array.isArray(r.plugins)?r:void 0}catch{return}}function eda(e){for(let t of uda())for(let r of e.rootCandidates){let o=(0,Qp.resolve)(t,r);if((0,ms.existsSync)((0,Qp.join)(o,".zcode-plugin","plugin.json")))return o}}function tda(e){let t=[];for(let r of QBn(e)){let o=tUn(r.slice(e.length+1));if(!pda(o))continue;let n=(0,ms.readFileSync)(r);t.push({mode:m9t(o,(0,ms.statSync)(r).mode),path:o,sha256:f9t(n),sourcePath:r})}return t.sort((r,o)=>r.path.localeCompare(o.path))}function*QBn(e){for(let t of(0,ms.readdirSync)(e,{withFileTypes:!0})){if(dda(t.name))continue;let r=(0,Qp.join)(e,t.name);if(t.isDirectory()){yield*QBn(r);continue}t.isFile()&&(yield r)}}function YBn(e,t,r){if(e.kind==="filesystem"&&r.sourcePath)return(0,ms.readFileSync)(r.sourcePath);let o=JBn();if(!o?.isSea())throw new Error("SEA plugin asset is unavailable outside SEA runtime.");return Buffer.from(o.getRawAsset(`${HBn}${lR}/${t.definition.name}/${t.definition.version}/${r.path}`))}function rda(e,t,r){let o=t.plugins.filter(n=>!r.has(`${n.definition.name}@${lR}`));gCt({manifest:{name:lR,plugins:o.map(n=>{let i=nda(t,n);return{cachePath:XBn(e,n.definition),...i?{description:i}:{},name:n.definition.name,source:t.kind,version:n.definition.version,...n.definition.listing??{}}}),version:1},storageRoot:e})}function nda(e,t){let r=t.files.find(o=>o.path===".zcode-plugin/plugin.json");if(r)try{let o=JSON.parse(YBn(e,t,r).toString("utf8"));return typeof o.description=="string"&&o.description.trim().length>0?o.description:void 0}catch{return}}function d9t(e,t){let r=(0,Qp.join)(e,KBn);if(!(0,ms.existsSync)(r))return!1;try{let o=JSON.parse((0,ms.readFileSync)(r,"utf8"));return o.hash===t.hash&&o.pluginVersion===t.definition.version}catch{return!1}}function oda(e,t,r,o){let n=ida(t),i=!1;if((0,ms.mkdirSync)((0,Qp.dirname)(t),{recursive:!0}),(0,ms.existsSync)(t))try{Gee(t,n,o),i=!0}catch(a){if(!ada(a))throw a}try{Gee(e,t,o)}catch(a){if(d9t(t,r)){_E(e,o),i&&_E(n,o),p9t(t,o);return}throw i&&!(0,ms.existsSync)(t)&&(0,ms.existsSync)(n)&&Gee(n,t,o),a}i&&_E(n,o),p9t(t,o)}function p9t(e,t){let r=`${e}.backup`;(0,ms.existsSync)(r)&&_E(r,t)}function ida(e){return`${e}.backup-${process.pid}-${Date.now()}`}function ada(e){return typeof e=="object"&&e!==null&&String(e.code)==="ENOENT"}function GBn(e,t){e?.warn("Official plugin cache operation degraded",{attempts:NBn(t.error),degraded:!0,errorCode:t.error.code,module:"bootstrap.official_plugin_cache",operation:t.operation,pluginId:t.pluginId,targetRoot:t.targetRoot})}function sda(e,t){return{hash:t.hash,marketplace:lR,plugin:t.definition.name,pluginVersion:t.definition.version,source:e.kind,version:1}}function XBn(e,t){return(0,Qp.join)(e,"cache",lR,t.name,t.version)}function uda(){return[cda(),lda(),process.cwd()].filter(e=>typeof e=="string")}function lda(){return typeof __dirname=="string"?__dirname:void 0}function cda(){return process.argv[1]?(0,Qp.dirname)(process.argv[1]):void 0}function dda(e){return e==="node_modules"||e===".turbo"||e==="coverage"}function pda(e){let[t]=e.split("/");return t!==void 0&&Wca.has(t)}function m9t(e,t){if(t!==void 0&&(t&73)!==0)return 493;let r=tUn(e);return/(?:^|\/)dist\/mcp\/server\.js$/i.test(r)||/^hooks\//u.test(r)&&!/\.(json|md|txt)$/iu.test(r)?493:420}function eUn(e){return fda(JSON.stringify(e.map(t=>[t.path,t.sha256,m9t(t.path,t.mode)])))}function tUn(e){return e.split(Qp.sep).join("/")}function mda(e){return e.filter((t,r)=>e.indexOf(t)===r)}function f9t(e){return(0,WBn.createHash)("sha256").update(e).digest("hex")}function fda(e){return f9t(Buffer.from(e))}var WBn,ms,Qp,lR,HBn,Gca,KBn,Wca,h9t=b(()=>{"use strict";WBn=require("node:crypto"),ms=require("node:fs"),Qp=require("node:path");g1e();ze();u9t();uR();c9t();lR=Li,HBn="zcode-official-plugins/",Gca=`${HBn}manifest.json`,KBn=".zcode-plugin-seed.json",Wca=new Set([".mcp.json",".zcode-plugin","README.md","commands","dist","docs","hooks","output-styles","package.json","scripts","skills","templates"]);s(Hca,"seedBundledOfficialPlugins");s(Kca,"tryWriteOfficialPluginRuntimeManifest");s(Wee,"resolveOfficialPluginRoots");s(Jca,"resolveSeedSource");s(Qca,"resolveSeaSeedSource");s(Yca,"resolveFilesystemSeedSource");s(JBn,"getSeaModule");s(Xca,"readSeaManifest");s(eda,"resolveFilesystemPluginRoot");s(tda,"collectFilesystemPluginFiles");s(QBn,"walkFiles");s(YBn,"readSeedFileBytes");s(rda,"writeOfficialMarketplace");s(nda,"readSeedPluginDescription");s(d9t,"isSeedCurrent");s(oda,"replaceSeedRoot");s(p9t,"cleanupLegacySeedBackup");s(ida,"createSeedBackupRoot");s(ada,"isNotFoundFsError");s(GBn,"warnCacheDegraded");s(sda,"seedMarker");s(XBn,"officialPluginCacheRoot");s(uda,"candidateBaseDirs");s(lda,"runtimeDir");s(cda,"entrypointDir");s(dda,"shouldSkipDirectory");s(pda,"shouldIncludePluginFile");s(m9t,"modeForSeedFile");s(eUn,"hashSeedFiles");s(tUn,"toPosixPath");s(mda,"uniquePaths");s(f9t,"hashBytes");s(fda,"hashText")});async function lB(e,t){let n=(rUn.get(e)??Promise.resolve()).then(()=>{},()=>{}).then(()=>t());return rUn.set(e,n.then(()=>{},()=>{})),n}var rUn,g9t=b(()=>{"use strict";rUn=new Map;s(lB,"withPluginStorageLock")});function zf(e={}){let{configResult:t,pluginStorageRoot:r,workingDirectory:o}=Nf(e);return qxe({config:t.config.plugins,env:e.env??process.env,officialPluginRoots:Wee({extraRoots:e.officialPluginRoots,logger:e.logger,storageRoot:r,suppressedBuiltins:new Set(t.config.plugins.suppressedBuiltins)}),officialPluginsEnabledByDefault:T5e,storageRoot:r,workingDirectory:o})}function oUn(e={}){let{configResult:t,pluginStorageRoot:r}=Nf(e);xw(r);let o=zf({...e,configResult:t,pluginStorageRoot:r}),n=vw(r),i=AI(r),a=new Set(i.map(h=>h.id)),u=[];for(let h of n){let _=Zm(r,h.id);u.push({summary:v9t(h,_?.featured,_?.plugins.length),entries:_?.plugins??[]})}let l=new Map,c=new Map,d=u.flatMap(h=>h.entries.map(_=>{let y=hda(_,h.summary.id,a);return l.set(y.id,{..._.version?{version:_.version}:{},...yw(_.source)?{sha:yw(_.source)}:{}}),_.listing&&c.set(y.id,_.listing),y})),p=new Map(o.plugins.map(h=>[h.id,h])),m=new Set(t.config.plugins.suppressedBuiltins),f=sR.filter(h=>m.has(`${h.name}@${Li}`)).map(h=>{let _=h.listing?Exe({name:h.name,...h.listing}):void 0;return{id:`${h.name}@${Li}`,name:h.name,marketplace:Li,version:h.version,installed:!1,..._?{listing:_}:{}}});return{marketplaces:u.map(h=>h.summary),availablePlugins:d,installedPlugins:i.map(h=>{let _=t.config.plugins.enabledPlugins[h.id]??!1,y=E5e(h,_,p.get(h.id)),v=l.get(h.id),S=yw(h.source),x=b4t({installedVersion:y.version,installedSha:S,latestVersion:v?.version,latestSha:v?.sha}),k=v?.version??(v?.sha?v.sha.slice(0,7):void 0),w=c.get(h.id);return{...y,updateStatus:x,...k?{latestVersion:k}:{},...w?{listing:w}:{}}}),restorableBuiltins:f,diagnostics:o.diagnostics}}function iUn(e={}){let{pluginStorageRoot:t}=Nf(e);FCt(t,r=>lB(t,r))}function C5e(e={}){return zf(e)}async function cB(e){let t=(0,b1.resolve)(e.workingDirectory??process.cwd()),r=e.configResult??Ni({env:e.env,projectConfigPath:e.projectConfigPath,workingDirectory:t,skipUserConfig:e.skipUserConfig,userConfigPath:e.userConfigPath}),o=zf({...e,configResult:r,workingDirectory:t}),n=mUn(e.plugin,o.plugins),i=await UEt(r.sources.user.path,n.id,e.enabled);return{enabled:i.enabled,path:i.path,plugin:{...n,enabled:i.enabled}}}async function aUn(e){let{pluginStorageRoot:t}=Nf(e),r=await kxe(e.source);if(e.dryRun===!0)return{id:"dry-run",name:"dry-run",source:r,pluginCount:0,isOfficial:!1};let o=await FH({signal:e.abortSignal,source:r,storageRoot:t});return v9t(o)}async function sUn(e){let{pluginStorageRoot:t}=Nf(e);await ZCt({marketplace:e.marketplace,storageRoot:t})}async function uUn(e){let{pluginStorageRoot:t}=Nf(e);return xw(t),(await qCt({marketplace:e.marketplace,storageRoot:t})).map(o=>v9t(o))}async function y9t(e){let{configResult:t,pluginStorageRoot:r}=Nf(e);if(xw(r),e.dryRun===!0)return{dependencyClosure:[],installedPlugins:[],diagnostics:(await Ixe({marketplace:e.marketplace,name:e.pluginName,storageRoot:r})).map(x1)};let o;try{o=await GCt({signal:e.abortSignal,marketplace:e.marketplace,name:e.pluginName,scope:e.scope,storageRoot:r})}catch(u){return{dependencyClosure:[],installedPlugins:[],diagnostics:[kda(u,`${e.pluginName}@${e.marketplace}`)]}}let{enabledIds:n}=await FEt(t.sources.user.path,o.installed.map(u=>u.id)),i=new Set(n),a=s(u=>i.has(u)||(t.config.plugins.enabledPlugins[u]??!1),"enabledById");return{dependencyClosure:o.closure,installedPlugins:o.installed.map(u=>E5e(u,a(u.id))),diagnostics:[]}}async function dB(e){let{configResult:t,pluginStorageRoot:r,workingDirectory:o}=Nf(e);return lB(r,async()=>{let n=yda(e);if(AI(r).find(l=>l.id===n)){let l=await WCt({pluginId:n,removeCache:e.removeCache??!0,storageRoot:r});return l?(await H2e(t.sources.user.path,l.id),await K2e(t.sources.user.path,l.id),E5e(l,!1)):null}let u=zf({...e,configResult:t,pluginStorageRoot:r,workingDirectory:o}).plugins.find(l=>l.id===n&&l.source==="official");if(u){await ZEt(t.sources.user.path,n),await H2e(t.sources.user.path,n);let l=(0,b1.join)(r,"cache",Li),c=(0,b1.resolve)(u.rootPath);c.startsWith((0,b1.resolve)(l)+b1.sep)&&await(0,_9t.rm)(c,{force:!0,recursive:!0}),await(0,_9t.rm)(Axe(r,n),{force:!0,recursive:!0});let d=new Date().toISOString();return E5e({id:u.id,name:u.name,marketplace:u.marketplace,version:u.version??"",installPath:u.rootPath,installedAt:d,updatedAt:d,scope:"user"},!1)}return null})}async function lUn(e){let{configResult:t,pluginStorageRoot:r}=Nf(e);await lB(r,async()=>{await K2e(t.sources.user.path,e.pluginId);let o=Nf({...e,configResult:void 0});Wee({storageRoot:o.pluginStorageRoot,suppressedBuiltins:new Set(o.configResult.config.plugins.suppressedBuiltins)})})}async function cUn(e){let t=vda(e.options),{configResult:r,pluginStorageRoot:o,workingDirectory:n}=Nf(e),i=zf({...e,configResult:r,pluginStorageRoot:o,workingDirectory:n}),a=mUn(e.pluginId,i.plugins);xda(a,t),e.dryRun!==!0&&await qEt(r.sources.user.path,a.id,t)}async function dUn(e){let{pluginStorageRoot:t}=Nf(e);if(xw(t),e.source)try{let r=await kxe(e.source);return(await KCt({source:r,storageRoot:t})).map(x1)}catch(r){return[{code:"plugin_marketplace_invalid",message:r instanceof Error?r.message:String(r),severity:"error"}]}if(e.marketplace&&e.pluginName){try{await Iz({marketplace:e.marketplace,storageRoot:t})}catch(r){return[{code:"plugin_marketplace_invalid",message:r instanceof Error?r.message:String(r),pluginId:`${e.pluginName}@${e.marketplace}`,severity:"error"}]}return(await Ixe({marketplace:e.marketplace,name:e.pluginName,storageRoot:t})).map(x1)}return[]}async function pUn(e){let{pluginStorageRoot:t}=Nf(e);return xw(t),HCt({marketplace:e.marketplace,name:e.pluginName,storageRoot:t})}function Nf(e){let t=(0,b1.resolve)(e.workingDirectory??process.cwd()),r=e.configResult??Ni({env:e.env,projectConfigPath:e.projectConfigPath,workingDirectory:t,skipUserConfig:e.skipUserConfig,userConfigPath:e.userConfigPath}),o=$a(r.config.storage.dir);return{configResult:r,pluginStorageRoot:e.pluginStorageRoot??iB(kx(o)),workingDirectory:t}}function mUn(e,t){let r=e.trim(),o=t.find(i=>i.id===r);if(o)return o;let n=t.filter(i=>i.name===r);if(n.length===1&&n[0])return n[0];throw n.length>1?new Error(`Plugin name is ambiguous, use full plugin id: ${r}`):new Error(`Plugin not found: ${r}`)}function v9t(e,t,r){return{id:e.id,name:e.name,source:e.source,...e.description?{description:e.description}:{},...e.lastUpdated?{lastUpdated:e.lastUpdated}:{},pluginCount:r??e.pluginCount,isOfficial:Goe(e.id),...t&&t.length>0?{featured:t}:{}}}function hda(e,t,r){let o=`${e.name}@${t}`;return{id:o,name:e.name,marketplace:t,...e.description?{description:e.description}:{},...e.version?{version:e.version}:{},installed:r.has(o),componentTypes:gda(e.raw),...e.listing?{listing:e.listing}:{}}}function E5e(e,t,r){return{id:e.id,name:e.name,marketplace:e.marketplace,...r?.description??void 0?{description:r?.description}:{},version:r?.version??e.version,enabled:t,scope:e.scope,installPath:e.installPath,installedAt:e.installedAt,componentTypes:r?_da(r):void 0,...r?{hookDetails:r.hookDetails}:{}}}function gda(e){let t=[];return"agents"in e&&t.push("agent"),"commands"in e&&t.push("command"),"skills"in e&&t.push("skill"),"hooks"in e&&t.push("hook"),"mcpServers"in e&&t.push("mcp"),"lspServers"in e&&t.push("lsp"),t}function _da(e){let t=[];return e.commandRootCount>0&&t.push("command"),(e.skillRootCount>0||e.skillCount>0)&&t.push("skill"),(e.declaredMcpServerNames.length>0||e.mcpServerNames.length>0)&&t.push("mcp"),e.hookDetails.length>0&&t.push("hook"),t}function yda(e){if(e.pluginId)return e.pluginId;if(e.pluginName&&e.marketplace)return`${e.pluginName}@${e.marketplace}`;throw new Error("pluginId or pluginName + marketplace is required")}function vda(e){let t={};for(let[r,o]of Object.entries(e))(typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&(t[r]=o);return t}function xda(e,t){let o=bda(e).userConfig??{};for(let n of Object.keys(t))if(o[n]?.sensitive===!0)throw new Error(`Sensitive plugin option cannot be stored in config.json before credential storage is supported: ${n}`)}function bda(e){try{let t=JSON.parse((0,nUn.readFileSync)(e.manifestPath,"utf8"));if(!wda(t))throw new Error("Plugin manifest must be an object");return t}catch(t){throw new Error(`Unable to read plugin manifest for configuration: ${e.id}: ${t instanceof Error?t.message:String(t)}`)}}function wda(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function x1(e){return{code:e.code,message:e.message,...e.pluginId?{pluginId:e.pluginId}:{},severity:e.severity}}function kda(e,t){let r=e instanceof Error?e.message:String(e);return r.startsWith("Plugin not found:")?x1({code:"plugin_not_found",message:r,pluginId:t,severity:"error"}):r.includes("Cross-marketplace dependency")?x1({code:"plugin_dependency_cross_marketplace",message:r,pluginId:t,severity:"error"}):r.includes("dependency cycle")?x1({code:"plugin_dependency_cycle",message:r,pluginId:t,severity:"error"}):r.includes("Dependency not found")||r.includes("Marketplace not found for dependency")?x1({code:"plugin_dependency_missing",message:r,pluginId:t,severity:"error"}):r.includes("source is recognized but not supported")?x1({code:"plugin_marketplace_source_unsupported",message:r,pluginId:t,severity:"error"}):x1({code:"plugin_marketplace_invalid",message:r,pluginId:t,severity:"error"})}var nUn,_9t,b1,pB=b(()=>{"use strict";nUn=require("node:fs"),_9t=require("node:fs/promises"),b1=require("node:path");Ou();YH();ze();h9t();uR();v1();g9t();s(zf,"resolveZCodePlugins");s(oUn,"getZCodePluginsOverview");s(iUn,"enrichCachedClaudeMarketplaceIconsForOverview");s(C5e,"listZCodePlugins");s(cB,"setZCodePluginEnabled");s(aUn,"addZCodePluginMarketplace");s(sUn,"removeZCodePluginMarketplace");s(uUn,"updateZCodePluginMarketplace");s(y9t,"installZCodeMarketplacePlugin");s(dB,"uninstallZCodeMarketplacePlugin");s(lUn,"restoreBuiltinPlugin");s(cUn,"configureZCodePlugin");s(dUn,"validateZCodePlugin");s(pUn,"describeZCodePlugin");s(Nf,"resolvePluginContext");s(mUn,"resolvePluginSelector");s(v9t,"toMarketplaceSummaryData");s(hda,"toAvailablePluginData");s(E5e,"toInstalledPluginData");s(gda,"inferComponentTypes");s(_da,"inferComponentTypesFromMetadata");s(yda,"resolvePluginIdForMutation");s(vda,"normalizePluginOptions");s(xda,"assertPluginOptionsSafeToPersist");s(bda,"readPluginManifestForConfiguration");s(wda,"isRecord");s(x1,"toPluginDiagnostic");s(kda,"toMarketplaceInstallDiagnostic")});function Sda(e){let t={...e.configResult.config.plugins.enabledPlugins},r=[...e.configResult.config.plugins.suppressedBuiltins],o=s(()=>({configResult:Ida(e.configResult,t,r),env:e.env,officialPluginRoots:e.officialPluginRoots,pluginStorageRoot:e.pluginStorageRoot,workingDirectory:e.workingDirectory}),"commonOptions");return{listPlugins:s(async()=>C5e(o()),"listPlugins"),setPluginEnabled:s(async(n,i)=>{let a=await cB({...o(),enabled:i,plugin:n});return t={...t,[a.plugin.id]:a.enabled},a},"setPluginEnabled"),uninstallPlugin:s(async n=>{let i=await dB({...o(),pluginId:n});if(i){let a={...t};delete a[i.id],t=a,i.marketplace===Li&&(r.includes(i.id)||(r=[...r,i.id]))}return{removed:i}},"uninstallPlugin")}}function fUn(e){return Sda({configResult:e.configResult,env:e.options.env,officialPluginRoots:e.options.officialPluginRoots,pluginStorageRoot:e.options.pluginStorageRoot,workingDirectory:e.workingDirectory})}function Ida(e,t,r){return{...e,config:{...e.config,plugins:{...e.config.plugins,enabledPlugins:t,suppressedBuiltins:r}}}}var hUn=b(()=>{"use strict";ze();pB();s(Sda,"createPluginFacade");s(fUn,"createPluginFacadeForApp");s(Ida,"currentConfigResult")});function _Un(e){let t=e.plugins.find(r=>r.id===I5e&&r.enabled);return t?{browserUse:!0,browserDocumentationRoot:(0,gUn.join)(t.rootPath,"docs")}:{}}var gUn,yUn=b(()=>{"use strict";gUn=require("node:path");uR();s(_Un,"resolvePluginRuntimeFeatures")});function xUn(){return Oze().socket||process.env[b9t]?.trim()}function Eda(){return Oze().token||process.env[vUn]?.trim()}async function Hee(e,t,r=new Set){let o=e?await e.status():{},n=new Date().toISOString(),i={};for(let[a,u]of Object.entries(t)){let l=bUn(a,u);if(l){i[a]={status:"failed",transport:u.type,toolCount:0,updatedAt:n,error:l};continue}i[a]=o[a]??{status:Oda(a,u,r),transport:u.type,toolCount:0,updatedAt:n,error:Dda(a,u,r)}}for(let[a,u]of Object.entries(o))a in i||(i[a]=u);return i}function A5e(e,t){let r=Object.fromEntries(Object.entries(e).filter(([o,n])=>!t.has(o)&&!bUn(o,n)));return Rda(r,xUn(),Eda())}function Rda(e,t,r=void 0){let o=t?.trim();if(!o)return e;let n=r?.trim(),i=!1,a={};for(let[u,l]of Object.entries(e)){let c=$da(u,l,o,n);a[u]=c,i||=c!==l}return i?a:e}function Mda(){let e=process.env.ZCODE_CUA_HELPER_ALLOW_UNAUTHENTICATED_LOCAL?.trim().toLowerCase();return e==="1"||e==="true"||e==="on"}function bUn(e,t){if(xUn()||!wUn(e,t)||t.type==="stdio"&&t.env?.[b9t]?.trim()||Mda())return;let r=process.env[Tda]?.trim();if(r)return`ZCode CUA Helper broker unavailable: ${r}`;if(process.platform==="darwin")return"ZCode CUA Helper broker socket unavailable; refusing to run zcode-cua without the product broker (would make Python/uvx the macOS TCC owner). Launch via ZCode desktop, or set ZCODE_CUA_HELPER_ALLOW_UNAUTHENTICATED_LOCAL=1 for local dev."}function $da(e,t,r,o){if(!wUn(e,t))return t;let n=[...t.args??[]];return x9t(n,Cda,"product"),x9t(n,Ada,"broker"),x9t(n,Pda,r),{...t,args:n,env:{...t.env,[b9t]:r,...o?{[vUn]:o}:{}}}}function wUn(e,t){return t.type!=="stdio"?!1:e==="zcode-cua"||vYt(t.command)?!0:(t.args??[]).some(xYt)}function x9t(e,t,r){let o=[];for(let n=0;n<e.length;n+=1){if(e[n]===t){n+1<e.length&&(n+=1);continue}o.push(e[n])}e.splice(0,e.length,...o,t,r)}function Oda(e,t,r){return t.enabled===!1?"disabled":r.has(e)?"untrusted":"disconnected"}function Dda(e,t,r){if(!(t.enabled===!1||!r.has(e)))return"Project MCP server requires explicit connection before use."}var b9t,vUn,Tda,Cda,Ada,Pda,P5e=b(()=>{"use strict";qr();b9t="ZCODE_CUA_PERMISSION_BROKER_SOCKET",vUn="ZCODE_CUA_PERMISSION_BROKER_TOKEN",Tda="ZCODE_CUA_PERMISSION_BROKER_UNAVAILABLE";s(xUn,"resolveZCodeCuaBrokerSocket");s(Eda,"resolveZCodeCuaBrokerToken");Cda="--permission-mode",Ada="--backend",Pda="--permission-broker-socket";s(Hee,"listMcpServerStatuses");s(A5e,"omitMcpServers");s(Rda,"injectZCodeCuaBrokerMcpServers");s(Mda,"isCuaUnauthenticatedLocalDevAllowed");s(bUn,"getZCodeCuaBrokerUnavailableReason");s($da,"injectZCodeCuaBrokerMcpServer");s(wUn,"isZCodeCuaStdioServer");s(x9t,"upsertFlag");s(Oda,"getConfiguredServerStatus");s(Dda,"getConfiguredServerError")});function R5e(e,t,r,o){if(!e||!t)return;let n=Nda(e,t);if(n)return w9t(n,r,o)}function w9t(e,t,r){let o=jda(e),n=e.providerOptions?IUn(e.providerOptions):void 0,i=r===void 0&&n?e2(o,e.providerOptions,t):void 0,a=LA(o,r??i,t)?.providerOptions??LA(o,void 0,t)?.providerOptions,u=a&&n?n.optionsWithoutLegacyReasoning:e.providerOptions;return SUn(u,a)}function kUn(e,t,r){if(!e||!t)return t;let o=IUn(t);if(!o)return t;let n=e2(e,o.matchingOptions,r);if(!n)return t;let i=LA(e,n,r)?.providerOptions;return i?SUn(o.optionsWithoutLegacyReasoning,i):t}function Nda(e,t){return zda(e).find(r=>r.provider===t.providerId&&r.model===t.modelId)}function zda(e){return[e.main,...e.lite?[e.lite]:[],...e.available??[]]}function jda(e){return{modelId:e.model,providerId:e.provider}}function SUn(e,t){if(!(!e&&!t))return e?t?TUn(e,t):{...e}:t?{...t}:void 0}function IUn(e){let t=e.openaiCompatible;if(!gy(t))return;let r={...t},o=t.extra_body,n=gy(o)?{...o}:{},i={},a=!1,u=gy(o)?o.chat_template_kwargs:void 0;if(gy(u)){let m={...u};typeof u.reasoning_effort=="string"&&(i.reasoningEffort=u.reasoning_effort,delete m.reasoning_effort,a=!0),typeof u.enable_thinking=="boolean"&&(i.enable_thinking=u.enable_thinking,u.enable_thinking===!1&&(i.reasoningEffort??="none"),delete m.enable_thinking,a=!0),Object.keys(m).length===0?delete n.chat_template_kwargs:n.chat_template_kwargs=m}let l=gy(o)?o.thinking:void 0;if(gy(l)&&typeof l.type=="string"&&(i.thinking={...l},delete n.thinking,a=!0),gy(o)&&typeof o.enable_thinking=="boolean"&&(i.enable_thinking=o.enable_thinking,delete n.enable_thinking,a=!0),gy(t.thinking)&&typeof t.thinking.type=="string"&&(i.thinking={...t.thinking},delete r.thinking,a=!0),!a)return;let c=Lda(r,n),d={...e};delete d.openaiCompatible;let p=Bda({...d,...c?{openaiCompatible:c}:{}});return{optionsWithoutLegacyReasoning:p,matchingOptions:{...p,openaiCompatible:{...p.openaiCompatible,...Object.fromEntries(Object.entries(i).filter(([m])=>!Object.prototype.hasOwnProperty.call(t,m)))}}}}function Lda(e,t){let r={...e};delete r.extra_body;let o=Object.keys(t).length===0?r:{...r,extra_body:t};return Object.keys(o).length===0?void 0:o}function Bda(e){let t=e.openaiCompatible;if(!gy(t)||Object.keys(t).length>0)return e;let r={...e};return delete r.openaiCompatible,r}function TUn(e,t){let r={...e};for(let[o,n]of Object.entries(t)){let i=r[o];r[o]=gy(i)&&gy(n)?TUn(i,n):n}return r}function gy(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}var k9t=b(()=>{"use strict";lw();lw();s(R5e,"resolveRuntimeModelProviderOptions");s(w9t,"resolveModelProviderOptionsFromTarget");s(kUn,"migrateLegacyOpenAiCompatibleReasoningOptions");s(Nda,"findModelTarget");s(zda,"getModelTargets");s(jda,"modelRefFromTarget");s(SUn,"mergeProviderOptions");s(IUn,"inspectLegacyOpenAiCompatibleReasoningOptions");s(Lda,"replaceExtraBody");s(Bda,"removeEmptyOpenAiCompatible");s(TUn,"mergeUnknownRecords");s(gy,"isPlainRecord")});async function EUn(e){if(!e.sessionStore)return[];let t=await e.sessionStore.messages({sessionID:e.sessionId}),r=await e.sessionStore.getSession(e.sessionId);return Uda(r?XT(t,r):t)}function Uda(e){let t=[];for(let r of e){if(Fda(r)||qda(r))continue;let o=Zda(r.parts);if(r.info.role==="user"){let l=Vda(o);if(l.trim().length===0)continue;t.push({content:l,messageId:r.info.id,role:"user"});continue}let n=Gda(o),a=n.some(l=>l.type!=="text")?n:[],u=n.filter(l=>l.type==="text").map(l=>l.text).join(`
|
|
3222
3222
|
|
|
3223
3223
|
`);u.trim().length===0&&a.length===0||t.push({content:u,...a.length>0?{parts:a}:{},messageId:r.info.id,role:"agent"})}return t}function Fda(e){return e.info.role==="user"?e.info.summary!==void 0:e.info.summary===!0}function qda(e){return e.info.role!=="user"?!1:My(e)!=="realUserInput"}function Zda(e){let t=new Map;for(let r of e)t.set(r.id,r);return[...t.values()]}function Vda(e){let t=[];for(let r of e){if(r.type==="text"&&!r.ignored){t.push(r.text);continue}if(r.type==="file"){t.push(`[Attached file: ${r.filename??r.url}]`);continue}r.type==="agent"&&t.push(`[Selected agent: ${r.name}]`)}return t.join(`
|
|
@@ -3547,7 +3547,7 @@ ${HHn}
|
|
|
3547
3547
|
`}function vwa(e,t){return e?`Uninstalled plugin ${e.id}
|
|
3548
3548
|
`:`Plugin not installed: ${t}
|
|
3549
3549
|
`}function xwa(e){return e.mcpServerNames.length>0?e.mcpServerNames.join(", "):"none"}function bwa(e,t,r){if(!(!r.verbose||t.length===0)){e.push("",`Diagnostics (${t.length})`);for(let o of t){let n=o.path?` (${o.path})`:"",i=o.pluginId?` ${o.pluginId}`:"";e.push(`- [${o.severity}]${i} ${o.code}: ${o.message}${n}`)}}}function JHn(e){return{commandRootCount:e.commandRootCount,dataPath:e.dataPath,enabled:e.enabled,id:e.id,manifestPath:e.manifestPath,marketplace:e.marketplace,declaredMcpServerNames:e.declaredMcpServerNames,mcpServerNames:e.mcpServerNames,hookDetails:(e.hookDetails??[]).map(Iwa),name:e.name,rootPath:e.rootPath,skillCount:e.skillCount,skillRootCount:e.skillRootCount,source:e.source,...e.description?{description:e.description}:{},...e.version?{version:e.version}:{}}}function Iwa(e){return{command:e.command,event:e.event,runnable:e.runnable,sourcePath:e.sourcePath,type:e.type,...e.args?{args:e.args}:{},...e.async!==void 0?{async:e.async}:{},...e.matcher!==void 0?{matcher:e.matcher}:{},...e.shell!==void 0?{shell:e.shell}:{},...e.statusMessage!==void 0?{statusMessage:e.statusMessage}:{},...e.timeout!==void 0?{timeout:e.timeout}:{},...e.timeoutMs!==void 0?{timeoutMs:e.timeoutMs}:{}}}function Twa(e){return{code:e.code,message:e.message,severity:e.severity,...e.path?{path:e.path}:{},...e.pluginId?{pluginId:e.pluginId}:{}}}var WHn,HHn,wwa,kwa,Swa,QHn=b(()=>{"use strict";WHn=require("node:readline");md();HHn="Usage: zcode plugins [list|enable <plugin-id-or-name>|disable <plugin-id-or-name>|uninstall <plugin-id-or-name> [--force]]";s(KHn,"runPluginsCommand");s(CZt,"failUsage");s(cwa,"runPluginsListCommand");s(dwa,"runPluginsSetCommand");s(pwa,"resolveListPlugins");s(mwa,"resolveSetPluginEnabled");s(fwa,"runPluginsUninstallCommand");s(hwa,"confirmUninstall");s(gwa,"resolveUninstallPlugin");s(AZt,"reportPluginsError");s(_wa,"formatHumanPluginList");s(ywa,"formatHumanPluginSet");s(vwa,"formatHumanPluginUninstall");s(xwa,"formatMcpNames");s(bwa,"appendDiagnostics");wwa=s((e,t)=>hl({cwd:t,diagnostics:e.diagnostics.map(Twa),plugins:e.plugins.map(JHn)}),"formatPluginListJson"),kwa=s((e,t)=>hl({cwd:t,enabled:e.enabled,path:e.path,plugin:JHn(e.plugin)}),"formatPluginSetJson"),Swa=s((e,t,r)=>hl({cwd:r,pluginId:e?.id??t,removed:e!==null,...e?{plugin:{id:e.id,name:e.name,marketplace:e.marketplace,scope:e.scope}}:{}}),"formatPluginUninstallJson");s(JHn,"formatPluginJson");s(Iwa,"formatHookDetailJson");s(Twa,"formatDiagnosticJson")});function Cwa(e=process.env){let t=e.ZCODE_STORAGE_DIR?.trim()||(0,PR.join)((0,XHn.homedir)(),".zcode");return(0,PR.join)(t,"clipboard")}function eKn(e={}){let t=e.platform??process.platform,r=e.maxBytes??Ewa,o=e.runCommand??Mwa,n=e.tempDirectory??Cwa(e.processEnv);return async(i={})=>t==="darwin"?await Awa({maxBytes:r,runCommand:o,signal:i.abortSignal,tempDirectory:n}):t==="linux"?await Pwa({maxBytes:r,runCommand:o,signal:i.abortSignal}):t==="win32"?await Rwa({maxBytes:r,runCommand:o,signal:i.abortSignal,tempDirectory:n}):null}async function Awa(e){await(0,xy.mkdir)(e.tempDirectory,{recursive:!0});let t=await(0,xy.mkdtemp)((0,PR.join)(e.tempDirectory,"zcode-clipboard-")),r=(0,PR.join)(t,"clipboard.png");try{return(await e.runCommand("osascript",["-e","set png_data to (the clipboard as \xABclass PNGf\xBB)","-e",`set fp to open for access POSIX file ${$wa(r)} with write permission`,"-e","write png_data to fp","-e","close access fp"],{maxBytes:e.maxBytes,signal:e.signal})).exitCode!==0?null:await tKn(r,"image/png",e.maxBytes)}finally{await(0,xy.rm)(t,{force:!0,recursive:!0})}}async function Pwa(e){let t=[{args:["--type","image/png"],file:"wl-paste",mediaType:"image/png"},{args:["--type","image/jpeg"],file:"wl-paste",mediaType:"image/jpeg"},{args:["--type","image/gif"],file:"wl-paste",mediaType:"image/gif"},{args:["--type","image/webp"],file:"wl-paste",mediaType:"image/webp"},{args:["-selection","clipboard","-t","image/png","-o"],file:"xclip",mediaType:"image/png"},{args:["-selection","clipboard","-t","image/jpeg","-o"],file:"xclip",mediaType:"image/jpeg"},{args:["-selection","clipboard","-t","image/gif","-o"],file:"xclip",mediaType:"image/gif"},{args:["-selection","clipboard","-t","image/webp","-o"],file:"xclip",mediaType:"image/webp"}];for(let r of t){let o=await e.runCommand(r.file,r.args,{maxBytes:e.maxBytes,signal:e.signal}),n=rKn(o.stdout,r.mediaType,e.maxBytes);if(o.exitCode===0&&n)return n}return null}async function Rwa(e){await(0,xy.mkdir)(e.tempDirectory,{recursive:!0});let t=await(0,xy.mkdtemp)((0,PR.join)(e.tempDirectory,"zcode-clipboard-")),r=(0,PR.join)(t,"clipboard.png"),o=["Add-Type -AssemblyName System.Windows.Forms;","$img = Get-Clipboard -Format Image;","if ($null -eq $img) { exit 2 }",`$img.Save(${Owa(r)}, [System.Drawing.Imaging.ImageFormat]::Png);`].join(" ");try{return(await e.runCommand("powershell.exe",["-NoProfile","-NonInteractive","-Command",o],{maxBytes:e.maxBytes,signal:e.signal})).exitCode!==0?null:await tKn(r,"image/png",e.maxBytes)}finally{await(0,xy.rm)(t,{force:!0,recursive:!0})}}async function tKn(e,t,r){let o=await(0,xy.readFile)(e);return rKn(o,t,r)}function rKn(e,t,r){return e.byteLength===0||e.byteLength>r?null:{dataUrl:`data:${t};base64,${e.toString("base64")}`,mediaType:t,sizeBytes:e.byteLength}}async function Mwa(e,t,r){return await new Promise(o=>{let n;try{n=(0,YHn.spawn)(e,t,{signal:r.signal,stdio:["ignore","pipe","ignore"],windowsHide:!0})}catch{o({exitCode:-1,stdout:Buffer.alloc(0)});return}let i=[],a=0,u=!1,l=s(c=>{u||(u=!0,o(c))},"finish");n.stdout?.on("data",c=>{if(a+=c.byteLength,a>r.maxBytes){n.kill();return}i.push(c)}),n.on("error",()=>l({exitCode:-1,stdout:Buffer.alloc(0)})),n.on("close",(c,d)=>{l({exitCode:c,signal:d,stdout:Buffer.concat(i)})})})}function $wa(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Owa(e){return`'${e.replace(/'/g,"''")}'`}var YHn,xy,XHn,PR,Ewa,nKn=b(()=>{"use strict";YHn=require("node:child_process"),xy=require("node:fs/promises"),XHn=require("node:os"),PR=require("node:path"),Ewa=20*1024*1024;s(Cwa,"resolveDefaultClipboardDirectory");s(eKn,"createNodeClipboardImageReader");s(Awa,"readMacClipboardImage");s(Pwa,"readLinuxClipboardImage");s(Rwa,"readWindowsClipboardImage");s(tKn,"readImageFile");s(rKn,"bufferToClipboardImage");s(Mwa,"runCommandBuffer");s($wa,"appleScriptString");s(Owa,"powershellString")});function iKn(e={}){let t=e.maxBytes??Dwa,r=e.platform??process.platform,o=e.runCommand??Zwa;return async n=>{let i=qwa(n,t);if(i.byteLength===0)return;let a=Bwa(e.stdout,i),u=await Uwa({input:n,platform:r,runCommand:o});if(!a&&!u)throw new Error("No text clipboard target accepted the selected text.")}}function Bwa(e,t){if(!e)return!1;try{return e.write(`${zwa}${Nwa};${t.toString("base64")}${jwa}`),!0}catch{return!1}}async function Uwa(e){for(let t of Fwa(e.platform))if((await e.runCommand(t.file,t.args,{input:e.input})).exitCode===0)return!0;return!1}function Fwa(e){return e==="darwin"?[{args:[],file:"pbcopy"}]:e==="linux"?[{args:[],file:"wl-copy"},{args:["-selection","clipboard"],file:"xclip"},{args:["--clipboard","--input"],file:"xsel"}]:e==="win32"?[{args:["-NoProfile","-NonInteractive","-Command",Lwa],file:"powershell.exe"}]:[]}function qwa(e,t){let r=Buffer.from(e,"utf8");if(r.byteLength>t)throw new Error(`Clipboard text exceeds ${t} bytes.`);return r}async function Zwa(e,t,r){return await new Promise(o=>{let n;try{n=(0,oKn.spawn)(e,t,{stdio:["pipe","ignore","ignore"],windowsHide:!0})}catch{o({exitCode:-1});return}let i=!1,a=s(u=>{i||(i=!0,o(u))},"finish");n.stdin?.on("error",()=>{}),n.stdin?.end(r.input),n.on("error",()=>a({exitCode:-1})),n.on("close",(u,l)=>a({exitCode:u,signal:l}))})}var oKn,Dwa,Nwa,zwa,jwa,Lwa,aKn=b(()=>{"use strict";oKn=require("node:child_process"),Dwa=1024*1024,Nwa="c",zwa="\x1B]52;",jwa="\x07",Lwa="Set-Clipboard -Value ([Console]::In.ReadToEnd())";s(iKn,"createNodeClipboardTextWriter");s(Bwa,"writeOsc52");s(Uwa,"writeNativeClipboardText");s(Fwa,"nativeClipboardCommands");s(qwa,"assertClipboardTextSize");s(Zwa,"runCommandText")});async function y3e(e){let t=e.env??process.env,r=(e.cwd??process.cwd)();return e.listCustomCommands?await e.listCustomCommands({env:t,logger:e.logger,workingDirectory:r}):await(await Bs()).listZCodeCustomCommands({env:t,logger:e.logger,workingDirectory:r})}async function sKn(e,t){let r=e.env??process.env,o=(e.cwd??process.cwd)();return e.loadCustomCommand?await e.loadCustomCommand({env:r,logger:e.logger,name:t,workingDirectory:o}):await(await Bs()).loadZCodeCustomCommand({env:r,logger:e.logger,name:t,workingDirectory:o})}async function uKn(e){let t=e.env??process.env,r=(e.cwd??process.cwd)();return await(e.listSkills??(await Bs()).listZCodeSkills)({env:t,logger:e.logger,workingDirectory:r})}async function lKn(e){let t=e.env??process.env,r=(e.cwd??process.cwd)();return(await(e.listSessions??(await Bs()).listZCodeSessions)({directory:r,env:t,limit:50})).map(i=>({directory:i.directory,id:i.id,parentId:i.parentID,title:i.title,updatedAt:i.time.updated}))}async function cKn(e){try{return await e.getSessionMetadata?.()??{}}catch(t){if(Vwa(t))throw t;return{}}}function Vwa(e){return e instanceof Error?e.name==="SqliteSessionMigrationError":!1}var PZt=b(()=>{"use strict";ME();s(y3e,"listCustomCommandsForTui");s(sKn,"loadCustomCommandForTui");s(uKn,"listSkillsForTui");s(lKn,"listSessionsForTui");s(cKn,"loadInitialTuiSessionMetadata");s(Vwa,"isStartupGateError")});async function dKn(e,t){let r=e.env??process.env,o=(e.cwd??process.cwd)(),n=(e.loadDotenv??om)({cwd:o,env:r});if(n.error)throw new Error(`Failed to load environment file: ${n.path}`,{cause:n.error});return await(e.loginZCodeCli??(await Bs()).loginZCodeCli)({abortSignal:t?.abortSignal,env:r,onAuthorizeUrl:t?.onAuthorizeUrl})}async function pKn(e,t){let r=e.env??process.env,o=(e.cwd??process.cwd)(),n=(e.loadDotenv??om)({cwd:o,env:r});if(n.error)throw new Error(`Failed to load environment file: ${n.path}`,{cause:n.error});return await(e.loginBigmodelCodingPlan??(await Bs()).loginBigmodelCodingPlan)({abortSignal:t?.abortSignal,env:r,onAuthorizeUrl:t?.onAuthorizeUrl})}async function mKn(e,t){return await(e.configureCodingPlanApiKey??(await Bs()).configureCodingPlanApiKey)({apiKey:t.apiKey,providerId:t.providerId})}async function fKn(e){let t=e.env??process.env,r=(e.cwd??process.cwd)(),o=(e.loadDotenv??om)({cwd:r,env:t});if(o.error)throw new Error(`Failed to load environment file: ${o.path}`,{cause:o.error});return await(e.logoutZCodeCli??(await Bs()).logoutZCodeCli)({env:t})}var hKn=b(()=>{"use strict";ME();nC();s(dKn,"loginForTui");s(pKn,"loginBigmodelForTui");s(mKn,"configureApiKeyForTui");s(fKn,"logoutForTui")});var gKn,_Kn,NE,RZt=b(()=>{"use strict";gKn={},_Kn=s(e=>({current:e,override:e}),"createCliModeState"),NE=s(e=>e.current??e.override??"build","currentCliMode")});function MZt(e,t,r){return{kind:"started_turn",result:{...e,locale:e.locale??t.getLocale?.(),mode:r,model:e.model??t.getModel?.(),theme:e.theme??t.getTheme?.(),thoughtLevel:e.thoughtLevel??t.getThoughtLevel?.()}}}var yKn=b(()=>{"use strict";s(MZt,"withTuiMetadata")});function vKn(){let e=new Set;return{onWorkflowEvent:s(async t=>{for(let r of e)await Promise.resolve(r(t)).catch(()=>{})},"onWorkflowEvent"),subscribeWorkflowEvents:s(t=>(e.add(t),()=>{e.delete(t)}),"subscribeWorkflowEvents")}}function xKn(e,t,r){e.refreshWorkflowPanel=async o=>{let n=await t(),i=await p3e(n,o);if(!i)throw new Error("Workflow panel is not available in this client.");return i},e.stopWorkflow=async o=>{let n=await t(),i=n.stopWorkflow??n.stopExpertWorkflow;if(!i)throw new Error("Workflow stop is not available in this client.");let a=await i({runId:o.runId}),u=await p3e(n,{runId:a.runId??o.runId});if(!u)throw new Error("Workflow panel is not available in this client.");return u},e.subscribeWorkflowEvents=r}var bKn=b(()=>{"use strict";fZt();s(vKn,"createTuiWorkflowEventHub");s(xKn,"attachTuiWorkflowPanelHandlers")});function wKn(e,t,r,o={continueSession:!1},n,i,a=jCe,u,l=!1,c,d){let p,m=n,f,h,_,y=new WeakMap,v=new WeakMap,S,x=vKn(),k=Math.max(1,Math.trunc(e.shutdownCleanupTimeoutMs??Cie)),w={requestPermission:s(async(V,G)=>{let H=S;return H?await H(V,G):{decision:"deny",reason:`No interactive approval handler configured for ${V.toolName}`,resolvedAt:new Date}},"requestPermission")},I=s(async(V=p)=>{if(!V)return;let G=V,H=y.get(G);H||(H=(async()=>{await Uy(async()=>V.close?.(),k),await Uy(async()=>v.get(G)?.close(),k)})(),y.set(G,H)),await H},"closeApp"),E=s(async V=>{let G=p,H=await V();return p=H,G&&G!==H&&await I(G),t.current=p.getMode?.()??NE(t),p},"replaceApp"),R=s(async V=>{let G=e.env??process.env,H=(e.cwd??process.cwd)(),Y=(e.loadDotenv??om)({cwd:H,env:G});if(Y.error)throw new Error(`Failed to load environment file: ${Y.path}`,{cause:Y.error});let Q=await g3e(V,H,G,e),se=e.createZCodeApp?void 0:await Bs(),Z=e.createZCodeApp??se?.createZCodeApp;if(!Z)throw new Error("ZCode app factory is unavailable.");let ae=e.prepareZCodeTelemetryEnv??se?.prepareZCodeTelemetryEnv;ae&&(h=e.shutdownZCodeTelemetry??se?.shutdownZCodeTelemetry);let ne=ae?await ae(G,{cliVersion:r,productVersion:G.ZCODE_APP_VERSION}):G,W=e.createProviderEndpointRoutingPort??se?.createDefaultProviderEndpointRoutingPort;f??=W?.({appVersion:r,env:G,projectConfigPath:e.projectConfigPath,skipUserConfig:e.skipUserConfig,userConfigPath:e.userConfigPath,workingDirectory:H});let ie=h3e({browserExecutable:d,browserUse:c},e),ce;try{ce=Z({browserControlPort:ie?.browserControlPort,env:ne,projectConfigPath:e.projectConfigPath,...f?{providerEndpointRoutingPort:f}:{},resume:Q!==void 0,runtimeConfig:{...t.override?{mode:t.override}:{},...u?{toolDisallowlist:u}:{},...l?{midConversationSystem:{mode:"force"}}:{},modelStreaming:"on",titleGeneration:gKn,workingDirectory:H},permissionBroker:w,sessionId:Q,skipUserConfig:e.skipUserConfig,uiDetectedLocale:i,uiLocale:m,userConfigPath:e.userConfigPath,version:r,onWorkflowEvent:x.onWorkflowEvent})}catch(fe){throw await Uy(async()=>ie?.close(),k),fe}return ie&&v.set(ce,ie),t.current=ce.getMode?.()??t.override??t.current??"build",ce},"createApp"),A=s(async()=>(p??=await R(o),t.current=p.getMode?.()??NE(t),p),"getApp"),$=s(async V=>await E(async()=>await R(V?{continueSession:!1,resumeSessionId:V}:{continueSession:!0})),"resumeApp"),M=s(async()=>await E(async()=>await R({continueSession:!1})),"newApp"),j=s(async V=>{if(t.override=V,p){let G=p;if(G.setMode){let H=await G.setMode(V);return t.current=H.mode,H.mode}G.runtime.updateConfig({mode:V})}return t.current=V,V},"setCliMode"),q=Lte({forkApp:s(async V=>{let H=await(await A()).forkFromCheckpoint?.({targetCheckpointId:V});if(!H)throw new Error("Forking is not available in this client.");return await E(async()=>await R({continueSession:!1,resumeSessionId:H.forkedSessionId})),{copiedMessageCount:H.copiedMessageCount,forkedSessionId:H.forkedSessionId,response:`${H.response}
|
|
3550
|
-
Switched to forked session ${H.forkedSessionId}.`,restoredFileCount:H.restoredFileCount??H.restoredFiles?.length??0}},"forkApp"),getApp:A,getMode:s(()=>NE(t),"getMode"),getLocale:s(()=>p?.getLocale?.()??NLt(m,i)??a,"getLocale"),hasConfiguredCodingPlanApiKey:bZt(e),listCustomCommands:s(()=>y3e(e),"listCustomCommands"),listSessions:s(()=>lKn(e),"listSessions"),listSkills:s(()=>uKn(e),"listSkills"),configureApiKey:s(V=>mKn(e,V),"configureApiKey"),login:s(V=>dKn(e,V),"login"),loginBigmodel:s(V=>pKn(e,V),"loginBigmodel"),loadCustomCommand:s(V=>sKn(e,V),"loadCustomCommand"),newApp:M,recordInputHistory:s(async(V,G)=>{await p?.recordInputHistory?.(V,G)},"recordInputHistory"),resumeApp:$,logout:s(()=>fKn(e),"logout"),setLocale:s(async V=>{if(p?.setLocale){let H=await p.setLocale(V);return m=V,H}return m=V,{configPath:(await RH(e.userConfigPath??rP(),V)).path,locale:NLt(V,i)??"en-US",requestedLocale:V}},"setLocale"),setMode:j}),U=s(async(V,G)=>{let H=S;S=G.requestPermission;try{return await q(V,G)}finally{S=H}},"submitPrompt");return U.setMode=async V=>({mode:await j(V)}),U.sendInput=async(V,G)=>{let H=S;S=G?.requestPermission;try{let Y=await A();if(Y.sendInput){let Q=await Y.sendInput(V,G);return Q.kind!=="started_turn"?Q:MZt(Q.result,Y,NE(t))}return MZt(await Y.submitPrompt(V,G),Y,NE(t))}finally{S=H}},U.loadSessionTranscript=async()=>await(await A()).loadSessionTranscript?.()??[],U.readGoal=async()=>await(await A()).readTarget?.()??null,U.readTodos=async()=>await(await A()).readTodos?.()??[],U.readRuntimeProjection=async()=>{let e=await A();return e.runtime?.getProjection?.()??null},U.readSessionUsage=async()=>await(await A()).readSessionUsage?.()??null,U.cancelBackgroundTask=async e=>await(await A()).cancelBackgroundTask?.(e)??null,U.previewFileRewind=async e=>{let t=await A();return await t.runtime?.previewWorkspaceFileRewind?.({targetMessageIds:e})??null},U.applyFileRewind=async e=>{let t=await A();return await t.runtime?.applyWorkspaceFileRewind?.({targetMessageIds:e})??null},U.recallPreviousInput=async V=>await(await A()).recallPreviousInputHistory?.(V)??null,xKn(U,A,x.subscribeWorkflowEvents),U.getSessionMetadata=async()=>{let V=await A();return{locale:V.getLocale?.(),model:V.getModel?.(),theme:V.getTheme?.(),thoughtLevel:V.getThoughtLevel?.()}},U.listModelOptions=async()=>(await A()).listModels?.()??[],U.listEffortOptions=async()=>{let V=await A();return await Ote(V)??[]},U.listMcpServers=async()=>(await A()).listMcpServers?.()??{},U.close=async()=>{_??=(async()=>{await I(),await Uy(async()=>h?.(),k)})(),await _},U}var kKn=b(()=>{"use strict";Ou();vg();ME();f3e();c3e();nC();zLt();SZt();IZt();MF();hKn();PZt();RZt();m3e();yKn();bKn();s(wKn,"createTuiSubmitPrompt")});var SKn,IKn,wd,zE,_0,TKn,EKn,Gwa,Wwa,CKn,AKn,Hwa,Kwa,Jwa,Qwa,Ywa,Xwa,PKn=b(()=>{"use strict";SKn=require("node:crypto"),IKn=require("node:fs"),wd=require("node:fs/promises"),zE=require("node:os"),_0=require("node:path"),TKn=require("node:url"),EKn="zcode-tui-runtime/",Gwa=`${EKn}manifest.json`,Wwa="node_modules/@zcode/tui/dist/index.js",CKn="manifest.json",AKn=s(async()=>{let e=await import("node:sea");if(!e.isSea())return await import("@zcode/tui");let t=await Hwa(e);return await import((0,TKn.pathToFileURL)((0,_0.join)(t,Wwa)).href)},"loadTuiRuntime"),Hwa=s(async e=>{let t=Kwa(e),r=(0,_0.join)(Qwa(),"0.16.1",t.target,t.hash),o=(0,_0.join)(r,CKn);if(await Jwa(o,t))return r;let n=`${r}.tmp-${process.pid}-${Date.now()}`;await(0,wd.rm)(n,{force:!0,recursive:!0}),await(0,wd.mkdir)(n,{recursive:!0});for(let i of t.files){let a=e.getRawAsset(`${EKn}${i.path}`),u=Buffer.from(a);if((0,SKn.createHash)("sha256").update(u).digest("hex")!==i.sha256)throw new Error(`SEA TUI asset hash mismatch for ${i.path}`);let c=(0,_0.join)(n,i.path);await(0,wd.mkdir)((0,_0.dirname)(c),{recursive:!0}),await(0,wd.writeFile)(c,u),await(0,wd.chmod)(c,i.mode??Xwa(i.path))}return await(0,wd.writeFile)(Ywa(n),JSON.stringify(t,null,2)),await(0,wd.rm)(r,{force:!0,recursive:!0}),await(0,wd.mkdir)((0,_0.dirname)(r),{recursive:!0}),await(0,wd.rename)(n,r),r},"ensureSeaTuiRuntime"),Kwa=s(e=>{let t=e.getAsset(Gwa,"utf8"),r=JSON.parse(t);if(r.version!==1||!r.hash||!Array.isArray(r.files))throw new Error("Invalid SEA TUI runtime manifest.");return r},"readManifest"),Jwa=s(async(e,t)=>{if(!(0,IKn.existsSync)(e))return!1;try{let r=JSON.parse(await(0,wd.readFile)(e,"utf8"));return r.hash===t.hash&&r.target===t.target}catch{return!1}},"isCacheCurrent"),Qwa=s(()=>{let e=(0,zE.homedir)();return(0,zE.platform)()==="darwin"&&e?(0,_0.join)(e,"Library","Caches","zcode","sea-assets"):(0,zE.platform)()==="win32"?(0,_0.join)(process.env.LOCALAPPDATA??(0,_0.join)(e||(0,zE.tmpdir)(),"AppData","Local"),"zcode","Cache","sea-assets"):(0,_0.join)(process.env.XDG_CACHE_HOME??(0,_0.join)(e||(0,zE.tmpdir)(),".cache"),"zcode","sea-assets")},"cacheBaseDirectory"),Ywa=s(e=>(0,_0.join)(e,CKn),"markerPathForDirectory"),Xwa=s(e=>/\.(?:dll|dylib|node|so)$/i.test(e)?493:420,"modeForPath")});function RKn({deps:e,options:t,workingDirectory:r}){let o=Ni({cliOverrides:e1a(t.locale),env:e.env??process.env,projectConfigPath:e.projectConfigPath,skipUserConfig:e.skipUserConfig,userConfigPath:e.userConfigPath,workingDirectory:r});return rx(o.config.ui.locale,t.detectedLocale)}var e1a,MKn=b(()=>{"use strict";Ou();vg();e1a=s(e=>e?{ui:{locale:e}}:void 0,"localeCliOverrides");s(RKn,"resolveTuiStartupLocale")});function OKn(e){let t=e.fileSystemPort??pk(),r=(0,Cg.resolve)(e.workspaceDirectory);return async o=>{let n=i1a(o.token);if(!n)return{items:[],truncated:!1};let i=(0,Cg.resolve)(r,n.directoryToken);if(!l1a(r,i))return{items:[],truncated:!1};try{let u=(await t.listDirectory({path:i},{signal:o.abortSignal})).entries.flatMap(c=>{if(c.kind!=="directory"&&c.kind!=="file")return[];if(c.kind==="directory"&&o1a.has(c.name))return[];if(!n.query.startsWith(".")&&c.name.startsWith("."))return[];if(!a1a(c.name,n.query))return[];let d=u1a(r,c.path);return d?[{kind:c.kind,path:c.kind==="directory"?`${d}/`:d}]:[]}).sort((c,d)=>s1a(c,d,n.query)),l=Math.max(1,Math.floor(o.limit??t1a));return{items:u.slice(0,l),truncated:u.length>l}}catch{return{items:[],truncated:!1}}}}function i1a(e){let t=e.replace(/^@/u,"");if(t.startsWith("/")||t.startsWith("\\")||(0,Cg.isAbsolute)(t)||n1a.test(t))return;let r=t.replace(r1a,"/");if(r.split("/").some(n=>n===".."))return;let o=r.lastIndexOf("/");return o<0?{directoryToken:"",query:r}:{directoryToken:r.slice(0,o+1),query:r.slice(o+1)}}function a1a(e,t){return t.length===0?!0:e.toLowerCase().includes(t.toLowerCase())}function s1a(e,t,r){if(e.kind!==t.kind)return e.kind==="directory"?-1:1;let o=$Kn(e.path),n=$Kn(t.path),i=r.toLowerCase(),a=o.toLowerCase().startsWith(i),u=n.toLowerCase().startsWith(i);return a!==u?a?-1:1:e.path.localeCompare(t.path)}function $Kn(e){let t=e.endsWith("/")?e.slice(0,-1):e,r=t.lastIndexOf("/");return r<0?t:t.slice(r+1)}function u1a(e,t){let r=(0,Cg.relative)(e,t);if(!(!r||r.startsWith("..")||(0,Cg.isAbsolute)(r)))return r.split(Cg.sep).join("/")}function l1a(e,t){let r=(0,Cg.relative)(e,t);return r===""||!r.startsWith("..")&&!(0,Cg.isAbsolute)(r)}var Cg,t1a,r1a,n1a,o1a,DKn=b(()=>{"use strict";c6();Cg=require("node:path"),t1a=50,r1a=/[\\/]+/gu,n1a=/^[a-zA-Z]:[\\/]/u,o1a=new Set([".bzr",".git",".hg",".jj",".sl",".svn","node_modules"]);s(OKn,"createWorkspacePathSuggestionProvider");s(i1a,"parseWorkspacePathToken");s(a1a,"matchesPathQuery");s(s1a,"compareWorkspacePathSuggestion");s($Kn,"basenameFromSuggestion");s(u1a,"toWorkspaceRelativePath");s(l1a,"isPathInside")});async function zKn(e){let t=e.maxOutputBytes??m1a,r=e.timeoutMs??p1a,n=await(e.runCommand??h1a)(c1a,["-C",e.workspaceDirectory,...d1a],{maxOutputBytes:t,timeoutMs:r}).catch(()=>({exitCode:-1,stdout:""}));if(n.exitCode!==0)return;let i=n.stdout.trim().split(/\r?\n/,1)[0]?.trim();if(!(!i||i===f1a))return i}async function h1a(e,t,r){return await new Promise(o=>{let n;try{n=(0,NKn.spawn)(e,t,{stdio:["ignore","pipe","ignore"],windowsHide:!0})}catch{o({exitCode:-1,stdout:""});return}let i="",a=!1,u=setTimeout(()=>{n.kill(),l({exitCode:-1,stdout:i})},r.timeoutMs),l=s(c=>{a||(a=!0,clearTimeout(u),o(c))},"finish");n.stdout?.on("data",c=>{i+=c.toString("utf8"),Buffer.byteLength(i,"utf8")>r.maxOutputBytes&&(n.kill(),l({exitCode:-1,stdout:i}))}),n.on("error",()=>l({exitCode:-1,stdout:i})),n.on("close",c=>l({exitCode:c,stdout:i}))})}var NKn,c1a,d1a,p1a,m1a,f1a,jKn=b(()=>{"use strict";NKn=require("node:child_process"),c1a="git",d1a=["symbolic-ref","--quiet","--short","HEAD"],p1a=750,m1a=512,f1a="HEAD";s(zKn,"resolveWorkspaceGitBranch");s(h1a,"runGitCommand")});var LKn,BKn=b(()=>{"use strict";qr();nKn();aKn();f3e();MF();PZt();m3e();kKn();PKn();MKn();DKn();jKn();RZt();LKn=s(async(e,t,r,o,n,i,a,u=!1)=>{try{let l=_Kn(n),c=r.runTui??(await AKn()).runTui,d=(r.cwd??process.cwd)(),p=r.env??process.env,m=T3(p)==="development",f=await(r.resolveWorkspaceGitBranch??zKn)({workspaceDirectory:d}).catch(()=>{}),h=RKn({deps:r,options:t,workingDirectory:d}),_=wKn(r,l,o,i,t.locale,t.detectedLocale,h,a,u,t.browserUse,t.browserExecutable),y=Aie({cleanup:s(async()=>{await _.close?.()},"cleanup"),cleanupTimeoutMs:r.shutdownCleanupTimeoutMs,exitProcess:r.exitProcess,process:r.shutdownProcess});try{let v=await PHn(r),S=v?{locale:h}:await cKn(_),x=v||!S.model?[]:await _.listModelOptions?.().catch(()=>[]),k=v||!S.model?[]:await _.listEffortOptions?.().catch(()=>[]),w=await y3e(r).catch(()=>{});return await c({initialMode:NE(l),initialModel:S.model,initialThoughtLevel:S.thoughtLevel,loginRequired:v,locale:S.locale??h,theme:S.theme??"auto",developerMode:m,version:o,workspaceDirectory:d,workspaceGitBranch:f,noColor:t.noColor,readClipboardImage:r.readClipboardImage??eKn(),effortOptions:k,modelOptions:x,listWorkspacePathSuggestions:OKn({workspaceDirectory:d}),listMcpServers:_.listMcpServers,writeClipboardText:r.writeClipboardText??iKn({stdout:e.stdout}),stderr:e.stderr,stdin:e.stdin,stdout:e.stdout,loadSessionTranscript:_.loadSessionTranscript,readGoal:_.readGoal,readTodos:_.readTodos,readRuntimeProjection:_.readRuntimeProjection,readSessionUsage:_.readSessionUsage,cancelBackgroundTask:_.cancelBackgroundTask,previewFileRewind:_.previewFileRewind,applyFileRewind:_.applyFileRewind,recallPreviousInput:_.recallPreviousInput,sendInput:_.sendInput,setMode:_.setMode,slashCommands:_Zt(w),submitPrompt:_,..._.refreshWorkflowPanel?{refreshWorkflowPanel:_.refreshWorkflowPanel}:{},..._.stopWorkflow?{stopWorkflow:_.stopWorkflow}:{},..._.subscribeWorkflowEvents?{subscribeWorkflowEvents:_.subscribeWorkflowEvents}:{}})}finally{y(),await _.close?.()}}catch(l){let c=l instanceof Error?l.message:String(l);return e.stderr.write(`Error: ${c}
|
|
3550
|
+
Switched to forked session ${H.forkedSessionId}.`,restoredFileCount:H.restoredFileCount??H.restoredFiles?.length??0}},"forkApp"),getApp:A,getMode:s(()=>NE(t),"getMode"),getLocale:s(()=>p?.getLocale?.()??NLt(m,i)??a,"getLocale"),hasConfiguredCodingPlanApiKey:bZt(e),listCustomCommands:s(()=>y3e(e),"listCustomCommands"),listSessions:s(()=>lKn(e),"listSessions"),listSkills:s(()=>uKn(e),"listSkills"),configureApiKey:s(V=>mKn(e,V),"configureApiKey"),login:s(V=>dKn(e,V),"login"),loginBigmodel:s(V=>pKn(e,V),"loginBigmodel"),loadCustomCommand:s(V=>sKn(e,V),"loadCustomCommand"),newApp:M,recordInputHistory:s(async(V,G)=>{await p?.recordInputHistory?.(V,G)},"recordInputHistory"),resumeApp:$,logout:s(()=>fKn(e),"logout"),setLocale:s(async V=>{if(p?.setLocale){let H=await p.setLocale(V);return m=V,H}return m=V,{configPath:(await RH(e.userConfigPath??rP(),V)).path,locale:NLt(V,i)??"en-US",requestedLocale:V}},"setLocale"),setMode:j}),U=s(async(V,G)=>{let H=S;S=G.requestPermission;try{return await q(V,G)}finally{S=H}},"submitPrompt");return U.setMode=async V=>({mode:await j(V)}),U.sendInput=async(V,G)=>{let H=S;S=G?.requestPermission;try{let Y=await A();if(Y.sendInput){let Q=await Y.sendInput(V,G);return Q.kind!=="started_turn"?Q:MZt(Q.result,Y,NE(t))}return MZt(await Y.submitPrompt(V,G),Y,NE(t))}finally{S=H}},U.loadSessionTranscript=async()=>await(await A()).loadSessionTranscript?.()??[],U.readGoal=async()=>await(await A()).readTarget?.()??null,U.readTodos=async()=>await(await A()).readTodos?.()??[],U.readRuntimeProjection=async()=>{let e=await A();return e.runtime?.getProjection?.()??null},U.readSessionUsage=async()=>await(await A()).readSessionUsage?.()??null,U.cancelBackgroundTask=async e=>await(await A()).cancelBackgroundTask?.(e)??null,U.previewFileRewind=async e=>{let t=await A();return await t.runtime?.previewWorkspaceFileRewind?.({targetMessageIds:e})??null},U.applyFileRewind=async e=>{let t=await A();return await t.runtime?.applyWorkspaceFileRewind?.({targetMessageIds:e})??null},U.interruptTurn=async e=>{let t=await A(),r=e?.reservationId??"tui-steer-interrupt",o=(Array.isArray(e?.pendingInputIds)?e.pendingInputIds:[]).filter(Boolean),n=[],i=async()=>{for(let a of n)await t.releaseQueueItemReservation?.(a,r);n=[]};try{if(t.reserveQueueItem&&t.releaseQueueItemReservation)for(let a of o)if(await t.reserveQueueItem(a,r))n.push(a);else{await i();break}let a=t.runtime?.stopActiveForegroundExecution?.({preserveQueueAutoDrainOnCancel:o.length>0&&n.length===o.length,reason:e?.reason??"TUI steer interrupt"})??{kind:"unsupported"};return a.kind!=="stopped"&&await i(),a}catch(a){await i();throw a}},U.promoteQueuedInput=async(e,t,r)=>{let o=await A(),n=r?.pendingInputReservationId??r?.queryId??r?.inputId??"tui-promotion",i=(Array.isArray(t)?t:[t]).filter(Boolean);if(i.length===0||!o.reserveQueueItem||!o.markQueueItemPromoting||!o.releaseQueueItemReservation||!o.removeQueueItem)return U.sendInput(e,{...r,delivery:"start_turn"});let a=[],u=!1;try{for(let l of i){if(await o.markQueueItemPromoting(l,n)){a.push(l);continue}if(!await o.reserveQueueItem(l,n))throw new Error("TUI queued input is already reserved: "+l);a.push(l);if(!await o.markQueueItemPromoting(l,n))throw new Error("TUI queued input promotion failed: "+l)}let c=await U.sendInput(e,{...r,delivery:"start_turn"});if(c?.kind==="rejected")return c;u=!0;for(let l of a)if(!await o.removeQueueItem(l,{reason:"promoted",reservationId:n}))throw new Error("TUI queued input promotion commit failed: "+l);return c}finally{if(!u)for(let l of a)await o.releaseQueueItemReservation(l,n)}},U.recallPreviousInput=async V=>await(await A()).recallPreviousInputHistory?.(V)??null,xKn(U,A,x.subscribeWorkflowEvents),U.getSessionMetadata=async()=>{let V=await A();return{locale:V.getLocale?.(),model:V.getModel?.(),theme:V.getTheme?.(),thoughtLevel:V.getThoughtLevel?.()}},U.listModelOptions=async()=>(await A()).listModels?.()??[],U.listEffortOptions=async()=>{let V=await A();return await Ote(V)??[]},U.listMcpServers=async()=>(await A()).listMcpServers?.()??{},U.close=async()=>{_??=(async()=>{await I(),await Uy(async()=>h?.(),k)})(),await _},U}var kKn=b(()=>{"use strict";Ou();vg();ME();f3e();c3e();nC();zLt();SZt();IZt();MF();hKn();PZt();RZt();m3e();yKn();bKn();s(wKn,"createTuiSubmitPrompt")});var SKn,IKn,wd,zE,_0,TKn,EKn,Gwa,Wwa,CKn,AKn,Hwa,Kwa,Jwa,Qwa,Ywa,Xwa,PKn=b(()=>{"use strict";SKn=require("node:crypto"),IKn=require("node:fs"),wd=require("node:fs/promises"),zE=require("node:os"),_0=require("node:path"),TKn=require("node:url"),EKn="zcode-tui-runtime/",Gwa=`${EKn}manifest.json`,Wwa="node_modules/@zcode/tui/dist/index.js",CKn="manifest.json",AKn=s(async()=>{let e=await import("node:sea");if(!e.isSea())return await import("@zcode/tui");let t=await Hwa(e);return await import((0,TKn.pathToFileURL)((0,_0.join)(t,Wwa)).href)},"loadTuiRuntime"),Hwa=s(async e=>{let t=Kwa(e),r=(0,_0.join)(Qwa(),"0.16.1",t.target,t.hash),o=(0,_0.join)(r,CKn);if(await Jwa(o,t))return r;let n=`${r}.tmp-${process.pid}-${Date.now()}`;await(0,wd.rm)(n,{force:!0,recursive:!0}),await(0,wd.mkdir)(n,{recursive:!0});for(let i of t.files){let a=e.getRawAsset(`${EKn}${i.path}`),u=Buffer.from(a);if((0,SKn.createHash)("sha256").update(u).digest("hex")!==i.sha256)throw new Error(`SEA TUI asset hash mismatch for ${i.path}`);let c=(0,_0.join)(n,i.path);await(0,wd.mkdir)((0,_0.dirname)(c),{recursive:!0}),await(0,wd.writeFile)(c,u),await(0,wd.chmod)(c,i.mode??Xwa(i.path))}return await(0,wd.writeFile)(Ywa(n),JSON.stringify(t,null,2)),await(0,wd.rm)(r,{force:!0,recursive:!0}),await(0,wd.mkdir)((0,_0.dirname)(r),{recursive:!0}),await(0,wd.rename)(n,r),r},"ensureSeaTuiRuntime"),Kwa=s(e=>{let t=e.getAsset(Gwa,"utf8"),r=JSON.parse(t);if(r.version!==1||!r.hash||!Array.isArray(r.files))throw new Error("Invalid SEA TUI runtime manifest.");return r},"readManifest"),Jwa=s(async(e,t)=>{if(!(0,IKn.existsSync)(e))return!1;try{let r=JSON.parse(await(0,wd.readFile)(e,"utf8"));return r.hash===t.hash&&r.target===t.target}catch{return!1}},"isCacheCurrent"),Qwa=s(()=>{let e=(0,zE.homedir)();return(0,zE.platform)()==="darwin"&&e?(0,_0.join)(e,"Library","Caches","zcode","sea-assets"):(0,zE.platform)()==="win32"?(0,_0.join)(process.env.LOCALAPPDATA??(0,_0.join)(e||(0,zE.tmpdir)(),"AppData","Local"),"zcode","Cache","sea-assets"):(0,_0.join)(process.env.XDG_CACHE_HOME??(0,_0.join)(e||(0,zE.tmpdir)(),".cache"),"zcode","sea-assets")},"cacheBaseDirectory"),Ywa=s(e=>(0,_0.join)(e,CKn),"markerPathForDirectory"),Xwa=s(e=>/\.(?:dll|dylib|node|so)$/i.test(e)?493:420,"modeForPath")});function RKn({deps:e,options:t,workingDirectory:r}){let o=Ni({cliOverrides:e1a(t.locale),env:e.env??process.env,projectConfigPath:e.projectConfigPath,skipUserConfig:e.skipUserConfig,userConfigPath:e.userConfigPath,workingDirectory:r});return rx(o.config.ui.locale,t.detectedLocale)}var e1a,MKn=b(()=>{"use strict";Ou();vg();e1a=s(e=>e?{ui:{locale:e}}:void 0,"localeCliOverrides");s(RKn,"resolveTuiStartupLocale")});function OKn(e){let t=e.fileSystemPort??pk(),r=(0,Cg.resolve)(e.workspaceDirectory);return async o=>{let n=i1a(o.token);if(!n)return{items:[],truncated:!1};let i=(0,Cg.resolve)(r,n.directoryToken);if(!l1a(r,i))return{items:[],truncated:!1};try{let u=(await t.listDirectory({path:i},{signal:o.abortSignal})).entries.flatMap(c=>{if(c.kind!=="directory"&&c.kind!=="file")return[];if(c.kind==="directory"&&o1a.has(c.name))return[];if(!n.query.startsWith(".")&&c.name.startsWith("."))return[];if(!a1a(c.name,n.query))return[];let d=u1a(r,c.path);return d?[{kind:c.kind,path:c.kind==="directory"?`${d}/`:d}]:[]}).sort((c,d)=>s1a(c,d,n.query)),l=Math.max(1,Math.floor(o.limit??t1a));return{items:u.slice(0,l),truncated:u.length>l}}catch{return{items:[],truncated:!1}}}}function i1a(e){let t=e.replace(/^@/u,"");if(t.startsWith("/")||t.startsWith("\\")||(0,Cg.isAbsolute)(t)||n1a.test(t))return;let r=t.replace(r1a,"/");if(r.split("/").some(n=>n===".."))return;let o=r.lastIndexOf("/");return o<0?{directoryToken:"",query:r}:{directoryToken:r.slice(0,o+1),query:r.slice(o+1)}}function a1a(e,t){return t.length===0?!0:e.toLowerCase().includes(t.toLowerCase())}function s1a(e,t,r){if(e.kind!==t.kind)return e.kind==="directory"?-1:1;let o=$Kn(e.path),n=$Kn(t.path),i=r.toLowerCase(),a=o.toLowerCase().startsWith(i),u=n.toLowerCase().startsWith(i);return a!==u?a?-1:1:e.path.localeCompare(t.path)}function $Kn(e){let t=e.endsWith("/")?e.slice(0,-1):e,r=t.lastIndexOf("/");return r<0?t:t.slice(r+1)}function u1a(e,t){let r=(0,Cg.relative)(e,t);if(!(!r||r.startsWith("..")||(0,Cg.isAbsolute)(r)))return r.split(Cg.sep).join("/")}function l1a(e,t){let r=(0,Cg.relative)(e,t);return r===""||!r.startsWith("..")&&!(0,Cg.isAbsolute)(r)}var Cg,t1a,r1a,n1a,o1a,DKn=b(()=>{"use strict";c6();Cg=require("node:path"),t1a=50,r1a=/[\\/]+/gu,n1a=/^[a-zA-Z]:[\\/]/u,o1a=new Set([".bzr",".git",".hg",".jj",".sl",".svn","node_modules"]);s(OKn,"createWorkspacePathSuggestionProvider");s(i1a,"parseWorkspacePathToken");s(a1a,"matchesPathQuery");s(s1a,"compareWorkspacePathSuggestion");s($Kn,"basenameFromSuggestion");s(u1a,"toWorkspaceRelativePath");s(l1a,"isPathInside")});async function zKn(e){let t=e.maxOutputBytes??m1a,r=e.timeoutMs??p1a,n=await(e.runCommand??h1a)(c1a,["-C",e.workspaceDirectory,...d1a],{maxOutputBytes:t,timeoutMs:r}).catch(()=>({exitCode:-1,stdout:""}));if(n.exitCode!==0)return;let i=n.stdout.trim().split(/\r?\n/,1)[0]?.trim();if(!(!i||i===f1a))return i}async function h1a(e,t,r){return await new Promise(o=>{let n;try{n=(0,NKn.spawn)(e,t,{stdio:["ignore","pipe","ignore"],windowsHide:!0})}catch{o({exitCode:-1,stdout:""});return}let i="",a=!1,u=setTimeout(()=>{n.kill(),l({exitCode:-1,stdout:i})},r.timeoutMs),l=s(c=>{a||(a=!0,clearTimeout(u),o(c))},"finish");n.stdout?.on("data",c=>{i+=c.toString("utf8"),Buffer.byteLength(i,"utf8")>r.maxOutputBytes&&(n.kill(),l({exitCode:-1,stdout:i}))}),n.on("error",()=>l({exitCode:-1,stdout:i})),n.on("close",c=>l({exitCode:c,stdout:i}))})}var NKn,c1a,d1a,p1a,m1a,f1a,jKn=b(()=>{"use strict";NKn=require("node:child_process"),c1a="git",d1a=["symbolic-ref","--quiet","--short","HEAD"],p1a=750,m1a=512,f1a="HEAD";s(zKn,"resolveWorkspaceGitBranch");s(h1a,"runGitCommand")});var LKn,BKn=b(()=>{"use strict";qr();nKn();aKn();f3e();MF();PZt();m3e();kKn();PKn();MKn();DKn();jKn();RZt();LKn=s(async(e,t,r,o,n,i,a,u=!1)=>{try{let l=_Kn(n),c=r.runTui??(await AKn()).runTui,d=(r.cwd??process.cwd)(),p=r.env??process.env,m=T3(p)==="development",f=await(r.resolveWorkspaceGitBranch??zKn)({workspaceDirectory:d}).catch(()=>{}),h=RKn({deps:r,options:t,workingDirectory:d}),_=wKn(r,l,o,i,t.locale,t.detectedLocale,h,a,u,t.browserUse,t.browserExecutable),y=Aie({cleanup:s(async()=>{await _.close?.()},"cleanup"),cleanupTimeoutMs:r.shutdownCleanupTimeoutMs,exitProcess:r.exitProcess,process:r.shutdownProcess});try{let v=await PHn(r),S=v?{locale:h}:await cKn(_),x=v||!S.model?[]:await _.listModelOptions?.().catch(()=>[]),k=v||!S.model?[]:await _.listEffortOptions?.().catch(()=>[]),w=await y3e(r).catch(()=>{});return await c({initialMode:NE(l),initialModel:S.model,initialThoughtLevel:S.thoughtLevel,loginRequired:v,locale:S.locale??h,theme:S.theme??"auto",developerMode:m,version:o,workspaceDirectory:d,workspaceGitBranch:f,noColor:t.noColor,readClipboardImage:r.readClipboardImage??eKn(),effortOptions:k,modelOptions:x,listWorkspacePathSuggestions:OKn({workspaceDirectory:d}),listMcpServers:_.listMcpServers,writeClipboardText:r.writeClipboardText??iKn({stdout:e.stdout}),stderr:e.stderr,stdin:e.stdin,stdout:e.stdout,loadSessionTranscript:_.loadSessionTranscript,readGoal:_.readGoal,readTodos:_.readTodos,readRuntimeProjection:_.readRuntimeProjection,readSessionUsage:_.readSessionUsage,cancelBackgroundTask:_.cancelBackgroundTask,previewFileRewind:_.previewFileRewind,applyFileRewind:_.applyFileRewind,interruptTurn:_.interruptTurn,promoteQueuedInput:_.promoteQueuedInput,recallPreviousInput:_.recallPreviousInput,sendInput:_.sendInput,setMode:_.setMode,slashCommands:_Zt(w),submitPrompt:_,..._.refreshWorkflowPanel?{refreshWorkflowPanel:_.refreshWorkflowPanel}:{},..._.stopWorkflow?{stopWorkflow:_.stopWorkflow}:{},..._.subscribeWorkflowEvents?{subscribeWorkflowEvents:_.subscribeWorkflowEvents}:{}})}finally{y(),await _.close?.()}}catch(l){let c=l instanceof Error?l.message:String(l);return e.stderr.write(`Error: ${c}
|
|
3551
3551
|
`),t.verbose&&l instanceof Error&&l.stack&&e.stderr.write(`${l.stack}
|
|
3552
3552
|
`),1}},"runTuiCommand")});var qKn={};mr(qKn,{run:()=>j1a});var FKn,jE,g1a,_1a,y1a,v1a,x1a,b1a,w1a,k1a,S1a,$Zt,UKn,I1a,T1a,E1a,C1a,A1a,P1a,R1a,M1a,$1a,O1a,D1a,v3e,N1a,z1a,j1a,ZKn=b(()=>{"use strict";FKn=require("node:util");g1e();md();md();vg();nC();QAn();zLt();ME();xWn();CWn();MWn();eZt();S3e();Uje();GHn();QHn();TZt();BKn();jE="0.16.1",g1a="--target requires non-empty text.",_1a="yolo",y1a="--force-mcs can only be used with --prompt, --target, or tui.",v1a="--target-replace requires --target.",x1a='--target cannot be used with --prompt. Use either --target <objective> or --prompt "/goal <objective>".',b1a=new Set(["--disallowedTools","--disallowed-tools"]),w1a="--browser-executable requires --browser-use=headless.",k1a="--browser-use=headless can only be used with --prompt, --target, or tui.",S1a=s(e=>(0,FKn.parseArgs)({allowPositionals:!0,args:e,options:{help:{short:"h",type:"boolean"},json:{type:"boolean"},"no-color":{type:"boolean"},"no-browser":{type:"boolean"},"browser-use":{type:"string"},"browser-executable":{type:"string"},prompt:{short:"p",type:"string"},attach:{multiple:!0,type:"string"},cwd:{type:"string"},locale:{type:"string"},resume:{type:"string"},target:{type:"string"},"target-replace":{type:"boolean"},continue:{short:"c",type:"boolean"},force:{short:"f",type:"boolean"},"force-mcs":{type:"boolean"},mode:{type:"string"},verbose:{type:"boolean"},version:{short:"v",type:"boolean"},stdio:{type:"boolean"}},strict:!0}),"parseGlobalArgs"),$Zt=s(e=>e[0]??"tui","commandName"),UKn=s(e=>typeof e.prompt=="string"||e.targetRequest!==void 0||$Zt(e.positionals)==="tui","isForceMcsSupportedInvocation"),I1a=s((e,t,r,o,n)=>({browserExecutable:n,browserUse:o,detectedLocale:r,force:e.force===!0,json:e.json===!0,locale:t,noColor:e["no-color"]===!0,verbose:e.verbose===!0}),"globalOptions"),T1a=s(e=>{if(e!==void 0){if(oee(e))return e;throw new Error(cy().cli.errors.localeUnsupported(e))}},"normalizeLocaleOption"),E1a=s(e=>{if(e===void 0)return;let t=e.toLowerCase();if(t==="build"||t==="plan"||t==="edit"||t==="yolo")return t;throw new Error(`Unsupported --mode value: ${e}. Supported modes: build, edit, plan, yolo.`)},"normalizePromptMode"),C1a=s(e=>{if(e!==void 0){if(e.toLowerCase()==="headless")return"headless";throw new Error(`Unsupported --browser-use value: ${e}. Supported value: headless.`)}},"normalizeBrowserUse"),A1a=s(e=>{let t=[],r=[];for(let o=0;o<e.length;o+=1){let n=e[o],i=n.match(/^(--disallowedTools|--disallowed-tools)=(.*)$/);if(i){r.push(i[2]??"");continue}if(!b1a.has(n)){t.push(n);continue}let a=!1;for(;o+1<e.length&&!P1a(e[o+1]);)r.push(e[o+1]),o+=1,a=!0;if(!a)throw new Error(`${n} requires at least one tool.`)}return{args:t,toolDisallowlist:R1a(r)}},"extractDisallowedToolsArgs"),P1a=s(e=>e==="--"||/^-[^-]?|^--/.test(e),"isCliOptionToken"),R1a=s(e=>{let t=[],r=new Set;for(let o of e)for(let n of M1a(o)){let i=$1a(n);!i||r.has(i)||(r.add(i),t.push(i))}return t.length>0?t:void 0},"normalizeCliToolRuleList"),M1a=s(e=>{let t=[],r="",o=!1,n=s(()=>{let i=r.trim();i&&t.push(i),r=""},"flush");for(let i of e)switch(i){case"(":o=!0,r+=i;break;case")":o=!1,r+=i;break;case",":o?r+=i:n();break;case" ":o?r+=i:n();break;default:r+=i;break}return n(),t},"splitCliToolRules"),$1a=s(e=>e?e==="web_search"?"WebSearch":e.startsWith("web_search(")?`WebSearch${e.slice(10)}`:e:"","normalizeCliToolRule"),O1a=s(e=>{let t=e.target,r=e["target-replace"]===!0;if(t===void 0){if(r)throw new Error(v1a);return}let o=t.trim();if(o.length===0)throw new Error(g1a);return{objective:o,replaceExisting:r}},"normalizeTargetRequest"),D1a=s(e=>e.replaceExisting?`/goal replace ${e.objective}`:`/goal ${e.objective}`,"buildHeadlessTargetCommand"),v3e=s((e,t,r)=>{e.write(JAn(jE,t,r))},"writeHelp"),N1a=s((e,t,r)=>{let o=$Lt(),n={cli:{name:FZt,processName:k3e,version:jE},runtime:{arch:o.arch,cwd:r,execPath:o.execPath,node:o.node,platform:o.platform,processTitle:process.title,sea:o.sea},packaging:{default:"node-bundle",sea:"optional"}};if(t.json)return e.stdout.write(hl(n)),0;let i=RLt(e.stdout,t.noColor);return e.stdout.write(`${MLt.bold("zcode doctor",i)}
|
|
3553
3553
|
`),e.stdout.write(`version: ${n.cli.version}
|