@synnaxlabs/alamos 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ae=require("./instrumentation-KXpmw8Ox.cjs");var qn;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(qn||(qn={}));var Fa="0000000000000000",Ka="00000000000000000000000000000000",Go={traceId:Ka,spanId:Fa,traceFlags:qn.NONE},Qt=function(){function t(e){e===void 0&&(e=Go),this._spanContext=e}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t}(),Ti=Ae.createContextKey("OpenTelemetry Context Key SPAN");function Si(t){return t.getValue(Ti)||void 0}function Zo(){return Si(Ae.ContextAPI.getInstance().active())}function Oi(t,e){return t.setValue(Ti,e)}function zo(t){return t.deleteValue(Ti)}function Fo(t,e){return Oi(t,new Qt(e))}function Ha(t){var e;return(e=Si(t))===null||e===void 0?void 0:e.spanContext()}var Ko=/^([0-9a-f]{32})$/i,Ho=/^[0-9a-f]{16}$/i;function Xo(t){return Ko.test(t)&&t!==Ka}function Yo(t){return Ho.test(t)&&t!==Fa}function Xa(t){return Xo(t.traceId)&&Yo(t.spanId)}function Wo(t){return new Qt(t)}var Pn=Ae.ContextAPI.getInstance(),Ya=function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=Pn.active());var i=!!(r!=null&&r.root);if(i)return new Qt;var a=n&&Ha(n);return qo(a)&&Xa(a)?new Qt(a):new Qt},t.prototype.startActiveSpan=function(e,r,n,i){var a,s,o;if(!(arguments.length<2)){arguments.length===2?o=r:arguments.length===3?(a=r,o=n):(a=r,s=n,o=i);var c=s??Pn.active(),u=this.startSpan(e,a,c),d=Oi(c,u);return Pn.with(d,o,void 0,u)}},t}();function qo(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var Jo=new Ya,Qo=function(){function t(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}return t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,i){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Jo},t}(),eu=function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new Ya},t}(),tu=new eu,fa=function(){function t(){}return t.prototype.getTracer=function(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new Qo(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:tu},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(e,r,n)},t}(),xn="trace",ru=function(){function t(){this._proxyTracerProvider=new fa,this.wrapSpanContext=Wo,this.isSpanContextValid=Xa,this.deleteSpan=zo,this.getSpan=Si,this.getActiveSpan=Zo,this.getSpanContext=Ha,this.setSpan=Oi,this.setSpanContext=Fo}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=Ae.registerGlobal(xn,this._proxyTracerProvider,Ae.DiagAPI.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return Ae.getGlobal(xn)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){Ae.unregisterGlobal(xn,Ae.DiagAPI.instance()),this._proxyTracerProvider=new fa},t}(),nu=ru.getInstance(),iu=Object.defineProperty,au=(t,e,r)=>e in t?iu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,T=(t,e,r)=>(au(t,typeof e!="symbol"?e+"":e,r),r),Pt,G;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(G||(G={}));var Jn;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Jn||(Jn={}));const A=G.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),st=t=>{switch(typeof t){case"undefined":return A.undefined;case"string":return A.string;case"number":return isNaN(t)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(t)?A.array:t===null?A.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?A.promise:typeof Map<"u"&&t instanceof Map?A.map:typeof Set<"u"&&t instanceof Set?A.set:typeof Date<"u"&&t instanceof Date?A.date:A.object;default:return A.unknown}},g=G.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),su=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Re extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,c=0;for(;c<s.path.length;){const u=s.path[c];c===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(s))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,G.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Re.create=t=>new Re(t);const ir=(t,e)=>{let r;switch(t.code){case g.invalid_type:t.received===A.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,G.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:r=`Unrecognized key(s) in object: ${G.joinValues(t.keys,", ")}`;break;case g.invalid_union:r="Invalid input";break;case g.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${G.joinValues(t.options)}`;break;case g.invalid_enum_value:r=`Invalid enum value. Expected ${G.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:r="Invalid function arguments";break;case g.invalid_return_type:r="Invalid function return type";break;case g.invalid_date:r="Invalid date";break;case g.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:G.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case g.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case g.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case g.custom:r="Invalid input";break;case g.invalid_intersection_types:r="Intersection results could not be merged";break;case g.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:r="Number must be finite";break;default:r=e.defaultError,G.assertNever(t)}return{message:r}};let Wa=ir;function ou(t){Wa=t}function Yr(){return Wa}const Wr=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],s={...i,path:a};let o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(s,{data:e,defaultError:o}).message;return{...i,path:a,message:i.message||o}},uu=[];function b(t,e){const r=Wr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Yr(),ir].filter(n=>!!n)});t.common.issues.push(r)}class le{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return x;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return le.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return x;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:e.value,value:n}}}const x=Object.freeze({status:"aborted"}),qa=t=>({status:"dirty",value:t}),_e=t=>({status:"valid",value:t}),Qn=t=>t.status==="aborted",ei=t=>t.status==="dirty",ar=t=>t.status==="valid",qr=t=>typeof Promise<"u"&&t instanceof Promise;var N;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(N||(N={}));class je{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const da=(t,e)=>{if(ar(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Re(t.common.issues);return this._error=r,this._error}}};function L(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>s.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:r??o.defaultError},description:i}}class M{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return st(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:st(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new le,ctx:{common:e.parent.common,data:e.data,parsedType:st(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(qr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:st(e)},a=this._parseSync({data:e,path:i.path,parent:i});return da(i,a)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:st(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(qr(i)?i:Promise.resolve(i));return da(n,a)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const s=e(i),o=()=>a.addIssue({code:g.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Ce({schema:this,typeName:I.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Je.create(this,this._def)}nullable(){return Nt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ie.create(this,this._def)}promise(){return Vt.create(this,this._def)}or(e){return cr.create([this,e],this._def)}and(e){return lr.create(this,e,this._def)}transform(e){return new Ce({...L(this._def),schema:this,typeName:I.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new _r({...L(this._def),innerType:this,defaultValue:r,typeName:I.ZodDefault})}brand(){return new Qa({typeName:I.ZodBranded,type:this,...L(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new tn({...L(this._def),innerType:this,catchValue:r,typeName:I.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Tr.create(this,e)}readonly(){return nn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cu=/^c[^\s-]{8,}$/i,lu=/^[a-z][a-z0-9]*$/,fu=/^[0-9A-HJKMNP-TV-Z]{26}$/,du=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,pu=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ln;const _u=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,vu=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,yu=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function mu(t,e){return!!((e==="v4"||!e)&&_u.test(t)||(e==="v6"||!e)&&vu.test(t))}class be extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==A.string){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_type,expected:A.string,received:a.parsedType}),x}const n=new le;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?b(i,{code:g.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&b(i,{code:g.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")pu.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"email",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ln||(Ln=new RegExp(hu,"u")),Ln.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"emoji",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")du.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"uuid",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")cu.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"cuid",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")lu.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"cuid2",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")fu.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"ulid",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),b(i,{validation:"url",code:g.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"regex",code:g.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?yu(a).test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?mu(e.data,a.version)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"ip",code:g.invalid_string,message:a.message}),n.dirty()):G.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:g.invalid_string,...N.errToObj(n)})}_addCheck(e){return new be({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...N.errToObj(e)})}url(e){return this._addCheck({kind:"url",...N.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...N.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...N.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...N.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...N.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...N.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...N.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...N.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...N.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...N.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...N.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...N.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...N.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...N.errToObj(r)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new be({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new be({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new be({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}be.create=t=>{var e;return new be({checks:[],typeName:I.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...L(t)})};function gu(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return a%s/Math.pow(10,i)}class pt extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==A.number){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_type,expected:A.number,received:a.parsedType}),x}let n;const i=new le;for(const a of this._def.checks)a.kind==="int"?G.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:g.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?gu(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_finite,message:a.message}),i.dirty()):G.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,N.toString(r))}gt(e,r){return this.setLimit("min",e,!1,N.toString(r))}lte(e,r){return this.setLimit("max",e,!0,N.toString(r))}lt(e,r){return this.setLimit("max",e,!1,N.toString(r))}setLimit(e,r,n,i){return new pt({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:N.toString(i)}]})}_addCheck(e){return new pt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:N.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:N.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:N.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:N.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&G.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}pt.create=t=>new pt({checks:[],typeName:I.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class ht extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==A.bigint){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_type,expected:A.bigint,received:a.parsedType}),x}let n;const i=new le;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):G.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,N.toString(r))}gt(e,r){return this.setLimit("min",e,!1,N.toString(r))}lte(e,r){return this.setLimit("max",e,!0,N.toString(r))}lt(e,r){return this.setLimit("max",e,!1,N.toString(r))}setLimit(e,r,n,i){return new ht({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:N.toString(i)}]})}_addCheck(e){return new ht({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}ht.create=t=>{var e;return new ht({checks:[],typeName:I.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...L(t)})};class sr extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==A.boolean){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.boolean,received:n.parsedType}),x}return _e(e.data)}}sr.create=t=>new sr({typeName:I.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class bt extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==A.date){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_type,expected:A.date,received:a.parsedType}),x}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_date}),x}const n=new le;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):G.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bt({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:N.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:N.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}bt.create=t=>new bt({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:I.ZodDate,...L(t)});class Jr extends M{_parse(e){if(this._getType(e)!==A.symbol){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.symbol,received:n.parsedType}),x}return _e(e.data)}}Jr.create=t=>new Jr({typeName:I.ZodSymbol,...L(t)});class or extends M{_parse(e){if(this._getType(e)!==A.undefined){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.undefined,received:n.parsedType}),x}return _e(e.data)}}or.create=t=>new or({typeName:I.ZodUndefined,...L(t)});class ur extends M{_parse(e){if(this._getType(e)!==A.null){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.null,received:n.parsedType}),x}return _e(e.data)}}ur.create=t=>new ur({typeName:I.ZodNull,...L(t)});class jt extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return _e(e.data)}}jt.create=t=>new jt({typeName:I.ZodAny,...L(t)});class Ot extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _e(e.data)}}Ot.create=t=>new Ot({typeName:I.ZodUnknown,...L(t)});class et extends M{_parse(e){const r=this._getOrReturnCtx(e);return b(r,{code:g.invalid_type,expected:A.never,received:r.parsedType}),x}}et.create=t=>new et({typeName:I.ZodNever,...L(t)});class Qr extends M{_parse(e){if(this._getType(e)!==A.undefined){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.void,received:n.parsedType}),x}return _e(e.data)}}Qr.create=t=>new Qr({typeName:I.ZodVoid,...L(t)});class Ie extends M{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==A.array)return b(r,{code:g.invalid_type,expected:A.array,received:r.parsedType}),x;if(i.exactLength!==null){const s=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(s||o)&&(b(r,{code:s?g.too_big:g.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(b(r,{code:g.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(b(r,{code:g.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>i.type._parseAsync(new je(r,s,r.path,o)))).then(s=>le.mergeArray(n,s));const a=[...r.data].map((s,o)=>i.type._parseSync(new je(r,s,r.path,o)));return le.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new Ie({...this._def,minLength:{value:e,message:N.toString(r)}})}max(e,r){return new Ie({...this._def,maxLength:{value:e,message:N.toString(r)}})}length(e,r){return new Ie({...this._def,exactLength:{value:e,message:N.toString(r)}})}nonempty(e){return this.min(1,e)}}Ie.create=(t,e)=>new Ie({type:t,minLength:null,maxLength:null,exactLength:null,typeName:I.ZodArray,...L(e)});function Dt(t){if(t instanceof ee){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Je.create(Dt(n))}return new ee({...t._def,shape:()=>e})}else return t instanceof Ie?new Ie({...t._def,type:Dt(t.element)}):t instanceof Je?Je.create(Dt(t.unwrap())):t instanceof Nt?Nt.create(Dt(t.unwrap())):t instanceof Ve?Ve.create(t.items.map(e=>Dt(e))):t}class ee extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=G.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==A.object){const u=this._getOrReturnCtx(e);return b(u,{code:g.invalid_type,expected:A.object,received:u.parsedType}),x}const{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof et&&this._def.unknownKeys==="strip"))for(const u in i.data)s.includes(u)||o.push(u);const c=[];for(const u of s){const d=a[u],y=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new je(i,y,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof et){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(b(i,{code:g.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const y=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new je(i,y,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const y=await d.key;u.push({key:y,value:await d.value,alwaysSet:d.alwaysSet})}return u}).then(u=>le.mergeObjectSync(n,u)):le.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return N.errToObj,new ee({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,a,s,o;const c=(s=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=N.errToObj(e).message)!==null&&o!==void 0?o:c}:{message:c}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(e){return new ee({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:I.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ee({...this._def,catchall:e})}pick(e){const r={};return G.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new ee({...this._def,shape:()=>r})}omit(e){const r={};return G.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new ee({...this._def,shape:()=>r})}deepPartial(){return Dt(this)}partial(e){const r={};return G.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new ee({...this._def,shape:()=>r})}required(e){const r={};return G.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Je;)a=a._def.innerType;r[n]=a}}),new ee({...this._def,shape:()=>r})}keyof(){return Ja(G.objectKeys(this.shape))}}ee.create=(t,e)=>new ee({shape:()=>t,unknownKeys:"strip",catchall:et.create(),typeName:I.ZodObject,...L(e)});ee.strictCreate=(t,e)=>new ee({shape:()=>t,unknownKeys:"strict",catchall:et.create(),typeName:I.ZodObject,...L(e)});ee.lazycreate=(t,e)=>new ee({shape:t,unknownKeys:"strip",catchall:et.create(),typeName:I.ZodObject,...L(e)});class cr extends M{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new Re(o.ctx.common.issues));return b(r,{code:g.invalid_union,unionErrors:s}),x}if(r.common.async)return Promise.all(n.map(async a=>{const s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(c=>new Re(c));return b(r,{code:g.invalid_union,unionErrors:o}),x}}get options(){return this._def.options}}cr.create=(t,e)=>new cr({options:t,typeName:I.ZodUnion,...L(e)});const Ur=t=>t instanceof dr?Ur(t.schema):t instanceof Ce?Ur(t.innerType()):t instanceof pr?[t.value]:t instanceof _t?t.options:t instanceof hr?Object.keys(t.enum):t instanceof _r?Ur(t._def.innerType):t instanceof or?[void 0]:t instanceof ur?[null]:null;class _n extends M{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.object)return b(r,{code:g.invalid_type,expected:A.object,received:r.parsedType}),x;const n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(b(r,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const i=new Map;for(const a of r){const s=Ur(a.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of s){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,a)}}return new _n({typeName:I.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...L(n)})}}function ti(t,e){const r=st(t),n=st(e);if(t===e)return{valid:!0,data:t};if(r===A.object&&n===A.object){const i=G.objectKeys(e),a=G.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(const o of a){const c=ti(t[o],e[o]);if(!c.valid)return{valid:!1};s[o]=c.data}return{valid:!0,data:s}}else if(r===A.array&&n===A.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const s=t[a],o=e[a],c=ti(s,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===A.date&&n===A.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class lr extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=(a,s)=>{if(Qn(a)||Qn(s))return x;const o=ti(a.value,s.value);return o.valid?((ei(a)||ei(s))&&r.dirty(),{status:r.value,value:o.data}):(b(n,{code:g.invalid_intersection_types}),x)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}lr.create=(t,e,r)=>new lr({left:t,right:e,typeName:I.ZodIntersection,...L(r)});class Ve extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.array)return b(n,{code:g.invalid_type,expected:A.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return b(n,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(b(n,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((s,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new je(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>le.mergeArray(r,s)):le.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ve({...this._def,rest:e})}}Ve.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ve({items:t,typeName:I.ZodTuple,rest:null,...L(e)})};class fr extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.object)return b(n,{code:g.invalid_type,expected:A.object,received:n.parsedType}),x;const i=[],a=this._def.keyType,s=this._def.valueType;for(const o in n.data)i.push({key:a._parse(new je(n,o,n.path,o)),value:s._parse(new je(n,n.data[o],n.path,o))});return n.common.async?le.mergeObjectAsync(r,i):le.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof M?new fr({keyType:e,valueType:r,typeName:I.ZodRecord,...L(n)}):new fr({keyType:be.create(),valueType:e,typeName:I.ZodRecord,...L(r)})}}class en extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.map)return b(n,{code:g.invalid_type,expected:A.map,received:n.parsedType}),x;const i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([o,c],u)=>({key:i._parse(new je(n,o,n.path,[u,"key"])),value:a._parse(new je(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of s){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return x;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),o.set(u.value,d.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of s){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return x;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),o.set(u.value,d.value)}return{status:r.value,value:o}}}}en.create=(t,e,r)=>new en({valueType:e,keyType:t,typeName:I.ZodMap,...L(r)});class wt extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.set)return b(n,{code:g.invalid_type,expected:A.set,received:n.parsedType}),x;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(b(n,{code:g.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(b(n,{code:g.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function s(c){const u=new Set;for(const d of c){if(d.status==="aborted")return x;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>a._parse(new je(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>s(c)):s(o)}min(e,r){return new wt({...this._def,minSize:{value:e,message:N.toString(r)}})}max(e,r){return new wt({...this._def,maxSize:{value:e,message:N.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}wt.create=(t,e)=>new wt({valueType:t,minSize:null,maxSize:null,typeName:I.ZodSet,...L(e)});class kt extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.function)return b(r,{code:g.invalid_type,expected:A.function,received:r.parsedType}),x;function n(o,c){return Wr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Yr(),ir].filter(u=>!!u),issueData:{code:g.invalid_arguments,argumentsError:c}})}function i(o,c){return Wr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Yr(),ir].filter(u=>!!u),issueData:{code:g.invalid_return_type,returnTypeError:c}})}const a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Vt){const o=this;return _e(async function(...c){const u=new Re([]),d=await o._def.args.parseAsync(c,a).catch(k=>{throw u.addIssue(n(c,k)),u}),y=await Reflect.apply(s,this,d);return await o._def.returns._def.type.parseAsync(y,a).catch(k=>{throw u.addIssue(i(y,k)),u})})}else{const o=this;return _e(function(...c){const u=o._def.args.safeParse(c,a);if(!u.success)throw new Re([n(c,u.error)]);const d=Reflect.apply(s,this,u.data),y=o._def.returns.safeParse(d,a);if(!y.success)throw new Re([i(d,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new kt({...this._def,args:Ve.create(e).rest(Ot.create())})}returns(e){return new kt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new kt({args:e||Ve.create([]).rest(Ot.create()),returns:r||Ot.create(),typeName:I.ZodFunction,...L(n)})}}class dr extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}dr.create=(t,e)=>new dr({getter:t,typeName:I.ZodLazy,...L(e)});class pr extends M{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return b(r,{received:r.data,code:g.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}pr.create=(t,e)=>new pr({value:t,typeName:I.ZodLiteral,...L(e)});function Ja(t,e){return new _t({values:t,typeName:I.ZodEnum,...L(e)})}class _t extends M{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return b(r,{expected:G.joinValues(n),received:r.parsedType,code:g.invalid_type}),x}if(this._def.values.indexOf(e.data)===-1){const r=this._getOrReturnCtx(e),n=this._def.values;return b(r,{received:r.data,code:g.invalid_enum_value,options:n}),x}return _e(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e){return _t.create(e)}exclude(e){return _t.create(this.options.filter(r=>!e.includes(r)))}}_t.create=Ja;class hr extends M{_parse(e){const r=G.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==A.string&&n.parsedType!==A.number){const i=G.objectValues(r);return b(n,{expected:G.joinValues(i),received:n.parsedType,code:g.invalid_type}),x}if(r.indexOf(e.data)===-1){const i=G.objectValues(r);return b(n,{received:n.data,code:g.invalid_enum_value,options:i}),x}return _e(e.data)}get enum(){return this._def.values}}hr.create=(t,e)=>new hr({values:t,typeName:I.ZodNativeEnum,...L(e)});class Vt extends M{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.promise&&r.common.async===!1)return b(r,{code:g.invalid_type,expected:A.promise,received:r.parsedType}),x;const n=r.parsedType===A.promise?r.data:Promise.resolve(r.data);return _e(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Vt.create=(t,e)=>new Vt({type:t,typeName:I.ZodPromise,...L(e)});class Ce extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===I.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{b(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(s).then(o=>this._def.schema._parseAsync({data:o,path:n.path,parent:n})):this._def.schema._parseSync({data:s,path:n.path,parent:n})}if(i.type==="refinement"){const s=o=>{const c=i.refinement(o,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?x:(o.status==="dirty"&&r.dirty(),s(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?x:(o.status==="dirty"&&r.dirty(),s(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ar(s))return s;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>ar(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:r.value,value:o})):s);G.assertNever(i)}}Ce.create=(t,e,r)=>new Ce({schema:t,typeName:I.ZodEffects,effect:e,...L(r)});Ce.createWithPreprocess=(t,e,r)=>new Ce({schema:e,effect:{type:"preprocess",transform:t},typeName:I.ZodEffects,...L(r)});class Je extends M{_parse(e){return this._getType(e)===A.undefined?_e(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Je.create=(t,e)=>new Je({innerType:t,typeName:I.ZodOptional,...L(e)});class Nt extends M{_parse(e){return this._getType(e)===A.null?_e(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nt.create=(t,e)=>new Nt({innerType:t,typeName:I.ZodNullable,...L(e)});class _r extends M{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===A.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}_r.create=(t,e)=>new _r({innerType:t,typeName:I.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class tn extends M{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return qr(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}tn.create=(t,e)=>new tn({innerType:t,typeName:I.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class rn extends M{_parse(e){if(this._getType(e)!==A.nan){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.nan,received:n.parsedType}),x}return{status:"valid",value:e.data}}}rn.create=t=>new rn({typeName:I.ZodNaN,...L(t)});const Eu=Symbol("zod_brand");class Qa extends M{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Tr extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?x:a.status==="dirty"?(r.dirty(),qa(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?x:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Tr({in:e,out:r,typeName:I.ZodPipeline})}}class nn extends M{_parse(e){const r=this._def.innerType._parse(e);return ar(r)&&(r.value=Object.freeze(r.value)),r}}nn.create=(t,e)=>new nn({innerType:t,typeName:I.ZodReadonly,...L(e)});const es=(t,e={},r)=>t?jt.create().superRefine((n,i)=>{var a,s;if(!t(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(s=(a=o.fatal)!==null&&a!==void 0?a:r)!==null&&s!==void 0?s:!0,u=typeof o=="string"?{message:o}:o;i.addIssue({code:"custom",...u,fatal:c})}}):jt.create(),Tu={object:ee.lazycreate};var I;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(I||(I={}));const Su=(t,e={message:`Input not instance of ${t.name}`})=>es(r=>r instanceof t,e),ts=be.create,rs=pt.create,Ou=rn.create,Au=ht.create,ns=sr.create,bu=bt.create,wu=Jr.create,Nu=or.create,Ru=ur.create,Iu=jt.create,Cu=Ot.create,Pu=et.create,xu=Qr.create,Lu=Ie.create,Mu=ee.create,Du=ee.strictCreate,ku=cr.create,Uu=_n.create,Bu=lr.create,ju=Ve.create,Vu=fr.create,$u=en.create,Gu=wt.create,Zu=kt.create,zu=dr.create,Fu=pr.create,Ku=_t.create,Hu=hr.create,Xu=Vt.create,pa=Ce.create,Yu=Je.create,Wu=Nt.create,qu=Ce.createWithPreprocess,Ju=Tr.create,Qu=()=>ts().optional(),ec=()=>rs().optional(),tc=()=>ns().optional(),rc={string:t=>be.create({...t,coerce:!0}),number:t=>pt.create({...t,coerce:!0}),boolean:t=>sr.create({...t,coerce:!0}),bigint:t=>ht.create({...t,coerce:!0}),date:t=>bt.create({...t,coerce:!0})},nc=x;var v=Object.freeze({__proto__:null,defaultErrorMap:ir,setErrorMap:ou,getErrorMap:Yr,makeIssue:Wr,EMPTY_PATH:uu,addIssueToContext:b,ParseStatus:le,INVALID:x,DIRTY:qa,OK:_e,isAborted:Qn,isDirty:ei,isValid:ar,isAsync:qr,get util(){return G},get objectUtil(){return Jn},ZodParsedType:A,getParsedType:st,ZodType:M,ZodString:be,ZodNumber:pt,ZodBigInt:ht,ZodBoolean:sr,ZodDate:bt,ZodSymbol:Jr,ZodUndefined:or,ZodNull:ur,ZodAny:jt,ZodUnknown:Ot,ZodNever:et,ZodVoid:Qr,ZodArray:Ie,ZodObject:ee,ZodUnion:cr,ZodDiscriminatedUnion:_n,ZodIntersection:lr,ZodTuple:Ve,ZodRecord:fr,ZodMap:en,ZodSet:wt,ZodFunction:kt,ZodLazy:dr,ZodLiteral:pr,ZodEnum:_t,ZodNativeEnum:hr,ZodPromise:Vt,ZodEffects:Ce,ZodTransformer:Ce,ZodOptional:Je,ZodNullable:Nt,ZodDefault:_r,ZodCatch:tn,ZodNaN:rn,BRAND:Eu,ZodBranded:Qa,ZodPipeline:Tr,ZodReadonly:nn,custom:es,Schema:M,ZodSchema:M,late:Tu,get ZodFirstPartyTypeKind(){return I},coerce:rc,any:Iu,array:Lu,bigint:Au,boolean:ns,date:bu,discriminatedUnion:Uu,effect:pa,enum:Ku,function:Zu,instanceof:Su,intersection:Bu,lazy:zu,literal:Fu,map:$u,nan:Ou,nativeEnum:Hu,never:Pu,null:Ru,nullable:Wu,number:rs,object:Mu,oboolean:tc,onumber:ec,optional:Yu,ostring:Qu,pipeline:Ju,preprocess:qu,promise:Xu,record:Vu,set:Gu,strictObject:Du,string:ts,symbol:wu,transformer:pa,tuple:ju,undefined:Nu,union:ku,unknown:Cu,void:xu,NEVER:nc,ZodIssueCode:g,quotelessJson:su,ZodError:Re});const Ai=v.tuple([v.number(),v.number()]),is=v.object({width:v.number(),height:v.number()}),ic=v.object({signedWidth:v.number(),signedHeight:v.number()}),ac=["width","height"];v.enum(ac);const sc=["start","center","end"],oc=["signedWidth","signedHeight"];v.enum(oc);const an=v.object({x:v.number(),y:v.number()}),uc=v.object({clientX:v.number(),clientY:v.number()}),cc=["x","y"],as=v.enum(cc),ss=["top","right","bottom","left"];v.enum(ss);const lc=["left","right"],fc=v.enum(lc),dc=["top","bottom"],pc=v.enum(dc),os=["center"];v.enum(os);const hc=[...ss,...os],sn=v.enum(hc);v.enum(sc);const _c=["first","last"];v.enum(_c);const vc=v.object({lower:v.number(),upper:v.number()});v.union([vc,Ai]);v.union([as,sn]);v.union([as,sn,v.instanceof(String)]);const Mn=(t,e)=>{const r={lower:0,upper:0};return typeof t=="number"?e!=null?(r.lower=t,r.upper=e):(r.lower=0,r.upper=t):Array.isArray(t)?[r.lower,r.upper]=t:(r.lower=t.lower,r.upper=t.upper),yc(r)},yc=t=>t.lower>t.upper?{lower:t.upper,upper:t.lower}:t;var Oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j={},vn={};Object.defineProperty(vn,"__esModule",{value:!0});function mc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"$"+n}).toLowerCase().replace(/(\$)(\w)/g,function(e,r,n){return n.toUpperCase()}):""}vn.default=mc;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});function gc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"_").toLowerCase():""}yn.default=gc;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});function Ec(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"$").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"$"+n}).toLowerCase().replace(/(\$)(\w?)/g,function(e,r,n){return n.toUpperCase()}):""}mn.default=Ec;var bi={};Object.defineProperty(bi,"__esModule",{value:!0});function Tc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,".").toLowerCase():""}bi.default=Tc;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});function Sc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"/").toLowerCase():""}wi.default=Sc;var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});function Oc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase():""}Ni.default=Oc;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});function Ac(t){if(t===void 0&&(t=""),!t)return"";var e=String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(r,n,i){return n+"_"+i.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase();return e.charAt(0).toUpperCase()+e.slice(1)}Ri.default=Ac;var Ii={};Object.defineProperty(Ii,"__esModule",{value:!0});function bc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase().replace(/( ?)(\w+)( ?)/g,function(e,r,n,i){return r+n.charAt(0).toUpperCase()+n.slice(1)+i}):""}Ii.default=bc;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});function wc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"-").toLowerCase():""}gn.default=wc;var Ci={},It={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.belongToTypes=t.isValidObject=t.isArrayObject=t.validateOptions=t.DefaultOption=void 0,t.DefaultOption={recursive:!1,recursiveInArray:!1,keepTypesOnRecursion:[]},t.validateOptions=function(e){return e===void 0&&(e=t.DefaultOption),e.recursive==null?e=t.DefaultOption:e.recursiveInArray==null&&(e.recursiveInArray=!1),e},t.isArrayObject=function(e){return e!=null&&Array.isArray(e)},t.isValidObject=function(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)},t.belongToTypes=function(e,r){return(r||[]).some(function(n){return e instanceof n})}})(It);var Nc=Oe&&Oe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Ci,"__esModule",{value:!0});var Ze=It;function Br(t,e){if(e===void 0&&(e=Ze.DefaultOption),!Ze.isValidObject(t))return null;e=Ze.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=n.toLowerCase();e.recursive&&(Ze.isValidObject(i)?Ze.belongToTypes(i,e.keepTypesOnRecursion)||(i=Br(i,e)):e.recursiveInArray&&Ze.isArrayObject(i)&&(i=Nc(i).map(function(s){var o=s;if(Ze.isValidObject(s))Ze.belongToTypes(o,e.keepTypesOnRecursion)||(o=Br(s,e));else if(Ze.isArrayObject(s)){var c=Br({key:s},e);o=c.key}return o}))),r[a]=i}),r}Ci.default=Br;var Pi={},Rc=Oe&&Oe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Pi,"__esModule",{value:!0});var ze=It;function jr(t,e){if(e===void 0&&(e=ze.DefaultOption),!ze.isValidObject(t))return null;e=ze.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=n.toUpperCase();e.recursive&&(ze.isValidObject(i)?ze.belongToTypes(i,e.keepTypesOnRecursion)||(i=jr(i,e)):e.recursiveInArray&&ze.isArrayObject(i)&&(i=Rc(i).map(function(s){var o=s;if(ze.isValidObject(s))ze.belongToTypes(o,e.keepTypesOnRecursion)||(o=jr(s,e));else if(ze.isArrayObject(s)){var c=jr({key:s},e);o=c.key}return o}))),r[a]=i}),r}Pi.default=jr;var xi={},Ic=Oe&&Oe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(xi,"__esModule",{value:!0});var Fe=It,Cc=vn;function Vr(t,e){if(e===void 0&&(e=Fe.DefaultOption),!Fe.isValidObject(t))return null;e=Fe.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=Cc.default(n);e.recursive&&(Fe.isValidObject(i)?Fe.belongToTypes(i,e.keepTypesOnRecursion)||(i=Vr(i,e)):e.recursiveInArray&&Fe.isArrayObject(i)&&(i=Ic(i).map(function(s){var o=s;if(Fe.isValidObject(s))Fe.belongToTypes(o,e.keepTypesOnRecursion)||(o=Vr(s,e));else if(Fe.isArrayObject(s)){var c=Vr({key:s},e);o=c.key}return o}))),r[a]=i}),r}xi.default=Vr;var Li={},Pc=Oe&&Oe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Li,"__esModule",{value:!0});var Ke=It,xc=yn;function $r(t,e){if(e===void 0&&(e=Ke.DefaultOption),!Ke.isValidObject(t))return null;e=Ke.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=xc.default(n);e.recursive&&(Ke.isValidObject(i)?Ke.belongToTypes(i,e.keepTypesOnRecursion)||(i=$r(i,e)):e.recursiveInArray&&Ke.isArrayObject(i)&&(i=Pc(i).map(function(s){var o=s;if(Ke.isValidObject(s))Ke.belongToTypes(o,e.keepTypesOnRecursion)||(o=$r(s,e));else if(Ke.isArrayObject(s)){var c=$r({key:s},e);o=c.key}return o}))),r[a]=i}),r}Li.default=$r;var Mi={},Lc=Oe&&Oe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Mi,"__esModule",{value:!0});var He=It,Mc=mn;function Gr(t,e){if(e===void 0&&(e=He.DefaultOption),!He.isValidObject(t))return null;e=He.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=Mc.default(n);e.recursive&&(He.isValidObject(i)?He.belongToTypes(i,e.keepTypesOnRecursion)||(i=Gr(i,e)):e.recursiveInArray&&He.isArrayObject(i)&&(i=Lc(i).map(function(s){var o=s;if(He.isValidObject(s))He.belongToTypes(o,e.keepTypesOnRecursion)||(o=Gr(s,e));else if(He.isArrayObject(s)){var c=Gr({key:s},e);o=c.key}return o}))),r[a]=i}),r}Mi.default=Gr;var Di={},Dc=Oe&&Oe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Di,"__esModule",{value:!0});var Xe=It,kc=gn;function Zr(t,e){if(e===void 0&&(e=Xe.DefaultOption),!Xe.isValidObject(t))return null;e=Xe.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=kc.default(n);e.recursive&&(Xe.isValidObject(i)?Xe.belongToTypes(i,e.keepTypesOnRecursion)||(i=Zr(i,e)):e.recursiveInArray&&Xe.isArrayObject(i)&&(i=Dc(i).map(function(s){var o=s;if(Xe.isValidObject(s))Xe.belongToTypes(o,e.keepTypesOnRecursion)||(o=Zr(s,e));else if(Xe.isArrayObject(s)){var c=Zr({key:s},e);o=c.key}return o}))),r[a]=i}),r}Di.default=Zr;Object.defineProperty(j,"__esModule",{value:!0});j.kebabKeys=j.pascalKeys=j.snakeKeys=j.camelKeys=j.upperKeys=j.lowerKeys=j.toLowerCase=j.toUpperCase=j.toKebabCase=j.toHeaderCase=j.toSentenceCase=j.toTextCase=j.toPathCase=j.toDotCase=j.toPascalCase=j.toSnakeCase=j.toCamelCase=void 0;var us=vn;j.toCamelCase=us.default;var cs=yn;j.toSnakeCase=cs.default;var ls=mn;j.toPascalCase=ls.default;var fs=bi;j.toDotCase=fs.default;var ds=wi;j.toPathCase=ds.default;var ps=Ni;j.toTextCase=ps.default;var hs=Ri;j.toSentenceCase=hs.default;var _s=Ii;j.toHeaderCase=_s.default;var vs=gn;j.toKebabCase=vs.default;var ys=Ci;j.lowerKeys=ys.default;var ms=Pi;j.upperKeys=ms.default;var gs=xi;j.camelKeys=gs.default;var Es=Li;j.snakeKeys=Es.default;var Ts=Mi;j.pascalKeys=Ts.default;var Ss=Di;j.kebabKeys=Ss.default;var Os=function(t){return String(t||"").toLowerCase()};j.toLowerCase=Os;var As=function(t){return String(t||"").toUpperCase()};j.toUpperCase=As;var Uc={toCamelCase:us.default,toSnakeCase:cs.default,toPascalCase:ls.default,toDotCase:fs.default,toPathCase:ds.default,toTextCase:ps.default,toSentenceCase:hs.default,toHeaderCase:_s.default,toKebabCase:vs.default,toUpperCase:As,toLowerCase:Os,lowerKeys:ys.default,upperKeys:ms.default,camelKeys:gs.default,snakeKeys:Es.default,pascalKeys:Ts.default,kebabKeys:Ss.default};j.default=Uc;var bs=j;const ws={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},Bc=t=>bs.snakeKeys(t,ws),jc=t=>bs.camelKeys(t,ws);var $t;(t=>{t.toSnake=Bc,t.toCamel=jc,t.capitalize=e=>e[0].toUpperCase()+e.slice(1)})($t||($t={}));v.object({x:sn,y:sn});const Vc=v.object({x:fc,y:pc}),$c={x:"left",y:"top"},Gc=(t,e)=>t.x===e.x&&t.y===e.y,ha=v.union([v.number(),an,Ai,is,ic,uc]),Zc=(t,e)=>typeof t=="number"?{x:t,y:e??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y},_a={x:0,y:0},Ir=v.union([v.number(),v.string()]);v.object({top:Ir,left:Ir,width:Ir,height:Ir});v.object({left:v.number(),top:v.number(),right:v.number(),bottom:v.number()});v.object({one:an,two:an,root:Vc});const ki=(t,e,r=0,n=0,i)=>{const a={one:{..._a},two:{..._a},root:i??$c};if(typeof t=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return a.one={x:t,y:e},a.two={x:a.one.x+r,y:a.one.y+n},a}return"one"in t&&"two"in t&&"root"in t?{...t,root:i??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(a.one={x:t.left,y:t.top},a.two={x:t.right,y:t.bottom},a):(a.one=t,e==null?a.two={x:a.one.x+r,y:a.one.y+n}:typeof e=="number"?a.two={x:a.one.x+e,y:a.one.y+r}:"width"in e?a.two={x:a.one.x+e.width,y:a.one.y+e.height}:"signedWidth"in e?a.two={x:a.one.x+e.signedWidth,y:a.one.y+e.signedHeight}:a.two=e,a))},Dn=t=>{const e=ki(t);return{lower:e.one.x,upper:e.two.x}},kn=t=>{const e=ki(t);return{lower:e.one.y,upper:e.two.y}},zc=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,Fc=v.object({signedWidth:v.number(),signedHeight:v.number()});v.union([is,Fc,an,Ai]);const Kc=(t,e,r)=>(e!=null&&(t=Math.max(t,e)),r!=null&&(t=Math.min(t,r)),t);v.object({offset:ha,scale:ha});const Hc=t=>(e,r,n,i)=>r==="dimension"?[e,n]:[e,i?n-t:n+t],Xc=t=>(e,r,n,i)=>[e,i?n/t:n*t],Yc=t=>(e,r,n)=>{if(e===null)return[t,n];const{lower:i,upper:a}=e,{lower:s,upper:o}=t,c=a-i,u=o-s;if(r==="dimension")return[t,n*(u/c)];const d=(n-i)*(u/c)+s;return[t,d]},Wc=t=>(e,r,n)=>[t,n],qc=()=>(t,e,r)=>{if(t===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[t,r];const{lower:n,upper:i}=t;return[t,i-(r-n)]},Jc=t=>(e,r,n)=>{const{lower:i,upper:a}=t;return n=Kc(n,i,a),[e,n]},ri=class qt{constructor(){T(this,"ops",[]),T(this,"currBounds",null),T(this,"currType",null),T(this,"reversed",!1),this.ops=[]}static translate(e){return new qt().translate(e)}static magnify(e){return new qt().magnify(e)}static scale(e,r){return new qt().scale(e,r)}translate(e){const r=this.new(),n=Hc(e);return n.type="translate",r.ops.push(n),r}magnify(e){const r=this.new(),n=Xc(e);return n.type="magnify",r.ops.push(n),r}scale(e,r){const n=Mn(e,r),i=this.new(),a=Yc(n);return a.type="scale",i.ops.push(a),i}clamp(e,r){const n=Mn(e,r),i=this.new(),a=Jc(n);return a.type="clamp",i.ops.push(a),i}reBound(e,r){const n=Mn(e,r),i=this.new(),a=Wc(n);return a.type="re-bound",i.ops.push(a),i}invert(){const e=qc();e.type="invert";const r=this.new();return r.ops.push(e),r}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new qt;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,r){return this.currBounds=null,this.ops.reduce(([n,i],a)=>a(n,e,i,this.reversed),[null,r])[1]}reverse(){const e=this.new();e.ops.reverse();const r=[];return e.ops.forEach((n,i)=>{if(n.type==="scale"||r.some(([s,o])=>i>=s&&i<=o))return;const a=e.ops.findIndex((s,o)=>s.type==="scale"&&o>i);a!==-1&&r.push([i,a])}),r.forEach(([n,i])=>{const a=e.ops.slice(n,i);a.unshift(e.ops[i]),e.ops.splice(n,i-n+1,...a)}),e.reversed=!e.reversed,e}};T(ri,"IDENTITY",new ri);let va=ri;const ya=class Ye{constructor(e=new va,r=new va,n=null){T(this,"x"),T(this,"y"),T(this,"currRoot"),this.x=e,this.y=r,this.currRoot=n}static translate(e,r){return new Ye().translate(e,r)}static translateX(e){return new Ye().translateX(e)}static translateY(e){return new Ye().translateY(e)}static clamp(e){return new Ye().clamp(e)}static magnify(e){return new Ye().magnify(e)}static scale(e){return new Ye().scale(e)}static reBound(e){return new Ye().reBound(e)}translate(e,r){const n=Zc(e,r),i=this.copy();return i.x=this.x.translate(n.x),i.y=this.y.translate(n.y),i}translateX(e){const r=this.copy();return r.x=this.x.translate(e),r}translateY(e){const r=this.copy();return r.y=this.y.translate(e),r}magnify(e){const r=this.copy();return r.x=this.x.magnify(e.x),r.y=this.y.magnify(e.y),r}scale(e){const r=this.copy();if(zc(e)){const n=this.currRoot;return r.currRoot=e.root,n!=null&&!Gc(n,e.root)&&(n.x!==e.root.x&&(r.x=r.x.invert()),n.y!==e.root.y&&(r.y=r.y.invert())),r.x=r.x.scale(Dn(e)),r.y=r.y.scale(kn(e)),r}return r.x=r.x.scale(e.width),r.y=r.y.scale(e.height),r}reBound(e){const r=this.copy();return r.x=this.x.reBound(Dn(e)),r.y=this.y.reBound(kn(e)),r}clamp(e){const r=this.copy();return r.x=this.x.clamp(Dn(e)),r.y=this.y.clamp(kn(e)),r}copy(){const e=new Ye;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}box(e){return ki(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}};T(ya,"IDENTITY",new ya);const Ns=(t,e)=>{const r=new ge(e);if(![pe.DAY,pe.HOUR,pe.MINUTE,pe.SECOND,pe.MILLISECOND,pe.MICROSECOND,pe.NANOSECOND].some(i=>i.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=t.valueOf()%r.valueOf();return t instanceof ge?new ge(n):new pe(n)},Y=class B extends Number{constructor(e,r="UTC"){if(e==null)return B.now();if(e instanceof Date)super(e.getTime()*B.MILLISECOND.valueOf());else if(typeof e=="string")super(B.parseDateTimeString(e,r).valueOf());else if(Array.isArray(e))super(B.parseDate(e));else{let n=0;e instanceof Number&&(e=e.valueOf()),r==="local"&&(n=B.utcOffset.valueOf()),super(e.valueOf()+n)}}static parseDate([e=1970,r=1,n=1]){const i=new Date(e,r-1,n,0,0,0,0);return new B(i.getTime()*B.MILLISECOND.valueOf()).truncate(B.DAY).valueOf()}static parseTimeString(e,r="UTC"){const[n,i,a]=e.split(":");let s="00",o="00";a!=null&&([s,o]=a.split("."));let c=B.hours(parseInt(n??"00",10)).add(B.minutes(parseInt(i??"00",10))).add(B.seconds(parseInt(s??"00",10))).add(B.milliseconds(parseInt(o??"00",10)));return r==="local"&&(c=c.add(B.utcOffset)),c.valueOf()}static parseDateTimeString(e,r="UTC"){if(!e.includes("/")&&!e.includes("-"))return B.parseTimeString(e,r);const n=new Date(e);return e.includes(":")||n.setUTCHours(0,0,0,0),new B(n.getTime()*B.MILLISECOND.valueOf(),r).valueOf()}fString(e="ISO",r="UTC"){switch(e){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString(r);case"preciseDate":return`${this.dateString(r)} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString(r)} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(B.utcOffset).date().toISOString()}timeString(e=!1,r="UTC"){const n=this.toISOString(r);return e?n.slice(11,23):n.slice(11,19)}dateString(e="UTC"){const r=this.date(),n=r.toLocaleString("default",{month:"short"}),i=r.toLocaleString("default",{day:"numeric"});return`${n} ${i}`}static get utcOffset(){return new pe(new Date().getTimezoneOffset()*B.MINUTE.valueOf())}static since(e){return new B().span(e)}date(){return new Date(this.milliseconds())}equals(e){return this.valueOf()===new B(e).valueOf()}span(e){return this.range(e).span}range(e){return new Qc(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===0}after(e){return this.valueOf()>new B(e).valueOf()}afterEq(e){return this.valueOf()>=new B(e).valueOf()}before(e){return this.valueOf()<new B(e).valueOf()}beforeEq(e){return this.valueOf()<=new B(e).valueOf()}add(e){return new B(this.valueOf()+e.valueOf())}sub(e){return new B(this.valueOf()-e.valueOf())}milliseconds(){return this.valueOf()/B.MILLISECOND.valueOf()}toString(){return this.date().toISOString()}remainder(e){return Ns(this,e)}get isToday(){return this.truncate(pe.DAY).equals(B.now().truncate(pe.DAY))}truncate(e){return this.sub(this.remainder(e))}static now(){return new B(new Date)}static nanoseconds(e){return new B(e)}static microseconds(e){return B.nanoseconds(e*1e3)}static milliseconds(e){return B.microseconds(e*1e3)}static seconds(e){return B.milliseconds(e*1e3)}static minutes(e){return B.seconds(e*60)}static hours(e){return B.minutes(e*60)}static days(e){return B.hours(e*24)}};T(Y,"NANOSECOND",Y.nanoseconds(1));T(Y,"MICROSECOND",Y.microseconds(1));T(Y,"MILLISECOND",Y.milliseconds(1));T(Y,"SECOND",Y.seconds(1));T(Y,"MINUTE",Y.minutes(1));T(Y,"HOUR",Y.hours(1));T(Y,"DAY",Y.days(1));T(Y,"MAX",new Y(9122272036554776e3));T(Y,"MIN",new Y(0));T(Y,"ZERO",new Y(0));T(Y,"z",v.union([v.instanceof(Number).transform(t=>new Y(t)),v.number().transform(t=>new Y(t)),v.instanceof(Y)]));let ge=Y;const X=class F extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}remainder(e){return Ns(this,e)}truncate(e){return new F(Math.trunc(this.valueOf()/e.valueOf())*e.valueOf())}multiply(e){return new F(this.valueOf()*e)}toString(){const e=this.truncate(F.DAY),r=this.truncate(F.HOUR),n=this.truncate(F.MINUTE),i=this.truncate(F.SECOND),a=this.truncate(F.MILLISECOND),s=this.truncate(F.MICROSECOND),o=this.truncate(F.NANOSECOND),c=e,u=r.sub(e),d=n.sub(r),y=i.sub(n),R=a.sub(i),k=s.sub(a),z=o.sub(s);let Z="";return c.isZero||(Z+=`${c.days}d `),u.isZero||(Z+=`${u.hours}h `),d.isZero||(Z+=`${d.minutes}m `),y.isZero||(Z+=`${y.seconds}s `),R.isZero||(Z+=`${R.milliseconds}ms `),k.isZero||(Z+=`${k.microseconds}µs `),z.isZero||(Z+=`${z.nanoseconds}ns`),Z.trim()}get days(){return this.valueOf()/F.DAY.valueOf()}get hours(){return this.valueOf()/F.HOUR.valueOf()}get minutes(){return this.valueOf()/F.MINUTE.valueOf()}get seconds(){return this.valueOf()/F.SECOND.valueOf()}get milliseconds(){return this.valueOf()/F.MILLISECOND.valueOf()}get microseconds(){return this.valueOf()/F.MICROSECOND.valueOf()}get nanoseconds(){return this.valueOf()}get isZero(){return this.valueOf()===0}equals(e){return this.valueOf()===new F(e).valueOf()}add(e){return new F(this.valueOf()+new F(e).valueOf())}sub(e){return new F(this.valueOf()-new F(e).valueOf())}static nanoseconds(e=1){return new F(e)}static microseconds(e=1){return F.nanoseconds(e*1e3)}static milliseconds(e=1){return F.microseconds(e*1e3)}static seconds(e=1){return F.milliseconds(e*1e3)}static minutes(e){return F.seconds(e.valueOf()*60)}static hours(e){return F.minutes(e*60)}static days(e){return F.hours(e*24)}};T(X,"NANOSECOND",X.nanoseconds(1));T(X,"MICROSECOND",X.microseconds(1));T(X,"MILLISECOND",X.milliseconds(1));T(X,"SECOND",X.seconds(1));T(X,"MINUTE",X.minutes(1));T(X,"HOUR",X.hours(1));T(X,"DAY",X.days(1));T(X,"MAX",new X(X.MAX_SAFE_INTEGER));T(X,"MIN",new X(-X.MAX_SAFE_INTEGER));T(X,"ZERO",new X(0));T(X,"z",v.union([v.instanceof(Number).transform(t=>new X(t)),v.number().transform(t=>new X(t)),v.instanceof(X)]));let pe=X;const Cr=class zr extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new zr(e).valueOf()}get period(){return pe.seconds(1/this.valueOf())}sampleCount(e){return new pe(e).seconds*this.valueOf()}byteCount(e,r){return this.sampleCount(e)*new de(r).valueOf()}span(e){return pe.seconds(e/this.valueOf())}byteSpan(e,r){return this.span(e.valueOf()/r.valueOf())}static hz(e){return new zr(e)}static khz(e){return zr.hz(e*1e3)}};T(Cr,"z",v.union([v.number().transform(t=>new Cr(t)),v.instanceof(Number).transform(t=>new Cr(t)),v.instanceof(Cr)]));const oe=class extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}length(e){return e.valueOf()/this.valueOf()}size(e){return new el(e*this.valueOf())}};T(oe,"UNKNOWN",new oe(0));T(oe,"BIT128",new oe(16));T(oe,"BIT64",new oe(8));T(oe,"BIT32",new oe(4));T(oe,"BIT16",new oe(2));T(oe,"BIT8",new oe(1));T(oe,"z",v.union([v.number().transform(t=>new oe(t)),v.instanceof(Number).transform(t=>new oe(t)),v.instanceof(oe)]));let de=oe;const Ue=class Fr{constructor(e,r){T(this,"start"),T(this,"end"),this.start=new ge(e),this.end=new ge(r)}get span(){return new pe(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}swap(){return new Fr(this.end,this.start)}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e){e=e.makeValid();const r=this.makeValid();return e.start.equals(r.start)?!0:e.end.equals(this.start)||e.start.equals(this.end)?!1:this.contains(e.end)||this.contains(e.start)||e.contains(this.start)||e.contains(this.end)}contains(e){return e instanceof Fr?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const r=new Fr(this.start,this.end);return e.start.after(this.start)&&(r.start=e.start),e.start.after(this.end)&&(r.end=e.start),e.end.before(this.end)&&(r.end=e.end),e.end.before(this.start)&&(r.start=e.end),r}};T(Ue,"MAX",new Ue(ge.MIN,ge.MAX));T(Ue,"MIN",new Ue(ge.MAX,ge.MIN));T(Ue,"ZERO",new Ue(ge.ZERO,ge.ZERO));T(Ue,"z",v.union([v.object({start:ge.z,end:ge.z}).transform(t=>new Ue(t.start,t.end)),v.instanceof(Ue)]));let Qc=Ue;const _=class gt extends String{constructor(e){if(e instanceof gt||typeof e=="string"||typeof e.valueOf()=="string"){super(e.valueOf());return}else{const r=gt.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(r!=null){super(r.valueOf());return}}throw super(gt.UNKNOWN.valueOf()),new Error(`unable to find data type for ${e.toString()}`)}get Array(){const e=gt.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}toString(){return this.valueOf()}get density(){const e=gt.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}checkArray(e){return e.constructor===this.Array}toJSON(){return this.toString()}get usesBigInt(){return gt.BIG_INT_TYPES.some(e=>e.equals(this))}};T(_,"UNKNOWN",new _("unknown"));T(_,"FLOAT64",new _("float64"));T(_,"FLOAT32",new _("float32"));T(_,"INT64",new _("int64"));T(_,"INT32",new _("int32"));T(_,"INT16",new _("int16"));T(_,"INT8",new _("int8"));T(_,"UINT64",new _("uint64"));T(_,"UINT32",new _("uint32"));T(_,"UINT16",new _("uint16"));T(_,"UINT8",new _("uint8"));T(_,"TIMESTAMP",new _("timestamp"));T(_,"UUID",new _("uuid"));T(_,"STRING",new _("string"));T(_,"JSON",new _("json"));T(_,"ARRAY_CONSTRUCTORS",new Map([[_.UINT8.toString(),Uint8Array],[_.UINT16.toString(),Uint16Array],[_.UINT32.toString(),Uint32Array],[_.UINT64.toString(),BigUint64Array],[_.FLOAT32.toString(),Float32Array],[_.FLOAT64.toString(),Float64Array],[_.INT8.toString(),Int8Array],[_.INT16.toString(),Int16Array],[_.INT32.toString(),Int32Array],[_.INT64.toString(),BigInt64Array],[_.TIMESTAMP.toString(),BigInt64Array],[_.STRING.toString(),Uint8Array],[_.JSON.toString(),Uint8Array],[_.UUID.toString(),Uint8Array]]));T(_,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,_.UINT8],[Uint16Array.name,_.UINT16],[Uint32Array.name,_.UINT32],[BigUint64Array.name,_.UINT64],[Float32Array.name,_.FLOAT32],[Float64Array.name,_.FLOAT64],[Int8Array.name,_.INT8],[Int16Array.name,_.INT16],[Int32Array.name,_.INT32],[BigInt64Array.name,_.INT64]]));T(_,"DENSITIES",new Map([[_.UINT8.toString(),de.BIT8],[_.UINT16.toString(),de.BIT16],[_.UINT32.toString(),de.BIT32],[_.UINT64.toString(),de.BIT64],[_.FLOAT32.toString(),de.BIT32],[_.FLOAT64.toString(),de.BIT64],[_.INT8.toString(),de.BIT8],[_.INT16.toString(),de.BIT16],[_.INT32.toString(),de.BIT32],[_.INT64.toString(),de.BIT64],[_.TIMESTAMP.toString(),de.BIT64],[_.STRING.toString(),de.UNKNOWN],[_.JSON.toString(),de.UNKNOWN],[_.UUID.toString(),de.BIT128]]));T(_,"ALL",[_.UNKNOWN,_.FLOAT64,_.FLOAT32,_.INT64,_.INT32,_.INT16,_.INT8,_.UINT64,_.UINT32,_.UINT16,_.UINT8,_.TIMESTAMP,_.UUID,_.STRING,_.JSON]);T(_,"BIG_INT_TYPES",[_.INT64,_.UINT64,_.TIMESTAMP]);T(_,"z",v.union([v.string().transform(t=>new _(t)),v.instanceof(_)]));const ce=class it extends Number{constructor(e){super(e.valueOf())}largerThan(e){return this.valueOf()>e.valueOf()}smallerThan(e){return this.valueOf()<e.valueOf()}add(e){return it.bytes(this.valueOf()+e.valueOf())}sub(e){return it.bytes(this.valueOf()-e.valueOf())}static bytes(e=1){return new it(e)}static kilobytes(e=1){return it.bytes(e.valueOf()*1e3)}static megabytes(e=1){return it.kilobytes(e.valueOf()*1e3)}static gigabytes(e=1){return it.megabytes(e.valueOf()*1e3)}static terabytes(e){return it.gigabytes(e.valueOf()*1e3)}isZero(){return this.valueOf()===0}};T(ce,"BYTE",new ce(1));T(ce,"KILOBYTE",ce.kilobytes(1));T(ce,"MEGABYTE",ce.megabytes(1));T(ce,"GIGABYTE",ce.gigabytes(1));T(ce,"TERABYTE",ce.terabytes(1));T(ce,"ZERO",new ce(0));T(ce,"z",v.union([v.number().transform(t=>new ce(t)),v.instanceof(ce)]));let el=ce;v.union([v.instanceof(Uint8Array),v.instanceof(Uint16Array),v.instanceof(Uint32Array),v.instanceof(BigUint64Array),v.instanceof(Float32Array),v.instanceof(Float64Array),v.instanceof(Int8Array),v.instanceof(Int16Array),v.instanceof(Int32Array),v.instanceof(BigInt64Array)]);v.record(v.union([v.number(),v.string(),v.symbol()]),v.unknown());const Rs=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",tl=Rs(),Is=["MacOS","Windows","Linux","Docker"],rl=v.enum(Is);let Pr;const nl=()=>{if(typeof window>"u")return;const t=window.navigator.userAgent.toLowerCase();if(t.includes("mac"))return"MacOS";if(t.includes("win"))return"Windows";if(t.includes("linux"))return"Linux"},il=(t={})=>{const{force:e,default:r}=t;return e??Pr??(Pr=nl(),Pr??r)},al=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:Is,RUNTIME:tl,detect:Rs,getOS:il,osZ:rl},Symbol.toStringTag,{value:"Module"})),sl=(...t)=>t.map(Cs).join(""),Cs=t=>(t.endsWith("/")||(t+="/"),t.startsWith("/")&&(t=t.slice(1)),t),ol=t=>t.endsWith("/")?t.slice(0,-1):t;Pt=class{constructor({host:t,port:e,protocol:r="",pathPrefix:n=""}){T(this,"protocol"),T(this,"host"),T(this,"port"),T(this,"path"),this.protocol=r,this.host=t,this.port=e,this.path=Cs(n)}replace(t){return new Pt({host:t.host??this.host,port:t.port??this.port,protocol:t.protocol??this.protocol,pathPrefix:t.pathPrefix??this.path})}child(t){return new Pt({...this,pathPrefix:sl(this.path,t)})}toString(){return ol(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}},T(Pt,"UNKNOWN",new Pt({host:"unknown",port:0}));var ni;try{ni=new TextDecoder}catch{}var S,Se,l=0,q={},$,ot,Te=0,De=0,se,Qe,ve=[],V,ma={useRecords:!1,mapsAsObjects:!0};class Ps{}const xs=new Ps;xs.name="MessagePack 0xC1";var lt=!1,Ls=2,ga;try{new Function("")}catch{Ls=1/0}class vr{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.sequential&&e.trusted!==!1&&(e.trusted=!0,!e.structures&&e.useRecords!=!1&&(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,r){if(S)return Bs(()=>(ai(),this?this.unpack(e,r):vr.prototype.unpack.call(ma,e,r)));!e.buffer&&e.constructor===ArrayBuffer&&(e=typeof Buffer<"u"?Buffer.from(e):new Uint8Array(e)),typeof r=="object"?(Se=r.end||e.length,l=r.start||0):(l=0,Se=r>-1?r:e.length),De=0,ot=null,se=null,S=e;try{V=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){throw S=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof vr){if(q=this,this.structures)return $=this.structures,xr(r);(!$||$.length>0)&&($=[])}else q=ma,(!$||$.length>0)&&($=[]);return xr(r)}unpackMultiple(e,r){let n,i=0;try{lt=!0;let a=e.length,s=this?this.unpack(e,a):En.unpack(e,a);if(r){if(r(s,i,l)===!1)return;for(;l<a;)if(i=l,r(xr(),i,l)===!1)return}else{for(n=[s];l<a;)i=l,n.push(xr());return n}}catch(a){throw a.lastPosition=i,a.values=n,a}finally{lt=!1,ai()}}_mergeStructures(e,r){e=e||[],Object.isFrozen(e)&&(e=e.map(n=>n.slice(0)));for(let n=0,i=e.length;n<i;n++){let a=e[n];a&&(a.isShared=!0,n>=32&&(a.highByte=n-32>>5))}e.sharedLength=e.length;for(let n in r||[])if(n>=0){let i=e[n],a=r[n];a&&(i&&((e.restoreStructures||(e.restoreStructures=[]))[n]=i),e[n]=a)}return this.structures=e}decode(e,r){return this.unpack(e,r)}}function xr(t){try{if(!q.trusted&&!lt){let r=$.sharedLength||0;r<$.length&&($.length=r)}let e;if(q.randomAccessStructure&&S[l]<64&&S[l]>=32&&ga?(e=ga(S,l,Se,q),S=null,!(t&&t.lazy)&&e&&(e=e.toJSON()),l=Se):e=ie(),se&&(l=se.postBundlePosition,se=null),lt&&($.restoreStructures=null),l==Se)$&&$.restoreStructures&&Ea(),$=null,S=null,Qe&&(Qe=null);else{if(l>Se)throw new Error("Unexpected end of MessagePack data");if(!lt){let r;try{r=JSON.stringify(e,(n,i)=>typeof i=="bigint"?`${i}n`:i).slice(0,100)}catch(n){r="(JSON view not available "+n+")"}throw new Error("Data read, but end of buffer not reached "+r)}}return e}catch(e){throw $&&$.restoreStructures&&Ea(),ai(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||l>Se)&&(e.incomplete=!0),e}}function Ea(){for(let t in $.restoreStructures)$[t]=$.restoreStructures[t];$.restoreStructures=null}function ie(){let t=S[l++];if(t<160)if(t<128){if(t<64)return t;{let e=$[t&63]||q.getStructures&&Ms()[t&63];return e?(e.read||(e.read=Ui(e,t&63)),e.read()):t}}else if(t<144)if(t-=128,q.mapsAsObjects){let e={};for(let r=0;r<t;r++){let n=ks();n==="__proto__"&&(n="__proto_"),e[n]=ie()}return e}else{let e=new Map;for(let r=0;r<t;r++)e.set(ie(),ie());return e}else{t-=144;let e=new Array(t);for(let r=0;r<t;r++)e[r]=ie();return q.freezeData?Object.freeze(e):e}else if(t<192){let e=t-160;if(De>=l)return ot.slice(l-Te,(l+=e)-Te);if(De==0&&Se<140){let r=e<16?Bi(e):Ds(e);if(r!=null)return r}return ii(e)}else{let e;switch(t){case 192:return null;case 193:return se?(e=ie(),e>0?se[1].slice(se.position1,se.position1+=e):se[0].slice(se.position0,se.position0-=e)):xs;case 194:return!1;case 195:return!0;case 196:if(e=S[l++],e===void 0)throw new Error("Unexpected end of buffer");return Un(e);case 197:return e=V.getUint16(l),l+=2,Un(e);case 198:return e=V.getUint32(l),l+=4,Un(e);case 199:return mt(S[l++]);case 200:return e=V.getUint16(l),l+=2,mt(e);case 201:return e=V.getUint32(l),l+=4,mt(e);case 202:if(e=V.getFloat32(l),q.useFloat32>2){let r=ji[(S[l]&127)<<1|S[l+1]>>7];return l+=4,(r*e+(e>0?.5:-.5)>>0)/r}return l+=4,e;case 203:return e=V.getFloat64(l),l+=8,e;case 204:return S[l++];case 205:return e=V.getUint16(l),l+=2,e;case 206:return e=V.getUint32(l),l+=4,e;case 207:return q.int64AsType==="number"?(e=V.getUint32(l)*4294967296,e+=V.getUint32(l+4)):q.int64AsType==="string"?e=V.getBigUint64(l).toString():q.int64AsType==="auto"?(e=V.getBigUint64(l),e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=V.getBigUint64(l),l+=8,e;case 208:return V.getInt8(l++);case 209:return e=V.getInt16(l),l+=2,e;case 210:return e=V.getInt32(l),l+=4,e;case 211:return q.int64AsType==="number"?(e=V.getInt32(l)*4294967296,e+=V.getUint32(l+4)):q.int64AsType==="string"?e=V.getBigInt64(l).toString():q.int64AsType==="auto"?(e=V.getBigInt64(l),e>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=V.getBigInt64(l),l+=8,e;case 212:if(e=S[l++],e==114)return wa(S[l++]&63);{let r=ve[e];if(r)return r.read?(l++,r.read(ie())):r.noBuffer?(l++,r()):r(S.subarray(l,++l));throw new Error("Unknown extension "+e)}case 213:return e=S[l],e==114?(l++,wa(S[l++]&63,S[l++])):mt(2);case 214:return mt(4);case 215:return mt(8);case 216:return mt(16);case 217:return e=S[l++],De>=l?ot.slice(l-Te,(l+=e)-Te):cl(e);case 218:return e=V.getUint16(l),l+=2,De>=l?ot.slice(l-Te,(l+=e)-Te):ll(e);case 219:return e=V.getUint32(l),l+=4,De>=l?ot.slice(l-Te,(l+=e)-Te):fl(e);case 220:return e=V.getUint16(l),l+=2,Sa(e);case 221:return e=V.getUint32(l),l+=4,Sa(e);case 222:return e=V.getUint16(l),l+=2,Oa(e);case 223:return e=V.getUint32(l),l+=4,Oa(e);default:if(t>=224)return t-256;if(t===void 0){let r=new Error("Unexpected end of MessagePack data");throw r.incomplete=!0,r}throw new Error("Unknown MessagePack token "+t)}}}const ul=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function Ui(t,e){function r(){if(r.count++>Ls){let i=t.read=new Function("r","return function(){return "+(q.freezeData?"Object.freeze":"")+"({"+t.map(a=>a==="__proto__"?"__proto_:r()":ul.test(a)?a+":r()":"["+JSON.stringify(a)+"]:r()").join(",")+"})}")(ie);return t.highByte===0&&(t.read=Ta(e,t.read)),i()}let n={};for(let i=0,a=t.length;i<a;i++){let s=t[i];s==="__proto__"&&(s="__proto_"),n[s]=ie()}return q.freezeData?Object.freeze(n):n}return r.count=0,t.highByte===0?Ta(e,r):r}const Ta=(t,e)=>function(){let r=S[l++];if(r===0)return e();let n=t<32?-(t+(r<<5)):t+(r<<5),i=$[n]||Ms()[n];if(!i)throw new Error("Record id is not defined for "+n);return i.read||(i.read=Ui(i,t)),i.read()};function Ms(){let t=Bs(()=>(S=null,q.getStructures()));return $=q._mergeStructures(t,$)}var ii=Sr,cl=Sr,ll=Sr,fl=Sr;function Sr(t){let e;if(t<16&&(e=Bi(t)))return e;if(t>64&&ni)return ni.decode(S.subarray(l,l+=t));const r=l+t,n=[];for(e="";l<r;){const i=S[l++];if(!(i&128))n.push(i);else if((i&224)===192){const a=S[l++]&63;n.push((i&31)<<6|a)}else if((i&240)===224){const a=S[l++]&63,s=S[l++]&63;n.push((i&31)<<12|a<<6|s)}else if((i&248)===240){const a=S[l++]&63,s=S[l++]&63,o=S[l++]&63;let c=(i&7)<<18|a<<12|s<<6|o;c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c)}else n.push(i);n.length>=4096&&(e+=ae.apply(String,n),n.length=0)}return n.length>0&&(e+=ae.apply(String,n)),e}function Sa(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=ie();return q.freezeData?Object.freeze(e):e}function Oa(t){if(q.mapsAsObjects){let e={};for(let r=0;r<t;r++){let n=ks();n==="__proto__"&&(n="__proto_"),e[n]=ie()}return e}else{let e=new Map;for(let r=0;r<t;r++)e.set(ie(),ie());return e}}var ae=String.fromCharCode;function Ds(t){let e=l,r=new Array(t);for(let n=0;n<t;n++){const i=S[l++];if((i&128)>0){l=e;return}r[n]=i}return ae.apply(String,r)}function Bi(t){if(t<4)if(t<2){if(t===0)return"";{let e=S[l++];if((e&128)>1){l-=1;return}return ae(e)}}else{let e=S[l++],r=S[l++];if((e&128)>0||(r&128)>0){l-=2;return}if(t<3)return ae(e,r);let n=S[l++];if((n&128)>0){l-=3;return}return ae(e,r,n)}else{let e=S[l++],r=S[l++],n=S[l++],i=S[l++];if((e&128)>0||(r&128)>0||(n&128)>0||(i&128)>0){l-=4;return}if(t<6){if(t===4)return ae(e,r,n,i);{let a=S[l++];if((a&128)>0){l-=5;return}return ae(e,r,n,i,a)}}else if(t<8){let a=S[l++],s=S[l++];if((a&128)>0||(s&128)>0){l-=6;return}if(t<7)return ae(e,r,n,i,a,s);let o=S[l++];if((o&128)>0){l-=7;return}return ae(e,r,n,i,a,s,o)}else{let a=S[l++],s=S[l++],o=S[l++],c=S[l++];if((a&128)>0||(s&128)>0||(o&128)>0||(c&128)>0){l-=8;return}if(t<10){if(t===8)return ae(e,r,n,i,a,s,o,c);{let u=S[l++];if((u&128)>0){l-=9;return}return ae(e,r,n,i,a,s,o,c,u)}}else if(t<12){let u=S[l++],d=S[l++];if((u&128)>0||(d&128)>0){l-=10;return}if(t<11)return ae(e,r,n,i,a,s,o,c,u,d);let y=S[l++];if((y&128)>0){l-=11;return}return ae(e,r,n,i,a,s,o,c,u,d,y)}else{let u=S[l++],d=S[l++],y=S[l++],R=S[l++];if((u&128)>0||(d&128)>0||(y&128)>0||(R&128)>0){l-=12;return}if(t<14){if(t===12)return ae(e,r,n,i,a,s,o,c,u,d,y,R);{let k=S[l++];if((k&128)>0){l-=13;return}return ae(e,r,n,i,a,s,o,c,u,d,y,R,k)}}else{let k=S[l++],z=S[l++];if((k&128)>0||(z&128)>0){l-=14;return}if(t<15)return ae(e,r,n,i,a,s,o,c,u,d,y,R,k,z);let Z=S[l++];if((Z&128)>0){l-=15;return}return ae(e,r,n,i,a,s,o,c,u,d,y,R,k,z,Z)}}}}}function Aa(){let t=S[l++],e;if(t<192)e=t-160;else switch(t){case 217:e=S[l++];break;case 218:e=V.getUint16(l),l+=2;break;case 219:e=V.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return Sr(e)}function Un(t){return q.copyBuffers?Uint8Array.prototype.slice.call(S,l,l+=t):S.subarray(l,l+=t)}function mt(t){let e=S[l++];if(ve[e]){let r;return ve[e](S.subarray(l,r=l+=t),n=>{l=n;try{return ie()}finally{l=r}})}else throw new Error("Unknown extension type "+e)}var ba=new Array(4096);function ks(){let t=S[l++];if(t>=160&&t<192){if(t=t-160,De>=l)return ot.slice(l-Te,(l+=t)-Te);if(!(De==0&&Se<180))return ii(t)}else return l--,ie().toString();let e=(t<<5^(t>1?V.getUint16(l):t>0?S[l]:0))&4095,r=ba[e],n=l,i=l+t-3,a,s=0;if(r&&r.bytes==t){for(;n<i;){if(a=V.getUint32(n),a!=r[s++]){n=1879048192;break}n+=4}for(i+=3;n<i;)if(a=S[n++],a!=r[s++]){n=1879048192;break}if(n===i)return l=n,r.string;i-=3,n=l}for(r=[],ba[e]=r,r.bytes=t;n<i;)a=V.getUint32(n),r.push(a),n+=4;for(i+=3;n<i;)a=S[n++],r.push(a);let o=t<16?Bi(t):Ds(t);return o!=null?r.string=o:r.string=ii(t)}const wa=(t,e)=>{let r=ie().map(a=>a.toString()),n=t;e!==void 0&&(t=t<32?-((e<<5)+t):(e<<5)+t,r.highByte=e);let i=$[t];return i&&(i.isShared||lt)&&(($.restoreStructures||($.restoreStructures=[]))[t]=i),$[t]=r,r.read=Ui(r,n),r.read()};ve[0]=()=>{};ve[0].noBuffer=!0;let dl={Error,TypeError,ReferenceError};ve[101]=()=>{let t=ie();return(dl[t[0]]||Error)(t[1])};ve[105]=t=>{let e=V.getUint32(l-4);Qe||(Qe=new Map);let r=S[l],n;r>=144&&r<160||r==220||r==221?n=[]:n={};let i={target:n};Qe.set(e,i);let a=ie();return i.used?Object.assign(n,a):(i.target=a,a)};ve[112]=t=>{let e=V.getUint32(l-4),r=Qe.get(e);return r.used=!0,r.target};ve[115]=()=>new Set(ie());const Us=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(t=>t+"Array");let pl=typeof globalThis=="object"?globalThis:window;ve[116]=t=>{let e=t[0],r=Us[e];if(!r)throw new Error("Could not find typed array for code "+e);return new pl[r](Uint8Array.prototype.slice.call(t,1).buffer)};ve[120]=()=>{let t=ie();return new RegExp(t[0],t[1])};const hl=[];ve[98]=t=>{let e=(t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3],r=l;return l+=e-t.length,se=hl,se=[Aa(),Aa()],se.position0=0,se.position1=0,se.postBundlePosition=l,l=r,ie()};ve[255]=t=>t.length==4?new Date((t[0]*16777216+(t[1]<<16)+(t[2]<<8)+t[3])*1e3):t.length==8?new Date(((t[0]<<22)+(t[1]<<14)+(t[2]<<6)+(t[3]>>2))/1e6+((t[3]&3)*4294967296+t[4]*16777216+(t[5]<<16)+(t[6]<<8)+t[7])*1e3):t.length==12?new Date(((t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3])/1e6+((t[4]&128?-281474976710656:0)+t[6]*1099511627776+t[7]*4294967296+t[8]*16777216+(t[9]<<16)+(t[10]<<8)+t[11])*1e3):new Date("invalid");function Bs(t){let e=Se,r=l,n=Te,i=De,a=ot,s=Qe,o=se,c=new Uint8Array(S.slice(0,Se)),u=$,d=$.slice(0,$.length),y=q,R=lt,k=t();return Se=e,l=r,Te=n,De=i,ot=a,Qe=s,se=o,S=c,lt=R,$=u,$.splice(0,$.length,...d),q=y,V=new DataView(S.buffer,S.byteOffset,S.byteLength),k}function ai(){S=null,Qe=null,$=null}function _l(t){t.unpack?ve[t.type]=t.unpack:ve[t.type]=t}const ji=new Array(147);for(let t=0;t<256;t++)ji[t]=+("1e"+Math.floor(45.15-t*.30103));var En=new vr({useRecords:!1});const vl=En.unpack;En.unpackMultiple;En.unpack;let yl=new Float32Array(1);new Uint8Array(yl.buffer,0,4);let Kr;try{Kr=new TextEncoder}catch{}let on,Vi;const Tn=typeof Buffer<"u",Lr=Tn?function(t){return Buffer.allocUnsafeSlow(t)}:Uint8Array,js=Tn?Buffer:Uint8Array,Na=Tn?4294967296:2144337920;let p,Ht,H,f=0,fe,J=null,ml;const gl=21760,El=/[\u0080-\uFFFF]/,xt=Symbol("record-id");class Tl extends vr{constructor(e){super(e),this.offset=0;let r,n,i,a,s=js.prototype.utf8Write?function(h,w){return p.utf8Write(h,w,4294967295)}:Kr&&Kr.encodeInto?function(h,w){return Kr.encodeInto(h,p.subarray(w)).written}:!1,o=this;e||(e={});let c=e&&e.sequential,u=e.structures||e.saveStructures,d=e.maxSharedStructures;if(d==null&&(d=u?32:0),d>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&e.moreTypes==null&&(this.moreTypes=!0);let y=e.maxOwnStructures;y==null&&(y=u?32:64),!this.structures&&e.useRecords!=!1&&(this.structures=[]);let R=d>32||y+d>64,k=d+64,z=d+y+64;if(z>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let Z=[],xe=0,me=0;this.pack=this.encode=function(h,w){if(p||(p=new Lr(8192),H=p.dataView||(p.dataView=new DataView(p.buffer,0,8192)),f=0),fe=p.length-10,fe-f<2048?(p=new Lr(p.length),H=p.dataView||(p.dataView=new DataView(p.buffer,0,p.length)),fe=p.length-10,f=0):f=f+7&2147483640,r=f,w&Il&&(f+=w&255),a=o.structuredClone?new Map:null,o.bundleStrings&&typeof h!="string"?(J=[],J.size=1/0):J=null,i=o.structures,i){i.uninitialized&&(i=o._mergeStructures(o.getStructures()));let m=i.sharedLength||0;if(m>d)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+i.sharedLength);if(!i.transitions){i.transitions=Object.create(null);for(let E=0;E<m;E++){let O=i[E];if(!O)continue;let D,U=i.transitions;for(let P=0,ne=O.length;P<ne;P++){let K=O[P];D=U[K],D||(D=U[K]=Object.create(null)),U=D}U[xt]=E+64}this.lastNamedStructuresLength=m}c||(i.nextId=m+64)}n&&(n=!1);try{o.randomAccessStructure&&h&&h.constructor&&h.constructor===Object?$o(h):W(h);let m=J;if(J&&Ca(r,W,0),a&&a.idsToInsert){let E=a.idsToInsert.sort((P,ne)=>P.offset>ne.offset?1:-1),O=E.length,D=-1;for(;m&&O>0;){let P=E[--O].offset+r;P<m.stringsPosition+r&&D===-1&&(D=0),P>m.position+r?D>=0&&(D+=6):(D>=0&&(H.setUint32(m.position+r,H.getUint32(m.position+r)+D),D=-1),m=m.previous,O++)}D>=0&&m&&H.setUint32(m.position+r,H.getUint32(m.position+r)+D),f+=E.length*6,f>fe&&rt(f),o.offset=f;let U=Ol(p.subarray(r,f),E);return a=null,U}return o.offset=f,w&Nl?(p.start=r,p.end=f,p):p.subarray(r,f)}finally{if(i&&(Ct(),n&&o.saveStructures)){let m=i.sharedLength||0,E=p.subarray(r,f),O=bl(i,o);return o.saveStructures(O,O.isCompatible)===!1?o.pack(h,w):(o.lastNamedStructuresLength=m,E)}w&Rl&&(f=r)}};const Ct=()=>{me<10&&me++;let h=i.sharedLength||0;if(i.length>h&&!c&&(i.length=h),xe>1e4)i.transitions=null,me=0,xe=0,Z.length>0&&(Z=[]);else if(Z.length>0&&!c){for(let w=0,m=Z.length;w<m;w++)Z[w][xt]=0;Z=[]}},tt=h=>{var w=h.length;w<16?p[f++]=144|w:w<65536?(p[f++]=220,p[f++]=w>>8,p[f++]=w&255):(p[f++]=221,H.setUint32(f,w),f+=4);for(let m=0;m<w;m++)W(h[m])},W=h=>{f>fe&&(p=rt(f));var w=typeof h,m;if(w==="string"){let E=h.length;if(J&&E>=4&&E<4096){if((J.size+=E)>gl){let P,ne=(J[0]?J[0].length*3+J[1].length:0)+10;f+ne>fe&&(p=rt(f+ne));let K;J.position?(K=J,p[f]=200,f+=3,p[f++]=98,P=f-r,f+=4,Ca(r,W,0),H.setUint16(P+r-3,f-r-P)):(p[f++]=214,p[f++]=98,P=f-r,f+=4),J=["",""],J.previous=K,J.size=0,J.position=P}let U=El.test(h);J[U?0:1]+=h,p[f++]=193,W(U?-E:E);return}let O;E<32?O=1:E<256?O=2:E<65536?O=3:O=5;let D=E*3;if(f+D>fe&&(p=rt(f+D)),E<64||!s){let U,P,ne,K=f+O;for(U=0;U<E;U++)P=h.charCodeAt(U),P<128?p[K++]=P:P<2048?(p[K++]=P>>6|192,p[K++]=P&63|128):(P&64512)===55296&&((ne=h.charCodeAt(U+1))&64512)===56320?(P=65536+((P&1023)<<10)+(ne&1023),U++,p[K++]=P>>18|240,p[K++]=P>>12&63|128,p[K++]=P>>6&63|128,p[K++]=P&63|128):(p[K++]=P>>12|224,p[K++]=P>>6&63|128,p[K++]=P&63|128);m=K-f-O}else m=s(h,f+O);m<32?p[f++]=160|m:m<256?(O<2&&p.copyWithin(f+2,f+1,f+1+m),p[f++]=217,p[f++]=m):m<65536?(O<3&&p.copyWithin(f+3,f+2,f+2+m),p[f++]=218,p[f++]=m>>8,p[f++]=m&255):(O<5&&p.copyWithin(f+5,f+3,f+3+m),p[f++]=219,H.setUint32(f,m),f+=4),f+=m}else if(w==="number")if(h>>>0===h)h<32||h<128&&this.useRecords===!1||h<64&&!this.randomAccessStructure?p[f++]=h:h<256?(p[f++]=204,p[f++]=h):h<65536?(p[f++]=205,p[f++]=h>>8,p[f++]=h&255):(p[f++]=206,H.setUint32(f,h),f+=4);else if(h>>0===h)h>=-32?p[f++]=256+h:h>=-128?(p[f++]=208,p[f++]=h+256):h>=-32768?(p[f++]=209,H.setInt16(f,h),f+=2):(p[f++]=210,H.setInt32(f,h),f+=4);else{let E;if((E=this.useFloat32)>0&&h<4294967296&&h>=-2147483648){p[f++]=202,H.setFloat32(f,h);let O;if(E<4||(O=h*ji[(p[f]&127)<<1|p[f+1]>>7])>>0===O){f+=4;return}else f--}p[f++]=203,H.setFloat64(f,h),f+=8}else if(w==="object"||w==="function")if(!h)p[f++]=192;else{if(a){let O=a.get(h);if(O){if(!O.id){let D=a.idsToInsert||(a.idsToInsert=[]);O.id=D.push(O)}p[f++]=214,p[f++]=112,H.setUint32(f,O.id),f+=4;return}else a.set(h,{offset:f-r})}let E=h.constructor;if(E===Object)Rr(h,!0);else if(E===Array)tt(h);else if(E===Map)if(this.mapAsEmptyObject)p[f++]=128;else{m=h.size,m<16?p[f++]=128|m:m<65536?(p[f++]=222,p[f++]=m>>8,p[f++]=m&255):(p[f++]=223,H.setUint32(f,m),f+=4);for(let[O,D]of h)W(O),W(D)}else{for(let O=0,D=on.length;O<D;O++){let U=Vi[O];if(h instanceof U){let P=on[O];if(P.write){P.type&&(p[f++]=212,p[f++]=P.type,p[f++]=0);let nt=P.write.call(this,h);nt===h?Array.isArray(h)?tt(h):Rr(h):W(nt);return}let ne=p,K=H,Ge=f;p=null;let yt;try{yt=P.pack.call(this,h,nt=>(p=ne,ne=null,f+=nt,f>fe&&rt(f),{target:p,targetView:H,position:f-nt}),W)}finally{ne&&(p=ne,H=K,f=Ge,fe=p.length-10)}yt&&(yt.length+f>fe&&rt(yt.length+f),f=Sl(yt,p,f,P.type));return}}if(Array.isArray(h))tt(h);else{if(h.toJSON){const O=h.toJSON();if(O!==h)return W(O)}if(w==="function")return W(this.writeFunction&&this.writeFunction(h));Rr(h,!h.hasOwnProperty)}}}else if(w==="boolean")p[f++]=h?195:194;else if(w==="bigint"){if(h<BigInt(1)<<BigInt(63)&&h>=-(BigInt(1)<<BigInt(63)))p[f++]=211,H.setBigInt64(f,h);else if(h<BigInt(1)<<BigInt(64)&&h>0)p[f++]=207,H.setBigUint64(f,h);else if(this.largeBigIntToFloat)p[f++]=203,H.setFloat64(f,Number(h));else throw new RangeError(h+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");f+=8}else if(w==="undefined")this.encodeUndefinedAsNil?p[f++]=192:(p[f++]=212,p[f++]=0,p[f++]=0);else throw new Error("Unknown type: "+w)},Nr=this.variableMapSize||this.coercibleKeyAsNumber?h=>{let w=Object.keys(h),m=w.length;m<16?p[f++]=128|m:m<65536?(p[f++]=222,p[f++]=m>>8,p[f++]=m&255):(p[f++]=223,H.setUint32(f,m),f+=4);let E;if(this.coercibleKeyAsNumber)for(let O=0;O<m;O++){E=w[O];let D=Number(E);W(isNaN(D)?E:D),W(h[E])}else for(let O=0;O<m;O++)W(E=w[O]),W(h[E])}:(h,w)=>{p[f++]=222;let m=f-r;f+=2;let E=0;for(let O in h)(w||h.hasOwnProperty(O))&&(W(O),W(h[O]),E++);p[m+++r]=E>>8,p[m+r]=E&255},Kt=this.useRecords===!1?Nr:e.progressiveRecords&&!R?(h,w)=>{let m,E=i.transitions||(i.transitions=Object.create(null)),O=f++-r,D;for(let U in h)if(w||h.hasOwnProperty(U)){if(m=E[U],m)E=m;else{let P=Object.keys(h),ne=E;E=i.transitions;let K=0;for(let Ge=0,yt=P.length;Ge<yt;Ge++){let nt=P[Ge];m=E[nt],m||(m=E[nt]=Object.create(null),K++),E=m}O+r+1==f?(f--,Cn(E,P,K)):la(E,P,O,K),D=!0,E=ne[U]}W(h[U])}if(!D){let U=E[xt];U?p[O+r]=U:la(E,Object.keys(h),O,0)}}:(h,w)=>{let m,E=i.transitions||(i.transitions=Object.create(null)),O=0;for(let U in h)(w||h.hasOwnProperty(U))&&(m=E[U],m||(m=E[U]=Object.create(null),O++),E=m);let D=E[xt];D?D>=96&&R?(p[f++]=((D-=96)&31)+96,p[f++]=D>>5):p[f++]=D:Cn(E,E.__keys__||Object.keys(h),O);for(let U in h)(w||h.hasOwnProperty(U))&&W(h[U])},ca=typeof this.useRecords=="function"&&this.useRecords,Rr=ca?(h,w)=>{ca(h)?Kt(h,w):Nr(h,w)}:Kt,rt=h=>{let w;if(h>16777216){if(h-r>Na)throw new Error("Packed buffer would be larger than maximum buffer size");w=Math.min(Na,Math.round(Math.max((h-r)*(h>67108864?1.25:2),4194304)/4096)*4096)}else w=(Math.max(h-r<<2,p.length-1)>>12)+1<<12;let m=new Lr(w);return H=m.dataView||(m.dataView=new DataView(m.buffer,0,w)),h=Math.min(h,p.length),p.copy?p.copy(m,0,r,h):m.set(p.slice(r,h)),f-=r,r=0,fe=m.length-10,p=m},Cn=(h,w,m)=>{let E=i.nextId;E||(E=64),E<k&&this.shouldShareStructure&&!this.shouldShareStructure(w)?(E=i.nextOwnId,E<z||(E=k),i.nextOwnId=E+1):(E>=z&&(E=k),i.nextId=E+1);let O=w.highByte=E>=96&&R?E-96>>5:-1;h[xt]=E,h.__keys__=w,i[E-64]=w,E<k?(w.isShared=!0,i.sharedLength=E-63,n=!0,O>=0?(p[f++]=(E&31)+96,p[f++]=O):p[f++]=E):(O>=0?(p[f++]=213,p[f++]=114,p[f++]=(E&31)+96,p[f++]=O):(p[f++]=212,p[f++]=114,p[f++]=E),m&&(xe+=me*m),Z.length>=y&&(Z.shift()[xt]=0),Z.push(h),W(w))},la=(h,w,m,E)=>{let O=p,D=f,U=fe,P=r;p=Ht,f=0,r=0,p||(Ht=p=new Lr(8192)),fe=p.length-10,Cn(h,w,E),Ht=p;let ne=f;if(p=O,f=D,fe=U,r=P,ne>1){let K=f+ne-1;K>fe&&rt(K);let Ge=m+r;p.copyWithin(Ge+ne,Ge+1,f),p.set(Ht.slice(0,ne),Ge),f=K}else p[m+r]=Ht[0]},$o=(h,w)=>{let m=ml(h,p,r,f,i,rt,(E,O,D)=>{if(D)return n=!0;f=O;let U=p;return W(E),Ct(),U!==p?{position:f,targetView:H,target:p}:f},this);if(m===0)return Rr(h,!0);f=m}}useBuffer(e){p=e,H=new DataView(p.buffer,p.byteOffset,p.byteLength),f=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}Vi=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,Ps];on=[{pack(t,e,r){let n=t.getTime()/1e3;if((this.useTimestamp32||t.getMilliseconds()===0)&&n>=0&&n<4294967296){let{target:i,targetView:a,position:s}=e(6);i[s++]=214,i[s++]=255,a.setUint32(s,n)}else if(n>0&&n<4294967296){let{target:i,targetView:a,position:s}=e(10);i[s++]=215,i[s++]=255,a.setUint32(s,t.getMilliseconds()*4e6+(n/1e3/4294967296>>0)),a.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return e(0),r(this.onInvalidDate());let{target:i,targetView:a,position:s}=e(3);i[s++]=212,i[s++]=255,i[s++]=255}else{let{target:i,targetView:a,position:s}=e(15);i[s++]=199,i[s++]=12,i[s++]=255,a.setUint32(s,t.getMilliseconds()*1e6),a.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(t,e,r){if(this.setAsEmptyObject)return e(0),r({});let n=Array.from(t),{target:i,position:a}=e(this.moreTypes?3:0);this.moreTypes&&(i[a++]=212,i[a++]=115,i[a++]=0),r(n)}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([t.name,t.message])}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([t.source,t.flags])}},{pack(t,e){this.moreTypes?Ra(t,16,e):Ia(Tn?Buffer.from(t):new Uint8Array(t),e)}},{pack(t,e){let r=t.constructor;r!==js&&this.moreTypes?Ra(t,Us.indexOf(r.name),e):Ia(t,e)}},{pack(t,e){let{target:r,position:n}=e(1);r[n]=193}}];function Ra(t,e,r,n){let i=t.byteLength;if(i+1<256){var{target:a,position:s}=r(4+i);a[s++]=199,a[s++]=i+1}else if(i+1<65536){var{target:a,position:s}=r(5+i);a[s++]=200,a[s++]=i+1>>8,a[s++]=i+1&255}else{var{target:a,position:s,targetView:o}=r(7+i);a[s++]=201,o.setUint32(s,i+1),s+=4}a[s++]=116,a[s++]=e,a.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s)}function Ia(t,e){let r=t.byteLength;var n,i;if(r<256){var{target:n,position:i}=e(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=e(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=r&255}else{var{target:n,position:i,targetView:a}=e(r+5);n[i++]=198,a.setUint32(i,r),i+=4}n.set(t,i)}function Sl(t,e,r,n){let i=t.length;switch(i){case 1:e[r++]=212;break;case 2:e[r++]=213;break;case 4:e[r++]=214;break;case 8:e[r++]=215;break;case 16:e[r++]=216;break;default:i<256?(e[r++]=199,e[r++]=i):i<65536?(e[r++]=200,e[r++]=i>>8,e[r++]=i&255):(e[r++]=201,e[r++]=i>>24,e[r++]=i>>16&255,e[r++]=i>>8&255,e[r++]=i&255)}return e[r++]=n,e.set(t,r),r+=i,r}function Ol(t,e){let r,n=e.length*6,i=t.length-n;for(;r=e.pop();){let a=r.offset,s=r.id;t.copyWithin(a+n,a,i),n-=6;let o=a+n;t[o++]=214,t[o++]=105,t[o++]=s>>24,t[o++]=s>>16&255,t[o++]=s>>8&255,t[o++]=s&255,i=a}return t}function Ca(t,e,r){if(J.length>0){H.setUint32(J.position+t,f+r-J.position-t),J.stringsPosition=f-t;let n=J;J=null,e(n[0]),e(n[1])}}function Al(t){if(t.Class){if(!t.pack&&!t.write)throw new Error("Extension has no pack or write function");if(t.pack&&!t.type)throw new Error("Extension has no type (numeric code to identify the extension)");Vi.unshift(t.Class),on.unshift(t)}_l(t)}function bl(t,e){return t.isCompatible=r=>{let n=!r||(e.lastNamedStructuresLength||0)===r.length;return n||e._mergeStructures(r),n},t}let Vs=new Tl({useRecords:!1});const wl=Vs.pack;Vs.pack;const Nl=512,Rl=1024,Il=2048;class Cl{constructor(){T(this,"contentType","application/msgpack")}encode(e){return wl($t.toSnake(e))}decode(e,r){const n=$t.toCamel(vl(new Uint8Array(e)));return r!=null?r.parse(n):n}static registerCustomType(e){Al({type:0,...e})}}class Pl{constructor(){T(this,"contentType","application/json")}encode(e){const r=JSON.stringify($t.toSnake(e),(n,i)=>ArrayBuffer.isView(i)?Array.from(i):i);return new TextEncoder().encode(r)}decode(e,r){const n=$t.toCamel(JSON.parse(new TextDecoder().decode(e)));return r!=null?r.parse(n):n}static registerCustomType(){}}new Cl,new Pl;var ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zt(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var $s={},ke={},Ll=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},St="1.4.1",Pa=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Ml(t){var e=new Set([t]),r=new Set,n=t.match(Pa);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(c){return c===t};function a(o){return r.add(o),!1}function s(o){return e.add(o),!0}return function(c){if(e.has(c))return!0;if(r.has(c))return!1;var u=c.match(Pa);if(!u)return a(c);var d={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return d.prerelease!=null||i.major!==d.major?a(c):i.major===0?i.minor===d.minor&&i.patch<=d.patch?s(c):a(c):i.minor<=d.minor?s(c):a(c)}}var Dl=Ml(St),kl=St.split(".")[0],yr=Symbol.for("opentelemetry.js.api."+kl),mr=Ll;function Or(t,e,r,n){var i;n===void 0&&(n=!1);var a=mr[yr]=(i=mr[yr])!==null&&i!==void 0?i:{version:St};if(!n&&a[t]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(s.stack||s.message),!1}if(a.version!==St){var s=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+t+" does not match previously registered API v"+St);return r.error(s.stack||s.message),!1}return a[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+St+"."),!0}function Rt(t){var e,r,n=(e=mr[yr])===null||e===void 0?void 0:e.version;if(!(!n||!Dl(n)))return(r=mr[yr])===null||r===void 0?void 0:r[t]}function Ar(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+St+".");var r=mr[yr];r&&delete r[t]}var Ul=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Bl=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},jl=function(){function t(e){this._namespace=e.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Xt("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Xt("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Xt("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Xt("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Xt("verbose",this._namespace,e)},t}();function Xt(t,e,r){var n=Rt("diag");if(n)return r.unshift(e),n[t].apply(n,Bl([],Ul(r),!1))}var te;(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(te||(te={}));function Vl(t,e){t<te.NONE?t=te.NONE:t>te.ALL&&(t=te.ALL),e=e||{};function r(n,i){var a=e[n];return typeof a=="function"&&t>=i?a.bind(e):function(){}}return{error:r("error",te.ERROR),warn:r("warn",te.WARN),info:r("info",te.INFO),debug:r("debug",te.DEBUG),verbose:r("verbose",te.VERBOSE)}}var $l=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Gl=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},Zl="diag",$e=function(){function t(){function e(i){return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var o=Rt("diag");if(o)return o[i].apply(o,Gl([],$l(a),!1))}}var r=this,n=function(i,a){var s,o,c;if(a===void 0&&(a={logLevel:te.INFO}),i===r){var u=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((s=u.stack)!==null&&s!==void 0?s:u.message),!1}typeof a=="number"&&(a={logLevel:a});var d=Rt("diag"),y=Vl((o=a.logLevel)!==null&&o!==void 0?o:te.INFO,i);if(d&&!a.suppressOverrideMessage){var R=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+R),y.warn("Current logger will overwrite one already registered from "+R)}return Or("diag",y,r,!0)};r.setLogger=n,r.disable=function(){Ar(Zl,r)},r.createComponentLogger=function(i){return new jl(i)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}(),zl=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Fl=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kl=function(){function t(e){this._entries=e?new Map(e):new Map}return t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=zl(e,2),n=r[0],i=r[1];return[n,i]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=new t(this._entries);try{for(var s=Fl(n),o=s.next();!o.done;o=s.next()){var c=o.value;a._entries.delete(c)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return a},t.prototype.clear=function(){return new t},t}(),Hl=Symbol("BaggageEntryMetadata"),Xl=$e.instance();function Yl(t){return t===void 0&&(t={}),new Kl(new Map(Object.entries(t)))}function Gs(t){return typeof t!="string"&&(Xl.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:Hl,toString:function(){return t}}}function Sn(t){return Symbol.for(t)}var Wl=function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var a=new t(r._currentContext);return a._currentContext.set(n,i),a},r.deleteValue=function(n){var i=new t(r._currentContext);return i._currentContext.delete(n),i}}return t}(),Et=new Wl,Bn=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],ql=function(){function t(){function e(n){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(console){var s=console[n];if(typeof s!="function"&&(s=console.log),typeof s=="function")return s.apply(console,i)}}}for(var r=0;r<Bn.length;r++)this[Bn[r].n]=e(Bn[r].c)}return t}(),Ft=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jl=function(){function t(){}return t.prototype.createHistogram=function(e,r){return of},t.prototype.createCounter=function(e,r){return sf},t.prototype.createUpDownCounter=function(e,r){return uf},t.prototype.createObservableGauge=function(e,r){return lf},t.prototype.createObservableCounter=function(e,r){return cf},t.prototype.createObservableUpDownCounter=function(e,r){return ff},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t}(),$i=function(){function t(){}return t}(),Ql=function(t){Ft(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e}($i),ef=function(t){Ft(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e}($i),tf=function(t){Ft(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e}($i),Gi=function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t}(),rf=function(t){Ft(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Gi),nf=function(t){Ft(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Gi),af=function(t){Ft(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Gi),Zs=new Jl,sf=new Ql,of=new tf,uf=new ef,cf=new rf,lf=new nf,ff=new af;function df(){return Zs}var si;(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(si||(si={}));var zs={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},Fs={set:function(t,e,r){t!=null&&(t[e]=r)}},pf=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},hf=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},_f=function(){function t(){}return t.prototype.active=function(){return Et},t.prototype.with=function(e,r,n){for(var i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return r.call.apply(r,hf([n],pf(i),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),vf=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},yf=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},jn="context",mf=new _f,On=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return Or(jn,e,$e.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(e,r,n){for(var i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,yf([e,r,n],vf(a),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return Rt(jn)||mf},t.prototype.disable=function(){this._getContextManager().disable(),Ar(jn,$e.instance())},t}(),Pe;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Pe||(Pe={}));var Zi="0000000000000000",zi="00000000000000000000000000000000",Fi={traceId:zi,spanId:Zi,traceFlags:Pe.NONE},er=function(){function t(e){e===void 0&&(e=Fi),this._spanContext=e}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t}(),Ki=Sn("OpenTelemetry Context Key SPAN");function Hi(t){return t.getValue(Ki)||void 0}function gf(){return Hi(On.getInstance().active())}function Xi(t,e){return t.setValue(Ki,e)}function Ef(t){return t.deleteValue(Ki)}function Tf(t,e){return Xi(t,new er(e))}function Ks(t){var e;return(e=Hi(t))===null||e===void 0?void 0:e.spanContext()}var Sf=/^([0-9a-f]{32})$/i,Of=/^[0-9a-f]{16}$/i;function Yi(t){return Sf.test(t)&&t!==zi}function Hs(t){return Of.test(t)&&t!==Zi}function br(t){return Yi(t.traceId)&&Hs(t.spanId)}function Af(t){return new er(t)}var Vn=On.getInstance(),Xs=function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=Vn.active());var i=!!(r!=null&&r.root);if(i)return new er;var a=n&&Ks(n);return bf(a)&&br(a)?new er(a):new er},t.prototype.startActiveSpan=function(e,r,n,i){var a,s,o;if(!(arguments.length<2)){arguments.length===2?o=r:arguments.length===3?(a=r,o=n):(a=r,s=n,o=i);var c=s??Vn.active(),u=this.startSpan(e,a,c),d=Xi(c,u);return Vn.with(d,o,void 0,u)}},t}();function bf(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var wf=new Xs,Ys=function(){function t(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}return t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,i){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):wf},t}(),Nf=function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new Xs},t}(),Rf=new Nf,oi=function(){function t(){}return t.prototype.getTracer=function(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new Ys(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Rf},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(e,r,n)},t}(),gr;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(gr||(gr={}));var un;(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(un||(un={}));var cn;(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(cn||(cn={}));var ui="[_0-9a-z-*/]",If="[a-z]"+ui+"{0,255}",Cf="[a-z0-9]"+ui+"{0,240}@[a-z]"+ui+"{0,13}",Pf=new RegExp("^(?:"+If+"|"+Cf+")$"),xf=/^[ -~]{0,255}[!-~]$/,Lf=/,|=/;function Mf(t){return Pf.test(t)}function Df(t){return xf.test(t)&&!Lf.test(t)}var xa=32,kf=512,La=",",Ma="=",Uf=function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+Ma+e.get(n)),r},[]).join(La)},t.prototype._parse=function(e){e.length>kf||(this._internalState=e.split(La).reverse().reduce(function(r,n){var i=n.trim(),a=i.indexOf(Ma);if(a!==-1){var s=i.slice(0,a),o=i.slice(a+1,n.length);Mf(s)&&Df(o)&&r.set(s,o)}return r},new Map),this._internalState.size>xa&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,xa))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t}();function Bf(t){return new Uf(t)}var Be=On.getInstance(),C=$e.instance(),jf=function(){function t(){}return t.prototype.getMeter=function(e,r,n){return Zs},t}(),Vf=new jf,$n="metrics",$f=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return Or($n,e,$e.instance())},t.prototype.getMeterProvider=function(){return Rt($n)||Vf},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){Ar($n,$e.instance())},t}(),An=$f.getInstance(),Gf=function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t}(),Wi=Sn("OpenTelemetry Baggage Key");function Ws(t){return t.getValue(Wi)||void 0}function Zf(){return Ws(On.getInstance().active())}function zf(t,e){return t.setValue(Wi,e)}function Ff(t){return t.deleteValue(Wi)}var Gn="propagation",Kf=new Gf,Hf=function(){function t(){this.createBaggage=Yl,this.getBaggage=Ws,this.getActiveBaggage=Zf,this.setBaggage=zf,this.deleteBaggage=Ff}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return Or(Gn,e,$e.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Fs),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=zs),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){Ar(Gn,$e.instance())},t.prototype._getGlobalPropagator=function(){return Rt(Gn)||Kf},t}(),Ut=Hf.getInstance(),Zn="trace",Xf=function(){function t(){this._proxyTracerProvider=new oi,this.wrapSpanContext=Af,this.isSpanContextValid=br,this.deleteSpan=Ef,this.getSpan=Hi,this.getActiveSpan=gf,this.getSpanContext=Ks,this.setSpan=Xi,this.setSpanContext=Tf}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=Or(Zn,this._proxyTracerProvider,$e.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return Rt(Zn)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){Ar(Zn,$e.instance()),this._proxyTracerProvider=new oi},t}(),ye=Xf.getInstance();const Yf={context:Be,diag:C,metrics:An,propagation:Ut,trace:ye},Wf=Object.freeze(Object.defineProperty({__proto__:null,DiagConsoleLogger:ql,get DiagLogLevel(){return te},INVALID_SPANID:Zi,INVALID_SPAN_CONTEXT:Fi,INVALID_TRACEID:zi,ProxyTracer:Ys,ProxyTracerProvider:oi,ROOT_CONTEXT:Et,get SamplingDecision(){return gr},get SpanKind(){return un},get SpanStatusCode(){return cn},get TraceFlags(){return Pe},get ValueType(){return si},baggageEntryMetadataFromString:Gs,context:Be,createContextKey:Sn,createNoopMeter:df,createTraceState:Bf,default:Yf,defaultTextMapGetter:zs,defaultTextMapSetter:Fs,diag:C,isSpanContextValid:br,isValidSpanId:Hs,isValidTraceId:Yi,metrics:An,propagation:Ut,trace:ye},Symbol.toStringTag,{value:"Module"}));var qs=Sn("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Js(t){return t.setValue(qs,!0)}function qi(t){return t.getValue(qs)===!0}var qf="=",ci=";",ln=",",zn="baggage",Jf=180,Qf=4096,ed=8192,td=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function rd(t){return t.reduce(function(e,r){var n=""+e+(e!==""?ln:"")+r;return n.length>ed?e:n},"")}function nd(t){return t.getAllEntries().map(function(e){var r=td(e,2),n=r[0],i=r[1],a=encodeURIComponent(n)+"="+encodeURIComponent(i.value);return i.metadata!==void 0&&(a+=ci+i.metadata.toString()),a})}function Qs(t){var e=t.split(ci);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.split(qf);if(n.length===2){var i=decodeURIComponent(n[0].trim()),a=decodeURIComponent(n[1].trim()),s;return e.length>0&&(s=Gs(e.join(ci))),{key:i,value:a,metadata:s}}}}}function eo(t){return typeof t!="string"||t.length===0?{}:t.split(ln).map(function(e){return Qs(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var id=function(){function t(){}return t.prototype.inject=function(e,r,n){var i=Ut.getBaggage(e);if(!(!i||qi(e))){var a=nd(i).filter(function(o){return o.length<=Qf}).slice(0,Jf),s=rd(a);s.length>0&&n.set(r,zn,s)}},t.prototype.extract=function(e,r,n){var i=n.get(r,zn),a=Array.isArray(i)?i.join(ln):i;if(!a)return e;var s={};if(a.length===0)return e;var o=a.split(ln);return o.forEach(function(c){var u=Qs(c);if(u){var d={value:u.value};u.metadata&&(d.metadata=u.metadata),s[u.key]=d}}),Object.entries(s).length===0?e:Ut.setBaggage(e,Ut.createBaggage(s))},t.prototype.fields=function(){return[zn]},t}(),to=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ad=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function Hr(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var i=to(Object.entries(t)),a=i.next();!a.done;a=i.next()){var s=ad(a.value,2),o=s[0],c=s[1];if(!sd(o)){C.warn("Invalid attribute key: "+o);continue}if(!ro(c)){C.warn("Invalid attribute value set for key: "+o);continue}Array.isArray(c)?n[o]=c.slice():n[o]=c}}catch(u){e={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}function sd(t){return typeof t=="string"&&t.length>0}function ro(t){return t==null?!0:Array.isArray(t)?od(t):no(t)}function od(t){var e,r,n;try{for(var i=to(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(s!=null){if(!n){if(no(s)){n=typeof s;continue}return!1}if(typeof s!==n)return!1}}}catch(o){e={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return!0}function no(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}function ud(){return function(t){C.error(cd(t))}}function cd(t){return typeof t=="string"?t:JSON.stringify(ld(t))}function ld(t){for(var e={},r=t;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!e[n]){var i=r[n];i&&(e[n]=String(i))}}),r=Object.getPrototypeOf(r);return e}var fd=ud();function At(t){try{fd(t)}catch{}}var Me;(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Me||(Me={}));var io=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},dd=",",pd=["OTEL_SDK_DISABLED"];function hd(t){return pd.indexOf(t)>-1}var _d=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function vd(t){return _d.indexOf(t)>-1}var yd=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function md(t){return yd.indexOf(t)>-1}var li=1/0,fi=128,gd=128,Ed=128,ao={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:te.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:li,OTEL_ATTRIBUTE_COUNT_LIMIT:fi,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:li,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:fi,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:gd,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Ed,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Me.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function Td(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function Sd(t,e,r,n,i){if(n===void 0&&(n=-1/0),i===void 0&&(i=1/0),typeof r[t]<"u"){var a=Number(r[t]);isNaN(a)||(a<n?e[t]=n:a>i?e[t]=i:e[t]=a)}}function Od(t,e,r,n){n===void 0&&(n=dd);var i=r[t];typeof i=="string"&&(e[t]=i.split(n).map(function(a){return a.trim()}))}var Ad={ALL:te.ALL,VERBOSE:te.VERBOSE,DEBUG:te.DEBUG,INFO:te.INFO,WARN:te.WARN,ERROR:te.ERROR,NONE:te.NONE};function bd(t,e,r){var n=r[t];if(typeof n=="string"){var i=Ad[n.toUpperCase()];i!=null&&(e[t]=i)}}function di(t){var e={};for(var r in ao){var n=r;switch(n){case"OTEL_LOG_LEVEL":bd(n,e,t);break;default:if(hd(n))Td(n,e,t);else if(vd(n))Sd(n,e,t);else if(md(n))Od(n,e,t);else{var i=t[n];typeof i<"u"&&i!==null&&(e[n]=String(i))}}}return e}function wd(){return typeof process<"u"&&process&&process.env?di(process.env):di(io)}function re(){var t=di(io);return Object.assign({},ao,t)}function tr(t){for(var e=t.length,r="",n=0;n<e;n+=2){var i=t.substring(n,n+2),a=parseInt(i,16);r+=String.fromCharCode(a)}return btoa(r)}var Bt=performance,Nd="1.11.0",We={AWS_LAMBDA_INVOKED_ARN:"aws.lambda.invoked_arn",DB_SYSTEM:"db.system",DB_CONNECTION_STRING:"db.connection_string",DB_USER:"db.user",DB_JDBC_DRIVER_CLASSNAME:"db.jdbc.driver_classname",DB_NAME:"db.name",DB_STATEMENT:"db.statement",DB_OPERATION:"db.operation",DB_MSSQL_INSTANCE_NAME:"db.mssql.instance_name",DB_CASSANDRA_KEYSPACE:"db.cassandra.keyspace",DB_CASSANDRA_PAGE_SIZE:"db.cassandra.page_size",DB_CASSANDRA_CONSISTENCY_LEVEL:"db.cassandra.consistency_level",DB_CASSANDRA_TABLE:"db.cassandra.table",DB_CASSANDRA_IDEMPOTENCE:"db.cassandra.idempotence",DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:"db.cassandra.speculative_execution_count",DB_CASSANDRA_COORDINATOR_ID:"db.cassandra.coordinator.id",DB_CASSANDRA_COORDINATOR_DC:"db.cassandra.coordinator.dc",DB_HBASE_NAMESPACE:"db.hbase.namespace",DB_REDIS_DATABASE_INDEX:"db.redis.database_index",DB_MONGODB_COLLECTION:"db.mongodb.collection",DB_SQL_TABLE:"db.sql.table",EXCEPTION_TYPE:"exception.type",EXCEPTION_MESSAGE:"exception.message",EXCEPTION_STACKTRACE:"exception.stacktrace",EXCEPTION_ESCAPED:"exception.escaped",FAAS_TRIGGER:"faas.trigger",FAAS_EXECUTION:"faas.execution",FAAS_DOCUMENT_COLLECTION:"faas.document.collection",FAAS_DOCUMENT_OPERATION:"faas.document.operation",FAAS_DOCUMENT_TIME:"faas.document.time",FAAS_DOCUMENT_NAME:"faas.document.name",FAAS_TIME:"faas.time",FAAS_CRON:"faas.cron",FAAS_COLDSTART:"faas.coldstart",FAAS_INVOKED_NAME:"faas.invoked_name",FAAS_INVOKED_PROVIDER:"faas.invoked_provider",FAAS_INVOKED_REGION:"faas.invoked_region",NET_TRANSPORT:"net.transport",NET_PEER_IP:"net.peer.ip",NET_PEER_PORT:"net.peer.port",NET_PEER_NAME:"net.peer.name",NET_HOST_IP:"net.host.ip",NET_HOST_PORT:"net.host.port",NET_HOST_NAME:"net.host.name",NET_HOST_CONNECTION_TYPE:"net.host.connection.type",NET_HOST_CONNECTION_SUBTYPE:"net.host.connection.subtype",NET_HOST_CARRIER_NAME:"net.host.carrier.name",NET_HOST_CARRIER_MCC:"net.host.carrier.mcc",NET_HOST_CARRIER_MNC:"net.host.carrier.mnc",NET_HOST_CARRIER_ICC:"net.host.carrier.icc",PEER_SERVICE:"peer.service",ENDUSER_ID:"enduser.id",ENDUSER_ROLE:"enduser.role",ENDUSER_SCOPE:"enduser.scope",THREAD_ID:"thread.id",THREAD_NAME:"thread.name",CODE_FUNCTION:"code.function",CODE_NAMESPACE:"code.namespace",CODE_FILEPATH:"code.filepath",CODE_LINENO:"code.lineno",HTTP_METHOD:"http.method",HTTP_URL:"http.url",HTTP_TARGET:"http.target",HTTP_HOST:"http.host",HTTP_SCHEME:"http.scheme",HTTP_STATUS_CODE:"http.status_code",HTTP_FLAVOR:"http.flavor",HTTP_USER_AGENT:"http.user_agent",HTTP_REQUEST_CONTENT_LENGTH:"http.request_content_length",HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:"http.request_content_length_uncompressed",HTTP_RESPONSE_CONTENT_LENGTH:"http.response_content_length",HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:"http.response_content_length_uncompressed",HTTP_SERVER_NAME:"http.server_name",HTTP_ROUTE:"http.route",HTTP_CLIENT_IP:"http.client_ip",AWS_DYNAMODB_TABLE_NAMES:"aws.dynamodb.table_names",AWS_DYNAMODB_CONSUMED_CAPACITY:"aws.dynamodb.consumed_capacity",AWS_DYNAMODB_ITEM_COLLECTION_METRICS:"aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:"aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:"aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_CONSISTENT_READ:"aws.dynamodb.consistent_read",AWS_DYNAMODB_PROJECTION:"aws.dynamodb.projection",AWS_DYNAMODB_LIMIT:"aws.dynamodb.limit",AWS_DYNAMODB_ATTRIBUTES_TO_GET:"aws.dynamodb.attributes_to_get",AWS_DYNAMODB_INDEX_NAME:"aws.dynamodb.index_name",AWS_DYNAMODB_SELECT:"aws.dynamodb.select",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:"aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:"aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_EXCLUSIVE_START_TABLE:"aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_TABLE_COUNT:"aws.dynamodb.table_count",AWS_DYNAMODB_SCAN_FORWARD:"aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT:"aws.dynamodb.segment",AWS_DYNAMODB_TOTAL_SEGMENTS:"aws.dynamodb.total_segments",AWS_DYNAMODB_COUNT:"aws.dynamodb.count",AWS_DYNAMODB_SCANNED_COUNT:"aws.dynamodb.scanned_count",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:"aws.dynamodb.attribute_definitions",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:"aws.dynamodb.global_secondary_index_updates",MESSAGING_SYSTEM:"messaging.system",MESSAGING_DESTINATION:"messaging.destination",MESSAGING_DESTINATION_KIND:"messaging.destination_kind",MESSAGING_TEMP_DESTINATION:"messaging.temp_destination",MESSAGING_PROTOCOL:"messaging.protocol",MESSAGING_PROTOCOL_VERSION:"messaging.protocol_version",MESSAGING_URL:"messaging.url",MESSAGING_MESSAGE_ID:"messaging.message_id",MESSAGING_CONVERSATION_ID:"messaging.conversation_id",MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:"messaging.message_payload_size_bytes",MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:"messaging.message_payload_compressed_size_bytes",MESSAGING_OPERATION:"messaging.operation",MESSAGING_CONSUMER_ID:"messaging.consumer_id",MESSAGING_RABBITMQ_ROUTING_KEY:"messaging.rabbitmq.routing_key",MESSAGING_KAFKA_MESSAGE_KEY:"messaging.kafka.message_key",MESSAGING_KAFKA_CONSUMER_GROUP:"messaging.kafka.consumer_group",MESSAGING_KAFKA_CLIENT_ID:"messaging.kafka.client_id",MESSAGING_KAFKA_PARTITION:"messaging.kafka.partition",MESSAGING_KAFKA_TOMBSTONE:"messaging.kafka.tombstone",RPC_SYSTEM:"rpc.system",RPC_SERVICE:"rpc.service",RPC_METHOD:"rpc.method",RPC_GRPC_STATUS_CODE:"rpc.grpc.status_code",RPC_JSONRPC_VERSION:"rpc.jsonrpc.version",RPC_JSONRPC_REQUEST_ID:"rpc.jsonrpc.request_id",RPC_JSONRPC_ERROR_CODE:"rpc.jsonrpc.error_code",RPC_JSONRPC_ERROR_MESSAGE:"rpc.jsonrpc.error_message",MESSAGE_TYPE:"message.type",MESSAGE_ID:"message.id",MESSAGE_COMPRESSED_SIZE:"message.compressed_size",MESSAGE_UNCOMPRESSED_SIZE:"message.uncompressed_size"},ue={CLOUD_PROVIDER:"cloud.provider",CLOUD_ACCOUNT_ID:"cloud.account.id",CLOUD_REGION:"cloud.region",CLOUD_AVAILABILITY_ZONE:"cloud.availability_zone",CLOUD_PLATFORM:"cloud.platform",AWS_ECS_CONTAINER_ARN:"aws.ecs.container.arn",AWS_ECS_CLUSTER_ARN:"aws.ecs.cluster.arn",AWS_ECS_LAUNCHTYPE:"aws.ecs.launchtype",AWS_ECS_TASK_ARN:"aws.ecs.task.arn",AWS_ECS_TASK_FAMILY:"aws.ecs.task.family",AWS_ECS_TASK_REVISION:"aws.ecs.task.revision",AWS_EKS_CLUSTER_ARN:"aws.eks.cluster.arn",AWS_LOG_GROUP_NAMES:"aws.log.group.names",AWS_LOG_GROUP_ARNS:"aws.log.group.arns",AWS_LOG_STREAM_NAMES:"aws.log.stream.names",AWS_LOG_STREAM_ARNS:"aws.log.stream.arns",CONTAINER_NAME:"container.name",CONTAINER_ID:"container.id",CONTAINER_RUNTIME:"container.runtime",CONTAINER_IMAGE_NAME:"container.image.name",CONTAINER_IMAGE_TAG:"container.image.tag",DEPLOYMENT_ENVIRONMENT:"deployment.environment",DEVICE_ID:"device.id",DEVICE_MODEL_IDENTIFIER:"device.model.identifier",DEVICE_MODEL_NAME:"device.model.name",FAAS_NAME:"faas.name",FAAS_ID:"faas.id",FAAS_VERSION:"faas.version",FAAS_INSTANCE:"faas.instance",FAAS_MAX_MEMORY:"faas.max_memory",HOST_ID:"host.id",HOST_NAME:"host.name",HOST_TYPE:"host.type",HOST_ARCH:"host.arch",HOST_IMAGE_NAME:"host.image.name",HOST_IMAGE_ID:"host.image.id",HOST_IMAGE_VERSION:"host.image.version",K8S_CLUSTER_NAME:"k8s.cluster.name",K8S_NODE_NAME:"k8s.node.name",K8S_NODE_UID:"k8s.node.uid",K8S_NAMESPACE_NAME:"k8s.namespace.name",K8S_POD_UID:"k8s.pod.uid",K8S_POD_NAME:"k8s.pod.name",K8S_CONTAINER_NAME:"k8s.container.name",K8S_REPLICASET_UID:"k8s.replicaset.uid",K8S_REPLICASET_NAME:"k8s.replicaset.name",K8S_DEPLOYMENT_UID:"k8s.deployment.uid",K8S_DEPLOYMENT_NAME:"k8s.deployment.name",K8S_STATEFULSET_UID:"k8s.statefulset.uid",K8S_STATEFULSET_NAME:"k8s.statefulset.name",K8S_DAEMONSET_UID:"k8s.daemonset.uid",K8S_DAEMONSET_NAME:"k8s.daemonset.name",K8S_JOB_UID:"k8s.job.uid",K8S_JOB_NAME:"k8s.job.name",K8S_CRONJOB_UID:"k8s.cronjob.uid",K8S_CRONJOB_NAME:"k8s.cronjob.name",OS_TYPE:"os.type",OS_DESCRIPTION:"os.description",OS_NAME:"os.name",OS_VERSION:"os.version",PROCESS_PID:"process.pid",PROCESS_EXECUTABLE_NAME:"process.executable.name",PROCESS_EXECUTABLE_PATH:"process.executable.path",PROCESS_COMMAND:"process.command",PROCESS_COMMAND_LINE:"process.command_line",PROCESS_COMMAND_ARGS:"process.command_args",PROCESS_OWNER:"process.owner",PROCESS_RUNTIME_NAME:"process.runtime.name",PROCESS_RUNTIME_VERSION:"process.runtime.version",PROCESS_RUNTIME_DESCRIPTION:"process.runtime.description",SERVICE_NAME:"service.name",SERVICE_NAMESPACE:"service.namespace",SERVICE_INSTANCE_ID:"service.instance.id",SERVICE_VERSION:"service.version",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version",TELEMETRY_AUTO_VERSION:"telemetry.auto.version",WEBENGINE_NAME:"webengine.name",WEBENGINE_VERSION:"webengine.version",WEBENGINE_DESCRIPTION:"webengine.description"},Rd={CPP:"cpp",DOTNET:"dotnet",ERLANG:"erlang",GO:"go",JAVA:"java",NODEJS:"nodejs",PHP:"php",PYTHON:"python",RUBY:"ruby",WEBJS:"webjs"},Lt,Fn=(Lt={},Lt[ue.TELEMETRY_SDK_NAME]="opentelemetry",Lt[ue.PROCESS_RUNTIME_NAME]="browser",Lt[ue.TELEMETRY_SDK_LANGUAGE]=Rd.WEBJS,Lt[ue.TELEMETRY_SDK_VERSION]=Nd,Lt);var Id=9,Cd=6,Pd=Math.pow(10,Cd),fn=Math.pow(10,Id);function ct(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Pd);return[r,n]}function Ji(){var t=Bt.timeOrigin;if(typeof t!="number"){var e=Bt;t=e.timing&&e.timing.fetchStart}return t}function so(t){var e=ct(Ji()),r=ct(typeof t=="number"?t:Bt.now());return oo(e,r)}function rr(t){if(Qi(t))return t;if(typeof t=="number")return t<Ji()?so(t):ct(t);if(t instanceof Date)return ct(t.getTime());throw TypeError("Invalid input type")}function xd(t,e){var r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=fn),[r,n]}function we(t){return t[0]*fn+t[1]}function Da(t){return Math.round(t[0]*1e6+t[1]/1e3)}function Qi(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function ka(t){return Qi(t)||typeof t=="number"||t instanceof Date}function oo(t,e){var r=[t[0]+e[0],t[1]+e[1]];return r[1]>=fn&&(r[1]-=fn,r[0]+=1),r}var Ne;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Ne||(Ne={}));var Ld=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Md=function(){function t(e){e===void 0&&(e={});var r;this._propagators=(r=e.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,i){return n.concat(i)},[])))}return t.prototype.inject=function(e,r,n){var i,a;try{for(var s=Ld(this._propagators),o=s.next();!o.done;o=s.next()){var c=o.value;try{c.inject(e,r,n)}catch(u){C.warn("Failed to inject with "+c.constructor.name+". Err: "+u.message)}}}catch(u){i={error:u}}finally{try{o&&!o.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}},t.prototype.extract=function(e,r,n){return this._propagators.reduce(function(i,a){try{return a.extract(i,r,n)}catch(s){C.warn("Failed to inject with "+a.constructor.name+". Err: "+s.message)}return i},e)},t.prototype.fields=function(){return this._fields.slice()},t}(),pi="[_0-9a-z-*/]",Dd="[a-z]"+pi+"{0,255}",kd="[a-z0-9]"+pi+"{0,240}@[a-z]"+pi+"{0,13}",Ud=new RegExp("^(?:"+Dd+"|"+kd+")$"),Bd=/^[ -~]{0,255}[!-~]$/,jd=/,|=/;function Vd(t){return Ud.test(t)}function $d(t){return Bd.test(t)&&!jd.test(t)}var Ua=32,Gd=512,Ba=",",ja="=",Zd=function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+ja+e.get(n)),r},[]).join(Ba)},t.prototype._parse=function(e){e.length>Gd||(this._internalState=e.split(Ba).reverse().reduce(function(r,n){var i=n.trim(),a=i.indexOf(ja);if(a!==-1){var s=i.slice(0,a),o=i.slice(a+1,n.length);Vd(s)&&$d(o)&&r.set(s,o)}return r},new Map),this._internalState.size>Ua&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Ua))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t}(),Kn="traceparent",Hn="tracestate",zd="00",Fd="(?!ff)[\\da-f]{2}",Kd="(?![0]{32})[\\da-f]{32}",Hd="(?![0]{16})[\\da-f]{16}",Xd="[\\da-f]{2}",Yd=new RegExp("^\\s?("+Fd+")-("+Kd+")-("+Hd+")-("+Xd+")(-.*)?\\s?$");function Wd(t){var e=Yd.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var qd=function(){function t(){}return t.prototype.inject=function(e,r,n){var i=ye.getSpanContext(e);if(!(!i||qi(e)||!br(i))){var a=zd+"-"+i.traceId+"-"+i.spanId+"-0"+Number(i.traceFlags||Pe.NONE).toString(16);n.set(r,Kn,a),i.traceState&&n.set(r,Hn,i.traceState.serialize())}},t.prototype.extract=function(e,r,n){var i=n.get(r,Kn);if(!i)return e;var a=Array.isArray(i)?i[0]:i;if(typeof a!="string")return e;var s=Wd(a);if(!s)return e;s.isRemote=!0;var o=n.get(r,Hn);if(o){var c=Array.isArray(o)?o.join(","):o;s.traceState=new Zd(typeof c=="string"?c:void 0)}return ye.setSpanContext(e,s)},t.prototype.fields=function(){return[Kn,Hn]},t}(),Jd="[object Object]",Qd="[object Null]",ep="[object Undefined]",tp=Function.prototype,uo=tp.toString,rp=uo.call(Object),np=ip(Object.getPrototypeOf,Object),co=Object.prototype,lo=co.hasOwnProperty,Tt=Symbol?Symbol.toStringTag:void 0,fo=co.toString;function ip(t,e){return function(r){return t(e(r))}}function Va(t){if(!ap(t)||sp(t)!==Jd)return!1;var e=np(t);if(e===null)return!0;var r=lo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&uo.call(r)===rp}function ap(t){return t!=null&&typeof t=="object"}function sp(t){return t==null?t===void 0?ep:Qd:Tt&&Tt in Object(t)?op(t):up(t)}function op(t){var e=lo.call(t,Tt),r=t[Tt],n=!1;try{t[Tt]=void 0,n=!0}catch{}var i=fo.call(t);return n&&(e?t[Tt]=r:delete t[Tt]),i}function up(t){return fo.call(t)}var cp=20;function lp(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=t.shift(),n=new WeakMap;t.length>0;)r=po(r,t.shift(),0,n);return r}function Xn(t){return dn(t)?t.slice():t}function po(t,e,r,n){r===void 0&&(r=0);var i;if(!(r>cp)){if(r++,Xr(t)||Xr(e)||ho(e))i=Xn(e);else if(dn(t)){if(i=t.slice(),dn(e))for(var a=0,s=e.length;a<s;a++)i.push(Xn(e[a]));else if(Yt(e))for(var o=Object.keys(e),a=0,s=o.length;a<s;a++){var c=o[a];i[c]=Xn(e[c])}}else if(Yt(t))if(Yt(e)){if(!fp(t,e))return e;i=Object.assign({},t);for(var o=Object.keys(e),a=0,s=o.length;a<s;a++){var c=o[a],u=e[c];if(Xr(u))typeof u>"u"?delete i[c]:i[c]=u;else{var d=i[c],y=u;if($a(t,c,n)||$a(e,c,n))delete i[c];else{if(Yt(d)&&Yt(y)){var R=n.get(d)||[],k=n.get(y)||[];R.push({obj:t,key:c}),k.push({obj:e,key:c}),n.set(d,R),n.set(y,k)}i[c]=po(i[c],u,r,n)}}}}else i=e;return i}}function $a(t,e,r){for(var n=r.get(t[e])||[],i=0,a=n.length;i<a;i++){var s=n[i];if(s.key===e&&s.obj===t)return!0}return!1}function dn(t){return Array.isArray(t)}function ho(t){return typeof t=="function"}function Yt(t){return!Xr(t)&&!dn(t)&&!ho(t)&&typeof t=="object"}function Xr(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function fp(t,e){return!(!Va(t)||!Va(e))}function dp(t,e){return typeof e=="string"?t===e:!!t.match(e)}var pp=function(){function t(){var e=this;this._promise=new Promise(function(r,n){e._resolve=r,e._reject=n})}return Object.defineProperty(t.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),t.prototype.resolve=function(e){this._resolve(e)},t.prototype.reject=function(e){this._reject(e)},t}(),hp=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},_p=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},ea=function(){function t(e,r){this._callback=e,this._that=r,this._isCalled=!1,this._deferred=new pp}return Object.defineProperty(t.prototype,"isCalled",{get:function(){return this._isCalled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"promise",{get:function(){return this._deferred.promise},enumerable:!1,configurable:!0}),t.prototype.call=function(){for(var e,r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(!this._isCalled){this._isCalled=!0;try{Promise.resolve((e=this._callback).call.apply(e,_p([this._that],hp(n),!1))).then(function(a){return r._deferred.resolve(a)},function(a){return r._deferred.reject(a)})}catch(a){this._deferred.reject(a)}}return this._deferred.promise},t}();function vp(t,e){return new Promise(function(r){Be.with(Js(Be.active()),function(){t.export(e,function(n){r(n)})})})}var yp={_export:vp},mp="exception",gp=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ep=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},ta=function(){function t(e,r,n,i,a,s,o,c,u){o===void 0&&(o=[]),this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:cn.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=s,this.kind=a,this.links=o;var d=Date.now();this._performanceStartTime=Bt.now(),this._performanceOffset=d-(this._performanceStartTime+Ji()),this._startTimeProvided=c!=null,this.startTime=this._getTime(c??d),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,r),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return r==null||this._isSpanEnded()?this:e.length===0?(C.warn("Invalid attribute key: "+e),this):ro(r)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(C.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var i=gp(Object.entries(e)),a=i.next();!a.done;a=i.next()){var s=Ep(a.value,2),o=s[0],c=s[1];this.setAttribute(o,c)}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return this},t.prototype.addEvent=function(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return C.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(C.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),ka(r)&&(ka(n)||(n=r),r=void 0);var i=Hr(r);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=e,this)},t.prototype.updateName=function(e){return this._isSpanEnded()?this:(this.name=e,this)},t.prototype.end=function(e){if(this._isSpanEnded()){C.error("You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(e),this._duration=xd(this.startTime,this.endTime),this._duration[0]<0&&(C.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<Bt.now())return so(e+this._performanceOffset);if(typeof e=="number")return ct(e);if(e instanceof Date)return ct(e.getTime());if(Qi(e))return e;if(this._startTimeProvided)return ct(Date.now());var r=Bt.now()-this._performanceStartTime;return oo(this.startTime,ct(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[We.EXCEPTION_MESSAGE]=e:e&&(e.code?n[We.EXCEPTION_TYPE]=e.code.toString():e.name&&(n[We.EXCEPTION_TYPE]=e.name),e.message&&(n[We.EXCEPTION_MESSAGE]=e.message),e.stack&&(n[We.EXCEPTION_STACKTRACE]=e.stack)),n[We.EXCEPTION_TYPE]||n[We.EXCEPTION_MESSAGE]?this.addEvent(mp,n,r):C.warn("Failed to record an exception "+e)},Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:function(){return this._ended},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:function(){return this._droppedAttributesCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:function(){return this._droppedEventsCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:function(){return this._droppedLinksCount},enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&C.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(e,r){return e.length<=r?e:e.substr(0,r)},t.prototype._truncateToSize=function(e){var r=this,n=this._attributeValueLengthLimit;return n<=0?(C.warn("Attribute value limit must be positive, got "+n),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(function(i){return typeof i=="string"?r._truncateToLimitUtil(i,n):i}):e},t}(),vt;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(vt||(vt={}));var Gt=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:vt.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t}(),ft=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:vt.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t}(),nr=function(){function t(e){var r,n,i,a;this._root=e.root,this._root||(At(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ft),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new ft,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new Gt,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new ft,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new Gt}return t.prototype.shouldSample=function(e,r,n,i,a,s){var o=ye.getSpanContext(e);return!o||!br(o)?this._root.shouldSample(e,r,n,i,a,s):o.isRemote?o.traceFlags&Pe.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,a,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,a,s):o.traceFlags&Pe.SAMPLED?this._localParentSampled.shouldSample(e,r,n,i,a,s):this._localParentNotSampled.shouldSample(e,r,n,i,a,s)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t}(),pn=function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return t.prototype.shouldSample=function(e,r){return{decision:Yi(r)&&this._accumulate(r)<this._upperBound?vt.RECORD_AND_SAMPLED:vt.NOT_RECORD}},t.prototype.toString=function(){return"TraceIdRatioBased{"+this._ratio+"}"},t.prototype._normalize=function(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n<e.length/8;n++){var i=n*8,a=parseInt(e.slice(i,i+8),16);r=(r^a)>>>0}return r},t}(),Tp=re(),Sp=Me.AlwaysOn,Mt=1;function _o(){return{sampler:vo(Tp),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:re().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:re().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:re().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:re().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:re().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:re().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:re().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:re().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}function vo(t){switch(t===void 0&&(t=re()),t.OTEL_TRACES_SAMPLER){case Me.AlwaysOn:return new ft;case Me.AlwaysOff:return new Gt;case Me.ParentBasedAlwaysOn:return new nr({root:new ft});case Me.ParentBasedAlwaysOff:return new nr({root:new Gt});case Me.TraceIdRatio:return new pn(Ga(t));case Me.ParentBasedTraceIdRatio:return new nr({root:new pn(Ga(t))});default:return C.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Sp+'".'),new ft}}function Ga(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return C.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+Mt+"."),Mt;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(C.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+Mt+"."),Mt):e<0||e>1?(C.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+Mt+"."),Mt):e}function Op(t){var e={sampler:vo()},r=_o(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function Ap(t){var e,r,n,i,a,s,o,c,u,d,y,R,k=Object.assign({},t.spanLimits),z=wd();return k.attributeCountLimit=(s=(a=(i=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:z.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&a!==void 0?a:z.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:fi,k.attributeValueLengthLimit=(R=(y=(d=(c=(o=t.spanLimits)===null||o===void 0?void 0:o.attributeValueLengthLimit)!==null&&c!==void 0?c:(u=t.generalLimits)===null||u===void 0?void 0:u.attributeValueLengthLimit)!==null&&d!==void 0?d:z.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&y!==void 0?y:z.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&R!==void 0?R:li,Object.assign({},t,{spanLimits:k})}var bp=function(){function t(e,r){this._exporter=e,this._finishedSpans=[],this._droppedSpansCount=0;var n=re();this._maxExportBatchSize=typeof(r==null?void 0:r.maxExportBatchSize)=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(r==null?void 0:r.maxQueueSize)=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(r==null?void 0:r.scheduledDelayMillis)=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(r==null?void 0:r.exportTimeoutMillis)=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new ea(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(C.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&Pe.SAMPLED&&this._addToBuffer(e)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var e=this;return Promise.resolve().then(function(){return e.onShutdown()}).then(function(){return e._flushAll()}).then(function(){return e._exporter.shutdown()})},t.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&C.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(C.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},t.prototype._flushAll=function(){var e=this;return new Promise(function(r,n){for(var i=[],a=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize),s=0,o=a;s<o;s++)i.push(e._flushOneBatch());Promise.all(i).then(function(){r()}).catch(n)})},t.prototype._flushOneBatch=function(){var e=this;return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise(function(r,n){var i=setTimeout(function(){n(new Error("Timeout"))},e._exportTimeoutMillis);Be.with(Js(Be.active()),function(){var a=e._finishedSpans.splice(0,e._maxExportBatchSize),s=function(){return e._exporter.export(a,function(c){var u;clearTimeout(i),c.code===Ne.SUCCESS?r():n((u=c.error)!==null&&u!==void 0?u:new Error("BatchSpanProcessor: span export failed"))})},o=a.map(function(c){return c.resource}).filter(function(c){return c.asyncAttributesPending});o.length===0?s():Promise.all(o.map(function(c){var u;return(u=c.waitForAsyncAttributes)===null||u===void 0?void 0:u.call(c)})).then(s,function(c){At(c),n(c)})})})},t.prototype._maybeStartTimer=function(){var e=this;this._timer===void 0&&(this._timer=setTimeout(function(){e._flushOneBatch().then(function(){e._finishedSpans.length>0&&(e._clearTimer(),e._maybeStartTimer())}).catch(function(r){At(r)})},this._scheduledDelayMillis),this._timer,void 0)},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t}(),wp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ra=function(t){wp(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.onInit(n),i}return e.prototype.onInit=function(r){var n=this;(r==null?void 0:r.disableAutoFlushOnDocumentHide)!==!0&&typeof document<"u"&&(this._visibilityChangeListener=function(){document.visibilityState==="hidden"&&n.forceFlush()},this._pageHideListener=function(){n.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))},e.prototype.onShutdown=function(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))},e}(bp),Np=8,Rp=16,na=function(){function t(){this.generateTraceId=Za(Rp),this.generateSpanId=Za(Np)}return t}(),Mr=Array(32);function Za(t){return function(){for(var r=0;r<t*2;r++)Mr[r]=Math.floor(Math.random()*16)+48,Mr[r]>=58&&(Mr[r]+=39);return String.fromCharCode.apply(null,Mr.slice(0,t*2))}}var ia=function(){function t(e,r,n){this._tracerProvider=n;var i=Op(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new na,this.resource=n.resource,this.instrumentationLibrary=e}return t.prototype.startSpan=function(e,r,n){var i,a,s;r===void 0&&(r={}),n===void 0&&(n=Be.active()),r.root&&(n=ye.deleteSpan(n));var o=ye.getSpan(n);if(qi(n)){C.debug("Instrumentation suppressed, returning Noop Span");var c=ye.wrapSpanContext(Fi);return c}var u=o==null?void 0:o.spanContext(),d=this._idGenerator.generateSpanId(),y,R,k;!u||!ye.isSpanContextValid(u)?y=this._idGenerator.generateTraceId():(y=u.traceId,R=u.traceState,k=u.spanId);var z=(i=r.kind)!==null&&i!==void 0?i:un.INTERNAL,Z=((a=r.links)!==null&&a!==void 0?a:[]).map(function(Kt){return{context:Kt.context,attributes:Hr(Kt.attributes)}}),xe=Hr(r.attributes),me=this._sampler.shouldSample(n,y,e,z,xe,Z);R=(s=me.traceState)!==null&&s!==void 0?s:R;var Ct=me.decision===gr.RECORD_AND_SAMPLED?Pe.SAMPLED:Pe.NONE,tt={traceId:y,spanId:d,traceFlags:Ct,traceState:R};if(me.decision===gr.NOT_RECORD){C.debug("Recording is off, propagating context in a non-recording span");var c=ye.wrapSpanContext(tt);return c}var W=new ta(this,n,e,tt,z,k,Z,r.startTime),Nr=Hr(Object.assign(xe,me.attributes));return W.setAttributes(Nr),W},t.prototype.startActiveSpan=function(e,r,n,i){var a,s,o;if(!(arguments.length<2)){arguments.length===2?o=r:arguments.length===3?(a=r,o=n):(a=r,s=n,o=i);var c=s??Be.active(),u=this.startSpan(e,a,c),d=ye.setSpan(c,u);return Be.with(d,o,void 0,u)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t}();function yo(){return"unknown_service"}var Ip=function(){function t(){}return t.prototype.detect=function(){return new Ee({})},t}(),aa=new Ip,Cp=function(){function t(){}return t.prototype.detect=function(){return Promise.resolve(aa.detect())},t}(),bn=new Cp,Pp=bn,xp=bn,Lp=aa,Mp=aa,Dp=bn,kp=bn,at=function(){return at=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},at.apply(this,arguments)},Up=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(d){try{u(n.next(d))}catch(y){s(y)}}function c(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})},Bp=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},jp=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Ee=function(){function t(e,r){var n=this,i;this._attributes=e,this.asyncAttributesPending=r!=null,this._syncAttributes=(i=this._attributes)!==null&&i!==void 0?i:{},this._asyncAttributesPromise=r==null?void 0:r.then(function(a){return n._attributes=Object.assign({},n._attributes,a),n.asyncAttributesPending=!1,a},function(a){return C.debug("a resource's async attributes promise rejected: %s",a),n.asyncAttributesPending=!1,{}})}return t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t((e={},e[ue.SERVICE_NAME]=yo(),e[ue.TELEMETRY_SDK_LANGUAGE]=Fn[ue.TELEMETRY_SDK_LANGUAGE],e[ue.TELEMETRY_SDK_NAME]=Fn[ue.TELEMETRY_SDK_NAME],e[ue.TELEMETRY_SDK_VERSION]=Fn[ue.TELEMETRY_SDK_VERSION],e))},Object.defineProperty(t.prototype,"attributes",{get:function(){var e;return this.asyncAttributesPending&&C.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}},enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return Up(this,void 0,void 0,function(){return Bp(this,function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.merge=function(e){var r=this,n;if(!e)return this;var i=at(at({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(i);var a=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(function(s){var o,c=jp(s,2),u=c[0],d=c[1];return at(at(at(at({},r._syncAttributes),u),(o=e._syncAttributes)!==null&&o!==void 0?o:e.attributes),d)});return new t(i,a)},t.EMPTY=new t({}),t}(),Vp=function(){function t(){}return t.prototype.detect=function(e){return Promise.resolve(go.detect(e))},t}(),$p=new Vp,Gp=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zp=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},zp=function(){function t(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}return t.prototype.detect=function(e){var r={},n=re(),i=n.OTEL_RESOURCE_ATTRIBUTES,a=n.OTEL_SERVICE_NAME;if(i)try{var s=this._parseResourceAttributes(i);Object.assign(r,s)}catch(o){C.debug("EnvDetector failed: "+o.message)}return a&&(r[ue.SERVICE_NAME]=a),new Ee(r)},t.prototype._parseResourceAttributes=function(e){var r,n;if(!e)return{};var i={},a=e.split(this._COMMA_SEPARATOR,-1);try{for(var s=Gp(a),o=s.next();!o.done;o=s.next()){var c=o.value,u=c.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(u.length===2){var d=Zp(u,2),y=d[0],R=d[1];if(y=y.trim(),R=R.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(y))throw new Error("Attribute key "+this._ERROR_MESSAGE_INVALID_CHARS);if(!this._isValid(R))throw new Error("Attribute value "+this._ERROR_MESSAGE_INVALID_VALUE);i[y]=decodeURIComponent(R)}}}catch(k){r={error:k}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},t.prototype._isValid=function(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)},t.prototype._isBaggageOctetString=function(e){for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<33||n===44||n===59||n===92||n>126)return!1}return!0},t.prototype._isValidAndNotEmpty=function(e){return e.length>0&&this._isValid(e)},t}(),mo=new zp,Fp=function(){function t(){}return t.prototype.detect=function(e){return Promise.resolve(mo.detect(e))},t}(),Kp=new Fp,hi=function(){return hi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},hi.apply(this,arguments)},Hp=function(){function t(){}return t.prototype.detect=function(e){var r,n=typeof navigator<"u";if(!n)return Ee.empty();var i=(r={},r[ue.PROCESS_RUNTIME_NAME]="browser",r[ue.PROCESS_RUNTIME_DESCRIPTION]="Web Browser",r[ue.PROCESS_RUNTIME_VERSION]=navigator.userAgent,r);return this._getResourceAttributes(i,e)},t.prototype._getResourceAttributes=function(e,r){return e[ue.PROCESS_RUNTIME_VERSION]===""?(C.debug("BrowserDetector failed: Unable to find required browser resources. "),Ee.empty()):new Ee(hi({},e))},t}(),go=new Hp,Xp=function(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"},_i=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(d){try{u(n.next(d))}catch(y){s(y)}}function c(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})},vi=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Yp=function(t){return t===void 0&&(t={}),_i(void 0,void 0,void 0,function(){var e;return vi(this,function(r){switch(r.label){case 0:return[4,Promise.all((t.detectors||[]).map(function(n){return _i(void 0,void 0,void 0,function(){var i,a;return vi(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.detect(t)];case 1:return i=s.sent(),C.debug(n.constructor.name+" found resource.",i),[2,i];case 2:return a=s.sent(),C.debug(n.constructor.name+" failed: "+a.message),[2,Ee.empty()];case 3:return[2]}})})}))];case 1:return e=r.sent(),Eo(e),[2,e.reduce(function(n,i){return n.merge(i)},Ee.empty())]}})})},Wp=function(t){var e;t===void 0&&(t={});var r=((e=t.detectors)!==null&&e!==void 0?e:[]).map(function(i){try{var a=i.detect(t),s;if(Xp(a)){var o=function(){return _i(void 0,void 0,void 0,function(){var c;return vi(this,function(u){switch(u.label){case 0:return[4,a];case 1:return c=u.sent(),[2,c.attributes]}})})};s=new Ee({},o())}else s=a;return s.waitForAsyncAttributes?s.waitForAsyncAttributes().then(function(){return C.debug(i.constructor.name+" found resource.",s)}):C.debug(i.constructor.name+" found resource.",s),s}catch(c){return C.error(i.constructor.name+" failed: "+c.message),Ee.empty()}}),n=r.reduce(function(i,a){return i.merge(a)},Ee.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(function(){Eo(r)}),n},Eo=function(t){t.forEach(function(e){if(Object.keys(e.attributes).length>0){var r=JSON.stringify(e.attributes,null,4);C.verbose(r)}})};const qp=Object.freeze(Object.defineProperty({__proto__:null,Resource:Ee,browserDetector:$p,browserDetectorSync:go,defaultServiceName:yo,detectResources:Yp,detectResourcesSync:Wp,envDetector:Kp,envDetectorSync:mo,hostDetector:Pp,hostDetectorSync:Lp,osDetector:xp,osDetectorSync:Mp,processDetector:Dp,processDetectorSync:kp},Symbol.toStringTag,{value:"Module"}));var Dr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Jp=function(){function t(e){this._spanProcessors=e}return t.prototype.forceFlush=function(){var e,r,n=[];try{for(var i=Dr(this._spanProcessors),a=i.next();!a.done;a=i.next()){var s=a.value;n.push(s.forceFlush())}}catch(o){e={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return new Promise(function(o){Promise.all(n).then(function(){o()}).catch(function(c){At(c||new Error("MultiSpanProcessor: forceFlush failed")),o()})})},t.prototype.onStart=function(e,r){var n,i;try{for(var a=Dr(this._spanProcessors),s=a.next();!s.done;s=a.next()){var o=s.value;o.onStart(e,r)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(e){var r,n;try{for(var i=Dr(this._spanProcessors),a=i.next();!a.done;a=i.next()){var s=a.value;s.onEnd(e)}}catch(o){r={error:o}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},t.prototype.shutdown=function(){var e,r,n=[];try{for(var i=Dr(this._spanProcessors),a=i.next();!a.done;a=i.next()){var s=a.value;n.push(s.shutdown())}}catch(o){e={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return new Promise(function(o,c){Promise.all(n).then(function(){o()},c)})},t}(),sa=function(){function t(){}return t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t}(),qe;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(qe||(qe={}));var oa=function(){function t(e){e===void 0&&(e={});var r;this._registeredSpanProcessors=[],this._tracers=new Map;var n=lp({},_o(),Ap(e));this.resource=(r=n.resource)!==null&&r!==void 0?r:Ee.empty(),this.resource=Ee.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});var i=this._buildExporterFromEnv();if(i!==void 0){var a=new ra(i);this.activeSpanProcessor=a}else this.activeSpanProcessor=new sa}return t.prototype.getTracer=function(e,r,n){var i=e+"@"+(r||"")+":"+((n==null?void 0:n.schemaUrl)||"");return this._tracers.has(i)||this._tracers.set(i,new ia({name:e,version:r,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this)),this._tracers.get(i)},t.prototype.addSpanProcessor=function(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(function(r){return C.error("Error while trying to shutdown current span processor",r)}),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new Jp(this._registeredSpanProcessors)},t.prototype.getActiveSpanProcessor=function(){return this.activeSpanProcessor},t.prototype.register=function(e){e===void 0&&(e={}),ye.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&Be.setGlobalContextManager(e.contextManager),e.propagator&&Ut.setGlobalPropagator(e.propagator)},t.prototype.forceFlush=function(){var e=this._config.forceFlushTimeoutMillis,r=this._registeredSpanProcessors.map(function(n){return new Promise(function(i){var a,s=setTimeout(function(){i(new Error("Span processor did not completed within timeout period of "+e+" ms")),a=qe.timeout},e);n.forceFlush().then(function(){clearTimeout(s),a!==qe.timeout&&(a=qe.resolved,i(a))}).catch(function(o){clearTimeout(s),a=qe.error,i(o)})})});return new Promise(function(n,i){Promise.all(r).then(function(a){var s=a.filter(function(o){return o!==qe.resolved});s.length>0?i(s):n()}).catch(function(a){return i([a])})})},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()},t.prototype._getSpanExporter=function(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()},t.prototype._buildPropagatorFromEnv=function(){var e=this,r=Array.from(new Set(re().OTEL_PROPAGATORS)),n=r.map(function(a){var s=e._getPropagator(a);return s||C.warn('Propagator "'+a+'" requested through environment variable is unavailable.'),s}),i=n.reduce(function(a,s){return s&&a.push(s),a},[]);if(i.length!==0)return r.length===1?i[0]:new Md({propagators:i})},t.prototype._buildExporterFromEnv=function(){var e=re().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||C.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new qd}],["baggage",function(){return new id}]]),t._registeredExporters=new Map,t}(),Qp=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},To=function(){function t(){}return t.prototype.export=function(e,r){return this._sendSpans(e,r)},t.prototype.shutdown=function(){return this._sendSpans([]),Promise.resolve()},t.prototype._exportInfo=function(e){var r;return{traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:Da(e.startTime),duration:Da(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}},t.prototype._sendSpans=function(e,r){var n,i;try{for(var a=Qp(e),s=a.next();!s.done;s=a.next()){var o=s.value;console.dir(this._exportInfo(o),{depth:3})}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}if(r)return r({code:Ne.SUCCESS})},t}(),eh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},th=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},So=function(){function t(){this._finishedSpans=[],this._stopped=!1}return t.prototype.export=function(e,r){var n;if(this._stopped)return r({code:Ne.FAILED,error:new Error("Exporter has been stopped")});(n=this._finishedSpans).push.apply(n,th([],eh(e),!1)),setTimeout(function(){return r({code:Ne.SUCCESS})},0)},t.prototype.shutdown=function(){return this._stopped=!0,this._finishedSpans=[],Promise.resolve()},t.prototype.reset=function(){this._finishedSpans=[]},t.prototype.getFinishedSpans=function(){return this._finishedSpans},t}(),rh=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(d){try{u(n.next(d))}catch(y){s(y)}}function c(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})},nh=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Oo=function(){function t(e){this._exporter=e,this._shutdownOnce=new ea(this._shutdown,this),this._unresolvedExports=new Set}return t.prototype.forceFlush=function(){return rh(this,void 0,void 0,function(){return nh(this,function(e){switch(e.label){case 0:return[4,Promise.all(Array.from(this._unresolvedExports))];case 1:return e.sent(),[2]}})})},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){var r=this,n,i;if(!this._shutdownOnce.isCalled&&e.spanContext().traceFlags&Pe.SAMPLED){var a=function(){return yp._export(r._exporter,[e]).then(function(o){var c;o.code!==Ne.SUCCESS&&At((c=o.error)!==null&&c!==void 0?c:new Error("SimpleSpanProcessor: span export failed (status "+o+")"))}).catch(function(o){At(o)})};if(e.resource.asyncAttributesPending){var s=(i=(n=e.resource).waitForAsyncAttributes)===null||i===void 0?void 0:i.call(n).then(function(){return s!=null&&r._unresolvedExports.delete(s),a()},function(o){return At(o)});s!=null&&this._unresolvedExports.add(s)}else a()}},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){return this._exporter.shutdown()},t}();const ih=Object.freeze(Object.defineProperty({__proto__:null,AlwaysOffSampler:Gt,AlwaysOnSampler:ft,BasicTracerProvider:oa,BatchSpanProcessor:ra,ConsoleSpanExporter:To,get ForceFlushState(){return qe},InMemorySpanExporter:So,NoopSpanProcessor:sa,ParentBasedSampler:nr,RandomIdGenerator:na,get SamplingDecision(){return vt},SimpleSpanProcessor:Oo,Span:ta,TraceIdRatioBasedSampler:pn,Tracer:ia},Symbol.toStringTag,{value:"Module"})),ah=zt(ih);var sh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},oh=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},Ao=function(){function t(){this._enabled=!1,this._currentContext=Et}return t.prototype._bindFunction=function(e,r){e===void 0&&(e=Et);var n=this,i=function(){for(var a=this,s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];return n.with(e,function(){return r.apply(a,s)})};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i},t.prototype.active=function(){return this._currentContext},t.prototype.bind=function(e,r){return e===void 0&&(e=this.active()),typeof r=="function"?this._bindFunction(e,r):r},t.prototype.disable=function(){return this._currentContext=Et,this._enabled=!1,this},t.prototype.enable=function(){return this._enabled?this:(this._enabled=!0,this._currentContext=Et,this)},t.prototype.with=function(e,r,n){for(var i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];var s=this._currentContext;this._currentContext=e||Et;try{return r.call.apply(r,oh([n],sh(i),!1))}finally{this._currentContext=s}},t}(),uh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ch=function(t){uh(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,r)||this;if(r.contextManager)throw"contextManager should be defined in register method not in constructor";if(r.propagator)throw"propagator should be defined in register method not in constructor";return n}return e.prototype.register=function(r){r===void 0&&(r={}),r.contextManager===void 0&&(r.contextManager=new Ao),r.contextManager&&r.contextManager.enable(),t.prototype.register.call(this,r)},e}(oa),Q;(function(t){t.CONNECT_END="connectEnd",t.CONNECT_START="connectStart",t.DECODED_BODY_SIZE="decodedBodySize",t.DOM_COMPLETE="domComplete",t.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",t.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",t.DOM_INTERACTIVE="domInteractive",t.DOMAIN_LOOKUP_END="domainLookupEnd",t.DOMAIN_LOOKUP_START="domainLookupStart",t.ENCODED_BODY_SIZE="encodedBodySize",t.FETCH_START="fetchStart",t.LOAD_EVENT_END="loadEventEnd",t.LOAD_EVENT_START="loadEventStart",t.NAVIGATION_START="navigationStart",t.REDIRECT_END="redirectEnd",t.REDIRECT_START="redirectStart",t.REQUEST_START="requestStart",t.RESPONSE_END="responseEnd",t.RESPONSE_START="responseStart",t.SECURE_CONNECTION_START="secureConnectionStart",t.UNLOAD_EVENT_END="unloadEventEnd",t.UNLOAD_EVENT_START="unloadEventStart"})(Q||(Q={}));var Yn;function lh(){return Yn||(Yn=document.createElement("a")),Yn}function bo(t,e){return e in t}function Le(t,e,r){if(bo(r,e)&&typeof r[e]=="number")return t.addEvent(e,r[e]),t}function fh(t,e){Le(t,Q.FETCH_START,e),Le(t,Q.DOMAIN_LOOKUP_START,e),Le(t,Q.DOMAIN_LOOKUP_END,e),Le(t,Q.CONNECT_START,e),Le(t,Q.SECURE_CONNECTION_START,e),Le(t,Q.CONNECT_END,e),Le(t,Q.REQUEST_START,e),Le(t,Q.RESPONSE_START,e),Le(t,Q.RESPONSE_END,e);var r=e[Q.ENCODED_BODY_SIZE];r!==void 0&&t.setAttribute(We.HTTP_RESPONSE_CONTENT_LENGTH,r);var n=e[Q.DECODED_BODY_SIZE];n!==void 0&&r!==n&&t.setAttribute(We.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,n)}function wo(t){return t.slice().sort(function(e,r){var n=e[Q.FETCH_START],i=r[Q.FETCH_START];return n>i?1:n<i?-1:0})}function dh(t,e,r,n,i,a){i===void 0&&(i=new WeakSet);var s=wn(t);t=s.toString();var o=hh(t,e,r,n,i,a);if(o.length===0)return{mainRequest:void 0};if(o.length===1)return{mainRequest:o[0]};var c=wo(o);if(s.origin!==location.origin&&c.length>1){var u=c[0],d=ph(c,u[Q.RESPONSE_END],r),y=u[Q.RESPONSE_END],R=d[Q.FETCH_START];return R<y&&(d=u,u=void 0),{corsPreFlightRequest:u,mainRequest:d}}else return{mainRequest:o[0]}}function ph(t,e,r){for(var n=we(r),i=we(rr(e)),a=t[1],s,o=t.length,c=1;c<o;c++){var u=t[c],d=we(rr(u[Q.FETCH_START])),y=we(rr(u[Q.RESPONSE_END])),R=n-y;d>=i&&(!s||R<s)&&(s=R,a=u)}return a}function hh(t,e,r,n,i,a){var s=we(e),o=we(r),c=n.filter(function(u){var d=we(rr(u[Q.FETCH_START])),y=we(rr(u[Q.RESPONSE_END]));return u.initiatorType.toLowerCase()===(a||"xmlhttprequest")&&u.name===t&&d>=s&&y<=o});return c.length>0&&(c=c.filter(function(u){return!i.has(u)})),c}function wn(t){if(typeof URL=="function")return new URL(t,typeof document<"u"?document.baseURI:location.href);var e=lh();return e.href=t,e}function _h(t){var e=wn(t);return e.href}function No(t,e){if(t.nodeType===Node.DOCUMENT_NODE)return"/";var r=yh(t,e);if(e&&r.indexOf("@id")>0)return r;var n="";return t.parentNode&&(n+=No(t.parentNode,!1)),n+=r,n}function vh(t){if(!t.parentNode)return 0;var e=[t.nodeType];t.nodeType===Node.CDATA_SECTION_NODE&&e.push(Node.TEXT_NODE);var r=Array.from(t.parentNode.childNodes);return r=r.filter(function(n){var i=n.localName;return e.indexOf(n.nodeType)>=0&&i===t.localName}),r.length>=1?r.indexOf(t)+1:0}function yh(t,e){var r=t.nodeType,n=vh(t),i="";if(r===Node.ELEMENT_NODE){var a=t.getAttribute("id");if(e&&a)return'//*[@id="'+a+'"]';i=t.localName}else if(r===Node.TEXT_NODE||r===Node.CDATA_SECTION_NODE)i="text()";else if(r===Node.COMMENT_NODE)i="comment()";else return"";return i&&n>1?"/"+i+"["+n+"]":"/"+i}function mh(t,e){var r=e||[];(typeof r=="string"||r instanceof RegExp)&&(r=[r]);var n=wn(t);return n.origin===location.origin?!0:r.some(function(i){return dp(t,i)})}const gh=Object.freeze(Object.defineProperty({__proto__:null,AlwaysOffSampler:Gt,AlwaysOnSampler:ft,BasicTracerProvider:oa,BatchSpanProcessor:ra,ConsoleSpanExporter:To,get ForceFlushState(){return qe},InMemorySpanExporter:So,NoopSpanProcessor:sa,ParentBasedSampler:nr,get PerformanceTimingNames(){return Q},RandomIdGenerator:na,get SamplingDecision(){return vt},SimpleSpanProcessor:Oo,Span:ta,StackContextManager:Ao,TraceIdRatioBasedSampler:pn,Tracer:ia,WebTracerProvider:ch,addSpanNetworkEvent:Le,addSpanNetworkEvents:fh,getElementXPath:No,getResource:dh,hasKey:bo,normalizeUrl:_h,parseUrl:wn,shouldPropagateTraceHeaders:mh,sortResources:wo},Symbol.toStringTag,{value:"Module"})),Eh=zt(gh);var Th=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Ro=1e4,Sh=5,Oh=1e3,Ah=5e3,bh=1.5;function wh(t){t===void 0&&(t={});var e={};return Object.entries(t).forEach(function(r){var n=Th(r,2),i=n[0],a=n[1];typeof a<"u"?e[i]=String(a):C.warn('Header "'+i+'" has wrong value and will be ignored')}),e}function Nh(t,e){return t.endsWith("/")||(t=t+"/"),t+e}function Rh(t){try{var e=new URL(t);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return C.warn("Could not parse export URL: '"+t+"'"),t}}function Ih(t){return typeof t=="number"?t<=0?Io(t,Ro):t:Ch()}function Ch(){var t,e=Number((t=re().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&t!==void 0?t:re().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?Io(e,Ro):e}function Io(t,e){return C.warn("Timeout must be greater than 0",t),e}function Ph(t){var e=[429,502,503,504];return e.includes(t)}function xh(t){if(t==null)return-1;var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;var r=new Date(t).getTime()-Date.now();return r>=0?r:0}var Lh=function(){function t(e){e===void 0&&(e={}),this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new ea(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:1/0,this.timeoutMillis=Ih(e.timeoutMillis),this.onInit(e)}return t.prototype.export=function(e,r){if(this._shutdownOnce.isCalled){r({code:Ne.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){r({code:Ne.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(function(){r({code:Ne.SUCCESS})}).catch(function(n){r({code:Ne.FAILED,error:n})})},t.prototype._export=function(e){var r=this;return new Promise(function(n,i){try{C.debug("items to be sent",e),r.send(e,n,i)}catch(a){i(a)}})},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){return C.debug("shutdown started"),this.onShutdown(),Promise.all(this._sendingPromises).then(function(){})},t}(),Mh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jt=function(t){Mh(e,t);function e(r,n,i){var a=t.call(this,r)||this;return a.name="OTLPExporterError",a.data=i,a.code=n,a}return e}(Error),hn=function(){return hn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},hn.apply(this,arguments)},Dh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function kh(t,e,r,n,i){if(navigator.sendBeacon(e,new Blob([t],r)))C.debug("sendBeacon - can send",t),n();else{var a=new Jt("sendBeacon - cannot send "+t);i(a)}}function Uh(t,e,r,n,i,a){var s,o,c=!1,u=setTimeout(function(){if(clearTimeout(s),c=!0,o.readyState===XMLHttpRequest.DONE){var y=new Jt("Request Timeout");a(y)}else o.abort()},n),d=function(y,R){y===void 0&&(y=Sh),R===void 0&&(R=Oh),o=new XMLHttpRequest,o.open("POST",e);var k={Accept:"application/json","Content-Type":"application/json"};Object.entries(hn(hn({},k),r)).forEach(function(z){var Z=Dh(z,2),xe=Z[0],me=Z[1];o.setRequestHeader(xe,me)}),o.send(t),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE&&c===!1)if(o.status>=200&&o.status<=299)C.debug("xhr success",t),i(),clearTimeout(u),clearTimeout(s);else if(o.status&&Ph(o.status)&&y>0){var z=void 0;R=bh*R,o.getResponseHeader("Retry-After")?z=xh(o.getResponseHeader("Retry-After")):z=Math.round(Math.random()*(Ah-R)+R),s=setTimeout(function(){d(y-1,R)},z)}else{var Z=new Jt("Failed to export with XHR (status: "+o.status+")",o.status);a(Z),clearTimeout(u),clearTimeout(s)}},o.onabort=function(){if(c){var z=new Jt("Request Timeout");a(z)}clearTimeout(u),clearTimeout(s)},o.onerror=function(){if(c){var z=new Jt("Request Timeout");a(z)}clearTimeout(u),clearTimeout(s)}};d()}var Bh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),jh=function(t){Bh(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,r)||this;return n._useXHR=!1,n._useXHR=!!r.headers||typeof navigator.sendBeacon!="function",n._useXHR?n._headers=Object.assign({},wh(r.headers),eo(re().OTEL_EXPORTER_OTLP_HEADERS)):n._headers={},n}return e.prototype.onInit=function(){window.addEventListener("unload",this.shutdown)},e.prototype.onShutdown=function(){window.removeEventListener("unload",this.shutdown)},e.prototype.send=function(r,n,i){var a=this;if(this._shutdownOnce.isCalled){C.debug("Shutdown already started. Cannot send objects");return}var s=this.convert(r),o=JSON.stringify(s),c=new Promise(function(d,y){a._useXHR?Uh(o,a.url,a._headers,a.timeoutMillis,d,y):kh(o,a.url,{type:"application/json"},d,y)}).then(n,i);this._sendingPromises.push(c);var u=function(){var d=a._sendingPromises.indexOf(c);a._sendingPromises.splice(d,1)};c.then(u,u)},e}(Lh),Vh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function Nn(t){return Object.keys(t).map(function(e){return Co(e,t[e])})}function Co(t,e){return{key:t,value:Po(e)}}function Po(t){var e=typeof t;return e==="string"?{stringValue:t}:e==="number"?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:e==="boolean"?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(Po)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(function(r){var n=Vh(r,2),i=n[0],a=n[1];return Co(i,a)})}}:{}}function $h(t,e){var r,n=t.spanContext(),i=t.status,a=e?t.parentSpanId:t.parentSpanId!=null?tr(t.parentSpanId):void 0;return{traceId:e?n.traceId:tr(n.traceId),spanId:e?n.spanId:tr(n.spanId),parentSpanId:a,traceState:(r=n.traceState)===null||r===void 0?void 0:r.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:we(t.startTime),endTimeUnixNano:we(t.endTime),attributes:Nn(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(Zh),droppedEventsCount:t.droppedEventsCount,status:{code:i.code,message:i.message},links:t.links.map(function(s){return Gh(s,e)}),droppedLinksCount:t.droppedLinksCount}}function Gh(t,e){var r;return{attributes:t.attributes?Nn(t.attributes):[],spanId:e?t.context.spanId:tr(t.context.spanId),traceId:e?t.context.traceId:tr(t.context.traceId),traceState:(r=t.context.traceState)===null||r===void 0?void 0:r.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}function Zh(t){return{attributes:t.attributes?Nn(t.attributes):[],name:t.name,timeUnixNano:we(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}var zh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function Kh(t,e){return{resourceSpans:Xh(t,e)}}function Hh(t){var e,r,n=new Map;try{for(var i=zh(t),a=i.next();!a.done;a=i.next()){var s=a.value,o=n.get(s.resource);o||(o=new Map,n.set(s.resource,o));var c=s.instrumentationLibrary.name+"@"+(s.instrumentationLibrary.version||"")+":"+(s.instrumentationLibrary.schemaUrl||""),u=o.get(c);u||(u=[],o.set(c,u)),u.push(s)}}catch(d){e={error:d}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}function Xh(t,e){for(var r=Hh(t),n=[],i=r.entries(),a=i.next();!a.done;){for(var s=Fh(a.value,2),o=s[0],c=s[1],u=[],d=c.values(),y=d.next();!y.done;){var R=y.value;if(R.length>0){var k=R[0].instrumentationLibrary,z=k.name,Z=k.version,xe=k.schemaUrl,me=R.map(function(tt){return $h(tt,e)});u.push({scope:{name:z,version:Z},spans:me,schemaUrl:xe})}y=d.next()}var Ct={resource:{attributes:Nn(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(Ct),a=i.next()}return n}var Yh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),xo="v1/traces",Wh="http://localhost:4318/"+xo,qh=function(t){Yh(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,r)||this;return n._headers=Object.assign(n._headers,eo(re().OTEL_EXPORTER_OTLP_TRACES_HEADERS)),n}return e.prototype.convert=function(r){return Kh(r,!0)},e.prototype.getDefaultUrl=function(r){return typeof r.url=="string"?r.url:re().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length>0?Rh(re().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT):re().OTEL_EXPORTER_OTLP_ENDPOINT.length>0?Nh(re().OTEL_EXPORTER_OTLP_ENDPOINT,xo):Wh},e}(jh);const Jh=Object.freeze(Object.defineProperty({__proto__:null,OTLPTraceExporter:qh},Symbol.toStringTag,{value:"Module"})),Qh=zt(Jh);function Lo(t){t===void 0&&(t=[]);for(var e=[],r=0,n=t.length;r<n;r++){var i=t[r];if(Array.isArray(i)){var a=Lo(i);e=e.concat(a.instrumentations)}else typeof i=="function"?e.push(new i):i.instrumentationName&&e.push(i)}return{instrumentations:e}}function e_(t,e,r){for(var n=0,i=t.length;n<i;n++){var a=t[n];e&&a.setTracerProvider(e),r&&a.setMeterProvider(r),a.getConfig().enabled||a.enable()}}function t_(t){t.forEach(function(e){return e.disable()})}function r_(t){var e=Lo(t.instrumentations).instrumentations,r=t.tracerProvider||ye.getTracerProvider(),n=t.meterProvider||An.getMeterProvider();return e_(e,r,n),function(){t_(e)}}function yi(t){return typeof t=="function"}var he=console.error.bind(console);function Wt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}function wr(t){t&&t.logger&&(yi(t.logger)?he=t.logger:he("new logger isn't a function, not replacing"))}function Mo(t,e,r){if(!t||!t[e]){he("no original function "+e+" to wrap");return}if(!r){he("no wrapper function"),he(new Error().stack);return}if(!yi(t[e])||!yi(r)){he("original object and wrapper must be functions");return}var n=t[e],i=r(n,e);return Wt(i,"__original",n),Wt(i,"__unwrap",function(){t[e]===i&&Wt(t,e,n)}),Wt(i,"__wrapped",!0),Wt(t,e,i),i}function n_(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{he("must provide one or more modules to patch"),he(new Error().stack);return}if(!(e&&Array.isArray(e))){he("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(i){Mo(n,i,r)})})}function Do(t,e){if(!t||!t[e]){he("no function to unwrap."),he(new Error().stack);return}if(!t[e].__unwrap)he("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}function i_(t,e){if(t)Array.isArray(t)||(t=[t]);else{he("must provide one or more modules to patch"),he(new Error().stack);return}if(!(e&&Array.isArray(e))){he("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Do(r,n)})})}wr.wrap=Mo;wr.massWrap=n_;wr.unwrap=Do;wr.massUnwrap=i_;var kr=wr,mi=function(){return mi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},mi.apply(this,arguments)},a_=function(){function t(e,r,n){n===void 0&&(n={}),this.instrumentationName=e,this.instrumentationVersion=r,this._wrap=kr.wrap,this._unwrap=kr.unwrap,this._massWrap=kr.massWrap,this._massUnwrap=kr.massUnwrap,this._config=mi({enabled:!0},n),this._diag=C.createComponentLogger({namespace:e}),this._tracer=ye.getTracer(e,r),this._meter=An.getMeter(e,r),this._updateMetricInstruments()}return Object.defineProperty(t.prototype,"meter",{get:function(){return this._meter},enumerable:!1,configurable:!0}),t.prototype.setMeterProvider=function(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()},t.prototype._updateMetricInstruments=function(){},t.prototype.getConfig=function(){return this._config},t.prototype.setConfig=function(e){e===void 0&&(e={}),this._config=Object.assign({},e)},t.prototype.setTracerProvider=function(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)},Object.defineProperty(t.prototype,"tracer",{get:function(){return this._tracer},enumerable:!1,configurable:!0}),t}(),s_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),o_=function(t){s_(e,t);function e(r,n,i){i===void 0&&(i={});var a=t.call(this,r,n,i)||this;return a._config.enabled&&a.enable(),a}return e}(a_),u_=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(d){try{u(n.next(d))}catch(y){s(y)}}function c(d){try{u(n.throw(d))}catch(y){s(y)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})},c_=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};function l_(t,e,r){var n,i;try{i=t()}catch(a){n=a}finally{if(e(n,i),n&&!r)throw n;return i}}function f_(t,e,r){return u_(this,void 0,void 0,function(){var n,i,a;return c_(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,3,4]),[4,t()];case 1:return i=s.sent(),[3,4];case 2:return a=s.sent(),n=a,[3,4];case 3:if(e(n,i),n&&!r)throw n;return[2,i];case 4:return[2]}})})}function d_(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}const p_=Object.freeze(Object.defineProperty({__proto__:null,InstrumentationBase:o_,isWrapped:d_,registerInstrumentations:r_,safeExecuteInTheMiddle:l_,safeExecuteInTheMiddleAsync:f_},Symbol.toStringTag,{value:"Module"})),h_=zt(p_);var ko={},dt={};const __=zt(qp);Object.defineProperty(dt,"__esModule",{value:!0});dt.parseDsn=dt.Dsn=dt.createResource=void 0;var za=__;function v_(t,e,r,n,i){if(t)return t;var a={};return e&&Object.assign(a,e),r&&(a["service.name"]=r),n&&(a["service.version"]=n),i&&(a["deployment.environment"]=i),t=za.Resource.default(),Object.keys(a).length?t.merge(new za.Resource(a)):t}dt.createResource=v_;var Uo=function(){function t(e){if(this.str="",this.scheme="",this.host="",this.projectId="",this.token="",!e)throw new Error("either dsn option or UPTRACE_DSN is required");var r;try{r=new URL(e)}catch{throw new Error("can't parse DSN=".concat(JSON.stringify(e)))}this.str=e,this.scheme=r.protocol,this.host=r.host,this.host==="api.uptrace.dev"&&(this.host="uptrace.dev"),this.host==="uptrace.dev"&&(this.projectId=r.pathname.slice(1),this.token=r.username)}return t.prototype.toString=function(){return this.str},t.prototype.appAddr=function(){return this.host==="uptrace.dev"?"https://app.uptrace.dev":"".concat(this.scheme,"//").concat(this.host)},t.prototype.otlpAddr=function(){return this.host==="uptrace.dev"?"https://otlp.uptrace.dev":"".concat(this.scheme,"//").concat(this.host)},t}();dt.Dsn=Uo;function y_(t){return new Uo(t)}dt.parseDsn=y_;var Zt={};const m_=zt(Wf);Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createClient=Zt.Client=void 0;var Wn=m_,g_="__dummy__",Bo=function(){function t(e){this._dsn=e}return t.prototype.traceUrl=function(e){var r,n=e.spanContext(),i=(r=n==null?void 0:n.traceId)!==null&&r!==void 0?r:"<no span>";return"".concat(this._dsn.appAddr(),"/traces/").concat(i)},t.prototype.reportException=function(e,r){r===void 0&&(r={});var n=!1,i=this._internalTracer(),a=Wn.trace.getSpan(Wn.context.active());a||(a=i.startSpan(g_),n=!0),typeof e=="string"?r["exception.message"]=e:(r["exception.type"]=e.name,r["exception.message"]=e.message,r["exception.stacktrace"]=e.stack),a.addEvent("exception",r),n&&a.end()},t.prototype._internalTracer=function(){return this._tracer||(this._tracer=Wn.trace.getTracer("uptrace-js")),this._tracer},t}();Zt.Client=Bo;function E_(t){return new Bo(t)}Zt.createClient=E_;var jo={};Object.defineProperty(jo,"__esModule",{value:!0});var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.VERSION=void 0;Rn.VERSION="1.11.1";(function(t){var e=ut&&ut.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=ut&&ut.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(dt,t),r(Zt,t),r(jo,t),r(Rn,t)})(ko);Object.defineProperty(ke,"__esModule",{value:!0});ke.WindowAttributesProcessor=ke.configureOpentelemetry=ke.traceUrl=ke.reportException=void 0;var T_=ah,S_=Eh,O_=Qh,A_=h_,Er=ko,gi=typeof window<"u",ua=(0,Er.createClient)((0,Er.parseDsn)("https://<key>@uptrace.dev/<project_id>"));function Ei(t,e){e===void 0&&(e={}),ua.reportException(t,e)}ke.reportException=Ei;function b_(t){return ua.traceUrl(t)}ke.traceUrl=b_;function w_(t){N_(t),R_(t),gi&&I_()}ke.configureOpentelemetry=w_;function N_(t){var e,r,n;t.resource=(0,Er.createResource)(t.resource,t.resourceAttributes,(e=t.serviceName)!==null&&e!==void 0?e:"",(r=t.serviceVersion)!==null&&r!==void 0?r:"",(n=t.deploymentEnvironment)!==null&&n!==void 0?n:"")}function R_(t){!t.dsn&&gi&&window.UPTRACE_DSN&&(t.dsn=window.UPTRACE_DSN);var e;try{e=(0,Er.parseDsn)(t.dsn)}catch(a){console.error("Uptrace is disabled:",String(a));return}ua=(0,Er.createClient)(e);var r=new O_.OTLPTraceExporter({url:"".concat(e.otlpAddr(),"/v1/traces"),headers:{"uptrace-dsn":t.dsn}}),n=new T_.BatchSpanProcessor(r,{maxExportBatchSize:1e3,maxQueueSize:1e3,scheduledDelayMillis:5*1e3}),i=new S_.WebTracerProvider({sampler:t.sampler,spanLimits:t.spanLimits,resource:t.resource,idGenerator:t.idGenerator,forceFlushTimeoutMillis:t.forceFlushTimeoutMillis});gi&&i.addSpanProcessor(new Vo),i.addSpanProcessor(n),i.register({contextManager:t.contextManager,propagator:t.textMapPropagator}),(0,A_.registerInstrumentations)({instrumentations:t.instrumentations})}function I_(){var t=window.onerror;window.onerror=function(r,n,i,a,s){if(t&&t(r,n,i,a,s),s){Ei(s,{onerror:!0});return}if(r!=="Script error."){var o={"window.onerror":!0};n&&(o["code.filepath"]=n),i&&(o["code.lineno"]=i),a&&(o["code.colno"]=a),Ei(String(r),o)}}}var Vo=function(){function t(){}return t.prototype.forceFlush=function(){return Promise.resolve()},t.prototype.onStart=function(e){window.navigator&&window.navigator.userAgent&&e.setAttribute("http.user_agent",window.navigator.userAgent),window.location&&window.location.href&&e.setAttribute("location.href",location.href)},t.prototype.onEnd=function(){},t.prototype.shutdown=function(){return Promise.resolve()},t}();ke.WindowAttributesProcessor=Vo;var In={};Object.defineProperty(In,"__esModule",{value:!0});In.VERSION=void 0;In.VERSION="1.11.1";(function(t){var e=ut&&ut.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=ut&&ut.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(ke,t),r(In,t)})($s);const C_=xl($s),P_=t=>{al.RUNTIME==="browser"?C_.configureOpentelemetry(t):require("@uptrace/node").configureOpentelemetry(t)},x_="http://synnax_dev@localhost:14318/2",L_=()=>{const t="synnax";return P_({dsn:x_,serviceName:t,deploymentEnvironment:"dev"}),new Ae.Instrumentation({key:"",serviceName:t,logger:new Ae.Logger,tracer:new Ae.Tracer(nu.getTracerProvider().getTracer("synnax"))})};exports.instrumentation=L_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const be=require("./instrumentation-2276Ha0Z.cjs");var Wn;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Wn||(Wn={}));var Ka="0000000000000000",Fa="00000000000000000000000000000000",Ko={traceId:Fa,spanId:Ka,traceFlags:Wn.NONE},Qt=function(){function t(e){e===void 0&&(e=Ko),this._spanContext=e}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t}(),Ei=be.createContextKey("OpenTelemetry Context Key SPAN");function Ti(t){return t.getValue(Ei)||void 0}function Fo(){return Ti(be.ContextAPI.getInstance().active())}function Si(t,e){return t.setValue(Ei,e)}function Yo(t){return t.deleteValue(Ei)}function Ho(t,e){return Si(t,new Qt(e))}function Ya(t){var e;return(e=Ti(t))===null||e===void 0?void 0:e.spanContext()}var Xo=/^([0-9a-f]{32})$/i,Wo=/^[0-9a-f]{16}$/i;function qo(t){return Xo.test(t)&&t!==Fa}function Jo(t){return Wo.test(t)&&t!==Ka}function Ha(t){return qo(t.traceId)&&Jo(t.spanId)}function Qo(t){return new Qt(t)}var Cn=be.ContextAPI.getInstance(),Xa=function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=Cn.active());var i=!!(r!=null&&r.root);if(i)return new Qt;var a=n&&Ya(n);return eu(a)&&Ha(a)?new Qt(a):new Qt},t.prototype.startActiveSpan=function(e,r,n,i){var a,s,o;if(!(arguments.length<2)){arguments.length===2?o=r:arguments.length===3?(a=r,o=n):(a=r,s=n,o=i);var c=s??Cn.active(),u=this.startSpan(e,a,c),d=Si(c,u);return Cn.with(d,o,void 0,u)}},t}();function eu(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var tu=new Xa,ru=function(){function t(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}return t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,i){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):tu},t}(),nu=function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new Xa},t}(),iu=new nu,la=function(){function t(){}return t.prototype.getTracer=function(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new ru(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:iu},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(e,r,n)},t}(),Pn="trace",au=function(){function t(){this._proxyTracerProvider=new la,this.wrapSpanContext=Qo,this.isSpanContextValid=Ha,this.deleteSpan=Yo,this.getSpan=Ti,this.getActiveSpan=Fo,this.getSpanContext=Ya,this.setSpan=Si,this.setSpanContext=Ho}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=be.registerGlobal(Pn,this._proxyTracerProvider,be.DiagAPI.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return be.getGlobal(Pn)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){be.unregisterGlobal(Pn,be.DiagAPI.instance()),this._proxyTracerProvider=new la},t}(),su=au.getInstance(),ou=Object.defineProperty,uu=(t,e,r)=>e in t?ou(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,T=(t,e,r)=>(uu(t,typeof e!="symbol"?e+"":e,r),r),Pt,Z;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Z||(Z={}));var qn;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(qn||(qn={}));const A=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),st=t=>{switch(typeof t){case"undefined":return A.undefined;case"string":return A.string;case"number":return isNaN(t)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(t)?A.array:t===null?A.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?A.promise:typeof Map<"u"&&t instanceof Map?A.map:typeof Set<"u"&&t instanceof Set?A.set:typeof Date<"u"&&t instanceof Date?A.date:A.object;default:return A.unknown}},g=Z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),cu=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ie extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,c=0;for(;c<s.path.length;){const u=s.path[c];c===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(s))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ie.create=t=>new Ie(t);const ir=(t,e)=>{let r;switch(t.code){case g.invalid_type:t.received===A.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Z.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:r=`Unrecognized key(s) in object: ${Z.joinValues(t.keys,", ")}`;break;case g.invalid_union:r="Invalid input";break;case g.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Z.joinValues(t.options)}`;break;case g.invalid_enum_value:r=`Invalid enum value. Expected ${Z.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:r="Invalid function arguments";break;case g.invalid_return_type:r="Invalid function return type";break;case g.invalid_date:r="Invalid date";break;case g.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Z.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case g.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case g.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case g.custom:r="Invalid input";break;case g.invalid_intersection_types:r="Intersection results could not be merged";break;case g.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:r="Number must be finite";break;default:r=e.defaultError,Z.assertNever(t)}return{message:r}};let Wa=ir;function lu(t){Wa=t}function Xr(){return Wa}const Wr=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],s={...i,path:a};let o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(s,{data:e,defaultError:o}).message;return{...i,path:a,message:i.message||o}},fu=[];function b(t,e){const r=Wr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xr(),ir].filter(n=>!!n)});t.common.issues.push(r)}class fe{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return x;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return fe.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return x;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:e.value,value:n}}}const x=Object.freeze({status:"aborted"}),qa=t=>({status:"dirty",value:t}),ve=t=>({status:"valid",value:t}),Jn=t=>t.status==="aborted",Qn=t=>t.status==="dirty",ar=t=>t.status==="valid",qr=t=>typeof Promise<"u"&&t instanceof Promise;var N;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(N||(N={}));class Ve{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const fa=(t,e)=>{if(ar(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ie(t.common.issues);return this._error=r,this._error}}};function L(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>s.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:r??o.defaultError},description:i}}class M{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return st(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:st(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new fe,ctx:{common:e.parent.common,data:e.data,parsedType:st(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(qr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:st(e)},a=this._parseSync({data:e,path:i.path,parent:i});return fa(i,a)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:st(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(qr(i)?i:Promise.resolve(i));return fa(n,a)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const s=e(i),o=()=>a.addIssue({code:g.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Pe({schema:this,typeName:I.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Qe.create(this,this._def)}nullable(){return Nt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ce.create(this,this._def)}promise(){return Vt.create(this,this._def)}or(e){return cr.create([this,e],this._def)}and(e){return lr.create(this,e,this._def)}transform(e){return new Pe({...L(this._def),schema:this,typeName:I.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new _r({...L(this._def),innerType:this,defaultValue:r,typeName:I.ZodDefault})}brand(){return new Qa({typeName:I.ZodBranded,type:this,...L(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new tn({...L(this._def),innerType:this,catchValue:r,typeName:I.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Tr.create(this,e)}readonly(){return nn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const du=/^c[^\s-]{8,}$/i,pu=/^[a-z][a-z0-9]*$/,hu=/^[0-9A-HJKMNP-TV-Z]{26}$/,_u=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,vu=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let xn;const mu=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,gu=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Eu=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Tu(t,e){return!!((e==="v4"||!e)&&mu.test(t)||(e==="v6"||!e)&&gu.test(t))}class we extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==A.string){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_type,expected:A.string,received:a.parsedType}),x}const n=new fe;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?b(i,{code:g.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&b(i,{code:g.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")vu.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"email",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")xn||(xn=new RegExp(yu,"u")),xn.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"emoji",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")_u.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"uuid",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")du.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"cuid",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")pu.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"cuid2",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")hu.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"ulid",code:g.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),b(i,{validation:"url",code:g.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"regex",code:g.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Eu(a).test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?Tu(e.data,a.version)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"ip",code:g.invalid_string,message:a.message}),n.dirty()):Z.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:g.invalid_string,...N.errToObj(n)})}_addCheck(e){return new we({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...N.errToObj(e)})}url(e){return this._addCheck({kind:"url",...N.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...N.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...N.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...N.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...N.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...N.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...N.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...N.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...N.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...N.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...N.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...N.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...N.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...N.errToObj(r)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new we({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new we({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new we({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}we.create=t=>{var e;return new we({checks:[],typeName:I.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...L(t)})};function Su(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return a%s/Math.pow(10,i)}class pt extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==A.number){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_type,expected:A.number,received:a.parsedType}),x}let n;const i=new fe;for(const a of this._def.checks)a.kind==="int"?Z.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:g.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Su(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_finite,message:a.message}),i.dirty()):Z.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,N.toString(r))}gt(e,r){return this.setLimit("min",e,!1,N.toString(r))}lte(e,r){return this.setLimit("max",e,!0,N.toString(r))}lt(e,r){return this.setLimit("max",e,!1,N.toString(r))}setLimit(e,r,n,i){return new pt({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:N.toString(i)}]})}_addCheck(e){return new pt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:N.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:N.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:N.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:N.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Z.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}pt.create=t=>new pt({checks:[],typeName:I.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class ht extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==A.bigint){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_type,expected:A.bigint,received:a.parsedType}),x}let n;const i=new fe;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Z.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,N.toString(r))}gt(e,r){return this.setLimit("min",e,!1,N.toString(r))}lte(e,r){return this.setLimit("max",e,!0,N.toString(r))}lt(e,r){return this.setLimit("max",e,!1,N.toString(r))}setLimit(e,r,n,i){return new ht({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:N.toString(i)}]})}_addCheck(e){return new ht({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}ht.create=t=>{var e;return new ht({checks:[],typeName:I.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...L(t)})};class sr extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==A.boolean){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.boolean,received:n.parsedType}),x}return ve(e.data)}}sr.create=t=>new sr({typeName:I.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class bt extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==A.date){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_type,expected:A.date,received:a.parsedType}),x}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return b(a,{code:g.invalid_date}),x}const n=new fe;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Z.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bt({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:N.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:N.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}bt.create=t=>new bt({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:I.ZodDate,...L(t)});class Jr extends M{_parse(e){if(this._getType(e)!==A.symbol){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.symbol,received:n.parsedType}),x}return ve(e.data)}}Jr.create=t=>new Jr({typeName:I.ZodSymbol,...L(t)});class or extends M{_parse(e){if(this._getType(e)!==A.undefined){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.undefined,received:n.parsedType}),x}return ve(e.data)}}or.create=t=>new or({typeName:I.ZodUndefined,...L(t)});class ur extends M{_parse(e){if(this._getType(e)!==A.null){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.null,received:n.parsedType}),x}return ve(e.data)}}ur.create=t=>new ur({typeName:I.ZodNull,...L(t)});class jt extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return ve(e.data)}}jt.create=t=>new jt({typeName:I.ZodAny,...L(t)});class Ot extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ve(e.data)}}Ot.create=t=>new Ot({typeName:I.ZodUnknown,...L(t)});class tt extends M{_parse(e){const r=this._getOrReturnCtx(e);return b(r,{code:g.invalid_type,expected:A.never,received:r.parsedType}),x}}tt.create=t=>new tt({typeName:I.ZodNever,...L(t)});class Qr extends M{_parse(e){if(this._getType(e)!==A.undefined){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.void,received:n.parsedType}),x}return ve(e.data)}}Qr.create=t=>new Qr({typeName:I.ZodVoid,...L(t)});class Ce extends M{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==A.array)return b(r,{code:g.invalid_type,expected:A.array,received:r.parsedType}),x;if(i.exactLength!==null){const s=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(s||o)&&(b(r,{code:s?g.too_big:g.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(b(r,{code:g.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(b(r,{code:g.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>i.type._parseAsync(new Ve(r,s,r.path,o)))).then(s=>fe.mergeArray(n,s));const a=[...r.data].map((s,o)=>i.type._parseSync(new Ve(r,s,r.path,o)));return fe.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new Ce({...this._def,minLength:{value:e,message:N.toString(r)}})}max(e,r){return new Ce({...this._def,maxLength:{value:e,message:N.toString(r)}})}length(e,r){return new Ce({...this._def,exactLength:{value:e,message:N.toString(r)}})}nonempty(e){return this.min(1,e)}}Ce.create=(t,e)=>new Ce({type:t,minLength:null,maxLength:null,exactLength:null,typeName:I.ZodArray,...L(e)});function Dt(t){if(t instanceof ee){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Qe.create(Dt(n))}return new ee({...t._def,shape:()=>e})}else return t instanceof Ce?new Ce({...t._def,type:Dt(t.element)}):t instanceof Qe?Qe.create(Dt(t.unwrap())):t instanceof Nt?Nt.create(Dt(t.unwrap())):t instanceof Ge?Ge.create(t.items.map(e=>Dt(e))):t}class ee extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Z.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==A.object){const u=this._getOrReturnCtx(e);return b(u,{code:g.invalid_type,expected:A.object,received:u.parsedType}),x}const{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof tt&&this._def.unknownKeys==="strip"))for(const u in i.data)s.includes(u)||o.push(u);const c=[];for(const u of s){const d=a[u],_=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Ve(i,_,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof tt){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(b(i,{code:g.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const _=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Ve(i,_,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const _=await d.key;u.push({key:_,value:await d.value,alwaysSet:d.alwaysSet})}return u}).then(u=>fe.mergeObjectSync(n,u)):fe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return N.errToObj,new ee({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,a,s,o;const c=(s=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=N.errToObj(e).message)!==null&&o!==void 0?o:c}:{message:c}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(e){return new ee({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:I.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ee({...this._def,catchall:e})}pick(e){const r={};return Z.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new ee({...this._def,shape:()=>r})}omit(e){const r={};return Z.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new ee({...this._def,shape:()=>r})}deepPartial(){return Dt(this)}partial(e){const r={};return Z.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new ee({...this._def,shape:()=>r})}required(e){const r={};return Z.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Qe;)a=a._def.innerType;r[n]=a}}),new ee({...this._def,shape:()=>r})}keyof(){return Ja(Z.objectKeys(this.shape))}}ee.create=(t,e)=>new ee({shape:()=>t,unknownKeys:"strip",catchall:tt.create(),typeName:I.ZodObject,...L(e)});ee.strictCreate=(t,e)=>new ee({shape:()=>t,unknownKeys:"strict",catchall:tt.create(),typeName:I.ZodObject,...L(e)});ee.lazycreate=(t,e)=>new ee({shape:t,unknownKeys:"strip",catchall:tt.create(),typeName:I.ZodObject,...L(e)});class cr extends M{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new Ie(o.ctx.common.issues));return b(r,{code:g.invalid_union,unionErrors:s}),x}if(r.common.async)return Promise.all(n.map(async a=>{const s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(c=>new Ie(c));return b(r,{code:g.invalid_union,unionErrors:o}),x}}get options(){return this._def.options}}cr.create=(t,e)=>new cr({options:t,typeName:I.ZodUnion,...L(e)});const Ur=t=>t instanceof dr?Ur(t.schema):t instanceof Pe?Ur(t.innerType()):t instanceof pr?[t.value]:t instanceof _t?t.options:t instanceof hr?Object.keys(t.enum):t instanceof _r?Ur(t._def.innerType):t instanceof or?[void 0]:t instanceof ur?[null]:null;class hn extends M{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.object)return b(r,{code:g.invalid_type,expected:A.object,received:r.parsedType}),x;const n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(b(r,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const i=new Map;for(const a of r){const s=Ur(a.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of s){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,a)}}return new hn({typeName:I.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...L(n)})}}function ei(t,e){const r=st(t),n=st(e);if(t===e)return{valid:!0,data:t};if(r===A.object&&n===A.object){const i=Z.objectKeys(e),a=Z.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(const o of a){const c=ei(t[o],e[o]);if(!c.valid)return{valid:!1};s[o]=c.data}return{valid:!0,data:s}}else if(r===A.array&&n===A.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const s=t[a],o=e[a],c=ei(s,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===A.date&&n===A.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class lr extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=(a,s)=>{if(Jn(a)||Jn(s))return x;const o=ei(a.value,s.value);return o.valid?((Qn(a)||Qn(s))&&r.dirty(),{status:r.value,value:o.data}):(b(n,{code:g.invalid_intersection_types}),x)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}lr.create=(t,e,r)=>new lr({left:t,right:e,typeName:I.ZodIntersection,...L(r)});class Ge extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.array)return b(n,{code:g.invalid_type,expected:A.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return b(n,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(b(n,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((s,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Ve(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>fe.mergeArray(r,s)):fe.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ge({...this._def,rest:e})}}Ge.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ge({items:t,typeName:I.ZodTuple,rest:null,...L(e)})};class fr extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.object)return b(n,{code:g.invalid_type,expected:A.object,received:n.parsedType}),x;const i=[],a=this._def.keyType,s=this._def.valueType;for(const o in n.data)i.push({key:a._parse(new Ve(n,o,n.path,o)),value:s._parse(new Ve(n,n.data[o],n.path,o))});return n.common.async?fe.mergeObjectAsync(r,i):fe.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof M?new fr({keyType:e,valueType:r,typeName:I.ZodRecord,...L(n)}):new fr({keyType:we.create(),valueType:e,typeName:I.ZodRecord,...L(r)})}}class en extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.map)return b(n,{code:g.invalid_type,expected:A.map,received:n.parsedType}),x;const i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([o,c],u)=>({key:i._parse(new Ve(n,o,n.path,[u,"key"])),value:a._parse(new Ve(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of s){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return x;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),o.set(u.value,d.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of s){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return x;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),o.set(u.value,d.value)}return{status:r.value,value:o}}}}en.create=(t,e,r)=>new en({valueType:e,keyType:t,typeName:I.ZodMap,...L(r)});class wt extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.set)return b(n,{code:g.invalid_type,expected:A.set,received:n.parsedType}),x;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(b(n,{code:g.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(b(n,{code:g.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function s(c){const u=new Set;for(const d of c){if(d.status==="aborted")return x;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>a._parse(new Ve(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>s(c)):s(o)}min(e,r){return new wt({...this._def,minSize:{value:e,message:N.toString(r)}})}max(e,r){return new wt({...this._def,maxSize:{value:e,message:N.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}wt.create=(t,e)=>new wt({valueType:t,minSize:null,maxSize:null,typeName:I.ZodSet,...L(e)});class kt extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.function)return b(r,{code:g.invalid_type,expected:A.function,received:r.parsedType}),x;function n(o,c){return Wr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Xr(),ir].filter(u=>!!u),issueData:{code:g.invalid_arguments,argumentsError:c}})}function i(o,c){return Wr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Xr(),ir].filter(u=>!!u),issueData:{code:g.invalid_return_type,returnTypeError:c}})}const a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Vt){const o=this;return ve(async function(...c){const u=new Ie([]),d=await o._def.args.parseAsync(c,a).catch(k=>{throw u.addIssue(n(c,k)),u}),_=await Reflect.apply(s,this,d);return await o._def.returns._def.type.parseAsync(_,a).catch(k=>{throw u.addIssue(i(_,k)),u})})}else{const o=this;return ve(function(...c){const u=o._def.args.safeParse(c,a);if(!u.success)throw new Ie([n(c,u.error)]);const d=Reflect.apply(s,this,u.data),_=o._def.returns.safeParse(d,a);if(!_.success)throw new Ie([i(d,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new kt({...this._def,args:Ge.create(e).rest(Ot.create())})}returns(e){return new kt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new kt({args:e||Ge.create([]).rest(Ot.create()),returns:r||Ot.create(),typeName:I.ZodFunction,...L(n)})}}class dr extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}dr.create=(t,e)=>new dr({getter:t,typeName:I.ZodLazy,...L(e)});class pr extends M{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return b(r,{received:r.data,code:g.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}pr.create=(t,e)=>new pr({value:t,typeName:I.ZodLiteral,...L(e)});function Ja(t,e){return new _t({values:t,typeName:I.ZodEnum,...L(e)})}class _t extends M{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return b(r,{expected:Z.joinValues(n),received:r.parsedType,code:g.invalid_type}),x}if(this._def.values.indexOf(e.data)===-1){const r=this._getOrReturnCtx(e),n=this._def.values;return b(r,{received:r.data,code:g.invalid_enum_value,options:n}),x}return ve(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e){return _t.create(e)}exclude(e){return _t.create(this.options.filter(r=>!e.includes(r)))}}_t.create=Ja;class hr extends M{_parse(e){const r=Z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==A.string&&n.parsedType!==A.number){const i=Z.objectValues(r);return b(n,{expected:Z.joinValues(i),received:n.parsedType,code:g.invalid_type}),x}if(r.indexOf(e.data)===-1){const i=Z.objectValues(r);return b(n,{received:n.data,code:g.invalid_enum_value,options:i}),x}return ve(e.data)}get enum(){return this._def.values}}hr.create=(t,e)=>new hr({values:t,typeName:I.ZodNativeEnum,...L(e)});class Vt extends M{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.promise&&r.common.async===!1)return b(r,{code:g.invalid_type,expected:A.promise,received:r.parsedType}),x;const n=r.parsedType===A.promise?r.data:Promise.resolve(r.data);return ve(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Vt.create=(t,e)=>new Vt({type:t,typeName:I.ZodPromise,...L(e)});class Pe extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===I.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{b(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(s).then(o=>this._def.schema._parseAsync({data:o,path:n.path,parent:n})):this._def.schema._parseSync({data:s,path:n.path,parent:n})}if(i.type==="refinement"){const s=o=>{const c=i.refinement(o,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?x:(o.status==="dirty"&&r.dirty(),s(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?x:(o.status==="dirty"&&r.dirty(),s(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ar(s))return s;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>ar(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:r.value,value:o})):s);Z.assertNever(i)}}Pe.create=(t,e,r)=>new Pe({schema:t,typeName:I.ZodEffects,effect:e,...L(r)});Pe.createWithPreprocess=(t,e,r)=>new Pe({schema:e,effect:{type:"preprocess",transform:t},typeName:I.ZodEffects,...L(r)});class Qe extends M{_parse(e){return this._getType(e)===A.undefined?ve(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qe.create=(t,e)=>new Qe({innerType:t,typeName:I.ZodOptional,...L(e)});class Nt extends M{_parse(e){return this._getType(e)===A.null?ve(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nt.create=(t,e)=>new Nt({innerType:t,typeName:I.ZodNullable,...L(e)});class _r extends M{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===A.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}_r.create=(t,e)=>new _r({innerType:t,typeName:I.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class tn extends M{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return qr(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ie(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ie(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}tn.create=(t,e)=>new tn({innerType:t,typeName:I.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class rn extends M{_parse(e){if(this._getType(e)!==A.nan){const n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:A.nan,received:n.parsedType}),x}return{status:"valid",value:e.data}}}rn.create=t=>new rn({typeName:I.ZodNaN,...L(t)});const Ou=Symbol("zod_brand");class Qa extends M{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Tr extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?x:a.status==="dirty"?(r.dirty(),qa(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?x:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Tr({in:e,out:r,typeName:I.ZodPipeline})}}class nn extends M{_parse(e){const r=this._def.innerType._parse(e);return ar(r)&&(r.value=Object.freeze(r.value)),r}}nn.create=(t,e)=>new nn({innerType:t,typeName:I.ZodReadonly,...L(e)});const es=(t,e={},r)=>t?jt.create().superRefine((n,i)=>{var a,s;if(!t(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(s=(a=o.fatal)!==null&&a!==void 0?a:r)!==null&&s!==void 0?s:!0,u=typeof o=="string"?{message:o}:o;i.addIssue({code:"custom",...u,fatal:c})}}):jt.create(),Au={object:ee.lazycreate};var I;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(I||(I={}));const bu=(t,e={message:`Input not instance of ${t.name}`})=>es(r=>r instanceof t,e),ts=we.create,rs=pt.create,wu=rn.create,Nu=ht.create,ns=sr.create,Ru=bt.create,Iu=Jr.create,Cu=or.create,Pu=ur.create,xu=jt.create,Lu=Ot.create,Mu=tt.create,Du=Qr.create,ku=Ce.create,Uu=ee.create,Bu=ee.strictCreate,ju=cr.create,Vu=hn.create,Gu=lr.create,$u=Ge.create,Zu=fr.create,zu=en.create,Ku=wt.create,Fu=kt.create,Yu=dr.create,Hu=pr.create,Xu=_t.create,Wu=hr.create,qu=Vt.create,da=Pe.create,Ju=Qe.create,Qu=Nt.create,ec=Pe.createWithPreprocess,tc=Tr.create,rc=()=>ts().optional(),nc=()=>rs().optional(),ic=()=>ns().optional(),ac={string:t=>we.create({...t,coerce:!0}),number:t=>pt.create({...t,coerce:!0}),boolean:t=>sr.create({...t,coerce:!0}),bigint:t=>ht.create({...t,coerce:!0}),date:t=>bt.create({...t,coerce:!0})},sc=x;var y=Object.freeze({__proto__:null,defaultErrorMap:ir,setErrorMap:lu,getErrorMap:Xr,makeIssue:Wr,EMPTY_PATH:fu,addIssueToContext:b,ParseStatus:fe,INVALID:x,DIRTY:qa,OK:ve,isAborted:Jn,isDirty:Qn,isValid:ar,isAsync:qr,get util(){return Z},get objectUtil(){return qn},ZodParsedType:A,getParsedType:st,ZodType:M,ZodString:we,ZodNumber:pt,ZodBigInt:ht,ZodBoolean:sr,ZodDate:bt,ZodSymbol:Jr,ZodUndefined:or,ZodNull:ur,ZodAny:jt,ZodUnknown:Ot,ZodNever:tt,ZodVoid:Qr,ZodArray:Ce,ZodObject:ee,ZodUnion:cr,ZodDiscriminatedUnion:hn,ZodIntersection:lr,ZodTuple:Ge,ZodRecord:fr,ZodMap:en,ZodSet:wt,ZodFunction:kt,ZodLazy:dr,ZodLiteral:pr,ZodEnum:_t,ZodNativeEnum:hr,ZodPromise:Vt,ZodEffects:Pe,ZodTransformer:Pe,ZodOptional:Qe,ZodNullable:Nt,ZodDefault:_r,ZodCatch:tn,ZodNaN:rn,BRAND:Ou,ZodBranded:Qa,ZodPipeline:Tr,ZodReadonly:nn,custom:es,Schema:M,ZodSchema:M,late:Au,get ZodFirstPartyTypeKind(){return I},coerce:ac,any:xu,array:ku,bigint:Nu,boolean:ns,date:Ru,discriminatedUnion:Vu,effect:da,enum:Xu,function:Fu,instanceof:bu,intersection:Gu,lazy:Yu,literal:Hu,map:zu,nan:wu,nativeEnum:Wu,never:Mu,null:Pu,nullable:Qu,number:rs,object:Uu,oboolean:ic,onumber:nc,optional:Ju,ostring:rc,pipeline:tc,preprocess:ec,promise:qu,record:Zu,set:Ku,strictObject:Bu,string:ts,symbol:Iu,transformer:da,tuple:$u,undefined:Cu,union:ju,unknown:Lu,void:Du,NEVER:sc,ZodIssueCode:g,quotelessJson:cu,ZodError:Ie});const Oi=y.tuple([y.number(),y.number()]),is=y.object({width:y.number(),height:y.number()}),oc=y.object({signedWidth:y.number(),signedHeight:y.number()}),uc=["width","height"];y.enum(uc);const cc=["start","center","end"],lc=["signedWidth","signedHeight"];y.enum(lc);const an=y.object({x:y.number(),y:y.number()}),fc=y.object({clientX:y.number(),clientY:y.number()}),dc=["x","y"],as=y.enum(dc),ss=["top","right","bottom","left"];y.enum(ss);const pc=["left","right"],os=y.enum(pc),hc=["top","bottom"],us=y.enum(hc),cs=["center"],pa=y.enum(cs),_c=[...ss,...cs],ls=y.enum(_c);y.enum(cc);const vc=["first","last"];y.enum(vc);const yc=y.object({lower:y.number(),upper:y.number()});y.union([yc,Oi]);y.union([as,ls]);y.union([as,ls,y.instanceof(String)]);const Ln=(t,e)=>{const r={lower:0,upper:0};return typeof t=="number"?e!=null?(r.lower=t,r.upper=e):(r.lower=0,r.upper=t):Array.isArray(t)?[r.lower,r.upper]=t:(r.lower=t.lower,r.upper=t.upper),mc(r)},mc=t=>t.lower>t.upper?{lower:t.upper,upper:t.lower}:t;var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j={},_n={};Object.defineProperty(_n,"__esModule",{value:!0});function gc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"$"+n}).toLowerCase().replace(/(\$)(\w)/g,function(e,r,n){return n.toUpperCase()}):""}_n.default=gc;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});function Ec(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"_").toLowerCase():""}vn.default=Ec;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});function Tc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"$").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"$"+n}).toLowerCase().replace(/(\$)(\w?)/g,function(e,r,n){return n.toUpperCase()}):""}yn.default=Tc;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});function Sc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,".").toLowerCase():""}Ai.default=Sc;var bi={};Object.defineProperty(bi,"__esModule",{value:!0});function Oc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"/").toLowerCase():""}bi.default=Oc;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});function Ac(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase():""}wi.default=Ac;var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});function bc(t){if(t===void 0&&(t=""),!t)return"";var e=String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(r,n,i){return n+"_"+i.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase();return e.charAt(0).toUpperCase()+e.slice(1)}Ni.default=bc;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});function wc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase().replace(/( ?)(\w+)( ?)/g,function(e,r,n,i){return r+n.charAt(0).toUpperCase()+n.slice(1)+i}):""}Ri.default=wc;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});function Nc(t){return t===void 0&&(t=""),t?String(t).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,r,n){return r+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"-").toLowerCase():""}mn.default=Nc;var Ii={},It={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.belongToTypes=t.isValidObject=t.isArrayObject=t.validateOptions=t.DefaultOption=void 0,t.DefaultOption={recursive:!1,recursiveInArray:!1,keepTypesOnRecursion:[]},t.validateOptions=function(e){return e===void 0&&(e=t.DefaultOption),e.recursive==null?e=t.DefaultOption:e.recursiveInArray==null&&(e.recursiveInArray=!1),e},t.isArrayObject=function(e){return e!=null&&Array.isArray(e)},t.isValidObject=function(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)},t.belongToTypes=function(e,r){return(r||[]).some(function(n){return e instanceof n})}})(It);var Rc=Ae&&Ae.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Ii,"__esModule",{value:!0});var ze=It;function Br(t,e){if(e===void 0&&(e=ze.DefaultOption),!ze.isValidObject(t))return null;e=ze.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=n.toLowerCase();e.recursive&&(ze.isValidObject(i)?ze.belongToTypes(i,e.keepTypesOnRecursion)||(i=Br(i,e)):e.recursiveInArray&&ze.isArrayObject(i)&&(i=Rc(i).map(function(s){var o=s;if(ze.isValidObject(s))ze.belongToTypes(o,e.keepTypesOnRecursion)||(o=Br(s,e));else if(ze.isArrayObject(s)){var c=Br({key:s},e);o=c.key}return o}))),r[a]=i}),r}Ii.default=Br;var Ci={},Ic=Ae&&Ae.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Ci,"__esModule",{value:!0});var Ke=It;function jr(t,e){if(e===void 0&&(e=Ke.DefaultOption),!Ke.isValidObject(t))return null;e=Ke.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=n.toUpperCase();e.recursive&&(Ke.isValidObject(i)?Ke.belongToTypes(i,e.keepTypesOnRecursion)||(i=jr(i,e)):e.recursiveInArray&&Ke.isArrayObject(i)&&(i=Ic(i).map(function(s){var o=s;if(Ke.isValidObject(s))Ke.belongToTypes(o,e.keepTypesOnRecursion)||(o=jr(s,e));else if(Ke.isArrayObject(s)){var c=jr({key:s},e);o=c.key}return o}))),r[a]=i}),r}Ci.default=jr;var Pi={},Cc=Ae&&Ae.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Pi,"__esModule",{value:!0});var Fe=It,Pc=_n;function Vr(t,e){if(e===void 0&&(e=Fe.DefaultOption),!Fe.isValidObject(t))return null;e=Fe.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=Pc.default(n);e.recursive&&(Fe.isValidObject(i)?Fe.belongToTypes(i,e.keepTypesOnRecursion)||(i=Vr(i,e)):e.recursiveInArray&&Fe.isArrayObject(i)&&(i=Cc(i).map(function(s){var o=s;if(Fe.isValidObject(s))Fe.belongToTypes(o,e.keepTypesOnRecursion)||(o=Vr(s,e));else if(Fe.isArrayObject(s)){var c=Vr({key:s},e);o=c.key}return o}))),r[a]=i}),r}Pi.default=Vr;var xi={},xc=Ae&&Ae.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(xi,"__esModule",{value:!0});var Ye=It,Lc=vn;function Gr(t,e){if(e===void 0&&(e=Ye.DefaultOption),!Ye.isValidObject(t))return null;e=Ye.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=Lc.default(n);e.recursive&&(Ye.isValidObject(i)?Ye.belongToTypes(i,e.keepTypesOnRecursion)||(i=Gr(i,e)):e.recursiveInArray&&Ye.isArrayObject(i)&&(i=xc(i).map(function(s){var o=s;if(Ye.isValidObject(s))Ye.belongToTypes(o,e.keepTypesOnRecursion)||(o=Gr(s,e));else if(Ye.isArrayObject(s)){var c=Gr({key:s},e);o=c.key}return o}))),r[a]=i}),r}xi.default=Gr;var Li={},Mc=Ae&&Ae.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Li,"__esModule",{value:!0});var He=It,Dc=yn;function $r(t,e){if(e===void 0&&(e=He.DefaultOption),!He.isValidObject(t))return null;e=He.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=Dc.default(n);e.recursive&&(He.isValidObject(i)?He.belongToTypes(i,e.keepTypesOnRecursion)||(i=$r(i,e)):e.recursiveInArray&&He.isArrayObject(i)&&(i=Mc(i).map(function(s){var o=s;if(He.isValidObject(s))He.belongToTypes(o,e.keepTypesOnRecursion)||(o=$r(s,e));else if(He.isArrayObject(s)){var c=$r({key:s},e);o=c.key}return o}))),r[a]=i}),r}Li.default=$r;var Mi={},kc=Ae&&Ae.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n};Object.defineProperty(Mi,"__esModule",{value:!0});var Xe=It,Uc=mn;function Zr(t,e){if(e===void 0&&(e=Xe.DefaultOption),!Xe.isValidObject(t))return null;e=Xe.validateOptions(e);var r={};return Object.keys(t).forEach(function(n){var i=t[n],a=Uc.default(n);e.recursive&&(Xe.isValidObject(i)?Xe.belongToTypes(i,e.keepTypesOnRecursion)||(i=Zr(i,e)):e.recursiveInArray&&Xe.isArrayObject(i)&&(i=kc(i).map(function(s){var o=s;if(Xe.isValidObject(s))Xe.belongToTypes(o,e.keepTypesOnRecursion)||(o=Zr(s,e));else if(Xe.isArrayObject(s)){var c=Zr({key:s},e);o=c.key}return o}))),r[a]=i}),r}Mi.default=Zr;Object.defineProperty(j,"__esModule",{value:!0});j.kebabKeys=j.pascalKeys=j.snakeKeys=j.camelKeys=j.upperKeys=j.lowerKeys=j.toLowerCase=j.toUpperCase=j.toKebabCase=j.toHeaderCase=j.toSentenceCase=j.toTextCase=j.toPathCase=j.toDotCase=j.toPascalCase=j.toSnakeCase=j.toCamelCase=void 0;var fs=_n;j.toCamelCase=fs.default;var ds=vn;j.toSnakeCase=ds.default;var ps=yn;j.toPascalCase=ps.default;var hs=Ai;j.toDotCase=hs.default;var _s=bi;j.toPathCase=_s.default;var vs=wi;j.toTextCase=vs.default;var ys=Ni;j.toSentenceCase=ys.default;var ms=Ri;j.toHeaderCase=ms.default;var gs=mn;j.toKebabCase=gs.default;var Es=Ii;j.lowerKeys=Es.default;var Ts=Ci;j.upperKeys=Ts.default;var Ss=Pi;j.camelKeys=Ss.default;var Os=xi;j.snakeKeys=Os.default;var As=Li;j.pascalKeys=As.default;var bs=Mi;j.kebabKeys=bs.default;var ws=function(t){return String(t||"").toLowerCase()};j.toLowerCase=ws;var Ns=function(t){return String(t||"").toUpperCase()};j.toUpperCase=Ns;var Bc={toCamelCase:fs.default,toSnakeCase:ds.default,toPascalCase:ps.default,toDotCase:hs.default,toPathCase:_s.default,toTextCase:vs.default,toSentenceCase:ys.default,toHeaderCase:ms.default,toKebabCase:gs.default,toUpperCase:Ns,toLowerCase:ws,lowerKeys:Es.default,upperKeys:Ts.default,camelKeys:Ss.default,snakeKeys:Os.default,pascalKeys:As.default,kebabKeys:bs.default};j.default=Bc;var Rs=j;const Is={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},jc=t=>Rs.snakeKeys(t,Is),Vc=t=>Rs.camelKeys(t,Is);var Gt;(t=>{t.toSnake=jc,t.toCamel=Vc,t.capitalize=e=>e[0].toUpperCase()+e.slice(1)})(Gt||(Gt={}));y.object({x:os.or(pa),y:us.or(pa)});const Gc=y.object({x:os,y:us}),$c=Object.freeze({x:"left",y:"top"}),Zc=(t,e)=>t.x===e.x&&t.y===e.y,ha=y.union([y.number(),an,Oi,is,oc,fc]),zc=(t,e)=>{if(typeof t=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:e,y:0}:{x:0,y:e}}return typeof t=="number"?{x:t,y:e??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},_a={x:0,y:0},Ir=y.union([y.number(),y.string()]);y.object({top:Ir,left:Ir,width:Ir,height:Ir});y.object({left:y.number(),top:y.number(),right:y.number(),bottom:y.number()});y.object({one:an,two:an,root:Gc});const Di=(t,e,r=0,n=0,i)=>{const a={one:{..._a},two:{..._a},root:i??$c};if(typeof t=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return a.one={x:t,y:e},a.two={x:a.one.x+r,y:a.one.y+n},a}return"one"in t&&"two"in t&&"root"in t?{...t,root:i??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(a.one={x:t.left,y:t.top},a.two={x:t.right,y:t.bottom},a):(a.one=t,e==null?a.two={x:a.one.x+r,y:a.one.y+n}:typeof e=="number"?a.two={x:a.one.x+e,y:a.one.y+r}:"width"in e?a.two={x:a.one.x+e.width,y:a.one.y+e.height}:"signedWidth"in e?a.two={x:a.one.x+e.signedWidth,y:a.one.y+e.signedHeight}:a.two=e,a))},Mn=t=>{const e=Di(t);return{lower:e.one.x,upper:e.two.x}},Dn=t=>{const e=Di(t);return{lower:e.one.y,upper:e.two.y}},Kc=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,Fc=y.object({signedWidth:y.number(),signedHeight:y.number()});y.union([is,Fc,an,Oi]);const Yc=(t,e,r)=>(e!=null&&(t=Math.max(t,e)),r!=null&&(t=Math.min(t,r)),t);y.object({offset:ha,scale:ha});const Hc=t=>(e,r,n,i)=>r==="dimension"?[e,n]:[e,i?n-t:n+t],Xc=t=>(e,r,n,i)=>[e,i?n/t:n*t],Wc=t=>(e,r,n)=>{if(e===null)return[t,n];const{lower:i,upper:a}=e,{lower:s,upper:o}=t,c=a-i,u=o-s;if(r==="dimension")return[t,n*(u/c)];const d=(n-i)*(u/c)+s;return[t,d]},qc=t=>(e,r,n)=>[t,n],Jc=()=>(t,e,r)=>{if(t===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[t,r];const{lower:n,upper:i}=t;return[t,i-(r-n)]},Qc=t=>(e,r,n)=>{const{lower:i,upper:a}=t;return n=Yc(n,i,a),[e,n]},ti=class qt{constructor(){T(this,"ops",[]),T(this,"currBounds",null),T(this,"currType",null),T(this,"reversed",!1),this.ops=[]}static translate(e){return new qt().translate(e)}static magnify(e){return new qt().magnify(e)}static scale(e,r){return new qt().scale(e,r)}translate(e){const r=this.new(),n=Hc(e);return n.type="translate",r.ops.push(n),r}magnify(e){const r=this.new(),n=Xc(e);return n.type="magnify",r.ops.push(n),r}scale(e,r){const n=Ln(e,r),i=this.new(),a=Wc(n);return a.type="scale",i.ops.push(a),i}clamp(e,r){const n=Ln(e,r),i=this.new(),a=Qc(n);return a.type="clamp",i.ops.push(a),i}reBound(e,r){const n=Ln(e,r),i=this.new(),a=qc(n);return a.type="re-bound",i.ops.push(a),i}invert(){const e=Jc();e.type="invert";const r=this.new();return r.ops.push(e),r}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new qt;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,r){return this.currBounds=null,this.ops.reduce(([n,i],a)=>a(n,e,i,this.reversed),[null,r])[1]}reverse(){const e=this.new();e.ops.reverse();const r=[];return e.ops.forEach((n,i)=>{if(n.type==="scale"||r.some(([s,o])=>i>=s&&i<=o))return;const a=e.ops.findIndex((s,o)=>s.type==="scale"&&o>i);a!==-1&&r.push([i,a])}),r.forEach(([n,i])=>{const a=e.ops.slice(n,i);a.unshift(e.ops[i]),e.ops.splice(n,i-n+1,...a)}),e.reversed=!e.reversed,e}};T(ti,"IDENTITY",new ti);let va=ti;const ya=class We{constructor(e=new va,r=new va,n=null){T(this,"x"),T(this,"y"),T(this,"currRoot"),this.x=e,this.y=r,this.currRoot=n}static translate(e,r){return new We().translate(e,r)}static translateX(e){return new We().translateX(e)}static translateY(e){return new We().translateY(e)}static clamp(e){return new We().clamp(e)}static magnify(e){return new We().magnify(e)}static scale(e){return new We().scale(e)}static reBound(e){return new We().reBound(e)}translate(e,r){const n=zc(e,r),i=this.copy();return i.x=this.x.translate(n.x),i.y=this.y.translate(n.y),i}translateX(e){const r=this.copy();return r.x=this.x.translate(e),r}translateY(e){const r=this.copy();return r.y=this.y.translate(e),r}magnify(e){const r=this.copy();return r.x=this.x.magnify(e.x),r.y=this.y.magnify(e.y),r}scale(e){const r=this.copy();if(Kc(e)){const n=this.currRoot;return r.currRoot=e.root,n!=null&&!Zc(n,e.root)&&(n.x!==e.root.x&&(r.x=r.x.invert()),n.y!==e.root.y&&(r.y=r.y.invert())),r.x=r.x.scale(Mn(e)),r.y=r.y.scale(Dn(e)),r}return r.x=r.x.scale(e.width),r.y=r.y.scale(e.height),r}reBound(e){const r=this.copy();return r.x=this.x.reBound(Mn(e)),r.y=this.y.reBound(Dn(e)),r}clamp(e){const r=this.copy();return r.x=this.x.clamp(Mn(e)),r.y=this.y.clamp(Dn(e)),r}copy(){const e=new We;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}box(e){return Di(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}};T(ya,"IDENTITY",new ya);const Cs=(t,e)=>{const r=new Ee(e);if(![he.DAY,he.HOUR,he.MINUTE,he.SECOND,he.MILLISECOND,he.MICROSECOND,he.NANOSECOND].some(i=>i.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=t.valueOf()%r.valueOf();return t instanceof Ee?new Ee(n):new he(n)},X=class B extends Number{constructor(e,r="UTC"){if(e==null)return B.now();if(e instanceof Date)super(e.getTime()*B.MILLISECOND.valueOf());else if(typeof e=="string")super(B.parseDateTimeString(e,r).valueOf());else if(Array.isArray(e))super(B.parseDate(e));else{let n=0;e instanceof Number&&(e=e.valueOf()),r==="local"&&(n=B.utcOffset.valueOf()),super(e.valueOf()+n)}}static parseDate([e=1970,r=1,n=1]){const i=new Date(e,r-1,n,0,0,0,0);return new B(i.getTime()*B.MILLISECOND.valueOf()).truncate(B.DAY).valueOf()}static parseTimeString(e,r="UTC"){const[n,i,a]=e.split(":");let s="00",o="00";a!=null&&([s,o]=a.split("."));let c=B.hours(parseInt(n??"00",10)).add(B.minutes(parseInt(i??"00",10))).add(B.seconds(parseInt(s??"00",10))).add(B.milliseconds(parseInt(o??"00",10)));return r==="local"&&(c=c.add(B.utcOffset)),c.valueOf()}static parseDateTimeString(e,r="UTC"){if(!e.includes("/")&&!e.includes("-"))return B.parseTimeString(e,r);const n=new Date(e);return e.includes(":")||n.setUTCHours(0,0,0,0),new B(n.getTime()*B.MILLISECOND.valueOf(),r).valueOf()}fString(e="ISO",r="UTC"){switch(e){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString(r);case"preciseDate":return`${this.dateString(r)} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString(r)} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(B.utcOffset).date().toISOString()}timeString(e=!1,r="UTC"){const n=this.toISOString(r);return e?n.slice(11,23):n.slice(11,19)}dateString(e="UTC"){const r=this.date(),n=r.toLocaleString("default",{month:"short"}),i=r.toLocaleString("default",{day:"numeric"});return`${n} ${i}`}static get utcOffset(){return new he(new Date().getTimezoneOffset()*B.MINUTE.valueOf())}static since(e){return new B().span(e)}date(){return new Date(this.milliseconds())}equals(e){return this.valueOf()===new B(e).valueOf()}span(e){return this.range(e).span}range(e){return new el(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===0}after(e){return this.valueOf()>new B(e).valueOf()}afterEq(e){return this.valueOf()>=new B(e).valueOf()}before(e){return this.valueOf()<new B(e).valueOf()}beforeEq(e){return this.valueOf()<=new B(e).valueOf()}add(e){return new B(this.valueOf()+e.valueOf())}sub(e){return new B(this.valueOf()-e.valueOf())}milliseconds(){return this.valueOf()/B.MILLISECOND.valueOf()}toString(){return this.date().toISOString()}remainder(e){return Cs(this,e)}get isToday(){return this.truncate(he.DAY).equals(B.now().truncate(he.DAY))}truncate(e){return this.sub(this.remainder(e))}get bigInt(){return BigInt(this.valueOf())}static now(){return new B(new Date)}static nanoseconds(e){return new B(e)}static microseconds(e){return B.nanoseconds(e*1e3)}static milliseconds(e){return B.microseconds(e*1e3)}static seconds(e){return B.milliseconds(e*1e3)}static minutes(e){return B.seconds(e*60)}static hours(e){return B.minutes(e*60)}static days(e){return B.hours(e*24)}};T(X,"NANOSECOND",X.nanoseconds(1));T(X,"MICROSECOND",X.microseconds(1));T(X,"MILLISECOND",X.milliseconds(1));T(X,"SECOND",X.seconds(1));T(X,"MINUTE",X.minutes(1));T(X,"HOUR",X.hours(1));T(X,"DAY",X.days(1));T(X,"MAX",new X(9122272036554776e3));T(X,"MIN",new X(0));T(X,"ZERO",new X(0));T(X,"z",y.union([y.instanceof(Number).transform(t=>new X(t)),y.number().transform(t=>new X(t)),y.instanceof(X)]));let Ee=X;const H=class $ extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}lessThan(e){return this.valueOf()<new $(e).valueOf()}greaterThan(e){return this.valueOf()>new $(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new $(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new $(e).valueOf()}remainder(e){return Cs(this,e)}truncate(e){return new $(Math.trunc(this.valueOf()/e.valueOf())*e.valueOf())}multiply(e){return new $(this.valueOf()*e)}toString(){const e=this.truncate($.DAY),r=this.truncate($.HOUR),n=this.truncate($.MINUTE),i=this.truncate($.SECOND),a=this.truncate($.MILLISECOND),s=this.truncate($.MICROSECOND),o=this.truncate($.NANOSECOND),c=e,u=r.sub(e),d=n.sub(r),_=i.sub(n),R=a.sub(i),k=s.sub(a),K=o.sub(s);let z="";return c.isZero||(z+=`${c.days}d `),u.isZero||(z+=`${u.hours}h `),d.isZero||(z+=`${d.minutes}m `),_.isZero||(z+=`${_.seconds}s `),R.isZero||(z+=`${R.milliseconds}ms `),k.isZero||(z+=`${k.microseconds}µs `),K.isZero||(z+=`${K.nanoseconds}ns`),z.trim()}get days(){return this.valueOf()/$.DAY.valueOf()}get hours(){return this.valueOf()/$.HOUR.valueOf()}get minutes(){return this.valueOf()/$.MINUTE.valueOf()}get seconds(){return this.valueOf()/$.SECOND.valueOf()}get milliseconds(){return this.valueOf()/$.MILLISECOND.valueOf()}get microseconds(){return this.valueOf()/$.MICROSECOND.valueOf()}get nanoseconds(){return this.valueOf()}get isZero(){return this.valueOf()===0}equals(e){return this.valueOf()===new $(e).valueOf()}add(e){return new $(this.valueOf()+new $(e).valueOf())}sub(e){return new $(this.valueOf()-new $(e).valueOf())}static nanoseconds(e=1){return new $(e)}static microseconds(e=1){return $.nanoseconds(e*1e3)}static milliseconds(e=1){return $.microseconds(e*1e3)}static seconds(e=1){return $.milliseconds(e*1e3)}static minutes(e){return $.seconds(e.valueOf()*60)}static hours(e){return $.minutes(e*60)}static days(e){return $.hours(e*24)}};T(H,"NANOSECOND",H.nanoseconds(1));T(H,"MICROSECOND",H.microseconds(1));T(H,"MILLISECOND",H.milliseconds(1));T(H,"SECOND",H.seconds(1));T(H,"MINUTE",H.minutes(1));T(H,"HOUR",H.hours(1));T(H,"DAY",H.days(1));T(H,"MAX",new H(H.MAX_SAFE_INTEGER));T(H,"MIN",new H(-H.MAX_SAFE_INTEGER));T(H,"ZERO",new H(0));T(H,"z",y.union([y.instanceof(Number).transform(t=>new H(t)),y.number().transform(t=>new H(t)),y.instanceof(H)]));let he=H;const Cr=class zr extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new zr(e).valueOf()}get period(){return he.seconds(1/this.valueOf())}sampleCount(e){return new he(e).seconds*this.valueOf()}byteCount(e,r){return this.sampleCount(e)*new pe(r).valueOf()}span(e){return he.seconds(e/this.valueOf())}byteSpan(e,r){return this.span(e.valueOf()/r.valueOf())}static hz(e){return new zr(e)}static khz(e){return zr.hz(e*1e3)}};T(Cr,"z",y.union([y.number().transform(t=>new Cr(t)),y.instanceof(Number).transform(t=>new Cr(t)),y.instanceof(Cr)]));const ue=class extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}length(e){return e.valueOf()/this.valueOf()}size(e){return new tl(e*this.valueOf())}};T(ue,"UNKNOWN",new ue(0));T(ue,"BIT128",new ue(16));T(ue,"BIT64",new ue(8));T(ue,"BIT32",new ue(4));T(ue,"BIT16",new ue(2));T(ue,"BIT8",new ue(1));T(ue,"z",y.union([y.number().transform(t=>new ue(t)),y.instanceof(Number).transform(t=>new ue(t)),y.instanceof(ue)]));let pe=ue;const Be=class Kr{constructor(e,r){T(this,"start"),T(this,"end"),this.start=new Ee(e),this.end=new Ee(r)}get span(){return new he(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}swap(){return new Kr(this.end,this.start)}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e){e=e.makeValid();const r=this.makeValid();return e.start.equals(r.start)?!0:e.end.equals(this.start)||e.start.equals(this.end)?!1:this.contains(e.end)||this.contains(e.start)||e.contains(this.start)||e.contains(this.end)}contains(e){return e instanceof Kr?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const r=new Kr(this.start,this.end);return e.start.after(this.start)&&(r.start=e.start),e.start.after(this.end)&&(r.end=e.start),e.end.before(this.end)&&(r.end=e.end),e.end.before(this.start)&&(r.start=e.end),r}};T(Be,"MAX",new Be(Ee.MIN,Ee.MAX));T(Be,"MIN",new Be(Ee.MAX,Ee.MIN));T(Be,"ZERO",new Be(Ee.ZERO,Ee.ZERO));T(Be,"z",y.union([y.object({start:Ee.z,end:Ee.z}).transform(t=>new Be(t.start,t.end)),y.instanceof(Be)]));let el=Be;const v=class gt extends String{constructor(e){if(e instanceof gt||typeof e=="string"||typeof e.valueOf()=="string"){super(e.valueOf());return}else{const r=gt.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(r!=null){super(r.valueOf());return}}throw super(gt.UNKNOWN.valueOf()),new Error(`unable to find data type for ${e.toString()}`)}get Array(){const e=gt.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}toString(){return this.valueOf()}get density(){const e=gt.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}checkArray(e){return e.constructor===this.Array}toJSON(){return this.toString()}get usesBigInt(){return gt.BIG_INT_TYPES.some(e=>e.equals(this))}};T(v,"UNKNOWN",new v("unknown"));T(v,"FLOAT64",new v("float64"));T(v,"FLOAT32",new v("float32"));T(v,"INT64",new v("int64"));T(v,"INT32",new v("int32"));T(v,"INT16",new v("int16"));T(v,"INT8",new v("int8"));T(v,"UINT64",new v("uint64"));T(v,"UINT32",new v("uint32"));T(v,"UINT16",new v("uint16"));T(v,"UINT8",new v("uint8"));T(v,"TIMESTAMP",new v("timestamp"));T(v,"UUID",new v("uuid"));T(v,"STRING",new v("string"));T(v,"JSON",new v("json"));T(v,"ARRAY_CONSTRUCTORS",new Map([[v.UINT8.toString(),Uint8Array],[v.UINT16.toString(),Uint16Array],[v.UINT32.toString(),Uint32Array],[v.UINT64.toString(),BigUint64Array],[v.FLOAT32.toString(),Float32Array],[v.FLOAT64.toString(),Float64Array],[v.INT8.toString(),Int8Array],[v.INT16.toString(),Int16Array],[v.INT32.toString(),Int32Array],[v.INT64.toString(),BigInt64Array],[v.TIMESTAMP.toString(),BigInt64Array],[v.STRING.toString(),Uint8Array],[v.JSON.toString(),Uint8Array],[v.UUID.toString(),Uint8Array]]));T(v,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,v.UINT8],[Uint16Array.name,v.UINT16],[Uint32Array.name,v.UINT32],[BigUint64Array.name,v.UINT64],[Float32Array.name,v.FLOAT32],[Float64Array.name,v.FLOAT64],[Int8Array.name,v.INT8],[Int16Array.name,v.INT16],[Int32Array.name,v.INT32],[BigInt64Array.name,v.INT64]]));T(v,"DENSITIES",new Map([[v.UINT8.toString(),pe.BIT8],[v.UINT16.toString(),pe.BIT16],[v.UINT32.toString(),pe.BIT32],[v.UINT64.toString(),pe.BIT64],[v.FLOAT32.toString(),pe.BIT32],[v.FLOAT64.toString(),pe.BIT64],[v.INT8.toString(),pe.BIT8],[v.INT16.toString(),pe.BIT16],[v.INT32.toString(),pe.BIT32],[v.INT64.toString(),pe.BIT64],[v.TIMESTAMP.toString(),pe.BIT64],[v.STRING.toString(),pe.UNKNOWN],[v.JSON.toString(),pe.UNKNOWN],[v.UUID.toString(),pe.BIT128]]));T(v,"ALL",[v.UNKNOWN,v.FLOAT64,v.FLOAT32,v.INT64,v.INT32,v.INT16,v.INT8,v.UINT64,v.UINT32,v.UINT16,v.UINT8,v.TIMESTAMP,v.UUID,v.STRING,v.JSON]);T(v,"BIG_INT_TYPES",[v.INT64,v.UINT64,v.TIMESTAMP]);T(v,"z",y.union([y.string().transform(t=>new v(t)),y.instanceof(v)]));const le=class ae extends Number{constructor(e){super(e.valueOf())}largerThan(e){return this.valueOf()>e.valueOf()}smallerThan(e){return this.valueOf()<e.valueOf()}add(e){return ae.bytes(this.valueOf()+e.valueOf())}sub(e){return ae.bytes(this.valueOf()-e.valueOf())}truncate(e){return new ae(Math.trunc(this.valueOf()/e.valueOf())*e.valueOf())}remainder(e){return ae.bytes(this.valueOf()%e.valueOf())}get gigabytes(){return this.valueOf()/ae.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/ae.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/ae.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/ae.TERABYTE.valueOf()}toString(){const e=this.truncate(ae.TERABYTE),r=this.truncate(ae.GIGABYTE),n=this.truncate(ae.MEGABYTE),i=this.truncate(ae.KILOBYTE),a=this.truncate(ae.BYTE),s=e,o=r.sub(e),c=n.sub(r),u=i.sub(n),d=a.sub(i);let _="";return s.isZero||(_+=`${s.terabytes}TB `),o.isZero||(_+=`${o.gigabytes}GB `),c.isZero||(_+=`${c.megabytes}MB `),u.isZero||(_+=`${u.kilobytes}KB `),(!d.isZero||_==="")&&(_+=`${d.valueOf()}B`),_.trim()}static bytes(e=1){return new ae(e)}static kilobytes(e=1){return ae.bytes(e.valueOf()*1e3)}static megabytes(e=1){return ae.kilobytes(e.valueOf()*1e3)}static gigabytes(e=1){return ae.megabytes(e.valueOf()*1e3)}static terabytes(e){return ae.gigabytes(e.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};T(le,"BYTE",new le(1));T(le,"KILOBYTE",le.kilobytes(1));T(le,"MEGABYTE",le.megabytes(1));T(le,"GIGABYTE",le.gigabytes(1));T(le,"TERABYTE",le.terabytes(1));T(le,"ZERO",new le(0));T(le,"z",y.union([y.number().transform(t=>new le(t)),y.instanceof(le)]));let tl=le;y.union([y.instanceof(Uint8Array),y.instanceof(Uint16Array),y.instanceof(Uint32Array),y.instanceof(BigUint64Array),y.instanceof(Float32Array),y.instanceof(Float64Array),y.instanceof(Int8Array),y.instanceof(Int16Array),y.instanceof(Int32Array),y.instanceof(BigInt64Array)]);y.record(y.union([y.number(),y.string(),y.symbol()]),y.unknown());const Ps=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",rl=Ps(),xs=["MacOS","Windows","Linux","Docker"],nl=y.enum(xs);let Pr;const il=()=>{if(typeof window>"u")return;const t=window.navigator.userAgent.toLowerCase();if(t.includes("mac"))return"MacOS";if(t.includes("win"))return"Windows";if(t.includes("linux"))return"Linux"},al=(t={})=>{const{force:e,default:r}=t;return e??Pr??(Pr=il(),Pr??r)},sl=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:xs,RUNTIME:rl,detect:Ps,getOS:al,osZ:nl},Symbol.toStringTag,{value:"Module"})),ol=(...t)=>t.map(Ls).join(""),Ls=t=>(t.endsWith("/")||(t+="/"),t.startsWith("/")&&(t=t.slice(1)),t),ul=t=>t.endsWith("/")?t.slice(0,-1):t;Pt=class{constructor({host:t,port:e,protocol:r="",pathPrefix:n=""}){T(this,"protocol"),T(this,"host"),T(this,"port"),T(this,"path"),this.protocol=r,this.host=t,this.port=e,this.path=Ls(n)}replace(t){return new Pt({host:t.host??this.host,port:t.port??this.port,protocol:t.protocol??this.protocol,pathPrefix:t.pathPrefix??this.path})}child(t){return new Pt({...this,pathPrefix:ol(this.path,t)})}toString(){return ul(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}},T(Pt,"UNKNOWN",new Pt({host:"unknown",port:0}));var ri;try{ri=new TextDecoder}catch{}var S,Oe,l=0,q={},G,ot,Se=0,ke=0,oe,et,ye=[],V,ma={useRecords:!1,mapsAsObjects:!0};class Ms{}const Ds=new Ms;Ds.name="MessagePack 0xC1";var lt=!1,ks=2,ga;try{new Function("")}catch{ks=1/0}class vr{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.sequential&&e.trusted!==!1&&(e.trusted=!0,!e.structures&&e.useRecords!=!1&&(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,r){if(S)return Gs(()=>(ii(),this?this.unpack(e,r):vr.prototype.unpack.call(ma,e,r)));!e.buffer&&e.constructor===ArrayBuffer&&(e=typeof Buffer<"u"?Buffer.from(e):new Uint8Array(e)),typeof r=="object"?(Oe=r.end||e.length,l=r.start||0):(l=0,Oe=r>-1?r:e.length),ke=0,ot=null,oe=null,S=e;try{V=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){throw S=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof vr){if(q=this,this.structures)return G=this.structures,xr(r);(!G||G.length>0)&&(G=[])}else q=ma,(!G||G.length>0)&&(G=[]);return xr(r)}unpackMultiple(e,r){let n,i=0;try{lt=!0;let a=e.length,s=this?this.unpack(e,a):gn.unpack(e,a);if(r){if(r(s,i,l)===!1)return;for(;l<a;)if(i=l,r(xr(),i,l)===!1)return}else{for(n=[s];l<a;)i=l,n.push(xr());return n}}catch(a){throw a.lastPosition=i,a.values=n,a}finally{lt=!1,ii()}}_mergeStructures(e,r){e=e||[],Object.isFrozen(e)&&(e=e.map(n=>n.slice(0)));for(let n=0,i=e.length;n<i;n++){let a=e[n];a&&(a.isShared=!0,n>=32&&(a.highByte=n-32>>5))}e.sharedLength=e.length;for(let n in r||[])if(n>=0){let i=e[n],a=r[n];a&&(i&&((e.restoreStructures||(e.restoreStructures=[]))[n]=i),e[n]=a)}return this.structures=e}decode(e,r){return this.unpack(e,r)}}function xr(t){try{if(!q.trusted&&!lt){let r=G.sharedLength||0;r<G.length&&(G.length=r)}let e;if(q.randomAccessStructure&&S[l]<64&&S[l]>=32&&ga?(e=ga(S,l,Oe,q),S=null,!(t&&t.lazy)&&e&&(e=e.toJSON()),l=Oe):e=ie(),oe&&(l=oe.postBundlePosition,oe=null),lt&&(G.restoreStructures=null),l==Oe)G&&G.restoreStructures&&Ea(),G=null,S=null,et&&(et=null);else{if(l>Oe)throw new Error("Unexpected end of MessagePack data");if(!lt){let r;try{r=JSON.stringify(e,(n,i)=>typeof i=="bigint"?`${i}n`:i).slice(0,100)}catch(n){r="(JSON view not available "+n+")"}throw new Error("Data read, but end of buffer not reached "+r)}}return e}catch(e){throw G&&G.restoreStructures&&Ea(),ii(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||l>Oe)&&(e.incomplete=!0),e}}function Ea(){for(let t in G.restoreStructures)G[t]=G.restoreStructures[t];G.restoreStructures=null}function ie(){let t=S[l++];if(t<160)if(t<128){if(t<64)return t;{let e=G[t&63]||q.getStructures&&Us()[t&63];return e?(e.read||(e.read=ki(e,t&63)),e.read()):t}}else if(t<144)if(t-=128,q.mapsAsObjects){let e={};for(let r=0;r<t;r++){let n=js();n==="__proto__"&&(n="__proto_"),e[n]=ie()}return e}else{let e=new Map;for(let r=0;r<t;r++)e.set(ie(),ie());return e}else{t-=144;let e=new Array(t);for(let r=0;r<t;r++)e[r]=ie();return q.freezeData?Object.freeze(e):e}else if(t<192){let e=t-160;if(ke>=l)return ot.slice(l-Se,(l+=e)-Se);if(ke==0&&Oe<140){let r=e<16?Ui(e):Bs(e);if(r!=null)return r}return ni(e)}else{let e;switch(t){case 192:return null;case 193:return oe?(e=ie(),e>0?oe[1].slice(oe.position1,oe.position1+=e):oe[0].slice(oe.position0,oe.position0-=e)):Ds;case 194:return!1;case 195:return!0;case 196:if(e=S[l++],e===void 0)throw new Error("Unexpected end of buffer");return kn(e);case 197:return e=V.getUint16(l),l+=2,kn(e);case 198:return e=V.getUint32(l),l+=4,kn(e);case 199:return mt(S[l++]);case 200:return e=V.getUint16(l),l+=2,mt(e);case 201:return e=V.getUint32(l),l+=4,mt(e);case 202:if(e=V.getFloat32(l),q.useFloat32>2){let r=Bi[(S[l]&127)<<1|S[l+1]>>7];return l+=4,(r*e+(e>0?.5:-.5)>>0)/r}return l+=4,e;case 203:return e=V.getFloat64(l),l+=8,e;case 204:return S[l++];case 205:return e=V.getUint16(l),l+=2,e;case 206:return e=V.getUint32(l),l+=4,e;case 207:return q.int64AsType==="number"?(e=V.getUint32(l)*4294967296,e+=V.getUint32(l+4)):q.int64AsType==="string"?e=V.getBigUint64(l).toString():q.int64AsType==="auto"?(e=V.getBigUint64(l),e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=V.getBigUint64(l),l+=8,e;case 208:return V.getInt8(l++);case 209:return e=V.getInt16(l),l+=2,e;case 210:return e=V.getInt32(l),l+=4,e;case 211:return q.int64AsType==="number"?(e=V.getInt32(l)*4294967296,e+=V.getUint32(l+4)):q.int64AsType==="string"?e=V.getBigInt64(l).toString():q.int64AsType==="auto"?(e=V.getBigInt64(l),e>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=V.getBigInt64(l),l+=8,e;case 212:if(e=S[l++],e==114)return wa(S[l++]&63);{let r=ye[e];if(r)return r.read?(l++,r.read(ie())):r.noBuffer?(l++,r()):r(S.subarray(l,++l));throw new Error("Unknown extension "+e)}case 213:return e=S[l],e==114?(l++,wa(S[l++]&63,S[l++])):mt(2);case 214:return mt(4);case 215:return mt(8);case 216:return mt(16);case 217:return e=S[l++],ke>=l?ot.slice(l-Se,(l+=e)-Se):ll(e);case 218:return e=V.getUint16(l),l+=2,ke>=l?ot.slice(l-Se,(l+=e)-Se):fl(e);case 219:return e=V.getUint32(l),l+=4,ke>=l?ot.slice(l-Se,(l+=e)-Se):dl(e);case 220:return e=V.getUint16(l),l+=2,Sa(e);case 221:return e=V.getUint32(l),l+=4,Sa(e);case 222:return e=V.getUint16(l),l+=2,Oa(e);case 223:return e=V.getUint32(l),l+=4,Oa(e);default:if(t>=224)return t-256;if(t===void 0){let r=new Error("Unexpected end of MessagePack data");throw r.incomplete=!0,r}throw new Error("Unknown MessagePack token "+t)}}}const cl=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function ki(t,e){function r(){if(r.count++>ks){let i=t.read=new Function("r","return function(){return "+(q.freezeData?"Object.freeze":"")+"({"+t.map(a=>a==="__proto__"?"__proto_:r()":cl.test(a)?a+":r()":"["+JSON.stringify(a)+"]:r()").join(",")+"})}")(ie);return t.highByte===0&&(t.read=Ta(e,t.read)),i()}let n={};for(let i=0,a=t.length;i<a;i++){let s=t[i];s==="__proto__"&&(s="__proto_"),n[s]=ie()}return q.freezeData?Object.freeze(n):n}return r.count=0,t.highByte===0?Ta(e,r):r}const Ta=(t,e)=>function(){let r=S[l++];if(r===0)return e();let n=t<32?-(t+(r<<5)):t+(r<<5),i=G[n]||Us()[n];if(!i)throw new Error("Record id is not defined for "+n);return i.read||(i.read=ki(i,t)),i.read()};function Us(){let t=Gs(()=>(S=null,q.getStructures()));return G=q._mergeStructures(t,G)}var ni=Sr,ll=Sr,fl=Sr,dl=Sr;function Sr(t){let e;if(t<16&&(e=Ui(t)))return e;if(t>64&&ri)return ri.decode(S.subarray(l,l+=t));const r=l+t,n=[];for(e="";l<r;){const i=S[l++];if(!(i&128))n.push(i);else if((i&224)===192){const a=S[l++]&63;n.push((i&31)<<6|a)}else if((i&240)===224){const a=S[l++]&63,s=S[l++]&63;n.push((i&31)<<12|a<<6|s)}else if((i&248)===240){const a=S[l++]&63,s=S[l++]&63,o=S[l++]&63;let c=(i&7)<<18|a<<12|s<<6|o;c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c)}else n.push(i);n.length>=4096&&(e+=se.apply(String,n),n.length=0)}return n.length>0&&(e+=se.apply(String,n)),e}function Sa(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=ie();return q.freezeData?Object.freeze(e):e}function Oa(t){if(q.mapsAsObjects){let e={};for(let r=0;r<t;r++){let n=js();n==="__proto__"&&(n="__proto_"),e[n]=ie()}return e}else{let e=new Map;for(let r=0;r<t;r++)e.set(ie(),ie());return e}}var se=String.fromCharCode;function Bs(t){let e=l,r=new Array(t);for(let n=0;n<t;n++){const i=S[l++];if((i&128)>0){l=e;return}r[n]=i}return se.apply(String,r)}function Ui(t){if(t<4)if(t<2){if(t===0)return"";{let e=S[l++];if((e&128)>1){l-=1;return}return se(e)}}else{let e=S[l++],r=S[l++];if((e&128)>0||(r&128)>0){l-=2;return}if(t<3)return se(e,r);let n=S[l++];if((n&128)>0){l-=3;return}return se(e,r,n)}else{let e=S[l++],r=S[l++],n=S[l++],i=S[l++];if((e&128)>0||(r&128)>0||(n&128)>0||(i&128)>0){l-=4;return}if(t<6){if(t===4)return se(e,r,n,i);{let a=S[l++];if((a&128)>0){l-=5;return}return se(e,r,n,i,a)}}else if(t<8){let a=S[l++],s=S[l++];if((a&128)>0||(s&128)>0){l-=6;return}if(t<7)return se(e,r,n,i,a,s);let o=S[l++];if((o&128)>0){l-=7;return}return se(e,r,n,i,a,s,o)}else{let a=S[l++],s=S[l++],o=S[l++],c=S[l++];if((a&128)>0||(s&128)>0||(o&128)>0||(c&128)>0){l-=8;return}if(t<10){if(t===8)return se(e,r,n,i,a,s,o,c);{let u=S[l++];if((u&128)>0){l-=9;return}return se(e,r,n,i,a,s,o,c,u)}}else if(t<12){let u=S[l++],d=S[l++];if((u&128)>0||(d&128)>0){l-=10;return}if(t<11)return se(e,r,n,i,a,s,o,c,u,d);let _=S[l++];if((_&128)>0){l-=11;return}return se(e,r,n,i,a,s,o,c,u,d,_)}else{let u=S[l++],d=S[l++],_=S[l++],R=S[l++];if((u&128)>0||(d&128)>0||(_&128)>0||(R&128)>0){l-=12;return}if(t<14){if(t===12)return se(e,r,n,i,a,s,o,c,u,d,_,R);{let k=S[l++];if((k&128)>0){l-=13;return}return se(e,r,n,i,a,s,o,c,u,d,_,R,k)}}else{let k=S[l++],K=S[l++];if((k&128)>0||(K&128)>0){l-=14;return}if(t<15)return se(e,r,n,i,a,s,o,c,u,d,_,R,k,K);let z=S[l++];if((z&128)>0){l-=15;return}return se(e,r,n,i,a,s,o,c,u,d,_,R,k,K,z)}}}}}function Aa(){let t=S[l++],e;if(t<192)e=t-160;else switch(t){case 217:e=S[l++];break;case 218:e=V.getUint16(l),l+=2;break;case 219:e=V.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return Sr(e)}function kn(t){return q.copyBuffers?Uint8Array.prototype.slice.call(S,l,l+=t):S.subarray(l,l+=t)}function mt(t){let e=S[l++];if(ye[e]){let r;return ye[e](S.subarray(l,r=l+=t),n=>{l=n;try{return ie()}finally{l=r}})}else throw new Error("Unknown extension type "+e)}var ba=new Array(4096);function js(){let t=S[l++];if(t>=160&&t<192){if(t=t-160,ke>=l)return ot.slice(l-Se,(l+=t)-Se);if(!(ke==0&&Oe<180))return ni(t)}else return l--,ie().toString();let e=(t<<5^(t>1?V.getUint16(l):t>0?S[l]:0))&4095,r=ba[e],n=l,i=l+t-3,a,s=0;if(r&&r.bytes==t){for(;n<i;){if(a=V.getUint32(n),a!=r[s++]){n=1879048192;break}n+=4}for(i+=3;n<i;)if(a=S[n++],a!=r[s++]){n=1879048192;break}if(n===i)return l=n,r.string;i-=3,n=l}for(r=[],ba[e]=r,r.bytes=t;n<i;)a=V.getUint32(n),r.push(a),n+=4;for(i+=3;n<i;)a=S[n++],r.push(a);let o=t<16?Ui(t):Bs(t);return o!=null?r.string=o:r.string=ni(t)}const wa=(t,e)=>{let r=ie().map(a=>a.toString()),n=t;e!==void 0&&(t=t<32?-((e<<5)+t):(e<<5)+t,r.highByte=e);let i=G[t];return i&&(i.isShared||lt)&&((G.restoreStructures||(G.restoreStructures=[]))[t]=i),G[t]=r,r.read=ki(r,n),r.read()};ye[0]=()=>{};ye[0].noBuffer=!0;let pl={Error,TypeError,ReferenceError};ye[101]=()=>{let t=ie();return(pl[t[0]]||Error)(t[1])};ye[105]=t=>{let e=V.getUint32(l-4);et||(et=new Map);let r=S[l],n;r>=144&&r<160||r==220||r==221?n=[]:n={};let i={target:n};et.set(e,i);let a=ie();return i.used?Object.assign(n,a):(i.target=a,a)};ye[112]=t=>{let e=V.getUint32(l-4),r=et.get(e);return r.used=!0,r.target};ye[115]=()=>new Set(ie());const Vs=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(t=>t+"Array");let hl=typeof globalThis=="object"?globalThis:window;ye[116]=t=>{let e=t[0],r=Vs[e];if(!r)throw new Error("Could not find typed array for code "+e);return new hl[r](Uint8Array.prototype.slice.call(t,1).buffer)};ye[120]=()=>{let t=ie();return new RegExp(t[0],t[1])};const _l=[];ye[98]=t=>{let e=(t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3],r=l;return l+=e-t.length,oe=_l,oe=[Aa(),Aa()],oe.position0=0,oe.position1=0,oe.postBundlePosition=l,l=r,ie()};ye[255]=t=>t.length==4?new Date((t[0]*16777216+(t[1]<<16)+(t[2]<<8)+t[3])*1e3):t.length==8?new Date(((t[0]<<22)+(t[1]<<14)+(t[2]<<6)+(t[3]>>2))/1e6+((t[3]&3)*4294967296+t[4]*16777216+(t[5]<<16)+(t[6]<<8)+t[7])*1e3):t.length==12?new Date(((t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3])/1e6+((t[4]&128?-281474976710656:0)+t[6]*1099511627776+t[7]*4294967296+t[8]*16777216+(t[9]<<16)+(t[10]<<8)+t[11])*1e3):new Date("invalid");function Gs(t){let e=Oe,r=l,n=Se,i=ke,a=ot,s=et,o=oe,c=new Uint8Array(S.slice(0,Oe)),u=G,d=G.slice(0,G.length),_=q,R=lt,k=t();return Oe=e,l=r,Se=n,ke=i,ot=a,et=s,oe=o,S=c,lt=R,G=u,G.splice(0,G.length,...d),q=_,V=new DataView(S.buffer,S.byteOffset,S.byteLength),k}function ii(){S=null,et=null,G=null}function vl(t){t.unpack?ye[t.type]=t.unpack:ye[t.type]=t}const Bi=new Array(147);for(let t=0;t<256;t++)Bi[t]=+("1e"+Math.floor(45.15-t*.30103));var gn=new vr({useRecords:!1});const yl=gn.unpack;gn.unpackMultiple;gn.unpack;let ml=new Float32Array(1);new Uint8Array(ml.buffer,0,4);let Fr;try{Fr=new TextEncoder}catch{}let sn,ji;const En=typeof Buffer<"u",Lr=En?function(t){return Buffer.allocUnsafeSlow(t)}:Uint8Array,$s=En?Buffer:Uint8Array,Na=En?4294967296:2144337920;let p,Yt,Y,f=0,de,J=null,gl;const El=21760,Tl=/[\u0080-\uFFFF]/,xt=Symbol("record-id");class Sl extends vr{constructor(e){super(e),this.offset=0;let r,n,i,a,s=$s.prototype.utf8Write?function(h,w){return p.utf8Write(h,w,4294967295)}:Fr&&Fr.encodeInto?function(h,w){return Fr.encodeInto(h,p.subarray(w)).written}:!1,o=this;e||(e={});let c=e&&e.sequential,u=e.structures||e.saveStructures,d=e.maxSharedStructures;if(d==null&&(d=u?32:0),d>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&e.moreTypes==null&&(this.moreTypes=!0);let _=e.maxOwnStructures;_==null&&(_=u?32:64),!this.structures&&e.useRecords!=!1&&(this.structures=[]);let R=d>32||_+d>64,k=d+64,K=d+_+64;if(K>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let z=[],Le=0,ge=0;this.pack=this.encode=function(h,w){if(p||(p=new Lr(8192),Y=p.dataView||(p.dataView=new DataView(p.buffer,0,8192)),f=0),de=p.length-10,de-f<2048?(p=new Lr(p.length),Y=p.dataView||(p.dataView=new DataView(p.buffer,0,p.length)),de=p.length-10,f=0):f=f+7&2147483640,r=f,w&Cl&&(f+=w&255),a=o.structuredClone?new Map:null,o.bundleStrings&&typeof h!="string"?(J=[],J.size=1/0):J=null,i=o.structures,i){i.uninitialized&&(i=o._mergeStructures(o.getStructures()));let m=i.sharedLength||0;if(m>d)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+i.sharedLength);if(!i.transitions){i.transitions=Object.create(null);for(let E=0;E<m;E++){let O=i[E];if(!O)continue;let D,U=i.transitions;for(let P=0,ne=O.length;P<ne;P++){let F=O[P];D=U[F],D||(D=U[F]=Object.create(null)),U=D}U[xt]=E+64}this.lastNamedStructuresLength=m}c||(i.nextId=m+64)}n&&(n=!1);try{o.randomAccessStructure&&h&&h.constructor&&h.constructor===Object?zo(h):W(h);let m=J;if(J&&Ca(r,W,0),a&&a.idsToInsert){let E=a.idsToInsert.sort((P,ne)=>P.offset>ne.offset?1:-1),O=E.length,D=-1;for(;m&&O>0;){let P=E[--O].offset+r;P<m.stringsPosition+r&&D===-1&&(D=0),P>m.position+r?D>=0&&(D+=6):(D>=0&&(Y.setUint32(m.position+r,Y.getUint32(m.position+r)+D),D=-1),m=m.previous,O++)}D>=0&&m&&Y.setUint32(m.position+r,Y.getUint32(m.position+r)+D),f+=E.length*6,f>de&&nt(f),o.offset=f;let U=Al(p.subarray(r,f),E);return a=null,U}return o.offset=f,w&Rl?(p.start=r,p.end=f,p):p.subarray(r,f)}finally{if(i&&(Ct(),n&&o.saveStructures)){let m=i.sharedLength||0,E=p.subarray(r,f),O=wl(i,o);return o.saveStructures(O,O.isCompatible)===!1?o.pack(h,w):(o.lastNamedStructuresLength=m,E)}w&Il&&(f=r)}};const Ct=()=>{ge<10&&ge++;let h=i.sharedLength||0;if(i.length>h&&!c&&(i.length=h),Le>1e4)i.transitions=null,ge=0,Le=0,z.length>0&&(z=[]);else if(z.length>0&&!c){for(let w=0,m=z.length;w<m;w++)z[w][xt]=0;z=[]}},rt=h=>{var w=h.length;w<16?p[f++]=144|w:w<65536?(p[f++]=220,p[f++]=w>>8,p[f++]=w&255):(p[f++]=221,Y.setUint32(f,w),f+=4);for(let m=0;m<w;m++)W(h[m])},W=h=>{f>de&&(p=nt(f));var w=typeof h,m;if(w==="string"){let E=h.length;if(J&&E>=4&&E<4096){if((J.size+=E)>El){let P,ne=(J[0]?J[0].length*3+J[1].length:0)+10;f+ne>de&&(p=nt(f+ne));let F;J.position?(F=J,p[f]=200,f+=3,p[f++]=98,P=f-r,f+=4,Ca(r,W,0),Y.setUint16(P+r-3,f-r-P)):(p[f++]=214,p[f++]=98,P=f-r,f+=4),J=["",""],J.previous=F,J.size=0,J.position=P}let U=Tl.test(h);J[U?0:1]+=h,p[f++]=193,W(U?-E:E);return}let O;E<32?O=1:E<256?O=2:E<65536?O=3:O=5;let D=E*3;if(f+D>de&&(p=nt(f+D)),E<64||!s){let U,P,ne,F=f+O;for(U=0;U<E;U++)P=h.charCodeAt(U),P<128?p[F++]=P:P<2048?(p[F++]=P>>6|192,p[F++]=P&63|128):(P&64512)===55296&&((ne=h.charCodeAt(U+1))&64512)===56320?(P=65536+((P&1023)<<10)+(ne&1023),U++,p[F++]=P>>18|240,p[F++]=P>>12&63|128,p[F++]=P>>6&63|128,p[F++]=P&63|128):(p[F++]=P>>12|224,p[F++]=P>>6&63|128,p[F++]=P&63|128);m=F-f-O}else m=s(h,f+O);m<32?p[f++]=160|m:m<256?(O<2&&p.copyWithin(f+2,f+1,f+1+m),p[f++]=217,p[f++]=m):m<65536?(O<3&&p.copyWithin(f+3,f+2,f+2+m),p[f++]=218,p[f++]=m>>8,p[f++]=m&255):(O<5&&p.copyWithin(f+5,f+3,f+3+m),p[f++]=219,Y.setUint32(f,m),f+=4),f+=m}else if(w==="number")if(h>>>0===h)h<32||h<128&&this.useRecords===!1||h<64&&!this.randomAccessStructure?p[f++]=h:h<256?(p[f++]=204,p[f++]=h):h<65536?(p[f++]=205,p[f++]=h>>8,p[f++]=h&255):(p[f++]=206,Y.setUint32(f,h),f+=4);else if(h>>0===h)h>=-32?p[f++]=256+h:h>=-128?(p[f++]=208,p[f++]=h+256):h>=-32768?(p[f++]=209,Y.setInt16(f,h),f+=2):(p[f++]=210,Y.setInt32(f,h),f+=4);else{let E;if((E=this.useFloat32)>0&&h<4294967296&&h>=-2147483648){p[f++]=202,Y.setFloat32(f,h);let O;if(E<4||(O=h*Bi[(p[f]&127)<<1|p[f+1]>>7])>>0===O){f+=4;return}else f--}p[f++]=203,Y.setFloat64(f,h),f+=8}else if(w==="object"||w==="function")if(!h)p[f++]=192;else{if(a){let O=a.get(h);if(O){if(!O.id){let D=a.idsToInsert||(a.idsToInsert=[]);O.id=D.push(O)}p[f++]=214,p[f++]=112,Y.setUint32(f,O.id),f+=4;return}else a.set(h,{offset:f-r})}let E=h.constructor;if(E===Object)Rr(h,!0);else if(E===Array)rt(h);else if(E===Map)if(this.mapAsEmptyObject)p[f++]=128;else{m=h.size,m<16?p[f++]=128|m:m<65536?(p[f++]=222,p[f++]=m>>8,p[f++]=m&255):(p[f++]=223,Y.setUint32(f,m),f+=4);for(let[O,D]of h)W(O),W(D)}else{for(let O=0,D=sn.length;O<D;O++){let U=ji[O];if(h instanceof U){let P=sn[O];if(P.write){P.type&&(p[f++]=212,p[f++]=P.type,p[f++]=0);let it=P.write.call(this,h);it===h?Array.isArray(h)?rt(h):Rr(h):W(it);return}let ne=p,F=Y,Ze=f;p=null;let yt;try{yt=P.pack.call(this,h,it=>(p=ne,ne=null,f+=it,f>de&&nt(f),{target:p,targetView:Y,position:f-it}),W)}finally{ne&&(p=ne,Y=F,f=Ze,de=p.length-10)}yt&&(yt.length+f>de&&nt(yt.length+f),f=Ol(yt,p,f,P.type));return}}if(Array.isArray(h))rt(h);else{if(h.toJSON){const O=h.toJSON();if(O!==h)return W(O)}if(w==="function")return W(this.writeFunction&&this.writeFunction(h));Rr(h,!h.hasOwnProperty)}}}else if(w==="boolean")p[f++]=h?195:194;else if(w==="bigint"){if(h<BigInt(1)<<BigInt(63)&&h>=-(BigInt(1)<<BigInt(63)))p[f++]=211,Y.setBigInt64(f,h);else if(h<BigInt(1)<<BigInt(64)&&h>0)p[f++]=207,Y.setBigUint64(f,h);else if(this.largeBigIntToFloat)p[f++]=203,Y.setFloat64(f,Number(h));else throw new RangeError(h+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");f+=8}else if(w==="undefined")this.encodeUndefinedAsNil?p[f++]=192:(p[f++]=212,p[f++]=0,p[f++]=0);else throw new Error("Unknown type: "+w)},Nr=this.variableMapSize||this.coercibleKeyAsNumber?h=>{let w=Object.keys(h),m=w.length;m<16?p[f++]=128|m:m<65536?(p[f++]=222,p[f++]=m>>8,p[f++]=m&255):(p[f++]=223,Y.setUint32(f,m),f+=4);let E;if(this.coercibleKeyAsNumber)for(let O=0;O<m;O++){E=w[O];let D=Number(E);W(isNaN(D)?E:D),W(h[E])}else for(let O=0;O<m;O++)W(E=w[O]),W(h[E])}:(h,w)=>{p[f++]=222;let m=f-r;f+=2;let E=0;for(let O in h)(w||h.hasOwnProperty(O))&&(W(O),W(h[O]),E++);p[m+++r]=E>>8,p[m+r]=E&255},Ft=this.useRecords===!1?Nr:e.progressiveRecords&&!R?(h,w)=>{let m,E=i.transitions||(i.transitions=Object.create(null)),O=f++-r,D;for(let U in h)if(w||h.hasOwnProperty(U)){if(m=E[U],m)E=m;else{let P=Object.keys(h),ne=E;E=i.transitions;let F=0;for(let Ze=0,yt=P.length;Ze<yt;Ze++){let it=P[Ze];m=E[it],m||(m=E[it]=Object.create(null),F++),E=m}O+r+1==f?(f--,In(E,P,F)):ca(E,P,O,F),D=!0,E=ne[U]}W(h[U])}if(!D){let U=E[xt];U?p[O+r]=U:ca(E,Object.keys(h),O,0)}}:(h,w)=>{let m,E=i.transitions||(i.transitions=Object.create(null)),O=0;for(let U in h)(w||h.hasOwnProperty(U))&&(m=E[U],m||(m=E[U]=Object.create(null),O++),E=m);let D=E[xt];D?D>=96&&R?(p[f++]=((D-=96)&31)+96,p[f++]=D>>5):p[f++]=D:In(E,E.__keys__||Object.keys(h),O);for(let U in h)(w||h.hasOwnProperty(U))&&W(h[U])},ua=typeof this.useRecords=="function"&&this.useRecords,Rr=ua?(h,w)=>{ua(h)?Ft(h,w):Nr(h,w)}:Ft,nt=h=>{let w;if(h>16777216){if(h-r>Na)throw new Error("Packed buffer would be larger than maximum buffer size");w=Math.min(Na,Math.round(Math.max((h-r)*(h>67108864?1.25:2),4194304)/4096)*4096)}else w=(Math.max(h-r<<2,p.length-1)>>12)+1<<12;let m=new Lr(w);return Y=m.dataView||(m.dataView=new DataView(m.buffer,0,w)),h=Math.min(h,p.length),p.copy?p.copy(m,0,r,h):m.set(p.slice(r,h)),f-=r,r=0,de=m.length-10,p=m},In=(h,w,m)=>{let E=i.nextId;E||(E=64),E<k&&this.shouldShareStructure&&!this.shouldShareStructure(w)?(E=i.nextOwnId,E<K||(E=k),i.nextOwnId=E+1):(E>=K&&(E=k),i.nextId=E+1);let O=w.highByte=E>=96&&R?E-96>>5:-1;h[xt]=E,h.__keys__=w,i[E-64]=w,E<k?(w.isShared=!0,i.sharedLength=E-63,n=!0,O>=0?(p[f++]=(E&31)+96,p[f++]=O):p[f++]=E):(O>=0?(p[f++]=213,p[f++]=114,p[f++]=(E&31)+96,p[f++]=O):(p[f++]=212,p[f++]=114,p[f++]=E),m&&(Le+=ge*m),z.length>=_&&(z.shift()[xt]=0),z.push(h),W(w))},ca=(h,w,m,E)=>{let O=p,D=f,U=de,P=r;p=Yt,f=0,r=0,p||(Yt=p=new Lr(8192)),de=p.length-10,In(h,w,E),Yt=p;let ne=f;if(p=O,f=D,de=U,r=P,ne>1){let F=f+ne-1;F>de&&nt(F);let Ze=m+r;p.copyWithin(Ze+ne,Ze+1,f),p.set(Yt.slice(0,ne),Ze),f=F}else p[m+r]=Yt[0]},zo=(h,w)=>{let m=gl(h,p,r,f,i,nt,(E,O,D)=>{if(D)return n=!0;f=O;let U=p;return W(E),Ct(),U!==p?{position:f,targetView:Y,target:p}:f},this);if(m===0)return Rr(h,!0);f=m}}useBuffer(e){p=e,Y=new DataView(p.buffer,p.byteOffset,p.byteLength),f=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}ji=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,Ms];sn=[{pack(t,e,r){let n=t.getTime()/1e3;if((this.useTimestamp32||t.getMilliseconds()===0)&&n>=0&&n<4294967296){let{target:i,targetView:a,position:s}=e(6);i[s++]=214,i[s++]=255,a.setUint32(s,n)}else if(n>0&&n<4294967296){let{target:i,targetView:a,position:s}=e(10);i[s++]=215,i[s++]=255,a.setUint32(s,t.getMilliseconds()*4e6+(n/1e3/4294967296>>0)),a.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return e(0),r(this.onInvalidDate());let{target:i,targetView:a,position:s}=e(3);i[s++]=212,i[s++]=255,i[s++]=255}else{let{target:i,targetView:a,position:s}=e(15);i[s++]=199,i[s++]=12,i[s++]=255,a.setUint32(s,t.getMilliseconds()*1e6),a.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(t,e,r){if(this.setAsEmptyObject)return e(0),r({});let n=Array.from(t),{target:i,position:a}=e(this.moreTypes?3:0);this.moreTypes&&(i[a++]=212,i[a++]=115,i[a++]=0),r(n)}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([t.name,t.message])}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([t.source,t.flags])}},{pack(t,e){this.moreTypes?Ra(t,16,e):Ia(En?Buffer.from(t):new Uint8Array(t),e)}},{pack(t,e){let r=t.constructor;r!==$s&&this.moreTypes?Ra(t,Vs.indexOf(r.name),e):Ia(t,e)}},{pack(t,e){let{target:r,position:n}=e(1);r[n]=193}}];function Ra(t,e,r,n){let i=t.byteLength;if(i+1<256){var{target:a,position:s}=r(4+i);a[s++]=199,a[s++]=i+1}else if(i+1<65536){var{target:a,position:s}=r(5+i);a[s++]=200,a[s++]=i+1>>8,a[s++]=i+1&255}else{var{target:a,position:s,targetView:o}=r(7+i);a[s++]=201,o.setUint32(s,i+1),s+=4}a[s++]=116,a[s++]=e,a.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s)}function Ia(t,e){let r=t.byteLength;var n,i;if(r<256){var{target:n,position:i}=e(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=e(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=r&255}else{var{target:n,position:i,targetView:a}=e(r+5);n[i++]=198,a.setUint32(i,r),i+=4}n.set(t,i)}function Ol(t,e,r,n){let i=t.length;switch(i){case 1:e[r++]=212;break;case 2:e[r++]=213;break;case 4:e[r++]=214;break;case 8:e[r++]=215;break;case 16:e[r++]=216;break;default:i<256?(e[r++]=199,e[r++]=i):i<65536?(e[r++]=200,e[r++]=i>>8,e[r++]=i&255):(e[r++]=201,e[r++]=i>>24,e[r++]=i>>16&255,e[r++]=i>>8&255,e[r++]=i&255)}return e[r++]=n,e.set(t,r),r+=i,r}function Al(t,e){let r,n=e.length*6,i=t.length-n;for(;r=e.pop();){let a=r.offset,s=r.id;t.copyWithin(a+n,a,i),n-=6;let o=a+n;t[o++]=214,t[o++]=105,t[o++]=s>>24,t[o++]=s>>16&255,t[o++]=s>>8&255,t[o++]=s&255,i=a}return t}function Ca(t,e,r){if(J.length>0){Y.setUint32(J.position+t,f+r-J.position-t),J.stringsPosition=f-t;let n=J;J=null,e(n[0]),e(n[1])}}function bl(t){if(t.Class){if(!t.pack&&!t.write)throw new Error("Extension has no pack or write function");if(t.pack&&!t.type)throw new Error("Extension has no type (numeric code to identify the extension)");ji.unshift(t.Class),sn.unshift(t)}vl(t)}function wl(t,e){return t.isCompatible=r=>{let n=!r||(e.lastNamedStructuresLength||0)===r.length;return n||e._mergeStructures(r),n},t}let Zs=new Sl({useRecords:!1});const Nl=Zs.pack;Zs.pack;const Rl=512,Il=1024,Cl=2048;class Pl{constructor(){T(this,"contentType","application/msgpack")}encode(e){return Nl(Gt.toSnake(e))}decode(e,r){const n=Gt.toCamel(yl(new Uint8Array(e)));return r!=null?r.parse(n):n}static registerCustomType(e){bl({type:0,...e})}}class xl{constructor(){T(this,"contentType","application/json")}encode(e){const r=JSON.stringify(Gt.toSnake(e),(n,i)=>ArrayBuffer.isView(i)?Array.from(i):i);return new TextEncoder().encode(r)}decode(e,r){const n=Gt.toCamel(JSON.parse(new TextDecoder().decode(e)));return r!=null?r.parse(n):n}static registerCustomType(){}}new Pl,new xl;var ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ll(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zt(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var zs={},Ue={},Ml=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},St="1.4.1",Pa=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Dl(t){var e=new Set([t]),r=new Set,n=t.match(Pa);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(c){return c===t};function a(o){return r.add(o),!1}function s(o){return e.add(o),!0}return function(c){if(e.has(c))return!0;if(r.has(c))return!1;var u=c.match(Pa);if(!u)return a(c);var d={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return d.prerelease!=null||i.major!==d.major?a(c):i.major===0?i.minor===d.minor&&i.patch<=d.patch?s(c):a(c):i.minor<=d.minor?s(c):a(c)}}var kl=Dl(St),Ul=St.split(".")[0],yr=Symbol.for("opentelemetry.js.api."+Ul),mr=Ml;function Or(t,e,r,n){var i;n===void 0&&(n=!1);var a=mr[yr]=(i=mr[yr])!==null&&i!==void 0?i:{version:St};if(!n&&a[t]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(s.stack||s.message),!1}if(a.version!==St){var s=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+t+" does not match previously registered API v"+St);return r.error(s.stack||s.message),!1}return a[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+St+"."),!0}function Rt(t){var e,r,n=(e=mr[yr])===null||e===void 0?void 0:e.version;if(!(!n||!kl(n)))return(r=mr[yr])===null||r===void 0?void 0:r[t]}function Ar(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+St+".");var r=mr[yr];r&&delete r[t]}var Bl=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},jl=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},Vl=function(){function t(e){this._namespace=e.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Ht("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Ht("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Ht("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Ht("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Ht("verbose",this._namespace,e)},t}();function Ht(t,e,r){var n=Rt("diag");if(n)return r.unshift(e),n[t].apply(n,jl([],Bl(r),!1))}var te;(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(te||(te={}));function Gl(t,e){t<te.NONE?t=te.NONE:t>te.ALL&&(t=te.ALL),e=e||{};function r(n,i){var a=e[n];return typeof a=="function"&&t>=i?a.bind(e):function(){}}return{error:r("error",te.ERROR),warn:r("warn",te.WARN),info:r("info",te.INFO),debug:r("debug",te.DEBUG),verbose:r("verbose",te.VERBOSE)}}var $l=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Zl=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},zl="diag",$e=function(){function t(){function e(i){return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var o=Rt("diag");if(o)return o[i].apply(o,Zl([],$l(a),!1))}}var r=this,n=function(i,a){var s,o,c;if(a===void 0&&(a={logLevel:te.INFO}),i===r){var u=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((s=u.stack)!==null&&s!==void 0?s:u.message),!1}typeof a=="number"&&(a={logLevel:a});var d=Rt("diag"),_=Gl((o=a.logLevel)!==null&&o!==void 0?o:te.INFO,i);if(d&&!a.suppressOverrideMessage){var R=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+R),_.warn("Current logger will overwrite one already registered from "+R)}return Or("diag",_,r,!0)};r.setLogger=n,r.disable=function(){Ar(zl,r)},r.createComponentLogger=function(i){return new Vl(i)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}(),Kl=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Fl=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Yl=function(){function t(e){this._entries=e?new Map(e):new Map}return t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=Kl(e,2),n=r[0],i=r[1];return[n,i]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=new t(this._entries);try{for(var s=Fl(n),o=s.next();!o.done;o=s.next()){var c=o.value;a._entries.delete(c)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return a},t.prototype.clear=function(){return new t},t}(),Hl=Symbol("BaggageEntryMetadata"),Xl=$e.instance();function Wl(t){return t===void 0&&(t={}),new Yl(new Map(Object.entries(t)))}function Ks(t){return typeof t!="string"&&(Xl.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:Hl,toString:function(){return t}}}function Tn(t){return Symbol.for(t)}var ql=function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var a=new t(r._currentContext);return a._currentContext.set(n,i),a},r.deleteValue=function(n){var i=new t(r._currentContext);return i._currentContext.delete(n),i}}return t}(),Et=new ql,Un=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Jl=function(){function t(){function e(n){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(console){var s=console[n];if(typeof s!="function"&&(s=console.log),typeof s=="function")return s.apply(console,i)}}}for(var r=0;r<Un.length;r++)this[Un[r].n]=e(Un[r].c)}return t}(),Kt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ql=function(){function t(){}return t.prototype.createHistogram=function(e,r){return uf},t.prototype.createCounter=function(e,r){return of},t.prototype.createUpDownCounter=function(e,r){return cf},t.prototype.createObservableGauge=function(e,r){return ff},t.prototype.createObservableCounter=function(e,r){return lf},t.prototype.createObservableUpDownCounter=function(e,r){return df},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t}(),Vi=function(){function t(){}return t}(),ef=function(t){Kt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e}(Vi),tf=function(t){Kt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,n){},e}(Vi),rf=function(t){Kt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,n){},e}(Vi),Gi=function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t}(),nf=function(t){Kt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Gi),af=function(t){Kt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Gi),sf=function(t){Kt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Gi),Fs=new Ql,of=new ef,uf=new rf,cf=new tf,lf=new nf,ff=new af,df=new sf;function pf(){return Fs}var ai;(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(ai||(ai={}));var Ys={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},Hs={set:function(t,e,r){t!=null&&(t[e]=r)}},hf=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},_f=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},vf=function(){function t(){}return t.prototype.active=function(){return Et},t.prototype.with=function(e,r,n){for(var i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return r.call.apply(r,_f([n],hf(i),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),yf=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},mf=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},Bn="context",gf=new vf,Sn=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return Or(Bn,e,$e.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(e,r,n){for(var i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,mf([e,r,n],yf(a),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return Rt(Bn)||gf},t.prototype.disable=function(){this._getContextManager().disable(),Ar(Bn,$e.instance())},t}(),xe;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(xe||(xe={}));var $i="0000000000000000",Zi="00000000000000000000000000000000",zi={traceId:Zi,spanId:$i,traceFlags:xe.NONE},er=function(){function t(e){e===void 0&&(e=zi),this._spanContext=e}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t}(),Ki=Tn("OpenTelemetry Context Key SPAN");function Fi(t){return t.getValue(Ki)||void 0}function Ef(){return Fi(Sn.getInstance().active())}function Yi(t,e){return t.setValue(Ki,e)}function Tf(t){return t.deleteValue(Ki)}function Sf(t,e){return Yi(t,new er(e))}function Xs(t){var e;return(e=Fi(t))===null||e===void 0?void 0:e.spanContext()}var Of=/^([0-9a-f]{32})$/i,Af=/^[0-9a-f]{16}$/i;function Hi(t){return Of.test(t)&&t!==Zi}function Ws(t){return Af.test(t)&&t!==$i}function br(t){return Hi(t.traceId)&&Ws(t.spanId)}function bf(t){return new er(t)}var jn=Sn.getInstance(),qs=function(){function t(){}return t.prototype.startSpan=function(e,r,n){n===void 0&&(n=jn.active());var i=!!(r!=null&&r.root);if(i)return new er;var a=n&&Xs(n);return wf(a)&&br(a)?new er(a):new er},t.prototype.startActiveSpan=function(e,r,n,i){var a,s,o;if(!(arguments.length<2)){arguments.length===2?o=r:arguments.length===3?(a=r,o=n):(a=r,s=n,o=i);var c=s??jn.active(),u=this.startSpan(e,a,c),d=Yi(c,u);return jn.with(d,o,void 0,u)}},t}();function wf(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var Nf=new qs,Js=function(){function t(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}return t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,i){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Nf},t}(),Rf=function(){function t(){}return t.prototype.getTracer=function(e,r,n){return new qs},t}(),If=new Rf,si=function(){function t(){}return t.prototype.getTracer=function(e,r,n){var i;return(i=this.getDelegateTracer(e,r,n))!==null&&i!==void 0?i:new Js(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:If},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(e,r,n)},t}(),gr;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(gr||(gr={}));var on;(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(on||(on={}));var un;(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(un||(un={}));var oi="[_0-9a-z-*/]",Cf="[a-z]"+oi+"{0,255}",Pf="[a-z0-9]"+oi+"{0,240}@[a-z]"+oi+"{0,13}",xf=new RegExp("^(?:"+Cf+"|"+Pf+")$"),Lf=/^[ -~]{0,255}[!-~]$/,Mf=/,|=/;function Df(t){return xf.test(t)}function kf(t){return Lf.test(t)&&!Mf.test(t)}var xa=32,Uf=512,La=",",Ma="=",Bf=function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+Ma+e.get(n)),r},[]).join(La)},t.prototype._parse=function(e){e.length>Uf||(this._internalState=e.split(La).reverse().reduce(function(r,n){var i=n.trim(),a=i.indexOf(Ma);if(a!==-1){var s=i.slice(0,a),o=i.slice(a+1,n.length);Df(s)&&kf(o)&&r.set(s,o)}return r},new Map),this._internalState.size>xa&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,xa))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t}();function jf(t){return new Bf(t)}var je=Sn.getInstance(),C=$e.instance(),Vf=function(){function t(){}return t.prototype.getMeter=function(e,r,n){return Fs},t}(),Gf=new Vf,Vn="metrics",$f=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return Or(Vn,e,$e.instance())},t.prototype.getMeterProvider=function(){return Rt(Vn)||Gf},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){Ar(Vn,$e.instance())},t}(),On=$f.getInstance(),Zf=function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t}(),Xi=Tn("OpenTelemetry Baggage Key");function Qs(t){return t.getValue(Xi)||void 0}function zf(){return Qs(Sn.getInstance().active())}function Kf(t,e){return t.setValue(Xi,e)}function Ff(t){return t.deleteValue(Xi)}var Gn="propagation",Yf=new Zf,Hf=function(){function t(){this.createBaggage=Wl,this.getBaggage=Qs,this.getActiveBaggage=zf,this.setBaggage=Kf,this.deleteBaggage=Ff}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return Or(Gn,e,$e.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Hs),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=Ys),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){Ar(Gn,$e.instance())},t.prototype._getGlobalPropagator=function(){return Rt(Gn)||Yf},t}(),Ut=Hf.getInstance(),$n="trace",Xf=function(){function t(){this._proxyTracerProvider=new si,this.wrapSpanContext=bf,this.isSpanContextValid=br,this.deleteSpan=Tf,this.getSpan=Fi,this.getActiveSpan=Ef,this.getSpanContext=Xs,this.setSpan=Yi,this.setSpanContext=Sf}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=Or($n,this._proxyTracerProvider,$e.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return Rt($n)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){Ar($n,$e.instance()),this._proxyTracerProvider=new si},t}(),me=Xf.getInstance();const Wf={context:je,diag:C,metrics:On,propagation:Ut,trace:me},qf=Object.freeze(Object.defineProperty({__proto__:null,DiagConsoleLogger:Jl,get DiagLogLevel(){return te},INVALID_SPANID:$i,INVALID_SPAN_CONTEXT:zi,INVALID_TRACEID:Zi,ProxyTracer:Js,ProxyTracerProvider:si,ROOT_CONTEXT:Et,get SamplingDecision(){return gr},get SpanKind(){return on},get SpanStatusCode(){return un},get TraceFlags(){return xe},get ValueType(){return ai},baggageEntryMetadataFromString:Ks,context:je,createContextKey:Tn,createNoopMeter:pf,createTraceState:jf,default:Wf,defaultTextMapGetter:Ys,defaultTextMapSetter:Hs,diag:C,isSpanContextValid:br,isValidSpanId:Ws,isValidTraceId:Hi,metrics:On,propagation:Ut,trace:me},Symbol.toStringTag,{value:"Module"}));var eo=Tn("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function to(t){return t.setValue(eo,!0)}function Wi(t){return t.getValue(eo)===!0}var Jf="=",ui=";",cn=",",Zn="baggage",Qf=180,ed=4096,td=8192,rd=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function nd(t){return t.reduce(function(e,r){var n=""+e+(e!==""?cn:"")+r;return n.length>td?e:n},"")}function id(t){return t.getAllEntries().map(function(e){var r=rd(e,2),n=r[0],i=r[1],a=encodeURIComponent(n)+"="+encodeURIComponent(i.value);return i.metadata!==void 0&&(a+=ui+i.metadata.toString()),a})}function ro(t){var e=t.split(ui);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.split(Jf);if(n.length===2){var i=decodeURIComponent(n[0].trim()),a=decodeURIComponent(n[1].trim()),s;return e.length>0&&(s=Ks(e.join(ui))),{key:i,value:a,metadata:s}}}}}function no(t){return typeof t!="string"||t.length===0?{}:t.split(cn).map(function(e){return ro(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var ad=function(){function t(){}return t.prototype.inject=function(e,r,n){var i=Ut.getBaggage(e);if(!(!i||Wi(e))){var a=id(i).filter(function(o){return o.length<=ed}).slice(0,Qf),s=nd(a);s.length>0&&n.set(r,Zn,s)}},t.prototype.extract=function(e,r,n){var i=n.get(r,Zn),a=Array.isArray(i)?i.join(cn):i;if(!a)return e;var s={};if(a.length===0)return e;var o=a.split(cn);return o.forEach(function(c){var u=ro(c);if(u){var d={value:u.value};u.metadata&&(d.metadata=u.metadata),s[u.key]=d}}),Object.entries(s).length===0?e:Ut.setBaggage(e,Ut.createBaggage(s))},t.prototype.fields=function(){return[Zn]},t}(),io=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},sd=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function Yr(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var i=io(Object.entries(t)),a=i.next();!a.done;a=i.next()){var s=sd(a.value,2),o=s[0],c=s[1];if(!od(o)){C.warn("Invalid attribute key: "+o);continue}if(!ao(c)){C.warn("Invalid attribute value set for key: "+o);continue}Array.isArray(c)?n[o]=c.slice():n[o]=c}}catch(u){e={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}function od(t){return typeof t=="string"&&t.length>0}function ao(t){return t==null?!0:Array.isArray(t)?ud(t):so(t)}function ud(t){var e,r,n;try{for(var i=io(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(s!=null){if(!n){if(so(s)){n=typeof s;continue}return!1}if(typeof s!==n)return!1}}}catch(o){e={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return!0}function so(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}function cd(){return function(t){C.error(ld(t))}}function ld(t){return typeof t=="string"?t:JSON.stringify(fd(t))}function fd(t){for(var e={},r=t;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!e[n]){var i=r[n];i&&(e[n]=String(i))}}),r=Object.getPrototypeOf(r);return e}var dd=cd();function At(t){try{dd(t)}catch{}}var De;(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(De||(De={}));var oo=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},pd=",",hd=["OTEL_SDK_DISABLED"];function _d(t){return hd.indexOf(t)>-1}var vd=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function yd(t){return vd.indexOf(t)>-1}var md=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function gd(t){return md.indexOf(t)>-1}var ci=1/0,li=128,Ed=128,Td=128,uo={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:te.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ci,OTEL_ATTRIBUTE_COUNT_LIMIT:li,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ci,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:li,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Ed,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Td,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:De.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function Sd(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function Od(t,e,r,n,i){if(n===void 0&&(n=-1/0),i===void 0&&(i=1/0),typeof r[t]<"u"){var a=Number(r[t]);isNaN(a)||(a<n?e[t]=n:a>i?e[t]=i:e[t]=a)}}function Ad(t,e,r,n){n===void 0&&(n=pd);var i=r[t];typeof i=="string"&&(e[t]=i.split(n).map(function(a){return a.trim()}))}var bd={ALL:te.ALL,VERBOSE:te.VERBOSE,DEBUG:te.DEBUG,INFO:te.INFO,WARN:te.WARN,ERROR:te.ERROR,NONE:te.NONE};function wd(t,e,r){var n=r[t];if(typeof n=="string"){var i=bd[n.toUpperCase()];i!=null&&(e[t]=i)}}function fi(t){var e={};for(var r in uo){var n=r;switch(n){case"OTEL_LOG_LEVEL":wd(n,e,t);break;default:if(_d(n))Sd(n,e,t);else if(yd(n))Od(n,e,t);else if(gd(n))Ad(n,e,t);else{var i=t[n];typeof i<"u"&&i!==null&&(e[n]=String(i))}}}return e}function Nd(){return typeof process<"u"&&process&&process.env?fi(process.env):fi(oo)}function re(){var t=fi(oo);return Object.assign({},uo,t)}function tr(t){for(var e=t.length,r="",n=0;n<e;n+=2){var i=t.substring(n,n+2),a=parseInt(i,16);r+=String.fromCharCode(a)}return btoa(r)}var Bt=performance,Rd="1.11.0",qe={AWS_LAMBDA_INVOKED_ARN:"aws.lambda.invoked_arn",DB_SYSTEM:"db.system",DB_CONNECTION_STRING:"db.connection_string",DB_USER:"db.user",DB_JDBC_DRIVER_CLASSNAME:"db.jdbc.driver_classname",DB_NAME:"db.name",DB_STATEMENT:"db.statement",DB_OPERATION:"db.operation",DB_MSSQL_INSTANCE_NAME:"db.mssql.instance_name",DB_CASSANDRA_KEYSPACE:"db.cassandra.keyspace",DB_CASSANDRA_PAGE_SIZE:"db.cassandra.page_size",DB_CASSANDRA_CONSISTENCY_LEVEL:"db.cassandra.consistency_level",DB_CASSANDRA_TABLE:"db.cassandra.table",DB_CASSANDRA_IDEMPOTENCE:"db.cassandra.idempotence",DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:"db.cassandra.speculative_execution_count",DB_CASSANDRA_COORDINATOR_ID:"db.cassandra.coordinator.id",DB_CASSANDRA_COORDINATOR_DC:"db.cassandra.coordinator.dc",DB_HBASE_NAMESPACE:"db.hbase.namespace",DB_REDIS_DATABASE_INDEX:"db.redis.database_index",DB_MONGODB_COLLECTION:"db.mongodb.collection",DB_SQL_TABLE:"db.sql.table",EXCEPTION_TYPE:"exception.type",EXCEPTION_MESSAGE:"exception.message",EXCEPTION_STACKTRACE:"exception.stacktrace",EXCEPTION_ESCAPED:"exception.escaped",FAAS_TRIGGER:"faas.trigger",FAAS_EXECUTION:"faas.execution",FAAS_DOCUMENT_COLLECTION:"faas.document.collection",FAAS_DOCUMENT_OPERATION:"faas.document.operation",FAAS_DOCUMENT_TIME:"faas.document.time",FAAS_DOCUMENT_NAME:"faas.document.name",FAAS_TIME:"faas.time",FAAS_CRON:"faas.cron",FAAS_COLDSTART:"faas.coldstart",FAAS_INVOKED_NAME:"faas.invoked_name",FAAS_INVOKED_PROVIDER:"faas.invoked_provider",FAAS_INVOKED_REGION:"faas.invoked_region",NET_TRANSPORT:"net.transport",NET_PEER_IP:"net.peer.ip",NET_PEER_PORT:"net.peer.port",NET_PEER_NAME:"net.peer.name",NET_HOST_IP:"net.host.ip",NET_HOST_PORT:"net.host.port",NET_HOST_NAME:"net.host.name",NET_HOST_CONNECTION_TYPE:"net.host.connection.type",NET_HOST_CONNECTION_SUBTYPE:"net.host.connection.subtype",NET_HOST_CARRIER_NAME:"net.host.carrier.name",NET_HOST_CARRIER_MCC:"net.host.carrier.mcc",NET_HOST_CARRIER_MNC:"net.host.carrier.mnc",NET_HOST_CARRIER_ICC:"net.host.carrier.icc",PEER_SERVICE:"peer.service",ENDUSER_ID:"enduser.id",ENDUSER_ROLE:"enduser.role",ENDUSER_SCOPE:"enduser.scope",THREAD_ID:"thread.id",THREAD_NAME:"thread.name",CODE_FUNCTION:"code.function",CODE_NAMESPACE:"code.namespace",CODE_FILEPATH:"code.filepath",CODE_LINENO:"code.lineno",HTTP_METHOD:"http.method",HTTP_URL:"http.url",HTTP_TARGET:"http.target",HTTP_HOST:"http.host",HTTP_SCHEME:"http.scheme",HTTP_STATUS_CODE:"http.status_code",HTTP_FLAVOR:"http.flavor",HTTP_USER_AGENT:"http.user_agent",HTTP_REQUEST_CONTENT_LENGTH:"http.request_content_length",HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:"http.request_content_length_uncompressed",HTTP_RESPONSE_CONTENT_LENGTH:"http.response_content_length",HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:"http.response_content_length_uncompressed",HTTP_SERVER_NAME:"http.server_name",HTTP_ROUTE:"http.route",HTTP_CLIENT_IP:"http.client_ip",AWS_DYNAMODB_TABLE_NAMES:"aws.dynamodb.table_names",AWS_DYNAMODB_CONSUMED_CAPACITY:"aws.dynamodb.consumed_capacity",AWS_DYNAMODB_ITEM_COLLECTION_METRICS:"aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:"aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:"aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_CONSISTENT_READ:"aws.dynamodb.consistent_read",AWS_DYNAMODB_PROJECTION:"aws.dynamodb.projection",AWS_DYNAMODB_LIMIT:"aws.dynamodb.limit",AWS_DYNAMODB_ATTRIBUTES_TO_GET:"aws.dynamodb.attributes_to_get",AWS_DYNAMODB_INDEX_NAME:"aws.dynamodb.index_name",AWS_DYNAMODB_SELECT:"aws.dynamodb.select",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:"aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:"aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_EXCLUSIVE_START_TABLE:"aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_TABLE_COUNT:"aws.dynamodb.table_count",AWS_DYNAMODB_SCAN_FORWARD:"aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT:"aws.dynamodb.segment",AWS_DYNAMODB_TOTAL_SEGMENTS:"aws.dynamodb.total_segments",AWS_DYNAMODB_COUNT:"aws.dynamodb.count",AWS_DYNAMODB_SCANNED_COUNT:"aws.dynamodb.scanned_count",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:"aws.dynamodb.attribute_definitions",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:"aws.dynamodb.global_secondary_index_updates",MESSAGING_SYSTEM:"messaging.system",MESSAGING_DESTINATION:"messaging.destination",MESSAGING_DESTINATION_KIND:"messaging.destination_kind",MESSAGING_TEMP_DESTINATION:"messaging.temp_destination",MESSAGING_PROTOCOL:"messaging.protocol",MESSAGING_PROTOCOL_VERSION:"messaging.protocol_version",MESSAGING_URL:"messaging.url",MESSAGING_MESSAGE_ID:"messaging.message_id",MESSAGING_CONVERSATION_ID:"messaging.conversation_id",MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:"messaging.message_payload_size_bytes",MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:"messaging.message_payload_compressed_size_bytes",MESSAGING_OPERATION:"messaging.operation",MESSAGING_CONSUMER_ID:"messaging.consumer_id",MESSAGING_RABBITMQ_ROUTING_KEY:"messaging.rabbitmq.routing_key",MESSAGING_KAFKA_MESSAGE_KEY:"messaging.kafka.message_key",MESSAGING_KAFKA_CONSUMER_GROUP:"messaging.kafka.consumer_group",MESSAGING_KAFKA_CLIENT_ID:"messaging.kafka.client_id",MESSAGING_KAFKA_PARTITION:"messaging.kafka.partition",MESSAGING_KAFKA_TOMBSTONE:"messaging.kafka.tombstone",RPC_SYSTEM:"rpc.system",RPC_SERVICE:"rpc.service",RPC_METHOD:"rpc.method",RPC_GRPC_STATUS_CODE:"rpc.grpc.status_code",RPC_JSONRPC_VERSION:"rpc.jsonrpc.version",RPC_JSONRPC_REQUEST_ID:"rpc.jsonrpc.request_id",RPC_JSONRPC_ERROR_CODE:"rpc.jsonrpc.error_code",RPC_JSONRPC_ERROR_MESSAGE:"rpc.jsonrpc.error_message",MESSAGE_TYPE:"message.type",MESSAGE_ID:"message.id",MESSAGE_COMPRESSED_SIZE:"message.compressed_size",MESSAGE_UNCOMPRESSED_SIZE:"message.uncompressed_size"},ce={CLOUD_PROVIDER:"cloud.provider",CLOUD_ACCOUNT_ID:"cloud.account.id",CLOUD_REGION:"cloud.region",CLOUD_AVAILABILITY_ZONE:"cloud.availability_zone",CLOUD_PLATFORM:"cloud.platform",AWS_ECS_CONTAINER_ARN:"aws.ecs.container.arn",AWS_ECS_CLUSTER_ARN:"aws.ecs.cluster.arn",AWS_ECS_LAUNCHTYPE:"aws.ecs.launchtype",AWS_ECS_TASK_ARN:"aws.ecs.task.arn",AWS_ECS_TASK_FAMILY:"aws.ecs.task.family",AWS_ECS_TASK_REVISION:"aws.ecs.task.revision",AWS_EKS_CLUSTER_ARN:"aws.eks.cluster.arn",AWS_LOG_GROUP_NAMES:"aws.log.group.names",AWS_LOG_GROUP_ARNS:"aws.log.group.arns",AWS_LOG_STREAM_NAMES:"aws.log.stream.names",AWS_LOG_STREAM_ARNS:"aws.log.stream.arns",CONTAINER_NAME:"container.name",CONTAINER_ID:"container.id",CONTAINER_RUNTIME:"container.runtime",CONTAINER_IMAGE_NAME:"container.image.name",CONTAINER_IMAGE_TAG:"container.image.tag",DEPLOYMENT_ENVIRONMENT:"deployment.environment",DEVICE_ID:"device.id",DEVICE_MODEL_IDENTIFIER:"device.model.identifier",DEVICE_MODEL_NAME:"device.model.name",FAAS_NAME:"faas.name",FAAS_ID:"faas.id",FAAS_VERSION:"faas.version",FAAS_INSTANCE:"faas.instance",FAAS_MAX_MEMORY:"faas.max_memory",HOST_ID:"host.id",HOST_NAME:"host.name",HOST_TYPE:"host.type",HOST_ARCH:"host.arch",HOST_IMAGE_NAME:"host.image.name",HOST_IMAGE_ID:"host.image.id",HOST_IMAGE_VERSION:"host.image.version",K8S_CLUSTER_NAME:"k8s.cluster.name",K8S_NODE_NAME:"k8s.node.name",K8S_NODE_UID:"k8s.node.uid",K8S_NAMESPACE_NAME:"k8s.namespace.name",K8S_POD_UID:"k8s.pod.uid",K8S_POD_NAME:"k8s.pod.name",K8S_CONTAINER_NAME:"k8s.container.name",K8S_REPLICASET_UID:"k8s.replicaset.uid",K8S_REPLICASET_NAME:"k8s.replicaset.name",K8S_DEPLOYMENT_UID:"k8s.deployment.uid",K8S_DEPLOYMENT_NAME:"k8s.deployment.name",K8S_STATEFULSET_UID:"k8s.statefulset.uid",K8S_STATEFULSET_NAME:"k8s.statefulset.name",K8S_DAEMONSET_UID:"k8s.daemonset.uid",K8S_DAEMONSET_NAME:"k8s.daemonset.name",K8S_JOB_UID:"k8s.job.uid",K8S_JOB_NAME:"k8s.job.name",K8S_CRONJOB_UID:"k8s.cronjob.uid",K8S_CRONJOB_NAME:"k8s.cronjob.name",OS_TYPE:"os.type",OS_DESCRIPTION:"os.description",OS_NAME:"os.name",OS_VERSION:"os.version",PROCESS_PID:"process.pid",PROCESS_EXECUTABLE_NAME:"process.executable.name",PROCESS_EXECUTABLE_PATH:"process.executable.path",PROCESS_COMMAND:"process.command",PROCESS_COMMAND_LINE:"process.command_line",PROCESS_COMMAND_ARGS:"process.command_args",PROCESS_OWNER:"process.owner",PROCESS_RUNTIME_NAME:"process.runtime.name",PROCESS_RUNTIME_VERSION:"process.runtime.version",PROCESS_RUNTIME_DESCRIPTION:"process.runtime.description",SERVICE_NAME:"service.name",SERVICE_NAMESPACE:"service.namespace",SERVICE_INSTANCE_ID:"service.instance.id",SERVICE_VERSION:"service.version",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version",TELEMETRY_AUTO_VERSION:"telemetry.auto.version",WEBENGINE_NAME:"webengine.name",WEBENGINE_VERSION:"webengine.version",WEBENGINE_DESCRIPTION:"webengine.description"},Id={CPP:"cpp",DOTNET:"dotnet",ERLANG:"erlang",GO:"go",JAVA:"java",NODEJS:"nodejs",PHP:"php",PYTHON:"python",RUBY:"ruby",WEBJS:"webjs"},Lt,zn=(Lt={},Lt[ce.TELEMETRY_SDK_NAME]="opentelemetry",Lt[ce.PROCESS_RUNTIME_NAME]="browser",Lt[ce.TELEMETRY_SDK_LANGUAGE]=Id.WEBJS,Lt[ce.TELEMETRY_SDK_VERSION]=Rd,Lt);var Cd=9,Pd=6,xd=Math.pow(10,Pd),ln=Math.pow(10,Cd);function ct(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*xd);return[r,n]}function qi(){var t=Bt.timeOrigin;if(typeof t!="number"){var e=Bt;t=e.timing&&e.timing.fetchStart}return t}function co(t){var e=ct(qi()),r=ct(typeof t=="number"?t:Bt.now());return lo(e,r)}function rr(t){if(Ji(t))return t;if(typeof t=="number")return t<qi()?co(t):ct(t);if(t instanceof Date)return ct(t.getTime());throw TypeError("Invalid input type")}function Ld(t,e){var r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=ln),[r,n]}function Ne(t){return t[0]*ln+t[1]}function Da(t){return Math.round(t[0]*1e6+t[1]/1e3)}function Ji(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function ka(t){return Ji(t)||typeof t=="number"||t instanceof Date}function lo(t,e){var r=[t[0]+e[0],t[1]+e[1]];return r[1]>=ln&&(r[1]-=ln,r[0]+=1),r}var Re;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Re||(Re={}));var Md=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Dd=function(){function t(e){e===void 0&&(e={});var r;this._propagators=(r=e.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,i){return n.concat(i)},[])))}return t.prototype.inject=function(e,r,n){var i,a;try{for(var s=Md(this._propagators),o=s.next();!o.done;o=s.next()){var c=o.value;try{c.inject(e,r,n)}catch(u){C.warn("Failed to inject with "+c.constructor.name+". Err: "+u.message)}}}catch(u){i={error:u}}finally{try{o&&!o.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}},t.prototype.extract=function(e,r,n){return this._propagators.reduce(function(i,a){try{return a.extract(i,r,n)}catch(s){C.warn("Failed to inject with "+a.constructor.name+". Err: "+s.message)}return i},e)},t.prototype.fields=function(){return this._fields.slice()},t}(),di="[_0-9a-z-*/]",kd="[a-z]"+di+"{0,255}",Ud="[a-z0-9]"+di+"{0,240}@[a-z]"+di+"{0,13}",Bd=new RegExp("^(?:"+kd+"|"+Ud+")$"),jd=/^[ -~]{0,255}[!-~]$/,Vd=/,|=/;function Gd(t){return Bd.test(t)}function $d(t){return jd.test(t)&&!Vd.test(t)}var Ua=32,Zd=512,Ba=",",ja="=",zd=function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+ja+e.get(n)),r},[]).join(Ba)},t.prototype._parse=function(e){e.length>Zd||(this._internalState=e.split(Ba).reverse().reduce(function(r,n){var i=n.trim(),a=i.indexOf(ja);if(a!==-1){var s=i.slice(0,a),o=i.slice(a+1,n.length);Gd(s)&&$d(o)&&r.set(s,o)}return r},new Map),this._internalState.size>Ua&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Ua))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t}(),Kn="traceparent",Fn="tracestate",Kd="00",Fd="(?!ff)[\\da-f]{2}",Yd="(?![0]{32})[\\da-f]{32}",Hd="(?![0]{16})[\\da-f]{16}",Xd="[\\da-f]{2}",Wd=new RegExp("^\\s?("+Fd+")-("+Yd+")-("+Hd+")-("+Xd+")(-.*)?\\s?$");function qd(t){var e=Wd.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var Jd=function(){function t(){}return t.prototype.inject=function(e,r,n){var i=me.getSpanContext(e);if(!(!i||Wi(e)||!br(i))){var a=Kd+"-"+i.traceId+"-"+i.spanId+"-0"+Number(i.traceFlags||xe.NONE).toString(16);n.set(r,Kn,a),i.traceState&&n.set(r,Fn,i.traceState.serialize())}},t.prototype.extract=function(e,r,n){var i=n.get(r,Kn);if(!i)return e;var a=Array.isArray(i)?i[0]:i;if(typeof a!="string")return e;var s=qd(a);if(!s)return e;s.isRemote=!0;var o=n.get(r,Fn);if(o){var c=Array.isArray(o)?o.join(","):o;s.traceState=new zd(typeof c=="string"?c:void 0)}return me.setSpanContext(e,s)},t.prototype.fields=function(){return[Kn,Fn]},t}(),Qd="[object Object]",ep="[object Null]",tp="[object Undefined]",rp=Function.prototype,fo=rp.toString,np=fo.call(Object),ip=ap(Object.getPrototypeOf,Object),po=Object.prototype,ho=po.hasOwnProperty,Tt=Symbol?Symbol.toStringTag:void 0,_o=po.toString;function ap(t,e){return function(r){return t(e(r))}}function Va(t){if(!sp(t)||op(t)!==Qd)return!1;var e=ip(t);if(e===null)return!0;var r=ho.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&fo.call(r)===np}function sp(t){return t!=null&&typeof t=="object"}function op(t){return t==null?t===void 0?tp:ep:Tt&&Tt in Object(t)?up(t):cp(t)}function up(t){var e=ho.call(t,Tt),r=t[Tt],n=!1;try{t[Tt]=void 0,n=!0}catch{}var i=_o.call(t);return n&&(e?t[Tt]=r:delete t[Tt]),i}function cp(t){return _o.call(t)}var lp=20;function fp(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=t.shift(),n=new WeakMap;t.length>0;)r=vo(r,t.shift(),0,n);return r}function Yn(t){return fn(t)?t.slice():t}function vo(t,e,r,n){r===void 0&&(r=0);var i;if(!(r>lp)){if(r++,Hr(t)||Hr(e)||yo(e))i=Yn(e);else if(fn(t)){if(i=t.slice(),fn(e))for(var a=0,s=e.length;a<s;a++)i.push(Yn(e[a]));else if(Xt(e))for(var o=Object.keys(e),a=0,s=o.length;a<s;a++){var c=o[a];i[c]=Yn(e[c])}}else if(Xt(t))if(Xt(e)){if(!dp(t,e))return e;i=Object.assign({},t);for(var o=Object.keys(e),a=0,s=o.length;a<s;a++){var c=o[a],u=e[c];if(Hr(u))typeof u>"u"?delete i[c]:i[c]=u;else{var d=i[c],_=u;if(Ga(t,c,n)||Ga(e,c,n))delete i[c];else{if(Xt(d)&&Xt(_)){var R=n.get(d)||[],k=n.get(_)||[];R.push({obj:t,key:c}),k.push({obj:e,key:c}),n.set(d,R),n.set(_,k)}i[c]=vo(i[c],u,r,n)}}}}else i=e;return i}}function Ga(t,e,r){for(var n=r.get(t[e])||[],i=0,a=n.length;i<a;i++){var s=n[i];if(s.key===e&&s.obj===t)return!0}return!1}function fn(t){return Array.isArray(t)}function yo(t){return typeof t=="function"}function Xt(t){return!Hr(t)&&!fn(t)&&!yo(t)&&typeof t=="object"}function Hr(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function dp(t,e){return!(!Va(t)||!Va(e))}function pp(t,e){return typeof e=="string"?t===e:!!t.match(e)}var hp=function(){function t(){var e=this;this._promise=new Promise(function(r,n){e._resolve=r,e._reject=n})}return Object.defineProperty(t.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),t.prototype.resolve=function(e){this._resolve(e)},t.prototype.reject=function(e){this._reject(e)},t}(),_p=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},vp=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},Qi=function(){function t(e,r){this._callback=e,this._that=r,this._isCalled=!1,this._deferred=new hp}return Object.defineProperty(t.prototype,"isCalled",{get:function(){return this._isCalled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"promise",{get:function(){return this._deferred.promise},enumerable:!1,configurable:!0}),t.prototype.call=function(){for(var e,r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(!this._isCalled){this._isCalled=!0;try{Promise.resolve((e=this._callback).call.apply(e,vp([this._that],_p(n),!1))).then(function(a){return r._deferred.resolve(a)},function(a){return r._deferred.reject(a)})}catch(a){this._deferred.reject(a)}}return this._deferred.promise},t}();function yp(t,e){return new Promise(function(r){je.with(to(je.active()),function(){t.export(e,function(n){r(n)})})})}var mp={_export:yp},gp="exception",Ep=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Tp=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},ea=function(){function t(e,r,n,i,a,s,o,c,u){o===void 0&&(o=[]),this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:un.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=s,this.kind=a,this.links=o;var d=Date.now();this._performanceStartTime=Bt.now(),this._performanceOffset=d-(this._performanceStartTime+qi()),this._startTimeProvided=c!=null,this.startTime=this._getTime(c??d),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,r),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return r==null||this._isSpanEnded()?this:e.length===0?(C.warn("Invalid attribute key: "+e),this):ao(r)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(C.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var i=Ep(Object.entries(e)),a=i.next();!a.done;a=i.next()){var s=Tp(a.value,2),o=s[0],c=s[1];this.setAttribute(o,c)}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return this},t.prototype.addEvent=function(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return C.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(C.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),ka(r)&&(ka(n)||(n=r),r=void 0);var i=Yr(r);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=e,this)},t.prototype.updateName=function(e){return this._isSpanEnded()?this:(this.name=e,this)},t.prototype.end=function(e){if(this._isSpanEnded()){C.error("You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(e),this._duration=Ld(this.startTime,this.endTime),this._duration[0]<0&&(C.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<Bt.now())return co(e+this._performanceOffset);if(typeof e=="number")return ct(e);if(e instanceof Date)return ct(e.getTime());if(Ji(e))return e;if(this._startTimeProvided)return ct(Date.now());var r=Bt.now()-this._performanceStartTime;return lo(this.startTime,ct(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[qe.EXCEPTION_MESSAGE]=e:e&&(e.code?n[qe.EXCEPTION_TYPE]=e.code.toString():e.name&&(n[qe.EXCEPTION_TYPE]=e.name),e.message&&(n[qe.EXCEPTION_MESSAGE]=e.message),e.stack&&(n[qe.EXCEPTION_STACKTRACE]=e.stack)),n[qe.EXCEPTION_TYPE]||n[qe.EXCEPTION_MESSAGE]?this.addEvent(gp,n,r):C.warn("Failed to record an exception "+e)},Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:function(){return this._ended},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:function(){return this._droppedAttributesCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:function(){return this._droppedEventsCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:function(){return this._droppedLinksCount},enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&C.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(e,r){return e.length<=r?e:e.substr(0,r)},t.prototype._truncateToSize=function(e){var r=this,n=this._attributeValueLengthLimit;return n<=0?(C.warn("Attribute value limit must be positive, got "+n),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(function(i){return typeof i=="string"?r._truncateToLimitUtil(i,n):i}):e},t}(),vt;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(vt||(vt={}));var $t=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:vt.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t}(),ft=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:vt.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t}(),nr=function(){function t(e){var r,n,i,a;this._root=e.root,this._root||(At(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ft),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new ft,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new $t,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new ft,this._localParentNotSampled=(a=e.localParentNotSampled)!==null&&a!==void 0?a:new $t}return t.prototype.shouldSample=function(e,r,n,i,a,s){var o=me.getSpanContext(e);return!o||!br(o)?this._root.shouldSample(e,r,n,i,a,s):o.isRemote?o.traceFlags&xe.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,a,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,a,s):o.traceFlags&xe.SAMPLED?this._localParentSampled.shouldSample(e,r,n,i,a,s):this._localParentNotSampled.shouldSample(e,r,n,i,a,s)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t}(),dn=function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return t.prototype.shouldSample=function(e,r){return{decision:Hi(r)&&this._accumulate(r)<this._upperBound?vt.RECORD_AND_SAMPLED:vt.NOT_RECORD}},t.prototype.toString=function(){return"TraceIdRatioBased{"+this._ratio+"}"},t.prototype._normalize=function(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n<e.length/8;n++){var i=n*8,a=parseInt(e.slice(i,i+8),16);r=(r^a)>>>0}return r},t}(),Sp=re(),Op=De.AlwaysOn,Mt=1;function mo(){return{sampler:go(Sp),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:re().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:re().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:re().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:re().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:re().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:re().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:re().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:re().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}function go(t){switch(t===void 0&&(t=re()),t.OTEL_TRACES_SAMPLER){case De.AlwaysOn:return new ft;case De.AlwaysOff:return new $t;case De.ParentBasedAlwaysOn:return new nr({root:new ft});case De.ParentBasedAlwaysOff:return new nr({root:new $t});case De.TraceIdRatio:return new dn($a(t));case De.ParentBasedTraceIdRatio:return new nr({root:new dn($a(t))});default:return C.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Op+'".'),new ft}}function $a(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return C.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+Mt+"."),Mt;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(C.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+Mt+"."),Mt):e<0||e>1?(C.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+Mt+"."),Mt):e}function Ap(t){var e={sampler:go()},r=mo(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function bp(t){var e,r,n,i,a,s,o,c,u,d,_,R,k=Object.assign({},t.spanLimits),K=Nd();return k.attributeCountLimit=(s=(a=(i=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:K.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&a!==void 0?a:K.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:li,k.attributeValueLengthLimit=(R=(_=(d=(c=(o=t.spanLimits)===null||o===void 0?void 0:o.attributeValueLengthLimit)!==null&&c!==void 0?c:(u=t.generalLimits)===null||u===void 0?void 0:u.attributeValueLengthLimit)!==null&&d!==void 0?d:K.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&_!==void 0?_:K.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&R!==void 0?R:ci,Object.assign({},t,{spanLimits:k})}var wp=function(){function t(e,r){this._exporter=e,this._finishedSpans=[],this._droppedSpansCount=0;var n=re();this._maxExportBatchSize=typeof(r==null?void 0:r.maxExportBatchSize)=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(r==null?void 0:r.maxQueueSize)=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(r==null?void 0:r.scheduledDelayMillis)=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(r==null?void 0:r.exportTimeoutMillis)=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Qi(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(C.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&xe.SAMPLED&&this._addToBuffer(e)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var e=this;return Promise.resolve().then(function(){return e.onShutdown()}).then(function(){return e._flushAll()}).then(function(){return e._exporter.shutdown()})},t.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&C.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(C.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},t.prototype._flushAll=function(){var e=this;return new Promise(function(r,n){for(var i=[],a=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize),s=0,o=a;s<o;s++)i.push(e._flushOneBatch());Promise.all(i).then(function(){r()}).catch(n)})},t.prototype._flushOneBatch=function(){var e=this;return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise(function(r,n){var i=setTimeout(function(){n(new Error("Timeout"))},e._exportTimeoutMillis);je.with(to(je.active()),function(){var a=e._finishedSpans.splice(0,e._maxExportBatchSize),s=function(){return e._exporter.export(a,function(c){var u;clearTimeout(i),c.code===Re.SUCCESS?r():n((u=c.error)!==null&&u!==void 0?u:new Error("BatchSpanProcessor: span export failed"))})},o=a.map(function(c){return c.resource}).filter(function(c){return c.asyncAttributesPending});o.length===0?s():Promise.all(o.map(function(c){var u;return(u=c.waitForAsyncAttributes)===null||u===void 0?void 0:u.call(c)})).then(s,function(c){At(c),n(c)})})})},t.prototype._maybeStartTimer=function(){var e=this;this._timer===void 0&&(this._timer=setTimeout(function(){e._flushOneBatch().then(function(){e._finishedSpans.length>0&&(e._clearTimer(),e._maybeStartTimer())}).catch(function(r){At(r)})},this._scheduledDelayMillis),this._timer,void 0)},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t}(),Np=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ta=function(t){Np(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.onInit(n),i}return e.prototype.onInit=function(r){var n=this;(r==null?void 0:r.disableAutoFlushOnDocumentHide)!==!0&&typeof document<"u"&&(this._visibilityChangeListener=function(){document.visibilityState==="hidden"&&n.forceFlush()},this._pageHideListener=function(){n.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))},e.prototype.onShutdown=function(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))},e}(wp),Rp=8,Ip=16,ra=function(){function t(){this.generateTraceId=Za(Ip),this.generateSpanId=Za(Rp)}return t}(),Mr=Array(32);function Za(t){return function(){for(var r=0;r<t*2;r++)Mr[r]=Math.floor(Math.random()*16)+48,Mr[r]>=58&&(Mr[r]+=39);return String.fromCharCode.apply(null,Mr.slice(0,t*2))}}var na=function(){function t(e,r,n){this._tracerProvider=n;var i=Ap(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new ra,this.resource=n.resource,this.instrumentationLibrary=e}return t.prototype.startSpan=function(e,r,n){var i,a,s;r===void 0&&(r={}),n===void 0&&(n=je.active()),r.root&&(n=me.deleteSpan(n));var o=me.getSpan(n);if(Wi(n)){C.debug("Instrumentation suppressed, returning Noop Span");var c=me.wrapSpanContext(zi);return c}var u=o==null?void 0:o.spanContext(),d=this._idGenerator.generateSpanId(),_,R,k;!u||!me.isSpanContextValid(u)?_=this._idGenerator.generateTraceId():(_=u.traceId,R=u.traceState,k=u.spanId);var K=(i=r.kind)!==null&&i!==void 0?i:on.INTERNAL,z=((a=r.links)!==null&&a!==void 0?a:[]).map(function(Ft){return{context:Ft.context,attributes:Yr(Ft.attributes)}}),Le=Yr(r.attributes),ge=this._sampler.shouldSample(n,_,e,K,Le,z);R=(s=ge.traceState)!==null&&s!==void 0?s:R;var Ct=ge.decision===gr.RECORD_AND_SAMPLED?xe.SAMPLED:xe.NONE,rt={traceId:_,spanId:d,traceFlags:Ct,traceState:R};if(ge.decision===gr.NOT_RECORD){C.debug("Recording is off, propagating context in a non-recording span");var c=me.wrapSpanContext(rt);return c}var W=new ea(this,n,e,rt,K,k,z,r.startTime),Nr=Yr(Object.assign(Le,ge.attributes));return W.setAttributes(Nr),W},t.prototype.startActiveSpan=function(e,r,n,i){var a,s,o;if(!(arguments.length<2)){arguments.length===2?o=r:arguments.length===3?(a=r,o=n):(a=r,s=n,o=i);var c=s??je.active(),u=this.startSpan(e,a,c),d=me.setSpan(c,u);return je.with(d,o,void 0,u)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t}();function Eo(){return"unknown_service"}var Cp=function(){function t(){}return t.prototype.detect=function(){return new Te({})},t}(),ia=new Cp,Pp=function(){function t(){}return t.prototype.detect=function(){return Promise.resolve(ia.detect())},t}(),An=new Pp,xp=An,Lp=An,Mp=ia,Dp=ia,kp=An,Up=An,at=function(){return at=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},at.apply(this,arguments)},Bp=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(d){try{u(n.next(d))}catch(_){s(_)}}function c(d){try{u(n.throw(d))}catch(_){s(_)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})},jp=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Vp=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Te=function(){function t(e,r){var n=this,i;this._attributes=e,this.asyncAttributesPending=r!=null,this._syncAttributes=(i=this._attributes)!==null&&i!==void 0?i:{},this._asyncAttributesPromise=r==null?void 0:r.then(function(a){return n._attributes=Object.assign({},n._attributes,a),n.asyncAttributesPending=!1,a},function(a){return C.debug("a resource's async attributes promise rejected: %s",a),n.asyncAttributesPending=!1,{}})}return t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t((e={},e[ce.SERVICE_NAME]=Eo(),e[ce.TELEMETRY_SDK_LANGUAGE]=zn[ce.TELEMETRY_SDK_LANGUAGE],e[ce.TELEMETRY_SDK_NAME]=zn[ce.TELEMETRY_SDK_NAME],e[ce.TELEMETRY_SDK_VERSION]=zn[ce.TELEMETRY_SDK_VERSION],e))},Object.defineProperty(t.prototype,"attributes",{get:function(){var e;return this.asyncAttributesPending&&C.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}},enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return Bp(this,void 0,void 0,function(){return jp(this,function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.merge=function(e){var r=this,n;if(!e)return this;var i=at(at({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(i);var a=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(function(s){var o,c=Vp(s,2),u=c[0],d=c[1];return at(at(at(at({},r._syncAttributes),u),(o=e._syncAttributes)!==null&&o!==void 0?o:e.attributes),d)});return new t(i,a)},t.EMPTY=new t({}),t}(),Gp=function(){function t(){}return t.prototype.detect=function(e){return Promise.resolve(So.detect(e))},t}(),$p=new Gp,Zp=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zp=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Kp=function(){function t(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}return t.prototype.detect=function(e){var r={},n=re(),i=n.OTEL_RESOURCE_ATTRIBUTES,a=n.OTEL_SERVICE_NAME;if(i)try{var s=this._parseResourceAttributes(i);Object.assign(r,s)}catch(o){C.debug("EnvDetector failed: "+o.message)}return a&&(r[ce.SERVICE_NAME]=a),new Te(r)},t.prototype._parseResourceAttributes=function(e){var r,n;if(!e)return{};var i={},a=e.split(this._COMMA_SEPARATOR,-1);try{for(var s=Zp(a),o=s.next();!o.done;o=s.next()){var c=o.value,u=c.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(u.length===2){var d=zp(u,2),_=d[0],R=d[1];if(_=_.trim(),R=R.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(_))throw new Error("Attribute key "+this._ERROR_MESSAGE_INVALID_CHARS);if(!this._isValid(R))throw new Error("Attribute value "+this._ERROR_MESSAGE_INVALID_VALUE);i[_]=decodeURIComponent(R)}}}catch(k){r={error:k}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},t.prototype._isValid=function(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)},t.prototype._isBaggageOctetString=function(e){for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<33||n===44||n===59||n===92||n>126)return!1}return!0},t.prototype._isValidAndNotEmpty=function(e){return e.length>0&&this._isValid(e)},t}(),To=new Kp,Fp=function(){function t(){}return t.prototype.detect=function(e){return Promise.resolve(To.detect(e))},t}(),Yp=new Fp,pi=function(){return pi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},pi.apply(this,arguments)},Hp=function(){function t(){}return t.prototype.detect=function(e){var r,n=typeof navigator<"u";if(!n)return Te.empty();var i=(r={},r[ce.PROCESS_RUNTIME_NAME]="browser",r[ce.PROCESS_RUNTIME_DESCRIPTION]="Web Browser",r[ce.PROCESS_RUNTIME_VERSION]=navigator.userAgent,r);return this._getResourceAttributes(i,e)},t.prototype._getResourceAttributes=function(e,r){return e[ce.PROCESS_RUNTIME_VERSION]===""?(C.debug("BrowserDetector failed: Unable to find required browser resources. "),Te.empty()):new Te(pi({},e))},t}(),So=new Hp,Xp=function(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"},hi=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(d){try{u(n.next(d))}catch(_){s(_)}}function c(d){try{u(n.throw(d))}catch(_){s(_)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})},_i=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Wp=function(t){return t===void 0&&(t={}),hi(void 0,void 0,void 0,function(){var e;return _i(this,function(r){switch(r.label){case 0:return[4,Promise.all((t.detectors||[]).map(function(n){return hi(void 0,void 0,void 0,function(){var i,a;return _i(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.detect(t)];case 1:return i=s.sent(),C.debug(n.constructor.name+" found resource.",i),[2,i];case 2:return a=s.sent(),C.debug(n.constructor.name+" failed: "+a.message),[2,Te.empty()];case 3:return[2]}})})}))];case 1:return e=r.sent(),Oo(e),[2,e.reduce(function(n,i){return n.merge(i)},Te.empty())]}})})},qp=function(t){var e;t===void 0&&(t={});var r=((e=t.detectors)!==null&&e!==void 0?e:[]).map(function(i){try{var a=i.detect(t),s;if(Xp(a)){var o=function(){return hi(void 0,void 0,void 0,function(){var c;return _i(this,function(u){switch(u.label){case 0:return[4,a];case 1:return c=u.sent(),[2,c.attributes]}})})};s=new Te({},o())}else s=a;return s.waitForAsyncAttributes?s.waitForAsyncAttributes().then(function(){return C.debug(i.constructor.name+" found resource.",s)}):C.debug(i.constructor.name+" found resource.",s),s}catch(c){return C.error(i.constructor.name+" failed: "+c.message),Te.empty()}}),n=r.reduce(function(i,a){return i.merge(a)},Te.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(function(){Oo(r)}),n},Oo=function(t){t.forEach(function(e){if(Object.keys(e.attributes).length>0){var r=JSON.stringify(e.attributes,null,4);C.verbose(r)}})};const Jp=Object.freeze(Object.defineProperty({__proto__:null,Resource:Te,browserDetector:$p,browserDetectorSync:So,defaultServiceName:Eo,detectResources:Wp,detectResourcesSync:qp,envDetector:Yp,envDetectorSync:To,hostDetector:xp,hostDetectorSync:Mp,osDetector:Lp,osDetectorSync:Dp,processDetector:kp,processDetectorSync:Up},Symbol.toStringTag,{value:"Module"}));var Dr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Qp=function(){function t(e){this._spanProcessors=e}return t.prototype.forceFlush=function(){var e,r,n=[];try{for(var i=Dr(this._spanProcessors),a=i.next();!a.done;a=i.next()){var s=a.value;n.push(s.forceFlush())}}catch(o){e={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return new Promise(function(o){Promise.all(n).then(function(){o()}).catch(function(c){At(c||new Error("MultiSpanProcessor: forceFlush failed")),o()})})},t.prototype.onStart=function(e,r){var n,i;try{for(var a=Dr(this._spanProcessors),s=a.next();!s.done;s=a.next()){var o=s.value;o.onStart(e,r)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(e){var r,n;try{for(var i=Dr(this._spanProcessors),a=i.next();!a.done;a=i.next()){var s=a.value;s.onEnd(e)}}catch(o){r={error:o}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},t.prototype.shutdown=function(){var e,r,n=[];try{for(var i=Dr(this._spanProcessors),a=i.next();!a.done;a=i.next()){var s=a.value;n.push(s.shutdown())}}catch(o){e={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return new Promise(function(o,c){Promise.all(n).then(function(){o()},c)})},t}(),aa=function(){function t(){}return t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t}(),Je;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(Je||(Je={}));var sa=function(){function t(e){e===void 0&&(e={});var r;this._registeredSpanProcessors=[],this._tracers=new Map;var n=fp({},mo(),bp(e));this.resource=(r=n.resource)!==null&&r!==void 0?r:Te.empty(),this.resource=Te.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});var i=this._buildExporterFromEnv();if(i!==void 0){var a=new ta(i);this.activeSpanProcessor=a}else this.activeSpanProcessor=new aa}return t.prototype.getTracer=function(e,r,n){var i=e+"@"+(r||"")+":"+((n==null?void 0:n.schemaUrl)||"");return this._tracers.has(i)||this._tracers.set(i,new na({name:e,version:r,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this)),this._tracers.get(i)},t.prototype.addSpanProcessor=function(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(function(r){return C.error("Error while trying to shutdown current span processor",r)}),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new Qp(this._registeredSpanProcessors)},t.prototype.getActiveSpanProcessor=function(){return this.activeSpanProcessor},t.prototype.register=function(e){e===void 0&&(e={}),me.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&je.setGlobalContextManager(e.contextManager),e.propagator&&Ut.setGlobalPropagator(e.propagator)},t.prototype.forceFlush=function(){var e=this._config.forceFlushTimeoutMillis,r=this._registeredSpanProcessors.map(function(n){return new Promise(function(i){var a,s=setTimeout(function(){i(new Error("Span processor did not completed within timeout period of "+e+" ms")),a=Je.timeout},e);n.forceFlush().then(function(){clearTimeout(s),a!==Je.timeout&&(a=Je.resolved,i(a))}).catch(function(o){clearTimeout(s),a=Je.error,i(o)})})});return new Promise(function(n,i){Promise.all(r).then(function(a){var s=a.filter(function(o){return o!==Je.resolved});s.length>0?i(s):n()}).catch(function(a){return i([a])})})},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()},t.prototype._getSpanExporter=function(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()},t.prototype._buildPropagatorFromEnv=function(){var e=this,r=Array.from(new Set(re().OTEL_PROPAGATORS)),n=r.map(function(a){var s=e._getPropagator(a);return s||C.warn('Propagator "'+a+'" requested through environment variable is unavailable.'),s}),i=n.reduce(function(a,s){return s&&a.push(s),a},[]);if(i.length!==0)return r.length===1?i[0]:new Dd({propagators:i})},t.prototype._buildExporterFromEnv=function(){var e=re().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||C.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Jd}],["baggage",function(){return new ad}]]),t._registeredExporters=new Map,t}(),eh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ao=function(){function t(){}return t.prototype.export=function(e,r){return this._sendSpans(e,r)},t.prototype.shutdown=function(){return this._sendSpans([]),Promise.resolve()},t.prototype._exportInfo=function(e){var r;return{traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:Da(e.startTime),duration:Da(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}},t.prototype._sendSpans=function(e,r){var n,i;try{for(var a=eh(e),s=a.next();!s.done;s=a.next()){var o=s.value;console.dir(this._exportInfo(o),{depth:3})}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}if(r)return r({code:Re.SUCCESS})},t}(),th=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},rh=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},bo=function(){function t(){this._finishedSpans=[],this._stopped=!1}return t.prototype.export=function(e,r){var n;if(this._stopped)return r({code:Re.FAILED,error:new Error("Exporter has been stopped")});(n=this._finishedSpans).push.apply(n,rh([],th(e),!1)),setTimeout(function(){return r({code:Re.SUCCESS})},0)},t.prototype.shutdown=function(){return this._stopped=!0,this._finishedSpans=[],Promise.resolve()},t.prototype.reset=function(){this._finishedSpans=[]},t.prototype.getFinishedSpans=function(){return this._finishedSpans},t}(),nh=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(d){try{u(n.next(d))}catch(_){s(_)}}function c(d){try{u(n.throw(d))}catch(_){s(_)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})},ih=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},wo=function(){function t(e){this._exporter=e,this._shutdownOnce=new Qi(this._shutdown,this),this._unresolvedExports=new Set}return t.prototype.forceFlush=function(){return nh(this,void 0,void 0,function(){return ih(this,function(e){switch(e.label){case 0:return[4,Promise.all(Array.from(this._unresolvedExports))];case 1:return e.sent(),[2]}})})},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){var r=this,n,i;if(!this._shutdownOnce.isCalled&&e.spanContext().traceFlags&xe.SAMPLED){var a=function(){return mp._export(r._exporter,[e]).then(function(o){var c;o.code!==Re.SUCCESS&&At((c=o.error)!==null&&c!==void 0?c:new Error("SimpleSpanProcessor: span export failed (status "+o+")"))}).catch(function(o){At(o)})};if(e.resource.asyncAttributesPending){var s=(i=(n=e.resource).waitForAsyncAttributes)===null||i===void 0?void 0:i.call(n).then(function(){return s!=null&&r._unresolvedExports.delete(s),a()},function(o){return At(o)});s!=null&&this._unresolvedExports.add(s)}else a()}},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){return this._exporter.shutdown()},t}();const ah=Object.freeze(Object.defineProperty({__proto__:null,AlwaysOffSampler:$t,AlwaysOnSampler:ft,BasicTracerProvider:sa,BatchSpanProcessor:ta,ConsoleSpanExporter:Ao,get ForceFlushState(){return Je},InMemorySpanExporter:bo,NoopSpanProcessor:aa,ParentBasedSampler:nr,RandomIdGenerator:ra,get SamplingDecision(){return vt},SimpleSpanProcessor:wo,Span:ea,TraceIdRatioBasedSampler:dn,Tracer:na},Symbol.toStringTag,{value:"Module"})),sh=zt(ah);var oh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},uh=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},No=function(){function t(){this._enabled=!1,this._currentContext=Et}return t.prototype._bindFunction=function(e,r){e===void 0&&(e=Et);var n=this,i=function(){for(var a=this,s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];return n.with(e,function(){return r.apply(a,s)})};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i},t.prototype.active=function(){return this._currentContext},t.prototype.bind=function(e,r){return e===void 0&&(e=this.active()),typeof r=="function"?this._bindFunction(e,r):r},t.prototype.disable=function(){return this._currentContext=Et,this._enabled=!1,this},t.prototype.enable=function(){return this._enabled?this:(this._enabled=!0,this._currentContext=Et,this)},t.prototype.with=function(e,r,n){for(var i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];var s=this._currentContext;this._currentContext=e||Et;try{return r.call.apply(r,uh([n],oh(i),!1))}finally{this._currentContext=s}},t}(),ch=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),lh=function(t){ch(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,r)||this;if(r.contextManager)throw"contextManager should be defined in register method not in constructor";if(r.propagator)throw"propagator should be defined in register method not in constructor";return n}return e.prototype.register=function(r){r===void 0&&(r={}),r.contextManager===void 0&&(r.contextManager=new No),r.contextManager&&r.contextManager.enable(),t.prototype.register.call(this,r)},e}(sa),Q;(function(t){t.CONNECT_END="connectEnd",t.CONNECT_START="connectStart",t.DECODED_BODY_SIZE="decodedBodySize",t.DOM_COMPLETE="domComplete",t.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",t.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",t.DOM_INTERACTIVE="domInteractive",t.DOMAIN_LOOKUP_END="domainLookupEnd",t.DOMAIN_LOOKUP_START="domainLookupStart",t.ENCODED_BODY_SIZE="encodedBodySize",t.FETCH_START="fetchStart",t.LOAD_EVENT_END="loadEventEnd",t.LOAD_EVENT_START="loadEventStart",t.NAVIGATION_START="navigationStart",t.REDIRECT_END="redirectEnd",t.REDIRECT_START="redirectStart",t.REQUEST_START="requestStart",t.RESPONSE_END="responseEnd",t.RESPONSE_START="responseStart",t.SECURE_CONNECTION_START="secureConnectionStart",t.UNLOAD_EVENT_END="unloadEventEnd",t.UNLOAD_EVENT_START="unloadEventStart"})(Q||(Q={}));var Hn;function fh(){return Hn||(Hn=document.createElement("a")),Hn}function Ro(t,e){return e in t}function Me(t,e,r){if(Ro(r,e)&&typeof r[e]=="number")return t.addEvent(e,r[e]),t}function dh(t,e){Me(t,Q.FETCH_START,e),Me(t,Q.DOMAIN_LOOKUP_START,e),Me(t,Q.DOMAIN_LOOKUP_END,e),Me(t,Q.CONNECT_START,e),Me(t,Q.SECURE_CONNECTION_START,e),Me(t,Q.CONNECT_END,e),Me(t,Q.REQUEST_START,e),Me(t,Q.RESPONSE_START,e),Me(t,Q.RESPONSE_END,e);var r=e[Q.ENCODED_BODY_SIZE];r!==void 0&&t.setAttribute(qe.HTTP_RESPONSE_CONTENT_LENGTH,r);var n=e[Q.DECODED_BODY_SIZE];n!==void 0&&r!==n&&t.setAttribute(qe.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,n)}function Io(t){return t.slice().sort(function(e,r){var n=e[Q.FETCH_START],i=r[Q.FETCH_START];return n>i?1:n<i?-1:0})}function ph(t,e,r,n,i,a){i===void 0&&(i=new WeakSet);var s=bn(t);t=s.toString();var o=_h(t,e,r,n,i,a);if(o.length===0)return{mainRequest:void 0};if(o.length===1)return{mainRequest:o[0]};var c=Io(o);if(s.origin!==location.origin&&c.length>1){var u=c[0],d=hh(c,u[Q.RESPONSE_END],r),_=u[Q.RESPONSE_END],R=d[Q.FETCH_START];return R<_&&(d=u,u=void 0),{corsPreFlightRequest:u,mainRequest:d}}else return{mainRequest:o[0]}}function hh(t,e,r){for(var n=Ne(r),i=Ne(rr(e)),a=t[1],s,o=t.length,c=1;c<o;c++){var u=t[c],d=Ne(rr(u[Q.FETCH_START])),_=Ne(rr(u[Q.RESPONSE_END])),R=n-_;d>=i&&(!s||R<s)&&(s=R,a=u)}return a}function _h(t,e,r,n,i,a){var s=Ne(e),o=Ne(r),c=n.filter(function(u){var d=Ne(rr(u[Q.FETCH_START])),_=Ne(rr(u[Q.RESPONSE_END]));return u.initiatorType.toLowerCase()===(a||"xmlhttprequest")&&u.name===t&&d>=s&&_<=o});return c.length>0&&(c=c.filter(function(u){return!i.has(u)})),c}function bn(t){if(typeof URL=="function")return new URL(t,typeof document<"u"?document.baseURI:location.href);var e=fh();return e.href=t,e}function vh(t){var e=bn(t);return e.href}function Co(t,e){if(t.nodeType===Node.DOCUMENT_NODE)return"/";var r=mh(t,e);if(e&&r.indexOf("@id")>0)return r;var n="";return t.parentNode&&(n+=Co(t.parentNode,!1)),n+=r,n}function yh(t){if(!t.parentNode)return 0;var e=[t.nodeType];t.nodeType===Node.CDATA_SECTION_NODE&&e.push(Node.TEXT_NODE);var r=Array.from(t.parentNode.childNodes);return r=r.filter(function(n){var i=n.localName;return e.indexOf(n.nodeType)>=0&&i===t.localName}),r.length>=1?r.indexOf(t)+1:0}function mh(t,e){var r=t.nodeType,n=yh(t),i="";if(r===Node.ELEMENT_NODE){var a=t.getAttribute("id");if(e&&a)return'//*[@id="'+a+'"]';i=t.localName}else if(r===Node.TEXT_NODE||r===Node.CDATA_SECTION_NODE)i="text()";else if(r===Node.COMMENT_NODE)i="comment()";else return"";return i&&n>1?"/"+i+"["+n+"]":"/"+i}function gh(t,e){var r=e||[];(typeof r=="string"||r instanceof RegExp)&&(r=[r]);var n=bn(t);return n.origin===location.origin?!0:r.some(function(i){return pp(t,i)})}const Eh=Object.freeze(Object.defineProperty({__proto__:null,AlwaysOffSampler:$t,AlwaysOnSampler:ft,BasicTracerProvider:sa,BatchSpanProcessor:ta,ConsoleSpanExporter:Ao,get ForceFlushState(){return Je},InMemorySpanExporter:bo,NoopSpanProcessor:aa,ParentBasedSampler:nr,get PerformanceTimingNames(){return Q},RandomIdGenerator:ra,get SamplingDecision(){return vt},SimpleSpanProcessor:wo,Span:ea,StackContextManager:No,TraceIdRatioBasedSampler:dn,Tracer:na,WebTracerProvider:lh,addSpanNetworkEvent:Me,addSpanNetworkEvents:dh,getElementXPath:Co,getResource:ph,hasKey:Ro,normalizeUrl:vh,parseUrl:bn,shouldPropagateTraceHeaders:gh,sortResources:Io},Symbol.toStringTag,{value:"Module"})),Th=zt(Eh);var Sh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Po=1e4,Oh=5,Ah=1e3,bh=5e3,wh=1.5;function Nh(t){t===void 0&&(t={});var e={};return Object.entries(t).forEach(function(r){var n=Sh(r,2),i=n[0],a=n[1];typeof a<"u"?e[i]=String(a):C.warn('Header "'+i+'" has wrong value and will be ignored')}),e}function Rh(t,e){return t.endsWith("/")||(t=t+"/"),t+e}function Ih(t){try{var e=new URL(t);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return C.warn("Could not parse export URL: '"+t+"'"),t}}function Ch(t){return typeof t=="number"?t<=0?xo(t,Po):t:Ph()}function Ph(){var t,e=Number((t=re().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&t!==void 0?t:re().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?xo(e,Po):e}function xo(t,e){return C.warn("Timeout must be greater than 0",t),e}function xh(t){var e=[429,502,503,504];return e.includes(t)}function Lh(t){if(t==null)return-1;var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;var r=new Date(t).getTime()-Date.now();return r>=0?r:0}var Mh=function(){function t(e){e===void 0&&(e={}),this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new Qi(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:1/0,this.timeoutMillis=Ch(e.timeoutMillis),this.onInit(e)}return t.prototype.export=function(e,r){if(this._shutdownOnce.isCalled){r({code:Re.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){r({code:Re.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(function(){r({code:Re.SUCCESS})}).catch(function(n){r({code:Re.FAILED,error:n})})},t.prototype._export=function(e){var r=this;return new Promise(function(n,i){try{C.debug("items to be sent",e),r.send(e,n,i)}catch(a){i(a)}})},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){return C.debug("shutdown started"),this.onShutdown(),Promise.all(this._sendingPromises).then(function(){})},t}(),Dh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jt=function(t){Dh(e,t);function e(r,n,i){var a=t.call(this,r)||this;return a.name="OTLPExporterError",a.data=i,a.code=n,a}return e}(Error),pn=function(){return pn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},pn.apply(this,arguments)},kh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function Uh(t,e,r,n,i){if(navigator.sendBeacon(e,new Blob([t],r)))C.debug("sendBeacon - can send",t),n();else{var a=new Jt("sendBeacon - cannot send "+t);i(a)}}function Bh(t,e,r,n,i,a){var s,o,c=!1,u=setTimeout(function(){if(clearTimeout(s),c=!0,o.readyState===XMLHttpRequest.DONE){var _=new Jt("Request Timeout");a(_)}else o.abort()},n),d=function(_,R){_===void 0&&(_=Oh),R===void 0&&(R=Ah),o=new XMLHttpRequest,o.open("POST",e);var k={Accept:"application/json","Content-Type":"application/json"};Object.entries(pn(pn({},k),r)).forEach(function(K){var z=kh(K,2),Le=z[0],ge=z[1];o.setRequestHeader(Le,ge)}),o.send(t),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE&&c===!1)if(o.status>=200&&o.status<=299)C.debug("xhr success",t),i(),clearTimeout(u),clearTimeout(s);else if(o.status&&xh(o.status)&&_>0){var K=void 0;R=wh*R,o.getResponseHeader("Retry-After")?K=Lh(o.getResponseHeader("Retry-After")):K=Math.round(Math.random()*(bh-R)+R),s=setTimeout(function(){d(_-1,R)},K)}else{var z=new Jt("Failed to export with XHR (status: "+o.status+")",o.status);a(z),clearTimeout(u),clearTimeout(s)}},o.onabort=function(){if(c){var K=new Jt("Request Timeout");a(K)}clearTimeout(u),clearTimeout(s)},o.onerror=function(){if(c){var K=new Jt("Request Timeout");a(K)}clearTimeout(u),clearTimeout(s)}};d()}var jh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vh=function(t){jh(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,r)||this;return n._useXHR=!1,n._useXHR=!!r.headers||typeof navigator.sendBeacon!="function",n._useXHR?n._headers=Object.assign({},Nh(r.headers),no(re().OTEL_EXPORTER_OTLP_HEADERS)):n._headers={},n}return e.prototype.onInit=function(){window.addEventListener("unload",this.shutdown)},e.prototype.onShutdown=function(){window.removeEventListener("unload",this.shutdown)},e.prototype.send=function(r,n,i){var a=this;if(this._shutdownOnce.isCalled){C.debug("Shutdown already started. Cannot send objects");return}var s=this.convert(r),o=JSON.stringify(s),c=new Promise(function(d,_){a._useXHR?Bh(o,a.url,a._headers,a.timeoutMillis,d,_):Uh(o,a.url,{type:"application/json"},d,_)}).then(n,i);this._sendingPromises.push(c);var u=function(){var d=a._sendingPromises.indexOf(c);a._sendingPromises.splice(d,1)};c.then(u,u)},e}(Mh),Gh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function wn(t){return Object.keys(t).map(function(e){return Lo(e,t[e])})}function Lo(t,e){return{key:t,value:Mo(e)}}function Mo(t){var e=typeof t;return e==="string"?{stringValue:t}:e==="number"?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:e==="boolean"?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(Mo)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(function(r){var n=Gh(r,2),i=n[0],a=n[1];return Lo(i,a)})}}:{}}function $h(t,e){var r,n=t.spanContext(),i=t.status,a=e?t.parentSpanId:t.parentSpanId!=null?tr(t.parentSpanId):void 0;return{traceId:e?n.traceId:tr(n.traceId),spanId:e?n.spanId:tr(n.spanId),parentSpanId:a,traceState:(r=n.traceState)===null||r===void 0?void 0:r.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:Ne(t.startTime),endTimeUnixNano:Ne(t.endTime),attributes:wn(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(zh),droppedEventsCount:t.droppedEventsCount,status:{code:i.code,message:i.message},links:t.links.map(function(s){return Zh(s,e)}),droppedLinksCount:t.droppedLinksCount}}function Zh(t,e){var r;return{attributes:t.attributes?wn(t.attributes):[],spanId:e?t.context.spanId:tr(t.context.spanId),traceId:e?t.context.traceId:tr(t.context.traceId),traceState:(r=t.context.traceState)===null||r===void 0?void 0:r.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}function zh(t){return{attributes:t.attributes?wn(t.attributes):[],name:t.name,timeUnixNano:Ne(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}var Kh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fh=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function Yh(t,e){return{resourceSpans:Xh(t,e)}}function Hh(t){var e,r,n=new Map;try{for(var i=Kh(t),a=i.next();!a.done;a=i.next()){var s=a.value,o=n.get(s.resource);o||(o=new Map,n.set(s.resource,o));var c=s.instrumentationLibrary.name+"@"+(s.instrumentationLibrary.version||"")+":"+(s.instrumentationLibrary.schemaUrl||""),u=o.get(c);u||(u=[],o.set(c,u)),u.push(s)}}catch(d){e={error:d}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}function Xh(t,e){for(var r=Hh(t),n=[],i=r.entries(),a=i.next();!a.done;){for(var s=Fh(a.value,2),o=s[0],c=s[1],u=[],d=c.values(),_=d.next();!_.done;){var R=_.value;if(R.length>0){var k=R[0].instrumentationLibrary,K=k.name,z=k.version,Le=k.schemaUrl,ge=R.map(function(rt){return $h(rt,e)});u.push({scope:{name:K,version:z},spans:ge,schemaUrl:Le})}_=d.next()}var Ct={resource:{attributes:wn(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(Ct),a=i.next()}return n}var Wh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Do="v1/traces",qh="http://localhost:4318/"+Do,Jh=function(t){Wh(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,r)||this;return n._headers=Object.assign(n._headers,no(re().OTEL_EXPORTER_OTLP_TRACES_HEADERS)),n}return e.prototype.convert=function(r){return Yh(r,!0)},e.prototype.getDefaultUrl=function(r){return typeof r.url=="string"?r.url:re().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length>0?Ih(re().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT):re().OTEL_EXPORTER_OTLP_ENDPOINT.length>0?Rh(re().OTEL_EXPORTER_OTLP_ENDPOINT,Do):qh},e}(Vh);const Qh=Object.freeze(Object.defineProperty({__proto__:null,OTLPTraceExporter:Jh},Symbol.toStringTag,{value:"Module"})),e_=zt(Qh);function ko(t){t===void 0&&(t=[]);for(var e=[],r=0,n=t.length;r<n;r++){var i=t[r];if(Array.isArray(i)){var a=ko(i);e=e.concat(a.instrumentations)}else typeof i=="function"?e.push(new i):i.instrumentationName&&e.push(i)}return{instrumentations:e}}function t_(t,e,r){for(var n=0,i=t.length;n<i;n++){var a=t[n];e&&a.setTracerProvider(e),r&&a.setMeterProvider(r),a.getConfig().enabled||a.enable()}}function r_(t){t.forEach(function(e){return e.disable()})}function n_(t){var e=ko(t.instrumentations).instrumentations,r=t.tracerProvider||me.getTracerProvider(),n=t.meterProvider||On.getMeterProvider();return t_(e,r,n),function(){r_(e)}}function vi(t){return typeof t=="function"}var _e=console.error.bind(console);function Wt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}function wr(t){t&&t.logger&&(vi(t.logger)?_e=t.logger:_e("new logger isn't a function, not replacing"))}function Uo(t,e,r){if(!t||!t[e]){_e("no original function "+e+" to wrap");return}if(!r){_e("no wrapper function"),_e(new Error().stack);return}if(!vi(t[e])||!vi(r)){_e("original object and wrapper must be functions");return}var n=t[e],i=r(n,e);return Wt(i,"__original",n),Wt(i,"__unwrap",function(){t[e]===i&&Wt(t,e,n)}),Wt(i,"__wrapped",!0),Wt(t,e,i),i}function i_(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{_e("must provide one or more modules to patch"),_e(new Error().stack);return}if(!(e&&Array.isArray(e))){_e("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(i){Uo(n,i,r)})})}function Bo(t,e){if(!t||!t[e]){_e("no function to unwrap."),_e(new Error().stack);return}if(!t[e].__unwrap)_e("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}function a_(t,e){if(t)Array.isArray(t)||(t=[t]);else{_e("must provide one or more modules to patch"),_e(new Error().stack);return}if(!(e&&Array.isArray(e))){_e("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Bo(r,n)})})}wr.wrap=Uo;wr.massWrap=i_;wr.unwrap=Bo;wr.massUnwrap=a_;var kr=wr,yi=function(){return yi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yi.apply(this,arguments)},s_=function(){function t(e,r,n){n===void 0&&(n={}),this.instrumentationName=e,this.instrumentationVersion=r,this._wrap=kr.wrap,this._unwrap=kr.unwrap,this._massWrap=kr.massWrap,this._massUnwrap=kr.massUnwrap,this._config=yi({enabled:!0},n),this._diag=C.createComponentLogger({namespace:e}),this._tracer=me.getTracer(e,r),this._meter=On.getMeter(e,r),this._updateMetricInstruments()}return Object.defineProperty(t.prototype,"meter",{get:function(){return this._meter},enumerable:!1,configurable:!0}),t.prototype.setMeterProvider=function(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()},t.prototype._updateMetricInstruments=function(){},t.prototype.getConfig=function(){return this._config},t.prototype.setConfig=function(e){e===void 0&&(e={}),this._config=Object.assign({},e)},t.prototype.setTracerProvider=function(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)},Object.defineProperty(t.prototype,"tracer",{get:function(){return this._tracer},enumerable:!1,configurable:!0}),t}(),o_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),u_=function(t){o_(e,t);function e(r,n,i){i===void 0&&(i={});var a=t.call(this,r,n,i)||this;return a._config.enabled&&a.enable(),a}return e}(s_),c_=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(d){try{u(n.next(d))}catch(_){s(_)}}function c(d){try{u(n.throw(d))}catch(_){s(_)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})},l_=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};function f_(t,e,r){var n,i;try{i=t()}catch(a){n=a}finally{if(e(n,i),n&&!r)throw n;return i}}function d_(t,e,r){return c_(this,void 0,void 0,function(){var n,i,a;return l_(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,3,4]),[4,t()];case 1:return i=s.sent(),[3,4];case 2:return a=s.sent(),n=a,[3,4];case 3:if(e(n,i),n&&!r)throw n;return[2,i];case 4:return[2]}})})}function p_(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}const h_=Object.freeze(Object.defineProperty({__proto__:null,InstrumentationBase:u_,isWrapped:p_,registerInstrumentations:n_,safeExecuteInTheMiddle:f_,safeExecuteInTheMiddleAsync:d_},Symbol.toStringTag,{value:"Module"})),__=zt(h_);var jo={},dt={};const v_=zt(Jp);Object.defineProperty(dt,"__esModule",{value:!0});dt.parseDsn=dt.Dsn=dt.createResource=void 0;var za=v_;function y_(t,e,r,n,i){if(t)return t;var a={};return e&&Object.assign(a,e),r&&(a["service.name"]=r),n&&(a["service.version"]=n),i&&(a["deployment.environment"]=i),t=za.Resource.default(),Object.keys(a).length?t.merge(new za.Resource(a)):t}dt.createResource=y_;var Vo=function(){function t(e){if(this.str="",this.scheme="",this.host="",this.projectId="",this.token="",!e)throw new Error("either dsn option or UPTRACE_DSN is required");var r;try{r=new URL(e)}catch{throw new Error("can't parse DSN=".concat(JSON.stringify(e)))}this.str=e,this.scheme=r.protocol,this.host=r.host,this.host==="api.uptrace.dev"&&(this.host="uptrace.dev"),this.host==="uptrace.dev"&&(this.projectId=r.pathname.slice(1),this.token=r.username)}return t.prototype.toString=function(){return this.str},t.prototype.appAddr=function(){return this.host==="uptrace.dev"?"https://app.uptrace.dev":"".concat(this.scheme,"//").concat(this.host)},t.prototype.otlpAddr=function(){return this.host==="uptrace.dev"?"https://otlp.uptrace.dev":"".concat(this.scheme,"//").concat(this.host)},t}();dt.Dsn=Vo;function m_(t){return new Vo(t)}dt.parseDsn=m_;var Zt={};const g_=zt(qf);Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createClient=Zt.Client=void 0;var Xn=g_,E_="__dummy__",Go=function(){function t(e){this._dsn=e}return t.prototype.traceUrl=function(e){var r,n=e.spanContext(),i=(r=n==null?void 0:n.traceId)!==null&&r!==void 0?r:"<no span>";return"".concat(this._dsn.appAddr(),"/traces/").concat(i)},t.prototype.reportException=function(e,r){r===void 0&&(r={});var n=!1,i=this._internalTracer(),a=Xn.trace.getSpan(Xn.context.active());a||(a=i.startSpan(E_),n=!0),typeof e=="string"?r["exception.message"]=e:(r["exception.type"]=e.name,r["exception.message"]=e.message,r["exception.stacktrace"]=e.stack),a.addEvent("exception",r),n&&a.end()},t.prototype._internalTracer=function(){return this._tracer||(this._tracer=Xn.trace.getTracer("uptrace-js")),this._tracer},t}();Zt.Client=Go;function T_(t){return new Go(t)}Zt.createClient=T_;var $o={};Object.defineProperty($o,"__esModule",{value:!0});var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.VERSION=void 0;Nn.VERSION="1.11.1";(function(t){var e=ut&&ut.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=ut&&ut.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(dt,t),r(Zt,t),r($o,t),r(Nn,t)})(jo);Object.defineProperty(Ue,"__esModule",{value:!0});Ue.WindowAttributesProcessor=Ue.configureOpentelemetry=Ue.traceUrl=Ue.reportException=void 0;var S_=sh,O_=Th,A_=e_,b_=__,Er=jo,mi=typeof window<"u",oa=(0,Er.createClient)((0,Er.parseDsn)("https://<key>@uptrace.dev/<project_id>"));function gi(t,e){e===void 0&&(e={}),oa.reportException(t,e)}Ue.reportException=gi;function w_(t){return oa.traceUrl(t)}Ue.traceUrl=w_;function N_(t){R_(t),I_(t),mi&&C_()}Ue.configureOpentelemetry=N_;function R_(t){var e,r,n;t.resource=(0,Er.createResource)(t.resource,t.resourceAttributes,(e=t.serviceName)!==null&&e!==void 0?e:"",(r=t.serviceVersion)!==null&&r!==void 0?r:"",(n=t.deploymentEnvironment)!==null&&n!==void 0?n:"")}function I_(t){!t.dsn&&mi&&window.UPTRACE_DSN&&(t.dsn=window.UPTRACE_DSN);var e;try{e=(0,Er.parseDsn)(t.dsn)}catch(a){console.error("Uptrace is disabled:",String(a));return}oa=(0,Er.createClient)(e);var r=new A_.OTLPTraceExporter({url:"".concat(e.otlpAddr(),"/v1/traces"),headers:{"uptrace-dsn":t.dsn}}),n=new S_.BatchSpanProcessor(r,{maxExportBatchSize:1e3,maxQueueSize:1e3,scheduledDelayMillis:5*1e3}),i=new O_.WebTracerProvider({sampler:t.sampler,spanLimits:t.spanLimits,resource:t.resource,idGenerator:t.idGenerator,forceFlushTimeoutMillis:t.forceFlushTimeoutMillis});mi&&i.addSpanProcessor(new Zo),i.addSpanProcessor(n),i.register({contextManager:t.contextManager,propagator:t.textMapPropagator}),(0,b_.registerInstrumentations)({instrumentations:t.instrumentations})}function C_(){var t=window.onerror;window.onerror=function(r,n,i,a,s){if(t&&t(r,n,i,a,s),s){gi(s,{onerror:!0});return}if(r!=="Script error."){var o={"window.onerror":!0};n&&(o["code.filepath"]=n),i&&(o["code.lineno"]=i),a&&(o["code.colno"]=a),gi(String(r),o)}}}var Zo=function(){function t(){}return t.prototype.forceFlush=function(){return Promise.resolve()},t.prototype.onStart=function(e){window.navigator&&window.navigator.userAgent&&e.setAttribute("http.user_agent",window.navigator.userAgent),window.location&&window.location.href&&e.setAttribute("location.href",location.href)},t.prototype.onEnd=function(){},t.prototype.shutdown=function(){return Promise.resolve()},t}();Ue.WindowAttributesProcessor=Zo;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.VERSION=void 0;Rn.VERSION="1.11.1";(function(t){var e=ut&&ut.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=ut&&ut.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ue,t),r(Rn,t)})(zs);const P_=Ll(zs),x_=t=>{sl.RUNTIME==="browser"?P_.configureOpentelemetry(t):require("@uptrace/node").configureOpentelemetry(t)},L_="http://synnax_dev@localhost:14318/2",M_=()=>{const t="synnax";return x_({dsn:L_,serviceName:t,deploymentEnvironment:"dev"}),new be.Instrumentation({key:"",serviceName:t,logger:new be.Logger,tracer:new be.Tracer(su.getTracerProvider().getTracer("synnax"))})};exports.instrumentation=M_;
2
2
  //# sourceMappingURL=dev.cjs.map