@oaknational/google-classroom-addon 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  * Copyright(c) 2012-2014 Roman Shtylman
5
5
  * Copyright(c) 2015 Douglas Christopher Wilson
6
6
  * MIT Licensed
7
- */function requireCookie(){if(hasRequiredCookie)return cookie;hasRequiredCookie=1,cookie.parse=function(e,r){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=r&&r.decode||l,d=0,u=0,c=0;do{if(-1===(u=e.indexOf("=",d)))break;if(-1===(c=e.indexOf(";",d)))c=o;else if(u>c){d=e.lastIndexOf(";",u-1)+1;continue}var f=a(e,d,u),h=s(e,u,f),m=e.slice(f,h);if(!t.call(n,m)){var g=a(e,u+1,c),y=s(e,c,g);34===e.charCodeAt(g)&&34===e.charCodeAt(y-1)&&(g++,y--);var v=e.slice(g,y);n[m]=p(v,i)}d=c+1}while(d<o);return n},cookie.serialize=function(t,a,s){var l=s&&s.encode||encodeURIComponent;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!r.test(t))throw new TypeError("argument name is invalid");var p=l(a);if(!n.test(p))throw new TypeError("argument val is invalid");var d=t+"="+p;if(!s)return d;if(null!=s.maxAge){var u=Math.floor(s.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+u}if(s.domain){if(!o.test(s.domain))throw new TypeError("option domain is invalid");d+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");d+="; Path="+s.path}if(s.expires){var c=s.expires;if(!function(t){return"[object Date]"===e.call(t)}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+c.toUTCString()}s.httpOnly&&(d+="; HttpOnly");s.secure&&(d+="; Secure");s.partitioned&&(d+="; Partitioned");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":d+="; Priority=Low";break;case"medium":d+="; Priority=Medium";break;case"high":d+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return d};var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,r=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,n=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,o=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/;function a(e,t,r){do{var n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<r);return r}function s(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return r}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function p(e,t){try{return t(e)}catch(t){return e}}return cookie}requireCookie();var alphabetByEncoding={},alphabetByValue=Array.from({length:64});for(let e=0,t="A".charCodeAt(0),r="Z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t);alphabetByEncoding[r]=e,alphabetByValue[e]=r}for(let e=0,t="a".charCodeAt(0),r="z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t),n=e+26;alphabetByEncoding[r]=n,alphabetByValue[n]=r}for(let e=0;e<10;e++){alphabetByEncoding[e.toString(10)]=e+52;const t=e.toString(10),r=e+52;alphabetByEncoding[t]=r,alphabetByValue[r]=t}alphabetByEncoding["-"]=62,alphabetByValue[62]="-",alphabetByEncoding._=63,alphabetByValue[63]="_";var bitsPerLetter=6,bitsPerByte=8,maxLetterValue=63,stringToBuffer=e=>(new TextEncoder).encode(e),bufferToString=e=>(new TextDecoder).decode(e),base64urlDecode=e=>{const t=e+"=".repeat((4-e.length%4)%4);let r=t.length/4*3;t.endsWith("==")?r-=2:t.endsWith("=")&&r--;const n=new ArrayBuffer(r),o=new DataView(n);for(let e=0;e<t.length;e+=4){let r=0,n=0;for(let o=e,i=e+3;o<=i;o++)if("="===t[o])r>>=bitsPerLetter;else{if(!(t[o]in alphabetByEncoding))throw new TypeError(`Invalid character ${t[o]} in base64 string.`);r|=alphabetByEncoding[t[o]]<<(i-o)*bitsPerLetter,n+=bitsPerLetter}const i=e/4*3;r>>=n%bitsPerByte;const a=Math.floor(n/bitsPerByte);for(let e=0;e<a;e++){const t=(a-e-1)*bitsPerByte;o.setUint8(i+e,(r&255<<t)>>t)}}return new Uint8Array(n)},base64urlEncode=e=>{const t="string"==typeof e?stringToBuffer(e):e;let r="";for(let e=0;e<t.length;e+=3){let n=0,o=0;for(let r=e,i=Math.min(e+3,t.length);r<i;r++)n|=t[r]<<(i-r-1)*bitsPerByte,o+=bitsPerByte;const i=Math.ceil(o/bitsPerLetter);n<<=i*bitsPerLetter-o;for(let e=1;e<=i;e++){const t=(i-e)*bitsPerLetter;r+=alphabetByValue[(n&maxLetterValue<<t)>>t]}}return r},defaults={encryption:{saltBits:256,algorithm:"aes-256-cbc",iterations:1,minPasswordlength:32},integrity:{saltBits:256,algorithm:"sha256",iterations:1,minPasswordlength:32},ttl:0,timestampSkewSec:60,localtimeOffsetMsec:0},clone$1=e=>({...e,encryption:{...e.encryption},integrity:{...e.integrity}}),algorithms={"aes-128-ctr":{keyBits:128,ivBits:128,name:"AES-CTR"},"aes-256-cbc":{keyBits:256,ivBits:128,name:"AES-CBC"},sha256:{keyBits:256,name:"SHA-256"}},macPrefix="Fe26.2",randomBytes=(e,t)=>{const r=new Uint8Array(t);return e.getRandomValues(r),r},randomBits=(e,t)=>{if(t<1)throw new Error("Invalid random bits count");const r=Math.ceil(t/8);return randomBytes(e,r)},pbkdf2=async(e,t,r,n,o,i)=>{const a=stringToBuffer(t),s=await e.subtle.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits"]),l={name:"PBKDF2",hash:i,salt:stringToBuffer(r),iterations:n};return await e.subtle.deriveBits(l,s,8*o)},generateKey=async(e,t,r)=>{var n;if(!(null==t?void 0:t.length))throw new Error("Empty password");if(null==r||"object"!=typeof r)throw new Error("Bad options");if(!(r.algorithm in algorithms))throw new Error(`Unknown algorithm: ${r.algorithm}`);const o=algorithms[r.algorithm],i={},a=null!=(n=r.hmac)&&n,s=a?{name:"HMAC",hash:o.name}:{name:o.name},l=a?["sign","verify"]:["encrypt","decrypt"];if("string"==typeof t){if(t.length<r.minPasswordlength)throw new Error(`Password string too short (min ${r.minPasswordlength} characters required)`);let{salt:n=""}=r;if(!n){const{saltBits:t=0}=r;if(!t)throw new Error("Missing salt and saltBits options");const o=randomBits(e,t);n=[...new Uint8Array(o)].map(e=>e.toString(16).padStart(2,"0")).join("")}const a=await pbkdf2(e,t,n,r.iterations,o.keyBits/8,"SHA-1"),p=await e.subtle.importKey("raw",a,s,!1,l);i.key=p,i.salt=n}else{if(t.length<o.keyBits/8)throw new Error("Key buffer (password) too small");i.key=await e.subtle.importKey("raw",t,s,!1,l),i.salt=""}return r.iv?i.iv=r.iv:"ivBits"in o&&(i.iv=randomBits(e,o.ivBits)),i},getEncryptParams=(e,t,r)=>["aes-128-ctr"===e?{name:"AES-CTR",counter:t.iv,length:128}:{name:"AES-CBC",iv:t.iv},t.key,"string"==typeof r?stringToBuffer(r):r],encrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.encrypt(...getEncryptParams(r.algorithm,o,n));return{encrypted:new Uint8Array(i),key:o}},decrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.decrypt(...getEncryptParams(r.algorithm,o,n));return bufferToString(new Uint8Array(i))},hmacWithPassword=async(e,t,r,n)=>{const o=await generateKey(e,t,{...r,hmac:!0}),i=stringToBuffer(n),a=await e.subtle.sign({name:"HMAC"},o.key,i);return{digest:base64urlEncode(new Uint8Array(a)),salt:o.salt}},normalizePassword=e=>"string"==typeof e||e instanceof Uint8Array?{encryption:e,integrity:e}:"secret"in e?{id:e.id,encryption:e.secret,integrity:e.secret}:{id:e.id,encryption:e.encryption,integrity:e.integrity},seal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone$1(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=JSON.stringify(t),s=normalizePassword(r),{id:l="",encryption:p,integrity:d}=s;if(l&&!/^\w+$/.test(l))throw new Error("Invalid password id");const{encrypted:u,key:c}=await encrypt(e,p,o.encryption,a),f=base64urlEncode(new Uint8Array(u)),h=base64urlEncode(c.iv),m=o.ttl?i+o.ttl:"",g=`${macPrefix}*${l}*${c.salt}*${h}*${f}*${m}`,y=await hmacWithPassword(e,d,o.integrity,g);return`${g}*${y.salt}*${y.digest}`},fixedTimeComparison=(e,t)=>{let r=e.length===t.length?0:1;r&&(t=e);for(let n=0;n<e.length;n+=1)r|=e.charCodeAt(n)^t.charCodeAt(n);return 0===r},unseal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone$1(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=t.split("*");if(8!==a.length)throw new Error("Incorrect number of sealed components");const s=a[0];let l=a[1];const p=a[2],d=a[3],u=a[4],c=a[5],f=a[6],h=a[7],m=`${s}*${l}*${p}*${d}*${u}*${c}`;if(macPrefix!==s)throw new Error("Wrong mac prefix");if(c){if(!/^\d+$/.test(c))throw new Error("Invalid expiration");if(Number.parseInt(c,10)<=i-1e3*o.timestampSkewSec)throw new Error("Expired seal")}let g="";if(l=l||"default","string"==typeof r||r instanceof Uint8Array)g=r;else{if(!(l in r))throw new Error(`Cannot find password: ${l}`);g=r[l]}g=normalizePassword(g);const y=o.integrity;y.salt=f;const v=await hmacWithPassword(e,g.integrity,y,m);if(!fixedTimeComparison(v.digest,h))throw new Error("Bad hmac value");const b=base64urlDecode(u),O=o.encryption;O.salt=p,O.iv=base64urlDecode(d);const w=await decrypt(e,g.encryption,O,b);return w?JSON.parse(w):null};const webCrypto=globalThis.crypto,subtle=webCrypto.subtle,randomUUID$1=()=>webCrypto.randomUUID(),getRandomValues$1=e=>webCrypto.getRandomValues(e),_crypto={randomUUID:randomUUID$1,getRandomValues:getRandomValues$1,subtle:subtle};var crypto$1=Object.freeze({__proto__:null,default:_crypto,getRandomValues:getRandomValues$1,randomUUID:randomUUID$1,subtle:subtle}),fourteenDaysInSeconds=1209600,currentMajorVersion=2,versionDelimiter="~";function normalizeStringPasswordToMap(e){return"string"==typeof e?{1:e}:e}function parseSeal(e){const[t,r]=e.split(versionDelimiter);return{sealWithoutVersion:t,tokenVersion:null==r?null:parseInt(r,10)}}function createSealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),i=Math.max(...Object.keys(o).map(Number)),a={id:i.toString(),secret:o[i]};return`${await seal(e,t,a,{...defaults,ttl:1e3*n})}${versionDelimiter}${currentMajorVersion}`}}function createUnsealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),{sealWithoutVersion:i,tokenVersion:a}=parseSeal(t);try{const t=await unseal(e,i,o,{...defaults,ttl:1e3*n})??{};return 2===a?t:{...t.persistent}}catch(e){if(e instanceof Error&&/^(Expired seal|Bad hmac value|Cannot find password|Incorrect number of sealed components)/.test(e.message))return{};throw e}}}var sealData=createSealData(crypto$1),unsealData=createUnsealData(crypto$1),createAnnouncementAttachmentArgsSchema=z__default.default.object({courseId:z__default.default.string(),itemId:z__default.default.string(),addOnToken:z__default.default.string(),title:z__default.default.string(),lessonSlug:z__default.default.string(),programmeSlug:z__default.default.string(),unitSlug:z__default.default.string(),maxPoints:z__default.default.number().optional()}),classroomAttachmentSchema=z__default.default.object({courseId:z__default.default.string(),postId:z__default.default.string(),id:z__default.default.string(),title:z__default.default.string(),teacherViewUri:z__default.default.object({uri:z__default.default.string()}),studentViewUri:z__default.default.object({uri:z__default.default.string()}),studentWorkReviewUri:z__default.default.object({uri:z__default.default.string()}).optional(),itemId:z__default.default.string(),maxPoints:z__default.default.number().optional()});z__default.default.string();var googleOAuthUserSchema=z__default.default.object({accessToken:z__default.default.string(),loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional(),email:z__default.default.string().optional()}),tokenPayloadSchema=z__default.default.object({token:z__default.default.string()});z__default.default.tuple([createAnnouncementAttachmentArgsSchema,z__default.default.string().min(1),z__default.default.string().min(1)]);var classroomAttachmentEntitySchema=classroomAttachmentSchema.extend({attachmentId:z__default.default.string(),createdAt:z__default.default.string()}),userCredentialsEntitySchema=z__default.default.object({loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional()}),GoogleClassroomClient=function(){function e(e,t){this.baseUrl=e,this.oAuthClient=t,this.baseUrl=e,this.oAuthClient=t}return e.prototype.getClassroomClient=function(){return __awaiter(this,void 0,void 0,function(){var e;return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.oAuthClient.getOAuth2Client()];case 1:return e=t.sent(),[2,new classroom.classroom_v1.Classroom({auth:e})]}})})},e.prototype.createAnnouncementAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a,s,l,p,d,u,c,f;return __generator$1(this,function(h){switch(h.label){case 0:return t=e.courseId,r=e.itemId,n=e.addOnToken,o=e.title,i=e.lessonSlug,a=e.programmeSlug,s=e.unitSlug,l=e.maxPoints,[4,this.getClassroomClient()];case 1:return p=h.sent(),d=l?{maxPoints:l,studentWorkReviewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)}}:{},[4,p.courses.courseWork.addOnAttachments.create({courseId:t,itemId:r,addOnToken:n,requestBody:__assign({title:o,teacherViewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)},studentViewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)}},d)})];case 2:return u=h.sent(),c=classroomAttachmentSchema.parse(u.data),f=c.maxPoints?{maxPoints:c.maxPoints,studentWorkReviewUri:c.studentWorkReviewUri}:{},[2,__assign({courseId:c.courseId,postId:c.postId,id:c.id,title:c.title,teacherViewUri:c.teacherViewUri,studentViewUri:c.studentViewUri,itemId:c.itemId},f)]}})})},e.prototype.submitPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.patch({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId,updateMask:"pointsEarned",requestBody:{pointsEarned:e.pointsEarned}})];case 2:return[2,t.sent().data]}})})},e.prototype.fetchPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.get({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId})];case 2:return[2,t.sent().data]}})})},e}(),ExceptionType,ErrorSeverity;exports.ExceptionType=void 0,ExceptionType=exports.ExceptionType||(exports.ExceptionType={}),ExceptionType.GoogleOAuth="google-oauth",ExceptionType.Firestore="firestore",ExceptionType.Encryption="encryption",exports.ErrorSeverity=void 0,ErrorSeverity=exports.ErrorSeverity||(exports.ErrorSeverity={}),ErrorSeverity.Error="error",ErrorSeverity.Warning="warning",ErrorSeverity.Info="info";var OakGoogleClassroomException=function(e){function t(t,r,n){var o,i,a,s=e.call(this,t)||this;return s.name="OakGoogleClassroomException",s.type=r,s.code=null==n?void 0:n.code,s.shouldRetry=null!==(o=null==n?void 0:n.shouldRetry)&&void 0!==o&&o,s.severity=null!==(i=null==n?void 0:n.severity)&&void 0!==i?i:exports.ErrorSeverity.Error,s.context=null==n?void 0:n.context,s.originalError=null==n?void 0:n.originalError,(null===(a=null==n?void 0:n.originalError)||void 0===a?void 0:a.stack)&&(s.stack=n.originalError.stack),s}return __extends$1(t,e),t}(Error),src$7={},src$6={},callCredentials={},metadata={},logging={},constants={},hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,Object.defineProperty(constants,"__esModule",{value:!0}),constants.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=constants.DEFAULT_MAX_SEND_MESSAGE_LENGTH=constants.Propagate=constants.LogVerbosity=constants.Status=void 0,function(e){e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.ALREADY_EXISTS=6]="ALREADY_EXISTS",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.OUT_OF_RANGE=11]="OUT_OF_RANGE",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.DATA_LOSS=15]="DATA_LOSS",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED"}(e||(constants.Status=e={})),function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.ERROR=2]="ERROR",e[e.NONE=3]="NONE"}(t||(constants.LogVerbosity=t={})),function(e){e[e.DEADLINE=1]="DEADLINE",e[e.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",e[e.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",e[e.CANCELLATION=8]="CANCELLATION",e[e.DEFAULTS=65535]="DEFAULTS"}(r||(constants.Propagate=r={})),constants.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1,constants.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4194304),constants;var e,t,r}var version$3="1.14.0",require$$11={version:version$3},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(e){var t,r,n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.setLoggerVerbosity=e.setLogger=e.getLogger=void 0,e.trace=function(t,r,n){m(r)&&(0,e.log)(t,(new Date).toISOString()+" | v"+s+" "+a.pid+" | "+r+" | "+n)},e.isTracerEnabled=m;const i=requireConstants(),a=require$$1__default.default,s=require$$11.version,l={error:(e,...t)=>{console.error("E "+e,...t)},info:(e,...t)=>{console.error("I "+e,...t)},debug:(e,...t)=>{console.error("D "+e,...t)}};let p=l,d=i.LogVerbosity.ERROR;switch((null!==(r=null!==(t=process.env.GRPC_NODE_VERBOSITY)&&void 0!==t?t:process.env.GRPC_VERBOSITY)&&void 0!==r?r:"").toUpperCase()){case"DEBUG":d=i.LogVerbosity.DEBUG;break;case"INFO":d=i.LogVerbosity.INFO;break;case"ERROR":d=i.LogVerbosity.ERROR;break;case"NONE":d=i.LogVerbosity.NONE}e.getLogger=()=>p;e.setLogger=e=>{p=e};e.setLoggerVerbosity=e=>{d=e};e.log=(e,...t)=>{let r;if(e>=d){switch(e){case i.LogVerbosity.DEBUG:r=p.debug;break;case i.LogVerbosity.INFO:r=p.info;break;case i.LogVerbosity.ERROR:r=p.error}r||(r=p.error),r&&r.bind(p)(...t)}};const u=null!==(o=null!==(n=process.env.GRPC_NODE_TRACE)&&void 0!==n?n:process.env.GRPC_TRACE)&&void 0!==o?o:"",c=new Set,f=new Set;for(const e of u.split(","))e.startsWith("-")?f.add(e.substring(1)):c.add(e);const h=c.has("all");function m(e){return!f.has(e)&&(h||c.has(e))}}(logging)),logging}var error={},hasRequiredError,hasRequiredMetadata,hasRequiredCallCredentials;function requireError(){if(hasRequiredError)return error;return hasRequiredError=1,Object.defineProperty(error,"__esModule",{value:!0}),error.getErrorMessage=function(e){return e instanceof Error?e.message:String(e)},error.getErrorCode=function(e){return"object"==typeof e&&null!==e&&"code"in e&&"number"==typeof e.code?e.code:null},error}function requireMetadata(){if(hasRequiredMetadata)return metadata;hasRequiredMetadata=1,Object.defineProperty(metadata,"__esModule",{value:!0}),metadata.Metadata=void 0;const e=requireLogging(),t=requireConstants(),r=requireError(),n=/^[:0-9a-z_.-]+$/,o=/^[ -~]*$/;function i(e){return e.endsWith("-bin")}function a(e){return!e.startsWith("grpc-")}function s(e){return e.toLowerCase()}function l(e,t){if(!function(e){return n.test(e)}(e))throw new Error('Metadata key "'+e+'" contains illegal characters');if(null!=t)if(i(e)){if(!Buffer.isBuffer(t))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(t))throw new Error("keys that don't end with '-bin' must have String values");if(!function(e){return o.test(e)}(t))throw new Error('Metadata string value "'+t+'" contains illegal characters')}}class p{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){l(e=s(e),t),this.internalRepr.set(e,[t])}add(e,t){l(e=s(e),t);const r=this.internalRepr.get(e);void 0===r?this.internalRepr.set(e,[t]):r.push(t)}remove(e){e=s(e),this.internalRepr.delete(e)}get(e){return e=s(e),this.internalRepr.get(e)||[]}getMap(){const e={};for(const[t,r]of this.internalRepr)if(r.length>0){const n=r[0];e[t]=Buffer.isBuffer(n)?Buffer.from(n):n}return e}clone(){const e=new p(this.options),t=e.internalRepr;for(const[e,r]of this.internalRepr){const n=r.map(e=>Buffer.isBuffer(e)?Buffer.from(e):e);t.set(e,n)}return e}merge(e){for(const[t,r]of e.internalRepr){const e=(this.internalRepr.get(t)||[]).concat(r);this.internalRepr.set(t,e)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){const e={};for(const[t,r]of this.internalRepr)t.startsWith(":")||(e[t]=r.map(d));return e}toJSON(){const e={};for(const[t,r]of this.internalRepr)e[t]=r;return e}setOpaque(e,t){this.opaqueData.set(e,t)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(n){const o=new p;for(const s of Object.keys(n)){if(":"===s.charAt(0))continue;const l=n[s];try{i(s)?Array.isArray(l)?l.forEach(e=>{o.add(s,Buffer.from(e,"base64"))}):void 0!==l&&(a(s)?l.split(",").forEach(e=>{o.add(s,Buffer.from(e.trim(),"base64"))}):o.add(s,Buffer.from(l,"base64"))):Array.isArray(l)?l.forEach(e=>{o.add(s,e)}):void 0!==l&&o.add(s,l)}catch(n){const o=`Failed to add metadata entry ${s}: ${l}. ${(0,r.getErrorMessage)(n)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,e.log)(t.LogVerbosity.ERROR,o)}}return o}}metadata.Metadata=p;const d=e=>Buffer.isBuffer(e)?e.toString("base64"):e;return metadata}function requireCallCredentials(){if(hasRequiredCallCredentials)return callCredentials;hasRequiredCallCredentials=1,Object.defineProperty(callCredentials,"__esModule",{value:!0}),callCredentials.CallCredentials=void 0;const e=requireMetadata();class t{static createFromMetadataGenerator(e){return new n(e)}static createFromGoogleCredential(r){return t.createFromMetadataGenerator((t,n)=>{let o;o=function(e){return"getRequestHeaders"in e&&"function"==typeof e.getRequestHeaders}(r)?r.getRequestHeaders(t.service_url):new Promise((e,n)=>{r.getRequestMetadata(t.service_url,(t,r)=>{t?n(t):r?e(r):n(new Error("Headers not set by metadata plugin"))})}),o.then(t=>{const r=new e.Metadata;for(const e of Object.keys(t))r.add(e,t[e]);n(null,r)},e=>{n(e)})})}static createEmpty(){return new o}}callCredentials.CallCredentials=t;class r extends t{constructor(e){super(),this.creds=e}async generateMetadata(t){const r=new e.Metadata,n=await Promise.all(this.creds.map(e=>e.generateMetadata(t)));for(const e of n)r.merge(e);return r}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e||e instanceof r&&this.creds.every((t,r)=>t._equals(e.creds[r]))}}class n extends t{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,r)=>{this.metadataGenerator(e,(e,n)=>{void 0!==n?t(n):r(e)})})}compose(e){return new r([this,e])}_equals(e){return this===e||e instanceof n&&this.metadataGenerator===e.metadataGenerator}}class o extends t{generateMetadata(t){return Promise.resolve(new e.Metadata)}compose(e){return e}_equals(e){return e instanceof o}}return callCredentials}var channel={},channelCredentials={},tlsHelpers={},hasRequiredTlsHelpers;function requireTlsHelpers(){if(hasRequiredTlsHelpers)return tlsHelpers;hasRequiredTlsHelpers=1,Object.defineProperty(tlsHelpers,"__esModule",{value:!0}),tlsHelpers.CIPHER_SUITES=void 0,tlsHelpers.getDefaultRootsData=function(){if(t)return null===r&&(r=e.readFileSync(t)),r;return null};const e=require$$0__default.default;tlsHelpers.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;const t=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH;let r=null;return tlsHelpers}var uriParser={},hasRequiredUriParser;function requireUriParser(){if(hasRequiredUriParser)return uriParser;hasRequiredUriParser=1,Object.defineProperty(uriParser,"__esModule",{value:!0}),uriParser.parseUri=function(t){const r=e.exec(t);if(null===r)return null;return{scheme:r[1],authority:r[2],path:r[3]}},uriParser.splitHostPort=function(e){if(e.startsWith("[")){const r=e.indexOf("]");if(-1===r)return null;const n=e.substring(1,r);if(-1===n.indexOf(":"))return null;if(e.length>r+1){if(":"===e[r+1]){const o=e.substring(r+2);return t.test(o)?{host:n,port:+o}:null}return null}return{host:n}}{const r=e.split(":");return 2===r.length?t.test(r[1])?{host:r[0],port:+r[1]}:null:{host:e}}},uriParser.combineHostPort=function(e){return void 0===e.port?e.host:e.host.includes(":")?`[${e.host}]:${e.port}`:`${e.host}:${e.port}`},uriParser.uriToString=function(e){let t="";void 0!==e.scheme&&(t+=e.scheme+":");void 0!==e.authority&&(t+="//"+e.authority+"/");return t+=e.path,t};const e=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;const t=/^\d+$/;return uriParser}var resolver={},hasRequiredResolver,hasRequiredChannelCredentials;function requireResolver(){if(hasRequiredResolver)return resolver;hasRequiredResolver=1,Object.defineProperty(resolver,"__esModule",{value:!0}),resolver.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0,resolver.registerResolver=function(e,r){t[e]=r},resolver.registerDefaultScheme=function(e){r=e},resolver.createResolver=function(r,n,o){if(void 0!==r.scheme&&r.scheme in t)return new t[r.scheme](r,n,o);throw new Error(`No resolver could be created for target ${(0,e.uriToString)(r)}`)},resolver.getDefaultAuthority=function(r){if(void 0!==r.scheme&&r.scheme in t)return t[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,e.uriToString)(r)}`)},resolver.mapUriDefaultScheme=function(n){if(void 0===n.scheme||!(n.scheme in t))return null!==r?{scheme:r,authority:void 0,path:(0,e.uriToString)(n)}:null;return n};const e=requireUriParser();resolver.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";const t={};let r=null;return resolver}function requireChannelCredentials(){if(hasRequiredChannelCredentials)return channelCredentials;hasRequiredChannelCredentials=1,Object.defineProperty(channelCredentials,"__esModule",{value:!0}),channelCredentials.ChannelCredentials=void 0,channelCredentials.createCertificateProviderChannelCredentials=function(e,t,r){return new f(e,t,null!=r?r:{})};const e=require$$1__default$1.default,t=requireCallCredentials(),r=requireTlsHelpers(),n=requireUriParser(),o=requireResolver(),i=requireLogging(),a=requireConstants();function s(e,t){if(e&&!(e instanceof Buffer))throw new TypeError(`${t}, if provided, must be a Buffer.`)}class l{compose(e){return new h(this,e)}static createSsl(t,n,o,i){var a;if(s(t,"Root certificate"),s(n,"Private key"),s(o,"Certificate chain"),n&&!o)throw new Error("Private key must be given with accompanying certificate chain");if(!n&&o)throw new Error("Certificate chain must be given with accompanying private key");const l=(0,e.createSecureContext)({ca:null!==(a=null!=t?t:(0,r.getDefaultRootsData)())&&void 0!==a?a:void 0,key:null!=n?n:void 0,cert:null!=o?o:void 0,ciphers:r.CIPHER_SUITES});return new c(l,null!=i?i:{})}static createFromSecureContext(e,t){return new c(e,null!=t?t:{})}static createInsecure(){return new p}}channelCredentials.ChannelCredentials=l;class p extends l{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof p}_createSecureConnector(e,r,n){return{connect:e=>Promise.resolve({socket:e,secure:!1}),waitForReady:()=>Promise.resolve(),getCallCredentials:()=>null!=n?n:t.CallCredentials.createEmpty(),destroy(){}}}}function d(t,r,i,a){var s,l;const p={secureContext:t};let d=i;if("grpc.http_connect_target"in a){const e=(0,n.parseUri)(a["grpc.http_connect_target"]);e&&(d=e)}const u=(0,o.getDefaultAuthority)(d),c=(0,n.splitHostPort)(u),f=null!==(s=null==c?void 0:c.host)&&void 0!==s?s:u;if(p.host=f,r.checkServerIdentity&&(p.checkServerIdentity=r.checkServerIdentity),void 0!==r.rejectUnauthorized&&(p.rejectUnauthorized=r.rejectUnauthorized),p.ALPNProtocols=["h2"],a["grpc.ssl_target_name_override"]){const t=a["grpc.ssl_target_name_override"],r=null!==(l=p.checkServerIdentity)&&void 0!==l?l:e.checkServerIdentity;p.checkServerIdentity=(e,n)=>r(t,n),p.servername=t}else p.servername=f;return a["grpc-node.tls_enable_trace"]&&(p.enableTrace=!0),p}class u{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(t){const r=Object.assign({socket:t},this.connectionOptions);return new Promise((t,n)=>{const o=(0,e.connect)(r,()=>{var e;null!==(e=this.connectionOptions.rejectUnauthorized)&&void 0!==e&&!e||o.authorized?t({socket:o,secure:!0}):n(o.authorizationError)});o.on("error",e=>{n(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}}class c extends l{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e||e instanceof c&&(this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity)}_createSecureConnector(e,r,n){const o=d(this.secureContext,this.verifyOptions,e,r);return new u(o,null!=n?n:t.CallCredentials.createEmpty())}}class f extends l{constructor(e,t,r){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=r,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,r;return this===e||e instanceof f&&(this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&(null===(t=this.verifyOptions)||void 0===t?void 0:t.checkServerIdentity)===(null===(r=e.verifyOptions)||void 0===r?void 0:r.checkServerIdentity))}ref(){var e;0===this.refcount&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),null===(e=this.identityCertificateProvider)||void 0===e||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,0===this.refcount&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),null===(e=this.identityCertificateProvider)||void 0===e||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,r,n){return this.ref(),new f.SecureConnectorImpl(this,e,r,null!=n?n:t.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(const e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return void 0!==this.latestCaUpdate&&(!this.identityCertificateProvider||void 0!==this.latestIdentityUpdate)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var t,n;if(!this.latestCaUpdate)return null;if(null!==this.identityCertificateProvider&&!this.latestIdentityUpdate)return null;try{return(0,e.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:null===(t=this.latestIdentityUpdate)||void 0===t?void 0:t.privateKey,cert:null===(n=this.latestIdentityUpdate)||void 0===n?void 0:n.certificate,ciphers:r.CIPHER_SUITES})}catch(e){return(0,i.log)(a.LogVerbosity.ERROR,"Failed to createSecureContext with error "+e.message),null}}}f.SecureConnectorImpl=class{constructor(e,t,r,n){this.parent=e,this.channelTarget=t,this.options=r,this.callCredentials=n}connect(t){return new Promise((r,n)=>{const o=this.parent.getLatestSecureContext();if(!o)return void n(new Error("Failed to load credentials"));t.closed&&n(new Error("Socket closed while loading credentials"));const i=d(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:t},i),s=()=>{n(new Error("Socket closed"))},l=e=>{n(e)},p=(0,e.connect)(a,()=>{var e;p.removeListener("close",s),p.removeListener("error",l),null!==(e=this.parent.verifyOptions.rejectUnauthorized)&&void 0!==e&&!e||p.authorized?r({socket:p,secure:!0}):n(p.authorizationError)});p.once("close",s),p.once("error",l)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};class h extends l{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){const t=this.callCredentials.compose(e);return new h(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e||e instanceof h&&(this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials))}_createSecureConnector(e,r,n){const o=this.callCredentials.compose(null!=n?n:t.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,o)}}return channelCredentials}var internalChannel={},resolvingLoadBalancer={},loadBalancer={},hasRequiredLoadBalancer;function requireLoadBalancer(){if(hasRequiredLoadBalancer)return loadBalancer;hasRequiredLoadBalancer=1,Object.defineProperty(loadBalancer,"__esModule",{value:!0}),loadBalancer.createChildChannelControlHelper=function(e,t){var r,n,o,i,a,s,l,p,d,u;return{createSubchannel:null!==(n=null===(r=t.createSubchannel)||void 0===r?void 0:r.bind(t))&&void 0!==n?n:e.createSubchannel.bind(e),updateState:null!==(i=null===(o=t.updateState)||void 0===o?void 0:o.bind(t))&&void 0!==i?i:e.updateState.bind(e),requestReresolution:null!==(s=null===(a=t.requestReresolution)||void 0===a?void 0:a.bind(t))&&void 0!==s?s:e.requestReresolution.bind(e),addChannelzChild:null!==(p=null===(l=t.addChannelzChild)||void 0===l?void 0:l.bind(t))&&void 0!==p?p:e.addChannelzChild.bind(e),removeChannelzChild:null!==(u=null===(d=t.removeChannelzChild)||void 0===d?void 0:d.bind(t))&&void 0!==u?u:e.removeChannelzChild.bind(e)}},loadBalancer.registerLoadBalancerType=function(e,t,n){r[e]={LoadBalancer:t,LoadBalancingConfig:n}},loadBalancer.registerDefaultLoadBalancerType=function(e){n=e},loadBalancer.createLoadBalancer=function(e,t){const n=e.getLoadBalancerName();return n in r?new r[n].LoadBalancer(t):null},loadBalancer.isLoadBalancerNameRegistered=function(e){return e in r},loadBalancer.parseLoadBalancingConfig=o,loadBalancer.getDefaultConfig=function(){if(!n)throw new Error("No default load balancer type registered");return new r[n].LoadBalancingConfig},loadBalancer.selectLbConfigFromList=function(i,a=!1){for(const r of i)try{return o(r)}catch(r){(0,e.log)(t.LogVerbosity.DEBUG,"Config parsing failed with error",r.message);continue}return a&&n?new r[n].LoadBalancingConfig:null};const e=requireLogging(),t=requireConstants();const r={};let n=null;function o(e){const t=Object.keys(e);if(1!==t.length)throw new Error("Provided load balancing config has multiple conflicting entries");const n=t[0];if(!(n in r))throw new Error(`Unrecognized load balancing config name ${n}`);try{return r[n].LoadBalancingConfig.createFromJson(e[n])}catch(e){throw new Error(`${n}: ${e.message}`)}}return loadBalancer}var serviceConfig={},hasRequiredServiceConfig;function requireServiceConfig(){if(hasRequiredServiceConfig)return serviceConfig;hasRequiredServiceConfig=1,Object.defineProperty(serviceConfig,"__esModule",{value:!0}),serviceConfig.validateRetryThrottling=a,serviceConfig.validateServiceConfig=l,serviceConfig.extractAndSelectServiceConfig=function(e,t){for(const r of e)if(r.length>0&&r[0].startsWith("grpc_config=")){const e=r.join("").substring(12);return d(JSON.parse(e),t)}return null};const e=require$$0__default$1.default,t=requireConstants(),r=/^\d+(\.\d{1,9})?s$/,n="node";function o(e){if("service"in e&&""!==e.service){if("string"!=typeof e.service)throw new Error("Invalid method config name: invalid service: expected type string, got "+typeof e.service);if("method"in e&&""!==e.method){if("string"!=typeof e.method)throw new Error("Invalid method config name: invalid method: expected type string, got "+typeof e.service);return{service:e.service,method:e.method}}return{service:e.service}}if("method"in e&&void 0!==e.method)throw new Error("Invalid method config name: method set with empty or unset service");return{}}function i(e){var n;const i={name:[]};if(!("name"in e)||!Array.isArray(e.name))throw new Error("Invalid method config: invalid name array");for(const t of e.name)i.name.push(o(t));if("waitForReady"in e){if("boolean"!=typeof e.waitForReady)throw new Error("Invalid method config: invalid waitForReady");i.waitForReady=e.waitForReady}if("timeout"in e)if("object"==typeof e.timeout){if(!("seconds"in e.timeout)||"number"!=typeof e.timeout.seconds)throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in e.timeout)||"number"!=typeof e.timeout.nanos)throw new Error("Invalid method config: invalid timeout.nanos");i.timeout=e.timeout}else{if("string"!=typeof e.timeout||!r.test(e.timeout))throw new Error("Invalid method config: invalid timeout");{const t=e.timeout.substring(0,e.timeout.length-1).split(".");i.timeout={seconds:0|t[0],nanos:0|(null!==(n=t[1])&&void 0!==n?n:0)}}}if("maxRequestBytes"in e){if("number"!=typeof e.maxRequestBytes)throw new Error("Invalid method config: invalid maxRequestBytes");i.maxRequestBytes=e.maxRequestBytes}if("maxResponseBytes"in e){if("number"!=typeof e.maxResponseBytes)throw new Error("Invalid method config: invalid maxRequestBytes");i.maxResponseBytes=e.maxResponseBytes}if("retryPolicy"in e){if("hedgingPolicy"in e)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");i.retryPolicy=function(e){if(!("maxAttempts"in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in e)||"string"!=typeof e.initialBackoff||!r.test(e.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in e)||"string"!=typeof e.maxBackoff||!r.test(e.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in e)||"number"!=typeof e.backoffMultiplier||e.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in e)||!Array.isArray(e.retryableStatusCodes))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(0===e.retryableStatusCodes.length)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(const r of e.retryableStatusCodes)if("number"==typeof r){if(!Object.values(t.Status).includes(r))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else{if("string"!=typeof r)throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");if(!Object.values(t.Status).includes(r.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}return{maxAttempts:e.maxAttempts,initialBackoff:e.initialBackoff,maxBackoff:e.maxBackoff,backoffMultiplier:e.backoffMultiplier,retryableStatusCodes:e.retryableStatusCodes}}(e.retryPolicy)}else"hedgingPolicy"in e&&(i.hedgingPolicy=function(e){if(!("maxAttempts"in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in e&&("string"!=typeof e.hedgingDelay||!r.test(e.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in e&&Array.isArray(e.nonFatalStatusCodes))for(const r of e.nonFatalStatusCodes)if("number"==typeof r){if(!Object.values(t.Status).includes(r))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else{if("string"!=typeof r)throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");if(!Object.values(t.Status).includes(r.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}const n={maxAttempts:e.maxAttempts};return e.hedgingDelay&&(n.hedgingDelay=e.hedgingDelay),e.nonFatalStatusCodes&&(n.nonFatalStatusCodes=e.nonFatalStatusCodes),n}(e.hedgingPolicy));return i}function a(e){if(!("maxTokens"in e)||"number"!=typeof e.maxTokens||e.maxTokens<=0||e.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in e)||"number"!=typeof e.tokenRatio||e.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+e.maxTokens.toFixed(3),tokenRatio:+e.tokenRatio.toFixed(3)}}function s(e){if("object"!=typeof e||null===e)throw new Error("Invalid loadBalancingConfig: unexpected type "+typeof e);const t=Object.keys(e);if(t.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${t}`);if(0===t.length)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[t[0]]:e[t[0]]}}function l(e){const t={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in e){if("string"!=typeof e.loadBalancingPolicy)throw new Error("Invalid service config: invalid loadBalancingPolicy");t.loadBalancingPolicy=e.loadBalancingPolicy}if("loadBalancingConfig"in e){if(!Array.isArray(e.loadBalancingConfig))throw new Error("Invalid service config: invalid loadBalancingConfig");for(const r of e.loadBalancingConfig)t.loadBalancingConfig.push(s(r))}if("methodConfig"in e&&Array.isArray(e.methodConfig))for(const r of e.methodConfig)t.methodConfig.push(i(r));"retryThrottling"in e&&(t.retryThrottling=a(e.retryThrottling));const r=[];for(const e of t.methodConfig)for(const t of e.name){for(const e of r)if(t.service===e.service&&t.method===e.method)throw new Error(`Invalid service config: duplicate name ${t.service}/${t.method}`);r.push(t)}return t}function p(e){if(!("serviceConfig"in e))throw new Error("Invalid service config choice: missing service config");const t={serviceConfig:l(e.serviceConfig)};if("clientLanguage"in e){if(!Array.isArray(e.clientLanguage))throw new Error("Invalid service config choice: invalid clientLanguage");t.clientLanguage=[];for(const r of e.clientLanguage){if("string"!=typeof r)throw new Error("Invalid service config choice: invalid clientLanguage");t.clientLanguage.push(r)}}if("clientHostname"in e){if(!Array.isArray(e.clientHostname))throw new Error("Invalid service config choice: invalid clientHostname");t.clientHostname=[];for(const r of e.clientHostname){if("string"!=typeof r)throw new Error("Invalid service config choice: invalid clientHostname");t.clientHostname.push(r)}}if("percentage"in e){if(!("number"==typeof e.percentage&&0<=e.percentage&&e.percentage<=100))throw new Error("Invalid service config choice: invalid percentage");t.percentage=e.percentage}const r=["clientLanguage","percentage","clientHostname","serviceConfig"];for(const t in e)if(!r.includes(t))throw new Error(`Invalid service config choice: unexpected field ${t}`);return t}function d(t,r){if(!Array.isArray(t))throw new Error("Invalid service config list");for(const o of t){const t=p(o);if(!("number"==typeof t.percentage&&r>t.percentage)){if(Array.isArray(t.clientHostname)){let r=!1;for(const n of t.clientHostname)n===e.hostname()&&(r=!0);if(!r)continue}if(Array.isArray(t.clientLanguage)){let e=!1;for(const r of t.clientLanguage)r===n&&(e=!0);if(!e)continue}return t.serviceConfig}}throw new Error("No matching service config found")}return serviceConfig}var connectivityState={},hasRequiredConnectivityState;function requireConnectivityState(){return hasRequiredConnectivityState||(hasRequiredConnectivityState=1,Object.defineProperty(connectivityState,"__esModule",{value:!0}),connectivityState.ConnectivityState=void 0,function(e){e[e.IDLE=0]="IDLE",e[e.CONNECTING=1]="CONNECTING",e[e.READY=2]="READY",e[e.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",e[e.SHUTDOWN=4]="SHUTDOWN"}(e||(connectivityState.ConnectivityState=e={}))),connectivityState;var e}var picker={},hasRequiredPicker;function requirePicker(){if(hasRequiredPicker)return picker;hasRequiredPicker=1,Object.defineProperty(picker,"__esModule",{value:!0}),picker.QueuePicker=picker.UnavailablePicker=picker.PickResultType=void 0;const e=requireMetadata(),t=requireConstants();var r;!function(e){e[e.COMPLETE=0]="COMPLETE",e[e.QUEUE=1]="QUEUE",e[e.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",e[e.DROP=3]="DROP"}(r||(picker.PickResultType=r={}));picker.UnavailablePicker=class{constructor(r){this.status=Object.assign({code:t.Status.UNAVAILABLE,details:"No connection established",metadata:new e.Metadata},r)}pick(e){return{pickResultType:r.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};return picker.QueuePicker=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:r.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}},picker}var backoffTimeout={},hasRequiredBackoffTimeout;function requireBackoffTimeout(){if(hasRequiredBackoffTimeout)return backoffTimeout;hasRequiredBackoffTimeout=1,Object.defineProperty(backoffTimeout,"__esModule",{value:!0}),backoffTimeout.BackoffTimeout=void 0;const e=requireConstants(),t=requireLogging();class r{constructor(e,t){this.callback=e,this.initialDelay=1e3,this.multiplier=1.6,this.maxDelay=12e4,this.jitter=.2,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(r){t.trace(e.LogVerbosity.DEBUG,"backoff","{"+this.id+"} "+r)}runTimer(e){var t,r;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||null===(r=(t=this.timerId).unref)||void 0===r||r.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);const e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;var r,n;this.nextDelay=e+(r=-t,n=t,Math.random()*(n-r)+r)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){const e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,null===(t=(e=this.timerId).ref)||void 0===t||t.call(e)}unref(){var e,t;this.hasRef=!1,null===(t=(e=this.timerId).unref)||void 0===t||t.call(e)}getEndTime(){return this.endTime}}return backoffTimeout.BackoffTimeout=r,r.nextId=0,backoffTimeout}var loadBalancerChildHandler={},hasRequiredLoadBalancerChildHandler,hasRequiredResolvingLoadBalancer;function requireLoadBalancerChildHandler(){if(hasRequiredLoadBalancerChildHandler)return loadBalancerChildHandler;hasRequiredLoadBalancerChildHandler=1,Object.defineProperty(loadBalancerChildHandler,"__esModule",{value:!0}),loadBalancerChildHandler.ChildLoadBalancerHandler=void 0;const e=requireLoadBalancer(),t=requireConnectivityState();return loadBalancerChildHandler.ChildLoadBalancerHandler=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(e){this.parent=e,this.child=null}createSubchannel(e,t){return this.parent.channelControlHelper.createSubchannel(e,t)}updateState(e,r,n){var o;if(this.calledByPendingChild()){if(e===t.ConnectivityState.CONNECTING)return;null===(o=this.parent.currentChild)||void 0===o||o.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(e,r,n)}requestReresolution(){var e;const t=null!==(e=this.parent.pendingChild)&&void 0!==e?e:this.parent.currentChild;this.child===t&&this.parent.channelControlHelper.requestReresolution()}setChild(e){this.child=e}addChannelzChild(e){this.parent.channelControlHelper.addChannelzChild(e)}removeChannelzChild(e){this.parent.channelControlHelper.removeChannelzChild(e)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(t,r,n,o){let i;if(null===this.currentChild||null===this.latestConfig||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,r)){const t=new this.ChildPolicyHelper(this),n=(0,e.createLoadBalancer)(r,t);t.setChild(n),null===this.currentChild?(this.currentChild=n,i=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=n,i=this.pendingChild)}else i=null===this.pendingChild?this.currentChild:this.pendingChild;return this.latestConfig=r,i.updateAddressList(t,r,n,o)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return"child_load_balancer_helper"}},loadBalancerChildHandler}function requireResolvingLoadBalancer(){if(hasRequiredResolvingLoadBalancer)return resolvingLoadBalancer;hasRequiredResolvingLoadBalancer=1,Object.defineProperty(resolvingLoadBalancer,"__esModule",{value:!0}),resolvingLoadBalancer.ResolvingLoadBalancer=void 0;const e=requireLoadBalancer(),t=requireServiceConfig(),r=requireConnectivityState(),n=requireResolver(),o=requirePicker(),i=requireBackoffTimeout(),a=requireConstants(),s=requireMetadata(),l=requireLogging(),p=requireConstants(),d=requireUriParser(),u=requireLoadBalancerChildHandler();function c(e){l.trace(p.LogVerbosity.DEBUG,"resolving_load_balancer",e)}const f=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function h(e,t,r,n){for(const o of r.name)switch(n){case"EMPTY":if(!o.service&&!o.method)return!0;break;case"SERVICE":if(o.service===e&&!o.method)return!0;break;case"SERVICE_AND_METHOD":if(o.service===e&&o.method===t)return!0}return!1}function m(e,t,r,n){for(const o of r)if(h(e,t,o,n))return o;return null}return resolvingLoadBalancer.ResolvingLoadBalancer=class{constructor(e,a,s,l,p){this.target=e,this.channelControlHelper=a,this.channelOptions=s,this.onSuccessfulResolution=l,this.onFailedResolution=p,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new o.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,s["grpc.service_config"]?this.defaultServiceConfig=(0,t.validateServiceConfig)(JSON.parse(s["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new o.QueuePicker(this),null),this.childLoadBalancer=new u.ChildLoadBalancerHandler({createSubchannel:a.createSubchannel.bind(a),requestReresolution:()=>{this.backoffTimeout.isRunning()?(c("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(e,t,r)=>{this.latestChildState=e,this.latestChildPicker=t,this.latestChildErrorMessage=r,this.updateState(e,t,r)},addChannelzChild:a.addChannelzChild.bind(a),removeChannelzChild:a.removeChannelzChild.bind(a)}),this.innerResolver=(0,n.createResolver)(e,this.handleResolverResult.bind(this),s);const d={initialDelay:s["grpc.initial_reconnect_backoff_ms"],maxDelay:s["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new i.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},d),this.backoffTimeout.unref()}handleResolverResult(t,r,o,i){var l,p;this.backoffTimeout.stop(),this.backoffTimeout.reset();let d=!0,u=null;if(null===o?u=this.defaultServiceConfig:o.ok?u=o.value:null!==this.previousServiceConfig?u=this.previousServiceConfig:(d=!1,this.handleResolutionFailure(o.error)),null!==u){const n=null!==(l=null==u?void 0:u.loadBalancingConfig)&&void 0!==l?l:[],o=(0,e.selectLbConfigFromList)(n,!0);null===o?(d=!1,this.handleResolutionFailure({code:a.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new s.Metadata})):d=this.childLoadBalancer.updateAddressList(t,o,Object.assign(Object.assign({},this.channelOptions),r),i)}return d&&this.onSuccessfulResolution(u,null!==(p=r[n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])&&void 0!==p?p:function(e){return{invoke(t,r){var n,o;const i=t.split("/").filter(e=>e.length>0),s=null!==(n=i[0])&&void 0!==n?n:"",l=null!==(o=i[1])&&void 0!==o?o:"";if(e&&e.methodConfig)for(const t of f){const r=m(s,l,e.methodConfig,t);if(r)return{methodConfig:r,pickInformation:{},status:a.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:a.Status.OK,dynamicFilterFactories:[]}},unref(){}}}(u)),d}updateResolution(){this.innerResolver.updateResolution(),this.currentState===r.ConnectivityState.IDLE&&this.updateState(r.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,n){c((0,d.uriToString)(this.target)+" "+r.ConnectivityState[this.currentState]+" -> "+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new o.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}handleResolutionFailure(e){this.latestChildState===r.ConnectivityState.IDLE&&(this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new o.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){this.currentState!==r.ConnectivityState.IDLE&&this.currentState!==r.ConnectivityState.TRANSIENT_FAILURE||(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new o.QueuePicker(this),this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}},resolvingLoadBalancer}var subchannelPool={},channelOptions={},hasRequiredChannelOptions;function requireChannelOptions(){if(hasRequiredChannelOptions)return channelOptions;return hasRequiredChannelOptions=1,Object.defineProperty(channelOptions,"__esModule",{value:!0}),channelOptions.recognizedOptions=void 0,channelOptions.channelOptionsEqual=function(e,t){const r=Object.keys(e).sort(),n=Object.keys(t).sort();if(r.length!==n.length)return!1;for(let o=0;o<r.length;o+=1){if(r[o]!==n[o])return!1;if(e[r[o]]!==t[n[o]])return!1}return!0},channelOptions.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0},channelOptions}var subchannel={},subchannelAddress={},hasRequiredSubchannelAddress;function requireSubchannelAddress(){if(hasRequiredSubchannelAddress)return subchannelAddress;hasRequiredSubchannelAddress=1,Object.defineProperty(subchannelAddress,"__esModule",{value:!0}),subchannelAddress.EndpointMap=void 0,subchannelAddress.isTcpSubchannelAddress=t,subchannelAddress.subchannelAddressEqual=r,subchannelAddress.subchannelAddressToString=n,subchannelAddress.stringToSubchannelAddress=function(t,r){return(0,e.isIP)(t)?{host:t,port:null!=r?r:o}:{path:t}},subchannelAddress.endpointEqual=function(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n=0;n<e.addresses.length;n++)if(!r(e.addresses[n],t.addresses[n]))return!1;return!0},subchannelAddress.endpointToString=function(e){return"["+e.addresses.map(n).join(", ")+"]"},subchannelAddress.endpointHasAddress=i;const e=require$$0__default$2.default;function t(e){return"port"in e}function r(e,r){return!e&&!r||!(!e||!r)&&(t(e)?t(r)&&e.host===r.host&&e.port===r.port:!t(r)&&e.path===r.path)}function n(r){return t(r)?(0,e.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}const o=443;function i(e,t){for(const n of e.addresses)if(r(n,t))return!0;return!1}function a(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(const n of e.addresses){let e=!1;for(const o of t.addresses)if(r(n,o)){e=!0;break}if(!e)return!1}return!0}return subchannelAddress.EndpointMap=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(const t of this.map)if(i(t.key,e))return t.value}deleteMissing(e){const t=[];for(const r of this.map){let n=!1;for(const t of e)a(t,r.key)&&(n=!0);n||(t.push(r.value),this.map.delete(r))}return t}get(e){for(const t of this.map)if(a(e,t.key))return t.value}set(e,t){for(const r of this.map)if(a(e,r.key))return void(r.value=t);this.map.add({key:e,value:t})}delete(e){for(const t of this.map)if(a(e,t.key))return void this.map.delete(t)}has(e){for(const t of this.map)if(a(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(const e of this.map)yield e.key}*values(){for(const e of this.map)yield e.value}*entries(){for(const e of this.map)yield[e.key,e.value]}},subchannelAddress}var channelz={},extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function __generator(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}"function"==typeof SuppressedError&&SuppressedError;var TreeNode=function(){function e(e,t,r){void 0===r&&(r=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=r}return e.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&1===e.l)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var r=e.h;r.t===e;)r=(e=r).h;e=r}return e},e.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}for(var t=e.h;t.i===e;)t=(e=t).h;return e.i!==t?t:e},e.prototype.T=function(){var e=this.h,t=this.i,r=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=r,r&&(r.h=this),t},e.prototype.I=function(){var e=this.h,t=this.t,r=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=r,r&&(r.h=this),t},e}(),TreeNodeEnableIndex=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.O=1,t}return __extends(t,e),t.prototype.T=function(){var t=e.prototype.T.call(this);return this.M(),t.M(),t},t.prototype.I=function(){var t=e.prototype.I.call(this);return this.M(),t.M(),t},t.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},t}(TreeNode),ContainerIterator=function(){function e(e){void 0===e&&(e=0),this.iteratorType=e}return e.prototype.equals=function(e){return this.C===e.C},e}(),Base=function(){function e(){this._=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),e.prototype.size=function(){return this._},e.prototype.empty=function(){return 0===this._},e}(),Container=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(Base);function throwIteratorAccessError(){throw new RangeError("Iterator access denied!")}var TreeContainer=function(e){function t(t,r){void 0===t&&(t=function(e,t){return e<t?-1:e>t?1:0}),void 0===r&&(r=!1);var n=e.call(this)||this;return n.N=void 0,n.g=t,n.enableIndex=r,n.S=r?TreeNodeEnableIndex:TreeNode,n.A=new n.S,n}return __extends(t,e),t.prototype.m=function(e,t){for(var r=this.A;e;){var n=this.g(e.u,t);if(n<0)e=e.i;else{if(!(n>0))return e;r=e,e=e.t}}return r},t.prototype.B=function(e,t){for(var r=this.A;e;){this.g(e.u,t)<=0?e=e.i:(r=e,e=e.t)}return r},t.prototype.j=function(e,t){for(var r=this.A;e;){var n=this.g(e.u,t);if(n<0)r=e,e=e.i;else{if(!(n>0))return e;e=e.t}}return r},t.prototype.k=function(e,t){for(var r=this.A;e;){this.g(e.u,t)<0?(r=e,e=e.i):e=e.t}return r},t.prototype.R=function(e){for(;;){var t,r=e.h;if(r===this.A)return;if(1===e.l)return void(e.l=0);if(e===r.t)if(1===(t=r.i).l)t.l=0,r.l=1,r===this.N?this.N=r.T():r.T();else{if(t.i&&1===t.i.l)return t.l=r.l,r.l=0,t.i.l=0,void(r===this.N?this.N=r.T():r.T());t.t&&1===t.t.l?(t.l=1,t.t.l=0,t.I()):(t.l=1,e=r)}else if(1===(t=r.t).l)t.l=0,r.l=1,r===this.N?this.N=r.I():r.I();else{if(t.t&&1===t.t.l)return t.l=r.l,r.l=0,t.t.l=0,void(r===this.N?this.N=r.I():r.I());t.i&&1===t.i.l?(t.l=1,t.i.l=0,t.T()):(t.l=1,e=r)}}},t.prototype.G=function(e){if(1!==this._){for(var t=e;t.t||t.i;){if(t.i)for(t=t.i;t.t;)t=t.t;else t=t.t;var r=e.u;e.u=t.u,t.u=r;var n=e.o;e.o=t.o,t.o=n,e=t}this.A.t===t?this.A.t=t.h:this.A.i===t&&(this.A.i=t.h),this.R(t);var o=t.h;if(t===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.h}else this.clear()},t.prototype.P=function(e){for(var t="number"==typeof e?e:void 0,r="function"==typeof e?e:void 0,n=void 0===e?[]:void 0,o=0,i=this.N,a=[];a.length||i;)if(i)a.push(i),i=i.t;else{if(i=a.pop(),o===t)return i;n&&n.push(i),r&&r(i,o,this),o+=1,i=i.i}return n},t.prototype.q=function(e){for(;;){var t=e.h;if(0===t.l)return;var r=t.h;if(t===r.t){if((n=r.i)&&1===n.l){if(n.l=t.l=0,r===this.N)return;r.l=1,e=r;continue}if(e!==t.i)return t.l=0,r===this.N?this.N=r.I():r.I(),void(r.l=1);e.l=0,e.t&&(e.t.h=t),e.i&&(e.i.h=r),t.i=e.t,r.t=e.i,e.t=t,e.i=r,r===this.N?(this.N=e,this.A.h=e):(o=r.h).t===r?o.t=e:o.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}else{var n,o;if((n=r.t)&&1===n.l){if(n.l=t.l=0,r===this.N)return;r.l=1,e=r;continue}if(e!==t.t)return t.l=0,r===this.N?this.N=r.T():r.T(),void(r.l=1);e.l=0,e.t&&(e.t.h=r),e.i&&(e.i.h=t),r.i=e.t,t.t=e.i,e.t=r,e.i=t,r===this.N?(this.N=e,this.A.h=e):(o=r.h).t===r?o.t=e:o.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}return void(this.enableIndex&&(t.M(),r.M(),e.M()))}},t.prototype.D=function(e,t,r){if(void 0===this.N)return this._+=1,this.N=new this.S(e,t,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var n,o=this.A.t,i=this.g(o.u,e);if(0===i)return o.o=t,this._;if(i>0)o.t=new this.S(e,t),o.t.h=o,n=o.t,this.A.t=n;else{var a=this.A.i,s=this.g(a.u,e);if(0===s)return a.o=t,this._;if(s<0)a.i=new this.S(e,t),a.i.h=a,n=a.i,this.A.i=n;else{if(void 0!==r){var l=r.C;if(l!==this.A){var p=this.g(l.u,e);if(0===p)return l.o=t,this._;if(p>0){var d=l.v(),u=this.g(d.u,e);if(0===u)return d.o=t,this._;u<0&&(n=new this.S(e,t),void 0===d.i?(d.i=n,n.h=d):(l.t=n,n.h=l))}}}if(void 0===n)for(n=this.N;;){var c=this.g(n.u,e);if(c>0){if(void 0===n.t){n.t=new this.S(e,t),n.t.h=n,n=n.t;break}n=n.t}else{if(!(c<0))return n.o=t,this._;if(void 0===n.i){n.i=new this.S(e,t),n.i.h=n,n=n.i;break}n=n.i}}}}if(this.enableIndex)for(var f=n.h;f!==this.A;)f.O+=1,f=f.h;return this.q(n),this._+=1,this._},t.prototype.F=function(e,t){for(;e;){var r=this.g(e.u,t);if(r<0)e=e.i;else{if(!(r>0))return e;e=e.t}}return e||this.A},t.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},t.prototype.updateKeyByIterator=function(e,t){var r=e.C;if(r===this.A&&throwIteratorAccessError(),1===this._)return r.u=t,!0;var n=r.p().u;if(r===this.A.t)return this.g(n,t)>0&&(r.u=t,!0);var o=r.v().u;return r===this.A.i?this.g(o,t)<0&&(r.u=t,!0):!(this.g(o,t)>=0||this.g(n,t)<=0)&&(r.u=t,!0)},t.prototype.eraseElementByPos=function(e){if(e<0||e>this._-1)throw new RangeError;var t=this.P(e);return this.G(t),this._},t.prototype.eraseElementByKey=function(e){if(0===this._)return!1;var t=this.F(this.N,e);return t!==this.A&&(this.G(t),!0)},t.prototype.eraseElementByIterator=function(e){var t=e.C;t===this.A&&throwIteratorAccessError();var r=void 0===t.i;return 0===e.iteratorType?r&&e.next():r&&void 0!==t.t||e.next(),this.G(t),e},t.prototype.getHeight=function(){if(0===this._)return 0;return function e(t){return t?Math.max(e(t.t),e(t.i))+1:0}(this.N)},t}(Container),TreeIterator=function(e){function t(t,r,n){var o=e.call(this,n)||this;return o.C=t,o.A=r,0===o.iteratorType?(o.pre=function(){return this.C===this.A.t&&throwIteratorAccessError(),this.C=this.C.v(),this},o.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.p(),this}):(o.pre=function(){return this.C===this.A.i&&throwIteratorAccessError(),this.C=this.C.p(),this},o.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.v(),this}),o}return __extends(t,e),Object.defineProperty(t.prototype,"index",{get:function(){var e=this.C,t=this.A.h;if(e===this.A)return t?t.O-1:0;var r=0;for(e.t&&(r+=e.t.O);e!==t;){var n=e.h;e===n.i&&(r+=1,n.t&&(r+=n.t.O)),e=n}return r},enumerable:!1,configurable:!0}),t.prototype.isAccessible=function(){return this.C!==this.A},t}(ContainerIterator),OrderedMapIterator=function(e){function t(t,r,n,o){var i=e.call(this,t,r,o)||this;return i.container=n,i}return __extends(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){this.C===this.A&&throwIteratorAccessError();var e=this;return new Proxy([],{get:function(t,r){return"0"===r?e.C.u:"1"===r?e.C.o:(t[0]=e.C.u,t[1]=e.C.o,t[r])},set:function(t,r,n){if("1"!==r)throw new TypeError("prop must be 1");return e.C.o=n,!0}})},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.C,this.A,this.container,this.iteratorType)},t}(TreeIterator),OrderedMap=function(e){function t(t,r,n){void 0===t&&(t=[]);var o=e.call(this,r,n)||this,i=o;return t.forEach(function(e){i.setElement(e[0],e[1])}),o}return __extends(t,e),t.prototype.begin=function(){return new OrderedMapIterator(this.A.t||this.A,this.A,this)},t.prototype.end=function(){return new OrderedMapIterator(this.A,this.A,this)},t.prototype.rBegin=function(){return new OrderedMapIterator(this.A.i||this.A,this.A,this,1)},t.prototype.rEnd=function(){return new OrderedMapIterator(this.A,this.A,this,1)},t.prototype.front=function(){if(0!==this._){var e=this.A.t;return[e.u,e.o]}},t.prototype.back=function(){if(0!==this._){var e=this.A.i;return[e.u,e.o]}},t.prototype.lowerBound=function(e){var t=this.m(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.upperBound=function(e){var t=this.B(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.reverseLowerBound=function(e){var t=this.j(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.reverseUpperBound=function(e){var t=this.k(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.forEach=function(e){this.P(function(t,r,n){e([t.u,t.o],r,n)})},t.prototype.setElement=function(e,t,r){return this.D(e,t,r)},t.prototype.getElementByPos=function(e){if(e<0||e>this._-1)throw new RangeError;var t=this.P(e);return[t.u,t.o]},t.prototype.find=function(e){var t=this.F(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.getElementByKey=function(e){return this.F(this.N,e).o},t.prototype.union=function(e){var t=this;return e.forEach(function(e){t.setElement(e[0],e[1])}),this._},t.prototype[Symbol.iterator]=function(){var e,t,r,n;return __generator(this,function(o){switch(o.label){case 0:e=this._,t=this.P(),r=0,o.label=1;case 1:return r<e?[4,[(n=t[r]).u,n.o]]:[3,4];case 2:o.sent(),o.label=3;case 3:return++r,[3,1];case 4:return[2]}})},t}(TreeContainer),esm=Object.freeze({__proto__:null,OrderedMap:OrderedMap}),require$$1$2=getAugmentedNamespace(esm),admin={},hasRequiredAdmin;function requireAdmin(){if(hasRequiredAdmin)return admin;hasRequiredAdmin=1,Object.defineProperty(admin,"__esModule",{value:!0}),admin.registerAdminService=function(t,r){e.push({getServiceDefinition:t,getHandlers:r})},admin.addAdminServicesToServer=function(t){for(const{getServiceDefinition:r,getHandlers:n}of e)t.addService(r(),n())};const e=[];return admin}var makeClient={},client={},call$1={},hasRequiredCall$1;function requireCall$1(){if(hasRequiredCall$1)return call$1;hasRequiredCall$1=1,Object.defineProperty(call$1,"__esModule",{value:!0}),call$1.ClientDuplexStreamImpl=call$1.ClientWritableStreamImpl=call$1.ClientReadableStreamImpl=call$1.ClientUnaryCallImpl=void 0,call$1.callErrorFromStatus=function(e,t){const n=`${e.code} ${r.Status[e.code]}: ${e.details}`,o=new Error(n),i=`${o.stack}\nfor call at\n${t}`;return Object.assign(new Error(n),e,{stack:i})};const e=require$$0__default$3.default,t=Stream__default.default,r=requireConstants();class n extends e.EventEmitter{constructor(){super()}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}}call$1.ClientUnaryCallImpl=n;class o extends t.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_read(e){var t;null===(t=this.call)||void 0===t||t.startRead()}}call$1.ClientReadableStreamImpl=o;class i extends t.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_write(e,t,r){var n;const o={callback:r},i=Number(t);Number.isNaN(i)||(o.flags=i),null===(n=this.call)||void 0===n||n.sendMessageWithContext(o,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}call$1.ClientWritableStreamImpl=i;class a extends t.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_read(e){var t;null===(t=this.call)||void 0===t||t.startRead()}_write(e,t,r){var n;const o={callback:r},i=Number(t);Number.isNaN(i)||(o.flags=i),null===(n=this.call)||void 0===n||n.sendMessageWithContext(o,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}return call$1.ClientDuplexStreamImpl=a,call$1}var clientInterceptors={},callInterface={},hasRequiredCallInterface,hasRequiredClientInterceptors,hasRequiredClient,hasRequiredMakeClient;function requireCallInterface(){if(hasRequiredCallInterface)return callInterface;hasRequiredCallInterface=1,Object.defineProperty(callInterface,"__esModule",{value:!0}),callInterface.InterceptingListenerImpl=void 0,callInterface.statusOrFromValue=function(e){return{ok:!0,value:e}},callInterface.statusOrFromError=function(t){var r;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:null!==(r=t.metadata)&&void 0!==r?r:new e.Metadata})}},callInterface.isInterceptingListener=function(e){return void 0!==e.onReceiveMetadata&&1===e.onReceiveMetadata.length};const e=requireMetadata();return callInterface.InterceptingListenerImpl=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextListener.onReceiveStatus(e)})}},callInterface}function requireClientInterceptors(){if(hasRequiredClientInterceptors)return clientInterceptors;hasRequiredClientInterceptors=1,Object.defineProperty(clientInterceptors,"__esModule",{value:!0}),clientInterceptors.InterceptingCall=clientInterceptors.RequesterBuilder=clientInterceptors.ListenerBuilder=clientInterceptors.InterceptorConfigurationError=void 0,clientInterceptors.getInterceptingCall=function(e,t,r,n){if(e.clientInterceptors.length>0&&e.clientInterceptorProviders.length>0)throw new o("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(e.callInterceptors.length>0&&e.callInterceptorProviders.length>0)throw new o("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];i=e.callInterceptors.length>0||e.callInterceptorProviders.length>0?[].concat(e.callInterceptors,e.callInterceptorProviders.map(e=>e(t))).filter(e=>e):[].concat(e.clientInterceptors,e.clientInterceptorProviders.map(e=>e(t))).filter(e=>e);const a=Object.assign({},r,{method_definition:t}),s=i.reduceRight((e,t)=>r=>t(r,e),e=>d(n,e,t));return s(a)};const e=requireMetadata(),t=requireCallInterface(),r=requireConstants(),n=requireError();class o extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,o)}}clientInterceptors.InterceptorConfigurationError=o;clientInterceptors.ListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};clientInterceptors.RequesterBuilder=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};const i={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveStatus:(e,t)=>{t(e)}},a={start:(e,t,r)=>{r(e,t)},sendMessage:(e,t)=>{t(e)},halfClose:e=>{e()},cancel:e=>{e()}};clientInterceptors.InterceptingCall=class{constructor(e,t){var r,n,o,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,this.requester=t?{start:null!==(r=t.start)&&void 0!==r?r:a.start,sendMessage:null!==(n=t.sendMessage)&&void 0!==n?n:a.sendMessage,halfClose:null!==(o=t.halfClose)&&void 0!==o?o:a.halfClose,cancel:null!==(i=t.cancel)&&void 0!==i?i:a.cancel}:a}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,r){var n,o,a,s,l,p;const d={onReceiveMetadata:null!==(o=null===(n=null==r?void 0:r.onReceiveMetadata)||void 0===n?void 0:n.bind(r))&&void 0!==o?o:e=>{},onReceiveMessage:null!==(s=null===(a=null==r?void 0:r.onReceiveMessage)||void 0===a?void 0:a.bind(r))&&void 0!==s?s:e=>{},onReceiveStatus:null!==(p=null===(l=null==r?void 0:r.onReceiveStatus)||void 0===l?void 0:l.bind(r))&&void 0!==p?p:e=>{}};this.processingMetadata=!0,this.requester.start(e,d,(e,r)=>{var n,o,a;let s;if(this.processingMetadata=!1,(0,t.isInterceptingListener)(r))s=r;else{const e={onReceiveMetadata:null!==(n=r.onReceiveMetadata)&&void 0!==n?n:i.onReceiveMetadata,onReceiveMessage:null!==(o=r.onReceiveMessage)&&void 0!==o?o:i.onReceiveMessage,onReceiveStatus:null!==(a=r.onReceiveStatus)&&void 0!==a?a:i.onReceiveStatus};s=new t.InterceptingListenerImpl(e,d)}this.nextCall.start(e,s),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,r),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};class s{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let o;try{o=this.methodDefinition.requestSerialize(t)}catch(e){return void this.call.cancelWithStatus(r.Status.INTERNAL,`Request message serialization failure: ${(0,n.getErrorMessage)(e)}`)}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(t,o){let i=null;this.call.start(t,{onReceiveMetadata:e=>{var t;null===(t=null==o?void 0:o.onReceiveMetadata)||void 0===t||t.call(o,e)},onReceiveMessage:t=>{var a;let s;try{s=this.methodDefinition.responseDeserialize(t)}catch(t){return i={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,n.getErrorMessage)(t)}`,metadata:new e.Metadata},void this.call.cancelWithStatus(i.code,i.details)}null===(a=null==o?void 0:o.onReceiveMessage)||void 0===a||a.call(o,s)},onReceiveStatus:e=>{var t,r;i?null===(t=null==o?void 0:o.onReceiveStatus)||void 0===t||t.call(o,i):null===(r=null==o?void 0:o.onReceiveStatus)||void 0===r||r.call(o,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}}class l extends s{constructor(e,t){super(e,t)}start(e,t){var r,n;let o=!1;const i={onReceiveMetadata:null!==(n=null===(r=null==t?void 0:t.onReceiveMetadata)||void 0===r?void 0:r.bind(t))&&void 0!==n?n:e=>{},onReceiveMessage:e=>{var r;o=!0,null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,e)},onReceiveStatus:e=>{var r,n;o||null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,null),null===(n=null==t?void 0:t.onReceiveStatus)||void 0===n||n.call(t,e)}};super.start(e,i),this.call.startRead()}}class p extends s{}function d(e,t,r){const n=function(e,t,r){var n,o;const i=null!==(n=r.deadline)&&void 0!==n?n:1/0,a=r.host,s=null!==(o=r.parent)&&void 0!==o?o:null,l=r.propagate_flags,p=r.credentials,d=e.createCall(t,i,a,s,l);return p&&d.setCredentials(p),d}(e,r.path,t);return r.responseStream?new p(n,r):new l(n,r)}return clientInterceptors}function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1,Object.defineProperty(client,"__esModule",{value:!0}),client.Client=void 0;const e=requireCall$1(),t=requireChannel(),r=requireConnectivityState(),n=requireConstants(),o=requireMetadata(),i=requireClientInterceptors(),a=Symbol(),s=Symbol(),l=Symbol(),p=Symbol();function d(e){return"function"==typeof e}function u(e){var t;return(null===(t=e.stack)||void 0===t?void 0:t.split("\n").slice(1).join("\n"))||"no stack trace available"}return client.Client=class{constructor(e,r,n={}){var o,i;if(n=Object.assign({},n),this[s]=null!==(o=n.interceptors)&&void 0!==o?o:[],delete n.interceptors,this[l]=null!==(i=n.interceptor_providers)&&void 0!==i?i:[],delete n.interceptor_providers,this[s].length>0&&this[l].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[p]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[a]=n.channelOverride;else if(n.channelFactoryOverride){const t=n.channelFactoryOverride;delete n.channelFactoryOverride,this[a]=t(e,r,n)}else this[a]=new t.ChannelImplementation(e,r,n)}close(){this[a].close()}getChannel(){return this[a]}waitForReady(e,t){const n=o=>{if(o)return void t(new Error("Failed to connect before the deadline"));let i;try{i=this[a].getConnectivityState(!0)}catch(e){return void t(new Error("The channel has been closed"))}if(i===r.ConnectivityState.READY)t();else try{this[a].watchConnectivityState(i,e,n)}catch(e){t(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,r){if(d(e))return{metadata:new o.Metadata,options:{},callback:e};if(d(t))return e instanceof o.Metadata?{metadata:e,options:{},callback:t}:{metadata:new o.Metadata,options:e,callback:t};if(!(e instanceof o.Metadata&&t instanceof Object&&d(r)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:r}}makeUnaryRequest(t,r,o,d,c,f,h){var m,g;const y=this.checkOptionalUnaryResponseArguments(c,f,h),v={path:t,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:o};let b={argument:d,metadata:y.metadata,call:new e.ClientUnaryCallImpl,channel:this[a],methodDefinition:v,callOptions:y.options,callback:y.callback};this[p]&&(b=this[p](b));const O=b.call,w={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(m=b.callOptions.interceptors)&&void 0!==m?m:[],callInterceptorProviders:null!==(g=b.callOptions.interceptor_providers)&&void 0!==g?g:[]},S=(0,i.getInterceptingCall)(w,b.methodDefinition,b.callOptions,b.channel);O.call=S;let _=null,P=!1,E=new Error;return S.start(b.metadata,{onReceiveMetadata:e=>{O.emit("metadata",e)},onReceiveMessage(e){null!==_&&S.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),_=e},onReceiveStatus(t){if(!P){if(P=!0,t.code===n.Status.OK)if(null===_){const r=u(E);b.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else b.callback(null,_);else{const r=u(E);b.callback((0,e.callErrorFromStatus)(t,r))}E=null,O.emit("status",t)}}}),S.sendMessage(d),S.halfClose(),O}makeClientStreamRequest(t,r,o,d,c,f){var h,m;const g=this.checkOptionalUnaryResponseArguments(d,c,f),y={path:t,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:o};let v={metadata:g.metadata,call:new e.ClientWritableStreamImpl(r),channel:this[a],methodDefinition:y,callOptions:g.options,callback:g.callback};this[p]&&(v=this[p](v));const b=v.call,O={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(h=v.callOptions.interceptors)&&void 0!==h?h:[],callInterceptorProviders:null!==(m=v.callOptions.interceptor_providers)&&void 0!==m?m:[]},w=(0,i.getInterceptingCall)(O,v.methodDefinition,v.callOptions,v.channel);b.call=w;let S=null,_=!1,P=new Error;return w.start(v.metadata,{onReceiveMetadata:e=>{b.emit("metadata",e)},onReceiveMessage(e){null!==S&&w.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),S=e,w.startRead()},onReceiveStatus(t){if(!_){if(_=!0,t.code===n.Status.OK)if(null===S){const r=u(P);v.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else v.callback(null,S);else{const r=u(P);v.callback((0,e.callErrorFromStatus)(t,r))}P=null,b.emit("status",t)}}}),b}checkMetadataAndOptions(e,t){let r,n;return e instanceof o.Metadata?(r=e,n=t||{}):(n=e||{},r=new o.Metadata),{metadata:r,options:n}}makeServerStreamRequest(t,r,o,d,c,f){var h,m;const g=this.checkMetadataAndOptions(c,f),y={path:t,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:o};let v={argument:d,metadata:g.metadata,call:new e.ClientReadableStreamImpl(o),channel:this[a],methodDefinition:y,callOptions:g.options};this[p]&&(v=this[p](v));const b=v.call,O={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(h=v.callOptions.interceptors)&&void 0!==h?h:[],callInterceptorProviders:null!==(m=v.callOptions.interceptor_providers)&&void 0!==m?m:[]},w=(0,i.getInterceptingCall)(O,v.methodDefinition,v.callOptions,v.channel);b.call=w;let S=!1,_=new Error;return w.start(v.metadata,{onReceiveMetadata(e){b.emit("metadata",e)},onReceiveMessage(e){b.push(e)},onReceiveStatus(t){if(!S){if(S=!0,b.push(null),t.code!==n.Status.OK){const r=u(_);b.emit("error",(0,e.callErrorFromStatus)(t,r))}_=null,b.emit("status",t)}}}),w.sendMessage(d),w.halfClose(),b}makeBidiStreamRequest(t,r,o,d,c){var f,h;const m=this.checkMetadataAndOptions(d,c),g={path:t,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:o};let y={metadata:m.metadata,call:new e.ClientDuplexStreamImpl(r,o),channel:this[a],methodDefinition:g,callOptions:m.options};this[p]&&(y=this[p](y));const v=y.call,b={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(f=y.callOptions.interceptors)&&void 0!==f?f:[],callInterceptorProviders:null!==(h=y.callOptions.interceptor_providers)&&void 0!==h?h:[]},O=(0,i.getInterceptingCall)(b,y.methodDefinition,y.callOptions,y.channel);v.call=O;let w=!1,S=new Error;return O.start(y.metadata,{onReceiveMetadata(e){v.emit("metadata",e)},onReceiveMessage(e){v.push(e)},onReceiveStatus(t){if(!w){if(w=!0,v.push(null),t.code!==n.Status.OK){const r=u(S);v.emit("error",(0,e.callErrorFromStatus)(t,r))}S=null,v.emit("status",t)}}}),v}},client}function requireMakeClient(){if(hasRequiredMakeClient)return makeClient;hasRequiredMakeClient=1,Object.defineProperty(makeClient,"__esModule",{value:!0}),makeClient.makeClientConstructor=n,makeClient.loadPackageDefinition=function(e){const t={};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=e[i],s=i.split(".");if(s.some(e=>r(e)))continue;const l=s[s.length-1];let p=t;for(const e of s.slice(0,-1))p[e]||(p[e]={}),p=p[e];o(a)?p[l]=a:p[l]=n(a,l)}return t};const e=requireClient(),t={unary:e.Client.prototype.makeUnaryRequest,server_stream:e.Client.prototype.makeServerStreamRequest,client_stream:e.Client.prototype.makeClientStreamRequest,bidi:e.Client.prototype.makeBidiStreamRequest};function r(e){return["__proto__","prototype","constructor"].includes(e)}function n(n,o,i){class a extends e.Client{}return Object.keys(n).forEach(e=>{if(r(e))return;const o=n[e];let i;if("string"==typeof e&&"$"===e.charAt(0))throw new Error("Method names cannot start with $");i=o.requestStream?o.responseStream?"bidi":"client_stream":o.responseStream?"server_stream":"unary";const s=o.requestSerialize,l=o.responseDeserialize,p=function(e,t,r,n){return function(...o){return e.call(this,t,r,n,...o)}}(t[i],o.path,s,l);a.prototype[e]=p,Object.assign(a.prototype[e],o),o.originalName&&!r(o.originalName)&&(a.prototype[o.originalName]=a.prototype[e])}),a.service=n,a.serviceName=o,a}function o(e){return"format"in e}return makeClient}var src$5={},lodash_camelcase,hasRequiredLodash_camelcase;function requireLodash_camelcase(){if(hasRequiredLodash_camelcase)return lodash_camelcase;hasRequiredLodash_camelcase=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\ud800-\\udfff",o="\\u0300-\\u036f\\ufe20-\\ufe23",i="\\u20d0-\\u20f0",a="\\u2700-\\u27bf",s="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",p="\\ufe0e\\ufe0f",d="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",u="['’]",c="["+n+"]",f="["+d+"]",h="["+o+i+"]",m="\\d+",g="["+a+"]",y="["+s+"]",v="[^"+n+d+m+a+s+l+"]",b="\\ud83c[\\udffb-\\udfff]",O="[^"+n+"]",w="(?:\\ud83c[\\udde6-\\uddff]){2}",S="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+l+"]",P="\\u200d",E="(?:"+y+"|"+v+")",T="(?:"+_+"|"+v+")",C="(?:['’](?:d|ll|m|re|s|t|ve))?",R="(?:['’](?:D|LL|M|RE|S|T|VE))?",D="(?:"+h+"|"+b+")"+"?",x="["+p+"]?",k=x+D+("(?:"+P+"(?:"+[O,w,S].join("|")+")"+x+D+")*"),j="(?:"+[g,w,S].join("|")+")"+k,A="(?:"+[O+h+"?",h,w,S,c].join("|")+")",N=RegExp(u,"g"),I=RegExp(h,"g"),q=RegExp(b+"(?="+b+")|"+A+k,"g"),M=RegExp([_+"?"+y+"+"+C+"(?="+[f,_,"$"].join("|")+")",T+"+"+R+"(?="+[f,_+E,"$"].join("|")+")",_+"?"+E+"+"+C,_+"+"+R,m,j].join("|"),"g"),L=RegExp("["+P+n+o+i+p+"]"),F=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,B="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,V="object"==typeof self&&self&&self.Object===Object&&self,U=B||V||Function("return this")();var $=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"});function G(e){return L.test(e)}function H(e){return G(e)?function(e){return e.match(q)||[]}(e):function(e){return e.split("")}(e)}var z=Object.prototype.toString,W=U.Symbol,J=W?W.prototype:void 0,Y=J?J.toString:void 0;function K(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(e){return!!e&&"object"==typeof e}(t)&&z.call(t)==e}(t))return Y?Y.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}function X(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}(e,t,r)}function Q(e){return null==e?"":K(e)}var Z,ee=(Z=function(e,t,r){return t=t.toLowerCase(),e+(r?re(Q(t).toLowerCase()):t)},function(e){return function(e,t,r){for(var n=-1,o=e?e.length:0;++n<o;)r=t(r,e[n],n,e);return r}(function(e,r){return e=Q(e),void 0===r?function(e){return F.test(e)}(e)?function(e){return e.match(M)||[]}(e):function(e){return e.match(t)||[]}(e):e.match(r)||[]}(function(e){return(e=Q(e))&&e.replace(r,$).replace(I,"")}(e).replace(N,"")),Z,"")});var te,re=(te="toUpperCase",function(e){var t=G(e=Q(e))?H(e):void 0,r=t?t[0]:e.charAt(0),n=t?X(t,1).join(""):e.slice(1);return r[te]()+n});return lodash_camelcase=ee}var src$4={exports:{}},indexLight={exports:{}},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var r=new Array(arguments.length-1),n=0,o=2,i=!0;for(;o<arguments.length;)r[n++]=arguments[o++];return new Promise(function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,a(e))}})},aspromise}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,n){for(var o,i=null,a=[],s=0,l=0;t<n;){var p=e[t++];switch(l){case 0:a[s++]=r[p>>2],o=(3&p)<<4,l=1;break;case 1:a[s++]=r[o|p>>4],o=(15&p)<<2,l=2;break;case 2:a[s++]=r[o|p>>6],a[s++]=r[63&p],l=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return l&&(a[s++]=r[o],a[s++]=61,1===l&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,r){for(var o,a=r,s=0,l=0;l<e.length;){var p=e.charCodeAt(l++);if(61===p&&s>1)break;if(void 0===(p=n[p]))throw Error(i);switch(s){case 0:o=p,s=1;break;case 1:t[r++]=o<<2|(48&p)>>4,o=p,s=2;break;case 2:t[r++]=(15&o)<<4|(60&p)>>2,o=p,s=3;break;case 3:t[r++]=(3&o)<<6|p,s=0}}if(1===s)throw Error(i);return r-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function i(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,r),e.readFloatLE=a.bind(null,n),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function i(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=n*Math.pow(2,-l))>>>0,o,i+t),e((a<<31|l+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,l=a>>>20&2047,p=4294967296*(1048575&a)+i;return 2047===l?p?NaN:s*(1/0):0===l?5e-324*s*p:s*Math.pow(2,l-1075)*(p+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,r,4,0),e.readDoubleLE=a.bind(null,n,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function t(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function r(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(e){var t=e;t.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,r){for(var n,o,i=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var r=t.zero=new t(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var n=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return r;var n=e<0;n&&(e=-e);var o=e>>>0,i=(e-o)/4294967296>>>0;return n&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},t.from=function(n){if("number"==typeof n)return t.fromNumber(n);if(e.isString(n)){if(!e.Long)return t.fromNumber(parseInt(n,10));n=e.Long.fromString(n)}return n.low||n.high?new t(n.low>>>0,n.high>>>0):r},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===n?r:new t((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(){var e=minimal$1;function t(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function r(e){function r(e,n){if(!(this instanceof r))return new r(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,r):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&t(this,n)}return r.prototype=Object.create(Error.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),r}e.asPromise=requireAspromise(),e.base64=requireBase64(),e.EventEmitter=requireEventemitter(),e.float=requireFloat(),e.inquire=requireInquire(),e.utf8=requireUtf8(),e.pool=requirePool(),e.LongBits=requireLongbits(),e.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),e.global=e.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||minimal$1,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},e.isString=function(e){return"string"==typeof e||e instanceof String},e.isObject=function(e){return e&&"object"==typeof e},e.isset=e.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},e.Buffer=function(){try{var t=e.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(e){return null}}(),e._Buffer_from=null,e._Buffer_allocUnsafe=null,e.newBuffer=function(t){return"number"==typeof t?e.Buffer?e._Buffer_allocUnsafe(t):new e.Array(t):e.Buffer?e._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},e.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,e.Long=e.global.dcodeIO&&e.global.dcodeIO.Long||e.global.Long||e.inquire("long"),e.key2Re=/^true|false|0|1$/,e.key32Re=/^-?(?:0|[1-9][0-9]*)$/,e.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,e.longToHash=function(t){return t?e.LongBits.from(t).toHash():e.LongBits.zeroHash},e.longFromHash=function(t,r){var n=e.LongBits.fromHash(t);return e.Long?e.Long.fromBits(n.lo,n.hi,r):n.toNumber(Boolean(r))},e.merge=t,e.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},e.newError=r,e.ProtocolError=r("ProtocolError"),e.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},e.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},e.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},e._configure=function(){var t=e.Buffer;t?(e._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},e._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):e._Buffer_from=e._Buffer_allocUnsafe=null}}()),minimal$1}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=l;var e,t=requireMinimal$1(),r=t.LongBits,n=t.base64,o=t.utf8;function i(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function a(){}function s(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new i(a,0,0),this.tail=this.head,this.states=null}var p=function(){return t.Buffer?function(){return(l.create=function(){return new e})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function u(e,t){this.len=e,this.next=void 0,this.val=t}function c(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function f(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=p(),l.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(l.alloc=t.pool(l.alloc,t.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new i(e,t,r),this.len+=t,this},u.prototype=Object.create(i.prototype),u.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new u((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(c,10,r.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=r.from(e);return this._push(c,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(c,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(f,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=r.from(e);return this._push(f,4,t.lo)._push(f,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var h=t.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};return l.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(d,1,0);if(t.isString(e)){var o=l.alloc(r=n.length(e));n.decode(e,o,0),e=o}return this.uint32(r)._push(h,r,e)},l.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new i(a,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(a,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(t){e=t,l.create=p(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=r;var e=requireWriter();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal$1();function r(){e.call(this)}function n(e,r,n){e.length<40?t.utf8.write(e,r,n):r.utf8Write?r.utf8Write(e,n):r.write(e,n)}return r._configure=function(){r.alloc=t._Buffer_allocUnsafe,r.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},r.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var n=e.length>>>0;return this.uint32(n),n&&this._push(r.writeBytesBuffer,n,e),this},r.prototype.string=function(e){var r=t.Buffer.byteLength(e);return this.uint32(r),r&&this._push(n,r,e),this},r._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=i;var e,t=requireMinimal$1(),r=t.LongBits,n=t.utf8;function o(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}var a="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},s=function(){return t.Buffer?function(r){return(i.create=function(r){return t.Buffer.isBuffer(r)?new e(r):a(r)})(r)}:a};function l(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw o(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}return i.create=s(),i.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,i.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}}(),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return p(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|p(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=t.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)},i.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},i.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},i._configure=function(r){e=r,i.create=s(),e._configure();var n=t.Long?"toLong":"toNumber";t.merge(i.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return d.call(this)[n](!0)},sfixed64:function(){return d.call(this)[n](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=r;var e=requireReader();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal$1();function r(t){e.call(this,t)}return r._configure=function(){t.Buffer&&(r.prototype._slice=t.Buffer.prototype.slice)},r.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},r._configure(),reader_buffer}var rpc={},service$1,hasRequiredService$1,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal;function requireService$1(){if(hasRequiredService$1)return service$1;hasRequiredService$1=1,service$1=t;var e=requireMinimal$1();function t(t,r,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(r),this.responseDelimited=Boolean(n)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(r,n,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,r,n,o,i);if(s.rpcImpl)try{return s.rpcImpl(r,n[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(e,t){if(e)return s.emit("error",e,r),a(e);if(null!==t){if(!(t instanceof o))try{t=o[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return s.emit("error",e,r),a(e)}return s.emit("data",t,r),a(null,t)}s.end(!0)})}catch(e){return s.emit("error",e,r),void setTimeout(function(){a(e)},0)}else setTimeout(function(){a(Error("already ended"))},0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service$1}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(e){e.Service=requireService$1()}(rpc)),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(){var e=indexMinimal;function t(){e.util._configure(),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}e.build="minimal",e.Writer=requireWriter(),e.BufferWriter=requireWriter_buffer(),e.Reader=requireReader(),e.BufferReader=requireReader_buffer(),e.util=requireMinimal$1(),e.rpc=requireRpc(),e.roots=requireRoots(),e.configure=t,t()}()),indexMinimal}var types$1={},util$5={exports:{}},codegen_1,hasRequiredCodegen,fetch_1,hasRequiredFetch;function requireCodegen(){if(hasRequiredCodegen)return codegen_1;function e(t,r){"string"==typeof t&&(r=t,t=void 0);var n=[];function o(t){if("string"!=typeof t){var r=i();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var a=Object.keys(t),s=new Array(a.length+1),l=new Array(a.length),p=0;p<a.length;)s[p]=a[p],l[p]=t[a[p++]];return s[p]=r,Function.apply(null,s).apply(null,l)}return Function(r)()}for(var d=new Array(arguments.length-1),u=0;u<d.length;)d[u]=arguments[++u];if(u=0,t=t.replace(/%([%dfijs])/g,function(e,t){var r=d[u++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"}),u!==d.length)throw Error("parameter count mismatch");return n.push(t),o}function i(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}return hasRequiredCodegen=1,codegen_1=e,e.verbose=!1,codegen_1}function requireFetch(){if(hasRequiredFetch)return fetch_1;hasRequiredFetch=1,fetch_1=r;var e=requireAspromise(),t=requireInquire()("fs");function r(n,o,i){return"function"==typeof o?(i=o,o={}):o||(o={}),i?!o.xhr&&t&&t.readFile?t.readFile(n,function(e,t){return e&&"undefined"!=typeof XMLHttpRequest?r.xhr(n,o,i):e?i(e):i(null,o.binary?t:t.toString("utf8"))}):r.xhr(n,o,i):e(r,this,n,o)}return r.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()},fetch_1}var path={},hasRequiredPath,namespace,hasRequiredNamespace,mapfield,hasRequiredMapfield,method,hasRequiredMethod,service,hasRequiredService,message,hasRequiredMessage,decoder_1,hasRequiredDecoder,verifier_1,hasRequiredVerifier;function requirePath(){return hasRequiredPath||(hasRequiredPath=1,function(e){var t=e,r=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=t.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),o="";n&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):n?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};t.resolve=function(e,t,o){return o||(t=n(t)),r(t)?t:(o||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}}(path)),path}function requireNamespace(){if(hasRequiredNamespace)return namespace;hasRequiredNamespace=1,namespace=l;var e=requireObject();((l.prototype=Object.create(e.prototype)).constructor=l).className="Namespace";var t,r,n,o=requireField(),i=requireUtil$5(),a=requireOneof();function s(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function l(t,r){e.call(this,t,r),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function p(e){e._nestedArray=null,e._lookupCache={};for(var t=e;t=t.parent;)t._lookupCache={};return e}return l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=s,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=i.toArray(this.nested))}}),l.prototype.toJSON=function(e){return i.toObject(["options",this.options,"nested",s(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var i,a=Object.keys(e),s=0;s<a.length;++s)i=e[a[s]],this.add((void 0!==i.fields?t.fromJSON:void 0!==i.values?n.fromJSON:void 0!==i.methods?r.fromJSON:void 0!==i.id?o.fromJSON:l.fromJSON)(a[s],i));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof n)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof o&&void 0!==e.extend||e instanceof t||e instanceof a||e instanceof n||e instanceof r||e instanceof l))throw TypeError("object must be a valid nested object");if(this.nested){var i=this.get(e.name);if(i){if(!(i instanceof l&&e instanceof l)||i instanceof t||i instanceof r)throw Error("duplicate name '"+e.name+"' in "+this);for(var s=i.nestedArray,d=0;d<s.length;++d)e.add(s[d]);this.remove(i),this.nested||(this.nested={}),e.setOptions(i.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof t||this instanceof r||this instanceof n||this instanceof o||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var u=this;u=u.parent;)u._needsRecursiveFeatureResolution=!0,u._needsRecursiveResolve=!0;return e.onAdd(this),p(this)},l.prototype.remove=function(t){if(!(t instanceof e))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),p(this)},l.prototype.define=function(e,t){if(i.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},l.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.nestedArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),i.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;var n=e.join(".");if(""===e[0])return this.root.lookup(e.slice(1),t);var o=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+n];if(o&&(!t||t.indexOf(o.constructor)>-1))return o;if((o=this._lookupImpl(e,n))&&(!t||t.indexOf(o.constructor)>-1))return o;if(r)return null;for(var a=this;a.parent;){if((o=a.parent._lookupImpl(e,n))&&(!t||t.indexOf(o.constructor)>-1))return o;a=a.parent}return null},l.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var r=this.get(e[0]),n=null;if(r)1===e.length?n=r:r instanceof l&&(e=e.slice(1),n=r._lookupImpl(e,e.join(".")));else for(var o=0;o<this.nestedArray.length;++o)this._nestedArray[o]instanceof l&&(r=this._nestedArray[o]._lookupImpl(e,t))&&(n=r);return this._lookupCache[t]=n,n},l.prototype.lookupType=function(e){var r=this.lookup(e,[t]);if(!r)throw Error("no such type: "+e);return r},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[t,n]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r},l.prototype.lookupService=function(e){var t=this.lookup(e,[r]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,o,i){t=e,r=o,n=i},namespace}function requireMapfield(){if(hasRequiredMapfield)return mapfield;hasRequiredMapfield=1,mapfield=n;var e=requireField();((n.prototype=Object.create(e.prototype)).constructor=n).className="MapField";var t=requireTypes(),r=requireUtil$5();function n(t,n,o,i,a,s){if(e.call(this,t,n,i,void 0,void 0,a,s),!r.isString(o))throw TypeError("keyType must be a string");this.keyType=o,this.resolvedKeyType=null,this.map=!0}return n.fromJSON=function(e,t){return new n(e,t.id,t.keyType,t.type,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},n.prototype.resolve=function(){if(this.resolved)return this;if(void 0===t.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return e.prototype.resolve.call(this)},n.d=function(e,t,o){return"function"==typeof o?o=r.decorateType(o).name:o&&"object"==typeof o&&(o=r.decorateEnum(o).name),function(i,a){r.decorateType(i.constructor).add(new n(a,e,t,o))}},mapfield}function requireMethod(){if(hasRequiredMethod)return method;hasRequiredMethod=1,method=r;var e=requireObject();((r.prototype=Object.create(e.prototype)).constructor=r).className="Method";var t=requireUtil$5();function r(r,n,o,i,a,s,l,p,d){if(t.isObject(a)?(l=a,a=s=void 0):t.isObject(s)&&(l=s,s=void 0),void 0!==n&&!t.isString(n))throw TypeError("type must be a string");if(!t.isString(o))throw TypeError("requestType must be a string");if(!t.isString(i))throw TypeError("responseType must be a string");e.call(this,r,l),this.type=n||"rpc",this.requestType=o,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=p,this.parsedOptions=d}return r.fromJSON=function(e,t){return new r(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},r.prototype.toJSON=function(e){var r=!!e&&Boolean(e.keepComments);return t.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",r?this.comment:void 0,"parsedOptions",this.parsedOptions])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),e.prototype.resolve.call(this))},method}function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=o;var e=requireNamespace();((o.prototype=Object.create(e.prototype)).constructor=o).className="Service";var t=requireMethod(),r=requireUtil$5(),n=requireRpc();function o(t,r){e.call(this,t,r),this.methods={},this._methodsArray=null}function i(e){return e._methodsArray=null,e}return o.fromJSON=function(e,r){var n=new o(e,r.options);if(r.methods)for(var i=Object.keys(r.methods),a=0;a<i.length;++a)n.add(t.fromJSON(i[a],r.methods[i[a]]));return r.nested&&n.addJSON(r.nested),r.edition&&(n._edition=r.edition),n.comment=r.comment,n._defaultEdition="proto3",n},o.prototype.toJSON=function(t){var n=e.prototype.toJSON.call(this,t),o=!!t&&Boolean(t.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",n&&n.options||void 0,"methods",e.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",o?this.comment:void 0])},Object.defineProperty(o.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}}),o.prototype.get=function(t){return this.methods[t]||e.prototype.get.call(this,t)},o.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolve.call(this);for(var t=this.methodsArray,r=0;r<t.length;++r)t[r].resolve();return this},o.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.methodsArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},o.prototype.add=function(r){if(this.get(r.name))throw Error("duplicate name '"+r.name+"' in "+this);return r instanceof t?(this.methods[r.name]=r,r.parent=this,i(this)):e.prototype.add.call(this,r)},o.prototype.remove=function(r){if(r instanceof t){if(this.methods[r.name]!==r)throw Error(r+" is not a member of "+this);return delete this.methods[r.name],r.parent=null,i(this)}return e.prototype.remove.call(this,r)},o.prototype.create=function(e,t,o){for(var i,a=new n.Service(e,t,o),s=0;s<this.methodsArray.length;++s){var l=r.lcFirst((i=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");a[l]=r.codegen(["r","c"],r.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return a},service}function requireMessage(){if(hasRequiredMessage)return message;hasRequiredMessage=1,message=t;var e=requireMinimal$1();function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return t.create=function(e){return this.$type.create(e)},t.encode=function(e,t){return this.$type.encode(e,t)},t.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},t.decode=function(e){return this.$type.decode(e)},t.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},t.verify=function(e){return this.$type.verify(e)},t.fromObject=function(e){return this.$type.fromObject(e)},t.toObject=function(e,t){return this.$type.toObject(e,t)},t.prototype.toJSON=function(){return this.$type.toObject(this,e.toJSONOptions)},message}function requireDecoder(){if(hasRequiredDecoder)return decoder_1;hasRequiredDecoder=1,decoder_1=function(o){for(var i=r.codegen(["r","l","e"],o.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(o.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),a=0;a<o.fieldsArray.length;++a){var s=o._fieldsArray[a].resolve(),l=s.resolvedType instanceof e?"int32":s.type,p="m"+r.safeProp(s.name);i("case %i: {",s.id),s.map?(i("if(%s===util.emptyObject)",p)("%s={}",p)("var c2 = r.uint32()+r.pos"),void 0!==t.defaults[s.keyType]?i("k=%j",t.defaults[s.keyType]):i("k=null"),void 0!==t.defaults[l]?i("value=%j",t.defaults[l]):i("value=null"),i("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===t.basic[l]?i("value=types[%i].decode(r,r.uint32())",a):i("value=r.%s()",l),i("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==t.long[s.keyType]?i('%s[typeof k==="object"?util.longToHash(k):k]=value',p):i("%s[k]=value",p)):s.repeated?(i("if(!(%s&&%s.length))",p,p)("%s=[]",p),void 0!==t.packed[l]&&i("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",p,l)("}else"),void 0===t.basic[l]?i(s.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",p,a):i("%s.push(r.%s())",p,l)):void 0===t.basic[l]?i(s.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",p,a):i("%s=r.%s()",p,l),i("break")("}")}for(i("default:")("r.skipType(t&7)")("break")("}")("}"),a=0;a<o._fieldsArray.length;++a){var d=o._fieldsArray[a];d.required&&i("if(!m.hasOwnProperty(%j))",d.name)("throw util.ProtocolError(%j,{instance:m})",n(d))}return i("return m")};var e=require_enum$1(),t=requireTypes(),r=requireUtil$5();function n(e){return"missing required '"+e.name+"'"}return decoder_1}function requireVerifier(){if(hasRequiredVerifier)return verifier_1;hasRequiredVerifier=1,verifier_1=function(e){var i=t.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),a=e.oneofsArray,s={};a.length&&i("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var p=e._fieldsArray[l].resolve(),d="m"+t.safeProp(p.name);if(p.optional&&i("if(%s!=null&&m.hasOwnProperty(%j)){",d,p.name),p.map)i("if(!util.isObject(%s))",d)("return%j",r(p,"object"))("var k=Object.keys(%s)",d)("for(var i=0;i<k.length;++i){"),o(i,p,"k[i]"),n(i,p,l,d+"[k[i]]")("}");else if(p.repeated)i("if(!Array.isArray(%s))",d)("return%j",r(p,"array"))("for(var i=0;i<%s.length;++i){",d),n(i,p,l,d+"[i]")("}");else{if(p.partOf){var u=t.safeProp(p.partOf.name);1===s[p.partOf.name]&&i("if(p%s===1)",u)("return%j",p.partOf.name+": multiple values"),s[p.partOf.name]=1,i("p%s=1",u)}n(i,p,l,d)}p.optional&&i("}")}return i("return null")};var e=require_enum$1(),t=requireUtil$5();function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function n(t,n,o,i){if(n.resolvedType)if(n.resolvedType instanceof e){t("switch(%s){",i)("default:")("return%j",r(n,"enum value"));for(var a=Object.keys(n.resolvedType.values),s=0;s<a.length;++s)t("case %i:",n.resolvedType.values[a[s]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",o,i)("if(e)")("return%j+e",n.name+".")("}");else switch(n.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",i)("return%j",r(n,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",r(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",r(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",r(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",r(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",r(n,"buffer"))}return t}function o(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",r(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",r(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",r(t,"boolean key"))}return e}return verifier_1}var converter={},hasRequiredConverter;function requireConverter(){return hasRequiredConverter||(hasRequiredConverter=1,function(e){var t=e,r=require_enum$1(),n=requireUtil$5();function o(e,t,n,o){var i=!1;if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(d%s){",o);for(var a=t.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)a[s[l]]!==t.typeDefault||i||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),t.repeated||e("break"),i=!0),e("case%j:",s[l])("case %i:",a[s[l]])("m%s=%j",o,a[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,n,o);else{var p=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":p=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,p)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,p?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function i(e,t,n,o){if(t.resolvedType)t.resolvedType instanceof r?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",o,n,o,o,n,o,o):e("d%s=types[%i].toObject(m%s,o)",o,n,o);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,i?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}t.fromObject=function(e){var t=e.fieldsArray,i=n.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return i("return new this.ctor");i("var m=new this.ctor");for(var a=0;a<t.length;++a){var s=t[a].resolve(),l=n.safeProp(s.name);s.map?(i("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),o(i,s,a,l+"[ks[i]]")("}")("}")):s.repeated?(i("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),o(i,s,a,l+"[i]")("}")("}")):(s.resolvedType instanceof r||i("if(d%s!=null){",l),o(i,s,a,l),s.resolvedType instanceof r||i("}"))}return i("return m")},t.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);if(!t.length)return n.codegen()("return {}");for(var o=n.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),a=[],s=[],l=[],p=0;p<t.length;++p)t[p].partOf||(t[p].resolve().repeated?a:t[p].map?s:l).push(t[p]);if(a.length){for(o("if(o.arrays||o.defaults){"),p=0;p<a.length;++p)o("d%s=[]",n.safeProp(a[p].name));o("}")}if(s.length){for(o("if(o.objects||o.defaults){"),p=0;p<s.length;++p)o("d%s={}",n.safeProp(s[p].name));o("}")}if(l.length){for(o("if(o.defaults){"),p=0;p<l.length;++p){var d=l[p],u=n.safeProp(d.name);if(d.resolvedType instanceof r)o("d%s=o.enums===String?%j:%j",u,d.resolvedType.valuesById[d.typeDefault],d.typeDefault);else if(d.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",d.typeDefault.low,d.typeDefault.high,d.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",u)("}else")("d%s=o.longs===String?%j:%i",u,d.typeDefault.toString(),d.typeDefault.toNumber());else if(d.bytes){var c="["+Array.prototype.slice.call(d.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",u,String.fromCharCode.apply(String,d.typeDefault))("else{")("d%s=%s",u,c)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",u,u)("}")}else o("d%s=%j",u,d.typeDefault)}o("}")}var f=!1;for(p=0;p<t.length;++p){d=t[p];var h=e._fieldsArray.indexOf(d);u=n.safeProp(d.name);d.map?(f||(f=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",u,u)("d%s={}",u)("for(var j=0;j<ks2.length;++j){"),i(o,d,h,u+"[ks2[j]]")("}")):d.repeated?(o("if(m%s&&m%s.length){",u,u)("d%s=[]",u)("for(var j=0;j<m%s.length;++j){",u),i(o,d,h,u+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",u,d.name),i(o,d,h,u),d.partOf&&o("if(o.oneofs)")("d%s=%j",n.safeProp(d.partOf.name),d.name)),o("}")}return o("return d")}}(converter)),converter}var wrappers$2={},hasRequiredWrappers$1,type,hasRequiredType,root,hasRequiredRoot,hasRequiredUtil$5,hasRequiredTypes,field,hasRequiredField,oneof,hasRequiredOneof,object,hasRequiredObject,_enum$1,hasRequired_enum$1,encoder_1,hasRequiredEncoder,hasRequiredIndexLight,tokenize_1,hasRequiredTokenize,parse_1,hasRequiredParse,common_1,hasRequiredCommon$2,hasRequiredSrc$7,protobufjs,hasRequiredProtobufjs;function requireWrappers$1(){return hasRequiredWrappers$1||(hasRequiredWrappers$1=1,function(){var e=wrappers$2,t=requireMessage();e[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,r){var n="",o="";if(r&&r.json&&e.type_url&&e.value){o=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(o);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof t){var a=e.$type.toObject(e,r);return""===n&&(n="type.googleapis.com/"),o=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=o,a}return this.toObject(e,r)}}}()),wrappers$2}function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=m;var e=requireNamespace();((m.prototype=Object.create(e.prototype)).constructor=m).className="Type";var t=require_enum$1(),r=requireOneof(),n=requireField(),o=requireMapfield(),i=requireService(),a=requireMessage(),s=requireReader(),l=requireWriter(),p=requireUtil$5(),d=requireEncoder(),u=requireDecoder(),c=requireVerifier(),f=requireConverter(),h=requireWrappers$1();function m(t,r){e.call(this,t,r),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function g(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}return Object.defineProperties(m.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=m.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof a||((e.prototype=new a).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.merge(e,a,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),m.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},m.fromJSON=function(a,s){var l=new m(a,s.options);l.extensions=s.extensions,l.reserved=s.reserved;for(var p=Object.keys(s.fields),d=0;d<p.length;++d)l.add((void 0!==s.fields[p[d]].keyType?o.fromJSON:n.fromJSON)(p[d],s.fields[p[d]]));if(s.oneofs)for(p=Object.keys(s.oneofs),d=0;d<p.length;++d)l.add(r.fromJSON(p[d],s.oneofs[p[d]]));if(s.nested)for(p=Object.keys(s.nested),d=0;d<p.length;++d){var u=s.nested[p[d]];l.add((void 0!==u.id?n.fromJSON:void 0!==u.fields?m.fromJSON:void 0!==u.values?t.fromJSON:void 0!==u.methods?i.fromJSON:e.fromJSON)(p[d],u))}return s.extensions&&s.extensions.length&&(l.extensions=s.extensions),s.reserved&&s.reserved.length&&(l.reserved=s.reserved),s.group&&(l.group=!0),s.comment&&(l.comment=s.comment),s.edition&&(l._edition=s.edition),l._defaultEdition="proto3",l},m.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t),n=!!t&&Boolean(t.keepComments);return p.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",e.arrayToJSON(this.oneofsArray,t),"fields",e.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])},m.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolveAll.call(this);var t=this.oneofsArray;for(n=0;n<t.length;)t[n++].resolve();for(var r=this.fieldsArray,n=0;n<r.length;)r[n++].resolve();return this},m.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.oneofsArray.forEach(e=>{e._resolveFeatures(t)}),this.fieldsArray.forEach(e=>{e._resolveFeatures(t)}),this):this},m.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},m.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof n&&void 0===t.extend){if(this._fieldsById?this._fieldsById[t.id]:this.fieldsById[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),this.fields[t.name]=t,t.message=this,t.onAdd(this),g(this)}return t instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),g(this)):e.prototype.add.call(this,t)},m.prototype.remove=function(t){if(t instanceof n&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),g(this)}if(t instanceof r){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),g(this)}return e.prototype.remove.call(this,t)},m.prototype.isReservedId=function(t){return e.isReservedId(this.reserved,t)},m.prototype.isReservedName=function(t){return e.isReservedName(this.reserved,t)},m.prototype.create=function(e){return new this.ctor(e)},m.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:l,types:t,util:p}),this.decode=u(this)({Reader:s,types:t,util:p}),this.verify=c(this)({types:t,util:p}),this.fromObject=f.fromObject(this)({types:t,util:p}),this.toObject=f.toObject(this)({types:t,util:p});var n=h[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},m.prototype.encode=function(e,t){return this.setup().encode(e,t)},m.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},m.prototype.decode=function(e,t){return this.setup().decode(e,t)},m.prototype.decodeDelimited=function(e){return e instanceof s||(e=s.create(e)),this.decode(e,e.uint32())},m.prototype.verify=function(e){return this.setup().verify(e)},m.prototype.fromObject=function(e){return this.setup().fromObject(e)},m.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},m.d=function(e){return function(t){p.decorateType(t,e)}},type}function requireRoot(){if(hasRequiredRoot)return root;hasRequiredRoot=1,root=l;var e=requireNamespace();((l.prototype=Object.create(e.prototype)).constructor=l).className="Root";var t,r,n,o=requireField(),i=require_enum$1(),a=requireOneof(),s=requireUtil$5();function l(t){e.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function p(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},l.prototype.resolvePath=s.path.resolve,l.prototype.fetch=s.fetch,l.prototype.load=function e(t,o,i){"function"==typeof o&&(i=o,o=void 0);var a=this;if(!i)return s.asPromise(e,a,t,o);var l=i===p;function d(e,t){if(i){if(l)throw e;t&&t.resolveAll();var r=i;i=null,r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in n)return r}return null}function c(e,t){try{if(s.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),s.isString(t)){r.filename=e;var n,i=r(t,a,o),p=0;if(i.imports)for(;p<i.imports.length;++p)(n=u(i.imports[p])||a.resolvePath(e,i.imports[p]))&&f(n);if(i.weakImports)for(p=0;p<i.weakImports.length;++p)(n=u(i.weakImports[p])||a.resolvePath(e,i.weakImports[p]))&&f(n,!0)}else a.setOptions(t.options).addJSON(t.nested)}catch(e){d(e)}l||h||d(null,a)}function f(e,t){if(e=u(e)||e,!(a.files.indexOf(e)>-1))if(a.files.push(e),e in n)l?c(e,n[e]):(++h,setTimeout(function(){--h,c(e,n[e])}));else if(l){var r;try{r=s.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||d(e))}c(e,r)}else++h,a.fetch(e,function(r,n){--h,i&&(r?t?h||d(null,a):d(r):c(e,n))})}var h=0;s.isString(t)&&(t=[t]);for(var m,g=0;g<t.length;++g)(m=a.resolvePath("",t[g]))&&f(m);return l?(a.resolveAll(),a):(h||d(null,a),a)},l.prototype.loadSync=function(e,t){if(!s.isNode)throw Error("not supported");return this.load(e,t,p)},l.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return e.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function u(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new o(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.get(n.name)||(n.declaringField=t,t.extensionField=n,r.add(n)),!0}return!1}return l.prototype._handleAdd=function(e){if(e instanceof o)void 0===e.extend||e.extensionField||u(0,e)||this.deferred.push(e);else if(e instanceof i)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof a)){if(e instanceof t)for(var r=0;r<this.deferred.length;)u(0,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);d.test(e.name)&&(e.parent[e.name]=e)}(e instanceof t||e instanceof i||e instanceof o)&&(this._fullyQualifiedObjects[e.fullName]=e)},l.prototype._handleRemove=function(t){if(t instanceof o){if(void 0!==t.extend)if(t.extensionField)t.extensionField.parent.remove(t.extensionField),t.extensionField=null;else{var r=this.deferred.indexOf(t);r>-1&&this.deferred.splice(r,1)}}else if(t instanceof i)d.test(t.name)&&delete t.parent[t.name];else if(t instanceof e){for(var n=0;n<t.nestedArray.length;++n)this._handleRemove(t._nestedArray[n]);d.test(t.name)&&delete t.parent[t.name]}delete this._fullyQualifiedObjects[t.fullName]},l._configure=function(e,o,i){t=e,r=o,n=i},root}function requireUtil$5(){if(hasRequiredUtil$5)return util$5.exports;hasRequiredUtil$5=1;var e,t,r=util$5.exports=requireMinimal$1(),n=requireRoots();r.codegen=requireCodegen(),r.fetch=requireFetch(),r.path=requirePath(),r.fs=r.inquire("fs"),r.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},r.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var o=/\\/g,i=/"/g;r.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},r.safeProp=function(e){return!/^[$\w_]+$/.test(e)||r.isReserved(e)?'["'+e.replace(o,"\\\\").replace(i,'\\"')+'"]':"."+e},r.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var a=/_([a-z])/g;r.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(a,function(e,t){return t.toUpperCase()})},r.compareFieldsById=function(e,t){return e.id-t.id},r.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(r.decorateRoot.remove(t.$type),t.$type.name=n,r.decorateRoot.add(t.$type)),t.$type;e||(e=requireType());var o=new e(n||t.name);return r.decorateRoot.add(o),o.ctor=t,Object.defineProperty(t,"$type",{value:o,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:o,enumerable:!1}),o};var s=0;return r.decorateEnum=function(e){if(e.$type)return e.$type;t||(t=require_enum$1());var n=new t("Enum"+s++,e);return r.decorateRoot.add(n),Object.defineProperty(e,"$type",{value:n,enumerable:!1}),n},r.setProperty=function(e,t,r,n){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,o){var i=r.shift();if("__proto__"===i||"prototype"===i)return t;if(r.length>0)t[i]=e(t[i]||{},r,o);else{var a=t[i];if(a&&n)return t;a&&(o=[].concat(a).concat(o)),t[i]=o}return t}(e,t=t.split("."),r)},Object.defineProperty(r,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(requireRoot()))}}),util$5.exports}function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(){var e=types$1,t=requireUtil$5(),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function n(e,t){var n=0,o={};for(t|=0;n<e.length;)o[r[n+t]]=e[n++];return o}e.basic=n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),e.defaults=n([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",t.emptyArray,null]),e.long=n([0,0,0,1,1],7),e.mapKey=n([0,0,0,5,5,0,0,0,1,1,0,2],2),e.packed=n([1,5,0,0,0,5,5,0,0,0,1,1,0])}()),types$1}function requireField(){if(hasRequiredField)return field;hasRequiredField=1,field=a;var e=requireObject();((a.prototype=Object.create(e.prototype)).constructor=a).className="Field";var t,r=require_enum$1(),n=requireTypes(),o=requireUtil$5(),i=/^required|optional|repeated$/;function a(t,r,a,s,l,p,d){if(o.isObject(s)?(d=l,p=s,s=l=void 0):o.isObject(l)&&(d=p,p=l,l=void 0),e.call(this,t,p),!o.isInteger(r)||r<0)throw TypeError("id must be a non-negative integer");if(!o.isString(a))throw TypeError("type must be a string");if(void 0!==s&&!i.test(s=s.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==l&&!o.isString(l))throw TypeError("extend must be a string");"proto3_optional"===s&&(s="optional"),this.rule=s&&"optional"!==s?s:void 0,this.type=a,this.id=r,this.extend=l||void 0,this.repeated="repeated"===s,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!o.Long&&void 0!==n.long[a],this.bytes="bytes"===a,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=d}return a.fromJSON=function(e,t){var r=new a(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},Object.defineProperty(a.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this._features.field_presence}}),Object.defineProperty(a.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(a.prototype,"delimited",{get:function(){return this.resolvedType instanceof t&&"DELIMITED"===this._features.message_encoding}}),Object.defineProperty(a.prototype,"packed",{get:function(){return"PACKED"===this._features.repeated_field_encoding}}),Object.defineProperty(a.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this._features.field_presence)}}),a.prototype.setOption=function(t,r,n){return e.prototype.setOption.call(this,t,r,n)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["edition",this._editionToJSON(),"rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=n.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof t?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=o.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var i;o.base64.test(this.typeDefault)?o.base64.decode(this.typeDefault,i=o.newBuffer(o.base64.length(this.typeDefault)),0):o.utf8.write(this.typeDefault,i=o.newBuffer(o.utf8.length(this.typeDefault)),0),this.typeDefault=i}return this.map?this.defaultValue=o.emptyObject:this.repeated?this.defaultValue=o.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof t&&(this.parent.ctor.prototype[this.name]=this.defaultValue),e.prototype.resolve.call(this)},a.prototype._inferLegacyProtoFeatures=function(e){if("proto2"!==e&&"proto3"!==e)return{};var r={};if("required"===this.rule&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&void 0===n.defaults[this.type]){var o=this.parent.get(this.type.split(".").pop());o&&o instanceof t&&o.group&&(r.message_encoding="DELIMITED")}return!0===this.getOption("packed")?r.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(r.repeated_field_encoding="EXPANDED"),r},a.prototype._resolveFeatures=function(t){return e.prototype._resolveFeatures.call(this,this._edition||t)},a.d=function(e,t,r,n){return"function"==typeof t?t=o.decorateType(t).name:t&&"object"==typeof t&&(t=o.decorateEnum(t).name),function(i,s){o.decorateType(i.constructor).add(new a(s,e,t,r,{default:n}))}},a._configure=function(e){t=e},field}function requireOneof(){if(hasRequiredOneof)return oneof;hasRequiredOneof=1,oneof=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="OneOf";var t=requireField(),r=requireUtil$5();function n(t,r,n,o){if(Array.isArray(r)||(n=r,r=void 0),e.call(this,t,n),void 0!==r&&!Array.isArray(r))throw TypeError("fieldNames must be an Array");this.oneof=r||[],this.fieldsArray=[],this.comment=o}function o(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}return n.fromJSON=function(e,t){return new n(e,t.oneof,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},n.prototype.add=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,o(this),this},n.prototype.remove=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),(r=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(r,1),e.partOf=null,this},n.prototype.onAdd=function(t){e.prototype.onAdd.call(this,t);for(var r=0;r<this.oneof.length;++r){var n=t.get(this.oneof[r]);n&&!n.partOf&&(n.partOf=this,this.fieldsArray.push(n))}o(this)},n.prototype.onRemove=function(t){for(var r,n=0;n<this.fieldsArray.length;++n)(r=this.fieldsArray[n]).parent&&r.parent.remove(r);e.prototype.onRemove.call(this,t)},Object.defineProperty(n.prototype,"isProto3Optional",{get:function(){if(null==this.fieldsArray||1!==this.fieldsArray.length)return!1;var e=this.fieldsArray[0];return null!=e.options&&!0===e.options.proto3_optional}}),n.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,o){r.decorateType(t.constructor).add(new n(o,e)),Object.defineProperty(t,o,{get:r.oneOfGetter(e),set:r.oneOfSetter(e)})}},oneof}function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=a,a.className="ReflectionObject";const e=requireOneof();var t,r=requireUtil$5(),n={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},o={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},i={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function a(e,t){if(!r.isString(e))throw TypeError("name must be a string");if(t&&!r.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(a.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),a.prototype.toJSON=function(){throw Error()},a.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var r=e.root;r instanceof t&&r._handleAdd(this)},a.prototype.onRemove=function(e){var r=e.root;r instanceof t&&r._handleRemove(this),this.parent=null,this.resolved=!1},a.prototype.resolve=function(){return this.resolved||this.root instanceof t&&(this.resolved=!0),this},a.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},a.prototype._resolveFeatures=function(t){if(!this._featuresResolved){var r={};if(!t)throw new Error("Unknown edition for "+this.fullName);var a=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(t));if(this._edition){if("proto2"===t)r=Object.assign({},o);else if("proto3"===t)r=Object.assign({},i);else{if("2023"!==t)throw new Error("Unknown edition: "+t);r=Object.assign({},n)}return this._features=Object.assign(r,a||{}),void(this._featuresResolved=!0)}if(this.partOf instanceof e){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,a||{})}else if(this.declaringField);else{if(!this.parent)throw new Error("Unable to find a parent for "+this.fullName);var l=Object.assign({},this.parent._features);this._features=Object.assign(l,a||{})}this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},a.prototype._inferLegacyProtoFeatures=function(){return{}},a.prototype.getOption=function(e){if(this.options)return this.options[e]},a.prototype.setOption=function(e,t,n){return this.options||(this.options={}),/^features\./.test(e)?r.setProperty(this.options,e,t,n):n&&void 0!==this.options[e]||(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},a.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var o=this.parsedOptions;if(n){var i=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(i){var a=i[e];r.setProperty(a,n,t)}else(i={})[e]=r.setProperty({},n,t),o.push(i)}else{var s={};s[e]=t,o.push(s)}return this},a.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},a.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},a.prototype._editionToJSON=function(){if(this._edition&&"proto3"!==this._edition)return this._edition},a._configure=function(e){t=e},object}function require_enum$1(){if(hasRequired_enum$1)return _enum$1;hasRequired_enum$1=1,_enum$1=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="Enum";var t=requireNamespace(),r=requireUtil$5();function n(t,r,n,o,i,a){if(e.call(this,t,n),r&&"object"!=typeof r)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=i||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,r)for(var s=Object.keys(r),l=0;l<s.length;++l)"number"==typeof r[s[l]]&&(this.valuesById[this.values[s[l]]=r[s[l]]]=s[l])}return n.prototype._resolveFeatures=function(t){return t=this._edition||t,e.prototype._resolveFeatures.call(this,t),Object.keys(this.values).forEach(e=>{var t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},n.fromJSON=function(e,t){var r=new n(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},n.prototype.add=function(e,t,n,o){if(!r.isString(e))throw TypeError("name must be a string");if(!r.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return o&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=o||null),this.comments[e]=n||null,this},n.prototype.remove=function(e){if(!r.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},n.prototype.isReservedId=function(e){return t.isReservedId(this.reserved,e)},n.prototype.isReservedName=function(e){return t.isReservedName(this.reserved,e)},_enum$1}function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=function(o){for(var i,a=r.codegen(["m","w"],o.name+"$encode")("if(!w)")("w=Writer.create()"),s=o.fieldsArray.slice().sort(r.compareFieldsById),l=0;l<s.length;++l){var p=s[l].resolve(),d=o._fieldsArray.indexOf(p),u=p.resolvedType instanceof e?"int32":p.type,c=t.basic[u];i="m"+r.safeProp(p.name),p.map?(a("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",i,p.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(p.id<<3|2)>>>0,8|t.mapKey[p.keyType],p.keyType),void 0===c?a("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",d,i):a(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,u,i),a("}")("}")):p.repeated?(a("if(%s!=null&&%s.length){",i,i),p.packed&&void 0!==t.packed[u]?a("w.uint32(%i).fork()",(p.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",u,i)("w.ldelim()"):(a("for(var i=0;i<%s.length;++i)",i),void 0===c?n(a,p,d,i+"[i]"):a("w.uint32(%i).%s(%s[i])",(p.id<<3|c)>>>0,u,i)),a("}")):(p.optional&&a("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,p.name),void 0===c?n(a,p,d,i):a("w.uint32(%i).%s(%s)",(p.id<<3|c)>>>0,u,i))}return a("return w")};var e=require_enum$1(),t=requireTypes(),r=requireUtil$5();function n(e,t,r,n){return t.delimited?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}return encoder_1}function requireIndexLight(){if(hasRequiredIndexLight)return indexLight.exports;hasRequiredIndexLight=1;var e=indexLight.exports=requireIndexMinimal();return e.build="light",e.load=function(t,r,n){return"function"==typeof r?(n=r,r=new e.Root):r||(r=new e.Root),r.load(t,n)},e.loadSync=function(t,r){return r||(r=new e.Root),r.loadSync(t)},e.encoder=requireEncoder(),e.decoder=requireDecoder(),e.verifier=requireVerifier(),e.converter=requireConverter(),e.ReflectionObject=requireObject(),e.Namespace=requireNamespace(),e.Root=requireRoot(),e.Enum=require_enum$1(),e.Type=requireType(),e.Field=requireField(),e.OneOf=requireOneof(),e.MapField=requireMapfield(),e.Service=requireService(),e.Method=requireMethod(),e.Message=requireMessage(),e.wrappers=requireWrappers$1(),e.types=requireTypes(),e.util=requireUtil$5(),e.ReflectionObject._configure(e.Root),e.Namespace._configure(e.Type,e.Service,e.Enum),e.Root._configure(e.Type),e.Field._configure(e.Type),indexLight.exports}function requireTokenize(){if(hasRequiredTokenize)return tokenize_1;hasRequiredTokenize=1,tokenize_1=d;var e=/[\s{}=;:[\],'"()<>]/g,t=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,o=/^\s*\*?\/*/,i=/\n/g,a=/\s/,s=/\\(.?)/g,l={0:"\0",r:"\r",n:"\n",t:"\t"};function p(e){return e.replace(s,function(e,t){switch(t){case"\\":case"":return t;default:return l[t]||""}})}function d(s,l){s=s.toString();var d=0,u=s.length,c=1,f=0,h={},m=[],g=null;function y(e){return Error("illegal "+e+" (line "+c+")")}function v(e){return s.charAt(e)}function b(e,t,r){var a,p={type:s.charAt(e++),lineEmpty:!1,leading:r},d=e-(l?2:3);do{if(--d<0||"\n"===(a=s.charAt(d))){p.lineEmpty=!0;break}}while(" "===a||"\t"===a);for(var u=s.substring(e,t).split(i),m=0;m<u.length;++m)u[m]=u[m].replace(l?o:n,"").trim();p.text=u.join("\n").trim(),h[c]=p,f=c}function O(e){var t=w(e),r=s.substring(e,t);return/^\s*\/\//.test(r)}function w(e){for(var t=e;t<u&&"\n"!==v(t);)t++;return t}function S(){if(m.length>0)return m.shift();if(g)return function(){var e="'"===g?r:t;e.lastIndex=d-1;var n=e.exec(s);if(!n)throw y("string");return d=e.lastIndex,_(g),g=null,p(n[1])}();var n,o,i,f,h,S=0===d;do{if(d===u)return null;for(n=!1;a.test(i=v(d));)if("\n"===i&&(S=!0,++c),++d===u)return null;if("/"===v(d)){if(++d===u)throw y("comment");if("/"===v(d))if(l){if(f=d,h=!1,O(d-1)){h=!0;do{if((d=w(d))===u)break;if(d++,!S)break}while(O(d))}else d=Math.min(u,w(d)+1);h&&(b(f,d,S),S=!0),c++,n=!0}else{for(h="/"===v(f=d+1);"\n"!==v(++d);)if(d===u)return null;++d,h&&(b(f,d-1,S),S=!0),++c,n=!0}else{if("*"!==(i=v(d)))return"/";f=d+1,h=l||"*"===v(f);do{if("\n"===i&&++c,++d===u)throw y("comment");o=i,i=v(d)}while("*"!==o||"/"!==i);++d,h&&(b(f,d-2,S),S=!0),n=!0}}}while(n);var P=d;if(e.lastIndex=0,!e.test(v(P++)))for(;P<u&&!e.test(v(P));)++P;var E=s.substring(d,d=P);return'"'!==E&&"'"!==E||(g=E),E}function _(e){m.push(e)}function P(){if(!m.length){var e=S();if(null===e)return null;_(e)}return m[0]}return Object.defineProperty({next:S,peek:P,push:_,skip:function(e,t){var r=P();if(r===e)return S(),!0;if(!t)throw y("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t,r=null;return void 0===e?(t=h[c-1],delete h[c-1],t&&(l||"*"===t.type||t.lineEmpty)&&(r=t.leading?t.text:null)):(f<e&&P(),t=h[e],delete h[e],!t||t.lineEmpty||!l&&"/"!==t.type||(r=t.leading?null:t.text)),r}},"line",{get:function(){return c}})}return d.unescape=p,tokenize_1}function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=w,w.filename=null,w.defaults={keepCase:!1};var e=requireTokenize(),t=requireRoot(),r=requireType(),n=requireField(),o=requireMapfield(),i=requireOneof(),a=require_enum$1(),s=requireService(),l=requireMethod(),p=requireObject(),d=requireTypes(),u=requireUtil$5(),c=/^[1-9][0-9]*$/,f=/^-?[1-9][0-9]*$/,h=/^0[x][0-9a-fA-F]+$/,m=/^-?0[x][0-9a-fA-F]+$/,g=/^0[0-7]+$/,y=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,b=/^[a-zA-Z_][a-zA-Z_0-9]*$/,O=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function w(S,_,P){_ instanceof t||(P=_,_=new t),P||(P=w.defaults);var E,T,C,R,D=P.preferTrailingComment||!1,x=e(S,P.alternateCommentMode||!1),k=x.next,j=x.push,A=x.peek,N=x.skip,I=x.cmnt,q=!0,M="proto2",L=_,F=[],B={},V=P.keepCase?function(e){return e}:u.camelCase;function U(e,t,r){var n=w.filename;return r||(w.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+x.line+")")}function $(){var e,t=[];do{if('"'!==(e=k())&&"'"!==e)throw U(e);t.push(k()),N(e),e=A()}while('"'===e||"'"===e);return t.join("")}function G(e){var t=k();switch(t){case"'":case'"':return j(t),$();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(c.test(e))return r*parseInt(e,10);if(h.test(e))return r*parseInt(e,16);if(g.test(e))return r*parseInt(e,8);if(v.test(e))return r*parseFloat(e);throw U(e,"number",t)}(t,!0)}catch(e){if(O.test(t))return t;throw U(t,"value")}}function H(e,t){var r,n;do{if(!t||'"'!==(r=A())&&"'"!==r)try{e.push([n=z(k()),N("to",!0)?z(k()):n])}catch(n){if(!(t&&O.test(r)&&M>=2023))throw n;e.push(r)}else{var o=$();if(e.push(o),M>=2023)throw U(o,"id")}}while(N(",",!0));var i={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Q(i,function(e){if("option"!==e)throw U(e);re(i,e),N(";")},function(){ie(i)})}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw U(e,"id");if(f.test(e))return parseInt(e,10);if(m.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw U(e,"id")}function W(){if(void 0!==E)throw U("package");if(E=k(),!O.test(E))throw U(E,"name");L=L.define(E),N(";")}function J(){var e,t=A();switch(t){case"weak":e=C||(C=[]),k();break;case"public":k();default:e=T||(T=[])}t=$(),N(";"),e.push(t)}function Y(){if(N("="),(M=$())<2023)throw U(M,"syntax");N(";")}function K(){N("="),M=$();if(!["2023"].includes(M))throw U(M,"edition");N(";")}function X(e,t){switch(t){case"option":return re(e,t),N(";"),!0;case"message":return Z(e,t),!0;case"enum":return te(e,t),!0;case"service":return function(e,t){if(!b.test(t=k()))throw U(t,"service name");var r=new s(t);Q(r,function(e){if(!X(r,e)){if("rpc"!==e)throw U(e);!function(e,t){var r=I(),n=t;if(!b.test(t=k()))throw U(t,"name");var o,i,a,s,p=t;N("("),N("stream",!0)&&(i=!0);if(!O.test(t=k()))throw U(t);o=t,N(")"),N("returns"),N("("),N("stream",!0)&&(s=!0);if(!O.test(t=k()))throw U(t);a=t,N(")");var d=new l(p,n,o,a,i,s);d.comment=r,Q(d,function(e){if("option"!==e)throw U(e);re(d,e),N(";")}),e.add(d)}(r,e)}}),e.add(r),e===L&&F.push(r)}(e,t),!0;case"extend":return function(e,t){if(!O.test(t=k()))throw U(t,"reference");var r=t;Q(null,function(t){switch(t){case"required":case"repeated":ee(e,t,r);break;case"optional":ee(e,"proto3"===M?"proto3_optional":"optional",r);break;default:if("proto2"===M||!O.test(t))throw U(t);j(t),ee(e,"optional",r)}})}(e,t),!0}return!1}function Q(e,t,r){var n=x.line;if(e&&("string"!=typeof e.comment&&(e.comment=I()),e.filename=w.filename),N("{",!0)){for(var o;"}"!==(o=k());)t(o);N(";",!0)}else r&&r(),N(";"),e&&("string"!=typeof e.comment||D)&&(e.comment=I(n)||e.comment)}function Z(e,t){if(!b.test(t=k()))throw U(t,"type name");var n=new r(t);Q(n,function(e){if(!X(n,e))switch(e){case"map":!function(e){N("<");var t=k();if(void 0===d.mapKey[t])throw U(t,"type");N(",");var r=k();if(!O.test(r))throw U(r,"type");N(">");var n=k();if(!b.test(n))throw U(n,"name");N("=");var i=new o(V(n),z(k()),t,r);Q(i,function(e){if("option"!==e)throw U(e);re(i,e),N(";")},function(){ie(i)}),e.add(i)}(n);break;case"required":if("proto2"!==M)throw U(e);case"repeated":ee(n,e);break;case"optional":if("proto3"===M)ee(n,"proto3_optional");else{if("proto2"!==M)throw U(e);ee(n,"optional")}break;case"oneof":!function(e,t){if(!b.test(t=k()))throw U(t,"name");var r=new i(V(t));Q(r,function(e){"option"===e?(re(r,e),N(";")):(j(e),ee(r,"optional"))}),e.add(r)}(n,e);break;case"extensions":H(n.extensions||(n.extensions=[]));break;case"reserved":H(n.reserved||(n.reserved=[]),!0);break;default:if("proto2"===M||!O.test(e))throw U(e);j(e),ee(n,"optional")}}),e.add(n),e===L&&F.push(n)}function ee(e,t,o){var a=k();if("group"!==a){for(;a.endsWith(".")||A().startsWith(".");)a+=k();if(!O.test(a))throw U(a,"type");var s=k();if(!b.test(s))throw U(s,"name");s=V(s),N("=");var l=new n(s,z(k()),a,t,o);if(Q(l,function(e){if("option"!==e)throw U(e);re(l,e),N(";")},function(){ie(l)}),"proto3_optional"===t){var p=new i("_"+s);l.setOption("proto3_optional",!0),p.add(l),e.add(p)}else e.add(l);e===L&&F.push(l)}else!function(e,t){if(M>=2023)throw U("group");var o=k();if(!b.test(o))throw U(o,"name");var i=u.lcFirst(o);o===i&&(o=u.ucFirst(o));N("=");var a=z(k()),s=new r(o);s.group=!0;var l=new n(i,a,o,t);l.filename=w.filename,Q(s,function(e){switch(e){case"option":re(s,e),N(";");break;case"required":case"repeated":ee(s,e);break;case"optional":ee(s,"proto3"===M?"proto3_optional":"optional");break;case"message":Z(s,e);break;case"enum":te(s,e);break;case"reserved":H(s.reserved||(s.reserved=[]),!0);break;default:throw U(e)}}),e.add(s).add(l)}(e,t)}function te(e,t){if(!b.test(t=k()))throw U(t,"name");var r=new a(t);Q(r,function(e){switch(e){case"option":re(r,e),N(";");break;case"reserved":H(r.reserved||(r.reserved=[]),!0),void 0===r.reserved&&(r.reserved=[]);break;default:!function(e,t){if(!b.test(t))throw U(t,"name");N("=");var r=z(k(),!0),n={options:void 0,getOption:function(e){return this.options[e]}};n.setOption=function(e,t){p.prototype.setOption.call(n,e,t)},n.setParsedOption=function(){},Q(n,function(e){if("option"!==e)throw U(e);re(n,e),N(";")},function(){ie(n)}),e.add(t,r,n.comment,n.parsedOptions||n.options)}(r,e)}}),e.add(r),e===L&&F.push(r)}function re(e,t){var r,n,o=!0;for("option"===t&&(t=k());"="!==t;){if("("===t){var i=k();N(")"),t="("+i+")"}if(o){if(o=!1,t.includes(".")&&!t.includes("(")){var a=t.split(".");r=a[0]+".",t=a[1];continue}r=t}else n=n?n+=t:t;t=k()}var s=ne(e,n?r.concat(n):r);n=n&&"."===n[0]?n.slice(1):n,function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,r=r&&"."===r[r.length-1]?r.slice(0,-1):r,s,n)}function ne(e,t){if(N("{",!0)){for(var r={};!N("}",!0);){if(!b.test(R=k()))throw U(R,"name");if(null===R)throw U(R,"end of input");var n,o=R;if(N(":",!0),"{"===A())n=ne(e,t+"."+R);else if("["===A()){var i;if(n=[],N("[",!0)){do{i=G(),n.push(i)}while(N(",",!0));N("]"),void 0!==i&&oe(e,t+"."+R,i)}}else n=G(),oe(e,t+"."+R,n);var a=r[o];a&&(n=[].concat(a).concat(n)),r[o]=n,N(",",!0),N(";",!0)}return r}var s=G();return oe(e,t,s),s}function oe(e,t,r){L===e&&/^features\./.test(t)?B[t]=r:e.setOption&&e.setOption(t,r)}function ie(e){if(N("[",!0)){do{re(e,"option")}while(N(",",!0));N("]")}return e}for(;null!==(R=k());)switch(R){case"package":if(!q)throw U(R);W();break;case"import":if(!q)throw U(R);J();break;case"syntax":if(!q)throw U(R);Y();break;case"edition":if(!q)throw U(R);K();break;case"option":re(L,R),N(";",!0);break;default:if(X(L,R)){q=!1;continue}throw U(R)}return F.forEach(e=>{e._edition=M,Object.keys(B).forEach(t=>{void 0===e.getOption(t)&&e.setOption(t,B[t],!0)})}),w.filename=null,{package:E,imports:T,weakImports:C,root:_}}return parse_1}function requireCommon$2(){if(hasRequiredCommon$2)return common_1;hasRequiredCommon$2=1,common_1=r;var e,t=/\/|\./;function r(e,n){t.test(e)||(e="google/protobuf/"+e+".proto",n={nested:{google:{nested:{protobuf:{nested:n}}}}}),r[e]=n}return r("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),r("duration",{Duration:e={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),r("timestamp",{Timestamp:e}),r("empty",{Empty:{fields:{}}}),r("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),r("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),r("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),r.get=function(e){return r[e]||null},common_1}function requireSrc$7(){if(hasRequiredSrc$7)return src$4.exports;hasRequiredSrc$7=1;var e=src$4.exports=requireIndexLight();return e.build="full",e.tokenize=requireTokenize(),e.parse=requireParse(),e.common=requireCommon$2(),e.Root._configure(e.Type,e.parse,e.common),src$4.exports}function requireProtobufjs(){return hasRequiredProtobufjs?protobufjs:(hasRequiredProtobufjs=1,protobufjs=requireSrc$7())}var descriptor$1={exports:{}},nested$7={google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}},require$$4$2={nested:nested$7},hasRequiredDescriptor$1;function requireDescriptor$1(){return hasRequiredDescriptor$1||(hasRequiredDescriptor$1=1,function(e,t){var r=requireProtobufjs();e.exports=t=r.descriptor=r.Root.fromJSON(require$$4$2).lookup(".google.protobuf");var n=r.Namespace,o=r.Root,i=r.Enum,a=r.Type,s=r.Field,l=r.MapField,p=r.OneOf,d=r.Service,u=r.Method;function c(e,r,l){var p=t.FileDescriptorProto.create({name:e.filename||(e.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});!function(e,r){if(!e)return;if("proto2"===e||"proto3"===e)r.syntax=e;else{if(r.syntax="editions","2023"!==e)throw new Error("Unsupported edition "+e);r.edition=t.Edition.EDITION_2023}}(l,p),e instanceof o||(p.package=e.fullName.substring(1));for(var u,f=0;f<e.nestedArray.length;++f)(u=e._nestedArray[f])instanceof a?p.messageType.push(u.toDescriptor(l)):u instanceof i?p.enumType.push(u.toDescriptor()):u instanceof s?p.extension.push(u.toDescriptor(l)):u instanceof d?p.service.push(u.toDescriptor()):u instanceof n&&c(u,r,l);p.options=_(e.options,t.FileOptions),p.messageType.length+p.enumType.length+p.extension.length+p.service.length&&r.push(p)}o.fromDescriptor=function(e){"number"==typeof e.length&&(e=t.FileDescriptorSet.decode(e));var r=new o;if(e.file)for(var n,l,p,u=0;u<e.file.length;++u){l=r,(n=e.file[u]).package&&n.package.length&&(l=r.define(n.package));var c=T(n);if(n.name&&n.name.length&&r.files.push(l.filename=n.name),n.messageType)for(p=0;p<n.messageType.length;++p)l.add(a.fromDescriptor(n.messageType[p],c));if(n.enumType)for(p=0;p<n.enumType.length;++p)l.add(i.fromDescriptor(n.enumType[p],c));if(n.extension)for(p=0;p<n.extension.length;++p)l.add(s.fromDescriptor(n.extension[p],c));if(n.service)for(p=0;p<n.service.length;++p)l.add(d.fromDescriptor(n.service[p],c));var f=w(n.options,t.FileOptions);if(f){var h=Object.keys(f);for(p=0;p<h.length;++p)l.setOption(h[p],f[h[p]])}}return r.resolveAll()},o.prototype.toDescriptor=function(e){var r=t.FileDescriptorSet.create();return c(this,r.file,e),r};var f=0;a.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.DescriptorProto.decode(e));var o,l=new a(e.name.length?e.name:"Type"+f++,w(e.options,t.MessageOptions));if(n||(l._edition=r),e.oneofDecl)for(o=0;o<e.oneofDecl.length;++o)l.add(p.fromDescriptor(e.oneofDecl[o]));if(e.field)for(o=0;o<e.field.length;++o){var d=s.fromDescriptor(e.field[o],r,!0);l.add(d),e.field[o].hasOwnProperty("oneofIndex")&&l.oneofsArray[e.field[o].oneofIndex].add(d)}if(e.extension)for(o=0;o<e.extension.length;++o)l.add(s.fromDescriptor(e.extension[o],r,!0));if(e.nestedType)for(o=0;o<e.nestedType.length;++o)l.add(a.fromDescriptor(e.nestedType[o],r,!0)),e.nestedType[o].options&&e.nestedType[o].options.mapEntry&&l.setOption("map_entry",!0);if(e.enumType)for(o=0;o<e.enumType.length;++o)l.add(i.fromDescriptor(e.enumType[o],r,!0));if(e.extensionRange&&e.extensionRange.length)for(l.extensions=[],o=0;o<e.extensionRange.length;++o)l.extensions.push([e.extensionRange[o].start,e.extensionRange[o].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(l.reserved=[],e.reservedRange)for(o=0;o<e.reservedRange.length;++o)l.reserved.push([e.reservedRange[o].start,e.reservedRange[o].end]);if(e.reservedName)for(o=0;o<e.reservedName.length;++o)l.reserved.push(e.reservedName[o])}return l},a.prototype.toDescriptor=function(e){var r,n=t.DescriptorProto.create({name:this.name});for(r=0;r<this.fieldsArray.length;++r){var o;if(n.field.push(o=this._fieldsArray[r].toDescriptor(e)),this._fieldsArray[r]instanceof l){var p=b(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),d=b(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),u=11===d||14===d?this._fieldsArray[r].resolvedType&&P(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(t.DescriptorProto.create({name:o.typeName,field:[t.FieldDescriptorProto.create({name:"key",number:1,label:1,type:p}),t.FieldDescriptorProto.create({name:"value",number:2,label:1,type:d,typeName:u})],options:t.MessageOptions.create({mapEntry:!0})}))}}for(r=0;r<this.oneofsArray.length;++r)n.oneofDecl.push(this._oneofsArray[r].toDescriptor());for(r=0;r<this.nestedArray.length;++r)this._nestedArray[r]instanceof s?n.field.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof a?n.nestedType.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof i&&n.enumType.push(this._nestedArray[r].toDescriptor());if(this.extensions)for(r=0;r<this.extensions.length;++r)n.extensionRange.push(t.DescriptorProto.ExtensionRange.create({start:this.extensions[r][0],end:this.extensions[r][1]}));if(this.reserved)for(r=0;r<this.reserved.length;++r)"string"==typeof this.reserved[r]?n.reservedName.push(this.reserved[r]):n.reservedRange.push(t.DescriptorProto.ReservedRange.create({start:this.reserved[r][0],end:this.reserved[r][1]}));return n.options=_(this.options,t.MessageOptions),n};var h=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;s.fromDescriptor=function(e,r,n){if("number"==typeof e.length&&(e=t.DescriptorProto.decode(e)),"number"!=typeof e.number)throw Error("missing field id");var o,i;switch(o=e.typeName&&e.typeName.length?e.typeName:function(e){switch(e){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+e)}(e.type),e.label){case 1:i=void 0;break;case 2:i="required";break;case 3:i="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;void 0!==e.extendee&&(a=a.length?a:void 0);var l=new s(e.name.length?e.name:"field"+e.number,e.number,o,i,a);if(n||(l._edition=r),l.options=w(e.options,t.FieldOptions),e.proto3_optional&&(l.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var p=e.defaultValue;switch(p){case"true":case"TRUE":p=!0;break;case"false":case"FALSE":p=!1;break;default:h.exec(p)&&(p=parseInt(p))}l.setOption("default",p)}return function(e){switch(e){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}(e.type)&&("proto3"===r?e.options&&!e.options.packed&&l.setOption("packed",!1):r&&"proto2"!==r||!e.options||!e.options.packed||l.setOption("packed",!0)),l},s.prototype.toDescriptor=function(e){var n=t.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)n.type=11,n.typeName=r.util.ucFirst(this.name),n.label=3;else{switch(n.type=b(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:n.typeName=this.resolvedType?P(this.parent,this.resolvedType):this.type}"repeated"===this.rule?n.label=3:this.required&&"proto2"===e?n.label=2:n.label=1}if(n.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(n.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(n.options=_(this.options,t.FieldOptions),null!=this.options.default&&(n.defaultValue=String(this.options.default)),this.options.proto3_optional&&(n.proto3_optional=!0)),"proto3"===e?this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!1):e&&"proto2"!==e||!this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!0),n};var m=0;i.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.EnumDescriptorProto.decode(e));var o={};if(e.value)for(var a=0;a<e.value.length;++a){var s=e.value[a].name,l=e.value[a].number||0;o[s&&s.length?s:"NAME"+l]=l}var p=new i(e.name&&e.name.length?e.name:"Enum"+m++,o,w(e.options,t.EnumOptions));return n||(p._edition=r),p},i.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(t.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return t.EnumDescriptorProto.create({name:this.name,value:e,options:_(this.options,t.EnumOptions)})};var g=0;p.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.OneofDescriptorProto.decode(e)),new p(e.name&&e.name.length?e.name:"oneof"+g++)},p.prototype.toDescriptor=function(){return t.OneofDescriptorProto.create({name:this.name})};var y=0;d.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.ServiceDescriptorProto.decode(e));var o=new d(e.name&&e.name.length?e.name:"Service"+y++,w(e.options,t.ServiceOptions));if(n||(o._edition=r),e.method)for(var i=0;i<e.method.length;++i)o.add(u.fromDescriptor(e.method[i]));return o},d.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return t.ServiceDescriptorProto.create({name:this.name,method:e,options:_(this.options,t.ServiceOptions)})};var v=0;function b(e,t,r){switch(e){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(t instanceof i)return 14;if(t instanceof a)return r?10:11;throw Error("illegal type: "+e)}function O(e,t){for(var r,n,o={},s=0;s<t.fieldsArray.length;++s)if("uninterpretedOption"!==(n=(r=t._fieldsArray[s]).name)&&Object.prototype.hasOwnProperty.call(e,n)){var l=E(n);r.resolvedType instanceof a?o[l]=O(e[n],r.resolvedType):r.resolvedType instanceof i?o[l]=r.resolvedType.valuesById[e[n]]:o[l]=e[n]}return o}function w(e,t){if(e)return O(t.toObject(e),t)}function S(e,t){for(var n={},o=Object.keys(e),i=0;i<o.length;++i){var s=o[i],l=r.util.camelCase(s);if(Object.prototype.hasOwnProperty.call(t.fields,l)){var p=t.fields[l];p.resolvedType instanceof a?n[l]=S(e[s],p.resolvedType):n[l]=e[s],p.repeated&&!Array.isArray(n[l])&&(n[l]=[n[l]])}}return n}function _(e,t){if(e)return t.fromObject(S(e,t))}function P(e,t){var r=e.fullName.split("."),i=t.fullName.split("."),a=0,s=0,l=i.length-1;if(!(e instanceof o)&&t instanceof n)for(;a<r.length&&s<l&&r[a]===i[s];){var p=t.lookup(r[a++],!0);if(null!==p&&p!==t)break;++s}else for(;a<r.length&&s<l&&r[a]===i[s];++a,++s);return i.slice(s).join(".")}function E(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function T(e){if("editions"===e.syntax){if(e.edition===t.Edition.EDITION_2023)return"2023";throw new Error("Unsupported edition "+e.edition)}return"proto3"===e.syntax?"proto3":"proto2"}u.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.MethodDescriptorProto.decode(e)),new u(e.name&&e.name.length?e.name:"Method"+v++,"rpc",e.inputType,e.outputType,Boolean(e.clientStreaming),Boolean(e.serverStreaming),w(e.options,t.MethodOptions))},u.prototype.toDescriptor=function(){return t.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:_(this.options,t.MethodOptions)})}}(descriptor$1,descriptor$1.exports)),descriptor$1.exports}var util$4={},nested$6={google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}},require$$3$1={nested:nested$6},nested$5={google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$5$2={nested:nested$5},nested$4={google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$6$1={nested:nested$4},hasRequiredUtil$4;function requireUtil$4(){if(hasRequiredUtil$4)return util$4;hasRequiredUtil$4=1,
7
+ */function requireCookie(){if(hasRequiredCookie)return cookie;hasRequiredCookie=1,cookie.parse=function(e,r){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=r&&r.decode||l,d=0,u=0,c=0;do{if(-1===(u=e.indexOf("=",d)))break;if(-1===(c=e.indexOf(";",d)))c=o;else if(u>c){d=e.lastIndexOf(";",u-1)+1;continue}var f=a(e,d,u),h=s(e,u,f),m=e.slice(f,h);if(!t.call(n,m)){var g=a(e,u+1,c),y=s(e,c,g);34===e.charCodeAt(g)&&34===e.charCodeAt(y-1)&&(g++,y--);var v=e.slice(g,y);n[m]=p(v,i)}d=c+1}while(d<o);return n},cookie.serialize=function(t,a,s){var l=s&&s.encode||encodeURIComponent;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!r.test(t))throw new TypeError("argument name is invalid");var p=l(a);if(!n.test(p))throw new TypeError("argument val is invalid");var d=t+"="+p;if(!s)return d;if(null!=s.maxAge){var u=Math.floor(s.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+u}if(s.domain){if(!o.test(s.domain))throw new TypeError("option domain is invalid");d+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");d+="; Path="+s.path}if(s.expires){var c=s.expires;if(!function(t){return"[object Date]"===e.call(t)}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+c.toUTCString()}s.httpOnly&&(d+="; HttpOnly");s.secure&&(d+="; Secure");s.partitioned&&(d+="; Partitioned");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":d+="; Priority=Low";break;case"medium":d+="; Priority=Medium";break;case"high":d+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return d};var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,r=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,n=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,o=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/;function a(e,t,r){do{var n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<r);return r}function s(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return r}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function p(e,t){try{return t(e)}catch(t){return e}}return cookie}requireCookie();var alphabetByEncoding={},alphabetByValue=Array.from({length:64});for(let e=0,t="A".charCodeAt(0),r="Z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t);alphabetByEncoding[r]=e,alphabetByValue[e]=r}for(let e=0,t="a".charCodeAt(0),r="z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t),n=e+26;alphabetByEncoding[r]=n,alphabetByValue[n]=r}for(let e=0;e<10;e++){alphabetByEncoding[e.toString(10)]=e+52;const t=e.toString(10),r=e+52;alphabetByEncoding[t]=r,alphabetByValue[r]=t}alphabetByEncoding["-"]=62,alphabetByValue[62]="-",alphabetByEncoding._=63,alphabetByValue[63]="_";var bitsPerLetter=6,bitsPerByte=8,maxLetterValue=63,stringToBuffer=e=>(new TextEncoder).encode(e),bufferToString=e=>(new TextDecoder).decode(e),base64urlDecode=e=>{const t=e+"=".repeat((4-e.length%4)%4);let r=t.length/4*3;t.endsWith("==")?r-=2:t.endsWith("=")&&r--;const n=new ArrayBuffer(r),o=new DataView(n);for(let e=0;e<t.length;e+=4){let r=0,n=0;for(let o=e,i=e+3;o<=i;o++)if("="===t[o])r>>=bitsPerLetter;else{if(!(t[o]in alphabetByEncoding))throw new TypeError(`Invalid character ${t[o]} in base64 string.`);r|=alphabetByEncoding[t[o]]<<(i-o)*bitsPerLetter,n+=bitsPerLetter}const i=e/4*3;r>>=n%bitsPerByte;const a=Math.floor(n/bitsPerByte);for(let e=0;e<a;e++){const t=(a-e-1)*bitsPerByte;o.setUint8(i+e,(r&255<<t)>>t)}}return new Uint8Array(n)},base64urlEncode=e=>{const t="string"==typeof e?stringToBuffer(e):e;let r="";for(let e=0;e<t.length;e+=3){let n=0,o=0;for(let r=e,i=Math.min(e+3,t.length);r<i;r++)n|=t[r]<<(i-r-1)*bitsPerByte,o+=bitsPerByte;const i=Math.ceil(o/bitsPerLetter);n<<=i*bitsPerLetter-o;for(let e=1;e<=i;e++){const t=(i-e)*bitsPerLetter;r+=alphabetByValue[(n&maxLetterValue<<t)>>t]}}return r},defaults={encryption:{saltBits:256,algorithm:"aes-256-cbc",iterations:1,minPasswordlength:32},integrity:{saltBits:256,algorithm:"sha256",iterations:1,minPasswordlength:32},ttl:0,timestampSkewSec:60,localtimeOffsetMsec:0},clone$1=e=>({...e,encryption:{...e.encryption},integrity:{...e.integrity}}),algorithms={"aes-128-ctr":{keyBits:128,ivBits:128,name:"AES-CTR"},"aes-256-cbc":{keyBits:256,ivBits:128,name:"AES-CBC"},sha256:{keyBits:256,name:"SHA-256"}},macPrefix="Fe26.2",randomBytes=(e,t)=>{const r=new Uint8Array(t);return e.getRandomValues(r),r},randomBits=(e,t)=>{if(t<1)throw new Error("Invalid random bits count");const r=Math.ceil(t/8);return randomBytes(e,r)},pbkdf2=async(e,t,r,n,o,i)=>{const a=stringToBuffer(t),s=await e.subtle.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits"]),l={name:"PBKDF2",hash:i,salt:stringToBuffer(r),iterations:n};return await e.subtle.deriveBits(l,s,8*o)},generateKey=async(e,t,r)=>{var n;if(!(null==t?void 0:t.length))throw new Error("Empty password");if(null==r||"object"!=typeof r)throw new Error("Bad options");if(!(r.algorithm in algorithms))throw new Error(`Unknown algorithm: ${r.algorithm}`);const o=algorithms[r.algorithm],i={},a=null!=(n=r.hmac)&&n,s=a?{name:"HMAC",hash:o.name}:{name:o.name},l=a?["sign","verify"]:["encrypt","decrypt"];if("string"==typeof t){if(t.length<r.minPasswordlength)throw new Error(`Password string too short (min ${r.minPasswordlength} characters required)`);let{salt:n=""}=r;if(!n){const{saltBits:t=0}=r;if(!t)throw new Error("Missing salt and saltBits options");const o=randomBits(e,t);n=[...new Uint8Array(o)].map(e=>e.toString(16).padStart(2,"0")).join("")}const a=await pbkdf2(e,t,n,r.iterations,o.keyBits/8,"SHA-1"),p=await e.subtle.importKey("raw",a,s,!1,l);i.key=p,i.salt=n}else{if(t.length<o.keyBits/8)throw new Error("Key buffer (password) too small");i.key=await e.subtle.importKey("raw",t,s,!1,l),i.salt=""}return r.iv?i.iv=r.iv:"ivBits"in o&&(i.iv=randomBits(e,o.ivBits)),i},getEncryptParams=(e,t,r)=>["aes-128-ctr"===e?{name:"AES-CTR",counter:t.iv,length:128}:{name:"AES-CBC",iv:t.iv},t.key,"string"==typeof r?stringToBuffer(r):r],encrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.encrypt(...getEncryptParams(r.algorithm,o,n));return{encrypted:new Uint8Array(i),key:o}},decrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.decrypt(...getEncryptParams(r.algorithm,o,n));return bufferToString(new Uint8Array(i))},hmacWithPassword=async(e,t,r,n)=>{const o=await generateKey(e,t,{...r,hmac:!0}),i=stringToBuffer(n),a=await e.subtle.sign({name:"HMAC"},o.key,i);return{digest:base64urlEncode(new Uint8Array(a)),salt:o.salt}},normalizePassword=e=>"string"==typeof e||e instanceof Uint8Array?{encryption:e,integrity:e}:"secret"in e?{id:e.id,encryption:e.secret,integrity:e.secret}:{id:e.id,encryption:e.encryption,integrity:e.integrity},seal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone$1(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=JSON.stringify(t),s=normalizePassword(r),{id:l="",encryption:p,integrity:d}=s;if(l&&!/^\w+$/.test(l))throw new Error("Invalid password id");const{encrypted:u,key:c}=await encrypt(e,p,o.encryption,a),f=base64urlEncode(new Uint8Array(u)),h=base64urlEncode(c.iv),m=o.ttl?i+o.ttl:"",g=`${macPrefix}*${l}*${c.salt}*${h}*${f}*${m}`,y=await hmacWithPassword(e,d,o.integrity,g);return`${g}*${y.salt}*${y.digest}`},fixedTimeComparison=(e,t)=>{let r=e.length===t.length?0:1;r&&(t=e);for(let n=0;n<e.length;n+=1)r|=e.charCodeAt(n)^t.charCodeAt(n);return 0===r},unseal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone$1(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=t.split("*");if(8!==a.length)throw new Error("Incorrect number of sealed components");const s=a[0];let l=a[1];const p=a[2],d=a[3],u=a[4],c=a[5],f=a[6],h=a[7],m=`${s}*${l}*${p}*${d}*${u}*${c}`;if(macPrefix!==s)throw new Error("Wrong mac prefix");if(c){if(!/^\d+$/.test(c))throw new Error("Invalid expiration");if(Number.parseInt(c,10)<=i-1e3*o.timestampSkewSec)throw new Error("Expired seal")}let g="";if(l=l||"default","string"==typeof r||r instanceof Uint8Array)g=r;else{if(!(l in r))throw new Error(`Cannot find password: ${l}`);g=r[l]}g=normalizePassword(g);const y=o.integrity;y.salt=f;const v=await hmacWithPassword(e,g.integrity,y,m);if(!fixedTimeComparison(v.digest,h))throw new Error("Bad hmac value");const b=base64urlDecode(u),O=o.encryption;O.salt=p,O.iv=base64urlDecode(d);const w=await decrypt(e,g.encryption,O,b);return w?JSON.parse(w):null};const webCrypto=globalThis.crypto,subtle=webCrypto.subtle,randomUUID$1=()=>webCrypto.randomUUID(),getRandomValues$1=e=>webCrypto.getRandomValues(e),_crypto={randomUUID:randomUUID$1,getRandomValues:getRandomValues$1,subtle:subtle};var crypto$1=Object.freeze({__proto__:null,default:_crypto,getRandomValues:getRandomValues$1,randomUUID:randomUUID$1,subtle:subtle}),fourteenDaysInSeconds=1209600,currentMajorVersion=2,versionDelimiter="~";function normalizeStringPasswordToMap(e){return"string"==typeof e?{1:e}:e}function parseSeal(e){const[t,r]=e.split(versionDelimiter);return{sealWithoutVersion:t,tokenVersion:null==r?null:parseInt(r,10)}}function createSealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),i=Math.max(...Object.keys(o).map(Number)),a={id:i.toString(),secret:o[i]};return`${await seal(e,t,a,{...defaults,ttl:1e3*n})}${versionDelimiter}${currentMajorVersion}`}}function createUnsealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),{sealWithoutVersion:i,tokenVersion:a}=parseSeal(t);try{const t=await unseal(e,i,o,{...defaults,ttl:1e3*n})??{};return 2===a?t:{...t.persistent}}catch(e){if(e instanceof Error&&/^(Expired seal|Bad hmac value|Cannot find password|Incorrect number of sealed components)/.test(e.message))return{};throw e}}}var sealData=createSealData(crypto$1),unsealData=createUnsealData(crypto$1),createAnnouncementAttachmentArgsSchema=z__default.default.object({courseId:z__default.default.string(),itemId:z__default.default.string(),addOnToken:z__default.default.string(),title:z__default.default.string(),lessonSlug:z__default.default.string(),programmeSlug:z__default.default.string(),unitSlug:z__default.default.string(),maxPoints:z__default.default.number().optional()}),classroomAttachmentSchema=z__default.default.object({courseId:z__default.default.string(),postId:z__default.default.string(),id:z__default.default.string(),title:z__default.default.string(),teacherViewUri:z__default.default.object({uri:z__default.default.string()}),studentViewUri:z__default.default.object({uri:z__default.default.string()}),studentWorkReviewUri:z__default.default.object({uri:z__default.default.string()}).optional(),itemId:z__default.default.string(),maxPoints:z__default.default.number().optional()});z__default.default.string();var googleOAuthUserSchema=z__default.default.object({accessToken:z__default.default.string(),loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional(),email:z__default.default.string().optional()}),tokenPayloadSchema=z__default.default.object({token:z__default.default.string()});z__default.default.tuple([createAnnouncementAttachmentArgsSchema,z__default.default.string().min(1),z__default.default.string().min(1)]);var classroomAttachmentEntitySchema=classroomAttachmentSchema.extend({attachmentId:z__default.default.string(),createdAt:z__default.default.string()}),userCredentialsEntitySchema=z__default.default.object({loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional()}),GoogleClassroomClient=function(){function e(e,t){this.baseUrl=e,this.oAuthClient=t,this.baseUrl=e,this.oAuthClient=t}return e.prototype.getClassroomClient=function(){return __awaiter(this,void 0,void 0,function(){var e;return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.oAuthClient.getOAuth2Client()];case 1:return e=t.sent(),[2,new classroom.classroom_v1.Classroom({auth:e})]}})})},e.prototype.createAnnouncementAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a,s,l,p,d,u,c,f;return __generator$1(this,function(h){switch(h.label){case 0:return t=e.courseId,r=e.itemId,n=e.addOnToken,o=e.title,i=e.lessonSlug,a=e.programmeSlug,s=e.unitSlug,l=e.maxPoints,[4,this.getClassroomClient()];case 1:return p=h.sent(),d=l?{maxPoints:l,studentWorkReviewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)}}:{},[4,p.courses.courseWork.addOnAttachments.create({courseId:t,itemId:r,addOnToken:n,requestBody:__assign({title:o,teacherViewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)},studentViewUri:{uri:"".concat(this.baseUrl,"/pupils/programmes/").concat(a,"/units/").concat(s,"/lessons/").concat(i)}},d)})];case 2:return u=h.sent(),c=classroomAttachmentSchema.parse(u.data),f=c.maxPoints?{maxPoints:c.maxPoints,studentWorkReviewUri:c.studentWorkReviewUri}:{},[2,__assign({courseId:c.courseId,postId:c.postId,id:c.id,title:c.title,teacherViewUri:c.teacherViewUri,studentViewUri:c.studentViewUri,itemId:c.itemId},f)]}})})},e.prototype.submitPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.patch({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId,updateMask:"pointsEarned",requestBody:{pointsEarned:e.pointsEarned}})];case 2:return[2,t.sent().data]}})})},e.prototype.fetchPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.get({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId})];case 2:return[2,t.sent().data]}})})},e}(),ExceptionType,ErrorSeverity;exports.ExceptionType=void 0,ExceptionType=exports.ExceptionType||(exports.ExceptionType={}),ExceptionType.GoogleOAuth="google-oauth",ExceptionType.Firestore="firestore",ExceptionType.Encryption="encryption",exports.ErrorSeverity=void 0,ErrorSeverity=exports.ErrorSeverity||(exports.ErrorSeverity={}),ErrorSeverity.Error="error",ErrorSeverity.Warning="warning",ErrorSeverity.Info="info";var OakGoogleClassroomException=function(e){function t(r,n,o){var i,a,s,l=e.call(this,r)||this;return Object.setPrototypeOf(l,t.prototype),l.name="OakGoogleClassroomException",l.type=n,l.code=null==o?void 0:o.code,l.shouldRetry=null!==(i=null==o?void 0:o.shouldRetry)&&void 0!==i&&i,l.severity=null!==(a=null==o?void 0:o.severity)&&void 0!==a?a:exports.ErrorSeverity.Error,l.context=null==o?void 0:o.context,l.originalError=null==o?void 0:o.originalError,(null===(s=null==o?void 0:o.originalError)||void 0===s?void 0:s.stack)&&(l.stack=o.originalError.stack),l}return __extends$1(t,e),t.prototype.toObject=function(){return{name:this.name,message:this.message,type:this.type,code:this.code,shouldRetry:this.shouldRetry,severity:this.severity,context:this.context,originalError:this.originalError}},t}(Error),src$7={},src$6={},callCredentials={},metadata={},logging={},constants={},hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,Object.defineProperty(constants,"__esModule",{value:!0}),constants.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=constants.DEFAULT_MAX_SEND_MESSAGE_LENGTH=constants.Propagate=constants.LogVerbosity=constants.Status=void 0,function(e){e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.ALREADY_EXISTS=6]="ALREADY_EXISTS",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.OUT_OF_RANGE=11]="OUT_OF_RANGE",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.DATA_LOSS=15]="DATA_LOSS",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED"}(e||(constants.Status=e={})),function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.ERROR=2]="ERROR",e[e.NONE=3]="NONE"}(t||(constants.LogVerbosity=t={})),function(e){e[e.DEADLINE=1]="DEADLINE",e[e.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",e[e.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",e[e.CANCELLATION=8]="CANCELLATION",e[e.DEFAULTS=65535]="DEFAULTS"}(r||(constants.Propagate=r={})),constants.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1,constants.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4194304),constants;var e,t,r}var version$3="1.14.0",require$$11={version:version$3},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(e){var t,r,n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.setLoggerVerbosity=e.setLogger=e.getLogger=void 0,e.trace=function(t,r,n){m(r)&&(0,e.log)(t,(new Date).toISOString()+" | v"+s+" "+a.pid+" | "+r+" | "+n)},e.isTracerEnabled=m;const i=requireConstants(),a=require$$1__default.default,s=require$$11.version,l={error:(e,...t)=>{console.error("E "+e,...t)},info:(e,...t)=>{console.error("I "+e,...t)},debug:(e,...t)=>{console.error("D "+e,...t)}};let p=l,d=i.LogVerbosity.ERROR;switch((null!==(r=null!==(t=process.env.GRPC_NODE_VERBOSITY)&&void 0!==t?t:process.env.GRPC_VERBOSITY)&&void 0!==r?r:"").toUpperCase()){case"DEBUG":d=i.LogVerbosity.DEBUG;break;case"INFO":d=i.LogVerbosity.INFO;break;case"ERROR":d=i.LogVerbosity.ERROR;break;case"NONE":d=i.LogVerbosity.NONE}e.getLogger=()=>p;e.setLogger=e=>{p=e};e.setLoggerVerbosity=e=>{d=e};e.log=(e,...t)=>{let r;if(e>=d){switch(e){case i.LogVerbosity.DEBUG:r=p.debug;break;case i.LogVerbosity.INFO:r=p.info;break;case i.LogVerbosity.ERROR:r=p.error}r||(r=p.error),r&&r.bind(p)(...t)}};const u=null!==(o=null!==(n=process.env.GRPC_NODE_TRACE)&&void 0!==n?n:process.env.GRPC_TRACE)&&void 0!==o?o:"",c=new Set,f=new Set;for(const e of u.split(","))e.startsWith("-")?f.add(e.substring(1)):c.add(e);const h=c.has("all");function m(e){return!f.has(e)&&(h||c.has(e))}}(logging)),logging}var error={},hasRequiredError,hasRequiredMetadata,hasRequiredCallCredentials;function requireError(){if(hasRequiredError)return error;return hasRequiredError=1,Object.defineProperty(error,"__esModule",{value:!0}),error.getErrorMessage=function(e){return e instanceof Error?e.message:String(e)},error.getErrorCode=function(e){return"object"==typeof e&&null!==e&&"code"in e&&"number"==typeof e.code?e.code:null},error}function requireMetadata(){if(hasRequiredMetadata)return metadata;hasRequiredMetadata=1,Object.defineProperty(metadata,"__esModule",{value:!0}),metadata.Metadata=void 0;const e=requireLogging(),t=requireConstants(),r=requireError(),n=/^[:0-9a-z_.-]+$/,o=/^[ -~]*$/;function i(e){return e.endsWith("-bin")}function a(e){return!e.startsWith("grpc-")}function s(e){return e.toLowerCase()}function l(e,t){if(!function(e){return n.test(e)}(e))throw new Error('Metadata key "'+e+'" contains illegal characters');if(null!=t)if(i(e)){if(!Buffer.isBuffer(t))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(t))throw new Error("keys that don't end with '-bin' must have String values");if(!function(e){return o.test(e)}(t))throw new Error('Metadata string value "'+t+'" contains illegal characters')}}class p{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){l(e=s(e),t),this.internalRepr.set(e,[t])}add(e,t){l(e=s(e),t);const r=this.internalRepr.get(e);void 0===r?this.internalRepr.set(e,[t]):r.push(t)}remove(e){e=s(e),this.internalRepr.delete(e)}get(e){return e=s(e),this.internalRepr.get(e)||[]}getMap(){const e={};for(const[t,r]of this.internalRepr)if(r.length>0){const n=r[0];e[t]=Buffer.isBuffer(n)?Buffer.from(n):n}return e}clone(){const e=new p(this.options),t=e.internalRepr;for(const[e,r]of this.internalRepr){const n=r.map(e=>Buffer.isBuffer(e)?Buffer.from(e):e);t.set(e,n)}return e}merge(e){for(const[t,r]of e.internalRepr){const e=(this.internalRepr.get(t)||[]).concat(r);this.internalRepr.set(t,e)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){const e={};for(const[t,r]of this.internalRepr)t.startsWith(":")||(e[t]=r.map(d));return e}toJSON(){const e={};for(const[t,r]of this.internalRepr)e[t]=r;return e}setOpaque(e,t){this.opaqueData.set(e,t)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(n){const o=new p;for(const s of Object.keys(n)){if(":"===s.charAt(0))continue;const l=n[s];try{i(s)?Array.isArray(l)?l.forEach(e=>{o.add(s,Buffer.from(e,"base64"))}):void 0!==l&&(a(s)?l.split(",").forEach(e=>{o.add(s,Buffer.from(e.trim(),"base64"))}):o.add(s,Buffer.from(l,"base64"))):Array.isArray(l)?l.forEach(e=>{o.add(s,e)}):void 0!==l&&o.add(s,l)}catch(n){const o=`Failed to add metadata entry ${s}: ${l}. ${(0,r.getErrorMessage)(n)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,e.log)(t.LogVerbosity.ERROR,o)}}return o}}metadata.Metadata=p;const d=e=>Buffer.isBuffer(e)?e.toString("base64"):e;return metadata}function requireCallCredentials(){if(hasRequiredCallCredentials)return callCredentials;hasRequiredCallCredentials=1,Object.defineProperty(callCredentials,"__esModule",{value:!0}),callCredentials.CallCredentials=void 0;const e=requireMetadata();class t{static createFromMetadataGenerator(e){return new n(e)}static createFromGoogleCredential(r){return t.createFromMetadataGenerator((t,n)=>{let o;o=function(e){return"getRequestHeaders"in e&&"function"==typeof e.getRequestHeaders}(r)?r.getRequestHeaders(t.service_url):new Promise((e,n)=>{r.getRequestMetadata(t.service_url,(t,r)=>{t?n(t):r?e(r):n(new Error("Headers not set by metadata plugin"))})}),o.then(t=>{const r=new e.Metadata;for(const e of Object.keys(t))r.add(e,t[e]);n(null,r)},e=>{n(e)})})}static createEmpty(){return new o}}callCredentials.CallCredentials=t;class r extends t{constructor(e){super(),this.creds=e}async generateMetadata(t){const r=new e.Metadata,n=await Promise.all(this.creds.map(e=>e.generateMetadata(t)));for(const e of n)r.merge(e);return r}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e||e instanceof r&&this.creds.every((t,r)=>t._equals(e.creds[r]))}}class n extends t{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,r)=>{this.metadataGenerator(e,(e,n)=>{void 0!==n?t(n):r(e)})})}compose(e){return new r([this,e])}_equals(e){return this===e||e instanceof n&&this.metadataGenerator===e.metadataGenerator}}class o extends t{generateMetadata(t){return Promise.resolve(new e.Metadata)}compose(e){return e}_equals(e){return e instanceof o}}return callCredentials}var channel={},channelCredentials={},tlsHelpers={},hasRequiredTlsHelpers;function requireTlsHelpers(){if(hasRequiredTlsHelpers)return tlsHelpers;hasRequiredTlsHelpers=1,Object.defineProperty(tlsHelpers,"__esModule",{value:!0}),tlsHelpers.CIPHER_SUITES=void 0,tlsHelpers.getDefaultRootsData=function(){if(t)return null===r&&(r=e.readFileSync(t)),r;return null};const e=require$$0__default.default;tlsHelpers.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;const t=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH;let r=null;return tlsHelpers}var uriParser={},hasRequiredUriParser;function requireUriParser(){if(hasRequiredUriParser)return uriParser;hasRequiredUriParser=1,Object.defineProperty(uriParser,"__esModule",{value:!0}),uriParser.parseUri=function(t){const r=e.exec(t);if(null===r)return null;return{scheme:r[1],authority:r[2],path:r[3]}},uriParser.splitHostPort=function(e){if(e.startsWith("[")){const r=e.indexOf("]");if(-1===r)return null;const n=e.substring(1,r);if(-1===n.indexOf(":"))return null;if(e.length>r+1){if(":"===e[r+1]){const o=e.substring(r+2);return t.test(o)?{host:n,port:+o}:null}return null}return{host:n}}{const r=e.split(":");return 2===r.length?t.test(r[1])?{host:r[0],port:+r[1]}:null:{host:e}}},uriParser.combineHostPort=function(e){return void 0===e.port?e.host:e.host.includes(":")?`[${e.host}]:${e.port}`:`${e.host}:${e.port}`},uriParser.uriToString=function(e){let t="";void 0!==e.scheme&&(t+=e.scheme+":");void 0!==e.authority&&(t+="//"+e.authority+"/");return t+=e.path,t};const e=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;const t=/^\d+$/;return uriParser}var resolver={},hasRequiredResolver,hasRequiredChannelCredentials;function requireResolver(){if(hasRequiredResolver)return resolver;hasRequiredResolver=1,Object.defineProperty(resolver,"__esModule",{value:!0}),resolver.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0,resolver.registerResolver=function(e,r){t[e]=r},resolver.registerDefaultScheme=function(e){r=e},resolver.createResolver=function(r,n,o){if(void 0!==r.scheme&&r.scheme in t)return new t[r.scheme](r,n,o);throw new Error(`No resolver could be created for target ${(0,e.uriToString)(r)}`)},resolver.getDefaultAuthority=function(r){if(void 0!==r.scheme&&r.scheme in t)return t[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,e.uriToString)(r)}`)},resolver.mapUriDefaultScheme=function(n){if(void 0===n.scheme||!(n.scheme in t))return null!==r?{scheme:r,authority:void 0,path:(0,e.uriToString)(n)}:null;return n};const e=requireUriParser();resolver.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";const t={};let r=null;return resolver}function requireChannelCredentials(){if(hasRequiredChannelCredentials)return channelCredentials;hasRequiredChannelCredentials=1,Object.defineProperty(channelCredentials,"__esModule",{value:!0}),channelCredentials.ChannelCredentials=void 0,channelCredentials.createCertificateProviderChannelCredentials=function(e,t,r){return new f(e,t,null!=r?r:{})};const e=require$$1__default$1.default,t=requireCallCredentials(),r=requireTlsHelpers(),n=requireUriParser(),o=requireResolver(),i=requireLogging(),a=requireConstants();function s(e,t){if(e&&!(e instanceof Buffer))throw new TypeError(`${t}, if provided, must be a Buffer.`)}class l{compose(e){return new h(this,e)}static createSsl(t,n,o,i){var a;if(s(t,"Root certificate"),s(n,"Private key"),s(o,"Certificate chain"),n&&!o)throw new Error("Private key must be given with accompanying certificate chain");if(!n&&o)throw new Error("Certificate chain must be given with accompanying private key");const l=(0,e.createSecureContext)({ca:null!==(a=null!=t?t:(0,r.getDefaultRootsData)())&&void 0!==a?a:void 0,key:null!=n?n:void 0,cert:null!=o?o:void 0,ciphers:r.CIPHER_SUITES});return new c(l,null!=i?i:{})}static createFromSecureContext(e,t){return new c(e,null!=t?t:{})}static createInsecure(){return new p}}channelCredentials.ChannelCredentials=l;class p extends l{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof p}_createSecureConnector(e,r,n){return{connect:e=>Promise.resolve({socket:e,secure:!1}),waitForReady:()=>Promise.resolve(),getCallCredentials:()=>null!=n?n:t.CallCredentials.createEmpty(),destroy(){}}}}function d(t,r,i,a){var s,l;const p={secureContext:t};let d=i;if("grpc.http_connect_target"in a){const e=(0,n.parseUri)(a["grpc.http_connect_target"]);e&&(d=e)}const u=(0,o.getDefaultAuthority)(d),c=(0,n.splitHostPort)(u),f=null!==(s=null==c?void 0:c.host)&&void 0!==s?s:u;if(p.host=f,r.checkServerIdentity&&(p.checkServerIdentity=r.checkServerIdentity),void 0!==r.rejectUnauthorized&&(p.rejectUnauthorized=r.rejectUnauthorized),p.ALPNProtocols=["h2"],a["grpc.ssl_target_name_override"]){const t=a["grpc.ssl_target_name_override"],r=null!==(l=p.checkServerIdentity)&&void 0!==l?l:e.checkServerIdentity;p.checkServerIdentity=(e,n)=>r(t,n),p.servername=t}else p.servername=f;return a["grpc-node.tls_enable_trace"]&&(p.enableTrace=!0),p}class u{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(t){const r=Object.assign({socket:t},this.connectionOptions);return new Promise((t,n)=>{const o=(0,e.connect)(r,()=>{var e;null!==(e=this.connectionOptions.rejectUnauthorized)&&void 0!==e&&!e||o.authorized?t({socket:o,secure:!0}):n(o.authorizationError)});o.on("error",e=>{n(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}}class c extends l{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e||e instanceof c&&(this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity)}_createSecureConnector(e,r,n){const o=d(this.secureContext,this.verifyOptions,e,r);return new u(o,null!=n?n:t.CallCredentials.createEmpty())}}class f extends l{constructor(e,t,r){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=r,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,r;return this===e||e instanceof f&&(this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&(null===(t=this.verifyOptions)||void 0===t?void 0:t.checkServerIdentity)===(null===(r=e.verifyOptions)||void 0===r?void 0:r.checkServerIdentity))}ref(){var e;0===this.refcount&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),null===(e=this.identityCertificateProvider)||void 0===e||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,0===this.refcount&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),null===(e=this.identityCertificateProvider)||void 0===e||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,r,n){return this.ref(),new f.SecureConnectorImpl(this,e,r,null!=n?n:t.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(const e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return void 0!==this.latestCaUpdate&&(!this.identityCertificateProvider||void 0!==this.latestIdentityUpdate)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var t,n;if(!this.latestCaUpdate)return null;if(null!==this.identityCertificateProvider&&!this.latestIdentityUpdate)return null;try{return(0,e.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:null===(t=this.latestIdentityUpdate)||void 0===t?void 0:t.privateKey,cert:null===(n=this.latestIdentityUpdate)||void 0===n?void 0:n.certificate,ciphers:r.CIPHER_SUITES})}catch(e){return(0,i.log)(a.LogVerbosity.ERROR,"Failed to createSecureContext with error "+e.message),null}}}f.SecureConnectorImpl=class{constructor(e,t,r,n){this.parent=e,this.channelTarget=t,this.options=r,this.callCredentials=n}connect(t){return new Promise((r,n)=>{const o=this.parent.getLatestSecureContext();if(!o)return void n(new Error("Failed to load credentials"));t.closed&&n(new Error("Socket closed while loading credentials"));const i=d(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:t},i),s=()=>{n(new Error("Socket closed"))},l=e=>{n(e)},p=(0,e.connect)(a,()=>{var e;p.removeListener("close",s),p.removeListener("error",l),null!==(e=this.parent.verifyOptions.rejectUnauthorized)&&void 0!==e&&!e||p.authorized?r({socket:p,secure:!0}):n(p.authorizationError)});p.once("close",s),p.once("error",l)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};class h extends l{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){const t=this.callCredentials.compose(e);return new h(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e||e instanceof h&&(this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials))}_createSecureConnector(e,r,n){const o=this.callCredentials.compose(null!=n?n:t.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,o)}}return channelCredentials}var internalChannel={},resolvingLoadBalancer={},loadBalancer={},hasRequiredLoadBalancer;function requireLoadBalancer(){if(hasRequiredLoadBalancer)return loadBalancer;hasRequiredLoadBalancer=1,Object.defineProperty(loadBalancer,"__esModule",{value:!0}),loadBalancer.createChildChannelControlHelper=function(e,t){var r,n,o,i,a,s,l,p,d,u;return{createSubchannel:null!==(n=null===(r=t.createSubchannel)||void 0===r?void 0:r.bind(t))&&void 0!==n?n:e.createSubchannel.bind(e),updateState:null!==(i=null===(o=t.updateState)||void 0===o?void 0:o.bind(t))&&void 0!==i?i:e.updateState.bind(e),requestReresolution:null!==(s=null===(a=t.requestReresolution)||void 0===a?void 0:a.bind(t))&&void 0!==s?s:e.requestReresolution.bind(e),addChannelzChild:null!==(p=null===(l=t.addChannelzChild)||void 0===l?void 0:l.bind(t))&&void 0!==p?p:e.addChannelzChild.bind(e),removeChannelzChild:null!==(u=null===(d=t.removeChannelzChild)||void 0===d?void 0:d.bind(t))&&void 0!==u?u:e.removeChannelzChild.bind(e)}},loadBalancer.registerLoadBalancerType=function(e,t,n){r[e]={LoadBalancer:t,LoadBalancingConfig:n}},loadBalancer.registerDefaultLoadBalancerType=function(e){n=e},loadBalancer.createLoadBalancer=function(e,t){const n=e.getLoadBalancerName();return n in r?new r[n].LoadBalancer(t):null},loadBalancer.isLoadBalancerNameRegistered=function(e){return e in r},loadBalancer.parseLoadBalancingConfig=o,loadBalancer.getDefaultConfig=function(){if(!n)throw new Error("No default load balancer type registered");return new r[n].LoadBalancingConfig},loadBalancer.selectLbConfigFromList=function(i,a=!1){for(const r of i)try{return o(r)}catch(r){(0,e.log)(t.LogVerbosity.DEBUG,"Config parsing failed with error",r.message);continue}return a&&n?new r[n].LoadBalancingConfig:null};const e=requireLogging(),t=requireConstants();const r={};let n=null;function o(e){const t=Object.keys(e);if(1!==t.length)throw new Error("Provided load balancing config has multiple conflicting entries");const n=t[0];if(!(n in r))throw new Error(`Unrecognized load balancing config name ${n}`);try{return r[n].LoadBalancingConfig.createFromJson(e[n])}catch(e){throw new Error(`${n}: ${e.message}`)}}return loadBalancer}var serviceConfig={},hasRequiredServiceConfig;function requireServiceConfig(){if(hasRequiredServiceConfig)return serviceConfig;hasRequiredServiceConfig=1,Object.defineProperty(serviceConfig,"__esModule",{value:!0}),serviceConfig.validateRetryThrottling=a,serviceConfig.validateServiceConfig=l,serviceConfig.extractAndSelectServiceConfig=function(e,t){for(const r of e)if(r.length>0&&r[0].startsWith("grpc_config=")){const e=r.join("").substring(12);return d(JSON.parse(e),t)}return null};const e=require$$0__default$1.default,t=requireConstants(),r=/^\d+(\.\d{1,9})?s$/,n="node";function o(e){if("service"in e&&""!==e.service){if("string"!=typeof e.service)throw new Error("Invalid method config name: invalid service: expected type string, got "+typeof e.service);if("method"in e&&""!==e.method){if("string"!=typeof e.method)throw new Error("Invalid method config name: invalid method: expected type string, got "+typeof e.service);return{service:e.service,method:e.method}}return{service:e.service}}if("method"in e&&void 0!==e.method)throw new Error("Invalid method config name: method set with empty or unset service");return{}}function i(e){var n;const i={name:[]};if(!("name"in e)||!Array.isArray(e.name))throw new Error("Invalid method config: invalid name array");for(const t of e.name)i.name.push(o(t));if("waitForReady"in e){if("boolean"!=typeof e.waitForReady)throw new Error("Invalid method config: invalid waitForReady");i.waitForReady=e.waitForReady}if("timeout"in e)if("object"==typeof e.timeout){if(!("seconds"in e.timeout)||"number"!=typeof e.timeout.seconds)throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in e.timeout)||"number"!=typeof e.timeout.nanos)throw new Error("Invalid method config: invalid timeout.nanos");i.timeout=e.timeout}else{if("string"!=typeof e.timeout||!r.test(e.timeout))throw new Error("Invalid method config: invalid timeout");{const t=e.timeout.substring(0,e.timeout.length-1).split(".");i.timeout={seconds:0|t[0],nanos:0|(null!==(n=t[1])&&void 0!==n?n:0)}}}if("maxRequestBytes"in e){if("number"!=typeof e.maxRequestBytes)throw new Error("Invalid method config: invalid maxRequestBytes");i.maxRequestBytes=e.maxRequestBytes}if("maxResponseBytes"in e){if("number"!=typeof e.maxResponseBytes)throw new Error("Invalid method config: invalid maxRequestBytes");i.maxResponseBytes=e.maxResponseBytes}if("retryPolicy"in e){if("hedgingPolicy"in e)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");i.retryPolicy=function(e){if(!("maxAttempts"in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in e)||"string"!=typeof e.initialBackoff||!r.test(e.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in e)||"string"!=typeof e.maxBackoff||!r.test(e.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in e)||"number"!=typeof e.backoffMultiplier||e.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in e)||!Array.isArray(e.retryableStatusCodes))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(0===e.retryableStatusCodes.length)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(const r of e.retryableStatusCodes)if("number"==typeof r){if(!Object.values(t.Status).includes(r))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else{if("string"!=typeof r)throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");if(!Object.values(t.Status).includes(r.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}return{maxAttempts:e.maxAttempts,initialBackoff:e.initialBackoff,maxBackoff:e.maxBackoff,backoffMultiplier:e.backoffMultiplier,retryableStatusCodes:e.retryableStatusCodes}}(e.retryPolicy)}else"hedgingPolicy"in e&&(i.hedgingPolicy=function(e){if(!("maxAttempts"in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in e&&("string"!=typeof e.hedgingDelay||!r.test(e.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in e&&Array.isArray(e.nonFatalStatusCodes))for(const r of e.nonFatalStatusCodes)if("number"==typeof r){if(!Object.values(t.Status).includes(r))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else{if("string"!=typeof r)throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");if(!Object.values(t.Status).includes(r.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}const n={maxAttempts:e.maxAttempts};return e.hedgingDelay&&(n.hedgingDelay=e.hedgingDelay),e.nonFatalStatusCodes&&(n.nonFatalStatusCodes=e.nonFatalStatusCodes),n}(e.hedgingPolicy));return i}function a(e){if(!("maxTokens"in e)||"number"!=typeof e.maxTokens||e.maxTokens<=0||e.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in e)||"number"!=typeof e.tokenRatio||e.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+e.maxTokens.toFixed(3),tokenRatio:+e.tokenRatio.toFixed(3)}}function s(e){if("object"!=typeof e||null===e)throw new Error("Invalid loadBalancingConfig: unexpected type "+typeof e);const t=Object.keys(e);if(t.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${t}`);if(0===t.length)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[t[0]]:e[t[0]]}}function l(e){const t={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in e){if("string"!=typeof e.loadBalancingPolicy)throw new Error("Invalid service config: invalid loadBalancingPolicy");t.loadBalancingPolicy=e.loadBalancingPolicy}if("loadBalancingConfig"in e){if(!Array.isArray(e.loadBalancingConfig))throw new Error("Invalid service config: invalid loadBalancingConfig");for(const r of e.loadBalancingConfig)t.loadBalancingConfig.push(s(r))}if("methodConfig"in e&&Array.isArray(e.methodConfig))for(const r of e.methodConfig)t.methodConfig.push(i(r));"retryThrottling"in e&&(t.retryThrottling=a(e.retryThrottling));const r=[];for(const e of t.methodConfig)for(const t of e.name){for(const e of r)if(t.service===e.service&&t.method===e.method)throw new Error(`Invalid service config: duplicate name ${t.service}/${t.method}`);r.push(t)}return t}function p(e){if(!("serviceConfig"in e))throw new Error("Invalid service config choice: missing service config");const t={serviceConfig:l(e.serviceConfig)};if("clientLanguage"in e){if(!Array.isArray(e.clientLanguage))throw new Error("Invalid service config choice: invalid clientLanguage");t.clientLanguage=[];for(const r of e.clientLanguage){if("string"!=typeof r)throw new Error("Invalid service config choice: invalid clientLanguage");t.clientLanguage.push(r)}}if("clientHostname"in e){if(!Array.isArray(e.clientHostname))throw new Error("Invalid service config choice: invalid clientHostname");t.clientHostname=[];for(const r of e.clientHostname){if("string"!=typeof r)throw new Error("Invalid service config choice: invalid clientHostname");t.clientHostname.push(r)}}if("percentage"in e){if(!("number"==typeof e.percentage&&0<=e.percentage&&e.percentage<=100))throw new Error("Invalid service config choice: invalid percentage");t.percentage=e.percentage}const r=["clientLanguage","percentage","clientHostname","serviceConfig"];for(const t in e)if(!r.includes(t))throw new Error(`Invalid service config choice: unexpected field ${t}`);return t}function d(t,r){if(!Array.isArray(t))throw new Error("Invalid service config list");for(const o of t){const t=p(o);if(!("number"==typeof t.percentage&&r>t.percentage)){if(Array.isArray(t.clientHostname)){let r=!1;for(const n of t.clientHostname)n===e.hostname()&&(r=!0);if(!r)continue}if(Array.isArray(t.clientLanguage)){let e=!1;for(const r of t.clientLanguage)r===n&&(e=!0);if(!e)continue}return t.serviceConfig}}throw new Error("No matching service config found")}return serviceConfig}var connectivityState={},hasRequiredConnectivityState;function requireConnectivityState(){return hasRequiredConnectivityState||(hasRequiredConnectivityState=1,Object.defineProperty(connectivityState,"__esModule",{value:!0}),connectivityState.ConnectivityState=void 0,function(e){e[e.IDLE=0]="IDLE",e[e.CONNECTING=1]="CONNECTING",e[e.READY=2]="READY",e[e.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",e[e.SHUTDOWN=4]="SHUTDOWN"}(e||(connectivityState.ConnectivityState=e={}))),connectivityState;var e}var picker={},hasRequiredPicker;function requirePicker(){if(hasRequiredPicker)return picker;hasRequiredPicker=1,Object.defineProperty(picker,"__esModule",{value:!0}),picker.QueuePicker=picker.UnavailablePicker=picker.PickResultType=void 0;const e=requireMetadata(),t=requireConstants();var r;!function(e){e[e.COMPLETE=0]="COMPLETE",e[e.QUEUE=1]="QUEUE",e[e.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",e[e.DROP=3]="DROP"}(r||(picker.PickResultType=r={}));picker.UnavailablePicker=class{constructor(r){this.status=Object.assign({code:t.Status.UNAVAILABLE,details:"No connection established",metadata:new e.Metadata},r)}pick(e){return{pickResultType:r.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};return picker.QueuePicker=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:r.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}},picker}var backoffTimeout={},hasRequiredBackoffTimeout;function requireBackoffTimeout(){if(hasRequiredBackoffTimeout)return backoffTimeout;hasRequiredBackoffTimeout=1,Object.defineProperty(backoffTimeout,"__esModule",{value:!0}),backoffTimeout.BackoffTimeout=void 0;const e=requireConstants(),t=requireLogging();class r{constructor(e,t){this.callback=e,this.initialDelay=1e3,this.multiplier=1.6,this.maxDelay=12e4,this.jitter=.2,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(r){t.trace(e.LogVerbosity.DEBUG,"backoff","{"+this.id+"} "+r)}runTimer(e){var t,r;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||null===(r=(t=this.timerId).unref)||void 0===r||r.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);const e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;var r,n;this.nextDelay=e+(r=-t,n=t,Math.random()*(n-r)+r)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){const e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,null===(t=(e=this.timerId).ref)||void 0===t||t.call(e)}unref(){var e,t;this.hasRef=!1,null===(t=(e=this.timerId).unref)||void 0===t||t.call(e)}getEndTime(){return this.endTime}}return backoffTimeout.BackoffTimeout=r,r.nextId=0,backoffTimeout}var loadBalancerChildHandler={},hasRequiredLoadBalancerChildHandler,hasRequiredResolvingLoadBalancer;function requireLoadBalancerChildHandler(){if(hasRequiredLoadBalancerChildHandler)return loadBalancerChildHandler;hasRequiredLoadBalancerChildHandler=1,Object.defineProperty(loadBalancerChildHandler,"__esModule",{value:!0}),loadBalancerChildHandler.ChildLoadBalancerHandler=void 0;const e=requireLoadBalancer(),t=requireConnectivityState();return loadBalancerChildHandler.ChildLoadBalancerHandler=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(e){this.parent=e,this.child=null}createSubchannel(e,t){return this.parent.channelControlHelper.createSubchannel(e,t)}updateState(e,r,n){var o;if(this.calledByPendingChild()){if(e===t.ConnectivityState.CONNECTING)return;null===(o=this.parent.currentChild)||void 0===o||o.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(e,r,n)}requestReresolution(){var e;const t=null!==(e=this.parent.pendingChild)&&void 0!==e?e:this.parent.currentChild;this.child===t&&this.parent.channelControlHelper.requestReresolution()}setChild(e){this.child=e}addChannelzChild(e){this.parent.channelControlHelper.addChannelzChild(e)}removeChannelzChild(e){this.parent.channelControlHelper.removeChannelzChild(e)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(t,r,n,o){let i;if(null===this.currentChild||null===this.latestConfig||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,r)){const t=new this.ChildPolicyHelper(this),n=(0,e.createLoadBalancer)(r,t);t.setChild(n),null===this.currentChild?(this.currentChild=n,i=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=n,i=this.pendingChild)}else i=null===this.pendingChild?this.currentChild:this.pendingChild;return this.latestConfig=r,i.updateAddressList(t,r,n,o)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return"child_load_balancer_helper"}},loadBalancerChildHandler}function requireResolvingLoadBalancer(){if(hasRequiredResolvingLoadBalancer)return resolvingLoadBalancer;hasRequiredResolvingLoadBalancer=1,Object.defineProperty(resolvingLoadBalancer,"__esModule",{value:!0}),resolvingLoadBalancer.ResolvingLoadBalancer=void 0;const e=requireLoadBalancer(),t=requireServiceConfig(),r=requireConnectivityState(),n=requireResolver(),o=requirePicker(),i=requireBackoffTimeout(),a=requireConstants(),s=requireMetadata(),l=requireLogging(),p=requireConstants(),d=requireUriParser(),u=requireLoadBalancerChildHandler();function c(e){l.trace(p.LogVerbosity.DEBUG,"resolving_load_balancer",e)}const f=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function h(e,t,r,n){for(const o of r.name)switch(n){case"EMPTY":if(!o.service&&!o.method)return!0;break;case"SERVICE":if(o.service===e&&!o.method)return!0;break;case"SERVICE_AND_METHOD":if(o.service===e&&o.method===t)return!0}return!1}function m(e,t,r,n){for(const o of r)if(h(e,t,o,n))return o;return null}return resolvingLoadBalancer.ResolvingLoadBalancer=class{constructor(e,a,s,l,p){this.target=e,this.channelControlHelper=a,this.channelOptions=s,this.onSuccessfulResolution=l,this.onFailedResolution=p,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new o.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,s["grpc.service_config"]?this.defaultServiceConfig=(0,t.validateServiceConfig)(JSON.parse(s["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new o.QueuePicker(this),null),this.childLoadBalancer=new u.ChildLoadBalancerHandler({createSubchannel:a.createSubchannel.bind(a),requestReresolution:()=>{this.backoffTimeout.isRunning()?(c("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(e,t,r)=>{this.latestChildState=e,this.latestChildPicker=t,this.latestChildErrorMessage=r,this.updateState(e,t,r)},addChannelzChild:a.addChannelzChild.bind(a),removeChannelzChild:a.removeChannelzChild.bind(a)}),this.innerResolver=(0,n.createResolver)(e,this.handleResolverResult.bind(this),s);const d={initialDelay:s["grpc.initial_reconnect_backoff_ms"],maxDelay:s["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new i.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},d),this.backoffTimeout.unref()}handleResolverResult(t,r,o,i){var l,p;this.backoffTimeout.stop(),this.backoffTimeout.reset();let d=!0,u=null;if(null===o?u=this.defaultServiceConfig:o.ok?u=o.value:null!==this.previousServiceConfig?u=this.previousServiceConfig:(d=!1,this.handleResolutionFailure(o.error)),null!==u){const n=null!==(l=null==u?void 0:u.loadBalancingConfig)&&void 0!==l?l:[],o=(0,e.selectLbConfigFromList)(n,!0);null===o?(d=!1,this.handleResolutionFailure({code:a.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new s.Metadata})):d=this.childLoadBalancer.updateAddressList(t,o,Object.assign(Object.assign({},this.channelOptions),r),i)}return d&&this.onSuccessfulResolution(u,null!==(p=r[n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])&&void 0!==p?p:function(e){return{invoke(t,r){var n,o;const i=t.split("/").filter(e=>e.length>0),s=null!==(n=i[0])&&void 0!==n?n:"",l=null!==(o=i[1])&&void 0!==o?o:"";if(e&&e.methodConfig)for(const t of f){const r=m(s,l,e.methodConfig,t);if(r)return{methodConfig:r,pickInformation:{},status:a.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:a.Status.OK,dynamicFilterFactories:[]}},unref(){}}}(u)),d}updateResolution(){this.innerResolver.updateResolution(),this.currentState===r.ConnectivityState.IDLE&&this.updateState(r.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,n){c((0,d.uriToString)(this.target)+" "+r.ConnectivityState[this.currentState]+" -> "+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new o.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}handleResolutionFailure(e){this.latestChildState===r.ConnectivityState.IDLE&&(this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new o.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){this.currentState!==r.ConnectivityState.IDLE&&this.currentState!==r.ConnectivityState.TRANSIENT_FAILURE||(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new o.QueuePicker(this),this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}},resolvingLoadBalancer}var subchannelPool={},channelOptions={},hasRequiredChannelOptions;function requireChannelOptions(){if(hasRequiredChannelOptions)return channelOptions;return hasRequiredChannelOptions=1,Object.defineProperty(channelOptions,"__esModule",{value:!0}),channelOptions.recognizedOptions=void 0,channelOptions.channelOptionsEqual=function(e,t){const r=Object.keys(e).sort(),n=Object.keys(t).sort();if(r.length!==n.length)return!1;for(let o=0;o<r.length;o+=1){if(r[o]!==n[o])return!1;if(e[r[o]]!==t[n[o]])return!1}return!0},channelOptions.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0},channelOptions}var subchannel={},subchannelAddress={},hasRequiredSubchannelAddress;function requireSubchannelAddress(){if(hasRequiredSubchannelAddress)return subchannelAddress;hasRequiredSubchannelAddress=1,Object.defineProperty(subchannelAddress,"__esModule",{value:!0}),subchannelAddress.EndpointMap=void 0,subchannelAddress.isTcpSubchannelAddress=t,subchannelAddress.subchannelAddressEqual=r,subchannelAddress.subchannelAddressToString=n,subchannelAddress.stringToSubchannelAddress=function(t,r){return(0,e.isIP)(t)?{host:t,port:null!=r?r:o}:{path:t}},subchannelAddress.endpointEqual=function(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n=0;n<e.addresses.length;n++)if(!r(e.addresses[n],t.addresses[n]))return!1;return!0},subchannelAddress.endpointToString=function(e){return"["+e.addresses.map(n).join(", ")+"]"},subchannelAddress.endpointHasAddress=i;const e=require$$0__default$2.default;function t(e){return"port"in e}function r(e,r){return!e&&!r||!(!e||!r)&&(t(e)?t(r)&&e.host===r.host&&e.port===r.port:!t(r)&&e.path===r.path)}function n(r){return t(r)?(0,e.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}const o=443;function i(e,t){for(const n of e.addresses)if(r(n,t))return!0;return!1}function a(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(const n of e.addresses){let e=!1;for(const o of t.addresses)if(r(n,o)){e=!0;break}if(!e)return!1}return!0}return subchannelAddress.EndpointMap=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(const t of this.map)if(i(t.key,e))return t.value}deleteMissing(e){const t=[];for(const r of this.map){let n=!1;for(const t of e)a(t,r.key)&&(n=!0);n||(t.push(r.value),this.map.delete(r))}return t}get(e){for(const t of this.map)if(a(e,t.key))return t.value}set(e,t){for(const r of this.map)if(a(e,r.key))return void(r.value=t);this.map.add({key:e,value:t})}delete(e){for(const t of this.map)if(a(e,t.key))return void this.map.delete(t)}has(e){for(const t of this.map)if(a(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(const e of this.map)yield e.key}*values(){for(const e of this.map)yield e.value}*entries(){for(const e of this.map)yield[e.key,e.value]}},subchannelAddress}var channelz={},extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function __generator(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}"function"==typeof SuppressedError&&SuppressedError;var TreeNode=function(){function e(e,t,r){void 0===r&&(r=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=r}return e.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&1===e.l)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var r=e.h;r.t===e;)r=(e=r).h;e=r}return e},e.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}for(var t=e.h;t.i===e;)t=(e=t).h;return e.i!==t?t:e},e.prototype.T=function(){var e=this.h,t=this.i,r=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=r,r&&(r.h=this),t},e.prototype.I=function(){var e=this.h,t=this.t,r=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=r,r&&(r.h=this),t},e}(),TreeNodeEnableIndex=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.O=1,t}return __extends(t,e),t.prototype.T=function(){var t=e.prototype.T.call(this);return this.M(),t.M(),t},t.prototype.I=function(){var t=e.prototype.I.call(this);return this.M(),t.M(),t},t.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},t}(TreeNode),ContainerIterator=function(){function e(e){void 0===e&&(e=0),this.iteratorType=e}return e.prototype.equals=function(e){return this.C===e.C},e}(),Base=function(){function e(){this._=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),e.prototype.size=function(){return this._},e.prototype.empty=function(){return 0===this._},e}(),Container=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(Base);function throwIteratorAccessError(){throw new RangeError("Iterator access denied!")}var TreeContainer=function(e){function t(t,r){void 0===t&&(t=function(e,t){return e<t?-1:e>t?1:0}),void 0===r&&(r=!1);var n=e.call(this)||this;return n.N=void 0,n.g=t,n.enableIndex=r,n.S=r?TreeNodeEnableIndex:TreeNode,n.A=new n.S,n}return __extends(t,e),t.prototype.m=function(e,t){for(var r=this.A;e;){var n=this.g(e.u,t);if(n<0)e=e.i;else{if(!(n>0))return e;r=e,e=e.t}}return r},t.prototype.B=function(e,t){for(var r=this.A;e;){this.g(e.u,t)<=0?e=e.i:(r=e,e=e.t)}return r},t.prototype.j=function(e,t){for(var r=this.A;e;){var n=this.g(e.u,t);if(n<0)r=e,e=e.i;else{if(!(n>0))return e;e=e.t}}return r},t.prototype.k=function(e,t){for(var r=this.A;e;){this.g(e.u,t)<0?(r=e,e=e.i):e=e.t}return r},t.prototype.R=function(e){for(;;){var t,r=e.h;if(r===this.A)return;if(1===e.l)return void(e.l=0);if(e===r.t)if(1===(t=r.i).l)t.l=0,r.l=1,r===this.N?this.N=r.T():r.T();else{if(t.i&&1===t.i.l)return t.l=r.l,r.l=0,t.i.l=0,void(r===this.N?this.N=r.T():r.T());t.t&&1===t.t.l?(t.l=1,t.t.l=0,t.I()):(t.l=1,e=r)}else if(1===(t=r.t).l)t.l=0,r.l=1,r===this.N?this.N=r.I():r.I();else{if(t.t&&1===t.t.l)return t.l=r.l,r.l=0,t.t.l=0,void(r===this.N?this.N=r.I():r.I());t.i&&1===t.i.l?(t.l=1,t.i.l=0,t.T()):(t.l=1,e=r)}}},t.prototype.G=function(e){if(1!==this._){for(var t=e;t.t||t.i;){if(t.i)for(t=t.i;t.t;)t=t.t;else t=t.t;var r=e.u;e.u=t.u,t.u=r;var n=e.o;e.o=t.o,t.o=n,e=t}this.A.t===t?this.A.t=t.h:this.A.i===t&&(this.A.i=t.h),this.R(t);var o=t.h;if(t===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.h}else this.clear()},t.prototype.P=function(e){for(var t="number"==typeof e?e:void 0,r="function"==typeof e?e:void 0,n=void 0===e?[]:void 0,o=0,i=this.N,a=[];a.length||i;)if(i)a.push(i),i=i.t;else{if(i=a.pop(),o===t)return i;n&&n.push(i),r&&r(i,o,this),o+=1,i=i.i}return n},t.prototype.q=function(e){for(;;){var t=e.h;if(0===t.l)return;var r=t.h;if(t===r.t){if((n=r.i)&&1===n.l){if(n.l=t.l=0,r===this.N)return;r.l=1,e=r;continue}if(e!==t.i)return t.l=0,r===this.N?this.N=r.I():r.I(),void(r.l=1);e.l=0,e.t&&(e.t.h=t),e.i&&(e.i.h=r),t.i=e.t,r.t=e.i,e.t=t,e.i=r,r===this.N?(this.N=e,this.A.h=e):(o=r.h).t===r?o.t=e:o.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}else{var n,o;if((n=r.t)&&1===n.l){if(n.l=t.l=0,r===this.N)return;r.l=1,e=r;continue}if(e!==t.t)return t.l=0,r===this.N?this.N=r.T():r.T(),void(r.l=1);e.l=0,e.t&&(e.t.h=r),e.i&&(e.i.h=t),r.i=e.t,t.t=e.i,e.t=r,e.i=t,r===this.N?(this.N=e,this.A.h=e):(o=r.h).t===r?o.t=e:o.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}return void(this.enableIndex&&(t.M(),r.M(),e.M()))}},t.prototype.D=function(e,t,r){if(void 0===this.N)return this._+=1,this.N=new this.S(e,t,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var n,o=this.A.t,i=this.g(o.u,e);if(0===i)return o.o=t,this._;if(i>0)o.t=new this.S(e,t),o.t.h=o,n=o.t,this.A.t=n;else{var a=this.A.i,s=this.g(a.u,e);if(0===s)return a.o=t,this._;if(s<0)a.i=new this.S(e,t),a.i.h=a,n=a.i,this.A.i=n;else{if(void 0!==r){var l=r.C;if(l!==this.A){var p=this.g(l.u,e);if(0===p)return l.o=t,this._;if(p>0){var d=l.v(),u=this.g(d.u,e);if(0===u)return d.o=t,this._;u<0&&(n=new this.S(e,t),void 0===d.i?(d.i=n,n.h=d):(l.t=n,n.h=l))}}}if(void 0===n)for(n=this.N;;){var c=this.g(n.u,e);if(c>0){if(void 0===n.t){n.t=new this.S(e,t),n.t.h=n,n=n.t;break}n=n.t}else{if(!(c<0))return n.o=t,this._;if(void 0===n.i){n.i=new this.S(e,t),n.i.h=n,n=n.i;break}n=n.i}}}}if(this.enableIndex)for(var f=n.h;f!==this.A;)f.O+=1,f=f.h;return this.q(n),this._+=1,this._},t.prototype.F=function(e,t){for(;e;){var r=this.g(e.u,t);if(r<0)e=e.i;else{if(!(r>0))return e;e=e.t}}return e||this.A},t.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},t.prototype.updateKeyByIterator=function(e,t){var r=e.C;if(r===this.A&&throwIteratorAccessError(),1===this._)return r.u=t,!0;var n=r.p().u;if(r===this.A.t)return this.g(n,t)>0&&(r.u=t,!0);var o=r.v().u;return r===this.A.i?this.g(o,t)<0&&(r.u=t,!0):!(this.g(o,t)>=0||this.g(n,t)<=0)&&(r.u=t,!0)},t.prototype.eraseElementByPos=function(e){if(e<0||e>this._-1)throw new RangeError;var t=this.P(e);return this.G(t),this._},t.prototype.eraseElementByKey=function(e){if(0===this._)return!1;var t=this.F(this.N,e);return t!==this.A&&(this.G(t),!0)},t.prototype.eraseElementByIterator=function(e){var t=e.C;t===this.A&&throwIteratorAccessError();var r=void 0===t.i;return 0===e.iteratorType?r&&e.next():r&&void 0!==t.t||e.next(),this.G(t),e},t.prototype.getHeight=function(){if(0===this._)return 0;return function e(t){return t?Math.max(e(t.t),e(t.i))+1:0}(this.N)},t}(Container),TreeIterator=function(e){function t(t,r,n){var o=e.call(this,n)||this;return o.C=t,o.A=r,0===o.iteratorType?(o.pre=function(){return this.C===this.A.t&&throwIteratorAccessError(),this.C=this.C.v(),this},o.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.p(),this}):(o.pre=function(){return this.C===this.A.i&&throwIteratorAccessError(),this.C=this.C.p(),this},o.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.v(),this}),o}return __extends(t,e),Object.defineProperty(t.prototype,"index",{get:function(){var e=this.C,t=this.A.h;if(e===this.A)return t?t.O-1:0;var r=0;for(e.t&&(r+=e.t.O);e!==t;){var n=e.h;e===n.i&&(r+=1,n.t&&(r+=n.t.O)),e=n}return r},enumerable:!1,configurable:!0}),t.prototype.isAccessible=function(){return this.C!==this.A},t}(ContainerIterator),OrderedMapIterator=function(e){function t(t,r,n,o){var i=e.call(this,t,r,o)||this;return i.container=n,i}return __extends(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){this.C===this.A&&throwIteratorAccessError();var e=this;return new Proxy([],{get:function(t,r){return"0"===r?e.C.u:"1"===r?e.C.o:(t[0]=e.C.u,t[1]=e.C.o,t[r])},set:function(t,r,n){if("1"!==r)throw new TypeError("prop must be 1");return e.C.o=n,!0}})},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.C,this.A,this.container,this.iteratorType)},t}(TreeIterator),OrderedMap=function(e){function t(t,r,n){void 0===t&&(t=[]);var o=e.call(this,r,n)||this,i=o;return t.forEach(function(e){i.setElement(e[0],e[1])}),o}return __extends(t,e),t.prototype.begin=function(){return new OrderedMapIterator(this.A.t||this.A,this.A,this)},t.prototype.end=function(){return new OrderedMapIterator(this.A,this.A,this)},t.prototype.rBegin=function(){return new OrderedMapIterator(this.A.i||this.A,this.A,this,1)},t.prototype.rEnd=function(){return new OrderedMapIterator(this.A,this.A,this,1)},t.prototype.front=function(){if(0!==this._){var e=this.A.t;return[e.u,e.o]}},t.prototype.back=function(){if(0!==this._){var e=this.A.i;return[e.u,e.o]}},t.prototype.lowerBound=function(e){var t=this.m(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.upperBound=function(e){var t=this.B(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.reverseLowerBound=function(e){var t=this.j(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.reverseUpperBound=function(e){var t=this.k(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.forEach=function(e){this.P(function(t,r,n){e([t.u,t.o],r,n)})},t.prototype.setElement=function(e,t,r){return this.D(e,t,r)},t.prototype.getElementByPos=function(e){if(e<0||e>this._-1)throw new RangeError;var t=this.P(e);return[t.u,t.o]},t.prototype.find=function(e){var t=this.F(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.getElementByKey=function(e){return this.F(this.N,e).o},t.prototype.union=function(e){var t=this;return e.forEach(function(e){t.setElement(e[0],e[1])}),this._},t.prototype[Symbol.iterator]=function(){var e,t,r,n;return __generator(this,function(o){switch(o.label){case 0:e=this._,t=this.P(),r=0,o.label=1;case 1:return r<e?[4,[(n=t[r]).u,n.o]]:[3,4];case 2:o.sent(),o.label=3;case 3:return++r,[3,1];case 4:return[2]}})},t}(TreeContainer),esm=Object.freeze({__proto__:null,OrderedMap:OrderedMap}),require$$1$2=getAugmentedNamespace(esm),admin={},hasRequiredAdmin;function requireAdmin(){if(hasRequiredAdmin)return admin;hasRequiredAdmin=1,Object.defineProperty(admin,"__esModule",{value:!0}),admin.registerAdminService=function(t,r){e.push({getServiceDefinition:t,getHandlers:r})},admin.addAdminServicesToServer=function(t){for(const{getServiceDefinition:r,getHandlers:n}of e)t.addService(r(),n())};const e=[];return admin}var makeClient={},client={},call$1={},hasRequiredCall$1;function requireCall$1(){if(hasRequiredCall$1)return call$1;hasRequiredCall$1=1,Object.defineProperty(call$1,"__esModule",{value:!0}),call$1.ClientDuplexStreamImpl=call$1.ClientWritableStreamImpl=call$1.ClientReadableStreamImpl=call$1.ClientUnaryCallImpl=void 0,call$1.callErrorFromStatus=function(e,t){const n=`${e.code} ${r.Status[e.code]}: ${e.details}`,o=new Error(n),i=`${o.stack}\nfor call at\n${t}`;return Object.assign(new Error(n),e,{stack:i})};const e=require$$0__default$3.default,t=Stream__default.default,r=requireConstants();class n extends e.EventEmitter{constructor(){super()}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}}call$1.ClientUnaryCallImpl=n;class o extends t.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_read(e){var t;null===(t=this.call)||void 0===t||t.startRead()}}call$1.ClientReadableStreamImpl=o;class i extends t.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_write(e,t,r){var n;const o={callback:r},i=Number(t);Number.isNaN(i)||(o.flags=i),null===(n=this.call)||void 0===n||n.sendMessageWithContext(o,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}call$1.ClientWritableStreamImpl=i;class a extends t.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_read(e){var t;null===(t=this.call)||void 0===t||t.startRead()}_write(e,t,r){var n;const o={callback:r},i=Number(t);Number.isNaN(i)||(o.flags=i),null===(n=this.call)||void 0===n||n.sendMessageWithContext(o,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}return call$1.ClientDuplexStreamImpl=a,call$1}var clientInterceptors={},callInterface={},hasRequiredCallInterface,hasRequiredClientInterceptors,hasRequiredClient,hasRequiredMakeClient;function requireCallInterface(){if(hasRequiredCallInterface)return callInterface;hasRequiredCallInterface=1,Object.defineProperty(callInterface,"__esModule",{value:!0}),callInterface.InterceptingListenerImpl=void 0,callInterface.statusOrFromValue=function(e){return{ok:!0,value:e}},callInterface.statusOrFromError=function(t){var r;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:null!==(r=t.metadata)&&void 0!==r?r:new e.Metadata})}},callInterface.isInterceptingListener=function(e){return void 0!==e.onReceiveMetadata&&1===e.onReceiveMetadata.length};const e=requireMetadata();return callInterface.InterceptingListenerImpl=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextListener.onReceiveStatus(e)})}},callInterface}function requireClientInterceptors(){if(hasRequiredClientInterceptors)return clientInterceptors;hasRequiredClientInterceptors=1,Object.defineProperty(clientInterceptors,"__esModule",{value:!0}),clientInterceptors.InterceptingCall=clientInterceptors.RequesterBuilder=clientInterceptors.ListenerBuilder=clientInterceptors.InterceptorConfigurationError=void 0,clientInterceptors.getInterceptingCall=function(e,t,r,n){if(e.clientInterceptors.length>0&&e.clientInterceptorProviders.length>0)throw new o("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(e.callInterceptors.length>0&&e.callInterceptorProviders.length>0)throw new o("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];i=e.callInterceptors.length>0||e.callInterceptorProviders.length>0?[].concat(e.callInterceptors,e.callInterceptorProviders.map(e=>e(t))).filter(e=>e):[].concat(e.clientInterceptors,e.clientInterceptorProviders.map(e=>e(t))).filter(e=>e);const a=Object.assign({},r,{method_definition:t}),s=i.reduceRight((e,t)=>r=>t(r,e),e=>d(n,e,t));return s(a)};const e=requireMetadata(),t=requireCallInterface(),r=requireConstants(),n=requireError();class o extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,o)}}clientInterceptors.InterceptorConfigurationError=o;clientInterceptors.ListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};clientInterceptors.RequesterBuilder=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};const i={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveStatus:(e,t)=>{t(e)}},a={start:(e,t,r)=>{r(e,t)},sendMessage:(e,t)=>{t(e)},halfClose:e=>{e()},cancel:e=>{e()}};clientInterceptors.InterceptingCall=class{constructor(e,t){var r,n,o,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,this.requester=t?{start:null!==(r=t.start)&&void 0!==r?r:a.start,sendMessage:null!==(n=t.sendMessage)&&void 0!==n?n:a.sendMessage,halfClose:null!==(o=t.halfClose)&&void 0!==o?o:a.halfClose,cancel:null!==(i=t.cancel)&&void 0!==i?i:a.cancel}:a}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,r){var n,o,a,s,l,p;const d={onReceiveMetadata:null!==(o=null===(n=null==r?void 0:r.onReceiveMetadata)||void 0===n?void 0:n.bind(r))&&void 0!==o?o:e=>{},onReceiveMessage:null!==(s=null===(a=null==r?void 0:r.onReceiveMessage)||void 0===a?void 0:a.bind(r))&&void 0!==s?s:e=>{},onReceiveStatus:null!==(p=null===(l=null==r?void 0:r.onReceiveStatus)||void 0===l?void 0:l.bind(r))&&void 0!==p?p:e=>{}};this.processingMetadata=!0,this.requester.start(e,d,(e,r)=>{var n,o,a;let s;if(this.processingMetadata=!1,(0,t.isInterceptingListener)(r))s=r;else{const e={onReceiveMetadata:null!==(n=r.onReceiveMetadata)&&void 0!==n?n:i.onReceiveMetadata,onReceiveMessage:null!==(o=r.onReceiveMessage)&&void 0!==o?o:i.onReceiveMessage,onReceiveStatus:null!==(a=r.onReceiveStatus)&&void 0!==a?a:i.onReceiveStatus};s=new t.InterceptingListenerImpl(e,d)}this.nextCall.start(e,s),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,r),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};class s{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let o;try{o=this.methodDefinition.requestSerialize(t)}catch(e){return void this.call.cancelWithStatus(r.Status.INTERNAL,`Request message serialization failure: ${(0,n.getErrorMessage)(e)}`)}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(t,o){let i=null;this.call.start(t,{onReceiveMetadata:e=>{var t;null===(t=null==o?void 0:o.onReceiveMetadata)||void 0===t||t.call(o,e)},onReceiveMessage:t=>{var a;let s;try{s=this.methodDefinition.responseDeserialize(t)}catch(t){return i={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,n.getErrorMessage)(t)}`,metadata:new e.Metadata},void this.call.cancelWithStatus(i.code,i.details)}null===(a=null==o?void 0:o.onReceiveMessage)||void 0===a||a.call(o,s)},onReceiveStatus:e=>{var t,r;i?null===(t=null==o?void 0:o.onReceiveStatus)||void 0===t||t.call(o,i):null===(r=null==o?void 0:o.onReceiveStatus)||void 0===r||r.call(o,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}}class l extends s{constructor(e,t){super(e,t)}start(e,t){var r,n;let o=!1;const i={onReceiveMetadata:null!==(n=null===(r=null==t?void 0:t.onReceiveMetadata)||void 0===r?void 0:r.bind(t))&&void 0!==n?n:e=>{},onReceiveMessage:e=>{var r;o=!0,null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,e)},onReceiveStatus:e=>{var r,n;o||null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,null),null===(n=null==t?void 0:t.onReceiveStatus)||void 0===n||n.call(t,e)}};super.start(e,i),this.call.startRead()}}class p extends s{}function d(e,t,r){const n=function(e,t,r){var n,o;const i=null!==(n=r.deadline)&&void 0!==n?n:1/0,a=r.host,s=null!==(o=r.parent)&&void 0!==o?o:null,l=r.propagate_flags,p=r.credentials,d=e.createCall(t,i,a,s,l);return p&&d.setCredentials(p),d}(e,r.path,t);return r.responseStream?new p(n,r):new l(n,r)}return clientInterceptors}function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1,Object.defineProperty(client,"__esModule",{value:!0}),client.Client=void 0;const e=requireCall$1(),t=requireChannel(),r=requireConnectivityState(),n=requireConstants(),o=requireMetadata(),i=requireClientInterceptors(),a=Symbol(),s=Symbol(),l=Symbol(),p=Symbol();function d(e){return"function"==typeof e}function u(e){var t;return(null===(t=e.stack)||void 0===t?void 0:t.split("\n").slice(1).join("\n"))||"no stack trace available"}return client.Client=class{constructor(e,r,n={}){var o,i;if(n=Object.assign({},n),this[s]=null!==(o=n.interceptors)&&void 0!==o?o:[],delete n.interceptors,this[l]=null!==(i=n.interceptor_providers)&&void 0!==i?i:[],delete n.interceptor_providers,this[s].length>0&&this[l].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[p]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[a]=n.channelOverride;else if(n.channelFactoryOverride){const t=n.channelFactoryOverride;delete n.channelFactoryOverride,this[a]=t(e,r,n)}else this[a]=new t.ChannelImplementation(e,r,n)}close(){this[a].close()}getChannel(){return this[a]}waitForReady(e,t){const n=o=>{if(o)return void t(new Error("Failed to connect before the deadline"));let i;try{i=this[a].getConnectivityState(!0)}catch(e){return void t(new Error("The channel has been closed"))}if(i===r.ConnectivityState.READY)t();else try{this[a].watchConnectivityState(i,e,n)}catch(e){t(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,r){if(d(e))return{metadata:new o.Metadata,options:{},callback:e};if(d(t))return e instanceof o.Metadata?{metadata:e,options:{},callback:t}:{metadata:new o.Metadata,options:e,callback:t};if(!(e instanceof o.Metadata&&t instanceof Object&&d(r)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:r}}makeUnaryRequest(t,r,o,d,c,f,h){var m,g;const y=this.checkOptionalUnaryResponseArguments(c,f,h),v={path:t,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:o};let b={argument:d,metadata:y.metadata,call:new e.ClientUnaryCallImpl,channel:this[a],methodDefinition:v,callOptions:y.options,callback:y.callback};this[p]&&(b=this[p](b));const O=b.call,w={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(m=b.callOptions.interceptors)&&void 0!==m?m:[],callInterceptorProviders:null!==(g=b.callOptions.interceptor_providers)&&void 0!==g?g:[]},S=(0,i.getInterceptingCall)(w,b.methodDefinition,b.callOptions,b.channel);O.call=S;let _=null,P=!1,E=new Error;return S.start(b.metadata,{onReceiveMetadata:e=>{O.emit("metadata",e)},onReceiveMessage(e){null!==_&&S.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),_=e},onReceiveStatus(t){if(!P){if(P=!0,t.code===n.Status.OK)if(null===_){const r=u(E);b.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else b.callback(null,_);else{const r=u(E);b.callback((0,e.callErrorFromStatus)(t,r))}E=null,O.emit("status",t)}}}),S.sendMessage(d),S.halfClose(),O}makeClientStreamRequest(t,r,o,d,c,f){var h,m;const g=this.checkOptionalUnaryResponseArguments(d,c,f),y={path:t,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:o};let v={metadata:g.metadata,call:new e.ClientWritableStreamImpl(r),channel:this[a],methodDefinition:y,callOptions:g.options,callback:g.callback};this[p]&&(v=this[p](v));const b=v.call,O={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(h=v.callOptions.interceptors)&&void 0!==h?h:[],callInterceptorProviders:null!==(m=v.callOptions.interceptor_providers)&&void 0!==m?m:[]},w=(0,i.getInterceptingCall)(O,v.methodDefinition,v.callOptions,v.channel);b.call=w;let S=null,_=!1,P=new Error;return w.start(v.metadata,{onReceiveMetadata:e=>{b.emit("metadata",e)},onReceiveMessage(e){null!==S&&w.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),S=e,w.startRead()},onReceiveStatus(t){if(!_){if(_=!0,t.code===n.Status.OK)if(null===S){const r=u(P);v.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else v.callback(null,S);else{const r=u(P);v.callback((0,e.callErrorFromStatus)(t,r))}P=null,b.emit("status",t)}}}),b}checkMetadataAndOptions(e,t){let r,n;return e instanceof o.Metadata?(r=e,n=t||{}):(n=e||{},r=new o.Metadata),{metadata:r,options:n}}makeServerStreamRequest(t,r,o,d,c,f){var h,m;const g=this.checkMetadataAndOptions(c,f),y={path:t,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:o};let v={argument:d,metadata:g.metadata,call:new e.ClientReadableStreamImpl(o),channel:this[a],methodDefinition:y,callOptions:g.options};this[p]&&(v=this[p](v));const b=v.call,O={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(h=v.callOptions.interceptors)&&void 0!==h?h:[],callInterceptorProviders:null!==(m=v.callOptions.interceptor_providers)&&void 0!==m?m:[]},w=(0,i.getInterceptingCall)(O,v.methodDefinition,v.callOptions,v.channel);b.call=w;let S=!1,_=new Error;return w.start(v.metadata,{onReceiveMetadata(e){b.emit("metadata",e)},onReceiveMessage(e){b.push(e)},onReceiveStatus(t){if(!S){if(S=!0,b.push(null),t.code!==n.Status.OK){const r=u(_);b.emit("error",(0,e.callErrorFromStatus)(t,r))}_=null,b.emit("status",t)}}}),w.sendMessage(d),w.halfClose(),b}makeBidiStreamRequest(t,r,o,d,c){var f,h;const m=this.checkMetadataAndOptions(d,c),g={path:t,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:o};let y={metadata:m.metadata,call:new e.ClientDuplexStreamImpl(r,o),channel:this[a],methodDefinition:g,callOptions:m.options};this[p]&&(y=this[p](y));const v=y.call,b={clientInterceptors:this[s],clientInterceptorProviders:this[l],callInterceptors:null!==(f=y.callOptions.interceptors)&&void 0!==f?f:[],callInterceptorProviders:null!==(h=y.callOptions.interceptor_providers)&&void 0!==h?h:[]},O=(0,i.getInterceptingCall)(b,y.methodDefinition,y.callOptions,y.channel);v.call=O;let w=!1,S=new Error;return O.start(y.metadata,{onReceiveMetadata(e){v.emit("metadata",e)},onReceiveMessage(e){v.push(e)},onReceiveStatus(t){if(!w){if(w=!0,v.push(null),t.code!==n.Status.OK){const r=u(S);v.emit("error",(0,e.callErrorFromStatus)(t,r))}S=null,v.emit("status",t)}}}),v}},client}function requireMakeClient(){if(hasRequiredMakeClient)return makeClient;hasRequiredMakeClient=1,Object.defineProperty(makeClient,"__esModule",{value:!0}),makeClient.makeClientConstructor=n,makeClient.loadPackageDefinition=function(e){const t={};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=e[i],s=i.split(".");if(s.some(e=>r(e)))continue;const l=s[s.length-1];let p=t;for(const e of s.slice(0,-1))p[e]||(p[e]={}),p=p[e];o(a)?p[l]=a:p[l]=n(a,l)}return t};const e=requireClient(),t={unary:e.Client.prototype.makeUnaryRequest,server_stream:e.Client.prototype.makeServerStreamRequest,client_stream:e.Client.prototype.makeClientStreamRequest,bidi:e.Client.prototype.makeBidiStreamRequest};function r(e){return["__proto__","prototype","constructor"].includes(e)}function n(n,o,i){class a extends e.Client{}return Object.keys(n).forEach(e=>{if(r(e))return;const o=n[e];let i;if("string"==typeof e&&"$"===e.charAt(0))throw new Error("Method names cannot start with $");i=o.requestStream?o.responseStream?"bidi":"client_stream":o.responseStream?"server_stream":"unary";const s=o.requestSerialize,l=o.responseDeserialize,p=function(e,t,r,n){return function(...o){return e.call(this,t,r,n,...o)}}(t[i],o.path,s,l);a.prototype[e]=p,Object.assign(a.prototype[e],o),o.originalName&&!r(o.originalName)&&(a.prototype[o.originalName]=a.prototype[e])}),a.service=n,a.serviceName=o,a}function o(e){return"format"in e}return makeClient}var src$5={},lodash_camelcase,hasRequiredLodash_camelcase;function requireLodash_camelcase(){if(hasRequiredLodash_camelcase)return lodash_camelcase;hasRequiredLodash_camelcase=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\ud800-\\udfff",o="\\u0300-\\u036f\\ufe20-\\ufe23",i="\\u20d0-\\u20f0",a="\\u2700-\\u27bf",s="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",p="\\ufe0e\\ufe0f",d="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",u="['’]",c="["+n+"]",f="["+d+"]",h="["+o+i+"]",m="\\d+",g="["+a+"]",y="["+s+"]",v="[^"+n+d+m+a+s+l+"]",b="\\ud83c[\\udffb-\\udfff]",O="[^"+n+"]",w="(?:\\ud83c[\\udde6-\\uddff]){2}",S="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+l+"]",P="\\u200d",E="(?:"+y+"|"+v+")",T="(?:"+_+"|"+v+")",C="(?:['’](?:d|ll|m|re|s|t|ve))?",R="(?:['’](?:D|LL|M|RE|S|T|VE))?",D="(?:"+h+"|"+b+")"+"?",x="["+p+"]?",k=x+D+("(?:"+P+"(?:"+[O,w,S].join("|")+")"+x+D+")*"),j="(?:"+[g,w,S].join("|")+")"+k,A="(?:"+[O+h+"?",h,w,S,c].join("|")+")",N=RegExp(u,"g"),I=RegExp(h,"g"),q=RegExp(b+"(?="+b+")|"+A+k,"g"),M=RegExp([_+"?"+y+"+"+C+"(?="+[f,_,"$"].join("|")+")",T+"+"+R+"(?="+[f,_+E,"$"].join("|")+")",_+"?"+E+"+"+C,_+"+"+R,m,j].join("|"),"g"),L=RegExp("["+P+n+o+i+p+"]"),F=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,B="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,V="object"==typeof self&&self&&self.Object===Object&&self,U=B||V||Function("return this")();var $=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"});function G(e){return L.test(e)}function H(e){return G(e)?function(e){return e.match(q)||[]}(e):function(e){return e.split("")}(e)}var z=Object.prototype.toString,W=U.Symbol,J=W?W.prototype:void 0,Y=J?J.toString:void 0;function K(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(e){return!!e&&"object"==typeof e}(t)&&z.call(t)==e}(t))return Y?Y.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}function X(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}(e,t,r)}function Q(e){return null==e?"":K(e)}var Z,ee=(Z=function(e,t,r){return t=t.toLowerCase(),e+(r?re(Q(t).toLowerCase()):t)},function(e){return function(e,t,r){for(var n=-1,o=e?e.length:0;++n<o;)r=t(r,e[n],n,e);return r}(function(e,r){return e=Q(e),void 0===r?function(e){return F.test(e)}(e)?function(e){return e.match(M)||[]}(e):function(e){return e.match(t)||[]}(e):e.match(r)||[]}(function(e){return(e=Q(e))&&e.replace(r,$).replace(I,"")}(e).replace(N,"")),Z,"")});var te,re=(te="toUpperCase",function(e){var t=G(e=Q(e))?H(e):void 0,r=t?t[0]:e.charAt(0),n=t?X(t,1).join(""):e.slice(1);return r[te]()+n});return lodash_camelcase=ee}var src$4={exports:{}},indexLight={exports:{}},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var r=new Array(arguments.length-1),n=0,o=2,i=!0;for(;o<arguments.length;)r[n++]=arguments[o++];return new Promise(function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,a(e))}})},aspromise}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,n){for(var o,i=null,a=[],s=0,l=0;t<n;){var p=e[t++];switch(l){case 0:a[s++]=r[p>>2],o=(3&p)<<4,l=1;break;case 1:a[s++]=r[o|p>>4],o=(15&p)<<2,l=2;break;case 2:a[s++]=r[o|p>>6],a[s++]=r[63&p],l=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return l&&(a[s++]=r[o],a[s++]=61,1===l&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,r){for(var o,a=r,s=0,l=0;l<e.length;){var p=e.charCodeAt(l++);if(61===p&&s>1)break;if(void 0===(p=n[p]))throw Error(i);switch(s){case 0:o=p,s=1;break;case 1:t[r++]=o<<2|(48&p)>>4,o=p,s=2;break;case 2:t[r++]=(15&o)<<4|(60&p)>>2,o=p,s=3;break;case 3:t[r++]=(3&o)<<6|p,s=0}}if(1===s)throw Error(i);return r-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function i(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,r),e.readFloatLE=a.bind(null,n),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function i(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=n*Math.pow(2,-l))>>>0,o,i+t),e((a<<31|l+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,l=a>>>20&2047,p=4294967296*(1048575&a)+i;return 2047===l?p?NaN:s*(1/0):0===l?5e-324*s*p:s*Math.pow(2,l-1075)*(p+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,r,4,0),e.readDoubleLE=a.bind(null,n,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function t(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function r(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(e){var t=e;t.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,r){for(var n,o,i=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var r=t.zero=new t(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var n=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return r;var n=e<0;n&&(e=-e);var o=e>>>0,i=(e-o)/4294967296>>>0;return n&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},t.from=function(n){if("number"==typeof n)return t.fromNumber(n);if(e.isString(n)){if(!e.Long)return t.fromNumber(parseInt(n,10));n=e.Long.fromString(n)}return n.low||n.high?new t(n.low>>>0,n.high>>>0):r},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===n?r:new t((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(){var e=minimal$1;function t(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function r(e){function r(e,n){if(!(this instanceof r))return new r(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,r):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&t(this,n)}return r.prototype=Object.create(Error.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),r}e.asPromise=requireAspromise(),e.base64=requireBase64(),e.EventEmitter=requireEventemitter(),e.float=requireFloat(),e.inquire=requireInquire(),e.utf8=requireUtf8(),e.pool=requirePool(),e.LongBits=requireLongbits(),e.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),e.global=e.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||minimal$1,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},e.isString=function(e){return"string"==typeof e||e instanceof String},e.isObject=function(e){return e&&"object"==typeof e},e.isset=e.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},e.Buffer=function(){try{var t=e.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(e){return null}}(),e._Buffer_from=null,e._Buffer_allocUnsafe=null,e.newBuffer=function(t){return"number"==typeof t?e.Buffer?e._Buffer_allocUnsafe(t):new e.Array(t):e.Buffer?e._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},e.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,e.Long=e.global.dcodeIO&&e.global.dcodeIO.Long||e.global.Long||e.inquire("long"),e.key2Re=/^true|false|0|1$/,e.key32Re=/^-?(?:0|[1-9][0-9]*)$/,e.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,e.longToHash=function(t){return t?e.LongBits.from(t).toHash():e.LongBits.zeroHash},e.longFromHash=function(t,r){var n=e.LongBits.fromHash(t);return e.Long?e.Long.fromBits(n.lo,n.hi,r):n.toNumber(Boolean(r))},e.merge=t,e.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},e.newError=r,e.ProtocolError=r("ProtocolError"),e.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},e.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},e.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},e._configure=function(){var t=e.Buffer;t?(e._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},e._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):e._Buffer_from=e._Buffer_allocUnsafe=null}}()),minimal$1}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=l;var e,t=requireMinimal$1(),r=t.LongBits,n=t.base64,o=t.utf8;function i(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function a(){}function s(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new i(a,0,0),this.tail=this.head,this.states=null}var p=function(){return t.Buffer?function(){return(l.create=function(){return new e})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function u(e,t){this.len=e,this.next=void 0,this.val=t}function c(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function f(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=p(),l.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(l.alloc=t.pool(l.alloc,t.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new i(e,t,r),this.len+=t,this},u.prototype=Object.create(i.prototype),u.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new u((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(c,10,r.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=r.from(e);return this._push(c,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(c,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(f,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=r.from(e);return this._push(f,4,t.lo)._push(f,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var h=t.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};return l.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(d,1,0);if(t.isString(e)){var o=l.alloc(r=n.length(e));n.decode(e,o,0),e=o}return this.uint32(r)._push(h,r,e)},l.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new i(a,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(a,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(t){e=t,l.create=p(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=r;var e=requireWriter();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal$1();function r(){e.call(this)}function n(e,r,n){e.length<40?t.utf8.write(e,r,n):r.utf8Write?r.utf8Write(e,n):r.write(e,n)}return r._configure=function(){r.alloc=t._Buffer_allocUnsafe,r.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},r.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var n=e.length>>>0;return this.uint32(n),n&&this._push(r.writeBytesBuffer,n,e),this},r.prototype.string=function(e){var r=t.Buffer.byteLength(e);return this.uint32(r),r&&this._push(n,r,e),this},r._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=i;var e,t=requireMinimal$1(),r=t.LongBits,n=t.utf8;function o(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}var a="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},s=function(){return t.Buffer?function(r){return(i.create=function(r){return t.Buffer.isBuffer(r)?new e(r):a(r)})(r)}:a};function l(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw o(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}return i.create=s(),i.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,i.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}}(),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return p(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|p(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=t.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)},i.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},i.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},i._configure=function(r){e=r,i.create=s(),e._configure();var n=t.Long?"toLong":"toNumber";t.merge(i.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return d.call(this)[n](!0)},sfixed64:function(){return d.call(this)[n](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=r;var e=requireReader();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal$1();function r(t){e.call(this,t)}return r._configure=function(){t.Buffer&&(r.prototype._slice=t.Buffer.prototype.slice)},r.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},r._configure(),reader_buffer}var rpc={},service$1,hasRequiredService$1,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal;function requireService$1(){if(hasRequiredService$1)return service$1;hasRequiredService$1=1,service$1=t;var e=requireMinimal$1();function t(t,r,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(r),this.responseDelimited=Boolean(n)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(r,n,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,r,n,o,i);if(s.rpcImpl)try{return s.rpcImpl(r,n[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(e,t){if(e)return s.emit("error",e,r),a(e);if(null!==t){if(!(t instanceof o))try{t=o[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return s.emit("error",e,r),a(e)}return s.emit("data",t,r),a(null,t)}s.end(!0)})}catch(e){return s.emit("error",e,r),void setTimeout(function(){a(e)},0)}else setTimeout(function(){a(Error("already ended"))},0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service$1}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(e){e.Service=requireService$1()}(rpc)),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(){var e=indexMinimal;function t(){e.util._configure(),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}e.build="minimal",e.Writer=requireWriter(),e.BufferWriter=requireWriter_buffer(),e.Reader=requireReader(),e.BufferReader=requireReader_buffer(),e.util=requireMinimal$1(),e.rpc=requireRpc(),e.roots=requireRoots(),e.configure=t,t()}()),indexMinimal}var types$1={},util$5={exports:{}},codegen_1,hasRequiredCodegen,fetch_1,hasRequiredFetch;function requireCodegen(){if(hasRequiredCodegen)return codegen_1;function e(t,r){"string"==typeof t&&(r=t,t=void 0);var n=[];function o(t){if("string"!=typeof t){var r=i();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var a=Object.keys(t),s=new Array(a.length+1),l=new Array(a.length),p=0;p<a.length;)s[p]=a[p],l[p]=t[a[p++]];return s[p]=r,Function.apply(null,s).apply(null,l)}return Function(r)()}for(var d=new Array(arguments.length-1),u=0;u<d.length;)d[u]=arguments[++u];if(u=0,t=t.replace(/%([%dfijs])/g,function(e,t){var r=d[u++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"}),u!==d.length)throw Error("parameter count mismatch");return n.push(t),o}function i(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}return hasRequiredCodegen=1,codegen_1=e,e.verbose=!1,codegen_1}function requireFetch(){if(hasRequiredFetch)return fetch_1;hasRequiredFetch=1,fetch_1=r;var e=requireAspromise(),t=requireInquire()("fs");function r(n,o,i){return"function"==typeof o?(i=o,o={}):o||(o={}),i?!o.xhr&&t&&t.readFile?t.readFile(n,function(e,t){return e&&"undefined"!=typeof XMLHttpRequest?r.xhr(n,o,i):e?i(e):i(null,o.binary?t:t.toString("utf8"))}):r.xhr(n,o,i):e(r,this,n,o)}return r.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()},fetch_1}var path={},hasRequiredPath,namespace,hasRequiredNamespace,mapfield,hasRequiredMapfield,method,hasRequiredMethod,service,hasRequiredService,message,hasRequiredMessage,decoder_1,hasRequiredDecoder,verifier_1,hasRequiredVerifier;function requirePath(){return hasRequiredPath||(hasRequiredPath=1,function(e){var t=e,r=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=t.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),o="";n&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):n?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};t.resolve=function(e,t,o){return o||(t=n(t)),r(t)?t:(o||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}}(path)),path}function requireNamespace(){if(hasRequiredNamespace)return namespace;hasRequiredNamespace=1,namespace=l;var e=requireObject();((l.prototype=Object.create(e.prototype)).constructor=l).className="Namespace";var t,r,n,o=requireField(),i=requireUtil$5(),a=requireOneof();function s(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function l(t,r){e.call(this,t,r),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function p(e){e._nestedArray=null,e._lookupCache={};for(var t=e;t=t.parent;)t._lookupCache={};return e}return l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=s,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=i.toArray(this.nested))}}),l.prototype.toJSON=function(e){return i.toObject(["options",this.options,"nested",s(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var i,a=Object.keys(e),s=0;s<a.length;++s)i=e[a[s]],this.add((void 0!==i.fields?t.fromJSON:void 0!==i.values?n.fromJSON:void 0!==i.methods?r.fromJSON:void 0!==i.id?o.fromJSON:l.fromJSON)(a[s],i));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof n)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof o&&void 0!==e.extend||e instanceof t||e instanceof a||e instanceof n||e instanceof r||e instanceof l))throw TypeError("object must be a valid nested object");if(this.nested){var i=this.get(e.name);if(i){if(!(i instanceof l&&e instanceof l)||i instanceof t||i instanceof r)throw Error("duplicate name '"+e.name+"' in "+this);for(var s=i.nestedArray,d=0;d<s.length;++d)e.add(s[d]);this.remove(i),this.nested||(this.nested={}),e.setOptions(i.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof t||this instanceof r||this instanceof n||this instanceof o||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var u=this;u=u.parent;)u._needsRecursiveFeatureResolution=!0,u._needsRecursiveResolve=!0;return e.onAdd(this),p(this)},l.prototype.remove=function(t){if(!(t instanceof e))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),p(this)},l.prototype.define=function(e,t){if(i.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},l.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.nestedArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),i.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;var n=e.join(".");if(""===e[0])return this.root.lookup(e.slice(1),t);var o=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+n];if(o&&(!t||t.indexOf(o.constructor)>-1))return o;if((o=this._lookupImpl(e,n))&&(!t||t.indexOf(o.constructor)>-1))return o;if(r)return null;for(var a=this;a.parent;){if((o=a.parent._lookupImpl(e,n))&&(!t||t.indexOf(o.constructor)>-1))return o;a=a.parent}return null},l.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var r=this.get(e[0]),n=null;if(r)1===e.length?n=r:r instanceof l&&(e=e.slice(1),n=r._lookupImpl(e,e.join(".")));else for(var o=0;o<this.nestedArray.length;++o)this._nestedArray[o]instanceof l&&(r=this._nestedArray[o]._lookupImpl(e,t))&&(n=r);return this._lookupCache[t]=n,n},l.prototype.lookupType=function(e){var r=this.lookup(e,[t]);if(!r)throw Error("no such type: "+e);return r},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[t,n]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r},l.prototype.lookupService=function(e){var t=this.lookup(e,[r]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,o,i){t=e,r=o,n=i},namespace}function requireMapfield(){if(hasRequiredMapfield)return mapfield;hasRequiredMapfield=1,mapfield=n;var e=requireField();((n.prototype=Object.create(e.prototype)).constructor=n).className="MapField";var t=requireTypes(),r=requireUtil$5();function n(t,n,o,i,a,s){if(e.call(this,t,n,i,void 0,void 0,a,s),!r.isString(o))throw TypeError("keyType must be a string");this.keyType=o,this.resolvedKeyType=null,this.map=!0}return n.fromJSON=function(e,t){return new n(e,t.id,t.keyType,t.type,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},n.prototype.resolve=function(){if(this.resolved)return this;if(void 0===t.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return e.prototype.resolve.call(this)},n.d=function(e,t,o){return"function"==typeof o?o=r.decorateType(o).name:o&&"object"==typeof o&&(o=r.decorateEnum(o).name),function(i,a){r.decorateType(i.constructor).add(new n(a,e,t,o))}},mapfield}function requireMethod(){if(hasRequiredMethod)return method;hasRequiredMethod=1,method=r;var e=requireObject();((r.prototype=Object.create(e.prototype)).constructor=r).className="Method";var t=requireUtil$5();function r(r,n,o,i,a,s,l,p,d){if(t.isObject(a)?(l=a,a=s=void 0):t.isObject(s)&&(l=s,s=void 0),void 0!==n&&!t.isString(n))throw TypeError("type must be a string");if(!t.isString(o))throw TypeError("requestType must be a string");if(!t.isString(i))throw TypeError("responseType must be a string");e.call(this,r,l),this.type=n||"rpc",this.requestType=o,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=p,this.parsedOptions=d}return r.fromJSON=function(e,t){return new r(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},r.prototype.toJSON=function(e){var r=!!e&&Boolean(e.keepComments);return t.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",r?this.comment:void 0,"parsedOptions",this.parsedOptions])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),e.prototype.resolve.call(this))},method}function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=o;var e=requireNamespace();((o.prototype=Object.create(e.prototype)).constructor=o).className="Service";var t=requireMethod(),r=requireUtil$5(),n=requireRpc();function o(t,r){e.call(this,t,r),this.methods={},this._methodsArray=null}function i(e){return e._methodsArray=null,e}return o.fromJSON=function(e,r){var n=new o(e,r.options);if(r.methods)for(var i=Object.keys(r.methods),a=0;a<i.length;++a)n.add(t.fromJSON(i[a],r.methods[i[a]]));return r.nested&&n.addJSON(r.nested),r.edition&&(n._edition=r.edition),n.comment=r.comment,n._defaultEdition="proto3",n},o.prototype.toJSON=function(t){var n=e.prototype.toJSON.call(this,t),o=!!t&&Boolean(t.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",n&&n.options||void 0,"methods",e.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",o?this.comment:void 0])},Object.defineProperty(o.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}}),o.prototype.get=function(t){return this.methods[t]||e.prototype.get.call(this,t)},o.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolve.call(this);for(var t=this.methodsArray,r=0;r<t.length;++r)t[r].resolve();return this},o.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.methodsArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},o.prototype.add=function(r){if(this.get(r.name))throw Error("duplicate name '"+r.name+"' in "+this);return r instanceof t?(this.methods[r.name]=r,r.parent=this,i(this)):e.prototype.add.call(this,r)},o.prototype.remove=function(r){if(r instanceof t){if(this.methods[r.name]!==r)throw Error(r+" is not a member of "+this);return delete this.methods[r.name],r.parent=null,i(this)}return e.prototype.remove.call(this,r)},o.prototype.create=function(e,t,o){for(var i,a=new n.Service(e,t,o),s=0;s<this.methodsArray.length;++s){var l=r.lcFirst((i=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");a[l]=r.codegen(["r","c"],r.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return a},service}function requireMessage(){if(hasRequiredMessage)return message;hasRequiredMessage=1,message=t;var e=requireMinimal$1();function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return t.create=function(e){return this.$type.create(e)},t.encode=function(e,t){return this.$type.encode(e,t)},t.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},t.decode=function(e){return this.$type.decode(e)},t.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},t.verify=function(e){return this.$type.verify(e)},t.fromObject=function(e){return this.$type.fromObject(e)},t.toObject=function(e,t){return this.$type.toObject(e,t)},t.prototype.toJSON=function(){return this.$type.toObject(this,e.toJSONOptions)},message}function requireDecoder(){if(hasRequiredDecoder)return decoder_1;hasRequiredDecoder=1,decoder_1=function(o){for(var i=r.codegen(["r","l","e"],o.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(o.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),a=0;a<o.fieldsArray.length;++a){var s=o._fieldsArray[a].resolve(),l=s.resolvedType instanceof e?"int32":s.type,p="m"+r.safeProp(s.name);i("case %i: {",s.id),s.map?(i("if(%s===util.emptyObject)",p)("%s={}",p)("var c2 = r.uint32()+r.pos"),void 0!==t.defaults[s.keyType]?i("k=%j",t.defaults[s.keyType]):i("k=null"),void 0!==t.defaults[l]?i("value=%j",t.defaults[l]):i("value=null"),i("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===t.basic[l]?i("value=types[%i].decode(r,r.uint32())",a):i("value=r.%s()",l),i("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==t.long[s.keyType]?i('%s[typeof k==="object"?util.longToHash(k):k]=value',p):i("%s[k]=value",p)):s.repeated?(i("if(!(%s&&%s.length))",p,p)("%s=[]",p),void 0!==t.packed[l]&&i("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",p,l)("}else"),void 0===t.basic[l]?i(s.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",p,a):i("%s.push(r.%s())",p,l)):void 0===t.basic[l]?i(s.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",p,a):i("%s=r.%s()",p,l),i("break")("}")}for(i("default:")("r.skipType(t&7)")("break")("}")("}"),a=0;a<o._fieldsArray.length;++a){var d=o._fieldsArray[a];d.required&&i("if(!m.hasOwnProperty(%j))",d.name)("throw util.ProtocolError(%j,{instance:m})",n(d))}return i("return m")};var e=require_enum$1(),t=requireTypes(),r=requireUtil$5();function n(e){return"missing required '"+e.name+"'"}return decoder_1}function requireVerifier(){if(hasRequiredVerifier)return verifier_1;hasRequiredVerifier=1,verifier_1=function(e){var i=t.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),a=e.oneofsArray,s={};a.length&&i("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var p=e._fieldsArray[l].resolve(),d="m"+t.safeProp(p.name);if(p.optional&&i("if(%s!=null&&m.hasOwnProperty(%j)){",d,p.name),p.map)i("if(!util.isObject(%s))",d)("return%j",r(p,"object"))("var k=Object.keys(%s)",d)("for(var i=0;i<k.length;++i){"),o(i,p,"k[i]"),n(i,p,l,d+"[k[i]]")("}");else if(p.repeated)i("if(!Array.isArray(%s))",d)("return%j",r(p,"array"))("for(var i=0;i<%s.length;++i){",d),n(i,p,l,d+"[i]")("}");else{if(p.partOf){var u=t.safeProp(p.partOf.name);1===s[p.partOf.name]&&i("if(p%s===1)",u)("return%j",p.partOf.name+": multiple values"),s[p.partOf.name]=1,i("p%s=1",u)}n(i,p,l,d)}p.optional&&i("}")}return i("return null")};var e=require_enum$1(),t=requireUtil$5();function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function n(t,n,o,i){if(n.resolvedType)if(n.resolvedType instanceof e){t("switch(%s){",i)("default:")("return%j",r(n,"enum value"));for(var a=Object.keys(n.resolvedType.values),s=0;s<a.length;++s)t("case %i:",n.resolvedType.values[a[s]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",o,i)("if(e)")("return%j+e",n.name+".")("}");else switch(n.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",i)("return%j",r(n,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",r(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",r(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",r(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",r(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",r(n,"buffer"))}return t}function o(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",r(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",r(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",r(t,"boolean key"))}return e}return verifier_1}var converter={},hasRequiredConverter;function requireConverter(){return hasRequiredConverter||(hasRequiredConverter=1,function(e){var t=e,r=require_enum$1(),n=requireUtil$5();function o(e,t,n,o){var i=!1;if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(d%s){",o);for(var a=t.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)a[s[l]]!==t.typeDefault||i||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),t.repeated||e("break"),i=!0),e("case%j:",s[l])("case %i:",a[s[l]])("m%s=%j",o,a[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,n,o);else{var p=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":p=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,p)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,p?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function i(e,t,n,o){if(t.resolvedType)t.resolvedType instanceof r?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",o,n,o,o,n,o,o):e("d%s=types[%i].toObject(m%s,o)",o,n,o);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,i?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}t.fromObject=function(e){var t=e.fieldsArray,i=n.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return i("return new this.ctor");i("var m=new this.ctor");for(var a=0;a<t.length;++a){var s=t[a].resolve(),l=n.safeProp(s.name);s.map?(i("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),o(i,s,a,l+"[ks[i]]")("}")("}")):s.repeated?(i("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),o(i,s,a,l+"[i]")("}")("}")):(s.resolvedType instanceof r||i("if(d%s!=null){",l),o(i,s,a,l),s.resolvedType instanceof r||i("}"))}return i("return m")},t.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);if(!t.length)return n.codegen()("return {}");for(var o=n.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),a=[],s=[],l=[],p=0;p<t.length;++p)t[p].partOf||(t[p].resolve().repeated?a:t[p].map?s:l).push(t[p]);if(a.length){for(o("if(o.arrays||o.defaults){"),p=0;p<a.length;++p)o("d%s=[]",n.safeProp(a[p].name));o("}")}if(s.length){for(o("if(o.objects||o.defaults){"),p=0;p<s.length;++p)o("d%s={}",n.safeProp(s[p].name));o("}")}if(l.length){for(o("if(o.defaults){"),p=0;p<l.length;++p){var d=l[p],u=n.safeProp(d.name);if(d.resolvedType instanceof r)o("d%s=o.enums===String?%j:%j",u,d.resolvedType.valuesById[d.typeDefault],d.typeDefault);else if(d.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",d.typeDefault.low,d.typeDefault.high,d.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",u)("}else")("d%s=o.longs===String?%j:%i",u,d.typeDefault.toString(),d.typeDefault.toNumber());else if(d.bytes){var c="["+Array.prototype.slice.call(d.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",u,String.fromCharCode.apply(String,d.typeDefault))("else{")("d%s=%s",u,c)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",u,u)("}")}else o("d%s=%j",u,d.typeDefault)}o("}")}var f=!1;for(p=0;p<t.length;++p){d=t[p];var h=e._fieldsArray.indexOf(d);u=n.safeProp(d.name);d.map?(f||(f=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",u,u)("d%s={}",u)("for(var j=0;j<ks2.length;++j){"),i(o,d,h,u+"[ks2[j]]")("}")):d.repeated?(o("if(m%s&&m%s.length){",u,u)("d%s=[]",u)("for(var j=0;j<m%s.length;++j){",u),i(o,d,h,u+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",u,d.name),i(o,d,h,u),d.partOf&&o("if(o.oneofs)")("d%s=%j",n.safeProp(d.partOf.name),d.name)),o("}")}return o("return d")}}(converter)),converter}var wrappers$2={},hasRequiredWrappers$1,type,hasRequiredType,root,hasRequiredRoot,hasRequiredUtil$5,hasRequiredTypes,field,hasRequiredField,oneof,hasRequiredOneof,object,hasRequiredObject,_enum$1,hasRequired_enum$1,encoder_1,hasRequiredEncoder,hasRequiredIndexLight,tokenize_1,hasRequiredTokenize,parse_1,hasRequiredParse,common_1,hasRequiredCommon$2,hasRequiredSrc$7,protobufjs,hasRequiredProtobufjs;function requireWrappers$1(){return hasRequiredWrappers$1||(hasRequiredWrappers$1=1,function(){var e=wrappers$2,t=requireMessage();e[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,r){var n="",o="";if(r&&r.json&&e.type_url&&e.value){o=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(o);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof t){var a=e.$type.toObject(e,r);return""===n&&(n="type.googleapis.com/"),o=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=o,a}return this.toObject(e,r)}}}()),wrappers$2}function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=m;var e=requireNamespace();((m.prototype=Object.create(e.prototype)).constructor=m).className="Type";var t=require_enum$1(),r=requireOneof(),n=requireField(),o=requireMapfield(),i=requireService(),a=requireMessage(),s=requireReader(),l=requireWriter(),p=requireUtil$5(),d=requireEncoder(),u=requireDecoder(),c=requireVerifier(),f=requireConverter(),h=requireWrappers$1();function m(t,r){e.call(this,t,r),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function g(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}return Object.defineProperties(m.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=m.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof a||((e.prototype=new a).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.merge(e,a,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),m.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},m.fromJSON=function(a,s){var l=new m(a,s.options);l.extensions=s.extensions,l.reserved=s.reserved;for(var p=Object.keys(s.fields),d=0;d<p.length;++d)l.add((void 0!==s.fields[p[d]].keyType?o.fromJSON:n.fromJSON)(p[d],s.fields[p[d]]));if(s.oneofs)for(p=Object.keys(s.oneofs),d=0;d<p.length;++d)l.add(r.fromJSON(p[d],s.oneofs[p[d]]));if(s.nested)for(p=Object.keys(s.nested),d=0;d<p.length;++d){var u=s.nested[p[d]];l.add((void 0!==u.id?n.fromJSON:void 0!==u.fields?m.fromJSON:void 0!==u.values?t.fromJSON:void 0!==u.methods?i.fromJSON:e.fromJSON)(p[d],u))}return s.extensions&&s.extensions.length&&(l.extensions=s.extensions),s.reserved&&s.reserved.length&&(l.reserved=s.reserved),s.group&&(l.group=!0),s.comment&&(l.comment=s.comment),s.edition&&(l._edition=s.edition),l._defaultEdition="proto3",l},m.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t),n=!!t&&Boolean(t.keepComments);return p.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",e.arrayToJSON(this.oneofsArray,t),"fields",e.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])},m.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolveAll.call(this);var t=this.oneofsArray;for(n=0;n<t.length;)t[n++].resolve();for(var r=this.fieldsArray,n=0;n<r.length;)r[n++].resolve();return this},m.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.oneofsArray.forEach(e=>{e._resolveFeatures(t)}),this.fieldsArray.forEach(e=>{e._resolveFeatures(t)}),this):this},m.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},m.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof n&&void 0===t.extend){if(this._fieldsById?this._fieldsById[t.id]:this.fieldsById[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),this.fields[t.name]=t,t.message=this,t.onAdd(this),g(this)}return t instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),g(this)):e.prototype.add.call(this,t)},m.prototype.remove=function(t){if(t instanceof n&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),g(this)}if(t instanceof r){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),g(this)}return e.prototype.remove.call(this,t)},m.prototype.isReservedId=function(t){return e.isReservedId(this.reserved,t)},m.prototype.isReservedName=function(t){return e.isReservedName(this.reserved,t)},m.prototype.create=function(e){return new this.ctor(e)},m.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:l,types:t,util:p}),this.decode=u(this)({Reader:s,types:t,util:p}),this.verify=c(this)({types:t,util:p}),this.fromObject=f.fromObject(this)({types:t,util:p}),this.toObject=f.toObject(this)({types:t,util:p});var n=h[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},m.prototype.encode=function(e,t){return this.setup().encode(e,t)},m.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},m.prototype.decode=function(e,t){return this.setup().decode(e,t)},m.prototype.decodeDelimited=function(e){return e instanceof s||(e=s.create(e)),this.decode(e,e.uint32())},m.prototype.verify=function(e){return this.setup().verify(e)},m.prototype.fromObject=function(e){return this.setup().fromObject(e)},m.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},m.d=function(e){return function(t){p.decorateType(t,e)}},type}function requireRoot(){if(hasRequiredRoot)return root;hasRequiredRoot=1,root=l;var e=requireNamespace();((l.prototype=Object.create(e.prototype)).constructor=l).className="Root";var t,r,n,o=requireField(),i=require_enum$1(),a=requireOneof(),s=requireUtil$5();function l(t){e.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function p(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},l.prototype.resolvePath=s.path.resolve,l.prototype.fetch=s.fetch,l.prototype.load=function e(t,o,i){"function"==typeof o&&(i=o,o=void 0);var a=this;if(!i)return s.asPromise(e,a,t,o);var l=i===p;function d(e,t){if(i){if(l)throw e;t&&t.resolveAll();var r=i;i=null,r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in n)return r}return null}function c(e,t){try{if(s.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),s.isString(t)){r.filename=e;var n,i=r(t,a,o),p=0;if(i.imports)for(;p<i.imports.length;++p)(n=u(i.imports[p])||a.resolvePath(e,i.imports[p]))&&f(n);if(i.weakImports)for(p=0;p<i.weakImports.length;++p)(n=u(i.weakImports[p])||a.resolvePath(e,i.weakImports[p]))&&f(n,!0)}else a.setOptions(t.options).addJSON(t.nested)}catch(e){d(e)}l||h||d(null,a)}function f(e,t){if(e=u(e)||e,!(a.files.indexOf(e)>-1))if(a.files.push(e),e in n)l?c(e,n[e]):(++h,setTimeout(function(){--h,c(e,n[e])}));else if(l){var r;try{r=s.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||d(e))}c(e,r)}else++h,a.fetch(e,function(r,n){--h,i&&(r?t?h||d(null,a):d(r):c(e,n))})}var h=0;s.isString(t)&&(t=[t]);for(var m,g=0;g<t.length;++g)(m=a.resolvePath("",t[g]))&&f(m);return l?(a.resolveAll(),a):(h||d(null,a),a)},l.prototype.loadSync=function(e,t){if(!s.isNode)throw Error("not supported");return this.load(e,t,p)},l.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return e.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function u(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new o(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.get(n.name)||(n.declaringField=t,t.extensionField=n,r.add(n)),!0}return!1}return l.prototype._handleAdd=function(e){if(e instanceof o)void 0===e.extend||e.extensionField||u(0,e)||this.deferred.push(e);else if(e instanceof i)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof a)){if(e instanceof t)for(var r=0;r<this.deferred.length;)u(0,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);d.test(e.name)&&(e.parent[e.name]=e)}(e instanceof t||e instanceof i||e instanceof o)&&(this._fullyQualifiedObjects[e.fullName]=e)},l.prototype._handleRemove=function(t){if(t instanceof o){if(void 0!==t.extend)if(t.extensionField)t.extensionField.parent.remove(t.extensionField),t.extensionField=null;else{var r=this.deferred.indexOf(t);r>-1&&this.deferred.splice(r,1)}}else if(t instanceof i)d.test(t.name)&&delete t.parent[t.name];else if(t instanceof e){for(var n=0;n<t.nestedArray.length;++n)this._handleRemove(t._nestedArray[n]);d.test(t.name)&&delete t.parent[t.name]}delete this._fullyQualifiedObjects[t.fullName]},l._configure=function(e,o,i){t=e,r=o,n=i},root}function requireUtil$5(){if(hasRequiredUtil$5)return util$5.exports;hasRequiredUtil$5=1;var e,t,r=util$5.exports=requireMinimal$1(),n=requireRoots();r.codegen=requireCodegen(),r.fetch=requireFetch(),r.path=requirePath(),r.fs=r.inquire("fs"),r.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},r.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var o=/\\/g,i=/"/g;r.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},r.safeProp=function(e){return!/^[$\w_]+$/.test(e)||r.isReserved(e)?'["'+e.replace(o,"\\\\").replace(i,'\\"')+'"]':"."+e},r.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var a=/_([a-z])/g;r.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(a,function(e,t){return t.toUpperCase()})},r.compareFieldsById=function(e,t){return e.id-t.id},r.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(r.decorateRoot.remove(t.$type),t.$type.name=n,r.decorateRoot.add(t.$type)),t.$type;e||(e=requireType());var o=new e(n||t.name);return r.decorateRoot.add(o),o.ctor=t,Object.defineProperty(t,"$type",{value:o,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:o,enumerable:!1}),o};var s=0;return r.decorateEnum=function(e){if(e.$type)return e.$type;t||(t=require_enum$1());var n=new t("Enum"+s++,e);return r.decorateRoot.add(n),Object.defineProperty(e,"$type",{value:n,enumerable:!1}),n},r.setProperty=function(e,t,r,n){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,o){var i=r.shift();if("__proto__"===i||"prototype"===i)return t;if(r.length>0)t[i]=e(t[i]||{},r,o);else{var a=t[i];if(a&&n)return t;a&&(o=[].concat(a).concat(o)),t[i]=o}return t}(e,t=t.split("."),r)},Object.defineProperty(r,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(requireRoot()))}}),util$5.exports}function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(){var e=types$1,t=requireUtil$5(),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function n(e,t){var n=0,o={};for(t|=0;n<e.length;)o[r[n+t]]=e[n++];return o}e.basic=n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),e.defaults=n([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",t.emptyArray,null]),e.long=n([0,0,0,1,1],7),e.mapKey=n([0,0,0,5,5,0,0,0,1,1,0,2],2),e.packed=n([1,5,0,0,0,5,5,0,0,0,1,1,0])}()),types$1}function requireField(){if(hasRequiredField)return field;hasRequiredField=1,field=a;var e=requireObject();((a.prototype=Object.create(e.prototype)).constructor=a).className="Field";var t,r=require_enum$1(),n=requireTypes(),o=requireUtil$5(),i=/^required|optional|repeated$/;function a(t,r,a,s,l,p,d){if(o.isObject(s)?(d=l,p=s,s=l=void 0):o.isObject(l)&&(d=p,p=l,l=void 0),e.call(this,t,p),!o.isInteger(r)||r<0)throw TypeError("id must be a non-negative integer");if(!o.isString(a))throw TypeError("type must be a string");if(void 0!==s&&!i.test(s=s.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==l&&!o.isString(l))throw TypeError("extend must be a string");"proto3_optional"===s&&(s="optional"),this.rule=s&&"optional"!==s?s:void 0,this.type=a,this.id=r,this.extend=l||void 0,this.repeated="repeated"===s,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!o.Long&&void 0!==n.long[a],this.bytes="bytes"===a,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=d}return a.fromJSON=function(e,t){var r=new a(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},Object.defineProperty(a.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this._features.field_presence}}),Object.defineProperty(a.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(a.prototype,"delimited",{get:function(){return this.resolvedType instanceof t&&"DELIMITED"===this._features.message_encoding}}),Object.defineProperty(a.prototype,"packed",{get:function(){return"PACKED"===this._features.repeated_field_encoding}}),Object.defineProperty(a.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this._features.field_presence)}}),a.prototype.setOption=function(t,r,n){return e.prototype.setOption.call(this,t,r,n)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["edition",this._editionToJSON(),"rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=n.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof t?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=o.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var i;o.base64.test(this.typeDefault)?o.base64.decode(this.typeDefault,i=o.newBuffer(o.base64.length(this.typeDefault)),0):o.utf8.write(this.typeDefault,i=o.newBuffer(o.utf8.length(this.typeDefault)),0),this.typeDefault=i}return this.map?this.defaultValue=o.emptyObject:this.repeated?this.defaultValue=o.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof t&&(this.parent.ctor.prototype[this.name]=this.defaultValue),e.prototype.resolve.call(this)},a.prototype._inferLegacyProtoFeatures=function(e){if("proto2"!==e&&"proto3"!==e)return{};var r={};if("required"===this.rule&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&void 0===n.defaults[this.type]){var o=this.parent.get(this.type.split(".").pop());o&&o instanceof t&&o.group&&(r.message_encoding="DELIMITED")}return!0===this.getOption("packed")?r.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(r.repeated_field_encoding="EXPANDED"),r},a.prototype._resolveFeatures=function(t){return e.prototype._resolveFeatures.call(this,this._edition||t)},a.d=function(e,t,r,n){return"function"==typeof t?t=o.decorateType(t).name:t&&"object"==typeof t&&(t=o.decorateEnum(t).name),function(i,s){o.decorateType(i.constructor).add(new a(s,e,t,r,{default:n}))}},a._configure=function(e){t=e},field}function requireOneof(){if(hasRequiredOneof)return oneof;hasRequiredOneof=1,oneof=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="OneOf";var t=requireField(),r=requireUtil$5();function n(t,r,n,o){if(Array.isArray(r)||(n=r,r=void 0),e.call(this,t,n),void 0!==r&&!Array.isArray(r))throw TypeError("fieldNames must be an Array");this.oneof=r||[],this.fieldsArray=[],this.comment=o}function o(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}return n.fromJSON=function(e,t){return new n(e,t.oneof,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},n.prototype.add=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,o(this),this},n.prototype.remove=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),(r=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(r,1),e.partOf=null,this},n.prototype.onAdd=function(t){e.prototype.onAdd.call(this,t);for(var r=0;r<this.oneof.length;++r){var n=t.get(this.oneof[r]);n&&!n.partOf&&(n.partOf=this,this.fieldsArray.push(n))}o(this)},n.prototype.onRemove=function(t){for(var r,n=0;n<this.fieldsArray.length;++n)(r=this.fieldsArray[n]).parent&&r.parent.remove(r);e.prototype.onRemove.call(this,t)},Object.defineProperty(n.prototype,"isProto3Optional",{get:function(){if(null==this.fieldsArray||1!==this.fieldsArray.length)return!1;var e=this.fieldsArray[0];return null!=e.options&&!0===e.options.proto3_optional}}),n.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,o){r.decorateType(t.constructor).add(new n(o,e)),Object.defineProperty(t,o,{get:r.oneOfGetter(e),set:r.oneOfSetter(e)})}},oneof}function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=a,a.className="ReflectionObject";const e=requireOneof();var t,r=requireUtil$5(),n={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},o={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},i={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function a(e,t){if(!r.isString(e))throw TypeError("name must be a string");if(t&&!r.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(a.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),a.prototype.toJSON=function(){throw Error()},a.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var r=e.root;r instanceof t&&r._handleAdd(this)},a.prototype.onRemove=function(e){var r=e.root;r instanceof t&&r._handleRemove(this),this.parent=null,this.resolved=!1},a.prototype.resolve=function(){return this.resolved||this.root instanceof t&&(this.resolved=!0),this},a.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},a.prototype._resolveFeatures=function(t){if(!this._featuresResolved){var r={};if(!t)throw new Error("Unknown edition for "+this.fullName);var a=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(t));if(this._edition){if("proto2"===t)r=Object.assign({},o);else if("proto3"===t)r=Object.assign({},i);else{if("2023"!==t)throw new Error("Unknown edition: "+t);r=Object.assign({},n)}return this._features=Object.assign(r,a||{}),void(this._featuresResolved=!0)}if(this.partOf instanceof e){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,a||{})}else if(this.declaringField);else{if(!this.parent)throw new Error("Unable to find a parent for "+this.fullName);var l=Object.assign({},this.parent._features);this._features=Object.assign(l,a||{})}this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},a.prototype._inferLegacyProtoFeatures=function(){return{}},a.prototype.getOption=function(e){if(this.options)return this.options[e]},a.prototype.setOption=function(e,t,n){return this.options||(this.options={}),/^features\./.test(e)?r.setProperty(this.options,e,t,n):n&&void 0!==this.options[e]||(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},a.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var o=this.parsedOptions;if(n){var i=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(i){var a=i[e];r.setProperty(a,n,t)}else(i={})[e]=r.setProperty({},n,t),o.push(i)}else{var s={};s[e]=t,o.push(s)}return this},a.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},a.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},a.prototype._editionToJSON=function(){if(this._edition&&"proto3"!==this._edition)return this._edition},a._configure=function(e){t=e},object}function require_enum$1(){if(hasRequired_enum$1)return _enum$1;hasRequired_enum$1=1,_enum$1=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="Enum";var t=requireNamespace(),r=requireUtil$5();function n(t,r,n,o,i,a){if(e.call(this,t,n),r&&"object"!=typeof r)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=i||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,r)for(var s=Object.keys(r),l=0;l<s.length;++l)"number"==typeof r[s[l]]&&(this.valuesById[this.values[s[l]]=r[s[l]]]=s[l])}return n.prototype._resolveFeatures=function(t){return t=this._edition||t,e.prototype._resolveFeatures.call(this,t),Object.keys(this.values).forEach(e=>{var t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},n.fromJSON=function(e,t){var r=new n(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},n.prototype.add=function(e,t,n,o){if(!r.isString(e))throw TypeError("name must be a string");if(!r.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return o&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=o||null),this.comments[e]=n||null,this},n.prototype.remove=function(e){if(!r.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},n.prototype.isReservedId=function(e){return t.isReservedId(this.reserved,e)},n.prototype.isReservedName=function(e){return t.isReservedName(this.reserved,e)},_enum$1}function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=function(o){for(var i,a=r.codegen(["m","w"],o.name+"$encode")("if(!w)")("w=Writer.create()"),s=o.fieldsArray.slice().sort(r.compareFieldsById),l=0;l<s.length;++l){var p=s[l].resolve(),d=o._fieldsArray.indexOf(p),u=p.resolvedType instanceof e?"int32":p.type,c=t.basic[u];i="m"+r.safeProp(p.name),p.map?(a("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",i,p.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(p.id<<3|2)>>>0,8|t.mapKey[p.keyType],p.keyType),void 0===c?a("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",d,i):a(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,u,i),a("}")("}")):p.repeated?(a("if(%s!=null&&%s.length){",i,i),p.packed&&void 0!==t.packed[u]?a("w.uint32(%i).fork()",(p.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",u,i)("w.ldelim()"):(a("for(var i=0;i<%s.length;++i)",i),void 0===c?n(a,p,d,i+"[i]"):a("w.uint32(%i).%s(%s[i])",(p.id<<3|c)>>>0,u,i)),a("}")):(p.optional&&a("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,p.name),void 0===c?n(a,p,d,i):a("w.uint32(%i).%s(%s)",(p.id<<3|c)>>>0,u,i))}return a("return w")};var e=require_enum$1(),t=requireTypes(),r=requireUtil$5();function n(e,t,r,n){return t.delimited?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}return encoder_1}function requireIndexLight(){if(hasRequiredIndexLight)return indexLight.exports;hasRequiredIndexLight=1;var e=indexLight.exports=requireIndexMinimal();return e.build="light",e.load=function(t,r,n){return"function"==typeof r?(n=r,r=new e.Root):r||(r=new e.Root),r.load(t,n)},e.loadSync=function(t,r){return r||(r=new e.Root),r.loadSync(t)},e.encoder=requireEncoder(),e.decoder=requireDecoder(),e.verifier=requireVerifier(),e.converter=requireConverter(),e.ReflectionObject=requireObject(),e.Namespace=requireNamespace(),e.Root=requireRoot(),e.Enum=require_enum$1(),e.Type=requireType(),e.Field=requireField(),e.OneOf=requireOneof(),e.MapField=requireMapfield(),e.Service=requireService(),e.Method=requireMethod(),e.Message=requireMessage(),e.wrappers=requireWrappers$1(),e.types=requireTypes(),e.util=requireUtil$5(),e.ReflectionObject._configure(e.Root),e.Namespace._configure(e.Type,e.Service,e.Enum),e.Root._configure(e.Type),e.Field._configure(e.Type),indexLight.exports}function requireTokenize(){if(hasRequiredTokenize)return tokenize_1;hasRequiredTokenize=1,tokenize_1=d;var e=/[\s{}=;:[\],'"()<>]/g,t=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,o=/^\s*\*?\/*/,i=/\n/g,a=/\s/,s=/\\(.?)/g,l={0:"\0",r:"\r",n:"\n",t:"\t"};function p(e){return e.replace(s,function(e,t){switch(t){case"\\":case"":return t;default:return l[t]||""}})}function d(s,l){s=s.toString();var d=0,u=s.length,c=1,f=0,h={},m=[],g=null;function y(e){return Error("illegal "+e+" (line "+c+")")}function v(e){return s.charAt(e)}function b(e,t,r){var a,p={type:s.charAt(e++),lineEmpty:!1,leading:r},d=e-(l?2:3);do{if(--d<0||"\n"===(a=s.charAt(d))){p.lineEmpty=!0;break}}while(" "===a||"\t"===a);for(var u=s.substring(e,t).split(i),m=0;m<u.length;++m)u[m]=u[m].replace(l?o:n,"").trim();p.text=u.join("\n").trim(),h[c]=p,f=c}function O(e){var t=w(e),r=s.substring(e,t);return/^\s*\/\//.test(r)}function w(e){for(var t=e;t<u&&"\n"!==v(t);)t++;return t}function S(){if(m.length>0)return m.shift();if(g)return function(){var e="'"===g?r:t;e.lastIndex=d-1;var n=e.exec(s);if(!n)throw y("string");return d=e.lastIndex,_(g),g=null,p(n[1])}();var n,o,i,f,h,S=0===d;do{if(d===u)return null;for(n=!1;a.test(i=v(d));)if("\n"===i&&(S=!0,++c),++d===u)return null;if("/"===v(d)){if(++d===u)throw y("comment");if("/"===v(d))if(l){if(f=d,h=!1,O(d-1)){h=!0;do{if((d=w(d))===u)break;if(d++,!S)break}while(O(d))}else d=Math.min(u,w(d)+1);h&&(b(f,d,S),S=!0),c++,n=!0}else{for(h="/"===v(f=d+1);"\n"!==v(++d);)if(d===u)return null;++d,h&&(b(f,d-1,S),S=!0),++c,n=!0}else{if("*"!==(i=v(d)))return"/";f=d+1,h=l||"*"===v(f);do{if("\n"===i&&++c,++d===u)throw y("comment");o=i,i=v(d)}while("*"!==o||"/"!==i);++d,h&&(b(f,d-2,S),S=!0),n=!0}}}while(n);var P=d;if(e.lastIndex=0,!e.test(v(P++)))for(;P<u&&!e.test(v(P));)++P;var E=s.substring(d,d=P);return'"'!==E&&"'"!==E||(g=E),E}function _(e){m.push(e)}function P(){if(!m.length){var e=S();if(null===e)return null;_(e)}return m[0]}return Object.defineProperty({next:S,peek:P,push:_,skip:function(e,t){var r=P();if(r===e)return S(),!0;if(!t)throw y("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t,r=null;return void 0===e?(t=h[c-1],delete h[c-1],t&&(l||"*"===t.type||t.lineEmpty)&&(r=t.leading?t.text:null)):(f<e&&P(),t=h[e],delete h[e],!t||t.lineEmpty||!l&&"/"!==t.type||(r=t.leading?null:t.text)),r}},"line",{get:function(){return c}})}return d.unescape=p,tokenize_1}function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=w,w.filename=null,w.defaults={keepCase:!1};var e=requireTokenize(),t=requireRoot(),r=requireType(),n=requireField(),o=requireMapfield(),i=requireOneof(),a=require_enum$1(),s=requireService(),l=requireMethod(),p=requireObject(),d=requireTypes(),u=requireUtil$5(),c=/^[1-9][0-9]*$/,f=/^-?[1-9][0-9]*$/,h=/^0[x][0-9a-fA-F]+$/,m=/^-?0[x][0-9a-fA-F]+$/,g=/^0[0-7]+$/,y=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,b=/^[a-zA-Z_][a-zA-Z_0-9]*$/,O=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function w(S,_,P){_ instanceof t||(P=_,_=new t),P||(P=w.defaults);var E,T,C,R,D=P.preferTrailingComment||!1,x=e(S,P.alternateCommentMode||!1),k=x.next,j=x.push,A=x.peek,N=x.skip,I=x.cmnt,q=!0,M="proto2",L=_,F=[],B={},V=P.keepCase?function(e){return e}:u.camelCase;function U(e,t,r){var n=w.filename;return r||(w.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+x.line+")")}function $(){var e,t=[];do{if('"'!==(e=k())&&"'"!==e)throw U(e);t.push(k()),N(e),e=A()}while('"'===e||"'"===e);return t.join("")}function G(e){var t=k();switch(t){case"'":case'"':return j(t),$();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(c.test(e))return r*parseInt(e,10);if(h.test(e))return r*parseInt(e,16);if(g.test(e))return r*parseInt(e,8);if(v.test(e))return r*parseFloat(e);throw U(e,"number",t)}(t,!0)}catch(e){if(O.test(t))return t;throw U(t,"value")}}function H(e,t){var r,n;do{if(!t||'"'!==(r=A())&&"'"!==r)try{e.push([n=z(k()),N("to",!0)?z(k()):n])}catch(n){if(!(t&&O.test(r)&&M>=2023))throw n;e.push(r)}else{var o=$();if(e.push(o),M>=2023)throw U(o,"id")}}while(N(",",!0));var i={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Q(i,function(e){if("option"!==e)throw U(e);re(i,e),N(";")},function(){ie(i)})}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw U(e,"id");if(f.test(e))return parseInt(e,10);if(m.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw U(e,"id")}function W(){if(void 0!==E)throw U("package");if(E=k(),!O.test(E))throw U(E,"name");L=L.define(E),N(";")}function J(){var e,t=A();switch(t){case"weak":e=C||(C=[]),k();break;case"public":k();default:e=T||(T=[])}t=$(),N(";"),e.push(t)}function Y(){if(N("="),(M=$())<2023)throw U(M,"syntax");N(";")}function K(){N("="),M=$();if(!["2023"].includes(M))throw U(M,"edition");N(";")}function X(e,t){switch(t){case"option":return re(e,t),N(";"),!0;case"message":return Z(e,t),!0;case"enum":return te(e,t),!0;case"service":return function(e,t){if(!b.test(t=k()))throw U(t,"service name");var r=new s(t);Q(r,function(e){if(!X(r,e)){if("rpc"!==e)throw U(e);!function(e,t){var r=I(),n=t;if(!b.test(t=k()))throw U(t,"name");var o,i,a,s,p=t;N("("),N("stream",!0)&&(i=!0);if(!O.test(t=k()))throw U(t);o=t,N(")"),N("returns"),N("("),N("stream",!0)&&(s=!0);if(!O.test(t=k()))throw U(t);a=t,N(")");var d=new l(p,n,o,a,i,s);d.comment=r,Q(d,function(e){if("option"!==e)throw U(e);re(d,e),N(";")}),e.add(d)}(r,e)}}),e.add(r),e===L&&F.push(r)}(e,t),!0;case"extend":return function(e,t){if(!O.test(t=k()))throw U(t,"reference");var r=t;Q(null,function(t){switch(t){case"required":case"repeated":ee(e,t,r);break;case"optional":ee(e,"proto3"===M?"proto3_optional":"optional",r);break;default:if("proto2"===M||!O.test(t))throw U(t);j(t),ee(e,"optional",r)}})}(e,t),!0}return!1}function Q(e,t,r){var n=x.line;if(e&&("string"!=typeof e.comment&&(e.comment=I()),e.filename=w.filename),N("{",!0)){for(var o;"}"!==(o=k());)t(o);N(";",!0)}else r&&r(),N(";"),e&&("string"!=typeof e.comment||D)&&(e.comment=I(n)||e.comment)}function Z(e,t){if(!b.test(t=k()))throw U(t,"type name");var n=new r(t);Q(n,function(e){if(!X(n,e))switch(e){case"map":!function(e){N("<");var t=k();if(void 0===d.mapKey[t])throw U(t,"type");N(",");var r=k();if(!O.test(r))throw U(r,"type");N(">");var n=k();if(!b.test(n))throw U(n,"name");N("=");var i=new o(V(n),z(k()),t,r);Q(i,function(e){if("option"!==e)throw U(e);re(i,e),N(";")},function(){ie(i)}),e.add(i)}(n);break;case"required":if("proto2"!==M)throw U(e);case"repeated":ee(n,e);break;case"optional":if("proto3"===M)ee(n,"proto3_optional");else{if("proto2"!==M)throw U(e);ee(n,"optional")}break;case"oneof":!function(e,t){if(!b.test(t=k()))throw U(t,"name");var r=new i(V(t));Q(r,function(e){"option"===e?(re(r,e),N(";")):(j(e),ee(r,"optional"))}),e.add(r)}(n,e);break;case"extensions":H(n.extensions||(n.extensions=[]));break;case"reserved":H(n.reserved||(n.reserved=[]),!0);break;default:if("proto2"===M||!O.test(e))throw U(e);j(e),ee(n,"optional")}}),e.add(n),e===L&&F.push(n)}function ee(e,t,o){var a=k();if("group"!==a){for(;a.endsWith(".")||A().startsWith(".");)a+=k();if(!O.test(a))throw U(a,"type");var s=k();if(!b.test(s))throw U(s,"name");s=V(s),N("=");var l=new n(s,z(k()),a,t,o);if(Q(l,function(e){if("option"!==e)throw U(e);re(l,e),N(";")},function(){ie(l)}),"proto3_optional"===t){var p=new i("_"+s);l.setOption("proto3_optional",!0),p.add(l),e.add(p)}else e.add(l);e===L&&F.push(l)}else!function(e,t){if(M>=2023)throw U("group");var o=k();if(!b.test(o))throw U(o,"name");var i=u.lcFirst(o);o===i&&(o=u.ucFirst(o));N("=");var a=z(k()),s=new r(o);s.group=!0;var l=new n(i,a,o,t);l.filename=w.filename,Q(s,function(e){switch(e){case"option":re(s,e),N(";");break;case"required":case"repeated":ee(s,e);break;case"optional":ee(s,"proto3"===M?"proto3_optional":"optional");break;case"message":Z(s,e);break;case"enum":te(s,e);break;case"reserved":H(s.reserved||(s.reserved=[]),!0);break;default:throw U(e)}}),e.add(s).add(l)}(e,t)}function te(e,t){if(!b.test(t=k()))throw U(t,"name");var r=new a(t);Q(r,function(e){switch(e){case"option":re(r,e),N(";");break;case"reserved":H(r.reserved||(r.reserved=[]),!0),void 0===r.reserved&&(r.reserved=[]);break;default:!function(e,t){if(!b.test(t))throw U(t,"name");N("=");var r=z(k(),!0),n={options:void 0,getOption:function(e){return this.options[e]}};n.setOption=function(e,t){p.prototype.setOption.call(n,e,t)},n.setParsedOption=function(){},Q(n,function(e){if("option"!==e)throw U(e);re(n,e),N(";")},function(){ie(n)}),e.add(t,r,n.comment,n.parsedOptions||n.options)}(r,e)}}),e.add(r),e===L&&F.push(r)}function re(e,t){var r,n,o=!0;for("option"===t&&(t=k());"="!==t;){if("("===t){var i=k();N(")"),t="("+i+")"}if(o){if(o=!1,t.includes(".")&&!t.includes("(")){var a=t.split(".");r=a[0]+".",t=a[1];continue}r=t}else n=n?n+=t:t;t=k()}var s=ne(e,n?r.concat(n):r);n=n&&"."===n[0]?n.slice(1):n,function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,r=r&&"."===r[r.length-1]?r.slice(0,-1):r,s,n)}function ne(e,t){if(N("{",!0)){for(var r={};!N("}",!0);){if(!b.test(R=k()))throw U(R,"name");if(null===R)throw U(R,"end of input");var n,o=R;if(N(":",!0),"{"===A())n=ne(e,t+"."+R);else if("["===A()){var i;if(n=[],N("[",!0)){do{i=G(),n.push(i)}while(N(",",!0));N("]"),void 0!==i&&oe(e,t+"."+R,i)}}else n=G(),oe(e,t+"."+R,n);var a=r[o];a&&(n=[].concat(a).concat(n)),r[o]=n,N(",",!0),N(";",!0)}return r}var s=G();return oe(e,t,s),s}function oe(e,t,r){L===e&&/^features\./.test(t)?B[t]=r:e.setOption&&e.setOption(t,r)}function ie(e){if(N("[",!0)){do{re(e,"option")}while(N(",",!0));N("]")}return e}for(;null!==(R=k());)switch(R){case"package":if(!q)throw U(R);W();break;case"import":if(!q)throw U(R);J();break;case"syntax":if(!q)throw U(R);Y();break;case"edition":if(!q)throw U(R);K();break;case"option":re(L,R),N(";",!0);break;default:if(X(L,R)){q=!1;continue}throw U(R)}return F.forEach(e=>{e._edition=M,Object.keys(B).forEach(t=>{void 0===e.getOption(t)&&e.setOption(t,B[t],!0)})}),w.filename=null,{package:E,imports:T,weakImports:C,root:_}}return parse_1}function requireCommon$2(){if(hasRequiredCommon$2)return common_1;hasRequiredCommon$2=1,common_1=r;var e,t=/\/|\./;function r(e,n){t.test(e)||(e="google/protobuf/"+e+".proto",n={nested:{google:{nested:{protobuf:{nested:n}}}}}),r[e]=n}return r("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),r("duration",{Duration:e={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),r("timestamp",{Timestamp:e}),r("empty",{Empty:{fields:{}}}),r("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),r("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),r("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),r.get=function(e){return r[e]||null},common_1}function requireSrc$7(){if(hasRequiredSrc$7)return src$4.exports;hasRequiredSrc$7=1;var e=src$4.exports=requireIndexLight();return e.build="full",e.tokenize=requireTokenize(),e.parse=requireParse(),e.common=requireCommon$2(),e.Root._configure(e.Type,e.parse,e.common),src$4.exports}function requireProtobufjs(){return hasRequiredProtobufjs?protobufjs:(hasRequiredProtobufjs=1,protobufjs=requireSrc$7())}var descriptor$1={exports:{}},nested$7={google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}},require$$4$2={nested:nested$7},hasRequiredDescriptor$1;function requireDescriptor$1(){return hasRequiredDescriptor$1||(hasRequiredDescriptor$1=1,function(e,t){var r=requireProtobufjs();e.exports=t=r.descriptor=r.Root.fromJSON(require$$4$2).lookup(".google.protobuf");var n=r.Namespace,o=r.Root,i=r.Enum,a=r.Type,s=r.Field,l=r.MapField,p=r.OneOf,d=r.Service,u=r.Method;function c(e,r,l){var p=t.FileDescriptorProto.create({name:e.filename||(e.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});!function(e,r){if(!e)return;if("proto2"===e||"proto3"===e)r.syntax=e;else{if(r.syntax="editions","2023"!==e)throw new Error("Unsupported edition "+e);r.edition=t.Edition.EDITION_2023}}(l,p),e instanceof o||(p.package=e.fullName.substring(1));for(var u,f=0;f<e.nestedArray.length;++f)(u=e._nestedArray[f])instanceof a?p.messageType.push(u.toDescriptor(l)):u instanceof i?p.enumType.push(u.toDescriptor()):u instanceof s?p.extension.push(u.toDescriptor(l)):u instanceof d?p.service.push(u.toDescriptor()):u instanceof n&&c(u,r,l);p.options=_(e.options,t.FileOptions),p.messageType.length+p.enumType.length+p.extension.length+p.service.length&&r.push(p)}o.fromDescriptor=function(e){"number"==typeof e.length&&(e=t.FileDescriptorSet.decode(e));var r=new o;if(e.file)for(var n,l,p,u=0;u<e.file.length;++u){l=r,(n=e.file[u]).package&&n.package.length&&(l=r.define(n.package));var c=T(n);if(n.name&&n.name.length&&r.files.push(l.filename=n.name),n.messageType)for(p=0;p<n.messageType.length;++p)l.add(a.fromDescriptor(n.messageType[p],c));if(n.enumType)for(p=0;p<n.enumType.length;++p)l.add(i.fromDescriptor(n.enumType[p],c));if(n.extension)for(p=0;p<n.extension.length;++p)l.add(s.fromDescriptor(n.extension[p],c));if(n.service)for(p=0;p<n.service.length;++p)l.add(d.fromDescriptor(n.service[p],c));var f=w(n.options,t.FileOptions);if(f){var h=Object.keys(f);for(p=0;p<h.length;++p)l.setOption(h[p],f[h[p]])}}return r.resolveAll()},o.prototype.toDescriptor=function(e){var r=t.FileDescriptorSet.create();return c(this,r.file,e),r};var f=0;a.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.DescriptorProto.decode(e));var o,l=new a(e.name.length?e.name:"Type"+f++,w(e.options,t.MessageOptions));if(n||(l._edition=r),e.oneofDecl)for(o=0;o<e.oneofDecl.length;++o)l.add(p.fromDescriptor(e.oneofDecl[o]));if(e.field)for(o=0;o<e.field.length;++o){var d=s.fromDescriptor(e.field[o],r,!0);l.add(d),e.field[o].hasOwnProperty("oneofIndex")&&l.oneofsArray[e.field[o].oneofIndex].add(d)}if(e.extension)for(o=0;o<e.extension.length;++o)l.add(s.fromDescriptor(e.extension[o],r,!0));if(e.nestedType)for(o=0;o<e.nestedType.length;++o)l.add(a.fromDescriptor(e.nestedType[o],r,!0)),e.nestedType[o].options&&e.nestedType[o].options.mapEntry&&l.setOption("map_entry",!0);if(e.enumType)for(o=0;o<e.enumType.length;++o)l.add(i.fromDescriptor(e.enumType[o],r,!0));if(e.extensionRange&&e.extensionRange.length)for(l.extensions=[],o=0;o<e.extensionRange.length;++o)l.extensions.push([e.extensionRange[o].start,e.extensionRange[o].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(l.reserved=[],e.reservedRange)for(o=0;o<e.reservedRange.length;++o)l.reserved.push([e.reservedRange[o].start,e.reservedRange[o].end]);if(e.reservedName)for(o=0;o<e.reservedName.length;++o)l.reserved.push(e.reservedName[o])}return l},a.prototype.toDescriptor=function(e){var r,n=t.DescriptorProto.create({name:this.name});for(r=0;r<this.fieldsArray.length;++r){var o;if(n.field.push(o=this._fieldsArray[r].toDescriptor(e)),this._fieldsArray[r]instanceof l){var p=b(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),d=b(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),u=11===d||14===d?this._fieldsArray[r].resolvedType&&P(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(t.DescriptorProto.create({name:o.typeName,field:[t.FieldDescriptorProto.create({name:"key",number:1,label:1,type:p}),t.FieldDescriptorProto.create({name:"value",number:2,label:1,type:d,typeName:u})],options:t.MessageOptions.create({mapEntry:!0})}))}}for(r=0;r<this.oneofsArray.length;++r)n.oneofDecl.push(this._oneofsArray[r].toDescriptor());for(r=0;r<this.nestedArray.length;++r)this._nestedArray[r]instanceof s?n.field.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof a?n.nestedType.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof i&&n.enumType.push(this._nestedArray[r].toDescriptor());if(this.extensions)for(r=0;r<this.extensions.length;++r)n.extensionRange.push(t.DescriptorProto.ExtensionRange.create({start:this.extensions[r][0],end:this.extensions[r][1]}));if(this.reserved)for(r=0;r<this.reserved.length;++r)"string"==typeof this.reserved[r]?n.reservedName.push(this.reserved[r]):n.reservedRange.push(t.DescriptorProto.ReservedRange.create({start:this.reserved[r][0],end:this.reserved[r][1]}));return n.options=_(this.options,t.MessageOptions),n};var h=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;s.fromDescriptor=function(e,r,n){if("number"==typeof e.length&&(e=t.DescriptorProto.decode(e)),"number"!=typeof e.number)throw Error("missing field id");var o,i;switch(o=e.typeName&&e.typeName.length?e.typeName:function(e){switch(e){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+e)}(e.type),e.label){case 1:i=void 0;break;case 2:i="required";break;case 3:i="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;void 0!==e.extendee&&(a=a.length?a:void 0);var l=new s(e.name.length?e.name:"field"+e.number,e.number,o,i,a);if(n||(l._edition=r),l.options=w(e.options,t.FieldOptions),e.proto3_optional&&(l.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var p=e.defaultValue;switch(p){case"true":case"TRUE":p=!0;break;case"false":case"FALSE":p=!1;break;default:h.exec(p)&&(p=parseInt(p))}l.setOption("default",p)}return function(e){switch(e){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}(e.type)&&("proto3"===r?e.options&&!e.options.packed&&l.setOption("packed",!1):r&&"proto2"!==r||!e.options||!e.options.packed||l.setOption("packed",!0)),l},s.prototype.toDescriptor=function(e){var n=t.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)n.type=11,n.typeName=r.util.ucFirst(this.name),n.label=3;else{switch(n.type=b(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:n.typeName=this.resolvedType?P(this.parent,this.resolvedType):this.type}"repeated"===this.rule?n.label=3:this.required&&"proto2"===e?n.label=2:n.label=1}if(n.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(n.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(n.options=_(this.options,t.FieldOptions),null!=this.options.default&&(n.defaultValue=String(this.options.default)),this.options.proto3_optional&&(n.proto3_optional=!0)),"proto3"===e?this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!1):e&&"proto2"!==e||!this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!0),n};var m=0;i.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.EnumDescriptorProto.decode(e));var o={};if(e.value)for(var a=0;a<e.value.length;++a){var s=e.value[a].name,l=e.value[a].number||0;o[s&&s.length?s:"NAME"+l]=l}var p=new i(e.name&&e.name.length?e.name:"Enum"+m++,o,w(e.options,t.EnumOptions));return n||(p._edition=r),p},i.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(t.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return t.EnumDescriptorProto.create({name:this.name,value:e,options:_(this.options,t.EnumOptions)})};var g=0;p.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.OneofDescriptorProto.decode(e)),new p(e.name&&e.name.length?e.name:"oneof"+g++)},p.prototype.toDescriptor=function(){return t.OneofDescriptorProto.create({name:this.name})};var y=0;d.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.ServiceDescriptorProto.decode(e));var o=new d(e.name&&e.name.length?e.name:"Service"+y++,w(e.options,t.ServiceOptions));if(n||(o._edition=r),e.method)for(var i=0;i<e.method.length;++i)o.add(u.fromDescriptor(e.method[i]));return o},d.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return t.ServiceDescriptorProto.create({name:this.name,method:e,options:_(this.options,t.ServiceOptions)})};var v=0;function b(e,t,r){switch(e){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(t instanceof i)return 14;if(t instanceof a)return r?10:11;throw Error("illegal type: "+e)}function O(e,t){for(var r,n,o={},s=0;s<t.fieldsArray.length;++s)if("uninterpretedOption"!==(n=(r=t._fieldsArray[s]).name)&&Object.prototype.hasOwnProperty.call(e,n)){var l=E(n);r.resolvedType instanceof a?o[l]=O(e[n],r.resolvedType):r.resolvedType instanceof i?o[l]=r.resolvedType.valuesById[e[n]]:o[l]=e[n]}return o}function w(e,t){if(e)return O(t.toObject(e),t)}function S(e,t){for(var n={},o=Object.keys(e),i=0;i<o.length;++i){var s=o[i],l=r.util.camelCase(s);if(Object.prototype.hasOwnProperty.call(t.fields,l)){var p=t.fields[l];p.resolvedType instanceof a?n[l]=S(e[s],p.resolvedType):n[l]=e[s],p.repeated&&!Array.isArray(n[l])&&(n[l]=[n[l]])}}return n}function _(e,t){if(e)return t.fromObject(S(e,t))}function P(e,t){var r=e.fullName.split("."),i=t.fullName.split("."),a=0,s=0,l=i.length-1;if(!(e instanceof o)&&t instanceof n)for(;a<r.length&&s<l&&r[a]===i[s];){var p=t.lookup(r[a++],!0);if(null!==p&&p!==t)break;++s}else for(;a<r.length&&s<l&&r[a]===i[s];++a,++s);return i.slice(s).join(".")}function E(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function T(e){if("editions"===e.syntax){if(e.edition===t.Edition.EDITION_2023)return"2023";throw new Error("Unsupported edition "+e.edition)}return"proto3"===e.syntax?"proto3":"proto2"}u.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.MethodDescriptorProto.decode(e)),new u(e.name&&e.name.length?e.name:"Method"+v++,"rpc",e.inputType,e.outputType,Boolean(e.clientStreaming),Boolean(e.serverStreaming),w(e.options,t.MethodOptions))},u.prototype.toDescriptor=function(){return t.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:_(this.options,t.MethodOptions)})}}(descriptor$1,descriptor$1.exports)),descriptor$1.exports}var util$4={},nested$6={google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}},require$$3$1={nested:nested$6},nested$5={google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$5$2={nested:nested$5},nested$4={google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$6$1={nested:nested$4},hasRequiredUtil$4;function requireUtil$4(){if(hasRequiredUtil$4)return util$4;hasRequiredUtil$4=1,
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2018 gRPC authors.
@@ -102,5 +102,5 @@ Object.defineProperty(e,"__esModule",{value:!0}),e.loadFileDescriptorSetFromObje
102
102
  * @copyright 2015 Toru Nagashima. All rights reserved.
103
103
  * See LICENSE file in root directory for full license.
104
104
  */
105
- const privateData=new WeakMap,wrappers=new WeakMap;function pd(e){const t=privateData.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function setCancelFlag(e){null==e.passiveListener?e.event.cancelable&&(e.canceled=!0,"function"==typeof e.event.preventDefault&&e.event.preventDefault()):"undefined"!=typeof console&&"function"==typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener)}function Event(e,t){privateData.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const r=Object.keys(t);for(let e=0;e<r.length;++e){const t=r[e];t in this||Object.defineProperty(this,t,defineRedirectDescriptor(t))}}function defineRedirectDescriptor(e){return{get(){return pd(this).event[e]},set(t){pd(this).event[e]=t},configurable:!0,enumerable:!0}}function defineCallDescriptor(e){return{value(){const t=pd(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function defineWrapper(e,t){const r=Object.keys(t);if(0===r.length)return e;function n(t,r){e.call(this,t,r)}n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let o=0;o<r.length;++o){const i=r[o];if(!(i in e.prototype)){const e="function"==typeof Object.getOwnPropertyDescriptor(t,i).value;Object.defineProperty(n.prototype,i,e?defineCallDescriptor(i):defineRedirectDescriptor(i))}}return n}function getWrapper(e){if(null==e||e===Object.prototype)return Event;let t=wrappers.get(e);return null==t&&(t=defineWrapper(getWrapper(Object.getPrototypeOf(e)),e),wrappers.set(e,t)),t}function wrapEvent(e,t){return new(getWrapper(Object.getPrototypeOf(t)))(e,t)}function isStopped(e){return pd(e).immediateStopped}function setEventPhase(e,t){pd(e).eventPhase=t}function setCurrentTarget(e,t){pd(e).currentTarget=t}function setPassiveListener(e,t){pd(e).passiveListener=t}Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){const e=pd(this).currentTarget;return null==e?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){const e=pd(this);e.stopped=!0,"function"==typeof e.event.stopPropagation&&e.event.stopPropagation()},stopImmediatePropagation(){const e=pd(this);e.stopped=!0,e.immediateStopped=!0,"function"==typeof e.event.stopImmediatePropagation&&e.event.stopImmediatePropagation()},get bubbles(){return Boolean(pd(this).event.bubbles)},get cancelable(){return Boolean(pd(this).event.cancelable)},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return Boolean(pd(this).event.composed)},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(e){if(!e)return;const t=pd(this);t.stopped=!0,"boolean"==typeof t.event.cancelBubble&&(t.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(e){e||setCancelFlag(pd(this))},initEvent(){}},Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.Event&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));const listenersMap=new WeakMap,CAPTURE=1,BUBBLE=2,ATTRIBUTE=3;function isObject(e){return null!==e&&"object"==typeof e}function getListeners(e){const t=listenersMap.get(e);if(null==t)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function defineEventAttributeDescriptor(e){return{get(){let t=getListeners(this).get(e);for(;null!=t;){if(t.listenerType===ATTRIBUTE)return t.listener;t=t.next}return null},set(t){"function"==typeof t||isObject(t)||(t=null);const r=getListeners(this);let n=null,o=r.get(e);for(;null!=o;)o.listenerType===ATTRIBUTE?null!==n?n.next=o.next:null!==o.next?r.set(e,o.next):r.delete(e):n=o,o=o.next;if(null!==t){const o={listener:t,listenerType:ATTRIBUTE,passive:!1,once:!1,next:null};null===n?r.set(e,o):n.next=o}},configurable:!0,enumerable:!0}}function defineEventAttribute(e,t){Object.defineProperty(e,`on${t}`,defineEventAttributeDescriptor(t))}function defineCustomEventTarget(e){function t(){EventTarget.call(this)}t.prototype=Object.create(EventTarget.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)defineEventAttribute(t.prototype,e[r]);return t}function EventTarget(){if(!(this instanceof EventTarget)){if(1===arguments.length&&Array.isArray(arguments[0]))return defineCustomEventTarget(arguments[0]);if(arguments.length>0){const e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return defineCustomEventTarget(e)}throw new TypeError("Cannot call a class as a function")}listenersMap.set(this,new Map)}EventTarget.prototype={addEventListener(e,t,r){if(null==t)return;if("function"!=typeof t&&!isObject(t))throw new TypeError("'listener' should be a function or an object.");const n=getListeners(this),o=isObject(r),i=(o?Boolean(r.capture):Boolean(r))?CAPTURE:BUBBLE,a={listener:t,listenerType:i,passive:o&&Boolean(r.passive),once:o&&Boolean(r.once),next:null};let s=n.get(e);if(void 0===s)return void n.set(e,a);let l=null;for(;null!=s;){if(s.listener===t&&s.listenerType===i)return;l=s,s=s.next}l.next=a},removeEventListener(e,t,r){if(null==t)return;const n=getListeners(this),o=(isObject(r)?Boolean(r.capture):Boolean(r))?CAPTURE:BUBBLE;let i=null,a=n.get(e);for(;null!=a;){if(a.listener===t&&a.listenerType===o)return void(null!==i?i.next=a.next:null!==a.next?n.set(e,a.next):n.delete(e));i=a,a=a.next}},dispatchEvent(e){if(null==e||"string"!=typeof e.type)throw new TypeError('"event.type" should be a string.');const t=getListeners(this),r=e.type;let n=t.get(r);if(null==n)return!0;const o=wrapEvent(this,e);let i=null;for(;null!=n;){if(n.once?null!==i?i.next=n.next:null!==n.next?t.set(r,n.next):t.delete(r):i=n,setPassiveListener(o,n.passive?n.listener:null),"function"==typeof n.listener)try{n.listener.call(this,o)}catch(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e)}else n.listenerType!==ATTRIBUTE&&"function"==typeof n.listener.handleEvent&&n.listener.handleEvent(o);if(isStopped(o))break;n=n.next}return setPassiveListener(o,null),setEventPhase(o,0),setCurrentTarget(o,null),!o.defaultPrevented}},Object.defineProperty(EventTarget.prototype,"constructor",{value:EventTarget,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.EventTarget&&Object.setPrototypeOf(EventTarget.prototype,window.EventTarget.prototype);class AbortSignal extends EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){const e=abortedFlags.get(this);if("boolean"!=typeof e)throw new TypeError("Expected 'this' to be an 'AbortSignal' object, but got "+(null===this?"null":typeof this));return e}}function createAbortSignal(){const e=Object.create(AbortSignal.prototype);return EventTarget.call(e),abortedFlags.set(e,!1),e}function abortSignal(e){!1===abortedFlags.get(e)&&(abortedFlags.set(e,!0),e.dispatchEvent({type:"abort"}))}defineEventAttribute(AbortSignal.prototype,"abort");const abortedFlags=new WeakMap;Object.defineProperties(AbortSignal.prototype,{aborted:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(AbortSignal.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});let AbortController$1=class{constructor(){signals.set(this,createAbortSignal())}get signal(){return getSignal(this)}abort(){abortSignal(getSignal(this))}};const signals=new WeakMap;function getSignal(e){const t=signals.get(e);if(null==t)throw new TypeError("Expected 'this' to be an 'AbortController' object, but got "+(null===e?"null":typeof e));return t}Object.defineProperties(AbortController$1.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(AbortController$1.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});var abortController=Object.freeze({__proto__:null,AbortController:AbortController$1,AbortSignal:AbortSignal,default:AbortController$1}),require$$1=getAugmentedNamespace(abortController),streamArrayParser={},hasRequiredStreamArrayParser,hasRequiredFallbackServiceStub;function requireStreamArrayParser(){if(hasRequiredStreamArrayParser)return streamArrayParser;hasRequiredStreamArrayParser=1,Object.defineProperty(streamArrayParser,"__esModule",{value:!0}),streamArrayParser.StreamArrayParser=void 0;const e=require$$1,t=Stream__default.default,r=requireFallbackRest(),n=requireFeatureDetection();class o extends t.Transform{constructor(t,r){super(Object.assign({},r,{readableObjectMode:!0})),this._done=!1,this._prevBlock=Buffer.from(""),this._isInString=!1,this._isSkipped=!1,this._level=0,this.rpc=t,this.cancelController=(0,n.hasAbortController)()?new AbortController:new e.AbortController,this.cancelSignal=this.cancelController.signal,this.cancelRequested=!1}_transform(e,t,n){let o=0,i=0;for(0===this._level&&0===i&&("["!==String.fromCharCode(e[0])&&this.emit("error",new Error(`Internal Error: API service stream data must start with a '[' and close with the corresponding ']', but it start with ${String.fromCharCode(e[0])}`)),i++,this._level++);i<e.length;){const t=String.fromCharCode(e[i]);if(this._isSkipped)this._isSkipped=!1;else switch(t){case"{":this._isInString||this._level++,this._isInString||2!==this._level||(o=i);break;case'"':this._isInString=!this._isInString;break;case"}":if(this._isInString||this._level--,!this._isInString&&1===this._level){const t=Buffer.concat([this._prevBlock,e.slice(o,i+1)]);try{const e=(0,r.decodeResponse)(this.rpc,!0,t);this.push(e)}catch(e){this.emit("error",e)}o=i+1,this._prevBlock=Buffer.from("")}break;case"]":this._isInString||1!==this._level||(this._done=!0,this.push(null));break;case"\\":this._isSkipped=!0}i++}this._level>1&&(this._prevBlock=Buffer.concat([this._prevBlock,e.slice(o,i)])),n()}_flush(e){e()}cancel(){this._done=!0,this.cancelRequested=!0,this.cancelController.abort(),this.end()}}return streamArrayParser.StreamArrayParser=o,streamArrayParser}function requireFallbackServiceStub(){if(hasRequiredFallbackServiceStub)return fallbackServiceStub;hasRequiredFallbackServiceStub=1,Object.defineProperty(fallbackServiceStub,"__esModule",{value:!0}),fallbackServiceStub.generateServiceStub=function(i,a,s,l,p,d,u,c){const f=(0,r.hasWindowFetch)()?window.fetch:e.default,h={close:()=>({cancel:()=>{}})};for(const[e,m]of Object.entries(i))h[e]=(e,i,h,g)=>{let y;null!=i||(i={});try{y=d(m,a,s,l,e,c)}catch(e){return g&&g(e),{cancel(){}}}const v=(0,r.hasAbortController)()?new AbortController:new t.AbortController,b=v.signal;let O=!1;const w=y.url,S=y.headers;for(const e of Object.keys(i))S[e]=i[e][0];const _=new n.StreamArrayParser(m);return p.getRequestHeaders().then(e=>{const t={headers:{...e,...S},body:y.body,method:y.method,signal:b};return"GET"!==y.method&&"DELETE"!==y.method||delete t.body,f(w,t)}).then(e=>e.ok&&m.responseStream?void(0,o.pipeline)(e.body,_,e=>{e&&(!O||e instanceof Error&&"AbortError"!==e.name)&&(g&&g(e),_.emit("error",e))}):Promise.all([Promise.resolve(e.ok),e.arrayBuffer()]).then(([e,t])=>{const r=u(m,e,t);g(null,r)}).catch(e=>{if(!O||"AbortError"!==e.name)if(m.responseStream)g&&g(e),_.emit("error",e);else{if(!g)throw e;g(e)}})).catch(e=>{if(m.responseStream)g&&g(e),_.emit("error",e);else{if(!g)throw e;g(e)}}),m.responseStream?_:{cancel:()=>{O=!0,v.abort()}}};return h};const e=require$$2$1,t=require$$1,r=requireFeatureDetection(),n=requireStreamArrayParser(),o=Stream__default.default;return fallbackServiceStub}var streaming={},readable={exports:{}},stream,hasRequiredStream,buffer_list,hasRequiredBuffer_list,destroy_1,hasRequiredDestroy;function requireStream(){return hasRequiredStream?stream:(hasRequiredStream=1,stream=Stream__default.default)}function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach(function(e){r(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function r(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}hasRequiredBuffer_list=1;var i=require$$0__default$7.default.Buffer,a=require$$1__default$4.default.inspect,s=a&&a.custom||"inspect";function l(e,t,r){i.prototype.copy.call(e,t,r)}return buffer_list=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return n(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t=i.allocUnsafe(e>>>0),r=this.head,n=0;r;)l(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0===(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0===(e-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,t}},{key:s,value:function(e,r){return a(this,t(t({},r),{},{depth:0,customInspect:!1}))}}]),e}()}function requireDestroy(){if(hasRequiredDestroy)return destroy_1;function e(e,n){r(e,n),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}return hasRequiredDestroy=1,destroy_1={destroy:function(n,o){var i=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,n)):process.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(r){!o&&r?i._writableState?i._writableState.errorEmitted?process.nextTick(t,i):(i._writableState.errorEmitted=!0,process.nextTick(e,i,r)):process.nextTick(e,i,r):o?(process.nextTick(t,i),o(r)):process.nextTick(t,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}},destroy_1}var errors={},hasRequiredErrors,state,hasRequiredState;function requireErrors(){if(hasRequiredErrors)return errors;hasRequiredErrors=1;const e={};function t(t,r,n){n||(n=Error);class o extends n{constructor(e,t,n){super(function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(e,t,n))}}o.prototype.name=n.name,o.prototype.code=t,e[t]=o}function r(e,t){if(Array.isArray(e)){const r=e.length;return e=e.map(e=>String(e)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}return t("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(e,t,n){let o;var i;let a;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a=`The ${e} ${o} ${r(t,"type")}`;else{const n=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a=`The "${e}" ${n} ${o} ${r(t,"type")}`}return a+=". Received type "+typeof n,a},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errors.codes=e,errors}function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var e=requireErrors().codes.ERR_INVALID_OPT_VALUE;return state={getHighWaterMark:function(t,r,n,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(r,o,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new e(o?n:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}}}var inherits={exports:{}},inherits_browser={exports:{}},hasRequiredInherits_browser,hasRequiredInherits,node$1,hasRequiredNode$1,_stream_writable,hasRequired_stream_writable,_stream_duplex,hasRequired_stream_duplex;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,"function"==typeof Object.create?inherits_browser.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),inherits_browser.exports}function requireInherits(){if(hasRequiredInherits)return inherits.exports;hasRequiredInherits=1;try{var e=require("util");if("function"!=typeof e.inherits)throw"";inherits.exports=e.inherits}catch(e){inherits.exports=requireInherits_browser()}return inherits.exports}function requireNode$1(){return hasRequiredNode$1?node$1:(hasRequiredNode$1=1,node$1=require$$1__default$4.default.deprecate)}function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var t;hasRequired_stream_writable=1,_stream_writable=w,w.WritableState=O;var r={deprecate:requireNode$1()},n=requireStream(),o=require$$0__default$7.default.Buffer,i=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,s=requireDestroy(),l=requireState().getHighWaterMark,p=requireErrors().codes,d=p.ERR_INVALID_ARG_TYPE,u=p.ERR_METHOD_NOT_IMPLEMENTED,c=p.ERR_MULTIPLE_CALLBACK,f=p.ERR_STREAM_CANNOT_PIPE,h=p.ERR_STREAM_DESTROYED,m=p.ERR_STREAM_NULL_VALUES,g=p.ERR_STREAM_WRITE_AFTER_END,y=p.ERR_UNKNOWN_ENCODING,v=s.errorOrDestroy;function b(){}function O(r,n,o){t=t||require_stream_duplex(),r=r||{},"boolean"!=typeof o&&(o=n instanceof t),this.objectMode=!!r.objectMode,o&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=l(this,r,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===r.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new c;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(C,e,t),e._writableState.errorEmitted=!0,v(e,n)):(o(n),e._writableState.errorEmitted=!0,v(e,n),C(e,t))}(e,r,n,t,o);else{var i=E(r)||e.destroyed;i||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),n?process.nextTick(_,e,r,i,o):_(e,r,i,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function w(e){var r=this instanceof(t=t||require_stream_duplex());if(!r&&!a.call(w,this))return new w(e);this._writableState=new O(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function S(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new h("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function P(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var o=r.bufferedRequestCount,i=new Array(o),a=r.corkedRequestsFree;a.entry=n;for(var s=0,l=!0;n;)i[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;i.allBuffers=l,S(t,r,!0,r.length,i,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;n;){var p=n.chunk,d=n.encoding,u=n.callback;if(S(t,r,!1,r.objectMode?1:p.length,p,d,u),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final(function(r){t.pendingcb--,r&&v(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)})}function C(e,t){var r=E(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}return requireInherits()(w,n),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===w&&(e&&e._writableState instanceof O)}})):a=function(e){return e instanceof this},w.prototype.pipe=function(){v(this,new f)},w.prototype.write=function(e,t,r){var n,a=this._writableState,s=!1,l=!a.objectMode&&(n=e,o.isBuffer(n)||n instanceof i);return l&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),l?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=b),a.ending?function(e,t){var r=new g;v(e,r),process.nextTick(t,r)}(this,r):(l||function(e,t,r,n){var o;return null===r?o=new m:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(v(e,o),process.nextTick(n,o),!1)}(this,a,e,r))&&(a.pendingcb++,s=function(e,t,r,n,i,a){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var l=t.objectMode?1:n.length;t.length+=l;var p=t.length<t.highWaterMark;p||(t.needDrain=!0);if(t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,l,n,i,a);return p}(this,a,l,e,t,r)),s},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,r){r(new u("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,C(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=s.destroy,w.prototype._undestroy=s.undestroy,w.prototype._destroy=function(e,t){t(e)},_stream_writable}function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};_stream_duplex=a;var t=require_stream_readable(),r=require_stream_writable();requireInherits()(a,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var i=n[o];a.prototype[i]||(a.prototype[i]=r.prototype[i])}function a(e){if(!(this instanceof a))return new a(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||process.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),_stream_duplex}var string_decoder={},safeBuffer={exports:{}},hasRequiredSafeBuffer,hasRequiredString_decoder,endOfStream$1,hasRequiredEndOfStream$1,async_iterator,hasRequiredAsync_iterator,from_1,hasRequiredFrom,_stream_readable,hasRequired_stream_readable,_stream_transform,hasRequired_stream_transform,_stream_passthrough,hasRequired_stream_passthrough,pipeline_1,hasRequiredPipeline,hasRequiredReadable;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(e,t){var r=require$$0__default$7.default,n=r.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i),i.prototype=Object.create(n.prototype),o(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=n(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var e=requireSafeBuffer().Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=i,this.end=a,n=4;break;case"utf8":this.fillLast=o,n=4;break;case"base64":this.text=s,this.end=l,n=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function i(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function s(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}return string_decoder.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var o=t.length-1;if(o<r)return 0;var i=n(t[o]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--o<r||-2===i)return 0;if(i=n(t[o]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--o<r||-2===i)return 0;if(i=n(t[o]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var o=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,o),e.toString("utf8",t,o)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},string_decoder}function requireEndOfStream$1(){if(hasRequiredEndOfStream$1)return endOfStream$1;hasRequiredEndOfStream$1=1;var e=requireErrors().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return endOfStream$1=function r(n,o,i){if("function"==typeof o)return r(n,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||t);var a=o.readable||!1!==o.readable&&n.readable,s=o.writable||!1!==o.writable&&n.writable,l=function(){n.writable||d()},p=n._writableState&&n._writableState.finished,d=function(){s=!1,p=!0,a||i.call(n)},u=n._readableState&&n._readableState.endEmitted,c=function(){a=!1,u=!0,s||i.call(n)},f=function(e){i.call(n,e)},h=function(){var t;return a&&!u?(n._readableState&&n._readableState.ended||(t=new e),i.call(n,t)):s&&!p?(n._writableState&&n._writableState.ended||(t=new e),i.call(n,t)):void 0},m=function(){n.req.on("finish",d)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(n)?s&&!n._writableState&&(n.on("end",l),n.on("close",l)):(n.on("complete",d),n.on("abort",h),n.req?m():n.on("request",m)),n.on("end",c),n.on("finish",d),!1!==o.error&&n.on("error",f),n.on("close",h),function(){n.removeListener("complete",d),n.removeListener("abort",h),n.removeListener("request",m),n.req&&n.req.removeListener("finish",d),n.removeListener("end",l),n.removeListener("close",l),n.removeListener("finish",d),n.removeListener("end",c),n.removeListener("error",f),n.removeListener("close",h)}},endOfStream$1}function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredAsync_iterator=1;var r=requireEndOfStream$1(),n=Symbol("lastResolve"),o=Symbol("lastReject"),i=Symbol("error"),a=Symbol("ended"),s=Symbol("lastPromise"),l=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function u(e){var t=e[n];if(null!==t){var r=e[p].read();null!==r&&(e[s]=null,e[n]=null,e[o]=null,t(d(r,!1)))}}function c(e){process.nextTick(u,e)}var f=Object.getPrototypeOf(function(){}),h=Object.setPrototypeOf((e={get stream(){return this[p]},next:function(){var e=this,t=this[i];if(null!==t)return Promise.reject(t);if(this[a])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,r){process.nextTick(function(){e[i]?r(e[i]):t(d(void 0,!0))})});var r,n=this[s];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[a]?r(d(void 0,!0)):t[l](r,n)},n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[l])}return this[s]=r,r}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),e),f);return async_iterator=function(e){var u,f=Object.create(h,(t(u={},p,{value:e,writable:!0}),t(u,n,{value:null,writable:!0}),t(u,o,{value:null,writable:!0}),t(u,i,{value:null,writable:!0}),t(u,a,{value:e._readableState.endEmitted,writable:!0}),t(u,l,{value:function(e,t){var r=f[p].read();r?(f[s]=null,f[n]=null,f[o]=null,e(d(r,!1))):(f[n]=e,f[o]=t)},writable:!0}),u));return f[s]=null,r(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=f[o];return null!==t&&(f[s]=null,f[n]=null,f[o]=null,t(e)),void(f[i]=e)}var r=f[n];null!==r&&(f[s]=null,f[n]=null,f[o]=null,r(d(void 0,!0))),f[a]=!0}),e.on("readable",c.bind(null,f)),f},async_iterator}function requireFrom(){if(hasRequiredFrom)return from_1;function e(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredFrom=1;var n=requireErrors().codes.ERR_INVALID_ARG_TYPE;return from_1=function(o,i,a){var s;if(i&&"function"==typeof i.next)s=i;else if(i&&i[Symbol.asyncIterator])s=i[Symbol.asyncIterator]();else{if(!i||!i[Symbol.iterator])throw new n("iterable",["Iterable"],i);s=i[Symbol.iterator]()}var l=new o(function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}({objectMode:!0},a)),p=!1;function d(){return u.apply(this,arguments)}function u(){var t;return t=function*(){try{var e=yield s.next(),t=e.value;e.done?l.push(null):l.push(yield t)?d():p=!1}catch(e){l.destroy(e)}},u=function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,l,"next",t)}function l(t){e(a,o,i,s,l,"throw",t)}s(void 0)})},u.apply(this,arguments)}return l._read=function(){p||(p=!0,d())},l},from_1}function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;var e;hasRequired_stream_readable=1,_stream_readable=w,w.ReadableState=O,require$$0__default$3.default.EventEmitter;var t=function(e,t){return e.listeners(t).length},r=requireStream(),n=require$$0__default$7.default.Buffer,o=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var i,a=require$$1__default$4.default;i=a&&a.debuglog?a.debuglog("stream"):function(){};var s,l,p,d=requireBuffer_list(),u=requireDestroy(),c=requireState().getHighWaterMark,f=requireErrors().codes,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_STREAM_PUSH_AFTER_EOF,g=f.ERR_METHOD_NOT_IMPLEMENTED,y=f.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;requireInherits()(w,r);var v=u.errorOrDestroy,b=["error","close","destroy","pause","resume"];function O(t,r,n){e=e||require_stream_duplex(),t=t||{},"boolean"!=typeof n&&(n=r instanceof e),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=c(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(s||(s=requireString_decoder().StringDecoder),this.decoder=new s(t.encoding),this.encoding=t.encoding)}function w(t){if(e=e||require_stream_duplex(),!(this instanceof w))return new w(t);var n=this instanceof e;this._readableState=new O(t,this,n),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),r.call(this)}function S(e,t,r,a,s){i("readableAddChunk",t);var l,p=e._readableState;if(null===t)p.reading=!1,function(e,t){if(i("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}(e,p);else if(s||(l=function(e,t){var r;i=t,n.isBuffer(i)||i instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new h("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(p,t)),l)v(e,l);else if(p.objectMode||t&&t.length>0)if("string"==typeof t||p.objectMode||Object.getPrototypeOf(t)===n.prototype||(t=function(e){return n.from(e)}(t)),a)p.endEmitted?v(e,new y):_(e,p,t,!0);else if(p.ended)v(e,new m);else{if(p.destroyed)return!1;p.reading=!1,p.decoder&&!r?(t=p.decoder.write(t),p.objectMode||0!==t.length?_(e,p,t,!1):R(e,p)):_(e,p,t,!1)}else a||(p.reading=!1,R(e,p));return!p.ended&&(p.length<p.highWaterMark||0===p.length)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),R(e,t)}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=u.destroy,w.prototype._undestroy=u.undestroy,w.prototype._destroy=function(e,t){t(e)},w.prototype.push=function(e,t){var r,o=this._readableState;return o.objectMode?r=!0:"string"==typeof e&&((t=t||o.defaultEncoding)!==o.encoding&&(e=n.from(e,t),t=""),r=!0),S(this,e,t,!1,r)},w.prototype.unshift=function(e){return S(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(e){s||(s=requireString_decoder().StringDecoder);var t=new s(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var P=1073741824;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(C,e))}function C(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,A(e)}function R(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(D,e,t))}function D(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function x(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){i("readable nexttick read 0"),e.read(0)}function j(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function I(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(q,t,e))}function q(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return w.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):T(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&I(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){v(this,new g("_read()"))},w.prototype.pipe=function(e,r){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,i("pipe count=%d opts=%j",o.pipesCount,r);var a=(!r||!1!==r.end)&&e!==process.stdout&&e!==process.stderr?l:m;function s(t,r){i("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",p),e.removeListener("error",c),e.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",u),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function l(){i("onend"),e.end()}o.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",s);var p=function(e){return function(){var r=e._readableState;i("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&t(e,"data")&&(r.flowing=!0,A(e))}}(n);e.on("drain",p);var d=!1;function u(t){i("ondata");var r=e.write(t);i("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!d&&(i("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function c(r){i("onerror",r),m(),e.removeListener("error",c),0===t(e,"error")&&v(e,r)}function f(){e.removeListener("finish",h),m()}function h(){i("onfinish"),e.removeListener("close",f),m()}function m(){i("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",f),e.once("finish",h),e.emit("pipe",n),o.flowing||(i("pipe resume"),n.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=M(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var n=r.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,i("on readable",o.length,o.reading),o.length?T(this):o.reading||process.nextTick(k,this))),n},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(e,t){var n=r.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(x,this),n},w.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(x,this),t},w.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(j,e,t))}(this,e)),e.paused=!1,this},w.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<b.length;a++)e.on(b[a],this.emit.bind(this,b[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(w.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=requireAsync_iterator()),l(this)}),Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(w.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(w.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),w._fromList=N,Object.defineProperty(w.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(w.from=function(e,t){return void 0===p&&(p=requireFrom()),p(w,e,t)}),_stream_readable}function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=s;var e=requireErrors().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=require_stream_duplex();function a(e,t){var n=this._transformState;n.transforming=!1;var o=n.writecb;if(null===o)return this.emit("error",new r);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),o(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush(function(t,r){p(e,t,r)})}function p(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new n;return e.push(null)}return requireInherits()(s,i),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,i.prototype.push.call(this,e,t)},s.prototype._transform=function(e,r,n){n(new t("_transform()"))},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},s.prototype._destroy=function(e,t){i.prototype._destroy.call(this,e,function(e){t(e)})},_stream_transform}function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=t;var e=require_stream_transform();function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return requireInherits()(t,e),t.prototype._transform=function(e,t,r){r(null,e)},_stream_passthrough}function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;var e;hasRequiredPipeline=1;var t=requireErrors().codes,r=t.ERR_MISSING_ARGS,n=t.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function i(e){e()}function a(e,t){return e.pipe(t)}return pipeline_1=function(){for(var t=arguments.length,s=new Array(t),l=0;l<t;l++)s[l]=arguments[l];var p,d=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new r("streams");var u=s.map(function(t,r){var o=r<s.length-1;return function(t,r,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var a=!1;t.on("close",function(){a=!0}),void 0===e&&(e=requireEndOfStream$1()),e(t,{readable:r,writable:o},function(e){if(e)return i(e);a=!0,i()});var s=!1;return function(e){if(!a&&!s)return s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void i(e||new n("pipe"))}}(t,o,r>0,function(e){p||(p=e),e&&u.forEach(i),o||(u.forEach(i),d(p))})});return s.reduce(a)},pipeline_1}function requireReadable(){return hasRequiredReadable||(hasRequiredReadable=1,function(e,t){var r=Stream__default.default;"disable"===process.env.READABLE_STREAM&&r?(e.exports=r.Readable,Object.assign(e.exports,r),e.exports.Stream=r):((t=e.exports=require_stream_readable()).Stream=r||t,t.Readable=t,t.Writable=require_stream_writable(),t.Duplex=require_stream_duplex(),t.Transform=require_stream_transform(),t.PassThrough=require_stream_passthrough(),t.finished=requireEndOfStream$1(),t.pipeline=requirePipeline())}(readable,readable.exports)),readable.exports}var once={exports:{}},wrappy_1,hasRequiredWrappy,hasRequiredOnce,endOfStream,hasRequiredEndOfStream,streamShift,hasRequiredStreamShift,duplexify,hasRequiredDuplexify;function requireWrappy(){if(hasRequiredWrappy)return wrappy_1;return hasRequiredWrappy=1,wrappy_1=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),o=e[e.length-1];return"function"==typeof n&&n!==o&&Object.keys(o).forEach(function(e){n[e]=o[e]}),n}},wrappy_1}function requireOnce(){if(hasRequiredOnce)return once.exports;hasRequiredOnce=1;var e=requireWrappy();function t(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function r(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}return once.exports=e(t),once.exports.strict=e(r),t.proto=t(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return t(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return r(this)},configurable:!0})}),once.exports}function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var e=requireOnce(),t=function(){},r=commonjsGlobal.Bare?queueMicrotask:process.nextTick.bind(process),n=function(o,i,a){if("function"==typeof i)return n(o,null,i);i||(i={}),a=e(a||t);var s=o._writableState,l=o._readableState,p=i.readable||!1!==i.readable&&o.readable,d=i.writable||!1!==i.writable&&o.writable,u=!1,c=function(){o.writable||f()},f=function(){d=!1,p||a.call(o)},h=function(){p=!1,d||a.call(o)},m=function(e){a.call(o,e?new Error("exited with error code: "+e):null)},g=function(e){a.call(o,e)},y=function(){r(v)},v=function(){if(!u)return(!p||l&&l.ended&&!l.destroyed)&&(!d||s&&s.ended&&!s.destroyed)?void 0:a.call(o,new Error("premature close"))},b=function(){o.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(o)?d&&!s&&(o.on("end",c),o.on("close",c)):(o.on("complete",f),o.on("abort",y),o.req?b():o.on("request",b)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(o)&&o.on("exit",m),o.on("end",h),o.on("finish",f),!1!==i.error&&o.on("error",g),o.on("close",y),function(){u=!0,o.removeListener("complete",f),o.removeListener("abort",y),o.removeListener("request",b),o.req&&o.req.removeListener("finish",f),o.removeListener("end",c),o.removeListener("close",c),o.removeListener("finish",f),o.removeListener("exit",m),o.removeListener("end",h),o.removeListener("error",g),o.removeListener("close",y)}};return endOfStream=n}function requireStreamShift(){if(hasRequiredStreamShift)return streamShift;return hasRequiredStreamShift=1,streamShift=function(e){var t=e._readableState;return t?t.objectMode||"number"==typeof e._duplexState?e.read():e.read(function(e){if(e.buffer.length){var t=e.bufferIndex||0;if(e.buffer.head)return e.buffer.head.data.length;if(e.buffer.length-t>0&&e.buffer[t])return e.buffer[t].length}return e.length}(t)):null},streamShift}function requireDuplexify(){if(hasRequiredDuplexify)return duplexify;hasRequiredDuplexify=1;var e=requireReadable(),t=requireEndOfStream(),r=requireInherits(),n=requireStreamShift(),o=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),i=function(e,t){e._corked?e.once("uncork",t):t()},a=function(e,t){return function(r){r?function(e,t){e._autoDestroy&&e.destroy(t)}(e,"premature close"===r.message?null:r):t&&!e._ended&&e.end()}},s=function(){},l=function(t,r,n){if(!(this instanceof l))return new l(t,r,n);e.Duplex.call(this,n),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!n||!1!==n.autoDestroy,this._forwardDestroy=!n||!1!==n.destroy,this._forwardEnd=!n||!1!==n.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),r&&this.setReadable(r)};return r(l,e.Duplex),l.obj=function(e,t,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new l(e,t,r)},l.prototype.cork=function(){1===++this._corked&&this.emit("cork")},l.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},l.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var r=this,n=t(e,{writable:!0,readable:!1},a(this,this._forwardEnd)),o=function(){var e=r._ondrain;r._ondrain=null,e&&e()};this._unwrite&&process.nextTick(o),this._writable=e,this._writable.on("drain",o),this._unwrite=function(){r._writable.removeListener("drain",o),n()},this.uncork()}else this.end()},l.prototype.setReadable=function(r){if(this._unread&&this._unread(),this.destroyed)r&&r.destroy&&r.destroy();else{if(null===r||!1===r)return this.push(null),void this.resume();var n,o=this,i=t(r,{writable:!1,readable:!0},a(this)),s=function(){o._forward()},l=function(){o.push(null)};this._drained=!0,this._readable=r,this._readable2=r._readableState?r:(n=r,new e.Readable({objectMode:!0,highWaterMark:16}).wrap(n)),this._readable2.on("readable",s),this._readable2.on("end",l),this._unread=function(){o._readable2.removeListener("readable",s),o._readable2.removeListener("end",l),i()},this._forward()}},l.prototype._read=function(){this._drained=!0,this._forward()},l.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=n(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},l.prototype.destroy=function(e,t){if(t||(t=s),this.destroyed)return t(null);this.destroyed=!0;var r=this;process.nextTick(function(){r._destroy(e),t(null)})},l.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},l.prototype._write=function(e,t,r){if(!this.destroyed)return this._corked?i(this,this._write.bind(this,e,t,r)):e===o?this._finish(r):this._writable?void(!1===this._writable.write(e)?this._ondrain=r:this.destroyed||r()):r()},l.prototype._finish=function(e){var t=this;this.emit("preend"),i(this,function(){var r,n;r=t._forwardEnd&&t._writable,n=function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit("prefinish"),i(t,e)},r?r._writableState&&r._writableState.finished?n():r._writableState?r.end(n):(r.end(),n()):n()})},l.prototype.end=function(t,r,n){return"function"==typeof t?this.end(null,null,t):"function"==typeof r?this.end(t,null,r):(this._ended=!0,t&&this.write(t),this._writableState.ending||this._writableState.destroyed||this.write(o),e.Writable.prototype.end.call(this,n))},duplexify=l}var retryRequest={exports:{}},extend,hasRequiredExtend,hasRequiredRetryRequest,hasRequiredStreaming;function requireExtend(){if(hasRequiredExtend)return extend;hasRequiredExtend=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(r){if(!r||"[object Object]"!==t.call(r))return!1;var n,o=e.call(r,"constructor"),i=r.constructor&&r.constructor.prototype&&e.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!o&&!i)return!1;for(n in r);return void 0===n||e.call(r,n)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(n)return n(t,r).value}return t[r]};return extend=function e(){var t,r,n,l,p,d,u=arguments[0],c=1,f=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});c<f;++c)if(null!=(t=arguments[c]))for(r in t)n=s(u,r),u!==(l=s(t,r))&&(h&&l&&(i(l)||(p=o(l)))?(p?(p=!1,d=n&&o(n)?n:[]):d=n&&i(n)?n:{},a(u,{name:r,newValue:e(h,d,l)})):void 0!==l&&a(u,{name:r,newValue:l}));return u},extend}function requireRetryRequest(){if(hasRequiredRetryRequest)return retryRequest.exports;hasRequiredRetryRequest=1;const{PassThrough:e}=Stream__default.default,t=requireExtend();let r=()=>{};"undefined"!=typeof process&&"env"in process&&"object"==typeof process.env&&"retry-request"===process.env.DEBUG&&(r=e=>{console.log("retry-request:",e)});const n={objectMode:!1,retries:2,maxRetryDelay:64,retryDelayMultiplier:2,totalTimeout:600,noResponseRetries:2,currentRetryAttempt:0,shouldRetryFn:function(e){const t=[[100,199],[429,429],[500,599]],n=e.statusCode;let o;for(r(`Response status: ${n}`);o=t.shift();)if(n>=o[0]&&n<=o[1])return!0}};function o(e){const{maxRetryDelay:t,retryDelayMultiplier:r,retryNumber:n,timeOfFirstRequest:o,totalTimeout:i}=e,a=1e3*t,s=1e3*i,l=Math.floor(1e3*Math.random()),p=1e3*Math.pow(r,n)+l,d=s-(Date.now()-o);return Math.min(p,d,a)}return retryRequest.exports=function(i,a,s){"string"==typeof i&&(i={url:i});const l="function"!=typeof arguments[arguments.length-1];"function"==typeof a&&(s=a);const p=a&&"number"==typeof a.currentRetryAttempt;if(void 0===(a=t({},n,a)).request)throw new Error("A request library must be provided to retry-request.");let d,u,c,f,h=a.currentRetryAttempt,m=0,g=!1;const y={abort:function(){f&&f.abort&&f.abort()}};l&&(d=new e({objectMode:a.objectMode}),d.abort=b);const v=Date.now();return h>0?w(h):O(),l?d:y;function b(){c=null,u&&(u.abort&&u.abort(),u.cancel&&u.cancel(),u.destroy?u.destroy():u.end&&u.end())}function O(){let t=!1;function n(e=[]){t||(t=!0,d.emit("complete",...e))}h++,r(`Current retry attempt: ${h}`),l?(g=!1,c=new e({objectMode:a.objectMode}),u=a.request(i),setImmediate(()=>{d.emit("request")}),u.on("error",e=>{g||(g=!0,S(e))}).on("response",(e,t)=>{g||(g=!0,S(null,e,t))}).on("complete",(...e)=>n(e)).on("finish",(...e)=>n(e)),u.pipe(c)):f=a.request(i,S)}function w(e){l&&b();const t=o({maxRetryDelay:a.maxRetryDelay,retryDelayMultiplier:a.retryDelayMultiplier,retryNumber:e,timeOfFirstRequest:v,totalTimeout:a.totalTimeout});r(`Next retry delay: ${t}`),t<=0?m=a.noResponseRetries+1:setTimeout(O,t)}function S(e,t,r){if(e)return m++,void(m<=a.noResponseRetries?w(m):l?(d.emit("error",e),d.end()):s(e,t,r));(p?h:h-1)<a.retries&&a.shouldRetryFn(t)?w(h):l?(d.emit("response",t),c.pipe(d),u.on("error",e=>{d.destroy(e)})):s(e,t,r)}},retryRequest.exports.defaults=n,retryRequest.exports.getNextRetryDelay=o,retryRequest.exports}function requireStreaming(){if(hasRequiredStreaming)return streaming;hasRequiredStreaming=1,Object.defineProperty(streaming,"__esModule",{value:!0}),streaming.StreamProxy=streaming.StreamType=void 0;const e=requireGax(),t=requireGoogleError(),r=requireStatus(),n=Stream__default.default,o=requireDuplexify(),i=requireRetryRequest();var a;!function(e){e[e.SERVER_STREAMING=1]="SERVER_STREAMING",e[e.CLIENT_STREAMING=2]="CLIENT_STREAMING",e[e.BIDI_STREAMING=3]="BIDI_STREAMING"}(a||(streaming.StreamType=a={}));return streaming.StreamProxy=class extends o{constructor(e,t,r,n){super(void 0,void 0,{objectMode:!0,readable:e!==a.CLIENT_STREAMING,writable:e!==a.SERVER_STREAMING}),this.type=e,this._callback=t,this._isCancelCalled=!1,this._responseHasSent=!1,this.rest=r,this.gaxServerStreamingRetries=n}shouldRetryRequest(e,r){const n=t.GoogleError.parseGRPCStatusDetails(e);let o=this.defaultShouldRetry(n,r);return r.shouldRetryFn&&(o=r.shouldRetryFn(n)),o}cancel(){this.stream?this.stream.cancel():this._isCancelCalled=!0}throwIfMaxRetriesOrTotalTimeoutExceeded(e,n,o,i,a,s){const l=(new Date).getTime();if(a&&(0===o||o<0||e&&l>=e)){const e=new t.GoogleError(`Total timeout of API exceeded ${a} milliseconds ${i?`retrying error ${i} `:""} before any response was received.`);throw e.code=r.Status.DEADLINE_EXCEEDED,e}if(0===n){const e=i;throw e.note="Max retries is set to zero.",e}if(s&&s>=n){const e=new t.GoogleError("Exceeded maximum number of retries "+(i?`retrying error ${i} `:"")+"before any response was received");throw e.code=r.Status.DEADLINE_EXCEEDED,e}}eventForwardHelper(e){["metadata","response","status"].forEach(t=>{e.on(t,this.emit.bind(this,t))})}statusMetadataHelper(e){e.on("status",()=>{this._responseHasSent||e.emit("response",{code:200,details:"",message:"OK"})}),e.on("metadata",t=>{e.emit("response",{code:200,details:"",message:"OK",metadata:t}),this._responseHasSent=!0})}forwardEvents(e){this.eventForwardHelper(e),this.statusMetadataHelper(e),e.on("error",e=>{t.GoogleError.parseGRPCStatusDetails(e)})}defaultShouldRetry(e,t){return!(t.retryCodes.length>0&&t.retryCodes.indexOf(e.code)<0||0===t.retryCodes.length)}setStream(e,t,r={},n){if(this.apiCall=e,this.argument=t,this.type===a.SERVER_STREAMING){if(this.rest){const r=e(t,this._callback);this.stream=r,this.setReadable(r)}else if(this.gaxServerStreamingRetries){const r=()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());return e(t,this._callback)},o=this.newStreamingRetryRequest({request:r,retry:n});this.stream=o,this.eventForwardHelper(o),this.setReadable(o)}else{const n=i(null,{objectMode:!0,request:()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());const r=e(t,this._callback);return this.stream=r,this.forwardEvents(r),r},retries:r.retries,currentRetryAttempt:r.currentRetryAttempt,noResponseRetries:r.noResponseRetries,shouldRetryFn:r.shouldRetryFn});this.setReadable(n)}return}const o=e(t,this._callback);this.stream=o,this.forwardEvents(o),this.type===a.CLIENT_STREAMING&&this.setWritable(o),this.type===a.BIDI_STREAMING&&(this.setReadable(o),this.setWritable(o)),this._isCancelCalled&&this.stream&&this.stream.cancel()}newStreamingRetryRequest(o){var i,a,s,l;const p=null!==(i=o.retry)&&void 0!==i?i:{retryCodes:[],backoffSettings:(0,e.createDefaultBackoffSettings)()};let d=0;const u=new n.PassThrough({objectMode:!0}),c=null!==(a=p.backoffSettings.totalTimeoutMillis)&&void 0!==a?a:void 0,f=null!==(s=p.backoffSettings.maxRetries)&&void 0!==s?s:void 0;let h=null!==(l=p.backoffSettings.initialRpcTimeoutMillis)&&void 0!==l?l:void 0,m=new Date,g=0;c&&(g=m.getTime()+c);const y=(e,r)=>{const n=t.GoogleError.parseGRPCStatusDetails(e);return n.note="Exception occurred in retry method that was not classified as transient",r.destroy(),u.destroy(n),u},v=e=>{let n=!1,i=!1,a=!1;const s=e.request(null);u.cancel=s.cancel;return["metadata","response","status"].forEach(e=>{s.on(e,u.emit.bind(u,e))}),this.statusMetadataHelper(s),s.on("data",e=>{d=0,this.emit.bind(this,"data")(e)}),s.on("status",()=>(i=!0,n&&u.end(),u)),s.on("end",()=>(a||(n=!0,i&&u.end()),u)),s.on("error",e=>{if(a=!0,void 0!==typeof f||void 0!==typeof c){if(this.shouldRetryRequest(e,p)){if(f&&c){const e=new t.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");return e.code=r.Status.INVALID_ARGUMENT,s.destroy(),u.destroy(e),u}{try{this.throwIfMaxRetriesOrTotalTimeoutExceeded(g,f,h,e,c,d)}catch(e){const r=t.GoogleError.parseGRPCStatusDetails(e);return s.destroy(),u.destroy(r),u}const r=p.backoffSettings.retryDelayMultiplier,n=p.backoffSettings.maxRetryDelayMillis,i=p.backoffSettings.rpcTimeoutMultiplier,a=p.backoffSettings.maxRpcTimeoutMillis;let l=p.backoffSettings.initialRetryDelayMillis;const y=Math.random()*l;return(()=>{setTimeout(()=>{if(h){m=new Date,l=Math.min(l*r,n);const e=h&&i?h*i:0,t=a||0,o=g?g-m.getTime():0;h=Math.min(e,t,o)}d++;let e=this.argument;void 0!==p.getResumptionRequestFn&&(e=p.getResumptionRequestFn(e));return o.request=()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());return this.apiCall(e,this._callback)},v(o)},y)})()}}return y(e,s)}return y(e,s)}),u};return v(o)}},streaming}var pathTemplate={},hasRequiredPathTemplate;function requirePathTemplate(){if(hasRequiredPathTemplate)return pathTemplate;hasRequiredPathTemplate=1,Object.defineProperty(pathTemplate,"__esModule",{value:!0}),pathTemplate.PathTemplate=void 0;return pathTemplate.PathTemplate=class{constructor(e){this.bindings={},this.data=e,this.segments=this.parsePathTemplate(e),this.size=this.segments.length}match(e){let t=e.split("/");const r={};if(t.length!==this.segments.length){if(!this.data.includes("**"))throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same.`);if(t.length!==this.segments.length+1)throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same with one wildcard.`)}for(let e=0;e<this.segments.length&&t.length>0;e++)if(this.segments[e]!==t[0]){if(!this.segments[e].includes("*"))throw new TypeError(`segment does not match, ${this.segments[e]} and ${t[e]}.`);{let n=this.segments[e];const o=n.match(/\{[$0-9a-zA-Z_]+=.*?\}/g);if(!o)throw new Error(`Error processing path template segment ${n}`);const i=o.map(e=>e.replace(/^\{/,"").replace(/=.*/,""));if(n.includes("**"))r[i[0]]=t[0]+"/"+t[1],t=t.slice(2);else{if(1===i.length)r[i[0]]=t[0];else{const o=t[0].split(/[-_.~]/);if(o.length!==i.length)throw new Error(`segment ${n} does not match ${t[0]}`);for(const e of i)r[e]=o[0],n=n.replace(`{${e}=*}`,`${o[0]}`),o.shift();if(n!==t[0])throw new TypeError(`non slash resource pattern ${this.segments[e]} and ${t[0]} should have same separator`)}t.shift()}}}else t.shift();return r}render(e){if(Object.keys(e).length!==Object.keys(this.bindings).length)throw new TypeError(`The number of variables ${Object.keys(e).length} does not match the number of needed variables ${Object.keys(this.bindings).length}`);let t=this.inspect();for(const r of Object.keys(e)){const n=e[r].toString();if(!this.bindings[r])throw new TypeError(`render fails for not matching ${e[r]}`);const o=this.bindings[r];if("*"===o){if(!n.match(/[^/{}]+/))throw new TypeError(`render fails for not matching ${n}`);t=t.replace(`{${r}=*}`,`${n}`)}else if("**"===o){if(!n.match(/[^{}]+/))throw new TypeError(`render fails for not matching ${n}`);t=t.replace(`{${r}=**}`,`${n}`)}}return t}inspect(){return this.segments.join("/")}parsePathTemplate(e){const t=function(e){let t=0,r=0,n=0;const o=[];for(;r>=t&&r<e.length;){if("{"===e.charAt(r))n+=1;else if("}"===e.charAt(r))n-=1;else if("/"===e.charAt(r)){if(r===e.length-1)throw new TypeError("Invalid path, it can not be ended by /");0===n&&(o.push(e.substring(t,r)),t=r+1)}if(r===e.length-1){if(0!==n)throw new TypeError("Brackets are invalid.");o.push(e.substring(t))}r+=1}return o}(e);let r=0,n=0;const o=[];let i;if(t.forEach(e=>{if("*"===e||"**"===e)this.bindings[`$${r}`]=e,o.push(`{$${r}=${e}}`),r+=1,"**"===e&&++n;else if(i=e.match(/\{[0-9a-zA-Z-.~_]+(?:=.*?)?\}/g)){for(const t of i){const r=t.match(/^\{([0-9a-zA-Z-.~_]+)(?:=(.*?))?\}$/);if(!r)throw new Error(`Cannot process path template segment ${t}`);const o=r[1];let i=r[2];i?"*"===i?this.bindings[o]=i:"**"===i&&(++n,this.bindings[o]=i):(i="*",e=e.replace(o,o+"=*"),this.bindings[o]=i)}o.push(e)}else e.match(/[0-9a-zA-Z-.~_]+/)&&o.push(e)}),n>1)throw new TypeError("Can not have more than one wildcard.");return o}},pathTemplate}var version$1="4.6.1",require$$19={version:version$1},descriptor={},longRunningDescriptor={},longRunningApiCaller={},longrunning={},hasRequiredLongrunning,hasRequiredLongRunningApiCaller,hasRequiredLongRunningDescriptor;function requireLongrunning(){if(hasRequiredLongrunning)return longrunning;hasRequiredLongrunning=1,Object.defineProperty(longrunning,"__esModule",{value:!0}),longrunning.Operation=void 0,longrunning.operation=function(e,t,r,n){return new o(e,t,r,n)};const e=require$$0__default$3.default,t=requireStatus(),r=requireGoogleError(),n=requireOperations();class o extends e.EventEmitter{constructor(e,t,r,n){super(),this.completeListeners=0,this.hasActiveListeners=!1,this.latestResponse=e,this.name=this.latestResponse.name,this.done=this.latestResponse.done,this.error=this.latestResponse.error,this.longrunningDescriptor=t,this.result=null,this.metadata=null,this.backoffSettings=r,this._unpackResponse(e),this._listenForEvents(),this._callOptions=n}_listenForEvents(){this.on("newListener",e=>{"complete"===e&&(this.completeListeners++,this.hasActiveListeners||(this.hasActiveListeners=!0,this.startPolling_()))}),this.on("removeListener",e=>{"complete"===e&&0===--this.completeListeners&&(this.hasActiveListeners=!1)})}cancel(){this.currentCallPromise_&&this.currentCallPromise_.cancel();const e=this.longrunningDescriptor.operationsClient,t=new n.google.longrunning.CancelOperationRequest;return t.name=this.latestResponse.name,e.cancelOperation(t)}getOperation(e){const t=this,o=this.longrunningDescriptor.operationsClient;function i(){if(!e)return new Promise((e,n)=>{if(t.latestResponse.error){const e=new r.GoogleError(t.latestResponse.error.message);e.code=t.latestResponse.error.code,n(e)}else e([t.result,t.metadata,t.latestResponse])})}if(this.latestResponse.done)return this._unpackResponse(this.latestResponse,e),i();const a=new n.google.longrunning.GetOperationRequest;a.name=this.latestResponse.name,this.currentCallPromise_=o.getOperationInternal(a,this._callOptions);const s=this.currentCallPromise_.then(r=>(t.latestResponse=r[0],t._unpackResponse(r[0],e),i()),t=>{if(!e)return Promise.reject(t);e(t)});return e?void 0:s}_unpackResponse(e,t){const n=this.longrunningDescriptor.responseDecoder,o=this.longrunningDescriptor.metadataDecoder;let i,a;if(e.done){if("error"===e.result){const n=new r.GoogleError(e.error.message);return n.code=e.error.code,this.error=n,void(t&&t(n))}n&&e.response&&(this.response=e.response,i=n(e.response.value),this.result=i,this.done=!0)}o&&e.metadata&&(a=o(e.metadata.value),this.metadata=a),t&&t(null,i,a,e)}startPolling_(){const e=this;let n=new Date;const o=this.backoffSettings.retryDelayMultiplier,i=this.backoffSettings.maxRetryDelayMillis;let a,s=this.backoffSettings.initialRetryDelayMillis,l=1/0;function p(t,...r){e.emit(t,...r)}this.backoffSettings.totalTimeoutMillis&&(l=n.getTime()+this.backoffSettings.totalTimeoutMillis),this.latestResponse.metadata&&(a=this.latestResponse.metadata.value),function d(){if(e.hasActiveListeners){if(n.getTime()>=l){const e=new r.GoogleError("Total timeout exceeded before any response was received");return e.code=t.Status.DEADLINE_EXCEEDED,void setImmediate(p,"error",e)}e.getOperation((e,t,r,l)=>{if(!e)return t?void setImmediate(p,"complete",t,r,l):(l.metadata&&(!a||l&&!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;++r)if(e[r]!==t[r])return!1;return!0}(l.metadata.value,a))&&(setImmediate(p,"progress",r,l),a=l.metadata.value),l.done?void setImmediate(p,"complete",{},r,l):void setTimeout(()=>{n=new Date,s=Math.min(s*o,i),d()},s));setImmediate(p,"error",e)})}}()}promise(){return new Promise((e,t)=>{this.on("error",t).on("complete",(t,r,n)=>{e([t,r,n])})})}}return longrunning.Operation=o,longrunning}function requireLongRunningApiCaller(){if(hasRequiredLongRunningApiCaller)return longRunningApiCaller;hasRequiredLongRunningApiCaller=1,Object.defineProperty(longRunningApiCaller,"__esModule",{value:!0}),longRunningApiCaller.LongrunningApiCaller=void 0;const e=requireCall(),t=requireGax(),r=requireLongrunning();return longRunningApiCaller.LongrunningApiCaller=class{constructor(e){this.longrunningDescriptor=e}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,t,r,n){n.call((t,n)=>this._wrapOperation(e,r,t,n),t)}_wrapOperation(e,n,o,i){let a=n.longrunning;a||(a=(0,t.createDefaultBackoffSettings)());const s=this.longrunningDescriptor;return e(o,(e,t)=>{if(e)return void i(e,null,null,t);const o=new r.Operation(t,s,a,n);i(null,o,t)})}fail(e,t){e.callback(t)}result(e){return e.promise}},longRunningApiCaller}function requireLongRunningDescriptor(){if(hasRequiredLongRunningDescriptor)return longRunningDescriptor;hasRequiredLongRunningDescriptor=1,Object.defineProperty(longRunningDescriptor,"__esModule",{value:!0}),longRunningDescriptor.LongRunningDescriptor=void 0;const e=requireLongRunningApiCaller();return longRunningDescriptor.LongRunningDescriptor=class{constructor(e,t,r){this.operationsClient=e,this.responseDecoder=t,this.metadataDecoder=r}getApiCaller(){return new e.LongrunningApiCaller(this)}},longRunningDescriptor}var pageDescriptor={},pagedApiCaller={},resourceCollector={},hasRequiredResourceCollector,hasRequiredPagedApiCaller,hasRequiredPageDescriptor;function requireResourceCollector(){if(hasRequiredResourceCollector)return resourceCollector;hasRequiredResourceCollector=1,Object.defineProperty(resourceCollector,"__esModule",{value:!0}),resourceCollector.ResourceCollector=void 0;return resourceCollector.ResourceCollector=class{constructor(e,t=-1){this.apiCall=e,this.resources=[],this.maxResults=t}callback(e,t,r){if(e)return void this.rejectCallback(e);for(const e of t)if(this.resources.push(e),this.resources.length===this.maxResults){r=null;break}if(!r)return void this.resolveCallback(this.resources);setImmediate(this.apiCall,r,(...e)=>this.callback(...e))}processAllPages(e){return new Promise((t,r)=>{this.resolveCallback=t,this.rejectCallback=r;setImmediate(this.apiCall,e,(...e)=>this.callback(...e))})}},resourceCollector}function requirePagedApiCaller(){if(hasRequiredPagedApiCaller)return pagedApiCaller;hasRequiredPagedApiCaller=1,Object.defineProperty(pagedApiCaller,"__esModule",{value:!0}),pagedApiCaller.PagedApiCaller=void 0;const e=requireCall(),t=requireGoogleError(),r=requireResourceCollector(),n=requireWarnings();return pagedApiCaller.PagedApiCaller=class{constructor(e){this.pageDescriptor=e}generateParseResponseCallback(e,r){const n=this.pageDescriptor.resourceField,o=this.pageDescriptor.responsePageTokenField,i=this.pageDescriptor.requestPageTokenField;return(a,s)=>{if(a)return void r(a);if(!e)return void r(new t.GoogleError("Undefined request in pagination method callback."));if(!s)return void r(new t.GoogleError("Undefined response in pagination method callback."));const l=s[n]||[],p=s[o];let d=null;p&&(d=Object.assign({},e),d[i]=p),r(a,l,d,s)}}wrap(e){const t=this;return function(r,n,o,i){return e(r,n,o,t.generateParseResponseCallback(r,i))}}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}call(e,t,o,i){if(t=Object.assign({},t),!o.autoPaginate)return void i.call(e,t);t.pageSize&&o.autoPaginate&&(0,n.warn)("autoPaginate true","Providing a pageSize without setting autoPaginate to false will still return all results. See https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure manual paging","AutopaginateTrueWarning");const a=o.maxResults||-1;new r.ResourceCollector(e,a).processAllPages(t).then(e=>i.callback(null,e),e=>i.callback(e))}fail(e,t){e.callback(t)}result(e){return e.promise}},pagedApiCaller}function requirePageDescriptor(){if(hasRequiredPageDescriptor)return pageDescriptor;hasRequiredPageDescriptor=1,Object.defineProperty(pageDescriptor,"__esModule",{value:!0}),pageDescriptor.PageDescriptor=void 0;const e=Stream__default.default,t=requireNormalApiCaller(),r=requireWarnings(),n=requirePagedApiCaller();return pageDescriptor.PageDescriptor=class{constructor(e,t,r){this.requestPageTokenField=e,this.responsePageTokenField=t,this.resourceField=r}createStream(t,n,o){(null==o?void 0:o.autoPaginate)&&(0,r.warn)("autoPaginate true","Autopaginate will always be set to false in stream paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning");const i=new e.PassThrough({objectMode:!0}),a="maxResults"in(o=Object.assign({},o,{autoPaginate:!1}))?o.maxResults:-1;let s=0,l=!1;function p(e,r,d,u){if(e)i.emit("error",e);else{i.emit("response",u);for(let e=0;e<r.length;++e){if(i._readableState.ended)return;null!==r[e]&&(i.push(r[e]),s++,s===a&&i.end())}i._readableState.ended||(d?("pageToken"in o&&delete o.pageToken,i.isPaused()?(n=d,l=!1):setImmediate(t,d,o,p)):i.end())}}return i.on("resume",()=>{l||(l=!0,t(n,o,p))}),i}asyncIterate(e,t,n){(null==n?void 0:n.autoPaginate)&&(0,r.warn)("autoPaginate true","Autopaginate will always be set to false in Async paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning"),n=Object.assign({},n,{autoPaginate:!1});return this.createIterator(e,t,n)}createIterator(e,t,r){const n={[Symbol.asyncIterator](){let n=t;const o=[];return{async next(){if(o.length>0)return Promise.resolve({done:!1,value:o.shift()});let t=0;for(;0===o.length&&n;){let i;if([i,n]=await e(n,r),i&&!Array.isArray(i))for(const[e,t]of Object.entries(i))o.push([e,t]);else o.push(...i);if(0===o.length&&(++t,t>10))break}return 0===o.length?Promise.resolve({done:!0,value:void 0}):Promise.resolve({done:!1,value:o.shift()})}}}};return n}getApiCaller(e){return e.autoPaginate?new n.PagedApiCaller(this):new t.NormalApiCaller}},pageDescriptor}var streamDescriptor={},streamingApiCaller={},hasRequiredStreamingApiCaller,hasRequiredStreamDescriptor;function requireStreamingApiCaller(){if(hasRequiredStreamingApiCaller)return streamingApiCaller;hasRequiredStreamingApiCaller=1,Object.defineProperty(streamingApiCaller,"__esModule",{value:!0}),streamingApiCaller.StreamingApiCaller=void 0;const e=requireWarnings(),t=requireStreaming();return streamingApiCaller.StreamingApiCaller=class{constructor(e){this.descriptor=e}init(e){return new t.StreamProxy(this.descriptor.type,e,this.descriptor.rest,this.descriptor.gaxStreamingRetries)}wrap(r){switch(this.descriptor.type){case t.StreamType.SERVER_STREAMING:return(e,t,n)=>r(e,t,n);case t.StreamType.CLIENT_STREAMING:return(e,t,n,o)=>r(t,n,o);case t.StreamType.BIDI_STREAMING:return(e,t,n)=>r(t,n);default:(0,e.warn)("streaming_wrap_unknown_stream_type",`Unknown stream type: ${this.descriptor.type}`)}return r}call(e,t,r,n){n.setStream(e,t,r.retryRequestOptions,r.retry)}fail(e,t){e.emit("error",t)}result(e){return e}},streamingApiCaller}function requireStreamDescriptor(){if(hasRequiredStreamDescriptor)return streamDescriptor;hasRequiredStreamDescriptor=1,Object.defineProperty(streamDescriptor,"__esModule",{value:!0}),streamDescriptor.StreamDescriptor=void 0;const e=requireStreamingApiCaller();return streamDescriptor.StreamDescriptor=class{constructor(e,t,r){this.type=e,this.streaming=!0,this.rest=t,this.gaxStreamingRetries=r}getApiCaller(){return new e.StreamingApiCaller(this)}},streamDescriptor}var bundleDescriptor={},bundleApiCaller={},hasRequiredBundleApiCaller;function requireBundleApiCaller(){if(hasRequiredBundleApiCaller)return bundleApiCaller;hasRequiredBundleApiCaller=1,Object.defineProperty(bundleApiCaller,"__esModule",{value:!0}),bundleApiCaller.BundleApiCaller=void 0;const e=requireCall(),t=requireGoogleError();return bundleApiCaller.BundleApiCaller=class{constructor(e){this.bundler=e}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,r,n,o){if(!n.isBundling)throw new t.GoogleError("Bundling enabled with no isBundling!");o.call((t,r)=>(this.bundler.schedule(e,t,r),o),r)}fail(e,t){e.callback(t)}result(e){return e.promise}},bundleApiCaller}var bundleExecutor={},bundlingUtils={},hasRequiredBundlingUtils;function requireBundlingUtils(){if(hasRequiredBundlingUtils)return bundlingUtils;function e(e,t){const r=t.split(".");let n=e;for(const e of r)n=null==n?void 0:n[e];return n}return hasRequiredBundlingUtils=1,Object.defineProperty(bundlingUtils,"__esModule",{value:!0}),bundlingUtils.computeBundleId=function(t,r){const n=[];let o=!1;for(const i of r){const r=e(t,i);void 0===r?n.push(null):(o=!0,n.push(r))}if(!o)return;return JSON.stringify(n)},bundlingUtils}var task={},hasRequiredTask,hasRequiredBundleExecutor,hasRequiredBundleDescriptor,hasRequiredDescriptor;function requireTask(){if(hasRequiredTask)return task;hasRequiredTask=1,Object.defineProperty(task,"__esModule",{value:!0}),task.Task=void 0,task.deepCopyForResponse=r;const e=requireStatus(),t=requireGoogleError();function r(e,t){let n;return null===e?null:void 0!==e?Array.isArray(e)?(n=[],e.forEach(e=>{n.push(r(e,null))}),n):void 0!==e.copy?e.copy():e instanceof ArrayBuffer?e.slice(0):"object"==typeof e?(n={},Object.keys(e).forEach(o=>{t&&o===t.field&&Array.isArray(e[o])?n[o]=e[o].slice(t.start,t.end):n[o]=r(e[o],null)}),n):e:void 0}return task.Task=class{constructor(e,t,r,n){this._apiCall=e,this._request=t,this._bundledField=r,this._subresponseField=n,this._data=[]}getElementCount(){let e=0;for(let t=0;t<this._data.length;++t)e+=this._data[t].elements.length;return e}getRequestByteSize(){let e=0;for(let t=0;t<this._data.length;++t)e+=this._data[t].bytes;return e}run(){if(0===this._data.length)return[];const n=this._request,o=[],i=[];for(let e=0;e<this._data.length;++e)o.push(...this._data[e].elements),i.push(this._data[e].callback.id);n[this._bundledField]=o;const a=this;return this.callCanceller=this._apiCall(n,(n,o)=>{const i=[];if(n)a._data.forEach(()=>{i.push(void 0)});else{let e=null;a._subresponseField&&(e={field:a._subresponseField,start:0}),a._data.forEach(t=>{e&&(e.end=e.start+t.elements.length),i.push(r(o,e)),e&&(e.start=e.end)})}for(let r=0;r<a._data.length;++r)if(a._data[r].cancelled){const n=new t.GoogleError("cancelled");n.code=e.Status.CANCELLED,a._data[r].callback(n)}else a._data[r].callback(n,i[r])}),i}extend(e,t,r){this._data.push({elements:e,bytes:t,callback:r})}cancel(r){if(this.callCanceller){let e=!0;return this._data.forEach(t=>{t.callback.id===r&&(t.cancelled=!0),t.cancelled||(e=!1)}),e&&this.callCanceller.cancel(),e}for(let n=0;n<this._data.length;++n)if(this._data[n].callback.id===r){const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,this._data[n].callback(r),this._data.splice(n,1);break}return 0===this._data.length}},task}function requireBundleExecutor(){if(hasRequiredBundleExecutor)return bundleExecutor;hasRequiredBundleExecutor=1,Object.defineProperty(bundleExecutor,"__esModule",{value:!0}),bundleExecutor.BundleExecutor=void 0;const e=requireStatus(),t=requireGoogleError(),r=requireWarnings(),n=requireBundlingUtils(),o=requireTask();function i(){}return bundleExecutor.BundleExecutor=class{constructor(e,t){this._options=e,this._descriptor=t,this._tasks={},this._timers={},this._invocations={},this._invocationId=0}schedule(a,s,l){const p=(0,n.computeBundleId)(s,this._descriptor.requestDiscriminatorFields);if(l=l||i,void 0===p)return(0,r.warn)("bundling_schedule_bundleid_undefined",`The request does not have enough information for request bundling. Invoking immediately. Request: ${JSON.stringify(s)} discriminator fields: ${this._descriptor.requestDiscriminatorFields}`),a(s,l);if(void 0===s[this._descriptor.bundledField])return(0,r.warn)("bundling_no_bundled_field",`Request does not contain field ${this._descriptor.bundledField} that must present for bundling. Invoking immediately. Request: ${JSON.stringify(s)}`),a(s,l);p in this._tasks||(this._tasks[p]=new o.Task(a,s,this._descriptor.bundledField,this._descriptor.subresponseField));let d=this._tasks[p];l.id=String(this._invocationId++),this._invocations[l.id]=p;const u=s[this._descriptor.bundledField],c=u.length;let f=0;const h=this;u.forEach(e=>{f+=this._descriptor.byteLengthFunction(e)});const m=this._options.elementCountLimit||0,g=this._options.requestByteLimit||0;if(m>0&&c>m||g>0&&f>=g){let r;r=m>0&&c>m?"The number of elements "+c+" exceeds the limit "+this._options.elementCountLimit:"The required bytes "+f+" exceeds the limit "+this._options.requestByteLimit;const n=new t.GoogleError(r);return n.code=e.Status.INVALID_ARGUMENT,l(n),{cancel:i}}const y=d.getElementCount(),v=d.getRequestByteSize();(m>0&&c+y>=m||g>0&&f+v>=g)&&(this._runNow(p),this._tasks[p]=new o.Task(a,s,this._descriptor.bundledField,this._descriptor.subresponseField),d=this._tasks[p]),d.extend(u,f,l);const b={cancel(){h._cancel(l.id)}},O=this._options.elementCountThreshold||0,w=this._options.requestByteThreshold||0;return O>0&&d.getElementCount()>=O||w>0&&d.getRequestByteSize()>=w?(this._runNow(p),b):(!(p in this._timers)&&this._options.delayThreshold>0&&(this._timers[p]=setTimeout(()=>{delete this._timers[p],this._runNow(p)},this._options.delayThreshold)),b)}_maybeClearTimeout(e){if(e in this._timers){const t=this._timers[e];delete this._timers[e],clearTimeout(t)}}_cancel(e){if(!(e in this._invocations))return;const t=this._invocations[e];if(!(t in this._tasks))return;const r=this._tasks[t];delete this._invocations[e],r.cancel(e)&&(this._maybeClearTimeout(t),delete this._tasks[t])}_runNow(e){if(!(e in this._tasks))return void(0,r.warn)("bundle_runnow_bundleid_unknown",`No such bundleid: ${e}`);this._maybeClearTimeout(e);const t=this._tasks[e];delete this._tasks[e],t.run().forEach(e=>{delete this._invocations[e]})}},bundleExecutor}function requireBundleDescriptor(){if(hasRequiredBundleDescriptor)return bundleDescriptor;hasRequiredBundleDescriptor=1,Object.defineProperty(bundleDescriptor,"__esModule",{value:!0}),bundleDescriptor.BundleDescriptor=void 0;const e=requireNormalApiCaller(),t=requireBundleApiCaller(),r=requireBundleExecutor(),n=requireUtil$2();return bundleDescriptor.BundleDescriptor=class{constructor(e,t,r,o){o||"function"!=typeof r||(o=r,r=null),this.bundledField=e,this.requestDiscriminatorFields=t.map(n.toCamelCase),this.subresponseField=r,this.byteLengthFunction=o}getApiCaller(n){return!1===n.isBundling?new e.NormalApiCaller:new t.BundleApiCaller(new r.BundleExecutor(n.bundleOptions,this))}},bundleDescriptor}function requireDescriptor(){return hasRequiredDescriptor||(hasRequiredDescriptor=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BundleDescriptor=e.StreamDescriptor=e.PageDescriptor=e.LongrunningDescriptor=void 0;var t=requireLongRunningDescriptor();Object.defineProperty(e,"LongrunningDescriptor",{enumerable:!0,get:function(){return t.LongRunningDescriptor}});var r=requirePageDescriptor();Object.defineProperty(e,"PageDescriptor",{enumerable:!0,get:function(){return r.PageDescriptor}});var n=requireStreamDescriptor();Object.defineProperty(e,"StreamDescriptor",{enumerable:!0,get:function(){return n.StreamDescriptor}});var o=requireBundleDescriptor();Object.defineProperty(e,"BundleDescriptor",{enumerable:!0,get:function(){return o.BundleDescriptor}})}(descriptor)),descriptor}var iamService={},interfaces$2={"google.iam.v1.IAMPolicy":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:2e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:2e4,total_timeout_millis:6e5}},methods:{GetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},SetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},TestIamPermissions:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}},require$$2={interfaces:interfaces$2},nested$3={google:{nested:{iam:{nested:{v1:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.Cloud.Iam.V1",go_package:"google.golang.org/genproto/googleapis/iam/v1;iam",java_multiple_files:!0,java_outer_classname:"PolicyProto",java_package:"com.google.iam.v1",php_namespace:"Google\\Cloud\\Iam\\V1"},nested:{IAMPolicy:{options:{"(google.api.default_host)":"iam-meta-api.googleapis.com"},methods:{SetIamPolicy:{requestType:"SetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:setIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:setIamPolicy",body:"*"}}]},GetIamPolicy:{requestType:"GetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:getIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:getIamPolicy",body:"*"}}]},TestIamPermissions:{requestType:"TestIamPermissionsRequest",responseType:"TestIamPermissionsResponse",options:{"(google.api.http).post":"/v1/{resource=**}:testIamPermissions","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:testIamPermissions",body:"*"}}]}}},SetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},policy:{type:"Policy",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},GetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},options:{type:"GetPolicyOptions",id:2}}},TestIamPermissionsRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},permissions:{rule:"repeated",type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TestIamPermissionsResponse:{fields:{permissions:{rule:"repeated",type:"string",id:1}}},GetPolicyOptions:{fields:{requestedPolicyVersion:{type:"int32",id:1}}},Policy:{fields:{version:{type:"int32",id:1},bindings:{rule:"repeated",type:"Binding",id:4},etag:{type:"bytes",id:3}}},Binding:{fields:{role:{type:"string",id:1},members:{rule:"repeated",type:"string",id:2},condition:{type:"google.type.Expr",id:3}}},PolicyDelta:{fields:{bindingDeltas:{rule:"repeated",type:"BindingDelta",id:1},auditConfigDeltas:{rule:"repeated",type:"AuditConfigDelta",id:2}}},BindingDelta:{fields:{action:{type:"Action",id:1},role:{type:"string",id:2},member:{type:"string",id:3},condition:{type:"google.type.Expr",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},AuditConfigDelta:{fields:{action:{type:"Action",id:1},service:{type:"string",id:2},exemptedMember:{type:"string",id:3},logType:{type:"string",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},logging:{options:{csharp_namespace:"Google.Cloud.Iam.V1.Logging",go_package:"google.golang.org/genproto/googleapis/iam/v1/logging;logging",java_multiple_files:!0,java_outer_classname:"AuditDataProto",java_package:"com.google.iam.v1.logging"},nested:{AuditData:{fields:{policyDelta:{type:"google.iam.v1.PolicyDelta",id:2}}}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ResourceProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"},fieldBehavior:{rule:"repeated",type:"google.api.FieldBehavior",id:1052,extend:"google.protobuf.FieldOptions"},FieldBehavior:{values:{FIELD_BEHAVIOR_UNSPECIFIED:0,OPTIONAL:1,REQUIRED:2,OUTPUT_ONLY:3,INPUT_ONLY:4,IMMUTABLE:5}},resourceReference:{type:"google.api.ResourceReference",id:1055,extend:"google.protobuf.FieldOptions"},resourceDefinition:{rule:"repeated",type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.FileOptions"},resource:{type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.MessageOptions"},ResourceDescriptor:{fields:{type:{type:"string",id:1},pattern:{rule:"repeated",type:"string",id:2},nameField:{type:"string",id:3},history:{type:"History",id:4},plural:{type:"string",id:5},singular:{type:"string",id:6}},nested:{History:{values:{HISTORY_UNSPECIFIED:0,ORIGINALLY_SINGLE_PATTERN:1,FUTURE_MULTI_PATTERN:2}}}},ResourceReference:{fields:{type:{type:"string",id:1},childType:{type:"string",id:2}}}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}},type:{options:{go_package:"google.golang.org/genproto/googleapis/type/expr;expr",java_multiple_files:!0,java_outer_classname:"ExprProto",java_package:"com.google.type",objc_class_prefix:"GTP"},nested:{Expr:{fields:{expression:{type:"string",id:1},title:{type:"string",id:2},description:{type:"string",id:3},location:{type:"string",id:4}}}}}}}},require$$5$1={nested:nested$3},hasRequiredIamService;function requireIamService(){if(hasRequiredIamService)return iamService;hasRequiredIamService=1,Object.defineProperty(iamService,"__esModule",{value:!0}),iamService.IamClient=void 0;const e=requireCreateApiCall(),t=requireRoutingHeader(),r=require$$2,n=requireFallback();let o=require$$19.version;const i=require$$5$1;return iamService.IamClient=class{constructor(e,t){this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{}},this.innerApiCalls={},this.gaxGrpc=e;const a=Object.assign({servicePath:t.servicePath,port:t.port,clientConfig:t.clientConfig,apiEndpoint:t.apiEndpoint,fallback:t.fallback},t);o=a.fallback?n.version:o,a.scopes=this.constructor.scopes,this._opts=a,this.auth=e.auth;const s=[`gax/${o}`,`gapic/${o}`];"undefined"!=typeof process&&"versions"in process?s.push(`gl-node/${process.versions.node}`):s.push(`gl-web/${o}`),a.fallback||s.push(`grpc/${e.grpcVersion}`),a.libName&&a.libVersion&&s.push(`${a.libName}/${a.libVersion}`),this._protos=this.gaxGrpc.loadProtoJSON(i),this._defaults=e.constructSettings("google.iam.v1.IAMPolicy",r,a.clientConfig||{},{"x-goog-api-client":s.join(" ")}),this.innerApiCalls={}}initialize(){if(this.iamPolicyStub)return this.iamPolicyStub;this.iamPolicyStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.iam.v1.IAMPolicy"):this._protos.google.iam.v1.IAMPolicy,this._opts);const t=["getIamPolicy","setIamPolicy","testIamPermissions"];for(const r of t){const t=this.iamPolicyStub.then(e=>(...t)=>{if(this._terminated)return Promise.reject("The client has already been closed.");return e[r].apply(e,t)},e=>()=>{throw e});this.innerApiCalls[r]=(0,e.createApiCall)(t,this._defaults[r],this.descriptors.page[r])}return this.iamPolicyStub}static get servicePath(){return"cloudkms.googleapis.com"}static get apiEndpoint(){return"cloudkms.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudkms"]}getProjectId(e){return this.auth&&"getProjectId"in this.auth?this.auth.getProjectId(e):e?void e(new Error("Cannot determine project ID.")):Promise.reject("Cannot determine project ID.")}getIamPolicy(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.getIamPolicy(e,o,n)}setIamPolicy(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.setIamPolicy(e,o,n)}testIamPermissions(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.testIamPermissions(e,o,n)}close(){return this.initialize(),this._terminated?Promise.resolve():this.iamPolicyStub.then(e=>{this._terminated=!0,e.close()})}},iamService}var locationService={},nested$2={google:{nested:{cloud:{nested:{location:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/cloud/location;location",java_multiple_files:!0,java_outer_classname:"LocationsProto",java_package:"com.google.cloud.location"},nested:{Locations:{options:{"(google.api.default_host)":"cloud.googleapis.com","(google.api.oauth_scopes)":"https://www.googleapis.com/auth/cloud-platform"},methods:{ListLocations:{requestType:"ListLocationsRequest",responseType:"ListLocationsResponse",options:{"(google.api.http).get":"/v1/{name=locations}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*}/locations"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations}",additional_bindings:{get:"/v1/{name=projects/*}/locations"}}}]},GetLocation:{requestType:"GetLocationRequest",responseType:"Location",options:{"(google.api.http).get":"/v1/{name=locations/*}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*/locations/*}"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations/*}",additional_bindings:{get:"/v1/{name=projects/*/locations/*}"}}}]}}},ListLocationsRequest:{fields:{name:{type:"string",id:1},filter:{type:"string",id:2},pageSize:{type:"int32",id:3},pageToken:{type:"string",id:4}}},ListLocationsResponse:{fields:{locations:{rule:"repeated",type:"Location",id:1},nextPageToken:{type:"string",id:2}}},GetLocationRequest:{fields:{name:{type:"string",id:1}}},Location:{fields:{name:{type:"string",id:1},locationId:{type:"string",id:4},displayName:{type:"string",id:5},labels:{keyType:"string",type:"string",id:2},metadata:{type:"google.protobuf.Any",id:3}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}}}}},require$$5={nested:nested$2},interfaces$1={"google.cloud.location.Locations":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{ListLocations:{retry_codes_name:"non_idempotent",retry_params_name:"default"},GetLocation:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}},require$$6={interfaces:interfaces$1},hasRequiredLocationService,hasRequiredFallback;function requireLocationService(){if(hasRequiredLocationService)return locationService;hasRequiredLocationService=1,Object.defineProperty(locationService,"__esModule",{value:!0}),locationService.LocationsClient=void 0;const e=requireGax(),t=requireWarnings(),r=requireCreateApiCall(),n=requireRoutingHeader(),o=requirePageDescriptor(),i=require$$5,a=require$$6,s=require$$19.version;return locationService.LocationsClient=class{constructor(e,r){var n,l;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}},this.gaxGrpc=e;const p=this.constructor,d=(null==r?void 0:r.servicePath)||(null==r?void 0:r.apiEndpoint)||p.servicePath;this._providedCustomServicePath=!(!(null==r?void 0:r.servicePath)&&!(null==r?void 0:r.apiEndpoint));const u=(null==r?void 0:r.port)||p.port,c=null!==(n=null==r?void 0:r.clientConfig)&&void 0!==n?n:{},f=null!==(l=null==r?void 0:r.fallback)&&void 0!==l?l:"undefined"!=typeof window&&"function"==typeof(null===window||void 0===window?void 0:window.fetch);r=Object.assign({servicePath:d,port:u,clientConfig:c,fallback:f},r),d===p.servicePath||"scopes"in r||(r.scopes=p.scopes),this._opts=r,this.auth=e.auth,d===p.servicePath&&(this.auth.defaultScopes=p.scopes);const h=[`gax/${s}`,`gapic/${s}`];"undefined"!=typeof process&&"versions"in process?h.push(`gl-node/${process.versions.node}`):h.push(`gl-web/${s}`),r.fallback?"rest"===r.fallback&&h.push(`rest/${e.grpcVersion}`):h.push(`grpc/${e.grpcVersion}`),r.libName&&r.libVersion&&h.push(`${r.libName}/${r.libVersion}`),this._protos=e.loadProtoJSON(i),this.descriptors.page={listLocations:new o.PageDescriptor("pageToken","nextPageToken","locations")},this._defaults=e.constructSettings("google.cloud.location.Locations",a,r.clientConfig||{},{"x-goog-api-client":h.join(" ")}),this.innerApiCalls={},this.warn=t.warn}initialize(){if(this.locationsStub)return this.locationsStub;this.locationsStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.cloud.location.Locations"):this._protos.google.cloud.location.Locations,this._opts,this._providedCustomServicePath);const e=["listLocations","getLocation"];for(const t of e){const e=this.locationsStub.then(e=>(...r)=>{if(this._terminated)return Promise.reject("The client has already been closed.");return e[t].apply(e,r)},e=>()=>{throw e}),n=this.descriptors.page[t]||void 0,o=(0,r.createApiCall)(e,this._defaults[t],n);this.innerApiCalls[t]=o}return this.locationsStub}static get servicePath(){return"cloud.googleapis.com"}static get apiEndpoint(){return"cloud.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform"]}getProjectId(e){if(!e)return this.auth.getProjectId();this.auth.getProjectId(e)}getLocation(e,t,r){let o;return e=e||{},"function"==typeof t&&void 0===r?(r=t,o={}):o=t,o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.getLocation(e,o,r)}listLocations(e,t,r){let o;return e=e||{},"function"==typeof t&&void 0===r?(r=t,o={}):o=t,o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.listLocations(e,o,r)}listLocationsAsync(t,r){t=t||{},(r=r||{}).otherArgs=r.otherArgs||{},r.otherArgs.headers=r.otherArgs.headers||{},r.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:t.name||""}),r=r||{};const o=new e.CallSettings(r);return this.initialize(),this.descriptors.page.listLocations.asyncIterate(this.innerApiCalls.listLocations,t,o)}close(){return this.initialize(),this._terminated?Promise.resolve():this.locationsStub.then(e=>{this._terminated=!0,e.close()})}},locationService}function requireFallback(){return hasRequiredFallback||(hasRequiredFallback=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=t.GoogleError=t.operation=t.Operation=t.warn=t.protobufMinimal=t.protobuf=t.LocationProtos=t.IamProtos=t.operationsProtos=t.GrpcClient=t.defaultToObjectOptions=t.makeUUID=t.LocationsClient=t.IamClient=t.OperationsClient=t.StreamType=t.StreamDescriptor=t.PageDescriptor=t.LongrunningDescriptor=t.BundleDescriptor=t.version=t.createDefaultBackoffSettings=t.RetryOptions=t.constructSettings=t.CallSettings=t.routingHeader=t.PathTemplate=void 0,t.lro=function(e){(e=Object.assign({scopes:[]},e)).protoJson&&(e=Object.assign(e,{fallback:!0}));const t=new C(e);return new l.OperationsClientBuilder(t,e.protoJson)},t.createApiCall=function(e,t,r,n){if(r&&"streaming"in r&&r.type!==f.StreamType.SERVER_STREAMING)return()=>{throw new Error("The REST transport currently does not support client-streaming or bidi-stream calls.")};if(r&&"streaming"in r&&!(0,u.isNodeJS)())return()=>{throw new Error("Server streaming over the REST transport is only supported in Node.js.")};return(0,p.createApiCall)(e,t,r)};const r=requireObjectHash(),n=requireProtobufjs();t.protobuf=n;const o=requireGax(),i=requireRoutingHeader();t.routingHeader=i;const a=requireStatus(),s=require$$3__default.default,l=requireOperationsClient(),p=requireCreateApiCall(),d=requireFallbackRest(),u=requireFeatureDetection(),c=requireFallbackServiceStub(),f=requireStreaming(),h=requireUtil$2(),m=requireIam_service();t.IamProtos=m;const g=requireLocations();t.LocationProtos=g;const y=requireOperations();t.operationsProtos=y;var v=requirePathTemplate();Object.defineProperty(t,"PathTemplate",{enumerable:!0,get:function(){return v.PathTemplate}});var b=requireGax();Object.defineProperty(t,"CallSettings",{enumerable:!0,get:function(){return b.CallSettings}}),Object.defineProperty(t,"constructSettings",{enumerable:!0,get:function(){return b.constructSettings}}),Object.defineProperty(t,"RetryOptions",{enumerable:!0,get:function(){return b.RetryOptions}}),Object.defineProperty(t,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return b.createDefaultBackoffSettings}}),t.version=require$$19.version+"-fallback";var O=requireDescriptor();Object.defineProperty(t,"BundleDescriptor",{enumerable:!0,get:function(){return O.BundleDescriptor}}),Object.defineProperty(t,"LongrunningDescriptor",{enumerable:!0,get:function(){return O.LongrunningDescriptor}}),Object.defineProperty(t,"PageDescriptor",{enumerable:!0,get:function(){return O.PageDescriptor}}),Object.defineProperty(t,"StreamDescriptor",{enumerable:!0,get:function(){return O.StreamDescriptor}});var w=requireStreaming();Object.defineProperty(t,"StreamType",{enumerable:!0,get:function(){return w.StreamType}});var S=requireOperationsClient();Object.defineProperty(t,"OperationsClient",{enumerable:!0,get:function(){return S.OperationsClient}});var _=requireIamService();Object.defineProperty(t,"IamClient",{enumerable:!0,get:function(){return _.IamClient}});var P=requireLocationService();Object.defineProperty(t,"LocationsClient",{enumerable:!0,get:function(){return P.LocationsClient}});var E=requireUtil$2();Object.defineProperty(t,"makeUUID",{enumerable:!0,get:function(){return E.makeUUID}}),t.defaultToObjectOptions={keepCase:!1,longs:String,enums:String,defaults:!0,oneofs:!0};const T="x-goog-api-client";class C{static clearProtoCache(){C.protoCache.clear()}constructor(e={}){var t;if((0,u.isNodeJS)())this.auth=e.auth||new s.GoogleAuth(e);else{if(!e.auth)throw new Error(JSON.stringify(e)+"You need to pass auth instance to use gRPC-fallback client in browser or other non-Node.js environments. Use OAuth2Client from google-auth-library.");this.auth=e.auth}this.fallback=!!e.fallback,this.grpcVersion=require$$19.version,this.httpRules=e.httpRules,this.numericEnums=null!==(t=e.numericEnums)&&void 0!==t&&t}loadProto(e){return n.Root.fromJSON(e)}loadProtoJSON(e,t=!1){const o=r(JSON.stringify(e)).toString(),i=C.protoCache.get(o);if(i&&!t)return i;const a=n.Root.fromJSON(e);return C.protoCache.set(o,a),a}static getServiceMethods(e){const t={};for(const[r,n]of Object.entries(e.methods)){t[(0,h.toLowerCamelCase)(r)]=n}return t}constructSettings(e,r,n,i){return o.constructSettings(e,r,n,a.Status,{metadataBuilder:function(e,r){const n={};i||(i={});for(const e in i)n[e]=Array.isArray(i[e])?i[e]:[i[e]];const o=[];if(n[T]&&n[T][0]&&o.push(...n[T][0].split(" ")),o.push(`grpc-web/${t.version}`),n[T]=[o.join(" ")],!r)return n;for(const e in r)if(e.toLowerCase()!==T){const t=r[e];if(Array.isArray(t))if(void 0===n[e])n[e]=t;else{if(!Array.isArray(n[e]))throw new Error(`Can not add value ${t} to the call metadata.`);n[e].push(...t)}else n[e]=[t]}return n}})}async createStub(e,t,r){if(this.authClient||(this.auth&&"getClient"in this.auth?this.authClient=await this.auth.getClient():this.auth&&"getRequestHeaders"in this.auth&&(this.authClient=this.auth)),!this.authClient)throw new Error("No authentication was provided");if(t.universeDomain||(t.universeDomain="googleapis.com"),t.universeDomain){const e=this.authClient.universeDomain;if(e&&t.universeDomain!==e)throw new Error(`The configured universe domain (${t.universeDomain}) does not match the universe domain found in the credentials (${e}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`)}e.resolveAll();const n=C.getServiceMethods(e),o=t.protocol||"https";let i,a=t.servicePath;if(!a&&e.options&&e.options["(google.api.default_host)"]&&(a=e.options["(google.api.default_host)"]),!a)throw new Error(`Cannot determine service API path for service ${e.name}.`);const s=a.match(/^(.*):(\d+)$/);s&&(a=s[1],i=parseInt(s[2])),t.port?i=t.port:i||(i=443);const l=d.encodeRequest,p=d.decodeResponse;return(0,c.generateServiceStub)(n,o,a,i,this.authClient,l,p,this.numericEnums)}static createByteLengthFunction(e){return o.createByteLengthFunction(e)}}t.GrpcClient=C,C.protoCache=new Map,t.protobufMinimal=requireMinimal();var R=requireWarnings();Object.defineProperty(t,"warn",{enumerable:!0,get:function(){return R.warn}});var D=requireLongrunning();Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return D.Operation}}),Object.defineProperty(t,"operation",{enumerable:!0,get:function(){return D.operation}});var x=requireGoogleError();Object.defineProperty(t,"GoogleError",{enumerable:!0,get:function(){return x.GoogleError}});const k=e.exports;t.fallback=k}(fallback,fallback.exports)),fallback.exports}var nested$1={google:{nested:{protobuf:{nested:{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/errdetails;errdetails",java_multiple_files:!0,java_outer_classname:"ErrorDetailsProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}},RetryInfo:{fields:{retryDelay:{type:"google.protobuf.Duration",id:1}}},DebugInfo:{fields:{stackEntries:{rule:"repeated",type:"string",id:1},detail:{type:"string",id:2}}},QuotaFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{subject:{type:"string",id:1},description:{type:"string",id:2}}}}},ErrorInfo:{fields:{reason:{type:"string",id:1},domain:{type:"string",id:2},metadata:{keyType:"string",type:"string",id:3}}},PreconditionFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{type:{type:"string",id:1},subject:{type:"string",id:2},description:{type:"string",id:3}}}}},BadRequest:{fields:{fieldViolations:{rule:"repeated",type:"FieldViolation",id:1}},nested:{FieldViolation:{fields:{field:{type:"string",id:1},description:{type:"string",id:2}}}}},RequestInfo:{fields:{requestId:{type:"string",id:1},servingData:{type:"string",id:2}}},ResourceInfo:{fields:{resourceType:{type:"string",id:1},resourceName:{type:"string",id:2},owner:{type:"string",id:3},description:{type:"string",id:4}}},Help:{fields:{links:{rule:"repeated",type:"Link",id:1}},nested:{Link:{fields:{description:{type:"string",id:1},url:{type:"string",id:2}}}}},LocalizedMessage:{fields:{locale:{type:"string",id:1},message:{type:"string",id:2}}}}}}}},require$$4$1={nested:nested$1},hasRequiredGoogleError,hasRequiredCall,hasRequiredNormalApiCaller,hasRequiredApiCaller;function requireGoogleError(){if(hasRequiredGoogleError)return googleError;hasRequiredGoogleError=1,Object.defineProperty(googleError,"__esModule",{value:!0}),googleError.GoogleErrorDecoder=googleError.GoogleError=void 0;const e=requireStatus(),t=requireProtobufjs(),r=requireSrc$3(),n=requireFallback();class o extends Error{static parseGRPCStatusDetails(e){const t=new i;try{if(e.metadata&&e.metadata.get("grpc-status-details-bin")){const r=t.decodeGRPCStatusDetails(e.metadata.get("grpc-status-details-bin"));r&&r.details&&r.details.length>0&&(e.statusDetails=r.details),r&&r.errorInfo&&(e.reason=r.errorInfo.reason,e.domain=r.errorInfo.domain,e.errorInfoMetadata=r.errorInfo.metadata)}}catch(e){}return e}static parseHttpError(t){Array.isArray(t)&&(t=t.find(e=>"error"in e)),t.error||(t.error={},Object.keys(t).filter(e=>"error"!==e).forEach(e=>{t.error[e]=t[e],delete t[e]}));const r=new i,n=r.decodeHTTPError(t.error),a=Object.assign(new o(t.error.message),n);if(t.error.code?a.code=(0,e.rpcCodeFromHttpStatusCode)(t.error.code):delete a.code,a.details)try{const e=r.decodeHttpStatusDetails(a.details);e&&e.details&&e.details.length>0&&(a.statusDetails=e.details),e&&e.errorInfo&&(a.reason=e.errorInfo.reason,a.domain=e.errorInfo.domain,a.errorInfoMetadata=e.errorInfo.metadata)}catch(e){}return a}}googleError.GoogleError=o;class i{constructor(){const e=require$$4$1;this.root=t.Root.fromJSON(e),this.anyType=this.root.lookupType("google.protobuf.Any"),this.statusType=this.root.lookupType("google.rpc.Status")}decodeProtobufAny(e){const t=e.type_url.match(/^type.googleapis.com\/(.*)/);if(!t)throw new Error(`Unknown type encoded in google.protobuf.any: ${e.type_url}`);const r=t[1],n=this.root.lookupType(r);if(!n)throw new Error(`Cannot lookup type ${r}`);return n.decode(e.value)}decodeRpcStatus(e){const t=new Uint8Array(e),r=this.statusType.decode(t),n=[];let o;for(const e of r.details)try{const t=this.decodeProtobufAny(e);n.push(t),"type.googleapis.com/google.rpc.ErrorInfo"===e.type_url&&(o=t)}catch(e){}return{code:r.code,message:r.message,statusDetails:n,reason:null==o?void 0:o.reason,domain:null==o?void 0:o.domain,errorInfoMetadata:null==o?void 0:o.metadata}}callErrorFromStatus(t){return t.message=`${t.code} ${e.Status[t.code]}: ${t.message}`,Object.assign(new o(t.message),t)}decodeErrorFromBuffer(e){return this.callErrorFromStatus(this.decodeRpcStatus(e))}decodeGRPCStatusDetails(e){const t=[];let r;e.forEach(e=>{const n=new Uint8Array(e),o=this.statusType.decode(n);for(const e of o.details)try{const n=this.decodeProtobufAny(e);t.push(n),"type.googleapis.com/google.rpc.ErrorInfo"===e.type_url&&(r=n)}catch(e){}});return{details:t,errorInfo:r}}decodeHTTPError(e){const t=r.fromProto3JSON(this.statusType,e);if(!t)throw new Error(`Received error message ${e}, but failed to serialize as proto3 message`);return this.statusType.toObject(t,n.defaultToObjectOptions)}decodeHttpStatusDetails(e){const t=[];let r;for(const n of e)try{const e=this.decodeProtobufAny(n);t.push(e),"type.googleapis.com/google.rpc.ErrorInfo"===n.type_url&&(r=e)}catch(e){}return{details:t,errorInfo:r}}}return googleError.GoogleErrorDecoder=i,googleError}function requireCall(){if(hasRequiredCall)return call;hasRequiredCall=1,Object.defineProperty(call,"__esModule",{value:!0}),call.OngoingCallPromise=call.OngoingCall=void 0;const e=requireStatus(),t=requireGoogleError();class r{constructor(e){this.callback=e,this.completed=!1}cancel(){if(!this.completed)if(this.completed=!0,this.cancelFunc)this.cancelFunc();else{const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,this.callback(r)}}call(e,r){if(this.completed)return;const n=e(r,(e,t,r,n)=>{this.completed=!0,setImmediate(this.callback,e,t,r,n)});n instanceof Promise&&n.catch(e=>{setImmediate(this.callback,new t.GoogleError(e),null,null,null)}),this.cancelFunc=()=>n.cancel()}}call.OngoingCall=r;return call.OngoingCallPromise=class extends r{constructor(){let e,r;const n=new Promise((t,n)=>{e=t,r=n});super((n,o,i,a)=>{if(n)n.metadata?r(t.GoogleError.parseGRPCStatusDetails(n)):r(n);else{if(void 0===o)throw new t.GoogleError("Neither error nor response are defined");e([o,i||null,a||null])}}),this.promise=n,this.promise.cancel=()=>{this.cancel()}}},call}function requireNormalApiCaller(){if(hasRequiredNormalApiCaller)return normalApiCaller;hasRequiredNormalApiCaller=1,Object.defineProperty(normalApiCaller,"__esModule",{value:!0}),normalApiCaller.NormalApiCaller=void 0;const e=requireCall();return normalApiCaller.NormalApiCaller=class{init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,t,r,n){n.call(e,t)}fail(e,t){e.callback(t)}result(e){return e.promise}},normalApiCaller}function requireApiCaller(){if(hasRequiredApiCaller)return apiCaller;hasRequiredApiCaller=1,Object.defineProperty(apiCaller,"__esModule",{value:!0}),apiCaller.createAPICaller=function(t,r){if(!r)return new e.NormalApiCaller;return r.getApiCaller(t)};const e=requireNormalApiCaller();return apiCaller}var retries={},timeout={},hasRequiredTimeout,hasRequiredRetries,hasRequiredCreateApiCall;function requireTimeout(){if(hasRequiredTimeout)return timeout;return hasRequiredTimeout=1,Object.defineProperty(timeout,"__esModule",{value:!0}),timeout.addTimeoutArg=function(e,t,r,n){return(o,i)=>{const a=new Date,s=r.options||{};s.deadline=new Date(a.getTime()+t);const l=r.metadataBuilder?r.metadataBuilder(n,r.headers||{}):null;return e(o,l,s,i)}},timeout}function requireRetries(){if(hasRequiredRetries)return retries;hasRequiredRetries=1,Object.defineProperty(retries,"__esModule",{value:!0}),retries.retryable=function(n,o,i,a){const s=o.backoffSettings.retryDelayMultiplier,l=o.backoffSettings.maxRetryDelayMillis,p=o.backoffSettings.rpcTimeoutMultiplier,d=o.backoffSettings.maxRpcTimeoutMillis;let u=o.backoffSettings.initialRetryDelayMillis,c=o.backoffSettings.initialRpcTimeoutMillis;return(f,h)=>{let m,g,y,v=new Date;o.backoffSettings.totalTimeoutMillis&&(y=v.getTime()+o.backoffSettings.totalTimeoutMillis);let b=0;const O=o.backoffSettings.maxRetries;if(O&&y){const r=new t.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");r.code=e.Status.INVALID_ARGUMENT,h(r)}else!function w(S){if(g=null,y&&v.getTime()>=y){const r=new t.GoogleError(`Total timeout of API ${a} exceeded ${o.backoffSettings.totalTimeoutMillis} milliseconds ${S?`retrying error ${S} `:""} before any response was received.`);return r.code=e.Status.DEADLINE_EXCEEDED,void h(r)}if(b&&b>=O){const r=new t.GoogleError("Exceeded maximum number of retries "+(S?`retrying error ${S} `:"")+"before any response was received");return r.code=e.Status.DEADLINE_EXCEEDED,void h(r)}b++;let _=S;const P=(0,r.addTimeoutArg)(n,c,i);m=P(f,(e,t,r,n)=>{if(e&&4!==e.code&&(_=e),e)if(m=null,o.retryCodes.length>0&&o.retryCodes.indexOf(e.code)<0)e.note="Exception occurred in retry method that was not classified as transient",h(e);else{const e=Math.random()*u;g=setTimeout(()=>{v=new Date,u=Math.min(u*s,l);const e=c&&p?c*p:0,t=d||0,r=y?y-v.getTime():0;c=Math.min(e,t,r),w(_)},e)}else h(null,t,r,n)}),m instanceof Promise&&m.catch(e=>{h(new t.GoogleError(e))})}();return{cancel(){if(g&&clearTimeout(g),m)m.cancel();else{const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,h(r)}}}}};const e=requireStatus(),t=requireGoogleError(),r=requireTimeout();return retries}function requireCreateApiCall(){if(hasRequiredCreateApiCall)return createApiCall;hasRequiredCreateApiCall=1,Object.defineProperty(createApiCall,"__esModule",{value:!0}),createApiCall.createApiCall=function(a,s,l,p){const d="function"==typeof a?Promise.resolve(a):a,u=(0,e.createAPICaller)(s,l);return(a,l,p)=>{var c,f;let h,m=u;if(m instanceof o.StreamingApiCaller){const e=null!==(f=null===(c=m.descriptor)||void 0===c?void 0:c.gaxStreamingRetries)&&void 0!==f&&f,r=(0,t.convertRetryOptions)(l,e);h=s.merge(r)}else h=s.merge(l);s.isBundling&&!h.isBundling&&(m=(0,e.createAPICaller)(s,void 0));const g=m.init(p);return d.then(e=>{var t,o,a;e=m.wrap(e);const s=null===(t=m.descriptor)||void 0===t?void 0:t.streaming,l=h.retry;if(s&&l&&(l.retryCodes.length>0&&l.shouldRetryFn&&((0,i.warn)("either_retrycodes_or_shouldretryfn","Only one of retryCodes or shouldRetryFn may be defined. Ignoring retryCodes."),l.retryCodes=[]),!m.descriptor.gaxStreamingRetries&&l.getResumptionRequestFn))throw new Error("getResumptionRequestFn can only be used when gaxStreamingRetries is set to true.");if(!s&&l){if(l.shouldRetryFn)throw new Error("Using a function to determine retry eligibility is only supported with server streaming calls");if(l.getResumptionRequestFn)throw new Error("Resumption strategy can only be used with server streaming retries");if(l.retryCodes&&l.retryCodes.length>0)return null!==(o=(a=l.backoffSettings).initialRpcTimeoutMillis)&&void 0!==o||(a.initialRpcTimeoutMillis=h.timeout),(0,r.retryable)(e,h.retry,h.otherArgs,h.apiName)}return(0,n.addTimeoutArg)(e,h.timeout,h.otherArgs)}).then(e=>{m.call(e,a,h,g)}).catch(e=>{m.fail(g,e)}),m.result(g)}};const e=requireApiCaller(),t=requireGax(),r=requireRetries(),n=requireTimeout(),o=requireStreamingApiCaller(),i=requireWarnings();return createApiCall}var interfaces={"google.longrunning.Operations":{retry_codes:{idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"],non_idempotent:[]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:9e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:9e4,total_timeout_millis:6e5}},methods:{GetOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},ListOperations:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},CancelOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},DeleteOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"}}}},require$$3={interfaces:interfaces},nested={google:{nested:{longrunning:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.LongRunning",go_package:"google.golang.org/genproto/googleapis/longrunning;longrunning",java_multiple_files:!0,java_outer_classname:"OperationsProto",java_package:"com.google.longrunning",php_namespace:"Google\\LongRunning"},nested:{operationInfo:{type:"google.longrunning.OperationInfo",id:1049,extend:"google.protobuf.MethodOptions"},Operations:{options:{"(google.api.default_host)":"longrunning.googleapis.com"},methods:{ListOperations:{requestType:"ListOperationsRequest",responseType:"ListOperationsResponse",options:{"(google.api.http).get":"/v1/{name=operations}","(google.api.method_signature)":"name,filter"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=operations}"}},{"(google.api.method_signature)":"name,filter"}]},GetOperation:{requestType:"GetOperationRequest",responseType:"Operation",options:{"(google.api.http).get":"/v1/operations/{name}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1/operations/{name}"}},{"(google.api.method_signature)":"name"}]},DeleteOperation:{requestType:"DeleteOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).delete":"/v1/{name=operations/**}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{delete:"/v1/{name=operations/**}"}},{"(google.api.method_signature)":"name"}]},CancelOperation:{requestType:"CancelOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).post":"/v1/{name=operations/**}:cancel","(google.api.http).body":"*","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{post:"/v1/{name=operations/**}:cancel",body:"*"}},{"(google.api.method_signature)":"name"}]},WaitOperation:{requestType:"WaitOperationRequest",responseType:"Operation"}}},Operation:{oneofs:{result:{oneof:["error","response"]}},fields:{name:{type:"string",id:1},metadata:{type:"google.protobuf.Any",id:2},done:{type:"bool",id:3},error:{type:"google.rpc.Status",id:4},response:{type:"google.protobuf.Any",id:5}}},GetOperationRequest:{fields:{name:{type:"string",id:1}}},ListOperationsRequest:{fields:{name:{type:"string",id:4},filter:{type:"string",id:1},pageSize:{type:"int32",id:2},pageToken:{type:"string",id:3}}},ListOperationsResponse:{fields:{operations:{rule:"repeated",type:"Operation",id:1},nextPageToken:{type:"string",id:2}}},CancelOperationRequest:{fields:{name:{type:"string",id:1}}},DeleteOperationRequest:{fields:{name:{type:"string",id:1}}},WaitOperationRequest:{fields:{name:{type:"string",id:1},timeout:{type:"google.protobuf.Duration",id:2}}},OperationInfo:{fields:{responseType:{type:"string",id:1},metadataType:{type:"string",id:2}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}},Empty:{fields:{}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/status;status",java_multiple_files:!0,java_outer_classname:"StatusProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}}}}}}},require$$4={nested:nested},hasRequiredOperationsClient,hasRequiredSrc$2;function requireOperationsClient(){return hasRequiredOperationsClient||(hasRequiredOperationsClient=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OperationsClientBuilder=e.OperationsClient=e.ALL_SCOPES=e.SERVICE_ADDRESS=void 0;const t=requireCreateApiCall(),r=requireDescriptor(),n=requireGax(),o=require$$3,i=require$$4,a=requireTranscoding();e.SERVICE_ADDRESS="longrunning.googleapis.com";const s=require$$19.version;e.ALL_SCOPES=[];class l{constructor(n,i,a){const l=Object.assign({servicePath:e.SERVICE_ADDRESS,port:443,clientConfig:{}},a),p=["gl-node/"+process.versions.node];l.libName&&l.libVersion&&p.push(l.libName+"/"+l.libVersion),p.push("gapic/0.7.1","gax/"+s),l.fallback?p.push("gl-web/"+s):p.push("grpc/"+n.grpcVersion);const d=n.constructSettings("google.longrunning.Operations",o,l.clientConfig||{},{"x-goog-api-client":p.join(" ")});this.auth=n.auth,this.innerApiCalls={},this.descriptor={listOperations:new r.PageDescriptor("pageToken","nextPageToken","operations")},this.operationsStub=n.createStub(l.fallback?i.lookupService("google.longrunning.Operations"):i.google.longrunning.Operations,l);const u=["getOperation","listOperations","cancelOperation","deleteOperation"];for(const e of u){const r=this.operationsStub.then(t=>(...r)=>t[e].apply(t,r),e=>()=>{throw e});this.innerApiCalls[e]=(0,t.createApiCall)(r,d[e],this.descriptor[e])}}close(){this.operationsStub.then(e=>e.close())}getProjectId(e){return this.auth&&"getProjectId"in this.auth?this.auth.getProjectId(e):e?void e(new Error("Cannot determine project ID.")):Promise.reject("Cannot determine project ID.")}getOperationInternal(e,t,r){return e=e||{},t=t||{},this.innerApiCalls.getOperation(e,t,r)}getOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.getOperation(e,n,r)}listOperations(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.listOperations(e,n,r)}listOperationsStream(e,t){const r=new n.CallSettings(t);return this.descriptor.listOperations.createStream(this.innerApiCalls.listOperations,e,r)}listOperationsAsync(e,t){e=e||{},t=t||{};const r=new n.CallSettings(t);return this.descriptor.listOperations.asyncIterate(this.innerApiCalls.listOperations,e,r)}cancelOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.cancelOperation(e,n,r)}deleteOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.deleteOperation(e,n,r)}}e.OperationsClient=l;e.OperationsClientBuilder=class{constructor(e,t){t&&e.httpRules&&(0,a.overrideHttpRules)(e.httpRules,t);const r=null!=t?t:e.loadProtoJSON(i);this.operationsClient=t=>(e.fallback&&(t.fallback=e.fallback),new l(e,r,t)),Object.assign(this.operationsClient,l)}}}(operationsClient)),operationsClient}function requireSrc$2(){return hasRequiredSrc$2||(hasRequiredSrc$2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializer=e.warn=e.ChannelCredentials=e.makeUUID=e.fallback=e.protobufMinimal=e.protobuf=e.version=e.createByteLengthFunction=e.LocationsClient=e.IamClient=e.OperationsClient=e.LocationProtos=e.IamProtos=e.operationsProtos=e.routingHeader=e.StreamType=e.Status=e.PathTemplate=e.operation=e.Operation=e.GrpcClient=e.GoogleProtoFilesRoot=e.ClientStub=e.GoogleError=e.createMaxRetriesBackoffSettings=e.createDefaultBackoffSettings=e.createBackoffSettings=e.createBundleOptions=e.createRetryOptions=e.RetryOptions=e.constructSettings=e.CallSettings=e.StreamDescriptor=e.PageDescriptor=e.LongrunningDescriptor=e.BundleDescriptor=e.createApiCall=e.OngoingCall=e.grpc=e.GoogleAuth=void 0,e.lro=b;const t=requireSrc$5();e.grpc=t;const r=requireGrpc(),n=requireIam_service();e.IamProtos=n;const o=requireLocations();e.LocationProtos=o;const i=requireOperations();e.operationsProtos=i;const a=requireOperationsClient(),s=requireRoutingHeader();e.routingHeader=s;var l=require$$3__default.default;Object.defineProperty(e,"GoogleAuth",{enumerable:!0,get:function(){return l.GoogleAuth}});var p=requireCall();Object.defineProperty(e,"OngoingCall",{enumerable:!0,get:function(){return p.OngoingCall}});var d=requireCreateApiCall();Object.defineProperty(e,"createApiCall",{enumerable:!0,get:function(){return d.createApiCall}});var u=requireDescriptor();Object.defineProperty(e,"BundleDescriptor",{enumerable:!0,get:function(){return u.BundleDescriptor}}),Object.defineProperty(e,"LongrunningDescriptor",{enumerable:!0,get:function(){return u.LongrunningDescriptor}}),Object.defineProperty(e,"PageDescriptor",{enumerable:!0,get:function(){return u.PageDescriptor}}),Object.defineProperty(e,"StreamDescriptor",{enumerable:!0,get:function(){return u.StreamDescriptor}});var c=requireGax();Object.defineProperty(e,"CallSettings",{enumerable:!0,get:function(){return c.CallSettings}}),Object.defineProperty(e,"constructSettings",{enumerable:!0,get:function(){return c.constructSettings}}),Object.defineProperty(e,"RetryOptions",{enumerable:!0,get:function(){return c.RetryOptions}}),Object.defineProperty(e,"createRetryOptions",{enumerable:!0,get:function(){return c.createRetryOptions}}),Object.defineProperty(e,"createBundleOptions",{enumerable:!0,get:function(){return c.createBundleOptions}}),Object.defineProperty(e,"createBackoffSettings",{enumerable:!0,get:function(){return c.createBackoffSettings}}),Object.defineProperty(e,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return c.createDefaultBackoffSettings}}),Object.defineProperty(e,"createMaxRetriesBackoffSettings",{enumerable:!0,get:function(){return c.createMaxRetriesBackoffSettings}});var f=requireGoogleError();Object.defineProperty(e,"GoogleError",{enumerable:!0,get:function(){return f.GoogleError}});var h=requireGrpc();Object.defineProperty(e,"ClientStub",{enumerable:!0,get:function(){return h.ClientStub}}),Object.defineProperty(e,"GoogleProtoFilesRoot",{enumerable:!0,get:function(){return h.GoogleProtoFilesRoot}}),Object.defineProperty(e,"GrpcClient",{enumerable:!0,get:function(){return h.GrpcClient}});var m=requireLongrunning();Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return m.Operation}}),Object.defineProperty(e,"operation",{enumerable:!0,get:function(){return m.operation}});var g=requirePathTemplate();Object.defineProperty(e,"PathTemplate",{enumerable:!0,get:function(){return g.PathTemplate}});var y=requireStatus();Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return y.Status}});var v=requireStreaming();function b(e){e=Object.assign({scopes:b.ALL_SCOPES},e);const t=new r.GrpcClient(e);return new a.OperationsClientBuilder(t)}Object.defineProperty(e,"StreamType",{enumerable:!0,get:function(){return v.StreamType}}),b.SERVICE_ADDRESS=a.SERVICE_ADDRESS,b.ALL_SCOPES=a.ALL_SCOPES;var O=requireOperationsClient();Object.defineProperty(e,"OperationsClient",{enumerable:!0,get:function(){return O.OperationsClient}});var w=requireIamService();Object.defineProperty(e,"IamClient",{enumerable:!0,get:function(){return w.IamClient}});var S=requireLocationService();Object.defineProperty(e,"LocationsClient",{enumerable:!0,get:function(){return S.LocationsClient}}),e.createByteLengthFunction=r.GrpcClient.createByteLengthFunction,e.version=require$$19.version;const _=requireProtobufjs();e.protobuf=_,e.protobufMinimal=requireMinimal();const P=requireFallback();e.fallback=P;var E=requireUtil$2();Object.defineProperty(e,"makeUUID",{enumerable:!0,get:function(){return E.makeUUID}});var T=requireSrc$5();Object.defineProperty(e,"ChannelCredentials",{enumerable:!0,get:function(){return T.ChannelCredentials}});var C=requireWarnings();Object.defineProperty(e,"warn",{enumerable:!0,get:function(){return C.warn}});const R=requireSrc$3();e.serializer=R}(src$7)),src$7}var srcExports$1=requireSrc$2(),_a,STATUS_TO_STRING_MAP=(_a={},_a[srcExports$1.Status.CANCELLED]="cancelled",_a[srcExports$1.Status.UNKNOWN]="unknown",_a[srcExports$1.Status.INVALID_ARGUMENT]="invalid-argument",_a[srcExports$1.Status.DEADLINE_EXCEEDED]="deadline-exceeded",_a[srcExports$1.Status.NOT_FOUND]="not-found",_a[srcExports$1.Status.ALREADY_EXISTS]="already-exists",_a[srcExports$1.Status.PERMISSION_DENIED]="permission-denied",_a[srcExports$1.Status.RESOURCE_EXHAUSTED]="resource-exhausted",_a[srcExports$1.Status.FAILED_PRECONDITION]="failed-precondition",_a[srcExports$1.Status.ABORTED]="aborted",_a[srcExports$1.Status.OUT_OF_RANGE]="out-of-range",_a[srcExports$1.Status.UNIMPLEMENTED]="unimplemented",_a[srcExports$1.Status.INTERNAL]="internal",_a[srcExports$1.Status.UNAVAILABLE]="unavailable",_a[srcExports$1.Status.DATA_LOSS]="data-loss",_a[srcExports$1.Status.UNAUTHENTICATED]="unauthenticated",_a[srcExports$1.Status.OK]="unknown",_a),FIRESTORE_ERROR_MAPPINGS={"permission-denied":{userMessage:"Unable to access storage. Please try signing in again.",internalMessage:"Firestore permission denied",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unavailable:{userMessage:"Service temporarily unavailable. Please try again in a moment.",internalMessage:"Firestore service unavailable",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"not-found":{userMessage:"The requested data could not be found.",internalMessage:"Firestore document not found",shouldRetry:!1,severity:exports.ErrorSeverity.Info},"deadline-exceeded":{userMessage:"The operation took too long. Please try again.",internalMessage:"Firestore operation timeout",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},unauthenticated:{userMessage:"Authentication required. Please sign in again.",internalMessage:"Firestore authentication failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},"already-exists":{userMessage:"This record already exists.",internalMessage:"Firestore document already exists",shouldRetry:!1,severity:exports.ErrorSeverity.Info},"resource-exhausted":{userMessage:"Service is at capacity. Please try again later.",internalMessage:"Firestore quota exceeded",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"failed-precondition":{userMessage:"The operation cannot be completed at this time.",internalMessage:"Firestore precondition failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},aborted:{userMessage:"The operation was cancelled. Please try again.",internalMessage:"Firestore transaction aborted",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"invalid-argument":{userMessage:"Invalid data provided. Please check your input.",internalMessage:"Firestore invalid argument",shouldRetry:!1,severity:exports.ErrorSeverity.Error},cancelled:{userMessage:"The operation was cancelled.",internalMessage:"Firestore operation cancelled",shouldRetry:!1,severity:exports.ErrorSeverity.Info},unknown:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Firestore unknown error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},"out-of-range":{userMessage:"The requested range is invalid.",internalMessage:"Firestore out of range",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unimplemented:{userMessage:"This feature is not yet available.",internalMessage:"Firestore operation not implemented",shouldRetry:!1,severity:exports.ErrorSeverity.Error},internal:{userMessage:"An internal error occurred. Our team has been notified.",internalMessage:"Firestore internal error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},"data-loss":{userMessage:"Data integrity error. Please contact support.",internalMessage:"Firestore data loss detected",shouldRetry:!1,severity:exports.ErrorSeverity.Error}};function isGoogleError(e){return e instanceof srcExports$1.GoogleError&&"number"==typeof e.code}function handleFirestoreError(e,t){var r,n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),isGoogleError(e)?(r=void 0!==e.code?STATUS_TO_STRING_MAP[e.code]:void 0,n=e):n=e instanceof Error?e:new Error(String(e));var o=r&&r in FIRESTORE_ERROR_MAPPINGS?FIRESTORE_ERROR_MAPPINGS[r]:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Unknown error type",shouldRetry:!1,severity:exports.ErrorSeverity.Error};throw console.error("[Internal] Error from Firestore: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var src$1={},gaxios={},isStream_1,hasRequiredIsStream;function requireIsStream(){if(hasRequiredIsStream)return isStream_1;hasRequiredIsStream=1;const e=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;return e.writable=t=>e(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState,e.readable=t=>e(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState,e.duplex=t=>e.writable(t)&&e.readable(t),e.transform=t=>e.duplex(t)&&"function"==typeof t._transform,isStream_1=e}var common$1={},util={},name="gaxios",version="6.7.1",description="A simple common HTTP client specifically for Google APIs and services.",main="build/src/index.js",types="build/src/index.d.ts",files=["build/src"],scripts={lint:"gts check",test:"c8 mocha build/test","presystem-test":"npm run compile","system-test":"mocha build/system-test --timeout 80000",compile:"tsc -p .",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"compodoc src/","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},repository="googleapis/gaxios",keywords=["google"],engines={node:">=14"},author="Google, LLC",license="Apache-2.0",devDependencies={"@babel/plugin-proposal-private-methods":"^7.18.6","@compodoc/compodoc":"1.1.19","@types/cors":"^2.8.6","@types/express":"^4.16.1","@types/extend":"^3.0.1","@types/mocha":"^9.0.0","@types/multiparty":"0.0.36","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^20.0.0","@types/node-fetch":"^2.5.7","@types/sinon":"^17.0.0","@types/tmp":"0.2.6","@types/uuid":"^10.0.0","abort-controller":"^3.0.0",assert:"^2.0.0",browserify:"^17.0.0",c8:"^8.0.0",cheerio:"1.0.0-rc.10",cors:"^2.8.5",execa:"^5.0.0",express:"^4.16.4","form-data":"^4.0.0",gts:"^5.0.0","is-docker":"^2.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"5.0.0",linkinator:"^3.0.0",mocha:"^8.0.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^13.0.0","null-loader":"^4.0.0",puppeteer:"^19.0.0",sinon:"^18.0.0","stream-browserify":"^3.0.0",tmp:"0.2.3","ts-loader":"^8.0.0",typescript:"^5.1.6",webpack:"^5.35.0","webpack-cli":"^4.0.0"},dependencies={extend:"^3.0.2","https-proxy-agent":"^7.0.1","is-stream":"^2.0.0","node-fetch":"^2.6.9",uuid:"^9.0.1"},require$$0={name:name,version:version,description:description,main:main,types:types,files:files,scripts:scripts,repository:repository,keywords:keywords,engines:engines,author:author,license:license,devDependencies:devDependencies,dependencies:dependencies},hasRequiredUtil,hasRequiredCommon$1;function requireUtil(){return hasRequiredUtil||(hasRequiredUtil=1,Object.defineProperty(util,"__esModule",{value:!0}),util.pkg=void 0,util.pkg=require$$0),util}function requireCommon$1(){return hasRequiredCommon$1||(hasRequiredCommon$1=1,function(e){var t,r=common$1&&common$1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=function e(t){const r="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function o(e){if(e)for(const t of Object.keys(e))/^authentication$/i.test(t)&&(e[t]=r),/^authorization$/i.test(t)&&(e[t]=r),/secret/i.test(t)&&(e[t]=r)}function i(e,t){if("object"==typeof e&&null!==e&&"string"==typeof e[t]){const n=e[t];(/grant_type=/i.test(n)||/assertion=/i.test(n)||/secret/i.test(n))&&(e[t]=r)}}function a(e){"object"==typeof e&&null!==e&&("grant_type"in e&&(e.grant_type=r),"assertion"in e&&(e.assertion=r),"client_secret"in e&&(e.client_secret=r))}if(t.config){o(t.config.headers),i(t.config,"data"),a(t.config.data),i(t.config,"body"),a(t.config.body);try{const e=new n.URL("",t.config.url);e.searchParams.has("token")&&e.searchParams.set("token",r),e.searchParams.has("client_secret")&&e.searchParams.set("client_secret",r),t.config.url=e.toString()}catch(e){}}t.response&&(e({config:t.response.config}),o(t.response.headers),i(t.response,"data"),a(t.response.data));return t};const n=Url__default.default,o=requireUtil(),i=r(requireExtend());e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${o.pkg.name}-gaxios-error`);class a extends Error{static[(t=e.GAXIOS_ERROR_SYMBOL,Symbol.hasInstance)](t){return!(!t||"object"!=typeof t||!(e.GAXIOS_ERROR_SYMBOL in t)||t[e.GAXIOS_ERROR_SYMBOL]!==o.pkg.version)||Function.prototype[Symbol.hasInstance].call(a,t)}constructor(e,r,n,a){var s;if(super(e),this.config=r,this.response=n,this.error=a,this[t]=o.pkg.version,this.config=(0,i.default)(!0,{},r),this.response&&(this.response.config=(0,i.default)(!0,{},this.response.config)),this.response){try{this.response.data=function(e,t){switch(e){case"stream":default:return t;case"json":return JSON.parse(JSON.stringify(t));case"arraybuffer":return JSON.parse(Buffer.from(t).toString("utf8"));case"blob":return JSON.parse(t.text())}}(this.config.responseType,null===(s=this.response)||void 0===s?void 0:s.data)}catch(e){}this.status=this.response.status}a&&"code"in a&&a.code&&(this.code=a.code),r.errorRedactor&&r.errorRedactor({config:this.config,response:this.response})}}e.GaxiosError=a}(common$1)),common$1}var retry={},hasRequiredRetry;function requireRetry(){if(hasRequiredRetry)return retry;function e(e){var r;const n=t(e);if("AbortError"===e.name||"AbortError"===(null===(r=e.error)||void 0===r?void 0:r.name))return!1;if(!n||0===n.retry)return!1;if(!e.response&&(n.currentRetryAttempt||0)>=n.noResponseRetries)return!1;if(!e.config.method||n.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){let t=!1;for(const[r,o]of n.statusCodesToRetry){const n=e.response.status;if(n>=r&&n<=o){t=!0;break}}if(!t)return!1}return n.currentRetryAttempt=n.currentRetryAttempt||0,!(n.currentRetryAttempt>=n.retry)}function t(e){if(e&&e.config&&e.config.retryConfig)return e.config.retryConfig}return hasRequiredRetry=1,Object.defineProperty(retry,"__esModule",{value:!0}),retry.getRetryConfig=async function(r){let n=t(r);if(!r||!r.config||!n&&!r.config.retry)return{shouldRetry:!1};n=n||{},n.currentRetryAttempt=n.currentRetryAttempt||0,n.retry=void 0===n.retry||null===n.retry?3:n.retry,n.httpMethodsToRetry=n.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],n.noResponseRetries=void 0===n.noResponseRetries||null===n.noResponseRetries?2:n.noResponseRetries,n.retryDelayMultiplier=n.retryDelayMultiplier?n.retryDelayMultiplier:2,n.timeOfFirstRequest=n.timeOfFirstRequest?n.timeOfFirstRequest:Date.now(),n.totalTimeout=n.totalTimeout?n.totalTimeout:Number.MAX_SAFE_INTEGER,n.maxRetryDelay=n.maxRetryDelay?n.maxRetryDelay:Number.MAX_SAFE_INTEGER;n.statusCodesToRetry=n.statusCodesToRetry||[[100,199],[408,408],[429,429],[500,599]],r.config.retryConfig=n;const o=n.shouldRetry||e;if(!await o(r))return{shouldRetry:!1,config:r.config};const i=function(e){var t;const r=e.currentRetryAttempt?0:null!==(t=e.retryDelay)&&void 0!==t?t:100,n=r+(Math.pow(e.retryDelayMultiplier,e.currentRetryAttempt)-1)/2*1e3,o=e.totalTimeout-(Date.now()-e.timeOfFirstRequest);return Math.min(n,o,e.maxRetryDelay)}(n);r.config.retryConfig.currentRetryAttempt+=1;const a=n.retryBackoff?n.retryBackoff(r,i):new Promise(e=>{setTimeout(e,i)});n.onRetryAttempt&&n.onRetryAttempt(r);return await a,{shouldRetry:!0,config:r.config}},retry}var interceptor={},hasRequiredInterceptor;function requireInterceptor(){if(hasRequiredInterceptor)return interceptor;hasRequiredInterceptor=1,Object.defineProperty(interceptor,"__esModule",{value:!0}),interceptor.GaxiosInterceptorManager=void 0;class e extends Set{}return interceptor.GaxiosInterceptorManager=e,interceptor}var dist$1={},src={exports:{}},browser={exports:{}},ms,hasRequiredMs,common,hasRequiredCommon,hasRequiredBrowser;function requireMs(){if(hasRequiredMs)return ms;hasRequiredMs=1;var e=1e3,t=60*e,r=60*t,n=24*r,o=7*n,i=365.25*n;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}return ms=function(s,l){l=l||{};var p=typeof s;if("string"===p&&s.length>0)return function(a){if((a=String(a)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!s)return;var l=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*i;case"weeks":case"week":case"w":return l*o;case"days":case"day":case"d":return l*n;case"hours":case"hour":case"hrs":case"hr":case"h":return l*r;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(s);if("number"===p&&isFinite(s))return l.long?function(o){var i=Math.abs(o);if(i>=n)return a(o,i,n,"day");if(i>=r)return a(o,i,r,"hour");if(i>=t)return a(o,i,t,"minute");if(i>=e)return a(o,i,e,"second");return o+" ms"}(s):function(o){var i=Math.abs(o);if(i>=n)return Math.round(o/n)+"d";if(i>=r)return Math.round(o/r)+"h";if(i>=t)return Math.round(o/t)+"m";if(i>=e)return Math.round(o/e)+"s";return o+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},ms}function requireCommon(){if(hasRequiredCommon)return common;return hasRequiredCommon=1,common=function(e){function t(e){let n,o,i,a=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];n=i.call(r,t),e.splice(a,1),a--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,o=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,i=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,i++,r=i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(n(e,r))return!1;for(const r of t.names)if(n(e,r))return!0;return!1},t.humanize=requireMs(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},common}function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=requireCommon()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(browser,browser.exports)),browser.exports}var node={exports:{}},hasFlag,hasRequiredHasFlag,supportsColor_1,hasRequiredSupportsColor,hasRequiredNode,hasRequiredSrc$1;function requireHasFlag(){return hasRequiredHasFlag?hasFlag:(hasRequiredHasFlag=1,hasFlag=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)})}function requireSupportsColor(){if(hasRequiredSupportsColor)return supportsColor_1;hasRequiredSupportsColor=1;const e=require$$0__default$1.default,t=require$$1__default$7.default,r=requireHasFlag(),{env:n}=process;let o;function i(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function a(t,i){if(0===o)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(t&&!i&&void 0===o)return 0;const a=o||0;if("dumb"===n.TERM)return a;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in n)||"codeship"===n.CI_NAME?1:a;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if("truecolor"===n.COLORTERM)return 3;if("TERM_PROGRAM"in n){const e=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:a}return r("no-color")||r("no-colors")||r("color=false")||r("color=never")?o=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(o=1),"FORCE_COLOR"in n&&(o="true"===n.FORCE_COLOR?1:"false"===n.FORCE_COLOR?0:0===n.FORCE_COLOR.length?1:Math.min(parseInt(n.FORCE_COLOR,10),3)),supportsColor_1={supportsColor:function(e){return i(a(e,e&&e.isTTY))},stdout:i(a(!0,t.isatty(1))),stderr:i(a(!0,t.isatty(2)))},supportsColor_1}function requireNode(){return hasRequiredNode||(hasRequiredNode=1,function(e,t){const r=require$$1__default$7.default,n=require$$1__default$4.default;t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${n} `;r[0]=i+r[0].split("\n").join("\n"+i),r.push(o+"m+"+e.exports.humanize(this.diff)+"")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=requireSupportsColor();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=requireCommon()(t);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts)}}(node,node.exports)),node.exports}function requireSrc$1(){return hasRequiredSrc$1||(hasRequiredSrc$1=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?src.exports=requireBrowser():src.exports=requireNode()),src.exports}var dist={},helpers={},hasRequiredHelpers,hasRequiredDist$1;function requireHelpers(){if(hasRequiredHelpers)return helpers;hasRequiredHelpers=1;var e=helpers&&helpers.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=helpers&&helpers.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=helpers&&helpers.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};Object.defineProperty(helpers,"__esModule",{value:!0}),helpers.req=helpers.json=helpers.toBuffer=void 0;const n=r(http__default.default),o=r(require$$1__default$6.default);async function i(e){let t=0;const r=[];for await(const n of e)t+=n.length,r.push(n);return Buffer.concat(r,t)}return helpers.toBuffer=i,helpers.json=async function(e){const t=(await i(e)).toString("utf8");try{return JSON.parse(t)}catch(e){const r=e;throw r.message+=` (input: ${t})`,r}},helpers.req=function(e,t={}){const r=(("string"==typeof e?e:e.href).startsWith("https:")?o:n).request(e,t),i=new Promise((e,t)=>{r.once("response",e).once("error",t).end()});return r.then=i.then.bind(i),r},helpers}function requireDist$1(){return hasRequiredDist$1||(hasRequiredDist$1=1,function(e){var t=dist&&dist.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=dist&&dist.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=dist&&dist.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(n,e,o);return r(n,e),n},o=dist&&dist.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Agent=void 0;const i=n(require$$0__default$2.default),a=n(http__default.default),s=require$$1__default$6.default;o(requireHelpers(),e);const l=Symbol("AgentBaseInternalState");class p extends a.Agent{constructor(e){super(e),this[l]={}}isSecureEndpoint(e){if(e){if("boolean"==typeof e.secureEndpoint)return e.secureEndpoint;if("string"==typeof e.protocol)return"https:"===e.protocol}const{stack:t}=new Error;return"string"==typeof t&&t.split("\n").some(e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:"))}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);const t=new i.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||null===t)return;const r=this.sockets[e],n=r.indexOf(t);-1!==n&&(r.splice(n,1),this.totalSocketCount--,0===r.length&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?s.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){const n={...t,secureEndpoint:this.isSecureEndpoint(t)},o=this.getName(n),i=this.incrementSockets(o);Promise.resolve().then(()=>this.connect(e,n)).then(s=>{if(this.decrementSockets(o,i),s instanceof a.Agent)try{return s.addRequest(e,n)}catch(e){return r(e)}this[l].currentSocket=s,super.createSocket(e,t,r)},e=>{this.decrementSockets(o,i),r(e)})}createConnection(){const e=this[l].currentSocket;if(this[l].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[l].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(e){this[l]&&(this[l].defaultPort=e)}get protocol(){return this[l].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[l]&&(this[l].protocol=e)}}e.Agent=p}(dist)),dist}var parseProxyResponse={},hasRequiredParseProxyResponse,hasRequiredDist,hasRequiredGaxios,hasRequiredSrc;function requireParseProxyResponse(){if(hasRequiredParseProxyResponse)return parseProxyResponse;hasRequiredParseProxyResponse=1;var e=parseProxyResponse&&parseProxyResponse.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(parseProxyResponse,"__esModule",{value:!0}),parseProxyResponse.parseProxyResponse=void 0;const t=(0,e(requireSrc$1()).default)("https-proxy-agent:parse-proxy-response");return parseProxyResponse.parseProxyResponse=function(e){return new Promise((r,n)=>{let o=0;const i=[];function a(){const l=e.read();l?function(l){i.push(l),o+=l.length;const p=Buffer.concat(i,o),d=p.indexOf("\r\n\r\n");if(-1===d)return t("have not received end of HTTP headers yet..."),void a();const u=p.slice(0,d).toString("ascii").split("\r\n"),c=u.shift();if(!c)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));const f=c.split(" "),h=+f[1],m=f.slice(2).join(" "),g={};for(const t of u){if(!t)continue;const r=t.indexOf(":");if(-1===r)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${t}"`));const o=t.slice(0,r).toLowerCase(),i=t.slice(r+1).trimStart(),a=g[o];"string"==typeof a?g[o]=[a,i]:Array.isArray(a)?a.push(i):g[o]=i}t("got proxy server response: %o %o",c,g),s(),r({connect:{statusCode:h,statusText:m,headers:g},buffered:p})}(l):e.once("readable",a)}function s(){e.removeListener("end",l),e.removeListener("error",p),e.removeListener("readable",a)}function l(){s(),t("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function p(e){s(),t("onerror %o",e),n(e)}e.on("error",p),e.on("end",l),a()})},parseProxyResponse}function requireDist(){if(hasRequiredDist)return dist$1;hasRequiredDist=1;var e=dist$1&&dist$1.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=dist$1&&dist$1.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=dist$1&&dist$1.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n},n=dist$1&&dist$1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dist$1,"__esModule",{value:!0}),dist$1.HttpsProxyAgent=void 0;const o=r(require$$0__default$2.default),i=r(require$$1__default$1.default),a=n(require$$2__default.default),s=n(requireSrc$1()),l=requireDist$1(),p=Url__default.default,d=requireParseProxyResponse(),u=(0,s.default)("https-proxy-agent"),c=e=>void 0===e.servername&&e.host&&!o.isIP(e.host)?{...e,servername:e.host}:e;class f extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy="string"==typeof e?new p.URL(e):e,this.proxyHeaders=t?.headers??{},u("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?m(t,"headers"):null,host:r,port:n}}async connect(e,t){const{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let n;"https:"===r.protocol?(u("Creating `tls.Socket`: %o",this.connectOpts),n=i.connect(c(this.connectOpts))):(u("Creating `net.Socket`: %o",this.connectOpts),n=o.connect(this.connectOpts));const s="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},l=o.isIPv6(t.host)?`[${t.host}]`:t.host;let p=`CONNECT ${l}:${t.port} HTTP/1.1\r\n`;if(r.username||r.password){const e=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(e).toString("base64")}`}s.Host=`${l}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const e of Object.keys(s))p+=`${e}: ${s[e]}\r\n`;const f=(0,d.parseProxyResponse)(n);n.write(`${p}\r\n`);const{connect:g,buffered:y}=await f;if(e.emit("proxyConnect",g),this.emit("proxyConnect",g,e),200===g.statusCode)return e.once("socket",h),t.secureEndpoint?(u("Upgrading socket connection to TLS"),i.connect({...m(c(t),"host","path","port"),socket:n})):n;n.destroy();const v=new o.Socket({writable:!1});return v.readable=!0,e.once("socket",e=>{u("Replaying proxy buffer for failed request"),(0,a.default)(e.listenerCount("data")>0),e.push(y),e.push(null)}),v}}function h(e){e.resume()}function m(e,...t){const r={};let n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}return f.protocols=["http","https"],dist$1.HttpsProxyAgent=f,dist$1}function requireGaxios(){if(hasRequiredGaxios)return gaxios;hasRequiredGaxios=1;var e,t,r,n,o,i,a,s,l=gaxios&&gaxios.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),p=gaxios&&gaxios.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),d=gaxios&&gaxios.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&l(t,e,r);return p(t,e),t},u=gaxios&&gaxios.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},c=gaxios&&gaxios.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},f=gaxios&&gaxios.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gaxios,"__esModule",{value:!0}),gaxios.Gaxios=void 0;const h=f(requireExtend()),m=require$$1__default$6.default,g=f(require$$2$1),y=f(require$$0__default$5.default),v=f(requireIsStream()),b=Url__default.default,O=requireCommon$1(),w=requireRetry(),S=Stream__default.default,_=require$$9,P=requireInterceptor(),E="undefined"!=typeof window&&window&&window.fetch?window.fetch:g.default;function T(e,t){return!!C(e,t)}function C(e,t){t=t.toLowerCase();for(const r of Object.keys((null==e?void 0:e.headers)||{}))if(t===r.toLowerCase())return e.headers[r]}class R{constructor(t){e.add(this),this.agentCache=new Map,this.defaults=t||{},this.interceptors={request:new P.GaxiosInterceptorManager,response:new P.GaxiosInterceptorManager}}async request(t={}){return t=await u(this,e,"m",i).call(this,t),t=await u(this,e,"m",n).call(this,t),u(this,e,"m",o).call(this,this._request(t))}async _defaultAdapter(e){const t=e.fetchImplementation||E,r=await t(e.url,e),n=await this.getResponseData(e,r);return this.translateResponse(e,r,n)}async _request(e={}){var t;try{let t;if(t=e.adapter?await e.adapter(e,this._defaultAdapter.bind(this)):await this._defaultAdapter(e),!e.validateStatus(t.status)){if("stream"===e.responseType){let e="";await new Promise(r=>{(null==t?void 0:t.data).on("data",t=>{e+=t}),(null==t?void 0:t.data).on("end",r)}),t.data=e}throw new O.GaxiosError(`Request failed with status code ${t.status}`,e,t)}return t}catch(r){const n=r instanceof O.GaxiosError?r:new O.GaxiosError(r.message,e,void 0,r),{shouldRetry:o,config:i}=await(0,w.getRetryConfig)(n);if(o&&i)return n.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,e.retryConfig=null===(t=n.config)||void 0===t?void 0:t.retryConfig,this._request(e);throw n}}async getResponseData(e,t){switch(e.responseType){case"stream":return t.body;case"json":{let e=await t.text();try{e=JSON.parse(e)}catch(e){}return e}case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"text":return t.text();default:return this.getResponseDataFromContentType(t)}}validateStatus(e){return e>=200&&e<300}paramsSerializer(e){return y.default.stringify(e)}translateResponse(e,t,r){const n={};return t.headers.forEach((e,t)=>{n[t]=e}),{config:e,data:r,headers:n,status:t.status,statusText:t.statusText,request:{responseURL:t.url}}}async getResponseDataFromContentType(e){let t=e.headers.get("Content-Type");if(null===t)return e.text();if(t=t.toLowerCase(),t.includes("application/json")){let t=await e.text();try{t=JSON.parse(t)}catch(e){}return t}return t.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,t){const r=`--${t}--`;for(const r of e){const e=`--${t}\r\nContent-Type: ${r.headers["Content-Type"]||"application/octet-stream"}\r\n\r\n`;yield e,"string"==typeof r.content?yield r.content:yield*r.content,yield"\r\n"}yield r}}return gaxios.Gaxios=R,t=R,e=new WeakSet,r=function(e,t=[]){var r,n;const o=new b.URL(e),i=[...t],a=(null===(n=null!==(r=process.env.NO_PROXY)&&void 0!==r?r:process.env.no_proxy)||void 0===n?void 0:n.split(","))||[];for(const e of a)i.push(e.trim());for(const e of i)if(e instanceof RegExp){if(e.test(o.toString()))return!1}else if(e instanceof b.URL){if(e.origin===o.origin)return!1}else if(e.startsWith("*.")||e.startsWith(".")){const t=e.replace(/^\*\./,".");if(o.hostname.endsWith(t))return!1}else if(e===o.origin||e===o.hostname||e===o.href)return!1;return!0},n=async function(e){let t=Promise.resolve(e);for(const e of this.interceptors.request.values())e&&(t=t.then(e.resolved,e.rejected));return t},o=async function(e){let t=Promise.resolve(e);for(const e of this.interceptors.response.values())e&&(t=t.then(e.resolved,e.rejected));return t},i=async function(n){var o,i,a,l;const p=(0,h.default)(!0,{},this.defaults,n);if(!p.url)throw new Error("URL is required.");const d=p.baseUrl||p.baseURL;if(d&&(p.url=d.toString()+p.url),p.paramsSerializer=p.paramsSerializer||this.paramsSerializer,p.params&&Object.keys(p.params).length>0){let e=p.paramsSerializer(p.params);e.startsWith("?")&&(e=e.slice(1));const t=p.url.toString().includes("?")?"&":"?";p.url=p.url+t+e}if("number"==typeof n.maxContentLength&&(p.size=n.maxContentLength),"number"==typeof n.maxRedirects&&(p.follow=n.maxRedirects),p.headers=p.headers||{},void 0===p.multipart&&p.data){const e="undefined"!=typeof FormData&&(null==p?void 0:p.data)instanceof FormData;v.default.readable(p.data)?p.body=p.data:"undefined"!=typeof Buffer&&Buffer.isBuffer(p.data)?(p.body=p.data,T(p,"Content-Type")||(p.headers["Content-Type"]="application/json")):"object"==typeof p.data?e||("application/x-www-form-urlencoded"===C(p,"content-type")?p.body=p.paramsSerializer(p.data):(T(p,"Content-Type")||(p.headers["Content-Type"]="application/json"),p.body=JSON.stringify(p.data))):p.body=p.data}else if(p.multipart&&p.multipart.length>0){const e=(0,_.v4)();p.headers["Content-Type"]=`multipart/related; boundary=${e}`;const t=new S.PassThrough;p.body=t,(0,S.pipeline)(this.getMultipartRequest(p.multipart,e),t,()=>{})}p.validateStatus=p.validateStatus||this.validateStatus,p.responseType=p.responseType||"unknown",p.headers.Accept||"json"!==p.responseType||(p.headers.Accept="application/json"),p.method=p.method||"GET";const c=p.proxy||(null===(o=null===process||void 0===process?void 0:process.env)||void 0===o?void 0:o.HTTPS_PROXY)||(null===(i=null===process||void 0===process?void 0:process.env)||void 0===i?void 0:i.https_proxy)||(null===(a=null===process||void 0===process?void 0:process.env)||void 0===a?void 0:a.HTTP_PROXY)||(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.http_proxy),f=u(this,e,"m",r).call(this,p.url,p.noProxy);if(p.agent);else if(c&&f){const e=await u(t,t,"m",s).call(t);this.agentCache.has(c)?p.agent=this.agentCache.get(c):(p.agent=new e(c,{cert:p.cert,key:p.key}),this.agentCache.set(c,p.agent))}else p.cert&&p.key&&(this.agentCache.has(p.key)?p.agent=this.agentCache.get(p.key):(p.agent=new m.Agent({cert:p.cert,key:p.key}),this.agentCache.set(p.key,p.agent)));return"function"!=typeof p.errorRedactor&&!1!==p.errorRedactor&&(p.errorRedactor=O.defaultErrorRedactor),p},s=async function(){return c(this,t,u(this,t,"f",a)||(await Promise.resolve().then(()=>d(requireDist()))).HttpsProxyAgent,"f",a),u(this,t,"f",a)},a={value:void 0},gaxios}function requireSrc(){return hasRequiredSrc||(hasRequiredSrc=1,function(e){var t=src$1&&src$1.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=src$1&&src$1.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=async function(t){return e.instance.request(t)};const n=requireGaxios();Object.defineProperty(e,"Gaxios",{enumerable:!0,get:function(){return n.Gaxios}});var o=requireCommon$1();Object.defineProperty(e,"GaxiosError",{enumerable:!0,get:function(){return o.GaxiosError}}),r(requireInterceptor(),e),e.instance=new n.Gaxios}(src$1)),src$1}var srcExports=requireSrc(),mapHTTPStatusToOAuthError=function(e){switch(e){case 400:return"invalid_request";case 401:return"invalid_token";case 403:return"access_denied";case 429:return"network_error";case 500:return"server_error";case 503:return"temporarily_unavailable"}return"unknown"},OAUTH_ERROR_MAPPINGS={invalid_client:{userMessage:"Authentication configuration error. Please contact support.",internalMessage:"OAuth client credentials invalid",shouldRetry:!1,severity:exports.ErrorSeverity.Error},invalid_grant:{userMessage:"Your session has expired. Please sign in again.",internalMessage:"OAuth refresh token expired or revoked",shouldRetry:!1,severity:exports.ErrorSeverity.Error},access_denied:{userMessage:"Access was denied. Please grant permission to continue.",internalMessage:"User denied OAuth permission",shouldRetry:!1,severity:exports.ErrorSeverity.Info},invalid_token:{userMessage:"Your authentication token is invalid. Please sign in again.",internalMessage:"OAuth access token invalid",shouldRetry:!1,severity:exports.ErrorSeverity.Error},expired_token:{userMessage:"Your session has expired. Please sign in again.",internalMessage:"OAuth access token expired",shouldRetry:!1,severity:exports.ErrorSeverity.Error},redirect_uri_mismatch:{userMessage:"Authentication configuration error. Please contact support.",internalMessage:"OAuth redirect URI mismatch",shouldRetry:!1,severity:exports.ErrorSeverity.Error},insufficient_scope:{userMessage:"Additional permissions are required. Please sign in again.",internalMessage:"OAuth insufficient scope",shouldRetry:!1,severity:exports.ErrorSeverity.Error},network_error:{userMessage:"Network error. Please check your connection and try again.",internalMessage:"OAuth network error",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},timeout_error:{userMessage:"Request timed out. Please try again.",internalMessage:"OAuth request timeout",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},invalid_request:{userMessage:"Invalid request. Please try again.",internalMessage:"OAuth invalid request parameters",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unsupported_grant_type:{userMessage:"Authentication method not supported. Please contact support.",internalMessage:"OAuth unsupported grant type",shouldRetry:!1,severity:exports.ErrorSeverity.Error},invalid_scope:{userMessage:"Invalid permissions requested. Please contact support.",internalMessage:"OAuth invalid scope",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unauthorized_client:{userMessage:"Application not authorized. Please contact support.",internalMessage:"OAuth client not authorized",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unknown:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Unknown OAuth error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},server_error:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"OAuth server error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},temporarily_unavailable:{userMessage:"Service temporarily unavailable. Please try again in a moment.",internalMessage:"OAuth service temporarily unavailable",shouldRetry:!0,severity:exports.ErrorSeverity.Warning}};function isOAuth2Error(e){return e instanceof srcExports.GaxiosError}function extractOAuthErrorCode(e){var t,r,n=null===(r=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===r?void 0:r.error;return"string"==typeof n?n:"string"==typeof e.code?e.code.startsWith("E")?"ETIMEDOUT"===e.code?"timeout_error":("ENOTFOUND"===e.code||e.code,"network_error"):e.code:e.status?mapHTTPStatusToOAuthError(e.status):"unknown"}function handleGoogleOAuth2Error(e,t){var r,n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),isOAuth2Error(e)?(r=extractOAuthErrorCode(e),n=e):e instanceof Error?(n=e,r="unknown"):(n=new Error(String(e)),r="unknown");var o=r&&r in OAUTH_ERROR_MAPPINGS?OAUTH_ERROR_MAPPINGS[r]:OAUTH_ERROR_MAPPINGS.unknown;throw console.error("[Internal] Error from Google OAuth2: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var ENCRYPTION_ERROR_MAPPINGS={encryption_failed:{userMessage:"Failed to encrypt data. Please try again.",internalMessage:"Encryption operation failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},decryption_failed:{userMessage:"Failed to decrypt data. Please contact support.",internalMessage:"Decryption operation failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error}};function handleEncryptionError(e,t,r){var n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),n=e instanceof Error?e:new Error(String(e));var o=ENCRYPTION_ERROR_MAPPINGS[r];throw console.error("[Internal] Error from Encryption: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var EncryptionService=function(){function e(e){this.encryptionSecret=e,this.ENCRYPTION_SECRET=e}return e.prototype.encryptString=function(t){try{var r=crypto__default.default.randomBytes(e.SALT_BYTES).toString("hex"),n=crypto__default.default.randomBytes(e.IV_LENGTH),o=crypto__default.default.scryptSync(this.ENCRYPTION_SECRET,r,e.ENCRYPTION_KEY_LENGTH),i=crypto__default.default.createCipheriv(e.ALGORITHM,o,n),a=i.update(t,"utf8","hex");return a+=i.final("hex"),"".concat(n.toString("hex"),":").concat(a,":").concat(r)}catch(e){return handleEncryptionError(e,{operation:"encryptString",service:exports.ExceptionType.Encryption,metadata:{message:"Failed to encrypt string",errorType:e instanceof Error?e.name:typeof e}},"encryption_failed")}},e.prototype.decryptString=function(t){try{var r=__read(t.split(":"),3),n=r[0],o=r[1],i=r[2];if(!n||!o||!i)throw new Error("Invalid encrypted string");var a=Buffer.from(n,"hex"),s=crypto__default.default.scryptSync(this.ENCRYPTION_SECRET,i,e.ENCRYPTION_KEY_LENGTH),l=crypto__default.default.createDecipheriv(e.ALGORITHM,s,a),p=l.update(o,"hex","utf8");return p+=l.final("utf8")}catch(e){return handleEncryptionError(e,{operation:"decryptString",service:exports.ExceptionType.Encryption,metadata:{message:"Failed to decrypt string",errorType:e instanceof Error?e.name:typeof e}},"decryption_failed")}},e.ALGORITHM="aes-256-cbc",e.IV_LENGTH=16,e.SALT_BYTES=16,e.ENCRYPTION_KEY_LENGTH=32,e}(),FirestoreCollections;!function(e){e.CONNECTED_USERS_CREDENTIALS="connectedUsersCredentials",e.CLASSROOM_ATTACHMENTS="classroomAttachments"}(FirestoreCollections||(FirestoreCollections={}));var FirestoreClient=function(){function e(e){this.firestore=e,this._firestore=e}return e.prototype.getConnectedUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._firestore.collection(FirestoreCollections.CONNECTED_USERS_CREDENTIALS).doc(e).get()];case 1:return(t=o.sent()).exists?[2,userCredentialsEntitySchema.parse(t.data())]:[2,null];case 2:return r=o.sent(),n={operation:"getConnectedUserCredentials",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to get users credentials"}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.upsertConnectedUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=userCredentialsEntitySchema.parse(e),this._firestore.settings({ignoreUndefinedProperties:!0}),[4,this._firestore.collection(FirestoreCollections.CONNECTED_USERS_CREDENTIALS).doc(t.loginHint).set(t)];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),n={operation:"upsertConnectedUserCredentials",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to upsert users credentials",originalError:r}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.upsertClassroomAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=classroomAttachmentEntitySchema.parse(e),this._firestore.settings({ignoreUndefinedProperties:!0}),[4,this._firestore.collection(FirestoreCollections.CLASSROOM_ATTACHMENTS).doc(t.attachmentId).set(t)];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),n={operation:"upsertClassroomAttachment",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to upsert classroom attachment",originalError:r}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.getClassroomAttachmentById=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._firestore.collection(FirestoreCollections.CLASSROOM_ATTACHMENTS).doc(e).get()];case 1:return(t=o.sent()).exists?[2,classroomAttachmentEntitySchema.parse(t.data())]:[2,null];case 2:return r=o.sent(),n={operation:"getClassroomAttachmentById",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to get classroom attachment by ID"}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e}(),GoogleOAuthClient=function(){function e(e,t,r,n,o){var i=this;if(this.googleClientId=e,this.googleClientSecret=t,this.callbackUrl=r,this.accessToken=n,this.refreshToken=o,!e)throw new Error("Google Client ID is missing");if(!t)throw new Error("Google Client Secret is missing");if(!r)throw new Error("Google OAuth Callback URL is missing");var a=new require$$3$2.OAuth2Client({clientId:e,clientSecret:t,redirectUri:r,forceRefreshOnFailure:!1});"true"===process.env.GOOGLE_CLASSROOM_DEV_MODE&&n&&(a.refreshHandler=function(){return __awaiter(i,void 0,void 0,function(){return __generator$1(this,function(e){return[2,{access_token:n,expiry_date:(new Date).getTime()+36e5}]})})}),(n||o)&&a.setCredentials({access_token:n,refresh_token:o}),this.client=a,this.clientId=e}return e.prototype.getAuthenticateUrl=function(e,t){void 0===t&&(t=!1);try{return this.client.generateAuthUrl({access_type:"offline",include_granted_scopes:!0,scope:["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/classroom.courses.readonly","https://www.googleapis.com/auth/classroom.addons.student","https://www.googleapis.com/auth/classroom.addons.teacher"],loginHint:e,subscribeToNewsletter:t})}catch(e){return handleGoogleOAuth2Error(e,{operation:"getAuthenticateUrl",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to get authenticate url"}})}},e.prototype.exchangeCodeForTokens=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a;return __generator$1(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.client.getToken(e)];case 1:return t=s.sent().tokens,[4,this.client.verifyIdToken({idToken:t.id_token,audience:this.clientId})];case 2:return r=s.sent(),n=r.getPayload(),o={accessToken:t.access_token,loginHint:null==n?void 0:n.sub,refreshToken:t.refresh_token,profilePictureUrl:null==n?void 0:n.picture,email:null==n?void 0:n.email},[2,googleOAuthUserSchema.parse(o)];case 3:return i=s.sent(),a={operation:"exchangeCodeForTokens",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to exchange code for tokens"}},[2,handleGoogleOAuth2Error(i,a)];case 4:return[2]}})})},e.prototype.refreshAccessToken=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.client.setCredentials({refresh_token:e}),[4,this.client.getAccessToken()];case 1:return t=o.sent(),[2,tokenPayloadSchema.parse(t).token];case 2:return r=o.sent(),n={operation:"refreshAccessToken",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to refresh access token"}},[2,handleGoogleOAuth2Error(r,n)];case 3:return[2]}})})},e.prototype.isAuthenticated=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.client.getTokenInfo(e)];case 1:return t=o.sent(),t.expiry_date<Date.now()?[2,!1]:[2,!0];case 2:return r=o.sent(),n={operation:"isAuthenticated",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to check if access token is authenticated"}},[2,handleGoogleOAuth2Error(r,n)];case 3:return[2]}})})},e.prototype.getOAuth2Client=function(){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(e){return[2,this.client]})})},e}(),OakGoogleClassroomAddOn=function(){function e(e,t,r,n,o,i,a){this.encryptionSecret=e,this.firestore=t,this.googleOAuthClientId=r,this.googleOAuthClientSecret=n,this.googleOAuthCallbackApiRoute=o,this.sessionSecret=i,this.baseUrl=a,this.encryptionService=new EncryptionService(e),this.firestoreClient=new FirestoreClient(t),this._googleOAuthClientId=r,this._googleOAuthClientSecret=n,this._googleOAuthCallbackApiRoute=o,this._sessionSecret=i}return e.prototype.getOAuthClient=function(e,t){return new GoogleOAuthClient(this._googleOAuthClientId,this._googleOAuthClientSecret,this._googleOAuthCallbackApiRoute,e,t)},e.prototype.getGoogleSignInUrl=function(e){return __awaiter(this,arguments,void 0,function(e,t){var r,n;return void 0===t&&(t=!1),__generator$1(this,function(o){if(r=this.getOAuthClient(),!(n=r.getAuthenticateUrl(e,t)))throw new OakGoogleClassroomException("Failed to get Google Authentication URL",exports.ExceptionType.GoogleOAuth,{context:{operation:"getGoogleSignInUrl",service:exports.ExceptionType.GoogleOAuth},severity:exports.ErrorSeverity.Error,originalError:new Error("Failed to get Google Authentication URL")});return[2,n]})})},e.prototype.handleGoogleSignInCallback=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o,i,a,s,l;return __generator$1(this,function(p){switch(p.label){case 0:if(!e||"string"!=typeof e||""===e.trim())throw new OakGoogleClassroomException("Invalid OAuth code provided",exports.ExceptionType.GoogleOAuth,{context:{operation:"handleGoogleSignInCallback",service:exports.ExceptionType.GoogleOAuth},severity:exports.ErrorSeverity.Error,originalError:new Error("Invalid OAuth code provided")});return[4,this.getOAuthClient().exchangeCodeForTokens(e)];case 1:if(!(r=p.sent()))throw new OakGoogleClassroomException("Failed to authenticate Google sign-in",exports.ExceptionType.GoogleOAuth,{context:{operation:"handleGoogleSignInCallback",service:exports.ExceptionType.GoogleOAuth},severity:exports.ErrorSeverity.Error,originalError:new Error("Failed to authenticate Google sign-in")});if(n=googleOAuthUserSchema.parse(r),!(o=n.accessToken))throw new OakGoogleClassroomException("Access token missing from OAuth response",exports.ExceptionType.GoogleOAuth,{context:{operation:"handleGoogleSignInCallback",service:exports.ExceptionType.GoogleOAuth,metadata:{loginHint:n.loginHint}},severity:exports.ErrorSeverity.Error,originalError:new Error("Access token missing from OAuth response")});i=n.refreshToken?this.encryptionService.encryptString(n.refreshToken):void 0,a=n.profilePictureUrl?this.encryptionService.encryptString(n.profilePictureUrl):void 0,p.label=2;case 2:return p.trys.push([2,4,,5]),[4,sealData({loginHint:n.loginHint,accessToken:o},{password:this._sessionSecret})];case 3:return s=p.sent(),[3,5];case 4:throw l=p.sent(),new OakGoogleClassroomException("Failed to create encrypted session",exports.ExceptionType.Encryption,{context:{operation:"handleGoogleSignInCallback",service:exports.ExceptionType.Encryption,metadata:{loginHint:n.loginHint}},severity:exports.ErrorSeverity.Error,originalError:l instanceof Error?l:new Error(String(l))});case 5:return[4,this.firestoreClient.upsertConnectedUserCredentials({refreshToken:i,profilePictureUrl:a,loginHint:n.loginHint})];case 6:return p.sent(),t&&n.email?[4,t(n.email)]:[3,8];case 7:p.sent(),p.label=8;case 8:return[2,{encryptedSession:s,accessToken:o,profilePictureUrl:n.profilePictureUrl}]}})})},e.prototype.decryptSession=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator$1(this,function(r){switch(r.label){case 0:return[4,unsealData(e,{password:this._sessionSecret})];case 1:return(null==(t=r.sent())?void 0:t.accessToken)&&(null==t?void 0:t.loginHint)?[2,t]:[2,null]}})})},e.prototype.getSessionAndUser=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o;return __generator$1(this,function(i){switch(i.label){case 0:return[4,this.decryptSession(e)];case 1:return(t=i.sent())?[4,this.firestoreClient.getConnectedUserCredentials(t.loginHint)]:[2,null];case 2:return(r=i.sent())?(n=r.refreshToken?this.encryptionService.decryptString(r.refreshToken):void 0,r.refreshToken=n,process.env.GOOGLE_CLASSROOM_DEV_REFRESH_TOKEN&&(r.refreshToken=process.env.GOOGLE_CLASSROOM_DEV_REFRESH_TOKEN),r.profilePictureUrl&&(o=this.encryptionService.decryptString(r.profilePictureUrl),r.profilePictureUrl=o),[2,{session:t,user:r}]):[2,null]}})})},e.prototype.verifyAuthSession=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o,i,a,s;return __generator$1(this,function(l){switch(l.label){case 0:return e&&t?[4,this.getSessionAndUser(e)]:[2,null];case 1:return(r=l.sent())&&t&&(null===(i=null==r?void 0:r.session)||void 0===i?void 0:i.accessToken)===t?[4,(n=this.getOAuthClient(t,r.user.refreshToken)).isAuthenticated(t)]:[2,null];case 2:return l.sent()?[2,{session:e,token:t,userProfilePicUrl:null===(a=null==r?void 0:r.user)||void 0===a?void 0:a.profilePictureUrl}]:[4,n.refreshAccessToken(r.user.refreshToken)];case 3:return(o=l.sent())?[4,sealData({loginHint:r.session.loginHint,accessToken:o},{password:this._sessionSecret})]:[3,5];case 4:return[2,{session:l.sent(),token:o,userProfilePicUrl:null===(s=null==r?void 0:r.user)||void 0===s?void 0:s.profilePictureUrl}];case 5:return[2,null]}})})},e.prototype.createAttachment=function(e,t,r){return __awaiter(this,void 0,void 0,function(){var n,o,i,a;return __generator$1(this,function(s){switch(s.label){case 0:return[4,this.getSessionAndUser(r)];case 1:if(!(n=s.sent())||t!==n.session.accessToken)throw new Error("Invalid Google Classroom session");return o=this.getOAuthClient(t,n.user.refreshToken),[4,new GoogleClassroomClient(this.baseUrl,o).createAnnouncementAttachment(e)];case 2:return i=s.sent(),a=__assign(__assign({},i),{attachmentId:i.id,createdAt:(new Date).toISOString()}),[4,this.firestoreClient.upsertClassroomAttachment(a)];case 3:return s.sent(),[4,this.firestoreClient.getClassroomAttachmentById(i.id)];case 4:return[2,s.sent()]}})})},e}();exports.OakGoogleClassroomAddOn=OakGoogleClassroomAddOn,exports.OakGoogleClassroomException=OakGoogleClassroomException;
105
+ const privateData=new WeakMap,wrappers=new WeakMap;function pd(e){const t=privateData.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function setCancelFlag(e){null==e.passiveListener?e.event.cancelable&&(e.canceled=!0,"function"==typeof e.event.preventDefault&&e.event.preventDefault()):"undefined"!=typeof console&&"function"==typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener)}function Event(e,t){privateData.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const r=Object.keys(t);for(let e=0;e<r.length;++e){const t=r[e];t in this||Object.defineProperty(this,t,defineRedirectDescriptor(t))}}function defineRedirectDescriptor(e){return{get(){return pd(this).event[e]},set(t){pd(this).event[e]=t},configurable:!0,enumerable:!0}}function defineCallDescriptor(e){return{value(){const t=pd(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function defineWrapper(e,t){const r=Object.keys(t);if(0===r.length)return e;function n(t,r){e.call(this,t,r)}n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let o=0;o<r.length;++o){const i=r[o];if(!(i in e.prototype)){const e="function"==typeof Object.getOwnPropertyDescriptor(t,i).value;Object.defineProperty(n.prototype,i,e?defineCallDescriptor(i):defineRedirectDescriptor(i))}}return n}function getWrapper(e){if(null==e||e===Object.prototype)return Event;let t=wrappers.get(e);return null==t&&(t=defineWrapper(getWrapper(Object.getPrototypeOf(e)),e),wrappers.set(e,t)),t}function wrapEvent(e,t){return new(getWrapper(Object.getPrototypeOf(t)))(e,t)}function isStopped(e){return pd(e).immediateStopped}function setEventPhase(e,t){pd(e).eventPhase=t}function setCurrentTarget(e,t){pd(e).currentTarget=t}function setPassiveListener(e,t){pd(e).passiveListener=t}Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){const e=pd(this).currentTarget;return null==e?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){const e=pd(this);e.stopped=!0,"function"==typeof e.event.stopPropagation&&e.event.stopPropagation()},stopImmediatePropagation(){const e=pd(this);e.stopped=!0,e.immediateStopped=!0,"function"==typeof e.event.stopImmediatePropagation&&e.event.stopImmediatePropagation()},get bubbles(){return Boolean(pd(this).event.bubbles)},get cancelable(){return Boolean(pd(this).event.cancelable)},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return Boolean(pd(this).event.composed)},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(e){if(!e)return;const t=pd(this);t.stopped=!0,"boolean"==typeof t.event.cancelBubble&&(t.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(e){e||setCancelFlag(pd(this))},initEvent(){}},Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.Event&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));const listenersMap=new WeakMap,CAPTURE=1,BUBBLE=2,ATTRIBUTE=3;function isObject(e){return null!==e&&"object"==typeof e}function getListeners(e){const t=listenersMap.get(e);if(null==t)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function defineEventAttributeDescriptor(e){return{get(){let t=getListeners(this).get(e);for(;null!=t;){if(t.listenerType===ATTRIBUTE)return t.listener;t=t.next}return null},set(t){"function"==typeof t||isObject(t)||(t=null);const r=getListeners(this);let n=null,o=r.get(e);for(;null!=o;)o.listenerType===ATTRIBUTE?null!==n?n.next=o.next:null!==o.next?r.set(e,o.next):r.delete(e):n=o,o=o.next;if(null!==t){const o={listener:t,listenerType:ATTRIBUTE,passive:!1,once:!1,next:null};null===n?r.set(e,o):n.next=o}},configurable:!0,enumerable:!0}}function defineEventAttribute(e,t){Object.defineProperty(e,`on${t}`,defineEventAttributeDescriptor(t))}function defineCustomEventTarget(e){function t(){EventTarget.call(this)}t.prototype=Object.create(EventTarget.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)defineEventAttribute(t.prototype,e[r]);return t}function EventTarget(){if(!(this instanceof EventTarget)){if(1===arguments.length&&Array.isArray(arguments[0]))return defineCustomEventTarget(arguments[0]);if(arguments.length>0){const e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return defineCustomEventTarget(e)}throw new TypeError("Cannot call a class as a function")}listenersMap.set(this,new Map)}EventTarget.prototype={addEventListener(e,t,r){if(null==t)return;if("function"!=typeof t&&!isObject(t))throw new TypeError("'listener' should be a function or an object.");const n=getListeners(this),o=isObject(r),i=(o?Boolean(r.capture):Boolean(r))?CAPTURE:BUBBLE,a={listener:t,listenerType:i,passive:o&&Boolean(r.passive),once:o&&Boolean(r.once),next:null};let s=n.get(e);if(void 0===s)return void n.set(e,a);let l=null;for(;null!=s;){if(s.listener===t&&s.listenerType===i)return;l=s,s=s.next}l.next=a},removeEventListener(e,t,r){if(null==t)return;const n=getListeners(this),o=(isObject(r)?Boolean(r.capture):Boolean(r))?CAPTURE:BUBBLE;let i=null,a=n.get(e);for(;null!=a;){if(a.listener===t&&a.listenerType===o)return void(null!==i?i.next=a.next:null!==a.next?n.set(e,a.next):n.delete(e));i=a,a=a.next}},dispatchEvent(e){if(null==e||"string"!=typeof e.type)throw new TypeError('"event.type" should be a string.');const t=getListeners(this),r=e.type;let n=t.get(r);if(null==n)return!0;const o=wrapEvent(this,e);let i=null;for(;null!=n;){if(n.once?null!==i?i.next=n.next:null!==n.next?t.set(r,n.next):t.delete(r):i=n,setPassiveListener(o,n.passive?n.listener:null),"function"==typeof n.listener)try{n.listener.call(this,o)}catch(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e)}else n.listenerType!==ATTRIBUTE&&"function"==typeof n.listener.handleEvent&&n.listener.handleEvent(o);if(isStopped(o))break;n=n.next}return setPassiveListener(o,null),setEventPhase(o,0),setCurrentTarget(o,null),!o.defaultPrevented}},Object.defineProperty(EventTarget.prototype,"constructor",{value:EventTarget,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.EventTarget&&Object.setPrototypeOf(EventTarget.prototype,window.EventTarget.prototype);class AbortSignal extends EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){const e=abortedFlags.get(this);if("boolean"!=typeof e)throw new TypeError("Expected 'this' to be an 'AbortSignal' object, but got "+(null===this?"null":typeof this));return e}}function createAbortSignal(){const e=Object.create(AbortSignal.prototype);return EventTarget.call(e),abortedFlags.set(e,!1),e}function abortSignal(e){!1===abortedFlags.get(e)&&(abortedFlags.set(e,!0),e.dispatchEvent({type:"abort"}))}defineEventAttribute(AbortSignal.prototype,"abort");const abortedFlags=new WeakMap;Object.defineProperties(AbortSignal.prototype,{aborted:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(AbortSignal.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});let AbortController$1=class{constructor(){signals.set(this,createAbortSignal())}get signal(){return getSignal(this)}abort(){abortSignal(getSignal(this))}};const signals=new WeakMap;function getSignal(e){const t=signals.get(e);if(null==t)throw new TypeError("Expected 'this' to be an 'AbortController' object, but got "+(null===e?"null":typeof e));return t}Object.defineProperties(AbortController$1.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(AbortController$1.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});var abortController=Object.freeze({__proto__:null,AbortController:AbortController$1,AbortSignal:AbortSignal,default:AbortController$1}),require$$1=getAugmentedNamespace(abortController),streamArrayParser={},hasRequiredStreamArrayParser,hasRequiredFallbackServiceStub;function requireStreamArrayParser(){if(hasRequiredStreamArrayParser)return streamArrayParser;hasRequiredStreamArrayParser=1,Object.defineProperty(streamArrayParser,"__esModule",{value:!0}),streamArrayParser.StreamArrayParser=void 0;const e=require$$1,t=Stream__default.default,r=requireFallbackRest(),n=requireFeatureDetection();class o extends t.Transform{constructor(t,r){super(Object.assign({},r,{readableObjectMode:!0})),this._done=!1,this._prevBlock=Buffer.from(""),this._isInString=!1,this._isSkipped=!1,this._level=0,this.rpc=t,this.cancelController=(0,n.hasAbortController)()?new AbortController:new e.AbortController,this.cancelSignal=this.cancelController.signal,this.cancelRequested=!1}_transform(e,t,n){let o=0,i=0;for(0===this._level&&0===i&&("["!==String.fromCharCode(e[0])&&this.emit("error",new Error(`Internal Error: API service stream data must start with a '[' and close with the corresponding ']', but it start with ${String.fromCharCode(e[0])}`)),i++,this._level++);i<e.length;){const t=String.fromCharCode(e[i]);if(this._isSkipped)this._isSkipped=!1;else switch(t){case"{":this._isInString||this._level++,this._isInString||2!==this._level||(o=i);break;case'"':this._isInString=!this._isInString;break;case"}":if(this._isInString||this._level--,!this._isInString&&1===this._level){const t=Buffer.concat([this._prevBlock,e.slice(o,i+1)]);try{const e=(0,r.decodeResponse)(this.rpc,!0,t);this.push(e)}catch(e){this.emit("error",e)}o=i+1,this._prevBlock=Buffer.from("")}break;case"]":this._isInString||1!==this._level||(this._done=!0,this.push(null));break;case"\\":this._isSkipped=!0}i++}this._level>1&&(this._prevBlock=Buffer.concat([this._prevBlock,e.slice(o,i)])),n()}_flush(e){e()}cancel(){this._done=!0,this.cancelRequested=!0,this.cancelController.abort(),this.end()}}return streamArrayParser.StreamArrayParser=o,streamArrayParser}function requireFallbackServiceStub(){if(hasRequiredFallbackServiceStub)return fallbackServiceStub;hasRequiredFallbackServiceStub=1,Object.defineProperty(fallbackServiceStub,"__esModule",{value:!0}),fallbackServiceStub.generateServiceStub=function(i,a,s,l,p,d,u,c){const f=(0,r.hasWindowFetch)()?window.fetch:e.default,h={close:()=>({cancel:()=>{}})};for(const[e,m]of Object.entries(i))h[e]=(e,i,h,g)=>{let y;null!=i||(i={});try{y=d(m,a,s,l,e,c)}catch(e){return g&&g(e),{cancel(){}}}const v=(0,r.hasAbortController)()?new AbortController:new t.AbortController,b=v.signal;let O=!1;const w=y.url,S=y.headers;for(const e of Object.keys(i))S[e]=i[e][0];const _=new n.StreamArrayParser(m);return p.getRequestHeaders().then(e=>{const t={headers:{...e,...S},body:y.body,method:y.method,signal:b};return"GET"!==y.method&&"DELETE"!==y.method||delete t.body,f(w,t)}).then(e=>e.ok&&m.responseStream?void(0,o.pipeline)(e.body,_,e=>{e&&(!O||e instanceof Error&&"AbortError"!==e.name)&&(g&&g(e),_.emit("error",e))}):Promise.all([Promise.resolve(e.ok),e.arrayBuffer()]).then(([e,t])=>{const r=u(m,e,t);g(null,r)}).catch(e=>{if(!O||"AbortError"!==e.name)if(m.responseStream)g&&g(e),_.emit("error",e);else{if(!g)throw e;g(e)}})).catch(e=>{if(m.responseStream)g&&g(e),_.emit("error",e);else{if(!g)throw e;g(e)}}),m.responseStream?_:{cancel:()=>{O=!0,v.abort()}}};return h};const e=require$$2$1,t=require$$1,r=requireFeatureDetection(),n=requireStreamArrayParser(),o=Stream__default.default;return fallbackServiceStub}var streaming={},readable={exports:{}},stream,hasRequiredStream,buffer_list,hasRequiredBuffer_list,destroy_1,hasRequiredDestroy;function requireStream(){return hasRequiredStream?stream:(hasRequiredStream=1,stream=Stream__default.default)}function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach(function(e){r(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function r(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}hasRequiredBuffer_list=1;var i=require$$0__default$7.default.Buffer,a=require$$1__default$4.default.inspect,s=a&&a.custom||"inspect";function l(e,t,r){i.prototype.copy.call(e,t,r)}return buffer_list=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return n(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t=i.allocUnsafe(e>>>0),r=this.head,n=0;r;)l(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0===(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0===(e-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,t}},{key:s,value:function(e,r){return a(this,t(t({},r),{},{depth:0,customInspect:!1}))}}]),e}()}function requireDestroy(){if(hasRequiredDestroy)return destroy_1;function e(e,n){r(e,n),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}return hasRequiredDestroy=1,destroy_1={destroy:function(n,o){var i=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,n)):process.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(r){!o&&r?i._writableState?i._writableState.errorEmitted?process.nextTick(t,i):(i._writableState.errorEmitted=!0,process.nextTick(e,i,r)):process.nextTick(e,i,r):o?(process.nextTick(t,i),o(r)):process.nextTick(t,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}},destroy_1}var errors={},hasRequiredErrors,state,hasRequiredState;function requireErrors(){if(hasRequiredErrors)return errors;hasRequiredErrors=1;const e={};function t(t,r,n){n||(n=Error);class o extends n{constructor(e,t,n){super(function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(e,t,n))}}o.prototype.name=n.name,o.prototype.code=t,e[t]=o}function r(e,t){if(Array.isArray(e)){const r=e.length;return e=e.map(e=>String(e)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}return t("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(e,t,n){let o;var i;let a;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a=`The ${e} ${o} ${r(t,"type")}`;else{const n=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a=`The "${e}" ${n} ${o} ${r(t,"type")}`}return a+=". Received type "+typeof n,a},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errors.codes=e,errors}function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var e=requireErrors().codes.ERR_INVALID_OPT_VALUE;return state={getHighWaterMark:function(t,r,n,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(r,o,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new e(o?n:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}}}var inherits={exports:{}},inherits_browser={exports:{}},hasRequiredInherits_browser,hasRequiredInherits,node$1,hasRequiredNode$1,_stream_writable,hasRequired_stream_writable,_stream_duplex,hasRequired_stream_duplex;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,"function"==typeof Object.create?inherits_browser.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),inherits_browser.exports}function requireInherits(){if(hasRequiredInherits)return inherits.exports;hasRequiredInherits=1;try{var e=require("util");if("function"!=typeof e.inherits)throw"";inherits.exports=e.inherits}catch(e){inherits.exports=requireInherits_browser()}return inherits.exports}function requireNode$1(){return hasRequiredNode$1?node$1:(hasRequiredNode$1=1,node$1=require$$1__default$4.default.deprecate)}function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var t;hasRequired_stream_writable=1,_stream_writable=w,w.WritableState=O;var r={deprecate:requireNode$1()},n=requireStream(),o=require$$0__default$7.default.Buffer,i=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,s=requireDestroy(),l=requireState().getHighWaterMark,p=requireErrors().codes,d=p.ERR_INVALID_ARG_TYPE,u=p.ERR_METHOD_NOT_IMPLEMENTED,c=p.ERR_MULTIPLE_CALLBACK,f=p.ERR_STREAM_CANNOT_PIPE,h=p.ERR_STREAM_DESTROYED,m=p.ERR_STREAM_NULL_VALUES,g=p.ERR_STREAM_WRITE_AFTER_END,y=p.ERR_UNKNOWN_ENCODING,v=s.errorOrDestroy;function b(){}function O(r,n,o){t=t||require_stream_duplex(),r=r||{},"boolean"!=typeof o&&(o=n instanceof t),this.objectMode=!!r.objectMode,o&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=l(this,r,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===r.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new c;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(C,e,t),e._writableState.errorEmitted=!0,v(e,n)):(o(n),e._writableState.errorEmitted=!0,v(e,n),C(e,t))}(e,r,n,t,o);else{var i=E(r)||e.destroyed;i||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),n?process.nextTick(_,e,r,i,o):_(e,r,i,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function w(e){var r=this instanceof(t=t||require_stream_duplex());if(!r&&!a.call(w,this))return new w(e);this._writableState=new O(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function S(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new h("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function P(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var o=r.bufferedRequestCount,i=new Array(o),a=r.corkedRequestsFree;a.entry=n;for(var s=0,l=!0;n;)i[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;i.allBuffers=l,S(t,r,!0,r.length,i,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;n;){var p=n.chunk,d=n.encoding,u=n.callback;if(S(t,r,!1,r.objectMode?1:p.length,p,d,u),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final(function(r){t.pendingcb--,r&&v(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)})}function C(e,t){var r=E(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}return requireInherits()(w,n),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===w&&(e&&e._writableState instanceof O)}})):a=function(e){return e instanceof this},w.prototype.pipe=function(){v(this,new f)},w.prototype.write=function(e,t,r){var n,a=this._writableState,s=!1,l=!a.objectMode&&(n=e,o.isBuffer(n)||n instanceof i);return l&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),l?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=b),a.ending?function(e,t){var r=new g;v(e,r),process.nextTick(t,r)}(this,r):(l||function(e,t,r,n){var o;return null===r?o=new m:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(v(e,o),process.nextTick(n,o),!1)}(this,a,e,r))&&(a.pendingcb++,s=function(e,t,r,n,i,a){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var l=t.objectMode?1:n.length;t.length+=l;var p=t.length<t.highWaterMark;p||(t.needDrain=!0);if(t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,l,n,i,a);return p}(this,a,l,e,t,r)),s},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,r){r(new u("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,C(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=s.destroy,w.prototype._undestroy=s.undestroy,w.prototype._destroy=function(e,t){t(e)},_stream_writable}function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};_stream_duplex=a;var t=require_stream_readable(),r=require_stream_writable();requireInherits()(a,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var i=n[o];a.prototype[i]||(a.prototype[i]=r.prototype[i])}function a(e){if(!(this instanceof a))return new a(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||process.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),_stream_duplex}var string_decoder={},safeBuffer={exports:{}},hasRequiredSafeBuffer,hasRequiredString_decoder,endOfStream$1,hasRequiredEndOfStream$1,async_iterator,hasRequiredAsync_iterator,from_1,hasRequiredFrom,_stream_readable,hasRequired_stream_readable,_stream_transform,hasRequired_stream_transform,_stream_passthrough,hasRequired_stream_passthrough,pipeline_1,hasRequiredPipeline,hasRequiredReadable;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(e,t){var r=require$$0__default$7.default,n=r.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i),i.prototype=Object.create(n.prototype),o(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=n(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var e=requireSafeBuffer().Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=i,this.end=a,n=4;break;case"utf8":this.fillLast=o,n=4;break;case"base64":this.text=s,this.end=l,n=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function i(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function s(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}return string_decoder.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var o=t.length-1;if(o<r)return 0;var i=n(t[o]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--o<r||-2===i)return 0;if(i=n(t[o]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--o<r||-2===i)return 0;if(i=n(t[o]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var o=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,o),e.toString("utf8",t,o)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},string_decoder}function requireEndOfStream$1(){if(hasRequiredEndOfStream$1)return endOfStream$1;hasRequiredEndOfStream$1=1;var e=requireErrors().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return endOfStream$1=function r(n,o,i){if("function"==typeof o)return r(n,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||t);var a=o.readable||!1!==o.readable&&n.readable,s=o.writable||!1!==o.writable&&n.writable,l=function(){n.writable||d()},p=n._writableState&&n._writableState.finished,d=function(){s=!1,p=!0,a||i.call(n)},u=n._readableState&&n._readableState.endEmitted,c=function(){a=!1,u=!0,s||i.call(n)},f=function(e){i.call(n,e)},h=function(){var t;return a&&!u?(n._readableState&&n._readableState.ended||(t=new e),i.call(n,t)):s&&!p?(n._writableState&&n._writableState.ended||(t=new e),i.call(n,t)):void 0},m=function(){n.req.on("finish",d)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(n)?s&&!n._writableState&&(n.on("end",l),n.on("close",l)):(n.on("complete",d),n.on("abort",h),n.req?m():n.on("request",m)),n.on("end",c),n.on("finish",d),!1!==o.error&&n.on("error",f),n.on("close",h),function(){n.removeListener("complete",d),n.removeListener("abort",h),n.removeListener("request",m),n.req&&n.req.removeListener("finish",d),n.removeListener("end",l),n.removeListener("close",l),n.removeListener("finish",d),n.removeListener("end",c),n.removeListener("error",f),n.removeListener("close",h)}},endOfStream$1}function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredAsync_iterator=1;var r=requireEndOfStream$1(),n=Symbol("lastResolve"),o=Symbol("lastReject"),i=Symbol("error"),a=Symbol("ended"),s=Symbol("lastPromise"),l=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function u(e){var t=e[n];if(null!==t){var r=e[p].read();null!==r&&(e[s]=null,e[n]=null,e[o]=null,t(d(r,!1)))}}function c(e){process.nextTick(u,e)}var f=Object.getPrototypeOf(function(){}),h=Object.setPrototypeOf((e={get stream(){return this[p]},next:function(){var e=this,t=this[i];if(null!==t)return Promise.reject(t);if(this[a])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,r){process.nextTick(function(){e[i]?r(e[i]):t(d(void 0,!0))})});var r,n=this[s];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[a]?r(d(void 0,!0)):t[l](r,n)},n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[l])}return this[s]=r,r}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),e),f);return async_iterator=function(e){var u,f=Object.create(h,(t(u={},p,{value:e,writable:!0}),t(u,n,{value:null,writable:!0}),t(u,o,{value:null,writable:!0}),t(u,i,{value:null,writable:!0}),t(u,a,{value:e._readableState.endEmitted,writable:!0}),t(u,l,{value:function(e,t){var r=f[p].read();r?(f[s]=null,f[n]=null,f[o]=null,e(d(r,!1))):(f[n]=e,f[o]=t)},writable:!0}),u));return f[s]=null,r(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=f[o];return null!==t&&(f[s]=null,f[n]=null,f[o]=null,t(e)),void(f[i]=e)}var r=f[n];null!==r&&(f[s]=null,f[n]=null,f[o]=null,r(d(void 0,!0))),f[a]=!0}),e.on("readable",c.bind(null,f)),f},async_iterator}function requireFrom(){if(hasRequiredFrom)return from_1;function e(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredFrom=1;var n=requireErrors().codes.ERR_INVALID_ARG_TYPE;return from_1=function(o,i,a){var s;if(i&&"function"==typeof i.next)s=i;else if(i&&i[Symbol.asyncIterator])s=i[Symbol.asyncIterator]();else{if(!i||!i[Symbol.iterator])throw new n("iterable",["Iterable"],i);s=i[Symbol.iterator]()}var l=new o(function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}({objectMode:!0},a)),p=!1;function d(){return u.apply(this,arguments)}function u(){var t;return t=function*(){try{var e=yield s.next(),t=e.value;e.done?l.push(null):l.push(yield t)?d():p=!1}catch(e){l.destroy(e)}},u=function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,l,"next",t)}function l(t){e(a,o,i,s,l,"throw",t)}s(void 0)})},u.apply(this,arguments)}return l._read=function(){p||(p=!0,d())},l},from_1}function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;var e;hasRequired_stream_readable=1,_stream_readable=w,w.ReadableState=O,require$$0__default$3.default.EventEmitter;var t=function(e,t){return e.listeners(t).length},r=requireStream(),n=require$$0__default$7.default.Buffer,o=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var i,a=require$$1__default$4.default;i=a&&a.debuglog?a.debuglog("stream"):function(){};var s,l,p,d=requireBuffer_list(),u=requireDestroy(),c=requireState().getHighWaterMark,f=requireErrors().codes,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_STREAM_PUSH_AFTER_EOF,g=f.ERR_METHOD_NOT_IMPLEMENTED,y=f.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;requireInherits()(w,r);var v=u.errorOrDestroy,b=["error","close","destroy","pause","resume"];function O(t,r,n){e=e||require_stream_duplex(),t=t||{},"boolean"!=typeof n&&(n=r instanceof e),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=c(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(s||(s=requireString_decoder().StringDecoder),this.decoder=new s(t.encoding),this.encoding=t.encoding)}function w(t){if(e=e||require_stream_duplex(),!(this instanceof w))return new w(t);var n=this instanceof e;this._readableState=new O(t,this,n),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),r.call(this)}function S(e,t,r,a,s){i("readableAddChunk",t);var l,p=e._readableState;if(null===t)p.reading=!1,function(e,t){if(i("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}(e,p);else if(s||(l=function(e,t){var r;i=t,n.isBuffer(i)||i instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new h("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(p,t)),l)v(e,l);else if(p.objectMode||t&&t.length>0)if("string"==typeof t||p.objectMode||Object.getPrototypeOf(t)===n.prototype||(t=function(e){return n.from(e)}(t)),a)p.endEmitted?v(e,new y):_(e,p,t,!0);else if(p.ended)v(e,new m);else{if(p.destroyed)return!1;p.reading=!1,p.decoder&&!r?(t=p.decoder.write(t),p.objectMode||0!==t.length?_(e,p,t,!1):R(e,p)):_(e,p,t,!1)}else a||(p.reading=!1,R(e,p));return!p.ended&&(p.length<p.highWaterMark||0===p.length)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),R(e,t)}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=u.destroy,w.prototype._undestroy=u.undestroy,w.prototype._destroy=function(e,t){t(e)},w.prototype.push=function(e,t){var r,o=this._readableState;return o.objectMode?r=!0:"string"==typeof e&&((t=t||o.defaultEncoding)!==o.encoding&&(e=n.from(e,t),t=""),r=!0),S(this,e,t,!1,r)},w.prototype.unshift=function(e){return S(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(e){s||(s=requireString_decoder().StringDecoder);var t=new s(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var P=1073741824;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(C,e))}function C(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,A(e)}function R(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(D,e,t))}function D(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function x(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){i("readable nexttick read 0"),e.read(0)}function j(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function I(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(q,t,e))}function q(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return w.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):T(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&I(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){v(this,new g("_read()"))},w.prototype.pipe=function(e,r){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,i("pipe count=%d opts=%j",o.pipesCount,r);var a=(!r||!1!==r.end)&&e!==process.stdout&&e!==process.stderr?l:m;function s(t,r){i("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",p),e.removeListener("error",c),e.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",u),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function l(){i("onend"),e.end()}o.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",s);var p=function(e){return function(){var r=e._readableState;i("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&t(e,"data")&&(r.flowing=!0,A(e))}}(n);e.on("drain",p);var d=!1;function u(t){i("ondata");var r=e.write(t);i("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!d&&(i("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function c(r){i("onerror",r),m(),e.removeListener("error",c),0===t(e,"error")&&v(e,r)}function f(){e.removeListener("finish",h),m()}function h(){i("onfinish"),e.removeListener("close",f),m()}function m(){i("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",f),e.once("finish",h),e.emit("pipe",n),o.flowing||(i("pipe resume"),n.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=M(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var n=r.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,i("on readable",o.length,o.reading),o.length?T(this):o.reading||process.nextTick(k,this))),n},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(e,t){var n=r.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(x,this),n},w.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(x,this),t},w.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(j,e,t))}(this,e)),e.paused=!1,this},w.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<b.length;a++)e.on(b[a],this.emit.bind(this,b[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(w.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=requireAsync_iterator()),l(this)}),Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(w.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(w.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),w._fromList=N,Object.defineProperty(w.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(w.from=function(e,t){return void 0===p&&(p=requireFrom()),p(w,e,t)}),_stream_readable}function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=s;var e=requireErrors().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=require_stream_duplex();function a(e,t){var n=this._transformState;n.transforming=!1;var o=n.writecb;if(null===o)return this.emit("error",new r);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),o(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush(function(t,r){p(e,t,r)})}function p(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new n;return e.push(null)}return requireInherits()(s,i),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,i.prototype.push.call(this,e,t)},s.prototype._transform=function(e,r,n){n(new t("_transform()"))},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},s.prototype._destroy=function(e,t){i.prototype._destroy.call(this,e,function(e){t(e)})},_stream_transform}function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=t;var e=require_stream_transform();function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return requireInherits()(t,e),t.prototype._transform=function(e,t,r){r(null,e)},_stream_passthrough}function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;var e;hasRequiredPipeline=1;var t=requireErrors().codes,r=t.ERR_MISSING_ARGS,n=t.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function i(e){e()}function a(e,t){return e.pipe(t)}return pipeline_1=function(){for(var t=arguments.length,s=new Array(t),l=0;l<t;l++)s[l]=arguments[l];var p,d=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new r("streams");var u=s.map(function(t,r){var o=r<s.length-1;return function(t,r,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var a=!1;t.on("close",function(){a=!0}),void 0===e&&(e=requireEndOfStream$1()),e(t,{readable:r,writable:o},function(e){if(e)return i(e);a=!0,i()});var s=!1;return function(e){if(!a&&!s)return s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void i(e||new n("pipe"))}}(t,o,r>0,function(e){p||(p=e),e&&u.forEach(i),o||(u.forEach(i),d(p))})});return s.reduce(a)},pipeline_1}function requireReadable(){return hasRequiredReadable||(hasRequiredReadable=1,function(e,t){var r=Stream__default.default;"disable"===process.env.READABLE_STREAM&&r?(e.exports=r.Readable,Object.assign(e.exports,r),e.exports.Stream=r):((t=e.exports=require_stream_readable()).Stream=r||t,t.Readable=t,t.Writable=require_stream_writable(),t.Duplex=require_stream_duplex(),t.Transform=require_stream_transform(),t.PassThrough=require_stream_passthrough(),t.finished=requireEndOfStream$1(),t.pipeline=requirePipeline())}(readable,readable.exports)),readable.exports}var once={exports:{}},wrappy_1,hasRequiredWrappy,hasRequiredOnce,endOfStream,hasRequiredEndOfStream,streamShift,hasRequiredStreamShift,duplexify,hasRequiredDuplexify;function requireWrappy(){if(hasRequiredWrappy)return wrappy_1;return hasRequiredWrappy=1,wrappy_1=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),o=e[e.length-1];return"function"==typeof n&&n!==o&&Object.keys(o).forEach(function(e){n[e]=o[e]}),n}},wrappy_1}function requireOnce(){if(hasRequiredOnce)return once.exports;hasRequiredOnce=1;var e=requireWrappy();function t(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function r(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}return once.exports=e(t),once.exports.strict=e(r),t.proto=t(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return t(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return r(this)},configurable:!0})}),once.exports}function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var e=requireOnce(),t=function(){},r=commonjsGlobal.Bare?queueMicrotask:process.nextTick.bind(process),n=function(o,i,a){if("function"==typeof i)return n(o,null,i);i||(i={}),a=e(a||t);var s=o._writableState,l=o._readableState,p=i.readable||!1!==i.readable&&o.readable,d=i.writable||!1!==i.writable&&o.writable,u=!1,c=function(){o.writable||f()},f=function(){d=!1,p||a.call(o)},h=function(){p=!1,d||a.call(o)},m=function(e){a.call(o,e?new Error("exited with error code: "+e):null)},g=function(e){a.call(o,e)},y=function(){r(v)},v=function(){if(!u)return(!p||l&&l.ended&&!l.destroyed)&&(!d||s&&s.ended&&!s.destroyed)?void 0:a.call(o,new Error("premature close"))},b=function(){o.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(o)?d&&!s&&(o.on("end",c),o.on("close",c)):(o.on("complete",f),o.on("abort",y),o.req?b():o.on("request",b)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(o)&&o.on("exit",m),o.on("end",h),o.on("finish",f),!1!==i.error&&o.on("error",g),o.on("close",y),function(){u=!0,o.removeListener("complete",f),o.removeListener("abort",y),o.removeListener("request",b),o.req&&o.req.removeListener("finish",f),o.removeListener("end",c),o.removeListener("close",c),o.removeListener("finish",f),o.removeListener("exit",m),o.removeListener("end",h),o.removeListener("error",g),o.removeListener("close",y)}};return endOfStream=n}function requireStreamShift(){if(hasRequiredStreamShift)return streamShift;return hasRequiredStreamShift=1,streamShift=function(e){var t=e._readableState;return t?t.objectMode||"number"==typeof e._duplexState?e.read():e.read(function(e){if(e.buffer.length){var t=e.bufferIndex||0;if(e.buffer.head)return e.buffer.head.data.length;if(e.buffer.length-t>0&&e.buffer[t])return e.buffer[t].length}return e.length}(t)):null},streamShift}function requireDuplexify(){if(hasRequiredDuplexify)return duplexify;hasRequiredDuplexify=1;var e=requireReadable(),t=requireEndOfStream(),r=requireInherits(),n=requireStreamShift(),o=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),i=function(e,t){e._corked?e.once("uncork",t):t()},a=function(e,t){return function(r){r?function(e,t){e._autoDestroy&&e.destroy(t)}(e,"premature close"===r.message?null:r):t&&!e._ended&&e.end()}},s=function(){},l=function(t,r,n){if(!(this instanceof l))return new l(t,r,n);e.Duplex.call(this,n),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!n||!1!==n.autoDestroy,this._forwardDestroy=!n||!1!==n.destroy,this._forwardEnd=!n||!1!==n.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),r&&this.setReadable(r)};return r(l,e.Duplex),l.obj=function(e,t,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new l(e,t,r)},l.prototype.cork=function(){1===++this._corked&&this.emit("cork")},l.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},l.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var r=this,n=t(e,{writable:!0,readable:!1},a(this,this._forwardEnd)),o=function(){var e=r._ondrain;r._ondrain=null,e&&e()};this._unwrite&&process.nextTick(o),this._writable=e,this._writable.on("drain",o),this._unwrite=function(){r._writable.removeListener("drain",o),n()},this.uncork()}else this.end()},l.prototype.setReadable=function(r){if(this._unread&&this._unread(),this.destroyed)r&&r.destroy&&r.destroy();else{if(null===r||!1===r)return this.push(null),void this.resume();var n,o=this,i=t(r,{writable:!1,readable:!0},a(this)),s=function(){o._forward()},l=function(){o.push(null)};this._drained=!0,this._readable=r,this._readable2=r._readableState?r:(n=r,new e.Readable({objectMode:!0,highWaterMark:16}).wrap(n)),this._readable2.on("readable",s),this._readable2.on("end",l),this._unread=function(){o._readable2.removeListener("readable",s),o._readable2.removeListener("end",l),i()},this._forward()}},l.prototype._read=function(){this._drained=!0,this._forward()},l.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=n(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},l.prototype.destroy=function(e,t){if(t||(t=s),this.destroyed)return t(null);this.destroyed=!0;var r=this;process.nextTick(function(){r._destroy(e),t(null)})},l.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},l.prototype._write=function(e,t,r){if(!this.destroyed)return this._corked?i(this,this._write.bind(this,e,t,r)):e===o?this._finish(r):this._writable?void(!1===this._writable.write(e)?this._ondrain=r:this.destroyed||r()):r()},l.prototype._finish=function(e){var t=this;this.emit("preend"),i(this,function(){var r,n;r=t._forwardEnd&&t._writable,n=function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit("prefinish"),i(t,e)},r?r._writableState&&r._writableState.finished?n():r._writableState?r.end(n):(r.end(),n()):n()})},l.prototype.end=function(t,r,n){return"function"==typeof t?this.end(null,null,t):"function"==typeof r?this.end(t,null,r):(this._ended=!0,t&&this.write(t),this._writableState.ending||this._writableState.destroyed||this.write(o),e.Writable.prototype.end.call(this,n))},duplexify=l}var retryRequest={exports:{}},extend,hasRequiredExtend,hasRequiredRetryRequest,hasRequiredStreaming;function requireExtend(){if(hasRequiredExtend)return extend;hasRequiredExtend=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(r){if(!r||"[object Object]"!==t.call(r))return!1;var n,o=e.call(r,"constructor"),i=r.constructor&&r.constructor.prototype&&e.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!o&&!i)return!1;for(n in r);return void 0===n||e.call(r,n)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(n)return n(t,r).value}return t[r]};return extend=function e(){var t,r,n,l,p,d,u=arguments[0],c=1,f=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});c<f;++c)if(null!=(t=arguments[c]))for(r in t)n=s(u,r),u!==(l=s(t,r))&&(h&&l&&(i(l)||(p=o(l)))?(p?(p=!1,d=n&&o(n)?n:[]):d=n&&i(n)?n:{},a(u,{name:r,newValue:e(h,d,l)})):void 0!==l&&a(u,{name:r,newValue:l}));return u},extend}function requireRetryRequest(){if(hasRequiredRetryRequest)return retryRequest.exports;hasRequiredRetryRequest=1;const{PassThrough:e}=Stream__default.default,t=requireExtend();let r=()=>{};"undefined"!=typeof process&&"env"in process&&"object"==typeof process.env&&"retry-request"===process.env.DEBUG&&(r=e=>{console.log("retry-request:",e)});const n={objectMode:!1,retries:2,maxRetryDelay:64,retryDelayMultiplier:2,totalTimeout:600,noResponseRetries:2,currentRetryAttempt:0,shouldRetryFn:function(e){const t=[[100,199],[429,429],[500,599]],n=e.statusCode;let o;for(r(`Response status: ${n}`);o=t.shift();)if(n>=o[0]&&n<=o[1])return!0}};function o(e){const{maxRetryDelay:t,retryDelayMultiplier:r,retryNumber:n,timeOfFirstRequest:o,totalTimeout:i}=e,a=1e3*t,s=1e3*i,l=Math.floor(1e3*Math.random()),p=1e3*Math.pow(r,n)+l,d=s-(Date.now()-o);return Math.min(p,d,a)}return retryRequest.exports=function(i,a,s){"string"==typeof i&&(i={url:i});const l="function"!=typeof arguments[arguments.length-1];"function"==typeof a&&(s=a);const p=a&&"number"==typeof a.currentRetryAttempt;if(void 0===(a=t({},n,a)).request)throw new Error("A request library must be provided to retry-request.");let d,u,c,f,h=a.currentRetryAttempt,m=0,g=!1;const y={abort:function(){f&&f.abort&&f.abort()}};l&&(d=new e({objectMode:a.objectMode}),d.abort=b);const v=Date.now();return h>0?w(h):O(),l?d:y;function b(){c=null,u&&(u.abort&&u.abort(),u.cancel&&u.cancel(),u.destroy?u.destroy():u.end&&u.end())}function O(){let t=!1;function n(e=[]){t||(t=!0,d.emit("complete",...e))}h++,r(`Current retry attempt: ${h}`),l?(g=!1,c=new e({objectMode:a.objectMode}),u=a.request(i),setImmediate(()=>{d.emit("request")}),u.on("error",e=>{g||(g=!0,S(e))}).on("response",(e,t)=>{g||(g=!0,S(null,e,t))}).on("complete",(...e)=>n(e)).on("finish",(...e)=>n(e)),u.pipe(c)):f=a.request(i,S)}function w(e){l&&b();const t=o({maxRetryDelay:a.maxRetryDelay,retryDelayMultiplier:a.retryDelayMultiplier,retryNumber:e,timeOfFirstRequest:v,totalTimeout:a.totalTimeout});r(`Next retry delay: ${t}`),t<=0?m=a.noResponseRetries+1:setTimeout(O,t)}function S(e,t,r){if(e)return m++,void(m<=a.noResponseRetries?w(m):l?(d.emit("error",e),d.end()):s(e,t,r));(p?h:h-1)<a.retries&&a.shouldRetryFn(t)?w(h):l?(d.emit("response",t),c.pipe(d),u.on("error",e=>{d.destroy(e)})):s(e,t,r)}},retryRequest.exports.defaults=n,retryRequest.exports.getNextRetryDelay=o,retryRequest.exports}function requireStreaming(){if(hasRequiredStreaming)return streaming;hasRequiredStreaming=1,Object.defineProperty(streaming,"__esModule",{value:!0}),streaming.StreamProxy=streaming.StreamType=void 0;const e=requireGax(),t=requireGoogleError(),r=requireStatus(),n=Stream__default.default,o=requireDuplexify(),i=requireRetryRequest();var a;!function(e){e[e.SERVER_STREAMING=1]="SERVER_STREAMING",e[e.CLIENT_STREAMING=2]="CLIENT_STREAMING",e[e.BIDI_STREAMING=3]="BIDI_STREAMING"}(a||(streaming.StreamType=a={}));return streaming.StreamProxy=class extends o{constructor(e,t,r,n){super(void 0,void 0,{objectMode:!0,readable:e!==a.CLIENT_STREAMING,writable:e!==a.SERVER_STREAMING}),this.type=e,this._callback=t,this._isCancelCalled=!1,this._responseHasSent=!1,this.rest=r,this.gaxServerStreamingRetries=n}shouldRetryRequest(e,r){const n=t.GoogleError.parseGRPCStatusDetails(e);let o=this.defaultShouldRetry(n,r);return r.shouldRetryFn&&(o=r.shouldRetryFn(n)),o}cancel(){this.stream?this.stream.cancel():this._isCancelCalled=!0}throwIfMaxRetriesOrTotalTimeoutExceeded(e,n,o,i,a,s){const l=(new Date).getTime();if(a&&(0===o||o<0||e&&l>=e)){const e=new t.GoogleError(`Total timeout of API exceeded ${a} milliseconds ${i?`retrying error ${i} `:""} before any response was received.`);throw e.code=r.Status.DEADLINE_EXCEEDED,e}if(0===n){const e=i;throw e.note="Max retries is set to zero.",e}if(s&&s>=n){const e=new t.GoogleError("Exceeded maximum number of retries "+(i?`retrying error ${i} `:"")+"before any response was received");throw e.code=r.Status.DEADLINE_EXCEEDED,e}}eventForwardHelper(e){["metadata","response","status"].forEach(t=>{e.on(t,this.emit.bind(this,t))})}statusMetadataHelper(e){e.on("status",()=>{this._responseHasSent||e.emit("response",{code:200,details:"",message:"OK"})}),e.on("metadata",t=>{e.emit("response",{code:200,details:"",message:"OK",metadata:t}),this._responseHasSent=!0})}forwardEvents(e){this.eventForwardHelper(e),this.statusMetadataHelper(e),e.on("error",e=>{t.GoogleError.parseGRPCStatusDetails(e)})}defaultShouldRetry(e,t){return!(t.retryCodes.length>0&&t.retryCodes.indexOf(e.code)<0||0===t.retryCodes.length)}setStream(e,t,r={},n){if(this.apiCall=e,this.argument=t,this.type===a.SERVER_STREAMING){if(this.rest){const r=e(t,this._callback);this.stream=r,this.setReadable(r)}else if(this.gaxServerStreamingRetries){const r=()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());return e(t,this._callback)},o=this.newStreamingRetryRequest({request:r,retry:n});this.stream=o,this.eventForwardHelper(o),this.setReadable(o)}else{const n=i(null,{objectMode:!0,request:()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());const r=e(t,this._callback);return this.stream=r,this.forwardEvents(r),r},retries:r.retries,currentRetryAttempt:r.currentRetryAttempt,noResponseRetries:r.noResponseRetries,shouldRetryFn:r.shouldRetryFn});this.setReadable(n)}return}const o=e(t,this._callback);this.stream=o,this.forwardEvents(o),this.type===a.CLIENT_STREAMING&&this.setWritable(o),this.type===a.BIDI_STREAMING&&(this.setReadable(o),this.setWritable(o)),this._isCancelCalled&&this.stream&&this.stream.cancel()}newStreamingRetryRequest(o){var i,a,s,l;const p=null!==(i=o.retry)&&void 0!==i?i:{retryCodes:[],backoffSettings:(0,e.createDefaultBackoffSettings)()};let d=0;const u=new n.PassThrough({objectMode:!0}),c=null!==(a=p.backoffSettings.totalTimeoutMillis)&&void 0!==a?a:void 0,f=null!==(s=p.backoffSettings.maxRetries)&&void 0!==s?s:void 0;let h=null!==(l=p.backoffSettings.initialRpcTimeoutMillis)&&void 0!==l?l:void 0,m=new Date,g=0;c&&(g=m.getTime()+c);const y=(e,r)=>{const n=t.GoogleError.parseGRPCStatusDetails(e);return n.note="Exception occurred in retry method that was not classified as transient",r.destroy(),u.destroy(n),u},v=e=>{let n=!1,i=!1,a=!1;const s=e.request(null);u.cancel=s.cancel;return["metadata","response","status"].forEach(e=>{s.on(e,u.emit.bind(u,e))}),this.statusMetadataHelper(s),s.on("data",e=>{d=0,this.emit.bind(this,"data")(e)}),s.on("status",()=>(i=!0,n&&u.end(),u)),s.on("end",()=>(a||(n=!0,i&&u.end()),u)),s.on("error",e=>{if(a=!0,void 0!==typeof f||void 0!==typeof c){if(this.shouldRetryRequest(e,p)){if(f&&c){const e=new t.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");return e.code=r.Status.INVALID_ARGUMENT,s.destroy(),u.destroy(e),u}{try{this.throwIfMaxRetriesOrTotalTimeoutExceeded(g,f,h,e,c,d)}catch(e){const r=t.GoogleError.parseGRPCStatusDetails(e);return s.destroy(),u.destroy(r),u}const r=p.backoffSettings.retryDelayMultiplier,n=p.backoffSettings.maxRetryDelayMillis,i=p.backoffSettings.rpcTimeoutMultiplier,a=p.backoffSettings.maxRpcTimeoutMillis;let l=p.backoffSettings.initialRetryDelayMillis;const y=Math.random()*l;return(()=>{setTimeout(()=>{if(h){m=new Date,l=Math.min(l*r,n);const e=h&&i?h*i:0,t=a||0,o=g?g-m.getTime():0;h=Math.min(e,t,o)}d++;let e=this.argument;void 0!==p.getResumptionRequestFn&&(e=p.getResumptionRequestFn(e));return o.request=()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());return this.apiCall(e,this._callback)},v(o)},y)})()}}return y(e,s)}return y(e,s)}),u};return v(o)}},streaming}var pathTemplate={},hasRequiredPathTemplate;function requirePathTemplate(){if(hasRequiredPathTemplate)return pathTemplate;hasRequiredPathTemplate=1,Object.defineProperty(pathTemplate,"__esModule",{value:!0}),pathTemplate.PathTemplate=void 0;return pathTemplate.PathTemplate=class{constructor(e){this.bindings={},this.data=e,this.segments=this.parsePathTemplate(e),this.size=this.segments.length}match(e){let t=e.split("/");const r={};if(t.length!==this.segments.length){if(!this.data.includes("**"))throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same.`);if(t.length!==this.segments.length+1)throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same with one wildcard.`)}for(let e=0;e<this.segments.length&&t.length>0;e++)if(this.segments[e]!==t[0]){if(!this.segments[e].includes("*"))throw new TypeError(`segment does not match, ${this.segments[e]} and ${t[e]}.`);{let n=this.segments[e];const o=n.match(/\{[$0-9a-zA-Z_]+=.*?\}/g);if(!o)throw new Error(`Error processing path template segment ${n}`);const i=o.map(e=>e.replace(/^\{/,"").replace(/=.*/,""));if(n.includes("**"))r[i[0]]=t[0]+"/"+t[1],t=t.slice(2);else{if(1===i.length)r[i[0]]=t[0];else{const o=t[0].split(/[-_.~]/);if(o.length!==i.length)throw new Error(`segment ${n} does not match ${t[0]}`);for(const e of i)r[e]=o[0],n=n.replace(`{${e}=*}`,`${o[0]}`),o.shift();if(n!==t[0])throw new TypeError(`non slash resource pattern ${this.segments[e]} and ${t[0]} should have same separator`)}t.shift()}}}else t.shift();return r}render(e){if(Object.keys(e).length!==Object.keys(this.bindings).length)throw new TypeError(`The number of variables ${Object.keys(e).length} does not match the number of needed variables ${Object.keys(this.bindings).length}`);let t=this.inspect();for(const r of Object.keys(e)){const n=e[r].toString();if(!this.bindings[r])throw new TypeError(`render fails for not matching ${e[r]}`);const o=this.bindings[r];if("*"===o){if(!n.match(/[^/{}]+/))throw new TypeError(`render fails for not matching ${n}`);t=t.replace(`{${r}=*}`,`${n}`)}else if("**"===o){if(!n.match(/[^{}]+/))throw new TypeError(`render fails for not matching ${n}`);t=t.replace(`{${r}=**}`,`${n}`)}}return t}inspect(){return this.segments.join("/")}parsePathTemplate(e){const t=function(e){let t=0,r=0,n=0;const o=[];for(;r>=t&&r<e.length;){if("{"===e.charAt(r))n+=1;else if("}"===e.charAt(r))n-=1;else if("/"===e.charAt(r)){if(r===e.length-1)throw new TypeError("Invalid path, it can not be ended by /");0===n&&(o.push(e.substring(t,r)),t=r+1)}if(r===e.length-1){if(0!==n)throw new TypeError("Brackets are invalid.");o.push(e.substring(t))}r+=1}return o}(e);let r=0,n=0;const o=[];let i;if(t.forEach(e=>{if("*"===e||"**"===e)this.bindings[`$${r}`]=e,o.push(`{$${r}=${e}}`),r+=1,"**"===e&&++n;else if(i=e.match(/\{[0-9a-zA-Z-.~_]+(?:=.*?)?\}/g)){for(const t of i){const r=t.match(/^\{([0-9a-zA-Z-.~_]+)(?:=(.*?))?\}$/);if(!r)throw new Error(`Cannot process path template segment ${t}`);const o=r[1];let i=r[2];i?"*"===i?this.bindings[o]=i:"**"===i&&(++n,this.bindings[o]=i):(i="*",e=e.replace(o,o+"=*"),this.bindings[o]=i)}o.push(e)}else e.match(/[0-9a-zA-Z-.~_]+/)&&o.push(e)}),n>1)throw new TypeError("Can not have more than one wildcard.");return o}},pathTemplate}var version$1="4.6.1",require$$19={version:version$1},descriptor={},longRunningDescriptor={},longRunningApiCaller={},longrunning={},hasRequiredLongrunning,hasRequiredLongRunningApiCaller,hasRequiredLongRunningDescriptor;function requireLongrunning(){if(hasRequiredLongrunning)return longrunning;hasRequiredLongrunning=1,Object.defineProperty(longrunning,"__esModule",{value:!0}),longrunning.Operation=void 0,longrunning.operation=function(e,t,r,n){return new o(e,t,r,n)};const e=require$$0__default$3.default,t=requireStatus(),r=requireGoogleError(),n=requireOperations();class o extends e.EventEmitter{constructor(e,t,r,n){super(),this.completeListeners=0,this.hasActiveListeners=!1,this.latestResponse=e,this.name=this.latestResponse.name,this.done=this.latestResponse.done,this.error=this.latestResponse.error,this.longrunningDescriptor=t,this.result=null,this.metadata=null,this.backoffSettings=r,this._unpackResponse(e),this._listenForEvents(),this._callOptions=n}_listenForEvents(){this.on("newListener",e=>{"complete"===e&&(this.completeListeners++,this.hasActiveListeners||(this.hasActiveListeners=!0,this.startPolling_()))}),this.on("removeListener",e=>{"complete"===e&&0===--this.completeListeners&&(this.hasActiveListeners=!1)})}cancel(){this.currentCallPromise_&&this.currentCallPromise_.cancel();const e=this.longrunningDescriptor.operationsClient,t=new n.google.longrunning.CancelOperationRequest;return t.name=this.latestResponse.name,e.cancelOperation(t)}getOperation(e){const t=this,o=this.longrunningDescriptor.operationsClient;function i(){if(!e)return new Promise((e,n)=>{if(t.latestResponse.error){const e=new r.GoogleError(t.latestResponse.error.message);e.code=t.latestResponse.error.code,n(e)}else e([t.result,t.metadata,t.latestResponse])})}if(this.latestResponse.done)return this._unpackResponse(this.latestResponse,e),i();const a=new n.google.longrunning.GetOperationRequest;a.name=this.latestResponse.name,this.currentCallPromise_=o.getOperationInternal(a,this._callOptions);const s=this.currentCallPromise_.then(r=>(t.latestResponse=r[0],t._unpackResponse(r[0],e),i()),t=>{if(!e)return Promise.reject(t);e(t)});return e?void 0:s}_unpackResponse(e,t){const n=this.longrunningDescriptor.responseDecoder,o=this.longrunningDescriptor.metadataDecoder;let i,a;if(e.done){if("error"===e.result){const n=new r.GoogleError(e.error.message);return n.code=e.error.code,this.error=n,void(t&&t(n))}n&&e.response&&(this.response=e.response,i=n(e.response.value),this.result=i,this.done=!0)}o&&e.metadata&&(a=o(e.metadata.value),this.metadata=a),t&&t(null,i,a,e)}startPolling_(){const e=this;let n=new Date;const o=this.backoffSettings.retryDelayMultiplier,i=this.backoffSettings.maxRetryDelayMillis;let a,s=this.backoffSettings.initialRetryDelayMillis,l=1/0;function p(t,...r){e.emit(t,...r)}this.backoffSettings.totalTimeoutMillis&&(l=n.getTime()+this.backoffSettings.totalTimeoutMillis),this.latestResponse.metadata&&(a=this.latestResponse.metadata.value),function d(){if(e.hasActiveListeners){if(n.getTime()>=l){const e=new r.GoogleError("Total timeout exceeded before any response was received");return e.code=t.Status.DEADLINE_EXCEEDED,void setImmediate(p,"error",e)}e.getOperation((e,t,r,l)=>{if(!e)return t?void setImmediate(p,"complete",t,r,l):(l.metadata&&(!a||l&&!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;++r)if(e[r]!==t[r])return!1;return!0}(l.metadata.value,a))&&(setImmediate(p,"progress",r,l),a=l.metadata.value),l.done?void setImmediate(p,"complete",{},r,l):void setTimeout(()=>{n=new Date,s=Math.min(s*o,i),d()},s));setImmediate(p,"error",e)})}}()}promise(){return new Promise((e,t)=>{this.on("error",t).on("complete",(t,r,n)=>{e([t,r,n])})})}}return longrunning.Operation=o,longrunning}function requireLongRunningApiCaller(){if(hasRequiredLongRunningApiCaller)return longRunningApiCaller;hasRequiredLongRunningApiCaller=1,Object.defineProperty(longRunningApiCaller,"__esModule",{value:!0}),longRunningApiCaller.LongrunningApiCaller=void 0;const e=requireCall(),t=requireGax(),r=requireLongrunning();return longRunningApiCaller.LongrunningApiCaller=class{constructor(e){this.longrunningDescriptor=e}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,t,r,n){n.call((t,n)=>this._wrapOperation(e,r,t,n),t)}_wrapOperation(e,n,o,i){let a=n.longrunning;a||(a=(0,t.createDefaultBackoffSettings)());const s=this.longrunningDescriptor;return e(o,(e,t)=>{if(e)return void i(e,null,null,t);const o=new r.Operation(t,s,a,n);i(null,o,t)})}fail(e,t){e.callback(t)}result(e){return e.promise}},longRunningApiCaller}function requireLongRunningDescriptor(){if(hasRequiredLongRunningDescriptor)return longRunningDescriptor;hasRequiredLongRunningDescriptor=1,Object.defineProperty(longRunningDescriptor,"__esModule",{value:!0}),longRunningDescriptor.LongRunningDescriptor=void 0;const e=requireLongRunningApiCaller();return longRunningDescriptor.LongRunningDescriptor=class{constructor(e,t,r){this.operationsClient=e,this.responseDecoder=t,this.metadataDecoder=r}getApiCaller(){return new e.LongrunningApiCaller(this)}},longRunningDescriptor}var pageDescriptor={},pagedApiCaller={},resourceCollector={},hasRequiredResourceCollector,hasRequiredPagedApiCaller,hasRequiredPageDescriptor;function requireResourceCollector(){if(hasRequiredResourceCollector)return resourceCollector;hasRequiredResourceCollector=1,Object.defineProperty(resourceCollector,"__esModule",{value:!0}),resourceCollector.ResourceCollector=void 0;return resourceCollector.ResourceCollector=class{constructor(e,t=-1){this.apiCall=e,this.resources=[],this.maxResults=t}callback(e,t,r){if(e)return void this.rejectCallback(e);for(const e of t)if(this.resources.push(e),this.resources.length===this.maxResults){r=null;break}if(!r)return void this.resolveCallback(this.resources);setImmediate(this.apiCall,r,(...e)=>this.callback(...e))}processAllPages(e){return new Promise((t,r)=>{this.resolveCallback=t,this.rejectCallback=r;setImmediate(this.apiCall,e,(...e)=>this.callback(...e))})}},resourceCollector}function requirePagedApiCaller(){if(hasRequiredPagedApiCaller)return pagedApiCaller;hasRequiredPagedApiCaller=1,Object.defineProperty(pagedApiCaller,"__esModule",{value:!0}),pagedApiCaller.PagedApiCaller=void 0;const e=requireCall(),t=requireGoogleError(),r=requireResourceCollector(),n=requireWarnings();return pagedApiCaller.PagedApiCaller=class{constructor(e){this.pageDescriptor=e}generateParseResponseCallback(e,r){const n=this.pageDescriptor.resourceField,o=this.pageDescriptor.responsePageTokenField,i=this.pageDescriptor.requestPageTokenField;return(a,s)=>{if(a)return void r(a);if(!e)return void r(new t.GoogleError("Undefined request in pagination method callback."));if(!s)return void r(new t.GoogleError("Undefined response in pagination method callback."));const l=s[n]||[],p=s[o];let d=null;p&&(d=Object.assign({},e),d[i]=p),r(a,l,d,s)}}wrap(e){const t=this;return function(r,n,o,i){return e(r,n,o,t.generateParseResponseCallback(r,i))}}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}call(e,t,o,i){if(t=Object.assign({},t),!o.autoPaginate)return void i.call(e,t);t.pageSize&&o.autoPaginate&&(0,n.warn)("autoPaginate true","Providing a pageSize without setting autoPaginate to false will still return all results. See https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure manual paging","AutopaginateTrueWarning");const a=o.maxResults||-1;new r.ResourceCollector(e,a).processAllPages(t).then(e=>i.callback(null,e),e=>i.callback(e))}fail(e,t){e.callback(t)}result(e){return e.promise}},pagedApiCaller}function requirePageDescriptor(){if(hasRequiredPageDescriptor)return pageDescriptor;hasRequiredPageDescriptor=1,Object.defineProperty(pageDescriptor,"__esModule",{value:!0}),pageDescriptor.PageDescriptor=void 0;const e=Stream__default.default,t=requireNormalApiCaller(),r=requireWarnings(),n=requirePagedApiCaller();return pageDescriptor.PageDescriptor=class{constructor(e,t,r){this.requestPageTokenField=e,this.responsePageTokenField=t,this.resourceField=r}createStream(t,n,o){(null==o?void 0:o.autoPaginate)&&(0,r.warn)("autoPaginate true","Autopaginate will always be set to false in stream paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning");const i=new e.PassThrough({objectMode:!0}),a="maxResults"in(o=Object.assign({},o,{autoPaginate:!1}))?o.maxResults:-1;let s=0,l=!1;function p(e,r,d,u){if(e)i.emit("error",e);else{i.emit("response",u);for(let e=0;e<r.length;++e){if(i._readableState.ended)return;null!==r[e]&&(i.push(r[e]),s++,s===a&&i.end())}i._readableState.ended||(d?("pageToken"in o&&delete o.pageToken,i.isPaused()?(n=d,l=!1):setImmediate(t,d,o,p)):i.end())}}return i.on("resume",()=>{l||(l=!0,t(n,o,p))}),i}asyncIterate(e,t,n){(null==n?void 0:n.autoPaginate)&&(0,r.warn)("autoPaginate true","Autopaginate will always be set to false in Async paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning"),n=Object.assign({},n,{autoPaginate:!1});return this.createIterator(e,t,n)}createIterator(e,t,r){const n={[Symbol.asyncIterator](){let n=t;const o=[];return{async next(){if(o.length>0)return Promise.resolve({done:!1,value:o.shift()});let t=0;for(;0===o.length&&n;){let i;if([i,n]=await e(n,r),i&&!Array.isArray(i))for(const[e,t]of Object.entries(i))o.push([e,t]);else o.push(...i);if(0===o.length&&(++t,t>10))break}return 0===o.length?Promise.resolve({done:!0,value:void 0}):Promise.resolve({done:!1,value:o.shift()})}}}};return n}getApiCaller(e){return e.autoPaginate?new n.PagedApiCaller(this):new t.NormalApiCaller}},pageDescriptor}var streamDescriptor={},streamingApiCaller={},hasRequiredStreamingApiCaller,hasRequiredStreamDescriptor;function requireStreamingApiCaller(){if(hasRequiredStreamingApiCaller)return streamingApiCaller;hasRequiredStreamingApiCaller=1,Object.defineProperty(streamingApiCaller,"__esModule",{value:!0}),streamingApiCaller.StreamingApiCaller=void 0;const e=requireWarnings(),t=requireStreaming();return streamingApiCaller.StreamingApiCaller=class{constructor(e){this.descriptor=e}init(e){return new t.StreamProxy(this.descriptor.type,e,this.descriptor.rest,this.descriptor.gaxStreamingRetries)}wrap(r){switch(this.descriptor.type){case t.StreamType.SERVER_STREAMING:return(e,t,n)=>r(e,t,n);case t.StreamType.CLIENT_STREAMING:return(e,t,n,o)=>r(t,n,o);case t.StreamType.BIDI_STREAMING:return(e,t,n)=>r(t,n);default:(0,e.warn)("streaming_wrap_unknown_stream_type",`Unknown stream type: ${this.descriptor.type}`)}return r}call(e,t,r,n){n.setStream(e,t,r.retryRequestOptions,r.retry)}fail(e,t){e.emit("error",t)}result(e){return e}},streamingApiCaller}function requireStreamDescriptor(){if(hasRequiredStreamDescriptor)return streamDescriptor;hasRequiredStreamDescriptor=1,Object.defineProperty(streamDescriptor,"__esModule",{value:!0}),streamDescriptor.StreamDescriptor=void 0;const e=requireStreamingApiCaller();return streamDescriptor.StreamDescriptor=class{constructor(e,t,r){this.type=e,this.streaming=!0,this.rest=t,this.gaxStreamingRetries=r}getApiCaller(){return new e.StreamingApiCaller(this)}},streamDescriptor}var bundleDescriptor={},bundleApiCaller={},hasRequiredBundleApiCaller;function requireBundleApiCaller(){if(hasRequiredBundleApiCaller)return bundleApiCaller;hasRequiredBundleApiCaller=1,Object.defineProperty(bundleApiCaller,"__esModule",{value:!0}),bundleApiCaller.BundleApiCaller=void 0;const e=requireCall(),t=requireGoogleError();return bundleApiCaller.BundleApiCaller=class{constructor(e){this.bundler=e}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,r,n,o){if(!n.isBundling)throw new t.GoogleError("Bundling enabled with no isBundling!");o.call((t,r)=>(this.bundler.schedule(e,t,r),o),r)}fail(e,t){e.callback(t)}result(e){return e.promise}},bundleApiCaller}var bundleExecutor={},bundlingUtils={},hasRequiredBundlingUtils;function requireBundlingUtils(){if(hasRequiredBundlingUtils)return bundlingUtils;function e(e,t){const r=t.split(".");let n=e;for(const e of r)n=null==n?void 0:n[e];return n}return hasRequiredBundlingUtils=1,Object.defineProperty(bundlingUtils,"__esModule",{value:!0}),bundlingUtils.computeBundleId=function(t,r){const n=[];let o=!1;for(const i of r){const r=e(t,i);void 0===r?n.push(null):(o=!0,n.push(r))}if(!o)return;return JSON.stringify(n)},bundlingUtils}var task={},hasRequiredTask,hasRequiredBundleExecutor,hasRequiredBundleDescriptor,hasRequiredDescriptor;function requireTask(){if(hasRequiredTask)return task;hasRequiredTask=1,Object.defineProperty(task,"__esModule",{value:!0}),task.Task=void 0,task.deepCopyForResponse=r;const e=requireStatus(),t=requireGoogleError();function r(e,t){let n;return null===e?null:void 0!==e?Array.isArray(e)?(n=[],e.forEach(e=>{n.push(r(e,null))}),n):void 0!==e.copy?e.copy():e instanceof ArrayBuffer?e.slice(0):"object"==typeof e?(n={},Object.keys(e).forEach(o=>{t&&o===t.field&&Array.isArray(e[o])?n[o]=e[o].slice(t.start,t.end):n[o]=r(e[o],null)}),n):e:void 0}return task.Task=class{constructor(e,t,r,n){this._apiCall=e,this._request=t,this._bundledField=r,this._subresponseField=n,this._data=[]}getElementCount(){let e=0;for(let t=0;t<this._data.length;++t)e+=this._data[t].elements.length;return e}getRequestByteSize(){let e=0;for(let t=0;t<this._data.length;++t)e+=this._data[t].bytes;return e}run(){if(0===this._data.length)return[];const n=this._request,o=[],i=[];for(let e=0;e<this._data.length;++e)o.push(...this._data[e].elements),i.push(this._data[e].callback.id);n[this._bundledField]=o;const a=this;return this.callCanceller=this._apiCall(n,(n,o)=>{const i=[];if(n)a._data.forEach(()=>{i.push(void 0)});else{let e=null;a._subresponseField&&(e={field:a._subresponseField,start:0}),a._data.forEach(t=>{e&&(e.end=e.start+t.elements.length),i.push(r(o,e)),e&&(e.start=e.end)})}for(let r=0;r<a._data.length;++r)if(a._data[r].cancelled){const n=new t.GoogleError("cancelled");n.code=e.Status.CANCELLED,a._data[r].callback(n)}else a._data[r].callback(n,i[r])}),i}extend(e,t,r){this._data.push({elements:e,bytes:t,callback:r})}cancel(r){if(this.callCanceller){let e=!0;return this._data.forEach(t=>{t.callback.id===r&&(t.cancelled=!0),t.cancelled||(e=!1)}),e&&this.callCanceller.cancel(),e}for(let n=0;n<this._data.length;++n)if(this._data[n].callback.id===r){const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,this._data[n].callback(r),this._data.splice(n,1);break}return 0===this._data.length}},task}function requireBundleExecutor(){if(hasRequiredBundleExecutor)return bundleExecutor;hasRequiredBundleExecutor=1,Object.defineProperty(bundleExecutor,"__esModule",{value:!0}),bundleExecutor.BundleExecutor=void 0;const e=requireStatus(),t=requireGoogleError(),r=requireWarnings(),n=requireBundlingUtils(),o=requireTask();function i(){}return bundleExecutor.BundleExecutor=class{constructor(e,t){this._options=e,this._descriptor=t,this._tasks={},this._timers={},this._invocations={},this._invocationId=0}schedule(a,s,l){const p=(0,n.computeBundleId)(s,this._descriptor.requestDiscriminatorFields);if(l=l||i,void 0===p)return(0,r.warn)("bundling_schedule_bundleid_undefined",`The request does not have enough information for request bundling. Invoking immediately. Request: ${JSON.stringify(s)} discriminator fields: ${this._descriptor.requestDiscriminatorFields}`),a(s,l);if(void 0===s[this._descriptor.bundledField])return(0,r.warn)("bundling_no_bundled_field",`Request does not contain field ${this._descriptor.bundledField} that must present for bundling. Invoking immediately. Request: ${JSON.stringify(s)}`),a(s,l);p in this._tasks||(this._tasks[p]=new o.Task(a,s,this._descriptor.bundledField,this._descriptor.subresponseField));let d=this._tasks[p];l.id=String(this._invocationId++),this._invocations[l.id]=p;const u=s[this._descriptor.bundledField],c=u.length;let f=0;const h=this;u.forEach(e=>{f+=this._descriptor.byteLengthFunction(e)});const m=this._options.elementCountLimit||0,g=this._options.requestByteLimit||0;if(m>0&&c>m||g>0&&f>=g){let r;r=m>0&&c>m?"The number of elements "+c+" exceeds the limit "+this._options.elementCountLimit:"The required bytes "+f+" exceeds the limit "+this._options.requestByteLimit;const n=new t.GoogleError(r);return n.code=e.Status.INVALID_ARGUMENT,l(n),{cancel:i}}const y=d.getElementCount(),v=d.getRequestByteSize();(m>0&&c+y>=m||g>0&&f+v>=g)&&(this._runNow(p),this._tasks[p]=new o.Task(a,s,this._descriptor.bundledField,this._descriptor.subresponseField),d=this._tasks[p]),d.extend(u,f,l);const b={cancel(){h._cancel(l.id)}},O=this._options.elementCountThreshold||0,w=this._options.requestByteThreshold||0;return O>0&&d.getElementCount()>=O||w>0&&d.getRequestByteSize()>=w?(this._runNow(p),b):(!(p in this._timers)&&this._options.delayThreshold>0&&(this._timers[p]=setTimeout(()=>{delete this._timers[p],this._runNow(p)},this._options.delayThreshold)),b)}_maybeClearTimeout(e){if(e in this._timers){const t=this._timers[e];delete this._timers[e],clearTimeout(t)}}_cancel(e){if(!(e in this._invocations))return;const t=this._invocations[e];if(!(t in this._tasks))return;const r=this._tasks[t];delete this._invocations[e],r.cancel(e)&&(this._maybeClearTimeout(t),delete this._tasks[t])}_runNow(e){if(!(e in this._tasks))return void(0,r.warn)("bundle_runnow_bundleid_unknown",`No such bundleid: ${e}`);this._maybeClearTimeout(e);const t=this._tasks[e];delete this._tasks[e],t.run().forEach(e=>{delete this._invocations[e]})}},bundleExecutor}function requireBundleDescriptor(){if(hasRequiredBundleDescriptor)return bundleDescriptor;hasRequiredBundleDescriptor=1,Object.defineProperty(bundleDescriptor,"__esModule",{value:!0}),bundleDescriptor.BundleDescriptor=void 0;const e=requireNormalApiCaller(),t=requireBundleApiCaller(),r=requireBundleExecutor(),n=requireUtil$2();return bundleDescriptor.BundleDescriptor=class{constructor(e,t,r,o){o||"function"!=typeof r||(o=r,r=null),this.bundledField=e,this.requestDiscriminatorFields=t.map(n.toCamelCase),this.subresponseField=r,this.byteLengthFunction=o}getApiCaller(n){return!1===n.isBundling?new e.NormalApiCaller:new t.BundleApiCaller(new r.BundleExecutor(n.bundleOptions,this))}},bundleDescriptor}function requireDescriptor(){return hasRequiredDescriptor||(hasRequiredDescriptor=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BundleDescriptor=e.StreamDescriptor=e.PageDescriptor=e.LongrunningDescriptor=void 0;var t=requireLongRunningDescriptor();Object.defineProperty(e,"LongrunningDescriptor",{enumerable:!0,get:function(){return t.LongRunningDescriptor}});var r=requirePageDescriptor();Object.defineProperty(e,"PageDescriptor",{enumerable:!0,get:function(){return r.PageDescriptor}});var n=requireStreamDescriptor();Object.defineProperty(e,"StreamDescriptor",{enumerable:!0,get:function(){return n.StreamDescriptor}});var o=requireBundleDescriptor();Object.defineProperty(e,"BundleDescriptor",{enumerable:!0,get:function(){return o.BundleDescriptor}})}(descriptor)),descriptor}var iamService={},interfaces$2={"google.iam.v1.IAMPolicy":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:2e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:2e4,total_timeout_millis:6e5}},methods:{GetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},SetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},TestIamPermissions:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}},require$$2={interfaces:interfaces$2},nested$3={google:{nested:{iam:{nested:{v1:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.Cloud.Iam.V1",go_package:"google.golang.org/genproto/googleapis/iam/v1;iam",java_multiple_files:!0,java_outer_classname:"PolicyProto",java_package:"com.google.iam.v1",php_namespace:"Google\\Cloud\\Iam\\V1"},nested:{IAMPolicy:{options:{"(google.api.default_host)":"iam-meta-api.googleapis.com"},methods:{SetIamPolicy:{requestType:"SetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:setIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:setIamPolicy",body:"*"}}]},GetIamPolicy:{requestType:"GetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:getIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:getIamPolicy",body:"*"}}]},TestIamPermissions:{requestType:"TestIamPermissionsRequest",responseType:"TestIamPermissionsResponse",options:{"(google.api.http).post":"/v1/{resource=**}:testIamPermissions","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:testIamPermissions",body:"*"}}]}}},SetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},policy:{type:"Policy",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},GetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},options:{type:"GetPolicyOptions",id:2}}},TestIamPermissionsRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},permissions:{rule:"repeated",type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TestIamPermissionsResponse:{fields:{permissions:{rule:"repeated",type:"string",id:1}}},GetPolicyOptions:{fields:{requestedPolicyVersion:{type:"int32",id:1}}},Policy:{fields:{version:{type:"int32",id:1},bindings:{rule:"repeated",type:"Binding",id:4},etag:{type:"bytes",id:3}}},Binding:{fields:{role:{type:"string",id:1},members:{rule:"repeated",type:"string",id:2},condition:{type:"google.type.Expr",id:3}}},PolicyDelta:{fields:{bindingDeltas:{rule:"repeated",type:"BindingDelta",id:1},auditConfigDeltas:{rule:"repeated",type:"AuditConfigDelta",id:2}}},BindingDelta:{fields:{action:{type:"Action",id:1},role:{type:"string",id:2},member:{type:"string",id:3},condition:{type:"google.type.Expr",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},AuditConfigDelta:{fields:{action:{type:"Action",id:1},service:{type:"string",id:2},exemptedMember:{type:"string",id:3},logType:{type:"string",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},logging:{options:{csharp_namespace:"Google.Cloud.Iam.V1.Logging",go_package:"google.golang.org/genproto/googleapis/iam/v1/logging;logging",java_multiple_files:!0,java_outer_classname:"AuditDataProto",java_package:"com.google.iam.v1.logging"},nested:{AuditData:{fields:{policyDelta:{type:"google.iam.v1.PolicyDelta",id:2}}}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ResourceProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"},fieldBehavior:{rule:"repeated",type:"google.api.FieldBehavior",id:1052,extend:"google.protobuf.FieldOptions"},FieldBehavior:{values:{FIELD_BEHAVIOR_UNSPECIFIED:0,OPTIONAL:1,REQUIRED:2,OUTPUT_ONLY:3,INPUT_ONLY:4,IMMUTABLE:5}},resourceReference:{type:"google.api.ResourceReference",id:1055,extend:"google.protobuf.FieldOptions"},resourceDefinition:{rule:"repeated",type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.FileOptions"},resource:{type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.MessageOptions"},ResourceDescriptor:{fields:{type:{type:"string",id:1},pattern:{rule:"repeated",type:"string",id:2},nameField:{type:"string",id:3},history:{type:"History",id:4},plural:{type:"string",id:5},singular:{type:"string",id:6}},nested:{History:{values:{HISTORY_UNSPECIFIED:0,ORIGINALLY_SINGLE_PATTERN:1,FUTURE_MULTI_PATTERN:2}}}},ResourceReference:{fields:{type:{type:"string",id:1},childType:{type:"string",id:2}}}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}},type:{options:{go_package:"google.golang.org/genproto/googleapis/type/expr;expr",java_multiple_files:!0,java_outer_classname:"ExprProto",java_package:"com.google.type",objc_class_prefix:"GTP"},nested:{Expr:{fields:{expression:{type:"string",id:1},title:{type:"string",id:2},description:{type:"string",id:3},location:{type:"string",id:4}}}}}}}},require$$5$1={nested:nested$3},hasRequiredIamService;function requireIamService(){if(hasRequiredIamService)return iamService;hasRequiredIamService=1,Object.defineProperty(iamService,"__esModule",{value:!0}),iamService.IamClient=void 0;const e=requireCreateApiCall(),t=requireRoutingHeader(),r=require$$2,n=requireFallback();let o=require$$19.version;const i=require$$5$1;return iamService.IamClient=class{constructor(e,t){this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{}},this.innerApiCalls={},this.gaxGrpc=e;const a=Object.assign({servicePath:t.servicePath,port:t.port,clientConfig:t.clientConfig,apiEndpoint:t.apiEndpoint,fallback:t.fallback},t);o=a.fallback?n.version:o,a.scopes=this.constructor.scopes,this._opts=a,this.auth=e.auth;const s=[`gax/${o}`,`gapic/${o}`];"undefined"!=typeof process&&"versions"in process?s.push(`gl-node/${process.versions.node}`):s.push(`gl-web/${o}`),a.fallback||s.push(`grpc/${e.grpcVersion}`),a.libName&&a.libVersion&&s.push(`${a.libName}/${a.libVersion}`),this._protos=this.gaxGrpc.loadProtoJSON(i),this._defaults=e.constructSettings("google.iam.v1.IAMPolicy",r,a.clientConfig||{},{"x-goog-api-client":s.join(" ")}),this.innerApiCalls={}}initialize(){if(this.iamPolicyStub)return this.iamPolicyStub;this.iamPolicyStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.iam.v1.IAMPolicy"):this._protos.google.iam.v1.IAMPolicy,this._opts);const t=["getIamPolicy","setIamPolicy","testIamPermissions"];for(const r of t){const t=this.iamPolicyStub.then(e=>(...t)=>{if(this._terminated)return Promise.reject("The client has already been closed.");return e[r].apply(e,t)},e=>()=>{throw e});this.innerApiCalls[r]=(0,e.createApiCall)(t,this._defaults[r],this.descriptors.page[r])}return this.iamPolicyStub}static get servicePath(){return"cloudkms.googleapis.com"}static get apiEndpoint(){return"cloudkms.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudkms"]}getProjectId(e){return this.auth&&"getProjectId"in this.auth?this.auth.getProjectId(e):e?void e(new Error("Cannot determine project ID.")):Promise.reject("Cannot determine project ID.")}getIamPolicy(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.getIamPolicy(e,o,n)}setIamPolicy(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.setIamPolicy(e,o,n)}testIamPermissions(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.testIamPermissions(e,o,n)}close(){return this.initialize(),this._terminated?Promise.resolve():this.iamPolicyStub.then(e=>{this._terminated=!0,e.close()})}},iamService}var locationService={},nested$2={google:{nested:{cloud:{nested:{location:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/cloud/location;location",java_multiple_files:!0,java_outer_classname:"LocationsProto",java_package:"com.google.cloud.location"},nested:{Locations:{options:{"(google.api.default_host)":"cloud.googleapis.com","(google.api.oauth_scopes)":"https://www.googleapis.com/auth/cloud-platform"},methods:{ListLocations:{requestType:"ListLocationsRequest",responseType:"ListLocationsResponse",options:{"(google.api.http).get":"/v1/{name=locations}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*}/locations"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations}",additional_bindings:{get:"/v1/{name=projects/*}/locations"}}}]},GetLocation:{requestType:"GetLocationRequest",responseType:"Location",options:{"(google.api.http).get":"/v1/{name=locations/*}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*/locations/*}"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations/*}",additional_bindings:{get:"/v1/{name=projects/*/locations/*}"}}}]}}},ListLocationsRequest:{fields:{name:{type:"string",id:1},filter:{type:"string",id:2},pageSize:{type:"int32",id:3},pageToken:{type:"string",id:4}}},ListLocationsResponse:{fields:{locations:{rule:"repeated",type:"Location",id:1},nextPageToken:{type:"string",id:2}}},GetLocationRequest:{fields:{name:{type:"string",id:1}}},Location:{fields:{name:{type:"string",id:1},locationId:{type:"string",id:4},displayName:{type:"string",id:5},labels:{keyType:"string",type:"string",id:2},metadata:{type:"google.protobuf.Any",id:3}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}}}}},require$$5={nested:nested$2},interfaces$1={"google.cloud.location.Locations":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{ListLocations:{retry_codes_name:"non_idempotent",retry_params_name:"default"},GetLocation:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}},require$$6={interfaces:interfaces$1},hasRequiredLocationService,hasRequiredFallback;function requireLocationService(){if(hasRequiredLocationService)return locationService;hasRequiredLocationService=1,Object.defineProperty(locationService,"__esModule",{value:!0}),locationService.LocationsClient=void 0;const e=requireGax(),t=requireWarnings(),r=requireCreateApiCall(),n=requireRoutingHeader(),o=requirePageDescriptor(),i=require$$5,a=require$$6,s=require$$19.version;return locationService.LocationsClient=class{constructor(e,r){var n,l;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}},this.gaxGrpc=e;const p=this.constructor,d=(null==r?void 0:r.servicePath)||(null==r?void 0:r.apiEndpoint)||p.servicePath;this._providedCustomServicePath=!(!(null==r?void 0:r.servicePath)&&!(null==r?void 0:r.apiEndpoint));const u=(null==r?void 0:r.port)||p.port,c=null!==(n=null==r?void 0:r.clientConfig)&&void 0!==n?n:{},f=null!==(l=null==r?void 0:r.fallback)&&void 0!==l?l:"undefined"!=typeof window&&"function"==typeof(null===window||void 0===window?void 0:window.fetch);r=Object.assign({servicePath:d,port:u,clientConfig:c,fallback:f},r),d===p.servicePath||"scopes"in r||(r.scopes=p.scopes),this._opts=r,this.auth=e.auth,d===p.servicePath&&(this.auth.defaultScopes=p.scopes);const h=[`gax/${s}`,`gapic/${s}`];"undefined"!=typeof process&&"versions"in process?h.push(`gl-node/${process.versions.node}`):h.push(`gl-web/${s}`),r.fallback?"rest"===r.fallback&&h.push(`rest/${e.grpcVersion}`):h.push(`grpc/${e.grpcVersion}`),r.libName&&r.libVersion&&h.push(`${r.libName}/${r.libVersion}`),this._protos=e.loadProtoJSON(i),this.descriptors.page={listLocations:new o.PageDescriptor("pageToken","nextPageToken","locations")},this._defaults=e.constructSettings("google.cloud.location.Locations",a,r.clientConfig||{},{"x-goog-api-client":h.join(" ")}),this.innerApiCalls={},this.warn=t.warn}initialize(){if(this.locationsStub)return this.locationsStub;this.locationsStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.cloud.location.Locations"):this._protos.google.cloud.location.Locations,this._opts,this._providedCustomServicePath);const e=["listLocations","getLocation"];for(const t of e){const e=this.locationsStub.then(e=>(...r)=>{if(this._terminated)return Promise.reject("The client has already been closed.");return e[t].apply(e,r)},e=>()=>{throw e}),n=this.descriptors.page[t]||void 0,o=(0,r.createApiCall)(e,this._defaults[t],n);this.innerApiCalls[t]=o}return this.locationsStub}static get servicePath(){return"cloud.googleapis.com"}static get apiEndpoint(){return"cloud.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform"]}getProjectId(e){if(!e)return this.auth.getProjectId();this.auth.getProjectId(e)}getLocation(e,t,r){let o;return e=e||{},"function"==typeof t&&void 0===r?(r=t,o={}):o=t,o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.getLocation(e,o,r)}listLocations(e,t,r){let o;return e=e||{},"function"==typeof t&&void 0===r?(r=t,o={}):o=t,o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.listLocations(e,o,r)}listLocationsAsync(t,r){t=t||{},(r=r||{}).otherArgs=r.otherArgs||{},r.otherArgs.headers=r.otherArgs.headers||{},r.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:t.name||""}),r=r||{};const o=new e.CallSettings(r);return this.initialize(),this.descriptors.page.listLocations.asyncIterate(this.innerApiCalls.listLocations,t,o)}close(){return this.initialize(),this._terminated?Promise.resolve():this.locationsStub.then(e=>{this._terminated=!0,e.close()})}},locationService}function requireFallback(){return hasRequiredFallback||(hasRequiredFallback=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=t.GoogleError=t.operation=t.Operation=t.warn=t.protobufMinimal=t.protobuf=t.LocationProtos=t.IamProtos=t.operationsProtos=t.GrpcClient=t.defaultToObjectOptions=t.makeUUID=t.LocationsClient=t.IamClient=t.OperationsClient=t.StreamType=t.StreamDescriptor=t.PageDescriptor=t.LongrunningDescriptor=t.BundleDescriptor=t.version=t.createDefaultBackoffSettings=t.RetryOptions=t.constructSettings=t.CallSettings=t.routingHeader=t.PathTemplate=void 0,t.lro=function(e){(e=Object.assign({scopes:[]},e)).protoJson&&(e=Object.assign(e,{fallback:!0}));const t=new C(e);return new l.OperationsClientBuilder(t,e.protoJson)},t.createApiCall=function(e,t,r,n){if(r&&"streaming"in r&&r.type!==f.StreamType.SERVER_STREAMING)return()=>{throw new Error("The REST transport currently does not support client-streaming or bidi-stream calls.")};if(r&&"streaming"in r&&!(0,u.isNodeJS)())return()=>{throw new Error("Server streaming over the REST transport is only supported in Node.js.")};return(0,p.createApiCall)(e,t,r)};const r=requireObjectHash(),n=requireProtobufjs();t.protobuf=n;const o=requireGax(),i=requireRoutingHeader();t.routingHeader=i;const a=requireStatus(),s=require$$3__default.default,l=requireOperationsClient(),p=requireCreateApiCall(),d=requireFallbackRest(),u=requireFeatureDetection(),c=requireFallbackServiceStub(),f=requireStreaming(),h=requireUtil$2(),m=requireIam_service();t.IamProtos=m;const g=requireLocations();t.LocationProtos=g;const y=requireOperations();t.operationsProtos=y;var v=requirePathTemplate();Object.defineProperty(t,"PathTemplate",{enumerable:!0,get:function(){return v.PathTemplate}});var b=requireGax();Object.defineProperty(t,"CallSettings",{enumerable:!0,get:function(){return b.CallSettings}}),Object.defineProperty(t,"constructSettings",{enumerable:!0,get:function(){return b.constructSettings}}),Object.defineProperty(t,"RetryOptions",{enumerable:!0,get:function(){return b.RetryOptions}}),Object.defineProperty(t,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return b.createDefaultBackoffSettings}}),t.version=require$$19.version+"-fallback";var O=requireDescriptor();Object.defineProperty(t,"BundleDescriptor",{enumerable:!0,get:function(){return O.BundleDescriptor}}),Object.defineProperty(t,"LongrunningDescriptor",{enumerable:!0,get:function(){return O.LongrunningDescriptor}}),Object.defineProperty(t,"PageDescriptor",{enumerable:!0,get:function(){return O.PageDescriptor}}),Object.defineProperty(t,"StreamDescriptor",{enumerable:!0,get:function(){return O.StreamDescriptor}});var w=requireStreaming();Object.defineProperty(t,"StreamType",{enumerable:!0,get:function(){return w.StreamType}});var S=requireOperationsClient();Object.defineProperty(t,"OperationsClient",{enumerable:!0,get:function(){return S.OperationsClient}});var _=requireIamService();Object.defineProperty(t,"IamClient",{enumerable:!0,get:function(){return _.IamClient}});var P=requireLocationService();Object.defineProperty(t,"LocationsClient",{enumerable:!0,get:function(){return P.LocationsClient}});var E=requireUtil$2();Object.defineProperty(t,"makeUUID",{enumerable:!0,get:function(){return E.makeUUID}}),t.defaultToObjectOptions={keepCase:!1,longs:String,enums:String,defaults:!0,oneofs:!0};const T="x-goog-api-client";class C{static clearProtoCache(){C.protoCache.clear()}constructor(e={}){var t;if((0,u.isNodeJS)())this.auth=e.auth||new s.GoogleAuth(e);else{if(!e.auth)throw new Error(JSON.stringify(e)+"You need to pass auth instance to use gRPC-fallback client in browser or other non-Node.js environments. Use OAuth2Client from google-auth-library.");this.auth=e.auth}this.fallback=!!e.fallback,this.grpcVersion=require$$19.version,this.httpRules=e.httpRules,this.numericEnums=null!==(t=e.numericEnums)&&void 0!==t&&t}loadProto(e){return n.Root.fromJSON(e)}loadProtoJSON(e,t=!1){const o=r(JSON.stringify(e)).toString(),i=C.protoCache.get(o);if(i&&!t)return i;const a=n.Root.fromJSON(e);return C.protoCache.set(o,a),a}static getServiceMethods(e){const t={};for(const[r,n]of Object.entries(e.methods)){t[(0,h.toLowerCamelCase)(r)]=n}return t}constructSettings(e,r,n,i){return o.constructSettings(e,r,n,a.Status,{metadataBuilder:function(e,r){const n={};i||(i={});for(const e in i)n[e]=Array.isArray(i[e])?i[e]:[i[e]];const o=[];if(n[T]&&n[T][0]&&o.push(...n[T][0].split(" ")),o.push(`grpc-web/${t.version}`),n[T]=[o.join(" ")],!r)return n;for(const e in r)if(e.toLowerCase()!==T){const t=r[e];if(Array.isArray(t))if(void 0===n[e])n[e]=t;else{if(!Array.isArray(n[e]))throw new Error(`Can not add value ${t} to the call metadata.`);n[e].push(...t)}else n[e]=[t]}return n}})}async createStub(e,t,r){if(this.authClient||(this.auth&&"getClient"in this.auth?this.authClient=await this.auth.getClient():this.auth&&"getRequestHeaders"in this.auth&&(this.authClient=this.auth)),!this.authClient)throw new Error("No authentication was provided");if(t.universeDomain||(t.universeDomain="googleapis.com"),t.universeDomain){const e=this.authClient.universeDomain;if(e&&t.universeDomain!==e)throw new Error(`The configured universe domain (${t.universeDomain}) does not match the universe domain found in the credentials (${e}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`)}e.resolveAll();const n=C.getServiceMethods(e),o=t.protocol||"https";let i,a=t.servicePath;if(!a&&e.options&&e.options["(google.api.default_host)"]&&(a=e.options["(google.api.default_host)"]),!a)throw new Error(`Cannot determine service API path for service ${e.name}.`);const s=a.match(/^(.*):(\d+)$/);s&&(a=s[1],i=parseInt(s[2])),t.port?i=t.port:i||(i=443);const l=d.encodeRequest,p=d.decodeResponse;return(0,c.generateServiceStub)(n,o,a,i,this.authClient,l,p,this.numericEnums)}static createByteLengthFunction(e){return o.createByteLengthFunction(e)}}t.GrpcClient=C,C.protoCache=new Map,t.protobufMinimal=requireMinimal();var R=requireWarnings();Object.defineProperty(t,"warn",{enumerable:!0,get:function(){return R.warn}});var D=requireLongrunning();Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return D.Operation}}),Object.defineProperty(t,"operation",{enumerable:!0,get:function(){return D.operation}});var x=requireGoogleError();Object.defineProperty(t,"GoogleError",{enumerable:!0,get:function(){return x.GoogleError}});const k=e.exports;t.fallback=k}(fallback,fallback.exports)),fallback.exports}var nested$1={google:{nested:{protobuf:{nested:{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/errdetails;errdetails",java_multiple_files:!0,java_outer_classname:"ErrorDetailsProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}},RetryInfo:{fields:{retryDelay:{type:"google.protobuf.Duration",id:1}}},DebugInfo:{fields:{stackEntries:{rule:"repeated",type:"string",id:1},detail:{type:"string",id:2}}},QuotaFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{subject:{type:"string",id:1},description:{type:"string",id:2}}}}},ErrorInfo:{fields:{reason:{type:"string",id:1},domain:{type:"string",id:2},metadata:{keyType:"string",type:"string",id:3}}},PreconditionFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{type:{type:"string",id:1},subject:{type:"string",id:2},description:{type:"string",id:3}}}}},BadRequest:{fields:{fieldViolations:{rule:"repeated",type:"FieldViolation",id:1}},nested:{FieldViolation:{fields:{field:{type:"string",id:1},description:{type:"string",id:2}}}}},RequestInfo:{fields:{requestId:{type:"string",id:1},servingData:{type:"string",id:2}}},ResourceInfo:{fields:{resourceType:{type:"string",id:1},resourceName:{type:"string",id:2},owner:{type:"string",id:3},description:{type:"string",id:4}}},Help:{fields:{links:{rule:"repeated",type:"Link",id:1}},nested:{Link:{fields:{description:{type:"string",id:1},url:{type:"string",id:2}}}}},LocalizedMessage:{fields:{locale:{type:"string",id:1},message:{type:"string",id:2}}}}}}}},require$$4$1={nested:nested$1},hasRequiredGoogleError,hasRequiredCall,hasRequiredNormalApiCaller,hasRequiredApiCaller;function requireGoogleError(){if(hasRequiredGoogleError)return googleError;hasRequiredGoogleError=1,Object.defineProperty(googleError,"__esModule",{value:!0}),googleError.GoogleErrorDecoder=googleError.GoogleError=void 0;const e=requireStatus(),t=requireProtobufjs(),r=requireSrc$3(),n=requireFallback();class o extends Error{static parseGRPCStatusDetails(e){const t=new i;try{if(e.metadata&&e.metadata.get("grpc-status-details-bin")){const r=t.decodeGRPCStatusDetails(e.metadata.get("grpc-status-details-bin"));r&&r.details&&r.details.length>0&&(e.statusDetails=r.details),r&&r.errorInfo&&(e.reason=r.errorInfo.reason,e.domain=r.errorInfo.domain,e.errorInfoMetadata=r.errorInfo.metadata)}}catch(e){}return e}static parseHttpError(t){Array.isArray(t)&&(t=t.find(e=>"error"in e)),t.error||(t.error={},Object.keys(t).filter(e=>"error"!==e).forEach(e=>{t.error[e]=t[e],delete t[e]}));const r=new i,n=r.decodeHTTPError(t.error),a=Object.assign(new o(t.error.message),n);if(t.error.code?a.code=(0,e.rpcCodeFromHttpStatusCode)(t.error.code):delete a.code,a.details)try{const e=r.decodeHttpStatusDetails(a.details);e&&e.details&&e.details.length>0&&(a.statusDetails=e.details),e&&e.errorInfo&&(a.reason=e.errorInfo.reason,a.domain=e.errorInfo.domain,a.errorInfoMetadata=e.errorInfo.metadata)}catch(e){}return a}}googleError.GoogleError=o;class i{constructor(){const e=require$$4$1;this.root=t.Root.fromJSON(e),this.anyType=this.root.lookupType("google.protobuf.Any"),this.statusType=this.root.lookupType("google.rpc.Status")}decodeProtobufAny(e){const t=e.type_url.match(/^type.googleapis.com\/(.*)/);if(!t)throw new Error(`Unknown type encoded in google.protobuf.any: ${e.type_url}`);const r=t[1],n=this.root.lookupType(r);if(!n)throw new Error(`Cannot lookup type ${r}`);return n.decode(e.value)}decodeRpcStatus(e){const t=new Uint8Array(e),r=this.statusType.decode(t),n=[];let o;for(const e of r.details)try{const t=this.decodeProtobufAny(e);n.push(t),"type.googleapis.com/google.rpc.ErrorInfo"===e.type_url&&(o=t)}catch(e){}return{code:r.code,message:r.message,statusDetails:n,reason:null==o?void 0:o.reason,domain:null==o?void 0:o.domain,errorInfoMetadata:null==o?void 0:o.metadata}}callErrorFromStatus(t){return t.message=`${t.code} ${e.Status[t.code]}: ${t.message}`,Object.assign(new o(t.message),t)}decodeErrorFromBuffer(e){return this.callErrorFromStatus(this.decodeRpcStatus(e))}decodeGRPCStatusDetails(e){const t=[];let r;e.forEach(e=>{const n=new Uint8Array(e),o=this.statusType.decode(n);for(const e of o.details)try{const n=this.decodeProtobufAny(e);t.push(n),"type.googleapis.com/google.rpc.ErrorInfo"===e.type_url&&(r=n)}catch(e){}});return{details:t,errorInfo:r}}decodeHTTPError(e){const t=r.fromProto3JSON(this.statusType,e);if(!t)throw new Error(`Received error message ${e}, but failed to serialize as proto3 message`);return this.statusType.toObject(t,n.defaultToObjectOptions)}decodeHttpStatusDetails(e){const t=[];let r;for(const n of e)try{const e=this.decodeProtobufAny(n);t.push(e),"type.googleapis.com/google.rpc.ErrorInfo"===n.type_url&&(r=e)}catch(e){}return{details:t,errorInfo:r}}}return googleError.GoogleErrorDecoder=i,googleError}function requireCall(){if(hasRequiredCall)return call;hasRequiredCall=1,Object.defineProperty(call,"__esModule",{value:!0}),call.OngoingCallPromise=call.OngoingCall=void 0;const e=requireStatus(),t=requireGoogleError();class r{constructor(e){this.callback=e,this.completed=!1}cancel(){if(!this.completed)if(this.completed=!0,this.cancelFunc)this.cancelFunc();else{const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,this.callback(r)}}call(e,r){if(this.completed)return;const n=e(r,(e,t,r,n)=>{this.completed=!0,setImmediate(this.callback,e,t,r,n)});n instanceof Promise&&n.catch(e=>{setImmediate(this.callback,new t.GoogleError(e),null,null,null)}),this.cancelFunc=()=>n.cancel()}}call.OngoingCall=r;return call.OngoingCallPromise=class extends r{constructor(){let e,r;const n=new Promise((t,n)=>{e=t,r=n});super((n,o,i,a)=>{if(n)n.metadata?r(t.GoogleError.parseGRPCStatusDetails(n)):r(n);else{if(void 0===o)throw new t.GoogleError("Neither error nor response are defined");e([o,i||null,a||null])}}),this.promise=n,this.promise.cancel=()=>{this.cancel()}}},call}function requireNormalApiCaller(){if(hasRequiredNormalApiCaller)return normalApiCaller;hasRequiredNormalApiCaller=1,Object.defineProperty(normalApiCaller,"__esModule",{value:!0}),normalApiCaller.NormalApiCaller=void 0;const e=requireCall();return normalApiCaller.NormalApiCaller=class{init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,t,r,n){n.call(e,t)}fail(e,t){e.callback(t)}result(e){return e.promise}},normalApiCaller}function requireApiCaller(){if(hasRequiredApiCaller)return apiCaller;hasRequiredApiCaller=1,Object.defineProperty(apiCaller,"__esModule",{value:!0}),apiCaller.createAPICaller=function(t,r){if(!r)return new e.NormalApiCaller;return r.getApiCaller(t)};const e=requireNormalApiCaller();return apiCaller}var retries={},timeout={},hasRequiredTimeout,hasRequiredRetries,hasRequiredCreateApiCall;function requireTimeout(){if(hasRequiredTimeout)return timeout;return hasRequiredTimeout=1,Object.defineProperty(timeout,"__esModule",{value:!0}),timeout.addTimeoutArg=function(e,t,r,n){return(o,i)=>{const a=new Date,s=r.options||{};s.deadline=new Date(a.getTime()+t);const l=r.metadataBuilder?r.metadataBuilder(n,r.headers||{}):null;return e(o,l,s,i)}},timeout}function requireRetries(){if(hasRequiredRetries)return retries;hasRequiredRetries=1,Object.defineProperty(retries,"__esModule",{value:!0}),retries.retryable=function(n,o,i,a){const s=o.backoffSettings.retryDelayMultiplier,l=o.backoffSettings.maxRetryDelayMillis,p=o.backoffSettings.rpcTimeoutMultiplier,d=o.backoffSettings.maxRpcTimeoutMillis;let u=o.backoffSettings.initialRetryDelayMillis,c=o.backoffSettings.initialRpcTimeoutMillis;return(f,h)=>{let m,g,y,v=new Date;o.backoffSettings.totalTimeoutMillis&&(y=v.getTime()+o.backoffSettings.totalTimeoutMillis);let b=0;const O=o.backoffSettings.maxRetries;if(O&&y){const r=new t.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");r.code=e.Status.INVALID_ARGUMENT,h(r)}else!function w(S){if(g=null,y&&v.getTime()>=y){const r=new t.GoogleError(`Total timeout of API ${a} exceeded ${o.backoffSettings.totalTimeoutMillis} milliseconds ${S?`retrying error ${S} `:""} before any response was received.`);return r.code=e.Status.DEADLINE_EXCEEDED,void h(r)}if(b&&b>=O){const r=new t.GoogleError("Exceeded maximum number of retries "+(S?`retrying error ${S} `:"")+"before any response was received");return r.code=e.Status.DEADLINE_EXCEEDED,void h(r)}b++;let _=S;const P=(0,r.addTimeoutArg)(n,c,i);m=P(f,(e,t,r,n)=>{if(e&&4!==e.code&&(_=e),e)if(m=null,o.retryCodes.length>0&&o.retryCodes.indexOf(e.code)<0)e.note="Exception occurred in retry method that was not classified as transient",h(e);else{const e=Math.random()*u;g=setTimeout(()=>{v=new Date,u=Math.min(u*s,l);const e=c&&p?c*p:0,t=d||0,r=y?y-v.getTime():0;c=Math.min(e,t,r),w(_)},e)}else h(null,t,r,n)}),m instanceof Promise&&m.catch(e=>{h(new t.GoogleError(e))})}();return{cancel(){if(g&&clearTimeout(g),m)m.cancel();else{const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,h(r)}}}}};const e=requireStatus(),t=requireGoogleError(),r=requireTimeout();return retries}function requireCreateApiCall(){if(hasRequiredCreateApiCall)return createApiCall;hasRequiredCreateApiCall=1,Object.defineProperty(createApiCall,"__esModule",{value:!0}),createApiCall.createApiCall=function(a,s,l,p){const d="function"==typeof a?Promise.resolve(a):a,u=(0,e.createAPICaller)(s,l);return(a,l,p)=>{var c,f;let h,m=u;if(m instanceof o.StreamingApiCaller){const e=null!==(f=null===(c=m.descriptor)||void 0===c?void 0:c.gaxStreamingRetries)&&void 0!==f&&f,r=(0,t.convertRetryOptions)(l,e);h=s.merge(r)}else h=s.merge(l);s.isBundling&&!h.isBundling&&(m=(0,e.createAPICaller)(s,void 0));const g=m.init(p);return d.then(e=>{var t,o,a;e=m.wrap(e);const s=null===(t=m.descriptor)||void 0===t?void 0:t.streaming,l=h.retry;if(s&&l&&(l.retryCodes.length>0&&l.shouldRetryFn&&((0,i.warn)("either_retrycodes_or_shouldretryfn","Only one of retryCodes or shouldRetryFn may be defined. Ignoring retryCodes."),l.retryCodes=[]),!m.descriptor.gaxStreamingRetries&&l.getResumptionRequestFn))throw new Error("getResumptionRequestFn can only be used when gaxStreamingRetries is set to true.");if(!s&&l){if(l.shouldRetryFn)throw new Error("Using a function to determine retry eligibility is only supported with server streaming calls");if(l.getResumptionRequestFn)throw new Error("Resumption strategy can only be used with server streaming retries");if(l.retryCodes&&l.retryCodes.length>0)return null!==(o=(a=l.backoffSettings).initialRpcTimeoutMillis)&&void 0!==o||(a.initialRpcTimeoutMillis=h.timeout),(0,r.retryable)(e,h.retry,h.otherArgs,h.apiName)}return(0,n.addTimeoutArg)(e,h.timeout,h.otherArgs)}).then(e=>{m.call(e,a,h,g)}).catch(e=>{m.fail(g,e)}),m.result(g)}};const e=requireApiCaller(),t=requireGax(),r=requireRetries(),n=requireTimeout(),o=requireStreamingApiCaller(),i=requireWarnings();return createApiCall}var interfaces={"google.longrunning.Operations":{retry_codes:{idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"],non_idempotent:[]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:9e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:9e4,total_timeout_millis:6e5}},methods:{GetOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},ListOperations:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},CancelOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},DeleteOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"}}}},require$$3={interfaces:interfaces},nested={google:{nested:{longrunning:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.LongRunning",go_package:"google.golang.org/genproto/googleapis/longrunning;longrunning",java_multiple_files:!0,java_outer_classname:"OperationsProto",java_package:"com.google.longrunning",php_namespace:"Google\\LongRunning"},nested:{operationInfo:{type:"google.longrunning.OperationInfo",id:1049,extend:"google.protobuf.MethodOptions"},Operations:{options:{"(google.api.default_host)":"longrunning.googleapis.com"},methods:{ListOperations:{requestType:"ListOperationsRequest",responseType:"ListOperationsResponse",options:{"(google.api.http).get":"/v1/{name=operations}","(google.api.method_signature)":"name,filter"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=operations}"}},{"(google.api.method_signature)":"name,filter"}]},GetOperation:{requestType:"GetOperationRequest",responseType:"Operation",options:{"(google.api.http).get":"/v1/operations/{name}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1/operations/{name}"}},{"(google.api.method_signature)":"name"}]},DeleteOperation:{requestType:"DeleteOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).delete":"/v1/{name=operations/**}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{delete:"/v1/{name=operations/**}"}},{"(google.api.method_signature)":"name"}]},CancelOperation:{requestType:"CancelOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).post":"/v1/{name=operations/**}:cancel","(google.api.http).body":"*","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{post:"/v1/{name=operations/**}:cancel",body:"*"}},{"(google.api.method_signature)":"name"}]},WaitOperation:{requestType:"WaitOperationRequest",responseType:"Operation"}}},Operation:{oneofs:{result:{oneof:["error","response"]}},fields:{name:{type:"string",id:1},metadata:{type:"google.protobuf.Any",id:2},done:{type:"bool",id:3},error:{type:"google.rpc.Status",id:4},response:{type:"google.protobuf.Any",id:5}}},GetOperationRequest:{fields:{name:{type:"string",id:1}}},ListOperationsRequest:{fields:{name:{type:"string",id:4},filter:{type:"string",id:1},pageSize:{type:"int32",id:2},pageToken:{type:"string",id:3}}},ListOperationsResponse:{fields:{operations:{rule:"repeated",type:"Operation",id:1},nextPageToken:{type:"string",id:2}}},CancelOperationRequest:{fields:{name:{type:"string",id:1}}},DeleteOperationRequest:{fields:{name:{type:"string",id:1}}},WaitOperationRequest:{fields:{name:{type:"string",id:1},timeout:{type:"google.protobuf.Duration",id:2}}},OperationInfo:{fields:{responseType:{type:"string",id:1},metadataType:{type:"string",id:2}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}},Empty:{fields:{}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/status;status",java_multiple_files:!0,java_outer_classname:"StatusProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}}}}}}},require$$4={nested:nested},hasRequiredOperationsClient,hasRequiredSrc$2;function requireOperationsClient(){return hasRequiredOperationsClient||(hasRequiredOperationsClient=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OperationsClientBuilder=e.OperationsClient=e.ALL_SCOPES=e.SERVICE_ADDRESS=void 0;const t=requireCreateApiCall(),r=requireDescriptor(),n=requireGax(),o=require$$3,i=require$$4,a=requireTranscoding();e.SERVICE_ADDRESS="longrunning.googleapis.com";const s=require$$19.version;e.ALL_SCOPES=[];class l{constructor(n,i,a){const l=Object.assign({servicePath:e.SERVICE_ADDRESS,port:443,clientConfig:{}},a),p=["gl-node/"+process.versions.node];l.libName&&l.libVersion&&p.push(l.libName+"/"+l.libVersion),p.push("gapic/0.7.1","gax/"+s),l.fallback?p.push("gl-web/"+s):p.push("grpc/"+n.grpcVersion);const d=n.constructSettings("google.longrunning.Operations",o,l.clientConfig||{},{"x-goog-api-client":p.join(" ")});this.auth=n.auth,this.innerApiCalls={},this.descriptor={listOperations:new r.PageDescriptor("pageToken","nextPageToken","operations")},this.operationsStub=n.createStub(l.fallback?i.lookupService("google.longrunning.Operations"):i.google.longrunning.Operations,l);const u=["getOperation","listOperations","cancelOperation","deleteOperation"];for(const e of u){const r=this.operationsStub.then(t=>(...r)=>t[e].apply(t,r),e=>()=>{throw e});this.innerApiCalls[e]=(0,t.createApiCall)(r,d[e],this.descriptor[e])}}close(){this.operationsStub.then(e=>e.close())}getProjectId(e){return this.auth&&"getProjectId"in this.auth?this.auth.getProjectId(e):e?void e(new Error("Cannot determine project ID.")):Promise.reject("Cannot determine project ID.")}getOperationInternal(e,t,r){return e=e||{},t=t||{},this.innerApiCalls.getOperation(e,t,r)}getOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.getOperation(e,n,r)}listOperations(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.listOperations(e,n,r)}listOperationsStream(e,t){const r=new n.CallSettings(t);return this.descriptor.listOperations.createStream(this.innerApiCalls.listOperations,e,r)}listOperationsAsync(e,t){e=e||{},t=t||{};const r=new n.CallSettings(t);return this.descriptor.listOperations.asyncIterate(this.innerApiCalls.listOperations,e,r)}cancelOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.cancelOperation(e,n,r)}deleteOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.deleteOperation(e,n,r)}}e.OperationsClient=l;e.OperationsClientBuilder=class{constructor(e,t){t&&e.httpRules&&(0,a.overrideHttpRules)(e.httpRules,t);const r=null!=t?t:e.loadProtoJSON(i);this.operationsClient=t=>(e.fallback&&(t.fallback=e.fallback),new l(e,r,t)),Object.assign(this.operationsClient,l)}}}(operationsClient)),operationsClient}function requireSrc$2(){return hasRequiredSrc$2||(hasRequiredSrc$2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializer=e.warn=e.ChannelCredentials=e.makeUUID=e.fallback=e.protobufMinimal=e.protobuf=e.version=e.createByteLengthFunction=e.LocationsClient=e.IamClient=e.OperationsClient=e.LocationProtos=e.IamProtos=e.operationsProtos=e.routingHeader=e.StreamType=e.Status=e.PathTemplate=e.operation=e.Operation=e.GrpcClient=e.GoogleProtoFilesRoot=e.ClientStub=e.GoogleError=e.createMaxRetriesBackoffSettings=e.createDefaultBackoffSettings=e.createBackoffSettings=e.createBundleOptions=e.createRetryOptions=e.RetryOptions=e.constructSettings=e.CallSettings=e.StreamDescriptor=e.PageDescriptor=e.LongrunningDescriptor=e.BundleDescriptor=e.createApiCall=e.OngoingCall=e.grpc=e.GoogleAuth=void 0,e.lro=b;const t=requireSrc$5();e.grpc=t;const r=requireGrpc(),n=requireIam_service();e.IamProtos=n;const o=requireLocations();e.LocationProtos=o;const i=requireOperations();e.operationsProtos=i;const a=requireOperationsClient(),s=requireRoutingHeader();e.routingHeader=s;var l=require$$3__default.default;Object.defineProperty(e,"GoogleAuth",{enumerable:!0,get:function(){return l.GoogleAuth}});var p=requireCall();Object.defineProperty(e,"OngoingCall",{enumerable:!0,get:function(){return p.OngoingCall}});var d=requireCreateApiCall();Object.defineProperty(e,"createApiCall",{enumerable:!0,get:function(){return d.createApiCall}});var u=requireDescriptor();Object.defineProperty(e,"BundleDescriptor",{enumerable:!0,get:function(){return u.BundleDescriptor}}),Object.defineProperty(e,"LongrunningDescriptor",{enumerable:!0,get:function(){return u.LongrunningDescriptor}}),Object.defineProperty(e,"PageDescriptor",{enumerable:!0,get:function(){return u.PageDescriptor}}),Object.defineProperty(e,"StreamDescriptor",{enumerable:!0,get:function(){return u.StreamDescriptor}});var c=requireGax();Object.defineProperty(e,"CallSettings",{enumerable:!0,get:function(){return c.CallSettings}}),Object.defineProperty(e,"constructSettings",{enumerable:!0,get:function(){return c.constructSettings}}),Object.defineProperty(e,"RetryOptions",{enumerable:!0,get:function(){return c.RetryOptions}}),Object.defineProperty(e,"createRetryOptions",{enumerable:!0,get:function(){return c.createRetryOptions}}),Object.defineProperty(e,"createBundleOptions",{enumerable:!0,get:function(){return c.createBundleOptions}}),Object.defineProperty(e,"createBackoffSettings",{enumerable:!0,get:function(){return c.createBackoffSettings}}),Object.defineProperty(e,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return c.createDefaultBackoffSettings}}),Object.defineProperty(e,"createMaxRetriesBackoffSettings",{enumerable:!0,get:function(){return c.createMaxRetriesBackoffSettings}});var f=requireGoogleError();Object.defineProperty(e,"GoogleError",{enumerable:!0,get:function(){return f.GoogleError}});var h=requireGrpc();Object.defineProperty(e,"ClientStub",{enumerable:!0,get:function(){return h.ClientStub}}),Object.defineProperty(e,"GoogleProtoFilesRoot",{enumerable:!0,get:function(){return h.GoogleProtoFilesRoot}}),Object.defineProperty(e,"GrpcClient",{enumerable:!0,get:function(){return h.GrpcClient}});var m=requireLongrunning();Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return m.Operation}}),Object.defineProperty(e,"operation",{enumerable:!0,get:function(){return m.operation}});var g=requirePathTemplate();Object.defineProperty(e,"PathTemplate",{enumerable:!0,get:function(){return g.PathTemplate}});var y=requireStatus();Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return y.Status}});var v=requireStreaming();function b(e){e=Object.assign({scopes:b.ALL_SCOPES},e);const t=new r.GrpcClient(e);return new a.OperationsClientBuilder(t)}Object.defineProperty(e,"StreamType",{enumerable:!0,get:function(){return v.StreamType}}),b.SERVICE_ADDRESS=a.SERVICE_ADDRESS,b.ALL_SCOPES=a.ALL_SCOPES;var O=requireOperationsClient();Object.defineProperty(e,"OperationsClient",{enumerable:!0,get:function(){return O.OperationsClient}});var w=requireIamService();Object.defineProperty(e,"IamClient",{enumerable:!0,get:function(){return w.IamClient}});var S=requireLocationService();Object.defineProperty(e,"LocationsClient",{enumerable:!0,get:function(){return S.LocationsClient}}),e.createByteLengthFunction=r.GrpcClient.createByteLengthFunction,e.version=require$$19.version;const _=requireProtobufjs();e.protobuf=_,e.protobufMinimal=requireMinimal();const P=requireFallback();e.fallback=P;var E=requireUtil$2();Object.defineProperty(e,"makeUUID",{enumerable:!0,get:function(){return E.makeUUID}});var T=requireSrc$5();Object.defineProperty(e,"ChannelCredentials",{enumerable:!0,get:function(){return T.ChannelCredentials}});var C=requireWarnings();Object.defineProperty(e,"warn",{enumerable:!0,get:function(){return C.warn}});const R=requireSrc$3();e.serializer=R}(src$7)),src$7}var srcExports$1=requireSrc$2(),_a,STATUS_TO_STRING_MAP=(_a={},_a[srcExports$1.Status.CANCELLED]="cancelled",_a[srcExports$1.Status.UNKNOWN]="unknown",_a[srcExports$1.Status.INVALID_ARGUMENT]="invalid-argument",_a[srcExports$1.Status.DEADLINE_EXCEEDED]="deadline-exceeded",_a[srcExports$1.Status.NOT_FOUND]="not-found",_a[srcExports$1.Status.ALREADY_EXISTS]="already-exists",_a[srcExports$1.Status.PERMISSION_DENIED]="permission-denied",_a[srcExports$1.Status.RESOURCE_EXHAUSTED]="resource-exhausted",_a[srcExports$1.Status.FAILED_PRECONDITION]="failed-precondition",_a[srcExports$1.Status.ABORTED]="aborted",_a[srcExports$1.Status.OUT_OF_RANGE]="out-of-range",_a[srcExports$1.Status.UNIMPLEMENTED]="unimplemented",_a[srcExports$1.Status.INTERNAL]="internal",_a[srcExports$1.Status.UNAVAILABLE]="unavailable",_a[srcExports$1.Status.DATA_LOSS]="data-loss",_a[srcExports$1.Status.UNAUTHENTICATED]="unauthenticated",_a[srcExports$1.Status.OK]="unknown",_a),FIRESTORE_ERROR_MAPPINGS={"permission-denied":{userMessage:"Unable to access storage. Please try signing in again.",internalMessage:"Firestore permission denied",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unavailable:{userMessage:"Service temporarily unavailable. Please try again in a moment.",internalMessage:"Firestore service unavailable",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"not-found":{userMessage:"The requested data could not be found.",internalMessage:"Firestore document not found",shouldRetry:!1,severity:exports.ErrorSeverity.Info},"deadline-exceeded":{userMessage:"The operation took too long. Please try again.",internalMessage:"Firestore operation timeout",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},unauthenticated:{userMessage:"Authentication required. Please sign in again.",internalMessage:"Firestore authentication failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},"already-exists":{userMessage:"This record already exists.",internalMessage:"Firestore document already exists",shouldRetry:!1,severity:exports.ErrorSeverity.Info},"resource-exhausted":{userMessage:"Service is at capacity. Please try again later.",internalMessage:"Firestore quota exceeded",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"failed-precondition":{userMessage:"The operation cannot be completed at this time.",internalMessage:"Firestore precondition failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},aborted:{userMessage:"The operation was cancelled. Please try again.",internalMessage:"Firestore transaction aborted",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"invalid-argument":{userMessage:"Invalid data provided. Please check your input.",internalMessage:"Firestore invalid argument",shouldRetry:!1,severity:exports.ErrorSeverity.Error},cancelled:{userMessage:"The operation was cancelled.",internalMessage:"Firestore operation cancelled",shouldRetry:!1,severity:exports.ErrorSeverity.Info},unknown:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Firestore unknown error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},"out-of-range":{userMessage:"The requested range is invalid.",internalMessage:"Firestore out of range",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unimplemented:{userMessage:"This feature is not yet available.",internalMessage:"Firestore operation not implemented",shouldRetry:!1,severity:exports.ErrorSeverity.Error},internal:{userMessage:"An internal error occurred. Our team has been notified.",internalMessage:"Firestore internal error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},"data-loss":{userMessage:"Data integrity error. Please contact support.",internalMessage:"Firestore data loss detected",shouldRetry:!1,severity:exports.ErrorSeverity.Error}};function isGoogleError(e){return e instanceof srcExports$1.GoogleError&&"number"==typeof e.code}function handleFirestoreError(e,t){var r,n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),isGoogleError(e)?(r=void 0!==e.code?STATUS_TO_STRING_MAP[e.code]:void 0,n=e):n=e instanceof Error?e:new Error(String(e));var o=r&&r in FIRESTORE_ERROR_MAPPINGS?FIRESTORE_ERROR_MAPPINGS[r]:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Unknown error type",shouldRetry:!1,severity:exports.ErrorSeverity.Error};throw console.error("[Internal] Error from Firestore: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var src$1={},gaxios={},isStream_1,hasRequiredIsStream;function requireIsStream(){if(hasRequiredIsStream)return isStream_1;hasRequiredIsStream=1;const e=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;return e.writable=t=>e(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState,e.readable=t=>e(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState,e.duplex=t=>e.writable(t)&&e.readable(t),e.transform=t=>e.duplex(t)&&"function"==typeof t._transform,isStream_1=e}var common$1={},util={},name="gaxios",version="6.7.1",description="A simple common HTTP client specifically for Google APIs and services.",main="build/src/index.js",types="build/src/index.d.ts",files=["build/src"],scripts={lint:"gts check",test:"c8 mocha build/test","presystem-test":"npm run compile","system-test":"mocha build/system-test --timeout 80000",compile:"tsc -p .",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"compodoc src/","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},repository="googleapis/gaxios",keywords=["google"],engines={node:">=14"},author="Google, LLC",license="Apache-2.0",devDependencies={"@babel/plugin-proposal-private-methods":"^7.18.6","@compodoc/compodoc":"1.1.19","@types/cors":"^2.8.6","@types/express":"^4.16.1","@types/extend":"^3.0.1","@types/mocha":"^9.0.0","@types/multiparty":"0.0.36","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^20.0.0","@types/node-fetch":"^2.5.7","@types/sinon":"^17.0.0","@types/tmp":"0.2.6","@types/uuid":"^10.0.0","abort-controller":"^3.0.0",assert:"^2.0.0",browserify:"^17.0.0",c8:"^8.0.0",cheerio:"1.0.0-rc.10",cors:"^2.8.5",execa:"^5.0.0",express:"^4.16.4","form-data":"^4.0.0",gts:"^5.0.0","is-docker":"^2.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"5.0.0",linkinator:"^3.0.0",mocha:"^8.0.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^13.0.0","null-loader":"^4.0.0",puppeteer:"^19.0.0",sinon:"^18.0.0","stream-browserify":"^3.0.0",tmp:"0.2.3","ts-loader":"^8.0.0",typescript:"^5.1.6",webpack:"^5.35.0","webpack-cli":"^4.0.0"},dependencies={extend:"^3.0.2","https-proxy-agent":"^7.0.1","is-stream":"^2.0.0","node-fetch":"^2.6.9",uuid:"^9.0.1"},require$$0={name:name,version:version,description:description,main:main,types:types,files:files,scripts:scripts,repository:repository,keywords:keywords,engines:engines,author:author,license:license,devDependencies:devDependencies,dependencies:dependencies},hasRequiredUtil,hasRequiredCommon$1;function requireUtil(){return hasRequiredUtil||(hasRequiredUtil=1,Object.defineProperty(util,"__esModule",{value:!0}),util.pkg=void 0,util.pkg=require$$0),util}function requireCommon$1(){return hasRequiredCommon$1||(hasRequiredCommon$1=1,function(e){var t,r=common$1&&common$1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=function e(t){const r="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function o(e){if(e)for(const t of Object.keys(e))/^authentication$/i.test(t)&&(e[t]=r),/^authorization$/i.test(t)&&(e[t]=r),/secret/i.test(t)&&(e[t]=r)}function i(e,t){if("object"==typeof e&&null!==e&&"string"==typeof e[t]){const n=e[t];(/grant_type=/i.test(n)||/assertion=/i.test(n)||/secret/i.test(n))&&(e[t]=r)}}function a(e){"object"==typeof e&&null!==e&&("grant_type"in e&&(e.grant_type=r),"assertion"in e&&(e.assertion=r),"client_secret"in e&&(e.client_secret=r))}if(t.config){o(t.config.headers),i(t.config,"data"),a(t.config.data),i(t.config,"body"),a(t.config.body);try{const e=new n.URL("",t.config.url);e.searchParams.has("token")&&e.searchParams.set("token",r),e.searchParams.has("client_secret")&&e.searchParams.set("client_secret",r),t.config.url=e.toString()}catch(e){}}t.response&&(e({config:t.response.config}),o(t.response.headers),i(t.response,"data"),a(t.response.data));return t};const n=Url__default.default,o=requireUtil(),i=r(requireExtend());e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${o.pkg.name}-gaxios-error`);class a extends Error{static[(t=e.GAXIOS_ERROR_SYMBOL,Symbol.hasInstance)](t){return!(!t||"object"!=typeof t||!(e.GAXIOS_ERROR_SYMBOL in t)||t[e.GAXIOS_ERROR_SYMBOL]!==o.pkg.version)||Function.prototype[Symbol.hasInstance].call(a,t)}constructor(e,r,n,a){var s;if(super(e),this.config=r,this.response=n,this.error=a,this[t]=o.pkg.version,this.config=(0,i.default)(!0,{},r),this.response&&(this.response.config=(0,i.default)(!0,{},this.response.config)),this.response){try{this.response.data=function(e,t){switch(e){case"stream":default:return t;case"json":return JSON.parse(JSON.stringify(t));case"arraybuffer":return JSON.parse(Buffer.from(t).toString("utf8"));case"blob":return JSON.parse(t.text())}}(this.config.responseType,null===(s=this.response)||void 0===s?void 0:s.data)}catch(e){}this.status=this.response.status}a&&"code"in a&&a.code&&(this.code=a.code),r.errorRedactor&&r.errorRedactor({config:this.config,response:this.response})}}e.GaxiosError=a}(common$1)),common$1}var retry={},hasRequiredRetry;function requireRetry(){if(hasRequiredRetry)return retry;function e(e){var r;const n=t(e);if("AbortError"===e.name||"AbortError"===(null===(r=e.error)||void 0===r?void 0:r.name))return!1;if(!n||0===n.retry)return!1;if(!e.response&&(n.currentRetryAttempt||0)>=n.noResponseRetries)return!1;if(!e.config.method||n.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){let t=!1;for(const[r,o]of n.statusCodesToRetry){const n=e.response.status;if(n>=r&&n<=o){t=!0;break}}if(!t)return!1}return n.currentRetryAttempt=n.currentRetryAttempt||0,!(n.currentRetryAttempt>=n.retry)}function t(e){if(e&&e.config&&e.config.retryConfig)return e.config.retryConfig}return hasRequiredRetry=1,Object.defineProperty(retry,"__esModule",{value:!0}),retry.getRetryConfig=async function(r){let n=t(r);if(!r||!r.config||!n&&!r.config.retry)return{shouldRetry:!1};n=n||{},n.currentRetryAttempt=n.currentRetryAttempt||0,n.retry=void 0===n.retry||null===n.retry?3:n.retry,n.httpMethodsToRetry=n.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],n.noResponseRetries=void 0===n.noResponseRetries||null===n.noResponseRetries?2:n.noResponseRetries,n.retryDelayMultiplier=n.retryDelayMultiplier?n.retryDelayMultiplier:2,n.timeOfFirstRequest=n.timeOfFirstRequest?n.timeOfFirstRequest:Date.now(),n.totalTimeout=n.totalTimeout?n.totalTimeout:Number.MAX_SAFE_INTEGER,n.maxRetryDelay=n.maxRetryDelay?n.maxRetryDelay:Number.MAX_SAFE_INTEGER;n.statusCodesToRetry=n.statusCodesToRetry||[[100,199],[408,408],[429,429],[500,599]],r.config.retryConfig=n;const o=n.shouldRetry||e;if(!await o(r))return{shouldRetry:!1,config:r.config};const i=function(e){var t;const r=e.currentRetryAttempt?0:null!==(t=e.retryDelay)&&void 0!==t?t:100,n=r+(Math.pow(e.retryDelayMultiplier,e.currentRetryAttempt)-1)/2*1e3,o=e.totalTimeout-(Date.now()-e.timeOfFirstRequest);return Math.min(n,o,e.maxRetryDelay)}(n);r.config.retryConfig.currentRetryAttempt+=1;const a=n.retryBackoff?n.retryBackoff(r,i):new Promise(e=>{setTimeout(e,i)});n.onRetryAttempt&&n.onRetryAttempt(r);return await a,{shouldRetry:!0,config:r.config}},retry}var interceptor={},hasRequiredInterceptor;function requireInterceptor(){if(hasRequiredInterceptor)return interceptor;hasRequiredInterceptor=1,Object.defineProperty(interceptor,"__esModule",{value:!0}),interceptor.GaxiosInterceptorManager=void 0;class e extends Set{}return interceptor.GaxiosInterceptorManager=e,interceptor}var dist$1={},src={exports:{}},browser={exports:{}},ms,hasRequiredMs,common,hasRequiredCommon,hasRequiredBrowser;function requireMs(){if(hasRequiredMs)return ms;hasRequiredMs=1;var e=1e3,t=60*e,r=60*t,n=24*r,o=7*n,i=365.25*n;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}return ms=function(s,l){l=l||{};var p=typeof s;if("string"===p&&s.length>0)return function(a){if((a=String(a)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!s)return;var l=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*i;case"weeks":case"week":case"w":return l*o;case"days":case"day":case"d":return l*n;case"hours":case"hour":case"hrs":case"hr":case"h":return l*r;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(s);if("number"===p&&isFinite(s))return l.long?function(o){var i=Math.abs(o);if(i>=n)return a(o,i,n,"day");if(i>=r)return a(o,i,r,"hour");if(i>=t)return a(o,i,t,"minute");if(i>=e)return a(o,i,e,"second");return o+" ms"}(s):function(o){var i=Math.abs(o);if(i>=n)return Math.round(o/n)+"d";if(i>=r)return Math.round(o/r)+"h";if(i>=t)return Math.round(o/t)+"m";if(i>=e)return Math.round(o/e)+"s";return o+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},ms}function requireCommon(){if(hasRequiredCommon)return common;return hasRequiredCommon=1,common=function(e){function t(e){let n,o,i,a=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];n=i.call(r,t),e.splice(a,1),a--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,o=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,i=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,i++,r=i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(n(e,r))return!1;for(const r of t.names)if(n(e,r))return!0;return!1},t.humanize=requireMs(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},common}function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=requireCommon()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(browser,browser.exports)),browser.exports}var node={exports:{}},hasFlag,hasRequiredHasFlag,supportsColor_1,hasRequiredSupportsColor,hasRequiredNode,hasRequiredSrc$1;function requireHasFlag(){return hasRequiredHasFlag?hasFlag:(hasRequiredHasFlag=1,hasFlag=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)})}function requireSupportsColor(){if(hasRequiredSupportsColor)return supportsColor_1;hasRequiredSupportsColor=1;const e=require$$0__default$1.default,t=require$$1__default$7.default,r=requireHasFlag(),{env:n}=process;let o;function i(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function a(t,i){if(0===o)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(t&&!i&&void 0===o)return 0;const a=o||0;if("dumb"===n.TERM)return a;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in n)||"codeship"===n.CI_NAME?1:a;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if("truecolor"===n.COLORTERM)return 3;if("TERM_PROGRAM"in n){const e=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:a}return r("no-color")||r("no-colors")||r("color=false")||r("color=never")?o=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(o=1),"FORCE_COLOR"in n&&(o="true"===n.FORCE_COLOR?1:"false"===n.FORCE_COLOR?0:0===n.FORCE_COLOR.length?1:Math.min(parseInt(n.FORCE_COLOR,10),3)),supportsColor_1={supportsColor:function(e){return i(a(e,e&&e.isTTY))},stdout:i(a(!0,t.isatty(1))),stderr:i(a(!0,t.isatty(2)))},supportsColor_1}function requireNode(){return hasRequiredNode||(hasRequiredNode=1,function(e,t){const r=require$$1__default$7.default,n=require$$1__default$4.default;t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${n} `;r[0]=i+r[0].split("\n").join("\n"+i),r.push(o+"m+"+e.exports.humanize(this.diff)+"")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=requireSupportsColor();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=requireCommon()(t);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts)}}(node,node.exports)),node.exports}function requireSrc$1(){return hasRequiredSrc$1||(hasRequiredSrc$1=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?src.exports=requireBrowser():src.exports=requireNode()),src.exports}var dist={},helpers={},hasRequiredHelpers,hasRequiredDist$1;function requireHelpers(){if(hasRequiredHelpers)return helpers;hasRequiredHelpers=1;var e=helpers&&helpers.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=helpers&&helpers.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=helpers&&helpers.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};Object.defineProperty(helpers,"__esModule",{value:!0}),helpers.req=helpers.json=helpers.toBuffer=void 0;const n=r(http__default.default),o=r(require$$1__default$6.default);async function i(e){let t=0;const r=[];for await(const n of e)t+=n.length,r.push(n);return Buffer.concat(r,t)}return helpers.toBuffer=i,helpers.json=async function(e){const t=(await i(e)).toString("utf8");try{return JSON.parse(t)}catch(e){const r=e;throw r.message+=` (input: ${t})`,r}},helpers.req=function(e,t={}){const r=(("string"==typeof e?e:e.href).startsWith("https:")?o:n).request(e,t),i=new Promise((e,t)=>{r.once("response",e).once("error",t).end()});return r.then=i.then.bind(i),r},helpers}function requireDist$1(){return hasRequiredDist$1||(hasRequiredDist$1=1,function(e){var t=dist&&dist.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=dist&&dist.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=dist&&dist.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(n,e,o);return r(n,e),n},o=dist&&dist.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Agent=void 0;const i=n(require$$0__default$2.default),a=n(http__default.default),s=require$$1__default$6.default;o(requireHelpers(),e);const l=Symbol("AgentBaseInternalState");class p extends a.Agent{constructor(e){super(e),this[l]={}}isSecureEndpoint(e){if(e){if("boolean"==typeof e.secureEndpoint)return e.secureEndpoint;if("string"==typeof e.protocol)return"https:"===e.protocol}const{stack:t}=new Error;return"string"==typeof t&&t.split("\n").some(e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:"))}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);const t=new i.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||null===t)return;const r=this.sockets[e],n=r.indexOf(t);-1!==n&&(r.splice(n,1),this.totalSocketCount--,0===r.length&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?s.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){const n={...t,secureEndpoint:this.isSecureEndpoint(t)},o=this.getName(n),i=this.incrementSockets(o);Promise.resolve().then(()=>this.connect(e,n)).then(s=>{if(this.decrementSockets(o,i),s instanceof a.Agent)try{return s.addRequest(e,n)}catch(e){return r(e)}this[l].currentSocket=s,super.createSocket(e,t,r)},e=>{this.decrementSockets(o,i),r(e)})}createConnection(){const e=this[l].currentSocket;if(this[l].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[l].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(e){this[l]&&(this[l].defaultPort=e)}get protocol(){return this[l].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[l]&&(this[l].protocol=e)}}e.Agent=p}(dist)),dist}var parseProxyResponse={},hasRequiredParseProxyResponse,hasRequiredDist,hasRequiredGaxios,hasRequiredSrc;function requireParseProxyResponse(){if(hasRequiredParseProxyResponse)return parseProxyResponse;hasRequiredParseProxyResponse=1;var e=parseProxyResponse&&parseProxyResponse.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(parseProxyResponse,"__esModule",{value:!0}),parseProxyResponse.parseProxyResponse=void 0;const t=(0,e(requireSrc$1()).default)("https-proxy-agent:parse-proxy-response");return parseProxyResponse.parseProxyResponse=function(e){return new Promise((r,n)=>{let o=0;const i=[];function a(){const l=e.read();l?function(l){i.push(l),o+=l.length;const p=Buffer.concat(i,o),d=p.indexOf("\r\n\r\n");if(-1===d)return t("have not received end of HTTP headers yet..."),void a();const u=p.slice(0,d).toString("ascii").split("\r\n"),c=u.shift();if(!c)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));const f=c.split(" "),h=+f[1],m=f.slice(2).join(" "),g={};for(const t of u){if(!t)continue;const r=t.indexOf(":");if(-1===r)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${t}"`));const o=t.slice(0,r).toLowerCase(),i=t.slice(r+1).trimStart(),a=g[o];"string"==typeof a?g[o]=[a,i]:Array.isArray(a)?a.push(i):g[o]=i}t("got proxy server response: %o %o",c,g),s(),r({connect:{statusCode:h,statusText:m,headers:g},buffered:p})}(l):e.once("readable",a)}function s(){e.removeListener("end",l),e.removeListener("error",p),e.removeListener("readable",a)}function l(){s(),t("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function p(e){s(),t("onerror %o",e),n(e)}e.on("error",p),e.on("end",l),a()})},parseProxyResponse}function requireDist(){if(hasRequiredDist)return dist$1;hasRequiredDist=1;var e=dist$1&&dist$1.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=dist$1&&dist$1.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=dist$1&&dist$1.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n},n=dist$1&&dist$1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dist$1,"__esModule",{value:!0}),dist$1.HttpsProxyAgent=void 0;const o=r(require$$0__default$2.default),i=r(require$$1__default$1.default),a=n(require$$2__default.default),s=n(requireSrc$1()),l=requireDist$1(),p=Url__default.default,d=requireParseProxyResponse(),u=(0,s.default)("https-proxy-agent"),c=e=>void 0===e.servername&&e.host&&!o.isIP(e.host)?{...e,servername:e.host}:e;class f extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy="string"==typeof e?new p.URL(e):e,this.proxyHeaders=t?.headers??{},u("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?m(t,"headers"):null,host:r,port:n}}async connect(e,t){const{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let n;"https:"===r.protocol?(u("Creating `tls.Socket`: %o",this.connectOpts),n=i.connect(c(this.connectOpts))):(u("Creating `net.Socket`: %o",this.connectOpts),n=o.connect(this.connectOpts));const s="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},l=o.isIPv6(t.host)?`[${t.host}]`:t.host;let p=`CONNECT ${l}:${t.port} HTTP/1.1\r\n`;if(r.username||r.password){const e=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(e).toString("base64")}`}s.Host=`${l}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const e of Object.keys(s))p+=`${e}: ${s[e]}\r\n`;const f=(0,d.parseProxyResponse)(n);n.write(`${p}\r\n`);const{connect:g,buffered:y}=await f;if(e.emit("proxyConnect",g),this.emit("proxyConnect",g,e),200===g.statusCode)return e.once("socket",h),t.secureEndpoint?(u("Upgrading socket connection to TLS"),i.connect({...m(c(t),"host","path","port"),socket:n})):n;n.destroy();const v=new o.Socket({writable:!1});return v.readable=!0,e.once("socket",e=>{u("Replaying proxy buffer for failed request"),(0,a.default)(e.listenerCount("data")>0),e.push(y),e.push(null)}),v}}function h(e){e.resume()}function m(e,...t){const r={};let n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}return f.protocols=["http","https"],dist$1.HttpsProxyAgent=f,dist$1}function requireGaxios(){if(hasRequiredGaxios)return gaxios;hasRequiredGaxios=1;var e,t,r,n,o,i,a,s,l=gaxios&&gaxios.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),p=gaxios&&gaxios.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),d=gaxios&&gaxios.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&l(t,e,r);return p(t,e),t},u=gaxios&&gaxios.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},c=gaxios&&gaxios.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},f=gaxios&&gaxios.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gaxios,"__esModule",{value:!0}),gaxios.Gaxios=void 0;const h=f(requireExtend()),m=require$$1__default$6.default,g=f(require$$2$1),y=f(require$$0__default$5.default),v=f(requireIsStream()),b=Url__default.default,O=requireCommon$1(),w=requireRetry(),S=Stream__default.default,_=require$$9,P=requireInterceptor(),E="undefined"!=typeof window&&window&&window.fetch?window.fetch:g.default;function T(e,t){return!!C(e,t)}function C(e,t){t=t.toLowerCase();for(const r of Object.keys((null==e?void 0:e.headers)||{}))if(t===r.toLowerCase())return e.headers[r]}class R{constructor(t){e.add(this),this.agentCache=new Map,this.defaults=t||{},this.interceptors={request:new P.GaxiosInterceptorManager,response:new P.GaxiosInterceptorManager}}async request(t={}){return t=await u(this,e,"m",i).call(this,t),t=await u(this,e,"m",n).call(this,t),u(this,e,"m",o).call(this,this._request(t))}async _defaultAdapter(e){const t=e.fetchImplementation||E,r=await t(e.url,e),n=await this.getResponseData(e,r);return this.translateResponse(e,r,n)}async _request(e={}){var t;try{let t;if(t=e.adapter?await e.adapter(e,this._defaultAdapter.bind(this)):await this._defaultAdapter(e),!e.validateStatus(t.status)){if("stream"===e.responseType){let e="";await new Promise(r=>{(null==t?void 0:t.data).on("data",t=>{e+=t}),(null==t?void 0:t.data).on("end",r)}),t.data=e}throw new O.GaxiosError(`Request failed with status code ${t.status}`,e,t)}return t}catch(r){const n=r instanceof O.GaxiosError?r:new O.GaxiosError(r.message,e,void 0,r),{shouldRetry:o,config:i}=await(0,w.getRetryConfig)(n);if(o&&i)return n.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,e.retryConfig=null===(t=n.config)||void 0===t?void 0:t.retryConfig,this._request(e);throw n}}async getResponseData(e,t){switch(e.responseType){case"stream":return t.body;case"json":{let e=await t.text();try{e=JSON.parse(e)}catch(e){}return e}case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"text":return t.text();default:return this.getResponseDataFromContentType(t)}}validateStatus(e){return e>=200&&e<300}paramsSerializer(e){return y.default.stringify(e)}translateResponse(e,t,r){const n={};return t.headers.forEach((e,t)=>{n[t]=e}),{config:e,data:r,headers:n,status:t.status,statusText:t.statusText,request:{responseURL:t.url}}}async getResponseDataFromContentType(e){let t=e.headers.get("Content-Type");if(null===t)return e.text();if(t=t.toLowerCase(),t.includes("application/json")){let t=await e.text();try{t=JSON.parse(t)}catch(e){}return t}return t.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,t){const r=`--${t}--`;for(const r of e){const e=`--${t}\r\nContent-Type: ${r.headers["Content-Type"]||"application/octet-stream"}\r\n\r\n`;yield e,"string"==typeof r.content?yield r.content:yield*r.content,yield"\r\n"}yield r}}return gaxios.Gaxios=R,t=R,e=new WeakSet,r=function(e,t=[]){var r,n;const o=new b.URL(e),i=[...t],a=(null===(n=null!==(r=process.env.NO_PROXY)&&void 0!==r?r:process.env.no_proxy)||void 0===n?void 0:n.split(","))||[];for(const e of a)i.push(e.trim());for(const e of i)if(e instanceof RegExp){if(e.test(o.toString()))return!1}else if(e instanceof b.URL){if(e.origin===o.origin)return!1}else if(e.startsWith("*.")||e.startsWith(".")){const t=e.replace(/^\*\./,".");if(o.hostname.endsWith(t))return!1}else if(e===o.origin||e===o.hostname||e===o.href)return!1;return!0},n=async function(e){let t=Promise.resolve(e);for(const e of this.interceptors.request.values())e&&(t=t.then(e.resolved,e.rejected));return t},o=async function(e){let t=Promise.resolve(e);for(const e of this.interceptors.response.values())e&&(t=t.then(e.resolved,e.rejected));return t},i=async function(n){var o,i,a,l;const p=(0,h.default)(!0,{},this.defaults,n);if(!p.url)throw new Error("URL is required.");const d=p.baseUrl||p.baseURL;if(d&&(p.url=d.toString()+p.url),p.paramsSerializer=p.paramsSerializer||this.paramsSerializer,p.params&&Object.keys(p.params).length>0){let e=p.paramsSerializer(p.params);e.startsWith("?")&&(e=e.slice(1));const t=p.url.toString().includes("?")?"&":"?";p.url=p.url+t+e}if("number"==typeof n.maxContentLength&&(p.size=n.maxContentLength),"number"==typeof n.maxRedirects&&(p.follow=n.maxRedirects),p.headers=p.headers||{},void 0===p.multipart&&p.data){const e="undefined"!=typeof FormData&&(null==p?void 0:p.data)instanceof FormData;v.default.readable(p.data)?p.body=p.data:"undefined"!=typeof Buffer&&Buffer.isBuffer(p.data)?(p.body=p.data,T(p,"Content-Type")||(p.headers["Content-Type"]="application/json")):"object"==typeof p.data?e||("application/x-www-form-urlencoded"===C(p,"content-type")?p.body=p.paramsSerializer(p.data):(T(p,"Content-Type")||(p.headers["Content-Type"]="application/json"),p.body=JSON.stringify(p.data))):p.body=p.data}else if(p.multipart&&p.multipart.length>0){const e=(0,_.v4)();p.headers["Content-Type"]=`multipart/related; boundary=${e}`;const t=new S.PassThrough;p.body=t,(0,S.pipeline)(this.getMultipartRequest(p.multipart,e),t,()=>{})}p.validateStatus=p.validateStatus||this.validateStatus,p.responseType=p.responseType||"unknown",p.headers.Accept||"json"!==p.responseType||(p.headers.Accept="application/json"),p.method=p.method||"GET";const c=p.proxy||(null===(o=null===process||void 0===process?void 0:process.env)||void 0===o?void 0:o.HTTPS_PROXY)||(null===(i=null===process||void 0===process?void 0:process.env)||void 0===i?void 0:i.https_proxy)||(null===(a=null===process||void 0===process?void 0:process.env)||void 0===a?void 0:a.HTTP_PROXY)||(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.http_proxy),f=u(this,e,"m",r).call(this,p.url,p.noProxy);if(p.agent);else if(c&&f){const e=await u(t,t,"m",s).call(t);this.agentCache.has(c)?p.agent=this.agentCache.get(c):(p.agent=new e(c,{cert:p.cert,key:p.key}),this.agentCache.set(c,p.agent))}else p.cert&&p.key&&(this.agentCache.has(p.key)?p.agent=this.agentCache.get(p.key):(p.agent=new m.Agent({cert:p.cert,key:p.key}),this.agentCache.set(p.key,p.agent)));return"function"!=typeof p.errorRedactor&&!1!==p.errorRedactor&&(p.errorRedactor=O.defaultErrorRedactor),p},s=async function(){return c(this,t,u(this,t,"f",a)||(await Promise.resolve().then(()=>d(requireDist()))).HttpsProxyAgent,"f",a),u(this,t,"f",a)},a={value:void 0},gaxios}function requireSrc(){return hasRequiredSrc||(hasRequiredSrc=1,function(e){var t=src$1&&src$1.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=src$1&&src$1.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=async function(t){return e.instance.request(t)};const n=requireGaxios();Object.defineProperty(e,"Gaxios",{enumerable:!0,get:function(){return n.Gaxios}});var o=requireCommon$1();Object.defineProperty(e,"GaxiosError",{enumerable:!0,get:function(){return o.GaxiosError}}),r(requireInterceptor(),e),e.instance=new n.Gaxios}(src$1)),src$1}var srcExports=requireSrc(),mapHTTPStatusToOAuthError=function(e){switch(e){case 400:return"invalid_request";case 401:return"invalid_token";case 403:return"access_denied";case 429:return"network_error";case 500:return"server_error";case 503:return"temporarily_unavailable"}return"unknown"},OAUTH_ERROR_MAPPINGS={invalid_client:{userMessage:"Authentication configuration error. Please contact support.",internalMessage:"OAuth client credentials invalid",shouldRetry:!1,severity:exports.ErrorSeverity.Error},invalid_grant:{userMessage:"Your session has expired. Please sign in again.",internalMessage:"OAuth refresh token expired or revoked",shouldRetry:!1,severity:exports.ErrorSeverity.Error},access_denied:{userMessage:"Access was denied. Please grant permission to continue.",internalMessage:"User denied OAuth permission",shouldRetry:!1,severity:exports.ErrorSeverity.Info},invalid_token:{userMessage:"Your authentication token is invalid. Please sign in again.",internalMessage:"OAuth access token invalid",shouldRetry:!1,severity:exports.ErrorSeverity.Error},expired_token:{userMessage:"Your session has expired. Please sign in again.",internalMessage:"OAuth access token expired",shouldRetry:!1,severity:exports.ErrorSeverity.Error},redirect_uri_mismatch:{userMessage:"Authentication configuration error. Please contact support.",internalMessage:"OAuth redirect URI mismatch",shouldRetry:!1,severity:exports.ErrorSeverity.Error},insufficient_scope:{userMessage:"Additional permissions are required. Please sign in again.",internalMessage:"OAuth insufficient scope",shouldRetry:!1,severity:exports.ErrorSeverity.Error},network_error:{userMessage:"Network error. Please check your connection and try again.",internalMessage:"OAuth network error",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},timeout_error:{userMessage:"Request timed out. Please try again.",internalMessage:"OAuth request timeout",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},invalid_request:{userMessage:"Invalid request. Please try again.",internalMessage:"OAuth invalid request parameters",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unsupported_grant_type:{userMessage:"Authentication method not supported. Please contact support.",internalMessage:"OAuth unsupported grant type",shouldRetry:!1,severity:exports.ErrorSeverity.Error},invalid_scope:{userMessage:"Invalid permissions requested. Please contact support.",internalMessage:"OAuth invalid scope",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unauthorized_client:{userMessage:"Application not authorized. Please contact support.",internalMessage:"OAuth client not authorized",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unknown:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Unknown OAuth error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},server_error:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"OAuth server error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},temporarily_unavailable:{userMessage:"Service temporarily unavailable. Please try again in a moment.",internalMessage:"OAuth service temporarily unavailable",shouldRetry:!0,severity:exports.ErrorSeverity.Warning}};function isOAuth2Error(e){return e instanceof srcExports.GaxiosError}function extractOAuthErrorCode(e){var t,r,n=null===(r=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===r?void 0:r.error;return"string"==typeof n?n:"string"==typeof e.code?e.code.startsWith("E")?"ETIMEDOUT"===e.code?"timeout_error":("ENOTFOUND"===e.code||e.code,"network_error"):e.code:e.status?mapHTTPStatusToOAuthError(e.status):"unknown"}function handleGoogleOAuth2Error(e,t){var r,n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),isOAuth2Error(e)?(r=extractOAuthErrorCode(e),n=e):e instanceof Error?(n=e,r="unknown"):(n=new Error(String(e)),r="unknown");var o=r&&r in OAUTH_ERROR_MAPPINGS?OAUTH_ERROR_MAPPINGS[r]:OAUTH_ERROR_MAPPINGS.unknown;throw console.error("[Internal] Error from Google OAuth2: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var ENCRYPTION_ERROR_MAPPINGS={encryption_failed:{userMessage:"Failed to encrypt data. Please try again.",internalMessage:"Encryption operation failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},decryption_failed:{userMessage:"Failed to decrypt data. Please contact support.",internalMessage:"Decryption operation failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error}};function handleEncryptionError(e,t,r){var n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),n=e instanceof Error?e:new Error(String(e));var o=ENCRYPTION_ERROR_MAPPINGS[r];throw console.error("[Internal] Error from Encryption: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var EncryptionService=function(){function e(e){this.encryptionSecret=e,this.ENCRYPTION_SECRET=e}return e.prototype.encryptString=function(t){try{var r=crypto__default.default.randomBytes(e.SALT_BYTES).toString("hex"),n=crypto__default.default.randomBytes(e.IV_LENGTH),o=crypto__default.default.scryptSync(this.ENCRYPTION_SECRET,r,e.ENCRYPTION_KEY_LENGTH),i=crypto__default.default.createCipheriv(e.ALGORITHM,o,n),a=i.update(t,"utf8","hex");return a+=i.final("hex"),"".concat(n.toString("hex"),":").concat(a,":").concat(r)}catch(e){return handleEncryptionError(e,{operation:"encryptString",service:exports.ExceptionType.Encryption,metadata:{message:"Failed to encrypt string",errorType:e instanceof Error?e.name:typeof e}},"encryption_failed")}},e.prototype.decryptString=function(t){try{var r=__read(t.split(":"),3),n=r[0],o=r[1],i=r[2];if(!n||!o||!i)throw new Error("Invalid encrypted string");var a=Buffer.from(n,"hex"),s=crypto__default.default.scryptSync(this.ENCRYPTION_SECRET,i,e.ENCRYPTION_KEY_LENGTH),l=crypto__default.default.createDecipheriv(e.ALGORITHM,s,a),p=l.update(o,"hex","utf8");return p+=l.final("utf8")}catch(e){return handleEncryptionError(e,{operation:"decryptString",service:exports.ExceptionType.Encryption,metadata:{message:"Failed to decrypt string",errorType:e instanceof Error?e.name:typeof e}},"decryption_failed")}},e.ALGORITHM="aes-256-cbc",e.IV_LENGTH=16,e.SALT_BYTES=16,e.ENCRYPTION_KEY_LENGTH=32,e}(),FirestoreCollections;!function(e){e.CONNECTED_USERS_CREDENTIALS="connectedUsersCredentials",e.CLASSROOM_ATTACHMENTS="classroomAttachments"}(FirestoreCollections||(FirestoreCollections={}));var FirestoreClient=function(){function e(e){this.firestore=e,this._firestore=e}return e.prototype.getConnectedUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._firestore.collection(FirestoreCollections.CONNECTED_USERS_CREDENTIALS).doc(e).get()];case 1:return(t=o.sent()).exists?[2,userCredentialsEntitySchema.parse(t.data())]:[2,null];case 2:return r=o.sent(),n={operation:"getConnectedUserCredentials",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to get users credentials"}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.upsertConnectedUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=userCredentialsEntitySchema.parse(e),this._firestore.settings({ignoreUndefinedProperties:!0}),[4,this._firestore.collection(FirestoreCollections.CONNECTED_USERS_CREDENTIALS).doc(t.loginHint).set(t)];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),n={operation:"upsertConnectedUserCredentials",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to upsert users credentials",originalError:r}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.upsertClassroomAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=classroomAttachmentEntitySchema.parse(e),[4,this._firestore.collection(FirestoreCollections.CLASSROOM_ATTACHMENTS).doc(t.attachmentId).set(t)];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),n={operation:"upsertClassroomAttachment",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to upsert classroom attachment",originalError:r}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.getClassroomAttachmentById=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._firestore.collection(FirestoreCollections.CLASSROOM_ATTACHMENTS).doc(e).get()];case 1:return(t=o.sent()).exists?[2,classroomAttachmentEntitySchema.parse(t.data())]:[2,null];case 2:return r=o.sent(),n={operation:"getClassroomAttachmentById",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to get classroom attachment by ID"}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e}(),GoogleOAuthClient=function(){function e(e,t,r,n,o){var i=this;if(this.googleClientId=e,this.googleClientSecret=t,this.callbackUrl=r,this.accessToken=n,this.refreshToken=o,!e)throw new Error("Google Client ID is missing");if(!t)throw new Error("Google Client Secret is missing");if(!r)throw new Error("Google OAuth Callback URL is missing");var a=new require$$3$2.OAuth2Client({clientId:e,clientSecret:t,redirectUri:r,forceRefreshOnFailure:!1});"true"===process.env.GOOGLE_CLASSROOM_DEV_MODE&&n&&(a.refreshHandler=function(){return __awaiter(i,void 0,void 0,function(){return __generator$1(this,function(e){return[2,{access_token:n,expiry_date:(new Date).getTime()+36e5}]})})}),(n||o)&&a.setCredentials({access_token:n,refresh_token:o}),this.client=a,this.clientId=e}return e.prototype.getAuthenticateUrl=function(e,t){void 0===t&&(t=!1);try{return this.client.generateAuthUrl({access_type:"offline",include_granted_scopes:!0,scope:["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/classroom.courses.readonly","https://www.googleapis.com/auth/classroom.addons.student","https://www.googleapis.com/auth/classroom.addons.teacher"],loginHint:e,subscribeToNewsletter:t})}catch(e){return handleGoogleOAuth2Error(e,{operation:"getAuthenticateUrl",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to get authenticate url"}})}},e.prototype.exchangeCodeForTokens=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a;return __generator$1(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.client.getToken(e)];case 1:return t=s.sent().tokens,[4,this.client.verifyIdToken({idToken:t.id_token,audience:this.clientId})];case 2:return r=s.sent(),n=r.getPayload(),o={accessToken:t.access_token,loginHint:null==n?void 0:n.sub,refreshToken:t.refresh_token,profilePictureUrl:null==n?void 0:n.picture,email:null==n?void 0:n.email},[2,googleOAuthUserSchema.parse(o)];case 3:return i=s.sent(),a={operation:"exchangeCodeForTokens",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to exchange code for tokens"}},[2,handleGoogleOAuth2Error(i,a)];case 4:return[2]}})})},e.prototype.refreshAccessToken=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.client.setCredentials({refresh_token:e}),[4,this.client.getAccessToken()];case 1:return t=o.sent(),[2,tokenPayloadSchema.parse(t).token];case 2:return r=o.sent(),n={operation:"refreshAccessToken",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to refresh access token"}},[2,handleGoogleOAuth2Error(r,n)];case 3:return[2]}})})},e.prototype.isAuthenticated=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.client.getTokenInfo(e)];case 1:return t=o.sent(),t.expiry_date<Date.now()?[2,!1]:[2,!0];case 2:return r=o.sent(),n={operation:"isAuthenticated",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to check if access token is authenticated"}},[2,handleGoogleOAuth2Error(r,n)];case 3:return[2]}})})},e.prototype.getOAuth2Client=function(){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(e){return[2,this.client]})})},e}(),OakGoogleClassroomAddOn=function(){function e(e,t,r,n,o,i,a){this.encryptionSecret=e,this.firestore=t,this.googleOAuthClientId=r,this.googleOAuthClientSecret=n,this.googleOAuthCallbackApiRoute=o,this.sessionSecret=i,this.baseUrl=a,this.encryptionService=new EncryptionService(e),this.firestoreClient=new FirestoreClient(t),this._googleOAuthClientId=r,this._googleOAuthClientSecret=n,this._googleOAuthCallbackApiRoute=o,this._sessionSecret=i}return e.prototype.getOAuthClient=function(e,t){return new GoogleOAuthClient(this._googleOAuthClientId,this._googleOAuthClientSecret,this._googleOAuthCallbackApiRoute,e,t)},e.prototype.getGoogleSignInUrl=function(e){return __awaiter(this,arguments,void 0,function(e,t){var r,n;return void 0===t&&(t=!1),__generator$1(this,function(o){if(r=this.getOAuthClient(),!(n=r.getAuthenticateUrl(e,t)))throw new OakGoogleClassroomException("Failed to get Google Authentication URL",exports.ExceptionType.GoogleOAuth,{context:{operation:"getGoogleSignInUrl",service:exports.ExceptionType.GoogleOAuth},severity:exports.ErrorSeverity.Error,originalError:new Error("Failed to get Google Authentication URL")});return[2,n]})})},e.prototype.handleGoogleSignInCallback=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o,i,a,s,l;return __generator$1(this,function(p){switch(p.label){case 0:if(!e||"string"!=typeof e||""===e.trim())throw new OakGoogleClassroomException("Invalid OAuth code provided",exports.ExceptionType.GoogleOAuth,{context:{operation:"handleGoogleSignInCallback",service:exports.ExceptionType.GoogleOAuth},severity:exports.ErrorSeverity.Error,originalError:new Error("Invalid OAuth code provided")});return[4,this.getOAuthClient().exchangeCodeForTokens(e)];case 1:if(!(r=p.sent()))throw new OakGoogleClassroomException("Failed to authenticate Google sign-in",exports.ExceptionType.GoogleOAuth,{context:{operation:"handleGoogleSignInCallback",service:exports.ExceptionType.GoogleOAuth},severity:exports.ErrorSeverity.Error,originalError:new Error("Failed to authenticate Google sign-in")});if(n=googleOAuthUserSchema.parse(r),!(o=n.accessToken))throw new OakGoogleClassroomException("Access token missing from OAuth response",exports.ExceptionType.GoogleOAuth,{context:{operation:"handleGoogleSignInCallback",service:exports.ExceptionType.GoogleOAuth,metadata:{loginHint:n.loginHint}},severity:exports.ErrorSeverity.Error,originalError:new Error("Access token missing from OAuth response")});i=n.refreshToken?this.encryptionService.encryptString(n.refreshToken):void 0,a=n.profilePictureUrl?this.encryptionService.encryptString(n.profilePictureUrl):void 0,p.label=2;case 2:return p.trys.push([2,4,,5]),[4,sealData({loginHint:n.loginHint,accessToken:o},{password:this._sessionSecret})];case 3:return s=p.sent(),[3,5];case 4:throw l=p.sent(),new OakGoogleClassroomException("Failed to create encrypted session",exports.ExceptionType.Encryption,{context:{operation:"handleGoogleSignInCallback",service:exports.ExceptionType.Encryption,metadata:{loginHint:n.loginHint}},severity:exports.ErrorSeverity.Error,originalError:l instanceof Error?l:new Error(String(l))});case 5:return[4,this.firestoreClient.upsertConnectedUserCredentials({refreshToken:i,profilePictureUrl:a,loginHint:n.loginHint})];case 6:return p.sent(),t&&n.email?[4,t(n.email)]:[3,8];case 7:p.sent(),p.label=8;case 8:return[2,{encryptedSession:s,accessToken:o,profilePictureUrl:n.profilePictureUrl}]}})})},e.prototype.decryptSession=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator$1(this,function(r){switch(r.label){case 0:return[4,unsealData(e,{password:this._sessionSecret})];case 1:return(null==(t=r.sent())?void 0:t.accessToken)&&(null==t?void 0:t.loginHint)?[2,t]:[2,null]}})})},e.prototype.getSessionAndUser=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o;return __generator$1(this,function(i){switch(i.label){case 0:return[4,this.decryptSession(e)];case 1:return(t=i.sent())?[4,this.firestoreClient.getConnectedUserCredentials(t.loginHint)]:[2,null];case 2:return(r=i.sent())?(n=r.refreshToken?this.encryptionService.decryptString(r.refreshToken):void 0,r.refreshToken=n,process.env.GOOGLE_CLASSROOM_DEV_REFRESH_TOKEN&&(r.refreshToken=process.env.GOOGLE_CLASSROOM_DEV_REFRESH_TOKEN),r.profilePictureUrl&&(o=this.encryptionService.decryptString(r.profilePictureUrl),r.profilePictureUrl=o),[2,{session:t,user:r}]):[2,null]}})})},e.prototype.verifyAuthSession=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o,i,a,s;return __generator$1(this,function(l){switch(l.label){case 0:return e&&t?[4,this.getSessionAndUser(e)]:[2,null];case 1:return(r=l.sent())&&t&&(null===(i=null==r?void 0:r.session)||void 0===i?void 0:i.accessToken)===t?[4,(n=this.getOAuthClient(t,r.user.refreshToken)).isAuthenticated(t)]:[2,null];case 2:return l.sent()?[2,{session:e,token:t,userProfilePicUrl:null===(a=null==r?void 0:r.user)||void 0===a?void 0:a.profilePictureUrl}]:[4,n.refreshAccessToken(r.user.refreshToken)];case 3:return(o=l.sent())?[4,sealData({loginHint:r.session.loginHint,accessToken:o},{password:this._sessionSecret})]:[3,5];case 4:return[2,{session:l.sent(),token:o,userProfilePicUrl:null===(s=null==r?void 0:r.user)||void 0===s?void 0:s.profilePictureUrl}];case 5:return[2,null]}})})},e.prototype.createAttachment=function(e,t,r){return __awaiter(this,void 0,void 0,function(){var n,o,i,a;return __generator$1(this,function(s){switch(s.label){case 0:return[4,this.getSessionAndUser(r)];case 1:if(!(n=s.sent())||t!==n.session.accessToken)throw new Error("Invalid Google Classroom session");return o=this.getOAuthClient(t,n.user.refreshToken),[4,new GoogleClassroomClient(this.baseUrl,o).createAnnouncementAttachment(e)];case 2:return i=s.sent(),a=__assign(__assign({},i),{attachmentId:i.id,createdAt:(new Date).toISOString()}),[4,this.firestoreClient.upsertClassroomAttachment(a)];case 3:return s.sent(),[4,this.firestoreClient.getClassroomAttachmentById(i.id)];case 4:return[2,s.sent()]}})})},e}();exports.OakGoogleClassroomAddOn=OakGoogleClassroomAddOn,exports.OakGoogleClassroomException=OakGoogleClassroomException;
106
106
  //# sourceMappingURL=index.js.map