@nutrient-sdk/node
Version:
Convert documents in your Node.js apps.
17 lines (15 loc) • 408 kB
JavaScript
/*!
* Nutrient for Node.js 1.3.0 (https://www.nutrient.io/nodejs)
*
* Copyright © 2024-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.
*
* Nutrient uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/nodejs-acknowledgements/
*/
var kc=Object.create;var no=Object.defineProperty;var Pc=Object.getOwnPropertyDescriptor;var Bc=Object.getOwnPropertyNames;var Lc=Object.getPrototypeOf,Vc=Object.prototype.hasOwnProperty;var Hs=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var h=(t,e)=>()=>(t&&(e=t(t=0)),e);var Mc=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),me=(t,e)=>{for(var n in e)no(t,n,{get:e[n],enumerable:!0})},Uc=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Bc(e))!Vc.call(t,o)&&o!==n&&no(t,o,{get:()=>e[o],enumerable:!(r=Pc(e,o))||r.enumerable});return t};var Mn=(t,e,n)=>(n=t!=null?kc(Lc(t)):{},Uc(e||!t||!t.__esModule?no(n,"default",{value:t,enumerable:!0}):n,t));var d,i=h(()=>{d={BUNDLE:"/vendor",BACKEND_BUILD:"true",GDPICTURE_HASH:"935f5ee62b7829a10574cea718090250ade8f886"}});var ea,q,ro=h(()=>{"use strict";i();ea=function t(e){let n;return e instanceof Error?n=e:n=new Error(e),Object.setPrototypeOf(n,t.prototype),n};ea.prototype=Object.create(Error.prototype,{name:{value:"PSPDFKitError",enumerable:!1}});q=ea});function b(t,e){if(!t)throw new q(`Assertion failed: ${e||"Condition not met"}
For further assistance, please go to: https://www.nutrient.io/support/request`)}var oo=h(()=>{"use strict";i();ro()});var ta=h(()=>{"use strict";i()});var na=h(()=>{"use strict";i()});var ra=h(()=>{"use strict";i()});var oa=h(()=>{"use strict";i()});var sa=h(()=>{"use strict";i()});function et(t){console.log(t)}var aa=h(()=>{"use strict";i()});var ia=h(()=>{"use strict";i()});var ua,Wc,la=h(()=>{"use strict";i();ua=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],Wc=ua.join(",")});var ca=h(()=>{"use strict";i()});var da=h(()=>{"use strict";i()});var ma=h(()=>{"use strict";i()});function Un(t){b(typeof t=="object"&&t!==null,"instantJSON must be an Object"),b(t.format==="https://pspdfkit.com/instant-json/v1","instantJSON has an invalid format, please use 'https://pspdfkit.com/instant-json/v1");let{pdfId:e}=t;e&&b(typeof e=="object"&&e!==null&&(typeof e.permanent=="string"&&typeof e.changing=="string"||typeof e.permanent!="string"&&typeof e.changing!="string"),"instantJSON has an invalid pdfId"),b(typeof t.skippedPdfObjectIds>"u"||Array.isArray(t.skippedPdfObjectIds),"instantJSON has invalid skippedPdfObjectIds"),b(typeof t.annotations>"u"||Array.isArray(t.annotations)&&t.annotations.every(n=>typeof n=="object"&&n!==null),"instantJSON has invalid annotations"),b(typeof t.formFieldValues>"u"||Array.isArray(t.formFieldValues)&&t.formFieldValues.every(n=>typeof n=="object"&&n!==null),"instantJSON has invalid form field values"),b(typeof t.skippedPdfBookmarkIds>"u"||Array.isArray(t.skippedPdfBookmarkIds),"instantJSON has invalid skippedPdfBookmarkIds"),b(typeof t.bookmarks>"u"||Array.isArray(t.bookmarks)&&t.bookmarks.every(n=>typeof n=="object"&&n!==null),"instantJSON has invalid bookmarks")}function Gn(t){let e={};return Object.keys(t).forEach(n=>{Array.isArray(t[n])?e[n]=t[n].filter(Boolean):typeof t[n]=="object"&&t[n]!==null?e[n]=Gn(t[n]):e[n]=t[n]}),e}var pa=h(()=>{"use strict";i();oo()});var fa=h(()=>{"use strict";i()});var ga=h(()=>{"use strict";i()});var ha=h(()=>{"use strict";i()});var Wn,so=h(()=>{"use strict";i();Wn=">=1.4"});var H=h(()=>{"use strict";i();oo();ro();ta();na();ra();oa();sa();aa();ia();la();ca();da();ma();pa();fa();ga();ha();so()});function wa(t,e=0){return(re[t[e+0]]+re[t[e+1]]+re[t[e+2]]+re[t[e+3]]+"-"+re[t[e+4]]+re[t[e+5]]+"-"+re[t[e+6]]+re[t[e+7]]+"-"+re[t[e+8]]+re[t[e+9]]+"-"+re[t[e+10]]+re[t[e+11]]+re[t[e+12]]+re[t[e+13]]+re[t[e+14]]+re[t[e+15]]).toLowerCase()}var re,xa=h(()=>{i();re=[];for(let t=0;t<256;++t)re.push((t+256).toString(16).slice(1))});import{randomFillSync as $c}from"crypto";function co(){return Jn>jn.length-16&&($c(jn),Jn=0),jn.slice(Jn,Jn+=16)}var jn,Jn,Ta=h(()=>{i();jn=new Uint8Array(256),Jn=jn.length});import{randomUUID as Yc}from"crypto";var mo,Oa=h(()=>{i();mo={randomUUID:Yc}});function zc(t,e,n){if(mo.randomUUID&&!e&&!t)return mo.randomUUID();t=t||{};let r=t.random??t.rng?.()??co();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[n+o]=r[o];return e}return wa(r)}var Ze,Ra=h(()=>{i();Oa();Ta();xa();Ze=zc});var tn=h(()=>{i();Ra()});async function Fa(t){try{let e=await fetch(t).catch(n=>{throw new q(`Error fetching dynamic fonts file ${t}. ${n}`)});if(e.status!==200)throw new q(`Error fetching dynamic fonts file ${t}. Status code: ${e.status}`);return e}catch(e){throw e}}async function Da(t){return(await Fa(t)).json().catch(n=>{throw new q(`Error parsing dynamic fonts file ${t}. ${n}`)})}var po=h(()=>{"use strict";i();H()});var rn=Mc((zn,Ua)=>{i();(function(t,e){typeof zn=="object"&&typeof Ua<"u"?e(zn):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.Comlink={}))})(zn,(function(t){"use strict";let e=Symbol("Comlink.proxy"),n=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),o=Symbol("Comlink.finalizer"),s=Symbol("Comlink.thrown"),a=y=>typeof y=="object"&&y!==null||typeof y=="function",u={canHandle:y=>a(y)&&y[e],serialize(y){let{port1:O,port2:B}=new MessageChannel;return f(y,O),[B,[B]]},deserialize(y){return y.start(),C(y)}},l={canHandle:y=>a(y)&&s in y,serialize({value:y}){let O;return y instanceof Error?O={isError:!0,value:{message:y.message,name:y.name,stack:y.stack}}:O={isError:!1,value:y},[O,[]]},deserialize(y){throw y.isError?Object.assign(new Error(y.value.message),y.value):y.value}},c=new Map([["proxy",u],["throw",l]]);function p(y,O){for(let B of y)if(O===B||B==="*"||B instanceof RegExp&&B.test(O))return!0;return!1}function f(y,O=globalThis,B=["*"]){O.addEventListener("message",function Pe(Y){if(!Y||!Y.data)return;if(!p(B,Y.origin)){console.warn(`Invalid origin '${Y.origin}' for comlink proxy`);return}let{id:ie,type:je,path:Ee}=Object.assign({path:[]},Y.data),Ne=(Y.data.argumentList||[]).map(it),ne;try{let le=Ee.slice(0,-1).reduce((de,en)=>de[en],y),we=Ee.reduce((de,en)=>de[en],y);switch(je){case"GET":ne=we;break;case"SET":le[Ee.slice(-1)[0]]=it(Y.data.value),ne=!0;break;case"APPLY":ne=we.apply(le,Ne);break;case"CONSTRUCT":{let de=new we(...Ne);ne=qs(de)}break;case"ENDPOINT":{let{port1:de,port2:en}=new MessageChannel;f(y,en),ne=Qs(de,[de])}break;case"RELEASE":ne=void 0;break;default:return}}catch(le){ne={value:le,[s]:0}}Promise.resolve(ne).catch(le=>({value:le,[s]:0})).then(le=>{let[we,de]=Vn(le);O.postMessage(Object.assign(Object.assign({},we),{id:ie}),de),je==="RELEASE"&&(O.removeEventListener("message",Pe),N(O),o in y&&typeof y[o]=="function"&&y[o]())}).catch(le=>{let[we,de]=Vn({value:new TypeError("Unserializable return value"),[s]:0});O.postMessage(Object.assign(Object.assign({},we),{id:ie}),de)})}),O.start&&O.start()}function _(y){return y.constructor.name==="MessagePort"}function N(y){_(y)&&y.close()}function C(y,O){let B=new Map;return y.addEventListener("message",function(Y){let{data:ie}=Y;if(!ie||!ie.id)return;let je=B.get(ie.id);if(je)try{je(ie)}finally{B.delete(ie.id)}}),at(y,B,[],O)}function A(y){if(y)throw new Error("Proxy has been released and is not useable")}function $(y){return Ct(y,new Map,{type:"RELEASE"}).then(()=>{N(y)})}let ae=new WeakMap,te="FinalizationRegistry"in globalThis&&new FinalizationRegistry(y=>{let O=(ae.get(y)||0)-1;ae.set(y,O),O===0&&$(y)});function He(y,O){let B=(ae.get(O)||0)+1;ae.set(O,B),te&&te.register(y,O,y)}function Je(y){te&&te.unregister(y)}function at(y,O,B=[],Pe=function(){}){let Y=!1,ie=new Proxy(Pe,{get(je,Ee){if(A(Y),Ee===r)return()=>{Je(ie),$(y),O.clear(),Y=!0};if(Ee==="then"){if(B.length===0)return{then:()=>ie};let Ne=Ct(y,O,{type:"GET",path:B.map(ne=>ne.toString())}).then(it);return Ne.then.bind(Ne)}return at(y,O,[...B,Ee])},set(je,Ee,Ne){A(Y);let[ne,le]=Vn(Ne);return Ct(y,O,{type:"SET",path:[...B,Ee].map(we=>we.toString()),value:ne},le).then(it)},apply(je,Ee,Ne){A(Y);let ne=B[B.length-1];if(ne===n)return Ct(y,O,{type:"ENDPOINT"}).then(it);if(ne==="bind")return at(y,O,B.slice(0,-1));let[le,we]=Ks(Ne);return Ct(y,O,{type:"APPLY",path:B.map(de=>de.toString()),argumentList:le},we).then(it)},construct(je,Ee){A(Y);let[Ne,ne]=Ks(Ee);return Ct(y,O,{type:"CONSTRUCT",path:B.map(le=>le.toString()),argumentList:Ne},ne).then(it)}});return He(ie,y),ie}function Fc(y){return Array.prototype.concat.apply([],y)}function Ks(y){let O=y.map(Vn);return[O.map(B=>B[0]),Fc(O.map(B=>B[1]))]}let Xs=new WeakMap;function Qs(y,O){return Xs.set(y,O),y}function qs(y){return Object.assign(y,{[e]:!0})}function Dc(y,O=globalThis,B="*"){return{postMessage:(Pe,Y)=>y.postMessage(Pe,B,Y),addEventListener:O.addEventListener.bind(O),removeEventListener:O.removeEventListener.bind(O)}}function Vn(y){for(let[O,B]of c)if(B.canHandle(y)){let[Pe,Y]=B.serialize(y);return[{type:"HANDLER",name:O,value:Pe},Y]}return[{type:"RAW",value:y},Xs.get(y)||[]]}function it(y){switch(y.type){case"HANDLER":return c.get(y.name).deserialize(y.value);case"RAW":return y.value}}function Ct(y,O,B,Pe){return new Promise(Y=>{let ie=Cc();O.set(ie,Y),y.start&&y.start(),y.postMessage(Object.assign({id:ie},B),Pe)})}function Cc(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}t.createEndpoint=n,t.expose=f,t.finalizer=o,t.proxy=qs,t.proxyMarker=e,t.releaseProxy=r,t.transfer=Qs,t.transferHandlers=c,t.windowEndpoint=Dc,t.wrap=C}))});var Ha=h(()=>{i()});function un(t,e){return t!==null&&typeof t=="object"&&"$typeName"in t&&typeof t.$typeName=="string"?e===void 0?!0:e.typeName===t.$typeName:!1}var er=h(()=>{i()});var m,Me=h(()=>{i();(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(m||(m={}))});function ti(){let t=0,e=0;for(let r=0;r<28;r+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<r,(o&128)==0)return this.assertBounds(),[t,e]}let n=this.buf[this.pos++];if(t|=(n&15)<<28,e=(n&112)>>4,(n&128)==0)return this.assertBounds(),[t,e];for(let r=3;r<=31;r+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<r,(o&128)==0)return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function nr(t,e,n){for(let s=0;s<28;s=s+7){let a=t>>>s,u=!(!(a>>>7)&&e==0),l=(u?a|128:a)&255;if(n.push(l),!u)return}let r=t>>>28&15|(e&7)<<4,o=e>>3!=0;if(n.push((o?r|128:r)&255),!!o){for(let s=3;s<31;s=s+7){let a=e>>>s,u=!!(a>>>7),l=(u?a|128:a)&255;if(n.push(l),!u)return}n.push(e>>>31&1)}}function _o(t){let e=t[0]==="-";e&&(t=t.slice(1));let n=1e6,r=0,o=0;function s(a,u){let l=Number(t.slice(a,u));o*=n,r=r*n+l,r>=tr&&(o=o+(r/tr|0),r=r%tr)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?ri(r,o):vo(r,o)}function ni(t,e){let n=vo(t,e),r=n.hi&2147483648;r&&(n=ri(n.lo,n.hi));let o=Io(n.lo,n.hi);return r?"-"+o:o}function Io(t,e){if({lo:t,hi:e}=Am(t,e),e<=2097151)return String(tr*e+t);let n=t&16777215,r=(t>>>24|e<<8)&16777215,o=e>>16&65535,s=n+r*6777216+o*6710656,a=r+o*8147497,u=o*2,l=1e7;return s>=l&&(a+=Math.floor(s/l),s%=l),a>=l&&(u+=Math.floor(a/l),a%=l),u.toString()+ei(a)+ei(s)}function Am(t,e){return{lo:t>>>0,hi:e>>>0}}function vo(t,e){return{lo:t|0,hi:e|0}}function ri(t,e){return e=~e,t?t=~t+1:e+=1,vo(t,e)}function ln(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function oi(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;(t&128)!==0&&n<10;n++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var tr,ei,rr=h(()=>{i();tr=4294967296;ei=t=>{let e=String(t);return"0000000".slice(e.length)+e}});function Nm(){let t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let n=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),o=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let u=typeof a=="bigint"?a:BigInt(a);if(u>r||u<n)throw new Error(`invalid int64: ${a}`);return u},uParse(a){let u=typeof a=="bigint"?a:BigInt(a);if(u>s||u<o)throw new Error(`invalid uint64: ${a}`);return u},enc(a){return t.setBigInt64(0,this.parse(a),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(a){return t.setBigInt64(0,this.uParse(a),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(a,u){return t.setInt32(0,a,!0),t.setInt32(4,u,!0),t.getBigInt64(0,!0)},uDec(a,u){return t.setInt32(0,a,!0),t.setInt32(4,u,!0),t.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(n){return typeof n!="string"&&(n=n.toString()),si(n),n},uParse(n){return typeof n!="string"&&(n=n.toString()),ai(n),n},enc(n){return typeof n!="string"&&(n=n.toString()),si(n),_o(n)},uEnc(n){return typeof n!="string"&&(n=n.toString()),ai(n),_o(n)},dec(n,r){return ni(n,r)},uDec(n,r){return Io(n,r)}}}function si(t){if(!/^-?[0-9]+$/.test(t))throw new Error("invalid int64: "+t)}function ai(t){if(!/^[0-9]+$/.test(t))throw new Error("invalid uint64: "+t)}var U,Nt=h(()=>{i();rr();U=Nm()});function Xe(t,e){switch(t){case m.STRING:return"";case m.BOOL:return!1;case m.DOUBLE:case m.FLOAT:return 0;case m.INT64:case m.UINT64:case m.SFIXED64:case m.FIXED64:case m.SINT64:return e?"0":U.zero;case m.BYTES:return new Uint8Array(0);default:return 0}}function ii(t,e){switch(t){case m.BOOL:return e===!1;case m.STRING:return e==="";case m.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var cn=h(()=>{i();Nt();Me()});function or(t,e){let n=t[e.localName].case;return n===void 0?n:e.fields.find(r=>r.localName===n)}function li(t,e){let n=e.localName;if(e.oneof)return t[e.oneof.localName].case===n;if(e.presence!=ui)return t[n]!==void 0&&Object.prototype.hasOwnProperty.call(t,n);switch(e.fieldKind){case"list":return t[n].length>0;case"map":return Object.keys(t[n]).length>0;case"scalar":return!ii(e.scalar,t[n]);case"enum":return t[n]!==e.enum.values[0].number}throw new Error("message field with implicit presence")}function wt(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==void 0}function sr(t,e){if(e.oneof){let n=t[e.oneof.localName];return n.case===e.localName?n.value:void 0}return t[e.localName]}function ar(t,e,n){e.oneof?t[e.oneof.localName]={case:e.localName,value:n}:t[e.localName]=n}function ci(t,e){let n=e.localName;if(e.oneof){let r=e.oneof.localName;t[r].case===n&&(t[r]={case:void 0})}else if(e.presence!=ui)delete t[n];else switch(e.fieldKind){case"map":t[n]={};break;case"list":t[n]=[];break;case"enum":t[n]=e.enum.values[0].number;break;case"scalar":t[n]=Xe(e.scalar,e.longAsString);break}}var ui,Te,Jt=h(()=>{i();cn();ui=2,Te=Symbol.for("reflect unsafe local")});function Ue(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function dn(t,e){var n,r,o,s;if(Ue(t)&&Te in t&&"add"in t&&"field"in t&&typeof t.field=="function"){if(e!==void 0){let a=e,u=t.field();return a.listKind==u.listKind&&a.scalar===u.scalar&&((n=a.message)===null||n===void 0?void 0:n.typeName)===((r=u.message)===null||r===void 0?void 0:r.typeName)&&((o=a.enum)===null||o===void 0?void 0:o.typeName)===((s=u.enum)===null||s===void 0?void 0:s.typeName)}return!0}return!1}function mn(t,e){var n,r,o,s;if(Ue(t)&&Te in t&&"has"in t&&"field"in t&&typeof t.field=="function"){if(e!==void 0){let a=e,u=t.field();return a.mapKey===u.mapKey&&a.mapKind==u.mapKind&&a.scalar===u.scalar&&((n=a.message)===null||n===void 0?void 0:n.typeName)===((r=u.message)===null||r===void 0?void 0:r.typeName)&&((o=a.enum)===null||o===void 0?void 0:o.typeName)===((s=u.enum)===null||s===void 0?void 0:s.typeName)}return!0}return!1}function pn(t,e){return Ue(t)&&Te in t&&"desc"in t&&Ue(t.desc)&&t.desc.kind==="message"&&(e===void 0||t.desc.typeName==e.typeName)}var ir=h(()=>{i();Jt()});function di(t){return mi(t.$typeName)}function ur(t){let e=t.fields[0];return mi(t.typeName)&&e!==void 0&&e.fieldKind=="scalar"&&e.name=="value"&&e.number==1}function mi(t){return t.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(t.substring(16))}var Ao=h(()=>{i()});function k(t,e){if(un(e,t))return e;let n=Dm(t);return e!==void 0&&Tm(t,n,e),n}function Tm(t,e,n){for(let r of t.members){let o=n[r.localName];if(o==null)continue;let s;if(r.kind=="oneof"){let a=or(n,r);if(!a)continue;s=a,o=sr(n,a)}else s=r;switch(s.fieldKind){case"message":o=wo(s,o);break;case"scalar":o=gi(s,o);break;case"list":o=Rm(s,o);break;case"map":o=Om(s,o);break}ar(e,s,o)}return e}function gi(t,e){return t.scalar==m.BYTES?xo(e):e}function Om(t,e){if(Ue(e)){if(t.scalar==m.BYTES)return pi(e,xo);if(t.mapKind=="message")return pi(e,n=>wo(t,n))}return e}function Rm(t,e){if(Array.isArray(e)){if(t.scalar==m.BYTES)return e.map(xo);if(t.listKind=="message")return e.map(n=>wo(t,n))}return e}function wo(t,e){if(t.fieldKind=="message"&&!t.oneof&&ur(t.message))return gi(t.message.fields[0],e);if(Ue(e)){if(t.message.typeName=="google.protobuf.Struct"&&t.parent.typeName!=="google.protobuf.Value")return e;if(!un(e,t.message))return k(t.message,e)}return e}function xo(t){return Array.isArray(t)?new Uint8Array(t):t}function pi(t,e){let n={};for(let r of Object.entries(t))n[r[0]]=e(r[1]);return n}function Dm(t){let e;if(Cm(t)){let n=fi.get(t),r,o;if(n)({prototype:r,members:o}=n);else{r={},o=new Set;for(let s of t.members)s.kind!="oneof"&&(s.fieldKind!="scalar"&&s.fieldKind!="enum"||s.presence!=lr&&(o.add(s),r[s.localName]=No(s)));fi.set(t,{prototype:r,members:o})}e=Object.create(r),e.$typeName=t.typeName;for(let s of t.members)o.has(s)||s.kind=="field"&&(s.fieldKind=="message"||(s.fieldKind=="scalar"||s.fieldKind=="enum")&&s.presence!=lr)||(e[s.localName]=No(s))}else{e={$typeName:t.typeName};for(let n of t.members)(n.kind=="oneof"||n.presence==lr)&&(e[n.localName]=No(n))}return e}function Cm(t){switch(t.file.edition){case wm:return!1;case xm:return!0;default:return t.fields.some(e=>e.presence!=lr&&e.fieldKind!="message"&&!e.oneof)}}function No(t){if(t.kind=="oneof")return{case:void 0};if(t.fieldKind=="list")return[];if(t.fieldKind=="map")return{};if(t.fieldKind=="message")return Fm;let e=t.getDefaultValue();return e!==void 0?t.fieldKind=="scalar"&&t.longAsString?e.toString():e:t.fieldKind=="scalar"?Xe(t.scalar,t.longAsString):t.enum.values[0].number}var wm,xm,lr,Fm,fi,To=h(()=>{i();er();Me();cn();ir();Jt();Ao();wm=999,xm=998,lr=2;Fm=Symbol(),fi=new WeakMap});var Ge,Oo=h(()=>{i();Ge=class extends Error{constructor(e,n,r="FieldValueInvalidError"){super(n),this.name=r,this.field=()=>e}}});function fn(){if(globalThis[Ro]==null){let t=new globalThis.TextEncoder,e=new globalThis.TextDecoder;globalThis[Ro]={encodeUtf8(n){return t.encode(n)},decodeUtf8(n){return e.decode(n)},checkUtf8(n){try{return encodeURIComponent(n),!0}catch{return!1}}}}return globalThis[Ro]}var Ro,Fo=h(()=>{i();Ro=Symbol.for("@bufbuild/protobuf/text-encoding")});function Do(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>Bo||t<Lo)throw new Error("invalid int32: "+t)}function hi(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid uint32: "+typeof t);if(!Number.isInteger(t)||t>Po||t<0)throw new Error("invalid uint32: "+t)}function km(t){if(typeof t=="string"){let e=t;if(t=Number(t),Number.isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>Co||t<ko))throw new Error("invalid float32: "+t)}var J,Co,ko,Po,Bo,Lo,cr,dr,mr=h(()=>{i();rr();Nt();Fo();(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(J||(J={}));Co=34028234663852886e22,ko=-34028234663852886e22,Po=4294967295,Bo=2147483647,Lo=-2147483648,cr=class{constructor(e=fn().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 o=0;o<this.chunks.length;o++)e+=this.chunks[o].length;let n=new Uint8Array(e),r=0;for(let o=0;o<this.chunks.length;o++)n.set(this.chunks[o],r),r+=this.chunks[o].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(hi(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Do(e),ln(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 n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){km(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){hi(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){Do(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return Do(e),e=(e<<1^e>>31)>>>0,ln(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),o=U.enc(e);return r.setInt32(0,o.lo,!0),r.setInt32(4,o.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),o=U.uEnc(e);return r.setInt32(0,o.lo,!0),r.setInt32(4,o.hi,!0),this.raw(n)}int64(e){let n=U.enc(e);return nr(n.lo,n.hi,this.buf),this}sint64(e){let n=U.enc(e),r=n.hi>>31,o=n.lo<<1^r,s=(n.hi<<1|n.lo>>>31)^r;return nr(o,s,this.buf),this}uint64(e){let n=U.uEnc(e);return nr(n.lo,n.hi,this.buf),this}},dr=class{constructor(e,n=fn().decodeUtf8){this.decodeUtf8=n,this.varint64=ti,this.uint32=oi,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(),n=e>>>3,r=e&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(e,n){let r=this.pos;switch(e){case J.Varint:for(;this.buf[this.pos++]&128;);break;case J.Bit64:this.pos+=4;case J.Bit32:this.pos+=4;break;case J.LengthDelimited:let o=this.uint32();this.pos+=o;break;case J.StartGroup:for(;;){let[s,a]=this.tag();if(a===J.EndGroup){if(n!==void 0&&s!==n)throw new Error("invalid end group tag");break}this.skip(a,s)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return U.dec(...this.varint64())}uint64(){return U.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),r=-(e&1);return e=(e>>>1|(n&1)<<31)^r,n=n>>>1^r,U.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return U.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return U.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(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.decodeUtf8(this.bytes())}}});function yi(t,e){let n=t.fieldKind=="list"?dn(e,t):t.fieldKind=="map"?mn(e,t):Mo(t,e);if(n===!0)return;let r;switch(t.fieldKind){case"list":r=`expected ${_i(t)}, got ${fr(e)}`;break;case"map":r=`expected ${Ii(t)}, got ${fr(e)}`;break;default:r=pr(t,e,n)}return new Ge(t,r)}function Vo(t,e,n){let r=Mo(t,n);if(r!==!0)return new Ge(t,`list item #${e+1}: ${pr(t,n,r)}`)}function bi(t,e,n){let r=Ei(e,t.mapKey);if(r!==!0)return new Ge(t,`invalid map key: ${pr({scalar:t.mapKey},e,r)}`);let o=Mo(t,n);if(o!==!0)return new Ge(t,`map entry ${fr(e)}: ${pr(t,n,o)}`)}function Mo(t,e){return t.scalar!==void 0?Ei(e,t.scalar):t.enum!==void 0?t.enum.open?Number.isInteger(e):t.enum.values.some(n=>n.number===e):pn(e,t.message)}function Ei(t,e){switch(e){case m.DOUBLE:return typeof t=="number";case m.FLOAT:return typeof t!="number"?!1:Number.isNaN(t)||!Number.isFinite(t)?!0:t>Co||t<ko?`${t.toFixed()} out of range`:!0;case m.INT32:case m.SFIXED32:case m.SINT32:return typeof t!="number"||!Number.isInteger(t)?!1:t>Bo||t<Lo?`${t.toFixed()} out of range`:!0;case m.FIXED32:case m.UINT32:return typeof t!="number"||!Number.isInteger(t)?!1:t>Po||t<0?`${t.toFixed()} out of range`:!0;case m.BOOL:return typeof t=="boolean";case m.STRING:return typeof t!="string"?!1:fn().checkUtf8(t)||"invalid UTF8";case m.BYTES:return t instanceof Uint8Array;case m.INT64:case m.SFIXED64:case m.SINT64:if(typeof t=="bigint"||typeof t=="number"||typeof t=="string"&&t.length>0)try{return U.parse(t),!0}catch{return`${t} out of range`}return!1;case m.FIXED64:case m.UINT64:if(typeof t=="bigint"||typeof t=="number"||typeof t=="string"&&t.length>0)try{return U.uParse(t),!0}catch{return`${t} out of range`}return!1}}function pr(t,e,n){return n=typeof n=="string"?`: ${n}`:`, got ${fr(e)}`,t.scalar!==void 0?`expected ${Pm(t.scalar)}`+n:t.enum!==void 0?`expected ${t.enum.toString()}`+n:`expected ${Si(t.message)}`+n}function fr(t){switch(typeof t){case"object":return t===null?"null":t instanceof Uint8Array?`Uint8Array(${t.length})`:Array.isArray(t)?`Array(${t.length})`:dn(t)?_i(t.field()):mn(t)?Ii(t.field()):pn(t)?Si(t.desc):un(t)?`message ${t.$typeName}`:"object";case"string":return t.length>30?"string":`"${t.split('"').join('\\"')}"`;case"boolean":return String(t);case"number":return String(t);case"bigint":return String(t)+"n";default:return typeof t}}function Si(t){return`ReflectMessage (${t.typeName})`}function _i(t){switch(t.listKind){case"message":return`ReflectList (${t.message.toString()})`;case"enum":return`ReflectList (${t.enum.toString()})`;case"scalar":return`ReflectList (${m[t.scalar]})`}}function Ii(t){switch(t.mapKind){case"message":return`ReflectMap (${m[t.mapKey]}, ${t.message.toString()})`;case"enum":return`ReflectMap (${m[t.mapKey]}, ${t.enum.toString()})`;case"scalar":return`ReflectMap (${m[t.mapKey]}, ${m[t.scalar]})`}}function Pm(t){switch(t){case m.STRING:return"string";case m.BOOL:return"boolean";case m.INT64:case m.SINT64:case m.SFIXED64:return"bigint (int64)";case m.UINT64:case m.FIXED64:return"bigint (uint64)";case m.BYTES:return"Uint8Array";case m.DOUBLE:return"number (float64)";case m.FLOAT:return"number (float32)";case m.FIXED32:case m.UINT32:return"number (uint32)";case m.INT32:case m.SFIXED32:case m.SINT32:return"number (int32)"}}var vi=h(()=>{i();Me();er();Oo();ir();mr();Fo();Nt()});function jt(t,e,n=!0){return new hr(t,e,n)}function gn(t,e){if(e.parent.typeName!==t.$typeName)throw new Ge(e,`cannot use ${e.toString()} with message ${t.$typeName}`,"ForeignFieldError")}function jo(t,e){return pn(e)?di(e.message)&&!t.oneof&&t.fieldKind=="message"?e.message.value:e.desc.typeName=="google.protobuf.Struct"&&t.parent.typeName!="google.protobuf.Value"?Ti(e.message):e.message:e}function Zo(t,e,n){return e!==void 0&&(ur(t.message)&&!t.oneof&&t.fieldKind=="message"?e={$typeName:t.message.typeName,value:$o(t.message.fields[0],e)}:t.message.typeName=="google.protobuf.Struct"&&t.parent.typeName!="google.protobuf.Value"&&Ue(e)&&(e=xi(e))),new hr(t.message,e,n)}function Ni(t,e){return t.listKind=="message"?jo(t,e):Yo(t,e)}function Uo(t,e,n){return t.listKind=="message"?Zo(t,e,n):$o(t,e)}function Bm(t,e){return t.mapKind=="message"?jo(t,e):Yo(t,e)}function Go(t,e,n){return t.mapKind=="message"?Zo(t,e,n):e}function gr(t){return typeof t=="string"||typeof t=="number"?t:String(t)}function wi(t,e){switch(e){case m.STRING:return t;case m.INT32:case m.FIXED32:case m.UINT32:case m.SFIXED32:case m.SINT32:{let n=Number.parseInt(t);if(Number.isFinite(n))return n;break}case m.BOOL:switch(t){case"true":return!0;case"false":return!1}break;case m.UINT64:case m.FIXED64:try{return U.uParse(t)}catch{}break;default:try{return U.parse(t)}catch{}break}return t}function $o(t,e){switch(t.scalar){case m.INT64:case m.SFIXED64:case m.SINT64:"longAsString"in t&&t.longAsString&&typeof e=="string"&&(e=U.parse(e));break;case m.FIXED64:case m.UINT64:"longAsString"in t&&t.longAsString&&typeof e=="string"&&(e=U.uParse(e));break}return e}function Yo(t,e){switch(t.scalar){case m.INT64:case m.SFIXED64:case m.SINT64:"longAsString"in t&&t.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=U.parse(e));break;case m.FIXED64:case m.UINT64:"longAsString"in t&&t.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=U.uParse(e));break}return e}function xi(t){let e={$typeName:"google.protobuf.Struct",fields:{}};if(Ue(t))for(let[n,r]of Object.entries(t))e.fields[n]=Ri(r);return e}function Ti(t){let e={};for(let[n,r]of Object.entries(t.fields))e[n]=Oi(r);return e}function Oi(t){switch(t.kind.case){case"structValue":return Ti(t.kind.value);case"listValue":return t.kind.value.values.map(Oi);case"nullValue":case void 0:return null;default:return t.kind.value}}function Ri(t){let e={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:0};else if(Array.isArray(t)){let n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(t))for(let r of t)n.values.push(Ri(r));e.kind={case:"listValue",value:n}}else e.kind={case:"structValue",value:xi(t)};break}return e}var Ai,hr,Wo,Jo,zo=h(()=>{i();Me();vi();Oo();Jt();To();Ao();cn();Nt();ir();Ai=new WeakMap,hr=class{get sortedFields(){let e=Ai.get(this.desc);if(e)return e;let n=this.desc.fields.concat().sort((r,o)=>r.number-o.number);return Ai.set(this.desc,n),n}constructor(e,n,r=!0){this.lists=new Map,this.maps=new Map,this.check=r,this.desc=e,this.message=this[Te]=n??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(n=>[n.number,n]))),this._fieldsByNumber.get(e)}oneofCase(e){return gn(this.message,e),or(this.message,e)}isSet(e){return gn(this.message,e),li(this.message,e)}clear(e){gn(this.message,e),ci(this.message,e)}get(e){gn(this.message,e);let n=sr(this.message,e);switch(e.fieldKind){case"list":let r=this.lists.get(e);return(!r||r[Te]!==n)&&this.lists.set(e,r=new Wo(e,n,this.check)),r;case"map":let o=this.maps.get(e);return(!o||o[Te]!==n)&&this.maps.set(e,o=new Jo(e,n,this.check)),o;case"message":return Zo(e,n,this.check);case"scalar":return n===void 0?Xe(e.scalar,!1):$o(e,n);case"enum":return n??e.enum.values[0].number}}set(e,n){if(gn(this.message,e),this.check){let o=yi(e,n);if(o)throw o}let r;e.fieldKind=="message"?r=jo(e,n):mn(n)||dn(n)?r=n[Te]:r=Yo(e,n),ar(this.message,e,r)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}};Wo=class{field(){return this._field}get size(){return this._arr.length}constructor(e,n,r){this._field=e,this._arr=this[Te]=n,this.check=r}get(e){let n=this._arr[e];return n===void 0?void 0:Uo(this._field,n,this.check)}set(e,n){if(e<0||e>=this._arr.length)throw new Ge(this._field,`list item #${e+1}: out of range`);if(this.check){let r=Vo(this._field,e,n);if(r)throw r}this._arr[e]=Ni(this._field,n)}add(e){if(this.check){let n=Vo(this._field,this._arr.length,e);if(n)throw n}this._arr.push(Ni(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(let e of this._arr)yield Uo(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,Uo(this._field,this._arr[e],this.check)]}},Jo=class{constructor(e,n,r=!0){this.obj=this[Te]=n??{},this.check=r,this._field=e}field(){return this._field}set(e,n){if(this.check){let r=bi(this._field,e,n);if(r)throw r}return this.obj[gr(e)]=Bm(this._field,n),this}delete(e){let n=gr(e),r=Object.prototype.hasOwnProperty.call(this.obj,n);return r&&delete this.obj[n],r}clear(){for(let e of Object.keys(this.obj))delete this.obj[e]}get(e){let n=this.obj[gr(e)];return n!==void 0&&(n=Go(this._field,n,this.check)),n}has(e){return Object.prototype.hasOwnProperty.call(this.obj,gr(e))}*keys(){for(let e of Object.keys(this.obj))yield wi(e,this._field.mapKey)}*entries(){for(let e of Object.entries(this.obj))yield[wi(e[0],this._field.mapKey),Go(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(let e of Object.values(this.obj))yield Go(this._field,e,this.check)}forEach(e,n){for(let r of this.entries())e.call(n,r[1],r[0],this)}}});var Fi=h(()=>{i()});function Ci(t){let e=Vm(),n=t.length*3/4;t[t.length-2]=="="?n-=2:t[t.length-1]=="="&&(n-=1);let r=new Uint8Array(n),o=0,s=0,a,u=0;for(let l=0;l<t.length;l++){if(a=e[t.charCodeAt(l)],a===void 0)switch(t[l]){case"=":s=0;case`
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(s){case 0:u=a,s=1;break;case 1:r[o++]=u<<2|(a&48)>>4,u=a,s=2;break;case 2:r[o++]=(u&15)<<4|(a&60)>>2,u=a,s=3;break;case 3:r[o++]=(u&3)<<6|a,s=0;break}}if(s==1)throw Error("invalid base64 string");return r.subarray(0,o)}function Lm(t){return yr||(yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Di=yr.slice(0,-2).concat("-","_")),t=="url"?Di:yr}function Vm(){if(!Zt){Zt=[];let t=Lm("std");for(let e=0;e<t.length;e++)Zt[t[e].charCodeAt(0)]=e;Zt[45]=t.indexOf("+"),Zt[95]=t.indexOf("/")}return Zt}var yr,Di,Zt,ki=h(()=>{i()});function $t(t){let e=!1,n=[];for(let r=0;r<t.length;r++){let o=t.charAt(r);switch(o){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(o),e=!1;break;default:e&&(e=!1,o=o.toUpperCase()),n.push(o);break}}return n.join("")}function Yt(t){return Mm.has(t)?t+"$":t}var Mm,Ko=h(()=>{i();Mm=new Set(["constructor","toString","toJSON","valueOf"])});function hn(t){for(let e of t.field)wt(e,"jsonName")||(e.jsonName=$t(e.name));t.nestedType.forEach(hn)}var Xo=h(()=>{i();Ko();Jt()});function Pi(t,e){let n=t.values.find(r=>r.name===e);if(!n)throw new Error(`cannot parse ${t} default value: ${e}`);return n.number}function Bi(t,e){switch(t){case m.STRING:return e;case m.BYTES:{let n=Um(e);if(n===!1)throw new Error(`cannot parse ${m[t]} default value: ${e}`);return n}case m.INT64:case m.SFIXED64:case m.SINT64:return U.parse(e);case m.UINT64:case m.FIXED64:return U.uParse(e);case m.DOUBLE:case m.FLOAT:switch(e){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(e)}case m.BOOL:return e==="true";case m.INT32:case m.UINT32:case m.SINT32:case m.FIXED32:case m.SFIXED32:return parseInt(e,10)}}function Um(t){let e=[],n={tail:t,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(r){if(this.tail.length>=r){let o=this.tail.substring(0,r);return this.tail=this.tail.substring(r),o}return!1}};for(;n.next();)switch(n.c){case"\\":if(n.next())switch(n.c){case"\\":e.push(n.c.charCodeAt(0));break;case"b":e.push(8);break;case"f":e.push(12);break;case"n":e.push(10);break;case"r":e.push(13);break;case"t":e.push(9);break;case"v":e.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let r=n.c,o=n.take(2);if(o===!1)return!1;let s=parseInt(r+o,8);if(Number.isNaN(s))return!1;e.push(s);break}case"x":{let r=n.c,o=n.take(2);if(o===!1)return!1;let s=parseInt(r+o,16);if(Number.isNaN(s))return!1;e.push(s);break}case"u":{let r=n.c,o=n.take(4);if(o===!1)return!1;let s=parseInt(r+o,16);if(Number.isNaN(s))return!1;let a=new Uint8Array(4);new DataView(a.buffer).setInt32(0,s,!0),e.push(a[0],a[1],a[2],a[3]);break}case"U":{let r=n.c,o=n.take(8);if(o===!1)return!1;let s=U.uEnc(r+o),a=new Uint8Array(8),u=new DataView(a.buffer);u.setInt32(0,s.lo,!0),u.setInt32(4,s.hi,!0),e.push(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);break}}break;default:e.push(n.c.charCodeAt(0))}return new Uint8Array(e)}var Li=h(()=>{i();Me();Nt()});function*br(t){switch(t.kind){case"file":for(let e of t.messages)yield e,yield*br(e);yield*t.enums,yield*t.services,yield*t.extensions;break;case"message":for(let e of t.nestedMessages)yield e,yield*br(e);yield*t.nestedEnums,yield*t.nestedExtensions;break}}var Vi=h(()=>{i()});function Er(...t){let e=Gm();if(!t.length)return e;if("$typeName"in t[0]&&t[0].$typeName=="google.protobuf.FileDescriptorSet"){for(let n of t[0].file)Wi(n,e);return e}if("$typeName"in t[0]){let s=function(a){let u=[];for(let l of a.dependency){if(e.getFile(l)!=null||o.has(l))continue;let c=r(l);if(!c)throw new Error(`Unable to resolve ${l}, imported by ${a.name}`);"kind"in c?e.addFile(c,!1,!0):(o.add(c.name),u.push(c))}return u.concat(...u.map(s))},n=t[0],r=t[1],o=new Set;for(let a of[n,...s(n)].reverse())Wi(a,e)}else for(let n of t)for(let r of n.files)e.addFile(r);return e}function Gm(){let t=new Map,e=new Map,n=new Map;return{kind:"registry",types:t,extendees:e,[Symbol.iterator](){return t.values()},get files(){return n.values()},addFile(r,o,s){if(n.set(r.proto.name,r),!o)for(let a of br(r))this.add(a);if(s)for(let a of r.dependencies)this.addFile(a,o,s)},add(r){if(r.kind=="extension"){let o=e.get(r.extendee.typeName);o||e.set(r.extendee.typeName,o=new Map),o.set(r.number,r)}t.set(r.typeName,r)},get(r){return t.get(r)},getFile(r){return n.get(r)},getMessage(r){let o=t.get(r);return o?.kind=="message"?o:void 0},getEnum(r){let o=t.get(r);return o?.kind=="enum"?o:void 0},getExtension(r){let o=t.get(r);return o?.kind=="extension"?o:void 0},getExtensionFor(r,o){var s;return(s=e.get(r.typeName))===null||s===void 0?void 0:s.get(o)},getService(r){let o=t.get(r);return o?.kind=="service"?o:void 0}}}function Wi(t,e){var n,r;let o={kind:"file",proto:t,deprecated:(r=(n=t.options)===null||n===void 0?void 0:n.deprecated)!==null&&r!==void 0?r:!1,edition:tp(t),name:t.name.replace(/\.proto$/,""),dependencies:np(t,e),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${t.name}`}},s=new Map,a={get(u){return s.get(u)},add(u){var l;Oe(((l=u.proto.options)===null||l===void 0?void 0:l.mapEntry)===!0),s.set(u.typeName,u)}};for(let u of t.enumType)Zi(u,o,void 0,e);for(let u of t.messageType)$i(u,o,void 0,e,a);for(let u of t.service)qm(u,o,e);qo(o,e);for(let u of s.values())Ho(u,e,a);for(let u of o.messages)Ho(u,e,a),qo(u,e);e.addFile(o,!0)}function qo(t,e){switch(t.kind){case"file":for(let n of t.proto.extension){let r=es(n,t,e);t.extensions.push(r),e.add(r)}break;case"message":for(let n of t.proto.extension){let r=es(n,t,e);t.nestedExtensions.push(r),e.add(r)}for(let n of t.nestedMessages)qo(n,e);break}}function Ho(t,e,n){let r=t.proto.oneofDecl.map(s=>ep(s,t)),o=new Set;for(let s of t.proto.field){let a=sp(s,r),u=es(s,t,e,a,n);t.fields.push(u),t.field[u.localName]=u,a===void 0?t.members.push(u):(a.fields.push(u),o.has(a)||(o.add(a),t.members.push(a)))}for(let s of r.filter(a=>o.has(a)))t.oneofs.push(s);for(let s of t.nestedMessages)Ho(s,e,n)}function Zi(t,e,n,r){var o,s,a,u,l;let c=rp(t.name,t.value),p={kind:"enum",proto:t,deprecated:(s=(o=t.options)===null||o===void 0?void 0:o.deprecated)!==null&&s!==void 0?s:!1,file:e,parent:n,open:!0,name:t.name,typeName:Sr(t,n,e),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};p.open=lp(p),r.add(p);for(let f of t.value){let _=f.name;p.values.push(p.value[f.number]={kind:"enum_value",proto:f,deprecated:(u=(a=f.options)===null||a===void 0?void 0:a.deprecated)!==null&&u!==void 0?u:!1,parent:p,name:_,localName:Yt(c==null?_:_.substring(c.length)),number:f.number,toString(){return`enum value ${p.typeName}.${_}`}})}((l=n?.nestedEnums)!==null&&l!==void 0?l:e.enums).push(p)}function $i(t,e,n,r,o){var s,a,u,l;let c={kind:"message",proto:t,deprecated:(a=(s=t.options)===null||s===void 0?void 0:s.deprecated)!==null&&a!==void 0?a:!1,file:e,parent:n,name:t.name,typeName:Sr(t,n,e),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((u=t.options)===null||u===void 0?void 0:u.mapEntry)===!0?o.add(c):(((l=n?.nestedMessages)!==null&&l!==void 0?l:e.messages).push(c),r.add(c));for(let p of t.enumType)Zi(p,e,c,r);for(let p of t.nestedType)$i(p,e,c,r,o)}function qm(t,e,n){var r,o;let s={kind:"service",proto:t,deprecated:(o=(r=t.options)===null||r===void 0?void 0:r.deprecated)!==null&&o!==void 0?o:!1,file:e,name:t.name,typeName:Sr(t,void 0,e),methods:[],method:{},toString(){return`service ${this.typeName}`}};e.services.push(s),n.add(s);for(let a of t.method){let u=Hm(a,s,n);s.methods.push(u),s.method[u.localName]=u}}function Hm(t,e,n){var r,o,s,a;let u;t.clientStreaming&&t.serverStreaming?u="bidi_streaming":t.clientStreaming?u="client_streaming":t.serverStreaming?u="server_streaming":u="unary";let l=n.getMessage(Qe(t.inputType)),c=n.getMessage(Qe(t.outputType));Oe(l,`invalid MethodDescriptorProto: input_type ${t.inputType} not found`),Oe(c,`invalid MethodDescriptorProto: output_type ${t.inputType} not found`);let p=t.name;return{kind:"rpc",proto:t,deprecated:(o=(r=t.options)===null||r===void 0?void 0:r.deprecated)!==null&&o!==void 0?o:!1,parent:e,name:p,localName:Yt(p.length?Yt(p[0].toLowerCase()+p.substring(1)):p),methodKind:u,input:l,output:c,idempotency:(a=(s=t.options)===null||s===void 0?void 0:s.idempotencyLevel)!==null&&a!==void 0?a:Ym,toString(){return`rpc ${e.typeName}.${p}`}}}function ep(t,e){return{kind:"oneof",proto:t,deprecated:!1,parent:e,fields:[],name:t.name,localName:Yt($t(t.name)),toString(){return`oneof ${e.typeName}.${this.name}`}}}function es(t,e,n,r,o){var s,a,u;let l=o===void 0,c={kind:"field",proto:t,deprecated:(a=(s=t.options)===null||s===void 0?void 0:s.deprecated)!==null&&a!==void 0?a:!1,name:t.name,number:t.number,scalar:void 0,message:void 0,enum:void 0,presence:ap(t,r,l,e),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(l){let N=e.kind=="file"?e:e.file,C=e.kind=="file"?void 0:e,A=Sr(t,C,N);c.kind="extension",c.file=N,c.parent=C,c.oneof=void 0,c.typeName=A,c.jsonName=`[${A}]`,c.toString=()=>`extension ${A}`;let $=n.getMessage(Qe(t.extendee));Oe($,`invalid FieldDescriptorProto: extendee ${t.extendee} not found`),c.extendee=$}else{let N=e;Oe(N.kind=="message"),c.parent=N,c.oneof=r,c.localName=r?$t(t.name):Yt($t(t.name)),c.jsonName=t.jsonName,c.toString=()=>`field ${N.typeName}.${t.name}`}let p=t.label,f=t.type,_=(u=t.options)===null||u===void 0?void 0:u.jstype;if(p===ts){let N=f==yn?o?.get(Qe(t.typeName)):void 0;if(N){c.fieldKind="map";let{key:C,value:A}=up(N);return c.mapKey=C.scalar,c.mapKind=A.fieldKind,c.message=A.message,c.delimitedEncoding=!1,c.enum=A.enum,c.scalar=A.scalar,c}switch(c.fieldKind="list",f){case yn:case bn:c.listKind="message",c.message=n.getMessage(Qe(t.typeName)),Oe(c.message),c.delimitedEncoding=Ji(t,e);break;case Mi:c.listKind="enum",c.enum=n.getEnum(Qe(t.typeName)),Oe(c.enum);break;default:c.listKind="scalar",c.scalar=f,c.longAsString=_==Ui;break}return c.packed=ip(t,e),c}switch(f){case yn:case bn:c.fieldKind="message",c.message=n.getMessage(Qe(t.typeName)),Oe(c.message,`invalid FieldDescriptorProto: type_name ${t.typeName} not found`),c.delimitedEncoding=Ji(t,e),c.getDefaultValue=()=>{};break;case Mi:{let N=n.getEnum(Qe(t.typeName));Oe(N!==void 0,`invalid FieldDescriptorProto: type_name ${t.typeName} not found`),c.fieldKind="enum",c.enum=n.getEnum(Qe(t.typeName)),c.getDefaultValue=()=>wt(t,"defaultValue")?Pi(N,t.defaultValue):void 0;break}default:{c.fieldKind="scalar",c.scalar=f,c.longAsString=_==Ui,c.getDefaultValue=()=>wt(t,"defaultValue")?Bi(f,t.defaultValue):void 0;break}}return c}function tp(t){switch(t.syntax){case"":case"proto2":return Wm;case"proto3":return Jm;case"editions":if(t.edition in ji)return t.edition;throw new Error(`${t.name}: unsupported edition`);default:throw new Error(`${t.name}: unsupported syntax "${t.syntax}"`)}}function np(t,e){return t.dependency.map(n=>{let r=e.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${t.name}`);return r})}function rp(t,e){let n=op(t)+"_";for(let r of e){if(!r.name.toLowerCase().startsWith(n))return;let o=r.name.substring(n.length);if(o.length==0||/^\d/.test(o))return}return n}function op(t){return(t.substring(0,1)+t.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()}function Sr(t,e,n){let r;return e?r=`${e.typeName}.${t.name}`:n.proto.package.length>0?r=`${n.proto.package}.${t.name}`:r=`${t.name}`,r}function Qe(t){return t.startsWith(".")?t.substring(1):t}function sp(t,e){if(!wt(t,"oneofIndex")||t.proto3Optional)return;let n=e[t.oneofIndex];return Oe(n,`invalid FieldDescriptorProto: oneof #${t.oneofIndex} for field #${t.number} not found`),n}function ap(t,e,n,r){if(t.label==$m)return zm;if(t.label==ts)return Gi;if(e||t.proto3Optional||n)return Qo;let o=zt("fieldPresence",{proto:t,parent:r});return o==Gi&&(t.type==yn||t.type==bn)?Qo:o}function ip(t,e){if(t.label!=ts)return!1;switch(t.type){case jm:case Zm:case bn:case yn:return!1}let n=t.options;return n&&wt(n,"packed")?n.packed:Km==zt("repeatedFieldEncoding",{proto:t,parent:e})}function up(t){let e=t.fields.find(r=>r.number===1),n=t.fields.find(r=>r.number===2);return Oe(e&&e.fieldKind=="scalar"&&e.scalar!=m.BYTES&&e.scalar!=m.FLOAT&&e.scalar!=m.DOUBLE&&n&&n.fieldKind!="list"&&n.fieldKind!="map"),{key:e,value:n}}function lp(t){var e;return Qm==zt("enumType",{proto:t.proto,parent:(e=t.parent)!==null&&e!==void 0?e:t.file})}function Ji(t,e){return t.type==bn?!0:Xm==zt("messageEncoding",{proto:t,parent:e})}function zt(t,e){var n,r;let o=(n=e.proto.options)===null||n===void 0?void 0:n.features;if(o){let s=o[t];if(s!=0)return s}if("kind"in e){if(e.kind=="message")return zt(t,(r=e.parent)!==null&&r!==void 0?r:e.file);let s=ji[e.edition];if(!s)throw new Error(`feature default for edition ${e.edition} not found`);return s[t]}return zt(t,e.parent)}function Oe(t,e){if(!t)throw new Error(e)}var Wm,Jm,jm,bn,yn,Zm,Mi,ts,$m,Ui,Ym,Qo,Gi,zm,Km,Xm,Qm,ji,_r=h(()=>{i();Me();Li();Vi();Jt();Ko();Wm=998,Jm=999,jm=9,bn=10,yn=11,Zm=12,Mi=14,ts=3,$m=2,Ui=1,Ym=0,Qo=1,Gi=2,zm=3,Km=1,Xm=2,Qm=1,ji={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 Yi(t){let e=cp(t);return e.messageType.forEach(hn),Er(e,()=>{}).getFile(e.name)}function cp(t){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},t),{messageType:t.messageType.map(zi),enumType:t.enumType.map(Ki)}))}function zi(t){var e,n,r,o,s,a,u,l;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:t.name,field:(n=(e=t.field)===null||e===void 0?void 0:e.map(dp))!==null&&n!==void 0?n:[],extension:[],nestedType:(o=(r=t.nestedType)===null||r===void 0?void 0:r.map(zi))!==null&&o!==void 0?o:[],enumType:(a=(s=t.enumType)===null||s===void 0?void 0:s.map(Ki))!==null&&a!==void 0?a:[],extensionRange:(l=(u=t.extensionRange)===null||u===void 0?void 0:u.map(p=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},p)))!==null&&l!==void 0?l:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function dp(t){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",p