UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

32 lines • 234 kB
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url); { const __piWorkerThreads = require("node:worker_threads"); if (typeof __piWorkerThreads.markAsUncloneable !== "function") { __piWorkerThreads.markAsUncloneable = () => {}; } }
import{__commonJS,__require}from"./chunk-IKOFCODM.js";var require_extend=__commonJS({"node_modules/extend/index.js"(exports,module){"use strict";var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function(arr){return typeof Array.isArray=="function"?Array.isArray(arr):toStr.call(arr)==="[object Array]"},isPlainObject=function(obj){if(!obj||toStr.call(obj)!=="[object Object]")return!1;var hasOwnConstructor=hasOwn.call(obj,"constructor"),hasIsPrototypeOf=obj.constructor&&obj.constructor.prototype&&hasOwn.call(obj.constructor.prototype,"isPrototypeOf");if(obj.constructor&&!hasOwnConstructor&&!hasIsPrototypeOf)return!1;var key;for(key in obj);return typeof key>"u"||hasOwn.call(obj,key)},setProperty=function(target,options){defineProperty&&options.name==="__proto__"?defineProperty(target,options.name,{enumerable:!0,configurable:!0,value:options.newValue,writable:!0}):target[options.name]=options.newValue},getProperty=function(obj,name){if(name==="__proto__")if(hasOwn.call(obj,name)){if(gOPD)return gOPD(obj,name).value}else return;return obj[name]};module.exports=function extend(){var options,name,src,copy,copyIsArray,clone,target=arguments[0],i=1,length=arguments.length,deep=!1;for(typeof target=="boolean"&&(deep=target,target=arguments[1]||{},i=2),(target==null||typeof target!="object"&&typeof target!="function")&&(target={});i<length;++i)if(options=arguments[i],options!=null)for(name in options)src=getProperty(target,name),copy=getProperty(options,name),target!==copy&&(deep&&copy&&(isPlainObject(copy)||(copyIsArray=isArray(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&isArray(src)?src:[]):clone=src&&isPlainObject(src)?src:{},setProperty(target,{name,newValue:extend(deep,clone,copy)})):typeof copy<"u"&&setProperty(target,{name,newValue:copy}));return target}}});var require_package=__commonJS({"node_modules/gaxios/package.json"(exports,module){module.exports={name:"gaxios",version:"7.1.4",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",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:"jsdoc -c .jsdoc.js","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"},repository:{type:"git",directory:"packages/gaxios",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/node":"^22.13.1","@types/sinon":"^17.0.3","@types/tmp":"^0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.1.3",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.2","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.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.1",linkinator:"^6.1.2",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","stream-browserify":"^3.0.0",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios"}}});var require_util=__commonJS({"node_modules/gaxios/build/cjs/src/util.cjs"(exports,module){"use strict";var pkg=require_package();module.exports={pkg}}});var require_common=__commonJS({"node_modules/gaxios/build/cjs/src/common.js"(exports){"use strict";var __importDefault=exports&&exports.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});exports.GaxiosError=exports.GAXIOS_ERROR_SYMBOL=void 0;exports.defaultErrorRedactor=defaultErrorRedactor;var extend_1=__importDefault(require_extend()),util_cjs_1=__importDefault(require_util()),pkg=util_cjs_1.default.pkg;exports.GAXIOS_ERROR_SYMBOL=Symbol.for(`${pkg.name}-gaxios-error`);var GaxiosError=class _GaxiosError extends Error{config;response;code;status;error;[exports.GAXIOS_ERROR_SYMBOL]=pkg.version;static[Symbol.hasInstance](instance){return instance&&typeof instance=="object"&&exports.GAXIOS_ERROR_SYMBOL in instance&&instance[exports.GAXIOS_ERROR_SYMBOL]===pkg.version?!0:Function.prototype[Symbol.hasInstance].call(_GaxiosError,instance)}constructor(message,config,response,cause){if(super(message,{cause}),this.config=config,this.response=response,this.error=cause instanceof Error?cause:void 0,this.config=(0,extend_1.default)(!0,{},config),this.response&&(this.response.config=(0,extend_1.default)(!0,{},this.response.config)),this.response){try{this.response.data=translateData(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}cause instanceof DOMException?this.code=cause.name:cause&&typeof cause=="object"&&"code"in cause&&(typeof cause.code=="string"||typeof cause.code=="number")&&(this.code=cause.code)}static extractAPIErrorFromResponse(res,defaultErrorMessage="The request failed"){let message=defaultErrorMessage;if(typeof res.data=="string"&&(message=res.data),res.data&&typeof res.data=="object"&&"error"in res.data&&res.data.error&&!res.ok){if(typeof res.data.error=="string")return{message:res.data.error,code:res.status,status:res.statusText};if(typeof res.data.error=="object"){message="message"in res.data.error&&typeof res.data.error.message=="string"?res.data.error.message:message;let status="status"in res.data.error&&typeof res.data.error.status=="string"?res.data.error.status:res.statusText,code="code"in res.data.error&&typeof res.data.error.code=="number"?res.data.error.code:res.status;if("errors"in res.data.error&&Array.isArray(res.data.error.errors)){let errorMessages=[];for(let e of res.data.error.errors)typeof e=="object"&&"message"in e&&typeof e.message=="string"&&errorMessages.push(e.message);return Object.assign({message:errorMessages.join(`
`)||message,code,status},res.data.error)}return Object.assign({message,code,status},res.data.error)}}return{message,code:res.status,status:res.statusText}}};exports.GaxiosError=GaxiosError;function translateData(responseType,data){switch(responseType){case"stream":return data;case"json":return JSON.parse(JSON.stringify(data));case"arraybuffer":return JSON.parse(Buffer.from(data).toString("utf8"));case"blob":return JSON.parse(data.text());default:return data}}function defaultErrorRedactor(data){let REDACT="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function redactHeaders(headers){headers&&headers.forEach((_,key)=>{(/^authentication$/i.test(key)||/^authorization$/i.test(key)||/secret/i.test(key))&&headers.set(key,REDACT)})}function redactString(obj,key){if(typeof obj=="object"&&obj!==null&&typeof obj[key]=="string"){let text=obj[key];(/grant_type=/i.test(text)||/assertion=/i.test(text)||/secret/i.test(text))&&(obj[key]=REDACT)}}function redactObject(obj){!obj||typeof obj!="object"||(obj instanceof FormData||obj instanceof URLSearchParams||"forEach"in obj&&"set"in obj?obj.forEach((_,key)=>{(["grant_type","assertion"].includes(key)||/secret/.test(key))&&obj.set(key,REDACT)}):("grant_type"in obj&&(obj.grant_type=REDACT),"assertion"in obj&&(obj.assertion=REDACT),"client_secret"in obj&&(obj.client_secret=REDACT)))}return data.config&&(redactHeaders(data.config.headers),redactString(data.config,"data"),redactObject(data.config.data),redactString(data.config,"body"),redactObject(data.config.body),data.config.url.searchParams.has("token")&&data.config.url.searchParams.set("token",REDACT),data.config.url.searchParams.has("client_secret")&&data.config.url.searchParams.set("client_secret",REDACT)),data.response&&(defaultErrorRedactor({config:data.response.config}),redactHeaders(data.response.headers),data.response.bodyUsed&&(redactString(data.response,"data"),redactObject(data.response.data))),data}}});var require_retry=__commonJS({"node_modules/gaxios/build/cjs/src/retry.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.getRetryConfig=getRetryConfig;async function getRetryConfig(err){let config=getConfig(err);if(!err||!err.config||!config&&!err.config.retry)return{shouldRetry:!1};config=config||{},config.currentRetryAttempt=config.currentRetryAttempt||0,config.retry=config.retry===void 0||config.retry===null?3:config.retry,config.httpMethodsToRetry=config.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],config.noResponseRetries=config.noResponseRetries===void 0||config.noResponseRetries===null?2:config.noResponseRetries,config.retryDelayMultiplier=config.retryDelayMultiplier?config.retryDelayMultiplier:2,config.timeOfFirstRequest=config.timeOfFirstRequest?config.timeOfFirstRequest:Date.now(),config.totalTimeout=config.totalTimeout?config.totalTimeout:Number.MAX_SAFE_INTEGER,config.maxRetryDelay=config.maxRetryDelay?config.maxRetryDelay:Number.MAX_SAFE_INTEGER;let retryRanges=[[100,199],[408,408],[429,429],[500,599]];if(config.statusCodesToRetry=config.statusCodesToRetry||retryRanges,err.config.retryConfig=config,!await(config.shouldRetry||shouldRetryRequest)(err))return{shouldRetry:!1,config:err.config};let delay=getNextRetryDelay(config);err.config.retryConfig.currentRetryAttempt+=1;let backoff=config.retryBackoff?config.retryBackoff(err,delay):new Promise(resolve=>{setTimeout(resolve,delay)});return config.onRetryAttempt&&await config.onRetryAttempt(err),await backoff,{shouldRetry:!0,config:err.config}}function shouldRetryRequest(err){let config=getConfig(err);if(err.config.signal?.aborted&&err.code!=="TimeoutError"||err.code==="AbortError"||!config||config.retry===0||!err.response&&(config.currentRetryAttempt||0)>=config.noResponseRetries||!config.httpMethodsToRetry||!config.httpMethodsToRetry.includes(err.config.method?.toUpperCase()||"GET"))return!1;if(err.response&&err.response.status){let isInRange=!1;for(let[min,max]of config.statusCodesToRetry){let status=err.response.status;if(status>=min&&status<=max){isInRange=!0;break}}if(!isInRange)return!1}return config.currentRetryAttempt=config.currentRetryAttempt||0,!(config.currentRetryAttempt>=config.retry)}function getConfig(err){if(err&&err.config&&err.config.retryConfig)return err.config.retryConfig}function getNextRetryDelay(config){let calculatedDelay=(config.currentRetryAttempt?0:config.retryDelay??100)+(Math.pow(config.retryDelayMultiplier,config.currentRetryAttempt)-1)/2*1e3,maxAllowableDelay=config.totalTimeout-(Date.now()-config.timeOfFirstRequest);return Math.min(calculatedDelay,maxAllowableDelay,config.maxRetryDelay)}}});var require_interceptor=__commonJS({"node_modules/gaxios/build/cjs/src/interceptor.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.GaxiosInterceptorManager=void 0;var GaxiosInterceptorManager=class extends Set{};exports.GaxiosInterceptorManager=GaxiosInterceptorManager}});var require_gaxios=__commonJS({"node_modules/gaxios/build/cjs/src/gaxios.js"(exports){"use strict";var __importDefault=exports&&exports.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}},_a;Object.defineProperty(exports,"__esModule",{value:!0});exports.Gaxios=void 0;var extend_1=__importDefault(require_extend()),https_1=__require("https"),common_js_1=require_common(),retry_js_1=require_retry(),stream_1=__require("stream"),interceptor_js_1=require_interceptor(),randomUUID=async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),HTTP_STATUS_NO_CONTENT=204,Gaxios=class{agentCache=new Map;defaults;interceptors;constructor(defaults){this.defaults=defaults||{},this.interceptors={request:new interceptor_js_1.GaxiosInterceptorManager,response:new interceptor_js_1.GaxiosInterceptorManager}}fetch(...args){let input=args[0],init=args[1],url,headers=new Headers;return typeof input=="string"?url=new URL(input):input instanceof URL?url=input:input&&input.url&&(url=new URL(input.url)),input&&typeof input=="object"&&"headers"in input&&_a.mergeHeaders(headers,input.headers),init&&_a.mergeHeaders(headers,new Headers(init.headers)),typeof input=="object"&&!(input instanceof URL)?this.request({...init,...input,headers,url}):this.request({...init,headers,url})}async request(opts={}){let prepared=await this.#prepareRequest(opts);return prepared=await this.#applyRequestInterceptors(prepared),this.#applyResponseInterceptors(this._request(prepared))}async _defaultAdapter(config){let fetchImpl=config.fetchImplementation||this.defaults.fetchImplementation||await _a.#getFetch(),preparedOpts={...config};delete preparedOpts.data;let res=await fetchImpl(config.url,preparedOpts),data=await this.getResponseData(config,res);return Object.getOwnPropertyDescriptor(res,"data")?.configurable||Object.defineProperties(res,{data:{configurable:!0,writable:!0,enumerable:!0,value:data}}),Object.assign(res,{config,data})}async _request(opts){try{let translatedResponse;if(opts.adapter?translatedResponse=await opts.adapter(opts,this._defaultAdapter.bind(this)):translatedResponse=await this._defaultAdapter(opts),!opts.validateStatus(translatedResponse.status)){if(opts.responseType==="stream"){let response=[];for await(let chunk of translatedResponse.data)response.push(chunk);translatedResponse.data=response.toString()}let errorInfo=common_js_1.GaxiosError.extractAPIErrorFromResponse(translatedResponse,`Request failed with status code ${translatedResponse.status}`);throw new common_js_1.GaxiosError(errorInfo?.message,opts,translatedResponse,errorInfo)}return translatedResponse}catch(e){let err;e instanceof common_js_1.GaxiosError?err=e:e instanceof Error?err=new common_js_1.GaxiosError(e.message,opts,void 0,e):err=new common_js_1.GaxiosError("Unexpected Gaxios Error",opts,void 0,e);let{shouldRetry,config}=await(0,retry_js_1.getRetryConfig)(err);if(shouldRetry&&config)return err.config.retryConfig.currentRetryAttempt=config.retryConfig.currentRetryAttempt,opts.retryConfig=err.config?.retryConfig,this.#appendTimeoutToSignal(opts),this._request(opts);throw opts.errorRedactor&&opts.errorRedactor(err),err}}async getResponseData(opts,res){if(res.status===HTTP_STATUS_NO_CONTENT)return"";if(opts.maxContentLength&&res.headers.has("content-length")&&opts.maxContentLength<Number.parseInt(res.headers?.get("content-length")||""))throw new common_js_1.GaxiosError("Response's `Content-Length` is over the limit.",opts,Object.assign(res,{config:opts}));switch(opts.responseType){case"stream":return res.body;case"json":{let data=await res.text();try{return JSON.parse(data)}catch{return data}}case"arraybuffer":return res.arrayBuffer();case"blob":return res.blob();case"text":return res.text();default:return this.getResponseDataFromContentType(res)}}#urlMayUseProxy(url,noProxy=[]){let candidate=new URL(url),noProxyList=[...noProxy],noProxyEnvList=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let rule of noProxyEnvList)noProxyList.push(rule.trim());for(let rule of noProxyList)if(rule instanceof RegExp){if(rule.test(candidate.toString()))return!1}else if(rule instanceof URL){if(rule.origin===candidate.origin)return!1}else if(rule.startsWith("*.")||rule.startsWith(".")){let cleanedRule=rule.replace(/^\*\./,".");if(candidate.hostname.endsWith(cleanedRule))return!1}else if(rule===candidate.origin||rule===candidate.hostname||rule===candidate.href)return!1;return!0}async#applyRequestInterceptors(options){let promiseChain=Promise.resolve(options);for(let interceptor of this.interceptors.request.values())interceptor&&(promiseChain=promiseChain.then(interceptor.resolved,interceptor.rejected));return promiseChain}async#applyResponseInterceptors(response){let promiseChain=Promise.resolve(response);for(let interceptor of this.interceptors.response.values())interceptor&&(promiseChain=promiseChain.then(interceptor.resolved,interceptor.rejected));return promiseChain}async#prepareRequest(options){let preparedHeaders=new Headers(this.defaults.headers);_a.mergeHeaders(preparedHeaders,options.headers);let opts=(0,extend_1.default)(!0,{},this.defaults,options);if(!opts.url)throw new Error("URL is required.");if(opts.baseURL&&(opts.url=new URL(opts.url,opts.baseURL)),opts.url=new URL(opts.url),opts.params)if(opts.paramsSerializer){let additionalQueryParams=opts.paramsSerializer(opts.params);additionalQueryParams.startsWith("?")&&(additionalQueryParams=additionalQueryParams.slice(1));let prefix=opts.url.toString().includes("?")?"&":"?";opts.url=opts.url+prefix+additionalQueryParams}else{let url=opts.url instanceof URL?opts.url:new URL(opts.url);for(let[key,value]of new URLSearchParams(opts.params))url.searchParams.append(key,value);opts.url=url}typeof options.maxContentLength=="number"&&(opts.size=options.maxContentLength),typeof options.maxRedirects=="number"&&(opts.follow=options.maxRedirects);let shouldDirectlyPassData=typeof opts.data=="string"||opts.data instanceof ArrayBuffer||opts.data instanceof Blob||globalThis.File&&opts.data instanceof File||opts.data instanceof FormData||opts.data instanceof stream_1.Readable||opts.data instanceof ReadableStream||opts.data instanceof String||opts.data instanceof URLSearchParams||ArrayBuffer.isView(opts.data)||["Blob","File","FormData"].includes(opts.data?.constructor?.name||"");if(opts.multipart?.length){let boundary=await randomUUID();preparedHeaders.set("content-type",`multipart/related; boundary=${boundary}`),opts.body=stream_1.Readable.from(this.getMultipartRequest(opts.multipart,boundary))}else shouldDirectlyPassData?opts.body=opts.data:typeof opts.data=="object"?preparedHeaders.get("Content-Type")==="application/x-www-form-urlencoded"?opts.body=opts.paramsSerializer?opts.paramsSerializer(opts.data):new URLSearchParams(opts.data):(preparedHeaders.has("content-type")||preparedHeaders.set("content-type","application/json"),opts.body=JSON.stringify(opts.data)):opts.data&&(opts.body=opts.data);opts.validateStatus=opts.validateStatus||this.validateStatus,opts.responseType=opts.responseType||"unknown",!preparedHeaders.has("accept")&&opts.responseType==="json"&&preparedHeaders.set("accept","application/json");let proxy=opts.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!opts.agent)if(proxy&&this.#urlMayUseProxy(opts.url,opts.noProxy)){let HttpsProxyAgent=await _a.#getProxyAgent();this.agentCache.has(proxy)?opts.agent=this.agentCache.get(proxy):(opts.agent=new HttpsProxyAgent(proxy,{cert:opts.cert,key:opts.key}),this.agentCache.set(proxy,opts.agent))}else opts.cert&&opts.key&&(this.agentCache.has(opts.key)?opts.agent=this.agentCache.get(opts.key):(opts.agent=new https_1.Agent({cert:opts.cert,key:opts.key}),this.agentCache.set(opts.key,opts.agent)));return typeof opts.errorRedactor!="function"&&opts.errorRedactor!==!1&&(opts.errorRedactor=common_js_1.defaultErrorRedactor),opts.body&&!("duplex"in opts)&&(opts.duplex="half"),this.#appendTimeoutToSignal(opts),Object.assign(opts,{headers:preparedHeaders,url:opts.url instanceof URL?opts.url:new URL(opts.url)})}#appendTimeoutToSignal(opts){if(opts.timeout){let timeoutSignal=AbortSignal.timeout(opts.timeout);opts.signal&&!opts.signal.aborted?opts.signal=AbortSignal.any([opts.signal,timeoutSignal]):opts.signal=timeoutSignal}}validateStatus(status){return status>=200&&status<300}async getResponseDataFromContentType(response){let contentType=response.headers.get("Content-Type");if(contentType===null)return response.text();if(contentType=contentType.toLowerCase(),contentType.includes("application/json")){let data=await response.text();try{data=JSON.parse(data)}catch{}return data}else return contentType.match(/^text\//)?response.text():response.blob()}async*getMultipartRequest(multipartOptions,boundary){let finale=`--${boundary}--`;for(let currentPart of multipartOptions){let partContentType=currentPart.headers.get("Content-Type")||"application/octet-stream";yield`--${boundary}\r
Content-Type: ${partContentType}\r
\r
`,typeof currentPart.content=="string"?yield currentPart.content:yield*currentPart.content,yield`\r
`}yield finale}static#proxyAgent;static#fetch;static async#getProxyAgent(){return this.#proxyAgent||=(await import("./https-proxy-agent-KZEZTHLI.js")).HttpsProxyAgent,this.#proxyAgent}static async#getFetch(){let hasWindow=typeof window<"u"&&!!window;return this.#fetch||=hasWindow?window.fetch:(await import("./src-U5BHCDY2.js")).default,this.#fetch}static mergeHeaders(base,...append){base=base instanceof Headers?base:new Headers(base);for(let headers of append)(headers instanceof Headers?headers:new Headers(headers)).forEach((value,key)=>{key==="set-cookie"?base.append(key,value):base.set(key,value)});return base}};exports.Gaxios=Gaxios;_a=Gaxios}});var require_src=__commonJS({"node_modules/gaxios/build/cjs/src/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.instance=exports.Gaxios=exports.GaxiosError=void 0;exports.request=request;var gaxios_js_1=require_gaxios();Object.defineProperty(exports,"Gaxios",{enumerable:!0,get:function(){return gaxios_js_1.Gaxios}});var common_js_1=require_common();Object.defineProperty(exports,"GaxiosError",{enumerable:!0,get:function(){return common_js_1.GaxiosError}});__exportStar(require_interceptor(),exports);exports.instance=new gaxios_js_1.Gaxios;async function request(opts){return exports.instance.request(opts)}}});var require_bignumber=__commonJS({"node_modules/bignumber.js/bignumber.js"(exports,module){(function(globalObject){"use strict";var BigNumber,isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(configObject){var div,convertBase,parseNumeric,P=BigNumber2.prototype={constructor:BigNumber2,toString:null,valueOf:null},ONE=new BigNumber2(1),DECIMAL_PLACES=20,ROUNDING_MODE=4,TO_EXP_NEG=-7,TO_EXP_POS=21,MIN_EXP=-1e7,MAX_EXP=1e7,CRYPTO=!1,MODULO_MODE=1,POW_PRECISION=0,FORMAT={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},ALPHABET="0123456789abcdefghijklmnopqrstuvwxyz",alphabetHasNormalDecimalDigits=!0;function BigNumber2(v,b){var alphabet,c,caseChanged,e,i,isNum,len,str,x=this;if(!(x instanceof BigNumber2))return new BigNumber2(v,b);if(b==null){if(v&&v._isBigNumber===!0){x.s=v.s,!v.c||v.e>MAX_EXP?x.c=x.e=null:v.e<MIN_EXP?x.c=[x.e=0]:(x.e=v.e,x.c=v.c.slice());return}if((isNum=typeof v=="number")&&v*0==0){if(x.s=1/v<0?(v=-v,-1):1,v===~~v){for(e=0,i=v;i>=10;i/=10,e++);e>MAX_EXP?x.c=x.e=null:(x.e=e,x.c=[v]);return}str=String(v)}else{if(!isNumeric.test(str=String(v)))return parseNumeric(x,str,isNum);x.s=str.charCodeAt(0)==45?(str=str.slice(1),-1):1}(e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length)}else{if(intCheck(b,2,ALPHABET.length,"Base"),b==10&&alphabetHasNormalDecimalDigits)return x=new BigNumber2(v),round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE);if(str=String(v),isNum=typeof v=="number"){if(v*0!=0)return parseNumeric(x,str,isNum,b);if(x.s=1/v<0?(str=str.slice(1),-1):1,BigNumber2.DEBUG&&str.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+v)}else x.s=str.charCodeAt(0)===45?(str=str.slice(1),-1):1;for(alphabet=ALPHABET.slice(0,b),e=i=0,len=str.length;i<len;i++)if(alphabet.indexOf(c=str.charAt(i))<0){if(c=="."){if(i>e){e=len;continue}}else if(!caseChanged&&(str==str.toUpperCase()&&(str=str.toLowerCase())||str==str.toLowerCase()&&(str=str.toUpperCase()))){caseChanged=!0,i=-1,e=0;continue}return parseNumeric(x,String(v),isNum,b)}isNum=!1,str=convertBase(str,b,10,x.s),(e=str.indexOf("."))>-1?str=str.replace(".",""):e=str.length}for(i=0;str.charCodeAt(i)===48;i++);for(len=str.length;str.charCodeAt(--len)===48;);if(str=str.slice(i,++len)){if(len-=i,isNum&&BigNumber2.DEBUG&&len>15&&(v>MAX_SAFE_INTEGER||v!==mathfloor(v)))throw Error(tooManyDigits+x.s*v);if((e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e<MIN_EXP)x.c=[x.e=0];else{if(x.e=e,x.c=[],i=(e+1)%LOG_BASE,e<0&&(i+=LOG_BASE),i<len){for(i&&x.c.push(+str.slice(0,i)),len-=LOG_BASE;i<len;)x.c.push(+str.slice(i,i+=LOG_BASE));i=LOG_BASE-(str=str.slice(i)).length}else i-=len;for(;i--;str+="0");x.c.push(+str)}}else x.c=[x.e=0]}BigNumber2.clone=clone,BigNumber2.ROUND_UP=0,BigNumber2.ROUND_DOWN=1,BigNumber2.ROUND_CEIL=2,BigNumber2.ROUND_FLOOR=3,BigNumber2.ROUND_HALF_UP=4,BigNumber2.ROUND_HALF_DOWN=5,BigNumber2.ROUND_HALF_EVEN=6,BigNumber2.ROUND_HALF_CEIL=7,BigNumber2.ROUND_HALF_FLOOR=8,BigNumber2.EUCLID=9,BigNumber2.config=BigNumber2.set=function(obj){var p,v;if(obj!=null)if(typeof obj=="object"){if(obj.hasOwnProperty(p="DECIMAL_PLACES")&&(v=obj[p],intCheck(v,0,MAX,p),DECIMAL_PLACES=v),obj.hasOwnProperty(p="ROUNDING_MODE")&&(v=obj[p],intCheck(v,0,8,p),ROUNDING_MODE=v),obj.hasOwnProperty(p="EXPONENTIAL_AT")&&(v=obj[p],v&&v.pop?(intCheck(v[0],-MAX,0,p),intCheck(v[1],0,MAX,p),TO_EXP_NEG=v[0],TO_EXP_POS=v[1]):(intCheck(v,-MAX,MAX,p),TO_EXP_NEG=-(TO_EXP_POS=v<0?-v:v))),obj.hasOwnProperty(p="RANGE"))if(v=obj[p],v&&v.pop)intCheck(v[0],-MAX,-1,p),intCheck(v[1],1,MAX,p),MIN_EXP=v[0],MAX_EXP=v[1];else if(intCheck(v,-MAX,MAX,p),v)MIN_EXP=-(MAX_EXP=v<0?-v:v);else throw Error(bignumberError+p+" cannot be zero: "+v);if(obj.hasOwnProperty(p="CRYPTO"))if(v=obj[p],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))CRYPTO=v;else throw CRYPTO=!v,Error(bignumberError+"crypto unavailable");else CRYPTO=v;else throw Error(bignumberError+p+" not true or false: "+v);if(obj.hasOwnProperty(p="MODULO_MODE")&&(v=obj[p],intCheck(v,0,9,p),MODULO_MODE=v),obj.hasOwnProperty(p="POW_PRECISION")&&(v=obj[p],intCheck(v,0,MAX,p),POW_PRECISION=v),obj.hasOwnProperty(p="FORMAT"))if(v=obj[p],typeof v=="object")FORMAT=v;else throw Error(bignumberError+p+" not an object: "+v);if(obj.hasOwnProperty(p="ALPHABET"))if(v=obj[p],typeof v=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(v))alphabetHasNormalDecimalDigits=v.slice(0,10)=="0123456789",ALPHABET=v;else throw Error(bignumberError+p+" invalid: "+v)}else throw Error(bignumberError+"Object expected: "+obj);return{DECIMAL_PLACES,ROUNDING_MODE,EXPONENTIAL_AT:[TO_EXP_NEG,TO_EXP_POS],RANGE:[MIN_EXP,MAX_EXP],CRYPTO,MODULO_MODE,POW_PRECISION,FORMAT,ALPHABET}},BigNumber2.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!BigNumber2.DEBUG)return!0;var i,n,c=v.c,e=v.e,s=v.s;out:if({}.toString.call(c)=="[object Array]"){if((s===1||s===-1)&&e>=-MAX&&e<=MAX&&e===mathfloor(e)){if(c[0]===0){if(e===0&&c.length===1)return!0;break out}if(i=(e+1)%LOG_BASE,i<1&&(i+=LOG_BASE),String(c[0]).length==i){for(i=0;i<c.length;i++)if(n=c[i],n<0||n>=BASE||n!==mathfloor(n))break out;if(n!==0)return!0}}}else if(c===null&&e===null&&(s===null||s===1||s===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+v)},BigNumber2.maximum=BigNumber2.max=function(){return maxOrMin(arguments,-1)},BigNumber2.minimum=BigNumber2.min=function(){return maxOrMin(arguments,1)},BigNumber2.random=(function(){var pow2_53=9007199254740992,random53bitInt=Math.random()*pow2_53&2097151?function(){return mathfloor(Math.random()*pow2_53)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber2(ONE);if(dp==null?dp=DECIMAL_PLACES:intCheck(dp,0,MAX),k=mathceil(dp/LOG_BASE),CRYPTO)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(k*=2));i<k;)v=a[i]*131072+(a[i+1]>>>11),v>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(k*=7);i<k;)v=(a[i]&31)*281474976710656+a[i+1]*1099511627776+a[i+2]*4294967296+a[i+3]*16777216+(a[i+4]<<16)+(a[i+5]<<8)+a[i+6],v>=9e15?crypto.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else throw CRYPTO=!1,Error(bignumberError+"crypto unavailable");if(!CRYPTO)for(;i<k;)v=random53bitInt(),v<9e15&&(c[i++]=v%1e14);for(k=c[--i],dp%=LOG_BASE,k&&dp&&(v=POWS_TEN[LOG_BASE-dp],c[i]=mathfloor(k/v)*v);c[i]===0;c.pop(),i--);if(i<0)c=[e=0];else{for(e=-1;c[0]===0;c.splice(0,1),e-=LOG_BASE);for(i=1,v=c[0];v>=10;v/=10,i++);i<LOG_BASE&&(e-=LOG_BASE-i)}return rand.e=e,rand.c=c,rand}})(),BigNumber2.sum=function(){for(var i=1,args=arguments,sum=new BigNumber2(args[0]);i<args.length;)sum=sum.plus(args[i++]);return sum},convertBase=(function(){var decimal="0123456789";function toBaseOut(str,baseIn,baseOut,alphabet){for(var j,arr=[0],arrL,i=0,len=str.length;i<len;){for(arrL=arr.length;arrL--;arr[arrL]*=baseIn);for(arr[0]+=alphabet.indexOf(str.charAt(i++)),j=0;j<arr.length;j++)arr[j]>baseOut-1&&(arr[j+1]==null&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}return function(str,baseIn,baseOut,sign,callerIsToString){var alphabet,d,e,k,r,x,xc,y,i=str.indexOf("."),dp=DECIMAL_PLACES,rm=ROUNDING_MODE;for(i>=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber2(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e,"0"),10,baseOut,decimal),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut,callerIsToString?(alphabet=ALPHABET,decimal):(alphabet=decimal,ALPHABET)),e=k=xc.length;xc[--k]==0;xc.pop());if(!xc[0])return alphabet.charAt(0);if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||xc[d+1]!=null,r=rm<4?(i!=null||r)&&(rm==0||rm==(x.s<0?3:2)):i>k||i==k&&(rm==4||r||rm==6&&xc[d-1]&1||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint(alphabet.charAt(1),-dp,alphabet.charAt(0)):alphabet.charAt(0);else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc=[1].concat(xc));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=alphabet.charAt(xc[i++]));str=toFixedPoint(str,e,alphabet.charAt(0))}return str}})(),div=(function(){function multiply(x,k,base){var m,temp,xlo,xhi,carry=0,i=x.length,klo=k%SQRT_BASE,khi=k/SQRT_BASE|0;for(x=x.slice();i--;)xlo=x[i]%SQRT_BASE,xhi=x[i]/SQRT_BASE|0,m=khi*xlo+xhi*klo,temp=klo*xlo+m%SQRT_BASE*SQRT_BASE+carry,carry=(temp/base|0)+(m/SQRT_BASE|0)+khi*xhi,x[i]=temp%base;return carry&&(x=[carry].concat(x)),x}function compare2(a,b,aL,bL){var i,cmp;if(aL!=bL)cmp=aL>bL?1:-1;else for(i=cmp=0;i<aL;i++)if(a[i]!=b[i]){cmp=a[i]>b[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]<b[aL]?1:0,a[aL]=i*base+a[aL]-b[aL];for(;!a[0]&&a.length>1;a.splice(0,1));}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!xc||!xc[0]||!yc||!yc[0])return new BigNumber2(!x.s||!y.s||(xc?yc&&xc[0]==yc[0]:!yc)?NaN:xc&&xc[0]==0||!yc?s*0:s/0);for(q=new BigNumber2(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL<yL;rem[remL++]=0);yz=yc.slice(),yz=[0].concat(yz),yc0=yc[0],yc[1]>=base/2&&yc0++;do{if(n=0,cmp=compare2(yc,rem,yL,remL),cmp<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),n=mathfloor(rem0/yc0),n>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;compare2(prod,rem,prodL,remL)==1;)n--,subtract(prod,yL<prodL?yz:yc,prodL,base),prodL=prod.length,cmp=1;else n==0&&(cmp=n=1),prod=yc.slice(),prodL=prod.length;if(prodL<remL&&(prod=[0].concat(prod)),subtract(rem,prod,remL,base),remL=rem.length,cmp==-1)for(;compare2(yc,rem,yL,remL)<1;)n++,subtract(rem,yL<remL?yz:yc,remL,base),remL=rem.length}else cmp===0&&(n++,rem=[0]);qc[i++]=n,rem[0]?rem[remL++]=xc[xi]||0:(rem=[xc[xi]],remL=1)}while((xi++<xL||rem[0]!=null)&&s--);more=rem[0]!=null,qc[0]||qc.splice(0,1)}if(base==BASE){for(i=1,s=qc[0];s>=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}})();function format(n,i,rm,id){var c0,e,ne,len,str;if(rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),!n.c)return n.toString();if(c0=n.c[0],ne=n.e,i==null)str=coeffToString(n.c),str=id==1||id==2&&(ne<=TO_EXP_NEG||ne>=TO_EXP_POS)?toExponential(str,ne):toFixedPoint(str,ne,"0");else if(n=round(new BigNumber2(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,id==1||id==2&&(i<=e||e<=TO_EXP_NEG)){for(;len<i;str+="0",len++);str=toExponential(str,e)}else if(i-=ne+(id===2&&e>ne),str=toFixedPoint(str,e,"0"),e+1>len){if(--i>0)for(str+=".";i--;str+="0");}else if(i+=e-len,i>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,n){for(var k,y,i=1,x=new BigNumber2(args[0]);i<args.length;i++)y=new BigNumber2(args[i]),(!y.s||(k=compare(x,y))===n||k===0&&x.s===n)&&(x=y);return x}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e<MIN_EXP?n.c=[n.e=0]:(n.e=e,n.c=c),n}parseNumeric=(function(){var basePrefix=/^(-?)0([xbo])(?=\w[\w.]*$)/i,dotAfter=/^([^.]+)\.$/,dotBefore=/^\.([^.]+)$/,isInfinityOrNaN=/^-?(Infinity|NaN)$/,whitespaceOrPlus=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(x,str,isNum,b){var base,s=isNum?str:str.replace(whitespaceOrPlus,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!isNum&&(s=s.replace(basePrefix,function(m,p1,p2){return base=(p2=p2.toLowerCase())=="x"?16:p2=="b"?2:8,!b||b==base?p1:m}),b&&(base=b,s=s.replace(dotAfter,"$1").replace(dotBefore,"0.$1")),str!=s))return new BigNumber2(s,base);if(BigNumber2.DEBUG)throw Error(bignumberError+"Not a"+(b?" base "+b:"")+" number: "+str);x.s=null}x.c=x.e=null}})();function round(x,sd,rm,r){var d,i,j,k,n,ni,rd,xc=x.c,pows10=POWS_TEN;if(xc){out:{for(d=1,k=xc[0];k>=10;k/=10,d++);if(i=sd-d,i<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=mathfloor(n/pows10[d-j-1]%10);else if(ni=mathceil((i+1)/LOG_BASE),ni>=xc.length)if(r){for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else break out;else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:mathfloor(n/pows10[d-j-1]%10)}if(r=r||sd<0||xc[ni+1]!=null||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(rm==0||rm==(x.s<0?3:2)):rd>5||rd==5&&(rm==4||r||rm==6&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(i==0?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;)if(ni==0){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}else{if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;xc[--i]===0;xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.e<MIN_EXP&&(x.c=[x.e=0])}return x}function valueOf(n){var str,e=n.e;return e===null?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e,"0"),n.s<0?"-"+str:str)}return P.absoluteValue=P.abs=function(){var x=new BigNumber2(this);return x.s<0&&(x.s=1),x},P.comparedTo=function(y,b){return compare(this,new BigNumber2(y,b))},P.decimalPlaces=P.dp=function(dp,rm){var c,n,v,x=this;if(dp!=null)return intCheck(dp,0,MAX),rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(new BigNumber2(x),dp+x.e+1,rm);if(!(c=x.c))return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return div(this,new BigNumber2(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.idiv=function(y,b){return div(this,new BigNumber2(y,b),0,1)},P.exponentiatedBy=P.pow=function(n,m){var half,isModExp,i,k,more,nIsBig,nIsNeg,nIsOdd,y,x=this;if(n=new BigNumber2(n),n.c&&!n.isInteger())throw Error(bignumberError+"Exponent not an integer: "+valueOf(n));if(m!=null&&(m=new BigNumber2(m)),nIsBig=n.e>14,!x.c||!x.c[0]||x.c[0]==1&&!x.e&&x.c.length==1||!n.c||!n.c[0])return y=new BigNumber2(Math.pow(+valueOf(x),nIsBig?n.s*(2-isOdd(n)):+valueOf(n))),m?y.mod(m):y;if(nIsNeg=n.s<0,m){if(m.c?!m.c[0]:!m.s)return new BigNumber2(NaN);isModExp=!nIsNeg&&x.isInteger()&&m.isInteger(),isModExp&&(x=x.mod(m))}else{if(n.e>9&&(x.e>0||x.e<-1||(x.e==0?x.c[0]>1||nIsBig&&x.c[1]>=24e7:x.c[0]<8e13||nIsBig&&x.c[0]<=9999975e7)))return k=x.s<0&&isOdd(n)?-0:0,x.e>-1&&(k=1/k),new BigNumber2(nIsNeg?1/k:k);POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2))}for(nIsBig?(half=new BigNumber2(.5),nIsNeg&&(n.s=1),nIsOdd=isOdd(n)):(i=Math.abs(+valueOf(n)),nIsOdd=i%2),y=new BigNumber2(ONE);;){if(nIsOdd){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):isModExp&&(y=y.mod(m))}if(i){if(i=mathfloor(i/2),i===0)break;nIsOdd=i%2}else if(n=n.times(half),round(n,n.e+1,1),n.e>14)nIsOdd=isOdd(n);else{if(i=+valueOf(n),i===0)break;nIsOdd=i%2}x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):isModExp&&(x=x.mod(m))}return isModExp?y:(nIsNeg&&(y=ONE.div(y)),m?y.mod(m):k?round(y,POW_PRECISION,ROUNDING_MODE,more):y)},P.integerValue=function(rm){var n=new BigNumber2(this);return rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(n,n.e+1,rm)},P.isEqualTo=P.eq=function(y,b){return compare(this,new BigNumber2(y,b))===0},P.isFinite=function(){return!!this.c},P.isGreaterThan=P.gt=function(y,b){return compare(this,new BigNumber2(y,b))>0},P.isGreaterThanOrEqualTo=P.gte=function(y,b){return(b=compare(this,new BigNumber2(y,b)))===1||b===0},P.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isLessThan=P.lt=function(y,b){return compare(this,new BigNumber2(y,b))<0},P.isLessThanOrEqualTo=P.lte=function(y,b){return(b=compare(this,new BigNumber2(y,b)))===-1||b===0},P.isNaN=function(){return!this.s},P.isNegative=function(){return this.s<0},P.isPositive=function(){return this.s>0},P.isZero=function(){return!!this.c&&this.c[0]==0},P.minus=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(y=new BigNumber2(y,b),b=y.s,!a||!b)return new BigNumber2(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber2(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber2(xc[0]?x:ROUNDING_MODE==3?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b<j;b++)if(xc[b]!=yc[b]){xLTy=xc[b]<yc[b];break}if(xLTy&&(t=xc,xc=yc,yc=t,y.s=-y.s),b=(j=yc.length)-(i=xc.length),b>0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]<yc[j]){for(i=j;i&&!xc[--i];xc[i]=b);--xc[i],xc[j]+=BASE}xc[j]-=yc[j]}for(;xc[0]==0;xc.splice(0,1),--ye);return xc[0]?normalise(y,xc,ye):(y.s=ROUNDING_MODE==3?-1:1,y.c=[y.e=0],y)},P.modulo=P.mod=function(y,b){var q,s,x=this;return y=new BigNumber2(y,b),!x.c||!y.s||y.c&&!y.c[0]?new BigNumber2(NaN):!y.c||x.c&&!x.c[0]?new BigNumber2(x):(MODULO_MODE==9?(s=y.s,y.s=1,q=div(x,y,0,3),y.s=s,q.s*=s):q=div(x,y,0,MODULO_MODE),y=x.minus(q.times(y)),!y.c[0]&&MODULO_MODE==1&&(y.s=x.s),y)},P.multipliedBy=P.times=function(y,b){var c,e,i,j,k,m,xcL,xlo,xhi,ycL,ylo,yhi,zc,base,sqrtBase,x=this,xc=x.c,yc=(y=new BigNumber2(y,b)).c;if(!xc||!yc||!xc[0]||!yc[0])return!x.s||!y.s||xc&&!xc[0]&&!yc||yc&&!yc[0]&&!xc?y.c=y.e=y.s=null:(y.s*=x.s,!xc||!yc?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(e=bitFloor(x.e/LOG_BASE)+bitFloor(y.e/LOG_BASE),y.s*=x.s,xcL=xc.length,ycL=yc.length,xcL<ycL&&(zc=xc,xc=yc,yc=zc,i=xcL,xcL=ycL,ycL=i),i=xcL+ycL,zc=[];i--;zc.push(0));for(base=BASE,sqrtBase=SQRT_BASE,i=ycL;--i>=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.splice(0,1),normalise(y,zc,e)},P.negated=function(){var x=new BigNumber2(this);return x.s=-x.s||null,x},P.plus=function(y,b){var t,x=this,a=x.s;if(y=new BigNumber2(y,b),b=y.s,!a||!b)return new BigNumber2(NaN);if(a!=b)return y.s=-b,x.minus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return new BigNumber2(a/0);if(!xc[0]||!yc[0])return yc[0]?y:new BigNumber2(xc[0]?x:a*0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for(a>0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]=BASE===xc[b]?0:xc[b]%BASE;return a&&(xc=[a].concat(xc),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(sd,rm){var c,n,v,x=this;if(sd!=null&&sd!==!!sd)return intCheck(sd,1,MAX),rm==null?rm=ROUNDING_MODE:intCheck(rm,0,8),round(new BigNumber2(x),sd,rm);if(!(c=x.c))return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return sd&&x.e+1>n&&(n=x.e+1),n},P.shiftedBy=function(k){return intCheck(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+k)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber2("0.5");if(s!==1||!c||!c[0])return new BigNumber2(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+valueOf(x)),s==0||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(+n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="5e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber2(n)):r=new BigNumber2(s+""),r.c[0]){for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s))if(r.e<e&&--s,n=n.slice(s-3,s+1),n=="9999"||!rep&&n=="4999"){if(!rep&&(round(t,t.e+DECIMAL_PLACES+2,0),t.times(t).eq(x))){r=t;break}dp+=4,s+=4,rep=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(round(r,r.e+DECIMAL_PLACES+2,1),m=!r.times(r).eq(x));break}}return round(r,r.e+DECIMAL_PLACES+1,ROUNDING_MODE,m)},P.toExponential=function(dp,rm){return dp!=null&&(intCheck(dp,0,MAX),dp++),format(this,dp,rm,1)},P.toFixed=function(dp,rm){return dp!=null&&(intCheck(dp,0,MAX),dp=dp+this.e+1),format(this,dp,rm)},P.toFormat=function(dp,rm,format2){var str,x=this;if(format2==null)dp!=null&&rm&&typeof rm=="object"?(format2=rm,rm=null):dp&&typeof dp=="object"?(format2=dp,dp=rm=null):format2=FORMAT;else if(typeof format2!="object")throw Error(bignumberError+"Argument not an object: "+format2);if(str=x.toFixed(dp,rm),x.c){var i,arr=str.split("."),g1=+format2.groupSize,g2=+format2.secondaryGroupSize,groupSeparator=format2.groupSeparator||"",intPart=arr[0],fractionPart=arr[1],isNeg=x.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i<len;i+=g1)intPart+=groupSeparator+intDigits.substr(i,g1);g2>0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+(format2.decimalSeparator||"")+((g2=+format2.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+(format2.fractionGroupSeparator||"")):fractionPart):intPart}return(format2.prefix||"")+str+(format2.suffix||"")},P.toFraction=function(md){var d,d0,d1,d2,e,exp,n,n0,n1,q,r,s,x=this,xc=x.c;if(md!=null&&(n=new BigNumber2(md),!n.isInteger()&&(n.c||n.s!==1)||n.lt(ONE)))throw Error(bignumberError+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+valueOf(n));if(!xc)return new BigNumber2(x);for(d=new BigNumber2(ONE),n1=d0=new BigNumber2(ONE),d1=n0=new BigNumber2(ONE),s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.comparedTo(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber2(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),d2.comparedTo(md)!=1;)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e=e*2,r=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().comparedTo(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1,d1]:[n0,d0],MAX_EXP=exp,r},P.toNumber=function(){return+valueOf(this)},P.toPrecision=function(sd,rm){return sd!=null&&intCheck(sd,1,MAX),format(this,sd,rm,2)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return e===null?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(b==null?str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(coeffToString(n.c),e):toFixedPoint(coeffToString(n.c),e,"0"):b===10&&alphabetHasNormalDecimalDigits?(n=round(new BigNumber2(n),DECIMAL_PLACES+e+1,ROUNDING_MODE),str=toFixedPoint(coeffToString(n.c),n.e,"0")):(intCheck(b,2,ALPHABET.length,"Base"),str=convertBase(toFixedPoint(coeffToString(n.c),e,"0"),10,b,s,!0)),s<0&&n.c[0]&&(str="-"+str)),str},P.valueOf=P.toJSON=function(){return valueOf(this)},P._isBigNumber=!0,configObject!=null&&BigNumber2.set(configObject),BigNumber2}function bitFloor(n){var i=n|0;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";i<j;){for(s=a[i++]+"",z=LOG_BASE-s.length;z--;s="0"+s);r+=s}for(j=r.length;r.charCodeAt(--j)===48;);return r.slice(0,j+1||1)}function compare(x,y){var a,b,xc=x.c,yc=y.c,i=x.s,j=y.s,k=x.e,l=y.e;if(!i||!j)return null;if(a=xc&&!xc[0],b=yc&&!yc[0],a||b)return a?b?0:-j:i;if(i!=j)return i;if(a=i<0,b=k==l,!xc||!yc)return b?0:!xc^a?1:-1;if(!b)return k>l^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;i<j;i++)if(xc[i]!=yc[i])return xc[i]>yc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intCheck(n,min,max,name){if(n<min||n>max||n!==mathfloor(n))throw Error(bignumberError+(name||"Argument")+(typeof n=="number"?n<min||n>max?" out of range: ":" not an integer: ":" not a primitive number: ")+String(n))}function isOdd(n){var k=n.c.length-1;return bitFloor(n.e/LOG_BASE)==k&&n.c[k]%2!=0}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e,z){var len,zs;if(e<0){for(zs=z+".";++e;zs+=z);str=zs+str}else if(len=str.length,++e>len){for(zs=z,e-=len;--e;zs+=z);str+=zs}else e<len&&(str=str.slice(0,e)+"."+str.slice(e));return str}BigNumber=clone(),BigNumber.default=BigNumber.BigNumber=BigNumber,typeof define=="function"&&define.amd?define(function(){return BigNumber}):typeof module<"u"&&module.exports?module.exports=BigNumber:(globalObject||(globalObject=typeof self<"u"&&self?self:window),globalObject.BigNumber=BigNumber)})(exports)}});var require_stringify=__commonJS({"node_modules/json-bigint/lib/stringify.js"(exports,module){var BigNumber=require_bignumber(),JSON2=module.exports;(function(){"use strict";function f(n){return n<10?"0"+n:n}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){return escapable.lastIndex=0,escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c=="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key],isBigNumber=value!=null&&(value instanceof BigNumber||BigNumber.isBigNumber(value));switch(value&&typeof value=="object"&&typeof value.toJSON=="function"&&(value=value.toJSON(key)),typeof rep=="function"&&(value=rep.call(holder,key,value)),typeof value){case"string":return isBigNumber?value:quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":case"bigint":return String(value);case"object":if(!value)return"null";if(gap+=indent,partial=[],Object.prototype.toString.apply(value)==="[object Array]"){for(length=value.length,i=0;i<length;i+=1)partial[i]=str(i,value)||"null";return v=partial.length===0?"[]":gap?`[
`+gap+partial.join(`,
`+gap)+`
`+mind+"]":"["+partial.join(",")+"]",gap=mind,v}if(rep&&typeof rep=="object")for(length=rep.length,i=0;i<length;i+=1)typeof rep[i]=="string"&&(k=rep[i],v=str(k,value),v&&partial.push(quote(k)+(gap?": ":":")+v));else Object.keys(value).forEach(function(k2){var v2=str(k2,value);v2&&partial.push(quote(k2)+(gap?": ":":")+v2)});return v=partial.length===0?"{}":gap?`{
`+gap+partial.join(`,
`+gap)+`
`+mind+"}":"{"+partial.join(",")+"}",gap=mind,v}}typeof JSON2.stringify!="function"&&(JSON2.stringify=function(value,replacer,space){var i;if(gap="",indent="",typeof space=="number")for(i=0;i<space;i+=1)indent+=" ";else typeof space=="string"&&(indent=space);if(rep=replacer,replacer&&typeof replacer!="function"&&(typeof replacer!="object"||typeof replacer.length!="number"))throw new Error("JSON.stringify");return str("",{"":value})})})()}});var require_parse=__commonJS({"node_modules/json-bigint/lib/parse.js"(exports,module){var BigNumber=null,suspectProtoRx=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,suspectConstructorRx=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,json_parse=function(options){"use strict";var _options={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(options!=null){if(options.strict===!0&&(_options.strict=!0),options.storeAsString===!0&&(_options.storeAsString=!0),_options.alwaysParseAsBig=options.alwaysParseAsBig===!0?options.alwaysParseAsBig:!1,_options.useNativeBigInt=options.useNativeBigInt===!0?options.useNativeBigInt:!1,typeof options.constructorAction<"u")if(options.constructorAction==="error"||options.constructorAction==="ignore"||options.constructorAction==="preserve")_options.constructorAction=options.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`);if(typeof options.protoAction<"u")if(options.protoAction==="error"||options.protoAction==="ignore"||options.protoAction==="preserve")_options.protoAction=options.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`)}var at,ch,escapee={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:"	"},text,error=function(m){throw{name:"SyntaxError",message:m,at,text}},next=function(c){return c&&c!==ch&&error("Expected '"+c+"' instead of '"+ch+"'"),ch=text.charAt(at),at+=1,ch},number=function(){var number2,string2="";for(ch==="-"&&(string2="-",next("-"));ch>="0"&&ch<="9";)string2+=ch,next();if(ch===".")for(string2+=".";next()&&ch>="0"&&ch<="9";)string2+=ch;if(ch==="e"||ch==="E")for(string2+=ch,next(),(ch==="-"||ch==="+")&&(string2+=ch,next());ch>="0"&&ch<="9";)string2+=ch,next();if(number2=+string2,!isFinite(number2))error("Bad number");else return BigNumber==null&&(BigNumber=require_bignumber()),string2.length>15?_options.storeAsString?string2:_options.useNativeBigInt?BigInt(string2):new BigNumber(string2):_options.alwaysParseAsBig?_options.useNativeBigInt?BigInt(number2):new BigNumber(number2):number2},string=function(){var hex,i,string2="",uffff;if(ch==='"')for(var startAt=at;next();){if(ch==='"')return at-1>startAt&&(string2+=text.substring(startAt,at-1)),next(),string2;if(ch==="\\"){if(at-1>startAt&&(string2+=text.substring(startAt,at-1)),next(),ch==="u"){for(uffff=0,i=0;i<4&&(hex=parseInt(next(),16),!!isFinite(hex));i+=1)uffff=uffff*16+hex;string2+=String.fromCharCode(uffff)}else if(typeof escapee[ch]=="string")string2+=escapee[ch];else break;startAt=at}}error("Bad string")},white=function(){for(;ch&&ch<=" ";)next()},word=function(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null}error("Unexpected '"+ch+"'")},value,array=function(){var array2=[];if(ch==="["){if(next("["),white(),ch==="]")return next("]"),array2;for(;ch;){if(array2.push(value()),white(),ch==="]")return next("]"),array2;next(","),white()}}error("Bad array")},object=function(){var key,object2=Object.create(null);if(ch==="{"){if(next("{"),white(),ch==="}")return next("}"),object2;for(;ch;){if(key=string(),white(),next(":"),_options.strict===!0&&Object.hasOwnProperty.call(object2,key)&&error('Duplicate key "'+key+'"'),suspectProtoRx.test(key)===!0?_options.protoAction==="error"?error("Object contains forbidden prototype property"):_options.protoAction==="ignore"?value():object2[key]=value():suspectConstructorRx.test(key)===!0?_options.constructorAction==="error"?error("Object contains forbidden constructor property"):_options.constructorAction==="ignore"?value():object2[key]=value():object2[key]=value(),white(),ch==="}")return next("}"),object2;next(","),white()}}error("Bad object")};return value=function(){switch(white(),ch){case"{":return object();case"[":return array();case'"':return string();case"-":return number();default:return ch>="0"&&ch<="9"?number():word()}},function(source,reviver){var result;return text=source+"",at=0,ch=" ",result=value(),white(),ch&&error("Syntax error"),typeof reviver=="function"?(function walk(holder,key){var k,v,value2=holder[key];return value2&&typeof value2=="object"&&Object.keys(value2).forEach(function(k2){v=walk(value2,k2),v!==void 0?value2[k2]=v:delete value2[k2]}),reviver.call(holder,key,value2)})({"":result},""):result}};module.exports=json_parse}});var require_json_bigint=__commonJS({"node_modules/json-bigint/index.js"(exports,module){var json_stringify=require_stringify().stringify,json_parse=require_parse();module.exports=function(options){return{parse:json_parse(options),stringify:json_stringify}};module.exports.parse=json_parse();module.exports.stringify=json_stringify}});var require_gcp_residency=__commonJS({"node_modules/gcp-metadata/build/src/gcp-residency.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.GCE_LINUX_BIOS_PATHS=void 0;exports.isGoogleCloudServerless=isGoogleCloudServerless;exports.isGoogleComputeEngineLinux=isGoogleComputeEngineLinux;exports.isGoogleComputeEngineMACAddress=isGoogleComputeEngineMACAddress;exports.isGoogleComputeEngine=isGoogleComputeEngine;exports.detectGCPResidency=detectGCPResidency;var fs_1=__require("fs"),os_1=__require("os");exports.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var GCE_MAC_ADDRESS_REGEX=/^42:01/;function isGoogleCloudServerless(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}function isGoogleComputeEngineLinux(){if((0,os_1.platform)()!=="linux")return!1;try{(0,fs_1.statSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let biosVendor=(0,fs_1.readFileSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(biosVendor)}catch{return!1}}function isGoogleComputeEngineMACAddress(){let interfaces=(0,os_1.networkInterfaces)();for(let item of Object.values(interfaces))if(item){for(let{mac}of item)if(GCE_MAC_ADDRESS_REGEX.test(mac))return!0}return!1}function isGoogleComputeEngine(){return isGoogleComputeEngineLinux()||isGoogleComputeEngineMACAddress()}function detectGCPResidency(){return isGoogleCloudServerless()||isGoogleComputeEngine()}}});var require_colours=__commonJS({"node_modules/google-logging-utils/build/src/colours.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.Colours=void 0;var Colours=class _Colours{static isEnabled(stream){return stream&&stream.isTTY&&(typeof stream.getColorDepth=="function"?stream.getColorDepth()>2:!0)}static refresh(){_Colours.enabled=_Colours.isEnabled(process==null?void 0:process.stderr),this.enabled?(_Colours.reset="\x1B[0m",_Colours.bright="\x1B[1m",_Colours.dim="\x1B[2m",_Colours.red="\x1B[31m",_Colours.green="\x1B[32m",_Colours.yellow="\x1B[33m",_Colours.blue="\x1B[34m",_Colours.magenta="\x1B[35m",_Colours.cyan="\x1B[36m",_Colours.white="\x1B[37m",_Colours.grey="\x1B[90m"):(_Colours.reset="",_Colours.bright="",_Colours.dim="",_Colours.red="",_Colours.green="",_Colours.yellow="",_Colours.blue="",_Colours.magenta="",_Colours.cyan="",_Colours.white="",_Colours.grey="")}};exports.Colours=Colours;Colours.enabled=!1;Colours.reset="";Colours.bright="";Colours.dim="";Colours.red="";Colours.green="";Colours.yellow="";Colours.blue="";Colours.magenta="";Colours.cyan="";Colours.white="";Colours.grey="";Colours.refresh()}});var require_logging_utils=__commonJS({"node_modules/google-logging-utils/build/src/logging-utils.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?(function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}):function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||(function(){var ownKeys=function(o){return ownKeys=Object.getOwnPropertyNames||function(o2){var ar=[];for(var k in o2)Object.prototype.hasOwnProperty.call(o2,k)&&(ar[ar.length]=k);return ar},ownKeys(o)};return function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k=ownKeys(mod),i=0;i<k.length;i++)k[i]!=="default"&&__createBinding(result,mod,k[i]);return __setModuleDefault(result,mod),result}})();Object.defineProperty(exports,"__esModule",{value:!0});exports.env=exports.DebugLogBackendBase=exports.placeholder=exports.AdhocDebugLogger=exports.LogSeverity=void 0;exports.getNodeBackend=getNodeBackend;exports.getDebugBackend=getDebugBackend;exports.getStructuredBackend=getStructuredBackend;exports.setBackend=setBackend;exports.log=log;var events_1=__require("events"),process2=__importStar(__require("process")),util=__importStar(__require("util")),colours_1=require_colours(),LogSeverity;(function(LogSeverity2){LogSeverity2.DEFAULT="DEFAULT",LogSeverity2.DEBUG="DEBUG",LogSeverity2.INFO="INFO",LogSeverity2.WARNING="WARNING",LogSeverity2.ERROR="ERROR"})(LogSeverity||(exports.LogSeverity=LogSeverity={}));var AdhocDebugLogger=class extends events_1.EventEmitter{constructor(namespace,upstream){super(),this.namespace=namespace,this.upstream=upstream,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:(event,listener)=>this.on(event,listener)}),this.func.debug=(...args)=>this.invokeSeverity(LogSeverity.DEBUG,...args),this.func.info=(...args)=>this.invokeSeverity(LogSeverity.INFO,...args),this.func.warn=(...args)=>this.invokeSeverity(LogSeverity.WARNING,...args),this.func.error=(...args)=>this.invokeSeverity(LogSeverity.ERROR,...args),this.func.sublog=namespace2=>log(namespace2,this.func)}invoke(fields,...args){if(this.upstream)try{this.upstream(fields,...args)}catch{}try{this.emit("log",fields,args)}catch{}}invokeSeverity(severity,...args){this.invoke({severity},...args)}};exports.AdhocDebugLogger=AdhocDebugLogger;exports.placeholder=new AdhocDebugLogger("",()=>{}).func;var DebugLogBackendBase=class{constructor(){var _a;this.cached=new Map,this.filters=[],this.filtersSet=!1;let nodeFlag=(_a=process2.env[exports.env.nodeEnables])!==null&&_a!==void 0?_a:"*";nodeFlag==="all"&&(nodeFlag="*"),this.filters=nodeFlag.split(",")}log(namespace,fields,...args){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let logger=this.cached.get(namespace);logger||(logger=this.makeLogger(namespace),this.cached.set(namespace,logger)),logger(fields,...args)}catch(e){console.error(e)}}};exports.DebugLogBackendBase=DebugLogBackendBase;var NodeBackend=class extends DebugLogBackendBase{constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(namespace){return this.enabledRegexp.test(namespace)}makeLogger(namespace){return this.enabledRegexp.test(namespace)?(fields,...args)=>{var _a;let nscolour=`${colours_1.Colours.green}${namespace}${colours_1.Colours.reset}`,pid=`${colours_1.Colours.yellow}${process2.pid}${colours_1.Colours.reset}`,level;switch(fields.severity){case LogSeverity.ERROR:level=`${colours_1.Colours.red}${fields.severity}${colours_1.Colours.reset}`;break;case LogSeverity.INFO:level=`${colours_1.Colours.magenta}${fields.severity}${colours_1.Colours.reset}`;break;case LogSeverity.WARNING:level=`${colours_1.Colours.yellow}${fields.severity}${colours_1.Colours.reset}`;break;default:level=(_a=fields.severity)!==null&&_a!==void 0?_a:LogSeverity.DEFAULT;break}let msg=util.formatWithOptions({colors:colours_1.Colours.enabled},...args),filteredFields=Object.assign({},fields);delete filteredFields.severity;let fieldsJson=Object.getOwnPropertyNames(filteredFields).length?JSON.stringify(filteredFields):"",fieldsColour=fieldsJson?`${colours_1.Colours.grey}${fieldsJson}${colours_1.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",pid,nscolour,level,msg,fieldsJson?` ${fieldsColour}`:"")}:()=>{}}setFilters(){let regexp=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${regexp}$`,"i")}};function getNodeBackend(){return new NodeBackend}var DebugBackend=class extends DebugLogBackendBase{constructor(pkg){super(),this.debugPkg=pkg}makeLogger(namespace){let debugLogger=this.debugPkg(namespace);return(fields,...args)=>{debugLogger(args[0],...args.slice(1))}}setFilters(){var _a;let existingFilters=(_a=process2.env.NODE_DEBUG)!==null&&_a!==void 0?_a:"";process2.env.NODE_DEBUG=`${existingFilters}${existingFilters?",":""}${this.filters.join(",")}`}};function getDebugBackend(debugPkg){return new DebugBackend(debugPkg)}var StructuredBackend=class extends DebugLogBackendBase{constructor(upstream){var _a;super(),this.upstream=(_a=upstream)!==null&&_a!==void 0?_a:void 0}makeLogger(namespace){var _a;let debugLogger=(_a=this.upstream)===null||_a===void 0?void 0:_a.makeLogger(namespace);return(fields,...args)=>{var _a2;let severity=(_a2=fields.severity)!==null&&_a2!==void 0?_a2:LogSeverity.INFO,json=Object.assign({severity,message:util.format(...args)},fields),jsonString=JSON.stringify(json);debugLogger?debugLogger(fields,jsonString):console.log("%s",jsonString)}}setFilters(){var _a;(_a=this.upstream)===null||_a===void 0||_a.setFilters()}};function getStructuredBackend(upstream){return new StructuredBackend(upstream)}exports.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var loggerCache=new Map,cachedBackend;function setBackend(backend){cachedBackend=backend,loggerCache.clear()}function log(namespace,parent){if(!cachedBackend&&!process2.env[exports.env.nodeEnables]||!namespace)return exports.placeholder;parent&&(namespace=`${parent.instance.namespace}:${namespace}`);let existing=loggerCache.get(namespace);if(existing)return existing.func;if(cachedBackend===null)return exports.placeholder;cachedBackend===void 0&&(cachedBackend=getNodeBackend());let logger=(()=>{let previousBackend;return new AdhocDebugLogger(namespace,(fields,...args)=>{if(previousBackend!==cachedBackend){if(cachedBackend===null)return;cachedBackend===void 0&&(cachedBackend=getNodeBackend()),previousBackend=cachedBackend}cachedBackend?.log(namespace,fields,...args)})})();return loggerCache.set(namespace,logger),logger.func}}});var require_src2=__commonJS({"node_modules/google-logging-utils/build/src/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});__exportStar(require_logging_utils(),exports)}});var require_src3=__commonJS({"node_modules/gcp-metadata/build/src/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?(function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}):function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||(function(){var ownKeys=function(o){return ownKeys=Object.getOwnPropertyNames||function(o2){var ar=[];for(var k in o2)Object.prototype.hasOwnProperty.call(o2,k)&&(ar[ar.length]=k);return ar},ownKeys(o)};return function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k=ownKeys(mod),i=0;i<k.length;i++)k[i]!=="default"&&__createBinding(result,mod,k[i]);return __setModuleDefault(result,mod),result}})(),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.gcpResidencyCache=exports.METADATA_SERVER_DETECTION=exports.HEADERS=exports.HEADER_VALUE=exports.HEADER_NAME=exports.SECONDARY_HOST_ADDRESS=exports.HOST_ADDRESS=exports.BASE_PATH=void 0;exports.instance=instance;exports.project=project;exports.universe=universe;exports.bulk=bulk;exports.isAvailable=isAvailable;exports.resetIsAvailableCache=resetIsAvailableCache;exports.getGCPResidency=getGCPResidency;exports.setGCPResidency=setGCPResidency;exports.requestTimeout=requestTimeout;var gaxios_1=require_src(),jsonBigint=require_json_bigint(),gcp_residency_1=require_gcp_residency(),logger=__importStar(require_src2());exports.BASE_PATH="/computeMetadata/v1";exports.HOST_ADDRESS="http://169.254.169.254";exports.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";exports.HEADER_NAME="Metadata-Flavor";exports.HEADER_VALUE="Google";exports.HEADERS=Object.freeze({[exports.HEADER_NAME]:exports.HEADER_VALUE});var log=logger.log("gcp-metadata");exports.METADATA_SERVER_DETECTION=Object.freeze({"assume-present":"don't try to ping the metadata server, but assume it's present",none:"don't try to ping the metadata server, but don't try to use it either","bios-only":"treat the result of a BIOS probe as canonical (don't fall back to pinging)","ping-only":"skip the BIOS probe, and go straight to pinging"});function getBaseUrl(baseUrl){return baseUrl||(baseUrl=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||exports.HOST_ADDRESS),/^https?:\/\//.test(baseUrl)||(baseUrl=`http://${baseUrl}`),new URL(exports.BASE_PATH,baseUrl).href}function validate(options){Object.keys(options).forEach(key=>{switch(key){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${key}' is not a valid configuration option.`)}})}async function metadataAccessor(type,options={},noResponseRetries=3,fastFail=!1){let headers=new Headers(exports.HEADERS),metadataKey="",params={};if(typeof type=="object"){let metadataAccessor2=type;new Headers(metadataAccessor2.headers).forEach((value,key)=>headers.set(key,value)),metadataKey=metadataAccessor2.metadataKey,params=metadataAccessor2.params||params,noResponseRetries=metadataAccessor2.noResponseRetries||noResponseRetries,fastFail=metadataAccessor2.fastFail||fastFail}else metadataKey=type;typeof options=="string"?metadataKey+=`/${options}`:(validate(options),options.property&&(metadataKey+=`/${options.property}`),new Headers(options.headers).forEach((value,key)=>headers.set(key,value)),params=options.params||params);let requestMethod=fastFail?fastFailMetadataRequest:gaxios_1.request,req={url:`${getBaseUrl()}/${metadataKey}`,headers,retryConfig:{noResponseRetries},params,responseType:"text",timeout:requestTimeout()};log.info("instance request %j",req);let res=await requestMethod(req);log.info("instance metadata is %s",res.data);let metadataFlavor=res.headers.get(exports.HEADER_NAME);if(metadataFlavor!==exports.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${exports.HEADER_NAME} header. Expected '${exports.HEADER_VALUE}', got ${metadataFlavor?`'${metadataFlavor}'`:"no header"}`);if(typeof res.data=="string")try{return jsonBigint.parse(res.data)}catch{}return res.data}async function fastFailMetadataRequest(options){let secondaryOptions={...options,url:options.url?.toString().replace(getBaseUrl(),getBaseUrl(exports.SECONDARY_HOST_ADDRESS))},r1=(0,gaxios_1.request)(options),r2=(0,gaxios_1.request)(secondaryOptions);return Promise.any([r1,r2])}function instance(options){return metadataAccessor("instance",options)}function project(options){return metadataAccessor("project",options)}function universe(options){return metadataAccessor("universe",options)}async function bulk(properties){let r={};return await Promise.all(properties.map(item=>(async()=>{let res=await metadataAccessor(item),key=item.metadataKey;r[key]=res})())),r}function detectGCPAvailableRetries(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}var cachedIsAvailableResponse;async function isAvailable(){if(process.env.METADATA_SERVER_DETECTION){let value=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(value in exports.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${value}\`, but it should be \`${Object.keys(exports.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(value){case"assume-present":return!0;case"none":return!1;case"bios-only":return getGCPResidency();case"ping-only":}}try{return cachedIsAvailableResponse===void 0&&(cachedIsAvailableResponse=metadataAccessor("instance",void 0,detectGCPAvailableRetries(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await cachedIsAvailableResponse,!0}catch(e){let err=e;if(process.env.DEBUG_AUTH&&console.info(err),err.type==="request-timeout"||err.response&&err.response.status===404)return!1;if(!(err.response&&err.response.status===404)&&(!err.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(err.code.toString()))){let code="UNKNOWN";err.code&&(code=err.code.toString()),process.emitWarning(`received unexpected error = ${err.message} code = ${code}`,"MetadataLookupWarning")}return!1}}function resetIsAvailableCache(){cachedIsAvailableResponse=void 0}exports.gcpResidencyCache=null;function getGCPResidency(){return exports.gcpResidencyCache===null&&setGCPResidency(),exports.gcpResidencyCache}function setGCPResidency(value=null){exports.gcpResidencyCache=value!==null?value:(0,gcp_residency_1.detectGCPResidency)()}function requestTimeout(){return getGCPResidency()?0:3e3}__exportStar(require_gcp_residency(),exports)}});var require_base64_js=__commonJS({"node_modules/base64-js/index.js"(exports){"use strict";exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;var i,len;revLookup[45]=62;revLookup[95]=63;function getLens(b64){var len2=b64.length;if(len2%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var validLen=b64.indexOf("=");validLen===-1&&(validLen=len2);var placeHoldersLen=validLen===len2?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp,lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1],arr=new Arr(_byteLength(b64,validLen,placeHoldersLen)),curByte=0,len2=placeHoldersLen>0?validLen-4:validLen,i2;for(i2=0;i2<len2;i2+=4)tmp=revLookup[b64.charCodeAt(i2)]<<18|revLookup[b64.charCodeAt(i2+1)]<<12|revLookup[b64.charCodeAt(i2+2)]<<6|revLookup[b64.charCodeAt(i2+3)],arr[curByte++]=tmp>>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=tmp&255;return placeHoldersLen===2&&(tmp=revLookup[b64.charCodeAt(i2)]<<2|revLookup[b64.charCodeAt(i2+1)]>>4,arr[curByte++]=tmp&255),placeHoldersLen===1&&(tmp=revLookup[b64.charCodeAt(i2)]<<10|revLookup[b64.charCodeAt(i2+1)]<<4|revLookup[b64.charCodeAt(i2+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=tmp&255),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i2=start;i2<end;i2+=3)tmp=(uint8[i2]<<16&16711680)+(uint8[i2+1]<<8&65280)+(uint8[i2+2]&255),output.push(tripletToBase64(tmp));return output.join("")}function fromByteArray(uint8){for(var tmp,len2=uint8.length,extraBytes=len2%3,parts=[],maxChunkLength=16383,i2=0,len22=len2-extraBytes;i2<len22;i2+=maxChunkLength)parts.push(encodeChunk(uint8,i2,i2+maxChunkLength>len22?len22:i2+maxChunkLength));return extraBytes===1?(tmp=uint8[len2-1],parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")):extraBytes===2&&(tmp=(uint8[len2-2]<<8)+uint8[len2-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")),parts.join("")}}});var require_shared=__commonJS({"node_modules/google-auth-library/build/src/crypto/shared.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.fromArrayBufferToHex=fromArrayBufferToHex;function fromArrayBufferToHex(arrayBuffer){return Array.from(new Uint8Array(arrayBuffer)).map(byte=>byte.toString(16).padStart(2,"0")).join("")}}});var require_crypto=__commonJS({"node_modules/google-auth-library/build/src/crypto/browser/crypto.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.BrowserCrypto=void 0;var base64js=require_base64_js(),shared_1=require_shared(),BrowserCrypto=class _BrowserCrypto{constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(str){let inputBuffer=new TextEncoder().encode(str),outputBuffer=await window.crypto.subtle.digest("SHA-256",inputBuffer);return base64js.fromByteArray(new Uint8Array(outputBuffer))}randomBytesBase64(count){let array=new Uint8Array(count);return window.crypto.getRandomValues(array),base64js.fromByteArray(array)}static padBase64(base64){for(;base64.length%4!==0;)base64+="=";return base64}async verify(pubkey,data,signature){let algo={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},dataArray=new TextEncoder().encode(data),signatureArray=base64js.toByteArray(_BrowserCrypto.padBase64(signature)),cryptoKey=await window.crypto.subtle.importKey("jwk",pubkey,algo,!0,["verify"]);return await window.crypto.subtle.verify(algo,cryptoKey,Buffer.from(signatureArray),dataArray)}async sign(privateKey,data){let algo={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},dataArray=new TextEncoder().encode(data),cryptoKey=await window.crypto.subtle.importKey("jwk",privateKey,algo,!0,["sign"]),result=await window.crypto.subtle.sign(algo,cryptoKey,dataArray);return base64js.fromByteArray(new Uint8Array(result))}decodeBase64StringUtf8(base64){let uint8array=base64js.toByteArray(_BrowserCrypto.padBase64(base64));return new TextDecoder().decode(uint8array)}encodeBase64StringUtf8(text){let uint8array=new TextEncoder().encode(text);return base64js.fromByteArray(uint8array)}async sha256DigestHex(str){let inputBuffer=new TextEncoder().encode(str),outputBuffer=await window.crypto.subtle.digest("SHA-256",inputBuffer);return(0,shared_1.fromArrayBufferToHex)(outputBuffer)}async signWithHmacSha256(key,msg){let rawKey=typeof key=="string"?key:String.fromCharCode(...new Uint16Array(key)),enc=new TextEncoder,cryptoKey=await window.crypto.subtle.importKey("raw",enc.encode(rawKey),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",cryptoKey,enc.encode(msg))}};exports.BrowserCrypto=BrowserCrypto}});var require_crypto2=__commonJS({"node_modules/google-auth-library/build/src/crypto/node/crypto.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.NodeCrypto=void 0;var crypto2=__require("crypto"),NodeCrypto=class{async sha256DigestBase64(str){return crypto2.createHash("sha256").update(str).digest("base64")}randomBytesBase64(count){return crypto2.randomBytes(count).toString("base64")}async verify(pubkey,data,signature){let verifier=crypto2.createVerify("RSA-SHA256");return verifier.update(data),verifier.end(),verifier.verify(pubkey,signature,"base64")}async sign(privateKey,data){let signer=crypto2.createSign("RSA-SHA256");return signer.update(data),signer.end(),signer.sign(privateKey,"base64")}decodeBase64StringUtf8(base64){return Buffer.from(base64,"base64").toString("utf-8")}encodeBase64StringUtf8(text){return Buffer.from(text,"utf-8").toString("base64")}async sha256DigestHex(str){return crypto2.createHash("sha256").update(str).digest("hex")}async signWithHmacSha256(key,msg){let cryptoKey=typeof key=="string"?key:toBuffer(key);return toArrayBuffer(crypto2.createHmac("sha256",cryptoKey).update(msg).digest())}};exports.NodeCrypto=NodeCrypto;function toArrayBuffer(buffer){let ab=new ArrayBuffer(buffer.length),view=new Uint8Array(ab);for(let i=0;i<buffer.length;++i)view[i]=buffer[i];return ab}function toBuffer(arrayBuffer){return Buffer.from(arrayBuffer)}}});var require_crypto3=__commonJS({"node_modules/google-auth-library/build/src/crypto/crypto.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.createCrypto=createCrypto;exports.hasBrowserCrypto=hasBrowserCrypto;var crypto_1=require_crypto(),crypto_2=require_crypto2();__exportStar(require_shared(),exports);function createCrypto(){return hasBrowserCrypto()?new crypto_1.BrowserCrypto:new crypto_2.NodeCrypto}function hasBrowserCrypto(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}}});var require_safe_buffer=__commonJS({"node_modules/safe-buffer/index.js"(exports,module){var buffer=__require("buffer"),Buffer2=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}Buffer2.from&&Buffer2.alloc&&Buffer2.allocUnsafe&&Buffer2.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer);function SafeBuffer(arg,encodingOrOffset,length){return Buffer2(arg,encodingOrOffset,length)}SafeBuffer.prototype=Object.create(Buffer2.prototype);copyProps(Buffer2,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg=="number")throw new TypeError("Argument must not be a number");return Buffer2(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!="number")throw new TypeError("Argument must be a number");var buf=Buffer2(size);return fill!==void 0?typeof encoding=="string"?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return Buffer2(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}}});var require_param_bytes_for_alg=__commonJS({"node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js"(exports,module){"use strict";function getParamSize(keySize){var result=(keySize/8|0)+(keySize%8===0?0:1);return result}var paramBytesForAlg={ES256:getParamSize(256),ES384:getParamSize(384),ES512:getParamSize(521)};function getParamBytesForAlg(alg){var paramBytes=paramBytesForAlg[alg];if(paramBytes)return paramBytes;throw new Error('Unknown algorithm "'+alg+'"')}module.exports=getParamBytesForAlg}});var require_ecdsa_sig_formatter=__commonJS({"node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js"(exports,module){"use strict";var Buffer2=require_safe_buffer().Buffer,getParamBytesForAlg=require_param_bytes_for_alg(),MAX_OCTET=128,CLASS_UNIVERSAL=0,PRIMITIVE_BIT=32,TAG_SEQ=16,TAG_INT=2,ENCODED_TAG_SEQ=TAG_SEQ|PRIMITIVE_BIT|CLASS_UNIVERSAL<<6,ENCODED_TAG_INT=TAG_INT|CLASS_UNIVERSAL<<6;function base64Url(base64){return base64.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function signatureAsBuffer(signature){if(Buffer2.isBuffer(signature))return signature;if(typeof signature=="string")return Buffer2.from(signature,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function derToJose(signature,alg){signature=signatureAsBuffer(signature);var paramBytes=getParamBytesForAlg(alg),maxEncodedParamLength=paramBytes+1,inputLength=signature.length,offset=0;if(signature[offset++]!==ENCODED_TAG_SEQ)throw new Error('Could not find expected "seq"');var seqLength=signature[offset++];if(seqLength===(MAX_OCTET|1)&&(seqLength=signature[offset++]),inputLength-offset<seqLength)throw new Error('"seq" specified length of "'+seqLength+'", only "'+(inputLength-offset)+'" remaining');if(signature[offset++]!==ENCODED_TAG_INT)throw new Error('Could not find expected "int" for "r"');var rLength=signature[offset++];if(inputLength-offset-2<rLength)throw new Error('"r" specified length of "'+rLength+'", only "'+(inputLength-offset-2)+'" available');if(maxEncodedParamLength<rLength)throw new Error('"r" specified length of "'+rLength+'", max of "'+maxEncodedParamLength+'" is acceptable');var rOffset=offset;if(offset+=rLength,signature[offset++]!==ENCODED_TAG_INT)throw new Error('Could not find expected "int" for "s"');var sLength=signature[offset++];if(inputLength-offset!==sLength)throw new Error('"s" specified length of "'+sLength+'", expected "'+(inputLength-offset)+'"');if(maxEncodedParamLength<sLength)throw new Error('"s" specified length of "'+sLength+'", max of "'+maxEncodedParamLength+'" is acceptable');var sOffset=offset;if(offset+=sLength,offset!==inputLength)throw new Error('Expected to consume entire buffer, but "'+(inputLength-offset)+'" bytes remain');var rPadding=paramBytes-rLength,sPadding=paramBytes-sLength,dst=Buffer2.allocUnsafe(rPadding+rLength+sPadding+sLength);for(offset=0;offset<rPadding;++offset)dst[offset]=0;signature.copy(dst,offset,rOffset+Math.max(-rPadding,0),rOffset+rLength),offset=paramBytes;for(var o=offset;offset<o+sPadding;++offset)dst[offset]=0;return signature.copy(dst,offset,sOffset+Math.max(-sPadding,0),sOffset+sLength),dst=dst.toString("base64"),dst=base64Url(dst),dst}function countPadding(buf,start,stop){for(var padding=0;start+padding<stop&&buf[start+padding]===0;)++padding;var needsSign=buf[start+padding]>=MAX_OCTET;return needsSign&&--padding,padding}function joseToDer(signature,alg){signature=signatureAsBuffer(signature);var paramBytes=getParamBytesForAlg(alg),signatureBytes=signature.length;if(signatureBytes!==paramBytes*2)throw new TypeError('"'+alg+'" signatures must be "'+paramBytes*2+'" bytes, saw "'+signatureBytes+'"');var rPadding=countPadding(signature,0,paramBytes),sPadding=countPadding(signature,paramBytes,signature.length),rLength=paramBytes-rPadding,sLength=paramBytes-sPadding,rsBytes=2+rLength+1+1+sLength,shortLength=rsBytes<MAX_OCTET,dst=Buffer2.allocUnsafe((shortLength?2:3)+rsBytes),offset=0;return dst[offset++]=ENCODED_TAG_SEQ,shortLength?dst[offset++]=rsBytes:(dst[offset++]=MAX_OCTET|1,dst[offset++]=rsBytes&255),dst[offset++]=ENCODED_TAG_INT,dst[offset++]=rLength,rPadding<0?(dst[offset++]=0,offset+=signature.copy(dst,offset,0,paramBytes)):offset+=signature.copy(dst,offset,rPadding,paramBytes),dst[offset++]=ENCODED_TAG_INT,dst[offset++]=sLength,sPadding<0?(dst[offset++]=0,signature.copy(dst,offset,paramBytes)):signature.copy(dst,offset,paramBytes+sPadding),dst}module.exports={derToJose,joseToDer}}});var require_util2=__commonJS({"node_modules/google-auth-library/build/src/util.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;exports.snakeToCamel=snakeToCamel;exports.originalOrCamelOptions=originalOrCamelOptions;exports.removeUndefinedValuesInObject=removeUndefinedValuesInObject;exports.isValidFile=isValidFile;exports.getWellKnownCertificateConfigFileLocation=getWellKnownCertificateConfigFileLocation;var fs=__require("fs"),os=__require("os"),path=__require("path"),WELL_KNOWN_CERTIFICATE_CONFIG_FILE="certificate_config.json",CLOUDSDK_CONFIG_DIRECTORY="gcloud";function snakeToCamel(str){return str.replace(/([_][^_])/g,match=>match.slice(1).toUpperCase())}function originalOrCamelOptions(obj){function get(key){let o=obj||{};return o[key]??o[snakeToCamel(key)]}return{get}}var LRUCache=class{capacity;#cache=new Map;maxAge;constructor(options){this.capacity=options.capacity,this.maxAge=options.maxAge}#moveToEnd(key,value){this.#cache.delete(key),this.#cache.set(key,{value,lastAccessed:Date.now()})}set(key,value){this.#moveToEnd(key,value),this.#evict()}get(key){let item=this.#cache.get(key);if(item)return this.#moveToEnd(key,item.value),this.#evict(),item.value}#evict(){let cutoffDate=this.maxAge?Date.now()-this.maxAge:0,oldestItem=this.#cache.entries().next();for(;!oldestItem.done&&(this.#cache.size>this.capacity||oldestItem.value[1].lastAccessed<cutoffDate);)this.#cache.delete(oldestItem.value[0]),oldestItem=this.#cache.entries().next()}};exports.LRUCache=LRUCache;function removeUndefinedValuesInObject(object){return Object.entries(object).forEach(([key,value])=>{(value===void 0||value==="undefined")&&delete object[key]}),object}async function isValidFile(filePath){try{return(await fs.promises.lstat(filePath)).isFile()}catch{return!1}}function getWellKnownCertificateConfigFileLocation(){let configDir=process.env.CLOUDSDK_CONFIG||(_isWindows()?path.join(process.env.APPDATA||"",CLOUDSDK_CONFIG_DIRECTORY):path.join(process.env.HOME||"",".config",CLOUDSDK_CONFIG_DIRECTORY));return path.join(configDir,WELL_KNOWN_CERTIFICATE_CONFIG_FILE)}function _isWindows(){return os.platform().startsWith("win")}}});var require_package2=__commonJS({"node_modules/google-auth-library/package.json"(exports,module){module.exports={name:"google-auth-library",version:"10.6.2",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:{type:"git",directory:"packages/google-auth-library-nodejs",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.1.4","gcp-metadata":"8.1.2","google-logging-utils":"1.1.3",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/node":"^24.0.0","@types/sinon":"^21.0.0","assert-rejects":"^1.0.0",c8:"^10.1.3",codecov:"^3.8.3",gts:"^6.0.2","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.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-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0",homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/google-auth-library-nodejs"}}});var require_shared2=__commonJS({"node_modules/google-auth-library/build/src/shared.cjs"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.USER_AGENT=exports.PRODUCT_NAME=exports.pkg=void 0;var pkg=require_package2();exports.pkg=pkg;var PRODUCT_NAME="google-api-nodejs-client";exports.PRODUCT_NAME=PRODUCT_NAME;var USER_AGENT=`${PRODUCT_NAME}/${pkg.version}`;exports.USER_AGENT=USER_AGENT}});var require_authclient=__commonJS({"node_modules/google-auth-library/build/src/auth/authclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.AuthClient=exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=exports.DEFAULT_UNIVERSE=void 0;var events_1=__require("events"),gaxios_1=require_src(),util_1=require_util2(),google_logging_utils_1=require_src2(),shared_cjs_1=require_shared2();exports.DEFAULT_UNIVERSE="googleapis.com";exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var AuthClient=class _AuthClient extends events_1.EventEmitter{apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=exports.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(opts={}){super();let options=(0,util_1.originalOrCamelOptions)(opts);this.apiKey=opts.apiKey,this.projectId=options.get("project_id")??null,this.quotaProjectId=options.get("quota_project_id"),this.credentials=options.get("credentials")??{},this.universeDomain=options.get("universe_domain")??exports.DEFAULT_UNIVERSE,this.transporter=opts.transporter??new gaxios_1.Gaxios(opts.transporterOptions),options.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(_AuthClient.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(_AuthClient.DEFAULT_RESPONSE_INTERCEPTOR)),opts.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=opts.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=opts.forceRefreshOnFailure??!1}fetch(...args){let input=args[0],init=args[1],url,headers=new Headers;return typeof input=="string"?url=new URL(input):input instanceof URL?url=input:input&&input.url&&(url=new URL(input.url)),input&&typeof input=="object"&&"headers"in input&&gaxios_1.Gaxios.mergeHeaders(headers,input.headers),init&&gaxios_1.Gaxios.mergeHeaders(headers,new Headers(init.headers)),typeof input=="object"&&!(input instanceof URL)?this.request({...init,...input,headers,url}):this.request({...init,headers,url})}setCredentials(credentials){this.credentials=credentials}addSharedMetadataHeaders(headers){return!headers.has("x-goog-user-project")&&this.quotaProjectId&&headers.set("x-goog-user-project",this.quotaProjectId),headers}addUserProjectAndAuthHeaders(target,source){let xGoogUserProject=source.get("x-goog-user-project"),authorizationHeader=source.get("authorization");return xGoogUserProject&&target.set("x-goog-user-project",xGoogUserProject),authorizationHeader&&target.set("authorization",authorizationHeader),target}static log=(0,google_logging_utils_1.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:async config=>{if(!config.headers.has("x-goog-api-client")){let nodeVersion=process.version.replace(/^v/,"");config.headers.set("x-goog-api-client",`gl-node/${nodeVersion}`)}let userAgent=config.headers.get("User-Agent");userAgent?userAgent.includes(`${shared_cjs_1.PRODUCT_NAME}/`)||config.headers.set("User-Agent",`${userAgent} ${shared_cjs_1.USER_AGENT}`):config.headers.set("User-Agent",shared_cjs_1.USER_AGENT);try{let symbols=config,methodName=symbols[_AuthClient.RequestMethodNameSymbol],logId=`${Math.floor(Math.random()*1e3)}`;symbols[_AuthClient.RequestLogIdSymbol]=logId;let logObject={url:config.url,headers:config.headers};methodName?_AuthClient.log.info("%s [%s] request %j",methodName,logId,logObject):_AuthClient.log.info("[%s] request %j",logId,logObject)}catch{}return config}};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:async response=>{try{let symbols=response.config,methodName=symbols[_AuthClient.RequestMethodNameSymbol],logId=symbols[_AuthClient.RequestLogIdSymbol];methodName?_AuthClient.log.info("%s [%s] response %j",methodName,logId,response.data):_AuthClient.log.info("[%s] response %j",logId,response.data)}catch{}return response},rejected:async error=>{try{let symbols=error.config,methodName=symbols[_AuthClient.RequestMethodNameSymbol],logId=symbols[_AuthClient.RequestLogIdSymbol];methodName?_AuthClient.log.info("%s [%s] error %j",methodName,logId,error.response?.data):_AuthClient.log.error("[%s] error %j",logId,error.response?.data)}catch{}throw error}};static setMethodName(config,methodName){try{let symbols=config;symbols[_AuthClient.RequestMethodNameSymbol]=methodName}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};exports.AuthClient=AuthClient}});var require_loginticket=__commonJS({"node_modules/google-auth-library/build/src/auth/loginticket.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.LoginTicket=void 0;var LoginTicket=class{envelope;payload;constructor(env,pay){this.envelope=env,this.payload=pay}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let payload=this.getPayload();return payload&&payload.sub?payload.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};exports.LoginTicket=LoginTicket}});var require_oauth2client=__commonJS({"node_modules/google-auth-library/build/src/auth/oauth2client.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.OAuth2Client=exports.ClientAuthentication=exports.CertificateFormat=exports.CodeChallengeMethod=void 0;var gaxios_1=require_src(),querystring=__require("querystring"),stream=__require("stream"),formatEcdsa=require_ecdsa_sig_formatter(),util_1=require_util2(),crypto_1=require_crypto3(),authclient_1=require_authclient(),loginticket_1=require_loginticket(),CodeChallengeMethod;(function(CodeChallengeMethod2){CodeChallengeMethod2.Plain="plain",CodeChallengeMethod2.S256="S256"})(CodeChallengeMethod||(exports.CodeChallengeMethod=CodeChallengeMethod={}));var CertificateFormat;(function(CertificateFormat2){CertificateFormat2.PEM="PEM",CertificateFormat2.JWK="JWK"})(CertificateFormat||(exports.CertificateFormat=CertificateFormat={}));var ClientAuthentication;(function(ClientAuthentication2){ClientAuthentication2.ClientSecretPost="ClientSecretPost",ClientAuthentication2.ClientSecretBasic="ClientSecretBasic",ClientAuthentication2.None="None"})(ClientAuthentication||(exports.ClientAuthentication=ClientAuthentication={}));var OAuth2Client=class _OAuth2Client extends authclient_1.AuthClient{redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=CertificateFormat.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(options={},clientSecret,redirectUri){super(typeof options=="object"?options:{}),typeof options!="object"&&(options={clientId:options,clientSecret,redirectUri}),this._clientId=options.clientId||options.client_id,this._clientSecret=options.clientSecret||options.client_secret,this.redirectUri=options.redirectUri||options.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...options.endpoints},this.clientAuthentication=options.clientAuthentication||ClientAuthentication.ClientSecretPost,this.issuers=options.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(opts={}){if(opts.code_challenge_method&&!opts.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return opts.response_type=opts.response_type||"code",opts.client_id=opts.client_id||this._clientId,opts.redirect_uri=opts.redirect_uri||this.redirectUri,Array.isArray(opts.scope)&&(opts.scope=opts.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+querystring.stringify(opts)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let crypto2=(0,crypto_1.createCrypto)(),codeVerifier=crypto2.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),codeChallenge=(await crypto2.sha256DigestBase64(codeVerifier)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier,codeChallenge}}getToken(codeOrOptions,callback){let options=typeof codeOrOptions=="string"?{code:codeOrOptions}:codeOrOptions;if(callback)this.getTokenAsync(options).then(r=>callback(null,r.tokens,r.res),e=>callback(e,null,e.response));else return this.getTokenAsync(options)}async getTokenAsync(options){let url=this.endpoints.oauth2TokenUrl.toString(),headers=new Headers,values={client_id:options.client_id||this._clientId,code_verifier:options.codeVerifier,code:options.code,grant_type:"authorization_code",redirect_uri:options.redirect_uri||this.redirectUri};if(this.clientAuthentication===ClientAuthentication.ClientSecretBasic){let basic=Buffer.from(`${this._clientId}:${this._clientSecret}`);headers.set("authorization",`Basic ${basic.toString("base64")}`)}this.clientAuthentication===ClientAuthentication.ClientSecretPost&&(values.client_secret=this._clientSecret);let opts={..._OAuth2Client.RETRY_CONFIG,method:"POST",url,data:new URLSearchParams((0,util_1.removeUndefinedValuesInObject)(values)),headers};authclient_1.AuthClient.setMethodName(opts,"getTokenAsync");let res=await this.transporter.request(opts),tokens=res.data;return res.data&&res.data.expires_in&&(tokens.expiry_date=new Date().getTime()+res.data.expires_in*1e3,delete tokens.expires_in),this.emit("tokens",tokens),{tokens,res}}async refreshToken(refreshToken){if(!refreshToken)return this.refreshTokenNoCache(refreshToken);if(this.refreshTokenPromises.has(refreshToken))return this.refreshTokenPromises.get(refreshToken);let p=this.refreshTokenNoCache(refreshToken).then(r=>(this.refreshTokenPromises.delete(refreshToken),r),e=>{throw this.refreshTokenPromises.delete(refreshToken),e});return this.refreshTokenPromises.set(refreshToken,p),p}async refreshTokenNoCache(refreshToken){if(!refreshToken)throw new Error("No refresh token is set.");let url=this.endpoints.oauth2TokenUrl.toString(),data={refresh_token:refreshToken,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},res;try{let opts={..._OAuth2Client.RETRY_CONFIG,method:"POST",url,data:new URLSearchParams((0,util_1.removeUndefinedValuesInObject)(data))};authclient_1.AuthClient.setMethodName(opts,"refreshTokenNoCache"),res=await this.transporter.request(opts)}catch(e){throw e instanceof gaxios_1.GaxiosError&&e.message==="invalid_grant"&&e.response?.data&&/ReAuth/i.test(e.response.data.error_description)&&(e.message=JSON.stringify(e.response.data)),e}let tokens=res.data;return res.data&&res.data.expires_in&&(tokens.expiry_date=new Date().getTime()+res.data.expires_in*1e3,delete tokens.expires_in),this.emit("tokens",tokens),{tokens,res}}refreshAccessToken(callback){if(callback)this.refreshAccessTokenAsync().then(r=>callback(null,r.credentials,r.res),callback);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let r=await this.refreshToken(this.credentials.refresh_token),tokens=r.tokens;return tokens.refresh_token=this.credentials.refresh_token,this.credentials=tokens,{credentials:this.credentials,res:r.res}}getAccessToken(callback){if(callback)this.getAccessTokenAsync().then(r=>callback(null,r.token,r.res),callback);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let refreshedAccessToken=await this.processAndValidateRefreshHandler();if(refreshedAccessToken?.access_token)return this.setCredentials(refreshedAccessToken),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(url){return(await this.getRequestMetadataAsync(url)).headers}async getRequestMetadataAsync(url){let thisCreds=this.credentials;if(!thisCreds.access_token&&!thisCreds.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(thisCreds.access_token&&!this.isTokenExpiring()){thisCreds.token_type=thisCreds.token_type||"Bearer";let headers2=new Headers({authorization:thisCreds.token_type+" "+thisCreds.access_token});return{headers:this.addSharedMetadataHeaders(headers2)}}if(this.refreshHandler){let refreshedAccessToken=await this.processAndValidateRefreshHandler();if(refreshedAccessToken?.access_token){this.setCredentials(refreshedAccessToken);let headers2=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(headers2)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let r=null,tokens=null;try{r=await this.refreshToken(thisCreds.refresh_token),tokens=r.tokens}catch(err){let e=err;throw e.response&&(e.response.status===403||e.response.status===404)&&(e.message=`Could not refresh access token: ${e.message}`),e}let credentials=this.credentials;credentials.token_type=credentials.token_type||"Bearer",tokens.refresh_token=credentials.refresh_token,this.credentials=tokens;let headers=new Headers({authorization:credentials.token_type+" "+tokens.access_token});return{headers:this.addSharedMetadataHeaders(headers),res:r.res}}static getRevokeTokenUrl(token){return new _OAuth2Client().getRevokeTokenURL(token).toString()}getRevokeTokenURL(token){let url=new URL(this.endpoints.oauth2RevokeUrl);return url.searchParams.append("token",token),url}revokeToken(token,callback){let opts={..._OAuth2Client.RETRY_CONFIG,url:this.getRevokeTokenURL(token).toString(),method:"POST"};if(authclient_1.AuthClient.setMethodName(opts,"revokeToken"),callback)this.transporter.request(opts).then(r=>callback(null,r),callback);else return this.transporter.request(opts)}revokeCredentials(callback){if(callback)this.revokeCredentialsAsync().then(res=>callback(null,res),callback);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let token=this.credentials.access_token;if(this.credentials={},token)return this.revokeToken(token);throw new Error("No access token to revoke.")}request(opts,callback){if(callback)this.requestAsync(opts).then(r=>callback(null,r),e=>callback(e,e.response));else return this.requestAsync(opts)}async requestAsync(opts,reAuthRetried=!1){try{let r=await this.getRequestMetadataAsync();return opts.headers=gaxios_1.Gaxios.mergeHeaders(opts.headers),this.addUserProjectAndAuthHeaders(opts.headers,r.headers),this.apiKey&&opts.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(opts)}catch(e){let res=e.response;if(res){let statusCode=res.status,mayRequireRefresh=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),mayRequireRefreshWithNoRefreshToken=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,isReadableStream=res.config.data instanceof stream.Readable,isAuthErr=statusCode===401||statusCode===403;if(!reAuthRetried&&isAuthErr&&!isReadableStream&&mayRequireRefresh)return await this.refreshAccessTokenAsync(),this.requestAsync(opts,!0);if(!reAuthRetried&&isAuthErr&&!isReadableStream&&mayRequireRefreshWithNoRefreshToken){let refreshedAccessToken=await this.processAndValidateRefreshHandler();return refreshedAccessToken?.access_token&&this.setCredentials(refreshedAccessToken),this.requestAsync(opts,!0)}}throw e}}verifyIdToken(options,callback){if(callback&&typeof callback!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(callback)this.verifyIdTokenAsync(options).then(r=>callback(null,r),callback);else return this.verifyIdTokenAsync(options)}async verifyIdTokenAsync(options){if(!options.idToken)throw new Error("The verifyIdToken method requires an ID Token");let response=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(options.idToken,response.certs,options.audience,this.issuers,options.maxExpiry)}async getTokenInfo(accessToken){let{data}=await this.transporter.request({..._OAuth2Client.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${accessToken}`},url:this.endpoints.tokenInfoUrl.toString()}),info=Object.assign({expiry_date:new Date().getTime()+data.expires_in*1e3,scopes:data.scope.split(" ")},data);return delete info.expires_in,delete info.scope,info}getFederatedSignonCerts(callback){if(callback)this.getFederatedSignonCertsAsync().then(r=>callback(null,r.certs,r.res),callback);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let nowTime=new Date().getTime(),format=(0,crypto_1.hasBrowserCrypto)()?CertificateFormat.JWK:CertificateFormat.PEM;if(this.certificateExpiry&&nowTime<this.certificateExpiry.getTime()&&this.certificateCacheFormat===format)return{certs:this.certificateCache,format};let res,url;switch(format){case CertificateFormat.PEM:url=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case CertificateFormat.JWK:url=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${format}`)}try{let opts={..._OAuth2Client.RETRY_CONFIG,url};authclient_1.AuthClient.setMethodName(opts,"getFederatedSignonCertsAsync"),res=await this.transporter.request(opts)}catch(e){throw e instanceof Error&&(e.message=`Failed to retrieve verification certificates: ${e.message}`),e}let cacheControl=res?.headers.get("cache-control"),cacheAge=-1;if(cacheControl){let maxAge=/max-age=(?<maxAge>[0-9]+)/.exec(cacheControl)?.groups?.maxAge;maxAge&&(cacheAge=Number(maxAge)*1e3)}let certificates={};switch(format){case CertificateFormat.PEM:certificates=res.data;break;case CertificateFormat.JWK:for(let key of res.data.keys)certificates[key.kid]=key;break;default:throw new Error(`Unsupported certificate format ${format}`)}let now=new Date;return this.certificateExpiry=cacheAge===-1?null:new Date(now.getTime()+cacheAge),this.certificateCache=certificates,this.certificateCacheFormat=format,{certs:certificates,format,res}}getIapPublicKeys(callback){if(callback)this.getIapPublicKeysAsync().then(r=>callback(null,r.pubkeys,r.res),callback);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let res,url=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let opts={..._OAuth2Client.RETRY_CONFIG,url};authclient_1.AuthClient.setMethodName(opts,"getIapPublicKeysAsync"),res=await this.transporter.request(opts)}catch(e){throw e instanceof Error&&(e.message=`Failed to retrieve verification certificates: ${e.message}`),e}return{pubkeys:res.data,res}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(jwt,certs,requiredAudience,issuers,maxExpiry){let crypto2=(0,crypto_1.createCrypto)();maxExpiry||(maxExpiry=_OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let segments=jwt.split(".");if(segments.length!==3)throw new Error("Wrong number of segments in token: "+jwt);let signed=segments[0]+"."+segments[1],signature=segments[2],envelope,payload;try{envelope=JSON.parse(crypto2.decodeBase64StringUtf8(segments[0]))}catch(err){throw err instanceof Error&&(err.message=`Can't parse token envelope: ${segments[0]}': ${err.message}`),err}if(!envelope)throw new Error("Can't parse token envelope: "+segments[0]);try{payload=JSON.parse(crypto2.decodeBase64StringUtf8(segments[1]))}catch(err){throw err instanceof Error&&(err.message=`Can't parse token payload '${segments[0]}`),err}if(!payload)throw new Error("Can't parse token payload: "+segments[1]);if(!Object.prototype.hasOwnProperty.call(certs,envelope.kid))throw new Error("No pem found for envelope: "+JSON.stringify(envelope));let cert=certs[envelope.kid];if(envelope.alg==="ES256"&&(signature=formatEcdsa.joseToDer(signature,"ES256").toString("base64")),!await crypto2.verify(cert,signed,signature))throw new Error("Invalid token signature: "+jwt);if(!payload.iat)throw new Error("No issue time in token: "+JSON.stringify(payload));if(!payload.exp)throw new Error("No expiration time in token: "+JSON.stringify(payload));let iat=Number(payload.iat);if(isNaN(iat))throw new Error("iat field using invalid format");let exp=Number(payload.exp);if(isNaN(exp))throw new Error("exp field using invalid format");let now=new Date().getTime()/1e3;if(exp>=now+maxExpiry)throw new Error("Expiration time too far in future: "+JSON.stringify(payload));let earliest=iat-_OAuth2Client.CLOCK_SKEW_SECS_,latest=exp+_OAuth2Client.CLOCK_SKEW_SECS_;if(now<earliest)throw new Error("Token used too early, "+now+" < "+earliest+": "+JSON.stringify(payload));if(now>latest)throw new Error("Token used too late, "+now+" > "+latest+": "+JSON.stringify(payload));if(issuers&&issuers.indexOf(payload.iss)<0)throw new Error("Invalid issuer, expected one of ["+issuers+"], but got "+payload.iss);if(typeof requiredAudience<"u"&&requiredAudience!==null){let aud=payload.aud,audVerified=!1;if(requiredAudience.constructor===Array?audVerified=requiredAudience.indexOf(aud)>-1:audVerified=aud===requiredAudience,!audVerified)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new loginticket_1.LoginTicket(envelope,payload)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let accessTokenResponse=await this.refreshHandler();if(!accessTokenResponse.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return accessTokenResponse}}isTokenExpiring(){let expiryDate=this.credentials.expiry_date;return expiryDate?expiryDate<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};exports.OAuth2Client=OAuth2Client}});var require_computeclient=__commonJS({"node_modules/google-auth-library/build/src/auth/computeclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.Compute=void 0;var gaxios_1=require_src(),gcpMetadata=require_src3(),oauth2client_1=require_oauth2client(),Compute=class extends oauth2client_1.OAuth2Client{serviceAccountEmail;scopes;constructor(options={}){super(options),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=options.serviceAccountEmail||"default",this.scopes=Array.isArray(options.scopes)?options.scopes:options.scopes?[options.scopes]:[]}async refreshTokenNoCache(){let tokenPath=`service-accounts/${this.serviceAccountEmail}/token`,data;try{let instanceOptions={property:tokenPath};this.scopes.length>0&&(instanceOptions.params={scopes:this.scopes.join(",")}),data=await gcpMetadata.instance(instanceOptions)}catch(e){throw e instanceof gaxios_1.GaxiosError&&(e.message=`Could not refresh access token: ${e.message}`,this.wrapError(e)),e}let tokens=data;return data&&data.expires_in&&(tokens.expiry_date=new Date().getTime()+data.expires_in*1e3,delete tokens.expires_in),this.emit("tokens",tokens),{tokens,res:null}}async fetchIdToken(targetAudience){let idTokenPath=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${targetAudience}`,idToken;try{let instanceOptions={property:idTokenPath};idToken=await gcpMetadata.instance(instanceOptions)}catch(e){throw e instanceof Error&&(e.message=`Could not fetch ID token: ${e.message}`),e}return idToken}wrapError(e){let res=e.response;res&&res.status&&(e.status=res.status,res.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:res.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};exports.Compute=Compute}});var require_idtokenclient=__commonJS({"node_modules/google-auth-library/build/src/auth/idtokenclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.IdTokenClient=void 0;var oauth2client_1=require_oauth2client(),IdTokenClient=class extends oauth2client_1.OAuth2Client{targetAudience;idTokenProvider;constructor(options){super(options),this.targetAudience=options.targetAudience,this.idTokenProvider=options.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let idToken=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:idToken,expiry_date:this.getIdTokenExpiryDate(idToken)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(idToken){let payloadB64=idToken.split(".")[1];if(payloadB64)return JSON.parse(Buffer.from(payloadB64,"base64").toString("ascii")).exp*1e3}};exports.IdTokenClient=IdTokenClient}});var require_envDetect=__commonJS({"node_modules/google-auth-library/build/src/auth/envDetect.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.GCPEnv=void 0;exports.clear=clear;exports.getEnv=getEnv;var gcpMetadata=require_src3(),GCPEnv;(function(GCPEnv2){GCPEnv2.APP_ENGINE="APP_ENGINE",GCPEnv2.KUBERNETES_ENGINE="KUBERNETES_ENGINE",GCPEnv2.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",GCPEnv2.COMPUTE_ENGINE="COMPUTE_ENGINE",GCPEnv2.CLOUD_RUN="CLOUD_RUN",GCPEnv2.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",GCPEnv2.NONE="NONE"})(GCPEnv||(exports.GCPEnv=GCPEnv={}));var envPromise;function clear(){envPromise=void 0}async function getEnv(){return envPromise||(envPromise=getEnvMemoized(),envPromise)}async function getEnvMemoized(){let env=GCPEnv.NONE;return isAppEngine()?env=GCPEnv.APP_ENGINE:isCloudFunction()?env=GCPEnv.CLOUD_FUNCTIONS:await isComputeEngine()?await isKubernetesEngine()?env=GCPEnv.KUBERNETES_ENGINE:isCloudRun()?env=GCPEnv.CLOUD_RUN:isCloudRunJob()?env=GCPEnv.CLOUD_RUN_JOBS:env=GCPEnv.COMPUTE_ENGINE:env=GCPEnv.NONE,env}function isAppEngine(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}function isCloudFunction(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}function isCloudRun(){return!!process.env.K_CONFIGURATION}function isCloudRunJob(){return!!process.env.CLOUD_RUN_JOB}async function isKubernetesEngine(){try{return await gcpMetadata.instance("attributes/cluster-name"),!0}catch{return!1}}async function isComputeEngine(){return gcpMetadata.isAvailable()}}});var require_data_stream=__commonJS({"node_modules/jws/lib/data-stream.js"(exports,module){var Buffer2=require_safe_buffer().Buffer,Stream=__require("stream"),util=__require("util");function DataStream(data){if(this.buffer=null,this.writable=!0,this.readable=!0,!data)return this.buffer=Buffer2.alloc(0),this;if(typeof data.pipe=="function")return this.buffer=Buffer2.alloc(0),data.pipe(this),this;if(data.length||typeof data=="object")return this.buffer=data,this.writable=!1,process.nextTick(function(){this.emit("end",data),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof data+")")}util.inherits(DataStream,Stream);DataStream.prototype.write=function(data){this.buffer=Buffer2.concat([this.buffer,Buffer2.from(data)]),this.emit("data",data)};DataStream.prototype.end=function(data){data&&this.write(data),this.emit("end",data),this.emit("close"),this.writable=!1,this.readable=!1};module.exports=DataStream}});var require_buffer_equal_constant_time=__commonJS({"node_modules/buffer-equal-constant-time/index.js"(exports,module){"use strict";var Buffer2=__require("buffer").Buffer,SlowBuffer=__require("buffer").SlowBuffer;module.exports=bufferEq;function bufferEq(a,b){if(!Buffer2.isBuffer(a)||!Buffer2.isBuffer(b)||a.length!==b.length)return!1;for(var c=0,i=0;i<a.length;i++)c|=a[i]^b[i];return c===0}bufferEq.install=function(){Buffer2.prototype.equal=SlowBuffer.prototype.equal=function(that){return bufferEq(this,that)}};var origBufEqual=Buffer2.prototype.equal,origSlowBufEqual=SlowBuffer.prototype.equal;bufferEq.restore=function(){Buffer2.prototype.equal=origBufEqual,SlowBuffer.prototype.equal=origSlowBufEqual}}});var require_jwa=__commonJS({"node_modules/jwa/index.js"(exports,module){var Buffer2=require_safe_buffer().Buffer,crypto2=__require("crypto"),formatEcdsa=require_ecdsa_sig_formatter(),util=__require("util"),MSG_INVALID_ALGORITHM=`"%s" is not a valid algorithm.
  Supported algorithms are:
  "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,MSG_INVALID_SECRET="secret must be a string or buffer",MSG_INVALID_VERIFIER_KEY="key must be a string or a buffer",MSG_INVALID_SIGNER_KEY="key must be a string, a buffer or an object",supportsKeyObjects=typeof crypto2.createPublicKey=="function";supportsKeyObjects&&(MSG_INVALID_VERIFIER_KEY+=" or a KeyObject",MSG_INVALID_SECRET+="or a KeyObject");function checkIsPublicKey(key){if(!Buffer2.isBuffer(key)&&typeof key!="string"&&(!supportsKeyObjects||typeof key!="object"||typeof key.type!="string"||typeof key.asymmetricKeyType!="string"||typeof key.export!="function"))throw typeError(MSG_INVALID_VERIFIER_KEY)}function checkIsPrivateKey(key){if(!Buffer2.isBuffer(key)&&typeof key!="string"&&typeof key!="object")throw typeError(MSG_INVALID_SIGNER_KEY)}function checkIsSecretKey(key){if(!Buffer2.isBuffer(key)){if(typeof key=="string")return key;if(!supportsKeyObjects||typeof key!="object"||key.type!=="secret"||typeof key.export!="function")throw typeError(MSG_INVALID_SECRET)}}function fromBase64(base64){return base64.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function toBase64(base64url){base64url=base64url.toString();var padding=4-base64url.length%4;if(padding!==4)for(var i=0;i<padding;++i)base64url+="=";return base64url.replace(/\-/g,"+").replace(/_/g,"/")}function typeError(template){var args=[].slice.call(arguments,1),errMsg=util.format.bind(util,template).apply(null,args);return new TypeError(errMsg)}function bufferOrString(obj){return Buffer2.isBuffer(obj)||typeof obj=="string"}function normalizeInput(thing){return bufferOrString(thing)||(thing=JSON.stringify(thing)),thing}function createHmacSigner(bits){return function(thing,secret){checkIsSecretKey(secret),thing=normalizeInput(thing);var hmac=crypto2.createHmac("sha"+bits,secret),sig=(hmac.update(thing),hmac.digest("base64"));return fromBase64(sig)}}var bufferEqual,timingSafeEqual="timingSafeEqual"in crypto2?function(a,b){return a.byteLength!==b.byteLength?!1:crypto2.timingSafeEqual(a,b)}:function(a,b){return bufferEqual||(bufferEqual=require_buffer_equal_constant_time()),bufferEqual(a,b)};function createHmacVerifier(bits){return function(thing,signature,secret){var computedSig=createHmacSigner(bits)(thing,secret);return timingSafeEqual(Buffer2.from(signature),Buffer2.from(computedSig))}}function createKeySigner(bits){return function(thing,privateKey){checkIsPrivateKey(privateKey),thing=normalizeInput(thing);var signer=crypto2.createSign("RSA-SHA"+bits),sig=(signer.update(thing),signer.sign(privateKey,"base64"));return fromBase64(sig)}}function createKeyVerifier(bits){return function(thing,signature,publicKey){checkIsPublicKey(publicKey),thing=normalizeInput(thing),signature=toBase64(signature);var verifier=crypto2.createVerify("RSA-SHA"+bits);return verifier.update(thing),verifier.verify(publicKey,signature,"base64")}}function createPSSKeySigner(bits){return function(thing,privateKey){checkIsPrivateKey(privateKey),thing=normalizeInput(thing);var signer=crypto2.createSign("RSA-SHA"+bits),sig=(signer.update(thing),signer.sign({key:privateKey,padding:crypto2.constants.RSA_PKCS1_PSS_PADDING,saltLength:crypto2.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return fromBase64(sig)}}function createPSSKeyVerifier(bits){return function(thing,signature,publicKey){checkIsPublicKey(publicKey),thing=normalizeInput(thing),signature=toBase64(signature);var verifier=crypto2.createVerify("RSA-SHA"+bits);return verifier.update(thing),verifier.verify({key:publicKey,padding:crypto2.constants.RSA_PKCS1_PSS_PADDING,saltLength:crypto2.constants.RSA_PSS_SALTLEN_DIGEST},signature,"base64")}}function createECDSASigner(bits){var inner=createKeySigner(bits);return function(){var signature=inner.apply(null,arguments);return signature=formatEcdsa.derToJose(signature,"ES"+bits),signature}}function createECDSAVerifer(bits){var inner=createKeyVerifier(bits);return function(thing,signature,publicKey){signature=formatEcdsa.joseToDer(signature,"ES"+bits).toString("base64");var result=inner(thing,signature,publicKey);return result}}function createNoneSigner(){return function(){return""}}function createNoneVerifier(){return function(thing,signature){return signature===""}}module.exports=function(algorithm){var signerFactories={hs:createHmacSigner,rs:createKeySigner,ps:createPSSKeySigner,es:createECDSASigner,none:createNoneSigner},verifierFactories={hs:createHmacVerifier,rs:createKeyVerifier,ps:createPSSKeyVerifier,es:createECDSAVerifer,none:createNoneVerifier},match=algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!match)throw typeError(MSG_INVALID_ALGORITHM,algorithm);var algo=(match[1]||match[3]).toLowerCase(),bits=match[2];return{sign:signerFactories[algo](bits),verify:verifierFactories[algo](bits)}}}});var require_tostring=__commonJS({"node_modules/jws/lib/tostring.js"(exports,module){var Buffer2=__require("buffer").Buffer;module.exports=function(obj){return typeof obj=="string"?obj:typeof obj=="number"||Buffer2.isBuffer(obj)?obj.toString():JSON.stringify(obj)}}});var require_sign_stream=__commonJS({"node_modules/jws/lib/sign-stream.js"(exports,module){var Buffer2=require_safe_buffer().Buffer,DataStream=require_data_stream(),jwa=require_jwa(),Stream=__require("stream"),toString=require_tostring(),util=__require("util");function base64url(string,encoding){return Buffer2.from(string,encoding).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jwsSecuredInput(header,payload,encoding){encoding=encoding||"utf8";var encodedHeader=base64url(toString(header),"binary"),encodedPayload=base64url(toString(payload),encoding);return util.format("%s.%s",encodedHeader,encodedPayload)}function jwsSign(opts){var header=opts.header,payload=opts.payload,secretOrKey=opts.secret||opts.privateKey,encoding=opts.encoding,algo=jwa(header.alg),securedInput=jwsSecuredInput(header,payload,encoding),signature=algo.sign(securedInput,secretOrKey);return util.format("%s.%s",securedInput,signature)}function SignStream(opts){var secret=opts.secret;if(secret=secret??opts.privateKey,secret=secret??opts.key,/^hs/i.test(opts.header.alg)===!0&&secret==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var secretStream=new DataStream(secret);this.readable=!0,this.header=opts.header,this.encoding=opts.encoding,this.secret=this.privateKey=this.key=secretStream,this.payload=new DataStream(opts.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}util.inherits(SignStream,Stream);SignStream.prototype.sign=function(){try{var signature=jwsSign({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",signature),this.emit("data",signature),this.emit("end"),this.readable=!1,signature}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}};SignStream.sign=jwsSign;module.exports=SignStream}});var require_verify_stream=__commonJS({"node_modules/jws/lib/verify-stream.js"(exports,module){var Buffer2=require_safe_buffer().Buffer,DataStream=require_data_stream(),jwa=require_jwa(),Stream=__require("stream"),toString=require_tostring(),util=__require("util"),JWS_REGEX=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function isObject(thing){return Object.prototype.toString.call(thing)==="[object Object]"}function safeJsonParse(thing){if(isObject(thing))return thing;try{return JSON.parse(thing)}catch{return}}function headerFromJWS(jwsSig){var encodedHeader=jwsSig.split(".",1)[0];return safeJsonParse(Buffer2.from(encodedHeader,"base64").toString("binary"))}function securedInputFromJWS(jwsSig){return jwsSig.split(".",2).join(".")}function signatureFromJWS(jwsSig){return jwsSig.split(".")[2]}function payloadFromJWS(jwsSig,encoding){encoding=encoding||"utf8";var payload=jwsSig.split(".")[1];return Buffer2.from(payload,"base64").toString(encoding)}function isValidJws(string){return JWS_REGEX.test(string)&&!!headerFromJWS(string)}function jwsVerify(jwsSig,algorithm,secretOrKey){if(!algorithm){var err=new Error("Missing algorithm parameter for jws.verify");throw err.code="MISSING_ALGORITHM",err}jwsSig=toString(jwsSig);var signature=signatureFromJWS(jwsSig),securedInput=securedInputFromJWS(jwsSig),algo=jwa(algorithm);return algo.verify(securedInput,signature,secretOrKey)}function jwsDecode(jwsSig,opts){if(opts=opts||{},jwsSig=toString(jwsSig),!isValidJws(jwsSig))return null;var header=headerFromJWS(jwsSig);if(!header)return null;var payload=payloadFromJWS(jwsSig);return(header.typ==="JWT"||opts.json)&&(payload=JSON.parse(payload,opts.encoding)),{header,payload,signature:signatureFromJWS(jwsSig)}}function VerifyStream(opts){opts=opts||{};var secretOrKey=opts.secret;if(secretOrKey=secretOrKey??opts.publicKey,secretOrKey=secretOrKey??opts.key,/^hs/i.test(opts.algorithm)===!0&&secretOrKey==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var secretStream=new DataStream(secretOrKey);this.readable=!0,this.algorithm=opts.algorithm,this.encoding=opts.encoding,this.secret=this.publicKey=this.key=secretStream,this.signature=new DataStream(opts.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}util.inherits(VerifyStream,Stream);VerifyStream.prototype.verify=function(){try{var valid=jwsVerify(this.signature.buffer,this.algorithm,this.key.buffer),obj=jwsDecode(this.signature.buffer,this.encoding);return this.emit("done",valid,obj),this.emit("data",valid),this.emit("end"),this.readable=!1,valid}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}};VerifyStream.decode=jwsDecode;VerifyStream.isValid=isValidJws;VerifyStream.verify=jwsVerify;module.exports=VerifyStream}});var require_jws=__commonJS({"node_modules/jws/index.js"(exports){var SignStream=require_sign_stream(),VerifyStream=require_verify_stream(),ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];exports.ALGORITHMS=ALGORITHMS;exports.sign=SignStream.sign;exports.verify=VerifyStream.verify;exports.decode=VerifyStream.decode;exports.isValid=VerifyStream.isValid;exports.createSign=function(opts){return new SignStream(opts)};exports.createVerify=function(opts){return new VerifyStream(opts)}}});var require_jwsSign=__commonJS({"node_modules/google-auth-library/build/src/gtoken/jwsSign.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.buildPayloadForJwsSign=buildPayloadForJwsSign;exports.getJwsSign=getJwsSign;var jws_1=require_jws(),ALG_RS256="RS256",GOOGLE_TOKEN_URL="https://oauth2.googleapis.com/token";function buildPayloadForJwsSign(tokenOptions){let iat=Math.floor(new Date().getTime()/1e3);return{iss:tokenOptions.iss,scope:tokenOptions.scope,aud:GOOGLE_TOKEN_URL,exp:iat+3600,iat,sub:tokenOptions.sub,...tokenOptions.additionalClaims}}function getJwsSign(tokenOptions){let payload=buildPayloadForJwsSign(tokenOptions);return(0,jws_1.sign)({header:{alg:ALG_RS256},payload,secret:tokenOptions.key})}}});var require_getToken=__commonJS({"node_modules/google-auth-library/build/src/gtoken/getToken.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.getToken=getToken;var jwsSign_1=require_jwsSign(),GOOGLE_TOKEN_URL="https://oauth2.googleapis.com/token",GOOGLE_GRANT_TYPE="urn:ietf:params:oauth:grant-type:jwt-bearer",generateRequestOptions=tokenOptions=>({method:"POST",url:GOOGLE_TOKEN_URL,data:new URLSearchParams({grant_type:GOOGLE_GRANT_TYPE,assertion:(0,jwsSign_1.getJwsSign)(tokenOptions)}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});async function getToken(tokenOptions){if(!tokenOptions.transporter)throw new Error("No transporter set.");try{let gaxiosOptions=generateRequestOptions(tokenOptions);return(await tokenOptions.transporter.request(gaxiosOptions)).data}catch(e){let err=e,errorData=err.response?.data;throw errorData?.error&&(err.message=`${errorData.error}: ${errorData.error_description}`),err}}}});var require_errorWithCode=__commonJS({"node_modules/google-auth-library/build/src/gtoken/errorWithCode.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.ErrorWithCode=void 0;var ErrorWithCode=class extends Error{code;constructor(message,code){super(message),this.code=code}};exports.ErrorWithCode=ErrorWithCode}});var require_getCredentials=__commonJS({"node_modules/google-auth-library/build/src/gtoken/getCredentials.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.getCredentials=getCredentials;var path=__require("path"),fs=__require("fs"),util_1=__require("util"),errorWithCode_1=require_errorWithCode(),readFile=fs.readFile?(0,util_1.promisify)(fs.readFile):async()=>{throw new errorWithCode_1.ErrorWithCode("use key rather than keyFile.","MISSING_CREDENTIALS")},ExtensionFiles;(function(ExtensionFiles2){ExtensionFiles2.JSON=".json",ExtensionFiles2.DER=".der",ExtensionFiles2.CRT=".crt",ExtensionFiles2.PEM=".pem",ExtensionFiles2.P12=".p12",ExtensionFiles2.PFX=".pfx"})(ExtensionFiles||(ExtensionFiles={}));var JsonCredentialsProvider=class{keyFilePath;constructor(keyFilePath){this.keyFilePath=keyFilePath}async getCredentials(){let key=await readFile(this.keyFilePath,"utf8"),body;try{body=JSON.parse(key)}catch(error){let err=error;throw new Error(`Invalid JSON key file: ${err.message}`)}let privateKey=body.private_key,clientEmail=body.client_email;if(!privateKey||!clientEmail)throw new errorWithCode_1.ErrorWithCode("private_key and client_email are required.","MISSING_CREDENTIALS");return{privateKey,clientEmail}}},PemCredentialsProvider=class{keyFilePath;constructor(keyFilePath){this.keyFilePath=keyFilePath}async getCredentials(){return{privateKey:await readFile(this.keyFilePath,"utf8")}}},P12CredentialsProvider=class{async getCredentials(){throw new errorWithCode_1.ErrorWithCode("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE")}},CredentialsProviderFactory=class{static create(keyFilePath){switch(path.extname(keyFilePath)){case ExtensionFiles.JSON:return new JsonCredentialsProvider(keyFilePath);case ExtensionFiles.DER:case ExtensionFiles.CRT:case ExtensionFiles.PEM:return new PemCredentialsProvider(keyFilePath);case ExtensionFiles.P12:case ExtensionFiles.PFX:return new P12CredentialsProvider;default:throw new errorWithCode_1.ErrorWithCode("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE")}}};async function getCredentials(keyFilePath){return CredentialsProviderFactory.create(keyFilePath).getCredentials()}}});var require_tokenHandler=__commonJS({"node_modules/google-auth-library/build/src/gtoken/tokenHandler.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.TokenHandler=void 0;var getToken_1=require_getToken(),getCredentials_1=require_getCredentials(),TokenHandler=class{token;tokenExpiresAt;inFlightRequest;tokenOptions;constructor(tokenOptions){this.tokenOptions=tokenOptions}async processCredentials(){if(!this.tokenOptions.key&&!this.tokenOptions.keyFile)throw new Error("No key or keyFile set.");if(!this.tokenOptions.key&&this.tokenOptions.keyFile){let credentials=await(0,getCredentials_1.getCredentials)(this.tokenOptions.keyFile);this.tokenOptions.key=credentials.privateKey,this.tokenOptions.email=credentials.clientEmail}}isTokenExpiring(){if(!this.token||!this.tokenExpiresAt)return!0;let now=new Date().getTime(),eagerRefreshThresholdMillis=this.tokenOptions.eagerRefreshThresholdMillis??0;return this.tokenExpiresAt<=now+eagerRefreshThresholdMillis}hasExpired(){let now=new Date().getTime();return this.token&&this.tokenExpiresAt?new Date().getTime()>=this.tokenExpiresAt:!0}async getToken(forceRefresh){if(await this.processCredentials(),this.inFlightRequest&&!forceRefresh)return this.inFlightRequest;if(this.token&&!this.isTokenExpiring()&&!forceRefresh)return this.token;try{this.inFlightRequest=(0,getToken_1.getToken)(this.tokenOptions);let token=await this.inFlightRequest;return this.token=token,this.tokenExpiresAt=new Date().getTime()+(token.expires_in??0)*1e3,token}finally{this.inFlightRequest=void 0}}};exports.TokenHandler=TokenHandler}});var require_revokeToken=__commonJS({"node_modules/google-auth-library/build/src/gtoken/revokeToken.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.revokeToken=revokeToken;var GOOGLE_REVOKE_TOKEN_URL="https://oauth2.googleapis.com/revoke?token=",DEFAULT_RETRY_VALUE=!0;async function revokeToken(accessToken,transporter){let url=GOOGLE_REVOKE_TOKEN_URL+accessToken;return await transporter.request({url,retry:DEFAULT_RETRY_VALUE})}}});var require_googleToken=__commonJS({"node_modules/google-auth-library/build/src/gtoken/googleToken.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.GoogleToken=void 0;var gaxios_1=require_src(),tokenHandler_1=require_tokenHandler(),revokeToken_1=require_revokeToken(),GoogleToken=class{tokenOptions;tokenHandler;constructor(options){this.tokenOptions=options||{},this.tokenOptions.transporter=this.tokenOptions.transporter||{request:opts=>(0,gaxios_1.request)(opts)},this.tokenOptions.iss||(this.tokenOptions.iss=this.tokenOptions.email),typeof this.tokenOptions.scope=="object"&&(this.tokenOptions.scope=this.tokenOptions.scope.join(" ")),this.tokenHandler=new tokenHandler_1.TokenHandler(this.tokenOptions)}get expiresAt(){return this.tokenHandler.tokenExpiresAt}get accessToken(){return this.tokenHandler.token?.access_token}get idToken(){return this.tokenHandler.token?.id_token}get tokenType(){return this.tokenHandler.token?.token_type}get refreshToken(){return this.tokenHandler.token?.refresh_token}hasExpired(){return this.tokenHandler.hasExpired()}isTokenExpiring(){return this.tokenHandler.isTokenExpiring()}getToken(callbackOrOptions,opts={forceRefresh:!1}){let callback;typeof callbackOrOptions=="function"?callback=callbackOrOptions:typeof callbackOrOptions=="object"&&(opts=callbackOrOptions);let promise=this.tokenHandler.getToken(opts.forceRefresh??!1);return callback&&promise.then(token=>callback(null,token),callback),promise}revokeToken(callback){if(!this.accessToken)return Promise.reject(new Error("No token to revoke."));let promise=(0,revokeToken_1.revokeToken)(this.accessToken,this.tokenOptions.transporter);callback&&promise.then(()=>callback(),callback),this.tokenHandler=new tokenHandler_1.TokenHandler(this.tokenOptions)}get googleTokenOptions(){return this.tokenOptions}};exports.GoogleToken=GoogleToken}});var require_jwtaccess=__commonJS({"node_modules/google-auth-library/build/src/auth/jwtaccess.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.JWTAccess=void 0;var jws=require_jws(),util_1=require_util2(),DEFAULT_HEADER={alg:"RS256",typ:"JWT"},JWTAccess=class _JWTAccess{email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new util_1.LRUCache({capacity:500,maxAge:3600*1e3});constructor(email,key,keyId,eagerRefreshThresholdMillis){this.email=email,this.key=key,this.keyId=keyId,this.eagerRefreshThresholdMillis=eagerRefreshThresholdMillis??300*1e3}getCachedKey(url,scopes){let cacheKey=url;if(scopes&&Array.isArray(scopes)&&scopes.length?cacheKey=url?`${url}_${scopes.join("_")}`:`${scopes.join("_")}`:typeof scopes=="string"&&(cacheKey=url?`${url}_${scopes}`:scopes),!cacheKey)throw Error("Scopes or url must be provided");return cacheKey}getRequestHeaders(url,additionalClaims,scopes){let key=this.getCachedKey(url,scopes),cachedToken=this.cache.get(key),now=Date.now();if(cachedToken&&cachedToken.expiration-now>this.eagerRefreshThresholdMillis)return new Headers(cachedToken.headers);let iat=Math.floor(Date.now()/1e3),exp=_JWTAccess.getExpirationTime(iat),defaultClaims;if(Array.isArray(scopes)&&(scopes=scopes.join(" ")),scopes?defaultClaims={iss:this.email,sub:this.email,scope:scopes,exp,iat}:defaultClaims={iss:this.email,sub:this.email,aud:url,exp,iat},additionalClaims){for(let claim in defaultClaims)if(additionalClaims[claim])throw new Error(`The '${claim}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let header=this.keyId?{...DEFAULT_HEADER,kid:this.keyId}:DEFAULT_HEADER,payload=Object.assign(defaultClaims,additionalClaims),signedJWT=jws.sign({header,payload,secret:this.key}),headers=new Headers({authorization:`Bearer ${signedJWT}`});return this.cache.set(key,{expiration:exp*1e3,headers}),headers}static getExpirationTime(iat){return iat+3600}fromJSON(json){if(!json)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!json.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!json.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=json.client_email,this.key=json.private_key,this.keyId=json.private_key_id,this.projectId=json.project_id}fromStream(inputStream,callback){if(callback)this.fromStreamAsync(inputStream).then(()=>callback(),callback);else return this.fromStreamAsync(inputStream)}fromStreamAsync(inputStream){return new Promise((resolve,reject)=>{inputStream||reject(new Error("Must pass in a stream containing the service account auth settings."));let s="";inputStream.setEncoding("utf8").on("data",chunk=>s+=chunk).on("error",reject).on("end",()=>{try{let data=JSON.parse(s);this.fromJSON(data),resolve()}catch(err){reject(err)}})})}};exports.JWTAccess=JWTAccess}});var require_jwtclient=__commonJS({"node_modules/google-auth-library/build/src/auth/jwtclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.JWT=void 0;var googleToken_1=require_googleToken(),getCredentials_1=require_getCredentials(),jwtaccess_1=require_jwtaccess(),oauth2client_1=require_oauth2client(),authclient_1=require_authclient(),JWT=class _JWT extends oauth2client_1.OAuth2Client{email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(options={}){super(options),this.email=options.email,this.keyFile=options.keyFile,this.key=options.key,this.keyId=options.keyId,this.scopes=options.scopes,this.subject=options.subject,this.additionalClaims=options.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(scopes){let jwt=new _JWT(this);return jwt.scopes=scopes,jwt}async getRequestMetadataAsync(url){url=this.defaultServicePath?`https://${this.defaultServicePath}/`:url;let useSelfSignedJWT=!this.hasUserScopes()&&url||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==authclient_1.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==authclient_1.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${authclient_1.DEFAULT_UNIVERSE}`);if(!this.apiKey&&useSelfSignedJWT)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${tokens.id_token}`}))}}else{this.access||(this.access=new jwtaccess_1.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let scopes;this.hasUserScopes()?scopes=this.scopes:url||(scopes=this.defaultScopes);let useScopes=this.useJWTAccessWithScope||this.universeDomain!==authclient_1.DEFAULT_UNIVERSE,headers=await this.access.getRequestHeaders(url??void 0,this.additionalClaims,useScopes?scopes:void 0);return{headers:this.addSharedMetadataHeaders(headers)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(url):{headers:new Headers}}async fetchIdToken(targetAudience){let gtoken=new googleToken_1.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:targetAudience},transporter:this.transporter});if(await gtoken.getToken({forceRefresh:!0}),!gtoken.idToken)throw new Error("Unknown error: Failed to fetch ID token");return gtoken.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(callback){if(callback)this.authorizeAsync().then(r=>callback(null,r),callback);else return this.authorizeAsync()}async authorizeAsync(){let result=await this.refreshToken();if(!result)throw new Error("No result returned");return this.credentials=result.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.googleTokenOptions?.key,this.email=this.gtoken.googleTokenOptions?.iss,result.tokens}async refreshTokenNoCache(){let gtoken=this.createGToken(),tokens={access_token:(await gtoken.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:gtoken.expiresAt,id_token:gtoken.idToken};return this.emit("tokens",tokens),{res:null,tokens}}createGToken(){return this.gtoken||(this.gtoken=new googleToken_1.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(json){if(!json)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!json.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!json.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=json.client_email,this.key=json.private_key,this.keyId=json.private_key_id,this.projectId=json.project_id,this.quotaProjectId=json.quota_project_id,this.universeDomain=json.universe_domain||this.universeDomain}fromStream(inputStream,callback){if(callback)this.fromStreamAsync(inputStream).then(()=>callback(),callback);else return this.fromStreamAsync(inputStream)}fromStreamAsync(inputStream){return new Promise((resolve,reject)=>{if(!inputStream)throw new Error("Must pass in a stream containing the service account auth settings.");let s="";inputStream.setEncoding("utf8").on("error",reject).on("data",chunk=>s+=chunk).on("end",()=>{try{let data=JSON.parse(s);this.fromJSON(data),resolve()}catch(e){reject(e)}})})}fromAPIKey(apiKey){if(typeof apiKey!="string")throw new Error("Must provide an API Key string.");this.apiKey=apiKey}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let gtoken=this.createGToken(),creds=await(0,getCredentials_1.getCredentials)(this.keyFile);return{private_key:creds.privateKey,client_email:creds.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};exports.JWT=JWT}});var require_refreshclient=__commonJS({"node_modules/google-auth-library/build/src/auth/refreshclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.UserRefreshClient=exports.USER_REFRESH_ACCOUNT_TYPE=void 0;var oauth2client_1=require_oauth2client(),authclient_1=require_authclient();exports.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var UserRefreshClient=class _UserRefreshClient extends oauth2client_1.OAuth2Client{_refreshToken;constructor(optionsOrClientId,clientSecret,refreshToken,eagerRefreshThresholdMillis,forceRefreshOnFailure){let opts=optionsOrClientId&&typeof optionsOrClientId=="object"?optionsOrClientId:{clientId:optionsOrClientId,clientSecret,refreshToken,eagerRefreshThresholdMillis,forceRefreshOnFailure};super(opts),this._refreshToken=opts.refreshToken,this.credentials.refresh_token=opts.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(targetAudience){let opts={..._UserRefreshClient.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:targetAudience}),responseType:"json"};return authclient_1.AuthClient.setMethodName(opts,"fetchIdToken"),(await this.transporter.request(opts)).data.id_token}fromJSON(json){if(!json)throw new Error("Must pass in a JSON object containing the user refresh token");if(json.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!json.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!json.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!json.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=json.client_id,this._clientSecret=json.client_secret,this._refreshToken=json.refresh_token,this.credentials.refresh_token=json.refresh_token,this.quotaProjectId=json.quota_project_id,this.universeDomain=json.universe_domain||this.universeDomain}fromStream(inputStream,callback){if(callback)this.fromStreamAsync(inputStream).then(()=>callback(),callback);else return this.fromStreamAsync(inputStream)}async fromStreamAsync(inputStream){return new Promise((resolve,reject)=>{if(!inputStream)return reject(new Error("Must pass in a stream containing the user refresh token."));let s="";inputStream.setEncoding("utf8").on("error",reject).on("data",chunk=>s+=chunk).on("end",()=>{try{let data=JSON.parse(s);return this.fromJSON(data),resolve()}catch(err){return reject(err)}})})}static fromJSON(json){let client=new _UserRefreshClient;return client.fromJSON(json),client}};exports.UserRefreshClient=UserRefreshClient}});var require_impersonated=__commonJS({"node_modules/google-auth-library/build/src/auth/impersonated.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.Impersonated=exports.IMPERSONATED_ACCOUNT_TYPE=void 0;var oauth2client_1=require_oauth2client(),gaxios_1=require_src(),util_1=require_util2();exports.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Impersonated=class _Impersonated extends oauth2client_1.OAuth2Client{sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(options={}){if(super(options),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=options.sourceClient??new oauth2client_1.OAuth2Client,this.targetPrincipal=options.targetPrincipal??"",this.delegates=options.delegates??[],this.targetScopes=options.targetScopes??[],this.lifetime=options.lifetime??3600,!!!(0,util_1.originalOrCamelOptions)(options).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=options.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(blobToSign){await this.sourceClient.getAccessToken();let name=`projects/-/serviceAccounts/${this.targetPrincipal}`,u=`${this.endpoint}/v1/${name}:signBlob`,body={delegates:this.delegates,payload:Buffer.from(blobToSign).toString("base64")};return(await this.sourceClient.request({..._Impersonated.RETRY_CONFIG,url:u,data:body,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let name="projects/-/serviceAccounts/"+this.targetPrincipal,u=`${this.endpoint}/v1/${name}:generateAccessToken`,body={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},res=await this.sourceClient.request({..._Impersonated.RETRY_CONFIG,url:u,data:body,method:"POST"}),tokenResponse=res.data;return this.credentials.access_token=tokenResponse.accessToken,this.credentials.expiry_date=Date.parse(tokenResponse.expireTime),{tokens:this.credentials,res}}catch(error){if(!(error instanceof Error))throw error;let status=0,message="";throw error instanceof gaxios_1.GaxiosError&&(status=error?.response?.data?.error?.status,message=error?.response?.data?.error?.message),status&&message?(error.message=`${status}: unable to impersonate: ${message}`,error):(error.message=`unable to impersonate: ${error}`,error)}}async fetchIdToken(targetAudience,options){await this.sourceClient.getAccessToken();let name=`projects/-/serviceAccounts/${this.targetPrincipal}`,u=`${this.endpoint}/v1/${name}:generateIdToken`,body={delegates:this.delegates,audience:targetAudience,includeEmail:options?.includeEmail??!0,useEmailAzp:options?.includeEmail??!0};return(await this.sourceClient.request({..._Impersonated.RETRY_CONFIG,url:u,data:body,method:"POST"})).data.token}};exports.Impersonated=Impersonated}});var require_oauth2common=__commonJS({"node_modules/google-auth-library/build/src/auth/oauth2common.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.OAuthClientAuthHandler=void 0;exports.getErrorFromOAuthErrorResponse=getErrorFromOAuthErrorResponse;var gaxios_1=require_src(),crypto_1=require_crypto3(),METHODS_SUPPORTING_REQUEST_BODY=["PUT","POST","PATCH"],OAuthClientAuthHandler=class{#crypto=(0,crypto_1.createCrypto)();#clientAuthentication;transporter;constructor(options){options&&"clientId"in options?(this.#clientAuthentication=options,this.transporter=new gaxios_1.Gaxios):(this.#clientAuthentication=options?.clientAuthentication,this.transporter=options?.transporter||new gaxios_1.Gaxios)}applyClientAuthenticationOptions(opts,bearerToken){opts.headers=gaxios_1.Gaxios.mergeHeaders(opts.headers),this.injectAuthenticatedHeaders(opts,bearerToken),bearerToken||this.injectAuthenticatedRequestBody(opts)}injectAuthenticatedHeaders(opts,bearerToken){if(bearerToken)opts.headers=gaxios_1.Gaxios.mergeHeaders(opts.headers,{authorization:`Bearer ${bearerToken}`});else if(this.#clientAuthentication?.confidentialClientType==="basic"){opts.headers=gaxios_1.Gaxios.mergeHeaders(opts.headers);let clientId=this.#clientAuthentication.clientId,clientSecret=this.#clientAuthentication.clientSecret||"",base64EncodedCreds=this.#crypto.encodeBase64StringUtf8(`${clientId}:${clientSecret}`);gaxios_1.Gaxios.mergeHeaders(opts.headers,{authorization:`Basic ${base64EncodedCreds}`})}}injectAuthenticatedRequestBody(opts){if(this.#clientAuthentication?.confidentialClientType==="request-body"){let method=(opts.method||"GET").toUpperCase();if(!METHODS_SUPPORTING_REQUEST_BODY.includes(method))throw new Error(`${method} HTTP method does not support ${this.#clientAuthentication.confidentialClientType} client authentication`);let contentType=new Headers(opts.headers).get("content-type");if(contentType?.startsWith("application/x-www-form-urlencoded")||opts.data instanceof URLSearchParams){let data=new URLSearchParams(opts.data??"");data.append("client_id",this.#clientAuthentication.clientId),data.append("client_secret",this.#clientAuthentication.clientSecret||""),opts.data=data}else if(contentType?.startsWith("application/json"))opts.data=opts.data||{},Object.assign(opts.data,{client_id:this.#clientAuthentication.clientId,client_secret:this.#clientAuthentication.clientSecret||""});else throw new Error(`${contentType} content-types are not supported with ${this.#clientAuthentication.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};exports.OAuthClientAuthHandler=OAuthClientAuthHandler;function getErrorFromOAuthErrorResponse(resp,err){let errorCode=resp.error,errorDescription=resp.error_description,errorUri=resp.error_uri,message=`Error code ${errorCode}`;typeof errorDescription<"u"&&(message+=`: ${errorDescription}`),typeof errorUri<"u"&&(message+=` - ${errorUri}`);let newError=new Error(message);if(err){let keys=Object.keys(err);err.stack&&keys.push("stack"),keys.forEach(key=>{key!=="message"&&Object.defineProperty(newError,key,{value:err[key],writable:!1,enumerable:!0})})}return newError}}});var require_stscredentials=__commonJS({"node_modules/google-auth-library/build/src/auth/stscredentials.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.StsCredentials=void 0;var gaxios_1=require_src(),authclient_1=require_authclient(),oauth2common_1=require_oauth2common(),util_1=require_util2(),StsCredentials=class _StsCredentials extends oauth2common_1.OAuthClientAuthHandler{#tokenExchangeEndpoint;constructor(options={tokenExchangeEndpoint:""},clientAuthentication){(typeof options!="object"||options instanceof URL)&&(options={tokenExchangeEndpoint:options,clientAuthentication}),super(options),this.#tokenExchangeEndpoint=options.tokenExchangeEndpoint}async exchangeToken(stsCredentialsOptions,headers,options){let values={grant_type:stsCredentialsOptions.grantType,resource:stsCredentialsOptions.resource,audience:stsCredentialsOptions.audience,scope:stsCredentialsOptions.scope?.join(" "),requested_token_type:stsCredentialsOptions.requestedTokenType,subject_token:stsCredentialsOptions.subjectToken,subject_token_type:stsCredentialsOptions.subjectTokenType,actor_token:stsCredentialsOptions.actingParty?.actorToken,actor_token_type:stsCredentialsOptions.actingParty?.actorTokenType,options:options&&JSON.stringify(options)},opts={..._StsCredentials.RETRY_CONFIG,url:this.#tokenExchangeEndpoint.toString(),method:"POST",headers,data:new URLSearchParams((0,util_1.removeUndefinedValuesInObject)(values)),responseType:"json"};authclient_1.AuthClient.setMethodName(opts,"exchangeToken"),this.applyClientAuthenticationOptions(opts);try{let response=await this.transporter.request(opts),stsSuccessfulResponse=response.data;return stsSuccessfulResponse.res=response,stsSuccessfulResponse}catch(error){throw error instanceof gaxios_1.GaxiosError&&error.response?(0,oauth2common_1.getErrorFromOAuthErrorResponse)(error.response.data,error):error}}};exports.StsCredentials=StsCredentials}});var require_baseexternalclient=__commonJS({"node_modules/google-auth-library/build/src/auth/baseexternalclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.BaseExternalAccountClient=exports.CLOUD_RESOURCE_MANAGER=exports.EXTERNAL_ACCOUNT_TYPE=exports.EXPIRATION_TIME_OFFSET=void 0;var gaxios_1=require_src(),stream=__require("stream"),authclient_1=require_authclient(),sts=require_stscredentials(),util_1=require_util2(),shared_cjs_1=require_shared2(),STS_GRANT_TYPE="urn:ietf:params:oauth:grant-type:token-exchange",STS_REQUEST_TOKEN_TYPE="urn:ietf:params:oauth:token-type:access_token",DEFAULT_OAUTH_SCOPE="https://www.googleapis.com/auth/cloud-platform",DEFAULT_TOKEN_LIFESPAN=3600;exports.EXPIRATION_TIME_OFFSET=300*1e3;exports.EXTERNAL_ACCOUNT_TYPE="external_account";exports.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var WORKFORCE_AUDIENCE_PATTERN="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",DEFAULT_TOKEN_URL="https://sts.{universeDomain}/v1/token",BaseExternalAccountClient=class _BaseExternalAccountClient extends authclient_1.AuthClient{scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#pendingAccessToken=null;constructor(options){super(options);let opts=(0,util_1.originalOrCamelOptions)(options),type=opts.get("type");if(type&&type!==exports.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${exports.EXTERNAL_ACCOUNT_TYPE}" type but received "${options.type}"`);let clientId=opts.get("client_id"),clientSecret=opts.get("client_secret");this.tokenUrl=opts.get("token_url")??DEFAULT_TOKEN_URL.replace("{universeDomain}",this.universeDomain);let subjectTokenType=opts.get("subject_token_type"),workforcePoolUserProject=opts.get("workforce_pool_user_project"),serviceAccountImpersonationUrl=opts.get("service_account_impersonation_url"),serviceAccountImpersonation=opts.get("service_account_impersonation"),serviceAccountImpersonationLifetime=(0,util_1.originalOrCamelOptions)(serviceAccountImpersonation).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(opts.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),clientId&&(this.clientAuth={confidentialClientType:"basic",clientId,clientSecret}),this.stsCredential=new sts.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=opts.get("scopes")||[DEFAULT_OAUTH_SCOPE],this.cachedAccessToken=null,this.audience=opts.get("audience"),this.subjectTokenType=subjectTokenType,this.workforcePoolUserProject=workforcePoolUserProject;let workforceAudiencePattern=new RegExp(WORKFORCE_AUDIENCE_PATTERN);if(this.workforcePoolUserProject&&!this.audience.match(workforceAudiencePattern))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=serviceAccountImpersonationUrl,this.serviceAccountImpersonationLifetime=serviceAccountImpersonationLifetime,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=DEFAULT_TOKEN_LIFESPAN),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?<email>[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(credentials){super.setCredentials(credentials),this.cachedAccessToken=credentials}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let accessTokenResponse=await this.getAccessToken(),headers=new Headers({authorization:`Bearer ${accessTokenResponse.token}`});return this.addSharedMetadataHeaders(headers)}request(opts,callback){if(callback)this.requestAsync(opts).then(r=>callback(null,r),e=>callback(e,e.response));else return this.requestAsync(opts)}async getProjectId(){let projectNumber=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(projectNumber){let headers=await this.getRequestHeaders(),opts={..._BaseExternalAccountClient.RETRY_CONFIG,headers,url:`${this.cloudResourceManagerURL.toString()}${projectNumber}`,responseType:"json"};authclient_1.AuthClient.setMethodName(opts,"getProjectId");let response=await this.transporter.request(opts);return this.projectId=response.data.projectId,this.projectId}return null}async requestAsync(opts,reAuthRetried=!1){let response;try{let requestHeaders=await this.getRequestHeaders();opts.headers=gaxios_1.Gaxios.mergeHeaders(opts.headers),this.addUserProjectAndAuthHeaders(opts.headers,requestHeaders),response=await this.transporter.request(opts)}catch(e){let res=e.response;if(res){let statusCode=res.status,isReadableStream=res.config.data instanceof stream.Readable;if(!reAuthRetried&&(statusCode===401||statusCode===403)&&!isReadableStream&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(opts,!0)}throw e}return response}async refreshAccessTokenAsync(){this.#pendingAccessToken=this.#pendingAccessToken||this.#internalRefreshAccessTokenAsync();try{return await this.#pendingAccessToken}finally{this.#pendingAccessToken=null}}async#internalRefreshAccessTokenAsync(){let subjectToken=await this.retrieveSubjectToken(),stsCredentialsOptions={grantType:STS_GRANT_TYPE,audience:this.audience,requestedTokenType:STS_REQUEST_TOKEN_TYPE,subjectToken,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[DEFAULT_OAUTH_SCOPE]:this.getScopesArray()},additionalOptions=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,additionalHeaders=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),stsResponse=await this.stsCredential.exchangeToken(stsCredentialsOptions,additionalHeaders,additionalOptions);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(stsResponse.access_token):stsResponse.expires_in?this.cachedAccessToken={access_token:stsResponse.access_token,expiry_date:new Date().getTime()+stsResponse.expires_in*1e3,res:stsResponse.res}:this.cachedAccessToken={access_token:stsResponse.access_token,res:stsResponse.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(audience){let match=audience.match(/\/projects\/([^/]+)/);return match?match[1]:null}async getImpersonatedAccessToken(token){let opts={..._BaseExternalAccountClient.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${token}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"},responseType:"json"};authclient_1.AuthClient.setMethodName(opts,"getImpersonatedAccessToken");let response=await this.transporter.request(opts),successResponse=response.data;return{access_token:successResponse.accessToken,expiry_date:new Date(successResponse.expireTime).getTime(),res:response}}isExpired(accessToken){let now=new Date().getTime();return accessToken.expiry_date?now>=accessToken.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[DEFAULT_OAUTH_SCOPE]}getMetricsHeaderValue(){let nodeVersion=process.version.replace(/^v/,""),saImpersonation=this.serviceAccountImpersonationUrl!==void 0,credentialSourceType=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${nodeVersion} auth/${shared_cjs_1.pkg.version} google-byoid-sdk source/${credentialSourceType} sa-impersonation/${saImpersonation} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};exports.BaseExternalAccountClient=BaseExternalAccountClient}});var require_filesubjecttokensupplier=__commonJS({"node_modules/google-auth-library/build/src/auth/filesubjecttokensupplier.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.FileSubjectTokenSupplier=void 0;var util_1=__require("util"),fs=__require("fs"),readFile=(0,util_1.promisify)(fs.readFile??(()=>{})),realpath=(0,util_1.promisify)(fs.realpath??(()=>{})),lstat=(0,util_1.promisify)(fs.lstat??(()=>{})),FileSubjectTokenSupplier=class{filePath;formatType;subjectTokenFieldName;constructor(opts){this.filePath=opts.filePath,this.formatType=opts.formatType,this.subjectTokenFieldName=opts.subjectTokenFieldName}async getSubjectToken(){let parsedFilePath=this.filePath;try{if(parsedFilePath=await realpath(parsedFilePath),!(await lstat(parsedFilePath)).isFile())throw new Error}catch(err){throw err instanceof Error&&(err.message=`The file at ${parsedFilePath} does not exist, or it is not a file. ${err.message}`),err}let subjectToken,rawText=await readFile(parsedFilePath,{encoding:"utf8"});if(this.formatType==="text"?subjectToken=rawText:this.formatType==="json"&&this.subjectTokenFieldName&&(subjectToken=JSON.parse(rawText)[this.subjectTokenFieldName]),!subjectToken)throw new Error("Unable to parse the subject_token from the credential_source file");return subjectToken}};exports.FileSubjectTokenSupplier=FileSubjectTokenSupplier}});var require_urlsubjecttokensupplier=__commonJS({"node_modules/google-auth-library/build/src/auth/urlsubjecttokensupplier.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.UrlSubjectTokenSupplier=void 0;var authclient_1=require_authclient(),UrlSubjectTokenSupplier=class{url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(opts){this.url=opts.url,this.formatType=opts.formatType,this.subjectTokenFieldName=opts.subjectTokenFieldName,this.headers=opts.headers,this.additionalGaxiosOptions=opts.additionalGaxiosOptions}async getSubjectToken(context){let opts={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers,responseType:this.formatType};authclient_1.AuthClient.setMethodName(opts,"getSubjectToken");let subjectToken;if(this.formatType==="text"?subjectToken=(await context.transporter.request(opts)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(subjectToken=(await context.transporter.request(opts)).data[this.subjectTokenFieldName]),!subjectToken)throw new Error("Unable to parse the subject_token from the credential_source URL");return subjectToken}};exports.UrlSubjectTokenSupplier=UrlSubjectTokenSupplier}});var require_certificatesubjecttokensupplier=__commonJS({"node_modules/google-auth-library/build/src/auth/certificatesubjecttokensupplier.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CertificateSubjectTokenSupplier=exports.InvalidConfigurationError=exports.CertificateSourceUnavailableError=exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var util_1=require_util2(),fs=__require("fs"),crypto_1=__require("crypto"),https=__require("https");exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var CertificateSourceUnavailableError=class extends Error{constructor(message){super(message),this.name="CertificateSourceUnavailableError"}};exports.CertificateSourceUnavailableError=CertificateSourceUnavailableError;var InvalidConfigurationError=class extends Error{constructor(message){super(message),this.name="InvalidConfigurationError"}};exports.InvalidConfigurationError=InvalidConfigurationError;var CertificateSubjectTokenSupplier=class{certificateConfigPath;trustChainPath;cert;key;constructor(opts){if(!opts.useDefaultCertificateConfig&&!opts.certificateConfigLocation)throw new InvalidConfigurationError("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(opts.useDefaultCertificateConfig&&opts.certificateConfigLocation)throw new InvalidConfigurationError("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=opts.trustChainPath,this.certificateConfigPath=opts.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new InvalidConfigurationError("Cannot create mTLS Agent with missing certificate or key");return new https.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#resolveCertificateConfigFilePath();let{certPath,keyPath}=await this.#getCertAndKeyPaths();return{cert:this.cert,key:this.key}=await this.#getKeyAndCert(certPath,keyPath),await this.#processChainFromPaths(this.cert)}async#resolveCertificateConfigFilePath(){let overridePath=this.certificateConfigPath;if(overridePath){if(await(0,util_1.isValidFile)(overridePath))return overridePath;throw new CertificateSourceUnavailableError(`Provided certificate config path is invalid: ${overridePath}`)}let envPath=process.env[exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(envPath){if(await(0,util_1.isValidFile)(envPath))return envPath;throw new CertificateSourceUnavailableError(`Path from environment variable "${exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${envPath}`)}let wellKnownPath=(0,util_1.getWellKnownCertificateConfigFileLocation)();if(await(0,util_1.isValidFile)(wellKnownPath))return wellKnownPath;throw new CertificateSourceUnavailableError(`Could not find certificate configuration file. Searched override path, the "${exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${wellKnownPath}).`)}async#getCertAndKeyPaths(){let configPath=this.certificateConfigPath,fileContents;try{fileContents=await fs.promises.readFile(configPath,"utf8")}catch{throw new CertificateSourceUnavailableError(`Failed to read certificate config file at: ${configPath}`)}try{let config=JSON.parse(fileContents),certPath=config?.cert_configs?.workload?.cert_path,keyPath=config?.cert_configs?.workload?.key_path;if(!certPath||!keyPath)throw new InvalidConfigurationError(`Certificate config file (${configPath}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath,keyPath}}catch(e){throw e instanceof InvalidConfigurationError?e:new InvalidConfigurationError(`Failed to parse certificate config from ${configPath}: ${e.message}`)}}async#getKeyAndCert(certPath,keyPath){let cert,key;try{cert=await fs.promises.readFile(certPath),new crypto_1.X509Certificate(cert)}catch(err){let message=err instanceof Error?err.message:String(err);throw new CertificateSourceUnavailableError(`Failed to read certificate file at ${certPath}: ${message}`)}try{key=await fs.promises.readFile(keyPath),(0,crypto_1.createPrivateKey)(key)}catch(err){let message=err instanceof Error?err.message:String(err);throw new CertificateSourceUnavailableError(`Failed to read private key file at ${keyPath}: ${message}`)}return{cert,key}}async#processChainFromPaths(leafCertBuffer){let leafCert=new crypto_1.X509Certificate(leafCertBuffer);if(!this.trustChainPath)return JSON.stringify([leafCert.raw.toString("base64")]);try{let chainCerts=((await fs.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((pem,index)=>{try{return new crypto_1.X509Certificate(pem)}catch(err){let message=err instanceof Error?err.message:String(err);throw new InvalidConfigurationError(`Failed to parse certificate at index ${index} in trust chain file ${this.trustChainPath}: ${message}`)}}),leafIndex=chainCerts.findIndex(chainCert=>leafCert.raw.equals(chainCert.raw)),finalChain;if(leafIndex===-1)finalChain=[leafCert,...chainCerts];else if(leafIndex===0)finalChain=chainCerts;else throw new InvalidConfigurationError(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${leafIndex}).`);return JSON.stringify(finalChain.map(cert=>cert.raw.toString("base64")))}catch(err){if(err instanceof InvalidConfigurationError)throw err;let message=err instanceof Error?err.message:String(err);throw new CertificateSourceUnavailableError(`Failed to process certificate chain from ${this.trustChainPath}: ${message}`)}}};exports.CertificateSubjectTokenSupplier=CertificateSubjectTokenSupplier}});var require_identitypoolclient=__commonJS({"node_modules/google-auth-library/build/src/auth/identitypoolclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.IdentityPoolClient=void 0;var baseexternalclient_1=require_baseexternalclient(),util_1=require_util2(),filesubjecttokensupplier_1=require_filesubjecttokensupplier(),urlsubjecttokensupplier_1=require_urlsubjecttokensupplier(),certificatesubjecttokensupplier_1=require_certificatesubjecttokensupplier(),stscredentials_1=require_stscredentials(),gaxios_1=require_src(),IdentityPoolClient=class _IdentityPoolClient extends baseexternalclient_1.BaseExternalAccountClient{subjectTokenSupplier;constructor(options){super(options);let opts=(0,util_1.originalOrCamelOptions)(options),credentialSource=opts.get("credential_source"),subjectTokenSupplier=opts.get("subject_token_supplier");if(!credentialSource&&!subjectTokenSupplier)throw new Error("A credential source or subject token supplier must be specified.");if(credentialSource&&subjectTokenSupplier)throw new Error("Only one of credential source or subject token supplier can be specified.");if(subjectTokenSupplier)this.subjectTokenSupplier=subjectTokenSupplier,this.credentialSourceType="programmatic";else{let credentialSourceOpts=(0,util_1.originalOrCamelOptions)(credentialSource),formatOpts=(0,util_1.originalOrCamelOptions)(credentialSourceOpts.get("format")),formatType=formatOpts.get("type")||"text",formatSubjectTokenFieldName=formatOpts.get("subject_token_field_name");if(formatType!=="json"&&formatType!=="text")throw new Error(`Invalid credential_source format "${formatType}"`);if(formatType==="json"&&!formatSubjectTokenFieldName)throw new Error("Missing subject_token_field_name for JSON credential_source format");let file=credentialSourceOpts.get("file"),url=credentialSourceOpts.get("url"),certificate=credentialSourceOpts.get("certificate"),headers=credentialSourceOpts.get("headers");if(file&&url||url&&certificate||file&&certificate)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(file)this.credentialSourceType="file",this.subjectTokenSupplier=new filesubjecttokensupplier_1.FileSubjectTokenSupplier({filePath:file,formatType,subjectTokenFieldName:formatSubjectTokenFieldName});else if(url)this.credentialSourceType="url",this.subjectTokenSupplier=new urlsubjecttokensupplier_1.UrlSubjectTokenSupplier({url,formatType,subjectTokenFieldName:formatSubjectTokenFieldName,headers,additionalGaxiosOptions:_IdentityPoolClient.RETRY_CONFIG});else if(certificate){this.credentialSourceType="certificate";let certificateSubjecttokensupplier=new certificatesubjecttokensupplier_1.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:certificate.use_default_certificate_config,certificateConfigLocation:certificate.certificate_config_location,trustChainPath:certificate.trust_chain_path});this.subjectTokenSupplier=certificateSubjecttokensupplier}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let subjectToken=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof certificatesubjecttokensupplier_1.CertificateSubjectTokenSupplier){let mtlsAgent=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new stscredentials_1.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new gaxios_1.Gaxios({agent:mtlsAgent})}),this.transporter=new gaxios_1.Gaxios({...this.transporter.defaults||{},agent:mtlsAgent})}return subjectToken}};exports.IdentityPoolClient=IdentityPoolClient}});var require_awsrequestsigner=__commonJS({"node_modules/google-auth-library/build/src/auth/awsrequestsigner.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.AwsRequestSigner=void 0;var gaxios_1=require_src(),crypto_1=require_crypto3(),AWS_ALGORITHM="AWS4-HMAC-SHA256",AWS_REQUEST_TYPE="aws4_request",AwsRequestSigner=class{getCredentials;region;crypto;constructor(getCredentials,region){this.getCredentials=getCredentials,this.region=region,this.crypto=(0,crypto_1.createCrypto)()}async getRequestOptions(amzOptions){if(!amzOptions.url)throw new RangeError('"url" is required in "amzOptions"');let requestPayloadData=typeof amzOptions.data=="object"?JSON.stringify(amzOptions.data):amzOptions.data,url=amzOptions.url,method=amzOptions.method||"GET",requestPayload=amzOptions.body||requestPayloadData,additionalAmzHeaders=amzOptions.headers,awsSecurityCredentials=await this.getCredentials(),uri=new URL(url);if(typeof requestPayload!="string"&&requestPayload!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${requestPayload}`);let headerMap=await generateAuthenticationHeaderMap({crypto:this.crypto,host:uri.host,canonicalUri:uri.pathname,canonicalQuerystring:uri.search.slice(1),method,region:this.region,securityCredentials:awsSecurityCredentials,requestPayload,additionalAmzHeaders}),headers=gaxios_1.Gaxios.mergeHeaders(headerMap.amzDate?{"x-amz-date":headerMap.amzDate}:{},{authorization:headerMap.authorizationHeader,host:uri.host},additionalAmzHeaders||{});awsSecurityCredentials.token&&gaxios_1.Gaxios.mergeHeaders(headers,{"x-amz-security-token":awsSecurityCredentials.token});let awsSignedReq={url,method,headers};return requestPayload!==void 0&&(awsSignedReq.body=requestPayload),awsSignedReq}};exports.AwsRequestSigner=AwsRequestSigner;async function sign(crypto2,key,msg){return await crypto2.signWithHmacSha256(key,msg)}async function getSigningKey(crypto2,key,dateStamp,region,serviceName){let kDate=await sign(crypto2,`AWS4${key}`,dateStamp),kRegion=await sign(crypto2,kDate,region),kService=await sign(crypto2,kRegion,serviceName);return await sign(crypto2,kService,"aws4_request")}async function generateAuthenticationHeaderMap(options){let additionalAmzHeaders=gaxios_1.Gaxios.mergeHeaders(options.additionalAmzHeaders),requestPayload=options.requestPayload||"",serviceName=options.host.split(".")[0],now=new Date,amzDate=now.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),dateStamp=now.toISOString().replace(/[-]/g,"").replace(/T.*/,"");options.securityCredentials.token&&additionalAmzHeaders.set("x-amz-security-token",options.securityCredentials.token);let amzHeaders=gaxios_1.Gaxios.mergeHeaders({host:options.host},additionalAmzHeaders.has("date")?{}:{"x-amz-date":amzDate},additionalAmzHeaders),canonicalHeaders="",signedHeadersList=[...amzHeaders.keys()].sort();signedHeadersList.forEach(key=>{canonicalHeaders+=`${key}:${amzHeaders.get(key)}
`});let signedHeaders=signedHeadersList.join(";"),payloadHash=await options.crypto.sha256DigestHex(requestPayload),canonicalRequest=`${options.method.toUpperCase()}
${options.canonicalUri}
${options.canonicalQuerystring}
${canonicalHeaders}
${signedHeaders}
${payloadHash}`,credentialScope=`${dateStamp}/${options.region}/${serviceName}/${AWS_REQUEST_TYPE}`,stringToSign=`${AWS_ALGORITHM}
${amzDate}
${credentialScope}
`+await options.crypto.sha256DigestHex(canonicalRequest),signingKey=await getSigningKey(options.crypto,options.securityCredentials.secretAccessKey,dateStamp,options.region,serviceName),signature=await sign(options.crypto,signingKey,stringToSign),authorizationHeader=`${AWS_ALGORITHM} Credential=${options.securityCredentials.accessKeyId}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${(0,crypto_1.fromArrayBufferToHex)(signature)}`;return{amzDate:additionalAmzHeaders.has("date")?void 0:amzDate,authorizationHeader,canonicalQuerystring:options.canonicalQuerystring}}}});var require_defaultawssecuritycredentialssupplier=__commonJS({"node_modules/google-auth-library/build/src/auth/defaultawssecuritycredentialssupplier.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.DefaultAwsSecurityCredentialsSupplier=void 0;var authclient_1=require_authclient(),DefaultAwsSecurityCredentialsSupplier=class{regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(opts){this.regionUrl=opts.regionUrl,this.securityCredentialsUrl=opts.securityCredentialsUrl,this.imdsV2SessionTokenUrl=opts.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=opts.additionalGaxiosOptions}async getAwsRegion(context){if(this.#regionFromEnv)return this.#regionFromEnv;let metadataHeaders=new Headers;if(!this.#regionFromEnv&&this.imdsV2SessionTokenUrl&&metadataHeaders.set("x-aws-ec2-metadata-token",await this.#getImdsV2SessionToken(context.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let opts={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",responseType:"text",headers:metadataHeaders};authclient_1.AuthClient.setMethodName(opts,"getAwsRegion");let response=await context.transporter.request(opts);return response.data.substr(0,response.data.length-1)}async getAwsSecurityCredentials(context){if(this.#securityCredentialsFromEnv)return this.#securityCredentialsFromEnv;let metadataHeaders=new Headers;this.imdsV2SessionTokenUrl&&metadataHeaders.set("x-aws-ec2-metadata-token",await this.#getImdsV2SessionToken(context.transporter));let roleName=await this.#getAwsRoleName(metadataHeaders,context.transporter),awsCreds=await this.#retrieveAwsSecurityCredentials(roleName,metadataHeaders,context.transporter);return{accessKeyId:awsCreds.AccessKeyId,secretAccessKey:awsCreds.SecretAccessKey,token:awsCreds.Token}}async#getImdsV2SessionToken(transporter){let opts={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return authclient_1.AuthClient.setMethodName(opts,"#getImdsV2SessionToken"),(await transporter.request(opts)).data}async#getAwsRoleName(headers,transporter){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let opts={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers};return authclient_1.AuthClient.setMethodName(opts,"#getAwsRoleName"),(await transporter.request(opts)).data}async#retrieveAwsSecurityCredentials(roleName,headers,transporter){let opts={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${roleName}`,headers,responseType:"json"};return authclient_1.AuthClient.setMethodName(opts,"#retrieveAwsSecurityCredentials"),(await transporter.request(opts)).data}get#regionFromEnv(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#securityCredentialsFromEnv(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};exports.DefaultAwsSecurityCredentialsSupplier=DefaultAwsSecurityCredentialsSupplier}});var require_awsclient=__commonJS({"node_modules/google-auth-library/build/src/auth/awsclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.AwsClient=void 0;var awsrequestsigner_1=require_awsrequestsigner(),baseexternalclient_1=require_baseexternalclient(),defaultawssecuritycredentialssupplier_1=require_defaultawssecuritycredentialssupplier(),util_1=require_util2(),gaxios_1=require_src(),AwsClient=class _AwsClient extends baseexternalclient_1.BaseExternalAccountClient{environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(options){super(options);let opts=(0,util_1.originalOrCamelOptions)(options),credentialSource=opts.get("credential_source"),awsSecurityCredentialsSupplier=opts.get("aws_security_credentials_supplier");if(!credentialSource&&!awsSecurityCredentialsSupplier)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(credentialSource&&awsSecurityCredentialsSupplier)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(awsSecurityCredentialsSupplier)this.awsSecurityCredentialsSupplier=awsSecurityCredentialsSupplier,this.regionalCredVerificationUrl=_AwsClient.#DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL,this.credentialSourceType="programmatic";else{let credentialSourceOpts=(0,util_1.originalOrCamelOptions)(credentialSource);this.environmentId=credentialSourceOpts.get("environment_id");let regionUrl=credentialSourceOpts.get("region_url"),securityCredentialsUrl=credentialSourceOpts.get("url"),imdsV2SessionTokenUrl=credentialSourceOpts.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new defaultawssecuritycredentialssupplier_1.DefaultAwsSecurityCredentialsSupplier({regionUrl,securityCredentialsUrl,imdsV2SessionTokenUrl}),this.regionalCredVerificationUrl=credentialSourceOpts.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let match=this.environmentId?.match(/^(aws)(\d+)$/);if(!match||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(match[2],10)!==1)throw new Error(`aws version "${match[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new awsrequestsigner_1.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let options=await this.awsRequestSigner.getRequestOptions({..._AwsClient.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),reformattedHeader=[];return gaxios_1.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},options.headers).forEach((value,key)=>reformattedHeader.push({key,value})),encodeURIComponent(JSON.stringify({url:options.url,method:options.method,headers:reformattedHeader}))}};exports.AwsClient=AwsClient}});var require_executable_response=__commonJS({"node_modules/google-auth-library/build/src/auth/executable-response.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.InvalidSubjectTokenError=exports.InvalidMessageFieldError=exports.InvalidCodeFieldError=exports.InvalidTokenTypeFieldError=exports.InvalidExpirationTimeFieldError=exports.InvalidSuccessFieldError=exports.InvalidVersionFieldError=exports.ExecutableResponseError=exports.ExecutableResponse=void 0;var SAML_SUBJECT_TOKEN_TYPE="urn:ietf:params:oauth:token-type:saml2",OIDC_SUBJECT_TOKEN_TYPE1="urn:ietf:params:oauth:token-type:id_token",OIDC_SUBJECT_TOKEN_TYPE2="urn:ietf:params:oauth:token-type:jwt",ExecutableResponse=class{version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(responseJson){if(!responseJson.version)throw new InvalidVersionFieldError("Executable response must contain a 'version' field.");if(responseJson.success===void 0)throw new InvalidSuccessFieldError("Executable response must contain a 'success' field.");if(this.version=responseJson.version,this.success=responseJson.success,this.success){if(this.expirationTime=responseJson.expiration_time,this.tokenType=responseJson.token_type,this.tokenType!==SAML_SUBJECT_TOKEN_TYPE&&this.tokenType!==OIDC_SUBJECT_TOKEN_TYPE1&&this.tokenType!==OIDC_SUBJECT_TOKEN_TYPE2)throw new InvalidTokenTypeFieldError(`Executable response must contain a 'token_type' field when successful and it must be one of ${OIDC_SUBJECT_TOKEN_TYPE1}, ${OIDC_SUBJECT_TOKEN_TYPE2}, or ${SAML_SUBJECT_TOKEN_TYPE}.`);if(this.tokenType===SAML_SUBJECT_TOKEN_TYPE){if(!responseJson.saml_response)throw new InvalidSubjectTokenError(`Executable response must contain a 'saml_response' field when token_type=${SAML_SUBJECT_TOKEN_TYPE}.`);this.subjectToken=responseJson.saml_response}else{if(!responseJson.id_token)throw new InvalidSubjectTokenError(`Executable response must contain a 'id_token' field when token_type=${OIDC_SUBJECT_TOKEN_TYPE1} or ${OIDC_SUBJECT_TOKEN_TYPE2}.`);this.subjectToken=responseJson.id_token}}else{if(!responseJson.code)throw new InvalidCodeFieldError("Executable response must contain a 'code' field when unsuccessful.");if(!responseJson.message)throw new InvalidMessageFieldError("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=responseJson.code,this.errorMessage=responseJson.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};exports.ExecutableResponse=ExecutableResponse;var ExecutableResponseError=class extends Error{constructor(message){super(message),Object.setPrototypeOf(this,new.target.prototype)}};exports.ExecutableResponseError=ExecutableResponseError;var InvalidVersionFieldError=class extends ExecutableResponseError{};exports.InvalidVersionFieldError=InvalidVersionFieldError;var InvalidSuccessFieldError=class extends ExecutableResponseError{};exports.InvalidSuccessFieldError=InvalidSuccessFieldError;var InvalidExpirationTimeFieldError=class extends ExecutableResponseError{};exports.InvalidExpirationTimeFieldError=InvalidExpirationTimeFieldError;var InvalidTokenTypeFieldError=class extends ExecutableResponseError{};exports.InvalidTokenTypeFieldError=InvalidTokenTypeFieldError;var InvalidCodeFieldError=class extends ExecutableResponseError{};exports.InvalidCodeFieldError=InvalidCodeFieldError;var InvalidMessageFieldError=class extends ExecutableResponseError{};exports.InvalidMessageFieldError=InvalidMessageFieldError;var InvalidSubjectTokenError=class extends ExecutableResponseError{};exports.InvalidSubjectTokenError=InvalidSubjectTokenError}});var require_pluggable_auth_handler=__commonJS({"node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.PluggableAuthHandler=exports.ExecutableError=void 0;var executable_response_1=require_executable_response(),childProcess=__require("child_process"),fs=__require("fs"),ExecutableError=class extends Error{code;constructor(message,code){super(`The executable failed with exit code: ${code} and error message: ${message}.`),this.code=code,Object.setPrototypeOf(this,new.target.prototype)}};exports.ExecutableError=ExecutableError;var PluggableAuthHandler=class _PluggableAuthHandler{commandComponents;timeoutMillis;outputFile;constructor(options){if(!options.command)throw new Error("No command provided.");if(this.commandComponents=_PluggableAuthHandler.parseCommand(options.command),this.timeoutMillis=options.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=options.outputFile}retrieveResponseFromExecutable(envMap){return new Promise((resolve,reject)=>{let child=childProcess.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(envMap)}}),output="";child.stdout.on("data",data=>{output+=data}),child.stderr.on("data",err=>{output+=err});let timeout=setTimeout(()=>(child.removeAllListeners(),child.kill(),reject(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);child.on("close",code=>{if(clearTimeout(timeout),code===0)try{let responseJson=JSON.parse(output),response=new executable_response_1.ExecutableResponse(responseJson);return resolve(response)}catch(error){return error instanceof executable_response_1.ExecutableResponseError?reject(error):reject(new executable_response_1.ExecutableResponseError(`The executable returned an invalid response: ${output}`))}else return reject(new ExecutableError(output,code.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let filePath;try{filePath=await fs.promises.realpath(this.outputFile)}catch{return}if(!(await fs.promises.lstat(filePath)).isFile())return;let responseString=await fs.promises.readFile(filePath,{encoding:"utf8"});if(responseString!=="")try{let responseJson=JSON.parse(responseString);return new executable_response_1.ExecutableResponse(responseJson).isValid()?new executable_response_1.ExecutableResponse(responseJson):void 0}catch(error){throw error instanceof executable_response_1.ExecutableResponseError?error:new executable_response_1.ExecutableResponseError(`The output file contained an invalid response: ${responseString}`)}}static parseCommand(command){let components=command.match(/(?:[^\s"]+|"[^"]*")+/g);if(!components)throw new Error(`Provided command: "${command}" could not be parsed.`);for(let i=0;i<components.length;i++)components[i][0]==='"'&&components[i].slice(-1)==='"'&&(components[i]=components[i].slice(1,-1));return components}};exports.PluggableAuthHandler=PluggableAuthHandler}});var require_pluggable_auth_client=__commonJS({"node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.PluggableAuthClient=exports.ExecutableError=void 0;var baseexternalclient_1=require_baseexternalclient(),executable_response_1=require_executable_response(),pluggable_auth_handler_1=require_pluggable_auth_handler(),pluggable_auth_handler_2=require_pluggable_auth_handler();Object.defineProperty(exports,"ExecutableError",{enumerable:!0,get:function(){return pluggable_auth_handler_2.ExecutableError}});var DEFAULT_EXECUTABLE_TIMEOUT_MILLIS=30*1e3,MINIMUM_EXECUTABLE_TIMEOUT_MILLIS=5*1e3,MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS=120*1e3,GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",MAXIMUM_EXECUTABLE_VERSION=1,PluggableAuthClient=class extends baseexternalclient_1.BaseExternalAccountClient{command;timeoutMillis;outputFile;handler;constructor(options){if(super(options),!options.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=options.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(options.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=DEFAULT_EXECUTABLE_TIMEOUT_MILLIS;else if(this.timeoutMillis=options.credential_source.executable.timeout_millis,this.timeoutMillis<MINIMUM_EXECUTABLE_TIMEOUT_MILLIS||this.timeoutMillis>MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS)throw new Error(`Timeout must be between ${MINIMUM_EXECUTABLE_TIMEOUT_MILLIS} and ${MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS} milliseconds.`);this.outputFile=options.credential_source.executable.output_file,this.handler=new pluggable_auth_handler_1.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let executableResponse;if(this.outputFile&&(executableResponse=await this.handler.retrieveCachedResponse()),!executableResponse){let envMap=new Map;envMap.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),envMap.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),envMap.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&envMap.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let serviceAccountEmail=this.getServiceAccountEmail();serviceAccountEmail&&envMap.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",serviceAccountEmail),executableResponse=await this.handler.retrieveResponseFromExecutable(envMap)}if(executableResponse.version>MAXIMUM_EXECUTABLE_VERSION)throw new Error(`Version of executable is not currently supported, maximum supported version is ${MAXIMUM_EXECUTABLE_VERSION}.`);if(!executableResponse.success)throw new pluggable_auth_handler_1.ExecutableError(executableResponse.errorMessage,executableResponse.errorCode);if(this.outputFile&&!executableResponse.expirationTime)throw new executable_response_1.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(executableResponse.isExpired())throw new Error("Executable response is expired.");return executableResponse.subjectToken}};exports.PluggableAuthClient=PluggableAuthClient}});var require_externalclient=__commonJS({"node_modules/google-auth-library/build/src/auth/externalclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.ExternalAccountClient=void 0;var baseexternalclient_1=require_baseexternalclient(),identitypoolclient_1=require_identitypoolclient(),awsclient_1=require_awsclient(),pluggable_auth_client_1=require_pluggable_auth_client(),ExternalAccountClient=class{constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(options){return options&&options.type===baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE?options.credential_source?.environment_id?new awsclient_1.AwsClient(options):options.credential_source?.executable?new pluggable_auth_client_1.PluggableAuthClient(options):new identitypoolclient_1.IdentityPoolClient(options):null}};exports.ExternalAccountClient=ExternalAccountClient}});var require_externalAccountAuthorizedUserClient=__commonJS({"node_modules/google-auth-library/build/src/auth/externalAccountAuthorizedUserClient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.ExternalAccountAuthorizedUserClient=exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var authclient_1=require_authclient(),oauth2common_1=require_oauth2common(),gaxios_1=require_src(),stream=__require("stream"),baseexternalclient_1=require_baseexternalclient();exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var DEFAULT_TOKEN_URL="https://sts.{universeDomain}/v1/oauthtoken",ExternalAccountAuthorizedUserHandler=class _ExternalAccountAuthorizedUserHandler extends oauth2common_1.OAuthClientAuthHandler{#tokenRefreshEndpoint;constructor(options){super(options),this.#tokenRefreshEndpoint=options.tokenRefreshEndpoint}async refreshToken(refreshToken,headers){let opts={..._ExternalAccountAuthorizedUserHandler.RETRY_CONFIG,url:this.#tokenRefreshEndpoint,method:"POST",headers,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:refreshToken}),responseType:"json"};authclient_1.AuthClient.setMethodName(opts,"refreshToken"),this.applyClientAuthenticationOptions(opts);try{let response=await this.transporter.request(opts),tokenRefreshResponse=response.data;return tokenRefreshResponse.res=response,tokenRefreshResponse}catch(error){throw error instanceof gaxios_1.GaxiosError&&error.response?(0,oauth2common_1.getErrorFromOAuthErrorResponse)(error.response.data,error):error}}},ExternalAccountAuthorizedUserClient=class extends authclient_1.AuthClient{cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(options){super(options),options.universe_domain&&(this.universeDomain=options.universe_domain),this.refreshToken=options.refresh_token;let clientAuthentication={confidentialClientType:"basic",clientId:options.client_id,clientSecret:options.client_secret};this.externalAccountAuthorizedUserHandler=new ExternalAccountAuthorizedUserHandler({tokenRefreshEndpoint:options.token_url??DEFAULT_TOKEN_URL.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication}),this.cachedAccessToken=null,this.quotaProjectId=options.quota_project_id,typeof options?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=baseexternalclient_1.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=options.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!options?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let accessTokenResponse=await this.getAccessToken(),headers=new Headers({authorization:`Bearer ${accessTokenResponse.token}`});return this.addSharedMetadataHeaders(headers)}request(opts,callback){if(callback)this.requestAsync(opts).then(r=>callback(null,r),e=>callback(e,e.response));else return this.requestAsync(opts)}async requestAsync(opts,reAuthRetried=!1){let response;try{let requestHeaders=await this.getRequestHeaders();opts.headers=gaxios_1.Gaxios.mergeHeaders(opts.headers),this.addUserProjectAndAuthHeaders(opts.headers,requestHeaders),response=await this.transporter.request(opts)}catch(e){let res=e.response;if(res){let statusCode=res.status,isReadableStream=res.config.data instanceof stream.Readable;if(!reAuthRetried&&(statusCode===401||statusCode===403)&&!isReadableStream&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(opts,!0)}throw e}return response}async refreshAccessTokenAsync(){let refreshResponse=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:refreshResponse.access_token,expiry_date:new Date().getTime()+refreshResponse.expires_in*1e3,res:refreshResponse.res},refreshResponse.refresh_token!==void 0&&(this.refreshToken=refreshResponse.refresh_token),this.cachedAccessToken}isExpired(credentials){let now=new Date().getTime();return credentials.expiry_date?now>=credentials.expiry_date-this.eagerRefreshThresholdMillis:!1}};exports.ExternalAccountAuthorizedUserClient=ExternalAccountAuthorizedUserClient}});var require_googleauth=__commonJS({"node_modules/google-auth-library/build/src/auth/googleauth.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.GoogleAuth=exports.GoogleAuthExceptionMessages=void 0;var child_process_1=__require("child_process"),fs=__require("fs"),gaxios_1=require_src(),gcpMetadata=require_src3(),os=__require("os"),path=__require("path"),crypto_1=require_crypto3(),computeclient_1=require_computeclient(),idtokenclient_1=require_idtokenclient(),envDetect_1=require_envDetect(),jwtclient_1=require_jwtclient(),refreshclient_1=require_refreshclient(),impersonated_1=require_impersonated(),externalclient_1=require_externalclient(),baseexternalclient_1=require_baseexternalclient(),authclient_1=require_authclient(),externalAccountAuthorizedUserClient_1=require_externalAccountAuthorizedUserClient(),util_1=require_util2();exports.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment. 
To learn more about authentication and Google APIs, visit: 
https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment. 
To learn more about authentication and Google APIs, visit: 
https://cloud.google.com/docs/authentication/getting-started`,NO_ADC_FOUND:"Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.",NO_UNIVERSE_DOMAIN_FOUND:`Unable to detect a Universe Domain in the current environment.
To learn more about Universe Domain retrieval, visit: 
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var GoogleAuth=class{checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#pendingAuthClient=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(opts={}){if(this._cachedProjectId=opts.projectId||null,this.cachedCredential=opts.authClient||null,this.keyFilename=opts.keyFilename||opts.keyFile,this.scopes=opts.scopes,this.clientOptions=opts.clientOptions||{},this.jsonContent=opts.credentials||null,this.apiKey=opts.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(exports.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);opts.universeDomain&&(this.clientOptions.universeDomain=opts.universeDomain)}setGapicJWTValues(client){client.defaultServicePath=this.defaultServicePath,client.useJWTAccessWithScope=this.useJWTAccessWithScope,client.defaultScopes=this.defaultScopes}getProjectId(callback){if(callback)this.getProjectIdAsync().then(r=>callback(null,r),callback);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let projectId=null;if(projectId||=await this.getProductionProjectId(),projectId||=await this.getFileProjectId(),projectId||=await this.getDefaultServiceProjectId(),projectId||=await this.getGCEProjectId(),projectId||=await this.getExternalAccountClientProjectId(),projectId)return this._cachedProjectId=projectId,projectId;throw new Error(exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let universeDomain;try{universeDomain=await gcpMetadata.universe("universe-domain"),universeDomain||=authclient_1.DEFAULT_UNIVERSE}catch(e){if(e&&e?.response?.status===404)universeDomain=authclient_1.DEFAULT_UNIVERSE;else throw e}return universeDomain}async getUniverseDomain(){let universeDomain=(0,util_1.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{universeDomain??=(await this.getClient()).universeDomain}catch{universeDomain??=authclient_1.DEFAULT_UNIVERSE}return universeDomain}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(optionsOrCallback={},callback){let options;if(typeof optionsOrCallback=="function"?callback=optionsOrCallback:options=optionsOrCallback,callback)this.getApplicationDefaultAsync(options).then(r=>callback(null,r.credential,r.projectId),callback);else return this.getApplicationDefaultAsync(options)}async getApplicationDefaultAsync(options={}){if(this.cachedCredential)return await this.#prepareAndCacheClient(this.cachedCredential,null);let credential;if(credential=await this._tryGetApplicationCredentialsFromEnvironmentVariable(options),credential)return credential instanceof jwtclient_1.JWT?credential.scopes=this.scopes:credential instanceof baseexternalclient_1.BaseExternalAccountClient&&(credential.scopes=this.getAnyScopes()),await this.#prepareAndCacheClient(credential);if(credential=await this._tryGetApplicationCredentialsFromWellKnownFile(options),credential)return credential instanceof jwtclient_1.JWT?credential.scopes=this.scopes:credential instanceof baseexternalclient_1.BaseExternalAccountClient&&(credential.scopes=this.getAnyScopes()),await this.#prepareAndCacheClient(credential);if(await this._checkIsGCE())return options.scopes=this.getAnyScopes(),await this.#prepareAndCacheClient(new computeclient_1.Compute(options));throw new Error(exports.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#prepareAndCacheClient(credential,quotaProjectIdOverride=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let projectId=await this.getProjectIdOptional();return quotaProjectIdOverride&&(credential.quotaProjectId=quotaProjectIdOverride),this.cachedCredential=credential,{credential,projectId}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=gcpMetadata.getGCPResidency()||await gcpMetadata.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(options){let credentialsPath=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!credentialsPath||credentialsPath.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(credentialsPath,options)}catch(e){throw e instanceof Error&&(e.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`),e}}async _tryGetApplicationCredentialsFromWellKnownFile(options){let location=null;if(this._isWindows())location=process.env.APPDATA;else{let home=process.env.HOME;home&&(location=path.join(home,".config"))}return location&&(location=path.join(location,"gcloud","application_default_credentials.json"),fs.existsSync(location)||(location=null)),location?await this._getApplicationCredentialsFromFilePath(location,options):null}async _getApplicationCredentialsFromFilePath(filePath,options={}){if(!filePath||filePath.length===0)throw new Error("The file path is invalid.");try{if(filePath=fs.realpathSync(filePath),!fs.lstatSync(filePath).isFile())throw new Error}catch(err){throw err instanceof Error&&(err.message=`The file at ${filePath} does not exist, or it is not a file. ${err.message}`),err}let readStream=fs.createReadStream(filePath);return this.fromStream(readStream,options)}fromImpersonatedJSON(json){if(!json)throw new Error("Must pass in a JSON object containing an  impersonated refresh token");if(json.type!==impersonated_1.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${impersonated_1.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!json.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!json.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let sourceClient=this.fromJSON(json.source_credentials);if(json.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${json.service_account_impersonation_url}`);let targetPrincipal=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(json.service_account_impersonation_url)?.groups?.target;if(!targetPrincipal)throw new RangeError(`Cannot extract target principal from ${json.service_account_impersonation_url}`);let targetScopes=(this.scopes||json.scopes||this.defaultScopes)??[];return new impersonated_1.Impersonated({...json,sourceClient,targetPrincipal,targetScopes:Array.isArray(targetScopes)?targetScopes:[targetScopes]})}fromJSON(json,options={}){let client,preferredUniverseDomain=(0,util_1.originalOrCamelOptions)(options).get("universe_domain");return json.type===refreshclient_1.USER_REFRESH_ACCOUNT_TYPE?(client=new refreshclient_1.UserRefreshClient(options),client.fromJSON(json)):json.type===impersonated_1.IMPERSONATED_ACCOUNT_TYPE?client=this.fromImpersonatedJSON(json):json.type===baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE?(client=externalclient_1.ExternalAccountClient.fromJSON({...json,...options}),client.scopes=this.getAnyScopes()):json.type===externalAccountAuthorizedUserClient_1.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?client=new externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient({...json,...options}):(options.scopes=this.scopes,client=new jwtclient_1.JWT(options),this.setGapicJWTValues(client),client.fromJSON(json)),preferredUniverseDomain&&(client.universeDomain=preferredUniverseDomain),client}_cacheClientFromJSON(json,options){let client=this.fromJSON(json,options);return this.jsonContent=json,this.cachedCredential=client,client}fromStream(inputStream,optionsOrCallback={},callback){let options={};if(typeof optionsOrCallback=="function"?callback=optionsOrCallback:options=optionsOrCallback,callback)this.fromStreamAsync(inputStream,options).then(r=>callback(null,r),callback);else return this.fromStreamAsync(inputStream,options)}fromStreamAsync(inputStream,options){return new Promise((resolve,reject)=>{if(!inputStream)throw new Error("Must pass in a stream containing the Google auth settings.");let chunks=[];inputStream.setEncoding("utf8").on("error",reject).on("data",chunk=>chunks.push(chunk)).on("end",()=>{try{try{let data=JSON.parse(chunks.join("")),r=this._cacheClientFromJSON(data,options);return resolve(r)}catch(err){if(!this.keyFilename)throw err;let client=new jwtclient_1.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=client,this.setGapicJWTValues(client),resolve(client)}}catch(err){return reject(err)}})})}fromAPIKey(apiKey,options={}){return new jwtclient_1.JWT({...options,apiKey})}_isWindows(){let sys=os.platform();return!!(sys&&sys.length>=3&&sys.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(resolve=>{(0,child_process_1.exec)("gcloud config config-helper --format json",(err,stdout)=>{if(!err&&stdout)try{let projectId=JSON.parse(stdout).configuration.properties.core.project;resolve(projectId);return}catch{}resolve(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let creds=await this.getClient();if(creds&&creds.projectId)return creds.projectId}let r=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return r?r.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await gcpMetadata.project("project-id")}catch{return null}}getCredentials(callback){if(callback)this.getCredentialsAsync().then(r=>callback(null,r),callback);else return this.getCredentialsAsync()}async getCredentialsAsync(){let client=await this.getClient();if(client instanceof impersonated_1.Impersonated)return{client_email:client.getTargetPrincipal()};if(client instanceof baseexternalclient_1.BaseExternalAccountClient){let serviceAccountEmail=client.getServiceAccountEmail();if(serviceAccountEmail)return{client_email:serviceAccountEmail,universe_domain:client.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[client_email,universe_domain]=await Promise.all([gcpMetadata.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email,universe_domain}}throw new Error(exports.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#pendingAuthClient=this.#pendingAuthClient||this.#determineClient();try{return await this.#pendingAuthClient}finally{this.#pendingAuthClient=null}}async#determineClient(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let filePath=path.resolve(this.keyFilename),stream=fs.createReadStream(filePath);return await this.fromStreamAsync(stream,this.clientOptions)}else if(this.apiKey){let client=await this.fromAPIKey(this.apiKey,this.clientOptions);client.scopes=this.scopes;let{credential}=await this.#prepareAndCacheClient(client);return credential}else{let{credential}=await this.getApplicationDefaultAsync(this.clientOptions);return credential}}async getIdTokenClient(targetAudience){let client=await this.getClient();if(!("fetchIdToken"in client))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new idtokenclient_1.IdTokenClient({targetAudience,idTokenProvider:client})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(url){return(await this.getClient()).getRequestHeaders(url)}async authorizeRequest(opts={}){let url=opts.url,headers=await(await this.getClient()).getRequestHeaders(url);return opts.headers=gaxios_1.Gaxios.mergeHeaders(opts.headers,headers),opts}async fetch(...args){return(await this.getClient()).fetch(...args)}async request(opts){return(await this.getClient()).request(opts)}getEnv(){return(0,envDetect_1.getEnv)()}async sign(data,endpoint){let client=await this.getClient(),universe=await this.getUniverseDomain();if(endpoint=endpoint||`https://iamcredentials.${universe}/v1/projects/-/serviceAccounts/`,client instanceof impersonated_1.Impersonated)return(await client.sign(data)).signedBlob;let crypto2=(0,crypto_1.createCrypto)();if(client instanceof jwtclient_1.JWT&&client.key)return await crypto2.sign(client.key,data);let creds=await this.getCredentials();if(!creds.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(crypto2,creds.client_email,data,endpoint)}async signBlob(crypto2,emailOrUniqueId,data,endpoint){let url=new URL(endpoint+`${emailOrUniqueId}:signBlob`);return(await this.request({method:"POST",url:url.href,data:{payload:crypto2.encodeBase64StringUtf8(data)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};exports.GoogleAuth=GoogleAuth}});var require_iam=__commonJS({"node_modules/google-auth-library/build/src/auth/iam.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.IAMAuth=void 0;var IAMAuth=class{selector;token;constructor(selector,token){this.selector=selector,this.token=token,this.selector=selector,this.token=token}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};exports.IAMAuth=IAMAuth}});var require_downscopedclient=__commonJS({"node_modules/google-auth-library/build/src/auth/downscopedclient.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.DownscopedClient=exports.EXPIRATION_TIME_OFFSET=exports.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var gaxios_1=require_src(),stream=__require("stream"),authclient_1=require_authclient(),sts=require_stscredentials(),STS_GRANT_TYPE="urn:ietf:params:oauth:grant-type:token-exchange",STS_REQUEST_TOKEN_TYPE="urn:ietf:params:oauth:token-type:access_token",STS_SUBJECT_TOKEN_TYPE="urn:ietf:params:oauth:token-type:access_token";exports.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;exports.EXPIRATION_TIME_OFFSET=300*1e3;var DownscopedClient=class extends authclient_1.AuthClient{authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(options,credentialAccessBoundary={accessBoundary:{accessBoundaryRules:[]}}){if(super(options instanceof authclient_1.AuthClient?{}:options),options instanceof authclient_1.AuthClient?(this.authClient=options,this.credentialAccessBoundary=credentialAccessBoundary):(this.authClient=options.authClient,this.credentialAccessBoundary=options.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>exports.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${exports.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let rule of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(rule.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new sts.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(credentials){if(!credentials.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(credentials),this.cachedDownscopedAccessToken=credentials}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let accessTokenResponse=await this.getAccessToken(),headers=new Headers({authorization:`Bearer ${accessTokenResponse.token}`});return this.addSharedMetadataHeaders(headers)}request(opts,callback){if(callback)this.requestAsync(opts).then(r=>callback(null,r),e=>callback(e,e.response));else return this.requestAsync(opts)}async requestAsync(opts,reAuthRetried=!1){let response;try{let requestHeaders=await this.getRequestHeaders();opts.headers=gaxios_1.Gaxios.mergeHeaders(opts.headers),this.addUserProjectAndAuthHeaders(opts.headers,requestHeaders),response=await this.transporter.request(opts)}catch(e){let res=e.response;if(res){let statusCode=res.status,isReadableStream=res.config.data instanceof stream.Readable;if(!reAuthRetried&&(statusCode===401||statusCode===403)&&!isReadableStream&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(opts,!0)}throw e}return response}async refreshAccessTokenAsync(){let subjectToken=(await this.authClient.getAccessToken()).token,stsCredentialsOptions={grantType:STS_GRANT_TYPE,requestedTokenType:STS_REQUEST_TOKEN_TYPE,subjectToken,subjectTokenType:STS_SUBJECT_TOKEN_TYPE},stsResponse=await this.stsCredential.exchangeToken(stsCredentialsOptions,void 0,this.credentialAccessBoundary),sourceCredExpireDate=this.authClient.credentials?.expiry_date||null,expiryDate=stsResponse.expires_in?new Date().getTime()+stsResponse.expires_in*1e3:sourceCredExpireDate;return this.cachedDownscopedAccessToken={access_token:stsResponse.access_token,expiry_date:expiryDate,res:stsResponse.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(downscopedAccessToken){let now=new Date().getTime();return downscopedAccessToken.expiry_date?now>=downscopedAccessToken.expiry_date-this.eagerRefreshThresholdMillis:!1}};exports.DownscopedClient=DownscopedClient}});var require_passthrough=__commonJS({"node_modules/google-auth-library/build/src/auth/passthrough.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.PassThroughClient=void 0;var authclient_1=require_authclient(),PassThroughClient=class extends authclient_1.AuthClient{async request(opts){return this.transporter.request(opts)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};exports.PassThroughClient=PassThroughClient}});var require_src4=__commonJS({"node_modules/google-auth-library/build/src/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.GoogleAuth=exports.auth=exports.PassThroughClient=exports.ExternalAccountAuthorizedUserClient=exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=exports.ExecutableError=exports.PluggableAuthClient=exports.DownscopedClient=exports.BaseExternalAccountClient=exports.ExternalAccountClient=exports.IdentityPoolClient=exports.AwsRequestSigner=exports.AwsClient=exports.UserRefreshClient=exports.LoginTicket=exports.ClientAuthentication=exports.OAuth2Client=exports.CodeChallengeMethod=exports.Impersonated=exports.JWT=exports.JWTAccess=exports.IdTokenClient=exports.IAMAuth=exports.GCPEnv=exports.Compute=exports.DEFAULT_UNIVERSE=exports.AuthClient=exports.gaxios=exports.gcpMetadata=void 0;var googleauth_1=require_googleauth();Object.defineProperty(exports,"GoogleAuth",{enumerable:!0,get:function(){return googleauth_1.GoogleAuth}});exports.gcpMetadata=require_src3();exports.gaxios=require_src();var authclient_1=require_authclient();Object.defineProperty(exports,"AuthClient",{enumerable:!0,get:function(){return authclient_1.AuthClient}});Object.defineProperty(exports,"DEFAULT_UNIVERSE",{enumerable:!0,get:function(){return authclient_1.DEFAULT_UNIVERSE}});var computeclient_1=require_computeclient();Object.defineProperty(exports,"Compute",{enumerable:!0,get:function(){return computeclient_1.Compute}});var envDetect_1=require_envDetect();Object.defineProperty(exports,"GCPEnv",{enumerable:!0,get:function(){return envDetect_1.GCPEnv}});var iam_1=require_iam();Object.defineProperty(exports,"IAMAuth",{enumerable:!0,get:function(){return iam_1.IAMAuth}});var idtokenclient_1=require_idtokenclient();Object.defineProperty(exports,"IdTokenClient",{enumerable:!0,get:function(){return idtokenclient_1.IdTokenClient}});var jwtaccess_1=require_jwtaccess();Object.defineProperty(exports,"JWTAccess",{enumerable:!0,get:function(){return jwtaccess_1.JWTAccess}});var jwtclient_1=require_jwtclient();Object.defineProperty(exports,"JWT",{enumerable:!0,get:function(){return jwtclient_1.JWT}});var impersonated_1=require_impersonated();Object.defineProperty(exports,"Impersonated",{enumerable:!0,get:function(){return impersonated_1.Impersonated}});var oauth2client_1=require_oauth2client();Object.defineProperty(exports,"CodeChallengeMethod",{enumerable:!0,get:function(){return oauth2client_1.CodeChallengeMethod}});Object.defineProperty(exports,"OAuth2Client",{enumerable:!0,get:function(){return oauth2client_1.OAuth2Client}});Object.defineProperty(exports,"ClientAuthentication",{enumerable:!0,get:function(){return oauth2client_1.ClientAuthentication}});var loginticket_1=require_loginticket();Object.defineProperty(exports,"LoginTicket",{enumerable:!0,get:function(){return loginticket_1.LoginTicket}});var refreshclient_1=require_refreshclient();Object.defineProperty(exports,"UserRefreshClient",{enumerable:!0,get:function(){return refreshclient_1.UserRefreshClient}});var awsclient_1=require_awsclient();Object.defineProperty(exports,"AwsClient",{enumerable:!0,get:function(){return awsclient_1.AwsClient}});var awsrequestsigner_1=require_awsrequestsigner();Object.defineProperty(exports,"AwsRequestSigner",{enumerable:!0,get:function(){return awsrequestsigner_1.AwsRequestSigner}});var identitypoolclient_1=require_identitypoolclient();Object.defineProperty(exports,"IdentityPoolClient",{enumerable:!0,get:function(){return identitypoolclient_1.IdentityPoolClient}});var externalclient_1=require_externalclient();Object.defineProperty(exports,"ExternalAccountClient",{enumerable:!0,get:function(){return externalclient_1.ExternalAccountClient}});var baseexternalclient_1=require_baseexternalclient();Object.defineProperty(exports,"BaseExternalAccountClient",{enumerable:!0,get:function(){return baseexternalclient_1.BaseExternalAccountClient}});var downscopedclient_1=require_downscopedclient();Object.defineProperty(exports,"DownscopedClient",{enumerable:!0,get:function(){return downscopedclient_1.DownscopedClient}});var pluggable_auth_client_1=require_pluggable_auth_client();Object.defineProperty(exports,"PluggableAuthClient",{enumerable:!0,get:function(){return pluggable_auth_client_1.PluggableAuthClient}});Object.defineProperty(exports,"ExecutableError",{enumerable:!0,get:function(){return pluggable_auth_client_1.ExecutableError}});var externalAccountAuthorizedUserClient_1=require_externalAccountAuthorizedUserClient();Object.defineProperty(exports,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:function(){return externalAccountAuthorizedUserClient_1.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE}});Object.defineProperty(exports,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:function(){return externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient}});var passthrough_1=require_passthrough();Object.defineProperty(exports,"PassThroughClient",{enumerable:!0,get:function(){return passthrough_1.PassThroughClient}});__exportStar(require_googleToken(),exports);var auth=new googleauth_1.GoogleAuth;exports.auth=auth}});export{require_src4 as require_src};