/*!
 * Nutrient Web SDK 1.16.0-f1a9a75 (https://www.nutrient.io/sdk/web)
 *
 * Copyright (c) 2016-2026 PSPDFKit GmbH. All rights reserved.
 *
 * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
 * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
 * This notice may not be removed from this file.
 *
 * PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
 */
"use strict";(self.webpackChunkNutrientViewer=self.webpackChunkNutrientViewer||[]).push([[825],{825(e,t,n){function r(e,t){return!(null===e||"object"!=typeof e||!("$typeName"in e)||"string"!=typeof e.$typeName)&&(void 0===t||t.typeName===e.$typeName)}var a;function o(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(127&r)<<n,!(128&r))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,!(128&n))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(127&r)<<n,!(128&r))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function i(e,t,n){for(let r=0;r<28;r+=7){const a=e>>>r,o=!(a>>>7==0&&0==t),i=255&(o?128|a:a);if(n.push(i),!o)return}const r=e>>>28&15|(7&t)<<4,a=!!(t>>3);if(n.push(255&(a?128|r:r)),a){for(let e=3;e<31;e+=7){const r=t>>>e,a=!(r>>>7==0),o=255&(a?128|r:r);if(n.push(o),!a)return}n.push(t>>>31&1)}}n.d(t,{prepareUpload:()=>_n}),function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(a||(a={}));const s=4294967296;function u(e){const t="-"===e[0];t&&(e=e.slice(1));const n=1e6;let r=0,a=0;function o(t,o){const i=Number(e.slice(t,o));a*=n,r=r*n+i,r>=s&&(a+=r/s|0,r%=s)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?c(r,a):m(r,a)}function l(e,t){if(({lo:e,hi:t}=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t)),t<=2097151)return String(s*t+e);const n=16777215&(e>>>24|t<<8),r=t>>16&65535;let a=(16777215&e)+6777216*n+6710656*r,o=n+8147497*r,i=2*r;const u=1e7;return a>=u&&(o+=Math.floor(a/u),a%=u),o>=u&&(i+=Math.floor(o/u),o%=u),i.toString()+p(o)+p(a)}function m(e,t){return{lo:0|e,hi:0|t}}function c(e,t){return t=~t,e?e=1+~e:t+=1,m(e,t)}const p=e=>{const t=String(e);return"0000000".slice(t.length)+t};function d(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function f(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let t=5;128&e&&t<10;t++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const b=g();function g(){const e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&(!!globalThis.Deno||"object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const r="bigint"==typeof e?e:BigInt(e);if(r>n||r<t)throw new Error(`invalid int64: ${e}`);return r},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>a||t<r)throw new Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)),uDec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),E(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),y(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),E(e),u(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),y(e),u(e)),dec:(e,t)=>function(e,t){let n=m(e,t);const r=2147483648&n.hi;r&&(n=c(n.lo,n.hi));const a=l(n.lo,n.hi);return r?"-"+a:a}(e,t),uDec:(e,t)=>l(e,t)}}function E(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function y(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}function N(e,t){switch(e){case a.STRING:return"";case a.BOOL:return!1;case a.DOUBLE:case a.FLOAT:return 0;case a.INT64:case a.UINT64:case a.SFIXED64:case a.FIXED64:case a.SINT64:return t?"0":b.zero;case a.BYTES:return new Uint8Array(0);default:return 0}}const T=Symbol.for("reflect unsafe local");function I(e,t){const n=e[t.localName].case;return void 0===n?n:t.fields.find(e=>e.localName===n)}function h(e,t){const n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(2!=t.presence)return void 0!==e[n]&&Object.prototype.hasOwnProperty.call(e,n);switch(t.fieldKind){case"list":return e[n].length>0;case"map":return Object.keys(e[n]).length>0;case"scalar":return!function(e,t){switch(e){case a.BOOL:return!1===t;case a.STRING:return""===t;case a.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return 0==t}}(t.scalar,e[n]);case"enum":return e[n]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&void 0!==e[t]}function v(e,t){if(t.oneof){const n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function O(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function S(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function A(e,t){var n,r,a,o;if(S(e)&&T in e&&"add"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const i=t,s=e.field();return i.listKind==s.listKind&&i.scalar===s.scalar&&(null===(n=i.message)||void 0===n?void 0:n.typeName)===(null===(r=s.message)||void 0===r?void 0:r.typeName)&&(null===(a=i.enum)||void 0===a?void 0:a.typeName)===(null===(o=s.enum)||void 0===o?void 0:o.typeName)}return!0}return!1}function D(e,t){var n,r,a,o;if(S(e)&&T in e&&"has"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const i=t,s=e.field();return i.mapKey===s.mapKey&&i.mapKind==s.mapKind&&i.scalar===s.scalar&&(null===(n=i.message)||void 0===n?void 0:n.typeName)===(null===(r=s.message)||void 0===r?void 0:r.typeName)&&(null===(a=i.enum)||void 0===a?void 0:a.typeName)===(null===(o=s.enum)||void 0===o?void 0:o.typeName)}return!0}return!1}function F(e,t){return S(e)&&T in e&&"desc"in e&&S(e.desc)&&"message"===e.desc.kind&&(void 0===t||e.desc.typeName==t.typeName)}function L(e){const t=e.fields[0];return R(e.typeName)&&void 0!==t&&"scalar"==t.fieldKind&&"value"==t.name&&1==t.number}function R(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}function k(e,t){if(r(t,e))return t;const n=function(e){let t;if(function(e){switch(e.file.edition){case 999:return!1;case 998:return!0;default:return e.fields.some(e=>2!=e.presence&&"message"!=e.fieldKind&&!e.oneof)}}(e)){const n=B.get(e);let r,a;if(n)({prototype:r,members:a}=n);else{r={},a=new Set;for(const t of e.members)"oneof"!=t.kind&&("scalar"!=t.fieldKind&&"enum"!=t.fieldKind||2!=t.presence&&(a.add(t),r[t.localName]=K(t)));B.set(e,{prototype:r,members:a})}t=Object.create(r),t.$typeName=e.typeName;for(const n of e.members)if(!a.has(n)){if("field"==n.kind){if("message"==n.fieldKind)continue;if(("scalar"==n.fieldKind||"enum"==n.fieldKind)&&2!=n.presence)continue}t[n.localName]=K(n)}}else{t={$typeName:e.typeName};for(const n of e.members)"oneof"!=n.kind&&2!=n.presence||(t[n.localName]=K(n))}return t}(e);return void 0!==t&&function(e,t,n){for(const r of e.members){let e,a=n[r.localName];if(null!=a){if("oneof"==r.kind){const t=I(n,r);if(!t)continue;e=t,a=v(n,t)}else e=r;switch(e.fieldKind){case"message":a=Y(e,a);break;case"scalar":a=P(e,a);break;case"list":a=w(e,a);break;case"map":a=U(e,a)}O(t,e,a)}}}(e,n,t),n}function P(e,t){return e.scalar==a.BYTES?V(t):t}function U(e,t){if(S(t)){if(e.scalar==a.BYTES)return G(t,V);if("message"==e.mapKind)return G(t,t=>Y(e,t))}return t}function w(e,t){if(Array.isArray(t)){if(e.scalar==a.BYTES)return t.map(V);if("message"==e.listKind)return t.map(t=>Y(e,t))}return t}function Y(e,t){if("message"==e.fieldKind&&!e.oneof&&L(e.message))return P(e.message.fields[0],t);if(S(t)){if("google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!==e.parent.typeName)return t;if(!r(t,e.message))return k(e.message,t)}return t}function V(e){return Array.isArray(e)?new Uint8Array(e):e}function G(e,t){const n={};for(const r of Object.entries(e))n[r[0]]=t(r[1]);return n}const W=Symbol(),B=new WeakMap;function K(e){if("oneof"==e.kind)return{case:void 0};if("list"==e.fieldKind)return[];if("map"==e.fieldKind)return{};if("message"==e.fieldKind)return W;const t=e.getDefaultValue();return void 0!==t?"scalar"==e.fieldKind&&e.longAsString?t.toString():t:"scalar"==e.fieldKind?N(e.scalar,e.longAsString):e.enum.values[0].number}class C extends Error{constructor(e,t,n="FieldValueInvalidError"){super(t),this.name=n,this.field=()=>e}}const j=Symbol.for("@bufbuild/protobuf/text-encoding");function M(){if(null==globalThis[j]){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[j]={encodeUtf8:t=>e.encode(t),decodeUtf8:e=>t.decode(e),checkUtf8(e){try{return encodeURIComponent(e),!0}catch(e){return!1}}}}return globalThis[j]}var x;!function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(x||(x={}));const X=34028234663852886e22,$=-34028234663852886e22,Z=4294967295,J=2147483647,H=-2147483648;class Q{constructor(e=M().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;let t=new Uint8Array(e),n=0;for(let e=0;e<this.chunks.length;e++)t.set(this.chunks[e],n),n+=this.chunks[e].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(ee(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return q(e),d(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){!function(e){if("string"==typeof e){const t=e;if(e=Number(e),Number.isNaN(e)&&"NaN"!==t)throw new Error("invalid float32: "+t)}else if("number"!=typeof e)throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>X||e<$))throw new Error("invalid float32: "+e)}(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){ee(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){q(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return q(e),d(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=b.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=b.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=b.enc(e);return i(t.lo,t.hi,this.buf),this}sint64(e){const t=b.enc(e),n=t.hi>>31;return i(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){const t=b.uEnc(e);return i(t.lo,t.hi,this.buf),this}}class z{constructor(e,t=M().decodeUtf8){this.decodeUtf8=t,this.varint64=o,this.uint32=f,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case x.Varint:for(;128&this.buf[this.pos++];);break;case x.Bit64:this.pos+=4;case x.Bit32:this.pos+=4;break;case x.LengthDelimited:let n=this.uint32();this.pos+=n;break;case x.StartGroup:for(;;){const[e,n]=this.tag();if(n===x.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return b.dec(...this.varint64())}uint64(){return b.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,b.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return b.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return b.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}}function q(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>J||e<H)throw new Error("invalid int32: "+e)}function ee(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Z||e<0)throw new Error("invalid uint32: "+e)}function te(e,t,n){const r=ne(e,n);if(!0!==r)return new C(e,`list item #${t+1}: ${ae(e,n,r)}`)}function ne(e,t){return void 0!==e.scalar?re(t,e.scalar):void 0!==e.enum?e.enum.open?Number.isInteger(t):e.enum.values.some(e=>e.number===t):F(t,e.message)}function re(e,t){switch(t){case a.DOUBLE:return"number"==typeof e;case a.FLOAT:return"number"==typeof e&&(!(!Number.isNaN(e)&&Number.isFinite(e))||(!(e>X||e<$)||`${e.toFixed()} out of range`));case a.INT32:case a.SFIXED32:case a.SINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>J||e<H)||`${e.toFixed()} out of range`);case a.FIXED32:case a.UINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>Z||e<0)||`${e.toFixed()} out of range`);case a.BOOL:return"boolean"==typeof e;case a.STRING:return"string"==typeof e&&(M().checkUtf8(e)||"invalid UTF8");case a.BYTES:return e instanceof Uint8Array;case a.INT64:case a.SFIXED64:case a.SINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return b.parse(e),!0}catch(t){return`${e} out of range`}return!1;case a.FIXED64:case a.UINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return b.uParse(e),!0}catch(t){return`${e} out of range`}return!1}}function ae(e,t,n){return n="string"==typeof n?`: ${n}`:`, got ${oe(t)}`,void 0!==e.scalar?`expected ${function(e){switch(e){case a.STRING:return"string";case a.BOOL:return"boolean";case a.INT64:case a.SINT64:case a.SFIXED64:return"bigint (int64)";case a.UINT64:case a.FIXED64:return"bigint (uint64)";case a.BYTES:return"Uint8Array";case a.DOUBLE:return"number (float64)";case a.FLOAT:return"number (float32)";case a.FIXED32:case a.UINT32:return"number (uint32)";case a.INT32:case a.SFIXED32:case a.SINT32:return"number (int32)"}}(e.scalar)}`+n:void 0!==e.enum?`expected ${e.enum.toString()}`+n:`expected ${ie(e.message)}`+n}function oe(e){switch(typeof e){case"object":return null===e?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:A(e)?se(e.field()):D(e)?ue(e.field()):F(e)?ie(e.desc):r(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function ie(e){return`ReflectMessage (${e.typeName})`}function se(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${a[e.scalar]})`}}function ue(e){switch(e.mapKind){case"message":return`ReflectMap (${a[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${a[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${a[e.mapKey]}, ${a[e.scalar]})`}}function le(e,t,n=!0){return new ce(e,t,n)}const me=new WeakMap;class ce{get sortedFields(){const e=me.get(this.desc);if(e)return e;const t=this.desc.fields.concat().sort((e,t)=>e.number-t.number);return me.set(this.desc,t),t}constructor(e,t,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=e,this.message=this[T]=null!=t?t:k(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(e=>[e.number,e]))),this._fieldsByNumber.get(e)}oneofCase(e){return pe(this.message,e),I(this.message,e)}isSet(e){return pe(this.message,e),h(this.message,e)}clear(e){pe(this.message,e),function(e,t){const n=t.localName;if(t.oneof){const r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(2!=t.presence)delete e[n];else switch(t.fieldKind){case"map":e[n]={};break;case"list":e[n]=[];break;case"enum":e[n]=t.enum.values[0].number;break;case"scalar":e[n]=N(t.scalar,t.longAsString)}}(this.message,e)}get(e){pe(this.message,e);const t=v(this.message,e);switch(e.fieldKind){case"list":let n=this.lists.get(e);return n&&n[T]===t||this.lists.set(e,n=new de(e,t,this.check)),n;case"map":let r=this.maps.get(e);return r&&r[T]===t||this.maps.set(e,r=new fe(e,t,this.check)),r;case"message":return ge(e,t,this.check);case"scalar":return void 0===t?N(e.scalar,!1):he(e,t);case"enum":return null!=t?t:e.enum.values[0].number}}set(e,t){if(pe(this.message,e),this.check){const n=function(e,t){const n="list"==e.fieldKind?A(t,e):"map"==e.fieldKind?D(t,e):ne(e,t);if(!0===n)return;let r;switch(e.fieldKind){case"list":r=`expected ${se(e)}, got ${oe(t)}`;break;case"map":r=`expected ${ue(e)}, got ${oe(t)}`;break;default:r=ae(e,t,n)}return new C(e,r)}(e,t);if(n)throw n}let n;n="message"==e.fieldKind?be(e,t):D(t)||A(t)?t[T]:_e(e,t),O(this.message,e,n)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function pe(e,t){if(t.parent.typeName!==e.$typeName)throw new C(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class de{field(){return this._field}get size(){return this._arr.length}constructor(e,t,n){this._field=e,this._arr=this[T]=t,this.check=n}get(e){const t=this._arr[e];return void 0===t?void 0:ye(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new C(this._field,`list item #${e+1}: out of range`);if(this.check){const n=te(this._field,e,t);if(n)throw n}this._arr[e]=Ee(this._field,t)}add(e){if(this.check){const t=te(this._field,this._arr.length,e);if(t)throw t}this._arr.push(Ee(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield ye(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,ye(this._field,this._arr[e],this.check)]}}class fe{constructor(e,t,n=!0){this.obj=this[T]=null!=t?t:{},this.check=n,this._field=e}field(){return this._field}set(e,t){if(this.check){const n=function(e,t,n){const r=re(t,e.mapKey);if(!0!==r)return new C(e,`invalid map key: ${ae({scalar:e.mapKey},t,r)}`);const a=ne(e,n);return!0!==a?new C(e,`map entry ${oe(t)}: ${ae(e,n,a)}`):void 0}(this._field,e,t);if(n)throw n}return this.obj[Te(e)]=function(e,t){if("message"==e.mapKind)return be(e,t);return _e(e,t)}(this._field,t),this}delete(e){const t=Te(e),n=Object.prototype.hasOwnProperty.call(this.obj,t);return n&&delete this.obj[t],n}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[Te(e)];return void 0!==t&&(t=Ne(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,Te(e))}*keys(){for(const e of Object.keys(this.obj))yield Ie(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[Ie(e[0],this._field.mapKey),Ne(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield Ne(this._field,e,this.check)}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}}function be(e,t){return F(t)?R(t.message.$typeName)&&!e.oneof&&"message"==e.fieldKind?t.message.value:"google.protobuf.Struct"==t.desc.typeName&&"google.protobuf.Value"!=e.parent.typeName?Oe(t.message):t.message:t}function ge(e,t,n){return void 0!==t&&(L(e.message)&&!e.oneof&&"message"==e.fieldKind?t={$typeName:e.message.typeName,value:he(e.message.fields[0],t)}:"google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!=e.parent.typeName&&S(t)&&(t=ve(t))),new ce(e.message,t,n)}function Ee(e,t){return"message"==e.listKind?be(e,t):_e(e,t)}function ye(e,t,n){return"message"==e.listKind?ge(e,t,n):he(e,t)}function Ne(e,t,n){return"message"==e.mapKind?ge(e,t,n):t}function Te(e){return"string"==typeof e||"number"==typeof e?e:String(e)}function Ie(e,t){switch(t){case a.STRING:return e;case a.INT32:case a.FIXED32:case a.UINT32:case a.SFIXED32:case a.SINT32:{const t=Number.parseInt(e);if(Number.isFinite(t))return t;break}case a.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case a.UINT64:case a.FIXED64:try{return b.uParse(e)}catch(e){}break;default:try{return b.parse(e)}catch(e){}}return e}function he(e,t){switch(e.scalar){case a.INT64:case a.SFIXED64:case a.SINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=b.parse(t));break;case a.FIXED64:case a.UINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=b.uParse(t))}return t}function _e(e,t){switch(e.scalar){case a.INT64:case a.SFIXED64:case a.SINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=b.parse(t));break;case a.FIXED64:case a.UINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=b.uParse(t))}return t}function ve(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(S(e))for(const[n,r]of Object.entries(e))t.fields[n]=Ae(r);return t}function Oe(e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=Se(r);return t}function Se(e){switch(e.kind.case){case"structValue":return Oe(e.kind.value);case"listValue":return e.kind.value.values.map(Se);case"nullValue":case void 0:return null;default:return e.kind.value}}function Ae(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(null===e){const e=0;t.kind={case:"nullValue",value:e}}else if(Array.isArray(e)){const n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const t of e)n.values.push(Ae(t));t.kind={case:"listValue",value:n}}else t.kind={case:"structValue",value:ve(e)}}return t}function De(e){const t=function(){if(!Re){Re=[];const e=ke("std");for(let t=0;t<e.length;t++)Re[e[t].charCodeAt(0)]=t;Re["-".charCodeAt(0)]=e.indexOf("+"),Re["_".charCodeAt(0)]=e.indexOf("/")}return Re}();let n=3*e.length/4;"="==e[e.length-2]?n-=2:"="==e[e.length-1]&&(n-=1);let r,a=new Uint8Array(n),o=0,i=0,s=0;for(let n=0;n<e.length;n++){if(r=t[e.charCodeAt(n)],void 0===r)switch(e[n]){case"=":i=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string")}switch(i){case 0:s=r,i=1;break;case 1:a[o++]=s<<2|(48&r)>>4,s=r,i=2;break;case 2:a[o++]=(15&s)<<4|(60&r)>>2,s=r,i=3;break;case 3:a[o++]=(3&s)<<6|r,i=0}}if(1==i)throw Error("invalid base64 string");return a.subarray(0,o)}let Fe,Le,Re;function ke(e){return Fe||(Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Le=Fe.slice(0,-2).concat("-","_")),"url"==e?Le:Fe}function Pe(e){let t=!1;const n=[];for(let r=0;r<e.length;r++){let a=e.charAt(r);switch(a){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(a),t=!1;break;default:t&&(t=!1,a=a.toUpperCase()),n.push(a)}}return n.join("")}const Ue=new Set(["constructor","toString","toJSON","valueOf"]);function we(e){return Ue.has(e)?e+"$":e}function Ye(e){for(const t of e.field)_(t,"jsonName")||(t.jsonName=Pe(t.name));e.nestedType.forEach(Ye)}function Ve(e,t){switch(e){case a.STRING:return t;case a.BYTES:{const n=function(e){const t=[],n={tail:e,c:"",next(){return 0!=this.tail.length&&(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(e){if(this.tail.length>=e){const t=this.tail.substring(0,e);return this.tail=this.tail.substring(e),t}return!1}};for(;n.next();)if("\\"===n.c){if(n.next())switch(n.c){case"\\":t.push(n.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const e=n.c,r=n.take(2);if(!1===r)return!1;const a=parseInt(e+r,8);if(Number.isNaN(a))return!1;t.push(a);break}case"x":{const e=n.c,r=n.take(2);if(!1===r)return!1;const a=parseInt(e+r,16);if(Number.isNaN(a))return!1;t.push(a);break}case"u":{const e=n.c,r=n.take(4);if(!1===r)return!1;const a=parseInt(e+r,16);if(Number.isNaN(a))return!1;const o=new Uint8Array(4);new DataView(o.buffer).setInt32(0,a,!0),t.push(o[0],o[1],o[2],o[3]);break}case"U":{const e=n.c,r=n.take(8);if(!1===r)return!1;const a=b.uEnc(e+r),o=new Uint8Array(8),i=new DataView(o.buffer);i.setInt32(0,a.lo,!0),i.setInt32(4,a.hi,!0),t.push(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7]);break}}}else t.push(n.c.charCodeAt(0));return new Uint8Array(t)}(t);if(!1===n)throw new Error(`cannot parse ${a[e]} default value: ${t}`);return n}case a.INT64:case a.SFIXED64:case a.SINT64:return b.parse(t);case a.UINT64:case a.FIXED64:return b.uParse(t);case a.DOUBLE:case a.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case a.BOOL:return"true"===t;case a.INT32:case a.UINT32:case a.SINT32:case a.FIXED32:case a.SFIXED32:return parseInt(t,10)}}function*Ge(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*Ge(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*Ge(t);yield*e.nestedEnums,yield*e.nestedExtensions}}function We(...e){const t=Be();if(!e.length)return t;if("$typeName"in e[0]&&"google.protobuf.FileDescriptorSet"==e[0].$typeName){for(const n of e[0].file)Me(n,t);return t}if("$typeName"in e[0]){const r=e[0],a=e[1],o=new Set;function i(e){const n=[];for(const r of e.dependency){if(null!=t.getFile(r))continue;if(o.has(r))continue;const i=a(r);if(!i)throw new Error(`Unable to resolve ${r}, imported by ${e.name}`);"kind"in i?t.addFile(i,!1,!0):(o.add(i.name),n.push(i))}return n.concat(...n.map(i))}for(const s of[r,...i(r)].reverse())Me(s,t)}else for(const u of e)for(const l of u.files)t.addFile(l);return t}function Be(){const e=new Map,t=new Map,n=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator]:()=>e.values(),get files(){return n.values()},addFile(e,t,r){if(n.set(e.proto.name,e),!t)for(const t of Ge(e))this.add(t);if(r)for(const n of e.dependencies)this.addFile(n,t,r)},add(n){if("extension"==n.kind){let e=t.get(n.extendee.typeName);e||t.set(n.extendee.typeName,e=new Map),e.set(n.number,n)}e.set(n.typeName,n)},get:t=>e.get(t),getFile:e=>n.get(e),getMessage(t){const n=e.get(t);return"message"==(null==n?void 0:n.kind)?n:void 0},getEnum(t){const n=e.get(t);return"enum"==(null==n?void 0:n.kind)?n:void 0},getExtension(t){const n=e.get(t);return"extension"==(null==n?void 0:n.kind)?n:void 0},getExtensionFor(e,n){var r;return null===(r=t.get(e.typeName))||void 0===r?void 0:r.get(n)},getService(t){const n=e.get(t);return"service"==(null==n?void 0:n.kind)?n:void 0}}}const Ke=10,Ce=11,je={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function Me(e,t){var n,r;const a={kind:"file",proto:e,deprecated:null!==(r=null===(n=e.options)||void 0===n?void 0:n.deprecated)&&void 0!==r&&r,edition:ze(e),name:e.name.replace(/\.proto$/,""),dependencies:qe(e,t),enums:[],messages:[],extensions:[],services:[],toString:()=>`file ${e.name}`},o=new Map,i={get:e=>o.get(e),add(e){var t;it(!0===(null===(t=e.proto.options)||void 0===t?void 0:t.mapEntry)),o.set(e.typeName,e)}};for(const n of e.enumType)$e(n,a,void 0,t);for(const n of e.messageType)Ze(n,a,void 0,t,i);for(const n of e.service)Je(n,a,t);xe(a,t);for(const e of o.values())Xe(e,t,i);for(const e of a.messages)Xe(e,t,i),xe(e,t);t.addFile(a,!0)}function xe(e,t){switch(e.kind){case"file":for(const n of e.proto.extension){const r=Qe(n,e,t);e.extensions.push(r),t.add(r)}break;case"message":for(const n of e.proto.extension){const r=Qe(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(const n of e.nestedMessages)xe(n,t)}}function Xe(e,t,n){const r=e.proto.oneofDecl.map(t=>function(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:we(Pe(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}(t,e)),a=new Set;for(const o of e.proto.field){const i=nt(o,r),s=Qe(o,e,t,i,n);e.fields.push(s),e.field[s.localName]=s,void 0===i?e.members.push(s):(i.fields.push(s),a.has(i)||(a.add(i),e.members.push(i)))}for(const t of r.filter(e=>a.has(e)))e.oneofs.push(t);for(const r of e.nestedMessages)Xe(r,t,n)}function $e(e,t,n,r){var a,o,i,s,u;const l=function(e,t){const n=(r=e,(r.substring(0,1)+r.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()+"_");var r;for(const e of t){if(!e.name.toLowerCase().startsWith(n))return;const t=e.name.substring(n.length);if(0==t.length)return;if(/^\d/.test(t))return}return n}(e.name,e.value),m={kind:"enum",proto:e,deprecated:null!==(o=null===(a=e.options)||void 0===a?void 0:a.deprecated)&&void 0!==o&&o,file:t,parent:n,open:!0,name:e.name,typeName:et(e,n,t),value:{},values:[],sharedPrefix:l,toString(){return`enum ${this.typeName}`}};m.open=function(e){var t;return 1==ot("enumType",{proto:e.proto,parent:null!==(t=e.parent)&&void 0!==t?t:e.file})}(m),r.add(m);for(const t of e.value){const e=t.name;m.values.push(m.value[t.number]={kind:"enum_value",proto:t,deprecated:null!==(s=null===(i=t.options)||void 0===i?void 0:i.deprecated)&&void 0!==s&&s,parent:m,name:e,localName:we(null==l?e:e.substring(l.length)),number:t.number,toString:()=>`enum value ${m.typeName}.${e}`})}(null!==(u=null==n?void 0:n.nestedEnums)&&void 0!==u?u:t.enums).push(m)}function Ze(e,t,n,r,a){var o,i,s,u;const l={kind:"message",proto:e,deprecated:null!==(i=null===(o=e.options)||void 0===o?void 0:o.deprecated)&&void 0!==i&&i,file:t,parent:n,name:e.name,typeName:et(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};!0===(null===(s=e.options)||void 0===s?void 0:s.mapEntry)?a.add(l):((null!==(u=null==n?void 0:n.nestedMessages)&&void 0!==u?u:t.messages).push(l),r.add(l));for(const n of e.enumType)$e(n,t,l,r);for(const n of e.nestedType)Ze(n,t,l,r,a)}function Je(e,t,n){var r,a;const o={kind:"service",proto:e,deprecated:null!==(a=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==a&&a,file:t,name:e.name,typeName:et(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(o),n.add(o);for(const t of e.method){const e=He(t,o,n);o.methods.push(e),o.method[e.localName]=e}}function He(e,t,n){var r,a,o,i;let s;s=e.clientStreaming&&e.serverStreaming?"bidi_streaming":e.clientStreaming?"client_streaming":e.serverStreaming?"server_streaming":"unary";const u=n.getMessage(tt(e.inputType)),l=n.getMessage(tt(e.outputType));it(u,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),it(l,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const m=e.name;return{kind:"rpc",proto:e,deprecated:null!==(a=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==a&&a,parent:t,name:m,localName:we(m.length?we(m[0].toLowerCase()+m.substring(1)):m),methodKind:s,input:u,output:l,idempotency:null!==(i=null===(o=e.options)||void 0===o?void 0:o.idempotencyLevel)&&void 0!==i?i:0,toString:()=>`rpc ${t.typeName}.${m}`}}function Qe(e,t,n,r,o){var i,s,u;const l=void 0===o,m={kind:"field",proto:e,deprecated:null!==(s=null===(i=e.options)||void 0===i?void 0:i.deprecated)&&void 0!==s&&s,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:rt(e,r,l,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(l){const r="file"==t.kind?t:t.file,a="file"==t.kind?void 0:t,o=et(e,a,r);m.kind="extension",m.file=r,m.parent=a,m.oneof=void 0,m.typeName=o,m.jsonName=`[${o}]`,m.toString=()=>`extension ${o}`;const i=n.getMessage(tt(e.extendee));it(i,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),m.extendee=i}else{const n=t;it("message"==n.kind),m.parent=n,m.oneof=r,m.localName=r?Pe(e.name):we(Pe(e.name)),m.jsonName=e.jsonName,m.toString=()=>`field ${n.typeName}.${e.name}`}const c=e.label,p=e.type,d=null===(u=e.options)||void 0===u?void 0:u.jstype;if(3===c){const r=11==p?null==o?void 0:o.get(tt(e.typeName)):void 0;if(r){m.fieldKind="map";const{key:e,value:t}=function(e){const t=e.fields.find(e=>1===e.number),n=e.fields.find(e=>2===e.number);return it(t&&"scalar"==t.fieldKind&&t.scalar!=a.BYTES&&t.scalar!=a.FLOAT&&t.scalar!=a.DOUBLE&&n&&"list"!=n.fieldKind&&"map"!=n.fieldKind),{key:t,value:n}}(r);return m.mapKey=e.scalar,m.mapKind=t.fieldKind,m.message=t.message,m.delimitedEncoding=!1,m.enum=t.enum,m.scalar=t.scalar,m}switch(m.fieldKind="list",p){case 11:case 10:m.listKind="message",m.message=n.getMessage(tt(e.typeName)),it(m.message),m.delimitedEncoding=at(e,t);break;case 14:m.listKind="enum",m.enum=n.getEnum(tt(e.typeName)),it(m.enum);break;default:m.listKind="scalar",m.scalar=p,m.longAsString=1==d}return m.packed=function(e,t){if(3!=e.label)return!1;switch(e.type){case 9:case 12:case Ke:case Ce:return!1}const n=e.options;if(n&&_(n,"packed"))return n.packed;return 1==ot("repeatedFieldEncoding",{proto:e,parent:t})}(e,t),m}switch(p){case Ce:case Ke:m.fieldKind="message",m.message=n.getMessage(tt(e.typeName)),it(m.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),m.delimitedEncoding=at(e,t),m.getDefaultValue=()=>{};break;case 14:{const t=n.getEnum(tt(e.typeName));it(void 0!==t,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),m.fieldKind="enum",m.enum=n.getEnum(tt(e.typeName)),m.getDefaultValue=()=>_(e,"defaultValue")?function(e,t){const n=e.values.find(e=>e.name===t);if(!n)throw new Error(`cannot parse ${e} default value: ${t}`);return n.number}(t,e.defaultValue):void 0;break}default:m.fieldKind="scalar",m.scalar=p,m.longAsString=1==d,m.getDefaultValue=()=>_(e,"defaultValue")?Ve(p,e.defaultValue):void 0}return m}function ze(e){switch(e.syntax){case"":case"proto2":return 998;case"proto3":return 999;case"editions":if(e.edition in je)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function qe(e,t){return e.dependency.map(n=>{const r=t.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${e.name}`);return r})}function et(e,t,n){let r;return r=t?`${t.typeName}.${e.name}`:n.proto.package.length>0?`${n.proto.package}.${e.name}`:`${e.name}`,r}function tt(e){return e.startsWith(".")?e.substring(1):e}function nt(e,t){if(!_(e,"oneofIndex"))return;if(e.proto3Optional)return;const n=t[e.oneofIndex];return it(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function rt(e,t,n,r){if(2==e.label)return 3;if(3==e.label)return 2;if(t||e.proto3Optional)return 1;if(n)return 1;const a=ot("fieldPresence",{proto:e,parent:r});return 2!=a||e.type!=Ce&&e.type!=Ke?a:1}function at(e,t){return e.type==Ke||2==ot("messageEncoding",{proto:e,parent:t})}function ot(e,t){var n,r;const a=null===(n=t.proto.options)||void 0===n?void 0:n.features;if(a){const t=a[e];if(0!=t)return t}if("kind"in t){if("message"==t.kind)return ot(e,null!==(r=t.parent)&&void 0!==r?r:t.file);const n=je[t.edition];if(!n)throw new Error(`feature default for edition ${t.edition} not found`);return n[e]}return ot(e,t.parent)}function it(e,t){if(!e)throw new Error(t)}function st(e){const t=function(e){const t=Object.create({syntax:"",edition:0});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(ut),enumType:e.enumType.map(ct)}))}(e);t.messageType.forEach(Ye);return We(t,()=>{}).getFile(t.name)}function ut(e){var t,n,r,a,o,i,s,u;const l=Object.create({visibility:0});return Object.assign(l,{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:null!==(n=null===(t=e.field)||void 0===t?void 0:t.map(lt))&&void 0!==n?n:[],extension:[],nestedType:null!==(a=null===(r=e.nestedType)||void 0===r?void 0:r.map(ut))&&void 0!==a?a:[],enumType:null!==(i=null===(o=e.enumType)||void 0===o?void 0:o.map(ct))&&void 0!==i?i:[],extensionRange:null!==(u=null===(s=e.extensionRange)||void 0===s?void 0:s.map(e=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},e)))&&void 0!==u?u:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function lt(e){const t=Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?mt(e.options):void 0}))}function mt(e){var t,n,r;const a=Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0});return Object.assign(a,Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:null!==(t=e.targets)&&void 0!==t?t:[],editionDefaults:null!==(r=null===(n=e.editionDefaults)||void 0===n?void 0:n.map(e=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},e)))&&void 0!==r?r:[],uninterpretedOption:[]}))}function ct(e){const t=Object.create({visibility:0});return Object.assign(t,{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e))})}function pt(e,t,...n){return n.reduce((e,t)=>e.nestedMessages[t],e.messages[t])}const dt=st({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_UNSTABLE",number:9999},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),ft=pt(dt,1);var bt;!function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"}(bt||(bt={}));var gt;!function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(gt||(gt={}));var Et;!function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"}(Et||(Et={}));var yt;!function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"}(yt||(yt={}));var Nt;!function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"}(Nt||(Nt={}));var Tt;!function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"}(Tt||(Tt={}));var It;!function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"}(It||(It={}));var ht;!function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"}(ht||(ht={}));var _t;!function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"}(_t||(_t={}));var vt;!function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"}(vt||(vt={}));var Ot;!function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"}(Ot||(Ot={}));var St;!function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"}(St||(St={}));var At;!function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"}(At||(At={}));var Dt;!function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"}(Dt||(Dt={}));var Ft;!function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"}(Ft||(Ft={}));var Lt;!function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"}(Lt||(Lt={}));var Rt;!function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"}(Rt||(Rt={}));var kt;!function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"}(kt||(kt={}));var Pt;!function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_UNSTABLE=9999]="EDITION_UNSTABLE",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"}(Pt||(Pt={}));var Ut;!function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"}(Ut||(Ut={}));const wt={readUnknownFields:!0};function Yt(e){return e?Object.assign(Object.assign({},wt),e):wt}function Vt(e,t,n,r,a){var o;const i=r?t.len:t.pos+a;let s,u;const l=null!==(o=e.getUnknown())&&void 0!==o?o:[];for(;t.pos<i&&([s,u]=t.tag(),!r||u!=x.EndGroup);){const r=e.findNumber(s);if(!r){const e=t.skip(u,s);n.readUnknownFields&&l.push({no:s,wireType:u,data:e});continue}Gt(e,t,r,u,n)}if(r&&(u!=x.EndGroup||s!==a))throw new Error("invalid end group tag");l.length>0&&e.setUnknown(l)}function Gt(e,t,n,r,o){var i;switch(n.fieldKind){case"scalar":e.set(n,Bt(t,n.scalar));break;case"enum":const s=Bt(t,a.INT32);if(n.enum.open)e.set(n,s);else{if(n.enum.values.some(e=>e.number===s))e.set(n,s);else if(o.readUnknownFields){const t=[];d(s,t);const a=null!==(i=e.getUnknown())&&void 0!==i?i:[];a.push({no:n.number,wireType:r,data:new Uint8Array(t)}),e.setUnknown(a)}}break;case"message":e.set(n,Wt(t,o,n,e.get(n)));break;case"list":!function(e,t,n,r){var o;const i=n.field();if("message"===i.listKind)return void n.add(Wt(e,r,i));const s=null!==(o=i.scalar)&&void 0!==o?o:a.INT32,u=t==x.LengthDelimited&&s!=a.STRING&&s!=a.BYTES;if(!u)return void n.add(Bt(e,s));const l=e.uint32()+e.pos;for(;e.pos<l;)n.add(Bt(e,s))}(t,r,e.get(n),o);break;case"map":!function(e,t,n){const r=t.field();let a,o;const i=e.uint32(),s=e.pos+i;for(;e.pos<s;){const[t]=e.tag();switch(t){case 1:a=Bt(e,r.mapKey);break;case 2:switch(r.mapKind){case"scalar":o=Bt(e,r.scalar);break;case"enum":o=e.int32();break;case"message":o=Wt(e,n,r)}}}void 0===a&&(a=N(r.mapKey,!1));if(void 0===o)switch(r.mapKind){case"scalar":o=N(r.scalar,!1);break;case"enum":o=r.enum.values[0].number;break;case"message":o=le(r.message,void 0,!1)}t.set(a,o)}(t,e.get(n),o)}}function Wt(e,t,n,r){const a=n.delimitedEncoding,o=null!=r?r:le(n.message,void 0,!1);return Vt(o,e,t,a,a?n.number:e.uint32()),o}function Bt(e,t){switch(t){case a.STRING:return e.string();case a.BOOL:return e.bool();case a.DOUBLE:return e.double();case a.FLOAT:return e.float();case a.INT32:return e.int32();case a.INT64:return e.int64();case a.UINT64:return e.uint64();case a.FIXED64:return e.fixed64();case a.BYTES:return e.bytes();case a.FIXED32:return e.fixed32();case a.SFIXED32:return e.sfixed32();case a.SFIXED64:return e.sfixed64();case a.SINT64:return e.sint64();case a.UINT32:return e.uint32();case a.SINT32:return e.sint32()}}function Kt(e,t){var n;const r=function(e,t,n){const r=le(e,void 0,!1);return Vt(r,new z(t),Yt(n),!1,t.byteLength),r.message}(ft,De(e));r.messageType.forEach(Ye),r.dependency=null!==(n=null==t?void 0:t.map(e=>e.proto.name))&&void 0!==n?n:[];return We(r,e=>null==t?void 0:t.find(t=>t.proto.name===e)).getFile(r.name)}const Ct={writeUnknownFields:!0};function jt(e,t,n){return Mt(new Q,function(e){return e?Object.assign(Object.assign({},Ct),e):Ct}(n),le(e,t)).finish()}function Mt(e,t,n){var r;for(const r of n.sortedFields)if(n.isSet(r))xt(e,t,n,r);else if(3==r.presence)throw new Error(`cannot encode ${r} to binary: required field not set`);if(t.writeUnknownFields)for(const{no:t,wireType:a,data:o}of null!==(r=n.getUnknown())&&void 0!==r?r:[])e.tag(t,a).raw(o);return e}function xt(e,t,n,r){var o;switch(r.fieldKind){case"scalar":case"enum":Xt(e,n.desc.typeName,r.name,null!==(o=r.scalar)&&void 0!==o?o:a.INT32,r.number,n.get(r));break;case"list":!function(e,t,n,r){var o;if("message"==n.listKind){for(const a of r)$t(e,t,n,a);return}const i=null!==(o=n.scalar)&&void 0!==o?o:a.INT32;if(n.packed){if(!r.size)return;e.tag(n.number,x.LengthDelimited).fork();for(const t of r)Jt(e,n.parent.typeName,n.name,i,t);return void e.join()}for(const t of r)Xt(e,n.parent.typeName,n.name,i,n.number,t)}(e,t,r,n.get(r));break;case"message":$t(e,t,r,n.get(r));break;case"map":for(const[a,o]of n.get(r))Zt(e,t,r,a,o)}}function Xt(e,t,n,r,o,i){Jt(e.tag(o,function(e){switch(e){case a.BYTES:case a.STRING:return x.LengthDelimited;case a.DOUBLE:case a.FIXED64:case a.SFIXED64:return x.Bit64;case a.FIXED32:case a.SFIXED32:case a.FLOAT:return x.Bit32;default:return x.Varint}}(r)),t,n,r,i)}function $t(e,t,n,r){n.delimitedEncoding?Mt(e.tag(n.number,x.StartGroup),t,r).tag(n.number,x.EndGroup):Mt(e.tag(n.number,x.LengthDelimited).fork(),t,r).join()}function Zt(e,t,n,r,o){var i;switch(e.tag(n.number,x.LengthDelimited).fork(),Xt(e,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case"scalar":case"enum":Xt(e,n.parent.typeName,n.name,null!==(i=n.scalar)&&void 0!==i?i:a.INT32,2,o);break;case"message":Mt(e.tag(2,x.LengthDelimited).fork(),t,o).join()}e.join()}function Jt(e,t,n,r,o){try{switch(r){case a.STRING:e.string(o);break;case a.BOOL:e.bool(o);break;case a.DOUBLE:e.double(o);break;case a.FLOAT:e.float(o);break;case a.INT32:e.int32(o);break;case a.INT64:e.int64(o);break;case a.UINT64:e.uint64(o);break;case a.FIXED64:e.fixed64(o);break;case a.BYTES:e.bytes(o);break;case a.FIXED32:e.fixed32(o);break;case a.SFIXED32:e.sfixed32(o);break;case a.SFIXED64:e.sfixed64(o);break;case a.SINT64:e.sint64(o);break;case a.UINT32:e.uint32(o);break;case a.SINT32:e.sint32(o)}}catch(e){if(e instanceof Error)throw new Error(`cannot encode field ${t}.${n} to binary: ${e.message}`);throw e}}var Ht;!function(e){e[e.TYPE_UNKNOWN=0]="TYPE_UNKNOWN",e[e.TYPE_DOUBLE=1]="TYPE_DOUBLE",e[e.TYPE_FLOAT=2]="TYPE_FLOAT",e[e.TYPE_INT64=3]="TYPE_INT64",e[e.TYPE_UINT64=4]="TYPE_UINT64",e[e.TYPE_INT32=5]="TYPE_INT32",e[e.TYPE_FIXED64=6]="TYPE_FIXED64",e[e.TYPE_FIXED32=7]="TYPE_FIXED32",e[e.TYPE_BOOL=8]="TYPE_BOOL",e[e.TYPE_STRING=9]="TYPE_STRING",e[e.TYPE_GROUP=10]="TYPE_GROUP",e[e.TYPE_MESSAGE=11]="TYPE_MESSAGE",e[e.TYPE_BYTES=12]="TYPE_BYTES",e[e.TYPE_UINT32=13]="TYPE_UINT32",e[e.TYPE_ENUM=14]="TYPE_ENUM",e[e.TYPE_SFIXED32=15]="TYPE_SFIXED32",e[e.TYPE_SFIXED64=16]="TYPE_SFIXED64",e[e.TYPE_SINT32=17]="TYPE_SINT32",e[e.TYPE_SINT64=18]="TYPE_SINT64"}(Ht||(Ht={}));var Qt;!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.OPTIONAL=1]="OPTIONAL",e[e.REQUIRED=2]="REQUIRED",e[e.REPEATED=3]="REPEATED"}(Qt||(Qt={}));var zt;!function(e){e[e.PROTO2=0]="PROTO2",e[e.PROTO3=1]="PROTO3",e[e.EDITIONS=2]="EDITIONS"}(zt||(zt={}));var qt;!function(e){e[e.STRING_TYPE_UNKNOWN=0]="STRING_TYPE_UNKNOWN",e[e.VIEW=1]="VIEW",e[e.CORD=2]="CORD",e[e.STRING=3]="STRING"}(qt||(qt={}));var en;!function(e){e[e.API_LEVEL_UNSPECIFIED=0]="API_LEVEL_UNSPECIFIED",e[e.API_OPEN=1]="API_OPEN",e[e.API_HYBRID=2]="API_HYBRID",e[e.API_OPAQUE=3]="API_OPAQUE"}(en||(en={}));var tn;!function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.KEEP=1]="KEEP",e[e.GENERATE_BOTH=2]="GENERATE_BOTH",e[e.STRIP=3]="STRIP"}(tn||(tn={}));var nn;!function(e){e[e.NEST_IN_FILE_CLASS_UNKNOWN=0]="NEST_IN_FILE_CLASS_UNKNOWN",e[e.NO=1]="NO",e[e.YES=2]="YES",e[e.LEGACY=3]="LEGACY"}(nn||(nn={}));var rn;!function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.DEFAULT=1]="DEFAULT",e[e.VERIFY=2]="VERIFY"}(rn||(rn={}));var an;!function(e){e[e.NULL_VALUE=0]="NULL_VALUE"}(an||(an={}));var on;!function(e){e[e.NONE=0]="NONE",e[e.PROTO3_OPTIONAL=1]="PROTO3_OPTIONAL",e[e.SUPPORTS_EDITIONS=2]="SUPPORTS_EDITIONS"}(on||(on={}));Symbol();Symbol();function sn(e,t,...n){return n.reduce((e,t)=>e.nestedMessages[t],e.messages[t])}const un="@bufbuild/protobuf",ln={isMessage:{typeOnly:!1,bootstrapWktFrom:"../../is-message.js",from:un},Message:{typeOnly:!0,bootstrapWktFrom:"../../types.js",from:un},create:{typeOnly:!1,bootstrapWktFrom:"../../create.js",from:un},fromJson:{typeOnly:!1,bootstrapWktFrom:"../../from-json.js",from:un},fromJsonString:{typeOnly:!1,bootstrapWktFrom:"../../from-json.js",from:un},fromBinary:{typeOnly:!1,bootstrapWktFrom:"../../from-binary.js",from:un},toBinary:{typeOnly:!1,bootstrapWktFrom:"../../to-binary.js",from:un},toJson:{typeOnly:!1,bootstrapWktFrom:"../../to-json.js",from:un},toJsonString:{typeOnly:!1,bootstrapWktFrom:"../../to-json.js",from:un},protoInt64:{typeOnly:!1,bootstrapWktFrom:"../../proto-int64.js",from:un},JsonValue:{typeOnly:!0,bootstrapWktFrom:"../../json-value.js",from:un},JsonObject:{typeOnly:!0,bootstrapWktFrom:"../../json-value.js",from:un},codegen:{boot:{typeOnly:!1,bootstrapWktFrom:"../../codegenv2/boot.js",from:un+"/codegenv2"},fileDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv2/file.js",from:un+"/codegenv2"},enumDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv2/enum.js",from:un+"/codegenv2"},extDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv2/extension.js",from:un+"/codegenv2"},messageDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv2/message.js",from:un+"/codegenv2"},serviceDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv2/service.js",from:un+"/codegenv2"},tsEnum:{typeOnly:!1,bootstrapWktFrom:"../../codegenv2/enum.js",from:un+"/codegenv2"},GenFile:{typeOnly:!0,bootstrapWktFrom:"../../codegenv2/types.js",from:un+"/codegenv2"},GenEnum:{typeOnly:!0,bootstrapWktFrom:"../../codegenv2/types.js",from:un+"/codegenv2"},GenExtension:{typeOnly:!0,bootstrapWktFrom:"../../codegenv2/types.js",from:un+"/codegenv2"},GenMessage:{typeOnly:!0,bootstrapWktFrom:"../../codegenv2/types.js",from:un+"/codegenv2"},GenService:{typeOnly:!0,bootstrapWktFrom:"../../codegenv2/types.js",from:un+"/codegenv2"}}};const mn=un;Object.assign(Object.assign({},ln),{codegen:{boot:{typeOnly:!1,bootstrapWktFrom:"../../codegenv1/boot.js",from:mn+"/codegenv1"},fileDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv1/file.js",from:mn+"/codegenv1"},enumDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv1/enum.js",from:mn+"/codegenv1"},extDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv1/extension.js",from:mn+"/codegenv1"},messageDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv1/message.js",from:mn+"/codegenv1"},serviceDesc:{typeOnly:!1,bootstrapWktFrom:"../../codegenv1/service.js",from:mn+"/codegenv1"},tsEnum:{typeOnly:!1,bootstrapWktFrom:"../../codegenv1/enum.js",from:mn+"/codegenv1"},GenFile:{typeOnly:!0,bootstrapWktFrom:"../../codegenv1/types.js",from:mn+"/codegenv1"},GenEnum:{typeOnly:!0,bootstrapWktFrom:"../../codegenv1/types.js",from:mn+"/codegenv1"},GenExtension:{typeOnly:!0,bootstrapWktFrom:"../../codegenv1/types.js",from:mn+"/codegenv1"},GenMessage:{typeOnly:!0,bootstrapWktFrom:"../../codegenv1/types.js",from:mn+"/codegenv1"},GenService:{typeOnly:!0,bootstrapWktFrom:"../../codegenv1/types.js",from:mn+"/codegenv1"}}});const cn=Kt("Cgxjb21tb24ucHJvdG8SEG51dHJpZW50Lm1ldHJpY3Mi8gEKCEFueVZhbHVlEhYKDHN0cmluZ192YWx1ZRgBIAEoCUgAEhQKCmJvb2xfdmFsdWUYAiABKAhIABITCglpbnRfdmFsdWUYAyABKANIABIWCgxkb3VibGVfdmFsdWUYBCABKAFIABIzCgthcnJheV92YWx1ZRgFIAEoCzIcLm51dHJpZW50Lm1ldHJpY3MuQXJyYXlWYWx1ZUgAEjYKDGt2bGlzdF92YWx1ZRgGIAEoCzIeLm51dHJpZW50Lm1ldHJpY3MuS2V5VmFsdWVMaXN0SAASFQoLYnl0ZXNfdmFsdWUYByABKAxIAEIHCgV2YWx1ZSI4CgpBcnJheVZhbHVlEioKBnZhbHVlcxgBIAMoCzIaLm51dHJpZW50Lm1ldHJpY3MuQW55VmFsdWUiQgoIS2V5VmFsdWUSCwoDa2V5GAEgASgJEikKBXZhbHVlGAIgASgLMhoubnV0cmllbnQubWV0cmljcy5BbnlWYWx1ZSI6CgxLZXlWYWx1ZUxpc3QSKgoGdmFsdWVzGAEgAygLMhoubnV0cmllbnQubWV0cmljcy5LZXlWYWx1ZUIYWhZpby5udXRyaWVudC5tZXRyaWNzL3BiYgZwcm90bzM"),pn=sn(cn,0),dn=sn(cn,2),fn=sn(cn,3);const bn=Kt("CgxjbGllbnQucHJvdG8SEG51dHJpZW50Lm1ldHJpY3MijwIKBkNsaWVudBI4CgtlbnZpcm9ubWVudBgBIAEoDjIjLm51dHJpZW50Lm1ldHJpY3MuQ2xpZW50RW52aXJvbm1lbnQSEgoKcHJvZHVjdF9pZBgCIAEoBhIXCg9wcm9kdWN0X3ZlcnNpb24YAyABKAkSFwoKbGljZW5zZV9pZBgEIAEoBkgAiAEBEhgKC2RlbW9fa2V5X2lkGAUgASgGSAGIAQESEAoDdGFnGAYgASgJSAKIAQESMgoKYXR0cmlidXRlcxgHIAEoCzIeLm51dHJpZW50Lm1ldHJpY3MuS2V5VmFsdWVMaXN0Qg0KC19saWNlbnNlX2lkQg4KDF9kZW1vX2tleV9pZEIGCgRfdGFnKk4KEUNsaWVudEVudmlyb25tZW50Eg4KCkVWQUxVQVRJT04QABIICgRERU1PEAESDwoLREVWRUxPUE1FTlQQAhIOCgpQUk9EVUNUSU9OEANCGFoWaW8ubnV0cmllbnQubWV0cmljcy9wYmIGcHJvdG8z",[cn]),gn=sn(bn,0),En=Kt("Cg1tZXRyaWNzLnByb3RvEhBudXRyaWVudC5tZXRyaWNzIiQKE01ldHJpY3NDb3VudGVyVmFsdWUSDQoFY291bnQYASABKAMiIgoQTWV0cmljc1NldFZhbHVlcxIOCgZ2YWx1ZXMYASADKAki7QEKEE1ldHJpY3NEYXRhUG9pbnQSFAoMdGltZV91bml4X21zGAEgASgGEgwKBG5hbWUYAiABKAkSPgoNY291bnRlcl92YWx1ZRgDIAEoCzIlLm51dHJpZW50Lm1ldHJpY3MuTWV0cmljc0NvdW50ZXJWYWx1ZUgAEjgKCnNldF92YWx1ZXMYBCABKAsyIi5udXRyaWVudC5tZXRyaWNzLk1ldHJpY3NTZXRWYWx1ZXNIABIyCgphdHRyaWJ1dGVzGAUgASgLMh4ubnV0cmllbnQubWV0cmljcy5LZXlWYWx1ZUxpc3RCBwoFdmFsdWVCGFoWaW8ubnV0cmllbnQubWV0cmljcy9wYmIGcHJvdG8z",[cn]),yn=sn(En,0),Nn=sn(En,1),Tn=sn(En,2);const In=Kt("Cg1zZXJ2aWNlLnByb3RvEhBudXRyaWVudC5tZXRyaWNzIpgBChtFeHBvcnRNZXRyaWNzU2VydmljZVJlcXVlc3QSKAoGY2xpZW50GAEgASgLMhgubnV0cmllbnQubWV0cmljcy5DbGllbnQSNwoLZGF0YV9wb2ludHMYAiADKAsyIi5udXRyaWVudC5tZXRyaWNzLk1ldHJpY3NEYXRhUG9pbnQSDwoCaWQYAyABKAlIAIgBAUIFCgNfaWQigQIKHEV4cG9ydE1ldHJpY3NTZXJ2aWNlUmVzcG9uc2USHQoVcHJvY2Vzc2VkX2RhdGFfcG9pbnRzGAEgASgDEhwKFHJlamVjdGVkX2RhdGFfcG9pbnRzGAIgASgDEjMKJmxhc3RfcHJvY2Vzc2VkX2RhdGFfcG9pbnRfdGltZV91bml4X21zGAMgASgGSACIAQESGgoNZXJyb3JfbWVzc2FnZRgEIAEoCUgBiAEBEg8KAmlkGAUgASgJSAKIAQFCKQonX2xhc3RfcHJvY2Vzc2VkX2RhdGFfcG9pbnRfdGltZV91bml4X21zQhAKDl9lcnJvcl9tZXNzYWdlQgUKA19pZEIYWhZpby5udXRyaWVudC5tZXRyaWNzL3BiYgZwcm90bzM",[En,bn]),hn=sn(In,0);async function _n(e,t){if(0===t.length)return null;const n=function(e){const t=e.map(e=>({metric:e,sortedAttributes:On(e.attributes)})),n=new Map;for(const{metric:e,sortedAttributes:r}of t){const t=r.map(e=>{let[t,n]=e;return`${t}=${n}`}).join(";"),a=`${e.name}|${t}|${e.timestamp}`;if(Sn(e)){const t=n.get(a);t&&"counter"===t.type?t.count+=1:n.set(a,{type:"counter",metric:e,count:1,sortedAttributes:r})}else if(An(e)){const t=n.get(a);t&&"unique"===t.type?t.values.add(e.value):n.set(a,{type:"unique",metric:e,values:new Set([e.value]),sortedAttributes:r})}}const r=[];for(const e of n.values())"counter"===e.type?r.push({...e.metric,count:e.count,sortedAttributes:e.sortedAttributes}):"unique"===e.type&&r.push({...e.metric,values:Array.from(e.values),sortedAttributes:e.sortedAttributes});return r}(t),r=[...n].sort((e,t)=>e.timestamp-t.timestamp),a=`${r[0].timestamp}-${function(){const e=new Uint8Array(4);return crypto.getRandomValues(e),Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}()}`,o=k(hn,{client:vn(e.clientInfo),dataPoints:r.map(e=>function(e){let t;if(Sn(e))t={case:"counterValue",value:k(yn,{count:BigInt(e.count??1)})};else if(An(e)){const n=e.values??[e.value];t={case:"setValues",value:k(Nn,{values:n})}}else t={case:void 0};const n=e.sortedAttributes??On(e.attributes),r=n.length>0?k(fn,{values:n.map(e=>{let[t,n]=e;return k(dn,{key:t,value:k(pn,{value:{case:"stringValue",value:n}})})})}):void 0;return k(Tn,{timeUnixMs:BigInt(e.timestamp),name:e.name,value:t,attributes:r})}(e))}),i=jt(hn,o),s=await async function(e,t){if("undefined"==typeof crypto||!crypto.subtle)throw new Error("Web Crypto API is not available.");try{const r=await crypto.subtle.importKey("raw",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),a=await crypto.subtle.sign("HMAC",r,t);return n=a,Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")}catch(e){throw new Error(`Failed to sign request with Web Crypto API: ${e}`)}var n}(e.hmacSecret,i);return{bucketId:a,headers:{"Content-Type":"application/protobuf","Nutrient-Metrics-Signature":`sha256=${s}`},body:i,requestId:`bucketId=${a}|signature=${s}`}}function vn(e){const t={};return void 0!==e.licenseId?t.licenseId=BigInt(e.licenseId):void 0!==e.demoKeyId?t.demoKeyId=BigInt(e.demoKeyId):t.tag=e.tag??Math.random().toString(36).substring(2,15),k(gn,{environment:e.environment,productId:BigInt(e.productId),productVersion:e.productVersion,...t})}function On(e){return Object.keys(e).sort().map(t=>[t,e[t]])}function Sn(e){return"counter"===e.type}function An(e){return"unique"===e.type}}}]);