@zuplo/core 5.1828.0 → 5.1830.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -392,7 +392,7 @@ ${m}
392
392
  Content-Type: ${i["Content-Type"]}\r
393
393
  \r
394
394
  `;n.write(s);if(typeof i.body==="string"){n.write(i.body);n.write("\r\n")}else{i.body.pipe(n,{end:false});i.body.on("end",()=>{n.write("\r\n");n.write(r);n.end()})}}return n}o(Ovt,"createMultipartStream");function Xi(t,e){const{uri:r,options:n}=Rvt(t);const i=t.multipart;if(t.multipart&&i.length===2){if(!e){throw new Error("Multipart without callback is not implemented.")}const s=Avt.v4();n.headers["Content-Type"]=`multipart/related; boundary=${s}`;n.body=Ovt(s,i);Xi.stats.requestStarting();(0,DF.default)(r,n).then(a=>{Xi.stats.requestFinished();const u=a.headers.get("content-type");const l=tT(n,a);const c=l.body;if(u==="application/json"||u==="application/json; charset=utf-8"){a.json().then(d=>{l.body=d;e(null,l,d)},d=>{e(d,l,c)});return}a.text().then(d=>{l.body=d;e(null,l,d)},d=>{e(d,l,c)})},a=>{Xi.stats.requestFinished();e(a,null,null)});return}if(e===void 0){const s=Cvt(new rT.PassThrough);let a;s.once("reading",()=>{if(a){(0,rT.pipeline)(a,s,()=>{})}else{s.once("response",()=>{(0,rT.pipeline)(a,s,()=>{})})}});n.compress=false;Xi.stats.requestStarting();(0,DF.default)(r,n).then(u=>{Xi.stats.requestFinished();a=u.body;a.on("error",c=>{s.emit("error",c)});const l=tT(n,u);s.emit("response",l)},u=>{Xi.stats.requestFinished();s.emit("error",u)});return s}Xi.stats.requestStarting();(0,DF.default)(r,n).then(s=>{Xi.stats.requestFinished();const a=s.headers.get("content-type");const u=tT(n,s);const l=u.body;if(a==="application/json"||a==="application/json; charset=utf-8"){if(u.statusCode===204){e(null,u,l);return}s.json().then(c=>{u.body=c;e(null,u,c)},c=>{e(c,u,l)});return}s.text().then(c=>{const d=tT(n,s);d.body=c;e(null,d,c)},c=>{e(c,u,l)})},s=>{Xi.stats.requestFinished();e(s,null,null)});return}o(Xi,"teenyRequest");Eg.teenyRequest=Xi;Xi.defaults=t=>{return(e,r)=>{const n={...t,...e};if(r===void 0){return Xi(n)}Xi(n,r)}};Xi.stats=new T_e.TeenyStatistics;Xi.resetStats=()=>{Xi.stats=new T_e.TeenyStatistics(Xi.stats.getOptions())}});var x_e=_((ear,Nvt)=>{Nvt.exports={name:"@google-cloud/storage",description:"Cloud Storage Client Library for Node.js",version:"7.5.0",license:"Apache-2.0",author:"Google Inc.",engines:{node:">=14"},repository:"googleapis/nodejs-storage",main:"./build/cjs/src/index.js",types:"./build/cjs/src/index.d.ts",type:"module",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"}}},files:["build/cjs/src","build/cjs/package.json","!build/cjs/src/**/*.map","build/esm/src","!build/esm/src/**/*.map"],keywords:["google apis client","google api client","google apis","google api","google","google cloud platform","google cloud","cloud","google storage","storage"],scripts:{"all-test":"npm test && npm run system-test && npm run samples-test",benchwrapper:"node bin/benchwrapper.js",check:"gts check",clean:"rm -rf build/","compile:cjs":"tsc -p ./tsconfig.cjs.json","compile:esm":"tsc -p .",compile:"npm run compile:cjs && npm run compile:esm","conformance-test":"mocha --parallel build/cjs/conformance-test/ --require build/cjs/conformance-test/globalHooks.js","docs-test":"linkinator docs",docs:"jsdoc -c .jsdoc.json",fix:"gts fix",lint:"gts check",postcompile:"cp ./src/package-json-helper.cjs ./build/cjs/src && cp ./src/package-json-helper.cjs ./build/esm/src","postcompile:cjs":"babel --plugins gapic-tools/build/src/replaceImportMetaUrl,gapic-tools/build/src/toggleESMFlagVariable build/cjs/src/util.js -o build/cjs/src/util.js && cp internal-tooling/helpers/package.cjs.json build/cjs/package.json",precompile:"rm -rf build/","preconformance-test":"npm run compile:cjs -- --sourceMap","predocs-test":"npm run docs",predocs:"npm run compile:cjs -- --sourceMap",prelint:"cd samples; npm link ../; npm install",prepare:"npm run compile","presystem-test:esm":"npm run compile:esm","presystem-test":"npm run compile -- --sourceMap",pretest:"npm run compile -- --sourceMap","samples-test":"npm link && cd samples/ && npm link ../ && npm test && cd ../","system-test:esm":"mocha build/esm/system-test --timeout 600000 --exit","system-test":"mocha build/cjs/system-test --timeout 600000 --exit",test:"c8 mocha build/cjs/test"},dependencies:{"@google-cloud/paginator":"^5.0.0","@google-cloud/projectify":"^4.0.0","@google-cloud/promisify":"^4.0.0","abort-controller":"^3.0.0","async-retry":"^1.3.3",compressible:"^2.0.12",duplexify:"^4.0.0",ent:"^2.2.0","fast-xml-parser":"^4.3.0",gaxios:"^6.0.2","google-auth-library":"^9.0.0",mime:"^3.0.0","mime-types":"^2.0.8","p-limit":"^3.0.1","retry-request":"^7.0.0","teeny-request":"^9.0.0",uuid:"^8.0.0"},devDependencies:{"@babel/cli":"^7.22.10","@babel/core":"^7.22.11","@google-cloud/pubsub":"^4.0.0","@grpc/grpc-js":"^1.0.3","@grpc/proto-loader":"^0.7.0","@types/async-retry":"^1.4.3","@types/compressible":"^2.0.0","@types/ent":"^2.2.1","@types/mime":"^3.0.0","@types/mime-types":"^2.1.0","@types/mocha":"^9.1.1","@types/mockery":"^1.4.29","@types/node":"^20.4.4","@types/node-fetch":"^2.1.3","@types/proxyquire":"^1.3.28","@types/request":"^2.48.4","@types/sinon":"^10.0.15","@types/tmp":"0.2.5","@types/uuid":"^8.0.0","@types/yargs":"^17.0.10",c8:"^8.0.0","form-data":"^4.0.0","gapic-tools":"^0.2.0",gts:"^5.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^3.0.0","jsdoc-region-tag":"^3.0.0",linkinator:"^4.0.0",mocha:"^9.2.2",mockery:"^2.1.0",nock:"~13.3.0","node-fetch":"^2.6.7","pack-n-play":"^2.0.0",proxyquire:"^2.1.3",sinon:"^17.0.0",tmp:"^0.2.0",typescript:"^5.1.6",yargs:"^17.3.1"}}});var bg=_(C_e=>{function Ivt(){return x_e()}o(Ivt,"getPackageJSON");C_e.getPackageJSON=Ivt});var yl=_(fr=>{"use strict";var Pvt=fr&&fr.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var Dvt=fr&&fr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var qF=fr&&fr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))Pvt(e,t,r)}Dvt(e,t);return e};Object.defineProperty(fr,"__esModule",{value:true});fr.PassThroughShim=fr.getModuleFormat=fr.getDirName=fr.getUserAgentString=fr.getRuntimeTrackingString=fr.formatAsUTCISO=fr.convertObjKeysToSnakeCase=fr.unicodeJSONStringify=fr.objectKeyToLowercase=fr.qsStringify=fr.encodeURI=fr.fixedEncodeURIComponent=fr.objectEntries=fr.normalize=void 0;var nar=qF(require("path"));var kvt=qF(require("querystring"));var $vt=require("stream");var Lvt=qF(require("url"));var qvt=bg();var iar=Lvt.fileURLToPath;var jvt=false;function Uvt(t,e){const r=typeof t==="object"?t:{};const n=typeof t==="function"?t:e;return{options:r,callback:n}}o(Uvt,"normalize");fr.normalize=Uvt;function Fvt(t){return Object.keys(t).map(e=>[e,t[e]])}o(Fvt,"objectEntries");fr.objectEntries=Fvt;function R_e(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())}o(R_e,"fixedEncodeURIComponent");fr.fixedEncodeURIComponent=R_e;function O_e(t,e){return t.split("/").map(R_e).join(e?"%2F":"/")}o(O_e,"encodeURI");fr.encodeURI=O_e;function Mvt(t){return kvt.stringify(t,"&","=",{encodeURIComponent:e=>O_e(e,true)})}o(Mvt,"qsStringify");fr.qsStringify=Mvt;function Bvt(t){const e={};for(let r of Object.keys(t)){const n=t[r];r=r.toLowerCase();e[r]=n}return e}o(Bvt,"objectKeyToLowercase");fr.objectKeyToLowercase=Bvt;function Vvt(t){return JSON.stringify(t).replace(/[\u0080-\uFFFF]/g,e=>"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4))}o(Vvt,"unicodeJSONStringify");fr.unicodeJSONStringify=Vvt;function $F(t){if(t instanceof Date||t instanceof RegExp){return t}if(Array.isArray(t)){return t.map($F)}if(t instanceof Object){return Object.keys(t).reduce((e,r)=>{const n=r[0].toLocaleLowerCase()+r.slice(1).replace(/([A-Z]+)/g,(i,s)=>{return`_${s.toLowerCase()}`});e[n]=$F(t[r]);return e},Object())}return t}o($F,"convertObjKeysToSnakeCase");fr.convertObjKeysToSnakeCase=$F;function Hvt(t,e=false,r="",n=""){const i=t.getUTCFullYear();const s=t.getUTCMonth()+1;const a=t.getUTCDate();const u=t.getUTCHours();const l=t.getUTCMinutes();const c=t.getUTCSeconds();let d=`${i.toString().padStart(4,"0")}${r}${s.toString().padStart(2,"0")}${r}${a.toString().padStart(2,"0")}`;if(e){d=`${d}T${u.toString().padStart(2,"0")}${n}${l.toString().padStart(2,"0")}${n}${c.toString().padStart(2,"0")}Z`}return d}o(Hvt,"formatAsUTCISO");fr.formatAsUTCISO=Hvt;function zvt(){if(globalThis.Deno&&globalThis.Deno.version&&globalThis.Deno.version.deno){return`gl-deno/${globalThis.Deno.version.deno}`}else{return`gl-node/${process.versions.node}`}}o(zvt,"getRuntimeTrackingString");fr.getRuntimeTrackingString=zvt;function Gvt(){const t=(0,qvt.getPackageJSON)();const e=t.name.replace("@google-cloud","gcloud-node").replace("/","-");return e+"/"+t.version}o(Gvt,"getUserAgentString");fr.getUserAgentString=Gvt;function Kvt(){let t="";try{t=__dirname}catch(e){t=__dirname}return t}o(Kvt,"getDirName");fr.getDirName=Kvt;function Yvt(){return jvt?"ESM":"CJS"}o(Yvt,"getModuleFormat");fr.getModuleFormat=Yvt;var LF=class extends $vt.PassThrough{static{o(this,"PassThroughShim")}constructor(){super(...arguments);this.shouldEmitReading=true;this.shouldEmitWriting=true}_read(e){if(this.shouldEmitReading){this.emit("reading");this.shouldEmitReading=false}super._read(e)}_write(e,r,n){if(this.shouldEmitWriting){this.emit("writing");this.shouldEmitWriting=false}process.nextTick(()=>{super._write(e,r,n)})}_final(e){if(this.shouldEmitReading){this.emit("reading");this.shouldEmitReading=false}if(this.shouldEmitWriting){this.emit("writing");this.shouldEmitWriting=false}e(null)}};fr.PassThroughShim=LF});var jF=_((oar,N_e)=>{N_e.exports=require("stream")});var k_e=_((uar,D_e)=>{"use strict";function I_e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);if(e)n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable});r.push.apply(r,n)}return r}o(I_e,"ownKeys");function Wvt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};if(e%2){I_e(Object(r),true).forEach(function(n){Jvt(t,n,r[n])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))}else{I_e(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}}return t}o(Wvt,"_objectSpread");function Jvt(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}o(Jvt,"_defineProperty");function Qvt(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}o(Qvt,"_classCallCheck");function P_e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}o(P_e,"_defineProperties");function Xvt(t,e,r){if(e)P_e(t.prototype,e);if(r)P_e(t,r);return t}o(Xvt,"_createClass");var Zvt=require("buffer");var nT=Zvt.Buffer;var e_t=require("util");var UF=e_t.inspect;var t_t=UF&&UF.custom||"inspect";function r_t(t,e,r){nT.prototype.copy.call(t,e,r)}o(r_t,"copyBuffer");D_e.exports=function(){function t(){Qvt(this,t);this.head=null;this.tail=null;this.length=0}o(t,"BufferList");Xvt(t,[{key:"push",value:o(function e(r){var n={data:r,next:null};if(this.length>0)this.tail.next=n;else this.head=n;this.tail=n;++this.length},"push")},{key:"unshift",value:o(function e(r){var n={data:r,next:this.head};if(this.length===0)this.tail=n;this.head=n;++this.length},"unshift")},{key:"shift",value:o(function e(){if(this.length===0)return;var r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r},"shift")},{key:"clear",value:o(function e(){this.head=this.tail=null;this.length=0},"clear")},{key:"join",value:o(function e(r){if(this.length===0)return"";var n=this.head;var i=""+n.data;while(n=n.next){i+=r+n.data}return i},"join")},{key:"concat",value:o(function e(r){if(this.length===0)return nT.alloc(0);var n=nT.allocUnsafe(r>>>0);var i=this.head;var s=0;while(i){r_t(i.data,n,s);s+=i.data.length;i=i.next}return n},"concat")},{key:"consume",value:o(function e(r,n){var i;if(r<this.head.data.length){i=this.head.data.slice(0,r);this.head.data=this.head.data.slice(r)}else if(r===this.head.data.length){i=this.shift()}else{i=n?this._getString(r):this._getBuffer(r)}return i},"consume")},{key:"first",value:o(function e(){return this.head.data},"first")},{key:"_getString",value:o(function e(r){var n=this.head;var i=1;var s=n.data;r-=s.length;while(n=n.next){var a=n.data;var u=r>a.length?a.length:r;if(u===a.length)s+=a;else s+=a.slice(0,r);r-=u;if(r===0){if(u===a.length){++i;if(n.next)this.head=n.next;else this.head=this.tail=null}else{this.head=n;n.data=a.slice(u)}break}++i}this.length-=i;return s},"_getString")},{key:"_getBuffer",value:o(function e(r){var n=nT.allocUnsafe(r);var i=this.head;var s=1;i.data.copy(n);r-=i.data.length;while(i=i.next){var a=i.data;var u=r>a.length?a.length:r;a.copy(n,n.length-r,0,u);r-=u;if(r===0){if(u===a.length){++s;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=a.slice(u)}break}++s}this.length-=s;return n},"_getBuffer")},{key:t_t,value:o(function e(r,n){return UF(this,Wvt({},n,{depth:0,customInspect:false}))},"value")}]);return t}()});var MF=_((car,L_e)=>{"use strict";function n_t(t,e){var r=this;var n=this._readableState&&this._readableState.destroyed;var i=this._writableState&&this._writableState.destroyed;if(n||i){if(e){e(t)}else if(t){if(!this._writableState){process.nextTick(FF,this,t)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(FF,this,t)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,function(s){if(!e&&s){if(!r._writableState){process.nextTick($_e,r,s)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick($_e,r,s)}else{process.nextTick(iT,r)}}else if(e){process.nextTick(iT,r);e(s)}else{process.nextTick(iT,r)}});return this}o(n_t,"destroy");function $_e(t,e){FF(t,e);iT(t)}o($_e,"emitErrorAndCloseNT");function iT(t){if(t._writableState&&!t._writableState.emitClose)return;if(t._readableState&&!t._readableState.emitClose)return;t.emit("close")}o(iT,"emitCloseNT");function i_t(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}o(i_t,"undestroy");function FF(t,e){t.emit("error",e)}o(FF,"emitErrorNT");function s_t(t,e){var r=t._readableState;var n=t._writableState;if(r&&r.autoDestroy||n&&n.autoDestroy)t.destroy(e);else t.emit("error",e)}o(s_t,"errorOrDestroy");L_e.exports={destroy:n_t,undestroy:i_t,errorOrDestroy:s_t}});var bp=_((par,U_e)=>{"use strict";var j_e={};function Eo(t,e,r){if(!r){r=Error}function n(s,a,u){if(typeof e==="string"){return e}else{return e(s,a,u)}}o(n,"getMessage");class i extends r{static{o(this,"NodeError")}constructor(a,u,l){super(n(a,u,l))}}i.prototype.name=r.name;i.prototype.code=t;j_e[t]=i}o(Eo,"createErrorType");function q_e(t,e){if(Array.isArray(t)){const r=t.length;t=t.map(n=>String(n));if(r>2){return`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]}else if(r===2){return`one of ${e} ${t[0]} or ${t[1]}`}else{return`of ${e} ${t[0]}`}}else{return`of ${e} ${String(t)}`}}o(q_e,"oneOf");function a_t(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}o(a_t,"startsWith");function o_t(t,e,r){if(r===void 0||r>t.length){r=t.length}return t.substring(r-e.length,r)===e}o(o_t,"endsWith");function u_t(t,e,r){if(typeof r!=="number"){r=0}if(r+e.length>t.length){return false}else{return t.indexOf(e,r)!==-1}}o(u_t,"includes");Eo("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Eo("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;if(typeof e==="string"&&a_t(e,"not ")){n="must not be";e=e.replace(/^not /,"")}else{n="must be"}let i;if(o_t(t," argument")){i=`The ${t} ${n} ${q_e(e,"type")}`}else{const s=u_t(t,".")?"property":"argument";i=`The "${t}" ${s} ${n} ${q_e(e,"type")}`}i+=`. Received type ${typeof r}`;return i},TypeError);Eo("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Eo("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Eo("ERR_STREAM_PREMATURE_CLOSE","Premature close");Eo("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Eo("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Eo("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Eo("ERR_STREAM_WRITE_AFTER_END","write after end");Eo("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Eo("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Eo("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");U_e.exports.codes=j_e});var BF=_((har,F_e)=>{"use strict";var l_t=bp().codes.ERR_INVALID_OPT_VALUE;function c_t(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}o(c_t,"highWaterMarkFrom");function d_t(t,e,r,n){var i=c_t(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new l_t(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}o(d_t,"getHighWaterMark");F_e.exports={getHighWaterMark:d_t}});var M_e=_((gar,VF)=>{if(typeof Object.create==="function"){VF.exports=o(function t(e,r){if(r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}},"inherits")}else{VF.exports=o(function t(e,r){if(r){e.super_=r;var n=o(function(){},"TempCtor");n.prototype=r.prototype;e.prototype=new n;e.prototype.constructor=e}},"inherits")}});var Jh=_((_ar,zF)=>{try{HF=require("util");if(typeof HF.inherits!=="function")throw"";zF.exports=HF.inherits}catch(t){zF.exports=M_e()}var HF});var V_e=_((Ear,B_e)=>{B_e.exports=require("util").deprecate});var YF=_((bar,W_e)=>{"use strict";W_e.exports=Wn;function z_e(t){var e=this;this.next=null;this.entry=null;this.finish=function(){j_t(e,t)}}o(z_e,"CorkedRequest");var wg;Wn.WritableState=_E;var p_t={deprecate:V_e()};var G_e=jF();var aT=require("buffer").Buffer;var f_t=global.Uint8Array||function(){};function h_t(t){return aT.from(t)}o(h_t,"_uint8ArrayToBuffer");function m_t(t){return aT.isBuffer(t)||t instanceof f_t}o(m_t,"_isUint8Array");var KF=MF();var g_t=BF();var y_t=g_t.getHighWaterMark;var wp=bp().codes;var v_t=wp.ERR_INVALID_ARG_TYPE;var __t=wp.ERR_METHOD_NOT_IMPLEMENTED;var E_t=wp.ERR_MULTIPLE_CALLBACK;var b_t=wp.ERR_STREAM_CANNOT_PIPE;var w_t=wp.ERR_STREAM_DESTROYED;var S_t=wp.ERR_STREAM_NULL_VALUES;var T_t=wp.ERR_STREAM_WRITE_AFTER_END;var A_t=wp.ERR_UNKNOWN_ENCODING;var Sg=KF.errorOrDestroy;Jh()(Wn,G_e);function x_t(){}o(x_t,"nop");function _E(t,e,r){wg=wg||Qh();t=t||{};if(typeof r!=="boolean")r=e instanceof wg;this.objectMode=!!t.objectMode;if(r)this.objectMode=this.objectMode||!!t.writableObjectMode;this.highWaterMark=y_t(this,t,"writableHighWaterMark",r);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var n=t.decodeStrings===false;this.decodeStrings=!n;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(i){D_t(e,i)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new z_e(this)}o(_E,"WritableState");_E.prototype.getBuffer=o(function t(){var e=this.bufferedRequest;var r=[];while(e){r.push(e);e=e.next}return r},"getBuffer");(function(){try{Object.defineProperty(_E.prototype,"buffer",{get:p_t.deprecate(o(function t(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}})();var sT;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){sT=Function.prototype[Symbol.hasInstance];Object.defineProperty(Wn,Symbol.hasInstance,{value:o(function t(e){if(sT.call(this,e))return true;if(this!==Wn)return false;return e&&e._writableState instanceof _E},"value")})}else{sT=o(function t(e){return e instanceof this},"realHasInstance")}function Wn(t){wg=wg||Qh();var e=this instanceof wg;if(!e&&!sT.call(Wn,this))return new Wn(t);this._writableState=new _E(t,this,e);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}G_e.call(this)}o(Wn,"Writable");Wn.prototype.pipe=function(){Sg(this,new b_t)};function C_t(t,e){var r=new T_t;Sg(t,r);process.nextTick(e,r)}o(C_t,"writeAfterEnd");function R_t(t,e,r,n){var i;if(r===null){i=new S_t}else if(typeof r!=="string"&&!e.objectMode){i=new v_t("chunk",["string","Buffer"],r)}if(i){Sg(t,i);process.nextTick(n,i);return false}return true}o(R_t,"validChunk");Wn.prototype.write=function(t,e,r){var n=this._writableState;var i=false;var s=!n.objectMode&&m_t(t);if(s&&!aT.isBuffer(t)){t=h_t(t)}if(typeof e==="function"){r=e;e=null}if(s)e="buffer";else if(!e)e=n.defaultEncoding;if(typeof r!=="function")r=x_t;if(n.ending)C_t(this,r);else if(s||R_t(this,n,t,r)){n.pendingcb++;i=N_t(this,n,s,t,e,r)}return i};Wn.prototype.cork=function(){this._writableState.corked++};Wn.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest)K_e(this,t)}};Wn.prototype.setDefaultEncoding=o(function t(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new A_t(e);this._writableState.defaultEncoding=e;return this},"setDefaultEncoding");Object.defineProperty(Wn.prototype,"writableBuffer",{enumerable:false,get:o(function t(){return this._writableState&&this._writableState.getBuffer()},"get")});function O_t(t,e,r){if(!t.objectMode&&t.decodeStrings!==false&&typeof e==="string"){e=aT.from(e,r)}return e}o(O_t,"decodeChunk");Object.defineProperty(Wn.prototype,"writableHighWaterMark",{enumerable:false,get:o(function t(){return this._writableState.highWaterMark},"get")});function N_t(t,e,r,n,i,s){if(!r){var a=O_t(e,n,i);if(n!==a){r=true;i="buffer";n=a}}var u=e.objectMode?1:n.length;e.length+=u;var l=e.length<e.highWaterMark;if(!l)e.needDrain=true;if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null};if(c){c.next=e.lastBufferedRequest}else{e.bufferedRequest=e.lastBufferedRequest}e.bufferedRequestCount+=1}else{GF(t,e,false,u,n,i,s)}return l}o(N_t,"writeOrBuffer");function GF(t,e,r,n,i,s,a){e.writelen=n;e.writecb=a;e.writing=true;e.sync=true;if(e.destroyed)e.onwrite(new w_t("write"));else if(r)t._writev(i,e.onwrite);else t._write(i,s,e.onwrite);e.sync=false}o(GF,"doWrite");function I_t(t,e,r,n,i){--e.pendingcb;if(r){process.nextTick(i,n);process.nextTick(vE,t,e);t._writableState.errorEmitted=true;Sg(t,n)}else{i(n);t._writableState.errorEmitted=true;Sg(t,n);vE(t,e)}}o(I_t,"onwriteError");function P_t(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}o(P_t,"onwriteStateUpdate");function D_t(t,e){var r=t._writableState;var n=r.sync;var i=r.writecb;if(typeof i!=="function")throw new E_t;P_t(r);if(e)I_t(t,r,n,e,i);else{var s=Y_e(r)||t.destroyed;if(!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest){K_e(t,r)}if(n){process.nextTick(H_e,t,r,s,i)}else{H_e(t,r,s,i)}}}o(D_t,"onwrite");function H_e(t,e,r,n){if(!r)k_t(t,e);e.pendingcb--;n();vE(t,e)}o(H_e,"afterWrite");function k_t(t,e){if(e.length===0&&e.needDrain){e.needDrain=false;t.emit("drain")}}o(k_t,"onwriteDrain");function K_e(t,e){e.bufferProcessing=true;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount;var i=new Array(n);var s=e.corkedRequestsFree;s.entry=r;var a=0;var u=true;while(r){i[a]=r;if(!r.isBuf)u=false;r=r.next;a+=1}i.allBuffers=u;GF(t,e,true,e.length,i,"",s.finish);e.pendingcb++;e.lastBufferedRequest=null;if(s.next){e.corkedRequestsFree=s.next;s.next=null}else{e.corkedRequestsFree=new z_e(e)}e.bufferedRequestCount=0}else{while(r){var l=r.chunk;var c=r.encoding;var d=r.callback;var p=e.objectMode?1:l.length;GF(t,e,false,p,l,c,d);r=r.next;e.bufferedRequestCount--;if(e.writing){break}}if(r===null)e.lastBufferedRequest=null}e.bufferedRequest=r;e.bufferProcessing=false}o(K_e,"clearBuffer");Wn.prototype._write=function(t,e,r){r(new __t("_write()"))};Wn.prototype._writev=null;Wn.prototype.end=function(t,e,r){var n=this._writableState;if(typeof t==="function"){r=t;t=null;e=null}else if(typeof e==="function"){r=e;e=null}if(t!==null&&t!==void 0)this.write(t,e);if(n.corked){n.corked=1;this.uncork()}if(!n.ending)q_t(this,n,r);return this};Object.defineProperty(Wn.prototype,"writableLength",{enumerable:false,get:o(function t(){return this._writableState.length},"get")});function Y_e(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}o(Y_e,"needFinish");function $_t(t,e){t._final(function(r){e.pendingcb--;if(r){Sg(t,r)}e.prefinished=true;t.emit("prefinish");vE(t,e)})}o($_t,"callFinal");function L_t(t,e){if(!e.prefinished&&!e.finalCalled){if(typeof t._final==="function"&&!e.destroyed){e.pendingcb++;e.finalCalled=true;process.nextTick($_t,t,e)}else{e.prefinished=true;t.emit("prefinish")}}}o(L_t,"prefinish");function vE(t,e){var r=Y_e(e);if(r){L_t(t,e);if(e.pendingcb===0){e.finished=true;t.emit("finish");if(e.autoDestroy){var n=t._readableState;if(!n||n.autoDestroy&&n.endEmitted){t.destroy()}}}}return r}o(vE,"finishMaybe");function q_t(t,e,r){e.ending=true;vE(t,e);if(r){if(e.finished)process.nextTick(r);else t.once("finish",r)}e.ended=true;t.writable=false}o(q_t,"endWritable");function j_t(t,e,r){var n=t.entry;t.entry=null;while(n){var i=n.callback;e.pendingcb--;i(r);n=n.next}e.corkedRequestsFree.next=t}o(j_t,"onCorkedFinish");Object.defineProperty(Wn.prototype,"destroyed",{enumerable:false,get:o(function t(){if(this._writableState===void 0){return false}return this._writableState.destroyed},"get"),set:o(function t(e){if(!this._writableState){return}this._writableState.destroyed=e},"set")});Wn.prototype.destroy=KF.destroy;Wn.prototype._undestroy=KF.undestroy;Wn.prototype._destroy=function(t,e){e(t)}});var Qh=_((Sar,Q_e)=>{"use strict";var U_t=Object.keys||function(t){var e=[];for(var r in t){e.push(r)}return e};Q_e.exports=vl;var J_e=QF();var JF=YF();Jh()(vl,J_e);{WF=U_t(JF.prototype);for(oT=0;oT<WF.length;oT++){uT=WF[oT];if(!vl.prototype[uT])vl.prototype[uT]=JF.prototype[uT]}}var WF;var uT;var oT;function vl(t){if(!(this instanceof vl))return new vl(t);J_e.call(this,t);JF.call(this,t);this.allowHalfOpen=true;if(t){if(t.readable===false)this.readable=false;if(t.writable===false)this.writable=false;if(t.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",F_t)}}}o(vl,"Duplex");Object.defineProperty(vl.prototype,"writableHighWaterMark",{enumerable:false,get:o(function t(){return this._writableState.highWaterMark},"get")});Object.defineProperty(vl.prototype,"writableBuffer",{enumerable:false,get:o(function t(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(vl.prototype,"writableLength",{enumerable:false,get:o(function t(){return this._writableState.length},"get")});function F_t(){if(this._writableState.ended)return;process.nextTick(M_t,this)}o(F_t,"onend");function M_t(t){t.end()}o(M_t,"onEndNT");Object.defineProperty(vl.prototype,"destroyed",{enumerable:false,get:o(function t(){if(this._readableState===void 0||this._writableState===void 0){return false}return this._readableState.destroyed&&this._writableState.destroyed},"get"),set:o(function t(e){if(this._readableState===void 0||this._writableState===void 0){return}this._readableState.destroyed=e;this._writableState.destroyed=e},"set")})});var e4e=_((XF,Z_e)=>{var lT=require("buffer");var Lc=lT.Buffer;function X_e(t,e){for(var r in t){e[r]=t[r]}}o(X_e,"copyProps");if(Lc.from&&Lc.alloc&&Lc.allocUnsafe&&Lc.allocUnsafeSlow){Z_e.exports=lT}else{X_e(lT,XF);XF.Buffer=Tg}function Tg(t,e,r){return Lc(t,e,r)}o(Tg,"SafeBuffer");X_e(Lc,Tg);Tg.from=function(t,e,r){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return Lc(t,e,r)};Tg.alloc=function(t,e,r){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var n=Lc(t);if(e!==void 0){if(typeof r==="string"){n.fill(e,r)}else{n.fill(e)}}else{n.fill(0)}return n};Tg.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return Lc(t)};Tg.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return lT.SlowBuffer(t)}});var tM=_(r4e=>{"use strict";var eM=e4e().Buffer;var t4e=eM.isEncoding||function(t){t=""+t;switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function B_t(t){if(!t)return"utf8";var e;while(true){switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase();e=true}}}o(B_t,"_normalizeEncoding");function V_t(t){var e=B_t(t);if(typeof e!=="string"&&(eM.isEncoding===t4e||!t4e(t)))throw new Error("Unknown encoding: "+t);return e||t}o(V_t,"normalizeEncoding");r4e.StringDecoder=EE;function EE(t){this.encoding=V_t(t);var e;switch(this.encoding){case"utf16le":this.text=W_t;this.end=J_t;e=4;break;case"utf8":this.fillLast=G_t;e=4;break;case"base64":this.text=Q_t;this.end=X_t;e=3;break;default:this.write=Z_t;this.end=e4t;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=eM.allocUnsafe(e)}o(EE,"StringDecoder");EE.prototype.write=function(t){if(t.length===0)return"";var e;var r;if(this.lastNeed){e=this.fillLast(t);if(e===void 0)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r<t.length)return e?e+this.text(t,r):this.text(t,r);return e||""};EE.prototype.end=Y_t;EE.prototype.text=K_t;EE.prototype.fillLast=function(t){if(this.lastNeed<=t.length){t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length);this.lastNeed-=t.length};function ZF(t){if(t<=127)return 0;else if(t>>5===6)return 2;else if(t>>4===14)return 3;else if(t>>3===30)return 4;return t>>6===2?-1:-2}o(ZF,"utf8CheckByte");function H_t(t,e,r){var n=e.length-1;if(n<r)return 0;var i=ZF(e[n]);if(i>=0){if(i>0)t.lastNeed=i-1;return i}if(--n<r||i===-2)return 0;i=ZF(e[n]);if(i>=0){if(i>0)t.lastNeed=i-2;return i}if(--n<r||i===-2)return 0;i=ZF(e[n]);if(i>=0){if(i>0){if(i===2)i=0;else t.lastNeed=i-3}return i}return 0}o(H_t,"utf8CheckIncomplete");function z_t(t,e,r){if((e[0]&192)!==128){t.lastNeed=0;return"\uFFFD"}if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128){t.lastNeed=1;return"\uFFFD"}if(t.lastNeed>2&&e.length>2){if((e[2]&192)!==128){t.lastNeed=2;return"\uFFFD"}}}}o(z_t,"utf8CheckExtraBytes");function G_t(t){var e=this.lastTotal-this.lastNeed;var r=z_t(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length){t.copy(this.lastChar,e,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,e,0,t.length);this.lastNeed-=t.length}o(G_t,"utf8FillLast");function K_t(t,e){var r=H_t(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);t.copy(this.lastChar,0,n);return t.toString("utf8",e,n)}o(K_t,"utf8Text");function Y_t(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+"\uFFFD";return e}o(Y_t,"utf8End");function W_t(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",e,t.length-1)}o(W_t,"utf16Text");function J_t(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}o(J_t,"utf16End");function Q_t(t,e){var r=(t.length-e)%3;if(r===0)return t.toString("base64",e);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=t[t.length-1]}else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",e,t.length-r)}o(Q_t,"base64Text");function X_t(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+this.lastChar.toString("base64",0,3-this.lastNeed);return e}o(X_t,"base64End");function Z_t(t){return t.toString(this.encoding)}o(Z_t,"simpleWrite");function e4t(t){return t&&t.length?this.write(t):""}o(e4t,"simpleEnd")});var cT=_((Rar,s4e)=>{"use strict";var n4e=bp().codes.ERR_STREAM_PREMATURE_CLOSE;function t4t(t){var e=false;return function(){if(e)return;e=true;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++){n[i]=arguments[i]}t.apply(this,n)}}o(t4t,"once");function r4t(){}o(r4t,"noop");function n4t(t){return t.setHeader&&typeof t.abort==="function"}o(n4t,"isRequest");function i4e(t,e,r){if(typeof e==="function")return i4e(t,null,e);if(!e)e={};r=t4t(r||r4t);var n=e.readable||e.readable!==false&&t.readable;var i=e.writable||e.writable!==false&&t.writable;var s=o(function h(){if(!t.writable)u()},"onlegacyfinish");var a=t._writableState&&t._writableState.finished;var u=o(function h(){i=false;a=true;if(!n)r.call(t)},"onfinish");var l=t._readableState&&t._readableState.endEmitted;var c=o(function h(){n=false;l=true;if(!i)r.call(t)},"onend");var d=o(function h(m){r.call(t,m)},"onerror");var p=o(function h(){var m;if(n&&!l){if(!t._readableState||!t._readableState.ended)m=new n4e;return r.call(t,m)}if(i&&!a){if(!t._writableState||!t._writableState.ended)m=new n4e;return r.call(t,m)}},"onclose");var f=o(function h(){t.req.on("finish",u)},"onrequest");if(n4t(t)){t.on("complete",u);t.on("abort",p);if(t.req)f();else t.on("request",f)}else if(i&&!t._writableState){t.on("end",s);t.on("close",s)}t.on("end",c);t.on("finish",u);if(e.error!==false)t.on("error",d);t.on("close",p);return function(){t.removeListener("complete",u);t.removeListener("abort",p);t.removeListener("request",f);if(t.req)t.req.removeListener("finish",u);t.removeListener("end",s);t.removeListener("close",s);t.removeListener("finish",u);t.removeListener("end",c);t.removeListener("error",d);t.removeListener("close",p)}}o(i4e,"eos");s4e.exports=i4e});var o4e=_((Nar,a4e)=>{"use strict";var dT;function Sp(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}o(Sp,"_defineProperty");var i4t=cT();var Tp=Symbol("lastResolve");var Xh=Symbol("lastReject");var bE=Symbol("error");var pT=Symbol("ended");var Zh=Symbol("lastPromise");var rM=Symbol("handlePromise");var em=Symbol("stream");function Ap(t,e){return{value:t,done:e}}o(Ap,"createIterResult");function s4t(t){var e=t[Tp];if(e!==null){var r=t[em].read();if(r!==null){t[Zh]=null;t[Tp]=null;t[Xh]=null;e(Ap(r,false))}}}o(s4t,"readAndResolve");function a4t(t){process.nextTick(s4t,t)}o(a4t,"onReadable");function o4t(t,e){return function(r,n){t.then(function(){if(e[pT]){r(Ap(void 0,true));return}e[rM](r,n)},n)}}o(o4t,"wrapForNext");var u4t=Object.getPrototypeOf(function(){});var l4t=Object.setPrototypeOf((dT={get stream(){return this[em]},next:o(function t(){var e=this;var r=this[bE];if(r!==null){return Promise.reject(r)}if(this[pT]){return Promise.resolve(Ap(void 0,true))}if(this[em].destroyed){return new Promise(function(a,u){process.nextTick(function(){if(e[bE]){u(e[bE])}else{a(Ap(void 0,true))}})})}var n=this[Zh];var i;if(n){i=new Promise(o4t(n,this))}else{var s=this[em].read();if(s!==null){return Promise.resolve(Ap(s,false))}i=new Promise(this[rM])}this[Zh]=i;return i},"next")},Sp(dT,Symbol.asyncIterator,function(){return this}),Sp(dT,"return",o(function t(){var e=this;return new Promise(function(r,n){e[em].destroy(null,function(i){if(i){n(i);return}r(Ap(void 0,true))})})},"_return")),dT),u4t);var c4t=o(function t(e){var r;var n=Object.create(l4t,(r={},Sp(r,em,{value:e,writable:true}),Sp(r,Tp,{value:null,writable:true}),Sp(r,Xh,{value:null,writable:true}),Sp(r,bE,{value:null,writable:true}),Sp(r,pT,{value:e._readableState.endEmitted,writable:true}),Sp(r,rM,{value:o(function i(s,a){var u=n[em].read();if(u){n[Zh]=null;n[Tp]=null;n[Xh]=null;s(Ap(u,false))}else{n[Tp]=s;n[Xh]=a}},"value"),writable:true}),r));n[Zh]=null;i4t(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=n[Xh];if(s!==null){n[Zh]=null;n[Tp]=null;n[Xh]=null;s(i)}n[bE]=i;return}var a=n[Tp];if(a!==null){n[Zh]=null;n[Tp]=null;n[Xh]=null;a(Ap(void 0,true))}n[pT]=true});e.on("readable",a4t.bind(null,n));return n},"createReadableStreamAsyncIterator");a4e.exports=c4t});var d4e=_((Par,c4e)=>{"use strict";function u4e(t,e,r,n,i,s,a){try{var u=t[s](a);var l=u.value}catch(c){r(c);return}if(u.done){e(l)}else{Promise.resolve(l).then(n,i)}}o(u4e,"asyncGeneratorStep");function d4t(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function a(l){u4e(s,n,i,a,u,"next",l)}o(a,"_next");function u(l){u4e(s,n,i,a,u,"throw",l)}o(u,"_throw");a(void 0)})}}o(d4t,"_asyncToGenerator");function l4e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);if(e)n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable});r.push.apply(r,n)}return r}o(l4e,"ownKeys");function p4t(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};if(e%2){l4e(Object(r),true).forEach(function(n){f4t(t,n,r[n])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))}else{l4e(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}}return t}o(p4t,"_objectSpread");function f4t(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}o(f4t,"_defineProperty");var h4t=bp().codes.ERR_INVALID_ARG_TYPE;function m4t(t,e,r){var n;if(e&&typeof e.next==="function"){n=e}else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new h4t("iterable",["Iterable"],e);var i=new t(p4t({objectMode:true},r));var s=false;i._read=function(){if(!s){s=true;a()}};function a(){return u.apply(this,arguments)}o(a,"next");function u(){u=d4t(function*(){try{var l=yield n.next(),c=l.value,d=l.done;if(d){i.push(null)}else if(i.push(yield c)){a()}else{s=false}}catch(p){i.destroy(p)}});return u.apply(this,arguments)}o(u,"_next2");return i}o(m4t,"from");c4e.exports=m4t});var QF=_(($ar,b4e)=>{"use strict";b4e.exports=Lr;var Ag;Lr.ReadableState=m4e;var kar=require("events").EventEmitter;var h4e=o(function t(e,r){return e.listeners(r).length},"EElistenerCount");var SE=jF();var fT=require("buffer").Buffer;var g4t=global.Uint8Array||function(){};function y4t(t){return fT.from(t)}o(y4t,"_uint8ArrayToBuffer");function v4t(t){return fT.isBuffer(t)||t instanceof g4t}o(v4t,"_isUint8Array");var nM=require("util");var Zt;if(nM&&nM.debuglog){Zt=nM.debuglog("stream")}else{Zt=o(function t(){},"debug")}var _4t=k_e();var cM=MF();var E4t=BF();var b4t=E4t.getHighWaterMark;var hT=bp().codes;var w4t=hT.ERR_INVALID_ARG_TYPE;var S4t=hT.ERR_STREAM_PUSH_AFTER_EOF;var T4t=hT.ERR_METHOD_NOT_IMPLEMENTED;var A4t=hT.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var xg;var iM;var sM;Jh()(Lr,SE);var wE=cM.errorOrDestroy;var aM=["error","close","destroy","pause","resume"];function x4t(t,e,r){if(typeof t.prependListener==="function")return t.prependListener(e,r);if(!t._events||!t._events[e])t.on(e,r);else if(Array.isArray(t._events[e]))t._events[e].unshift(r);else t._events[e]=[r,t._events[e]]}o(x4t,"prependListener");function m4e(t,e,r){Ag=Ag||Qh();t=t||{};if(typeof r!=="boolean")r=e instanceof Ag;this.objectMode=!!t.objectMode;if(r)this.objectMode=this.objectMode||!!t.readableObjectMode;this.highWaterMark=b4t(this,t,"readableHighWaterMark",r);this.buffer=new _4t;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!xg)xg=tM().StringDecoder;this.decoder=new xg(t.encoding);this.encoding=t.encoding}}o(m4e,"ReadableState");function Lr(t){Ag=Ag||Qh();if(!(this instanceof Lr))return new Lr(t);var e=this instanceof Ag;this._readableState=new m4e(t,this,e);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}SE.call(this)}o(Lr,"Readable");Object.defineProperty(Lr.prototype,"destroyed",{enumerable:false,get:o(function t(){if(this._readableState===void 0){return false}return this._readableState.destroyed},"get"),set:o(function t(e){if(!this._readableState){return}this._readableState.destroyed=e},"set")});Lr.prototype.destroy=cM.destroy;Lr.prototype._undestroy=cM.undestroy;Lr.prototype._destroy=function(t,e){e(t)};Lr.prototype.push=function(t,e){var r=this._readableState;var n;if(!r.objectMode){if(typeof t==="string"){e=e||r.defaultEncoding;if(e!==r.encoding){t=fT.from(t,e);e=""}n=true}}else{n=true}return g4e(this,t,e,false,n)};Lr.prototype.unshift=function(t){return g4e(this,t,null,true,false)};function g4e(t,e,r,n,i){Zt("readableAddChunk",e);var s=t._readableState;if(e===null){s.reading=false;O4t(t,s)}else{var a;if(!i)a=C4t(s,e);if(a){wE(t,a)}else if(s.objectMode||e&&e.length>0){if(typeof e!=="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==fT.prototype){e=y4t(e)}if(n){if(s.endEmitted)wE(t,new A4t);else oM(t,s,e,true)}else if(s.ended){wE(t,new S4t)}else if(s.destroyed){return false}else{s.reading=false;if(s.decoder&&!r){e=s.decoder.write(e);if(s.objectMode||e.length!==0)oM(t,s,e,false);else lM(t,s)}else{oM(t,s,e,false)}}}else if(!n){s.reading=false;lM(t,s)}}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}o(g4e,"readableAddChunk");function oM(t,e,r,n){if(e.flowing&&e.length===0&&!e.sync){e.awaitDrain=0;t.emit("data",r)}else{e.length+=e.objectMode?1:r.length;if(n)e.buffer.unshift(r);else e.buffer.push(r);if(e.needReadable)mT(t)}lM(t,e)}o(oM,"addChunk");function C4t(t,e){var r;if(!v4t(e)&&typeof e!=="string"&&e!==void 0&&!t.objectMode){r=new w4t("chunk",["string","Buffer","Uint8Array"],e)}return r}o(C4t,"chunkInvalid");Lr.prototype.isPaused=function(){return this._readableState.flowing===false};Lr.prototype.setEncoding=function(t){if(!xg)xg=tM().StringDecoder;var e=new xg(t);this._readableState.decoder=e;this._readableState.encoding=this._readableState.decoder.encoding;var r=this._readableState.buffer.head;var n="";while(r!==null){n+=e.write(r.data);r=r.next}this._readableState.buffer.clear();if(n!=="")this._readableState.buffer.push(n);this._readableState.length=n.length;return this};var p4e=1073741824;function R4t(t){if(t>=p4e){t=p4e}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}o(R4t,"computeNewHighWaterMark");function f4e(t,e){if(t<=0||e.length===0&&e.ended)return 0;if(e.objectMode)return 1;if(t!==t){if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length}if(t>e.highWaterMark)e.highWaterMark=R4t(t);if(t<=e.length)return t;if(!e.ended){e.needReadable=true;return 0}return e.length}o(f4e,"howMuchToRead");Lr.prototype.read=function(t){Zt("read",t);t=parseInt(t,10);var e=this._readableState;var r=t;if(t!==0)e.emittedReadable=false;if(t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended)){Zt("read: emitReadable",e.length,e.ended);if(e.length===0&&e.ended)uM(this);else mT(this);return null}t=f4e(t,e);if(t===0&&e.ended){if(e.length===0)uM(this);return null}var n=e.needReadable;Zt("need readable",n);if(e.length===0||e.length-t<e.highWaterMark){n=true;Zt("length less than watermark",n)}if(e.ended||e.reading){n=false;Zt("reading or ended",n)}else if(n){Zt("do read");e.reading=true;e.sync=true;if(e.length===0)e.needReadable=true;this._read(e.highWaterMark);e.sync=false;if(!e.reading)t=f4e(r,e)}var i;if(t>0)i=_4e(t,e);else i=null;if(i===null){e.needReadable=e.length<=e.highWaterMark;t=0}else{e.length-=t;e.awaitDrain=0}if(e.length===0){if(!e.ended)e.needReadable=true;if(r!==t&&e.ended)uM(this)}if(i!==null)this.emit("data",i);return i};function O4t(t,e){Zt("onEofChunk");if(e.ended)return;if(e.decoder){var r=e.decoder.end();if(r&&r.length){e.buffer.push(r);e.length+=e.objectMode?1:r.length}}e.ended=true;if(e.sync){mT(t)}else{e.needReadable=false;if(!e.emittedReadable){e.emittedReadable=true;y4e(t)}}}o(O4t,"onEofChunk");function mT(t){var e=t._readableState;Zt("emitReadable",e.needReadable,e.emittedReadable);e.needReadable=false;if(!e.emittedReadable){Zt("emitReadable",e.flowing);e.emittedReadable=true;process.nextTick(y4e,t)}}o(mT,"emitReadable");function y4e(t){var e=t._readableState;Zt("emitReadable_",e.destroyed,e.length,e.ended);if(!e.destroyed&&(e.length||e.ended)){t.emit("readable");e.emittedReadable=false}e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark;dM(t)}o(y4e,"emitReadable_");function lM(t,e){if(!e.readingMore){e.readingMore=true;process.nextTick(N4t,t,e)}}o(lM,"maybeReadMore");function N4t(t,e){while(!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0)){var r=e.length;Zt("maybeReadMore read 0");t.read(0);if(r===e.length)break}e.readingMore=false}o(N4t,"maybeReadMore_");Lr.prototype._read=function(t){wE(this,new T4t("_read()"))};Lr.prototype.pipe=function(t,e){var r=this;var n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1;Zt("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==false)&&t!==process.stdout&&t!==process.stderr;var s=i?u:g;if(n.endEmitted)process.nextTick(s);else r.once("end",s);t.on("unpipe",a);function a(y,v){Zt("onunpipe");if(y===r){if(v&&v.hasUnpiped===false){v.hasUnpiped=true;d()}}}o(a,"onunpipe");function u(){Zt("onend");t.end()}o(u,"onend");var l=I4t(r);t.on("drain",l);var c=false;function d(){Zt("cleanup");t.removeListener("close",h);t.removeListener("finish",m);t.removeListener("drain",l);t.removeListener("error",f);t.removeListener("unpipe",a);r.removeListener("end",u);r.removeListener("end",g);r.removeListener("data",p);c=true;if(n.awaitDrain&&(!t._writableState||t._writableState.needDrain))l()}o(d,"cleanup");r.on("data",p);function p(y){Zt("ondata");var v=t.write(y);Zt("dest.write",v);if(v===false){if((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&E4e(n.pipes,t)!==-1)&&!c){Zt("false write response, pause",n.awaitDrain);n.awaitDrain++}r.pause()}}o(p,"ondata");function f(y){Zt("onerror",y);g();t.removeListener("error",f);if(h4e(t,"error")===0)wE(t,y)}o(f,"onerror");x4t(t,"error",f);function h(){t.removeListener("finish",m);g()}o(h,"onclose");t.once("close",h);function m(){Zt("onfinish");t.removeListener("close",h);g()}o(m,"onfinish");t.once("finish",m);function g(){Zt("unpipe");r.unpipe(t)}o(g,"unpipe");t.emit("pipe",r);if(!n.flowing){Zt("pipe resume");r.resume()}return t};function I4t(t){return o(function e(){var r=t._readableState;Zt("pipeOnDrain",r.awaitDrain);if(r.awaitDrain)r.awaitDrain--;if(r.awaitDrain===0&&h4e(t,"data")){r.flowing=true;dM(t)}},"pipeOnDrainFunctionResult")}o(I4t,"pipeOnDrain");Lr.prototype.unpipe=function(t){var e=this._readableState;var r={hasUnpiped:false};if(e.pipesCount===0)return this;if(e.pipesCount===1){if(t&&t!==e.pipes)return this;if(!t)t=e.pipes;e.pipes=null;e.pipesCount=0;e.flowing=false;if(t)t.emit("unpipe",this,r);return this}if(!t){var n=e.pipes;var i=e.pipesCount;e.pipes=null;e.pipesCount=0;e.flowing=false;for(var s=0;s<i;s++){n[s].emit("unpipe",this,{hasUnpiped:false})}return this}var a=E4e(e.pipes,t);if(a===-1)return this;e.pipes.splice(a,1);e.pipesCount-=1;if(e.pipesCount===1)e.pipes=e.pipes[0];t.emit("unpipe",this,r);return this};Lr.prototype.on=function(t,e){var r=SE.prototype.on.call(this,t,e);var n=this._readableState;if(t==="data"){n.readableListening=this.listenerCount("readable")>0;if(n.flowing!==false)this.resume()}else if(t==="readable"){if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.flowing=false;n.emittedReadable=false;Zt("on readable",n.length,n.reading);if(n.length){mT(this)}else if(!n.reading){process.nextTick(P4t,this)}}}return r};Lr.prototype.addListener=Lr.prototype.on;Lr.prototype.removeListener=function(t,e){var r=SE.prototype.removeListener.call(this,t,e);if(t==="readable"){process.nextTick(v4e,this)}return r};Lr.prototype.removeAllListeners=function(t){var e=SE.prototype.removeAllListeners.apply(this,arguments);if(t==="readable"||t===void 0){process.nextTick(v4e,this)}return e};function v4e(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0;if(e.resumeScheduled&&!e.paused){e.flowing=true}else if(t.listenerCount("data")>0){t.resume()}}o(v4e,"updateReadableListening");function P4t(t){Zt("readable nexttick read 0");t.read(0)}o(P4t,"nReadingNextTick");Lr.prototype.resume=function(){var t=this._readableState;if(!t.flowing){Zt("resume");t.flowing=!t.readableListening;D4t(this,t)}t.paused=false;return this};function D4t(t,e){if(!e.resumeScheduled){e.resumeScheduled=true;process.nextTick(k4t,t,e)}}o(D4t,"resume");function k4t(t,e){Zt("resume",e.reading);if(!e.reading){t.read(0)}e.resumeScheduled=false;t.emit("resume");dM(t);if(e.flowing&&!e.reading)t.read(0)}o(k4t,"resume_");Lr.prototype.pause=function(){Zt("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){Zt("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function dM(t){var e=t._readableState;Zt("flow",e.flowing);while(e.flowing&&t.read()!==null){;}}o(dM,"flow");Lr.prototype.wrap=function(t){var e=this;var r=this._readableState;var n=false;t.on("end",function(){Zt("wrapped end");if(r.decoder&&!r.ended){var a=r.decoder.end();if(a&&a.length)e.push(a)}e.push(null)});t.on("data",function(a){Zt("wrapped data");if(r.decoder)a=r.decoder.write(a);if(r.objectMode&&(a===null||a===void 0))return;else if(!r.objectMode&&(!a||!a.length))return;var u=e.push(a);if(!u){n=true;t.pause()}});for(var i in t){if(this[i]===void 0&&typeof t[i]==="function"){this[i]=o(function a(u){return o(function l(){return t[u].apply(t,arguments)},"methodWrapReturnFunction")},"methodWrap")(i)}}for(var s=0;s<aM.length;s++){t.on(aM[s],this.emit.bind(this,aM[s]))}this._read=function(a){Zt("wrapped _read",a);if(n){n=false;t.resume()}};return this};if(typeof Symbol==="function"){Lr.prototype[Symbol.asyncIterator]=function(){if(iM===void 0){iM=o4e()}return iM(this)}}Object.defineProperty(Lr.prototype,"readableHighWaterMark",{enumerable:false,get:o(function t(){return this._readableState.highWaterMark},"get")});Object.defineProperty(Lr.prototype,"readableBuffer",{enumerable:false,get:o(function t(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(Lr.prototype,"readableFlowing",{enumerable:false,get:o(function t(){return this._readableState.flowing},"get"),set:o(function t(e){if(this._readableState){this._readableState.flowing=e}},"set")});Lr._fromList=_4e;Object.defineProperty(Lr.prototype,"readableLength",{enumerable:false,get:o(function t(){return this._readableState.length},"get")});function _4e(t,e){if(e.length===0)return null;var r;if(e.objectMode)r=e.buffer.shift();else if(!t||t>=e.length){if(e.decoder)r=e.buffer.join("");else if(e.buffer.length===1)r=e.buffer.first();else r=e.buffer.concat(e.length);e.buffer.clear()}else{r=e.buffer.consume(t,e.decoder)}return r}o(_4e,"fromList");function uM(t){var e=t._readableState;Zt("endReadable",e.endEmitted);if(!e.endEmitted){e.ended=true;process.nextTick($4t,e,t)}}o(uM,"endReadable");function $4t(t,e){Zt("endReadableNT",t.endEmitted,t.length);if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end");if(t.autoDestroy){var r=e._writableState;if(!r||r.autoDestroy&&r.finished){e.destroy()}}}}o($4t,"endReadableNT");if(typeof Symbol==="function"){Lr.from=function(t,e){if(sM===void 0){sM=d4e()}return sM(Lr,t,e)}}function E4e(t,e){for(var r=0,n=t.length;r<n;r++){if(t[r]===e)return r}return-1}o(E4e,"indexOf")});var pM=_((qar,S4e)=>{"use strict";S4e.exports=qc;var gT=bp().codes;var L4t=gT.ERR_METHOD_NOT_IMPLEMENTED;var q4t=gT.ERR_MULTIPLE_CALLBACK;var j4t=gT.ERR_TRANSFORM_ALREADY_TRANSFORMING;var U4t=gT.ERR_TRANSFORM_WITH_LENGTH_0;var yT=Qh();Jh()(qc,yT);function F4t(t,e){var r=this._transformState;r.transforming=false;var n=r.writecb;if(n===null){return this.emit("error",new q4t)}r.writechunk=null;r.writecb=null;if(e!=null)this.push(e);n(t);var i=this._readableState;i.reading=false;if(i.needReadable||i.length<i.highWaterMark){this._read(i.highWaterMark)}}o(F4t,"afterTransform");function qc(t){if(!(this instanceof qc))return new qc(t);yT.call(this,t);this._transformState={afterTransform:F4t.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",M4t)}o(qc,"Transform");function M4t(){var t=this;if(typeof this._flush==="function"&&!this._readableState.destroyed){this._flush(function(e,r){w4e(t,e,r)})}else{w4e(this,null,null)}}o(M4t,"prefinish");qc.prototype.push=function(t,e){this._transformState.needTransform=false;return yT.prototype.push.call(this,t,e)};qc.prototype._transform=function(t,e,r){r(new L4t("_transform()"))};qc.prototype._write=function(t,e,r){var n=this._transformState;n.writecb=r;n.writechunk=t;n.writeencoding=e;if(!n.transforming){var i=this._readableState;if(n.needTransform||i.needReadable||i.length<i.highWaterMark)this._read(i.highWaterMark)}};qc.prototype._read=function(t){var e=this._transformState;if(e.writechunk!==null&&!e.transforming){e.transforming=true;this._transform(e.writechunk,e.writeencoding,e.afterTransform)}else{e.needTransform=true}};qc.prototype._destroy=function(t,e){yT.prototype._destroy.call(this,t,function(r){e(r)})};function w4e(t,e,r){if(e)return t.emit("error",e);if(r!=null)t.push(r);if(t._writableState.length)throw new U4t;if(t._transformState.transforming)throw new j4t;return t.push(null)}o(w4e,"done")});var x4e=_((Uar,A4e)=>{"use strict";A4e.exports=TE;var T4e=pM();Jh()(TE,T4e);function TE(t){if(!(this instanceof TE))return new TE(t);T4e.call(this,t)}o(TE,"PassThrough");TE.prototype._transform=function(t,e,r){r(null,t)}});var I4e=_((Mar,N4e)=>{"use strict";var fM;function B4t(t){var e=false;return function(){if(e)return;e=true;t.apply(void 0,arguments)}}o(B4t,"once");var O4e=bp().codes;var V4t=O4e.ERR_MISSING_ARGS;var H4t=O4e.ERR_STREAM_DESTROYED;function C4e(t){if(t)throw t}o(C4e,"noop");function z4t(t){return t.setHeader&&typeof t.abort==="function"}o(z4t,"isRequest");function G4t(t,e,r,n){n=B4t(n);var i=false;t.on("close",function(){i=true});if(fM===void 0)fM=cT();fM(t,{readable:e,writable:r},function(a){if(a)return n(a);i=true;n()});var s=false;return function(a){if(i)return;if(s)return;s=true;if(z4t(t))return t.abort();if(typeof t.destroy==="function")return t.destroy();n(a||new H4t("pipe"))}}o(G4t,"destroyer");function R4e(t){t()}o(R4e,"call");function K4t(t,e){return t.pipe(e)}o(K4t,"pipe");function Y4t(t){if(!t.length)return C4e;if(typeof t[t.length-1]!=="function")return C4e;return t.pop()}o(Y4t,"popCallback");function W4t(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n=Y4t(e);if(Array.isArray(e[0]))e=e[0];if(e.length<2){throw new V4t("streams")}var i;var s=e.map(function(a,u){var l=u<e.length-1;var c=u>0;return G4t(a,l,c,function(d){if(!i)i=d;if(d)s.forEach(R4e);if(l)return;s.forEach(R4e);n(i)})});return e.reduce(K4t)}o(W4t,"pipeline");N4e.exports=W4t});var P4e=_((bo,xE)=>{var AE=require("stream");if(process.env.READABLE_STREAM==="disable"&&AE){xE.exports=AE.Readable;Object.assign(xE.exports,AE);xE.exports.Stream=AE}else{bo=xE.exports=QF();bo.Stream=AE||bo;bo.Readable=bo;bo.Writable=YF();bo.Duplex=Qh();bo.Transform=pM();bo.PassThrough=x4e();bo.finished=cT();bo.pipeline=I4e()}});var $4e=_((Var,k4e)=>{k4e.exports=D4e;function D4e(t,e){if(t&&e)return D4e(t)(e);if(typeof t!=="function")throw new TypeError("need wrapper function");Object.keys(t).forEach(function(n){r[n]=t[n]});return r;function r(){var n=new Array(arguments.length);for(var i=0;i<n.length;i++){n[i]=arguments[i]}var s=t.apply(this,n);var a=n[n.length-1];if(typeof s==="function"&&s!==a){Object.keys(a).forEach(function(u){s[u]=a[u]})}return s}o(r,"wrapper")}o(D4e,"wrappy")});var j4e=_((zar,hM)=>{var L4e=$4e();hM.exports=L4e(vT);hM.exports.strict=L4e(q4e);vT.proto=vT(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return vT(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return q4e(this)},configurable:true})});function vT(t){var e=o(function(){if(e.called)return e.value;e.called=true;return e.value=t.apply(this,arguments)},"f");e.called=false;return e}o(vT,"once");function q4e(t){var e=o(function(){if(e.called)throw new Error(e.onceError);e.called=true;return e.value=t.apply(this,arguments)},"f");var r=t.name||"Function wrapped with `once`";e.onceError=r+" shouldn't be called more than once";e.called=false;return e}o(q4e,"onceStrict")});var M4e=_((Kar,F4e)=>{var J4t=j4e();var Q4t=o(function(){},"noop");var X4t=o(function(t){return t.setHeader&&typeof t.abort==="function"},"isRequest");var Z4t=o(function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},"isChildProcess");var U4e=o(function(t,e,r){if(typeof e==="function")return U4e(t,null,e);if(!e)e={};r=J4t(r||Q4t);var n=t._writableState;var i=t._readableState;var s=e.readable||e.readable!==false&&t.readable;var a=e.writable||e.writable!==false&&t.writable;var u=false;var l=o(function(){if(!t.writable)c()},"onlegacyfinish");var c=o(function(){a=false;if(!s)r.call(t)},"onfinish");var d=o(function(){s=false;if(!a)r.call(t)},"onend");var p=o(function(y){r.call(t,y?new Error("exited with error code: "+y):null)},"onexit");var f=o(function(y){r.call(t,y)},"onerror");var h=o(function(){process.nextTick(m)},"onclose");var m=o(function(){if(u)return;if(s&&!(i&&(i.ended&&!i.destroyed)))return r.call(t,new Error("premature close"));if(a&&!(n&&(n.ended&&!n.destroyed)))return r.call(t,new Error("premature close"))},"onclosenexttick");var g=o(function(){t.req.on("finish",c)},"onrequest");if(X4t(t)){t.on("complete",c);t.on("abort",h);if(t.req)g();else t.on("request",g)}else if(a&&!n){t.on("end",l);t.on("close",l)}if(Z4t(t))t.on("exit",p);t.on("end",d);t.on("finish",c);if(e.error!==false)t.on("error",f);t.on("close",h);return function(){u=true;t.removeListener("complete",c);t.removeListener("abort",h);t.removeListener("request",g);if(t.req)t.req.removeListener("finish",c);t.removeListener("end",l);t.removeListener("close",l);t.removeListener("finish",c);t.removeListener("exit",p);t.removeListener("end",d);t.removeListener("error",f);t.removeListener("close",h)}},"eos");F4e.exports=U4e});var V4e=_((War,B4e)=>{B4e.exports=eEt;function eEt(t){var e=t._readableState;if(!e)return null;return e.objectMode||typeof t._duplexState==="number"?t.read():t.read(tEt(e))}o(eEt,"shift");function tEt(t){if(t.buffer.length){if(t.buffer.head){return t.buffer.head.data.length}return t.buffer[0].length}return t.length}o(tEt,"getStateLength")});var gM=_((Qar,K4e)=>{var _T=P4e();var H4e=M4e();var rEt=Jh();var nEt=V4e();var z4e=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]);var mM=o(function(t,e){if(t._corked)t.once("uncork",e);else e()},"onuncork");var iEt=o(function(t,e){if(t._autoDestroy)t.destroy(e)},"autoDestroy");var G4e=o(function(t,e){return function(r){if(r)iEt(t,r.message==="premature close"?null:r);else if(e&&!t._ended)t.end()}},"destroyer");var sEt=o(function(t,e){if(!t)return e();if(t._writableState&&t._writableState.finished)return e();if(t._writableState)return t.end(e);t.end();e()},"end");var aEt=o(function(){},"noop");var oEt=o(function(t){return new _T.Readable({objectMode:true,highWaterMark:16}).wrap(t)},"toStreams2");var Zi=o(function(t,e,r){if(!(this instanceof Zi))return new Zi(t,e,r);_T.Duplex.call(this,r);this._writable=null;this._readable=null;this._readable2=null;this._autoDestroy=!r||r.autoDestroy!==false;this._forwardDestroy=!r||r.destroy!==false;this._forwardEnd=!r||r.end!==false;this._corked=1;this._ondrain=null;this._drained=false;this._forwarding=false;this._unwrite=null;this._unread=null;this._ended=false;this.destroyed=false;if(t)this.setWritable(t);if(e)this.setReadable(e)},"Duplexify");rEt(Zi,_T.Duplex);Zi.obj=function(t,e,r){if(!r)r={};r.objectMode=true;r.highWaterMark=16;return new Zi(t,e,r)};Zi.prototype.cork=function(){if(++this._corked===1)this.emit("cork")};Zi.prototype.uncork=function(){if(this._corked&&--this._corked===0)this.emit("uncork")};Zi.prototype.setWritable=function(t){if(this._unwrite)this._unwrite();if(this.destroyed){if(t&&t.destroy)t.destroy();return}if(t===null||t===false){this.end();return}var e=this;var r=H4e(t,{writable:true,readable:false},G4e(this,this._forwardEnd));var n=o(function(){var s=e._ondrain;e._ondrain=null;if(s)s()},"ondrain");var i=o(function(){e._writable.removeListener("drain",n);r()},"clear");if(this._unwrite)process.nextTick(n);this._writable=t;this._writable.on("drain",n);this._unwrite=i;this.uncork()};Zi.prototype.setReadable=function(t){if(this._unread)this._unread();if(this.destroyed){if(t&&t.destroy)t.destroy();return}if(t===null||t===false){this.push(null);this.resume();return}var e=this;var r=H4e(t,{writable:false,readable:true},G4e(this));var n=o(function(){e._forward()},"onreadable");var i=o(function(){e.push(null)},"onend");var s=o(function(){e._readable2.removeListener("readable",n);e._readable2.removeListener("end",i);r()},"clear");this._drained=true;this._readable=t;this._readable2=t._readableState?t:oEt(t);this._readable2.on("readable",n);this._readable2.on("end",i);this._unread=s;this._forward()};Zi.prototype._read=function(){this._drained=true;this._forward()};Zi.prototype._forward=function(){if(this._forwarding||!this._readable2||!this._drained)return;this._forwarding=true;var t;while(this._drained&&(t=nEt(this._readable2))!==null){if(this.destroyed)continue;this._drained=this.push(t)}this._forwarding=false};Zi.prototype.destroy=function(t,e){if(!e)e=aEt;if(this.destroyed)return e(null);this.destroyed=true;var r=this;process.nextTick(function(){r._destroy(t);e(null)})};Zi.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null;if(e)e(t);else this.emit("error",t)}if(this._forwardDestroy){if(this._readable&&this._readable.destroy)this._readable.destroy();if(this._writable&&this._writable.destroy)this._writable.destroy()}this.emit("close")};Zi.prototype._write=function(t,e,r){if(this.destroyed)return;if(this._corked)return mM(this,this._write.bind(this,t,e,r));if(t===z4e)return this._finish(r);if(!this._writable)return r();if(this._writable.write(t)===false)this._ondrain=r;else if(!this.destroyed)r()};Zi.prototype._finish=function(t){var e=this;this.emit("preend");mM(this,function(){sEt(e._forwardEnd&&e._writable,function(){if(e._writableState.prefinished===false)e._writableState.prefinished=true;e.emit("prefinish");mM(e,t)})})};Zi.prototype.end=function(t,e,r){if(typeof t==="function")return this.end(null,null,t);if(typeof e==="function")return this.end(t,null,e);this._ended=true;if(t)this.write(t);if(!this._writableState.ending&&!this._writableState.destroyed)this.write(z4e);return _T.Writable.prototype.end.call(this,r)};K4e.exports=Zi});var rm=_(Jn=>{"use strict";var uEt=Jn&&Jn.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var lEt=Jn&&Jn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var Q4e=Jn&&Jn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))uEt(e,t,r)}lEt(e,t);return e};var X4e=Jn&&Jn.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Jn,"__esModule",{value:true});Jn.util=Jn.Util=Jn.PartialFailureError=Jn.ApiError=Jn.GCCL_GCS_CMD_KEY=void 0;var CE=_ge();var cEt=Q4e(Rge());var Y4e=KS();var W4e=X4e(Ive());var dEt=require("stream");var J4e=A_e();var pEt=Q4e((M1(),zm(F1)));var yM=EM();var vM=yl();var fEt=X4e(gM());var hEt=bg();var mEt=(0,hEt.getPackageJSON)();Jn.GCCL_GCS_CMD_KEY=Symbol.for("GCCL_GCS_CMD");var ET={timeout:6e4,gzip:true,forever:true,pool:{maxSockets:Infinity}};var gEt=true;var yEt=3;var tm=class t extends Error{static{o(this,"ApiError")}constructor(e){super();if(typeof e!=="object"){this.message=e||"";return}const r=e;this.code=r.code;this.errors=r.errors;this.response=r.response;try{this.errors=JSON.parse(this.response.body).error.errors}catch(n){this.errors=r.errors}this.message=t.createMultiErrorMessage(r,this.errors);Error.captureStackTrace(this)}static createMultiErrorMessage(e,r){const n=new Set;if(e.message){n.add(e.message)}if(r&&r.length){r.forEach(({message:s})=>n.add(s))}else if(e.response&&e.response.body){n.add(cEt.decode(e.response.body.toString()))}else if(!e.message){n.add("A failure occurred during this request.")}let i=Array.from(n);if(i.length>1){i=i.map((s,a)=>` ${a+1}. ${s}`);i.unshift("Multiple errors occurred during the request. Please see the `errors` array for complete details.\n");i.push("\n")}return i.join("\n")}};Jn.ApiError=tm;var bT=class extends Error{static{o(this,"PartialFailureError")}constructor(e){super();const r=e;this.errors=r.errors;this.name="PartialFailureError";this.response=r.response;this.message=tm.createMultiErrorMessage(r,this.errors)}};Jn.PartialFailureError=bT;var wT=class{static{o(this,"Util")}constructor(){this.ApiError=tm;this.PartialFailureError=bT}noop(){}handleResp(e,r,n,i){i=i||qa.noop;const s={err:e||null,...r&&qa.parseHttpRespMessage(r),...n&&qa.parseHttpRespBody(n)};if(!s.err&&r&&typeof s.body==="object"){s.resp.body=s.body}if(s.err&&r){s.err.response=r}i(s.err,s.body,s.resp)}parseHttpRespMessage(e){const r={resp:e};if(e.statusCode<200||e.statusCode>299){r.err=new tm({errors:new Array,code:e.statusCode,message:e.statusMessage,response:e})}return r}parseHttpRespBody(e){const r={body:e};if(typeof e==="string"){try{r.body=JSON.parse(e)}catch(n){r.body=e}}if(r.body&&r.body.error){r.err=new tm(r.body.error)}return r}makeWritableStream(e,r,n){var i;n=n||qa.noop;const s=new _M;s.on("progress",c=>e.emit("progress",c));e.setWritable(s);const a={method:"POST",qs:{uploadType:"multipart"},timeout:0,maxRetries:0};const u=r.metadata||{};const l={...a,...r.request,qs:{...a.qs,...(i=r.request)===null||i===void 0?void 0:i.qs},multipart:[{"Content-Type":"application/json",body:JSON.stringify(u)},{"Content-Type":u.contentType||"application/octet-stream",body:s}]};r.makeAuthenticatedRequest(l,{onAuthenticated(c,d){if(c){e.destroy(c);return}ET.headers=qa._getDefaultHeaders(l[Jn.GCCL_GCS_CMD_KEY]);const p=J4e.teenyRequest.defaults(ET);p(d,(f,h,m)=>{qa.handleResp(f,h,m,(g,y)=>{if(g){e.destroy(g);return}e.emit("response",h);n(y)})})}})}shouldRetryRequest(e){if(e){if([408,429,500,502,503,504].indexOf(e.code)!==-1){return true}if(e.errors){for(const r of e.errors){const n=r.reason;if(n==="rateLimitExceeded"){return true}if(n==="userRateLimitExceeded"){return true}if(n&&n.includes("EAI_AGAIN")){return true}}}}return false}makeAuthenticatedRequestFactory(e){const r={...e};if(r.projectId===yM.DEFAULT_PROJECT_ID_TOKEN){delete r.projectId}let n;if(r.authClient instanceof Y4e.GoogleAuth){n=r.authClient}else{const a={...r,authClient:r.authClient};n=new Y4e.GoogleAuth(a)}function i(a,u){let l;let c;const d={...e};let p;if(!u){l=(0,fEt.default)();d.stream=l}const f=typeof u==="object"?u:void 0;const h=typeof u==="function"?u:void 0;async function m(){c=await n.getProjectId()}o(m,"setProjectId");const g=o(async(v,w)=>{const E=v;const b=v&&typeof v.message==="string"&&v.message.indexOf("Could not load the default credentials")>-1;if(b){w=a}if(!v||b){try{w=qa.decorateRequest(w,c);v=null}catch(S){if(S instanceof CE.MissingProjectIdError){try{await m();w=qa.decorateRequest(w,c);v=null}catch(T){v=v||T}}else{v=v||S}}}if(v){if(l){l.destroy(v)}else{const S=f&&f.onAuthenticated?f.onAuthenticated:h;S(v)}return}if(f&&f.onAuthenticated){f.onAuthenticated(null,w)}else{p=qa.makeRequest(w,d,(S,...T)=>{if(S&&S.code===401&&E){S=E}h(S,...T)})}},"onAuthenticated");const y=o(async()=>{try{const v=o(async()=>{if(e.projectId&&e.projectId!==yM.DEFAULT_PROJECT_ID_TOKEN){return e.projectId}if(e.projectIdRequired===false){return yM.DEFAULT_PROJECT_ID_TOKEN}return m()},"getProjectId");const w=o(async()=>{if(d.customEndpoint&&!d.useAuthWithCustomEndpoint){return a}else{return n.authorizeRequest(a)}},"authorizeRequest");const[E,b]=await Promise.all([v(),w()]);if(E){c=E}return g(null,b)}catch(v){return g(v)}},"prepareRequest");y();if(l){return l}return{abort(){setImmediate(()=>{if(p){p.abort();p=null}})}}}o(i,"makeAuthenticatedRequest");const s=i;s.getCredentials=n.getCredentials.bind(n);s.authClient=n;return s}makeRequest(e,r,n){var i,s,a,u,l;let c=gEt;if(r.autoRetry!==void 0){c=r.autoRetry}else if(((i=r.retryOptions)===null||i===void 0?void 0:i.autoRetry)!==void 0){c=r.retryOptions.autoRetry}let d=yEt;if(r.maxRetries!==void 0){d=r.maxRetries}else if(((s=r.retryOptions)===null||s===void 0?void 0:s.maxRetries)!==void 0){d=r.retryOptions.maxRetries}ET.headers=this._getDefaultHeaders(e[Jn.GCCL_GCS_CMD_KEY]);const p={request:J4e.teenyRequest.defaults(ET),retries:c!==false?d:0,noResponseRetries:c!==false?d:0,shouldRetryFn(g){var y,v;const w=qa.parseHttpRespMessage(g).err;if((y=r.retryOptions)===null||y===void 0?void 0:y.retryableErrorFn){return w&&((v=r.retryOptions)===null||v===void 0?void 0:v.retryableErrorFn(w))}return w&&qa.shouldRetryRequest(w)},maxRetryDelay:(a=r.retryOptions)===null||a===void 0?void 0:a.maxRetryDelay,retryDelayMultiplier:(u=r.retryOptions)===null||u===void 0?void 0:u.retryDelayMultiplier,totalTimeout:(l=r.retryOptions)===null||l===void 0?void 0:l.totalTimeout};if(typeof e.maxRetries==="number"){p.retries=e.maxRetries;p.noResponseRetries=e.maxRetries}if(!r.stream){return(0,W4e.default)(e,p,(g,y,v)=>{qa.handleResp(g,y,v,n)})}const f=r.stream;let h;const m=(e.method||"GET").toUpperCase()==="GET";if(m){h=(0,W4e.default)(e,p);f.setReadable(h)}else{h=p.request(e);f.setWritable(h)}h.on("error",f.destroy.bind(f)).on("response",f.emit.bind(f,"response")).on("complete",f.emit.bind(f,"complete"));f.abort=h.abort;return f}decorateRequest(e,r){delete e.autoPaginate;delete e.autoPaginateVal;delete e.objectMode;if(e.qs!==null&&typeof e.qs==="object"){delete e.qs.autoPaginate;delete e.qs.autoPaginateVal;e.qs=(0,CE.replaceProjectIdToken)(e.qs,r)}if(Array.isArray(e.multipart)){e.multipart=e.multipart.map(n=>{return(0,CE.replaceProjectIdToken)(n,r)})}if(e.json!==null&&typeof e.json==="object"){delete e.json.autoPaginate;delete e.json.autoPaginateVal;e.json=(0,CE.replaceProjectIdToken)(e.json,r)}e.uri=(0,CE.replaceProjectIdToken)(e.uri,r);return e}isCustomType(e,r){function n(l){return l.constructor&&l.constructor.name.toLowerCase()}o(n,"getConstructorName");const i=r.split("/");const s=i[0]&&i[0].toLowerCase();const a=i[1]&&i[1].toLowerCase();if(a&&n(e)!==a){return false}let u=e;while(true){if(n(u)===s){return true}u=u.parent;if(!u){return false}}}maybeOptionsOrCallback(e,r){return typeof e==="function"?[{},e]:[e,r]}_getDefaultHeaders(e){const r={"User-Agent":(0,vM.getUserAgentString)(),"x-goog-api-client":`${(0,vM.getRuntimeTrackingString)()} gccl/${mEt.version}-${(0,vM.getModuleFormat)()} gccl-invocation-id/${pEt.v4()}`};if(e){r["x-goog-api-client"]+=` gccl-gcs-cmd/${e}`}return r}};Jn.Util=wT;var _M=class extends dEt.Transform{static{o(this,"ProgressStream")}constructor(){super(...arguments);this.bytesRead=0}_transform(e,r,n){this.bytesRead+=e.length;this.emit("progress",{bytesWritten:this.bytesRead,contentLength:"*"});this.push(e);n()}};var qa=new wT;Jn.util=qa});var EM=_(ma=>{"use strict";var vEt=ma&&ma.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var _Et=ma&&ma.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var EEt=ma&&ma.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))vEt(e,t,r)}_Et(e,t);return e};Object.defineProperty(ma,"__esModule",{value:true});ma.Service=ma.DEFAULT_PROJECT_ID_TOKEN=void 0;var bEt=EEt((M1(),zm(F1)));var bM=rm();var wM=yl();ma.DEFAULT_PROJECT_ID_TOKEN="{{projectId}}";var SM=class t{static{o(this,"Service")}constructor(e,r={}){this.baseUrl=e.baseUrl;this.apiEndpoint=e.apiEndpoint;this.timeout=r.timeout;this.globalInterceptors=Array.isArray(r.interceptors_)?r.interceptors_:[];this.interceptors=[];this.packageJson=e.packageJson;this.projectId=r.projectId||ma.DEFAULT_PROJECT_ID_TOKEN;this.projectIdRequired=e.projectIdRequired!==false;this.providedUserAgent=r.userAgent;const n={...e,projectIdRequired:this.projectIdRequired,projectId:this.projectId,authClient:r.authClient||e.authClient,credentials:r.credentials,keyFile:r.keyFilename,email:r.email,token:r.token};this.makeAuthenticatedRequest=bM.util.makeAuthenticatedRequestFactory(n);this.authClient=this.makeAuthenticatedRequest.authClient;this.getCredentials=this.makeAuthenticatedRequest.getCredentials;const i=!!process.env.FUNCTION_NAME;if(i){this.interceptors.push({request(s){s.forever=false;return s}})}}getRequestInterceptors(){return[].slice.call(this.globalInterceptors).concat(this.interceptors).filter(e=>typeof e.request==="function").map(e=>e.request)}getProjectId(e){if(!e){return this.getProjectIdAsync()}this.getProjectIdAsync().then(r=>e(null,r),e)}async getProjectIdAsync(){const e=await this.authClient.getProjectId();if(this.projectId===ma.DEFAULT_PROJECT_ID_TOKEN&&e){this.projectId=e}return this.projectId}request_(e,r){e={...e,timeout:this.timeout};const n=e.uri.indexOf("http")===0;const i=[this.baseUrl];if(this.projectIdRequired){if(e.projectId){i.push("projects");i.push(e.projectId)}else{i.push("projects");i.push(this.projectId)}}i.push(e.uri);if(n){i.splice(0,i.indexOf(e.uri))}e.uri=i.map(c=>{const d=/^\/*|\/*$/g;return c.replace(d,"")}).join("/").replace(/\/:/g,":");const s=this.getRequestInterceptors();const a=Array.isArray(e.interceptors_)?e.interceptors_:[];a.forEach(c=>{if(typeof c.request==="function"){s.push(c.request)}});s.forEach(c=>{e=c(e)});delete e.interceptors_;const u=this.packageJson;let l=(0,wM.getUserAgentString)();if(this.providedUserAgent){l=`${this.providedUserAgent} ${l}`}e.headers={...e.headers,"User-Agent":l,"x-goog-api-client":`${(0,wM.getRuntimeTrackingString)()} gccl/${u.version}-${(0,wM.getModuleFormat)()} gccl-invocation-id/${bEt.v4()}`};if(e[bM.GCCL_GCS_CMD_KEY]){e.headers["x-goog-api-client"]+=` gccl-gcs-cmd/${e[bM.GCCL_GCS_CMD_KEY]}`}if(e.shouldReturnStream){return this.makeAuthenticatedRequest(e)}else{this.makeAuthenticatedRequest(e,r)}}request(e,r){t.prototype.request_.call(this,e,r)}requestStream(e){const r={...e,shouldReturnStream:true};return t.prototype.request_.call(this,r)}};ma.Service=SM});var _l=_(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:true});wo.callbackifyAll=wo.callbackify=wo.promisifyAll=wo.promisify=void 0;function wEt(t,e){if(t.promisified_){return t}e=e||{};const r=Array.prototype.slice;const n=o(function(){let i;for(i=arguments.length-1;i>=0;i--){const u=arguments[i];if(typeof u==="undefined"){continue}if(typeof u!=="function"){break}return t.apply(this,arguments)}const s=r.call(arguments,0,i+1);let a=Promise;if(this&&this.Promise){a=this.Promise}return new a((u,l)=>{s.push((...c)=>{const d=r.call(c);const p=d.shift();if(p){return l(p)}if(e.singular&&d.length===1){u(d[0])}else{u(d)}});t.apply(this,s)})},"wrapper");n.promisified_=true;return n}o(wEt,"promisify");wo.promisify=wEt;function SEt(t,e){const r=e&&e.exclude||[];const n=Object.getOwnPropertyNames(t.prototype);const i=n.filter(s=>{return!r.includes(s)&&typeof t.prototype[s]==="function"&&!/(^_|(Stream|_)|promise$)|^constructor$/.test(s)});i.forEach(s=>{const a=t.prototype[s];if(!a.promisified_){t.prototype[s]=wo.promisify(a,e)}})}o(SEt,"promisifyAll");wo.promisifyAll=SEt;function TEt(t){if(t.callbackified_){return t}const e=o(function(){if(typeof arguments[arguments.length-1]!=="function"){return t.apply(this,arguments)}const r=Array.prototype.pop.call(arguments);t.apply(this,arguments).then(n=>{n=Array.isArray(n)?n:[n];r(null,...n)},n=>r(n))},"wrapper");e.callbackified_=true;return e}o(TEt,"callbackify");wo.callbackify=TEt;function AEt(t,e){const r=e&&e.exclude||[];const n=Object.getOwnPropertyNames(t.prototype);const i=n.filter(s=>{return!r.includes(s)&&typeof t.prototype[s]==="function"&&!/^_|(Stream|_)|^constructor$/.test(s)});i.forEach(s=>{const a=t.prototype[s];if(!a.callbackified_){t.prototype[s]=wo.callbackify(a)}})}o(AEt,"callbackifyAll");wo.callbackifyAll=AEt});var Z4e=_(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:true});TT.ServiceObject=void 0;var xEt=_l();var CEt=require("events");var RE=rm();var ST=class t extends CEt.EventEmitter{static{o(this,"ServiceObject")}constructor(e){super();this.metadata={};this.baseUrl=e.baseUrl;this.parent=e.parent;this.id=e.id;this.createMethod=e.createMethod;this.methods=e.methods||{};this.interceptors=[];this.projectId=e.projectId;if(e.methods){Object.getOwnPropertyNames(t.prototype).filter(r=>{return!/^request/.test(r)&&!/^getRequestInterceptors/.test(r)&&this[r]===t.prototype[r]&&!e.methods[r]}).forEach(r=>{this[r]=void 0})}}create(e,r){const n=this;const i=[this.id];if(typeof e==="function"){r=e}if(typeof e==="object"){i.push(e)}function s(...a){const[u,l]=a;if(!u){n.metadata=l.metadata;if(n.id&&l.metadata){n.id=l.metadata.id}a[1]=n}r(...a)}o(s,"onCreate");i.push(s);this.createMethod.apply(null,i)}delete(e,r){var n;const[i,s]=RE.util.maybeOptionsOrCallback(e,r);const a=i.ignoreNotFound;delete i.ignoreNotFound;const u=typeof this.methods.delete==="object"&&this.methods.delete||{};const l={method:"DELETE",uri:"",...u.reqOpts,qs:{...(n=u.reqOpts)===null||n===void 0?void 0:n.qs,...i}};t.prototype.request.call(this,l,(c,d,p)=>{if(c){if(c.code===404&&a){c=null}}s(c,p)})}exists(e,r){const[n,i]=RE.util.maybeOptionsOrCallback(e,r);this.get(n,s=>{if(s){if(s.code===404){i(null,false)}else{i(s)}return}i(null,true)})}get(e,r){const n=this;const[i,s]=RE.util.maybeOptionsOrCallback(e,r);const a=Object.assign({},i);const u=a.autoCreate&&typeof this.create==="function";delete a.autoCreate;function l(c,d,p){if(c){if(c.code===409){n.get(a,s);return}s(c,null,p);return}s(null,d,p)}o(l,"onCreate");this.getMetadata(a,(c,d)=>{if(c){if(c.code===404&&u){const p=[];if(Object.keys(a).length>0){p.push(a)}p.push(l);n.create(...p);return}s(c,null,d);return}s(null,n,d)})}getMetadata(e,r){var n;const[i,s]=RE.util.maybeOptionsOrCallback(e,r);const a=typeof this.methods.getMetadata==="object"&&this.methods.getMetadata||{};const u={uri:"",...a.reqOpts,qs:{...(n=a.reqOpts)===null||n===void 0?void 0:n.qs,...i}};t.prototype.request.call(this,u,(l,c,d)=>{this.metadata=c;s(l,this.metadata,d)})}getRequestInterceptors(){const e=this.interceptors.filter(r=>typeof r.request==="function").map(r=>r.request);return this.parent.getRequestInterceptors().concat(e)}setMetadata(e,r,n){var i,s;const[a,u]=RE.util.maybeOptionsOrCallback(r,n);const l=typeof this.methods.setMetadata==="object"&&this.methods.setMetadata||{};const c={method:"PATCH",uri:"",...l.reqOpts,json:{...(i=l.reqOpts)===null||i===void 0?void 0:i.json,...e},qs:{...(s=l.reqOpts)===null||s===void 0?void 0:s.qs,...a}};t.prototype.request.call(this,c,(d,p,f)=>{this.metadata=p;u(d,this.metadata,f)})}request_(e,r){e={...e};if(this.projectId){e.projectId=this.projectId}const n=e.uri.indexOf("http")===0;const i=[this.baseUrl,this.id||"",e.uri];if(n){i.splice(0,i.indexOf(e.uri))}e.uri=i.filter(u=>u.trim()).map(u=>{const l=/^\/*|\/*$/g;return u.replace(l,"")}).join("/");const s=Array.isArray(e.interceptors_)?e.interceptors_:[];const a=[].slice.call(this.interceptors);e.interceptors_=s.concat(a);if(e.shouldReturnStream){return this.parent.requestStream(e)}this.parent.request(e,r)}request(e,r){this.request_(e,r)}requestStream(e){const r={...e,shouldReturnStream:true};return this.request_(r)}};TT.ServiceObject=ST;(0,xEt.promisifyAll)(ST,{exclude:["getRequestInterceptors"]})});var xp=_(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:true});El.util=El.ApiError=El.ServiceObject=El.Service=void 0;var REt=EM();Object.defineProperty(El,"Service",{enumerable:true,get:function(){return REt.Service}});var OEt=Z4e();Object.defineProperty(El,"ServiceObject",{enumerable:true,get:function(){return OEt.ServiceObject}});var eEe=rm();Object.defineProperty(El,"ApiError",{enumerable:true,get:function(){return eEe.ApiError}});Object.defineProperty(El,"util",{enumerable:true,get:function(){return eEe.util}})});var TM=_((uor,tEe)=>{"use strict";var NEt=o(t=>{if(t===null||t===void 0){return[]}if(Array.isArray(t)){return t}if(typeof t==="string"){return[t]}if(typeof t[Symbol.iterator]==="function"){return[...t]}return[t]},"arrify");tEe.exports=NEt});var rEe=_(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:true});AT.ResourceStream=void 0;var IEt=require("stream");var AM=class extends IEt.Transform{static{o(this,"ResourceStream")}constructor(e,r){const n=Object.assign({objectMode:true},e.streamOptions);super(n);this._ended=false;this._maxApiCalls=e.maxApiCalls===-1?Infinity:e.maxApiCalls;this._nextQuery=e.query;this._reading=false;this._requestFn=r;this._requestsMade=0;this._resultsToSend=e.maxResults===-1?Infinity:e.maxResults}end(...e){this._ended=true;return super.end(...e)}_read(){if(this._reading){return}this._reading=true;try{this._requestFn(this._nextQuery,(e,r,n)=>{if(e){this.destroy(e);return}this._nextQuery=n;if(this._resultsToSend!==Infinity){r=r.splice(0,this._resultsToSend);this._resultsToSend-=r.length}let i=true;for(const u of r){if(this._ended){break}i=this.push(u)}const s=!this._nextQuery||this._resultsToSend<1;const a=++this._requestsMade>=this._maxApiCalls;if(s||a){this.end()}if(i&&!this._ended){setImmediate(()=>this._read())}this._reading=false})}catch(e){this.destroy(e)}}};AT.ResourceStream=AM});var xM=_(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:true});Cp.ResourceStream=Cp.paginator=Cp.Paginator=void 0;var PEt=TM();var nEe=M4();var iEe=rEe();Object.defineProperty(Cp,"ResourceStream",{enumerable:true,get:function(){return iEe.ResourceStream}});var xT=class{static{o(this,"Paginator")}extend(e,r){r=PEt(r);r.forEach(n=>{const i=e.prototype[n];e.prototype[n+"_"]=i;e.prototype[n]=function(...s){const a=Cg.parseArguments_(s);return Cg.run_(a,i.bind(this))}})}streamify(e){return function(...r){const n=Cg.parseArguments_(r);const i=this[e+"_"]||this[e];return Cg.runAsStream_(n,i.bind(this))}}parseArguments_(e){let r;let n=true;let i=-1;let s=-1;let a;const u=e[0];const l=e[e.length-1];if(typeof u==="function"){a=u}else{r=u}if(typeof l==="function"){a=l}if(typeof r==="object"){r=nEe(true,{},r);if(r.maxResults&&typeof r.maxResults==="number"){s=r.maxResults}else if(typeof r.pageSize==="number"){s=r.pageSize}if(r.maxApiCalls&&typeof r.maxApiCalls==="number"){i=r.maxApiCalls;delete r.maxApiCalls}if(s!==-1||r.autoPaginate===false){n=false}}const c={query:r||{},autoPaginate:n,maxApiCalls:i,maxResults:s,callback:a};c.streamOptions=nEe(true,{},c.query);delete c.streamOptions.autoPaginate;delete c.streamOptions.maxResults;delete c.streamOptions.pageSize;return c}run_(e,r){const n=e.query;const i=e.callback;if(!e.autoPaginate){return r(n,i)}const s=new Array;const a=new Promise((u,l)=>{Cg.runAsStream_(e,r).on("error",l).on("data",c=>s.push(c)).on("end",()=>u(s))});if(!i){return a.then(u=>[u])}a.then(u=>i(null,u),u=>i(u))}runAsStream_(e,r){return new iEe.ResourceStream(e,r)}};Cp.Paginator=xT;var Cg=new xT;Cp.paginator=Cg});var sEe=_((mor,DEt)=>{DEt.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/3gpp-ims+xml":{source:"iana",compressible:true},"application/3gpphal+json":{source:"iana",compressible:true},"application/3gpphalforms+json":{source:"iana",compressible:true},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:true},"application/alto-costmap+json":{source:"iana",compressible:true},"application/alto-costmapfilter+json":{source:"iana",compressible:true},"application/alto-directory+json":{source:"iana",compressible:true},"application/alto-endpointcost+json":{source:"iana",compressible:true},"application/alto-endpointcostparams+json":{source:"iana",compressible:true},"application/alto-endpointprop+json":{source:"iana",compressible:true},"application/alto-endpointpropparams+json":{source:"iana",compressible:true},"application/alto-error+json":{source:"iana",compressible:true},"application/alto-networkmap+json":{source:"iana",compressible:true},"application/alto-networkmapfilter+json":{source:"iana",compressible:true},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:true},"application/alto-updatestreamparams+json":{source:"iana",compressible:true},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:true,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:true,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:true,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:true,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:true,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:true,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:true},"application/atsc-rsat+xml":{source:"iana",compressible:true,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:true},"application/bacnet-xdd+zip":{source:"iana",compressible:false},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:false,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/calendar+json":{source:"iana",compressible:true},"application/calendar+xml":{source:"iana",compressible:true,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:true},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:true},"application/ccxml+xml":{source:"iana",compressible:true,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:true,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:true},"application/cellml+xml":{source:"iana",compressible:true},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:true},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:true},"application/clue_info+xml":{source:"iana",compressible:true},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:true},"application/coap-group+json":{source:"iana",compressible:true},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:true},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:true,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:true},"application/cstadata+xml":{source:"iana",compressible:true},"application/csvm+json":{source:"iana",compressible:true},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:true},"application/dash+xml":{source:"iana",compressible:true,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:true,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:true,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:true},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:true},"application/dicom+xml":{source:"iana",compressible:true},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:true},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:true,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:true},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:true,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:true,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:false},"application/edifact":{source:"iana",compressible:false},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:true},"application/elm+xml":{source:"iana",compressible:true},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/emergencycalldata.comment+xml":{source:"iana",compressible:true},"application/emergencycalldata.control+xml":{source:"iana",compressible:true},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.veds+xml":{source:"iana",compressible:true},"application/emma+xml":{source:"iana",compressible:true,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:true,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:true},"application/epub+zip":{source:"iana",compressible:false,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:true},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:true,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:true},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/fido.trusted-apps+json":{compressible:true},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:false},"application/framework-attributes+xml":{source:"iana",compressible:true},"application/geo+json":{source:"iana",compressible:true,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:true},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:true,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:true,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:false,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:true},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:true},"application/ibe-pkg-reply+xml":{source:"iana",compressible:true},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:true,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:true,extensions:["its"]},"application/java-archive":{source:"apache",compressible:false,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:false,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:false,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:true,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:true},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:true},"application/jrd+json":{source:"iana",compressible:true},"application/jscalendar+json":{source:"iana",compressible:true},"application/json":{source:"iana",charset:"UTF-8",compressible:true,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:true},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:true,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:true},"application/jwk-set+json":{source:"iana",compressible:true},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:true},"application/kpml-response+xml":{source:"iana",compressible:true},"application/ld+json":{source:"iana",compressible:true,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:true,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:true},"application/lost+xml":{source:"iana",compressible:true,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:true},"application/lpf+zip":{source:"iana",compressible:false},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:true,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:true,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:true,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:true,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:true},"application/mathml-presentation+xml":{source:"iana",compressible:true},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:true},"application/mbms-deregister+xml":{source:"iana",compressible:true},"application/mbms-envelope+xml":{source:"iana",compressible:true},"application/mbms-msk+xml":{source:"iana",compressible:true},"application/mbms-msk-response+xml":{source:"iana",compressible:true},"application/mbms-protection-description+xml":{source:"iana",compressible:true},"application/mbms-reception-report+xml":{source:"iana",compressible:true},"application/mbms-register+xml":{source:"iana",compressible:true},"application/mbms-register-response+xml":{source:"iana",compressible:true},"application/mbms-schedule+xml":{source:"iana",compressible:true},"application/mbms-user-service-description+xml":{source:"iana",compressible:true},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:true,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:true},"application/mediaservercontrol+xml":{source:"iana",compressible:true,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:true},"application/metalink+xml":{source:"apache",compressible:true,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:true,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:true,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:true,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:true,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:true,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:true},"application/mrb-publish+xml":{source:"iana",compressible:true},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/msword":{source:"iana",compressible:false,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:true},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:true},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:false,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:true},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:true,extensions:["opf"]},"application/ogg":{source:"iana",compressible:false,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:true,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:true},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:false},"application/p2p-overlay+xml":{source:"iana",compressible:true,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:true,extensions:["xer"]},"application/pdf":{source:"iana",compressible:false,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:false,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:true,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/postscript":{source:"iana",compressible:true,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:true},"application/problem+json":{source:"iana",compressible:true},"application/problem+xml":{source:"iana",compressible:true},"application/provenance+xml":{source:"iana",compressible:true,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:false},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:true},"application/pskc+xml":{source:"iana",compressible:true,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:true},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:true,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:true},"application/rdf+xml":{source:"iana",compressible:true,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:true,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:true},"application/resource-lists+xml":{source:"iana",compressible:true,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:true,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:true},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:true},"application/rls-services+xml":{source:"iana",compressible:true,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:true,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:true,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:true,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:true,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:true,extensions:["rss"]},"application/rtf":{source:"iana",compressible:true,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:true},"application/samlmetadata+xml":{source:"iana",compressible:true},"application/sarif+json":{source:"iana",compressible:true},"application/sarif-external-properties+json":{source:"iana",compressible:true},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:true,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:true},"application/scim+json":{source:"iana",compressible:true},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:true},"application/senml+xml":{source:"iana",compressible:true,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:true},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:true},"application/sensml+xml":{source:"iana",compressible:true,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:true},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:true,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:true},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:true,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:true},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:true,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:true},"application/spirits-event+xml":{source:"iana",compressible:true},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:true,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:true,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:true,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:true,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:true},"application/swid+xml":{source:"iana",compressible:true,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:true},"application/taxii+json":{source:"iana",compressible:true},"application/td+json":{source:"iana",compressible:true},"application/tei+xml":{source:"iana",compressible:true,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:true,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:true},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:true,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:true,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:false,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:true},"application/urc-ressheet+xml":{source:"iana",compressible:true,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:true,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:true},"application/vcard+json":{source:"iana",compressible:true},"application/vcard+xml":{source:"iana",compressible:true},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:true,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:true},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:true},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:true},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:true},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:true},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:true},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:true},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:true},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:true},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:true},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:false,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:true,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:true},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:true},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:false,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:true},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:true},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:true},"application/vnd.apple.installer+xml":{source:"iana",compressible:true,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:false,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:true},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:true},"application/vnd.avistar+xml":{source:"iana",compressible:true},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:true,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:true},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:true},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:true},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:true},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:true},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:true,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:true,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:true},"application/vnd.collection.doc+json":{source:"iana",compressible:true},"application/vnd.collection.next+json":{source:"iana",compressible:true},"application/vnd.comicbook+zip":{source:"iana",compressible:false},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:true},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:true,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:true},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:true},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:true},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:true},"application/vnd.cyclonedx+xml":{source:"iana",compressible:true},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:false},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:true,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:true},"application/vnd.dataresource+json":{source:"iana",compressible:true},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:true,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:true},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:true},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:true},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:true},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:true},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:true},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:true},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:true},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:false},"application/vnd.eszigno3+xml":{source:"iana",compressible:true,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:true},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:false},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:false},"application/vnd.etsi.cug+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:true},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:true},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:true},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:true},"application/vnd.etsi.sci+xml":{source:"iana",compressible:true},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:true},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:true},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:true},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:false},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:false},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:false},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:true},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:true},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:true},"application/vnd.geo+json":{source:"iana",compressible:true},"application/vnd.geocube+xml":{source:"iana",compressible:true},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:false,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:false,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:false,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:true,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:false,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:true},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:false},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:true},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:true},"application/vnd.hal+xml":{source:"iana",compressible:true,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:true,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:true},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:true},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:true},"application/vnd.hyper-item+json":{source:"iana",compressible:true},"application/vnd.hyperdrive+json":{source:"iana",compressible:true},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:false},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:false},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:true},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:true},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:true},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:true},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:true,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:false},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:true},"application/vnd.las.las+xml":{source:"iana",compressible:true,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:true},"application/vnd.liberty-request+xml":{source:"iana",compressible:true},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:true,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:false},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:true},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:false},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:true},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:true},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:true,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:false,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:true,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:true},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:true},"application/vnd.ms-outlook":{compressible:false,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:true},"application/vnd.ms-powerpoint":{source:"iana",compressible:false,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:true},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:true},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:true},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:false,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:true},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:true},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:true},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:true},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:true},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:true},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:true,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:true},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:false,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:false,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:false,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:false,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:true},"application/vnd.oftn.l10n+json":{source:"iana",compressible:true},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:true},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:true},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:true},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:true},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:true},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:true},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:true},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:true},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:true},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:true},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:true,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:true},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:true},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:true},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:true},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:true},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:true},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:true,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:true,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:false,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:false,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:false,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:true},"application/vnd.oracle.resource+json":{source:"iana",compressible:true},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:true},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:true},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:true},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:true},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:true},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:true,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:true},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:true,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:true},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:true},"application/vnd.shopkick+json":{source:"iana",compressible:true},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:true},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:true,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:true,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:true,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:true},"application/vnd.syft+json":{source:"iana",compressible:true},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:true},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:true},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:true},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:true,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:true},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:true},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:true},"application/vnd.wv.ssp+xml":{source:"iana",compressible:true},"application/vnd.xacml+json":{source:"iana",compressible:true},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:true},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:true,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:true,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:true,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:true},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:true,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:true,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:true},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:true,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:true,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:false,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:false,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:false,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:false,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:false,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:false},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:true,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:true,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:true,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:false,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:true,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:false,extensions:["jnlp"]},"application/x-javascript":{compressible:true},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:false,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:false},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:true,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:false,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:false,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:true,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:false,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:false,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:true,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:true,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:true,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:true,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:true,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:false,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:true,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:true,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:true,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:true,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:true},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:true,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:false,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:true},"application/xaml+xml":{source:"apache",compressible:true,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:true,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:true,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:true,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:true,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:true},"application/xcap-ns+xml":{source:"iana",compressible:true,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:true},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:true},"application/xenc+xml":{source:"iana",compressible:true,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:true,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:true},"application/xliff+xml":{source:"iana",compressible:true,extensions:["xlf"]},"application/xml":{source:"iana",compressible:true,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:true,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:true},"application/xmpp+xml":{source:"iana",compressible:true},"application/xop+xml":{source:"iana",compressible:true,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:true,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:true,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:true,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:true,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:true},"application/yang-data+xml":{source:"iana",compressible:true},"application/yang-patch+json":{source:"iana",compressible:true},"application/yang-patch+xml":{source:"iana",compressible:true},"application/yin+xml":{source:"iana",compressible:true,extensions:["yin"]},"application/zip":{source:"iana",compressible:false,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:false,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:false,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:false},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:false,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:false,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:false,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:false,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:false},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:false},"audio/vorbis":{source:"iana",compressible:false},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:false,extensions:["wav"]},"audio/wave":{compressible:false,extensions:["wav"]},"audio/webm":{source:"apache",compressible:false,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:false,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:false,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:true,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:true,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:false,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:false,extensions:["avif"]},"image/bmp":{source:"iana",compressible:true,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:false,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:false,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:false,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:false,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:false,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:false},"image/png":{source:"iana",compressible:false,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:true,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:false,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:true,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:true,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:true,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:true,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:true,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:false},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:false},"message/imdn+xml":{source:"iana",compressible:true},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:false},"message/rfc822":{source:"iana",compressible:true,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:true,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:true,extensions:["glb"]},"model/iges":{source:"iana",compressible:false,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:false,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:true,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:false,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:false,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:true,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:true},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:false,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:false,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:false,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:false,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:true,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:false},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:false},"multipart/form-data":{source:"iana",compressible:false},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:false},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:false},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:true,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:true},"text/cmd":{compressible:true},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:true,extensions:["css"]},"text/csv":{source:"iana",compressible:true,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:true,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:true},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:true,extensions:["jsx"]},"text/less":{compressible:true,extensions:["less"]},"text/markdown":{source:"iana",compressible:true,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:true,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:true,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:true,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:true,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:true,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:true,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:true,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:true,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:true,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:true},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:true},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:true,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:true,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:true,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:true,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:true,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:true,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:false,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:false,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:false,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:false,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:false,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:false,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:false,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:false,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:true},"x-shader/x-vertex":{compressible:true}}});var CM=_((gor,aEe)=>{aEe.exports=sEe()});var RM=_(ga=>{"use strict";var CT=CM();var kEt=require("path").extname;var oEe=/^\s*([^;\s]*)(?:;|\s|$)/;var $Et=/^text\//i;ga.charset=uEe;ga.charsets={lookup:uEe};ga.contentType=LEt;ga.extension=qEt;ga.extensions=Object.create(null);ga.lookup=jEt;ga.types=Object.create(null);UEt(ga.extensions,ga.types);function uEe(t){if(!t||typeof t!=="string"){return false}var e=oEe.exec(t);var r=e&&CT[e[1].toLowerCase()];if(r&&r.charset){return r.charset}if(e&&$Et.test(e[1])){return"UTF-8"}return false}o(uEe,"charset");function LEt(t){if(!t||typeof t!=="string"){return false}var e=t.indexOf("/")===-1?ga.lookup(t):t;if(!e){return false}if(e.indexOf("charset")===-1){var r=ga.charset(e);if(r)e+="; charset="+r.toLowerCase()}return e}o(LEt,"contentType");function qEt(t){if(!t||typeof t!=="string"){return false}var e=oEe.exec(t);var r=e&&ga.extensions[e[1].toLowerCase()];if(!r||!r.length){return false}return r[0]}o(qEt,"extension");function jEt(t){if(!t||typeof t!=="string"){return false}var e=kEt("x."+t).toLowerCase().substr(1);if(!e){return false}return ga.types[e]||false}o(jEt,"lookup");function UEt(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(CT).forEach(o(function n(i){var s=CT[i];var a=s.extensions;if(!a||!a.length){return}t[i]=a;for(var u=0;u<a.length;u++){var l=a[u];if(e[l]){var c=r.indexOf(CT[e[l]].source);var d=r.indexOf(s.source);if(e[l]!=="application/octet-stream"&&(c>d||c===d&&e[l].substr(0,12)==="application/")){continue}}e[l]=i}},"forEachMimeType"))}o(UEt,"populateMaps")});var cEe=_((_or,lEe)=>{var OM=class{static{o(this,"Node")}constructor(e){this.value=e;this.next=void 0}};var NM=class{static{o(this,"Queue")}constructor(){this.clear()}enqueue(e){const r=new OM(e);if(this._head){this._tail.next=r;this._tail=r}else{this._head=r;this._tail=r}this._size++}dequeue(){const e=this._head;if(!e){return}this._head=this._head.next;this._size--;return e.value}clear(){this._head=void 0;this._tail=void 0;this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;while(e){yield e.value;e=e.next}}};lEe.exports=NM});var IM=_((bor,dEe)=>{"use strict";var FEt=cEe();var MEt=o(t=>{if(!((Number.isInteger(t)||t===Infinity)&&t>0)){throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const e=new FEt;let r=0;const n=o(()=>{r--;if(e.size>0){e.dequeue()()}},"next");const i=o(async(u,l,...c)=>{r++;const d=(async()=>u(...c))();l(d);try{await d}catch{}n()},"run");const s=o((u,l,...c)=>{e.enqueue(i.bind(null,u,l,...c));(async()=>{await Promise.resolve();if(r<t&&e.size>0){e.dequeue()()}})()},"enqueue");const a=o((u,...l)=>new Promise(c=>{s(u,c,...l)}),"generator");Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}});return a},"pLimit");dEe.exports=MEt});var fEe=_((Sor,pEe)=>{function So(t,e){if(typeof e==="boolean"){e={forever:e}}this._originalTimeouts=JSON.parse(JSON.stringify(t));this._timeouts=t;this._options=e||{};this._maxRetryTime=e&&e.maxRetryTime||Infinity;this._fn=null;this._errors=[];this._attempts=1;this._operationTimeout=null;this._operationTimeoutCb=null;this._timeout=null;this._operationStart=null;this._timer=null;if(this._options.forever){this._cachedTimeouts=this._timeouts.slice(0)}}o(So,"RetryOperation");pEe.exports=So;So.prototype.reset=function(){this._attempts=1;this._timeouts=this._originalTimeouts.slice(0)};So.prototype.stop=function(){if(this._timeout){clearTimeout(this._timeout)}if(this._timer){clearTimeout(this._timer)}this._timeouts=[];this._cachedTimeouts=null};So.prototype.retry=function(t){if(this._timeout){clearTimeout(this._timeout)}if(!t){return false}var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime){this._errors.push(t);this._errors.unshift(new Error("RetryOperation timeout occurred"));return false}this._errors.push(t);var r=this._timeouts.shift();if(r===void 0){if(this._cachedTimeouts){this._errors.splice(0,this._errors.length-1);r=this._cachedTimeouts.slice(-1)}else{return false}}var n=this;this._timer=setTimeout(function(){n._attempts++;if(n._operationTimeoutCb){n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout);if(n._options.unref){n._timeout.unref()}}n._fn(n._attempts)},r);if(this._options.unref){this._timer.unref()}return true};So.prototype.attempt=function(t,e){this._fn=t;if(e){if(e.timeout){this._operationTimeout=e.timeout}if(e.cb){this._operationTimeoutCb=e.cb}}var r=this;if(this._operationTimeoutCb){this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)}this._operationStart=new Date().getTime();this._fn(this._attempts)};So.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated");this.attempt(t)};So.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated");this.attempt(t)};So.prototype.start=So.prototype.try;So.prototype.errors=function(){return this._errors};So.prototype.attempts=function(){return this._attempts};So.prototype.mainError=function(){if(this._errors.length===0){return null}var t={};var e=null;var r=0;for(var n=0;n<this._errors.length;n++){var i=this._errors[n];var s=i.message;var a=(t[s]||0)+1;t[s]=a;if(a>=r){e=i;r=a}}return e}});var hEe=_(nm=>{var BEt=fEe();nm.operation=function(t){var e=nm.timeouts(t);return new BEt(e,{forever:t&&(t.forever||t.retries===Infinity),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};nm.timeouts=function(t){if(t instanceof Array){return[].concat(t)}var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:Infinity,randomize:false};for(var r in t){e[r]=t[r]}if(e.minTimeout>e.maxTimeout){throw new Error("minTimeout is greater than maxTimeout")}var n=[];for(var i=0;i<e.retries;i++){n.push(this.createTimeout(i,e))}if(t&&t.forever&&!n.length){n.push(this.createTimeout(i,e))}n.sort(function(s,a){return s-a});return n};nm.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1;var n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));n=Math.min(n,e.maxTimeout);return n};nm.wrap=function(t,e,r){if(e instanceof Array){r=e;e=null}if(!r){r=[];for(var n in t){if(typeof t[n]==="function"){r.push(n)}}}for(var i=0;i<r.length;i++){var s=r[i];var a=t[s];t[s]=o(function u(l){var c=nm.operation(e);var d=Array.prototype.slice.call(arguments,1);var p=d.pop();d.push(function(f){if(c.retry(f)){return}if(f){arguments[0]=c.mainError()}p.apply(this,arguments)});c.attempt(function(){l.apply(t,d)})},"retryWrapper").bind(t,a);t[s].options=e}}});var gEe=_((Cor,mEe)=>{mEe.exports=hEe()});var OE=_((Ror,yEe)=>{var VEt=gEe();function HEt(t,e){function r(n,i){var s=e||{};var a;if(!("randomize"in s)){s.randomize=true}a=VEt.operation(s);function u(d){i(d||new Error("Aborted"))}o(u,"bail");function l(d,p){if(d.bail){u(d);return}if(!a.retry(d)){i(a.mainError())}else if(s.onRetry){s.onRetry(d,p)}}o(l,"onError");function c(d){var p;try{p=t(u,d)}catch(f){l(f,d);return}Promise.resolve(p).then(n).catch(o(function f(h){l(h,d)},"catchIt"))}o(c,"runAttempt");a.attempt(c)}o(r,"run");return new Promise(r)}o(HEt,"retry");yEe.exports=HEt});var PM=_(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:true});Rg.AclRoleAccessorMethods=Rg.Acl=void 0;var zEt=_l();var im=class t{static{o(this,"AclRoleAccessorMethods")}constructor(){this.owners={};this.readers={};this.writers={};this.owners={};this.readers={};this.writers={};t.roles.forEach(this._assignAccessMethods.bind(this))}_assignAccessMethods(e){const r=t.accessMethods;const n=t.entities;const i=e.toLowerCase()+"s";this[i]=n.reduce((s,a)=>{const u=a.charAt(a.length-1)==="-";r.forEach(l=>{let c=l+a[0].toUpperCase()+a.substring(1);if(u){c=c.replace("-","")}s[c]=(d,p,f)=>{let h;if(typeof p==="function"){f=p;p={}}if(u){h=a+d}else{h=a;f=d}p=Object.assign({entity:h,role:e},p);const m=[p];if(typeof f==="function"){m.push(f)}return this[l].apply(this,m)}});return s},{})}};Rg.AclRoleAccessorMethods=im;im.accessMethods=["add","delete"];im.entities=["allAuthenticatedUsers","allUsers","domain-","group-","project-","user-"];im.roles=["OWNER","READER","WRITER"];var RT=class extends im{static{o(this,"Acl")}constructor(e){super();this.pathPrefix=e.pathPrefix;this.request_=e.request}add(e,r){const n={};if(e.generation){n.generation=e.generation}if(e.userProject){n.userProject=e.userProject}this.request({method:"POST",uri:"",qs:n,maxRetries:0,json:{entity:e.entity,role:e.role.toUpperCase()}},(i,s)=>{if(i){r(i,null,s);return}r(null,this.makeAclObject_(s),s)})}delete(e,r){const n={};if(e.generation){n.generation=e.generation}if(e.userProject){n.userProject=e.userProject}this.request({method:"DELETE",uri:"/"+encodeURIComponent(e.entity),qs:n},(i,s)=>{r(i,s)})}get(e,r){const n=typeof e==="object"?e:null;const i=typeof e==="function"?e:r;let s="";const a={};if(n){s="/"+encodeURIComponent(n.entity);if(n.generation){a.generation=n.generation}if(n.userProject){a.userProject=n.userProject}}this.request({uri:s,qs:a},(u,l)=>{if(u){i(u,null,l);return}let c;if(l.items){c=l.items.map(this.makeAclObject_)}else{c=this.makeAclObject_(l)}i(null,c,l)})}update(e,r){const n={};if(e.generation){n.generation=e.generation}if(e.userProject){n.userProject=e.userProject}this.request({method:"PUT",uri:"/"+encodeURIComponent(e.entity),qs:n,json:{role:e.role.toUpperCase()}},(i,s)=>{if(i){r(i,null,s);return}r(null,this.makeAclObject_(s),s)})}makeAclObject_(e){const r={entity:e.entity,role:e.role};if(e.projectTeam){r.projectTeam=e.projectTeam}return r}request(e,r){e.uri=this.pathPrefix+e.uri;this.request_(e,r)}};Rg.Acl=RT;(0,zEt.promisifyAll)(RT,{exclude:["request"]})});var _Ee=_((Por,vEe)=>{"use strict";var GEt=CM();var KEt=/^text\/|\+(?:json|text|xml)$/i;var YEt=/^\s*([^;\s]*)(?:;|\s|$)/;vEe.exports=WEt;function WEt(t){if(!t||typeof t!=="string"){return false}var e=YEt.exec(t);var r=e&&e[1].toLowerCase();var n=GEt[r];if(n&&n.compressible!==void 0){return n.compressible}return KEt.test(r)||void 0}o(WEt,"compressible")});var bEe=_((kor,EEe)=>{"use strict";function OT(){this._types=Object.create(null);this._extensions=Object.create(null);for(let t=0;t<arguments.length;t++){this.define(arguments[t])}this.define=this.define.bind(this);this.getType=this.getType.bind(this);this.getExtension=this.getExtension.bind(this)}o(OT,"Mime");OT.prototype.define=function(t,e){for(let r in t){let n=t[r].map(function(i){return i.toLowerCase()});r=r.toLowerCase();for(let i=0;i<n.length;i++){const s=n[i];if(s[0]==="*"){continue}if(!e&&s in this._types){throw new Error('Attempt to change mapping for "'+s+'" extension from "'+this._types[s]+'" to "'+r+'". Pass `force=true` to allow this, otherwise remove "'+s+'" from the list of extensions for "'+r+'".')}this._types[s]=r}if(e||!this._extensions[r]){const i=n[0];this._extensions[r]=i[0]!=="*"?i:i.substr(1)}}};OT.prototype.getType=function(t){t=String(t);let e=t.replace(/^.*[/\\]/,"").toLowerCase();let r=e.replace(/^.*\./,"").toLowerCase();let n=e.length<t.length;let i=r.length<e.length-1;return(i||!n)&&this._types[r]||null};OT.prototype.getExtension=function(t){t=/^\s*([^;\s]*)/.test(t)&&RegExp.$1;return t&&this._extensions[t.toLowerCase()]||null};EEe.exports=OT});var SEe=_((Lor,wEe)=>{wEe.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}});var AEe=_((qor,TEe)=>{TEe.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}});var CEe=_((jor,xEe)=>{"use strict";var JEt=bEe();xEe.exports=new JEt(SEe(),AEe())});var qEe=_((PE,IE)=>{"use strict";Object.defineProperty(PE,"__esModule",{value:true});var DEe=new WeakMap;var DM=new WeakMap;function On(t){const e=DEe.get(t);console.assert(e!=null,"'this' is expected an Event object, but got",t);return e}o(On,"pd");function REe(t){if(t.passiveListener!=null){if(typeof console!=="undefined"&&typeof console.error==="function"){console.error("Unable to preventDefault inside passive event listener invocation.",t.passiveListener)}return}if(!t.event.cancelable){return}t.canceled=true;if(typeof t.event.preventDefault==="function"){t.event.preventDefault()}}o(REe,"setCancelFlag");function Og(t,e){DEe.set(this,{eventTarget:t,event:e,eventPhase:2,currentTarget:t,canceled:false,stopped:false,immediateStopped:false,passiveListener:null,timeStamp:e.timeStamp||Date.now()});Object.defineProperty(this,"isTrusted",{value:false,enumerable:true});const r=Object.keys(e);for(let n=0;n<r.length;++n){const i=r[n];if(!(i in this)){Object.defineProperty(this,i,kEe(i))}}}o(Og,"Event");Og.prototype={get type(){return On(this).event.type},get target(){return On(this).eventTarget},get currentTarget(){return On(this).currentTarget},composedPath(){const t=On(this).currentTarget;if(t==null){return[]}return[t]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return On(this).eventPhase},stopPropagation(){const t=On(this);t.stopped=true;if(typeof t.event.stopPropagation==="function"){t.event.stopPropagation()}},stopImmediatePropagation(){const t=On(this);t.stopped=true;t.immediateStopped=true;if(typeof t.event.stopImmediatePropagation==="function"){t.event.stopImmediatePropagation()}},get bubbles(){return Boolean(On(this).event.bubbles)},get cancelable(){return Boolean(On(this).event.cancelable)},preventDefault(){REe(On(this))},get defaultPrevented(){return On(this).canceled},get composed(){return Boolean(On(this).event.composed)},get timeStamp(){return On(this).timeStamp},get srcElement(){return On(this).eventTarget},get cancelBubble(){return On(this).stopped},set cancelBubble(t){if(!t){return}const e=On(this);e.stopped=true;if(typeof e.event.cancelBubble==="boolean"){e.event.cancelBubble=true}},get returnValue(){return!On(this).canceled},set returnValue(t){if(!t){REe(On(this))}},initEvent(){}};Object.defineProperty(Og.prototype,"constructor",{value:Og,configurable:true,writable:true});if(typeof window!=="undefined"&&typeof window.Event!=="undefined"){Object.setPrototypeOf(Og.prototype,window.Event.prototype);DM.set(window.Event.prototype,Og)}function kEe(t){return{get(){return On(this).event[t]},set(e){On(this).event[t]=e},configurable:true,enumerable:true}}o(kEe,"defineRedirectDescriptor");function QEt(t){return{value(){const e=On(this).event;return e[t].apply(e,arguments)},configurable:true,enumerable:true}}o(QEt,"defineCallDescriptor");function XEt(t,e){const r=Object.keys(e);if(r.length===0){return t}function n(i,s){t.call(this,i,s)}o(n,"CustomEvent");n.prototype=Object.create(t.prototype,{constructor:{value:n,configurable:true,writable:true}});for(let i=0;i<r.length;++i){const s=r[i];if(!(s in t.prototype)){const a=Object.getOwnPropertyDescriptor(e,s);const u=typeof a.value==="function";Object.defineProperty(n.prototype,s,u?QEt(s):kEe(s))}}return n}o(XEt,"defineWrapper");function $Ee(t){if(t==null||t===Object.prototype){return Og}let e=DM.get(t);if(e==null){e=XEt($Ee(Object.getPrototypeOf(t)),t);DM.set(t,e)}return e}o($Ee,"getWrapper");function ZEt(t,e){const r=$Ee(Object.getPrototypeOf(e));return new r(t,e)}o(ZEt,"wrapEvent");function e6t(t){return On(t).immediateStopped}o(e6t,"isStopped");function t6t(t,e){On(t).eventPhase=e}o(t6t,"setEventPhase");function r6t(t,e){On(t).currentTarget=e}o(r6t,"setCurrentTarget");function OEe(t,e){On(t).passiveListener=e}o(OEe,"setPassiveListener");var LEe=new WeakMap;var NEe=1;var IEe=2;var NT=3;function IT(t){return t!==null&&typeof t==="object"}o(IT,"isObject");function NE(t){const e=LEe.get(t);if(e==null){throw new TypeError("'this' is expected an EventTarget object, but got another value.")}return e}o(NE,"getListeners");function n6t(t){return{get(){const e=NE(this);let r=e.get(t);while(r!=null){if(r.listenerType===NT){return r.listener}r=r.next}return null},set(e){if(typeof e!=="function"&&!IT(e)){e=null}const r=NE(this);let n=null;let i=r.get(t);while(i!=null){if(i.listenerType===NT){if(n!==null){n.next=i.next}else if(i.next!==null){r.set(t,i.next)}else{r.delete(t)}}else{n=i}i=i.next}if(e!==null){const s={listener:e,listenerType:NT,passive:false,once:false,next:null};if(n===null){r.set(t,s)}else{n.next=s}}},configurable:true,enumerable:true}}o(n6t,"defineEventAttributeDescriptor");function kM(t,e){Object.defineProperty(t,`on${e}`,n6t(e))}o(kM,"defineEventAttribute");function PEe(t){function e(){Tu.call(this)}o(e,"CustomEventTarget");e.prototype=Object.create(Tu.prototype,{constructor:{value:e,configurable:true,writable:true}});for(let r=0;r<t.length;++r){kM(e.prototype,t[r])}return e}o(PEe,"defineCustomEventTarget");function Tu(){if(this instanceof Tu){LEe.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0])){return PEe(arguments[0])}if(arguments.length>0){const t=new Array(arguments.length);for(let e=0;e<arguments.length;++e){t[e]=arguments[e]}return PEe(t)}throw new TypeError("Cannot call a class as a function")}o(Tu,"EventTarget");Tu.prototype={addEventListener(t,e,r){if(e==null){return}if(typeof e!=="function"&&!IT(e)){throw new TypeError("'listener' should be a function or an object.")}const n=NE(this);const i=IT(r);const s=i?Boolean(r.capture):Boolean(r);const a=s?NEe:IEe;const u={listener:e,listenerType:a,passive:i&&Boolean(r.passive),once:i&&Boolean(r.once),next:null};let l=n.get(t);if(l===void 0){n.set(t,u);return}let c=null;while(l!=null){if(l.listener===e&&l.listenerType===a){return}c=l;l=l.next}c.next=u},removeEventListener(t,e,r){if(e==null){return}const n=NE(this);const i=IT(r)?Boolean(r.capture):Boolean(r);const s=i?NEe:IEe;let a=null;let u=n.get(t);while(u!=null){if(u.listener===e&&u.listenerType===s){if(a!==null){a.next=u.next}else if(u.next!==null){n.set(t,u.next)}else{n.delete(t)}return}a=u;u=u.next}},dispatchEvent(t){if(t==null||typeof t.type!=="string"){throw new TypeError('"event.type" should be a string.')}const e=NE(this);const r=t.type;let n=e.get(r);if(n==null){return true}const i=ZEt(this,t);let s=null;while(n!=null){if(n.once){if(s!==null){s.next=n.next}else if(n.next!==null){e.set(r,n.next)}else{e.delete(r)}}else{s=n}OEe(i,n.passive?n.listener:null);if(typeof n.listener==="function"){try{n.listener.call(this,i)}catch(a){if(typeof console!=="undefined"&&typeof console.error==="function"){console.error(a)}}}else if(n.listenerType!==NT&&typeof n.listener.handleEvent==="function"){n.listener.handleEvent(i)}if(e6t(i)){break}n=n.next}OEe(i,null);t6t(i,0);r6t(i,null);return!i.defaultPrevented}};Object.defineProperty(Tu.prototype,"constructor",{value:Tu,configurable:true,writable:true});if(typeof window!=="undefined"&&typeof window.EventTarget!=="undefined"){Object.setPrototypeOf(Tu.prototype,window.EventTarget.prototype)}PE.defineEventAttribute=kM;PE.EventTarget=Tu;PE.default=Tu;IE.exports=Tu;IE.exports.EventTarget=IE.exports["default"]=Tu;IE.exports.defineEventAttribute=kM});var FEe=_((kE,DE)=>{"use strict";Object.defineProperty(kE,"__esModule",{value:true});var $M=qEe();var Rp=class extends $M.EventTarget{static{o(this,"AbortSignal")}constructor(){super();throw new TypeError("AbortSignal cannot be constructed directly")}get aborted(){const e=PT.get(this);if(typeof e!=="boolean"){throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`)}return e}};$M.defineEventAttribute(Rp.prototype,"abort");function i6t(){const t=Object.create(Rp.prototype);$M.EventTarget.call(t);PT.set(t,false);return t}o(i6t,"createAbortSignal");function s6t(t){if(PT.get(t)!==false){return}PT.set(t,true);t.dispatchEvent({type:"abort"})}o(s6t,"abortSignal");var PT=new WeakMap;Object.defineProperties(Rp.prototype,{aborted:{enumerable:true}});if(typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol"){Object.defineProperty(Rp.prototype,Symbol.toStringTag,{configurable:true,value:"AbortSignal"})}var Op=class{static{o(this,"AbortController")}constructor(){UEe.set(this,i6t())}get signal(){return jEe(this)}abort(){s6t(jEe(this))}};var UEe=new WeakMap;function jEe(t){const e=UEe.get(t);if(e==null){throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${t===null?"null":typeof t}`)}return e}o(jEe,"getSignal");Object.defineProperties(Op.prototype,{signal:{enumerable:true},abort:{enumerable:true}});if(typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol"){Object.defineProperty(Op.prototype,Symbol.toStringTag,{configurable:true,value:"AbortController"})}kE.AbortController=Op;kE.AbortSignal=Rp;kE.default=Op;DE.exports=Op;DE.exports.AbortController=DE.exports["default"]=Op;DE.exports.AbortSignal=Rp});var HEe=_(Fn=>{"use strict";var a6t=Fn&&Fn.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var o6t=Fn&&Fn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var BEe=Fn&&Fn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))a6t(e,t,r)}o6t(e,t);return e};var u6t=Fn&&Fn.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r};var ja=Fn&&Fn.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var VEe=Fn&&Fn.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};var Uc;var Fc;var $E;var DT;Object.defineProperty(Fn,"__esModule",{value:true});Fn.createURI=Fn.upload=Fn.Upload=Fn.PROTOCOL_REGEX=void 0;var l6t=VEe(FEe());var c6t=require("crypto");var d6t=BEe(pl());var p6t=KS();var MEe=require("stream");var f6t=VEe(OE());var Ng=BEe((M1(),zm(F1)));var h6t=rm();var jc=yl();var m6t=bg();var g6t=404;var LM=308;var y6t=/.*\.googleapis\.com/;var qM=(0,m6t.getPackageJSON)();Fn.PROTOCOL_REGEX=/^(\w*):\/\//;var LE=class extends MEe.Writable{static{o(this,"Upload")}constructor(e){super(e);Uc.add(this);this.numBytesWritten=0;this.numRetries=0;this.currentInvocationId={chunk:Ng.v4(),uri:Ng.v4(),offset:Ng.v4()};this.writeBuffers=[];this.numChunksReadInRequest=0;this.localWriteCache=[];this.localWriteCacheByteLength=0;this.upstreamEnded=false;Fc.set(this,void 0);e=e||{};if(!e.bucket||!e.file){throw new Error("A bucket and file name are required")}e.authConfig=e.authConfig||{};e.authConfig.scopes=["https://www.googleapis.com/auth/devstorage.full_control"];this.authClient=e.authClient||new p6t.GoogleAuth(e.authConfig);this.apiEndpoint="https://storage.googleapis.com";if(e.apiEndpoint){this.apiEndpoint=this.sanitizeEndpoint(e.apiEndpoint);if(!y6t.test(e.apiEndpoint)){this.authClient=d6t}}this.baseURI=`${this.apiEndpoint}/upload/storage/v1/b`;this.bucket=e.bucket;const r=[e.bucket,e.file];if(typeof e.generation==="number"){r.push(`${e.generation}`)}this.cacheKey=r.join("/");this.customRequestOptions=e.customRequestOptions||{};this.file=e.file;this.generation=e.generation;this.kmsKeyName=e.kmsKeyName;this.metadata=e.metadata||{};this.offset=e.offset;this.origin=e.origin;this.params=e.params||{};this.userProject=e.userProject;this.chunkSize=e.chunkSize;this.retryOptions=e.retryOptions;if(e.key){const s=Buffer.from(e.key).toString("base64");this.encryption={key:s,hash:(0,c6t.createHash)("sha256").update(e.key).digest("base64")}}this.predefinedAcl=e.predefinedAcl;if(e.private)this.predefinedAcl="private";if(e.public)this.predefinedAcl="publicRead";const n=e.retryOptions.autoRetry;this.uriProvidedManually=!!e.uri;this.uri=e.uri;this.numBytesWritten=0;this.numRetries=0;if(!n){e.retryOptions.maxRetries=0}this.timeOfFirstRequest=Date.now();const i=e.metadata?Number(e.metadata.contentLength):NaN;this.contentLength=isNaN(i)?"*":i;u6t(this,Fc,e[h6t.GCCL_GCS_CMD_KEY],"f");this.once("writing",()=>{if(this.uri){this.continueUploading()}else{this.createURI(s=>{if(s){return this.destroy(s)}this.startUploading();return})}})}_final(e=()=>{}){this.upstreamEnded=true;this.once("uploadFinished",e);process.nextTick(()=>{this.emit("upstreamFinished");this.emit("writing")})}_write(e,r,n=()=>{}){this.emit("writing");this.writeBuffers.push(typeof e==="string"?Buffer.from(e,r):e);this.once("readFromChunkBuffer",n);process.nextTick(()=>this.emit("wroteToChunkBuffer"))}prependLocalBufferToUpstream(e){let r=[];if(e){let i=0;while(e>i){let s=this.localWriteCache.pop();if(!s)break;i+=s.byteLength;if(i>e){const a=i-e;s=s.subarray(a);i-=a}r.unshift(s)}}else{r=this.localWriteCache}const n=this.writeBuffers;this.writeBuffers=r;for(const i of n){this.writeBuffers.push(i)}ja(this,Uc,"m",$E).call(this)}*pullFromChunkBuffer(e){while(e){const r=this.writeBuffers.shift();if(!r)break;let n=r;if(r.byteLength>e){n=r.subarray(0,e);this.writeBuffers.unshift(r.subarray(e));e=0}else{e-=r.byteLength}yield n;this.emit("readFromChunkBuffer")}}async waitForNextChunk(){const e=await new Promise(r=>{if(this.writeBuffers.length){return r(true)}if(this.upstreamEnded){return r(false)}const n=o(()=>{s();return r(true)},"wroteToChunkBufferCallback");const i=o(()=>{s();if(this.writeBuffers.length)return r(true);return r(false)},"upstreamFinishedCallback");const s=o(()=>{this.removeListener("wroteToChunkBuffer",n);this.removeListener("upstreamFinished",i)},"removeListeners");this.once("wroteToChunkBuffer",n);this.once("upstreamFinished",i)});return e}async*upstreamIterator(e=Infinity){while(e&&await this.waitForNextChunk()){for(const r of this.pullFromChunkBuffer(e)){e-=r.byteLength;yield r}}}createURI(e){if(!e){return this.createURIAsync()}this.createURIAsync().then(r=>e(null,r),e)}async createURIAsync(){const e={...this.metadata};const r={};if(e.contentLength){r["X-Upload-Content-Length"]=e.contentLength.toString();delete e.contentLength}if(e.contentType){r["X-Upload-Content-Type"]=e.contentType;delete e.contentType}let n=`${(0,jc.getRuntimeTrackingString)()} gccl/${qM.version}-${(0,jc.getModuleFormat)()} gccl-invocation-id/${this.currentInvocationId.uri}`;if(ja(this,Fc,"f")){n+=` gccl-gcs-cmd/${ja(this,Fc,"f")}`}const i={method:"POST",url:[this.baseURI,this.bucket,"o"].join("/"),params:Object.assign({name:this.file,uploadType:"resumable"},this.params),data:e,headers:{"User-Agent":(0,jc.getUserAgentString)(),"x-goog-api-client":n,...r}};if(e.contentLength){i.headers["X-Upload-Content-Length"]=e.contentLength.toString()}if(e.contentType){i.headers["X-Upload-Content-Type"]=e.contentType}if(typeof this.generation!=="undefined"){i.params.ifGenerationMatch=this.generation}if(this.kmsKeyName){i.params.kmsKeyName=this.kmsKeyName}if(this.predefinedAcl){i.params.predefinedAcl=this.predefinedAcl}if(this.origin){i.headers.Origin=this.origin}const s=await(0,f6t.default)(async a=>{var u,l,c;try{const d=await this.makeRequest(i);this.currentInvocationId.uri=Ng.v4();return d.headers.location}catch(d){const p=d;const f={code:(u=p.response)===null||u===void 0?void 0:u.status,name:(l=p.response)===null||l===void 0?void 0:l.statusText,message:(c=p.response)===null||c===void 0?void 0:c.statusText,errors:[{reason:p.code}]};if(this.retryOptions.maxRetries>0&&this.retryOptions.retryableErrorFn(f)){throw p}else{return a(p)}}},{retries:this.retryOptions.maxRetries,factor:this.retryOptions.retryDelayMultiplier,maxTimeout:this.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.retryOptions.totalTimeout*1e3});this.uri=s;this.offset=0;return s}async continueUploading(){if(typeof this.offset==="number"){this.startUploading();return}await this.getAndSetOffset();this.startUploading()}async startUploading(){const e=!!this.chunkSize;let r=false;this.numChunksReadInRequest=0;if(!this.offset){this.offset=0}if(this.offset<this.numBytesWritten){const c=this.numBytesWritten-this.offset;const d=`The offset is lower than the number of bytes written. The server has ${this.offset} bytes and while ${this.numBytesWritten} bytes has been uploaded - thus ${c} bytes are missing. Stopping as this could result in data loss. Initiate a new upload to continue.`;this.emit("error",new RangeError(d));return}if(this.numBytesWritten<this.offset){const c=this.offset-this.numBytesWritten;for await(const d of this.upstreamIterator(c)){d}this.numBytesWritten=this.offset}let n=void 0;if(typeof this.contentLength==="number"){n=this.contentLength-this.numBytesWritten}if(this.chunkSize){n=n?Math.min(this.chunkSize,n):this.chunkSize}const i=this.upstreamIterator(n);const s=new MEe.Readable({read:async()=>{if(r)s.push(null);const c=await i.next();if(c.value){this.numChunksReadInRequest++;if(e){ja(this,Uc,"m",DT).call(this,c.value)}else{ja(this,Uc,"m",$E).call(this);ja(this,Uc,"m",DT).call(this,c.value)}this.numBytesWritten+=c.value.byteLength;this.emit("progress",{bytesWritten:this.numBytesWritten,contentLength:this.contentLength});s.push(c.value)}if(c.done){s.push(null)}}});let a=`${(0,jc.getRuntimeTrackingString)()} gccl/${qM.version}-${(0,jc.getModuleFormat)()} gccl-invocation-id/${this.currentInvocationId.chunk}`;if(ja(this,Fc,"f")){a+=` gccl-gcs-cmd/${ja(this,Fc,"f")}`}const u={"User-Agent":(0,jc.getUserAgentString)(),"x-goog-api-client":a};if(e){for await(const h of this.upstreamIterator(n)){ja(this,Uc,"m",DT).call(this,h)}const c=this.localWriteCacheByteLength;const d=!await this.waitForNextChunk();this.prependLocalBufferToUpstream();let p=this.contentLength;if(typeof this.contentLength!=="number"&&d){p=c+this.numBytesWritten}const f=c+this.numBytesWritten-1;u["Content-Length"]=c;u["Content-Range"]=`bytes ${this.offset}-${f}/${p}`}else{u["Content-Range"]=`bytes ${this.offset}-*/${this.contentLength}`}const l={method:"PUT",url:this.uri,headers:u,body:s};try{const c=await this.makeRequestStream(l);if(c){r=true;this.responseHandler(c)}}catch(c){const d=c;if(this.retryOptions.retryableErrorFn(d)){this.attemptDelayedRetry({status:NaN,data:d});return}this.destroy(d)}}responseHandler(e){if(e.data.error){this.destroy(e.data.error);return}this.currentInvocationId.chunk=Ng.v4();const r=this.chunkSize&&e.status===LM&&e.headers.range;if(r){const n=e.headers.range;this.offset=Number(n.split("-")[1])+1;const i=this.numBytesWritten-this.offset;if(i){this.prependLocalBufferToUpstream(i);this.numBytesWritten-=i}else{ja(this,Uc,"m",$E).call(this)}this.continueUploading()}else if(!this.isSuccessfulResponse(e.status)){const n=new Error("Upload failed");n.code=e.status;n.name="Upload failed";if(e===null||e===void 0?void 0:e.data){n.errors=[e===null||e===void 0?void 0:e.data]}this.destroy(n)}else{ja(this,Uc,"m",$E).call(this);if(e&&e.data){e.data.size=Number(e.data.size)}this.emit("metadata",e.data);this.emit("uploadFinished")}}async getAndSetOffset(){let e=`${(0,jc.getRuntimeTrackingString)()} gccl/${qM.version}-${(0,jc.getModuleFormat)()} gccl-invocation-id/${this.currentInvocationId.offset}`;if(ja(this,Fc,"f")){e+=` gccl-gcs-cmd/${ja(this,Fc,"f")}`}const r={method:"PUT",url:this.uri,headers:{"Content-Length":0,"Content-Range":"bytes */*","User-Agent":(0,jc.getUserAgentString)(),"x-goog-api-client":e}};try{const n=await this.makeRequest(r);this.currentInvocationId.offset=Ng.v4();if(n.status===LM){if(n.headers.range){const i=n.headers.range;this.offset=Number(i.split("-")[1])+1;return}}this.offset=0}catch(n){const i=n;if(this.retryOptions.retryableErrorFn(i)){this.attemptDelayedRetry({status:NaN,data:i});return}this.destroy(i)}}async makeRequest(e){if(this.encryption){e.headers=e.headers||{};e.headers["x-goog-encryption-algorithm"]="AES256";e.headers["x-goog-encryption-key"]=this.encryption.key.toString();e.headers["x-goog-encryption-key-sha256"]=this.encryption.hash.toString()}if(this.userProject){e.params=e.params||{};e.params.userProject=this.userProject}e.validateStatus=i=>{return this.isSuccessfulResponse(i)||i===LM};const r={...this.customRequestOptions,...e,headers:{...this.customRequestOptions.headers,...e.headers}};const n=await this.authClient.request(r);if(n.data&&n.data.error){throw n.data.error}return n}async makeRequestStream(e){const r=new l6t.default;const n=o(()=>r.abort(),"errorCallback");this.once("error",n);if(this.userProject){e.params=e.params||{};e.params.userProject=this.userProject}e.signal=r.signal;e.validateStatus=()=>true;const i={...this.customRequestOptions,...e,headers:{...this.customRequestOptions.headers,...e.headers}};const s=await this.authClient.request(i);const a=this.onResponse(s);this.removeListener("error",n);return a?s:null}onResponse(e){if(e.status!==200&&this.retryOptions.retryableErrorFn({code:e.status,message:e.statusText,name:e.statusText})){this.attemptDelayedRetry(e);return false}this.emit("response",e);return true}attemptDelayedRetry(e){if(this.numRetries<this.retryOptions.maxRetries){if(e.status===g6t&&this.numChunksReadInRequest===0){this.startUploading()}else{const r=this.getRetryDelay();if(r<=0){this.destroy(new Error(`Retry total time limit exceeded - ${e.data}`));return}this.numBytesWritten-=this.localWriteCacheByteLength;this.prependLocalBufferToUpstream();this.offset=void 0;setTimeout(this.continueUploading.bind(this),r)}this.numRetries++}else{this.destroy(new Error("Retry limit exceeded - "+e.data))}}getRetryDelay(){const e=Math.round(Math.random()*1e3);const r=Math.pow(this.retryOptions.retryDelayMultiplier,this.numRetries)*1e3+e;const n=this.retryOptions.totalTimeout*1e3-(Date.now()-this.timeOfFirstRequest);const i=this.retryOptions.maxRetryDelay*1e3;return Math.min(r,i,n)}sanitizeEndpoint(e){if(!Fn.PROTOCOL_REGEX.test(e)){e=`https://${e}`}return e.replace(/\/+$/,"")}isSuccessfulResponse(e){return e>=200&&e<300}};Fn.Upload=LE;Fc=new WeakMap,Uc=new WeakSet,$E=o(function t(){this.localWriteCache=[];this.localWriteCacheByteLength=0},"_Upload_resetLocalBuffersCache"),DT=o(function t(e){this.localWriteCache.push(e);this.localWriteCacheByteLength+=e.byteLength},"_Upload_addLocalBufferCache");function v6t(t){return new LE(t)}o(v6t,"upload");Fn.upload=v6t;function _6t(t,e){const r=new LE(t);if(!e){return r.createURI()}r.createURI().then(n=>e(null,n),e)}o(_6t,"createURI");Fn.createURI=_6t});var UM=_(Oi=>{"use strict";var E6t=Oi&&Oi.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var b6t=Oi&&Oi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var YEe=Oi&&Oi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))E6t(e,t,r)}b6t(e,t);return e};Object.defineProperty(Oi,"__esModule",{value:true});Oi.SigningError=Oi.URLSigner=Oi.PATH_STYLED_HOST=Oi.SignerExceptionMessages=void 0;var w6t=YEe(require("crypto"));var zEe=YEe(require("url"));var GEe=Ig();var Np=yl();var qE;(function(t){t["ACCESSIBLE_DATE_INVALID"]="The accessible at date provided was invalid.";t["EXPIRATION_BEFORE_ACCESSIBLE_DATE"]="An expiration date cannot be before accessible date.";t["X_GOOG_CONTENT_SHA256"]="The header X-Goog-Content-SHA256 must be a hexadecimal string."})(qE||(Oi.SignerExceptionMessages=qE={}));var S6t="v2";var KEe=7*24*60*60;Oi.PATH_STYLED_HOST="https://storage.googleapis.com";var jM=class{static{o(this,"URLSigner")}constructor(e,r,n){this.bucket=r;this.file=n;this.authClient=e}getSignedUrl(e){const r=this.parseExpires(e.expires);const n=e.method;const i=this.parseAccessibleAt(e.accessibleAt);if(r<i){throw new Error(qE.EXPIRATION_BEFORE_ACCESSIBLE_DATE)}let s;const a=e.virtualHostedStyle||false;if(e.cname){s=e.cname}else if(a){s=`https://${this.bucket.name}.storage.googleapis.com`}const u=1e3;const l=Object.assign({},e,{method:n,expiration:r,accessibleAt:new Date(u*i),bucket:this.bucket.name,file:this.file?(0,Np.encodeURI)(this.file.name,false):void 0});if(s){l.cname=s}const c=e.version||S6t;let d;if(c==="v2"){d=this.getSignedUrlV2(l)}else if(c==="v4"){d=this.getSignedUrlV4(l)}else{throw new Error(`Invalid signed URL version: ${c}. Supported versions are 'v2' and 'v4'.`)}return d.then(p=>{p=Object.assign(p,e.queryParams);const f=new zEe.URL(l.cname||Oi.PATH_STYLED_HOST);f.pathname=this.getResourcePath(!!l.cname,this.bucket.name,l.file);f.search=(0,Np.qsStringify)(p);return f.href})}getSignedUrlV2(e){const r=this.getCanonicalHeaders(e.extensionHeaders||{});const n=this.getResourcePath(false,e.bucket,e.file);const i=[e.method,e.contentMd5||"",e.contentType||"",e.expiration,r+n].join("\n");const s=o(async()=>{const a=this.authClient;try{const u=await a.sign(i);const l=await a.getCredentials();return{GoogleAccessId:l.client_email,Expires:e.expiration,Signature:u}}catch(u){const l=u;const c=new jE(l.message);c.stack=l.stack;throw c}},"sign");return s()}getSignedUrlV4(e){e.accessibleAt=e.accessibleAt?e.accessibleAt:new Date;const r=1/1e3;const n=e.expiration-e.accessibleAt.valueOf()*r;if(n>KEe){throw new Error(`Max allowed expiration is seven days (${KEe} seconds).`)}const i=Object.assign({},e.extensionHeaders);const s=new zEe.URL(e.cname||Oi.PATH_STYLED_HOST);i.host=s.host;if(e.contentMd5){i["content-md5"]=e.contentMd5}if(e.contentType){i["content-type"]=e.contentType}let a;const u=i["x-goog-content-sha256"];if(u){if(typeof u!=="string"||!/[A-Fa-f0-9]{40}/.test(u)){throw new Error(qE.X_GOOG_CONTENT_SHA256)}a=u}const l=Object.keys(i).map(h=>h.toLowerCase()).sort().join(";");const c=this.getCanonicalHeaders(i);const d=(0,Np.formatAsUTCISO)(e.accessibleAt);const p=`${d}/auto/storage/goog4_request`;const f=o(async()=>{const h=await this.authClient.getCredentials();const m=`${h.client_email}/${p}`;const g=(0,Np.formatAsUTCISO)(e.accessibleAt?e.accessibleAt:new Date,true);const y={"X-Goog-Algorithm":"GOOG4-RSA-SHA256","X-Goog-Credential":m,"X-Goog-Date":g,"X-Goog-Expires":n.toString(10),"X-Goog-SignedHeaders":l,...e.queryParams||{}};const v=this.getCanonicalQueryParams(y);const w=this.getCanonicalRequest(e.method,this.getResourcePath(!!e.cname,e.bucket,e.file),v,c,l,a);const E=w6t.createHash("sha256").update(w).digest("hex");const b=["GOOG4-RSA-SHA256",g,p,E].join("\n");try{const S=await this.authClient.sign(b);const T=Buffer.from(S,"base64").toString("hex");const A=Object.assign({},y,{"X-Goog-Signature":T});return A}catch(S){const T=S;const A=new jE(T.message);A.stack=T.stack;throw A}},"sign");return f()}getCanonicalHeaders(e){const r=(0,Np.objectEntries)(e).map(([n,i])=>[n.toLowerCase(),i]).sort((n,i)=>n[0].localeCompare(i[0]));return r.filter(([,n])=>n!==void 0).map(([n,i])=>{const s=`${i}`.trim().replace(/\s{2,}/g," ");return`${n}:${s}
395
- `}).join("")}getCanonicalRequest(e,r,n,i,s,a){return[e,r,n,i,s,a||"UNSIGNED-PAYLOAD"].join("\n")}getCanonicalQueryParams(e){return(0,Np.objectEntries)(e).map(([r,n])=>[(0,Np.encodeURI)(r,true),(0,Np.encodeURI)(n,true)]).sort((r,n)=>r[0]<n[0]?-1:1).map(([r,n])=>`${r}=${n}`).join("&")}getResourcePath(e,r,n){if(e){return"/"+(n||"")}else if(n){return`/${r}/${n}`}else{return`/${r}`}}parseExpires(e,r=new Date){const n=new Date(e).valueOf();if(isNaN(n)){throw new Error(GEe.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(n<r.valueOf()){throw new Error(GEe.ExceptionMessages.EXPIRATION_DATE_PAST)}return Math.floor(n/1e3)}parseAccessibleAt(e){const r=new Date(e||new Date).valueOf();if(isNaN(r)){throw new Error(qE.ACCESSIBLE_DATE_INVALID)}return Math.floor(r/1e3)}};Oi.URLSigner=jM;var jE=class extends Error{static{o(this,"SigningError")}constructor(){super(...arguments);this.name="SigningError"}};Oi.SigningError=jE});var UE=_(vs=>{"use strict";var WEe=vs&&vs.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r};var kT=vs&&vs.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var Ip;Object.defineProperty(vs,"__esModule",{value:true});vs.CRC32C_EXTENSION_TABLE=vs.CRC32C_EXTENSIONS=vs.CRC32C_EXCEPTION_MESSAGES=vs.CRC32C_DEFAULT_VALIDATOR_GENERATOR=vs.CRC32C=void 0;var T6t=require("fs");var FM=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697];vs.CRC32C_EXTENSIONS=FM;var JEe=new Int32Array(FM);vs.CRC32C_EXTENSION_TABLE=JEe;var A6t=o(()=>new Pg,"CRC32C_DEFAULT_VALIDATOR_GENERATOR");vs.CRC32C_DEFAULT_VALIDATOR_GENERATOR=A6t;var $T={INVALID_INIT_BASE64_RANGE:t=>`base64-encoded data expected to equal 4 bytes, not ${t}`,INVALID_INIT_BUFFER_LENGTH:t=>`Buffer expected to equal 4 bytes, not ${t}`,INVALID_INIT_INTEGER:t=>`Number expected to be a safe, unsigned 32-bit integer, not ${t}`};vs.CRC32C_EXCEPTION_MESSAGES=$T;var Pg=class t{static{o(this,"CRC32C")}constructor(e=0){Ip.set(this,0);WEe(this,Ip,e,"f")}update(e){let r=kT(this,Ip,"f")^4294967295;for(const n of e){const i=t.CRC32C_EXTENSION_TABLE[(n^r)&255];r=i^r>>>8}WEe(this,Ip,r^4294967295,"f")}validate(e){if(typeof e==="number"){return e===kT(this,Ip,"f")}else if(typeof e==="string"){return e===this.toString()}else if(Buffer.isBuffer(e)){return Buffer.compare(e,this.toBuffer())===0}else{return e.toString()===this.toString()}}toBuffer(){const e=Buffer.alloc(4);e.writeInt32BE(kT(this,Ip,"f"));return e}toJSON(){return this.toString()}toString(){return this.toBuffer().toString("base64")}valueOf(){return kT(this,Ip,"f")}static fromBuffer(e){let r;if(Buffer.isBuffer(e)){r=e}else if("buffer"in e){r=Buffer.from(e.buffer)}else{r=Buffer.from(e)}if(r.byteLength!==4){throw new RangeError($T.INVALID_INIT_BUFFER_LENGTH(r.byteLength))}return new t(r.readInt32BE())}static async fromFile(e){const r=new t;await new Promise((n,i)=>{(0,T6t.createReadStream)(e).on("data",s=>r.update(s)).on("end",n).on("error",i)});return r}static fromString(e){const r=Buffer.from(e,"base64");if(r.byteLength!==4){throw new RangeError($T.INVALID_INIT_BASE64_RANGE(r.byteLength))}return this.fromBuffer(r)}static fromNumber(e){if(!Number.isSafeInteger(e)||e>2**32||e<-(2**32)){throw new RangeError($T.INVALID_INIT_INTEGER(e))}return new t(e)}static from(e){if(typeof e==="number"){return this.fromNumber(e)}else if(typeof e==="string"){return this.fromString(e)}else if("byteLength"in e){return this.fromBuffer(e)}else{return this.fromString(e.toString())}}};vs.CRC32C=Pg;Ip=new WeakMap;Pg.CRC32C_EXTENSIONS=FM;Pg.CRC32C_EXTENSION_TABLE=JEe});var VM=_(Dp=>{"use strict";var MM=Dp&&Dp.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r};var bl=Dp&&Dp.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var sm;var Pp;var LT;Object.defineProperty(Dp,"__esModule",{value:true});Dp.HashStreamValidator=void 0;var x6t=require("crypto");var C6t=require("stream");var R6t=UE();var QEe=FE();var BM=class extends C6t.Transform{static{o(this,"HashStreamValidator")}constructor(e={}){super();this.updateHashesOnly=false;sm.set(this,void 0);Pp.set(this,void 0);LT.set(this,"");this.crc32cEnabled=!!e.crc32c;this.md5Enabled=!!e.md5;this.updateHashesOnly=!!e.updateHashesOnly;this.crc32cExpected=e.crc32cExpected;this.md5Expected=e.md5Expected;if(this.crc32cEnabled){const r=e.crc32cGenerator||R6t.CRC32C_DEFAULT_VALIDATOR_GENERATOR;MM(this,sm,r(),"f")}if(this.md5Enabled){MM(this,Pp,(0,x6t.createHash)("md5"),"f")}}_flush(e){if(bl(this,Pp,"f")){MM(this,LT,bl(this,Pp,"f").digest("base64"),"f")}if(this.updateHashesOnly){e();return}let r=this.crc32cEnabled||this.md5Enabled;if(this.crc32cEnabled&&this.crc32cExpected){r=!this.test("crc32c",this.crc32cExpected)}if(this.md5Enabled&&this.md5Expected){r=!this.test("md5",this.md5Expected)}if(r){const n=new QEe.RequestError(QEe.FileExceptionMessages.DOWNLOAD_MISMATCH);n.code="CONTENT_DOWNLOAD_MISMATCH";e(n)}else{e()}}_transform(e,r,n){this.push(e,r);try{if(bl(this,sm,"f"))bl(this,sm,"f").update(e);if(bl(this,Pp,"f"))bl(this,Pp,"f").update(e);n()}catch(i){n(i)}}test(e,r){const n=Buffer.isBuffer(r)?r.toString("base64"):r;if(e==="crc32c"&&bl(this,sm,"f")){return bl(this,sm,"f").validate(n)}if(e==="md5"&&bl(this,Pp,"f")){return bl(this,LT,"f")===n}return false}};Dp.HashStreamValidator=BM;sm=new WeakMap,Pp=new WeakMap,LT=new WeakMap});var FE=_(Mn=>{"use strict";var O6t=Mn&&Mn.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var N6t=Mn&&Mn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var jT=Mn&&Mn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))O6t(e,t,r)}N6t(e,t);return e};var I6t=Mn&&Mn.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var UT=Mn&&Mn.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};var zM;var n6e;Object.defineProperty(Mn,"__esModule",{value:true});Mn.File=Mn.FileExceptionMessages=Mn.RequestError=Mn.STORAGE_POST_POLICY_BASE_URL=Mn.ActionToHTTPMethod=void 0;var kp=xp();var P6t=_l();var D6t=UT(_Ee());var k6t=jT(require("crypto"));var XEe=jT(require("fs"));var $6t=UT(CEe());var ZEe=jT(HEe());var ME=require("stream");var e6e=jT(require("zlib"));var To=Ig();var BE=FT();var L6t=PM();var HM=UM();var Mc=rm();var q6t=UT(gM());var Bc=yl();var t6e=VM();var j6t=UT(OE());var GM;(function(t){t["read"]="GET";t["write"]="PUT";t["delete"]="DELETE";t["resumable"]="POST"})(GM||(Mn.ActionToHTTPMethod=GM={}));Mn.STORAGE_POST_POLICY_BASE_URL="https://storage.googleapis.com";var U6t=/^gs:\/\/([a-z0-9_.-]+)\/(.+)$/;var VE=class extends Error{static{o(this,"RequestError")}};Mn.RequestError=VE;var r6e=7*24*60*60;var Ao;(function(t){t["EXPIRATION_TIME_NA"]="An expiration time is not available.";t["DESTINATION_NO_NAME"]="Destination file should have a name.";t["INVALID_VALIDATION_FILE_RANGE"]="Cannot use validation with file ranges (start/end).";t["MD5_NOT_AVAILABLE"]="MD5 verification was specified, but is not available for the requested object. MD5 is not available for composite objects.";t["EQUALS_CONDITION_TWO_ELEMENTS"]="Equals condition must be an array of 2 elements.";t["STARTS_WITH_TWO_ELEMENTS"]="StartsWith condition must be an array of 2 elements.";t["CONTENT_LENGTH_RANGE_MIN_MAX"]="ContentLengthRange must have numeric min & max fields.";t["DOWNLOAD_MISMATCH"]="The downloaded data did not match the data from the server. To be sure the content is the same, you should download the file again.";t["UPLOAD_MISMATCH_DELETE_FAIL"]="The uploaded data did not match the data from the server.\n As a precaution, we attempted to delete the file, but it was not successful.\n To be sure the content is the same, you should try removing the file manually,\n then uploading the file again.\n \n\nThe delete attempt failed with this message:\n\n ";t["UPLOAD_MISMATCH"]="The uploaded data did not match the data from the server.\n As a precaution, the file has been deleted.\n To be sure the content is the same, you should try uploading the file again."})(Ao||(Mn.FileExceptionMessages=Ao={}));var qT=class t extends kp.ServiceObject{static{o(this,"File")}constructor(e,r,n={}){var i,s;const a={};let u;if(n.generation!==null){if(typeof n.generation==="string"){u=Number(n.generation)}else{u=n.generation}if(!isNaN(u)){a.generation=u}}Object.assign(a,n.preconditionOpts);const l=n.userProject||e.userProject;if(typeof l==="string"){a.userProject=l}const c={delete:{reqOpts:{qs:a}},exists:{reqOpts:{qs:a}},get:{reqOpts:{qs:a}},getMetadata:{reqOpts:{qs:a}},setMetadata:{reqOpts:{qs:a}}};super({parent:e,baseUrl:"/o",id:encodeURIComponent(r),methods:c});zM.add(this);this.bucket=e;this.storage=e.parent;if(n.generation!==null){let d;if(typeof n.generation==="string"){d=Number(n.generation)}else{d=n.generation}if(!isNaN(d)){this.generation=d}}this.kmsKeyName=n.kmsKeyName;this.userProject=l;this.name=r;if(n.encryptionKey){this.setEncryptionKey(n.encryptionKey)}this.acl=new L6t.Acl({request:this.request.bind(this),pathPrefix:"/acl"});this.crc32cGenerator=n.crc32cGenerator||this.bucket.crc32cGenerator;this.instanceRetryValue=(s=(i=this.storage)===null||i===void 0?void 0:i.retryOptions)===null||s===void 0?void 0:s.autoRetry;this.instancePreconditionOpts=n===null||n===void 0?void 0:n.preconditionOpts}get cloudStorageURI(){const e=this.bucket.cloudStorageURI;e.pathname=this.name;return e}shouldRetryBasedOnPreconditionAndIdempotencyStrat(e){var r;return!((e===null||e===void 0?void 0:e.ifGenerationMatch)===void 0&&((r=this.instancePreconditionOpts)===null||r===void 0?void 0:r.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryNever)}copy(e,r,n){var i,s;const a=new Error(Ao.DESTINATION_NO_NAME);if(!e){throw a}let u={};if(typeof r==="function"){n=r}else if(r){u={...r}}n=n||kp.util.noop;let l;let c;let d;if(typeof e==="string"){const h=U6t.exec(e);if(h!==null&&h.length===3){l=this.storage.bucket(h[1]);c=h[2]}else{l=this.bucket;c=e}}else if(e instanceof BE.Bucket){l=e;c=this.name}else if(e instanceof t){l=e.bucket;c=e.name;d=e}else{throw a}const p={};if(this.generation!==void 0){p.sourceGeneration=this.generation}if(u.token!==void 0){p.rewriteToken=u.token}if(u.userProject!==void 0){p.userProject=u.userProject;delete u.userProject}if(u.predefinedAcl!==void 0){p.destinationPredefinedAcl=u.predefinedAcl;delete u.predefinedAcl}d=d||l.file(c);const f={};if(this.encryptionKey!==void 0){f["x-goog-copy-source-encryption-algorithm"]="AES256";f["x-goog-copy-source-encryption-key"]=this.encryptionKeyBase64;f["x-goog-copy-source-encryption-key-sha256"]=this.encryptionKeyHash}if(d.encryptionKey!==void 0){this.setEncryptionKey(d.encryptionKey)}else if(u.destinationKmsKeyName!==void 0){p.destinationKmsKeyName=u.destinationKmsKeyName;delete u.destinationKmsKeyName}else if(d.kmsKeyName!==void 0){p.destinationKmsKeyName=d.kmsKeyName}if(p.destinationKmsKeyName){this.kmsKeyName=p.destinationKmsKeyName;const h=this.interceptors.indexOf(this.encryptionKeyInterceptor);if(h>-1){this.interceptors.splice(h,1)}}if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(u===null||u===void 0?void 0:u.preconditionOpts)){this.storage.retryOptions.autoRetry=false}if(((i=u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)!==void 0){p.ifGenerationMatch=(s=u.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch;delete u.preconditionOpts}this.request({method:"POST",uri:`/rewriteTo/b/${l.name}/o/${encodeURIComponent(d.name)}`,qs:p,json:u,headers:f},(h,m)=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue;if(h){n(h,null,m);return}if(m.rewriteToken){const g={token:m.rewriteToken};if(p.userProject){g.userProject=p.userProject}if(p.destinationKmsKeyName){g.destinationKmsKeyName=p.destinationKmsKeyName}this.copy(d,g,n);return}n(null,d,m)})}createReadStream(e={}){e=Object.assign({decompress:true},e);const r=typeof e.start==="number"||typeof e.end==="number";const n=e.end<0;let i=void 0;let s=void 0;const a=new Bc.PassThroughShim;let u=true;let l=false;if(typeof e.validation==="string"){const h=e.validation.toLowerCase().trim();u=h==="crc32c";l=h==="md5"}else if(e.validation===false){u=false}const c=!r&&(u||l);if(r){if(typeof e.validation==="string"||e.validation===true){throw new Error(Ao.INVALID_VALIDATION_FILE_RANGE)}u=false;l=false}const d=o(h=>{if(h){if(s===null||s===void 0?void 0:s.agent){s.agent.destroy()}a.destroy(h)}},"onComplete");const p=o((h,m,g)=>{if(h){this.getBufferFromReadable(g).then(S=>{h.message=S.toString("utf8");a.destroy(h)});return}s=g.request;const y=g.toJSON().headers;const v=y["content-encoding"]==="gzip";const w={};const E=y["x-goog-stored-content-encoding"]==="gzip"&&v||y["x-goog-stored-content-encoding"]==="identity";const b=[];if(c){if(typeof y["x-goog-hash"]==="string"){y["x-goog-hash"].split(",").forEach(S=>{const T=S.indexOf("=");const A=S.substring(0,T);const R=S.substring(T+1);w[A]=R})}i=new t6e.HashStreamValidator({crc32c:u,md5:l,crc32cGenerator:this.crc32cGenerator,crc32cExpected:w.crc32c,md5Expected:w.md5})}if(l&&!w.md5){const S=new VE(Ao.MD5_NOT_AVAILABLE);S.code="MD5_NOT_AVAILABLE";a.destroy(S);return}if(E&&c&&i){b.push(i)}if(v&&e.decompress){b.push(e6e.createGunzip())}(0,ME.pipeline)(g,...b,a,d)},"onResponse");const f=o(()=>{const h={alt:"media"};if(this.generation){h.generation=this.generation}if(e.userProject){h.userProject=e.userProject}const m={"Accept-Encoding":"gzip","Cache-Control":"no-store"};if(r){const y=typeof e.start==="number"?e.start:"0";const v=typeof e.end==="number"?e.end:"";m.Range=`bytes=${n?v:`${y}-${v}`}`}const g={uri:"",headers:m,qs:h};if(e[Mc.GCCL_GCS_CMD_KEY]){g[Mc.GCCL_GCS_CMD_KEY]=e[Mc.GCCL_GCS_CMD_KEY]}this.requestStream(g).on("error",y=>{a.destroy(y)}).on("response",y=>{a.emit("response",y);kp.util.handleResp(null,y,null,p)}).resume()},"makeRequest");a.on("reading",f);return a}createResumableUpload(e,r){var n,i;const s=typeof e==="object"?e:{};r=typeof e==="function"?e:r;const a=this.storage.retryOptions;if(((n=s===null||s===void 0?void 0:s.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&((i=this.instancePreconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryNever){a.autoRetry=false}ZEe.createURI({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((u,l)=>l(u),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:s.metadata,offset:s.offset,origin:s.origin,predefinedAcl:s.predefinedAcl,private:s.private,public:s.public,userProject:s.userProject||this.userProject,retryOptions:a,params:(s===null||s===void 0?void 0:s.preconditionOpts)||this.instancePreconditionOpts,[Mc.GCCL_GCS_CMD_KEY]:s[Mc.GCCL_GCS_CMD_KEY]},r);this.storage.retryOptions.autoRetry=this.instanceRetryValue}createWriteStream(e={}){var r;(r=e.metadata)!==null&&r!==void 0?r:e.metadata={};if(e.contentType){e.metadata.contentType=e.contentType}if(!e.metadata.contentType||e.metadata.contentType==="auto"){const f=$6t.default.getType(this.name);if(f){e.metadata.contentType=f}}let n=e.gzip;if(n==="auto"){n=(0,D6t.default)(e.metadata.contentType||"")}if(n){e.metadata.contentEncoding="gzip"}let i=true;let s=false;if(typeof e.validation==="string"){e.validation=e.validation.toLowerCase();i=e.validation==="crc32c";s=e.validation==="md5"}else if(e.validation===false){i=false}let a=o(f=>{u.destroy(f||void 0)},"pipelineCallback");const u=new ME.Writable({final(f){a=f;l.end()},write(f,h,m){l.write(f,h,m)}});const l=new Bc.PassThroughShim;const c=new t6e.HashStreamValidator({crc32c:i,md5:s,crc32cGenerator:this.crc32cGenerator,updateHashesOnly:true});const d=(0,q6t.default)();let p=false;l.on("reading",()=>u.emit("reading"));l.on("writing",()=>u.emit("writing"));d.on("progress",f=>u.emit("progress",f));d.on("response",f=>u.emit("response",f));d.once("metadata",()=>{p=true});u.on("writing",()=>{if(e.resumable===false){this.startSimpleUpload_(d,e)}else{this.startResumableUpload_(d,e)}(0,ME.pipeline)(l,n?e6e.createGzip():new ME.PassThrough,c,d,async f=>{if(f){return a(f)}if(!p){try{await new Promise((h,m)=>{d.once("metadata",h);d.once("error",m)})}catch(h){return a(h)}}try{await I6t(this,zM,"m",n6e).call(this,c,{crc32c:i,md5:s});a()}catch(h){a(h)}})});return u}delete(e,r){const n=typeof e==="object"?e:{};r=typeof e==="function"?e:r;this.disableAutoRetryConditionallyIdempotent_(this.methods.delete,BE.AvailableServiceObjectMethods.delete,n);super.delete(n).then(i=>r(null,...i)).catch(r).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}download(e,r){let n;if(typeof e==="function"){r=e;n={}}else{n=e}let i=false;const s=o((...c)=>{if(!i)r(...c);i=true},"callback");const a=n.destination;delete n.destination;const u=this.createReadStream(n);let l=false;if(a){u.on("error",s).once("data",c=>{l=true;const d=XEe.createWriteStream(a);d.write(c);u.pipe(d).on("error",s).on("finish",s)}).on("end",()=>{if(!l){const c=Buffer.alloc(0);try{XEe.writeFileSync(a,c);s(null,c)}catch(d){s(d,c)}}})}else{this.getBufferFromReadable(u).then(c=>s===null||s===void 0?void 0:s(null,c)).catch(s)}}setEncryptionKey(e){this.encryptionKey=e;this.encryptionKeyBase64=Buffer.from(e).toString("base64");this.encryptionKeyHash=k6t.createHash("sha256").update(this.encryptionKeyBase64,"base64").digest("base64");this.encryptionKeyInterceptor={request:r=>{r.headers=r.headers||{};r.headers["x-goog-encryption-algorithm"]="AES256";r.headers["x-goog-encryption-key"]=this.encryptionKeyBase64;r.headers["x-goog-encryption-key-sha256"]=this.encryptionKeyHash;return r}};this.interceptors.push(this.encryptionKeyInterceptor);return this}getExpirationDate(e){this.getMetadata((r,n,i)=>{if(r){e(r,null,i);return}if(!n.retentionExpirationTime){const s=new Error(Ao.EXPIRATION_TIME_NA);e(s,null,i);return}e(null,new Date(n.retentionExpirationTime),i)})}generateSignedPostPolicyV2(e,r){const n=(0,Bc.normalize)(e,r);let i=n.options;const s=n.callback;const a=new Date(i.expires);if(isNaN(a.getTime())){throw new Error(To.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(a.valueOf()<Date.now()){throw new Error(To.ExceptionMessages.EXPIRATION_DATE_PAST)}i=Object.assign({},i);const u=[["eq","$key",this.name],{bucket:this.bucket.name}];if(Array.isArray(i.equals)){if(!Array.isArray(i.equals[0])){i.equals=[i.equals]}i.equals.forEach(p=>{if(!Array.isArray(p)||p.length!==2){throw new Error(Ao.EQUALS_CONDITION_TWO_ELEMENTS)}u.push(["eq",p[0],p[1]])})}if(Array.isArray(i.startsWith)){if(!Array.isArray(i.startsWith[0])){i.startsWith=[i.startsWith]}i.startsWith.forEach(p=>{if(!Array.isArray(p)||p.length!==2){throw new Error(Ao.STARTS_WITH_TWO_ELEMENTS)}u.push(["starts-with",p[0],p[1]])})}if(i.acl){u.push({acl:i.acl})}if(i.successRedirect){u.push({success_action_redirect:i.successRedirect})}if(i.successStatus){u.push({success_action_status:i.successStatus})}if(i.contentLengthRange){const p=i.contentLengthRange.min;const f=i.contentLengthRange.max;if(typeof p!=="number"||typeof f!=="number"){throw new Error(Ao.CONTENT_LENGTH_RANGE_MIN_MAX)}u.push(["content-length-range",p,f])}const l={expiration:a.toISOString(),conditions:u};const c=JSON.stringify(l);const d=Buffer.from(c).toString("base64");this.storage.authClient.sign(d).then(p=>{s(null,{string:c,base64:d,signature:p})},p=>{s(new HM.SigningError(p.message))})}generateSignedPostPolicyV4(e,r){const n=(0,Bc.normalize)(e,r);let i=n.options;const s=n.callback;const a=new Date(i.expires);if(isNaN(a.getTime())){throw new Error(To.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(a.valueOf()<Date.now()){throw new Error(To.ExceptionMessages.EXPIRATION_DATE_PAST)}if(a.valueOf()-Date.now()>r6e*1e3){throw new Error(`Max allowed expiration is seven days (${r6e} seconds).`)}i=Object.assign({},i);let u=Object.assign({},i.fields);const l=new Date;const c=(0,Bc.formatAsUTCISO)(l,true);const d=(0,Bc.formatAsUTCISO)(l);const p=o(async()=>{const{client_email:f}=await this.storage.authClient.getCredentials();const h=`${f}/${d}/auto/storage/goog4_request`;u={...u,bucket:this.bucket.name,key:this.name,"x-goog-date":c,"x-goog-credential":h,"x-goog-algorithm":"GOOG4-RSA-SHA256"};const m=i.conditions||[];Object.entries(u).forEach(([E,b])=>{if(!E.startsWith("x-ignore-")){m.push({[E]:b})}});delete u.bucket;const g=(0,Bc.formatAsUTCISO)(a,true,"-",":");const y={conditions:m,expiration:g};const v=(0,Bc.unicodeJSONStringify)(y);const w=Buffer.from(v).toString("base64");try{const E=await this.storage.authClient.sign(w);const b=Buffer.from(E,"base64").toString("hex");u["policy"]=w;u["x-goog-signature"]=b;let S;if(i.virtualHostedStyle){S=`https://${this.bucket.name}.storage.googleapis.com/`}else if(i.bucketBoundHostname){S=`${i.bucketBoundHostname}/`}else{S=`${Mn.STORAGE_POST_POLICY_BASE_URL}/${this.bucket.name}/`}return{url:S,fields:u}}catch(E){throw new HM.SigningError(E.message)}},"sign");p().then(f=>s(null,f),s)}getSignedUrl(e,r){const n=GM[e.action];const i=(0,Bc.objectKeyToLowercase)(e.extensionHeaders||{});if(e.action==="resumable"){i["x-goog-resumable"]="start"}const s=Object.assign({},e.queryParams);if(typeof e.responseType==="string"){s["response-content-type"]=e.responseType}if(typeof e.promptSaveAs==="string"){s["response-content-disposition"]='attachment; filename="'+e.promptSaveAs+'"'}if(typeof e.responseDisposition==="string"){s["response-content-disposition"]=e.responseDisposition}if(this.generation){s["generation"]=this.generation.toString()}const a={method:n,expires:e.expires,accessibleAt:e.accessibleAt,extensionHeaders:i,queryParams:s,contentMd5:e.contentMd5,contentType:e.contentType};if(e.cname){a.cname=e.cname}if(e.version){a.version=e.version}if(e.virtualHostedStyle){a.virtualHostedStyle=e.virtualHostedStyle}if(!this.signer){this.signer=new HM.URLSigner(this.storage.authClient,this.bucket,this)}this.signer.getSignedUrl(a).then(u=>r(null,u),r)}isPublic(e){var r;const n=((r=this.storage)===null||r===void 0?void 0:r.interceptors)||[];const i=this.interceptors||[];const s=n.concat(i);const a=s.reduce((u,l)=>{const c=l.request({uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`});Object.assign(u,c.headers);return u},{});kp.util.makeRequest({method:"GET",uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`,headers:a},{retryOptions:this.storage.retryOptions},u=>{if(u){const l=u;if(l.code===403){e(null,false)}else{e(u)}}else{e(null,true)}})}makePrivate(e,r){var n,i;const s=typeof e==="object"?e:{};r=typeof e==="function"?e:r;const a={predefinedAcl:s.strict?"private":"projectPrivate"};if(((n=s.preconditionOpts)===null||n===void 0?void 0:n.ifMetagenerationMatch)!==void 0){a.ifMetagenerationMatch=(i=s.preconditionOpts)===null||i===void 0?void 0:i.ifMetagenerationMatch;delete s.preconditionOpts}if(s.userProject){a.userProject=s.userProject}const u={...s.metadata,acl:null};this.setMetadata(u,a,r)}makePublic(e){e=e||kp.util.noop;this.acl.add({entity:"allUsers",role:"READER"},(r,n,i)=>{e(r,i)})}publicUrl(){return`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`}move(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||kp.util.noop;this.copy(e,i,(s,a,u)=>{if(s){s.message="file#copy failed with an error - "+s.message;n(s,null,u);return}if(this.name!==a.name||this.bucket.name!==a.bucket.name){this.delete(i,(l,c)=>{if(l){l.message="file#delete failed with an error - "+l.message;n(l,a,c);return}n(null,a,u)})}else{n(null,a,u)}})}rename(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||kp.util.noop;this.move(e,i,n)}request(e,r){return this.parent.request.call(this,e,r)}rotateEncryptionKey(e,r){var n;r=typeof e==="function"?e:r;let i={};if(typeof e==="string"||e instanceof Buffer){i={encryptionKey:e}}else if(typeof e==="object"){i=e}const s=this.bucket.file(this.id,i);const a=((n=i.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)!==void 0?{preconditionOpts:i.preconditionOpts}:{};this.copy(s,a,r)}save(e,r,n){n=typeof r==="function"?r:n;const i=typeof r==="object"?r:{};let s=this.storage.retryOptions.maxRetries;if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(i===null||i===void 0?void 0:i.preconditionOpts)){s=0}const a=(0,j6t.default)(async u=>{return new Promise((l,c)=>{if(s===0){this.storage.retryOptions.autoRetry=false}const d=this.createWriteStream(i);if(i.onUploadProgress){d.on("progress",i.onUploadProgress)}const p=o(f=>{if(this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(f)){return c(f)}return u(f)},"handleError");if(typeof e==="string"||Buffer.isBuffer(e)){d.on("error",p).on("finish",()=>l()).end(e)}else{(0,ME.pipeline)(e,d,f=>{if(f){if(typeof e!=="function"){return u(f)}p(f)}else{l()}})}})},{retries:s,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});if(!n){return a}else{return a.then(()=>{if(n){return n()}}).catch(n)}}setMetadata(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,BE.AvailableServiceObjectMethods.setMetadata,i);super.setMetadata(e,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setStorageClass(e,r,n){n=typeof r==="function"?r:n;const i=typeof r==="object"?r:{};const s={...i,storageClass:e.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(a,u,l)=>{return u+"_"+l}).toUpperCase()};this.copy(this,s,(a,u,l)=>{if(a){n(a,l);return}this.metadata=u.metadata;n(null,l)})}setUserProject(e){this.bucket.setUserProject.call(this,e)}startResumableUpload_(e,r={}){var n;(n=r.metadata)!==null&&n!==void 0?n:r.metadata={};const i=this.storage.retryOptions;if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(r.preconditionOpts)){i.autoRetry=false}const s=ZEe.upload({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((a,u)=>u(a),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:r.metadata,offset:r.offset,predefinedAcl:r.predefinedAcl,private:r.private,public:r.public,uri:r.uri,userProject:r.userProject||this.userProject,retryOptions:{...i},params:(r===null||r===void 0?void 0:r.preconditionOpts)||this.instancePreconditionOpts,chunkSize:r===null||r===void 0?void 0:r.chunkSize,highWaterMark:r===null||r===void 0?void 0:r.highWaterMark,[Mc.GCCL_GCS_CMD_KEY]:r[Mc.GCCL_GCS_CMD_KEY]});s.on("response",a=>{e.emit("response",a)}).on("metadata",a=>{this.metadata=a;e.emit("metadata")}).on("finish",()=>{e.emit("complete")}).on("progress",a=>e.emit("progress",a));e.setWritable(s);this.storage.retryOptions.autoRetry=this.instanceRetryValue}startSimpleUpload_(e,r={}){var n;(n=r.metadata)!==null&&n!==void 0?n:r.metadata={};const i=this.storage.apiEndpoint;const s=this.bucket.name;const a=`${i}/upload/storage/v1/b/${s}/o`;const u={qs:{name:this.name},uri:a,[Mc.GCCL_GCS_CMD_KEY]:r[Mc.GCCL_GCS_CMD_KEY]};if(this.generation!==void 0){u.qs.ifGenerationMatch=this.generation}if(this.kmsKeyName!==void 0){u.qs.kmsKeyName=this.kmsKeyName}if(typeof r.timeout==="number"){u.timeout=r.timeout}if(r.userProject||this.userProject){u.qs.userProject=r.userProject||this.userProject}if(r.predefinedAcl){u.qs.predefinedAcl=r.predefinedAcl}else if(r.private){u.qs.predefinedAcl="private"}else if(r.public){u.qs.predefinedAcl="publicRead"}Object.assign(u.qs,this.instancePreconditionOpts,r.preconditionOpts);kp.util.makeWritableStream(e,{makeAuthenticatedRequest:l=>{this.request(l,(c,d,p)=>{if(c){e.destroy(c);return}this.metadata=d;e.emit("metadata",d);e.emit("response",p);e.emit("complete")})},metadata:r.metadata,request:u})}disableAutoRetryConditionallyIdempotent_(e,r,n){var i,s,a,u;if(typeof e==="object"&&((s=(i=e===null||e===void 0?void 0:e.reqOpts)===null||i===void 0?void 0:i.qs)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&r===BE.AvailableServiceObjectMethods.delete&&this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}if(typeof e==="object"&&((u=(a=e===null||e===void 0?void 0:e.reqOpts)===null||a===void 0?void 0:a.qs)===null||u===void 0?void 0:u.ifMetagenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifMetagenerationMatch)===void 0&&r===BE.AvailableServiceObjectMethods.setMetadata&&this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}}async getBufferFromReadable(e){const r=[];for await(const n of e){r.push(n)}return Buffer.concat(r)}};Mn.File=qT;zM=new WeakSet,n6e=o(async function t(e,r={}){const n=this.metadata;let i=!!(r.crc32c||r.md5);if(r.crc32c&&n.crc32c){i=!e.test("crc32c",n.crc32c)}if(r.md5&&n.md5Hash){i=!e.test("md5",n.md5Hash)}if(i){const s=[];let a="";let u="";try{await this.delete();if(r.md5&&!n.md5Hash){a="MD5_NOT_AVAILABLE";u=Ao.MD5_NOT_AVAILABLE}else{a="FILE_NO_UPLOAD";u=Ao.UPLOAD_MISMATCH}}catch(c){const d=c;a="FILE_NO_UPLOAD_DELETE";u=`${Ao.UPLOAD_MISMATCH_DELETE_FAIL}${d.message}`;s.push(d)}const l=new VE(u);l.code=a;l.errors=s;throw l}return true},"_File_validateIntegrity");(0,P6t.promisifyAll)(qT,{exclude:["cloudStorageURI","publicUrl","request","save","setEncryptionKey","shouldRetryBasedOnPreconditionAndIdempotencyStrat","getBufferFromReadable"]})});var YM=_(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:true});Dg.Iam=Dg.IAMExceptionMessages=void 0;var F6t=_l();var KM=yl();var MT;(function(t){t["POLICY_OBJECT_REQUIRED"]="A policy object is required.";t["PERMISSIONS_REQUIRED"]="Permissions are required."})(MT||(Dg.IAMExceptionMessages=MT={}));var BT=class{static{o(this,"Iam")}constructor(e){this.request_=e.request.bind(e);this.resourceId_="buckets/"+e.getId()}getPolicy(e,r){const{options:n,callback:i}=(0,KM.normalize)(e,r);const s={};if(n.userProject){s.userProject=n.userProject}if(n.requestedPolicyVersion!==null&&n.requestedPolicyVersion!==void 0){s.optionsRequestedPolicyVersion=n.requestedPolicyVersion}this.request_({uri:"/iam",qs:s},i)}setPolicy(e,r,n){if(e===null||typeof e!=="object"){throw new Error(MT.POLICY_OBJECT_REQUIRED)}const{options:i,callback:s}=(0,KM.normalize)(r,n);let a;if(e.etag===void 0){a=0}this.request_({method:"PUT",uri:"/iam",maxRetries:a,json:Object.assign({resourceId:this.resourceId_},e),qs:i},s)}testPermissions(e,r,n){if(!Array.isArray(e)&&typeof e!=="string"){throw new Error(MT.PERMISSIONS_REQUIRED)}const{options:i,callback:s}=(0,KM.normalize)(r,n);const a=Array.isArray(e)?e:[e];const u=Object.assign({permissions:a},i);this.request_({uri:"/iam/testPermissions",qs:u,useQuerystring:true},(l,c)=>{if(l){s(l,null,c);return}const d=Array.isArray(c.permissions)?c.permissions:[];const p=a.reduce((f,h)=>{f[h]=d.indexOf(h)>-1;return f},{});s(null,p,c)})}};Dg.Iam=BT;(0,F6t.promisifyAll)(BT)});var WM=_(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:true});HT.Notification=void 0;var M6t=xp();var B6t=_l();var VT=class extends M6t.ServiceObject{static{o(this,"Notification")}constructor(e,r){const n={};const i={create:true,delete:{reqOpts:{qs:n}},get:{reqOpts:{qs:n}},getMetadata:{reqOpts:{qs:n}},exists:true};super({parent:e,baseUrl:"/notificationConfigs",id:r.toString(),createMethod:e.createNotification.bind(e),methods:i})}};HT.Notification=VT;(0,B6t.promisifyAll)(VT)});var FT=_(Ni=>{"use strict";var V6t=Ni&&Ni.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var H6t=Ni&&Ni.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var XM=Ni&&Ni.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))V6t(e,t,r)}H6t(e,t);return e};var o6e=Ni&&Ni.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Ni,"__esModule",{value:true});Ni.Bucket=Ni.BucketExceptionMessages=Ni.AvailableServiceObjectMethods=Ni.BucketActionToHTTPMethod=void 0;var zT=xp();var u6e=xM();var z6t=_l();var G6t=XM(require("fs"));var K6t=XM(RM());var Y6t=XM(require("path"));var i6e=o6e(IM());var s6e=require("util");var W6t=o6e(OE());var J6t=yl();var a6e=PM();var JM=FE();var Q6t=YM();var X6t=WM();var kg=Ig();var Z6t=UM();var ebt=require("stream");var tbt=require("url");var QM;(function(t){t["list"]="GET"})(QM||(Ni.BucketActionToHTTPMethod=QM={}));var $g;(function(t){t[t["setMetadata"]=0]="setMetadata";t[t["delete"]=1]="delete"})($g||(Ni.AvailableServiceObjectMethods=$g={}));var wl;(function(t){t["PROVIDE_SOURCE_FILE"]="You must provide at least one source file.";t["DESTINATION_FILE_NOT_SPECIFIED"]="A destination file must be specified.";t["CHANNEL_ID_REQUIRED"]="An ID is required to create a channel.";t["TOPIC_NAME_REQUIRED"]="A valid topic name is required.";t["CONFIGURATION_OBJECT_PREFIX_REQUIRED"]="A configuration object with a prefix is required.";t["SPECIFY_FILE_NAME"]="A file name must be specified.";t["METAGENERATION_NOT_PROVIDED"]="A metageneration must be provided.";t["SUPPLY_NOTIFICATION_ID"]="You must supply a notification ID."})(wl||(Ni.BucketExceptionMessages=wl={}));var HE=class t extends zT.ServiceObject{static{o(this,"Bucket")}getFilesStream(e){return new ebt.Readable}constructor(e,r,n){var i,s,a,u;n=n||{};r=r.replace(/^gs:\/\//,"").replace(/\/+$/,"");const l={};if((i=n===null||n===void 0?void 0:n.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch){l.ifGenerationMatch=n.preconditionOpts.ifGenerationMatch}if((s=n===null||n===void 0?void 0:n.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationNotMatch){l.ifGenerationNotMatch=n.preconditionOpts.ifGenerationNotMatch}if((a=n===null||n===void 0?void 0:n.preconditionOpts)===null||a===void 0?void 0:a.ifMetagenerationMatch){l.ifMetagenerationMatch=n.preconditionOpts.ifMetagenerationMatch}if((u=n===null||n===void 0?void 0:n.preconditionOpts)===null||u===void 0?void 0:u.ifMetagenerationNotMatch){l.ifMetagenerationNotMatch=n.preconditionOpts.ifMetagenerationNotMatch}const c=n.userProject;if(typeof c==="string"){l.userProject=c}const d={create:{reqOpts:{qs:l}},delete:{reqOpts:{qs:l}},exists:{reqOpts:{qs:l}},get:{reqOpts:{qs:l}},getMetadata:{reqOpts:{qs:l}},setMetadata:{reqOpts:{qs:l}}};super({parent:e,baseUrl:"/b",id:r,createMethod:e.createBucket.bind(e),methods:d});this.name=r;this.storage=e;this.userProject=n.userProject;this.acl=new a6e.Acl({request:this.request.bind(this),pathPrefix:"/acl"});this.acl.default=new a6e.Acl({request:this.request.bind(this),pathPrefix:"/defaultObjectAcl"});this.crc32cGenerator=n.crc32cGenerator||this.storage.crc32cGenerator;this.iam=new Q6t.Iam(this);this.getFilesStream=u6e.paginator.streamify("getFiles");this.instanceRetryValue=e.retryOptions.autoRetry;this.instancePreconditionOpts=n===null||n===void 0?void 0:n.preconditionOpts}get cloudStorageURI(){const e=new tbt.URL("gs://");e.host=this.name;return e}addLifecycleRule(e,r,n){let i={};if(typeof r==="function"){n=r}else if(r){i=r}i=i||{};const s=Array.isArray(e)?e:[e];for(const a of s){if(a.condition.createdBefore instanceof Date){a.condition.createdBefore=a.condition.createdBefore.toISOString().replace(/T.+$/,"")}if(a.condition.customTimeBefore instanceof Date){a.condition.customTimeBefore=a.condition.customTimeBefore.toISOString().replace(/T.+$/,"")}if(a.condition.noncurrentTimeBefore instanceof Date){a.condition.noncurrentTimeBefore=a.condition.noncurrentTimeBefore.toISOString().replace(/T.+$/,"")}}if(i.append===false){this.setMetadata({lifecycle:{rule:s}},i,n);return}this.getMetadata((a,u)=>{var l,c;if(a){n(a);return}const d=Array.isArray((l=u.lifecycle)===null||l===void 0?void 0:l.rule)?(c=u.lifecycle)===null||c===void 0?void 0:c.rule:[];this.setMetadata({lifecycle:{rule:d.concat(s)}},i,n)})}combine(e,r,n,i){var s;if(!Array.isArray(e)||e.length===0){throw new Error(wl.PROVIDE_SOURCE_FILE)}if(!r){throw new Error(wl.DESTINATION_FILE_NOT_SPECIFIED)}let a={};if(typeof n==="function"){i=n}else if(n){a=n}this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,$g.setMetadata,a);const u=o(d=>{if(d instanceof JM.File){return d}return this.file(d)},"convertToFile");e=e.map(u);const l=u(r);i=i||zT.util.noop;if(!l.metadata.contentType){const d=K6t.contentType(l.name);if(d){l.metadata.contentType=d}}let c=this.storage.retryOptions.maxRetries;if(((s=l===null||l===void 0?void 0:l.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&a.ifGenerationMatch===void 0&&this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryNever){c=0}if(a.ifGenerationMatch===void 0){Object.assign(a,l.instancePreconditionOpts,a)}l.request({method:"POST",uri:"/compose",maxRetries:c,json:{destination:{contentType:l.metadata.contentType},sourceObjects:e.map(d=>{const p={name:d.name};if(d.metadata&&d.metadata.generation){p.generation=parseInt(d.metadata.generation.toString())}return p})},qs:a},(d,p)=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue;if(d){i(d,null,p);return}i(null,l,p)})}createChannel(e,r,n,i){if(typeof e!=="string"){throw new Error(wl.CHANNEL_ID_REQUIRED)}let s={};if(typeof n==="function"){i=n}else if(n){s=n}this.request({method:"POST",uri:"/o/watch",json:Object.assign({id:e,type:"web_hook"},r),qs:s},(a,u)=>{if(a){i(a,null,u);return}const l=u.resourceId;const c=this.storage.channel(e,l);c.metadata=u;i(null,c,u)})}createNotification(e,r,n){let i={};if(typeof r==="function"){n=r}else if(r){i=r}const s=e!==null&&typeof e==="object";if(s&&zT.util.isCustomType(e,"pubsub/topic")){e=e.name}if(typeof e!=="string"){throw new Error(wl.TOPIC_NAME_REQUIRED)}const a=Object.assign({topic:e},i);if(a.topic.indexOf("projects")!==0){a.topic="projects/{{projectId}}/topics/"+a.topic}a.topic="//pubsub.googleapis.com/"+a.topic;if(!a.payloadFormat){a.payloadFormat="JSON_API_V1"}const u={};if(a.userProject){u.userProject=a.userProject;delete a.userProject}this.request({method:"POST",uri:"/notificationConfigs",json:(0,J6t.convertObjKeysToSnakeCase)(a),qs:u,maxRetries:0},(l,c)=>{if(l){n(l,null,c);return}const d=this.notification(c.id);d.metadata=c;n(null,d,c)})}deleteFiles(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}const i=10;const s=1e3;const a=[];const u=o(l=>{return l.delete(n).catch(c=>{if(!n.force){throw c}a.push(c)})},"deleteFile");(async()=>{try{let l=[];const c=(0,i6e.default)(i);const d=this.getFilesStream(n);for await(const p of d){if(l.length>=s){await Promise.all(l);l=[]}l.push(c(()=>u(p)).catch(f=>{d.destroy();throw f}))}await Promise.all(l);r(a.length>0?a:null)}catch(l){r(l);return}})()}deleteLabels(e,r,n){let i=new Array;let s={};if(typeof e==="function"){n=e}else if(typeof e==="string"){i=[e]}else if(Array.isArray(e)){i=e}else if(e){s=e}if(typeof r==="function"){n=r}else if(r){s=r}const a=o(u=>{const l=u.reduce((c,d)=>{c[d]=null;return c},{});if((s===null||s===void 0?void 0:s.ifMetagenerationMatch)!==void 0){this.setLabels(l,s,n)}else{this.setLabels(l,n)}},"deleteLabels");if(i.length===0){this.getLabels((u,l)=>{if(u){n(u);return}a(Object.keys(l))})}else{a(i)}}disableRequesterPays(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}this.setMetadata({billing:{requesterPays:false}},n,r)}enableLogging(e,r){if(!e||typeof e==="function"||typeof e.prefix==="undefined"){throw new Error(wl.CONFIGURATION_OBJECT_PREFIX_REQUIRED)}let n=this.id;if(e.bucket&&e.bucket instanceof t){n=e.bucket.id}else if(e.bucket&&typeof e.bucket==="string"){n=e.bucket}const i={};if(e===null||e===void 0?void 0:e.ifMetagenerationMatch){i.ifMetagenerationMatch=e.ifMetagenerationMatch}if(e===null||e===void 0?void 0:e.ifMetagenerationNotMatch){i.ifMetagenerationNotMatch=e.ifMetagenerationNotMatch}(async()=>{try{const[s]=await this.iam.getPolicy();s.bindings.push({members:["group:cloud-storage-analytics@google.com"],role:"roles/storage.objectCreator"});await this.iam.setPolicy(s);this.setMetadata({logging:{logBucket:n,logObjectPrefix:e.prefix}},i,r)}catch(s){r(s);return}})()}enableRequesterPays(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}this.setMetadata({billing:{requesterPays:true}},n,r)}file(e,r){if(!e){throw Error(wl.SPECIFY_FILE_NAME)}return new JM.File(this,e,r)}getFiles(e,r){let n=typeof e==="object"?e:{};if(!r){r=e}n=Object.assign({},n);this.request({uri:"/o",qs:n},(i,s)=>{if(i){r(i,null,null,s);return}const a=s.items?s.items:[];const u=a.map(c=>{const d={};if(n.versions){d.generation=c.generation}if(c.kmsKeyName){d.kmsKeyName=c.kmsKeyName}const p=this.file(c.name,d);p.metadata=c;return p});let l=null;if(s.nextPageToken){l=Object.assign({},n,{pageToken:s.nextPageToken})}r(null,u,l,s)})}getLabels(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}this.getMetadata(n,(i,s)=>{if(i){r(i,null);return}r(null,(s===null||s===void 0?void 0:s.labels)||{})})}getNotifications(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}this.request({uri:"/notificationConfigs",qs:n},(i,s)=>{if(i){r(i,null,s);return}const a=s.items?s.items:[];const u=a.map(l=>{const c=this.notification(l.id);c.metadata=l;return c});r(null,u,s)})}getSignedUrl(e,r){const n=QM[e.action];const i={method:n,expires:e.expires,version:e.version,cname:e.cname,extensionHeaders:e.extensionHeaders||{},queryParams:e.queryParams||{}};if(!this.signer){this.signer=new Z6t.URLSigner(this.storage.authClient,this)}this.signer.getSignedUrl(i).then(s=>r(null,s),r)}lock(e,r){const n=typeof e;if(n!=="number"&&n!=="string"){throw new Error(wl.METAGENERATION_NOT_PROVIDED)}this.request({method:"POST",uri:"/lockRetentionPolicy",qs:{ifMetagenerationMatch:e}},r)}makePrivate(e,r){var n,i,s,a;const u=typeof e==="object"?e:{};r=typeof e==="function"?e:r;u.private=true;const l={predefinedAcl:"projectPrivate"};if(u.userProject){l.userProject=u.userProject}if((n=u.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch){l.ifGenerationMatch=u.preconditionOpts.ifGenerationMatch}if((i=u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationNotMatch){l.ifGenerationNotMatch=u.preconditionOpts.ifGenerationNotMatch}if((s=u.preconditionOpts)===null||s===void 0?void 0:s.ifMetagenerationMatch){l.ifMetagenerationMatch=u.preconditionOpts.ifMetagenerationMatch}if((a=u.preconditionOpts)===null||a===void 0?void 0:a.ifMetagenerationNotMatch){l.ifMetagenerationNotMatch=u.preconditionOpts.ifMetagenerationNotMatch}const c={...u.metadata,acl:null};this.setMetadata(c,l,d=>{if(d){r(d)}const p=o(()=>{if(u.includeFiles){return(0,s6e.promisify)(this.makeAllFilesPublicPrivate_).call(this,u)}return Promise.resolve([])},"internalCall");p().then(f=>r(null,f)).catch(r)})}makePublic(e,r){const n=typeof e==="object"?e:{};r=typeof e==="function"?e:r;const i={public:true,...n};this.acl.add({entity:"allUsers",role:"READER"}).then(()=>{return this.acl.default.add({entity:"allUsers",role:"READER"})}).then(()=>{if(i.includeFiles){return(0,s6e.promisify)(this.makeAllFilesPublicPrivate_).call(this,i)}return[]}).then(s=>r(null,s),r)}notification(e){if(!e){throw new Error(wl.SUPPLY_NOTIFICATION_ID)}return new X6t.Notification(this,e)}removeRetentionPeriod(e,r){const n=typeof e==="object"?e:{};r=typeof e==="function"?e:r;this.setMetadata({retentionPolicy:null},n,r)}request(e,r){if(this.userProject&&(!e.qs||!e.qs.userProject)){e.qs={...e.qs,userProject:this.userProject}}return super.request(e,r)}setLabels(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||zT.util.noop;this.setMetadata({labels:e},i,n)}setMetadata(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,$g.setMetadata,i);super.setMetadata(e,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setRetentionPeriod(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.setMetadata({retentionPolicy:{retentionPeriod:e.toString()}},i,n)}setCorsConfiguration(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.setMetadata({cors:e},i,n)}setStorageClass(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;e=e.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(s,a,u)=>{return a+"_"+u}).toUpperCase();this.setMetadata({storageClass:e},i,n)}setUserProject(e){this.userProject=e;const r=["create","delete","exists","get","getMetadata","setMetadata"];r.forEach(n=>{const i=this.methods[n];if(typeof i==="object"){if(typeof i.reqOpts==="object"){Object.assign(i.reqOpts.qs,{userProject:e})}else{i.reqOpts={qs:{userProject:e}}}}})}upload(e,r,n){var i,s;const a=o(d=>{const p=(0,W6t.default)(async f=>{await new Promise((h,m)=>{var g,y;if(d===0&&((y=(g=c===null||c===void 0?void 0:c.storage)===null||g===void 0?void 0:g.retryOptions)===null||y===void 0?void 0:y.autoRetry)){c.storage.retryOptions.autoRetry=false}const v=c.createWriteStream(u);if(u.onUploadProgress){v.on("progress",u.onUploadProgress)}G6t.createReadStream(e).on("error",f).pipe(v).on("error",w=>{if(this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(w)){return m(w)}else{return f(w)}}).on("finish",()=>{return h()})})},{retries:d,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});if(!n){return p}else{return p.then(()=>{if(n){return n(null,c,c.metadata)}}).catch(n)}},"upload");if(global["GCLOUD_SANDBOX_ENV"]){return}let u=typeof r==="object"?r:{};n=typeof r==="function"?r:n;u=Object.assign({metadata:{}},u);let l=this.storage.retryOptions.maxRetries;if(((i=u===null||u===void 0?void 0:u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&((s=this.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryNever){l=0}let c;if(u.destination instanceof JM.File){c=u.destination}else if(u.destination!==null&&typeof u.destination==="string"){c=this.file(u.destination,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}else{const d=Y6t.basename(e);c=this.file(d,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}a(l)}makeAllFilesPublicPrivate_(e,r){const n=10;const i=[];const s=[];const a=typeof e==="object"?e:{};r=typeof e==="function"?e:r;const u=o(async l=>{try{await(a.public?l.makePublic():l.makePrivate(a));s.push(l)}catch(c){if(!a.force){throw c}i.push(c)}},"processFile");this.getFiles(a).then(([l])=>{const c=(0,i6e.default)(n);const d=l.map(p=>{return c(()=>u(p))});return Promise.all(d)}).then(()=>r(i.length>0?i:null,s),l=>r(l,s))}getId(){return this.id}disableAutoRetryConditionallyIdempotent_(e,r,n){var i,s;if(typeof e==="object"&&((s=(i=e===null||e===void 0?void 0:e.reqOpts)===null||i===void 0?void 0:i.qs)===null||s===void 0?void 0:s.ifMetagenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifMetagenerationMatch)===void 0&&(r===$g.setMetadata||r===$g.delete)&&this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryConditional){this.storage.retryOptions.autoRetry=false}else if(this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}}};Ni.Bucket=HE;u6e.paginator.extend(HE,"getFiles");(0,z6t.promisifyAll)(HE,{exclude:["cloudStorageURI","request","file","notification"]})});var ZM=_(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:true});KT.Channel=void 0;var l6e=xp();var rbt=_l();var GT=class extends l6e.ServiceObject{static{o(this,"Channel")}constructor(e,r,n){const i={parent:e,baseUrl:"/channels",id:"",methods:{}};super(i);this.metadata.id=r;this.metadata.resourceId=n}stop(e){e=e||l6e.util.noop;this.request({method:"POST",uri:"/stop",json:this.metadata},(r,n)=>{e(r,n)})}};KT.Channel=GT;(0,rbt.promisifyAll)(GT)});var eB=_(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:true});WT.HmacKey=void 0;var nbt=xp();var ibt=Ig();var sbt=_l();var YT=class extends nbt.ServiceObject{static{o(this,"HmacKey")}constructor(e,r,n){const i={delete:true,get:true,getMetadata:true,setMetadata:{reqOpts:{method:"PUT"}}};const s=n&&n.projectId||e.projectId;super({parent:e,id:r,baseUrl:`/projects/${s}/hmacKeys`,methods:i});this.storage=e;this.instanceRetryValue=e.retryOptions.autoRetry}setMetadata(e,r,n){if(this.storage.retryOptions.idempotencyStrategy!==ibt.IdempotencyStrategy.RetryAlways){this.storage.retryOptions.autoRetry=false}const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;super.setMetadata(e,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}};WT.HmacKey=YT;(0,sbt.promisifyAll)(YT)});var Ig=_(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:true});Yr.Storage=Yr.RETRYABLE_ERR_FN_DEFAULT=Yr.MAX_RETRY_DELAY_DEFAULT=Yr.TOTAL_TIMEOUT_DEFAULT=Yr.RETRY_DELAY_MULTIPLIER_DEFAULT=Yr.MAX_RETRY_DEFAULT=Yr.AUTO_RETRY_DEFAULT=Yr.PROTOCOL_REGEX=Yr.StorageExceptionMessages=Yr.ExceptionMessages=Yr.IdempotencyStrategy=void 0;var abt=xp();var tB=xM();var obt=_l();var c6e=require("stream");var p6e=FT();var f6e=ZM();var ubt=FE();var JT=yl();var lbt=bg();var h6e=eB();var cbt=UE();var rB;(function(t){t[t["RetryAlways"]=0]="RetryAlways";t[t["RetryConditional"]=1]="RetryConditional";t[t["RetryNever"]=2]="RetryNever"})(rB||(Yr.IdempotencyStrategy=rB={}));var d6e;(function(t){t["EXPIRATION_DATE_INVALID"]="The expiration date provided was invalid.";t["EXPIRATION_DATE_PAST"]="An expiration date cannot be in the past."})(d6e||(Yr.ExceptionMessages=d6e={}));var Lg;(function(t){t["BUCKET_NAME_REQUIRED"]="A bucket name is needed to use Cloud Storage.";t["BUCKET_NAME_REQUIRED_CREATE"]="A name is required to create a bucket.";t["HMAC_SERVICE_ACCOUNT"]="The first argument must be a service account email to create an HMAC key.";t["HMAC_ACCESS_ID"]="An access ID is needed to create an HmacKey object."})(Lg||(Yr.StorageExceptionMessages=Lg={}));Yr.PROTOCOL_REGEX=/^(\w*):\/\//;Yr.AUTO_RETRY_DEFAULT=true;Yr.MAX_RETRY_DEFAULT=3;Yr.RETRY_DELAY_MULTIPLIER_DEFAULT=2;Yr.TOTAL_TIMEOUT_DEFAULT=600;Yr.MAX_RETRY_DELAY_DEFAULT=64;var dbt=rB.RetryConditional;var pbt=o(function(t){var e;const r=o(n=>{return n.includes("eai_again")||n==="econnreset"||n==="unexpected connection closure"||n==="epipe"||n==="socket connection timeout"},"isConnectionProblem");if(t){if([408,429,500,502,503,504].indexOf(t.code)!==-1){return true}if(typeof t.code==="string"){if(["408","429","500","502","503","504"].indexOf(t.code)!==-1){return true}const n=t.code.toLowerCase();if(r(n)){return true}}if(t.errors){for(const n of t.errors){const i=(e=n===null||n===void 0?void 0:n.reason)===null||e===void 0?void 0:e.toString().toLowerCase();if(i&&r(i)){return true}}}}return false},"RETRYABLE_ERR_FN_DEFAULT");Yr.RETRYABLE_ERR_FN_DEFAULT=pbt;var Sl=class t extends abt.Service{static{o(this,"Storage")}getBucketsStream(){return new c6e.Readable}getHmacKeysStream(){return new c6e.Readable}constructor(e={}){var r,n,i,s,a,u,l,c,d,p,f,h,m,g;let y="https://storage.googleapis.com";let v=false;const w=process.env.STORAGE_EMULATOR_HOST;if(typeof w==="string"){y=t.sanitizeEndpoint(w);v=true}if(e.apiEndpoint){y=t.sanitizeEndpoint(e.apiEndpoint);v=true}e=Object.assign({},e,{apiEndpoint:y});const E=w||`${e.apiEndpoint}/storage/v1`;const b={apiEndpoint:e.apiEndpoint,retryOptions:{autoRetry:((r=e.retryOptions)===null||r===void 0?void 0:r.autoRetry)!==void 0?(n=e.retryOptions)===null||n===void 0?void 0:n.autoRetry:Yr.AUTO_RETRY_DEFAULT,maxRetries:((i=e.retryOptions)===null||i===void 0?void 0:i.maxRetries)?(s=e.retryOptions)===null||s===void 0?void 0:s.maxRetries:Yr.MAX_RETRY_DEFAULT,retryDelayMultiplier:((a=e.retryOptions)===null||a===void 0?void 0:a.retryDelayMultiplier)?(u=e.retryOptions)===null||u===void 0?void 0:u.retryDelayMultiplier:Yr.RETRY_DELAY_MULTIPLIER_DEFAULT,totalTimeout:((l=e.retryOptions)===null||l===void 0?void 0:l.totalTimeout)?(c=e.retryOptions)===null||c===void 0?void 0:c.totalTimeout:Yr.TOTAL_TIMEOUT_DEFAULT,maxRetryDelay:((d=e.retryOptions)===null||d===void 0?void 0:d.maxRetryDelay)?(p=e.retryOptions)===null||p===void 0?void 0:p.maxRetryDelay:Yr.MAX_RETRY_DELAY_DEFAULT,retryableErrorFn:((f=e.retryOptions)===null||f===void 0?void 0:f.retryableErrorFn)?(h=e.retryOptions)===null||h===void 0?void 0:h.retryableErrorFn:Yr.RETRYABLE_ERR_FN_DEFAULT,idempotencyStrategy:((m=e.retryOptions)===null||m===void 0?void 0:m.idempotencyStrategy)!==void 0?(g=e.retryOptions)===null||g===void 0?void 0:g.idempotencyStrategy:dbt},baseUrl:E,customEndpoint:v,useAuthWithCustomEndpoint:e===null||e===void 0?void 0:e.useAuthWithCustomEndpoint,projectIdRequired:false,scopes:["https://www.googleapis.com/auth/iam","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/devstorage.full_control"],packageJson:(0,lbt.getPackageJSON)()};super(b,e);this.acl=t.acl;this.crc32cGenerator=e.crc32cGenerator||cbt.CRC32C_DEFAULT_VALIDATOR_GENERATOR;this.retryOptions=b.retryOptions;this.getBucketsStream=tB.paginator.streamify("getBuckets");this.getHmacKeysStream=tB.paginator.streamify("getHmacKeys")}static sanitizeEndpoint(e){if(!Yr.PROTOCOL_REGEX.test(e)){e=`https://${e}`}return e.replace(/\/+$/,"")}bucket(e,r){if(!e){throw new Error(Lg.BUCKET_NAME_REQUIRED)}return new p6e.Bucket(this,e,r)}channel(e,r){return new f6e.Channel(this,e,r)}createBucket(e,r,n){if(!e){throw new Error(Lg.BUCKET_NAME_REQUIRED_CREATE)}let i;if(!n){n=r;i={}}else{i=r}const s={...i,name:e};const a={archive:"ARCHIVE",coldline:"COLDLINE",dra:"DURABLE_REDUCED_AVAILABILITY",multiRegional:"MULTI_REGIONAL",nearline:"NEARLINE",regional:"REGIONAL",standard:"STANDARD"};const u=Object.keys(a);for(const c of u){if(s[c]){if(i.storageClass&&i.storageClass!==c){throw new Error(`Both \`${c}\` and \`storageClass\` were provided.`)}s.storageClass=a[c];delete s[c]}}if(s.requesterPays){s.billing={requesterPays:s.requesterPays};delete s.requesterPays}const l={project:this.projectId};if(s.userProject){l.userProject=s.userProject;delete s.userProject}this.request({method:"POST",uri:"/b",qs:l,json:s},(c,d)=>{if(c){n(c,null,d);return}const p=this.bucket(e);p.metadata=d;n(null,p,d)})}createHmacKey(e,r,n){if(typeof e!=="string"){throw new Error(Lg.HMAC_SERVICE_ACCOUNT)}const{options:i,callback:s}=(0,JT.normalize)(r,n);const a=Object.assign({},i,{serviceAccountEmail:e});const u=a.projectId||this.projectId;delete a.projectId;this.request({method:"POST",uri:`/projects/${u}/hmacKeys`,qs:a,maxRetries:0},(l,c)=>{if(l){s(l,null,null,c);return}const d=c.metadata;const p=this.hmacKey(d.accessId,{projectId:d.projectId});p.metadata=c.metadata;s(null,p,c.secret,c)})}getBuckets(e,r){const{options:n,callback:i}=(0,JT.normalize)(e,r);n.project=n.project||this.projectId;this.request({uri:"/b",qs:n},(s,a)=>{if(s){i(s,null,null,a);return}const u=a.items?a.items:[];const l=u.map(d=>{const p=this.bucket(d.id);p.metadata=d;return p});const c=a.nextPageToken?Object.assign({},n,{pageToken:a.nextPageToken}):null;i(null,l,c,a)})}getHmacKeys(e,r){const{options:n,callback:i}=(0,JT.normalize)(e,r);const s=Object.assign({},n);const a=s.projectId||this.projectId;delete s.projectId;this.request({uri:`/projects/${a}/hmacKeys`,qs:s},(u,l)=>{if(u){i(u,null,null,l);return}const c=l.items?l.items:[];const d=c.map(f=>{const h=this.hmacKey(f.accessId,{projectId:f.projectId});h.metadata=f;return h});const p=l.nextPageToken?Object.assign({},n,{pageToken:l.nextPageToken}):null;i(null,d,p,l)})}getServiceAccount(e,r){const{options:n,callback:i}=(0,JT.normalize)(e,r);this.request({uri:`/projects/${this.projectId}/serviceAccount`,qs:n},(s,a)=>{if(s){i(s,null,a);return}const u={};for(const l in a){if(a.hasOwnProperty(l)){const c=l.replace(/_(\w)/g,(d,p)=>p.toUpperCase());u[c]=a[l]}}i(null,u,a)})}hmacKey(e,r){if(!e){throw new Error(Lg.HMAC_ACCESS_ID)}return new h6e.HmacKey(this,e,r)}};Yr.Storage=Sl;Sl.Bucket=p6e.Bucket;Sl.Channel=f6e.Channel;Sl.File=ubt.File;Sl.HmacKey=h6e.HmacKey;Sl.acl={OWNER_ROLE:"OWNER",READER_ROLE:"READER",WRITER_ROLE:"WRITER"};tB.paginator.extend(Sl,["getBuckets","getHmacKeys"]);(0,obt.promisifyAll)(Sl,{exclude:["bucket","channel","hmacKey"]})});var QT=_(Vc=>{"use strict";var m6e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";var fbt=m6e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";var g6e="["+m6e+"]["+fbt+"]*";var hbt=new RegExp("^"+g6e+"$");var mbt=o(function(t,e){const r=[];let n=e.exec(t);while(n){const i=[];i.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let a=0;a<s;a++){i.push(n[a])}r.push(i);n=e.exec(t)}return r},"getAllMatches");var gbt=o(function(t){const e=hbt.exec(t);return!(e===null||typeof e==="undefined")},"isName");Vc.isExist=function(t){return typeof t!=="undefined"};Vc.isEmptyObject=function(t){return Object.keys(t).length===0};Vc.merge=function(t,e,r){if(e){const n=Object.keys(e);const i=n.length;for(let s=0;s<i;s++){if(r==="strict"){t[n[s]]=[e[n[s]]]}else{t[n[s]]=e[n[s]]}}}};Vc.getValue=function(t){if(Vc.isExist(t)){return t}else{return""}};Vc.isName=gbt;Vc.getAllMatches=mbt;Vc.nameRegexp=g6e});var iB=_(b6e=>{"use strict";var nB=QT();var ybt={allowBooleanAttributes:false,unpairedTags:[]};b6e.validate=function(t,e){e=Object.assign({},ybt,e);const r=[];let n=false;let i=false;if(t[0]==="\uFEFF"){t=t.substr(1)}for(let s=0;s<t.length;s++){if(t[s]==="<"&&t[s+1]==="?"){s+=2;s=v6e(t,s);if(s.err)return s}else if(t[s]==="<"){let a=s;s++;if(t[s]==="!"){s=_6e(t,s);continue}else{let u=false;if(t[s]==="/"){u=true;s++}let l="";for(;s<t.length&&t[s]!==">"&&t[s]!==" "&&t[s]!==" "&&t[s]!=="\n"&&t[s]!=="\r";s++){l+=t[s]}l=l.trim();if(l[l.length-1]==="/"){l=l.substring(0,l.length-1);s--}if(!Abt(l)){let p;if(l.trim().length===0){p="Invalid space after '<'."}else{p="Tag '"+l+"' is an invalid name."}return ci("InvalidTag",p,ya(t,s))}const c=Ebt(t,s);if(c===false){return ci("InvalidAttr","Attributes for '"+l+"' have open quote.",ya(t,s))}let d=c.value;s=c.index;if(d[d.length-1]==="/"){const p=s-d.length;d=d.substring(0,d.length-1);const f=E6e(d,e);if(f===true){n=true}else{return ci(f.err.code,f.err.msg,ya(t,p+f.err.line))}}else if(u){if(!c.tagClosed){return ci("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",ya(t,s))}else if(d.trim().length>0){return ci("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",ya(t,a))}else{const p=r.pop();if(l!==p.tagName){let f=ya(t,p.tagStartPos);return ci("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+l+"'.",ya(t,a))}if(r.length==0){i=true}}}else{const p=E6e(d,e);if(p!==true){return ci(p.err.code,p.err.msg,ya(t,s-d.length+p.err.line))}if(i===true){return ci("InvalidXml","Multiple possible root nodes found.",ya(t,s))}else if(e.unpairedTags.indexOf(l)!==-1){}else{r.push({tagName:l,tagStartPos:a})}n=true}for(s++;s<t.length;s++){if(t[s]==="<"){if(t[s+1]==="!"){s++;s=_6e(t,s);continue}else if(t[s+1]==="?"){s=v6e(t,++s);if(s.err)return s}else{break}}else if(t[s]==="&"){const p=Sbt(t,s);if(p==-1)return ci("InvalidChar","char '&' is not expected.",ya(t,s));s=p}else{if(i===true&&!y6e(t[s])){return ci("InvalidXml","Extra text at the end",ya(t,s))}}}if(t[s]==="<"){s--}}}else{if(y6e(t[s])){continue}return ci("InvalidChar","char '"+t[s]+"' is not expected.",ya(t,s))}}if(!n){return ci("InvalidXml","Start tag expected.",1)}else if(r.length==1){return ci("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",ya(t,r[0].tagStartPos))}else if(r.length>0){return ci("InvalidXml","Invalid '"+JSON.stringify(r.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}return true};function y6e(t){return t===" "||t===" "||t==="\n"||t==="\r"}o(y6e,"isWhiteSpace");function v6e(t,e){const r=e;for(;e<t.length;e++){if(t[e]=="?"||t[e]==" "){const n=t.substr(r,e-r);if(e>5&&n==="xml"){return ci("InvalidXml","XML declaration allowed only at the start of the document.",ya(t,e))}else if(t[e]=="?"&&t[e+1]==">"){e++;break}else{continue}}}return e}o(v6e,"readPI");function _6e(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++){if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let r=1;for(e+=8;e<t.length;e++){if(t[e]==="<"){r++}else if(t[e]===">"){r--;if(r===0){break}}}}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++){if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}}return e}o(_6e,"readCommentAndCDATA");var vbt='"';var _bt="'";function Ebt(t,e){let r="";let n="";let i=false;for(;e<t.length;e++){if(t[e]===vbt||t[e]===_bt){if(n===""){n=t[e]}else if(n!==t[e]){}else{n=""}}else if(t[e]===">"){if(n===""){i=true;break}}r+=t[e]}if(n!==""){return false}return{value:r,index:e,tagClosed:i}}o(Ebt,"readAttributeStr");var bbt=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function E6e(t,e){const r=nB.getAllMatches(t,bbt);const n={};for(let i=0;i<r.length;i++){if(r[i][1].length===0){return ci("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",zE(r[i]))}else if(r[i][3]!==void 0&&r[i][4]===void 0){return ci("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",zE(r[i]))}else if(r[i][3]===void 0&&!e.allowBooleanAttributes){return ci("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",zE(r[i]))}const s=r[i][2];if(!Tbt(s)){return ci("InvalidAttr","Attribute '"+s+"' is an invalid name.",zE(r[i]))}if(!n.hasOwnProperty(s)){n[s]=1}else{return ci("InvalidAttr","Attribute '"+s+"' is repeated.",zE(r[i]))}}return true}o(E6e,"validateAttributeString");function wbt(t,e){let r=/\d/;if(t[e]==="x"){e++;r=/[\da-fA-F]/}for(;e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(r))break}return-1}o(wbt,"validateNumberAmpersand");function Sbt(t,e){e++;if(t[e]===";")return-1;if(t[e]==="#"){e++;return wbt(t,e)}let r=0;for(;e<t.length;e++,r++){if(t[e].match(/\w/)&&r<20)continue;if(t[e]===";")break;return-1}return e}o(Sbt,"validateAmpersand");function ci(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}o(ci,"getErrorObject");function Tbt(t){return nB.isName(t)}o(Tbt,"validateAttrName");function Abt(t){return nB.isName(t)}o(Abt,"validateTagName");function ya(t,e){const r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}o(ya,"getLineNumberForPosition");function zE(t){return t.startIndex+t[1].length}o(zE,"getPositionFromMatch")});var S6e=_(sB=>{var w6e={preserveOrder:false,attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,removeNSPrefix:false,allowBooleanAttributes:false,parseTagValue:true,parseAttributeValue:false,trimValues:true,cdataPropName:false,numberParseOptions:{hex:true,leadingZeros:true,eNotation:true},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:false,isArray:()=>false,commentPropName:false,unpairedTags:[],processEntities:true,htmlEntities:false,ignoreDeclaration:false,ignorePiTags:false,transformTagName:false,transformAttributeName:false,updateTag:function(t,e,r){return t}};var xbt=o(function(t){return Object.assign({},w6e,t)},"buildOptions");sB.buildOptions=xbt;sB.defaultOptions=w6e});var A6e=_((mur,T6e)=>{"use strict";var aB=class{static{o(this,"XmlNode")}constructor(e){this.tagname=e;this.child=[];this[":@"]={}}add(e,r){if(e==="__proto__")e="#__proto__";this.child.push({[e]:r})}addChild(e){if(e.tagname==="__proto__")e.tagname="#__proto__";if(e[":@"]&&Object.keys(e[":@"]).length>0){this.child.push({[e.tagname]:e.child,[":@"]:e[":@"]})}else{this.child.push({[e.tagname]:e.child})}}};T6e.exports=aB});var C6e=_((yur,x6e)=>{var Cbt=QT();function Rbt(t,e){const r={};if(t[e+3]==="O"&&t[e+4]==="C"&&t[e+5]==="T"&&t[e+6]==="Y"&&t[e+7]==="P"&&t[e+8]==="E"){e=e+9;let n=1;let i=false,s=false;let a="";for(;e<t.length;e++){if(t[e]==="<"&&!s){if(i&&Ibt(t,e)){e+=7;[entityName,val,e]=Obt(t,e+1);if(val.indexOf("&")===-1)r[$bt(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(i&&Pbt(t,e))e+=8;else if(i&&Dbt(t,e))e+=8;else if(i&&kbt(t,e))e+=9;else if(Nbt)s=true;else throw new Error("Invalid DOCTYPE");n++;a=""}else if(t[e]===">"){if(s){if(t[e-1]==="-"&&t[e-2]==="-"){s=false;n--}}else{n--}if(n===0){break}}else if(t[e]==="["){i=true}else{a+=t[e]}}if(n!==0){throw new Error(`Unclosed DOCTYPE`)}}else{throw new Error(`Invalid Tag instead of DOCTYPE`)}return{entities:r,i:e}}o(Rbt,"readDocType");function Obt(t,e){let r="";for(;e<t.length&&(t[e]!=="'"&&t[e]!=='"');e++){r+=t[e]}r=r.trim();if(r.indexOf(" ")!==-1)throw new Error("External entites are not supported");const n=t[e++];let i="";for(;e<t.length&&t[e]!==n;e++){i+=t[e]}return[r,i,e]}o(Obt,"readEntityExp");function Nbt(t,e){if(t[e+1]==="!"&&t[e+2]==="-"&&t[e+3]==="-")return true;return false}o(Nbt,"isComment");function Ibt(t,e){if(t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="N"&&t[e+4]==="T"&&t[e+5]==="I"&&t[e+6]==="T"&&t[e+7]==="Y")return true;return false}o(Ibt,"isEntity");function Pbt(t,e){if(t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="L"&&t[e+4]==="E"&&t[e+5]==="M"&&t[e+6]==="E"&&t[e+7]==="N"&&t[e+8]==="T")return true;return false}o(Pbt,"isElement");function Dbt(t,e){if(t[e+1]==="!"&&t[e+2]==="A"&&t[e+3]==="T"&&t[e+4]==="T"&&t[e+5]==="L"&&t[e+6]==="I"&&t[e+7]==="S"&&t[e+8]==="T")return true;return false}o(Dbt,"isAttlist");function kbt(t,e){if(t[e+1]==="!"&&t[e+2]==="N"&&t[e+3]==="O"&&t[e+4]==="T"&&t[e+5]==="A"&&t[e+6]==="T"&&t[e+7]==="I"&&t[e+8]==="O"&&t[e+9]==="N")return true;return false}o(kbt,"isNotation");function $bt(t){if(Cbt.isName(t))return t;else throw new Error(`Invalid entity name ${t}`)}o($bt,"validateEntityName");x6e.exports=Rbt});var O6e=_((_ur,R6e)=>{var Lbt=/^[-+]?0x[a-fA-F0-9]+$/;var qbt=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;if(!Number.parseInt&&window.parseInt){Number.parseInt=window.parseInt}if(!Number.parseFloat&&window.parseFloat){Number.parseFloat=window.parseFloat}var jbt={hex:true,leadingZeros:true,decimalPoint:".",eNotation:true};function Ubt(t,e={}){e=Object.assign({},jbt,e);if(!t||typeof t!=="string")return t;let r=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(r))return t;else if(e.hex&&Lbt.test(r)){return Number.parseInt(r,16)}else{const n=qbt.exec(r);if(n){const i=n[1];const s=n[2];let a=Fbt(n[3]);const u=n[4]||n[6];if(!e.leadingZeros&&s.length>0&&i&&r[2]!==".")return t;else if(!e.leadingZeros&&s.length>0&&!i&&r[1]!==".")return t;else{const l=Number(r);const c=""+l;if(c.search(/[eE]/)!==-1){if(e.eNotation)return l;else return t}else if(u){if(e.eNotation)return l;else return t}else if(r.indexOf(".")!==-1){if(c==="0"&&a==="")return l;else if(c===a)return l;else if(i&&c==="-"+a)return l;else return t}if(s){if(a===c)return l;else if(i+a===c)return l;else return t}if(r===c)return l;else if(r===i+c)return l;return t}}else{return t}}}o(Ubt,"toNumber");function Fbt(t){if(t&&t.indexOf(".")!==-1){t=t.replace(/0+$/,"");if(t===".")t="0";else if(t[0]===".")t="0"+t;else if(t[t.length-1]===".")t=t.substr(0,t.length-1);return t}return t}o(Fbt,"trimZeros");R6e.exports=Ubt});var I6e=_((wur,N6e)=>{"use strict";var cB=QT();var GE=A6e();var Mbt=C6e();var Bbt=O6e();var bur="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,cB.nameRegexp);var oB=class{static{o(this,"OrderedObjParser")}constructor(e){this.options=e;this.currentNode=null;this.tagsNodeStack=[];this.docTypeEntities={};this.lastEntities={"apos":{regex:/&(apos|#39|#x27);/g,val:"'"},"gt":{regex:/&(gt|#62|#x3E);/g,val:">"},"lt":{regex:/&(lt|#60|#x3C);/g,val:"<"},"quot":{regex:/&(quot|#34|#x22);/g,val:'"'}};this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"};this.htmlEntities={"space":{regex:/&(nbsp|#160);/g,val:" "},"cent":{regex:/&(cent|#162);/g,val:"\xA2"},"pound":{regex:/&(pound|#163);/g,val:"\xA3"},"yen":{regex:/&(yen|#165);/g,val:"\xA5"},"euro":{regex:/&(euro|#8364);/g,val:"\u20AC"},"copyright":{regex:/&(copy|#169);/g,val:"\xA9"},"reg":{regex:/&(reg|#174);/g,val:"\xAE"},"inr":{regex:/&(inr|#8377);/g,val:"\u20B9"}};this.addExternalEntities=Vbt;this.parseXml=Ybt;this.parseTextData=Hbt;this.resolveNameSpace=zbt;this.buildAttributesMap=Kbt;this.isItStopNode=Xbt;this.replaceEntitiesValue=Jbt;this.readStopNodeData=e3t;this.saveTextToParentTag=Qbt;this.addChild=Wbt}};function Vbt(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const n=e[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}o(Vbt,"addExternalEntities");function Hbt(t,e,r,n,i,s,a){if(t!==void 0){if(this.options.trimValues&&!n){t=t.trim()}if(t.length>0){if(!a)t=this.replaceEntitiesValue(t);const u=this.options.tagValueProcessor(e,t,r,i,s);if(u===null||u===void 0){return t}else if(typeof u!==typeof t||u!==t){return u}else if(this.options.trimValues){return lB(t,this.options.parseTagValue,this.options.numberParseOptions)}else{const l=t.trim();if(l===t){return lB(t,this.options.parseTagValue,this.options.numberParseOptions)}else{return t}}}}}o(Hbt,"parseTextData");function zbt(t){if(this.options.removeNSPrefix){const e=t.split(":");const r=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns"){return""}if(e.length===2){t=r+e[1]}}return t}o(zbt,"resolveNameSpace");var Gbt=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Kbt(t,e,r){if(!this.options.ignoreAttributes&&typeof t==="string"){const n=cB.getAllMatches(t,Gbt);const i=n.length;const s={};for(let a=0;a<i;a++){const u=this.resolveNameSpace(n[a][1]);let l=n[a][4];let c=this.options.attributeNamePrefix+u;if(u.length){if(this.options.transformAttributeName){c=this.options.transformAttributeName(c)}if(c==="__proto__")c="#__proto__";if(l!==void 0){if(this.options.trimValues){l=l.trim()}l=this.replaceEntitiesValue(l);const d=this.options.attributeValueProcessor(u,l,e);if(d===null||d===void 0){s[c]=l}else if(typeof d!==typeof l||d!==l){s[c]=d}else{s[c]=lB(l,this.options.parseAttributeValue,this.options.numberParseOptions)}}else if(this.options.allowBooleanAttributes){s[c]=true}}}if(!Object.keys(s).length){return}if(this.options.attributesGroupName){const a={};a[this.options.attributesGroupName]=s;return a}return s}}o(Kbt,"buildAttributesMap");var Ybt=o(function(t){t=t.replace(/\r\n?/g,"\n");const e=new GE("!xml");let r=e;let n="";let i="";for(let s=0;s<t.length;s++){const a=t[s];if(a==="<"){if(t[s+1]==="/"){const u=am(t,">",s,"Closing Tag is not closed.");let l=t.substring(s+2,u).trim();if(this.options.removeNSPrefix){const p=l.indexOf(":");if(p!==-1){l=l.substr(p+1)}}if(this.options.transformTagName){l=this.options.transformTagName(l)}if(r){n=this.saveTextToParentTag(n,r,i)}const c=i.substring(i.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1){throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`)}let d=0;if(c&&this.options.unpairedTags.indexOf(c)!==-1){d=i.lastIndexOf(".",i.lastIndexOf(".")-1);this.tagsNodeStack.pop()}else{d=i.lastIndexOf(".")}i=i.substring(0,d);r=this.tagsNodeStack.pop();n="";s=u}else if(t[s+1]==="?"){let u=uB(t,s,false,"?>");if(!u)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,i);if(this.options.ignoreDeclaration&&u.tagName==="?xml"||this.options.ignorePiTags){}else{const l=new GE(u.tagName);l.add(this.options.textNodeName,"");if(u.tagName!==u.tagExp&&u.attrExpPresent){l[":@"]=this.buildAttributesMap(u.tagExp,i,u.tagName)}this.addChild(r,l,i)}s=u.closeIndex+1}else if(t.substr(s+1,3)==="!--"){const u=am(t,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const l=t.substring(s+4,u-2);n=this.saveTextToParentTag(n,r,i);r.add(this.options.commentPropName,[{[this.options.textNodeName]:l}])}s=u}else if(t.substr(s+1,2)==="!D"){const u=Mbt(t,s);this.docTypeEntities=u.entities;s=u.i}else if(t.substr(s+1,2)==="!["){const u=am(t,"]]>",s,"CDATA is not closed.")-2;const l=t.substring(s+9,u);n=this.saveTextToParentTag(n,r,i);if(this.options.cdataPropName){r.add(this.options.cdataPropName,[{[this.options.textNodeName]:l}])}else{let c=this.parseTextData(l,r.tagname,i,true,false,true);if(c==void 0)c="";r.add(this.options.textNodeName,c)}s=u+2}else{let u=uB(t,s,this.options.removeNSPrefix);let l=u.tagName;const c=u.rawTagName;let d=u.tagExp;let p=u.attrExpPresent;let f=u.closeIndex;if(this.options.transformTagName){l=this.options.transformTagName(l)}if(r&&n){if(r.tagname!=="!xml"){n=this.saveTextToParentTag(n,r,i,false)}}const h=r;if(h&&this.options.unpairedTags.indexOf(h.tagname)!==-1){r=this.tagsNodeStack.pop();i=i.substring(0,i.lastIndexOf("."))}if(l!==e.tagname){i+=i?"."+l:l}if(this.isItStopNode(this.options.stopNodes,i,l)){let m="";if(d.length>0&&d.lastIndexOf("/")===d.length-1){s=u.closeIndex}else if(this.options.unpairedTags.indexOf(l)!==-1){s=u.closeIndex}else{const y=this.readStopNodeData(t,c,f+1);if(!y)throw new Error(`Unexpected end of ${c}`);s=y.i;m=y.tagContent}const g=new GE(l);if(l!==d&&p){g[":@"]=this.buildAttributesMap(d,i,l)}if(m){m=this.parseTextData(m,l,i,true,p,true,true)}i=i.substr(0,i.lastIndexOf("."));g.add(this.options.textNodeName,m);this.addChild(r,g,i)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){if(l[l.length-1]==="/"){l=l.substr(0,l.length-1);i=i.substr(0,i.length-1);d=l}else{d=d.substr(0,d.length-1)}if(this.options.transformTagName){l=this.options.transformTagName(l)}const m=new GE(l);if(l!==d&&p){m[":@"]=this.buildAttributesMap(d,i,l)}this.addChild(r,m,i);i=i.substr(0,i.lastIndexOf("."))}else{const m=new GE(l);this.tagsNodeStack.push(r);if(l!==d&&p){m[":@"]=this.buildAttributesMap(d,i,l)}this.addChild(r,m,i);r=m}n="";s=f}}}else{n+=t[s]}}return e.child},"parseXml");function Wbt(t,e,r){const n=this.options.updateTag(e.tagname,r,e[":@"]);if(n===false){}else if(typeof n==="string"){e.tagname=n;t.addChild(e)}else{t.addChild(e)}}o(Wbt,"addChild");var Jbt=o(function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(let e in this.lastEntities){const r=this.lastEntities[e];t=t.replace(r.regex,r.val)}if(this.options.htmlEntities){for(let e in this.htmlEntities){const r=this.htmlEntities[e];t=t.replace(r.regex,r.val)}}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t},"replaceEntitiesValue");function Qbt(t,e,r,n){if(t){if(n===void 0)n=Object.keys(e.child).length===0;t=this.parseTextData(t,e.tagname,r,false,e[":@"]?Object.keys(e[":@"]).length!==0:false,n);if(t!==void 0&&t!=="")e.add(this.options.textNodeName,t);t=""}return t}o(Qbt,"saveTextToParentTag");function Xbt(t,e,r){const n="*."+r;for(const i in t){const s=t[i];if(n===s||e===s)return true}return false}o(Xbt,"isItStopNode");function Zbt(t,e,r=">"){let n;let i="";for(let s=e;s<t.length;s++){let a=t[s];if(n){if(a===n)n=""}else if(a==='"'||a==="'"){n=a}else if(a===r[0]){if(r[1]){if(t[s+1]===r[1]){return{data:i,index:s}}}else{return{data:i,index:s}}}else if(a===" "){a=" "}i+=a}}o(Zbt,"tagExpWithClosingIndex");function am(t,e,r,n){const i=t.indexOf(e,r);if(i===-1){throw new Error(n)}else{return i+e.length-1}}o(am,"findClosingIndex");function uB(t,e,r,n=">"){const i=Zbt(t,e+1,n);if(!i)return;let s=i.data;const a=i.index;const u=s.search(/\s/);let l=s;let c=true;if(u!==-1){l=s.substr(0,u).replace(/\s\s*$/,"");s=s.substr(u+1)}const d=l;if(r){const p=l.indexOf(":");if(p!==-1){l=l.substr(p+1);c=l!==i.data.substr(p+1)}}return{tagName:l,tagExp:s,closeIndex:a,attrExpPresent:c,rawTagName:d}}o(uB,"readTagExp");function e3t(t,e,r){const n=r;let i=1;for(;r<t.length;r++){if(t[r]==="<"){if(t[r+1]==="/"){const s=am(t,">",r,`${e} is not closed`);let a=t.substring(r+2,s).trim();if(a===e){i--;if(i===0){return{tagContent:t.substring(n,r),i:s}}}r=s}else if(t[r+1]==="?"){const s=am(t,"?>",r+1,"StopNode is not closed.");r=s}else if(t.substr(r+1,3)==="!--"){const s=am(t,"-->",r+3,"StopNode is not closed.");r=s}else if(t.substr(r+1,2)==="!["){const s=am(t,"]]>",r,"StopNode is not closed.")-2;r=s}else{const s=uB(t,r,">");if(s){const a=s&&s.tagName;if(a===e&&s.tagExp[s.tagExp.length-1]!=="/"){i++}r=s.closeIndex}}}}}o(e3t,"readStopNodeData");function lB(t,e,r){if(e&&typeof t==="string"){const n=t.trim();if(n==="true")return true;else if(n==="false")return false;else return Bbt(t,r)}else{if(cB.isExist(t)){return t}else{return""}}}o(lB,"parseValue");N6e.exports=oB});var k6e=_(D6e=>{"use strict";function t3t(t,e){return P6e(t,e)}o(t3t,"prettify");function P6e(t,e,r){let n;const i={};for(let s=0;s<t.length;s++){const a=t[s];const u=r3t(a);let l="";if(r===void 0)l=u;else l=r+"."+u;if(u===e.textNodeName){if(n===void 0)n=a[u];else n+=""+a[u]}else if(u===void 0){continue}else if(a[u]){let c=P6e(a[u],e,l);const d=i3t(c,e);if(a[":@"]){n3t(c,a[":@"],l,e)}else if(Object.keys(c).length===1&&c[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode){c=c[e.textNodeName]}else if(Object.keys(c).length===0){if(e.alwaysCreateTextNode)c[e.textNodeName]="";else c=""}if(i[u]!==void 0&&i.hasOwnProperty(u)){if(!Array.isArray(i[u])){i[u]=[i[u]]}i[u].push(c)}else{if(e.isArray(u,l,d)){i[u]=[c]}else{i[u]=c}}}}if(typeof n==="string"){if(n.length>0)i[e.textNodeName]=n}else if(n!==void 0)i[e.textNodeName]=n;return i}o(P6e,"compress");function r3t(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const n=e[r];if(n!==":@")return n}}o(r3t,"propName");function n3t(t,e,r,n){if(e){const i=Object.keys(e);const s=i.length;for(let a=0;a<s;a++){const u=i[a];if(n.isArray(u,r+"."+u,true,true)){t[u]=[e[u]]}else{t[u]=e[u]}}}}o(n3t,"assignAttributes");function i3t(t,e){const{textNodeName:r}=e;const n=Object.keys(t).length;if(n===0){return true}if(n===1&&(t[r]||typeof t[r]==="boolean"||t[r]===0)){return true}return false}o(i3t,"isLeafTag");D6e.prettify=t3t});var L6e=_((xur,$6e)=>{var{buildOptions:s3t}=S6e();var a3t=I6e();var{prettify:o3t}=k6e();var u3t=iB();var dB=class{static{o(this,"XMLParser")}constructor(e){this.externalEntities={};this.options=s3t(e)}parse(e,r){if(typeof e==="string"){}else if(e.toString){e=e.toString()}else{throw new Error("XML data is accepted in String or Bytes[] form.")}if(r){if(r===true)r={};const s=u3t.validate(e,r);if(s!==true){throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}}const n=new a3t(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(e);if(this.options.preserveOrder||i===void 0)return i;else return o3t(i,this.options)}addEntity(e,r){if(r.indexOf("&")!==-1){throw new Error("Entity value can't have '&'")}else if(e.indexOf("&")!==-1||e.indexOf(";")!==-1){throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'")}else if(r==="&"){throw new Error("An entity with value '&' is not permitted")}else{this.externalEntities[e]=r}}};$6e.exports=dB});var M6e=_((Rur,F6e)=>{var l3t="\n";function c3t(t,e){let r="";if(e.format&&e.indentBy.length>0){r=l3t}return j6e(t,e,"",r)}o(c3t,"toXml");function j6e(t,e,r,n){let i="";let s=false;for(let a=0;a<t.length;a++){const u=t[a];const l=d3t(u);if(l===void 0)continue;let c="";if(r.length===0)c=l;else c=`${r}.${l}`;if(l===e.textNodeName){let m=u[l];if(!p3t(c,e)){m=e.tagValueProcessor(l,m);m=U6e(m,e)}if(s){i+=n}i+=m;s=false;continue}else if(l===e.cdataPropName){if(s){i+=n}i+=`<![CDATA[${u[l][0][e.textNodeName]}]]>`;s=false;continue}else if(l===e.commentPropName){i+=n+`<!--${u[l][0][e.textNodeName]}-->`;s=true;continue}else if(l[0]==="?"){const m=q6e(u[":@"],e);const g=l==="?xml"?"":n;let y=u[l][0][e.textNodeName];y=y.length!==0?" "+y:"";i+=g+`<${l}${y}${m}?>`;s=true;continue}let d=n;if(d!==""){d+=e.indentBy}const p=q6e(u[":@"],e);const f=n+`<${l}${p}`;const h=j6e(u[l],e,c,d);if(e.unpairedTags.indexOf(l)!==-1){if(e.suppressUnpairedNode)i+=f+">";else i+=f+"/>"}else if((!h||h.length===0)&&e.suppressEmptyNode){i+=f+"/>"}else if(h&&h.endsWith(">")){i+=f+`>${h}${n}</${l}>`}else{i+=f+">";if(h&&n!==""&&(h.includes("/>")||h.includes("</"))){i+=n+e.indentBy+h+n}else{i+=h}i+=`</${l}>`}s=true}return i}o(j6e,"arrToStr");function d3t(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const n=e[r];if(!t.hasOwnProperty(n))continue;if(n!==":@")return n}}o(d3t,"propName");function q6e(t,e){let r="";if(t&&!e.ignoreAttributes){for(let n in t){if(!t.hasOwnProperty(n))continue;let i=e.attributeValueProcessor(n,t[n]);i=U6e(i,e);if(i===true&&e.suppressBooleanAttributes){r+=` ${n.substr(e.attributeNamePrefix.length)}`}else{r+=` ${n.substr(e.attributeNamePrefix.length)}="${i}"`}}}return r}o(q6e,"attr_to_str");function p3t(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);let r=t.substr(t.lastIndexOf(".")+1);for(let n in e.stopNodes){if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+r)return true}return false}o(p3t,"isStopNode");function U6e(t,e){if(t&&t.length>0&&e.processEntities){for(let r=0;r<e.entities.length;r++){const n=e.entities[r];t=t.replace(n.regex,n.val)}}return t}o(U6e,"replaceEntitiesValue");F6e.exports=c3t});var V6e=_((Nur,B6e)=>{"use strict";var f3t=M6e();var h3t={attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,cdataPropName:false,format:false,indentBy:" ",suppressEmptyNode:false,suppressUnpairedNode:true,suppressBooleanAttributes:true,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:false,commentPropName:false,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:true,stopNodes:[],oneListGroup:false};function $p(t){this.options=Object.assign({},h3t,t);if(this.options.ignoreAttributes||this.options.attributesGroupName){this.isAttribute=function(){return false}}else{this.attrPrefixLen=this.options.attributeNamePrefix.length;this.isAttribute=y3t}this.processTextOrObjNode=m3t;if(this.options.format){this.indentate=g3t;this.tagEndChar=">\n";this.newLine="\n"}else{this.indentate=function(){return""};this.tagEndChar=">";this.newLine=""}}o($p,"Builder");$p.prototype.build=function(t){if(this.options.preserveOrder){return f3t(t,this.options)}else{if(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1){t={[this.options.arrayNodeName]:t}}return this.j2x(t,0).val}};$p.prototype.j2x=function(t,e){let r="";let n="";for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;if(typeof t[i]==="undefined"){if(this.isAttribute(i)){n+=""}}else if(t[i]===null){if(this.isAttribute(i)){n+=""}else if(i[0]==="?"){n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar}else{n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar}}else if(t[i]instanceof Date){n+=this.buildTextValNode(t[i],i,"",e)}else if(typeof t[i]!=="object"){const s=this.isAttribute(i);if(s){r+=this.buildAttrPairStr(s,""+t[i])}else{if(i===this.options.textNodeName){let a=this.options.tagValueProcessor(i,""+t[i]);n+=this.replaceEntitiesValue(a)}else{n+=this.buildTextValNode(t[i],i,"",e)}}}else if(Array.isArray(t[i])){const s=t[i].length;let a="";for(let u=0;u<s;u++){const l=t[i][u];if(typeof l==="undefined"){}else if(l===null){if(i[0]==="?")n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar;else n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar}else if(typeof l==="object"){if(this.options.oneListGroup){a+=this.j2x(l,e+1).val}else{a+=this.processTextOrObjNode(l,i,e)}}else{a+=this.buildTextValNode(l,i,"",e)}}if(this.options.oneListGroup){a=this.buildObjectNode(a,i,"",e)}n+=a}else{if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const s=Object.keys(t[i]);const a=s.length;for(let u=0;u<a;u++){r+=this.buildAttrPairStr(s[u],""+t[i][s[u]])}}else{n+=this.processTextOrObjNode(t[i],i,e)}}}return{attrStr:r,val:n}};$p.prototype.buildAttrPairStr=function(t,e){e=this.options.attributeValueProcessor(t,""+e);e=this.replaceEntitiesValue(e);if(this.options.suppressBooleanAttributes&&e==="true"){return" "+t}else return" "+t+'="'+e+'"'};function m3t(t,e,r){const n=this.j2x(t,r+1);if(t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1){return this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r)}else{return this.buildObjectNode(n.val,e,n.attrStr,r)}}o(m3t,"processTextOrObjNode");$p.prototype.buildObjectNode=function(t,e,r,n){if(t===""){if(e[0]==="?")return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;else{return this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar}}else{let i="</"+e+this.tagEndChar;let s="";if(e[0]==="?"){s="?";i=""}if((r||r==="")&&t.indexOf("<")===-1){return this.indentate(n)+"<"+e+r+s+">"+t+i}else if(this.options.commentPropName!==false&&e===this.options.commentPropName&&s.length===0){return this.indentate(n)+`<!--${t}-->`+this.newLine}else{return this.indentate(n)+"<"+e+r+s+this.tagEndChar+t+this.indentate(n)+i}}};$p.prototype.closeTag=function(t){let e="";if(this.options.unpairedTags.indexOf(t)!==-1){if(!this.options.suppressUnpairedNode)e="/"}else if(this.options.suppressEmptyNode){e="/"}else{e=`></${t}`}return e};$p.prototype.buildTextValNode=function(t,e,r,n){if(this.options.cdataPropName!==false&&e===this.options.cdataPropName){return this.indentate(n)+`<![CDATA[${t}]]>`+this.newLine}else if(this.options.commentPropName!==false&&e===this.options.commentPropName){return this.indentate(n)+`<!--${t}-->`+this.newLine}else if(e[0]==="?"){return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar}else{let i=this.options.tagValueProcessor(e,t);i=this.replaceEntitiesValue(i);if(i===""){return this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar}else{return this.indentate(n)+"<"+e+r+">"+i+"</"+e+this.tagEndChar}}};$p.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities){for(let e=0;e<this.options.entities.length;e++){const r=this.options.entities[e];t=t.replace(r.regex,r.val)}}return t};function g3t(t){return this.options.indentBy.repeat(t)}o(g3t,"indentate");function y3t(t){if(t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName){return t.substr(this.attrPrefixLen)}else{return false}}o(y3t,"isAttribute");B6e.exports=$p});var z6e=_((Pur,H6e)=>{"use strict";var v3t=iB();var _3t=L6e();var E3t=V6e();H6e.exports={XMLParser:_3t,XMLValidator:v3t,XMLBuilder:E3t}});var J6e=_(_s=>{"use strict";var b3t=_s&&_s.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var w3t=_s&&_s.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var S3t=_s&&_s.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))b3t(e,t,r)}w3t(e,t);return e};var om=_s&&_s.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var W6e=_s&&_s.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};var Hc;var e7;var YE;Object.defineProperty(_s,"__esModule",{value:true});_s.TransferManager=_s.MultiPartUploadError=void 0;var KE=W6e(IM());var Lp=S3t(require("path"));var XT=require("fs");var T3t=UE();var A3t=KS();var G6e=z6e();var ZT=W6e(OE());var x3t=require("crypto");var pB=rm();var K6e=yl();var C3t=bg();var R3t=(0,C3t.getPackageJSON)();var O3t=5;var N3t=5;var I3t=5;var P3t=32*1024*1024;var D3t=32*1024*1024;var k3t=32*1024*1024;var Y6e=5;var $3t="(?:)";var qg={UPLOAD_MANY:"tm.upload_many",DOWNLOAD_MANY:"tm.download_many",UPLOAD_SHARDED:"tm.upload_sharded",DOWNLOAD_SHARDED:"tm.download_sharded"};var L3t=o((t,e,r,n)=>{return new fB(t,e,r,n)},"defaultMultiPartGenerator");var WE=class extends Error{static{o(this,"MultiPartUploadError")}constructor(e,r,n){super(e);this.uploadId=r;this.partsMap=n}};_s.MultiPartUploadError=WE;var fB=class{static{o(this,"XMLMultiPartUploadHelper")}constructor(e,r,n,i){Hc.add(this);this.authClient=e.storage.authClient||new A3t.GoogleAuth;this.uploadId=n||"";this.bucket=e;this.fileName=r;this.baseUrl=`https://${e.name}.${new URL(this.bucket.storage.apiEndpoint).hostname}/${r}`;this.xmlBuilder=new G6e.XMLBuilder({arrayNodeName:"Part"});this.xmlParser=new G6e.XMLParser;this.partsMap=i||new Map;this.retryOptions={retries:this.bucket.storage.retryOptions.maxRetries,factor:this.bucket.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.bucket.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.bucket.storage.retryOptions.totalTimeout*1e3}}async initiateUpload(e={}){const r=`${this.baseUrl}?uploads`;return(0,ZT.default)(async n=>{try{const i=await this.authClient.request({headers:om(this,Hc,"m",e7).call(this,e),method:"POST",url:r});if(i.data&&i.data.error){throw i.data.error}const s=this.xmlParser.parse(i.data);this.uploadId=s.InitiateMultipartUploadResult.UploadId}catch(i){om(this,Hc,"m",YE).call(this,i,n)}},this.retryOptions)}async uploadPart(e,r,n){const i=`${this.baseUrl}?partNumber=${e}&uploadId=${this.uploadId}`;let s=om(this,Hc,"m",e7).call(this);if(n==="md5"){const a=(0,x3t.createHash)("md5").update(r).digest("base64");s={"Content-MD5":a}}return(0,ZT.default)(async a=>{try{const u=await this.authClient.request({url:i,method:"PUT",body:r,headers:s});if(u.data&&u.data.error){throw u.data.error}this.partsMap.set(e,u.headers["etag"])}catch(u){om(this,Hc,"m",YE).call(this,u,a)}},this.retryOptions)}async completeUpload(){const e=`${this.baseUrl}?uploadId=${this.uploadId}`;const r=new Map([...this.partsMap.entries()].sort((s,a)=>s[0]-a[0]));const n=[];for(const s of r.entries()){n.push({PartNumber:s[0],ETag:s[1]})}const i=`<CompleteMultipartUpload>${this.xmlBuilder.build(n)}</CompleteMultipartUpload>`;return(0,ZT.default)(async s=>{try{const a=await this.authClient.request({headers:om(this,Hc,"m",e7).call(this),url:e,method:"POST",body:i});if(a.data&&a.data.error){throw a.data.error}return a}catch(a){om(this,Hc,"m",YE).call(this,a,s);return}},this.retryOptions)}async abortUpload(){const e=`${this.baseUrl}?uploadId=${this.uploadId}`;return(0,ZT.default)(async r=>{try{const n=await this.authClient.request({url:e,method:"DELETE"});if(n.data&&n.data.error){throw n.data.error}}catch(n){om(this,Hc,"m",YE).call(this,n,r);return}},this.retryOptions)}};Hc=new WeakSet,e7=o(function t(e={}){let r=false;let n=false;for(const[i,s]of Object.entries(e)){if(i.toLocaleLowerCase().trim()==="x-goog-api-client"){r=true;if(!s.includes(qg.UPLOAD_SHARDED)){e[i]=`${s} gccl-gcs-cmd/${qg.UPLOAD_SHARDED}`}}else if(i.toLocaleLowerCase().trim()==="user-agent"){n=true}}if(!r){e["x-goog-api-client"]=`${(0,K6e.getRuntimeTrackingString)()} gccl/${R3t.version} gccl-gcs-cmd/${qg.UPLOAD_SHARDED}`}if(!n){e["User-Agent"]=(0,K6e.getUserAgentString)()}return e},"_XMLMultiPartUploadHelper_setGoogApiClientHeaders"),YE=o(function t(e,r){if(this.bucket.storage.retryOptions.autoRetry&&this.bucket.storage.retryOptions.retryableErrorFn(e)){throw e}else{r(e)}},"_XMLMultiPartUploadHelper_handleErrorResponse");var hB=class{static{o(this,"TransferManager")}constructor(e){this.bucket=e}async uploadManyFiles(e,r={}){var n;if(r.skipIfExists&&((n=r.passthroughOptions)===null||n===void 0?void 0:n.preconditionOpts)){r.passthroughOptions.preconditionOpts.ifGenerationMatch=0}else if(r.skipIfExists&&r.passthroughOptions===void 0){r.passthroughOptions={preconditionOpts:{ifGenerationMatch:0}}}const i=(0,KE.default)(r.concurrencyLimit||O3t);const s=[];let a=[];if(!Array.isArray(e)){for await(const u of this.getPathsFromDirectory(e)){a.push(u)}}else{a=e}for(const u of a){const l=await XT.promises.lstat(u);if(l.isDirectory()){continue}const c={...r.passthroughOptions,[pB.GCCL_GCS_CMD_KEY]:qg.UPLOAD_MANY};c.destination=u.split(Lp.sep).join(Lp.posix.sep);if(r.prefix){c.destination=Lp.posix.join(...r.prefix.split(Lp.sep),c.destination)}s.push(i(()=>this.bucket.upload(u,c)))}return Promise.all(s)}async downloadManyFiles(e,r={}){const n=(0,KE.default)(r.concurrencyLimit||N3t);const i=[];let s=[];if(!Array.isArray(e)){const l=await this.bucket.getFiles({prefix:e});s=l[0]}else{s=e.map(l=>{if(typeof l==="string"){return this.bucket.file(l)}return l})}const a=r.stripPrefix?`^${r.stripPrefix}`:$3t;const u=new RegExp(a,"g");for(const l of s){const c={...r.passthroughOptions,[pB.GCCL_GCS_CMD_KEY]:qg.DOWNLOAD_MANY};if(r.prefix){c.destination=Lp.join(r.prefix||"",c.destination||"",l.name)}if(r.stripPrefix){c.destination=l.name.replace(u,"")}i.push(n(()=>l.download(c)))}return Promise.all(i)}async downloadFileInChunks(e,r={}){let n=r.chunkSizeBytes||D3t;let i=(0,KE.default)(r.concurrencyLimit||I3t);const s=[];const a=typeof e==="string"?this.bucket.file(e):e;const u=await a.get();const l=parseInt(u[0].metadata.size.toString());if(l<P3t){i=(0,KE.default)(1);n=l}let c=0;const d=r.destination||Lp.basename(a.name);const p=await XT.promises.open(d,"w");while(c<l){const h=c;let m=c+n-1;m=m>l?l:m;s.push(i(async()=>{const g=await a.download({start:h,end:m,[pB.GCCL_GCS_CMD_KEY]:qg.DOWNLOAD_SHARDED});return p.write(g[0],0,g[0].length,h)}));c+=n}let f;try{const h=await Promise.all(s);f=h.map(m=>m.buffer);if(r.validation==="crc32c"){await T3t.CRC32C.fromFile(d)}return f}finally{p.close()}}async uploadFileInChunks(e,r={},n=L3t){const i=r.chunkSizeBytes||k3t;const s=(0,KE.default)(r.concurrencyLimit||Y6e);const a=r.maxQueueSize||r.concurrencyLimit||Y6e;const u=r.uploadName||Lp.basename(e);const l=n(this.bucket,u,r.uploadId,r.partsMap);let c=1;let d=[];try{if(r.uploadId===void 0){await l.initiateUpload(r.headers)}const p=l.partsMap.size*i;const f=(0,XT.createReadStream)(e,{highWaterMark:i,start:p});for await(const h of f){if(d.length>=a){await Promise.all(d);d=[]}d.push(s(()=>l.uploadPart(c++,h,r.validation)))}await Promise.all(d);return await l.completeUpload()}catch(p){if((r.autoAbortFailure===void 0||r.autoAbortFailure)&&l.uploadId){try{await l.abortUpload();return}catch(f){throw new WE(f.message,l.uploadId,l.partsMap)}}throw new WE(p.message,l.uploadId,l.partsMap)}}async*getPathsFromDirectory(e){const r=await XT.promises.readdir(e,{withFileTypes:true});for(const n of r){const i=Lp.join(e,n.name);n.isDirectory()?yield*this.getPathsFromDirectory(i):yield i}}};_s.TransferManager=hB});var X6e=_(fn=>{"use strict";var q3t=fn&&fn.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var mB=fn&&fn.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))q3t(e,t,r)};Object.defineProperty(fn,"__esModule",{value:true});fn.Notification=fn.Iam=fn.HmacKey=fn.File=fn.Channel=fn.Bucket=fn.Storage=fn.IdempotencyStrategy=fn.ApiError=void 0;var j3t=xp();Object.defineProperty(fn,"ApiError",{enumerable:true,get:function(){return j3t.ApiError}});var Q6e=Ig();Object.defineProperty(fn,"IdempotencyStrategy",{enumerable:true,get:function(){return Q6e.IdempotencyStrategy}});Object.defineProperty(fn,"Storage",{enumerable:true,get:function(){return Q6e.Storage}});var U3t=FT();Object.defineProperty(fn,"Bucket",{enumerable:true,get:function(){return U3t.Bucket}});mB(UE(),fn);var F3t=ZM();Object.defineProperty(fn,"Channel",{enumerable:true,get:function(){return F3t.Channel}});var M3t=FE();Object.defineProperty(fn,"File",{enumerable:true,get:function(){return M3t.File}});mB(VM(),fn);var B3t=eB();Object.defineProperty(fn,"HmacKey",{enumerable:true,get:function(){return B3t.HmacKey}});var V3t=YM();Object.defineProperty(fn,"Iam",{enumerable:true,get:function(){return V3t.Iam}});var H3t=WM();Object.defineProperty(fn,"Notification",{enumerable:true,get:function(){return H3t.Notification}});mB(J6e(),fn)});var yB=_(hr=>{"use strict";var gB=hr&&hr.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(hr,"__esModule",{value:true});hr.deleteFolder=hr.untar=hr.tarFolderContent=hr.getParentDirFilename=hr.safePath=hr.UnsafePathError=hr.ensureDirectoryExists=hr.mkdirForFilePathIfNotExits=hr.mkdirIfNotExists=hr.listFolderContents=hr.listFolders=hr.isNotFileOrDirectory=hr.dirExists=hr.deleteFile=hr.fileExists=void 0;var Z6e=gB(require("child_process"));var jp=gB(require("fs/promises"));var qp=gB(require("path"));var ebe=[".git","node_modules",".yarn",".DS_Store"];async function z3t(t){try{const e=await jp.default.stat(t);return e.isFile()}catch(e){return false}}o(z3t,"fileExists");hr.fileExists=z3t;async function G3t(t,e){return await jp.default.rm(t,e)}o(G3t,"deleteFile");hr.deleteFile=G3t;async function r7(t){try{const e=await jp.default.stat(t);return e.isDirectory()}catch(e){return false}}o(r7,"dirExists");hr.dirExists=r7;async function K3t(t){try{await jp.default.stat(t);return false}catch(e){return true}}o(K3t,"isNotFileOrDirectory");hr.isNotFileOrDirectory=K3t;function Y3t(t,e){const r=new RegExp(`(.*)(\\/${e})$|(.*)(${e}\\/)`);const n=t.match(r);if(!n){return""}const i=t.split(n[0]);return i[1]===""?"":`/${i[1]}`}o(Y3t,"getParentDirectory");async function W3t(t){if(!await r7(t)){return[]}const e=await jp.default.readdir(t,{withFileTypes:true});const r=[];for await(const n of e){if(!ebe.includes(n.name)){if(n.isDirectory()){r.push(n.name)}}}return r}o(W3t,"listFolders");hr.listFolders=W3t;async function tbe(t,e,r=true){const n=Y3t(t,e);const i=await jp.default.readdir(t,{withFileTypes:true});const s=[];for await(const a of i){if(!ebe.includes(a.name)||!r){if(a.isDirectory()){const u=await tbe(qp.default.join(t,a.name),e,r);s.push(...u)}else{s.push(qp.default.join(n,a.name))}}}return s}o(tbe,"listFolderContents");hr.listFolderContents=tbe;var J3t=o(async t=>{if(await r7(t)){return true}await jp.default.mkdir(t,{recursive:true})},"mkdirIfNotExists");hr.mkdirIfNotExists=J3t;var Q3t=o(async t=>{const e=qp.default.dirname(t);return(0,hr.mkdirIfNotExists)(e)},"mkdirForFilePathIfNotExits");hr.mkdirForFilePathIfNotExits=Q3t;hr.ensureDirectoryExists=hr.mkdirForFilePathIfNotExits;var t7=class extends Error{static{o(this,"UnsafePathError")}constructor(e){super(e)}};hr.UnsafePathError=t7;function X3t(t){const e=o(r=>{if(!r.startsWith(t)){throw new t7(`Resolved path is not part of the project.`)}return r},"ensureSafePath");return{resolve:(...r)=>e(qp.default.resolve(...r))}}o(X3t,"safePath");hr.safePath=X3t;function Z3t(t){return`${qp.default.basename(qp.default.dirname(t))}/${qp.default.basename(t)}`}o(Z3t,"getParentDirFilename");hr.getParentDirFilename=Z3t;function e8t(t,e,r,n){const i=qp.default.join(n,r);Z6e.default.execSync(`tar --exclude='.git/' --exclude='dist/' -czf ${i} ${e}`,{cwd:t});return i}o(e8t,"tarFolderContent");hr.tarFolderContent=e8t;function t8t(t,e,r,n=false){Z6e.default.execSync(`tar -xf ${e} ${n?"--strip-components=1 ":""}-C ${r}`,{cwd:t})}o(t8t,"untar");hr.untar=t8t;async function r8t(t){if(await r7(t)){return await jp.default.rm(t,{recursive:true})}}o(r8t,"deleteFolder");hr.deleteFolder=r8t});var abe=_(er=>{"use strict";var n8t=er&&er.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var i8t=er&&er.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var s8t=er&&er.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))n8t(e,t,r)}i8t(e,t);return e};var rbe=er&&er.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(er,"__esModule",{value:true});er.uploadFolderAndRemoveMissingSourceFiles=er.cleanGCPFilePaths=er.uploadFolder=er.deleteDirectory=er.deleteFile=er.listFolderContent=er.readFileStream=er.fileExists=er.getFileContents=er.downloadFile=er.uploadFromMemory=er.uploadFile=er.getBucket=er.BucketName=void 0;var a8t=X6e();var zc=rbe(require("path"));var Tl=rbe(Oa());var n7=s8t(yB());var um;(function(t){t[t["Archive"]=0]="Archive";t[t["Bundle"]=1]="Bundle";t[t["SourceCode"]=2]="SourceCode";t[t["Sources"]=3]="Sources";t[t["DevPortalBuild"]=4]="DevPortalBuild"})(um||(er.BucketName=um={}));function Al(t){let e;if(t===um.Archive){if(Tl.default.GCP_STORAGE_ARCHIVE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_ARCHIVE_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_ARCHIVE_BUCKET_NAME}else if(t===um.Bundle){if(Tl.default.GCP_STORAGE_BUNDLE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_BUNDLE_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_BUNDLE_BUCKET_NAME}else if(t===um.SourceCode){if(Tl.default.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_SOURCE_CODE_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}else if(t===um.Sources){if(Tl.default.GCP_STORAGE_SOURCES_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_SOURCES_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_SOURCES_BUCKET_NAME}else if(t===um.DevPortalBuild){if(Tl.default.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}else{throw new Error("Invalid value for argument 'bucketName'")}const r=new a8t.Storage;return r.bucket(e)}o(Al,"getBucket");er.getBucket=Al;async function vB(t,e,r,n,i){try{await Al(t).upload(e,{destination:r,metadata:i})}catch(s){n.info(`File upload for ${t}/${r} ran into an issue`);n.error(s)}}o(vB,"uploadFile");er.uploadFile=vB;async function o8t(t,e,r,n,i){try{await Al(t).file(r).save(e,i)}catch(s){n.info(`From Memory upload for ${t}/${r} ran into an issue`);n.error(s)}}o(o8t,"uploadFromMemory");er.uploadFromMemory=o8t;async function u8t(t,e,r,n){try{const i={destination:r};await Al(t).file(e).download(i);n.info(`File ${t}/${e} successfully downloaded to ${r}`)}catch(i){n.info(`Downloading file ${t}/${e} ran into an issue`);n.error(i)}}o(u8t,"downloadFile");er.downloadFile=u8t;async function l8t(t,e,r){try{const n=await Al(t).file(e).download();r.info(`File ${t}/${e} successfully downloaded to memory`);return n.toString()}catch(n){r.info(`Downloading file ${t}/${e} ran into an issue`);r.error(n)}}o(l8t,"getFileContents");er.getFileContents=l8t;async function c8t(t,e,r){try{r.info(`Check if file ${t}/${e} exists in storage`);const n=await Al(t).file(e).exists();return n[0]}catch(n){r.info(`Ran into an issue while checking if a file ${t}/${e} exists in storage`);r.error(n);return false}}o(c8t,"fileExists");er.fileExists=c8t;function d8t(t,e,r){r.info(`Reading file ${t}/${e} from storage`);return Al(t).file(e).createReadStream({decompress:true})}o(d8t,"readFileStream");er.readFileStream=d8t;async function nbe(t,e,r){const n=new Set;try{const[i]=await Al(t).getFiles({prefix:e});for(let s=0;s<i.length;s++){const a=i[s];const u=a.name.replace(e,"");if(u===""){continue}const l=u.split("/");if(l.length>1){for(let c=0;c<l.length-1;c++){const d=`/${l[c]}`;if(!n.has(d)){n.add(d)}}}n.add(`/${u}`)}}catch(i){r.info(`Ran into an issue while listing files in ${t}/${e} storage path`);r.error(i)}return[...n]}o(nbe,"listFolderContent");er.listFolderContent=nbe;async function ibe(t,e,r){try{r.info(`Deleting file ${t}/${e} from storage`);await Al(t).file(e).delete()}catch(n){r.warn(`Failed to delete file ${t}/${e} from storage`);r.error(n)}}o(ibe,"deleteFile");er.deleteFile=ibe;async function p8t(t,e,r){try{r.info(`Deleting directory ${t}/${e} from storage`);await Al(t).deleteFiles({prefix:e})}catch(n){r.info(`Failed to delete directory ${t}/${e} from storage`);r.error(n)}}o(p8t,"deleteDirectory");er.deleteDirectory=p8t;async function f8t(t,e,r,n,i){try{n.info(`Upload folder ${zc.default.basename(e)}`);if(await n7.dirExists(e)){const s=await n7.listFolderContents(e,zc.default.basename(e));if(s&&s.length>0){await Promise.all(s.map(async a=>{return await vB(t,zc.default.join(e,a),zc.default.join(r,a),n,i)}))}}}catch(s){n.warn(`Failed to upload directory ${e} to bucket ${t}`,s)}}o(f8t,"uploadFolder");er.uploadFolder=f8t;function sbe(t){const e=t.filter(r=>r!=="/").map(r=>r.replace(/^\/+/,""));return e}o(sbe,"cleanGCPFilePaths");er.cleanGCPFilePaths=sbe;async function h8t(t,e,r,n,i){try{n.info(`uploadFolderAndRemoveMissingSourceFiles: upload folder ${zc.default.basename(e)}`);if(await n7.dirExists(e)){const s=await nbe(t,r,n);const a=sbe(s);const u=await n7.listFolderContents(e,zc.default.basename(e));const l=a.filter(c=>!u.includes(c)).map(c=>zc.default.join(r,c));await Promise.all(l.map(async c=>{return await ibe(t,c,n)}));await Promise.all(u.map(async c=>{return await vB(t,zc.default.join(e,c),zc.default.join(r,c),n,i)}))}}catch(s){n.warn(`Failed to upload directory ${e} to bucket ${t}`,s)}}o(h8t,"uploadFolderAndRemoveMissingSourceFiles");er.uploadFolderAndRemoveMissingSourceFiles=h8t});var obe=_(i7=>{"use strict";Object.defineProperty(i7,"__esModule",{value:true});i7.graphQL=void 0;var xl=As();async function m8t(t,e,r){const n=await fetch(`https://api.github.com/graphql`,{method:"POST",headers:{Authorization:`Bearer ${e}`},body:t});if(n.status===401){r.warn("Failed GitHub GraphQL query with status 401. User token might have been revoked directly in GitHub.");throw new xl.ApiError(xl.Problems.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS)}if(n.status===403){r.warn("Failed GitHub GraphQL query with status 403. User token does not have correct permissions to query this GitHub API.");throw new xl.ApiError(xl.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}if(n.status===404){r.warn("Failed GitHub GraphQL query with status 404. User token has been revoked and can not query this GitHub API.");throw new xl.ApiError(xl.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}if(n.status===400){const i=await n.json();r.warn("Failed GitHub GraphQL query with status 400. A malformed query was ran against the GitHub API.",i);throw new xl.ApiError(xl.Problems.BAD_REQUEST)}if(n.status!==200&&n.status!==304){r.warn(`Failed GitHub GraphQL query with status ${n.status}. There was an unexpected error querying the GitHub API.`);throw new xl.ApiError(xl.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}return n}o(m8t,"graphQL");i7.graphQL=m8t});var fbe=_(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:true});xo.SourceControlProvider=xo.PlanType=xo.EnvironmentType=xo.EnvironmentTarget=xo.DeploymentState=void 0;var ube;(function(t){t[t["IS_STARTING"]=0]="IS_STARTING";t[t["STARTED"]=1]="STARTED";t[t["STOPPED"]=2]="STOPPED";t[t["ERRORED"]=3]="ERRORED"})(ube||(xo.DeploymentState=ube={}));var lbe;(function(t){t["CLOUDFLARE"]="CLOUDFLARE";t["KNATIVE"]="KNATIVE"})(lbe||(xo.EnvironmentTarget=lbe={}));var cbe;(function(t){t["PRODUCTION"]="PRODUCTION";t["PREVIEW"]="PREVIEW";t["WORKING_COPY"]="WORKING_COPY"})(cbe||(xo.EnvironmentType=cbe={}));var dbe;(function(t){t["FREE_V1"]="FREE_V1";t["BUILDER_V1"]="BUILDER_V1";t["BUSINESS_V1"]="BUSINESS_V1";t["CUSTOM"]="CUSTOM";t["EMPLOYEE"]="EMPLOYEE";t["CUSTOM_TRIAL_V1"]="CUSTOM_TRIAL_V1"})(dbe||(xo.PlanType=dbe={}));var pbe;(function(t){t["GITHUB"]="GITHUB";t["GITLAB"]="GITLAB";t["BITBUCKET"]="BITBUCKET"})(pbe||(xo.SourceControlProvider=pbe={}))});var mbe=_(hbe=>{"use strict";Object.defineProperty(hbe,"__esModule",{value:true})});var gbe=_(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:true});Co.INTERNAL_ROUTE_VENDOR_TAG=Co.ZUPLO_OPEN_API_ROUTE_KEY=Co.ZUPLO_OPEN_API_PATH_KEY=Co.ZUPLO_OPEN_API_VENDOR_PREFIX=void 0;Co.ZUPLO_OPEN_API_VENDOR_PREFIX="x-zuplo";Co.ZUPLO_OPEN_API_PATH_KEY=`${Co.ZUPLO_OPEN_API_VENDOR_PREFIX}-path`;Co.ZUPLO_OPEN_API_ROUTE_KEY=`${Co.ZUPLO_OPEN_API_VENDOR_PREFIX}-route`;Co.INTERNAL_ROUTE_VENDOR_TAG="x-internal"});var ybe=_((zur,g8t)=>{g8t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/dev-portal.json",title:"Dev Portal Config",description:"",type:"object",required:[],additionalProperties:false,$defs:{ApiKeysConfig:{type:"object",additionalProperties:false,required:["bucketName"],properties:{bucketName:{type:"string"},apiKey:{type:"string"}}},DevPortalOAuthClientConfig:{type:"object",additionalProperties:false,required:["clientId"],properties:{clientId:{type:"string"},audience:{type:"string",description:"The audience of the API (i.e. the Zup's URL)\nOkta: not required\nAuth0: https://my-api.example.com/"}}},DevPortalOAuthClientCredentialsConfig:{type:"object",description:"This is the M2M configuration used to authenticate with OAuth provider in order to manage OAuth clients",required:["clientId","clientSecret"],additionalProperties:false,properties:{clientId:{type:"string"},clientSecret:{type:"string"}}},DevPortalAPIKeyCredentialConfig:{type:"object",description:"API Key credentials to access identity provider API",required:["apiKey"],additionalProperties:false,properties:{apiKey:{type:"string"}}},DevPortalOAuthConfig:{type:"object",description:"Settings for OAuth that is used to authenticate end-users to the developer portal and (optionally) for configuring issuing of OAuth Client Consumers using the identity provider",required:["provider","authority","jwksUrl"],additionalProperties:false,properties:{provider:{type:"string",enum:["okta","auth0","azure-ad","clerk","oidc"]},authority:{type:"string",description:"This is the full URL of the authorization server.\nOkta: https://dev-1235.okta.com/oauth2/aus123152352342\nAuth0: https://my-account.us.auth0.com\nAzure Active Directory: https://login.microsoftonline.com/{tenant}/v2.0\nClerk: https://your-account-23.clerk.accounts.dev"},jwksUrl:{type:"string",description:"The url of of the JWKS"},devPortalClient:{description:"This is the client that is used to authenticate end-users to the Zuplo developer portal",$ref:"#/$defs/DevPortalOAuthClientConfig"},managementClient:{oneOf:[{$ref:"#/$defs/DevPortalOAuthClientCredentialsConfig"},{$ref:"#/$defs/DevPortalAPIKeyCredentialConfig"}]}}},DevPortalExternalAuthConfig:{type:"object",description:"Settings for external auth that is used to authenticate end-users to the developer portal",additionalProperties:false,required:["loginUrl","provider","logoutUrl"],properties:{provider:{type:"string",enum:["external"]},loginUrl:{type:"string",description:"The URL of your external login page"},logoutUrl:{type:"string",description:"The URL of your external logout endpoint"}}},DevPortalAuthConfig:{type:"object",oneOf:[{$ref:"#/$defs/DevPortalOAuthConfig"},{$ref:"#/$defs/DevPortalExternalAuthConfig"}]},DevPortalMonetizationConfig:{type:"object",description:"Settings for monetization features like self-serve checkout and subscription management",oneOf:[{$ref:"#/$defs/DevPortalStripeMonetizationConfig"}]},DevPortalStripeMonetizationConfig:{type:"object",description:"Settings used to configure Stripe for monetization features like self-serve checkout and subscription management",additionalProperties:false,required:["provider","publishableKey","pricingTableId","secretKey"],properties:{provider:{type:"string",enum:["stripe"]},publishableKey:{type:"string",description:"Your Stripe publishable key - found under Developers > API keys > Standard keys"},secretKey:{type:"string",description:"Your Stripe secret key - found under Developers > API keys > Standard keys"},pricingTableId:{type:"string",description:"The ID of the pricing table that will be used to display pricing information to end-users"},meteringBucketId:{type:"string",description:"The ID of the metering bucket that will be used to track usage of the API"}}}},properties:{$schema:{type:"string"},enabled:{description:"If the developer portal is enabled",type:"boolean",default:true},authentication:{description:"Authentication configuration",$ref:"#/$defs/DevPortalAuthConfig"},monetization:{description:"Monetization configuration",$ref:"#/$defs/DevPortalMonetizationConfig"},sitePathname:{type:"string",default:"/docs"},faviconUrl:{type:"string",description:"The favicon url"},pageTitle:{type:"string",description:"The default page title"},enableAuthentication:{type:"boolean",description:"If sign in to the developer portal is enabled."},enableMonetization:{type:"boolean",description:"If monetization features like self-serve checkout and subscription management are enabled."},requireAuthentication:{type:"boolean",default:false,description:"If authentication is required to access the developer portal. If false, the developer portal will be publicly accessible."},authorizePathname:{type:"string",default:"/oauth/authorize",description:"The path that starts the OAuth flow for third-party-apps"},apiKeys:{description:"Api Keys Service Configuration",$ref:"#/$defs/ApiKeysConfig"},generateExamples:{type:"boolean",default:true,description:"If false, the developer portal will no longer generate examples for endpoints that do not have examples defined"}}}});var XE=_(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:true});qr.regexpCode=qr.getEsmExportName=qr.getProperty=qr.safeStringify=qr.stringify=qr.strConcat=qr.addCodeArg=qr.str=qr._=qr.nil=qr._Code=qr.Name=qr.IDENTIFIER=qr._CodeOrName=void 0;var JE=class{static{o(this,"_CodeOrName")}};qr._CodeOrName=JE;qr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var lm=class extends JE{static{o(this,"Name")}constructor(e){super();if(!qr.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}};qr.Name=lm;var Ro=class extends JE{static{o(this,"_Code")}constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>{if(n instanceof lm)r[n.str]=(r[n.str]||0)+1;return r},{})}};qr._Code=Ro;qr.nil=new Ro("");function vbe(t,...e){const r=[t[0]];let n=0;while(n<e.length){EB(r,e[n]);r.push(t[++n])}return new Ro(r)}o(vbe,"_");qr._=vbe;var _B=new Ro("+");function _be(t,...e){const r=[QE(t[0])];let n=0;while(n<e.length){r.push(_B);EB(r,e[n]);r.push(_B,QE(t[++n]))}y8t(r);return new Ro(r)}o(_be,"str");qr.str=_be;function EB(t,e){if(e instanceof Ro)t.push(...e._items);else if(e instanceof lm)t.push(e);else t.push(E8t(e))}o(EB,"addCodeArg");qr.addCodeArg=EB;function y8t(t){let e=1;while(e<t.length-1){if(t[e]===_B){const r=v8t(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}o(y8t,"optimize");function v8t(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string"){if(e instanceof lm||t[t.length-1]!=='"')return;if(typeof e!="string")return`${t.slice(0,-1)}${e}"`;if(e[0]==='"')return t.slice(0,-1)+e.slice(1);return}if(typeof e=="string"&&e[0]==='"'&&!(t instanceof lm))return`"${t}${e.slice(1)}`;return}o(v8t,"mergeExprItems");function _8t(t,e){return e.emptyStr()?t:t.emptyStr()?e:_be`${t}${e}`}o(_8t,"strConcat");qr.strConcat=_8t;function E8t(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:QE(Array.isArray(t)?t.join(","):t)}o(E8t,"interpolate");function b8t(t){return new Ro(QE(t))}o(b8t,"stringify");qr.stringify=b8t;function QE(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(QE,"safeStringify");qr.safeStringify=QE;function w8t(t){return typeof t=="string"&&qr.IDENTIFIER.test(t)?new Ro(`.${t}`):vbe`[${t}]`}o(w8t,"getProperty");qr.getProperty=w8t;function S8t(t){if(typeof t=="string"&&qr.IDENTIFIER.test(t)){return new Ro(`${t}`)}throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}o(S8t,"getEsmExportName");qr.getEsmExportName=S8t;function T8t(t){return new Ro(t.toString())}o(T8t,"regexpCode");qr.regexpCode=T8t});var TB=_(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:true});js.ValueScope=js.ValueScopeName=js.Scope=js.varKinds=js.UsedValueState=void 0;var va=XE();var bB=class extends Error{static{o(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}};var wB;(function(t){t[t["Started"]=0]="Started";t[t["Completed"]=1]="Completed"})(wB=js.UsedValueState||(js.UsedValueState={}));js.varKinds={const:new va.Name("const"),let:new va.Name("let"),var:new va.Name("var")};var s7=class{static{o(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={};this._prefixes=e;this._parent=r}toName(e){return e instanceof va.Name?e:this.name(e)}name(e){return new va.Name(this._newName(e))}_newName(e){const r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e)){throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`)}return this._names[e]={prefix:e,index:0}}};js.Scope=s7;var a7=class extends va.Name{static{o(this,"ValueScopeName")}constructor(e,r){super(r);this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e;this.scopePath=(0,va._)`.${new va.Name(r)}[${n}]`}};js.ValueScopeName=a7;var A8t=(0,va._)`\n`;var SB=class extends s7{static{o(this,"ValueScope")}constructor(e){super(e);this._values={};this._scope=e.scope;this.opts={...e,_n:e.lines?A8t:va.nil}}get(){return this._scope}name(e){return new a7(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(e);const{prefix:s}=i;const a=(n=r.key)!==null&&n!==void 0?n:r.ref;let u=this._values[s];if(u){const d=u.get(a);if(d)return d}else{u=this._values[s]=new Map}u.set(a,i);const l=this._scope[s]||(this._scope[s]=[]);const c=l.length;l[c]=r.ref;i.setValue(r,{property:s,itemIndex:c});return i}getValue(e,r){const n=this._values[e];if(!n)return;return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,va._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=va.nil;for(const a in e){const u=e[a];if(!u)continue;const l=n[a]=n[a]||new Map;u.forEach(c=>{if(l.has(c))return;l.set(c,wB.Started);let d=r(c);if(d){const p=this.opts.es5?js.varKinds.var:js.varKinds.const;s=(0,va._)`${s}${p} ${c} = ${d};${this.opts._n}`}else if(d=i===null||i===void 0?void 0:i(c)){s=(0,va._)`${s}${d}${this.opts._n}`}else{throw new bB(c)}l.set(c,wB.Completed)})}return s}};js.ValueScope=SB});var Pt=_(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:true});Yt.or=Yt.and=Yt.not=Yt.CodeGen=Yt.operators=Yt.varKinds=Yt.ValueScopeName=Yt.ValueScope=Yt.Scope=Yt.Name=Yt.regexpCode=Yt.stringify=Yt.getProperty=Yt.nil=Yt.strConcat=Yt.str=Yt._=void 0;var Er=XE();var Au=TB();var Up=XE();Object.defineProperty(Yt,"_",{enumerable:true,get:function(){return Up._}});Object.defineProperty(Yt,"str",{enumerable:true,get:function(){return Up.str}});Object.defineProperty(Yt,"strConcat",{enumerable:true,get:function(){return Up.strConcat}});Object.defineProperty(Yt,"nil",{enumerable:true,get:function(){return Up.nil}});Object.defineProperty(Yt,"getProperty",{enumerable:true,get:function(){return Up.getProperty}});Object.defineProperty(Yt,"stringify",{enumerable:true,get:function(){return Up.stringify}});Object.defineProperty(Yt,"regexpCode",{enumerable:true,get:function(){return Up.regexpCode}});Object.defineProperty(Yt,"Name",{enumerable:true,get:function(){return Up.Name}});var c7=TB();Object.defineProperty(Yt,"Scope",{enumerable:true,get:function(){return c7.Scope}});Object.defineProperty(Yt,"ValueScope",{enumerable:true,get:function(){return c7.ValueScope}});Object.defineProperty(Yt,"ValueScopeName",{enumerable:true,get:function(){return c7.ValueScopeName}});Object.defineProperty(Yt,"varKinds",{enumerable:true,get:function(){return c7.varKinds}});Yt.operators={GT:new Er._Code(">"),GTE:new Er._Code(">="),LT:new Er._Code("<"),LTE:new Er._Code("<="),EQ:new Er._Code("==="),NEQ:new Er._Code("!=="),NOT:new Er._Code("!"),OR:new Er._Code("||"),AND:new Er._Code("&&"),ADD:new Er._Code("+")};var Gc=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}};var AB=class extends Gc{static{o(this,"Def")}constructor(e,r,n){super();this.varKind=e;this.name=r;this.rhs=n}render({es5:e,_n:r}){const n=e?Au.varKinds.var:this.varKind;const i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(!e[this.name.str])return;if(this.rhs)this.rhs=Ug(this.rhs,e,r);return this}get names(){return this.rhs instanceof Er._CodeOrName?this.rhs.names:{}}};var o7=class extends Gc{static{o(this,"Assign")}constructor(e,r,n){super();this.lhs=e;this.rhs=r;this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(this.lhs instanceof Er.Name&&!e[this.lhs.str]&&!this.sideEffects)return;this.rhs=Ug(this.rhs,e,r);return this}get names(){const e=this.lhs instanceof Er.Name?{}:{...this.lhs.names};return l7(e,this.rhs)}};var xB=class extends o7{static{o(this,"AssignOp")}constructor(e,r,n,i){super(e,n,i);this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}};var CB=class extends Gc{static{o(this,"Label")}constructor(e){super();this.label=e;this.names={}}render({_n:e}){return`${this.label}:`+e}};var RB=class extends Gc{static{o(this,"Break")}constructor(e){super();this.label=e;this.names={}}render({_n:e}){const r=this.label?` ${this.label}`:"";return`break${r};`+e}};var OB=class extends Gc{static{o(this,"Throw")}constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}};var NB=class extends Gc{static{o(this,"AnyCode")}constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){this.code=Ug(this.code,e,r);return this}get names(){return this.code instanceof Er._CodeOrName?this.code.names:{}}};var ZE=class extends Gc{static{o(this,"ParentNode")}constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){const{nodes:e}=this;let r=e.length;while(r--){const n=e[r].optimizeNodes();if(Array.isArray(n))e.splice(r,1,...n);else if(n)e[r]=n;else e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){const{nodes:n}=this;let i=n.length;while(i--){const s=n[i];if(s.optimizeNames(e,r))continue;x8t(e,s.names);n.splice(i,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>pm(e,r.names),{})}};var Kc=class extends ZE{static{o(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}};var IB=class extends ZE{static{o(this,"Root")}};var jg=class extends Kc{static{o(this,"Else")}};jg.kind="else";var cm=class t extends Kc{static{o(this,"If")}constructor(e,r){super(r);this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);if(this.else)r+="else "+this.else.render(e);return r}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(e===true)return this.nodes;let r=this.else;if(r){const n=r.optimizeNodes();r=this.else=Array.isArray(n)?new jg(n):n}if(r){if(e===false)return r instanceof t?r:r.nodes;if(this.nodes.length)return this;return new t(Ebe(e),r instanceof t?[r]:r.nodes)}if(e===false||!this.nodes.length)return void 0;return this}optimizeNames(e,r){var n;this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r);if(!(super.optimizeNames(e,r)||this.else))return;this.condition=Ug(this.condition,e,r);return this}get names(){const e=super.names;l7(e,this.condition);if(this.else)pm(e,this.else.names);return e}};cm.kind="if";var dm=class extends Kc{static{o(this,"For")}};dm.kind="for";var PB=class extends dm{static{o(this,"ForLoop")}constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(!super.optimizeNames(e,r))return;this.iteration=Ug(this.iteration,e,r);return this}get names(){return pm(super.names,this.iteration.names)}};var DB=class extends dm{static{o(this,"ForRange")}constructor(e,r,n,i){super();this.varKind=e;this.name=r;this.from=n;this.to=i}render(e){const r=e.es5?Au.varKinds.var:this.varKind;const{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){const e=l7(super.names,this.from);return l7(e,this.to)}};var u7=class extends dm{static{o(this,"ForIter")}constructor(e,r,n,i){super();this.loop=e;this.varKind=r;this.name=n;this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(!super.optimizeNames(e,r))return;this.iterable=Ug(this.iterable,e,r);return this}get names(){return pm(super.names,this.iterable.names)}};var e6=class extends Kc{static{o(this,"Func")}constructor(e,r,n){super();this.name=e;this.args=r;this.async=n}render(e){const r=this.async?"async ":"";return`${r}function ${this.name}(${this.args})`+super.render(e)}};e6.kind="func";var t6=class extends ZE{static{o(this,"Return")}render(e){return"return "+super.render(e)}};t6.kind="return";var kB=class extends Kc{static{o(this,"Try")}render(e){let r="try"+super.render(e);if(this.catch)r+=this.catch.render(e);if(this.finally)r+=this.finally.render(e);return r}optimizeNodes(){var e,r;super.optimizeNodes();(e=this.catch)===null||e===void 0?void 0:e.optimizeNodes();(r=this.finally)===null||r===void 0?void 0:r.optimizeNodes();return this}optimizeNames(e,r){var n,i;super.optimizeNames(e,r);(n=this.catch)===null||n===void 0?void 0:n.optimizeNames(e,r);(i=this.finally)===null||i===void 0?void 0:i.optimizeNames(e,r);return this}get names(){const e=super.names;if(this.catch)pm(e,this.catch.names);if(this.finally)pm(e,this.finally.names);return e}};var r6=class extends Kc{static{o(this,"Catch")}constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};r6.kind="catch";var n6=class extends Kc{static{o(this,"Finally")}render(e){return"finally"+super.render(e)}};n6.kind="finally";var $B=class{static{o(this,"CodeGen")}constructor(e,r={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...r,_n:r.lines?"\n":""};this._extScope=e;this._scope=new Au.Scope({parent:e});this._nodes=[new IB]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){const n=this._extScope.value(e,r);const i=this._values[n.prefix]||(this._values[n.prefix]=new Set);i.add(n);return n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){const s=this._scope.toName(r);if(n!==void 0&&i)this._constants[s.str]=n;this._leafNode(new AB(e,s,n));return s}const(e,r,n){return this._def(Au.varKinds.const,e,r,n)}let(e,r,n){return this._def(Au.varKinds.let,e,r,n)}var(e,r,n){return this._def(Au.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new o7(e,r,n))}add(e,r){return this._leafNode(new xB(e,Yt.operators.ADD,r))}code(e){if(typeof e=="function")e();else if(e!==Er.nil)this._leafNode(new NB(e));return this}object(...e){const r=["{"];for(const[n,i]of e){if(r.length>1)r.push(",");r.push(n);if(n!==i||this.opts.es5){r.push(":");(0,Er.addCodeArg)(r,i)}}r.push("}");return new Er._Code(r)}if(e,r,n){this._blockNode(new cm(e));if(r&&n){this.code(r).else().code(n).endIf()}else if(r){this.code(r).endIf()}else if(n){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(e){return this._elseNode(new cm(e))}else(){return this._elseNode(new jg)}endIf(){return this._endBlockNode(cm,jg)}_for(e,r){this._blockNode(e);if(r)this.code(r).endFor();return this}for(e,r){return this._for(new PB(e),r)}forRange(e,r,n,i,s=this.opts.es5?Au.varKinds.var:Au.varKinds.let){const a=this._scope.toName(e);return this._for(new DB(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Au.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const a=r instanceof Er.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Er._)`${a}.length`,u=>{this.var(s,(0,Er._)`${a}[${u}]`);n(s)})}return this._for(new u7("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Au.varKinds.var:Au.varKinds.const){if(this.opts.ownProperties){return this.forOf(e,(0,Er._)`Object.keys(${r})`,n)}const s=this._scope.toName(e);return this._for(new u7("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(dm)}label(e){return this._leafNode(new CB(e))}break(e){return this._leafNode(new RB(e))}return(e){const r=new t6;this._blockNode(r);this.code(e);if(r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(t6)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new kB;this._blockNode(i);this.code(e);if(r){const s=this.name("e");this._currNode=i.catch=new r6(s);r(s)}if(n){this._currNode=i.finally=new n6;this.code(n)}return this._endBlockNode(r6,n6)}throw(e){return this._leafNode(new OB(e))}block(e,r){this._blockStarts.push(this._nodes.length);if(e)this.code(e).endBlock(r);return this}endBlock(e){const r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e){throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`)}this._nodes.length=r;return this}func(e,r=Er.nil,n,i){this._blockNode(new e6(e,r,n));if(i)this.code(i).endFunc();return this}endFunc(){return this._endBlockNode(e6)}optimize(e=1){while(e-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(e){this._currNode.nodes.push(e);return this}_blockNode(e){this._currNode.nodes.push(e);this._nodes.push(e)}_endBlockNode(e,r){const n=this._currNode;if(n instanceof e||r&&n instanceof r){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){const r=this._currNode;if(!(r instanceof cm)){throw new Error('CodeGen: "else" without "if"')}this._currNode=r.else=e;return this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const r=this._nodes;r[r.length-1]=e}};Yt.CodeGen=$B;function pm(t,e){for(const r in e)t[r]=(t[r]||0)+(e[r]||0);return t}o(pm,"addNames");function l7(t,e){return e instanceof Er._CodeOrName?pm(t,e.names):t}o(l7,"addExprNames");function Ug(t,e,r){if(t instanceof Er.Name)return n(t);if(!i(t))return t;return new Er._Code(t._items.reduce((s,a)=>{if(a instanceof Er.Name)a=n(a);if(a instanceof Er._Code)s.push(...a._items);else s.push(a);return s},[]));function n(s){const a=r[s.str];if(a===void 0||e[s.str]!==1)return s;delete e[s.str];return a}o(n,"replaceName");function i(s){return s instanceof Er._Code&&s._items.some(a=>a instanceof Er.Name&&e[a.str]===1&&r[a.str]!==void 0)}o(i,"canOptimize")}o(Ug,"optimizeExpr");function x8t(t,e){for(const r in e)t[r]=(t[r]||0)-(e[r]||0)}o(x8t,"subtractNames");function Ebe(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Er._)`!${LB(t)}`}o(Ebe,"not");Yt.not=Ebe;var C8t=bbe(Yt.operators.AND);function R8t(...t){return t.reduce(C8t)}o(R8t,"and");Yt.and=R8t;var O8t=bbe(Yt.operators.OR);function N8t(...t){return t.reduce(O8t)}o(N8t,"or");Yt.or=N8t;function bbe(t){return(e,r)=>e===Er.nil?r:r===Er.nil?e:(0,Er._)`${LB(e)} ${t} ${LB(r)}`}o(bbe,"mappend");function LB(t){return t instanceof Er.Name?t:(0,Er._)`(${t})`}o(LB,"par")});var sr=_(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:true});Wt.checkStrictMode=Wt.getErrorPath=Wt.Type=Wt.useFunc=Wt.setEvaluated=Wt.evaluatedPropsToName=Wt.mergeEvaluated=Wt.eachItem=Wt.unescapeJsonPointer=Wt.escapeJsonPointer=Wt.escapeFragment=Wt.unescapeFragment=Wt.schemaRefOrVal=Wt.schemaHasRulesButRef=Wt.schemaHasRules=Wt.checkUnknownRules=Wt.alwaysValidSchema=Wt.toHash=void 0;var hn=Pt();var I8t=XE();function P8t(t){const e={};for(const r of t)e[r]=true;return e}o(P8t,"toHash");Wt.toHash=P8t;function D8t(t,e){if(typeof e=="boolean")return e;if(Object.keys(e).length===0)return true;Tbe(t,e);return!Abe(e,t.self.RULES.all)}o(D8t,"alwaysValidSchema");Wt.alwaysValidSchema=D8t;function Tbe(t,e=t.schema){const{opts:r,self:n}=t;if(!r.strictSchema)return;if(typeof e==="boolean")return;const i=n.RULES.keywords;for(const s in e){if(!i[s])Obe(t,`unknown keyword: "${s}"`)}}o(Tbe,"checkUnknownRules");Wt.checkUnknownRules=Tbe;function Abe(t,e){if(typeof t=="boolean")return!t;for(const r in t)if(e[r])return true;return false}o(Abe,"schemaHasRules");Wt.schemaHasRules=Abe;function k8t(t,e){if(typeof t=="boolean")return!t;for(const r in t)if(r!=="$ref"&&e.all[r])return true;return false}o(k8t,"schemaHasRulesButRef");Wt.schemaHasRulesButRef=k8t;function $8t({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,hn._)`${r}`}return(0,hn._)`${t}${e}${(0,hn.getProperty)(n)}`}o($8t,"schemaRefOrVal");Wt.schemaRefOrVal=$8t;function L8t(t){return xbe(decodeURIComponent(t))}o(L8t,"unescapeFragment");Wt.unescapeFragment=L8t;function q8t(t){return encodeURIComponent(qB(t))}o(q8t,"escapeFragment");Wt.escapeFragment=q8t;function qB(t){if(typeof t=="number")return`${t}`;return t.replace(/~/g,"~0").replace(/\//g,"~1")}o(qB,"escapeJsonPointer");Wt.escapeJsonPointer=qB;function xbe(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(xbe,"unescapeJsonPointer");Wt.unescapeJsonPointer=xbe;function j8t(t,e){if(Array.isArray(t)){for(const r of t)e(r)}else{e(t)}}o(j8t,"eachItem");Wt.eachItem=j8t;function wbe({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{const l=a===void 0?s:a instanceof hn.Name?(s instanceof hn.Name?t(i,s,a):e(i,s,a),a):s instanceof hn.Name?(e(i,a,s),s):r(s,a);return u===hn.Name&&!(l instanceof hn.Name)?n(i,l):l}}o(wbe,"makeMergeEvaluated");Wt.mergeEvaluated={props:wbe({mergeNames:(t,e,r)=>t.if((0,hn._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,hn._)`${e} === true`,()=>t.assign(r,true),()=>t.assign(r,(0,hn._)`${r} || {}`).code((0,hn._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,hn._)`${r} !== true`,()=>{if(e===true){t.assign(r,true)}else{t.assign(r,(0,hn._)`${r} || {}`);jB(t,r,e)}}),mergeValues:(t,e)=>t===true?true:{...t,...e},resultToName:Cbe}),items:wbe({mergeNames:(t,e,r)=>t.if((0,hn._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,hn._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,hn._)`${r} !== true`,()=>t.assign(r,e===true?true:(0,hn._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===true?true:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Cbe(t,e){if(e===true)return t.var("props",true);const r=t.var("props",(0,hn._)`{}`);if(e!==void 0)jB(t,r,e);return r}o(Cbe,"evaluatedPropsToName");Wt.evaluatedPropsToName=Cbe;function jB(t,e,r){Object.keys(r).forEach(n=>t.assign((0,hn._)`${e}${(0,hn.getProperty)(n)}`,true))}o(jB,"setEvaluated");Wt.setEvaluated=jB;var Sbe={};function U8t(t,e){return t.scopeValue("func",{ref:e,code:Sbe[e.code]||(Sbe[e.code]=new I8t._Code(e.code))})}o(U8t,"useFunc");Wt.useFunc=U8t;var Rbe;(function(t){t[t["Num"]=0]="Num";t[t["Str"]=1]="Str"})(Rbe=Wt.Type||(Wt.Type={}));function F8t(t,e,r){if(t instanceof hn.Name){const n=e===Rbe.Num;return r?n?(0,hn._)`"[" + ${t} + "]"`:(0,hn._)`"['" + ${t} + "']"`:n?(0,hn._)`"/" + ${t}`:(0,hn._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,hn.getProperty)(t).toString():"/"+qB(t)}o(F8t,"getErrorPath");Wt.getErrorPath=F8t;function Obe(t,e,r=t.opts.strictSchema){if(!r)return;e=`strict mode: ${e}`;if(r===true)throw new Error(e);t.self.logger.warn(e)}o(Obe,"checkStrictMode");Wt.checkStrictMode=Obe});var Oo=_(UB=>{"use strict";Object.defineProperty(UB,"__esModule",{value:true});var Es=Pt();var M8t={data:new Es.Name("data"),valCxt:new Es.Name("valCxt"),instancePath:new Es.Name("instancePath"),parentData:new Es.Name("parentData"),parentDataProperty:new Es.Name("parentDataProperty"),rootData:new Es.Name("rootData"),dynamicAnchors:new Es.Name("dynamicAnchors"),vErrors:new Es.Name("vErrors"),errors:new Es.Name("errors"),this:new Es.Name("this"),self:new Es.Name("self"),scope:new Es.Name("scope"),json:new Es.Name("json"),jsonPos:new Es.Name("jsonPos"),jsonLen:new Es.Name("jsonLen"),jsonPart:new Es.Name("jsonPart")};UB.default=M8t});var i6=_(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:true});bs.extendErrors=bs.resetErrorsCount=bs.reportExtraError=bs.reportError=bs.keyword$DataError=bs.keywordError=void 0;var Cr=Pt();var d7=sr();var Us=Oo();bs.keywordError={message:({keyword:t})=>(0,Cr.str)`must pass "${t}" keyword validation`};bs.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Cr.str)`"${t}" keyword must be ${e} ($data)`:(0,Cr.str)`"${t}" keyword is invalid ($data)`};function B8t(t,e=bs.keywordError,r,n){const{it:i}=t;const{gen:s,compositeRule:a,allErrors:u}=i;const l=Pbe(t,e,r);if(n!==null&&n!==void 0?n:a||u){Nbe(s,l)}else{Ibe(i,(0,Cr._)`[${l}]`)}}o(B8t,"reportError");bs.reportError=B8t;function V8t(t,e=bs.keywordError,r){const{it:n}=t;const{gen:i,compositeRule:s,allErrors:a}=n;const u=Pbe(t,e,r);Nbe(i,u);if(!(s||a)){Ibe(n,Us.default.vErrors)}}o(V8t,"reportExtraError");bs.reportExtraError=V8t;function H8t(t,e){t.assign(Us.default.errors,e);t.if((0,Cr._)`${Us.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Cr._)`${Us.default.vErrors}.length`,e),()=>t.assign(Us.default.vErrors,null)))}o(H8t,"resetErrorsCount");bs.resetErrorsCount=H8t;function z8t({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");const a=t.name("err");t.forRange("i",i,Us.default.errors,u=>{t.const(a,(0,Cr._)`${Us.default.vErrors}[${u}]`);t.if((0,Cr._)`${a}.instancePath === undefined`,()=>t.assign((0,Cr._)`${a}.instancePath`,(0,Cr.strConcat)(Us.default.instancePath,s.errorPath)));t.assign((0,Cr._)`${a}.schemaPath`,(0,Cr.str)`${s.errSchemaPath}/${e}`);if(s.opts.verbose){t.assign((0,Cr._)`${a}.schema`,r);t.assign((0,Cr._)`${a}.data`,n)}})}o(z8t,"extendErrors");bs.extendErrors=z8t;function Nbe(t,e){const r=t.const("err",e);t.if((0,Cr._)`${Us.default.vErrors} === null`,()=>t.assign(Us.default.vErrors,(0,Cr._)`[${r}]`),(0,Cr._)`${Us.default.vErrors}.push(${r})`);t.code((0,Cr._)`${Us.default.errors}++`)}o(Nbe,"addError");function Ibe(t,e){const{gen:r,validateName:n,schemaEnv:i}=t;if(i.$async){r.throw((0,Cr._)`new ${t.ValidationError}(${e})`)}else{r.assign((0,Cr._)`${n}.errors`,e);r.return(false)}}o(Ibe,"returnErrors");var fm={keyword:new Cr.Name("keyword"),schemaPath:new Cr.Name("schemaPath"),params:new Cr.Name("params"),propertyName:new Cr.Name("propertyName"),message:new Cr.Name("message"),schema:new Cr.Name("schema"),parentSchema:new Cr.Name("parentSchema")};function Pbe(t,e,r){const{createErrors:n}=t.it;if(n===false)return(0,Cr._)`{}`;return G8t(t,e,r)}o(Pbe,"errorObjectCode");function G8t(t,e,r={}){const{gen:n,it:i}=t;const s=[K8t(i,r),Y8t(t,r)];W8t(t,e,s);return n.object(...s)}o(G8t,"errorObject");function K8t({errorPath:t},{instancePath:e}){const r=e?(0,Cr.str)`${t}${(0,d7.getErrorPath)(e,d7.Type.Str)}`:t;return[Us.default.instancePath,(0,Cr.strConcat)(Us.default.instancePath,r)]}o(K8t,"errorInstancePath");function Y8t({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Cr.str)`${e}/${t}`;if(r){i=(0,Cr.str)`${i}${(0,d7.getErrorPath)(r,d7.Type.Str)}`}return[fm.schemaPath,i]}o(Y8t,"errorSchemaPath");function W8t(t,{params:e,message:r},n){const{keyword:i,data:s,schemaValue:a,it:u}=t;const{opts:l,propertyName:c,topSchemaRef:d,schemaPath:p}=u;n.push([fm.keyword,i],[fm.params,typeof e=="function"?e(t):e||(0,Cr._)`{}`]);if(l.messages){n.push([fm.message,typeof r=="function"?r(t):r])}if(l.verbose){n.push([fm.schema,a],[fm.parentSchema,(0,Cr._)`${d}${p}`],[Us.default.data,s])}if(c)n.push([fm.propertyName,c])}o(W8t,"extraErrorProps")});var kbe=_(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:true});Fg.boolOrEmptySchema=Fg.topBoolOrEmptySchema=void 0;var J8t=i6();var Q8t=Pt();var X8t=Oo();var Z8t={message:"boolean schema is false"};function e5t(t){const{gen:e,schema:r,validateName:n}=t;if(r===false){Dbe(t,false)}else if(typeof r=="object"&&r.$async===true){e.return(X8t.default.data)}else{e.assign((0,Q8t._)`${n}.errors`,null);e.return(true)}}o(e5t,"topBoolOrEmptySchema");Fg.topBoolOrEmptySchema=e5t;function t5t(t,e){const{gen:r,schema:n}=t;if(n===false){r.var(e,false);Dbe(t)}else{r.var(e,true)}}o(t5t,"boolOrEmptySchema");Fg.boolOrEmptySchema=t5t;function Dbe(t,e){const{gen:r,data:n}=t;const i={gen:r,keyword:"false schema",data:n,schema:false,schemaCode:false,schemaValue:false,params:{},it:t};(0,J8t.reportError)(i,Z8t,void 0,e)}o(Dbe,"falseSchemaError")});var FB=_(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:true});Mg.getRules=Mg.isJSONType=void 0;var r5t=["string","number","integer","boolean","null","object","array"];var n5t=new Set(r5t);function i5t(t){return typeof t=="string"&&n5t.has(t)}o(i5t,"isJSONType");Mg.isJSONType=i5t;function s5t(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:true,boolean:true,null:true},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}o(s5t,"getRules");Mg.getRules=s5t});var MB=_(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:true});Fp.shouldUseRule=Fp.shouldUseGroup=Fp.schemaHasRulesForType=void 0;function a5t({schema:t,self:e},r){const n=e.RULES.types[r];return n&&n!==true&&$be(t,n)}o(a5t,"schemaHasRulesForType");Fp.schemaHasRulesForType=a5t;function $be(t,e){return e.rules.some(r=>Lbe(t,r))}o($be,"shouldUseGroup");Fp.shouldUseGroup=$be;function Lbe(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}o(Lbe,"shouldUseRule");Fp.shouldUseRule=Lbe});var a6=_(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:true});es.reportTypeError=es.checkDataTypes=es.checkDataType=es.coerceAndCheckDataType=es.getJSONTypes=es.getSchemaTypes=es.DataType=void 0;var o5t=FB();var u5t=MB();var l5t=i6();var Lt=Pt();var qbe=sr();var s6;(function(t){t[t["Correct"]=0]="Correct";t[t["Wrong"]=1]="Wrong"})(s6=es.DataType||(es.DataType={}));function c5t(t){const e=jbe(t.type);const r=e.includes("null");if(r){if(t.nullable===false)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0){throw new Error('"nullable" cannot be used without "type"')}if(t.nullable===true)e.push("null")}return e}o(c5t,"getSchemaTypes");es.getSchemaTypes=c5t;function jbe(t){const e=Array.isArray(t)?t:t?[t]:[];if(e.every(o5t.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}o(jbe,"getJSONTypes");es.getJSONTypes=jbe;function d5t(t,e){const{gen:r,data:n,opts:i}=t;const s=p5t(e,i.coerceTypes);const a=e.length>0&&!(s.length===0&&e.length===1&&(0,u5t.schemaHasRulesForType)(t,e[0]));if(a){const u=VB(e,n,i.strictNumbers,s6.Wrong);r.if(u,()=>{if(s.length)f5t(t,e,s);else HB(t)})}return a}o(d5t,"coerceAndCheckDataType");es.coerceAndCheckDataType=d5t;var Ube=new Set(["string","number","integer","boolean","null"]);function p5t(t,e){return e?t.filter(r=>Ube.has(r)||e==="array"&&r==="array"):[]}o(p5t,"coerceToTypes");function f5t(t,e,r){const{gen:n,data:i,opts:s}=t;const a=n.let("dataType",(0,Lt._)`typeof ${i}`);const u=n.let("coerced",(0,Lt._)`undefined`);if(s.coerceTypes==="array"){n.if((0,Lt._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Lt._)`${i}[0]`).assign(a,(0,Lt._)`typeof ${i}`).if(VB(e,i,s.strictNumbers),()=>n.assign(u,i)))}n.if((0,Lt._)`${u} !== undefined`);for(const c of r){if(Ube.has(c)||c==="array"&&s.coerceTypes==="array"){l(c)}}n.else();HB(t);n.endIf();n.if((0,Lt._)`${u} !== undefined`,()=>{n.assign(i,u);h5t(t,u)});function l(c){switch(c){case"string":n.elseIf((0,Lt._)`${a} == "number" || ${a} == "boolean"`).assign(u,(0,Lt._)`"" + ${i}`).elseIf((0,Lt._)`${i} === null`).assign(u,(0,Lt._)`""`);return;case"number":n.elseIf((0,Lt._)`${a} == "boolean" || ${i} === null
395
+ `}).join("")}getCanonicalRequest(e,r,n,i,s,a){return[e,r,n,i,s,a||"UNSIGNED-PAYLOAD"].join("\n")}getCanonicalQueryParams(e){return(0,Np.objectEntries)(e).map(([r,n])=>[(0,Np.encodeURI)(r,true),(0,Np.encodeURI)(n,true)]).sort((r,n)=>r[0]<n[0]?-1:1).map(([r,n])=>`${r}=${n}`).join("&")}getResourcePath(e,r,n){if(e){return"/"+(n||"")}else if(n){return`/${r}/${n}`}else{return`/${r}`}}parseExpires(e,r=new Date){const n=new Date(e).valueOf();if(isNaN(n)){throw new Error(GEe.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(n<r.valueOf()){throw new Error(GEe.ExceptionMessages.EXPIRATION_DATE_PAST)}return Math.floor(n/1e3)}parseAccessibleAt(e){const r=new Date(e||new Date).valueOf();if(isNaN(r)){throw new Error(qE.ACCESSIBLE_DATE_INVALID)}return Math.floor(r/1e3)}};Oi.URLSigner=jM;var jE=class extends Error{static{o(this,"SigningError")}constructor(){super(...arguments);this.name="SigningError"}};Oi.SigningError=jE});var UE=_(vs=>{"use strict";var WEe=vs&&vs.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r};var kT=vs&&vs.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var Ip;Object.defineProperty(vs,"__esModule",{value:true});vs.CRC32C_EXTENSION_TABLE=vs.CRC32C_EXTENSIONS=vs.CRC32C_EXCEPTION_MESSAGES=vs.CRC32C_DEFAULT_VALIDATOR_GENERATOR=vs.CRC32C=void 0;var T6t=require("fs");var FM=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697];vs.CRC32C_EXTENSIONS=FM;var JEe=new Int32Array(FM);vs.CRC32C_EXTENSION_TABLE=JEe;var A6t=o(()=>new Pg,"CRC32C_DEFAULT_VALIDATOR_GENERATOR");vs.CRC32C_DEFAULT_VALIDATOR_GENERATOR=A6t;var $T={INVALID_INIT_BASE64_RANGE:t=>`base64-encoded data expected to equal 4 bytes, not ${t}`,INVALID_INIT_BUFFER_LENGTH:t=>`Buffer expected to equal 4 bytes, not ${t}`,INVALID_INIT_INTEGER:t=>`Number expected to be a safe, unsigned 32-bit integer, not ${t}`};vs.CRC32C_EXCEPTION_MESSAGES=$T;var Pg=class t{static{o(this,"CRC32C")}constructor(e=0){Ip.set(this,0);WEe(this,Ip,e,"f")}update(e){let r=kT(this,Ip,"f")^4294967295;for(const n of e){const i=t.CRC32C_EXTENSION_TABLE[(n^r)&255];r=i^r>>>8}WEe(this,Ip,r^4294967295,"f")}validate(e){if(typeof e==="number"){return e===kT(this,Ip,"f")}else if(typeof e==="string"){return e===this.toString()}else if(Buffer.isBuffer(e)){return Buffer.compare(e,this.toBuffer())===0}else{return e.toString()===this.toString()}}toBuffer(){const e=Buffer.alloc(4);e.writeInt32BE(kT(this,Ip,"f"));return e}toJSON(){return this.toString()}toString(){return this.toBuffer().toString("base64")}valueOf(){return kT(this,Ip,"f")}static fromBuffer(e){let r;if(Buffer.isBuffer(e)){r=e}else if("buffer"in e){r=Buffer.from(e.buffer)}else{r=Buffer.from(e)}if(r.byteLength!==4){throw new RangeError($T.INVALID_INIT_BUFFER_LENGTH(r.byteLength))}return new t(r.readInt32BE())}static async fromFile(e){const r=new t;await new Promise((n,i)=>{(0,T6t.createReadStream)(e).on("data",s=>r.update(s)).on("end",n).on("error",i)});return r}static fromString(e){const r=Buffer.from(e,"base64");if(r.byteLength!==4){throw new RangeError($T.INVALID_INIT_BASE64_RANGE(r.byteLength))}return this.fromBuffer(r)}static fromNumber(e){if(!Number.isSafeInteger(e)||e>2**32||e<-(2**32)){throw new RangeError($T.INVALID_INIT_INTEGER(e))}return new t(e)}static from(e){if(typeof e==="number"){return this.fromNumber(e)}else if(typeof e==="string"){return this.fromString(e)}else if("byteLength"in e){return this.fromBuffer(e)}else{return this.fromString(e.toString())}}};vs.CRC32C=Pg;Ip=new WeakMap;Pg.CRC32C_EXTENSIONS=FM;Pg.CRC32C_EXTENSION_TABLE=JEe});var VM=_(Dp=>{"use strict";var MM=Dp&&Dp.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r};var bl=Dp&&Dp.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var sm;var Pp;var LT;Object.defineProperty(Dp,"__esModule",{value:true});Dp.HashStreamValidator=void 0;var x6t=require("crypto");var C6t=require("stream");var R6t=UE();var QEe=FE();var BM=class extends C6t.Transform{static{o(this,"HashStreamValidator")}constructor(e={}){super();this.updateHashesOnly=false;sm.set(this,void 0);Pp.set(this,void 0);LT.set(this,"");this.crc32cEnabled=!!e.crc32c;this.md5Enabled=!!e.md5;this.updateHashesOnly=!!e.updateHashesOnly;this.crc32cExpected=e.crc32cExpected;this.md5Expected=e.md5Expected;if(this.crc32cEnabled){const r=e.crc32cGenerator||R6t.CRC32C_DEFAULT_VALIDATOR_GENERATOR;MM(this,sm,r(),"f")}if(this.md5Enabled){MM(this,Pp,(0,x6t.createHash)("md5"),"f")}}_flush(e){if(bl(this,Pp,"f")){MM(this,LT,bl(this,Pp,"f").digest("base64"),"f")}if(this.updateHashesOnly){e();return}let r=this.crc32cEnabled||this.md5Enabled;if(this.crc32cEnabled&&this.crc32cExpected){r=!this.test("crc32c",this.crc32cExpected)}if(this.md5Enabled&&this.md5Expected){r=!this.test("md5",this.md5Expected)}if(r){const n=new QEe.RequestError(QEe.FileExceptionMessages.DOWNLOAD_MISMATCH);n.code="CONTENT_DOWNLOAD_MISMATCH";e(n)}else{e()}}_transform(e,r,n){this.push(e,r);try{if(bl(this,sm,"f"))bl(this,sm,"f").update(e);if(bl(this,Pp,"f"))bl(this,Pp,"f").update(e);n()}catch(i){n(i)}}test(e,r){const n=Buffer.isBuffer(r)?r.toString("base64"):r;if(e==="crc32c"&&bl(this,sm,"f")){return bl(this,sm,"f").validate(n)}if(e==="md5"&&bl(this,Pp,"f")){return bl(this,LT,"f")===n}return false}};Dp.HashStreamValidator=BM;sm=new WeakMap,Pp=new WeakMap,LT=new WeakMap});var FE=_(Mn=>{"use strict";var O6t=Mn&&Mn.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var N6t=Mn&&Mn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var jT=Mn&&Mn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))O6t(e,t,r)}N6t(e,t);return e};var I6t=Mn&&Mn.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var UT=Mn&&Mn.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};var zM;var n6e;Object.defineProperty(Mn,"__esModule",{value:true});Mn.File=Mn.FileExceptionMessages=Mn.RequestError=Mn.STORAGE_POST_POLICY_BASE_URL=Mn.ActionToHTTPMethod=void 0;var kp=xp();var P6t=_l();var D6t=UT(_Ee());var k6t=jT(require("crypto"));var XEe=jT(require("fs"));var $6t=UT(CEe());var ZEe=jT(HEe());var ME=require("stream");var e6e=jT(require("zlib"));var To=Ig();var BE=FT();var L6t=PM();var HM=UM();var Mc=rm();var q6t=UT(gM());var Bc=yl();var t6e=VM();var j6t=UT(OE());var GM;(function(t){t["read"]="GET";t["write"]="PUT";t["delete"]="DELETE";t["resumable"]="POST"})(GM||(Mn.ActionToHTTPMethod=GM={}));Mn.STORAGE_POST_POLICY_BASE_URL="https://storage.googleapis.com";var U6t=/^gs:\/\/([a-z0-9_.-]+)\/(.+)$/;var VE=class extends Error{static{o(this,"RequestError")}};Mn.RequestError=VE;var r6e=7*24*60*60;var Ao;(function(t){t["EXPIRATION_TIME_NA"]="An expiration time is not available.";t["DESTINATION_NO_NAME"]="Destination file should have a name.";t["INVALID_VALIDATION_FILE_RANGE"]="Cannot use validation with file ranges (start/end).";t["MD5_NOT_AVAILABLE"]="MD5 verification was specified, but is not available for the requested object. MD5 is not available for composite objects.";t["EQUALS_CONDITION_TWO_ELEMENTS"]="Equals condition must be an array of 2 elements.";t["STARTS_WITH_TWO_ELEMENTS"]="StartsWith condition must be an array of 2 elements.";t["CONTENT_LENGTH_RANGE_MIN_MAX"]="ContentLengthRange must have numeric min & max fields.";t["DOWNLOAD_MISMATCH"]="The downloaded data did not match the data from the server. To be sure the content is the same, you should download the file again.";t["UPLOAD_MISMATCH_DELETE_FAIL"]="The uploaded data did not match the data from the server.\n As a precaution, we attempted to delete the file, but it was not successful.\n To be sure the content is the same, you should try removing the file manually,\n then uploading the file again.\n \n\nThe delete attempt failed with this message:\n\n ";t["UPLOAD_MISMATCH"]="The uploaded data did not match the data from the server.\n As a precaution, the file has been deleted.\n To be sure the content is the same, you should try uploading the file again."})(Ao||(Mn.FileExceptionMessages=Ao={}));var qT=class t extends kp.ServiceObject{static{o(this,"File")}constructor(e,r,n={}){var i,s;const a={};let u;if(n.generation!==null){if(typeof n.generation==="string"){u=Number(n.generation)}else{u=n.generation}if(!isNaN(u)){a.generation=u}}Object.assign(a,n.preconditionOpts);const l=n.userProject||e.userProject;if(typeof l==="string"){a.userProject=l}const c={delete:{reqOpts:{qs:a}},exists:{reqOpts:{qs:a}},get:{reqOpts:{qs:a}},getMetadata:{reqOpts:{qs:a}},setMetadata:{reqOpts:{qs:a}}};super({parent:e,baseUrl:"/o",id:encodeURIComponent(r),methods:c});zM.add(this);this.bucket=e;this.storage=e.parent;if(n.generation!==null){let d;if(typeof n.generation==="string"){d=Number(n.generation)}else{d=n.generation}if(!isNaN(d)){this.generation=d}}this.kmsKeyName=n.kmsKeyName;this.userProject=l;this.name=r;if(n.encryptionKey){this.setEncryptionKey(n.encryptionKey)}this.acl=new L6t.Acl({request:this.request.bind(this),pathPrefix:"/acl"});this.crc32cGenerator=n.crc32cGenerator||this.bucket.crc32cGenerator;this.instanceRetryValue=(s=(i=this.storage)===null||i===void 0?void 0:i.retryOptions)===null||s===void 0?void 0:s.autoRetry;this.instancePreconditionOpts=n===null||n===void 0?void 0:n.preconditionOpts}get cloudStorageURI(){const e=this.bucket.cloudStorageURI;e.pathname=this.name;return e}shouldRetryBasedOnPreconditionAndIdempotencyStrat(e){var r;return!((e===null||e===void 0?void 0:e.ifGenerationMatch)===void 0&&((r=this.instancePreconditionOpts)===null||r===void 0?void 0:r.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryNever)}copy(e,r,n){var i,s;const a=new Error(Ao.DESTINATION_NO_NAME);if(!e){throw a}let u={};if(typeof r==="function"){n=r}else if(r){u={...r}}n=n||kp.util.noop;let l;let c;let d;if(typeof e==="string"){const h=U6t.exec(e);if(h!==null&&h.length===3){l=this.storage.bucket(h[1]);c=h[2]}else{l=this.bucket;c=e}}else if(e instanceof BE.Bucket){l=e;c=this.name}else if(e instanceof t){l=e.bucket;c=e.name;d=e}else{throw a}const p={};if(this.generation!==void 0){p.sourceGeneration=this.generation}if(u.token!==void 0){p.rewriteToken=u.token}if(u.userProject!==void 0){p.userProject=u.userProject;delete u.userProject}if(u.predefinedAcl!==void 0){p.destinationPredefinedAcl=u.predefinedAcl;delete u.predefinedAcl}d=d||l.file(c);const f={};if(this.encryptionKey!==void 0){f["x-goog-copy-source-encryption-algorithm"]="AES256";f["x-goog-copy-source-encryption-key"]=this.encryptionKeyBase64;f["x-goog-copy-source-encryption-key-sha256"]=this.encryptionKeyHash}if(d.encryptionKey!==void 0){this.setEncryptionKey(d.encryptionKey)}else if(u.destinationKmsKeyName!==void 0){p.destinationKmsKeyName=u.destinationKmsKeyName;delete u.destinationKmsKeyName}else if(d.kmsKeyName!==void 0){p.destinationKmsKeyName=d.kmsKeyName}if(p.destinationKmsKeyName){this.kmsKeyName=p.destinationKmsKeyName;const h=this.interceptors.indexOf(this.encryptionKeyInterceptor);if(h>-1){this.interceptors.splice(h,1)}}if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(u===null||u===void 0?void 0:u.preconditionOpts)){this.storage.retryOptions.autoRetry=false}if(((i=u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)!==void 0){p.ifGenerationMatch=(s=u.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch;delete u.preconditionOpts}this.request({method:"POST",uri:`/rewriteTo/b/${l.name}/o/${encodeURIComponent(d.name)}`,qs:p,json:u,headers:f},(h,m)=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue;if(h){n(h,null,m);return}if(m.rewriteToken){const g={token:m.rewriteToken};if(p.userProject){g.userProject=p.userProject}if(p.destinationKmsKeyName){g.destinationKmsKeyName=p.destinationKmsKeyName}this.copy(d,g,n);return}n(null,d,m)})}createReadStream(e={}){e=Object.assign({decompress:true},e);const r=typeof e.start==="number"||typeof e.end==="number";const n=e.end<0;let i=void 0;let s=void 0;const a=new Bc.PassThroughShim;let u=true;let l=false;if(typeof e.validation==="string"){const h=e.validation.toLowerCase().trim();u=h==="crc32c";l=h==="md5"}else if(e.validation===false){u=false}const c=!r&&(u||l);if(r){if(typeof e.validation==="string"||e.validation===true){throw new Error(Ao.INVALID_VALIDATION_FILE_RANGE)}u=false;l=false}const d=o(h=>{if(h){if(s===null||s===void 0?void 0:s.agent){s.agent.destroy()}a.destroy(h)}},"onComplete");const p=o((h,m,g)=>{if(h){this.getBufferFromReadable(g).then(S=>{h.message=S.toString("utf8");a.destroy(h)});return}s=g.request;const y=g.toJSON().headers;const v=y["content-encoding"]==="gzip";const w={};const E=y["x-goog-stored-content-encoding"]==="gzip"&&v||y["x-goog-stored-content-encoding"]==="identity";const b=[];if(c){if(typeof y["x-goog-hash"]==="string"){y["x-goog-hash"].split(",").forEach(S=>{const T=S.indexOf("=");const A=S.substring(0,T);const R=S.substring(T+1);w[A]=R})}i=new t6e.HashStreamValidator({crc32c:u,md5:l,crc32cGenerator:this.crc32cGenerator,crc32cExpected:w.crc32c,md5Expected:w.md5})}if(l&&!w.md5){const S=new VE(Ao.MD5_NOT_AVAILABLE);S.code="MD5_NOT_AVAILABLE";a.destroy(S);return}if(E&&c&&i){b.push(i)}if(v&&e.decompress){b.push(e6e.createGunzip())}(0,ME.pipeline)(g,...b,a,d)},"onResponse");const f=o(()=>{const h={alt:"media"};if(this.generation){h.generation=this.generation}if(e.userProject){h.userProject=e.userProject}const m={"Accept-Encoding":"gzip","Cache-Control":"no-store"};if(r){const y=typeof e.start==="number"?e.start:"0";const v=typeof e.end==="number"?e.end:"";m.Range=`bytes=${n?v:`${y}-${v}`}`}const g={uri:"",headers:m,qs:h};if(e[Mc.GCCL_GCS_CMD_KEY]){g[Mc.GCCL_GCS_CMD_KEY]=e[Mc.GCCL_GCS_CMD_KEY]}this.requestStream(g).on("error",y=>{a.destroy(y)}).on("response",y=>{a.emit("response",y);kp.util.handleResp(null,y,null,p)}).resume()},"makeRequest");a.on("reading",f);return a}createResumableUpload(e,r){var n,i;const s=typeof e==="object"?e:{};r=typeof e==="function"?e:r;const a=this.storage.retryOptions;if(((n=s===null||s===void 0?void 0:s.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&((i=this.instancePreconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryNever){a.autoRetry=false}ZEe.createURI({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((u,l)=>l(u),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:s.metadata,offset:s.offset,origin:s.origin,predefinedAcl:s.predefinedAcl,private:s.private,public:s.public,userProject:s.userProject||this.userProject,retryOptions:a,params:(s===null||s===void 0?void 0:s.preconditionOpts)||this.instancePreconditionOpts,[Mc.GCCL_GCS_CMD_KEY]:s[Mc.GCCL_GCS_CMD_KEY]},r);this.storage.retryOptions.autoRetry=this.instanceRetryValue}createWriteStream(e={}){var r;(r=e.metadata)!==null&&r!==void 0?r:e.metadata={};if(e.contentType){e.metadata.contentType=e.contentType}if(!e.metadata.contentType||e.metadata.contentType==="auto"){const f=$6t.default.getType(this.name);if(f){e.metadata.contentType=f}}let n=e.gzip;if(n==="auto"){n=(0,D6t.default)(e.metadata.contentType||"")}if(n){e.metadata.contentEncoding="gzip"}let i=true;let s=false;if(typeof e.validation==="string"){e.validation=e.validation.toLowerCase();i=e.validation==="crc32c";s=e.validation==="md5"}else if(e.validation===false){i=false}let a=o(f=>{u.destroy(f||void 0)},"pipelineCallback");const u=new ME.Writable({final(f){a=f;l.end()},write(f,h,m){l.write(f,h,m)}});const l=new Bc.PassThroughShim;const c=new t6e.HashStreamValidator({crc32c:i,md5:s,crc32cGenerator:this.crc32cGenerator,updateHashesOnly:true});const d=(0,q6t.default)();let p=false;l.on("reading",()=>u.emit("reading"));l.on("writing",()=>u.emit("writing"));d.on("progress",f=>u.emit("progress",f));d.on("response",f=>u.emit("response",f));d.once("metadata",()=>{p=true});u.on("writing",()=>{if(e.resumable===false){this.startSimpleUpload_(d,e)}else{this.startResumableUpload_(d,e)}(0,ME.pipeline)(l,n?e6e.createGzip():new ME.PassThrough,c,d,async f=>{if(f){return a(f)}if(!p){try{await new Promise((h,m)=>{d.once("metadata",h);d.once("error",m)})}catch(h){return a(h)}}try{await I6t(this,zM,"m",n6e).call(this,c,{crc32c:i,md5:s});a()}catch(h){a(h)}})});return u}delete(e,r){const n=typeof e==="object"?e:{};r=typeof e==="function"?e:r;this.disableAutoRetryConditionallyIdempotent_(this.methods.delete,BE.AvailableServiceObjectMethods.delete,n);super.delete(n).then(i=>r(null,...i)).catch(r).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}download(e,r){let n;if(typeof e==="function"){r=e;n={}}else{n=e}let i=false;const s=o((...c)=>{if(!i)r(...c);i=true},"callback");const a=n.destination;delete n.destination;const u=this.createReadStream(n);let l=false;if(a){u.on("error",s).once("data",c=>{l=true;const d=XEe.createWriteStream(a);d.write(c);u.pipe(d).on("error",s).on("finish",s)}).on("end",()=>{if(!l){const c=Buffer.alloc(0);try{XEe.writeFileSync(a,c);s(null,c)}catch(d){s(d,c)}}})}else{this.getBufferFromReadable(u).then(c=>s===null||s===void 0?void 0:s(null,c)).catch(s)}}setEncryptionKey(e){this.encryptionKey=e;this.encryptionKeyBase64=Buffer.from(e).toString("base64");this.encryptionKeyHash=k6t.createHash("sha256").update(this.encryptionKeyBase64,"base64").digest("base64");this.encryptionKeyInterceptor={request:r=>{r.headers=r.headers||{};r.headers["x-goog-encryption-algorithm"]="AES256";r.headers["x-goog-encryption-key"]=this.encryptionKeyBase64;r.headers["x-goog-encryption-key-sha256"]=this.encryptionKeyHash;return r}};this.interceptors.push(this.encryptionKeyInterceptor);return this}getExpirationDate(e){this.getMetadata((r,n,i)=>{if(r){e(r,null,i);return}if(!n.retentionExpirationTime){const s=new Error(Ao.EXPIRATION_TIME_NA);e(s,null,i);return}e(null,new Date(n.retentionExpirationTime),i)})}generateSignedPostPolicyV2(e,r){const n=(0,Bc.normalize)(e,r);let i=n.options;const s=n.callback;const a=new Date(i.expires);if(isNaN(a.getTime())){throw new Error(To.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(a.valueOf()<Date.now()){throw new Error(To.ExceptionMessages.EXPIRATION_DATE_PAST)}i=Object.assign({},i);const u=[["eq","$key",this.name],{bucket:this.bucket.name}];if(Array.isArray(i.equals)){if(!Array.isArray(i.equals[0])){i.equals=[i.equals]}i.equals.forEach(p=>{if(!Array.isArray(p)||p.length!==2){throw new Error(Ao.EQUALS_CONDITION_TWO_ELEMENTS)}u.push(["eq",p[0],p[1]])})}if(Array.isArray(i.startsWith)){if(!Array.isArray(i.startsWith[0])){i.startsWith=[i.startsWith]}i.startsWith.forEach(p=>{if(!Array.isArray(p)||p.length!==2){throw new Error(Ao.STARTS_WITH_TWO_ELEMENTS)}u.push(["starts-with",p[0],p[1]])})}if(i.acl){u.push({acl:i.acl})}if(i.successRedirect){u.push({success_action_redirect:i.successRedirect})}if(i.successStatus){u.push({success_action_status:i.successStatus})}if(i.contentLengthRange){const p=i.contentLengthRange.min;const f=i.contentLengthRange.max;if(typeof p!=="number"||typeof f!=="number"){throw new Error(Ao.CONTENT_LENGTH_RANGE_MIN_MAX)}u.push(["content-length-range",p,f])}const l={expiration:a.toISOString(),conditions:u};const c=JSON.stringify(l);const d=Buffer.from(c).toString("base64");this.storage.authClient.sign(d).then(p=>{s(null,{string:c,base64:d,signature:p})},p=>{s(new HM.SigningError(p.message))})}generateSignedPostPolicyV4(e,r){const n=(0,Bc.normalize)(e,r);let i=n.options;const s=n.callback;const a=new Date(i.expires);if(isNaN(a.getTime())){throw new Error(To.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(a.valueOf()<Date.now()){throw new Error(To.ExceptionMessages.EXPIRATION_DATE_PAST)}if(a.valueOf()-Date.now()>r6e*1e3){throw new Error(`Max allowed expiration is seven days (${r6e} seconds).`)}i=Object.assign({},i);let u=Object.assign({},i.fields);const l=new Date;const c=(0,Bc.formatAsUTCISO)(l,true);const d=(0,Bc.formatAsUTCISO)(l);const p=o(async()=>{const{client_email:f}=await this.storage.authClient.getCredentials();const h=`${f}/${d}/auto/storage/goog4_request`;u={...u,bucket:this.bucket.name,key:this.name,"x-goog-date":c,"x-goog-credential":h,"x-goog-algorithm":"GOOG4-RSA-SHA256"};const m=i.conditions||[];Object.entries(u).forEach(([E,b])=>{if(!E.startsWith("x-ignore-")){m.push({[E]:b})}});delete u.bucket;const g=(0,Bc.formatAsUTCISO)(a,true,"-",":");const y={conditions:m,expiration:g};const v=(0,Bc.unicodeJSONStringify)(y);const w=Buffer.from(v).toString("base64");try{const E=await this.storage.authClient.sign(w);const b=Buffer.from(E,"base64").toString("hex");u["policy"]=w;u["x-goog-signature"]=b;let S;if(i.virtualHostedStyle){S=`https://${this.bucket.name}.storage.googleapis.com/`}else if(i.bucketBoundHostname){S=`${i.bucketBoundHostname}/`}else{S=`${Mn.STORAGE_POST_POLICY_BASE_URL}/${this.bucket.name}/`}return{url:S,fields:u}}catch(E){throw new HM.SigningError(E.message)}},"sign");p().then(f=>s(null,f),s)}getSignedUrl(e,r){const n=GM[e.action];const i=(0,Bc.objectKeyToLowercase)(e.extensionHeaders||{});if(e.action==="resumable"){i["x-goog-resumable"]="start"}const s=Object.assign({},e.queryParams);if(typeof e.responseType==="string"){s["response-content-type"]=e.responseType}if(typeof e.promptSaveAs==="string"){s["response-content-disposition"]='attachment; filename="'+e.promptSaveAs+'"'}if(typeof e.responseDisposition==="string"){s["response-content-disposition"]=e.responseDisposition}if(this.generation){s["generation"]=this.generation.toString()}const a={method:n,expires:e.expires,accessibleAt:e.accessibleAt,extensionHeaders:i,queryParams:s,contentMd5:e.contentMd5,contentType:e.contentType};if(e.cname){a.cname=e.cname}if(e.version){a.version=e.version}if(e.virtualHostedStyle){a.virtualHostedStyle=e.virtualHostedStyle}if(!this.signer){this.signer=new HM.URLSigner(this.storage.authClient,this.bucket,this)}this.signer.getSignedUrl(a).then(u=>r(null,u),r)}isPublic(e){var r;const n=((r=this.storage)===null||r===void 0?void 0:r.interceptors)||[];const i=this.interceptors||[];const s=n.concat(i);const a=s.reduce((u,l)=>{const c=l.request({uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`});Object.assign(u,c.headers);return u},{});kp.util.makeRequest({method:"GET",uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`,headers:a},{retryOptions:this.storage.retryOptions},u=>{if(u){const l=u;if(l.code===403){e(null,false)}else{e(u)}}else{e(null,true)}})}makePrivate(e,r){var n,i;const s=typeof e==="object"?e:{};r=typeof e==="function"?e:r;const a={predefinedAcl:s.strict?"private":"projectPrivate"};if(((n=s.preconditionOpts)===null||n===void 0?void 0:n.ifMetagenerationMatch)!==void 0){a.ifMetagenerationMatch=(i=s.preconditionOpts)===null||i===void 0?void 0:i.ifMetagenerationMatch;delete s.preconditionOpts}if(s.userProject){a.userProject=s.userProject}const u={...s.metadata,acl:null};this.setMetadata(u,a,r)}makePublic(e){e=e||kp.util.noop;this.acl.add({entity:"allUsers",role:"READER"},(r,n,i)=>{e(r,i)})}publicUrl(){return`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`}move(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||kp.util.noop;this.copy(e,i,(s,a,u)=>{if(s){s.message="file#copy failed with an error - "+s.message;n(s,null,u);return}if(this.name!==a.name||this.bucket.name!==a.bucket.name){this.delete(i,(l,c)=>{if(l){l.message="file#delete failed with an error - "+l.message;n(l,a,c);return}n(null,a,u)})}else{n(null,a,u)}})}rename(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||kp.util.noop;this.move(e,i,n)}request(e,r){return this.parent.request.call(this,e,r)}rotateEncryptionKey(e,r){var n;r=typeof e==="function"?e:r;let i={};if(typeof e==="string"||e instanceof Buffer){i={encryptionKey:e}}else if(typeof e==="object"){i=e}const s=this.bucket.file(this.id,i);const a=((n=i.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)!==void 0?{preconditionOpts:i.preconditionOpts}:{};this.copy(s,a,r)}save(e,r,n){n=typeof r==="function"?r:n;const i=typeof r==="object"?r:{};let s=this.storage.retryOptions.maxRetries;if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(i===null||i===void 0?void 0:i.preconditionOpts)){s=0}const a=(0,j6t.default)(async u=>{return new Promise((l,c)=>{if(s===0){this.storage.retryOptions.autoRetry=false}const d=this.createWriteStream(i);if(i.onUploadProgress){d.on("progress",i.onUploadProgress)}const p=o(f=>{if(this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(f)){return c(f)}return u(f)},"handleError");if(typeof e==="string"||Buffer.isBuffer(e)){d.on("error",p).on("finish",()=>l()).end(e)}else{(0,ME.pipeline)(e,d,f=>{if(f){if(typeof e!=="function"){return u(f)}p(f)}else{l()}})}})},{retries:s,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});if(!n){return a}else{return a.then(()=>{if(n){return n()}}).catch(n)}}setMetadata(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,BE.AvailableServiceObjectMethods.setMetadata,i);super.setMetadata(e,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setStorageClass(e,r,n){n=typeof r==="function"?r:n;const i=typeof r==="object"?r:{};const s={...i,storageClass:e.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(a,u,l)=>{return u+"_"+l}).toUpperCase()};this.copy(this,s,(a,u,l)=>{if(a){n(a,l);return}this.metadata=u.metadata;n(null,l)})}setUserProject(e){this.bucket.setUserProject.call(this,e)}startResumableUpload_(e,r={}){var n;(n=r.metadata)!==null&&n!==void 0?n:r.metadata={};const i=this.storage.retryOptions;if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(r.preconditionOpts)){i.autoRetry=false}const s=ZEe.upload({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((a,u)=>u(a),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:r.metadata,offset:r.offset,predefinedAcl:r.predefinedAcl,private:r.private,public:r.public,uri:r.uri,userProject:r.userProject||this.userProject,retryOptions:{...i},params:(r===null||r===void 0?void 0:r.preconditionOpts)||this.instancePreconditionOpts,chunkSize:r===null||r===void 0?void 0:r.chunkSize,highWaterMark:r===null||r===void 0?void 0:r.highWaterMark,[Mc.GCCL_GCS_CMD_KEY]:r[Mc.GCCL_GCS_CMD_KEY]});s.on("response",a=>{e.emit("response",a)}).on("metadata",a=>{this.metadata=a;e.emit("metadata")}).on("finish",()=>{e.emit("complete")}).on("progress",a=>e.emit("progress",a));e.setWritable(s);this.storage.retryOptions.autoRetry=this.instanceRetryValue}startSimpleUpload_(e,r={}){var n;(n=r.metadata)!==null&&n!==void 0?n:r.metadata={};const i=this.storage.apiEndpoint;const s=this.bucket.name;const a=`${i}/upload/storage/v1/b/${s}/o`;const u={qs:{name:this.name},uri:a,[Mc.GCCL_GCS_CMD_KEY]:r[Mc.GCCL_GCS_CMD_KEY]};if(this.generation!==void 0){u.qs.ifGenerationMatch=this.generation}if(this.kmsKeyName!==void 0){u.qs.kmsKeyName=this.kmsKeyName}if(typeof r.timeout==="number"){u.timeout=r.timeout}if(r.userProject||this.userProject){u.qs.userProject=r.userProject||this.userProject}if(r.predefinedAcl){u.qs.predefinedAcl=r.predefinedAcl}else if(r.private){u.qs.predefinedAcl="private"}else if(r.public){u.qs.predefinedAcl="publicRead"}Object.assign(u.qs,this.instancePreconditionOpts,r.preconditionOpts);kp.util.makeWritableStream(e,{makeAuthenticatedRequest:l=>{this.request(l,(c,d,p)=>{if(c){e.destroy(c);return}this.metadata=d;e.emit("metadata",d);e.emit("response",p);e.emit("complete")})},metadata:r.metadata,request:u})}disableAutoRetryConditionallyIdempotent_(e,r,n){var i,s,a,u;if(typeof e==="object"&&((s=(i=e===null||e===void 0?void 0:e.reqOpts)===null||i===void 0?void 0:i.qs)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&r===BE.AvailableServiceObjectMethods.delete&&this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}if(typeof e==="object"&&((u=(a=e===null||e===void 0?void 0:e.reqOpts)===null||a===void 0?void 0:a.qs)===null||u===void 0?void 0:u.ifMetagenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifMetagenerationMatch)===void 0&&r===BE.AvailableServiceObjectMethods.setMetadata&&this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===To.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}}async getBufferFromReadable(e){const r=[];for await(const n of e){r.push(n)}return Buffer.concat(r)}};Mn.File=qT;zM=new WeakSet,n6e=o(async function t(e,r={}){const n=this.metadata;let i=!!(r.crc32c||r.md5);if(r.crc32c&&n.crc32c){i=!e.test("crc32c",n.crc32c)}if(r.md5&&n.md5Hash){i=!e.test("md5",n.md5Hash)}if(i){const s=[];let a="";let u="";try{await this.delete();if(r.md5&&!n.md5Hash){a="MD5_NOT_AVAILABLE";u=Ao.MD5_NOT_AVAILABLE}else{a="FILE_NO_UPLOAD";u=Ao.UPLOAD_MISMATCH}}catch(c){const d=c;a="FILE_NO_UPLOAD_DELETE";u=`${Ao.UPLOAD_MISMATCH_DELETE_FAIL}${d.message}`;s.push(d)}const l=new VE(u);l.code=a;l.errors=s;throw l}return true},"_File_validateIntegrity");(0,P6t.promisifyAll)(qT,{exclude:["cloudStorageURI","publicUrl","request","save","setEncryptionKey","shouldRetryBasedOnPreconditionAndIdempotencyStrat","getBufferFromReadable"]})});var YM=_(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:true});Dg.Iam=Dg.IAMExceptionMessages=void 0;var F6t=_l();var KM=yl();var MT;(function(t){t["POLICY_OBJECT_REQUIRED"]="A policy object is required.";t["PERMISSIONS_REQUIRED"]="Permissions are required."})(MT||(Dg.IAMExceptionMessages=MT={}));var BT=class{static{o(this,"Iam")}constructor(e){this.request_=e.request.bind(e);this.resourceId_="buckets/"+e.getId()}getPolicy(e,r){const{options:n,callback:i}=(0,KM.normalize)(e,r);const s={};if(n.userProject){s.userProject=n.userProject}if(n.requestedPolicyVersion!==null&&n.requestedPolicyVersion!==void 0){s.optionsRequestedPolicyVersion=n.requestedPolicyVersion}this.request_({uri:"/iam",qs:s},i)}setPolicy(e,r,n){if(e===null||typeof e!=="object"){throw new Error(MT.POLICY_OBJECT_REQUIRED)}const{options:i,callback:s}=(0,KM.normalize)(r,n);let a;if(e.etag===void 0){a=0}this.request_({method:"PUT",uri:"/iam",maxRetries:a,json:Object.assign({resourceId:this.resourceId_},e),qs:i},s)}testPermissions(e,r,n){if(!Array.isArray(e)&&typeof e!=="string"){throw new Error(MT.PERMISSIONS_REQUIRED)}const{options:i,callback:s}=(0,KM.normalize)(r,n);const a=Array.isArray(e)?e:[e];const u=Object.assign({permissions:a},i);this.request_({uri:"/iam/testPermissions",qs:u,useQuerystring:true},(l,c)=>{if(l){s(l,null,c);return}const d=Array.isArray(c.permissions)?c.permissions:[];const p=a.reduce((f,h)=>{f[h]=d.indexOf(h)>-1;return f},{});s(null,p,c)})}};Dg.Iam=BT;(0,F6t.promisifyAll)(BT)});var WM=_(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:true});HT.Notification=void 0;var M6t=xp();var B6t=_l();var VT=class extends M6t.ServiceObject{static{o(this,"Notification")}constructor(e,r){const n={};const i={create:true,delete:{reqOpts:{qs:n}},get:{reqOpts:{qs:n}},getMetadata:{reqOpts:{qs:n}},exists:true};super({parent:e,baseUrl:"/notificationConfigs",id:r.toString(),createMethod:e.createNotification.bind(e),methods:i})}};HT.Notification=VT;(0,B6t.promisifyAll)(VT)});var FT=_(Ni=>{"use strict";var V6t=Ni&&Ni.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var H6t=Ni&&Ni.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var XM=Ni&&Ni.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))V6t(e,t,r)}H6t(e,t);return e};var o6e=Ni&&Ni.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Ni,"__esModule",{value:true});Ni.Bucket=Ni.BucketExceptionMessages=Ni.AvailableServiceObjectMethods=Ni.BucketActionToHTTPMethod=void 0;var zT=xp();var u6e=xM();var z6t=_l();var G6t=XM(require("fs"));var K6t=XM(RM());var Y6t=XM(require("path"));var i6e=o6e(IM());var s6e=require("util");var W6t=o6e(OE());var J6t=yl();var a6e=PM();var JM=FE();var Q6t=YM();var X6t=WM();var kg=Ig();var Z6t=UM();var ebt=require("stream");var tbt=require("url");var QM;(function(t){t["list"]="GET"})(QM||(Ni.BucketActionToHTTPMethod=QM={}));var $g;(function(t){t[t["setMetadata"]=0]="setMetadata";t[t["delete"]=1]="delete"})($g||(Ni.AvailableServiceObjectMethods=$g={}));var wl;(function(t){t["PROVIDE_SOURCE_FILE"]="You must provide at least one source file.";t["DESTINATION_FILE_NOT_SPECIFIED"]="A destination file must be specified.";t["CHANNEL_ID_REQUIRED"]="An ID is required to create a channel.";t["TOPIC_NAME_REQUIRED"]="A valid topic name is required.";t["CONFIGURATION_OBJECT_PREFIX_REQUIRED"]="A configuration object with a prefix is required.";t["SPECIFY_FILE_NAME"]="A file name must be specified.";t["METAGENERATION_NOT_PROVIDED"]="A metageneration must be provided.";t["SUPPLY_NOTIFICATION_ID"]="You must supply a notification ID."})(wl||(Ni.BucketExceptionMessages=wl={}));var HE=class t extends zT.ServiceObject{static{o(this,"Bucket")}getFilesStream(e){return new ebt.Readable}constructor(e,r,n){var i,s,a,u;n=n||{};r=r.replace(/^gs:\/\//,"").replace(/\/+$/,"");const l={};if((i=n===null||n===void 0?void 0:n.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch){l.ifGenerationMatch=n.preconditionOpts.ifGenerationMatch}if((s=n===null||n===void 0?void 0:n.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationNotMatch){l.ifGenerationNotMatch=n.preconditionOpts.ifGenerationNotMatch}if((a=n===null||n===void 0?void 0:n.preconditionOpts)===null||a===void 0?void 0:a.ifMetagenerationMatch){l.ifMetagenerationMatch=n.preconditionOpts.ifMetagenerationMatch}if((u=n===null||n===void 0?void 0:n.preconditionOpts)===null||u===void 0?void 0:u.ifMetagenerationNotMatch){l.ifMetagenerationNotMatch=n.preconditionOpts.ifMetagenerationNotMatch}const c=n.userProject;if(typeof c==="string"){l.userProject=c}const d={create:{reqOpts:{qs:l}},delete:{reqOpts:{qs:l}},exists:{reqOpts:{qs:l}},get:{reqOpts:{qs:l}},getMetadata:{reqOpts:{qs:l}},setMetadata:{reqOpts:{qs:l}}};super({parent:e,baseUrl:"/b",id:r,createMethod:e.createBucket.bind(e),methods:d});this.name=r;this.storage=e;this.userProject=n.userProject;this.acl=new a6e.Acl({request:this.request.bind(this),pathPrefix:"/acl"});this.acl.default=new a6e.Acl({request:this.request.bind(this),pathPrefix:"/defaultObjectAcl"});this.crc32cGenerator=n.crc32cGenerator||this.storage.crc32cGenerator;this.iam=new Q6t.Iam(this);this.getFilesStream=u6e.paginator.streamify("getFiles");this.instanceRetryValue=e.retryOptions.autoRetry;this.instancePreconditionOpts=n===null||n===void 0?void 0:n.preconditionOpts}get cloudStorageURI(){const e=new tbt.URL("gs://");e.host=this.name;return e}addLifecycleRule(e,r,n){let i={};if(typeof r==="function"){n=r}else if(r){i=r}i=i||{};const s=Array.isArray(e)?e:[e];for(const a of s){if(a.condition.createdBefore instanceof Date){a.condition.createdBefore=a.condition.createdBefore.toISOString().replace(/T.+$/,"")}if(a.condition.customTimeBefore instanceof Date){a.condition.customTimeBefore=a.condition.customTimeBefore.toISOString().replace(/T.+$/,"")}if(a.condition.noncurrentTimeBefore instanceof Date){a.condition.noncurrentTimeBefore=a.condition.noncurrentTimeBefore.toISOString().replace(/T.+$/,"")}}if(i.append===false){this.setMetadata({lifecycle:{rule:s}},i,n);return}this.getMetadata((a,u)=>{var l,c;if(a){n(a);return}const d=Array.isArray((l=u.lifecycle)===null||l===void 0?void 0:l.rule)?(c=u.lifecycle)===null||c===void 0?void 0:c.rule:[];this.setMetadata({lifecycle:{rule:d.concat(s)}},i,n)})}combine(e,r,n,i){var s;if(!Array.isArray(e)||e.length===0){throw new Error(wl.PROVIDE_SOURCE_FILE)}if(!r){throw new Error(wl.DESTINATION_FILE_NOT_SPECIFIED)}let a={};if(typeof n==="function"){i=n}else if(n){a=n}this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,$g.setMetadata,a);const u=o(d=>{if(d instanceof JM.File){return d}return this.file(d)},"convertToFile");e=e.map(u);const l=u(r);i=i||zT.util.noop;if(!l.metadata.contentType){const d=K6t.contentType(l.name);if(d){l.metadata.contentType=d}}let c=this.storage.retryOptions.maxRetries;if(((s=l===null||l===void 0?void 0:l.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&a.ifGenerationMatch===void 0&&this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryNever){c=0}if(a.ifGenerationMatch===void 0){Object.assign(a,l.instancePreconditionOpts,a)}l.request({method:"POST",uri:"/compose",maxRetries:c,json:{destination:{contentType:l.metadata.contentType},sourceObjects:e.map(d=>{const p={name:d.name};if(d.metadata&&d.metadata.generation){p.generation=parseInt(d.metadata.generation.toString())}return p})},qs:a},(d,p)=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue;if(d){i(d,null,p);return}i(null,l,p)})}createChannel(e,r,n,i){if(typeof e!=="string"){throw new Error(wl.CHANNEL_ID_REQUIRED)}let s={};if(typeof n==="function"){i=n}else if(n){s=n}this.request({method:"POST",uri:"/o/watch",json:Object.assign({id:e,type:"web_hook"},r),qs:s},(a,u)=>{if(a){i(a,null,u);return}const l=u.resourceId;const c=this.storage.channel(e,l);c.metadata=u;i(null,c,u)})}createNotification(e,r,n){let i={};if(typeof r==="function"){n=r}else if(r){i=r}const s=e!==null&&typeof e==="object";if(s&&zT.util.isCustomType(e,"pubsub/topic")){e=e.name}if(typeof e!=="string"){throw new Error(wl.TOPIC_NAME_REQUIRED)}const a=Object.assign({topic:e},i);if(a.topic.indexOf("projects")!==0){a.topic="projects/{{projectId}}/topics/"+a.topic}a.topic="//pubsub.googleapis.com/"+a.topic;if(!a.payloadFormat){a.payloadFormat="JSON_API_V1"}const u={};if(a.userProject){u.userProject=a.userProject;delete a.userProject}this.request({method:"POST",uri:"/notificationConfigs",json:(0,J6t.convertObjKeysToSnakeCase)(a),qs:u,maxRetries:0},(l,c)=>{if(l){n(l,null,c);return}const d=this.notification(c.id);d.metadata=c;n(null,d,c)})}deleteFiles(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}const i=10;const s=1e3;const a=[];const u=o(l=>{return l.delete(n).catch(c=>{if(!n.force){throw c}a.push(c)})},"deleteFile");(async()=>{try{let l=[];const c=(0,i6e.default)(i);const d=this.getFilesStream(n);for await(const p of d){if(l.length>=s){await Promise.all(l);l=[]}l.push(c(()=>u(p)).catch(f=>{d.destroy();throw f}))}await Promise.all(l);r(a.length>0?a:null)}catch(l){r(l);return}})()}deleteLabels(e,r,n){let i=new Array;let s={};if(typeof e==="function"){n=e}else if(typeof e==="string"){i=[e]}else if(Array.isArray(e)){i=e}else if(e){s=e}if(typeof r==="function"){n=r}else if(r){s=r}const a=o(u=>{const l=u.reduce((c,d)=>{c[d]=null;return c},{});if((s===null||s===void 0?void 0:s.ifMetagenerationMatch)!==void 0){this.setLabels(l,s,n)}else{this.setLabels(l,n)}},"deleteLabels");if(i.length===0){this.getLabels((u,l)=>{if(u){n(u);return}a(Object.keys(l))})}else{a(i)}}disableRequesterPays(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}this.setMetadata({billing:{requesterPays:false}},n,r)}enableLogging(e,r){if(!e||typeof e==="function"||typeof e.prefix==="undefined"){throw new Error(wl.CONFIGURATION_OBJECT_PREFIX_REQUIRED)}let n=this.id;if(e.bucket&&e.bucket instanceof t){n=e.bucket.id}else if(e.bucket&&typeof e.bucket==="string"){n=e.bucket}const i={};if(e===null||e===void 0?void 0:e.ifMetagenerationMatch){i.ifMetagenerationMatch=e.ifMetagenerationMatch}if(e===null||e===void 0?void 0:e.ifMetagenerationNotMatch){i.ifMetagenerationNotMatch=e.ifMetagenerationNotMatch}(async()=>{try{const[s]=await this.iam.getPolicy();s.bindings.push({members:["group:cloud-storage-analytics@google.com"],role:"roles/storage.objectCreator"});await this.iam.setPolicy(s);this.setMetadata({logging:{logBucket:n,logObjectPrefix:e.prefix}},i,r)}catch(s){r(s);return}})()}enableRequesterPays(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}this.setMetadata({billing:{requesterPays:true}},n,r)}file(e,r){if(!e){throw Error(wl.SPECIFY_FILE_NAME)}return new JM.File(this,e,r)}getFiles(e,r){let n=typeof e==="object"?e:{};if(!r){r=e}n=Object.assign({},n);this.request({uri:"/o",qs:n},(i,s)=>{if(i){r(i,null,null,s);return}const a=s.items?s.items:[];const u=a.map(c=>{const d={};if(n.versions){d.generation=c.generation}if(c.kmsKeyName){d.kmsKeyName=c.kmsKeyName}const p=this.file(c.name,d);p.metadata=c;return p});let l=null;if(s.nextPageToken){l=Object.assign({},n,{pageToken:s.nextPageToken})}r(null,u,l,s)})}getLabels(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}this.getMetadata(n,(i,s)=>{if(i){r(i,null);return}r(null,(s===null||s===void 0?void 0:s.labels)||{})})}getNotifications(e,r){let n={};if(typeof e==="function"){r=e}else if(e){n=e}this.request({uri:"/notificationConfigs",qs:n},(i,s)=>{if(i){r(i,null,s);return}const a=s.items?s.items:[];const u=a.map(l=>{const c=this.notification(l.id);c.metadata=l;return c});r(null,u,s)})}getSignedUrl(e,r){const n=QM[e.action];const i={method:n,expires:e.expires,version:e.version,cname:e.cname,extensionHeaders:e.extensionHeaders||{},queryParams:e.queryParams||{}};if(!this.signer){this.signer=new Z6t.URLSigner(this.storage.authClient,this)}this.signer.getSignedUrl(i).then(s=>r(null,s),r)}lock(e,r){const n=typeof e;if(n!=="number"&&n!=="string"){throw new Error(wl.METAGENERATION_NOT_PROVIDED)}this.request({method:"POST",uri:"/lockRetentionPolicy",qs:{ifMetagenerationMatch:e}},r)}makePrivate(e,r){var n,i,s,a;const u=typeof e==="object"?e:{};r=typeof e==="function"?e:r;u.private=true;const l={predefinedAcl:"projectPrivate"};if(u.userProject){l.userProject=u.userProject}if((n=u.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch){l.ifGenerationMatch=u.preconditionOpts.ifGenerationMatch}if((i=u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationNotMatch){l.ifGenerationNotMatch=u.preconditionOpts.ifGenerationNotMatch}if((s=u.preconditionOpts)===null||s===void 0?void 0:s.ifMetagenerationMatch){l.ifMetagenerationMatch=u.preconditionOpts.ifMetagenerationMatch}if((a=u.preconditionOpts)===null||a===void 0?void 0:a.ifMetagenerationNotMatch){l.ifMetagenerationNotMatch=u.preconditionOpts.ifMetagenerationNotMatch}const c={...u.metadata,acl:null};this.setMetadata(c,l,d=>{if(d){r(d)}const p=o(()=>{if(u.includeFiles){return(0,s6e.promisify)(this.makeAllFilesPublicPrivate_).call(this,u)}return Promise.resolve([])},"internalCall");p().then(f=>r(null,f)).catch(r)})}makePublic(e,r){const n=typeof e==="object"?e:{};r=typeof e==="function"?e:r;const i={public:true,...n};this.acl.add({entity:"allUsers",role:"READER"}).then(()=>{return this.acl.default.add({entity:"allUsers",role:"READER"})}).then(()=>{if(i.includeFiles){return(0,s6e.promisify)(this.makeAllFilesPublicPrivate_).call(this,i)}return[]}).then(s=>r(null,s),r)}notification(e){if(!e){throw new Error(wl.SUPPLY_NOTIFICATION_ID)}return new X6t.Notification(this,e)}removeRetentionPeriod(e,r){const n=typeof e==="object"?e:{};r=typeof e==="function"?e:r;this.setMetadata({retentionPolicy:null},n,r)}request(e,r){if(this.userProject&&(!e.qs||!e.qs.userProject)){e.qs={...e.qs,userProject:this.userProject}}return super.request(e,r)}setLabels(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||zT.util.noop;this.setMetadata({labels:e},i,n)}setMetadata(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,$g.setMetadata,i);super.setMetadata(e,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setRetentionPeriod(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.setMetadata({retentionPolicy:{retentionPeriod:e.toString()}},i,n)}setCorsConfiguration(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.setMetadata({cors:e},i,n)}setStorageClass(e,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;e=e.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(s,a,u)=>{return a+"_"+u}).toUpperCase();this.setMetadata({storageClass:e},i,n)}setUserProject(e){this.userProject=e;const r=["create","delete","exists","get","getMetadata","setMetadata"];r.forEach(n=>{const i=this.methods[n];if(typeof i==="object"){if(typeof i.reqOpts==="object"){Object.assign(i.reqOpts.qs,{userProject:e})}else{i.reqOpts={qs:{userProject:e}}}}})}upload(e,r,n){var i,s;const a=o(d=>{const p=(0,W6t.default)(async f=>{await new Promise((h,m)=>{var g,y;if(d===0&&((y=(g=c===null||c===void 0?void 0:c.storage)===null||g===void 0?void 0:g.retryOptions)===null||y===void 0?void 0:y.autoRetry)){c.storage.retryOptions.autoRetry=false}const v=c.createWriteStream(u);if(u.onUploadProgress){v.on("progress",u.onUploadProgress)}G6t.createReadStream(e).on("error",f).pipe(v).on("error",w=>{if(this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(w)){return m(w)}else{return f(w)}}).on("finish",()=>{return h()})})},{retries:d,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});if(!n){return p}else{return p.then(()=>{if(n){return n(null,c,c.metadata)}}).catch(n)}},"upload");if(global["GCLOUD_SANDBOX_ENV"]){return}let u=typeof r==="object"?r:{};n=typeof r==="function"?r:n;u=Object.assign({metadata:{}},u);let l=this.storage.retryOptions.maxRetries;if(((i=u===null||u===void 0?void 0:u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&((s=this.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryNever){l=0}let c;if(u.destination instanceof JM.File){c=u.destination}else if(u.destination!==null&&typeof u.destination==="string"){c=this.file(u.destination,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}else{const d=Y6t.basename(e);c=this.file(d,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}a(l)}makeAllFilesPublicPrivate_(e,r){const n=10;const i=[];const s=[];const a=typeof e==="object"?e:{};r=typeof e==="function"?e:r;const u=o(async l=>{try{await(a.public?l.makePublic():l.makePrivate(a));s.push(l)}catch(c){if(!a.force){throw c}i.push(c)}},"processFile");this.getFiles(a).then(([l])=>{const c=(0,i6e.default)(n);const d=l.map(p=>{return c(()=>u(p))});return Promise.all(d)}).then(()=>r(i.length>0?i:null,s),l=>r(l,s))}getId(){return this.id}disableAutoRetryConditionallyIdempotent_(e,r,n){var i,s;if(typeof e==="object"&&((s=(i=e===null||e===void 0?void 0:e.reqOpts)===null||i===void 0?void 0:i.qs)===null||s===void 0?void 0:s.ifMetagenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifMetagenerationMatch)===void 0&&(r===$g.setMetadata||r===$g.delete)&&this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryConditional){this.storage.retryOptions.autoRetry=false}else if(this.storage.retryOptions.idempotencyStrategy===kg.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}}};Ni.Bucket=HE;u6e.paginator.extend(HE,"getFiles");(0,z6t.promisifyAll)(HE,{exclude:["cloudStorageURI","request","file","notification"]})});var ZM=_(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:true});KT.Channel=void 0;var l6e=xp();var rbt=_l();var GT=class extends l6e.ServiceObject{static{o(this,"Channel")}constructor(e,r,n){const i={parent:e,baseUrl:"/channels",id:"",methods:{}};super(i);this.metadata.id=r;this.metadata.resourceId=n}stop(e){e=e||l6e.util.noop;this.request({method:"POST",uri:"/stop",json:this.metadata},(r,n)=>{e(r,n)})}};KT.Channel=GT;(0,rbt.promisifyAll)(GT)});var eB=_(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:true});WT.HmacKey=void 0;var nbt=xp();var ibt=Ig();var sbt=_l();var YT=class extends nbt.ServiceObject{static{o(this,"HmacKey")}constructor(e,r,n){const i={delete:true,get:true,getMetadata:true,setMetadata:{reqOpts:{method:"PUT"}}};const s=n&&n.projectId||e.projectId;super({parent:e,id:r,baseUrl:`/projects/${s}/hmacKeys`,methods:i});this.storage=e;this.instanceRetryValue=e.retryOptions.autoRetry}setMetadata(e,r,n){if(this.storage.retryOptions.idempotencyStrategy!==ibt.IdempotencyStrategy.RetryAlways){this.storage.retryOptions.autoRetry=false}const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;super.setMetadata(e,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}};WT.HmacKey=YT;(0,sbt.promisifyAll)(YT)});var Ig=_(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:true});Yr.Storage=Yr.RETRYABLE_ERR_FN_DEFAULT=Yr.MAX_RETRY_DELAY_DEFAULT=Yr.TOTAL_TIMEOUT_DEFAULT=Yr.RETRY_DELAY_MULTIPLIER_DEFAULT=Yr.MAX_RETRY_DEFAULT=Yr.AUTO_RETRY_DEFAULT=Yr.PROTOCOL_REGEX=Yr.StorageExceptionMessages=Yr.ExceptionMessages=Yr.IdempotencyStrategy=void 0;var abt=xp();var tB=xM();var obt=_l();var c6e=require("stream");var p6e=FT();var f6e=ZM();var ubt=FE();var JT=yl();var lbt=bg();var h6e=eB();var cbt=UE();var rB;(function(t){t[t["RetryAlways"]=0]="RetryAlways";t[t["RetryConditional"]=1]="RetryConditional";t[t["RetryNever"]=2]="RetryNever"})(rB||(Yr.IdempotencyStrategy=rB={}));var d6e;(function(t){t["EXPIRATION_DATE_INVALID"]="The expiration date provided was invalid.";t["EXPIRATION_DATE_PAST"]="An expiration date cannot be in the past."})(d6e||(Yr.ExceptionMessages=d6e={}));var Lg;(function(t){t["BUCKET_NAME_REQUIRED"]="A bucket name is needed to use Cloud Storage.";t["BUCKET_NAME_REQUIRED_CREATE"]="A name is required to create a bucket.";t["HMAC_SERVICE_ACCOUNT"]="The first argument must be a service account email to create an HMAC key.";t["HMAC_ACCESS_ID"]="An access ID is needed to create an HmacKey object."})(Lg||(Yr.StorageExceptionMessages=Lg={}));Yr.PROTOCOL_REGEX=/^(\w*):\/\//;Yr.AUTO_RETRY_DEFAULT=true;Yr.MAX_RETRY_DEFAULT=3;Yr.RETRY_DELAY_MULTIPLIER_DEFAULT=2;Yr.TOTAL_TIMEOUT_DEFAULT=600;Yr.MAX_RETRY_DELAY_DEFAULT=64;var dbt=rB.RetryConditional;var pbt=o(function(t){var e;const r=o(n=>{return n.includes("eai_again")||n==="econnreset"||n==="unexpected connection closure"||n==="epipe"||n==="socket connection timeout"},"isConnectionProblem");if(t){if([408,429,500,502,503,504].indexOf(t.code)!==-1){return true}if(typeof t.code==="string"){if(["408","429","500","502","503","504"].indexOf(t.code)!==-1){return true}const n=t.code.toLowerCase();if(r(n)){return true}}if(t.errors){for(const n of t.errors){const i=(e=n===null||n===void 0?void 0:n.reason)===null||e===void 0?void 0:e.toString().toLowerCase();if(i&&r(i)){return true}}}}return false},"RETRYABLE_ERR_FN_DEFAULT");Yr.RETRYABLE_ERR_FN_DEFAULT=pbt;var Sl=class t extends abt.Service{static{o(this,"Storage")}getBucketsStream(){return new c6e.Readable}getHmacKeysStream(){return new c6e.Readable}constructor(e={}){var r,n,i,s,a,u,l,c,d,p,f,h,m,g;let y="https://storage.googleapis.com";let v=false;const w=process.env.STORAGE_EMULATOR_HOST;if(typeof w==="string"){y=t.sanitizeEndpoint(w);v=true}if(e.apiEndpoint){y=t.sanitizeEndpoint(e.apiEndpoint);v=true}e=Object.assign({},e,{apiEndpoint:y});const E=w||`${e.apiEndpoint}/storage/v1`;const b={apiEndpoint:e.apiEndpoint,retryOptions:{autoRetry:((r=e.retryOptions)===null||r===void 0?void 0:r.autoRetry)!==void 0?(n=e.retryOptions)===null||n===void 0?void 0:n.autoRetry:Yr.AUTO_RETRY_DEFAULT,maxRetries:((i=e.retryOptions)===null||i===void 0?void 0:i.maxRetries)?(s=e.retryOptions)===null||s===void 0?void 0:s.maxRetries:Yr.MAX_RETRY_DEFAULT,retryDelayMultiplier:((a=e.retryOptions)===null||a===void 0?void 0:a.retryDelayMultiplier)?(u=e.retryOptions)===null||u===void 0?void 0:u.retryDelayMultiplier:Yr.RETRY_DELAY_MULTIPLIER_DEFAULT,totalTimeout:((l=e.retryOptions)===null||l===void 0?void 0:l.totalTimeout)?(c=e.retryOptions)===null||c===void 0?void 0:c.totalTimeout:Yr.TOTAL_TIMEOUT_DEFAULT,maxRetryDelay:((d=e.retryOptions)===null||d===void 0?void 0:d.maxRetryDelay)?(p=e.retryOptions)===null||p===void 0?void 0:p.maxRetryDelay:Yr.MAX_RETRY_DELAY_DEFAULT,retryableErrorFn:((f=e.retryOptions)===null||f===void 0?void 0:f.retryableErrorFn)?(h=e.retryOptions)===null||h===void 0?void 0:h.retryableErrorFn:Yr.RETRYABLE_ERR_FN_DEFAULT,idempotencyStrategy:((m=e.retryOptions)===null||m===void 0?void 0:m.idempotencyStrategy)!==void 0?(g=e.retryOptions)===null||g===void 0?void 0:g.idempotencyStrategy:dbt},baseUrl:E,customEndpoint:v,useAuthWithCustomEndpoint:e===null||e===void 0?void 0:e.useAuthWithCustomEndpoint,projectIdRequired:false,scopes:["https://www.googleapis.com/auth/iam","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/devstorage.full_control"],packageJson:(0,lbt.getPackageJSON)()};super(b,e);this.acl=t.acl;this.crc32cGenerator=e.crc32cGenerator||cbt.CRC32C_DEFAULT_VALIDATOR_GENERATOR;this.retryOptions=b.retryOptions;this.getBucketsStream=tB.paginator.streamify("getBuckets");this.getHmacKeysStream=tB.paginator.streamify("getHmacKeys")}static sanitizeEndpoint(e){if(!Yr.PROTOCOL_REGEX.test(e)){e=`https://${e}`}return e.replace(/\/+$/,"")}bucket(e,r){if(!e){throw new Error(Lg.BUCKET_NAME_REQUIRED)}return new p6e.Bucket(this,e,r)}channel(e,r){return new f6e.Channel(this,e,r)}createBucket(e,r,n){if(!e){throw new Error(Lg.BUCKET_NAME_REQUIRED_CREATE)}let i;if(!n){n=r;i={}}else{i=r}const s={...i,name:e};const a={archive:"ARCHIVE",coldline:"COLDLINE",dra:"DURABLE_REDUCED_AVAILABILITY",multiRegional:"MULTI_REGIONAL",nearline:"NEARLINE",regional:"REGIONAL",standard:"STANDARD"};const u=Object.keys(a);for(const c of u){if(s[c]){if(i.storageClass&&i.storageClass!==c){throw new Error(`Both \`${c}\` and \`storageClass\` were provided.`)}s.storageClass=a[c];delete s[c]}}if(s.requesterPays){s.billing={requesterPays:s.requesterPays};delete s.requesterPays}const l={project:this.projectId};if(s.userProject){l.userProject=s.userProject;delete s.userProject}this.request({method:"POST",uri:"/b",qs:l,json:s},(c,d)=>{if(c){n(c,null,d);return}const p=this.bucket(e);p.metadata=d;n(null,p,d)})}createHmacKey(e,r,n){if(typeof e!=="string"){throw new Error(Lg.HMAC_SERVICE_ACCOUNT)}const{options:i,callback:s}=(0,JT.normalize)(r,n);const a=Object.assign({},i,{serviceAccountEmail:e});const u=a.projectId||this.projectId;delete a.projectId;this.request({method:"POST",uri:`/projects/${u}/hmacKeys`,qs:a,maxRetries:0},(l,c)=>{if(l){s(l,null,null,c);return}const d=c.metadata;const p=this.hmacKey(d.accessId,{projectId:d.projectId});p.metadata=c.metadata;s(null,p,c.secret,c)})}getBuckets(e,r){const{options:n,callback:i}=(0,JT.normalize)(e,r);n.project=n.project||this.projectId;this.request({uri:"/b",qs:n},(s,a)=>{if(s){i(s,null,null,a);return}const u=a.items?a.items:[];const l=u.map(d=>{const p=this.bucket(d.id);p.metadata=d;return p});const c=a.nextPageToken?Object.assign({},n,{pageToken:a.nextPageToken}):null;i(null,l,c,a)})}getHmacKeys(e,r){const{options:n,callback:i}=(0,JT.normalize)(e,r);const s=Object.assign({},n);const a=s.projectId||this.projectId;delete s.projectId;this.request({uri:`/projects/${a}/hmacKeys`,qs:s},(u,l)=>{if(u){i(u,null,null,l);return}const c=l.items?l.items:[];const d=c.map(f=>{const h=this.hmacKey(f.accessId,{projectId:f.projectId});h.metadata=f;return h});const p=l.nextPageToken?Object.assign({},n,{pageToken:l.nextPageToken}):null;i(null,d,p,l)})}getServiceAccount(e,r){const{options:n,callback:i}=(0,JT.normalize)(e,r);this.request({uri:`/projects/${this.projectId}/serviceAccount`,qs:n},(s,a)=>{if(s){i(s,null,a);return}const u={};for(const l in a){if(a.hasOwnProperty(l)){const c=l.replace(/_(\w)/g,(d,p)=>p.toUpperCase());u[c]=a[l]}}i(null,u,a)})}hmacKey(e,r){if(!e){throw new Error(Lg.HMAC_ACCESS_ID)}return new h6e.HmacKey(this,e,r)}};Yr.Storage=Sl;Sl.Bucket=p6e.Bucket;Sl.Channel=f6e.Channel;Sl.File=ubt.File;Sl.HmacKey=h6e.HmacKey;Sl.acl={OWNER_ROLE:"OWNER",READER_ROLE:"READER",WRITER_ROLE:"WRITER"};tB.paginator.extend(Sl,["getBuckets","getHmacKeys"]);(0,obt.promisifyAll)(Sl,{exclude:["bucket","channel","hmacKey"]})});var QT=_(Vc=>{"use strict";var m6e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";var fbt=m6e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";var g6e="["+m6e+"]["+fbt+"]*";var hbt=new RegExp("^"+g6e+"$");var mbt=o(function(t,e){const r=[];let n=e.exec(t);while(n){const i=[];i.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let a=0;a<s;a++){i.push(n[a])}r.push(i);n=e.exec(t)}return r},"getAllMatches");var gbt=o(function(t){const e=hbt.exec(t);return!(e===null||typeof e==="undefined")},"isName");Vc.isExist=function(t){return typeof t!=="undefined"};Vc.isEmptyObject=function(t){return Object.keys(t).length===0};Vc.merge=function(t,e,r){if(e){const n=Object.keys(e);const i=n.length;for(let s=0;s<i;s++){if(r==="strict"){t[n[s]]=[e[n[s]]]}else{t[n[s]]=e[n[s]]}}}};Vc.getValue=function(t){if(Vc.isExist(t)){return t}else{return""}};Vc.isName=gbt;Vc.getAllMatches=mbt;Vc.nameRegexp=g6e});var iB=_(b6e=>{"use strict";var nB=QT();var ybt={allowBooleanAttributes:false,unpairedTags:[]};b6e.validate=function(t,e){e=Object.assign({},ybt,e);const r=[];let n=false;let i=false;if(t[0]==="\uFEFF"){t=t.substr(1)}for(let s=0;s<t.length;s++){if(t[s]==="<"&&t[s+1]==="?"){s+=2;s=v6e(t,s);if(s.err)return s}else if(t[s]==="<"){let a=s;s++;if(t[s]==="!"){s=_6e(t,s);continue}else{let u=false;if(t[s]==="/"){u=true;s++}let l="";for(;s<t.length&&t[s]!==">"&&t[s]!==" "&&t[s]!==" "&&t[s]!=="\n"&&t[s]!=="\r";s++){l+=t[s]}l=l.trim();if(l[l.length-1]==="/"){l=l.substring(0,l.length-1);s--}if(!Abt(l)){let p;if(l.trim().length===0){p="Invalid space after '<'."}else{p="Tag '"+l+"' is an invalid name."}return ci("InvalidTag",p,ya(t,s))}const c=Ebt(t,s);if(c===false){return ci("InvalidAttr","Attributes for '"+l+"' have open quote.",ya(t,s))}let d=c.value;s=c.index;if(d[d.length-1]==="/"){const p=s-d.length;d=d.substring(0,d.length-1);const f=E6e(d,e);if(f===true){n=true}else{return ci(f.err.code,f.err.msg,ya(t,p+f.err.line))}}else if(u){if(!c.tagClosed){return ci("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",ya(t,s))}else if(d.trim().length>0){return ci("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",ya(t,a))}else{const p=r.pop();if(l!==p.tagName){let f=ya(t,p.tagStartPos);return ci("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+l+"'.",ya(t,a))}if(r.length==0){i=true}}}else{const p=E6e(d,e);if(p!==true){return ci(p.err.code,p.err.msg,ya(t,s-d.length+p.err.line))}if(i===true){return ci("InvalidXml","Multiple possible root nodes found.",ya(t,s))}else if(e.unpairedTags.indexOf(l)!==-1){}else{r.push({tagName:l,tagStartPos:a})}n=true}for(s++;s<t.length;s++){if(t[s]==="<"){if(t[s+1]==="!"){s++;s=_6e(t,s);continue}else if(t[s+1]==="?"){s=v6e(t,++s);if(s.err)return s}else{break}}else if(t[s]==="&"){const p=Sbt(t,s);if(p==-1)return ci("InvalidChar","char '&' is not expected.",ya(t,s));s=p}else{if(i===true&&!y6e(t[s])){return ci("InvalidXml","Extra text at the end",ya(t,s))}}}if(t[s]==="<"){s--}}}else{if(y6e(t[s])){continue}return ci("InvalidChar","char '"+t[s]+"' is not expected.",ya(t,s))}}if(!n){return ci("InvalidXml","Start tag expected.",1)}else if(r.length==1){return ci("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",ya(t,r[0].tagStartPos))}else if(r.length>0){return ci("InvalidXml","Invalid '"+JSON.stringify(r.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}return true};function y6e(t){return t===" "||t===" "||t==="\n"||t==="\r"}o(y6e,"isWhiteSpace");function v6e(t,e){const r=e;for(;e<t.length;e++){if(t[e]=="?"||t[e]==" "){const n=t.substr(r,e-r);if(e>5&&n==="xml"){return ci("InvalidXml","XML declaration allowed only at the start of the document.",ya(t,e))}else if(t[e]=="?"&&t[e+1]==">"){e++;break}else{continue}}}return e}o(v6e,"readPI");function _6e(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++){if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let r=1;for(e+=8;e<t.length;e++){if(t[e]==="<"){r++}else if(t[e]===">"){r--;if(r===0){break}}}}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++){if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}}return e}o(_6e,"readCommentAndCDATA");var vbt='"';var _bt="'";function Ebt(t,e){let r="";let n="";let i=false;for(;e<t.length;e++){if(t[e]===vbt||t[e]===_bt){if(n===""){n=t[e]}else if(n!==t[e]){}else{n=""}}else if(t[e]===">"){if(n===""){i=true;break}}r+=t[e]}if(n!==""){return false}return{value:r,index:e,tagClosed:i}}o(Ebt,"readAttributeStr");var bbt=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function E6e(t,e){const r=nB.getAllMatches(t,bbt);const n={};for(let i=0;i<r.length;i++){if(r[i][1].length===0){return ci("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",zE(r[i]))}else if(r[i][3]!==void 0&&r[i][4]===void 0){return ci("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",zE(r[i]))}else if(r[i][3]===void 0&&!e.allowBooleanAttributes){return ci("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",zE(r[i]))}const s=r[i][2];if(!Tbt(s)){return ci("InvalidAttr","Attribute '"+s+"' is an invalid name.",zE(r[i]))}if(!n.hasOwnProperty(s)){n[s]=1}else{return ci("InvalidAttr","Attribute '"+s+"' is repeated.",zE(r[i]))}}return true}o(E6e,"validateAttributeString");function wbt(t,e){let r=/\d/;if(t[e]==="x"){e++;r=/[\da-fA-F]/}for(;e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(r))break}return-1}o(wbt,"validateNumberAmpersand");function Sbt(t,e){e++;if(t[e]===";")return-1;if(t[e]==="#"){e++;return wbt(t,e)}let r=0;for(;e<t.length;e++,r++){if(t[e].match(/\w/)&&r<20)continue;if(t[e]===";")break;return-1}return e}o(Sbt,"validateAmpersand");function ci(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}o(ci,"getErrorObject");function Tbt(t){return nB.isName(t)}o(Tbt,"validateAttrName");function Abt(t){return nB.isName(t)}o(Abt,"validateTagName");function ya(t,e){const r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}o(ya,"getLineNumberForPosition");function zE(t){return t.startIndex+t[1].length}o(zE,"getPositionFromMatch")});var S6e=_(sB=>{var w6e={preserveOrder:false,attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,removeNSPrefix:false,allowBooleanAttributes:false,parseTagValue:true,parseAttributeValue:false,trimValues:true,cdataPropName:false,numberParseOptions:{hex:true,leadingZeros:true,eNotation:true},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:false,isArray:()=>false,commentPropName:false,unpairedTags:[],processEntities:true,htmlEntities:false,ignoreDeclaration:false,ignorePiTags:false,transformTagName:false,transformAttributeName:false,updateTag:function(t,e,r){return t}};var xbt=o(function(t){return Object.assign({},w6e,t)},"buildOptions");sB.buildOptions=xbt;sB.defaultOptions=w6e});var A6e=_((mur,T6e)=>{"use strict";var aB=class{static{o(this,"XmlNode")}constructor(e){this.tagname=e;this.child=[];this[":@"]={}}add(e,r){if(e==="__proto__")e="#__proto__";this.child.push({[e]:r})}addChild(e){if(e.tagname==="__proto__")e.tagname="#__proto__";if(e[":@"]&&Object.keys(e[":@"]).length>0){this.child.push({[e.tagname]:e.child,[":@"]:e[":@"]})}else{this.child.push({[e.tagname]:e.child})}}};T6e.exports=aB});var C6e=_((yur,x6e)=>{var Cbt=QT();function Rbt(t,e){const r={};if(t[e+3]==="O"&&t[e+4]==="C"&&t[e+5]==="T"&&t[e+6]==="Y"&&t[e+7]==="P"&&t[e+8]==="E"){e=e+9;let n=1;let i=false,s=false;let a="";for(;e<t.length;e++){if(t[e]==="<"&&!s){if(i&&Ibt(t,e)){e+=7;[entityName,val,e]=Obt(t,e+1);if(val.indexOf("&")===-1)r[$bt(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(i&&Pbt(t,e))e+=8;else if(i&&Dbt(t,e))e+=8;else if(i&&kbt(t,e))e+=9;else if(Nbt)s=true;else throw new Error("Invalid DOCTYPE");n++;a=""}else if(t[e]===">"){if(s){if(t[e-1]==="-"&&t[e-2]==="-"){s=false;n--}}else{n--}if(n===0){break}}else if(t[e]==="["){i=true}else{a+=t[e]}}if(n!==0){throw new Error(`Unclosed DOCTYPE`)}}else{throw new Error(`Invalid Tag instead of DOCTYPE`)}return{entities:r,i:e}}o(Rbt,"readDocType");function Obt(t,e){let r="";for(;e<t.length&&(t[e]!=="'"&&t[e]!=='"');e++){r+=t[e]}r=r.trim();if(r.indexOf(" ")!==-1)throw new Error("External entites are not supported");const n=t[e++];let i="";for(;e<t.length&&t[e]!==n;e++){i+=t[e]}return[r,i,e]}o(Obt,"readEntityExp");function Nbt(t,e){if(t[e+1]==="!"&&t[e+2]==="-"&&t[e+3]==="-")return true;return false}o(Nbt,"isComment");function Ibt(t,e){if(t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="N"&&t[e+4]==="T"&&t[e+5]==="I"&&t[e+6]==="T"&&t[e+7]==="Y")return true;return false}o(Ibt,"isEntity");function Pbt(t,e){if(t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="L"&&t[e+4]==="E"&&t[e+5]==="M"&&t[e+6]==="E"&&t[e+7]==="N"&&t[e+8]==="T")return true;return false}o(Pbt,"isElement");function Dbt(t,e){if(t[e+1]==="!"&&t[e+2]==="A"&&t[e+3]==="T"&&t[e+4]==="T"&&t[e+5]==="L"&&t[e+6]==="I"&&t[e+7]==="S"&&t[e+8]==="T")return true;return false}o(Dbt,"isAttlist");function kbt(t,e){if(t[e+1]==="!"&&t[e+2]==="N"&&t[e+3]==="O"&&t[e+4]==="T"&&t[e+5]==="A"&&t[e+6]==="T"&&t[e+7]==="I"&&t[e+8]==="O"&&t[e+9]==="N")return true;return false}o(kbt,"isNotation");function $bt(t){if(Cbt.isName(t))return t;else throw new Error(`Invalid entity name ${t}`)}o($bt,"validateEntityName");x6e.exports=Rbt});var O6e=_((_ur,R6e)=>{var Lbt=/^[-+]?0x[a-fA-F0-9]+$/;var qbt=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;if(!Number.parseInt&&window.parseInt){Number.parseInt=window.parseInt}if(!Number.parseFloat&&window.parseFloat){Number.parseFloat=window.parseFloat}var jbt={hex:true,leadingZeros:true,decimalPoint:".",eNotation:true};function Ubt(t,e={}){e=Object.assign({},jbt,e);if(!t||typeof t!=="string")return t;let r=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(r))return t;else if(e.hex&&Lbt.test(r)){return Number.parseInt(r,16)}else{const n=qbt.exec(r);if(n){const i=n[1];const s=n[2];let a=Fbt(n[3]);const u=n[4]||n[6];if(!e.leadingZeros&&s.length>0&&i&&r[2]!==".")return t;else if(!e.leadingZeros&&s.length>0&&!i&&r[1]!==".")return t;else{const l=Number(r);const c=""+l;if(c.search(/[eE]/)!==-1){if(e.eNotation)return l;else return t}else if(u){if(e.eNotation)return l;else return t}else if(r.indexOf(".")!==-1){if(c==="0"&&a==="")return l;else if(c===a)return l;else if(i&&c==="-"+a)return l;else return t}if(s){if(a===c)return l;else if(i+a===c)return l;else return t}if(r===c)return l;else if(r===i+c)return l;return t}}else{return t}}}o(Ubt,"toNumber");function Fbt(t){if(t&&t.indexOf(".")!==-1){t=t.replace(/0+$/,"");if(t===".")t="0";else if(t[0]===".")t="0"+t;else if(t[t.length-1]===".")t=t.substr(0,t.length-1);return t}return t}o(Fbt,"trimZeros");R6e.exports=Ubt});var I6e=_((wur,N6e)=>{"use strict";var cB=QT();var GE=A6e();var Mbt=C6e();var Bbt=O6e();var bur="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,cB.nameRegexp);var oB=class{static{o(this,"OrderedObjParser")}constructor(e){this.options=e;this.currentNode=null;this.tagsNodeStack=[];this.docTypeEntities={};this.lastEntities={"apos":{regex:/&(apos|#39|#x27);/g,val:"'"},"gt":{regex:/&(gt|#62|#x3E);/g,val:">"},"lt":{regex:/&(lt|#60|#x3C);/g,val:"<"},"quot":{regex:/&(quot|#34|#x22);/g,val:'"'}};this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"};this.htmlEntities={"space":{regex:/&(nbsp|#160);/g,val:" "},"cent":{regex:/&(cent|#162);/g,val:"\xA2"},"pound":{regex:/&(pound|#163);/g,val:"\xA3"},"yen":{regex:/&(yen|#165);/g,val:"\xA5"},"euro":{regex:/&(euro|#8364);/g,val:"\u20AC"},"copyright":{regex:/&(copy|#169);/g,val:"\xA9"},"reg":{regex:/&(reg|#174);/g,val:"\xAE"},"inr":{regex:/&(inr|#8377);/g,val:"\u20B9"}};this.addExternalEntities=Vbt;this.parseXml=Ybt;this.parseTextData=Hbt;this.resolveNameSpace=zbt;this.buildAttributesMap=Kbt;this.isItStopNode=Xbt;this.replaceEntitiesValue=Jbt;this.readStopNodeData=e3t;this.saveTextToParentTag=Qbt;this.addChild=Wbt}};function Vbt(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const n=e[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}o(Vbt,"addExternalEntities");function Hbt(t,e,r,n,i,s,a){if(t!==void 0){if(this.options.trimValues&&!n){t=t.trim()}if(t.length>0){if(!a)t=this.replaceEntitiesValue(t);const u=this.options.tagValueProcessor(e,t,r,i,s);if(u===null||u===void 0){return t}else if(typeof u!==typeof t||u!==t){return u}else if(this.options.trimValues){return lB(t,this.options.parseTagValue,this.options.numberParseOptions)}else{const l=t.trim();if(l===t){return lB(t,this.options.parseTagValue,this.options.numberParseOptions)}else{return t}}}}}o(Hbt,"parseTextData");function zbt(t){if(this.options.removeNSPrefix){const e=t.split(":");const r=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns"){return""}if(e.length===2){t=r+e[1]}}return t}o(zbt,"resolveNameSpace");var Gbt=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Kbt(t,e,r){if(!this.options.ignoreAttributes&&typeof t==="string"){const n=cB.getAllMatches(t,Gbt);const i=n.length;const s={};for(let a=0;a<i;a++){const u=this.resolveNameSpace(n[a][1]);let l=n[a][4];let c=this.options.attributeNamePrefix+u;if(u.length){if(this.options.transformAttributeName){c=this.options.transformAttributeName(c)}if(c==="__proto__")c="#__proto__";if(l!==void 0){if(this.options.trimValues){l=l.trim()}l=this.replaceEntitiesValue(l);const d=this.options.attributeValueProcessor(u,l,e);if(d===null||d===void 0){s[c]=l}else if(typeof d!==typeof l||d!==l){s[c]=d}else{s[c]=lB(l,this.options.parseAttributeValue,this.options.numberParseOptions)}}else if(this.options.allowBooleanAttributes){s[c]=true}}}if(!Object.keys(s).length){return}if(this.options.attributesGroupName){const a={};a[this.options.attributesGroupName]=s;return a}return s}}o(Kbt,"buildAttributesMap");var Ybt=o(function(t){t=t.replace(/\r\n?/g,"\n");const e=new GE("!xml");let r=e;let n="";let i="";for(let s=0;s<t.length;s++){const a=t[s];if(a==="<"){if(t[s+1]==="/"){const u=am(t,">",s,"Closing Tag is not closed.");let l=t.substring(s+2,u).trim();if(this.options.removeNSPrefix){const p=l.indexOf(":");if(p!==-1){l=l.substr(p+1)}}if(this.options.transformTagName){l=this.options.transformTagName(l)}if(r){n=this.saveTextToParentTag(n,r,i)}const c=i.substring(i.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1){throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`)}let d=0;if(c&&this.options.unpairedTags.indexOf(c)!==-1){d=i.lastIndexOf(".",i.lastIndexOf(".")-1);this.tagsNodeStack.pop()}else{d=i.lastIndexOf(".")}i=i.substring(0,d);r=this.tagsNodeStack.pop();n="";s=u}else if(t[s+1]==="?"){let u=uB(t,s,false,"?>");if(!u)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,i);if(this.options.ignoreDeclaration&&u.tagName==="?xml"||this.options.ignorePiTags){}else{const l=new GE(u.tagName);l.add(this.options.textNodeName,"");if(u.tagName!==u.tagExp&&u.attrExpPresent){l[":@"]=this.buildAttributesMap(u.tagExp,i,u.tagName)}this.addChild(r,l,i)}s=u.closeIndex+1}else if(t.substr(s+1,3)==="!--"){const u=am(t,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const l=t.substring(s+4,u-2);n=this.saveTextToParentTag(n,r,i);r.add(this.options.commentPropName,[{[this.options.textNodeName]:l}])}s=u}else if(t.substr(s+1,2)==="!D"){const u=Mbt(t,s);this.docTypeEntities=u.entities;s=u.i}else if(t.substr(s+1,2)==="!["){const u=am(t,"]]>",s,"CDATA is not closed.")-2;const l=t.substring(s+9,u);n=this.saveTextToParentTag(n,r,i);if(this.options.cdataPropName){r.add(this.options.cdataPropName,[{[this.options.textNodeName]:l}])}else{let c=this.parseTextData(l,r.tagname,i,true,false,true);if(c==void 0)c="";r.add(this.options.textNodeName,c)}s=u+2}else{let u=uB(t,s,this.options.removeNSPrefix);let l=u.tagName;const c=u.rawTagName;let d=u.tagExp;let p=u.attrExpPresent;let f=u.closeIndex;if(this.options.transformTagName){l=this.options.transformTagName(l)}if(r&&n){if(r.tagname!=="!xml"){n=this.saveTextToParentTag(n,r,i,false)}}const h=r;if(h&&this.options.unpairedTags.indexOf(h.tagname)!==-1){r=this.tagsNodeStack.pop();i=i.substring(0,i.lastIndexOf("."))}if(l!==e.tagname){i+=i?"."+l:l}if(this.isItStopNode(this.options.stopNodes,i,l)){let m="";if(d.length>0&&d.lastIndexOf("/")===d.length-1){s=u.closeIndex}else if(this.options.unpairedTags.indexOf(l)!==-1){s=u.closeIndex}else{const y=this.readStopNodeData(t,c,f+1);if(!y)throw new Error(`Unexpected end of ${c}`);s=y.i;m=y.tagContent}const g=new GE(l);if(l!==d&&p){g[":@"]=this.buildAttributesMap(d,i,l)}if(m){m=this.parseTextData(m,l,i,true,p,true,true)}i=i.substr(0,i.lastIndexOf("."));g.add(this.options.textNodeName,m);this.addChild(r,g,i)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){if(l[l.length-1]==="/"){l=l.substr(0,l.length-1);i=i.substr(0,i.length-1);d=l}else{d=d.substr(0,d.length-1)}if(this.options.transformTagName){l=this.options.transformTagName(l)}const m=new GE(l);if(l!==d&&p){m[":@"]=this.buildAttributesMap(d,i,l)}this.addChild(r,m,i);i=i.substr(0,i.lastIndexOf("."))}else{const m=new GE(l);this.tagsNodeStack.push(r);if(l!==d&&p){m[":@"]=this.buildAttributesMap(d,i,l)}this.addChild(r,m,i);r=m}n="";s=f}}}else{n+=t[s]}}return e.child},"parseXml");function Wbt(t,e,r){const n=this.options.updateTag(e.tagname,r,e[":@"]);if(n===false){}else if(typeof n==="string"){e.tagname=n;t.addChild(e)}else{t.addChild(e)}}o(Wbt,"addChild");var Jbt=o(function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(let e in this.lastEntities){const r=this.lastEntities[e];t=t.replace(r.regex,r.val)}if(this.options.htmlEntities){for(let e in this.htmlEntities){const r=this.htmlEntities[e];t=t.replace(r.regex,r.val)}}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t},"replaceEntitiesValue");function Qbt(t,e,r,n){if(t){if(n===void 0)n=Object.keys(e.child).length===0;t=this.parseTextData(t,e.tagname,r,false,e[":@"]?Object.keys(e[":@"]).length!==0:false,n);if(t!==void 0&&t!=="")e.add(this.options.textNodeName,t);t=""}return t}o(Qbt,"saveTextToParentTag");function Xbt(t,e,r){const n="*."+r;for(const i in t){const s=t[i];if(n===s||e===s)return true}return false}o(Xbt,"isItStopNode");function Zbt(t,e,r=">"){let n;let i="";for(let s=e;s<t.length;s++){let a=t[s];if(n){if(a===n)n=""}else if(a==='"'||a==="'"){n=a}else if(a===r[0]){if(r[1]){if(t[s+1]===r[1]){return{data:i,index:s}}}else{return{data:i,index:s}}}else if(a===" "){a=" "}i+=a}}o(Zbt,"tagExpWithClosingIndex");function am(t,e,r,n){const i=t.indexOf(e,r);if(i===-1){throw new Error(n)}else{return i+e.length-1}}o(am,"findClosingIndex");function uB(t,e,r,n=">"){const i=Zbt(t,e+1,n);if(!i)return;let s=i.data;const a=i.index;const u=s.search(/\s/);let l=s;let c=true;if(u!==-1){l=s.substr(0,u).replace(/\s\s*$/,"");s=s.substr(u+1)}const d=l;if(r){const p=l.indexOf(":");if(p!==-1){l=l.substr(p+1);c=l!==i.data.substr(p+1)}}return{tagName:l,tagExp:s,closeIndex:a,attrExpPresent:c,rawTagName:d}}o(uB,"readTagExp");function e3t(t,e,r){const n=r;let i=1;for(;r<t.length;r++){if(t[r]==="<"){if(t[r+1]==="/"){const s=am(t,">",r,`${e} is not closed`);let a=t.substring(r+2,s).trim();if(a===e){i--;if(i===0){return{tagContent:t.substring(n,r),i:s}}}r=s}else if(t[r+1]==="?"){const s=am(t,"?>",r+1,"StopNode is not closed.");r=s}else if(t.substr(r+1,3)==="!--"){const s=am(t,"-->",r+3,"StopNode is not closed.");r=s}else if(t.substr(r+1,2)==="!["){const s=am(t,"]]>",r,"StopNode is not closed.")-2;r=s}else{const s=uB(t,r,">");if(s){const a=s&&s.tagName;if(a===e&&s.tagExp[s.tagExp.length-1]!=="/"){i++}r=s.closeIndex}}}}}o(e3t,"readStopNodeData");function lB(t,e,r){if(e&&typeof t==="string"){const n=t.trim();if(n==="true")return true;else if(n==="false")return false;else return Bbt(t,r)}else{if(cB.isExist(t)){return t}else{return""}}}o(lB,"parseValue");N6e.exports=oB});var k6e=_(D6e=>{"use strict";function t3t(t,e){return P6e(t,e)}o(t3t,"prettify");function P6e(t,e,r){let n;const i={};for(let s=0;s<t.length;s++){const a=t[s];const u=r3t(a);let l="";if(r===void 0)l=u;else l=r+"."+u;if(u===e.textNodeName){if(n===void 0)n=a[u];else n+=""+a[u]}else if(u===void 0){continue}else if(a[u]){let c=P6e(a[u],e,l);const d=i3t(c,e);if(a[":@"]){n3t(c,a[":@"],l,e)}else if(Object.keys(c).length===1&&c[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode){c=c[e.textNodeName]}else if(Object.keys(c).length===0){if(e.alwaysCreateTextNode)c[e.textNodeName]="";else c=""}if(i[u]!==void 0&&i.hasOwnProperty(u)){if(!Array.isArray(i[u])){i[u]=[i[u]]}i[u].push(c)}else{if(e.isArray(u,l,d)){i[u]=[c]}else{i[u]=c}}}}if(typeof n==="string"){if(n.length>0)i[e.textNodeName]=n}else if(n!==void 0)i[e.textNodeName]=n;return i}o(P6e,"compress");function r3t(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const n=e[r];if(n!==":@")return n}}o(r3t,"propName");function n3t(t,e,r,n){if(e){const i=Object.keys(e);const s=i.length;for(let a=0;a<s;a++){const u=i[a];if(n.isArray(u,r+"."+u,true,true)){t[u]=[e[u]]}else{t[u]=e[u]}}}}o(n3t,"assignAttributes");function i3t(t,e){const{textNodeName:r}=e;const n=Object.keys(t).length;if(n===0){return true}if(n===1&&(t[r]||typeof t[r]==="boolean"||t[r]===0)){return true}return false}o(i3t,"isLeafTag");D6e.prettify=t3t});var L6e=_((xur,$6e)=>{var{buildOptions:s3t}=S6e();var a3t=I6e();var{prettify:o3t}=k6e();var u3t=iB();var dB=class{static{o(this,"XMLParser")}constructor(e){this.externalEntities={};this.options=s3t(e)}parse(e,r){if(typeof e==="string"){}else if(e.toString){e=e.toString()}else{throw new Error("XML data is accepted in String or Bytes[] form.")}if(r){if(r===true)r={};const s=u3t.validate(e,r);if(s!==true){throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}}const n=new a3t(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(e);if(this.options.preserveOrder||i===void 0)return i;else return o3t(i,this.options)}addEntity(e,r){if(r.indexOf("&")!==-1){throw new Error("Entity value can't have '&'")}else if(e.indexOf("&")!==-1||e.indexOf(";")!==-1){throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'")}else if(r==="&"){throw new Error("An entity with value '&' is not permitted")}else{this.externalEntities[e]=r}}};$6e.exports=dB});var M6e=_((Rur,F6e)=>{var l3t="\n";function c3t(t,e){let r="";if(e.format&&e.indentBy.length>0){r=l3t}return j6e(t,e,"",r)}o(c3t,"toXml");function j6e(t,e,r,n){let i="";let s=false;for(let a=0;a<t.length;a++){const u=t[a];const l=d3t(u);if(l===void 0)continue;let c="";if(r.length===0)c=l;else c=`${r}.${l}`;if(l===e.textNodeName){let m=u[l];if(!p3t(c,e)){m=e.tagValueProcessor(l,m);m=U6e(m,e)}if(s){i+=n}i+=m;s=false;continue}else if(l===e.cdataPropName){if(s){i+=n}i+=`<![CDATA[${u[l][0][e.textNodeName]}]]>`;s=false;continue}else if(l===e.commentPropName){i+=n+`<!--${u[l][0][e.textNodeName]}-->`;s=true;continue}else if(l[0]==="?"){const m=q6e(u[":@"],e);const g=l==="?xml"?"":n;let y=u[l][0][e.textNodeName];y=y.length!==0?" "+y:"";i+=g+`<${l}${y}${m}?>`;s=true;continue}let d=n;if(d!==""){d+=e.indentBy}const p=q6e(u[":@"],e);const f=n+`<${l}${p}`;const h=j6e(u[l],e,c,d);if(e.unpairedTags.indexOf(l)!==-1){if(e.suppressUnpairedNode)i+=f+">";else i+=f+"/>"}else if((!h||h.length===0)&&e.suppressEmptyNode){i+=f+"/>"}else if(h&&h.endsWith(">")){i+=f+`>${h}${n}</${l}>`}else{i+=f+">";if(h&&n!==""&&(h.includes("/>")||h.includes("</"))){i+=n+e.indentBy+h+n}else{i+=h}i+=`</${l}>`}s=true}return i}o(j6e,"arrToStr");function d3t(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const n=e[r];if(!t.hasOwnProperty(n))continue;if(n!==":@")return n}}o(d3t,"propName");function q6e(t,e){let r="";if(t&&!e.ignoreAttributes){for(let n in t){if(!t.hasOwnProperty(n))continue;let i=e.attributeValueProcessor(n,t[n]);i=U6e(i,e);if(i===true&&e.suppressBooleanAttributes){r+=` ${n.substr(e.attributeNamePrefix.length)}`}else{r+=` ${n.substr(e.attributeNamePrefix.length)}="${i}"`}}}return r}o(q6e,"attr_to_str");function p3t(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);let r=t.substr(t.lastIndexOf(".")+1);for(let n in e.stopNodes){if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+r)return true}return false}o(p3t,"isStopNode");function U6e(t,e){if(t&&t.length>0&&e.processEntities){for(let r=0;r<e.entities.length;r++){const n=e.entities[r];t=t.replace(n.regex,n.val)}}return t}o(U6e,"replaceEntitiesValue");F6e.exports=c3t});var V6e=_((Nur,B6e)=>{"use strict";var f3t=M6e();var h3t={attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,cdataPropName:false,format:false,indentBy:" ",suppressEmptyNode:false,suppressUnpairedNode:true,suppressBooleanAttributes:true,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:false,commentPropName:false,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:true,stopNodes:[],oneListGroup:false};function $p(t){this.options=Object.assign({},h3t,t);if(this.options.ignoreAttributes||this.options.attributesGroupName){this.isAttribute=function(){return false}}else{this.attrPrefixLen=this.options.attributeNamePrefix.length;this.isAttribute=y3t}this.processTextOrObjNode=m3t;if(this.options.format){this.indentate=g3t;this.tagEndChar=">\n";this.newLine="\n"}else{this.indentate=function(){return""};this.tagEndChar=">";this.newLine=""}}o($p,"Builder");$p.prototype.build=function(t){if(this.options.preserveOrder){return f3t(t,this.options)}else{if(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1){t={[this.options.arrayNodeName]:t}}return this.j2x(t,0).val}};$p.prototype.j2x=function(t,e){let r="";let n="";for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;if(typeof t[i]==="undefined"){if(this.isAttribute(i)){n+=""}}else if(t[i]===null){if(this.isAttribute(i)){n+=""}else if(i[0]==="?"){n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar}else{n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar}}else if(t[i]instanceof Date){n+=this.buildTextValNode(t[i],i,"",e)}else if(typeof t[i]!=="object"){const s=this.isAttribute(i);if(s){r+=this.buildAttrPairStr(s,""+t[i])}else{if(i===this.options.textNodeName){let a=this.options.tagValueProcessor(i,""+t[i]);n+=this.replaceEntitiesValue(a)}else{n+=this.buildTextValNode(t[i],i,"",e)}}}else if(Array.isArray(t[i])){const s=t[i].length;let a="";for(let u=0;u<s;u++){const l=t[i][u];if(typeof l==="undefined"){}else if(l===null){if(i[0]==="?")n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar;else n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar}else if(typeof l==="object"){if(this.options.oneListGroup){a+=this.j2x(l,e+1).val}else{a+=this.processTextOrObjNode(l,i,e)}}else{a+=this.buildTextValNode(l,i,"",e)}}if(this.options.oneListGroup){a=this.buildObjectNode(a,i,"",e)}n+=a}else{if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const s=Object.keys(t[i]);const a=s.length;for(let u=0;u<a;u++){r+=this.buildAttrPairStr(s[u],""+t[i][s[u]])}}else{n+=this.processTextOrObjNode(t[i],i,e)}}}return{attrStr:r,val:n}};$p.prototype.buildAttrPairStr=function(t,e){e=this.options.attributeValueProcessor(t,""+e);e=this.replaceEntitiesValue(e);if(this.options.suppressBooleanAttributes&&e==="true"){return" "+t}else return" "+t+'="'+e+'"'};function m3t(t,e,r){const n=this.j2x(t,r+1);if(t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1){return this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r)}else{return this.buildObjectNode(n.val,e,n.attrStr,r)}}o(m3t,"processTextOrObjNode");$p.prototype.buildObjectNode=function(t,e,r,n){if(t===""){if(e[0]==="?")return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;else{return this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar}}else{let i="</"+e+this.tagEndChar;let s="";if(e[0]==="?"){s="?";i=""}if((r||r==="")&&t.indexOf("<")===-1){return this.indentate(n)+"<"+e+r+s+">"+t+i}else if(this.options.commentPropName!==false&&e===this.options.commentPropName&&s.length===0){return this.indentate(n)+`<!--${t}-->`+this.newLine}else{return this.indentate(n)+"<"+e+r+s+this.tagEndChar+t+this.indentate(n)+i}}};$p.prototype.closeTag=function(t){let e="";if(this.options.unpairedTags.indexOf(t)!==-1){if(!this.options.suppressUnpairedNode)e="/"}else if(this.options.suppressEmptyNode){e="/"}else{e=`></${t}`}return e};$p.prototype.buildTextValNode=function(t,e,r,n){if(this.options.cdataPropName!==false&&e===this.options.cdataPropName){return this.indentate(n)+`<![CDATA[${t}]]>`+this.newLine}else if(this.options.commentPropName!==false&&e===this.options.commentPropName){return this.indentate(n)+`<!--${t}-->`+this.newLine}else if(e[0]==="?"){return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar}else{let i=this.options.tagValueProcessor(e,t);i=this.replaceEntitiesValue(i);if(i===""){return this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar}else{return this.indentate(n)+"<"+e+r+">"+i+"</"+e+this.tagEndChar}}};$p.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities){for(let e=0;e<this.options.entities.length;e++){const r=this.options.entities[e];t=t.replace(r.regex,r.val)}}return t};function g3t(t){return this.options.indentBy.repeat(t)}o(g3t,"indentate");function y3t(t){if(t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName){return t.substr(this.attrPrefixLen)}else{return false}}o(y3t,"isAttribute");B6e.exports=$p});var z6e=_((Pur,H6e)=>{"use strict";var v3t=iB();var _3t=L6e();var E3t=V6e();H6e.exports={XMLParser:_3t,XMLValidator:v3t,XMLBuilder:E3t}});var J6e=_(_s=>{"use strict";var b3t=_s&&_s.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var w3t=_s&&_s.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var S3t=_s&&_s.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))b3t(e,t,r)}w3t(e,t);return e};var om=_s&&_s.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)};var W6e=_s&&_s.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};var Hc;var e7;var YE;Object.defineProperty(_s,"__esModule",{value:true});_s.TransferManager=_s.MultiPartUploadError=void 0;var KE=W6e(IM());var Lp=S3t(require("path"));var XT=require("fs");var T3t=UE();var A3t=KS();var G6e=z6e();var ZT=W6e(OE());var x3t=require("crypto");var pB=rm();var K6e=yl();var C3t=bg();var R3t=(0,C3t.getPackageJSON)();var O3t=5;var N3t=5;var I3t=5;var P3t=32*1024*1024;var D3t=32*1024*1024;var k3t=32*1024*1024;var Y6e=5;var $3t="(?:)";var qg={UPLOAD_MANY:"tm.upload_many",DOWNLOAD_MANY:"tm.download_many",UPLOAD_SHARDED:"tm.upload_sharded",DOWNLOAD_SHARDED:"tm.download_sharded"};var L3t=o((t,e,r,n)=>{return new fB(t,e,r,n)},"defaultMultiPartGenerator");var WE=class extends Error{static{o(this,"MultiPartUploadError")}constructor(e,r,n){super(e);this.uploadId=r;this.partsMap=n}};_s.MultiPartUploadError=WE;var fB=class{static{o(this,"XMLMultiPartUploadHelper")}constructor(e,r,n,i){Hc.add(this);this.authClient=e.storage.authClient||new A3t.GoogleAuth;this.uploadId=n||"";this.bucket=e;this.fileName=r;this.baseUrl=`https://${e.name}.${new URL(this.bucket.storage.apiEndpoint).hostname}/${r}`;this.xmlBuilder=new G6e.XMLBuilder({arrayNodeName:"Part"});this.xmlParser=new G6e.XMLParser;this.partsMap=i||new Map;this.retryOptions={retries:this.bucket.storage.retryOptions.maxRetries,factor:this.bucket.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.bucket.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.bucket.storage.retryOptions.totalTimeout*1e3}}async initiateUpload(e={}){const r=`${this.baseUrl}?uploads`;return(0,ZT.default)(async n=>{try{const i=await this.authClient.request({headers:om(this,Hc,"m",e7).call(this,e),method:"POST",url:r});if(i.data&&i.data.error){throw i.data.error}const s=this.xmlParser.parse(i.data);this.uploadId=s.InitiateMultipartUploadResult.UploadId}catch(i){om(this,Hc,"m",YE).call(this,i,n)}},this.retryOptions)}async uploadPart(e,r,n){const i=`${this.baseUrl}?partNumber=${e}&uploadId=${this.uploadId}`;let s=om(this,Hc,"m",e7).call(this);if(n==="md5"){const a=(0,x3t.createHash)("md5").update(r).digest("base64");s={"Content-MD5":a}}return(0,ZT.default)(async a=>{try{const u=await this.authClient.request({url:i,method:"PUT",body:r,headers:s});if(u.data&&u.data.error){throw u.data.error}this.partsMap.set(e,u.headers["etag"])}catch(u){om(this,Hc,"m",YE).call(this,u,a)}},this.retryOptions)}async completeUpload(){const e=`${this.baseUrl}?uploadId=${this.uploadId}`;const r=new Map([...this.partsMap.entries()].sort((s,a)=>s[0]-a[0]));const n=[];for(const s of r.entries()){n.push({PartNumber:s[0],ETag:s[1]})}const i=`<CompleteMultipartUpload>${this.xmlBuilder.build(n)}</CompleteMultipartUpload>`;return(0,ZT.default)(async s=>{try{const a=await this.authClient.request({headers:om(this,Hc,"m",e7).call(this),url:e,method:"POST",body:i});if(a.data&&a.data.error){throw a.data.error}return a}catch(a){om(this,Hc,"m",YE).call(this,a,s);return}},this.retryOptions)}async abortUpload(){const e=`${this.baseUrl}?uploadId=${this.uploadId}`;return(0,ZT.default)(async r=>{try{const n=await this.authClient.request({url:e,method:"DELETE"});if(n.data&&n.data.error){throw n.data.error}}catch(n){om(this,Hc,"m",YE).call(this,n,r);return}},this.retryOptions)}};Hc=new WeakSet,e7=o(function t(e={}){let r=false;let n=false;for(const[i,s]of Object.entries(e)){if(i.toLocaleLowerCase().trim()==="x-goog-api-client"){r=true;if(!s.includes(qg.UPLOAD_SHARDED)){e[i]=`${s} gccl-gcs-cmd/${qg.UPLOAD_SHARDED}`}}else if(i.toLocaleLowerCase().trim()==="user-agent"){n=true}}if(!r){e["x-goog-api-client"]=`${(0,K6e.getRuntimeTrackingString)()} gccl/${R3t.version} gccl-gcs-cmd/${qg.UPLOAD_SHARDED}`}if(!n){e["User-Agent"]=(0,K6e.getUserAgentString)()}return e},"_XMLMultiPartUploadHelper_setGoogApiClientHeaders"),YE=o(function t(e,r){if(this.bucket.storage.retryOptions.autoRetry&&this.bucket.storage.retryOptions.retryableErrorFn(e)){throw e}else{r(e)}},"_XMLMultiPartUploadHelper_handleErrorResponse");var hB=class{static{o(this,"TransferManager")}constructor(e){this.bucket=e}async uploadManyFiles(e,r={}){var n;if(r.skipIfExists&&((n=r.passthroughOptions)===null||n===void 0?void 0:n.preconditionOpts)){r.passthroughOptions.preconditionOpts.ifGenerationMatch=0}else if(r.skipIfExists&&r.passthroughOptions===void 0){r.passthroughOptions={preconditionOpts:{ifGenerationMatch:0}}}const i=(0,KE.default)(r.concurrencyLimit||O3t);const s=[];let a=[];if(!Array.isArray(e)){for await(const u of this.getPathsFromDirectory(e)){a.push(u)}}else{a=e}for(const u of a){const l=await XT.promises.lstat(u);if(l.isDirectory()){continue}const c={...r.passthroughOptions,[pB.GCCL_GCS_CMD_KEY]:qg.UPLOAD_MANY};c.destination=u.split(Lp.sep).join(Lp.posix.sep);if(r.prefix){c.destination=Lp.posix.join(...r.prefix.split(Lp.sep),c.destination)}s.push(i(()=>this.bucket.upload(u,c)))}return Promise.all(s)}async downloadManyFiles(e,r={}){const n=(0,KE.default)(r.concurrencyLimit||N3t);const i=[];let s=[];if(!Array.isArray(e)){const l=await this.bucket.getFiles({prefix:e});s=l[0]}else{s=e.map(l=>{if(typeof l==="string"){return this.bucket.file(l)}return l})}const a=r.stripPrefix?`^${r.stripPrefix}`:$3t;const u=new RegExp(a,"g");for(const l of s){const c={...r.passthroughOptions,[pB.GCCL_GCS_CMD_KEY]:qg.DOWNLOAD_MANY};if(r.prefix){c.destination=Lp.join(r.prefix||"",c.destination||"",l.name)}if(r.stripPrefix){c.destination=l.name.replace(u,"")}i.push(n(()=>l.download(c)))}return Promise.all(i)}async downloadFileInChunks(e,r={}){let n=r.chunkSizeBytes||D3t;let i=(0,KE.default)(r.concurrencyLimit||I3t);const s=[];const a=typeof e==="string"?this.bucket.file(e):e;const u=await a.get();const l=parseInt(u[0].metadata.size.toString());if(l<P3t){i=(0,KE.default)(1);n=l}let c=0;const d=r.destination||Lp.basename(a.name);const p=await XT.promises.open(d,"w");while(c<l){const h=c;let m=c+n-1;m=m>l?l:m;s.push(i(async()=>{const g=await a.download({start:h,end:m,[pB.GCCL_GCS_CMD_KEY]:qg.DOWNLOAD_SHARDED});return p.write(g[0],0,g[0].length,h)}));c+=n}let f;try{const h=await Promise.all(s);f=h.map(m=>m.buffer);if(r.validation==="crc32c"){await T3t.CRC32C.fromFile(d)}return f}finally{p.close()}}async uploadFileInChunks(e,r={},n=L3t){const i=r.chunkSizeBytes||k3t;const s=(0,KE.default)(r.concurrencyLimit||Y6e);const a=r.maxQueueSize||r.concurrencyLimit||Y6e;const u=r.uploadName||Lp.basename(e);const l=n(this.bucket,u,r.uploadId,r.partsMap);let c=1;let d=[];try{if(r.uploadId===void 0){await l.initiateUpload(r.headers)}const p=l.partsMap.size*i;const f=(0,XT.createReadStream)(e,{highWaterMark:i,start:p});for await(const h of f){if(d.length>=a){await Promise.all(d);d=[]}d.push(s(()=>l.uploadPart(c++,h,r.validation)))}await Promise.all(d);return await l.completeUpload()}catch(p){if((r.autoAbortFailure===void 0||r.autoAbortFailure)&&l.uploadId){try{await l.abortUpload();return}catch(f){throw new WE(f.message,l.uploadId,l.partsMap)}}throw new WE(p.message,l.uploadId,l.partsMap)}}async*getPathsFromDirectory(e){const r=await XT.promises.readdir(e,{withFileTypes:true});for(const n of r){const i=Lp.join(e,n.name);n.isDirectory()?yield*this.getPathsFromDirectory(i):yield i}}};_s.TransferManager=hB});var X6e=_(fn=>{"use strict";var q3t=fn&&fn.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var mB=fn&&fn.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))q3t(e,t,r)};Object.defineProperty(fn,"__esModule",{value:true});fn.Notification=fn.Iam=fn.HmacKey=fn.File=fn.Channel=fn.Bucket=fn.Storage=fn.IdempotencyStrategy=fn.ApiError=void 0;var j3t=xp();Object.defineProperty(fn,"ApiError",{enumerable:true,get:function(){return j3t.ApiError}});var Q6e=Ig();Object.defineProperty(fn,"IdempotencyStrategy",{enumerable:true,get:function(){return Q6e.IdempotencyStrategy}});Object.defineProperty(fn,"Storage",{enumerable:true,get:function(){return Q6e.Storage}});var U3t=FT();Object.defineProperty(fn,"Bucket",{enumerable:true,get:function(){return U3t.Bucket}});mB(UE(),fn);var F3t=ZM();Object.defineProperty(fn,"Channel",{enumerable:true,get:function(){return F3t.Channel}});var M3t=FE();Object.defineProperty(fn,"File",{enumerable:true,get:function(){return M3t.File}});mB(VM(),fn);var B3t=eB();Object.defineProperty(fn,"HmacKey",{enumerable:true,get:function(){return B3t.HmacKey}});var V3t=YM();Object.defineProperty(fn,"Iam",{enumerable:true,get:function(){return V3t.Iam}});var H3t=WM();Object.defineProperty(fn,"Notification",{enumerable:true,get:function(){return H3t.Notification}});mB(J6e(),fn)});var yB=_(hr=>{"use strict";var gB=hr&&hr.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(hr,"__esModule",{value:true});hr.deleteFolder=hr.untar=hr.tarFolderContent=hr.getParentDirFilename=hr.safePath=hr.UnsafePathError=hr.ensureDirectoryExists=hr.mkdirForFilePathIfNotExits=hr.mkdirIfNotExists=hr.listFolderContents=hr.listFolders=hr.isNotFileOrDirectory=hr.dirExists=hr.deleteFile=hr.fileExists=void 0;var Z6e=gB(require("child_process"));var jp=gB(require("fs/promises"));var qp=gB(require("path"));var ebe=[".git","node_modules",".yarn",".DS_Store"];async function z3t(t){try{const e=await jp.default.stat(t);return e.isFile()}catch(e){return false}}o(z3t,"fileExists");hr.fileExists=z3t;async function G3t(t,e){return await jp.default.rm(t,e)}o(G3t,"deleteFile");hr.deleteFile=G3t;async function r7(t){try{const e=await jp.default.stat(t);return e.isDirectory()}catch(e){return false}}o(r7,"dirExists");hr.dirExists=r7;async function K3t(t){try{await jp.default.stat(t);return false}catch(e){return true}}o(K3t,"isNotFileOrDirectory");hr.isNotFileOrDirectory=K3t;function Y3t(t,e){const r=new RegExp(`(.*)(\\/${e})$|(.*)(${e}\\/)`);const n=t.match(r);if(!n){return""}const i=t.split(n[0]);return i[1]===""?"":`/${i[1]}`}o(Y3t,"getParentDirectory");async function W3t(t){if(!await r7(t)){return[]}const e=await jp.default.readdir(t,{withFileTypes:true});const r=[];for await(const n of e){if(!ebe.includes(n.name)){if(n.isDirectory()){r.push(n.name)}}}return r}o(W3t,"listFolders");hr.listFolders=W3t;async function tbe(t,e,r=true){const n=Y3t(t,e);const i=await jp.default.readdir(t,{withFileTypes:true});const s=[];for await(const a of i){if(!ebe.includes(a.name)||!r){if(a.isDirectory()){const u=await tbe(qp.default.join(t,a.name),e,r);s.push(...u)}else{s.push(qp.default.join(n,a.name))}}}return s}o(tbe,"listFolderContents");hr.listFolderContents=tbe;var J3t=o(async t=>{if(await r7(t)){return true}await jp.default.mkdir(t,{recursive:true})},"mkdirIfNotExists");hr.mkdirIfNotExists=J3t;var Q3t=o(async t=>{const e=qp.default.dirname(t);return(0,hr.mkdirIfNotExists)(e)},"mkdirForFilePathIfNotExits");hr.mkdirForFilePathIfNotExits=Q3t;hr.ensureDirectoryExists=hr.mkdirForFilePathIfNotExits;var t7=class extends Error{static{o(this,"UnsafePathError")}constructor(e){super(e)}};hr.UnsafePathError=t7;function X3t(t){const e=o(r=>{if(!r.startsWith(t)){throw new t7(`Resolved path is not part of the project.`)}return r},"ensureSafePath");return{resolve:(...r)=>e(qp.default.resolve(...r))}}o(X3t,"safePath");hr.safePath=X3t;function Z3t(t){return`${qp.default.basename(qp.default.dirname(t))}/${qp.default.basename(t)}`}o(Z3t,"getParentDirFilename");hr.getParentDirFilename=Z3t;function e8t(t,e,r,n){const i=qp.default.join(n,r);Z6e.default.execSync(`tar --exclude='.git/' --exclude='dist/' -czf ${i} ${e}`,{cwd:t});return i}o(e8t,"tarFolderContent");hr.tarFolderContent=e8t;function t8t(t,e,r,n=false){Z6e.default.execSync(`tar -xf ${e} ${n?"--strip-components=1 ":""}-C ${r}`,{cwd:t})}o(t8t,"untar");hr.untar=t8t;async function r8t(t){if(await r7(t)){return await jp.default.rm(t,{recursive:true})}}o(r8t,"deleteFolder");hr.deleteFolder=r8t});var abe=_(er=>{"use strict";var n8t=er&&er.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var i8t=er&&er.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var s8t=er&&er.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))n8t(e,t,r)}i8t(e,t);return e};var rbe=er&&er.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(er,"__esModule",{value:true});er.uploadFolderAndRemoveMissingSourceFiles=er.cleanGCPFilePaths=er.uploadFolder=er.deleteDirectory=er.deleteFile=er.listFolderContent=er.readFileStream=er.fileExists=er.getFileContents=er.downloadFile=er.uploadFromMemory=er.uploadFile=er.getBucket=er.BucketName=void 0;var a8t=X6e();var zc=rbe(require("path"));var Tl=rbe(Oa());var n7=s8t(yB());var um;(function(t){t[t["Archive"]=0]="Archive";t[t["Bundle"]=1]="Bundle";t[t["SourceCode"]=2]="SourceCode";t[t["Sources"]=3]="Sources";t[t["DevPortalBuild"]=4]="DevPortalBuild"})(um||(er.BucketName=um={}));function Al(t){let e;if(t===um.Archive){if(Tl.default.GCP_STORAGE_ARCHIVE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_ARCHIVE_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_ARCHIVE_BUCKET_NAME}else if(t===um.Bundle){if(Tl.default.GCP_STORAGE_BUNDLE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_BUNDLE_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_BUNDLE_BUCKET_NAME}else if(t===um.SourceCode){if(Tl.default.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_SOURCE_CODE_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}else if(t===um.Sources){if(Tl.default.GCP_STORAGE_SOURCES_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_SOURCES_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_SOURCES_BUCKET_NAME}else if(t===um.DevPortalBuild){if(Tl.default.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME must be set`)}e=Tl.default.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}else{throw new Error("Invalid value for argument 'bucketName'")}const r=new a8t.Storage;return r.bucket(e)}o(Al,"getBucket");er.getBucket=Al;async function vB(t,e,r,n,i){try{await Al(t).upload(e,{destination:r,metadata:i})}catch(s){n.info(`File upload for ${t}/${r} ran into an issue`);n.error(s)}}o(vB,"uploadFile");er.uploadFile=vB;async function o8t(t,e,r,n,i){try{await Al(t).file(r).save(e,i)}catch(s){n.info(`From Memory upload for ${t}/${r} ran into an issue`);n.error(s)}}o(o8t,"uploadFromMemory");er.uploadFromMemory=o8t;async function u8t(t,e,r,n){try{const i={destination:r};await Al(t).file(e).download(i);n.info(`File ${t}/${e} successfully downloaded to ${r}`)}catch(i){n.info(`Downloading file ${t}/${e} ran into an issue`);n.error(i)}}o(u8t,"downloadFile");er.downloadFile=u8t;async function l8t(t,e,r){try{const n=await Al(t).file(e).download();r.info(`File ${t}/${e} successfully downloaded to memory`);return n.toString()}catch(n){r.info(`Downloading file ${t}/${e} ran into an issue`);r.error(n)}}o(l8t,"getFileContents");er.getFileContents=l8t;async function c8t(t,e,r){try{r.info(`Check if file ${t}/${e} exists in storage`);const n=await Al(t).file(e).exists();return n[0]}catch(n){r.info(`Ran into an issue while checking if a file ${t}/${e} exists in storage`);r.error(n);return false}}o(c8t,"fileExists");er.fileExists=c8t;function d8t(t,e,r){r.info(`Reading file ${t}/${e} from storage`);return Al(t).file(e).createReadStream({decompress:true})}o(d8t,"readFileStream");er.readFileStream=d8t;async function nbe(t,e,r){const n=new Set;try{const[i]=await Al(t).getFiles({prefix:e});for(let s=0;s<i.length;s++){const a=i[s];const u=a.name.replace(e,"");if(u===""){continue}const l=u.split("/");if(l.length>1){for(let c=0;c<l.length-1;c++){const d=`/${l[c]}`;if(!n.has(d)){n.add(d)}}}n.add(`/${u}`)}}catch(i){r.info(`Ran into an issue while listing files in ${t}/${e} storage path`);r.error(i)}return[...n]}o(nbe,"listFolderContent");er.listFolderContent=nbe;async function ibe(t,e,r){try{r.info(`Deleting file ${t}/${e} from storage`);await Al(t).file(e).delete()}catch(n){r.warn(`Failed to delete file ${t}/${e} from storage`);r.error(n)}}o(ibe,"deleteFile");er.deleteFile=ibe;async function p8t(t,e,r){try{r.info(`Deleting directory ${t}/${e} from storage`);await Al(t).deleteFiles({prefix:e})}catch(n){r.info(`Failed to delete directory ${t}/${e} from storage`);r.error(n)}}o(p8t,"deleteDirectory");er.deleteDirectory=p8t;async function f8t(t,e,r,n,i){try{n.info(`Upload folder ${zc.default.basename(e)}`);if(await n7.dirExists(e)){const s=await n7.listFolderContents(e,zc.default.basename(e));if(s&&s.length>0){await Promise.all(s.map(async a=>{return await vB(t,zc.default.join(e,a),zc.default.join(r,a),n,i)}))}}}catch(s){n.warn(`Failed to upload directory ${e} to bucket ${t}`,s)}}o(f8t,"uploadFolder");er.uploadFolder=f8t;function sbe(t){const e=t.filter(r=>r!=="/").map(r=>r.replace(/^\/+/,""));return e}o(sbe,"cleanGCPFilePaths");er.cleanGCPFilePaths=sbe;async function h8t(t,e,r,n,i){try{n.info(`uploadFolderAndRemoveMissingSourceFiles: upload folder ${zc.default.basename(e)}`);if(await n7.dirExists(e)){const s=await nbe(t,r,n);const a=sbe(s);const u=await n7.listFolderContents(e,zc.default.basename(e));const l=a.filter(c=>!u.includes(c)).map(c=>zc.default.join(r,c));await Promise.all(l.map(async c=>{return await ibe(t,c,n)}));await Promise.all(u.map(async c=>{return await vB(t,zc.default.join(e,c),zc.default.join(r,c),n,i)}))}}catch(s){n.warn(`Failed to upload directory ${e} to bucket ${t}`,s)}}o(h8t,"uploadFolderAndRemoveMissingSourceFiles");er.uploadFolderAndRemoveMissingSourceFiles=h8t});var obe=_(i7=>{"use strict";Object.defineProperty(i7,"__esModule",{value:true});i7.graphQL=void 0;var xl=As();async function m8t(t,e,r){const n=await fetch(`https://api.github.com/graphql`,{method:"POST",headers:{Authorization:`Bearer ${e}`},body:t});if(n.status===401){r.warn("Failed GitHub GraphQL query with status 401. User token might have been revoked directly in GitHub.");throw new xl.ApiError(xl.Problems.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS)}if(n.status===403){r.warn("Failed GitHub GraphQL query with status 403. User token does not have correct permissions to query this GitHub API.");throw new xl.ApiError(xl.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}if(n.status===404){r.warn("Failed GitHub GraphQL query with status 404. User token has been revoked and can not query this GitHub API.");throw new xl.ApiError(xl.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}if(n.status===400){const i=await n.json();r.warn("Failed GitHub GraphQL query with status 400. A malformed query was ran against the GitHub API.",i);throw new xl.ApiError(xl.Problems.BAD_REQUEST)}if(n.status!==200&&n.status!==304){r.warn(`Failed GitHub GraphQL query with status ${n.status}. There was an unexpected error querying the GitHub API.`);throw new xl.ApiError(xl.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}return n}o(m8t,"graphQL");i7.graphQL=m8t});var fbe=_(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:true});xo.SourceControlProvider=xo.PlanType=xo.EnvironmentType=xo.EnvironmentTarget=xo.DeploymentState=void 0;var ube;(function(t){t[t["IS_STARTING"]=0]="IS_STARTING";t[t["STARTED"]=1]="STARTED";t[t["STOPPED"]=2]="STOPPED";t[t["ERRORED"]=3]="ERRORED"})(ube||(xo.DeploymentState=ube={}));var lbe;(function(t){t["CLOUDFLARE"]="CLOUDFLARE";t["KNATIVE"]="KNATIVE"})(lbe||(xo.EnvironmentTarget=lbe={}));var cbe;(function(t){t["PRODUCTION"]="PRODUCTION";t["PREVIEW"]="PREVIEW";t["WORKING_COPY"]="WORKING_COPY"})(cbe||(xo.EnvironmentType=cbe={}));var dbe;(function(t){t["FREE_V1"]="FREE_V1";t["BUILDER_V1"]="BUILDER_V1";t["BUSINESS_V1"]="BUSINESS_V1";t["CUSTOM"]="CUSTOM";t["EMPLOYEE"]="EMPLOYEE";t["CUSTOM_TRIAL_V1"]="CUSTOM_TRIAL_V1"})(dbe||(xo.PlanType=dbe={}));var pbe;(function(t){t["GITHUB"]="GITHUB";t["GITLAB"]="GITLAB";t["BITBUCKET"]="BITBUCKET"})(pbe||(xo.SourceControlProvider=pbe={}))});var mbe=_(hbe=>{"use strict";Object.defineProperty(hbe,"__esModule",{value:true})});var gbe=_(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:true});Co.INTERNAL_ROUTE_VENDOR_TAG=Co.ZUPLO_OPEN_API_ROUTE_KEY=Co.ZUPLO_OPEN_API_PATH_KEY=Co.ZUPLO_OPEN_API_VENDOR_PREFIX=void 0;Co.ZUPLO_OPEN_API_VENDOR_PREFIX="x-zuplo";Co.ZUPLO_OPEN_API_PATH_KEY=`${Co.ZUPLO_OPEN_API_VENDOR_PREFIX}-path`;Co.ZUPLO_OPEN_API_ROUTE_KEY=`${Co.ZUPLO_OPEN_API_VENDOR_PREFIX}-route`;Co.INTERNAL_ROUTE_VENDOR_TAG="x-internal"});var ybe=_((zur,g8t)=>{g8t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/dev-portal.json",title:"Dev Portal Config",description:"",type:"object",required:[],additionalProperties:false,$defs:{ApiKeysConfig:{type:"object",additionalProperties:false,required:["bucketName"],properties:{bucketName:{type:"string"},apiKey:{type:"string"}}},DevPortalOAuthClientConfig:{type:"object",additionalProperties:false,required:["clientId"],properties:{clientId:{type:"string"},audience:{type:"string",description:"The audience of the API (i.e. the Zup's URL)\nOkta: not required\nAuth0: https://my-api.example.com/"}}},DevPortalOAuthClientCredentialsConfig:{type:"object",description:"This is the M2M configuration used to authenticate with OAuth provider in order to manage OAuth clients",required:["clientId","clientSecret"],additionalProperties:false,properties:{clientId:{type:"string"},clientSecret:{type:"string"}}},DevPortalAPIKeyCredentialConfig:{type:"object",description:"API Key credentials to access identity provider API",required:["apiKey"],additionalProperties:false,properties:{apiKey:{type:"string"}}},DevPortalOAuthConfig:{type:"object",description:"Settings for OAuth that is used to authenticate end-users to the developer portal and (optionally) for configuring issuing of OAuth Client Consumers using the identity provider",required:["provider","authority","jwksUrl"],additionalProperties:false,properties:{provider:{type:"string",enum:["okta","auth0","azure-ad","clerk","oidc"]},authority:{type:"string",description:"This is the full URL of the authorization server.\nOkta: https://dev-1235.okta.com/oauth2/aus123152352342\nAuth0: https://my-account.us.auth0.com\nAzure Active Directory: https://login.microsoftonline.com/{tenant}/v2.0\nClerk: https://your-account-23.clerk.accounts.dev"},jwksUrl:{type:"string",description:"The url of of the JWKS"},devPortalClient:{description:"This is the client that is used to authenticate end-users to the Zuplo developer portal",$ref:"#/$defs/DevPortalOAuthClientConfig"},managementClient:{oneOf:[{$ref:"#/$defs/DevPortalOAuthClientCredentialsConfig"},{$ref:"#/$defs/DevPortalAPIKeyCredentialConfig"}]}}},DevPortalExternalAuthConfig:{type:"object",description:"Settings for external auth that is used to authenticate end-users to the developer portal",additionalProperties:false,required:["loginUrl","provider","logoutUrl"],properties:{provider:{type:"string",enum:["external"]},loginUrl:{type:"string",description:"The URL of your external login page"},logoutUrl:{type:"string",description:"The URL of your external logout endpoint"}}},DevPortalAuthConfig:{type:"object",oneOf:[{$ref:"#/$defs/DevPortalOAuthConfig"},{$ref:"#/$defs/DevPortalExternalAuthConfig"}]},DevPortalMonetizationConfig:{type:"object",description:"Settings for monetization features like self-serve checkout and subscription management",oneOf:[{$ref:"#/$defs/DevPortalStripeMonetizationConfig"}]},DevPortalStripeMonetizationConfig:{type:"object",description:"Settings used to configure Stripe for monetization features like self-serve checkout and subscription management",additionalProperties:false,required:["provider","publishableKey","pricingTableId","secretKey"],properties:{provider:{type:"string",enum:["stripe"]},publishableKey:{type:"string",description:"Your Stripe publishable key - found under Developers > API keys > Standard keys"},secretKey:{type:"string",description:"Your Stripe secret key - found under Developers > API keys > Standard keys"},pricingTableId:{type:"string",description:"The ID of the pricing table that will be used to display pricing information to end-users"},meteringBucketId:{type:"string",description:"The ID of the metering bucket that will be used to track usage of the API"}}}},properties:{$schema:{type:"string"},enabled:{description:"If the developer portal is enabled",type:"boolean",default:true},authentication:{description:"Authentication configuration",$ref:"#/$defs/DevPortalAuthConfig"},monetization:{description:"Monetization configuration",$ref:"#/$defs/DevPortalMonetizationConfig"},sitePathname:{type:"string",default:"/docs"},faviconUrl:{type:"string",description:"The favicon url"},pageTitle:{type:"string",description:"The default page title"},enableAuthentication:{type:"boolean",description:"If sign in to the developer portal is enabled."},enableMonetization:{type:"boolean",description:"If monetization features like self-serve checkout and subscription management are enabled."},enableMetering:{type:"boolean",description:"If monetization features like self-serve checkout and subscription management are enabled."},requireAuthentication:{type:"boolean",default:false,description:"If authentication is required to access the developer portal. If false, the developer portal will be publicly accessible."},authorizePathname:{type:"string",default:"/oauth/authorize",description:"The path that starts the OAuth flow for third-party-apps"},apiKeys:{description:"Api Keys Service Configuration",$ref:"#/$defs/ApiKeysConfig"},generateExamples:{type:"boolean",default:true,description:"If false, the developer portal will no longer generate examples for endpoints that do not have examples defined"}}}});var XE=_(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:true});qr.regexpCode=qr.getEsmExportName=qr.getProperty=qr.safeStringify=qr.stringify=qr.strConcat=qr.addCodeArg=qr.str=qr._=qr.nil=qr._Code=qr.Name=qr.IDENTIFIER=qr._CodeOrName=void 0;var JE=class{static{o(this,"_CodeOrName")}};qr._CodeOrName=JE;qr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var lm=class extends JE{static{o(this,"Name")}constructor(e){super();if(!qr.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}};qr.Name=lm;var Ro=class extends JE{static{o(this,"_Code")}constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>{if(n instanceof lm)r[n.str]=(r[n.str]||0)+1;return r},{})}};qr._Code=Ro;qr.nil=new Ro("");function vbe(t,...e){const r=[t[0]];let n=0;while(n<e.length){EB(r,e[n]);r.push(t[++n])}return new Ro(r)}o(vbe,"_");qr._=vbe;var _B=new Ro("+");function _be(t,...e){const r=[QE(t[0])];let n=0;while(n<e.length){r.push(_B);EB(r,e[n]);r.push(_B,QE(t[++n]))}y8t(r);return new Ro(r)}o(_be,"str");qr.str=_be;function EB(t,e){if(e instanceof Ro)t.push(...e._items);else if(e instanceof lm)t.push(e);else t.push(E8t(e))}o(EB,"addCodeArg");qr.addCodeArg=EB;function y8t(t){let e=1;while(e<t.length-1){if(t[e]===_B){const r=v8t(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}o(y8t,"optimize");function v8t(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string"){if(e instanceof lm||t[t.length-1]!=='"')return;if(typeof e!="string")return`${t.slice(0,-1)}${e}"`;if(e[0]==='"')return t.slice(0,-1)+e.slice(1);return}if(typeof e=="string"&&e[0]==='"'&&!(t instanceof lm))return`"${t}${e.slice(1)}`;return}o(v8t,"mergeExprItems");function _8t(t,e){return e.emptyStr()?t:t.emptyStr()?e:_be`${t}${e}`}o(_8t,"strConcat");qr.strConcat=_8t;function E8t(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:QE(Array.isArray(t)?t.join(","):t)}o(E8t,"interpolate");function b8t(t){return new Ro(QE(t))}o(b8t,"stringify");qr.stringify=b8t;function QE(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(QE,"safeStringify");qr.safeStringify=QE;function w8t(t){return typeof t=="string"&&qr.IDENTIFIER.test(t)?new Ro(`.${t}`):vbe`[${t}]`}o(w8t,"getProperty");qr.getProperty=w8t;function S8t(t){if(typeof t=="string"&&qr.IDENTIFIER.test(t)){return new Ro(`${t}`)}throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}o(S8t,"getEsmExportName");qr.getEsmExportName=S8t;function T8t(t){return new Ro(t.toString())}o(T8t,"regexpCode");qr.regexpCode=T8t});var TB=_(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:true});js.ValueScope=js.ValueScopeName=js.Scope=js.varKinds=js.UsedValueState=void 0;var va=XE();var bB=class extends Error{static{o(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}};var wB;(function(t){t[t["Started"]=0]="Started";t[t["Completed"]=1]="Completed"})(wB=js.UsedValueState||(js.UsedValueState={}));js.varKinds={const:new va.Name("const"),let:new va.Name("let"),var:new va.Name("var")};var s7=class{static{o(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={};this._prefixes=e;this._parent=r}toName(e){return e instanceof va.Name?e:this.name(e)}name(e){return new va.Name(this._newName(e))}_newName(e){const r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e)){throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`)}return this._names[e]={prefix:e,index:0}}};js.Scope=s7;var a7=class extends va.Name{static{o(this,"ValueScopeName")}constructor(e,r){super(r);this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e;this.scopePath=(0,va._)`.${new va.Name(r)}[${n}]`}};js.ValueScopeName=a7;var A8t=(0,va._)`\n`;var SB=class extends s7{static{o(this,"ValueScope")}constructor(e){super(e);this._values={};this._scope=e.scope;this.opts={...e,_n:e.lines?A8t:va.nil}}get(){return this._scope}name(e){return new a7(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(e);const{prefix:s}=i;const a=(n=r.key)!==null&&n!==void 0?n:r.ref;let u=this._values[s];if(u){const d=u.get(a);if(d)return d}else{u=this._values[s]=new Map}u.set(a,i);const l=this._scope[s]||(this._scope[s]=[]);const c=l.length;l[c]=r.ref;i.setValue(r,{property:s,itemIndex:c});return i}getValue(e,r){const n=this._values[e];if(!n)return;return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,va._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=va.nil;for(const a in e){const u=e[a];if(!u)continue;const l=n[a]=n[a]||new Map;u.forEach(c=>{if(l.has(c))return;l.set(c,wB.Started);let d=r(c);if(d){const p=this.opts.es5?js.varKinds.var:js.varKinds.const;s=(0,va._)`${s}${p} ${c} = ${d};${this.opts._n}`}else if(d=i===null||i===void 0?void 0:i(c)){s=(0,va._)`${s}${d}${this.opts._n}`}else{throw new bB(c)}l.set(c,wB.Completed)})}return s}};js.ValueScope=SB});var Pt=_(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:true});Yt.or=Yt.and=Yt.not=Yt.CodeGen=Yt.operators=Yt.varKinds=Yt.ValueScopeName=Yt.ValueScope=Yt.Scope=Yt.Name=Yt.regexpCode=Yt.stringify=Yt.getProperty=Yt.nil=Yt.strConcat=Yt.str=Yt._=void 0;var Er=XE();var Au=TB();var Up=XE();Object.defineProperty(Yt,"_",{enumerable:true,get:function(){return Up._}});Object.defineProperty(Yt,"str",{enumerable:true,get:function(){return Up.str}});Object.defineProperty(Yt,"strConcat",{enumerable:true,get:function(){return Up.strConcat}});Object.defineProperty(Yt,"nil",{enumerable:true,get:function(){return Up.nil}});Object.defineProperty(Yt,"getProperty",{enumerable:true,get:function(){return Up.getProperty}});Object.defineProperty(Yt,"stringify",{enumerable:true,get:function(){return Up.stringify}});Object.defineProperty(Yt,"regexpCode",{enumerable:true,get:function(){return Up.regexpCode}});Object.defineProperty(Yt,"Name",{enumerable:true,get:function(){return Up.Name}});var c7=TB();Object.defineProperty(Yt,"Scope",{enumerable:true,get:function(){return c7.Scope}});Object.defineProperty(Yt,"ValueScope",{enumerable:true,get:function(){return c7.ValueScope}});Object.defineProperty(Yt,"ValueScopeName",{enumerable:true,get:function(){return c7.ValueScopeName}});Object.defineProperty(Yt,"varKinds",{enumerable:true,get:function(){return c7.varKinds}});Yt.operators={GT:new Er._Code(">"),GTE:new Er._Code(">="),LT:new Er._Code("<"),LTE:new Er._Code("<="),EQ:new Er._Code("==="),NEQ:new Er._Code("!=="),NOT:new Er._Code("!"),OR:new Er._Code("||"),AND:new Er._Code("&&"),ADD:new Er._Code("+")};var Gc=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}};var AB=class extends Gc{static{o(this,"Def")}constructor(e,r,n){super();this.varKind=e;this.name=r;this.rhs=n}render({es5:e,_n:r}){const n=e?Au.varKinds.var:this.varKind;const i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(!e[this.name.str])return;if(this.rhs)this.rhs=Ug(this.rhs,e,r);return this}get names(){return this.rhs instanceof Er._CodeOrName?this.rhs.names:{}}};var o7=class extends Gc{static{o(this,"Assign")}constructor(e,r,n){super();this.lhs=e;this.rhs=r;this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(this.lhs instanceof Er.Name&&!e[this.lhs.str]&&!this.sideEffects)return;this.rhs=Ug(this.rhs,e,r);return this}get names(){const e=this.lhs instanceof Er.Name?{}:{...this.lhs.names};return l7(e,this.rhs)}};var xB=class extends o7{static{o(this,"AssignOp")}constructor(e,r,n,i){super(e,n,i);this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}};var CB=class extends Gc{static{o(this,"Label")}constructor(e){super();this.label=e;this.names={}}render({_n:e}){return`${this.label}:`+e}};var RB=class extends Gc{static{o(this,"Break")}constructor(e){super();this.label=e;this.names={}}render({_n:e}){const r=this.label?` ${this.label}`:"";return`break${r};`+e}};var OB=class extends Gc{static{o(this,"Throw")}constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}};var NB=class extends Gc{static{o(this,"AnyCode")}constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){this.code=Ug(this.code,e,r);return this}get names(){return this.code instanceof Er._CodeOrName?this.code.names:{}}};var ZE=class extends Gc{static{o(this,"ParentNode")}constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){const{nodes:e}=this;let r=e.length;while(r--){const n=e[r].optimizeNodes();if(Array.isArray(n))e.splice(r,1,...n);else if(n)e[r]=n;else e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){const{nodes:n}=this;let i=n.length;while(i--){const s=n[i];if(s.optimizeNames(e,r))continue;x8t(e,s.names);n.splice(i,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>pm(e,r.names),{})}};var Kc=class extends ZE{static{o(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}};var IB=class extends ZE{static{o(this,"Root")}};var jg=class extends Kc{static{o(this,"Else")}};jg.kind="else";var cm=class t extends Kc{static{o(this,"If")}constructor(e,r){super(r);this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);if(this.else)r+="else "+this.else.render(e);return r}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(e===true)return this.nodes;let r=this.else;if(r){const n=r.optimizeNodes();r=this.else=Array.isArray(n)?new jg(n):n}if(r){if(e===false)return r instanceof t?r:r.nodes;if(this.nodes.length)return this;return new t(Ebe(e),r instanceof t?[r]:r.nodes)}if(e===false||!this.nodes.length)return void 0;return this}optimizeNames(e,r){var n;this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r);if(!(super.optimizeNames(e,r)||this.else))return;this.condition=Ug(this.condition,e,r);return this}get names(){const e=super.names;l7(e,this.condition);if(this.else)pm(e,this.else.names);return e}};cm.kind="if";var dm=class extends Kc{static{o(this,"For")}};dm.kind="for";var PB=class extends dm{static{o(this,"ForLoop")}constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(!super.optimizeNames(e,r))return;this.iteration=Ug(this.iteration,e,r);return this}get names(){return pm(super.names,this.iteration.names)}};var DB=class extends dm{static{o(this,"ForRange")}constructor(e,r,n,i){super();this.varKind=e;this.name=r;this.from=n;this.to=i}render(e){const r=e.es5?Au.varKinds.var:this.varKind;const{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){const e=l7(super.names,this.from);return l7(e,this.to)}};var u7=class extends dm{static{o(this,"ForIter")}constructor(e,r,n,i){super();this.loop=e;this.varKind=r;this.name=n;this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(!super.optimizeNames(e,r))return;this.iterable=Ug(this.iterable,e,r);return this}get names(){return pm(super.names,this.iterable.names)}};var e6=class extends Kc{static{o(this,"Func")}constructor(e,r,n){super();this.name=e;this.args=r;this.async=n}render(e){const r=this.async?"async ":"";return`${r}function ${this.name}(${this.args})`+super.render(e)}};e6.kind="func";var t6=class extends ZE{static{o(this,"Return")}render(e){return"return "+super.render(e)}};t6.kind="return";var kB=class extends Kc{static{o(this,"Try")}render(e){let r="try"+super.render(e);if(this.catch)r+=this.catch.render(e);if(this.finally)r+=this.finally.render(e);return r}optimizeNodes(){var e,r;super.optimizeNodes();(e=this.catch)===null||e===void 0?void 0:e.optimizeNodes();(r=this.finally)===null||r===void 0?void 0:r.optimizeNodes();return this}optimizeNames(e,r){var n,i;super.optimizeNames(e,r);(n=this.catch)===null||n===void 0?void 0:n.optimizeNames(e,r);(i=this.finally)===null||i===void 0?void 0:i.optimizeNames(e,r);return this}get names(){const e=super.names;if(this.catch)pm(e,this.catch.names);if(this.finally)pm(e,this.finally.names);return e}};var r6=class extends Kc{static{o(this,"Catch")}constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};r6.kind="catch";var n6=class extends Kc{static{o(this,"Finally")}render(e){return"finally"+super.render(e)}};n6.kind="finally";var $B=class{static{o(this,"CodeGen")}constructor(e,r={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...r,_n:r.lines?"\n":""};this._extScope=e;this._scope=new Au.Scope({parent:e});this._nodes=[new IB]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){const n=this._extScope.value(e,r);const i=this._values[n.prefix]||(this._values[n.prefix]=new Set);i.add(n);return n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){const s=this._scope.toName(r);if(n!==void 0&&i)this._constants[s.str]=n;this._leafNode(new AB(e,s,n));return s}const(e,r,n){return this._def(Au.varKinds.const,e,r,n)}let(e,r,n){return this._def(Au.varKinds.let,e,r,n)}var(e,r,n){return this._def(Au.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new o7(e,r,n))}add(e,r){return this._leafNode(new xB(e,Yt.operators.ADD,r))}code(e){if(typeof e=="function")e();else if(e!==Er.nil)this._leafNode(new NB(e));return this}object(...e){const r=["{"];for(const[n,i]of e){if(r.length>1)r.push(",");r.push(n);if(n!==i||this.opts.es5){r.push(":");(0,Er.addCodeArg)(r,i)}}r.push("}");return new Er._Code(r)}if(e,r,n){this._blockNode(new cm(e));if(r&&n){this.code(r).else().code(n).endIf()}else if(r){this.code(r).endIf()}else if(n){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(e){return this._elseNode(new cm(e))}else(){return this._elseNode(new jg)}endIf(){return this._endBlockNode(cm,jg)}_for(e,r){this._blockNode(e);if(r)this.code(r).endFor();return this}for(e,r){return this._for(new PB(e),r)}forRange(e,r,n,i,s=this.opts.es5?Au.varKinds.var:Au.varKinds.let){const a=this._scope.toName(e);return this._for(new DB(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Au.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const a=r instanceof Er.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Er._)`${a}.length`,u=>{this.var(s,(0,Er._)`${a}[${u}]`);n(s)})}return this._for(new u7("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Au.varKinds.var:Au.varKinds.const){if(this.opts.ownProperties){return this.forOf(e,(0,Er._)`Object.keys(${r})`,n)}const s=this._scope.toName(e);return this._for(new u7("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(dm)}label(e){return this._leafNode(new CB(e))}break(e){return this._leafNode(new RB(e))}return(e){const r=new t6;this._blockNode(r);this.code(e);if(r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(t6)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new kB;this._blockNode(i);this.code(e);if(r){const s=this.name("e");this._currNode=i.catch=new r6(s);r(s)}if(n){this._currNode=i.finally=new n6;this.code(n)}return this._endBlockNode(r6,n6)}throw(e){return this._leafNode(new OB(e))}block(e,r){this._blockStarts.push(this._nodes.length);if(e)this.code(e).endBlock(r);return this}endBlock(e){const r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e){throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`)}this._nodes.length=r;return this}func(e,r=Er.nil,n,i){this._blockNode(new e6(e,r,n));if(i)this.code(i).endFunc();return this}endFunc(){return this._endBlockNode(e6)}optimize(e=1){while(e-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(e){this._currNode.nodes.push(e);return this}_blockNode(e){this._currNode.nodes.push(e);this._nodes.push(e)}_endBlockNode(e,r){const n=this._currNode;if(n instanceof e||r&&n instanceof r){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){const r=this._currNode;if(!(r instanceof cm)){throw new Error('CodeGen: "else" without "if"')}this._currNode=r.else=e;return this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const r=this._nodes;r[r.length-1]=e}};Yt.CodeGen=$B;function pm(t,e){for(const r in e)t[r]=(t[r]||0)+(e[r]||0);return t}o(pm,"addNames");function l7(t,e){return e instanceof Er._CodeOrName?pm(t,e.names):t}o(l7,"addExprNames");function Ug(t,e,r){if(t instanceof Er.Name)return n(t);if(!i(t))return t;return new Er._Code(t._items.reduce((s,a)=>{if(a instanceof Er.Name)a=n(a);if(a instanceof Er._Code)s.push(...a._items);else s.push(a);return s},[]));function n(s){const a=r[s.str];if(a===void 0||e[s.str]!==1)return s;delete e[s.str];return a}o(n,"replaceName");function i(s){return s instanceof Er._Code&&s._items.some(a=>a instanceof Er.Name&&e[a.str]===1&&r[a.str]!==void 0)}o(i,"canOptimize")}o(Ug,"optimizeExpr");function x8t(t,e){for(const r in e)t[r]=(t[r]||0)-(e[r]||0)}o(x8t,"subtractNames");function Ebe(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Er._)`!${LB(t)}`}o(Ebe,"not");Yt.not=Ebe;var C8t=bbe(Yt.operators.AND);function R8t(...t){return t.reduce(C8t)}o(R8t,"and");Yt.and=R8t;var O8t=bbe(Yt.operators.OR);function N8t(...t){return t.reduce(O8t)}o(N8t,"or");Yt.or=N8t;function bbe(t){return(e,r)=>e===Er.nil?r:r===Er.nil?e:(0,Er._)`${LB(e)} ${t} ${LB(r)}`}o(bbe,"mappend");function LB(t){return t instanceof Er.Name?t:(0,Er._)`(${t})`}o(LB,"par")});var sr=_(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:true});Wt.checkStrictMode=Wt.getErrorPath=Wt.Type=Wt.useFunc=Wt.setEvaluated=Wt.evaluatedPropsToName=Wt.mergeEvaluated=Wt.eachItem=Wt.unescapeJsonPointer=Wt.escapeJsonPointer=Wt.escapeFragment=Wt.unescapeFragment=Wt.schemaRefOrVal=Wt.schemaHasRulesButRef=Wt.schemaHasRules=Wt.checkUnknownRules=Wt.alwaysValidSchema=Wt.toHash=void 0;var hn=Pt();var I8t=XE();function P8t(t){const e={};for(const r of t)e[r]=true;return e}o(P8t,"toHash");Wt.toHash=P8t;function D8t(t,e){if(typeof e=="boolean")return e;if(Object.keys(e).length===0)return true;Tbe(t,e);return!Abe(e,t.self.RULES.all)}o(D8t,"alwaysValidSchema");Wt.alwaysValidSchema=D8t;function Tbe(t,e=t.schema){const{opts:r,self:n}=t;if(!r.strictSchema)return;if(typeof e==="boolean")return;const i=n.RULES.keywords;for(const s in e){if(!i[s])Obe(t,`unknown keyword: "${s}"`)}}o(Tbe,"checkUnknownRules");Wt.checkUnknownRules=Tbe;function Abe(t,e){if(typeof t=="boolean")return!t;for(const r in t)if(e[r])return true;return false}o(Abe,"schemaHasRules");Wt.schemaHasRules=Abe;function k8t(t,e){if(typeof t=="boolean")return!t;for(const r in t)if(r!=="$ref"&&e.all[r])return true;return false}o(k8t,"schemaHasRulesButRef");Wt.schemaHasRulesButRef=k8t;function $8t({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,hn._)`${r}`}return(0,hn._)`${t}${e}${(0,hn.getProperty)(n)}`}o($8t,"schemaRefOrVal");Wt.schemaRefOrVal=$8t;function L8t(t){return xbe(decodeURIComponent(t))}o(L8t,"unescapeFragment");Wt.unescapeFragment=L8t;function q8t(t){return encodeURIComponent(qB(t))}o(q8t,"escapeFragment");Wt.escapeFragment=q8t;function qB(t){if(typeof t=="number")return`${t}`;return t.replace(/~/g,"~0").replace(/\//g,"~1")}o(qB,"escapeJsonPointer");Wt.escapeJsonPointer=qB;function xbe(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(xbe,"unescapeJsonPointer");Wt.unescapeJsonPointer=xbe;function j8t(t,e){if(Array.isArray(t)){for(const r of t)e(r)}else{e(t)}}o(j8t,"eachItem");Wt.eachItem=j8t;function wbe({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{const l=a===void 0?s:a instanceof hn.Name?(s instanceof hn.Name?t(i,s,a):e(i,s,a),a):s instanceof hn.Name?(e(i,a,s),s):r(s,a);return u===hn.Name&&!(l instanceof hn.Name)?n(i,l):l}}o(wbe,"makeMergeEvaluated");Wt.mergeEvaluated={props:wbe({mergeNames:(t,e,r)=>t.if((0,hn._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,hn._)`${e} === true`,()=>t.assign(r,true),()=>t.assign(r,(0,hn._)`${r} || {}`).code((0,hn._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,hn._)`${r} !== true`,()=>{if(e===true){t.assign(r,true)}else{t.assign(r,(0,hn._)`${r} || {}`);jB(t,r,e)}}),mergeValues:(t,e)=>t===true?true:{...t,...e},resultToName:Cbe}),items:wbe({mergeNames:(t,e,r)=>t.if((0,hn._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,hn._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,hn._)`${r} !== true`,()=>t.assign(r,e===true?true:(0,hn._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===true?true:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Cbe(t,e){if(e===true)return t.var("props",true);const r=t.var("props",(0,hn._)`{}`);if(e!==void 0)jB(t,r,e);return r}o(Cbe,"evaluatedPropsToName");Wt.evaluatedPropsToName=Cbe;function jB(t,e,r){Object.keys(r).forEach(n=>t.assign((0,hn._)`${e}${(0,hn.getProperty)(n)}`,true))}o(jB,"setEvaluated");Wt.setEvaluated=jB;var Sbe={};function U8t(t,e){return t.scopeValue("func",{ref:e,code:Sbe[e.code]||(Sbe[e.code]=new I8t._Code(e.code))})}o(U8t,"useFunc");Wt.useFunc=U8t;var Rbe;(function(t){t[t["Num"]=0]="Num";t[t["Str"]=1]="Str"})(Rbe=Wt.Type||(Wt.Type={}));function F8t(t,e,r){if(t instanceof hn.Name){const n=e===Rbe.Num;return r?n?(0,hn._)`"[" + ${t} + "]"`:(0,hn._)`"['" + ${t} + "']"`:n?(0,hn._)`"/" + ${t}`:(0,hn._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,hn.getProperty)(t).toString():"/"+qB(t)}o(F8t,"getErrorPath");Wt.getErrorPath=F8t;function Obe(t,e,r=t.opts.strictSchema){if(!r)return;e=`strict mode: ${e}`;if(r===true)throw new Error(e);t.self.logger.warn(e)}o(Obe,"checkStrictMode");Wt.checkStrictMode=Obe});var Oo=_(UB=>{"use strict";Object.defineProperty(UB,"__esModule",{value:true});var Es=Pt();var M8t={data:new Es.Name("data"),valCxt:new Es.Name("valCxt"),instancePath:new Es.Name("instancePath"),parentData:new Es.Name("parentData"),parentDataProperty:new Es.Name("parentDataProperty"),rootData:new Es.Name("rootData"),dynamicAnchors:new Es.Name("dynamicAnchors"),vErrors:new Es.Name("vErrors"),errors:new Es.Name("errors"),this:new Es.Name("this"),self:new Es.Name("self"),scope:new Es.Name("scope"),json:new Es.Name("json"),jsonPos:new Es.Name("jsonPos"),jsonLen:new Es.Name("jsonLen"),jsonPart:new Es.Name("jsonPart")};UB.default=M8t});var i6=_(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:true});bs.extendErrors=bs.resetErrorsCount=bs.reportExtraError=bs.reportError=bs.keyword$DataError=bs.keywordError=void 0;var Cr=Pt();var d7=sr();var Us=Oo();bs.keywordError={message:({keyword:t})=>(0,Cr.str)`must pass "${t}" keyword validation`};bs.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Cr.str)`"${t}" keyword must be ${e} ($data)`:(0,Cr.str)`"${t}" keyword is invalid ($data)`};function B8t(t,e=bs.keywordError,r,n){const{it:i}=t;const{gen:s,compositeRule:a,allErrors:u}=i;const l=Pbe(t,e,r);if(n!==null&&n!==void 0?n:a||u){Nbe(s,l)}else{Ibe(i,(0,Cr._)`[${l}]`)}}o(B8t,"reportError");bs.reportError=B8t;function V8t(t,e=bs.keywordError,r){const{it:n}=t;const{gen:i,compositeRule:s,allErrors:a}=n;const u=Pbe(t,e,r);Nbe(i,u);if(!(s||a)){Ibe(n,Us.default.vErrors)}}o(V8t,"reportExtraError");bs.reportExtraError=V8t;function H8t(t,e){t.assign(Us.default.errors,e);t.if((0,Cr._)`${Us.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Cr._)`${Us.default.vErrors}.length`,e),()=>t.assign(Us.default.vErrors,null)))}o(H8t,"resetErrorsCount");bs.resetErrorsCount=H8t;function z8t({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");const a=t.name("err");t.forRange("i",i,Us.default.errors,u=>{t.const(a,(0,Cr._)`${Us.default.vErrors}[${u}]`);t.if((0,Cr._)`${a}.instancePath === undefined`,()=>t.assign((0,Cr._)`${a}.instancePath`,(0,Cr.strConcat)(Us.default.instancePath,s.errorPath)));t.assign((0,Cr._)`${a}.schemaPath`,(0,Cr.str)`${s.errSchemaPath}/${e}`);if(s.opts.verbose){t.assign((0,Cr._)`${a}.schema`,r);t.assign((0,Cr._)`${a}.data`,n)}})}o(z8t,"extendErrors");bs.extendErrors=z8t;function Nbe(t,e){const r=t.const("err",e);t.if((0,Cr._)`${Us.default.vErrors} === null`,()=>t.assign(Us.default.vErrors,(0,Cr._)`[${r}]`),(0,Cr._)`${Us.default.vErrors}.push(${r})`);t.code((0,Cr._)`${Us.default.errors}++`)}o(Nbe,"addError");function Ibe(t,e){const{gen:r,validateName:n,schemaEnv:i}=t;if(i.$async){r.throw((0,Cr._)`new ${t.ValidationError}(${e})`)}else{r.assign((0,Cr._)`${n}.errors`,e);r.return(false)}}o(Ibe,"returnErrors");var fm={keyword:new Cr.Name("keyword"),schemaPath:new Cr.Name("schemaPath"),params:new Cr.Name("params"),propertyName:new Cr.Name("propertyName"),message:new Cr.Name("message"),schema:new Cr.Name("schema"),parentSchema:new Cr.Name("parentSchema")};function Pbe(t,e,r){const{createErrors:n}=t.it;if(n===false)return(0,Cr._)`{}`;return G8t(t,e,r)}o(Pbe,"errorObjectCode");function G8t(t,e,r={}){const{gen:n,it:i}=t;const s=[K8t(i,r),Y8t(t,r)];W8t(t,e,s);return n.object(...s)}o(G8t,"errorObject");function K8t({errorPath:t},{instancePath:e}){const r=e?(0,Cr.str)`${t}${(0,d7.getErrorPath)(e,d7.Type.Str)}`:t;return[Us.default.instancePath,(0,Cr.strConcat)(Us.default.instancePath,r)]}o(K8t,"errorInstancePath");function Y8t({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Cr.str)`${e}/${t}`;if(r){i=(0,Cr.str)`${i}${(0,d7.getErrorPath)(r,d7.Type.Str)}`}return[fm.schemaPath,i]}o(Y8t,"errorSchemaPath");function W8t(t,{params:e,message:r},n){const{keyword:i,data:s,schemaValue:a,it:u}=t;const{opts:l,propertyName:c,topSchemaRef:d,schemaPath:p}=u;n.push([fm.keyword,i],[fm.params,typeof e=="function"?e(t):e||(0,Cr._)`{}`]);if(l.messages){n.push([fm.message,typeof r=="function"?r(t):r])}if(l.verbose){n.push([fm.schema,a],[fm.parentSchema,(0,Cr._)`${d}${p}`],[Us.default.data,s])}if(c)n.push([fm.propertyName,c])}o(W8t,"extraErrorProps")});var kbe=_(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:true});Fg.boolOrEmptySchema=Fg.topBoolOrEmptySchema=void 0;var J8t=i6();var Q8t=Pt();var X8t=Oo();var Z8t={message:"boolean schema is false"};function e5t(t){const{gen:e,schema:r,validateName:n}=t;if(r===false){Dbe(t,false)}else if(typeof r=="object"&&r.$async===true){e.return(X8t.default.data)}else{e.assign((0,Q8t._)`${n}.errors`,null);e.return(true)}}o(e5t,"topBoolOrEmptySchema");Fg.topBoolOrEmptySchema=e5t;function t5t(t,e){const{gen:r,schema:n}=t;if(n===false){r.var(e,false);Dbe(t)}else{r.var(e,true)}}o(t5t,"boolOrEmptySchema");Fg.boolOrEmptySchema=t5t;function Dbe(t,e){const{gen:r,data:n}=t;const i={gen:r,keyword:"false schema",data:n,schema:false,schemaCode:false,schemaValue:false,params:{},it:t};(0,J8t.reportError)(i,Z8t,void 0,e)}o(Dbe,"falseSchemaError")});var FB=_(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:true});Mg.getRules=Mg.isJSONType=void 0;var r5t=["string","number","integer","boolean","null","object","array"];var n5t=new Set(r5t);function i5t(t){return typeof t=="string"&&n5t.has(t)}o(i5t,"isJSONType");Mg.isJSONType=i5t;function s5t(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:true,boolean:true,null:true},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}o(s5t,"getRules");Mg.getRules=s5t});var MB=_(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:true});Fp.shouldUseRule=Fp.shouldUseGroup=Fp.schemaHasRulesForType=void 0;function a5t({schema:t,self:e},r){const n=e.RULES.types[r];return n&&n!==true&&$be(t,n)}o(a5t,"schemaHasRulesForType");Fp.schemaHasRulesForType=a5t;function $be(t,e){return e.rules.some(r=>Lbe(t,r))}o($be,"shouldUseGroup");Fp.shouldUseGroup=$be;function Lbe(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}o(Lbe,"shouldUseRule");Fp.shouldUseRule=Lbe});var a6=_(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:true});es.reportTypeError=es.checkDataTypes=es.checkDataType=es.coerceAndCheckDataType=es.getJSONTypes=es.getSchemaTypes=es.DataType=void 0;var o5t=FB();var u5t=MB();var l5t=i6();var Lt=Pt();var qbe=sr();var s6;(function(t){t[t["Correct"]=0]="Correct";t[t["Wrong"]=1]="Wrong"})(s6=es.DataType||(es.DataType={}));function c5t(t){const e=jbe(t.type);const r=e.includes("null");if(r){if(t.nullable===false)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0){throw new Error('"nullable" cannot be used without "type"')}if(t.nullable===true)e.push("null")}return e}o(c5t,"getSchemaTypes");es.getSchemaTypes=c5t;function jbe(t){const e=Array.isArray(t)?t:t?[t]:[];if(e.every(o5t.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}o(jbe,"getJSONTypes");es.getJSONTypes=jbe;function d5t(t,e){const{gen:r,data:n,opts:i}=t;const s=p5t(e,i.coerceTypes);const a=e.length>0&&!(s.length===0&&e.length===1&&(0,u5t.schemaHasRulesForType)(t,e[0]));if(a){const u=VB(e,n,i.strictNumbers,s6.Wrong);r.if(u,()=>{if(s.length)f5t(t,e,s);else HB(t)})}return a}o(d5t,"coerceAndCheckDataType");es.coerceAndCheckDataType=d5t;var Ube=new Set(["string","number","integer","boolean","null"]);function p5t(t,e){return e?t.filter(r=>Ube.has(r)||e==="array"&&r==="array"):[]}o(p5t,"coerceToTypes");function f5t(t,e,r){const{gen:n,data:i,opts:s}=t;const a=n.let("dataType",(0,Lt._)`typeof ${i}`);const u=n.let("coerced",(0,Lt._)`undefined`);if(s.coerceTypes==="array"){n.if((0,Lt._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Lt._)`${i}[0]`).assign(a,(0,Lt._)`typeof ${i}`).if(VB(e,i,s.strictNumbers),()=>n.assign(u,i)))}n.if((0,Lt._)`${u} !== undefined`);for(const c of r){if(Ube.has(c)||c==="array"&&s.coerceTypes==="array"){l(c)}}n.else();HB(t);n.endIf();n.if((0,Lt._)`${u} !== undefined`,()=>{n.assign(i,u);h5t(t,u)});function l(c){switch(c){case"string":n.elseIf((0,Lt._)`${a} == "number" || ${a} == "boolean"`).assign(u,(0,Lt._)`"" + ${i}`).elseIf((0,Lt._)`${i} === null`).assign(u,(0,Lt._)`""`);return;case"number":n.elseIf((0,Lt._)`${a} == "boolean" || ${i} === null
396
396
  || (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,Lt._)`+${i}`);return;case"integer":n.elseIf((0,Lt._)`${a} === "boolean" || ${i} === null
397
397
  || (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,Lt._)`+${i}`);return;case"boolean":n.elseIf((0,Lt._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(u,false).elseIf((0,Lt._)`${i} === "true" || ${i} === 1`).assign(u,true);return;case"null":n.elseIf((0,Lt._)`${i} === "" || ${i} === 0 || ${i} === false`);n.assign(u,null);return;case"array":n.elseIf((0,Lt._)`${a} === "string" || ${a} === "number"
398
398
  || ${a} === "boolean" || ${i} === null`).assign(u,(0,Lt._)`[${i}]`)}}o(l,"coerceSpecificType")}o(f5t,"coerceData");function h5t({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Lt._)`${e} !== undefined`,()=>t.assign((0,Lt._)`${e}[${r}]`,n))}o(h5t,"assignParentData");function BB(t,e,r,n=s6.Correct){const i=n===s6.Correct?Lt.operators.EQ:Lt.operators.NEQ;let s;switch(t){case"null":return(0,Lt._)`${e} ${i} null`;case"array":s=(0,Lt._)`Array.isArray(${e})`;break;case"object":s=(0,Lt._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Lt._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Lt._)`typeof ${e} ${i} ${t}`}return n===s6.Correct?s:(0,Lt.not)(s);function a(u=Lt.nil){return(0,Lt.and)((0,Lt._)`typeof ${e} == "number"`,u,r?(0,Lt._)`isFinite(${e})`:Lt.nil)}o(a,"numCond")}o(BB,"checkDataType");es.checkDataType=BB;function VB(t,e,r,n){if(t.length===1){return BB(t[0],e,r,n)}let i;const s=(0,qbe.toHash)(t);if(s.array&&s.object){const a=(0,Lt._)`typeof ${e} != "object"`;i=s.null?a:(0,Lt._)`!${e} || ${a}`;delete s.null;delete s.array;delete s.object}else{i=Lt.nil}if(s.number)delete s.integer;for(const a in s)i=(0,Lt.and)(i,BB(a,e,r,n));return i}o(VB,"checkDataTypes");es.checkDataTypes=VB;var m5t={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Lt._)`{type: ${t}}`:(0,Lt._)`{type: ${e}}`};function HB(t){const e=g5t(t);(0,l5t.reportError)(e,m5t)}o(HB,"reportTypeError");es.reportTypeError=HB;function g5t(t){const{gen:e,data:r,schema:n}=t;const i=(0,qbe.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}o(g5t,"getTypeErrorContext")});var Mbe=_(p7=>{"use strict";Object.defineProperty(p7,"__esModule",{value:true});p7.assignDefaults=void 0;var Bg=Pt();var y5t=sr();function v5t(t,e){const{properties:r,items:n}=t.schema;if(e==="object"&&r){for(const i in r){Fbe(t,i,r[i].default)}}else if(e==="array"&&Array.isArray(n)){n.forEach((i,s)=>Fbe(t,s,i.default))}}o(v5t,"assignDefaults");p7.assignDefaults=v5t;function Fbe(t,e,r){const{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;const u=(0,Bg._)`${s}${(0,Bg.getProperty)(e)}`;if(i){(0,y5t.checkStrictMode)(t,`default is ignored for: ${u}`);return}let l=(0,Bg._)`${u} === undefined`;if(a.useDefaults==="empty"){l=(0,Bg._)`${l} || ${u} === null || ${u} === ""`}n.if(l,(0,Bg._)`${u} = ${(0,Bg.stringify)(r)}`)}o(Fbe,"assignDefault")});var No=_(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:true});an.validateUnion=an.validateArray=an.usePattern=an.callValidateCode=an.schemaProperties=an.allSchemaProperties=an.noPropertyInData=an.propertyInData=an.isOwnProperty=an.hasPropFunc=an.reportMissingProp=an.checkMissingProp=an.checkReportMissingProp=void 0;var Nn=Pt();var zB=sr();var Mp=Oo();var _5t=sr();function E5t(t,e){const{gen:r,data:n,it:i}=t;r.if(KB(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Nn._)`${e}`},true);t.error()})}o(E5t,"checkReportMissingProp");an.checkReportMissingProp=E5t;function b5t({gen:t,data:e,it:{opts:r}},n,i){return(0,Nn.or)(...n.map(s=>(0,Nn.and)(KB(t,e,s,r.ownProperties),(0,Nn._)`${i} = ${s}`)))}o(b5t,"checkMissingProp");an.checkMissingProp=b5t;function w5t(t,e){t.setParams({missingProperty:e},true);t.error()}o(w5t,"reportMissingProp");an.reportMissingProp=w5t;function Bbe(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Nn._)`Object.prototype.hasOwnProperty`})}o(Bbe,"hasPropFunc");an.hasPropFunc=Bbe;function GB(t,e,r){return(0,Nn._)`${Bbe(t)}.call(${e}, ${r})`}o(GB,"isOwnProperty");an.isOwnProperty=GB;function S5t(t,e,r,n){const i=(0,Nn._)`${e}${(0,Nn.getProperty)(r)} !== undefined`;return n?(0,Nn._)`${i} && ${GB(t,e,r)}`:i}o(S5t,"propertyInData");an.propertyInData=S5t;function KB(t,e,r,n){const i=(0,Nn._)`${e}${(0,Nn.getProperty)(r)} === undefined`;return n?(0,Nn.or)(i,(0,Nn.not)(GB(t,e,r))):i}o(KB,"noPropertyInData");an.noPropertyInData=KB;function Vbe(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}o(Vbe,"allSchemaProperties");an.allSchemaProperties=Vbe;function T5t(t,e){return Vbe(e).filter(r=>!(0,zB.alwaysValidSchema)(t,e[r]))}o(T5t,"schemaProperties");an.schemaProperties=T5t;function A5t({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,l,c){const d=c?(0,Nn._)`${t}, ${e}, ${n}${i}`:e;const p=[[Mp.default.instancePath,(0,Nn.strConcat)(Mp.default.instancePath,s)],[Mp.default.parentData,a.parentData],[Mp.default.parentDataProperty,a.parentDataProperty],[Mp.default.rootData,Mp.default.rootData]];if(a.opts.dynamicRef)p.push([Mp.default.dynamicAnchors,Mp.default.dynamicAnchors]);const f=(0,Nn._)`${d}, ${r.object(...p)}`;return l!==Nn.nil?(0,Nn._)`${u}.call(${l}, ${f})`:(0,Nn._)`${u}(${f})`}o(A5t,"callValidateCode");an.callValidateCode=A5t;var x5t=(0,Nn._)`new RegExp`;function C5t({gen:t,it:{opts:e}},r){const n=e.unicodeRegExp?"u":"";const{regExp:i}=e.code;const s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Nn._)`${i.code==="new RegExp"?x5t:(0,_5t.useFunc)(t,i)}(${r}, ${n})`})}o(C5t,"usePattern");an.usePattern=C5t;function R5t(t){const{gen:e,data:r,keyword:n,it:i}=t;const s=e.name("valid");if(i.allErrors){const u=e.let("valid",true);a(()=>e.assign(u,false));return u}e.var(s,true);a(()=>e.break());return s;function a(u){const l=e.const("len",(0,Nn._)`${r}.length`);e.forRange("i",0,l,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:zB.Type.Num},s);e.if((0,Nn.not)(s),u)})}o(a,"validateItems")}o(R5t,"validateArray");an.validateArray=R5t;function O5t(t){const{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=r.some(l=>(0,zB.alwaysValidSchema)(i,l));if(s&&!i.opts.unevaluated)return;const a=e.let("valid",false);const u=e.name("_valid");e.block(()=>r.forEach((l,c)=>{const d=t.subschema({keyword:n,schemaProp:c,compositeRule:true},u);e.assign(a,(0,Nn._)`${a} || ${u}`);const p=t.mergeValidEvaluated(d,u);if(!p)e.if((0,Nn.not)(a))}));t.result(a,()=>t.reset(),()=>t.error(true))}o(O5t,"validateUnion");an.validateUnion=O5t});var Gbe=_(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:true});Cl.validateKeywordUsage=Cl.validSchemaType=Cl.funcKeywordCode=Cl.macroKeywordCode=void 0;var Fs=Pt();var hm=Oo();var N5t=No();var I5t=i6();function P5t(t,e){const{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t;const u=e.macro.call(a.self,i,s,a);const l=zbe(r,n,u);if(a.opts.validateSchema!==false)a.self.validateSchema(u,true);const c=r.name("valid");t.subschema({schema:u,schemaPath:Fs.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:true},c);t.pass(c,()=>t.error(true))}o(P5t,"macroKeywordCode");Cl.macroKeywordCode=P5t;function D5t(t,e){var r;const{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:l}=t;$5t(l,e);const c=!u&&e.compile?e.compile.call(l.self,s,a,l):e.validate;const d=zbe(n,i,c);const p=n.let("valid");t.block$data(p,f);t.ok((r=e.valid)!==null&&r!==void 0?r:p);function f(){if(e.errors===false){g();if(e.modifying)Hbe(t);y(()=>t.error())}else{const v=e.async?h():m();if(e.modifying)Hbe(t);y(()=>k5t(t,v))}}o(f,"validateKeyword");function h(){const v=n.let("ruleErrs",null);n.try(()=>g((0,Fs._)`await `),w=>n.assign(p,false).if((0,Fs._)`${w} instanceof ${l.ValidationError}`,()=>n.assign(v,(0,Fs._)`${w}.errors`),()=>n.throw(w)));return v}o(h,"validateAsync");function m(){const v=(0,Fs._)`${d}.errors`;n.assign(v,null);g(Fs.nil);return v}o(m,"validateSync");function g(v=e.async?(0,Fs._)`await `:Fs.nil){const w=l.opts.passContext?hm.default.this:hm.default.self;const E=!("compile"in e&&!u||e.schema===false);n.assign(p,(0,Fs._)`${v}${(0,N5t.callValidateCode)(t,d,w,E)}`,e.modifying)}o(g,"assignValid");function y(v){var w;n.if((0,Fs.not)((w=e.valid)!==null&&w!==void 0?w:p),v)}o(y,"reportErrs")}o(D5t,"funcKeywordCode");Cl.funcKeywordCode=D5t;function Hbe(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Fs._)`${n.parentData}[${n.parentDataProperty}]`))}o(Hbe,"modifyData");function k5t(t,e){const{gen:r}=t;r.if((0,Fs._)`Array.isArray(${e})`,()=>{r.assign(hm.default.vErrors,(0,Fs._)`${hm.default.vErrors} === null ? ${e} : ${hm.default.vErrors}.concat(${e})`).assign(hm.default.errors,(0,Fs._)`${hm.default.vErrors}.length`);(0,I5t.extendErrors)(t)},()=>t.error())}o(k5t,"addErrs");function $5t({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}o($5t,"checkAsyncKeyword");function zbe(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Fs.stringify)(r)})}o(zbe,"useKeyword");function L5t(t,e,r=false){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t=="undefined")}o(L5t,"validSchemaType");Cl.validSchemaType=L5t;function q5t({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s){throw new Error("ajv implementation error")}const a=i.dependencies;if(a===null||a===void 0?void 0:a.some(u=>!Object.prototype.hasOwnProperty.call(t,u))){throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`)}if(i.validateSchema){const u=i.validateSchema(t[s]);if(!u){const l=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}}o(q5t,"validateKeywordUsage");Cl.validateKeywordUsage=q5t});var Ybe=_(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:true});Bp.extendSubschemaMode=Bp.extendSubschemaData=Bp.getSubschema=void 0;var Rl=Pt();var Kbe=sr();function j5t(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0){throw new Error('both "keyword" and "schema" passed, only one allowed')}if(e!==void 0){const u=t.schema[e];return r===void 0?{schema:u,schemaPath:(0,Rl._)`${t.schemaPath}${(0,Rl.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:u[r],schemaPath:(0,Rl._)`${t.schemaPath}${(0,Rl.getProperty)(e)}${(0,Rl.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Kbe.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0){throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"')}return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(j5t,"getSubschema");Bp.getSubschema=j5t;function U5t(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0){throw new Error('both "data" and "dataProp" passed, only one allowed')}const{gen:u}=e;if(r!==void 0){const{errorPath:c,dataPathArr:d,opts:p}=e;const f=u.let("data",(0,Rl._)`${e.data}${(0,Rl.getProperty)(r)}`,true);l(f);t.errorPath=(0,Rl.str)`${c}${(0,Kbe.getErrorPath)(r,n,p.jsPropertySyntax)}`;t.parentDataProperty=(0,Rl._)`${r}`;t.dataPathArr=[...d,t.parentDataProperty]}if(i!==void 0){const c=i instanceof Rl.Name?i:u.let("data",i,true);l(c);if(a!==void 0)t.propertyName=a}if(s)t.dataTypes=s;function l(c){t.data=c;t.dataLevel=e.dataLevel+1;t.dataTypes=[];e.definedProperties=new Set;t.parentData=e.data;t.dataNames=[...e.dataNames,c]}o(l,"dataContextProps")}o(U5t,"extendSubschemaData");Bp.extendSubschemaData=U5t;function F5t(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){if(n!==void 0)t.compositeRule=n;if(i!==void 0)t.createErrors=i;if(s!==void 0)t.allErrors=s;t.jtdDiscriminator=e;t.jtdMetadata=r}o(F5t,"extendSubschemaMode");Bp.extendSubschemaMode=F5t});var o6=_(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:true});_a.getSchemaRefs=_a.resolveUrl=_a.normalizeId=_a._getFullPath=_a.getFullPath=_a.inlineRef=void 0;var M5t=sr();var B5t=nu();var V5t=jv();var H5t=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function z5t(t,e=true){if(typeof t=="boolean")return true;if(e===true)return!YB(t);if(!e)return false;return Wbe(t)<=e}o(z5t,"inlineRef");_a.inlineRef=z5t;var G5t=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function YB(t){for(const e in t){if(G5t.has(e))return true;const r=t[e];if(Array.isArray(r)&&r.some(YB))return true;if(typeof r=="object"&&YB(r))return true}return false}o(YB,"hasRef");function Wbe(t){let e=0;for(const r in t){if(r==="$ref")return Infinity;e++;if(H5t.has(r))continue;if(typeof t[r]=="object"){(0,M5t.eachItem)(t[r],n=>e+=Wbe(n))}if(e===Infinity)return Infinity}return e}o(Wbe,"countKeys");function Jbe(t,e="",r){if(r!==false)e=Vg(e);const n=t.parse(e);return Qbe(t,n)}o(Jbe,"getFullPath");_a.getFullPath=Jbe;function Qbe(t,e){const r=t.serialize(e);return r.split("#")[0]+"#"}o(Qbe,"_getFullPath");_a._getFullPath=Qbe;var K5t=/#\/?$/;function Vg(t){return t?t.replace(K5t,""):""}o(Vg,"normalizeId");_a.normalizeId=Vg;function Y5t(t,e,r){r=Vg(r);return t.resolve(e,r)}o(Y5t,"resolveUrl");_a.resolveUrl=Y5t;var W5t=/^[a-z_][-a-z0-9._]*$/i;function J5t(t,e){if(typeof t=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts;const i=Vg(t[r]||e);const s={"":i};const a=Jbe(n,i,false);const u={};const l=new Set;V5t(t,{allKeys:true},(p,f,h,m)=>{if(m===void 0)return;const g=a+f;let y=s[m];if(typeof p[r]=="string")y=v.call(this,p[r]);w.call(this,p.$anchor);w.call(this,p.$dynamicAnchor);s[f]=y;function v(E){const b=this.opts.uriResolver.resolve;E=Vg(y?b(y,E):E);if(l.has(E))throw d(E);l.add(E);let S=this.refs[E];if(typeof S=="string")S=this.refs[S];if(typeof S=="object"){c(p,S.schema,E)}else if(E!==Vg(g)){if(E[0]==="#"){c(p,u[E],E);u[E]=p}else{this.refs[E]=g}}return E}o(v,"addRef");function w(E){if(typeof E=="string"){if(!W5t.test(E))throw new Error(`invalid anchor "${E}"`);v.call(this,`#${E}`)}}o(w,"addAnchor")});return u;function c(p,f,h){if(f!==void 0&&!B5t(p,f))throw d(h)}o(c,"checkAmbiguosRef");function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}o(d,"ambiguos")}o(J5t,"getSchemaRefs");_a.getSchemaRefs=J5t});var c6=_(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:true});Vp.getData=Vp.KeywordCxt=Vp.validateFunctionCode=void 0;var r3e=kbe();var Xbe=a6();var JB=MB();var f7=a6();var Q5t=Mbe();var l6=Gbe();var WB=Ybe();var ot=Pt();var Tt=Oo();var X5t=o6();var Yc=sr();var u6=i6();function Z5t(t){if(s3e(t)){a3e(t);if(i3e(t)){rwt(t);return}}n3e(t,()=>(0,r3e.topBoolOrEmptySchema)(t))}o(Z5t,"validateFunctionCode");Vp.validateFunctionCode=Z5t;function n3e({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){if(i.code.es5){t.func(e,(0,ot._)`${Tt.default.data}, ${Tt.default.valCxt}`,n.$async,()=>{t.code((0,ot._)`"use strict"; ${Zbe(r,i)}`);twt(t,i);t.code(s)})}else{t.func(e,(0,ot._)`${Tt.default.data}, ${ewt(i)}`,n.$async,()=>t.code(Zbe(r,i)).code(s))}}o(n3e,"validateFunction");function ewt(t){return(0,ot._)`{${Tt.default.instancePath}="", ${Tt.default.parentData}, ${Tt.default.parentDataProperty}, ${Tt.default.rootData}=${Tt.default.data}${t.dynamicRef?(0,ot._)`, ${Tt.default.dynamicAnchors}={}`:ot.nil}}={}`}o(ewt,"destructureValCxt");function twt(t,e){t.if(Tt.default.valCxt,()=>{t.var(Tt.default.instancePath,(0,ot._)`${Tt.default.valCxt}.${Tt.default.instancePath}`);t.var(Tt.default.parentData,(0,ot._)`${Tt.default.valCxt}.${Tt.default.parentData}`);t.var(Tt.default.parentDataProperty,(0,ot._)`${Tt.default.valCxt}.${Tt.default.parentDataProperty}`);t.var(Tt.default.rootData,(0,ot._)`${Tt.default.valCxt}.${Tt.default.rootData}`);if(e.dynamicRef)t.var(Tt.default.dynamicAnchors,(0,ot._)`${Tt.default.valCxt}.${Tt.default.dynamicAnchors}`)},()=>{t.var(Tt.default.instancePath,(0,ot._)`""`);t.var(Tt.default.parentData,(0,ot._)`undefined`);t.var(Tt.default.parentDataProperty,(0,ot._)`undefined`);t.var(Tt.default.rootData,Tt.default.data);if(e.dynamicRef)t.var(Tt.default.dynamicAnchors,(0,ot._)`{}`)})}o(twt,"destructureValCxtES5");function rwt(t){const{schema:e,opts:r,gen:n}=t;n3e(t,()=>{if(r.$comment&&e.$comment)u3e(t);owt(t);n.let(Tt.default.vErrors,null);n.let(Tt.default.errors,0);if(r.unevaluated)nwt(t);o3e(t);cwt(t)});return}o(rwt,"topSchemaObjCode");function nwt(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ot._)`${r}.evaluated`);e.if((0,ot._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ot._)`${t.evaluated}.props`,(0,ot._)`undefined`));e.if((0,ot._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ot._)`${t.evaluated}.items`,(0,ot._)`undefined`))}o(nwt,"resetEvaluated");function Zbe(t,e){const r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ot._)`/*# sourceURL=${r} */`:ot.nil}o(Zbe,"funcSourceUrl");function iwt(t,e){if(s3e(t)){a3e(t);if(i3e(t)){swt(t,e);return}}(0,r3e.boolOrEmptySchema)(t,e)}o(iwt,"subschemaCode");function i3e({schema:t,self:e}){if(typeof t=="boolean")return!t;for(const r in t)if(e.RULES.all[r])return true;return false}o(i3e,"schemaCxtHasRules");function s3e(t){return typeof t.schema!="boolean"}o(s3e,"isSchemaObj");function swt(t,e){const{schema:r,gen:n,opts:i}=t;if(i.$comment&&r.$comment)u3e(t);uwt(t);lwt(t);const s=n.const("_errs",Tt.default.errors);o3e(t,s);n.var(e,(0,ot._)`${s} === ${Tt.default.errors}`)}o(swt,"subSchemaObjCode");function a3e(t){(0,Yc.checkUnknownRules)(t);awt(t)}o(a3e,"checkKeywords");function o3e(t,e){if(t.opts.jtd)return e3e(t,[],false,e);const r=(0,Xbe.getSchemaTypes)(t.schema);const n=(0,Xbe.coerceAndCheckDataType)(t,r);e3e(t,r,!n,e)}o(o3e,"typeAndKeywords");function awt(t){const{schema:e,errSchemaPath:r,opts:n,self:i}=t;if(e.$ref&&n.ignoreKeywordsWithRef&&(0,Yc.schemaHasRulesButRef)(e,i.RULES)){i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}}o(awt,"checkRefsAndKeywords");function owt(t){const{schema:e,opts:r}=t;if(e.default!==void 0&&r.useDefaults&&r.strictSchema){(0,Yc.checkStrictMode)(t,"default is ignored in the schema root")}}o(owt,"checkNoDefault");function uwt(t){const e=t.schema[t.opts.schemaId];if(e)t.baseId=(0,X5t.resolveUrl)(t.opts.uriResolver,t.baseId,e)}o(uwt,"updateContext");function lwt(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}o(lwt,"checkAsyncSchema");function u3e({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){const s=r.$comment;if(i.$comment===true){t.code((0,ot._)`${Tt.default.self}.logger.log(${s})`)}else if(typeof i.$comment=="function"){const a=(0,ot.str)`${n}/$comment`;const u=t.scopeValue("root",{ref:e.root});t.code((0,ot._)`${Tt.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}o(u3e,"commentKeyword");function cwt(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;if(r.$async){e.if((0,ot._)`${Tt.default.errors} === 0`,()=>e.return(Tt.default.data),()=>e.throw((0,ot._)`new ${i}(${Tt.default.vErrors})`))}else{e.assign((0,ot._)`${n}.errors`,Tt.default.vErrors);if(s.unevaluated)dwt(t);e.return((0,ot._)`${Tt.default.errors} === 0`)}}o(cwt,"returnResults");function dwt({gen:t,evaluated:e,props:r,items:n}){if(r instanceof ot.Name)t.assign((0,ot._)`${e}.props`,r);if(n instanceof ot.Name)t.assign((0,ot._)`${e}.items`,n)}o(dwt,"assignEvaluated");function e3e(t,e,r,n){const{gen:i,schema:s,data:a,allErrors:u,opts:l,self:c}=t;const{RULES:d}=c;if(s.$ref&&(l.ignoreKeywordsWithRef||!(0,Yc.schemaHasRulesButRef)(s,d))){i.block(()=>c3e(t,"$ref",d.all.$ref.definition));return}if(!l.jtd)pwt(t,e);i.block(()=>{for(const f of d.rules)p(f);p(d.post)});function p(f){if(!(0,JB.shouldUseGroup)(s,f))return;if(f.type){i.if((0,f7.checkDataType)(f.type,a,l.strictNumbers));t3e(t,f);if(e.length===1&&e[0]===f.type&&r){i.else();(0,f7.reportTypeError)(t)}i.endIf()}else{t3e(t,f)}if(!u)i.if((0,ot._)`${Tt.default.errors} === ${n||0}`)}o(p,"groupKeywords")}o(e3e,"schemaKeywords");function t3e(t,e){const{gen:r,schema:n,opts:{useDefaults:i}}=t;if(i)(0,Q5t.assignDefaults)(t,e.type);r.block(()=>{for(const s of e.rules){if((0,JB.shouldUseRule)(n,s)){c3e(t,s.keyword,s.definition,e.type)}}})}o(t3e,"iterateKeywords");function pwt(t,e){if(t.schemaEnv.meta||!t.opts.strictTypes)return;fwt(t,e);if(!t.opts.allowUnionTypes)hwt(t,e);mwt(t,t.dataTypes)}o(pwt,"checkStrictTypes");function fwt(t,e){if(!e.length)return;if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{if(!l3e(t.dataTypes,r)){QB(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}});ywt(t,e)}o(fwt,"checkContextTypes");function hwt(t,e){if(e.length>1&&!(e.length===2&&e.includes("null"))){QB(t,"use allowUnionTypes to allow union type keyword")}}o(hwt,"checkMultipleTypes");function mwt(t,e){const r=t.self.RULES.all;for(const n in r){const i=r[n];if(typeof i=="object"&&(0,JB.shouldUseRule)(t.schema,i)){const{type:s}=i.definition;if(s.length&&!s.some(a=>gwt(e,a))){QB(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}}o(mwt,"checkKeywordTypes");function gwt(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}o(gwt,"hasApplicableType");function l3e(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}o(l3e,"includesType");function ywt(t,e){const r=[];for(const n of t.dataTypes){if(l3e(e,n))r.push(n);else if(e.includes("integer")&&n==="number")r.push("integer")}t.dataTypes=r}o(ywt,"narrowSchemaTypes");function QB(t,e){const r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`;(0,Yc.checkStrictMode)(t,e,t.opts.strictTypes)}o(QB,"strictTypesError");var h7=class{static{o(this,"KeywordCxt")}constructor(e,r,n){(0,l6.validateKeywordUsage)(e,r,n);this.gen=e.gen;this.allErrors=e.allErrors;this.keyword=n;this.data=e.data;this.schema=e.schema[n];this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data;this.schemaValue=(0,Yc.schemaRefOrVal)(e,this.schema,n,this.$data);this.schemaType=r.schemaType;this.parentSchema=e.schema;this.params={};this.it=e;this.def=r;if(this.$data){this.schemaCode=e.gen.const("vSchema",d3e(this.$data,e))}else{this.schemaCode=this.schemaValue;if(!(0,l6.validSchemaType)(this.schema,r.schemaType,r.allowUndefined)){throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`)}}if("code"in r?r.trackErrors:r.errors!==false){this.errsCount=e.gen.const("_errs",Tt.default.errors)}}result(e,r,n){this.failResult((0,ot.not)(e),r,n)}failResult(e,r,n){this.gen.if(e);if(n)n();else this.error();if(r){this.gen.else();r();if(this.allErrors)this.gen.endIf()}else{if(this.allErrors)this.gen.endIf();else this.gen.else()}}pass(e,r){this.failResult((0,ot.not)(e),void 0,r)}fail(e){if(e===void 0){this.error();if(!this.allErrors)this.gen.if(false);return}this.gen.if(e);this.error();if(this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:r}=this;this.fail((0,ot._)`${r} !== undefined && (${(0,ot.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r);this._error(e,n);this.setParams({});return}this._error(e,n)}_error(e,r){;(e?u6.reportExtraError:u6.reportError)(this,this.def.error,r)}$dataError(){(0,u6.reportError)(this,this.def.$dataError||u6.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,u6.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,r){if(r)Object.assign(this.params,e);else this.params=e}block$data(e,r,n=ot.nil){this.gen.block(()=>{this.check$data(e,n);r()})}check$data(e=ot.nil,r=ot.nil){if(!this.$data)return;const{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,ot.or)((0,ot._)`${i} === undefined`,r));if(e!==ot.nil)n.assign(e,true);if(s.length||a.validateSchema){n.elseIf(this.invalid$data());this.$dataError();if(e!==ot.nil)n.assign(e,false)}n.else()}invalid$data(){const{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ot.or)(a(),u());function a(){if(n.length){if(!(r instanceof ot.Name))throw new Error("ajv implementation error");const l=Array.isArray(n)?n:[n];return(0,ot._)`${(0,f7.checkDataTypes)(l,r,s.opts.strictNumbers,f7.DataType.Wrong)}`}return ot.nil}o(a,"wrong$DataType");function u(){if(i.validateSchema){const l=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ot._)`!${l}(${r})`}return ot.nil}o(u,"invalid$DataSchema")}subschema(e,r){const n=(0,WB.getSubschema)(this.it,e);(0,WB.extendSubschemaData)(n,this.it,e);(0,WB.extendSubschemaMode)(n,e);const i={...this.it,...n,items:void 0,props:void 0};iwt(i,r);return i}mergeEvaluated(e,r){const{it:n,gen:i}=this;if(!n.opts.unevaluated)return;if(n.props!==true&&e.props!==void 0){n.props=Yc.mergeEvaluated.props(i,e.props,n.props,r)}if(n.items!==true&&e.items!==void 0){n.items=Yc.mergeEvaluated.items(i,e.items,n.items,r)}}mergeValidEvaluated(e,r){const{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==true||n.items!==true)){i.if(r,()=>this.mergeEvaluated(e,ot.Name));return true}}};Vp.KeywordCxt=h7;function c3e(t,e,r,n){const i=new h7(t,r,e);if("code"in r){r.code(i,n)}else if(i.$data&&r.validate){(0,l6.funcKeywordCode)(i,r)}else if("macro"in r){(0,l6.macroKeywordCode)(i,r)}else if(r.compile||r.validate){(0,l6.funcKeywordCode)(i,r)}}o(c3e,"keywordCode");var vwt=/^\/(?:[^~]|~0|~1)*$/;var _wt=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function d3e(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i;let s;if(t==="")return Tt.default.rootData;if(t[0]==="/"){if(!vwt.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t;s=Tt.default.rootData}else{const c=_wt.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);const d=+c[1];i=c[2];if(i==="#"){if(d>=e)throw new Error(l("property/index",d));return n[e-d]}if(d>e)throw new Error(l("data",d));s=r[e-d];if(!i)return s}let a=s;const u=i.split("/");for(const c of u){if(c){s=(0,ot._)`${s}${(0,ot.getProperty)((0,Yc.unescapeJsonPointer)(c))}`;a=(0,ot._)`${a} && ${s}`}}return a;function l(c,d){return`Cannot access ${c} ${d} levels up, current level is ${e}`}o(l,"errorMsg")}o(d3e,"getData");Vp.getData=d3e});var m7=_(ZB=>{"use strict";Object.defineProperty(ZB,"__esModule",{value:true});var XB=class extends Error{static{o(this,"ValidationError")}constructor(e){super("validation failed");this.errors=e;this.ajv=this.validation=true}};ZB.default=XB});var g7=_(rV=>{"use strict";Object.defineProperty(rV,"__esModule",{value:true});var eV=o6();var tV=class extends Error{static{o(this,"MissingRefError")}constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`);this.missingRef=(0,eV.resolveUrl)(e,r,n);this.missingSchema=(0,eV.normalizeId)((0,eV.getFullPath)(e,this.missingRef))}};rV.default=tV});var d6=_(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:true});Io.resolveSchema=Io.getCompilingSchema=Io.resolveRef=Io.compileSchema=Io.SchemaEnv=void 0;var xu=Pt();var Ewt=m7();var mm=Oo();var Cu=o6();var p3e=sr();var bwt=c6();var Hg=class{static{o(this,"SchemaEnv")}constructor(e){var r;this.refs={};this.dynamicAnchors={};let n;if(typeof e.schema=="object")n=e.schema;this.schema=e.schema;this.schemaId=e.schemaId;this.root=e.root||this;this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Cu.normalizeId)(n===null||n===void 0?void 0:n[e.schemaId||"$id"]);this.schemaPath=e.schemaPath;this.localRefs=e.localRefs;this.meta=e.meta;this.$async=n===null||n===void 0?void 0:n.$async;this.refs={}}};Io.SchemaEnv=Hg;function iV(t){const e=f3e.call(this,t);if(e)return e;const r=(0,Cu.getFullPath)(this.opts.uriResolver,t.root.baseId);const{es5:n,lines:i}=this.opts.code;const{ownProperties:s}=this.opts;const a=new xu.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s});let u;if(t.$async){u=a.scopeValue("Error",{ref:Ewt.default,code:(0,xu._)`require("ajv/dist/runtime/validation_error").default`})}const l=a.scopeName("validate");t.validateName=l;const c={gen:a,allErrors:this.opts.allErrors,data:mm.default.data,parentData:mm.default.parentData,parentDataProperty:mm.default.parentDataProperty,dataNames:[mm.default.data],dataPathArr:[xu.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===true?{ref:t.schema,code:(0,xu.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:xu.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,xu._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(t);(0,bwt.validateFunctionCode)(c);a.optimize(this.opts.code.optimize);const p=a.toString();d=`${a.scopeRefs(mm.default.scope)}return ${p}`;if(this.opts.code.process)d=this.opts.code.process(d,t);const f=new Function(`${mm.default.self}`,`${mm.default.scope}`,d);const h=f(this,this.scope.get());this.scope.value(l,{ref:h});h.errors=null;h.schema=t.schema;h.schemaEnv=t;if(t.$async)h.$async=true;if(this.opts.code.source===true){h.source={validateName:l,validateCode:p,scopeValues:a._values}}if(this.opts.unevaluated){const{props:m,items:g}=c;h.evaluated={props:m instanceof xu.Name?void 0:m,items:g instanceof xu.Name?void 0:g,dynamicProps:m instanceof xu.Name,dynamicItems:g instanceof xu.Name};if(h.source)h.source.evaluated=(0,xu.stringify)(h.evaluated)}t.validate=h;return t}catch(p){delete t.validate;delete t.validateName;if(d)this.logger.error("Error compiling schema, function code:",d);throw p}finally{this._compilations.delete(t)}}o(iV,"compileSchema");Io.compileSchema=iV;function wwt(t,e,r){var n;r=(0,Cu.resolveUrl)(this.opts.uriResolver,e,r);const i=t.refs[r];if(i)return i;let s=Awt.call(this,t,r);if(s===void 0){const a=(n=t.localRefs)===null||n===void 0?void 0:n[r];const{schemaId:u}=this.opts;if(a)s=new Hg({schema:a,schemaId:u,root:t,baseId:e})}if(s===void 0)return;return t.refs[r]=Swt.call(this,s)}o(wwt,"resolveRef");Io.resolveRef=wwt;function Swt(t){if((0,Cu.inlineRef)(t.schema,this.opts.inlineRefs))return t.schema;return t.validate?t:iV.call(this,t)}o(Swt,"inlineOrCompile");function f3e(t){for(const e of this._compilations){if(Twt(e,t))return e}}o(f3e,"getCompilingSchema");Io.getCompilingSchema=f3e;function Twt(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}o(Twt,"sameSchemaEnv");function Awt(t,e){let r;while(typeof(r=this.refs[e])=="string")e=r;return r||this.schemas[e]||y7.call(this,t,e)}o(Awt,"resolve");function y7(t,e){const r=this.opts.uriResolver.parse(e);const n=(0,Cu._getFullPath)(this.opts.uriResolver,r);let i=(0,Cu.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i){return nV.call(this,r,t)}const s=(0,Cu.normalizeId)(n);const a=this.refs[s]||this.schemas[s];if(typeof a=="string"){const u=y7.call(this,t,a);if(typeof(u===null||u===void 0?void 0:u.schema)!=="object")return;return nV.call(this,r,u)}if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;if(!a.validate)iV.call(this,a);if(s===(0,Cu.normalizeId)(e)){const{schema:u}=a;const{schemaId:l}=this.opts;const c=u[l];if(c)i=(0,Cu.resolveUrl)(this.opts.uriResolver,i,c);return new Hg({schema:u,schemaId:l,root:t,baseId:i})}return nV.call(this,r,a)}o(y7,"resolveSchema");Io.resolveSchema=y7;var xwt=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function nV(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(const u of t.fragment.slice(1).split("/")){if(typeof r==="boolean")return;const l=r[(0,p3e.unescapeFragment)(u)];if(l===void 0)return;r=l;const c=typeof r==="object"&&r[this.opts.schemaId];if(!xwt.has(u)&&c){e=(0,Cu.resolveUrl)(this.opts.uriResolver,e,c)}}let s;if(typeof r!="boolean"&&r.$ref&&!(0,p3e.schemaHasRulesButRef)(r,this.RULES)){const u=(0,Cu.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=y7.call(this,n,u)}const{schemaId:a}=this.opts;s=s||new Hg({schema:r,schemaId:a,root:n,baseId:e});if(s.schema!==s.root.schema)return s;return void 0}o(nV,"getJsonPointer")});var h3e=_((Olr,Cwt)=>{Cwt.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:false}});var g3e=_(sV=>{"use strict";Object.defineProperty(sV,"__esModule",{value:true});var m3e=p0();m3e.code='require("ajv/dist/runtime/uri").default';sV.default=m3e});var T3e=_(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:true});ts.CodeGen=ts.Name=ts.nil=ts.stringify=ts.str=ts._=ts.KeywordCxt=void 0;var Rwt=c6();Object.defineProperty(ts,"KeywordCxt",{enumerable:true,get:function(){return Rwt.KeywordCxt}});var zg=Pt();Object.defineProperty(ts,"_",{enumerable:true,get:function(){return zg._}});Object.defineProperty(ts,"str",{enumerable:true,get:function(){return zg.str}});Object.defineProperty(ts,"stringify",{enumerable:true,get:function(){return zg.stringify}});Object.defineProperty(ts,"nil",{enumerable:true,get:function(){return zg.nil}});Object.defineProperty(ts,"Name",{enumerable:true,get:function(){return zg.Name}});Object.defineProperty(ts,"CodeGen",{enumerable:true,get:function(){return zg.CodeGen}});var Owt=m7();var b3e=g7();var Nwt=FB();var p6=d6();var Iwt=Pt();var f6=o6();var v7=a6();var oV=sr();var y3e=h3e();var Pwt=g3e();var w3e=o((t,e)=>new RegExp(t,e),"defaultRegExp");w3e.code="new RegExp";var Dwt=["removeAdditional","useDefaults","coerceTypes"];var kwt=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]);var $wt={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."};var Lwt={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var v3e=200;function qwt(t){var e,r,n,i,s,a,u,l,c,d,p,f,h,m,g,y,v,w,E,b,S,T,A,R,O;const j=t.strict;const B=(e=t.code)===null||e===void 0?void 0:e.optimize;const U=B===true||B===void 0?1:B||0;const Q=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:w3e;const oe=(i=t.uriResolver)!==null&&i!==void 0?i:Pwt.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:j)!==null&&a!==void 0?a:true,strictNumbers:(l=(u=t.strictNumbers)!==null&&u!==void 0?u:j)!==null&&l!==void 0?l:true,strictTypes:(d=(c=t.strictTypes)!==null&&c!==void 0?c:j)!==null&&d!==void 0?d:"log",strictTuples:(f=(p=t.strictTuples)!==null&&p!==void 0?p:j)!==null&&f!==void 0?f:"log",strictRequired:(m=(h=t.strictRequired)!==null&&h!==void 0?h:j)!==null&&m!==void 0?m:false,code:t.code?{...t.code,optimize:U,regExp:Q}:{optimize:U,regExp:Q},loopRequired:(g=t.loopRequired)!==null&&g!==void 0?g:v3e,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:v3e,meta:(v=t.meta)!==null&&v!==void 0?v:true,messages:(w=t.messages)!==null&&w!==void 0?w:true,inlineRefs:(E=t.inlineRefs)!==null&&E!==void 0?E:true,schemaId:(b=t.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(S=t.addUsedSchema)!==null&&S!==void 0?S:true,validateSchema:(T=t.validateSchema)!==null&&T!==void 0?T:true,validateFormats:(A=t.validateFormats)!==null&&A!==void 0?A:true,unicodeRegExp:(R=t.unicodeRegExp)!==null&&R!==void 0?R:true,int32range:(O=t.int32range)!==null&&O!==void 0?O:true,uriResolver:oe}}o(qwt,"requiredOptions");var h6=class{static{o(this,"Ajv")}constructor(e={}){this.schemas={};this.refs={};this.formats={};this._compilations=new Set;this._loading={};this._cache=new Map;e=this.opts={...e,...qwt(e)};const{es5:r,lines:n}=this.opts.code;this.scope=new Iwt.ValueScope({scope:{},prefixes:kwt,es5:r,lines:n});this.logger=Vwt(e.logger);const i=e.validateFormats;e.validateFormats=false;this.RULES=(0,Nwt.getRules)();_3e.call(this,$wt,e,"NOT SUPPORTED");_3e.call(this,Lwt,e,"DEPRECATED","warn");this._metaOpts=Mwt.call(this);if(e.formats)Uwt.call(this);this._addVocabularies();this._addDefaultMetaSchema();if(e.keywords)Fwt.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);jwt.call(this);e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:r,schemaId:n}=this.opts;let i=y3e;if(n==="id"){i={...y3e};i.id=i.$id;delete i.$id}if(r&&e)this.addMetaSchema(i,i[n],false)}defaultMeta(){const{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){n=this.getSchema(e);if(!n)throw new Error(`no schema with key or ref "${e}"`)}else{n=this.compile(e)}const i=n(r);if(!("$async"in n))this.errors=n.errors;return i}compile(e,r){const n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function"){throw new Error("options.loadSchema should be a function")}const{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(d,p){await s.call(this,d.$schema);const f=this._addSchema(d,p);return f.validate||a.call(this,f)}o(i,"runCompileAsync");async function s(d){if(d&&!this.getSchema(d)){await i.call(this,{$ref:d},true)}}o(s,"loadMetaSchema");async function a(d){try{return this._compileSchemaEnv(d)}catch(p){if(!(p instanceof b3e.default))throw p;u.call(this,p);await l.call(this,p.missingSchema);return a.call(this,d)}}o(a,"_compileAsync");function u({missingSchema:d,missingRef:p}){if(this.refs[d]){throw new Error(`AnySchema ${d} is loaded but ${p} cannot be resolved`)}}o(u,"checkLoaded");async function l(d){const p=await c.call(this,d);if(!this.refs[d])await s.call(this,p.$schema);if(!this.refs[d])this.addSchema(p,d,r)}o(l,"loadMissingSchema");async function c(d){const p=this._loading[d];if(p)return p;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}o(c,"_loadSchema")}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(const a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e==="object"){const{schemaId:a}=this.opts;s=e[a];if(s!==void 0&&typeof s!="string"){throw new Error(`schema ${a} must be string`)}}r=(0,f6.normalizeId)(r||s);this._checkUnique(r);this.schemas[r]=this._addSchema(e,n,r,i,true);return this}addMetaSchema(e,r,n=this.opts.validateSchema){this.addSchema(e,r,true,n);return this}validateSchema(e,r){if(typeof e=="boolean")return true;let n;n=e.$schema;if(n!==void 0&&typeof n!="string"){throw new Error("$schema must be a string")}n=n||this.opts.defaultMeta||this.defaultMeta();if(!n){this.logger.warn("meta-schema not available");this.errors=null;return true}const i=this.validate(n,e);if(!i&&r){const s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;while(typeof(r=E3e.call(this,e))=="string")e=r;if(r===void 0){const{schemaId:n}=this.opts;const i=new p6.SchemaEnv({schema:{},schemaId:n});r=p6.resolveSchema.call(this,i,e);if(!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp){this._removeAllSchemas(this.schemas,e);this._removeAllSchemas(this.refs,e);return this}switch(typeof e){case"undefined":this._removeAllSchemas(this.schemas);this._removeAllSchemas(this.refs);this._cache.clear();return this;case"string":{const r=E3e.call(this,e);if(typeof r=="object")this._cache.delete(r.schema);delete this.schemas[e];delete this.refs[e];return this}case"object":{const r=e;this._cache.delete(r);let n=e[this.opts.schemaId];if(n){n=(0,f6.normalizeId)(n);delete this.schemas[n];delete this.refs[n]}return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string"){n=e;if(typeof r=="object"){this.logger.warn("these parameters are deprecated, see docs for addKeyword");r.keyword=n}}else if(typeof e=="object"&&r===void 0){r=e;n=r.keyword;if(Array.isArray(n)&&!n.length){throw new Error("addKeywords: keyword must be string or non-empty array")}}else{throw new Error("invalid addKeywords parameters")}zwt.call(this,n,r);if(!r){(0,oV.eachItem)(n,s=>aV.call(this,s));return this}Kwt.call(this,r);const i={...r,type:(0,v7.getJSONTypes)(r.type),schemaType:(0,v7.getJSONTypes)(r.schemaType)};(0,oV.eachItem)(n,i.type.length===0?s=>aV.call(this,s,i):s=>i.type.forEach(a=>aV.call(this,s,i,a)));return this}getKeyword(e){const r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){const{RULES:r}=this;delete r.keywords[e];delete r.all[e];for(const n of r.rules){const i=n.rules.findIndex(s=>s.keyword===e);if(i>=0)n.rules.splice(i,1)}return this}addFormat(e,r){if(typeof r=="string")r=new RegExp(r);this.formats[e]=r;return this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){if(!e||e.length===0)return"No errors";return e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const i of r){const s=i.split("/").slice(1);let a=e;for(const u of s)a=a[u];for(const u in n){const l=n[u];if(typeof l!="object")continue;const{$data:c}=l.definition;const d=a[u];if(c&&d)a[u]=S3e(d)}}return e}_removeAllSchemas(e,r){for(const n in e){const i=e[n];if(!r||r.test(n)){if(typeof i=="string"){delete e[n]}else if(i&&!i.meta){this._cache.delete(i.schema);delete e[n]}}}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a;const{schemaId:u}=this.opts;if(typeof e=="object"){a=e[u]}else{if(this.opts.jtd)throw new Error("schema must be object");else if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(l!==void 0)return l;n=(0,f6.normalizeId)(a||n);const c=f6.getSchemaRefs.call(this,e,n);l=new p6.SchemaEnv({schema:e,schemaId:u,meta:r,baseId:n,localRefs:c});this._cache.set(l.schema,l);if(s&&!n.startsWith("#")){if(n)this._checkUnique(n);this.refs[n]=l}if(i)this.validateSchema(e,true);return l}_checkUnique(e){if(this.schemas[e]||this.refs[e]){throw new Error(`schema with key or id "${e}" already exists`)}}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else p6.compileSchema.call(this,e);if(!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const r=this.opts;this.opts=this._metaOpts;try{p6.compileSchema.call(this,e)}finally{this.opts=r}}};ts.default=h6;h6.ValidationError=Owt.default;h6.MissingRefError=b3e.default;function _3e(t,e,r,n="error"){for(const i in t){const s=i;if(s in e)this.logger[n](`${r}: option ${i}. ${t[s]}`)}}o(_3e,"checkOptions");function E3e(t){t=(0,f6.normalizeId)(t);return this.schemas[t]||this.refs[t]}o(E3e,"getSchEnv");function jwt(){const t=this.opts.schemas;if(!t)return;if(Array.isArray(t))this.addSchema(t);else for(const e in t)this.addSchema(t[e],e)}o(jwt,"addInitialSchemas");function Uwt(){for(const t in this.opts.formats){const e=this.opts.formats[t];if(e)this.addFormat(t,e)}}o(Uwt,"addInitialFormats");function Fwt(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const e in t){const r=t[e];if(!r.keyword)r.keyword=e;this.addKeyword(r)}}o(Fwt,"addInitialKeywords");function Mwt(){const t={...this.opts};for(const e of Dwt)delete t[e];return t}o(Mwt,"getMetaSchemaOptions");var Bwt={log(){},warn(){},error(){}};function Vwt(t){if(t===false)return Bwt;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}o(Vwt,"getLogger");var Hwt=/^[a-z_$][a-z0-9_$:-]*$/i;function zwt(t,e){const{RULES:r}=this;(0,oV.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Hwt.test(n))throw new Error(`Keyword ${n} has invalid name`)});if(!e)return;if(e.$data&&!("code"in e||"validate"in e)){throw new Error('$data keyword must have "code" or "validate" function')}}o(zwt,"checkKeyword");function aV(t,e,r){var n;const i=e===null||e===void 0?void 0:e.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let a=i?s.post:s.rules.find(({type:l})=>l===r);if(!a){a={type:r,rules:[]};s.rules.push(a)}s.keywords[t]=true;if(!e)return;const u={keyword:t,definition:{...e,type:(0,v7.getJSONTypes)(e.type),schemaType:(0,v7.getJSONTypes)(e.schemaType)}};if(e.before)Gwt.call(this,a,u,e.before);else a.rules.push(u);s.all[t]=u;(n=e.implements)===null||n===void 0?void 0:n.forEach(l=>this.addKeyword(l))}o(aV,"addRule");function Gwt(t,e,r){const n=t.rules.findIndex(i=>i.keyword===r);if(n>=0){t.rules.splice(n,0,e)}else{t.rules.push(e);this.logger.warn(`rule ${r} is not defined`)}}o(Gwt,"addBeforeRule");function Kwt(t){let{metaSchema:e}=t;if(e===void 0)return;if(t.$data&&this.opts.$data)e=S3e(e);t.validateSchema=this.compile(e,true)}o(Kwt,"keywordMetaschema");var Ywt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function S3e(t){return{anyOf:[t,Ywt]}}o(S3e,"schemaOrData")});var A3e=_(uV=>{"use strict";Object.defineProperty(uV,"__esModule",{value:true});var Wwt={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};uV.default=Wwt});var b7=_(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:true});gm.callRef=gm.getValidate=void 0;var Jwt=g7();var x3e=No();var Ea=Pt();var Gg=Oo();var C3e=d6();var _7=sr();var Qwt={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:r,it:n}=t;const{baseId:i,schemaEnv:s,validateName:a,opts:u,self:l}=n;const{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return p();const d=C3e.resolveRef.call(l,c,i,r);if(d===void 0)throw new Jwt.default(n.opts.uriResolver,i,r);if(d instanceof C3e.SchemaEnv)return f(d);return h(d);function p(){if(s===c)return E7(t,a,s,s.$async);const m=e.scopeValue("root",{ref:c});return E7(t,(0,Ea._)`${m}.validate`,c,c.$async)}o(p,"callRootRef");function f(m){const g=R3e(t,m);E7(t,g,m,m.$async)}o(f,"callValidate");function h(m){const g=e.scopeValue("schema",u.code.source===true?{ref:m,code:(0,Ea.stringify)(m)}:{ref:m});const y=e.name("valid");const v=t.subschema({schema:m,dataTypes:[],schemaPath:Ea.nil,topSchemaRef:g,errSchemaPath:r},y);t.mergeEvaluated(v);t.ok(y)}o(h,"inlineRefSchema")}};function R3e(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ea._)`${r.scopeValue("wrapper",{ref:e})}.validate`}o(R3e,"getValidate");gm.getValidate=R3e;function E7(t,e,r,n){const{gen:i,it:s}=t;const{allErrors:a,schemaEnv:u,opts:l}=s;const c=l.passContext?Gg.default.this:Ea.nil;if(n)d();else p();function d(){if(!u.$async)throw new Error("async schema referenced by sync schema");const m=i.let("valid");i.try(()=>{i.code((0,Ea._)`await ${(0,x3e.callValidateCode)(t,e,c)}`);h(e);if(!a)i.assign(m,true)},g=>{i.if((0,Ea._)`!(${g} instanceof ${s.ValidationError})`,()=>i.throw(g));f(g);if(!a)i.assign(m,false)});t.ok(m)}o(d,"callAsyncRef");function p(){t.result((0,x3e.callValidateCode)(t,e,c),()=>h(e),()=>f(e))}o(p,"callSyncRef");function f(m){const g=(0,Ea._)`${m}.errors`;i.assign(Gg.default.vErrors,(0,Ea._)`${Gg.default.vErrors} === null ? ${g} : ${Gg.default.vErrors}.concat(${g})`);i.assign(Gg.default.errors,(0,Ea._)`${Gg.default.vErrors}.length`)}o(f,"addErrorsFrom");function h(m){var g;if(!s.opts.unevaluated)return;const y=(g=r===null||r===void 0?void 0:r.validate)===null||g===void 0?void 0:g.evaluated;if(s.props!==true){if(y&&!y.dynamicProps){if(y.props!==void 0){s.props=_7.mergeEvaluated.props(i,y.props,s.props)}}else{const v=i.var("props",(0,Ea._)`${m}.evaluated.props`);s.props=_7.mergeEvaluated.props(i,v,s.props,Ea.Name)}}if(s.items!==true){if(y&&!y.dynamicItems){if(y.items!==void 0){s.items=_7.mergeEvaluated.items(i,y.items,s.items)}}else{const v=i.var("items",(0,Ea._)`${m}.evaluated.items`);s.items=_7.mergeEvaluated.items(i,v,s.items,Ea.Name)}}}o(h,"addEvaluatedFrom")}o(E7,"callRef");gm.callRef=E7;gm.default=Qwt});var O3e=_(lV=>{"use strict";Object.defineProperty(lV,"__esModule",{value:true});var Xwt=A3e();var Zwt=b7();var e9t=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Xwt.default,Zwt.default];lV.default=e9t});var N3e=_(cV=>{"use strict";Object.defineProperty(cV,"__esModule",{value:true});var w7=Pt();var Hp=w7.operators;var S7={maximum:{okStr:"<=",ok:Hp.LTE,fail:Hp.GT},minimum:{okStr:">=",ok:Hp.GTE,fail:Hp.LT},exclusiveMaximum:{okStr:"<",ok:Hp.LT,fail:Hp.GTE},exclusiveMinimum:{okStr:">",ok:Hp.GT,fail:Hp.LTE}};var t9t={message:({keyword:t,schemaCode:e})=>(0,w7.str)`must be ${S7[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,w7._)`{comparison: ${S7[t].okStr}, limit: ${e}}`};var r9t={keyword:Object.keys(S7),type:"number",schemaType:"number",$data:true,error:t9t,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,w7._)`${r} ${S7[e].fail} ${n} || isNaN(${r})`)}};cV.default=r9t});var I3e=_(dV=>{"use strict";Object.defineProperty(dV,"__esModule",{value:true});var m6=Pt();var n9t={message:({schemaCode:t})=>(0,m6.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,m6._)`{multipleOf: ${t}}`};var i9t={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:n9t,code(t){const{gen:e,data:r,schemaCode:n,it:i}=t;const s=i.opts.multipleOfPrecision;const a=e.let("res");const u=s?(0,m6._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,m6._)`${a} !== parseInt(${a})`;t.fail$data((0,m6._)`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};dV.default=i9t});var D3e=_(pV=>{"use strict";Object.defineProperty(pV,"__esModule",{value:true});function P3e(t){const e=t.length;let r=0;let n=0;let i;while(n<e){r++;i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<e){i=t.charCodeAt(n);if((i&64512)===56320)n++}}return r}o(P3e,"ucs2length");pV.default=P3e;P3e.code='require("ajv/dist/runtime/ucs2length").default'});var k3e=_(fV=>{"use strict";Object.defineProperty(fV,"__esModule",{value:true});var ym=Pt();var s9t=sr();var a9t=D3e();var o9t={message({keyword:t,schemaCode:e}){const r=t==="maxLength"?"more":"fewer";return(0,ym.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,ym._)`{limit: ${t}}`};var u9t={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:o9t,code(t){const{keyword:e,data:r,schemaCode:n,it:i}=t;const s=e==="maxLength"?ym.operators.GT:ym.operators.LT;const a=i.opts.unicode===false?(0,ym._)`${r}.length`:(0,ym._)`${(0,s9t.useFunc)(t.gen,a9t.default)}(${r})`;t.fail$data((0,ym._)`${a} ${s} ${n}`)}};fV.default=u9t});var $3e=_(hV=>{"use strict";Object.defineProperty(hV,"__esModule",{value:true});var l9t=No();var T7=Pt();var c9t={message:({schemaCode:t})=>(0,T7.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,T7._)`{pattern: ${t}}`};var d9t={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:c9t,code(t){const{data:e,$data:r,schema:n,schemaCode:i,it:s}=t;const a=s.opts.unicodeRegExp?"u":"";const u=r?(0,T7._)`(new RegExp(${i}, ${a}))`:(0,l9t.usePattern)(t,n);t.fail$data((0,T7._)`!${u}.test(${e})`)}};hV.default=d9t});var L3e=_(mV=>{"use strict";Object.defineProperty(mV,"__esModule",{value:true});var g6=Pt();var p9t={message({keyword:t,schemaCode:e}){const r=t==="maxProperties"?"more":"fewer";return(0,g6.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,g6._)`{limit: ${t}}`};var f9t={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:p9t,code(t){const{keyword:e,data:r,schemaCode:n}=t;const i=e==="maxProperties"?g6.operators.GT:g6.operators.LT;t.fail$data((0,g6._)`Object.keys(${r}).length ${i} ${n}`)}};mV.default=f9t});var q3e=_(gV=>{"use strict";Object.defineProperty(gV,"__esModule",{value:true});var y6=No();var v6=Pt();var h9t=sr();var m9t={message:({params:{missingProperty:t}})=>(0,v6.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,v6._)`{missingProperty: ${t}}`};var g9t={keyword:"required",type:"object",schemaType:"array",$data:true,error:m9t,code(t){const{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t;const{opts:u}=a;if(!s&&r.length===0)return;const l=r.length>=u.loopRequired;if(a.allErrors)c();else d();if(u.strictRequired){const h=t.parentSchema.properties;const{definedProperties:m}=t.it;for(const g of r){if((h===null||h===void 0?void 0:h[g])===void 0&&!m.has(g)){const y=a.schemaEnv.baseId+a.errSchemaPath;const v=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,h9t.checkStrictMode)(a,v,a.opts.strictRequired)}}}function c(){if(l||s){t.block$data(v6.nil,p)}else{for(const h of r){(0,y6.checkReportMissingProp)(t,h)}}}o(c,"allErrorsMode");function d(){const h=e.let("missing");if(l||s){const m=e.let("valid",true);t.block$data(m,()=>f(h,m));t.ok(m)}else{e.if((0,y6.checkMissingProp)(t,r,h));(0,y6.reportMissingProp)(t,h);e.else()}}o(d,"exitOnErrorMode");function p(){e.forOf("prop",n,h=>{t.setParams({missingProperty:h});e.if((0,y6.noPropertyInData)(e,i,h,u.ownProperties),()=>t.error())})}o(p,"loopAllRequired");function f(h,m){t.setParams({missingProperty:h});e.forOf(h,n,()=>{e.assign(m,(0,y6.propertyInData)(e,i,h,u.ownProperties));e.if((0,v6.not)(m),()=>{t.error();e.break()})},v6.nil)}o(f,"loopUntilMissing")}};gV.default=g9t});var j3e=_(yV=>{"use strict";Object.defineProperty(yV,"__esModule",{value:true});var _6=Pt();var y9t={message({keyword:t,schemaCode:e}){const r=t==="maxItems"?"more":"fewer";return(0,_6.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,_6._)`{limit: ${t}}`};var v9t={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:y9t,code(t){const{keyword:e,data:r,schemaCode:n}=t;const i=e==="maxItems"?_6.operators.GT:_6.operators.LT;t.fail$data((0,_6._)`${r}.length ${i} ${n}`)}};yV.default=v9t});var A7=_(vV=>{"use strict";Object.defineProperty(vV,"__esModule",{value:true});var U3e=nu();U3e.code='require("ajv/dist/runtime/equal").default';vV.default=U3e});var F3e=_(EV=>{"use strict";Object.defineProperty(EV,"__esModule",{value:true});var _V=a6();var rs=Pt();var _9t=sr();var E9t=A7();var b9t={message:({params:{i:t,j:e}})=>(0,rs.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,rs._)`{i: ${t}, j: ${e}}`};var w9t={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:b9t,code(t){const{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=t;if(!n&&!i)return;const l=e.let("valid");const c=s.items?(0,_V.getSchemaTypes)(s.items):[];t.block$data(l,d,(0,rs._)`${a} === false`);t.ok(l);function d(){const m=e.let("i",(0,rs._)`${r}.length`);const g=e.let("j");t.setParams({i:m,j:g});e.assign(l,true);e.if((0,rs._)`${m} > 1`,()=>(p()?f:h)(m,g))}o(d,"validateUniqueItems");function p(){return c.length>0&&!c.some(m=>m==="object"||m==="array")}o(p,"canOptimize");function f(m,g){const y=e.name("item");const v=(0,_V.checkDataTypes)(c,y,u.opts.strictNumbers,_V.DataType.Wrong);const w=e.const("indices",(0,rs._)`{}`);e.for((0,rs._)`;${m}--;`,()=>{e.let(y,(0,rs._)`${r}[${m}]`);e.if(v,(0,rs._)`continue`);if(c.length>1)e.if((0,rs._)`typeof ${y} == "string"`,(0,rs._)`${y} += "_"`);e.if((0,rs._)`typeof ${w}[${y}] == "number"`,()=>{e.assign(g,(0,rs._)`${w}[${y}]`);t.error();e.assign(l,false).break()}).code((0,rs._)`${w}[${y}] = ${m}`)})}o(f,"loopN");function h(m,g){const y=(0,_9t.useFunc)(e,E9t.default);const v=e.name("outer");e.label(v).for((0,rs._)`;${m}--;`,()=>e.for((0,rs._)`${g} = ${m}; ${g}--;`,()=>e.if((0,rs._)`${y}(${r}[${m}], ${r}[${g}])`,()=>{t.error();e.assign(l,false).break(v)})))}o(h,"loopN2")}};EV.default=w9t});var M3e=_(wV=>{"use strict";Object.defineProperty(wV,"__esModule",{value:true});var bV=Pt();var S9t=sr();var T9t=A7();var A9t={message:"must be equal to constant",params:({schemaCode:t})=>(0,bV._)`{allowedValue: ${t}}`};var x9t={keyword:"const",$data:true,error:A9t,code(t){const{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;if(n||s&&typeof s=="object"){t.fail$data((0,bV._)`!${(0,S9t.useFunc)(e,T9t.default)}(${r}, ${i})`)}else{t.fail((0,bV._)`${s} !== ${r}`)}}};wV.default=x9t});var B3e=_(SV=>{"use strict";Object.defineProperty(SV,"__esModule",{value:true});var E6=Pt();var C9t=sr();var R9t=A7();var O9t={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,E6._)`{allowedValues: ${t}}`};var N9t={keyword:"enum",schemaType:"array",$data:true,error:O9t,code(t){const{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");const u=i.length>=a.opts.loopEnum;let l;const c=o(()=>l!==null&&l!==void 0?l:l=(0,C9t.useFunc)(e,R9t.default),"getEql");let d;if(u||n){d=e.let("valid");t.block$data(d,p)}else{if(!Array.isArray(i))throw new Error("ajv implementation error");const h=e.const("vSchema",s);d=(0,E6.or)(...i.map((m,g)=>f(h,g)))}t.pass(d);function p(){e.assign(d,false);e.forOf("v",s,h=>e.if((0,E6._)`${c()}(${r}, ${h})`,()=>e.assign(d,true).break()))}o(p,"loopEnum");function f(h,m){const g=i[m];return typeof g==="object"&&g!==null?(0,E6._)`${c()}(${r}, ${h}[${m}])`:(0,E6._)`${r} === ${g}`}o(f,"equalCode")}};SV.default=N9t});var V3e=_(TV=>{"use strict";Object.defineProperty(TV,"__esModule",{value:true});var I9t=N3e();var P9t=I3e();var D9t=k3e();var k9t=$3e();var $9t=L3e();var L9t=q3e();var q9t=j3e();var j9t=F3e();var U9t=M3e();var F9t=B3e();var M9t=[I9t.default,P9t.default,D9t.default,k9t.default,$9t.default,L9t.default,q9t.default,j9t.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},U9t.default,F9t.default];TV.default=M9t});var xV=_(b6=>{"use strict";Object.defineProperty(b6,"__esModule",{value:true});b6.validateAdditionalItems=void 0;var vm=Pt();var AV=sr();var B9t={message:({params:{len:t}})=>(0,vm.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,vm._)`{limit: ${t}}`};var V9t={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:B9t,code(t){const{parentSchema:e,it:r}=t;const{items:n}=e;if(!Array.isArray(n)){(0,AV.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}H3e(t,n)}};function H3e(t,e){const{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=true;const u=r.const("len",(0,vm._)`${i}.length`);if(n===false){t.setParams({len:e.length});t.pass((0,vm._)`${u} <= ${e.length}`)}else if(typeof n=="object"&&!(0,AV.alwaysValidSchema)(a,n)){const c=r.var("valid",(0,vm._)`${u} <= ${e.length}`);r.if((0,vm.not)(c),()=>l(c));t.ok(c)}function l(c){r.forRange("i",e.length,u,d=>{t.subschema({keyword:s,dataProp:d,dataPropType:AV.Type.Num},c);if(!a.allErrors)r.if((0,vm.not)(c),()=>r.break())})}o(l,"validateItems")}o(H3e,"validateAdditionalItems");b6.validateAdditionalItems=H3e;b6.default=V9t});var CV=_(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:true});w6.validateTuple=void 0;var z3e=Pt();var x7=sr();var H9t=No();var z9t={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:r}=t;if(Array.isArray(e))return G3e(t,"additionalItems",e);r.items=true;if((0,x7.alwaysValidSchema)(r,e))return;t.ok((0,H9t.validateArray)(t))}};function G3e(t,e,r=t.schema){const{gen:n,parentSchema:i,data:s,keyword:a,it:u}=t;d(i);if(u.opts.unevaluated&&r.length&&u.items!==true){u.items=x7.mergeEvaluated.items(n,r.length,u.items)}const l=n.name("valid");const c=n.const("len",(0,z3e._)`${s}.length`);r.forEach((p,f)=>{if((0,x7.alwaysValidSchema)(u,p))return;n.if((0,z3e._)`${c} > ${f}`,()=>t.subschema({keyword:a,schemaProp:f,dataProp:f},l));t.ok(l)});function d(p){const{opts:f,errSchemaPath:h}=u;const m=r.length;const g=m===p.minItems&&(m===p.maxItems||p[e]===false);if(f.strictTuples&&!g){const y=`"${a}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,x7.checkStrictMode)(u,y,f.strictTuples)}}o(d,"checkStrictTuple")}o(G3e,"validateTuple");w6.validateTuple=G3e;w6.default=z9t});var K3e=_(RV=>{"use strict";Object.defineProperty(RV,"__esModule",{value:true});var G9t=CV();var K9t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,G9t.validateTuple)(t,"items")};RV.default=K9t});var W3e=_(OV=>{"use strict";Object.defineProperty(OV,"__esModule",{value:true});var Y3e=Pt();var Y9t=sr();var W9t=No();var J9t=xV();var Q9t={message:({params:{len:t}})=>(0,Y3e.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Y3e._)`{limit: ${t}}`};var X9t={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Q9t,code(t){const{schema:e,parentSchema:r,it:n}=t;const{prefixItems:i}=r;n.items=true;if((0,Y9t.alwaysValidSchema)(n,e))return;if(i)(0,J9t.validateAdditionalItems)(t,i);else t.ok((0,W9t.validateArray)(t))}};OV.default=X9t});var J3e=_(NV=>{"use strict";Object.defineProperty(NV,"__esModule",{value:true});var Po=Pt();var C7=sr();var Z9t={message:({params:{min:t,max:e}})=>e===void 0?(0,Po.str)`must contain at least ${t} valid item(s)`:(0,Po.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Po._)`{minContains: ${t}}`:(0,Po._)`{minContains: ${t}, maxContains: ${e}}`};var eSt={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:Z9t,code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;let a;let u;const{minContains:l,maxContains:c}=n;if(s.opts.next){a=l===void 0?1:l;u=c}else{a=1}const d=e.const("len",(0,Po._)`${i}.length`);t.setParams({min:a,max:u});if(u===void 0&&a===0){(0,C7.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(u!==void 0&&a>u){(0,C7.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`);t.fail();return}if((0,C7.alwaysValidSchema)(s,r)){let g=(0,Po._)`${d} >= ${a}`;if(u!==void 0)g=(0,Po._)`${g} && ${d} <= ${u}`;t.pass(g);return}s.items=true;const p=e.name("valid");if(u===void 0&&a===1){h(p,()=>e.if(p,()=>e.break()))}else if(a===0){e.let(p,true);if(u!==void 0)e.if((0,Po._)`${i}.length > 0`,f)}else{e.let(p,false);f()}t.result(p,()=>t.reset());function f(){const g=e.name("_valid");const y=e.let("count",0);h(g,()=>e.if(g,()=>m(y)))}o(f,"validateItemsWithCount");function h(g,y){e.forRange("i",0,d,v=>{t.subschema({keyword:"contains",dataProp:v,dataPropType:C7.Type.Num,compositeRule:true},g);y()})}o(h,"validateItems");function m(g){e.code((0,Po._)`${g}++`);if(u===void 0){e.if((0,Po._)`${g} >= ${a}`,()=>e.assign(p,true).break())}else{e.if((0,Po._)`${g} > ${u}`,()=>e.assign(p,false).break());if(a===1)e.assign(p,true);else e.if((0,Po._)`${g} >= ${a}`,()=>e.assign(p,true))}}o(m,"checkLimits")}};NV.default=eSt});var R7=_(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:true});Ol.validateSchemaDeps=Ol.validatePropertyDeps=Ol.error=void 0;var IV=Pt();var tSt=sr();var S6=No();Ol.error={message:({params:{property:t,depsCount:e,deps:r}})=>{const n=e===1?"property":"properties";return(0,IV.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,IV._)`{property: ${t},
@@ -407,5 +407,5 @@ ${p}
407
407
  ${f}`;const m=`${a}/${t.region}/${n}/${INt}`;const g=`${DSe}
408
408
  ${s}
409
409
  ${m}
410
- `+await t.crypto.sha256DigestHex(h);const y=await PNt(t.crypto,t.securityCredentials.secretAccessKey,a,t.region,n);const v=await K6(t.crypto,y,g);const w=`${DSe} Credential=${t.securityCredentials.accessKeyId}/${m}, SignedHeaders=${p}, Signature=${(0,kSe.fromArrayBufferToHex)(v)}`;return{amzDate:u.date?void 0:s,authorizationHeader:w,canonicalQuerystring:t.canonicalQuerystring}}o(DNt,"generateAuthenticationHeaderMap")});var mG=_(VA=>{"use strict";Object.defineProperty(VA,"__esModule",{value:true});VA.AwsClient=void 0;var kNt=$Se();var $Nt=cf();var Y6=class extends $Nt.BaseExternalAccountClient{static{o(this,"AwsClient")}constructor(e,r){super(e,r);this.environmentId=e.credential_source.environment_id;this.regionUrl=e.credential_source.region_url;this.securityCredentialsUrl=e.credential_source.url;this.regionalCredVerificationUrl=e.credential_source.regional_cred_verification_url;this.imdsV2SessionTokenUrl=e.credential_source.imdsv2_session_token_url;this.awsRequestSigner=null;this.region="";this.validateEnvironmentId()}validateEnvironmentId(){var e;const r=(e=this.environmentId)===null||e===void 0?void 0:e.match(/^(aws)(\d+)$/);if(!r||!this.regionalCredVerificationUrl){throw new Error('No valid AWS "credential_source" provided')}else if(parseInt(r[2],10)!==1){throw new Error(`aws version "${r[2]}" is not supported in the current build.`)}}async retrieveSubjectToken(){if(!this.awsRequestSigner){const i={};if(this.shouldUseMetadataServer()&&this.imdsV2SessionTokenUrl){i["x-aws-ec2-metadata-token"]=await this.getImdsV2SessionToken()}this.region=await this.getAwsRegion(i);this.awsRequestSigner=new kNt.AwsRequestSigner(async()=>{if(this.securityCredentialsFromEnv){return this.securityCredentialsFromEnv}const s=await this.getAwsRoleName(i);const a=await this.getAwsSecurityCredentials(s,i);return{accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,token:a.Token}},this.region)}const e=await this.awsRequestSigner.getRequestOptions({url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"});const r=[];const n=Object.assign({"x-goog-cloud-target-resource":this.audience},e.headers);for(const i in n){r.push({key:i,value:n[i]})}return encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}async getImdsV2SessionToken(){const e={url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};const r=await this.transporter.request(e);return r.data}async getAwsRegion(e){if(this.regionFromEnv){return this.regionFromEnv}if(!this.regionUrl){throw new Error('Unable to determine AWS region due to missing "options.credential_source.region_url"')}const r={url:this.regionUrl,method:"GET",responseType:"text",headers:e};const n=await this.transporter.request(r);return n.data.substr(0,n.data.length-1)}async getAwsRoleName(e){if(!this.securityCredentialsUrl){throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"')}const r={url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:e};const n=await this.transporter.request(r);return n.data}async getAwsSecurityCredentials(e,r){const n=await this.transporter.request({url:`${this.securityCredentialsUrl}/${e}`,responseType:"json",headers:r});return n.data}shouldUseMetadataServer(){return!this.regionFromEnv||!this.securityCredentialsFromEnv}get regionFromEnv(){return process.env["AWS_REGION"]||process.env["AWS_DEFAULT_REGION"]||null}get securityCredentialsFromEnv(){if(process.env["AWS_ACCESS_KEY_ID"]&&process.env["AWS_SECRET_ACCESS_KEY"]){return{accessKeyId:process.env["AWS_ACCESS_KEY_ID"],secretAccessKey:process.env["AWS_SECRET_ACCESS_KEY"],token:process.env["AWS_SESSION_TOKEN"]}}return null}};VA.AwsClient=Y6;Y6.AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";Y6.AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254"});var EG=_(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:true});pi.InvalidSubjectTokenError=pi.InvalidMessageFieldError=pi.InvalidCodeFieldError=pi.InvalidTokenTypeFieldError=pi.InvalidExpirationTimeFieldError=pi.InvalidSuccessFieldError=pi.InvalidVersionFieldError=pi.ExecutableResponseError=pi.ExecutableResponse=void 0;var HA="urn:ietf:params:oauth:token-type:saml2";var gG="urn:ietf:params:oauth:token-type:id_token";var yG="urn:ietf:params:oauth:token-type:jwt";var vG=class{static{o(this,"ExecutableResponse")}constructor(e){if(!e.version){throw new zA("Executable response must contain a 'version' field.")}if(e.success===void 0){throw new GA("Executable response must contain a 'success' field.")}this.version=e.version;this.success=e.success;if(this.success){this.expirationTime=e.expiration_time;this.tokenType=e.token_type;if(this.tokenType!==HA&&this.tokenType!==gG&&this.tokenType!==yG){throw new KA(`Executable response must contain a 'token_type' field when successful and it must be one of ${gG}, ${yG}, or ${HA}.`)}if(this.tokenType===HA){if(!e.saml_response){throw new W6(`Executable response must contain a 'saml_response' field when token_type=${HA}.`)}this.subjectToken=e.saml_response}else{if(!e.id_token){throw new W6(`Executable response must contain a 'id_token' field when token_type=${gG} or ${yG}.`)}this.subjectToken=e.id_token}}else{if(!e.code){throw new YA("Executable response must contain a 'code' field when unsuccessful.")}if(!e.message){throw new WA("Executable response must contain a 'message' field when unsuccessful.")}this.errorCode=e.code;this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};pi.ExecutableResponse=vG;var Bl=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e);Object.setPrototypeOf(this,new.target.prototype)}};pi.ExecutableResponseError=Bl;var zA=class extends Bl{static{o(this,"InvalidVersionFieldError")}};pi.InvalidVersionFieldError=zA;var GA=class extends Bl{static{o(this,"InvalidSuccessFieldError")}};pi.InvalidSuccessFieldError=GA;var _G=class extends Bl{static{o(this,"InvalidExpirationTimeFieldError")}};pi.InvalidExpirationTimeFieldError=_G;var KA=class extends Bl{static{o(this,"InvalidTokenTypeFieldError")}};pi.InvalidTokenTypeFieldError=KA;var YA=class extends Bl{static{o(this,"InvalidCodeFieldError")}};pi.InvalidCodeFieldError=YA;var WA=class extends Bl{static{o(this,"InvalidMessageFieldError")}};pi.InvalidMessageFieldError=WA;var W6=class extends Bl{static{o(this,"InvalidSubjectTokenError")}};pi.InvalidSubjectTokenError=W6});var LSe=_(JA=>{"use strict";Object.defineProperty(JA,"__esModule",{value:true});JA.PluggableAuthHandler=void 0;var LNt=QA();var Nm=EG();var qNt=require("child_process");var bG=require("fs");var wG=class t{static{o(this,"PluggableAuthHandler")}constructor(e){if(!e.command){throw new Error("No command provided.")}this.commandComponents=t.parseCommand(e.command);this.timeoutMillis=e.timeoutMillis;if(!this.timeoutMillis){throw new Error("No timeoutMillis provided.")}this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((r,n)=>{const i=qNt.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}});let s="";i.stdout.on("data",u=>{s+=u});i.stderr.on("data",u=>{s+=u});const a=setTimeout(()=>{i.removeAllListeners();i.kill();return n(new Error("The executable failed to finish within the timeout specified."))},this.timeoutMillis);i.on("close",u=>{clearTimeout(a);if(u===0){try{const l=JSON.parse(s);const c=new Nm.ExecutableResponse(l);return r(c)}catch(l){if(l instanceof Nm.ExecutableResponseError){return n(l)}return n(new Nm.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}}else{return n(new LNt.ExecutableError(s,u.toString()))}})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0){return void 0}let e;try{e=await bG.promises.realpath(this.outputFile)}catch(n){return void 0}if(!(await bG.promises.lstat(e)).isFile()){return void 0}const r=await bG.promises.readFile(e,{encoding:"utf8"});if(r===""){return void 0}try{const n=JSON.parse(r);const i=new Nm.ExecutableResponse(n);if(i.isValid()){return new Nm.ExecutableResponse(n)}return void 0}catch(n){if(n instanceof Nm.ExecutableResponseError){throw n}throw new Nm.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(e){const r=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r){throw new Error(`Provided command: "${e}" could not be parsed.`)}for(let n=0;n<r.length;n++){if(r[n][0]==='"'&&r[n].slice(-1)==='"'){r[n]=r[n].slice(1,-1)}}return r}};JA.PluggableAuthHandler=wG});var QA=_(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:true});Sy.PluggableAuthClient=Sy.ExecutableError=void 0;var jNt=cf();var UNt=EG();var FNt=LSe();var XA=class extends Error{static{o(this,"ExecutableError")}constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`);this.code=r;Object.setPrototypeOf(this,new.target.prototype)}};Sy.ExecutableError=XA;var MNt=30*1e3;var qSe=5*1e3;var jSe=120*1e3;var BNt="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES";var USe=1;var SG=class extends jNt.BaseExternalAccountClient{static{o(this,"PluggableAuthClient")}constructor(e,r){super(e,r);if(!e.credential_source.executable){throw new Error('No valid Pluggable Auth "credential_source" provided.')}this.command=e.credential_source.executable.command;if(!this.command){throw new Error('No valid Pluggable Auth "credential_source" provided.')}if(e.credential_source.executable.timeout_millis===void 0){this.timeoutMillis=MNt}else{this.timeoutMillis=e.credential_source.executable.timeout_millis;if(this.timeoutMillis<qSe||this.timeoutMillis>jSe){throw new Error(`Timeout must be between ${qSe} and ${jSe} milliseconds.`)}}this.outputFile=e.credential_source.executable.output_file;this.handler=new FNt.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile})}async retrieveSubjectToken(){if(process.env[BNt]!=="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 e=void 0;if(this.outputFile){e=await this.handler.retrieveCachedResponse()}if(!e){const r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience);r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType);r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0");if(this.outputFile){r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile)}const n=this.getServiceAccountEmail();if(n){r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n)}e=await this.handler.retrieveResponseFromExecutable(r)}if(e.version>USe){throw new Error(`Version of executable is not currently supported, maximum supported version is ${USe}.`)}if(!e.success){throw new XA(e.errorMessage,e.errorCode)}if(this.outputFile){if(!e.expirationTime){throw new UNt.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.")}}if(e.isExpired()){throw new Error("Executable response is expired.")}return e.subjectToken}};Sy.PluggableAuthClient=SG});var AG=_(ZA=>{"use strict";Object.defineProperty(ZA,"__esModule",{value:true});ZA.ExternalAccountClient=void 0;var VNt=cf();var HNt=fG();var zNt=mG();var GNt=QA();var TG=class{static{o(this,"ExternalAccountClient")}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(e,r){var n,i;if(e&&e.type===VNt.EXTERNAL_ACCOUNT_TYPE){if((n=e.credential_source)===null||n===void 0?void 0:n.environment_id){return new zNt.AwsClient(e,r)}else if((i=e.credential_source)===null||i===void 0?void 0:i.executable){return new GNt.PluggableAuthClient(e,r)}else{return new HNt.IdentityPoolClient(e,r)}}else{return null}}};ZA.ExternalAccountClient=TG});var MSe=_(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:true});Ty.ExternalAccountAuthorizedUserClient=Ty.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var KNt=ny();var FSe=rG();var YNt=Jc();var WNt=require("stream");var JNt=cf();Ty.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var xG=class extends FSe.OAuthClientAuthHandler{static{o(this,"ExternalAccountAuthorizedUserHandler")}constructor(e,r,n){super(n);this.url=e;this.transporter=r}async refreshToken(e,r){const n=new URLSearchParams({grant_type:"refresh_token",refresh_token:e});const i={"Content-Type":"application/x-www-form-urlencoded",...r};const s={url:this.url,method:"POST",headers:i,data:n.toString(),responseType:"json"};this.applyClientAuthenticationOptions(s);try{const a=await this.transporter.request(s);const u=a.data;u.res=a;return u}catch(a){if(a instanceof YNt.GaxiosError&&a.response){throw(0,FSe.getErrorFromOAuthErrorResponse)(a.response.data,a)}throw a}}};var CG=class extends KNt.AuthClient{static{o(this,"ExternalAccountAuthorizedUserClient")}constructor(e,r){super();this.refreshToken=e.refresh_token;const n={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new xG(e.token_url,this.transporter,n);this.cachedAccessToken=null;this.quotaProjectId=e.quota_project_id;if(typeof(r===null||r===void 0?void 0:r.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=JNt.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=r.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(r===null||r===void 0?void 0:r.forceRefreshOnFailure)}async getAccessToken(){if(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){const e=await this.getAccessToken();const r={Authorization:`Bearer ${e.token}`};return this.addSharedMetadataHeaders(r)}request(e,r){if(r){this.requestAsync(e).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(e)}}async requestAsync(e,r=false){let n;try{const i=await this.getRequestHeaders();e.headers=e.headers||{};if(i&&i["x-goog-user-project"]){e.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){e.headers.Authorization=i.Authorization}n=await this.transporter.request(e)}catch(i){const s=i.response;if(s){const a=s.status;const u=s.config.data instanceof WNt.Readable;const l=a===401||a===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(e,true)}}throw i}return n}async refreshAccessTokenAsync(){const e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res};if(e.refresh_token!==void 0){this.refreshToken=e.refresh_token}return this.cachedAccessToken}isExpired(e){const r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:false}};Ty.ExternalAccountAuthorizedUserClient=CG});var HSe=_(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:true});xy.GoogleAuth=xy.CLOUD_SDK_CLIENT_ID=void 0;var QNt=require("child_process");var J6=require("fs");var RG=G7();var XNt=require("os");var OG=require("path");var ZNt=ty();var eIt=N6();var tIt=jH();var rIt=FH();var nIt=MH();var Ay=Jz();var NG=Xz();var ex=eG();var iIt=AG();var Q6=cf();var BSe=MSe();xy.CLOUD_SDK_CLIENT_ID="764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com";var VSe={NO_PROJECT_ID_FOUND:"Unable to detect a Project Id in the current environment. \nTo learn more about authentication and Google APIs, visit: \nhttps://cloud.google.com/docs/authentication/getting-started"};var tx=class{static{o(this,"GoogleAuth")}get isGCE(){return this.checkIsGCE}constructor(e){this.checkIsGCE=void 0;this.jsonContent=null;this.cachedCredential=null;e=e||{};this._cachedProjectId=e.projectId||null;this.cachedCredential=e.authClient||null;this.keyFilename=e.keyFilename||e.keyFile;this.scopes=e.scopes;this.jsonContent=e.credentials||null;this.clientOptions=e.clientOptions}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath;e.useJWTAccessWithScope=this.useJWTAccessWithScope;e.defaultScopes=this.defaultScopes}getProjectId(e){if(e){this.getProjectIdAsync().then(r=>e(null,r),e)}else{return this.getProjectIdAsync()}}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===VSe.NO_PROJECT_ID_FOUND){return null}else{throw e}}}async findAndCacheProjectId(){let e=null;e||(e=await this.getProductionProjectId());e||(e=await this.getFileProjectId());e||(e=await this.getDefaultServiceProjectId());e||(e=await this.getGCEProjectId());e||(e=await this.getExternalAccountClientProjectId());if(e){this._cachedProjectId=e;return e}else{throw new Error(VSe.NO_PROJECT_ID_FOUND)}}async getProjectIdAsync(){if(this._cachedProjectId){return this._cachedProjectId}if(!this._findProjectIdPromise){this._findProjectIdPromise=this.findAndCacheProjectId()}return this._findProjectIdPromise}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e==="function"){r=e}else{n=e}if(r){this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r)}else{return this.getApplicationDefaultAsync(n)}}async getApplicationDefaultAsync(e={}){if(this.cachedCredential){return await this.prepareAndCacheADC(this.cachedCredential)}const r=process.env["GOOGLE_CLOUD_QUOTA_PROJECT"];let n;n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e);if(n){if(n instanceof Ay.JWT){n.scopes=this.scopes}else if(n instanceof Q6.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}n=await this._tryGetApplicationCredentialsFromWellKnownFile(e);if(n){if(n instanceof Ay.JWT){n.scopes=this.scopes}else if(n instanceof Q6.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}let i;try{i=await this._checkIsGCE()}catch(s){if(s instanceof Error){s.message=`Unexpected error determining execution environment: ${s.message}`}throw s}if(!i){throw new Error("Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.")}e.scopes=this.getAnyScopes();return await this.prepareAndCacheADC(new tIt.Compute(e),r)}async prepareAndCacheADC(e,r){const n=await this.getProjectIdOptional();if(r){e.quotaProjectId=r}this.cachedCredential=e;return{credential:e,projectId:n}}async _checkIsGCE(){if(this.checkIsGCE===void 0){this.checkIsGCE=await RG.isAvailable()}return this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){const r=process.env["GOOGLE_APPLICATION_CREDENTIALS"]||process.env["google_application_credentials"];if(!r||r.length===0){return null}try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){if(n instanceof Error){n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`}throw n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows()){r=process.env["APPDATA"]}else{const i=process.env["HOME"];if(i){r=OG.join(i,".config")}}if(r){r=OG.join(r,"gcloud","application_default_credentials.json");if(!J6.existsSync(r)){r=null}}if(!r){return null}const n=await this._getApplicationCredentialsFromFilePath(r,e);return n}async _getApplicationCredentialsFromFilePath(e,r={}){if(!e||e.length===0){throw new Error("The file path is invalid.")}try{e=J6.realpathSync(e);if(!J6.lstatSync(e).isFile()){throw new Error}}catch(i){if(i instanceof Error){i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`}throw i}const n=J6.createReadStream(e);return this.fromStream(n,r)}fromImpersonatedJSON(e){var r,n,i,s;if(!e){throw new Error("Must pass in a JSON object containing an impersonated refresh token")}if(e.type!==ex.IMPERSONATED_ACCOUNT_TYPE){throw new Error(`The incoming JSON object does not have the "${ex.IMPERSONATED_ACCOUNT_TYPE}" type`)}if(!e.source_credentials){throw new Error("The incoming JSON object does not contain a source_credentials field")}if(!e.service_account_impersonation_url){throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field")}const a=new NG.UserRefreshClient(e.source_credentials.client_id,e.source_credentials.client_secret,e.source_credentials.refresh_token);const u=(n=(r=/(?<target>[^/]+):generateAccessToken$/.exec(e.service_account_impersonation_url))===null||r===void 0?void 0:r.groups)===null||n===void 0?void 0:n.target;if(!u){throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`)}const l=(i=this.getAnyScopes())!==null&&i!==void 0?i:[];const c=new ex.Impersonated({delegates:(s=e.delegates)!==null&&s!==void 0?s:[],sourceClient:a,targetPrincipal:u,targetScopes:Array.isArray(l)?l:[l]});return c}fromJSON(e,r={}){let n;r=r||{};if(e.type===NG.USER_REFRESH_ACCOUNT_TYPE){n=new NG.UserRefreshClient(r);n.fromJSON(e)}else if(e.type===ex.IMPERSONATED_ACCOUNT_TYPE){n=this.fromImpersonatedJSON(e)}else if(e.type===Q6.EXTERNAL_ACCOUNT_TYPE){n=iIt.ExternalAccountClient.fromJSON(e,r);n.scopes=this.getAnyScopes()}else if(e.type===BSe.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE){n=new BSe.ExternalAccountAuthorizedUserClient(e,r)}else{r.scopes=this.scopes;n=new Ay.JWT(r);this.setGapicJWTValues(n);n.fromJSON(e)}return n}_cacheClientFromJSON(e,r){const n=this.fromJSON(e,r);this.jsonContent=e;this.cachedCredential=n;return n}fromStream(e,r={},n){let i={};if(typeof r==="function"){n=r}else{i=r}if(n){this.fromStreamAsync(e,i).then(s=>n(null,s),n)}else{return this.fromStreamAsync(e,i)}}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e){throw new Error("Must pass in a stream containing the Google auth settings.")}let s="";e.setEncoding("utf8").on("error",i).on("data",a=>s+=a).on("end",()=>{try{try{const a=JSON.parse(s);const u=this._cacheClientFromJSON(a,r);return n(u)}catch(a){if(!this.keyFilename)throw a;const u=new Ay.JWT({...this.clientOptions,keyFile:this.keyFilename});this.cachedCredential=u;this.setGapicJWTValues(u);return n(u)}}catch(a){return i(a)}})})}fromAPIKey(e,r){r=r||{};const n=new Ay.JWT(r);n.fromAPIKey(e);return n}_isWindows(){const e=XNt.platform();if(e&&e.length>=3){if(e.substring(0,3).toLowerCase()==="win"){return true}}return false}async getDefaultServiceProjectId(){return new Promise(e=>{(0,QNt.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n){try{const i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch(i){}}e(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){const r=await this.getClient();if(r&&r.projectId){return r.projectId}}const e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();if(e){return e.projectId}else{return null}}async getExternalAccountClientProjectId(){if(!this.jsonContent||this.jsonContent.type!==Q6.EXTERNAL_ACCOUNT_TYPE){return null}const e=await this.getClient();return await e.getProjectId()}async getGCEProjectId(){try{const e=await RG.project("project-id");return e}catch(e){return null}}getCredentials(e){if(e){this.getCredentialsAsync().then(r=>e(null,r),e)}else{return this.getCredentialsAsync()}}async getCredentialsAsync(){const e=await this.getClient();if(e instanceof Q6.BaseExternalAccountClient){const i=e.getServiceAccountEmail();if(i){return{client_email:i}}}if(this.jsonContent){const i={client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key};return i}const r=await this._checkIsGCE();if(!r){throw new Error("Unknown error.")}const n=await RG.instance({property:"service-accounts/",params:{recursive:"true"}});if(!n||!n.default||!n.default.email){throw new Error("Failure from metadata server.")}return{client_email:n.default.email}}async getClient(){if(!this.cachedCredential){if(this.jsonContent){this._cacheClientFromJSON(this.jsonContent,this.clientOptions)}else if(this.keyFilename){const e=OG.resolve(this.keyFilename);const r=J6.createReadStream(e);await this.fromStreamAsync(r,this.clientOptions)}else{await this.getApplicationDefaultAsync(this.clientOptions)}}return this.cachedCredential}async getIdTokenClient(e){const r=await this.getClient();if(!("fetchIdToken"in r)){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 rIt.IdTokenClient({targetAudience:e,idTokenProvider:r})}async getAccessToken(){const e=await this.getClient();return(await e.getAccessToken()).token}async getRequestHeaders(e){const r=await this.getClient();return r.getRequestHeaders(e)}async authorizeRequest(e){e=e||{};const r=e.url||e.uri;const n=await this.getClient();const i=await n.getRequestHeaders(r);e.headers=Object.assign(e.headers||{},i);return e}async request(e){const r=await this.getClient();return r.request(e)}getEnv(){return(0,nIt.getEnv)()}async sign(e){const r=await this.getClient();const n=(0,ZNt.createCrypto)();if(r instanceof Ay.JWT&&r.key){const s=await n.sign(r.key,e);return s}const i=await this.getCredentials();if(!i.client_email){throw new Error("Cannot sign data without `client_email`.")}return this.signBlob(n,i.client_email,e)}async signBlob(e,r,n){const i=`https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/${r}:signBlob`;const s=await this.request({method:"POST",url:i,data:{payload:e.encodeBase64StringUtf8(n)}});return s.data.signedBlob}};xy.GoogleAuth=tx;tx.DefaultTransporter=eIt.DefaultTransporter});var zSe=_(rx=>{"use strict";Object.defineProperty(rx,"__esModule",{value:true});rx.IAMAuth=void 0;var IG=class{static{o(this,"IAMAuth")}constructor(e,r){this.selector=e;this.token=r;this.selector=e;this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};rx.IAMAuth=IG});var GSe=_(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:true});Du.DownscopedClient=Du.EXPIRATION_TIME_OFFSET=Du.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var sIt=require("stream");var aIt=ny();var oIt=iG();var uIt="urn:ietf:params:oauth:grant-type:token-exchange";var lIt="urn:ietf:params:oauth:token-type:access_token";var cIt="urn:ietf:params:oauth:token-type:access_token";var dIt="https://sts.googleapis.com/v1/token";Du.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Du.EXPIRATION_TIME_OFFSET=5*60*1e3;var PG=class extends aIt.AuthClient{static{o(this,"DownscopedClient")}constructor(e,r,n,i){super();this.authClient=e;this.credentialAccessBoundary=r;if(r.accessBoundary.accessBoundaryRules.length===0){throw new Error("At least one access boundary rule needs to be defined.")}else if(r.accessBoundary.accessBoundaryRules.length>Du.MAX_ACCESS_BOUNDARY_RULES_COUNT){throw new Error(`The provided access boundary has more than ${Du.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`)}for(const s of r.accessBoundary.accessBoundaryRules){if(s.availablePermissions.length===0){throw new Error("At least one permission should be defined in access boundary rules.")}}this.stsCredential=new oIt.StsCredentials(dIt);this.cachedDownscopedAccessToken=null;if(typeof(n===null||n===void 0?void 0:n.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=Du.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=n.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(n===null||n===void 0?void 0:n.forceRefreshOnFailure);this.quotaProjectId=i}setCredentials(e){if(!e.expiry_date){throw new Error("The access token expiry_date field is missing in the provided credentials.")}super.setCredentials(e);this.cachedDownscopedAccessToken=e}async getAccessToken(){if(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){const e=await this.getAccessToken();const r={Authorization:`Bearer ${e.token}`};return this.addSharedMetadataHeaders(r)}request(e,r){if(r){this.requestAsync(e).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(e)}}async requestAsync(e,r=false){let n;try{const i=await this.getRequestHeaders();e.headers=e.headers||{};if(i&&i["x-goog-user-project"]){e.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){e.headers.Authorization=i.Authorization}n=await this.transporter.request(e)}catch(i){const s=i.response;if(s){const a=s.status;const u=s.config.data instanceof sIt.Readable;const l=a===401||a===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(e,true)}}throw i}return n}async refreshAccessTokenAsync(){var e;const r=(await this.authClient.getAccessToken()).token;const n={grantType:uIt,requestedTokenType:lIt,subjectToken:r,subjectTokenType:cIt};const i=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary);const s=((e=this.authClient.credentials)===null||e===void 0?void 0:e.expiry_date)||null;const a=i.expires_in?new Date().getTime()+i.expires_in*1e3:s;this.cachedDownscopedAccessToken={access_token:i.access_token,expiry_date:a,res:i.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});return this.cachedDownscopedAccessToken}isExpired(e){const r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:false}};Du.DownscopedClient=PG});var DG=_(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:true});Ot.GoogleAuth=Ot.auth=Ot.DefaultTransporter=Ot.PluggableAuthClient=Ot.DownscopedClient=Ot.BaseExternalAccountClient=Ot.ExternalAccountClient=Ot.IdentityPoolClient=Ot.AwsClient=Ot.UserRefreshClient=Ot.LoginTicket=Ot.OAuth2Client=Ot.CodeChallengeMethod=Ot.Impersonated=Ot.JWT=Ot.JWTAccess=Ot.IdTokenClient=Ot.IAMAuth=Ot.GCPEnv=Ot.Compute=Ot.AuthClient=void 0;var KSe=HSe();Object.defineProperty(Ot,"GoogleAuth",{enumerable:true,get:function(){return KSe.GoogleAuth}});var pIt=ny();Object.defineProperty(Ot,"AuthClient",{enumerable:true,get:function(){return pIt.AuthClient}});var fIt=jH();Object.defineProperty(Ot,"Compute",{enumerable:true,get:function(){return fIt.Compute}});var hIt=MH();Object.defineProperty(Ot,"GCPEnv",{enumerable:true,get:function(){return hIt.GCPEnv}});var mIt=zSe();Object.defineProperty(Ot,"IAMAuth",{enumerable:true,get:function(){return mIt.IAMAuth}});var gIt=FH();Object.defineProperty(Ot,"IdTokenClient",{enumerable:true,get:function(){return gIt.IdTokenClient}});var yIt=Yz();Object.defineProperty(Ot,"JWTAccess",{enumerable:true,get:function(){return yIt.JWTAccess}});var vIt=Jz();Object.defineProperty(Ot,"JWT",{enumerable:true,get:function(){return vIt.JWT}});var _It=eG();Object.defineProperty(Ot,"Impersonated",{enumerable:true,get:function(){return _It.Impersonated}});var YSe=Em();Object.defineProperty(Ot,"CodeChallengeMethod",{enumerable:true,get:function(){return YSe.CodeChallengeMethod}});Object.defineProperty(Ot,"OAuth2Client",{enumerable:true,get:function(){return YSe.OAuth2Client}});var EIt=$H();Object.defineProperty(Ot,"LoginTicket",{enumerable:true,get:function(){return EIt.LoginTicket}});var bIt=Xz();Object.defineProperty(Ot,"UserRefreshClient",{enumerable:true,get:function(){return bIt.UserRefreshClient}});var wIt=mG();Object.defineProperty(Ot,"AwsClient",{enumerable:true,get:function(){return wIt.AwsClient}});var SIt=fG();Object.defineProperty(Ot,"IdentityPoolClient",{enumerable:true,get:function(){return SIt.IdentityPoolClient}});var TIt=AG();Object.defineProperty(Ot,"ExternalAccountClient",{enumerable:true,get:function(){return TIt.ExternalAccountClient}});var AIt=cf();Object.defineProperty(Ot,"BaseExternalAccountClient",{enumerable:true,get:function(){return AIt.BaseExternalAccountClient}});var xIt=GSe();Object.defineProperty(Ot,"DownscopedClient",{enumerable:true,get:function(){return xIt.DownscopedClient}});var CIt=QA();Object.defineProperty(Ot,"PluggableAuthClient",{enumerable:true,get:function(){return CIt.PluggableAuthClient}});var RIt=N6();Object.defineProperty(Ot,"DefaultTransporter",{enumerable:true,get:function(){return RIt.DefaultTransporter}});var OIt=new KSe.GoogleAuth;Ot.auth=OIt});var Ry=_(Cy=>{"use strict";var NIt=Cy&&Cy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Cy,"__esModule",{value:true});Cy.getServiceAccountIdToken=void 0;var IIt=DG();var PIt=NIt(ru());var DIt=new IIt.GoogleAuth;var WSe=new PIt.default({max:50,maxAge:1e3*60*50});async function kIt(t){let e=WSe.get(t);if(!e){const r=await DIt.getIdTokenClient(t);e=await r.idTokenProvider.fetchIdToken(t);WSe.set(t,e)}return e}o(kIt,"getServiceAccountIdToken");Cy.getServiceAccountIdToken=kIt});var eTe=_(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:true});Fo.mergeHeaders=Fo.createFinalURL=Fo.defaultBodySerializer=Fo.defaultQuerySerializer=Fo.createClient=void 0;var Oy=As();var $It=Ry();var LIt=/\/*$/;async function qIt(t){const{baseUrl:e,fetch:r=globalThis.fetch,querySerializer:n,bodySerializer:i,zuploExtensions:s,...a}=t;const u=s?.fastifyRequest.log;const l=s?.fastifyRequest.id;const c=s?.options?.userSub??s?.fastifyRequest.getUserSub();const d=new Headers({"zuplo-user":c,"zp-rid":l,...a.headers??{}});const p=await(0,$It.getServiceAccountIdToken)(e);d.set("Authorization",`Bearer ${p}`);if(["GET","DELETE","HEAD","OPTIONS","TRACE"].includes(a.method?.toUpperCase()??"")){}else{d.set("Content-Type","application/json")}async function f(h,m){const{headers:g,body:y,params:v={},parseAs:w="json",querySerializer:E=n??JSe,bodySerializer:b=i??QSe,...S}=m||{};const T=XSe(h,{baseUrl:e,params:v,querySerializer:E});const A=ZSe(d,g,v.header);const R={redirect:"follow",...a,...S,headers:A};if(y)R.body=b(y);if(R.body instanceof FormData)A.delete("Content-Type");const O=await r(T,R);if(O.status===404){const j=await O.json();if(j&&j.hasOwnProperty("type")&&j.hasOwnProperty("title")&&j.hasOwnProperty("status")){throw new Oy.ApiError(j)}throw new Oy.ApiError(Oy.Problems.NOT_FOUND)}if(O.status===204||O.headers.get("Content-Length")==="0"){return O.ok?{data:{},response:O}:{error:{},response:O}}if(O.ok){let j=O.body;if(w!=="stream"){const B=O.clone();j=typeof B[w]==="function"?await B[w]():await B.text()}return{data:j,response:O}}else{u.debug(`Error on internal api: path: ${T}, status: ${O.status}, headers: ${JSON.stringify(O.headers)}, body: ${await O.clone().text()}`);let j={};try{j=await O.clone().json();if(j.type&&j.status&&j.title){throw new Oy.ApiError(j)}}catch(B){}throw new Oy.ApiError(Oy.Problems.INTERNAL_SERVER_ERROR)}}o(f,"coreFetch");return{async GET(h,m){return f(h,{...m,method:"GET"})},async PUT(h,m){return f(h,{...m,method:"PUT"})},async POST(h,m){return f(h,{...m,method:"POST"})},async DELETE(h,m){return f(h,{...m,method:"DELETE"})},async OPTIONS(h,m){return f(h,{...m,method:"OPTIONS"})},async HEAD(h,m){return f(h,{...m,method:"HEAD"})},async PATCH(h,m){return f(h,{...m,method:"PATCH"})},async TRACE(h,m){return f(h,{...m,method:"TRACE"})}}}o(qIt,"createClient");Fo.createClient=qIt;function JSe(t){const e=new URLSearchParams;if(t&&typeof t==="object"){for(const[r,n]of Object.entries(t)){if(n===void 0||n===null)continue;e.set(r,n)}}return e.toString()}o(JSe,"defaultQuerySerializer");Fo.defaultQuerySerializer=JSe;function QSe(t){return JSON.stringify(t)}o(QSe,"defaultBodySerializer");Fo.defaultBodySerializer=QSe;function XSe(t,e){let r=`${e.baseUrl?e.baseUrl.replace(LIt,""):""}${t}`;if(e.params.path){for(const[n,i]of Object.entries(e.params.path))r=r.replace(`{${n}}`,encodeURIComponent(String(i)))}if(e.params.query){const n=e.querySerializer(e.params.query);if(n)r+=`?${n}`}return r}o(XSe,"createFinalURL");Fo.createFinalURL=XSe;function ZSe(...t){const e=new Headers;for(const r of t){if(!r||typeof r!=="object")continue;const n=r instanceof Headers?r.entries():Object.entries(r);for(const[i,s]of n){if(s!==void 0&&s!==null){e.set(i,s)}}}return e}o(ZSe,"mergeHeaders");Fo.mergeHeaders=ZSe});var tTe=_(df=>{"use strict";var jIt=df&&df.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(df,"__esModule",{value:true});df.ApiKeyService=df.createApiKeyServiceClient=void 0;var Ny=As();var UIt=DG();var nx=jIt(Oa());var FIt=eTe();async function MIt(t){return(0,FIt.createClient)({baseUrl:nx.default.API_KEY_MANAGEMENT_SERVICE_URL,zuploExtensions:{fastifyRequest:t}})}o(MIt,"createApiKeyServiceClient");df.createApiKeyServiceClient=MIt;var kG=class{static{o(this,"ApiKeyService")}logger;requestId;constructor(e){this.logger=e.log;this.requestId=e.id}async fetchGCP(e,r={}){this.logger.info(`Fetching with GCP JWT ${r.method} ${e} from Api Key Service API.`);const n=new UIt.GoogleAuth;const i=await n.getIdTokenClient(nx.default.API_KEY_MANAGEMENT_SERVICE_URL);this.logger.info(`Payload to send: ${JSON.stringify({url:`${nx.default.API_KEY_MANAGEMENT_SERVICE_URL}/${e}`,method:"GET",body:r.body,headers:{...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}}})}`);const s=await i.getRequestHeaders();const a=await i.request({url:`${nx.default.API_KEY_MANAGEMENT_SERVICE_URL}/${e}`,method:r.method||"GET",body:r.body,headers:{...s,...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}},validateStatus:u=>u>=200&&u<500});if(a.status===404){const u=await a.data;if(u&&u.hasOwnProperty("type")&&u.hasOwnProperty("title")&&u.hasOwnProperty("status")){throw new Ny.ApiError(u)}throw new Ny.ApiError(Ny.Problems.NOT_FOUND)}if(a.status>=300){this.logger.debug(`Error on api-key-service: path: ${e}, status: ${a.status}, headers: ${JSON.stringify(a.headers)}, body: ${JSON.stringify(a.data)}`);const u=a.data;if(u.type&&u.status&&u.title){throw new Ny.ApiError(u)}this.logger.error(`Error not handled on api-key-service: path: ${e}, status: ${a.status}`);throw new Ny.ApiError(Ny.Problems.INTERNAL_SERVER_ERROR)}if(a.status===204){return{}}return a.data}};df.ApiKeyService=kG});var nTe=_(Iy=>{"use strict";var BIt=Iy&&Iy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Iy,"__esModule",{value:true});Iy.AuthApiService=void 0;var Im=As();var rTe=BIt(Oa());var VIt=Ry();var $G=class{static{o(this,"AuthApiService")}logger;requestId;baseUrl;constructor(e){this.logger=e.log;this.requestId=e.id;if(!rTe.default.AUTH_API_URL){throw new Error("AUTH_API_URL is not set")}this.baseUrl=rTe.default.AUTH_API_URL}async getClientJWT(e,r){let n;try{n=await this.fetch(`/v1/clients/${e}`,{method:"GET"})}catch(s){if(s.status===Im.Problems.NOT_FOUND.status){n=await this.fetch(`/v1/clients`,{method:"POST",body:JSON.stringify({client_id:e})})}else{throw s}}const i=await this.fetch(`/v1/oauth/token`,{method:"POST",body:JSON.stringify({client_id:e,client_secret:n.client_secret,grant_type:"client_credentials",custom_claims:r})});return i.access_token}async fetch(e,r){this.logger.info(`Fetching internally ${e} from Auth API V2.`);const n=new Headers({"content-type":"application/json","zp-rid":this.requestId,authorization:""});if(process.env.K_SERVICE){const s=await(0,VIt.getServiceAccountIdToken)(this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${e}`,{...r,headers:n});if(i.status===Im.HttpStatusCode.NOT_FOUND){throw new Im.ApiError(Im.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on auth-api: path: ${e}, status: ${i.status}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new Im.ApiError(s)}this.logger.error(`Error not handled on auth-api: path: ${e}, status: ${i.status}`);throw new Im.ApiError(Im.Problems.INTERNAL_SERVER_ERROR)}return i.clone().json()}};Iy.AuthApiService=$G});var X6=_(ix=>{"use strict";Object.defineProperty(ix,"__esModule",{value:true});ix.ApiServiceClient=void 0;var Py=As();var HIt=Ry();var LG=class{static{o(this,"ApiServiceClient")}userSub;logger;requestId;baseUrl;cache;targetAudience;constructor(e,r,n){this.userSub=n.userSub;this.logger=n.logger;this.requestId=n.requestId;this.baseUrl=e;this.cache=r;this.targetAudience=n.targetAudience}async cachedFetch(e,r,n){if(!this.userSub||!n){throw new Error("userSub and cacheKey parameters are required to use cachedFetch")}const i=`${this.userSub}@${n}`;if(this.cache.has(i)){return this.cache.get(i)}const s=await this.fetchInternally(e,r);this.cache.set(i,s);return s}async fetchInternally(e,r){this.logger.info(`Fetching internally ${r.method} ${this.baseUrl}${e}`);const n=new Headers({...r.headers,"zuplo-user":this.userSub,"content-type":"application/json","zp-rid":this.requestId});if(process.env.K_SERVICE){const s=await(0,HIt.getServiceAccountIdToken)(this.targetAudience??this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${e}`,{...r,headers:n});if(i.status===404){this.logger.debug(`Error on internal api: path: ${e}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.json();if(s&&s.hasOwnProperty("type")&&s.hasOwnProperty("title")&&s.hasOwnProperty("status")){throw new Py.ApiError(s)}throw new Py.ApiError(Py.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on internal api: path: ${e}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new Py.ApiError(s)}this.logger.error(`Error not handled on internal api: path: ${e}, status: ${i.status}`);throw new Py.ApiError(Py.Problems.INTERNAL_SERVER_ERROR)}if(i.status===204){return{}}return i.clone().json()}};ix.ApiServiceClient=LG});var oTe=_(Vl=>{"use strict";var sTe=Vl&&Vl.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Vl,"__esModule",{value:true});Vl.ContentApiService=Vl.getContentApiStorageTarballPath=Vl.contentApiTarballFileName=void 0;var zIt=sTe(ru());var iTe=sTe(Oa());var GIt=X6();var KIt=new zIt.default({max:500,maxAge:1e3*60*50});function aTe(t,e){return`${t}--${e}.tar.gz`}o(aTe,"contentApiTarballFileName");Vl.contentApiTarballFileName=aTe;function YIt(t,e){const r=aTe(t,e);return`${t}/builds/${r}`}o(YIt,"getContentApiStorageTarballPath");Vl.getContentApiStorageTarballPath=YIt;var qG=class extends GIt.ApiServiceClient{static{o(this,"ContentApiService")}constructor(e){if(!iTe.default.CONTENT_API_URL){throw new Error("CONTENT_API_URL is not set")}super(iTe.default.CONTENT_API_URL,KIt,e)}};Vl.ContentApiService=qG});var cTe=_(Dy=>{"use strict";var lTe=Dy&&Dy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Dy,"__esModule",{value:true});Dy.DevApiService=void 0;var WIt=lTe(ru());var uTe=lTe(Oa());var JIt=X6();var QIt=new WIt.default({max:500,maxAge:1e3*60*50});var jG=class extends JIt.ApiServiceClient{static{o(this,"DevApiService")}constructor(e,r){if(!uTe.default.DEV_API_URL){throw new Error("DEV_API_URL is not set")}const n=r&&r.userSub?r.userSub:e.getUserSub();super(uTe.default.DEV_API_URL,QIt,{userSub:n,logger:e.log,requestId:e.id})}};Dy.DevApiService=jG});var fTe=_((Ihr,pTe)=>{var dTe=require("stream").Stream;var XIt=require("util");pTe.exports=ku;function ku(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}o(ku,"DelayedStream");XIt.inherits(ku,dTe);ku.create=function(t,e){var r=new this;e=e||{};for(var n in e){r[n]=e[n]}r.source=t;var i=t.emit;t.emit=function(){r._handleEmit(arguments);return i.apply(t,arguments)};t.on("error",function(){});if(r.pauseStream){t.pause()}return r};Object.defineProperty(ku.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});ku.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ku.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};ku.prototype.pause=function(){this.source.pause()};ku.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this));this._bufferedEvents=[]};ku.prototype.pipe=function(){var t=dTe.prototype.pipe.apply(this,arguments);this.resume();return t};ku.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}if(t[0]==="data"){this.dataSize+=t[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(t)};ku.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}});var yTe=_((Dhr,gTe)=>{var ZIt=require("util");var mTe=require("stream").Stream;var hTe=fTe();gTe.exports=Xn;function Xn(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}o(Xn,"CombinedStream");ZIt.inherits(Xn,mTe);Xn.create=function(t){var e=new this;t=t||{};for(var r in t){e[r]=t[r]}return e};Xn.isStreamLike=function(t){return typeof t!=="function"&&typeof t!=="string"&&typeof t!=="boolean"&&typeof t!=="number"&&!Buffer.isBuffer(t)};Xn.prototype.append=function(t){var e=Xn.isStreamLike(t);if(e){if(!(t instanceof hTe)){var r=hTe.create(t,{maxDataSize:Infinity,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this));t=r}this._handleErrors(t);if(this.pauseStreams){t.pause()}}this._streams.push(t);return this};Xn.prototype.pipe=function(t,e){mTe.prototype.pipe.call(this,t,e);this.resume();return t};Xn.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};Xn.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t=="undefined"){this.end();return}if(typeof t!=="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=Xn.isStreamLike(r);if(n){r.on("data",this._checkDataSize.bind(this));this._handleErrors(r)}this._pipeNext(r)}.bind(this))};Xn.prototype._pipeNext=function(t){this._currentStream=t;var e=Xn.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this));t.pipe(this,{end:false});return}var r=t;this.write(r);this._getNext()};Xn.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};Xn.prototype.write=function(t){this.emit("data",t)};Xn.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};Xn.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};Xn.prototype.end=function(){this._reset();this.emit("end")};Xn.prototype.destroy=function(){this._reset();this.emit("close")};Xn.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};Xn.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))};Xn.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){if(!e.dataSize){return}t.dataSize+=e.dataSize});if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};Xn.prototype._emitError=function(t){this._reset();this.emit("error",t)}});var _Te=_(($hr,vTe)=>{vTe.exports=ePt;function ePt(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(e){e(t)}else{setTimeout(t,0)}}o(ePt,"defer")});var UG=_((qhr,bTe)=>{var ETe=_Te();bTe.exports=tPt;function tPt(t){var e=false;ETe(function(){e=true});return o(function r(n,i){if(e){t(n,i)}else{ETe(o(function s(){t(n,i)},"nextTick_callback"))}},"async_callback")}o(tPt,"async")});var FG=_((Uhr,wTe)=>{wTe.exports=rPt;function rPt(t){Object.keys(t.jobs).forEach(nPt.bind(t));t.jobs={}}o(rPt,"abort");function nPt(t){if(typeof this.jobs[t]=="function"){this.jobs[t]()}}o(nPt,"clean")});var MG=_((Mhr,TTe)=>{var STe=UG();var iPt=FG();TTe.exports=sPt;function sPt(t,e,r,n){var i=r["keyedList"]?r["keyedList"][r.index]:r.index;r.jobs[i]=aPt(e,i,t[i],function(s,a){if(!(i in r.jobs)){return}delete r.jobs[i];if(s){iPt(r)}else{r.results[i]=a}n(s,r.results)})}o(sPt,"iterate");function aPt(t,e,r,n){var i;if(t.length==2){i=t(r,STe(n))}else{i=t(r,e,STe(n))}return i}o(aPt,"runJob")});var BG=_((Vhr,ATe)=>{ATe.exports=oPt;function oPt(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};if(e){n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])})}return n}o(oPt,"state")});var VG=_((zhr,xTe)=>{var uPt=FG();var lPt=UG();xTe.exports=cPt;function cPt(t){if(!Object.keys(this.jobs).length){return}this.index=this.size;uPt(this);lPt(t)(null,this.results)}o(cPt,"terminator")});var RTe=_((Khr,CTe)=>{var dPt=MG();var pPt=BG();var fPt=VG();CTe.exports=hPt;function hPt(t,e,r){var n=pPt(t);while(n.index<(n["keyedList"]||t).length){dPt(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}});n.index++}return fPt.bind(n,r)}o(hPt,"parallel")});var HG=_((Whr,sx)=>{var OTe=MG();var mPt=BG();var gPt=VG();sx.exports=yPt;sx.exports.ascending=NTe;sx.exports.descending=vPt;function yPt(t,e,r,n){var i=mPt(t,r);OTe(t,e,i,o(function s(a,u){if(a){n(a,u);return}i.index++;if(i.index<(i["keyedList"]||t).length){OTe(t,e,i,s);return}n(null,i.results)},"iteratorHandler"));return gPt.bind(i,n)}o(yPt,"serialOrdered");function NTe(t,e){return t<e?-1:t>e?1:0}o(NTe,"ascending");function vPt(t,e){return-1*NTe(t,e)}o(vPt,"descending")});var PTe=_((Qhr,ITe)=>{var _Pt=HG();ITe.exports=EPt;function EPt(t,e,r){return _Pt(t,e,null,r)}o(EPt,"serial")});var kTe=_((Zhr,DTe)=>{DTe.exports={parallel:RTe(),serial:PTe(),serialOrdered:HG()}});var LTe=_((emr,$Te)=>{$Te.exports=function(t,e){Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]});return t}});var UTe=_((tmr,jTe)=>{var YG=yTe();var qTe=require("util");var zG=require("path");var bPt=require("http");var wPt=require("https");var SPt=require("url").parse;var TPt=require("fs");var APt=require("stream").Stream;var GG=RM();var xPt=kTe();var KG=LTe();jTe.exports=Fr;qTe.inherits(Fr,YG);function Fr(t){if(!(this instanceof Fr)){return new Fr(t)}this._overheadLength=0;this._valueLength=0;this._valuesToMeasure=[];YG.call(this);t=t||{};for(var e in t){this[e]=t[e]}}o(Fr,"FormData");Fr.LINE_BREAK="\r\n";Fr.DEFAULT_CONTENT_TYPE="application/octet-stream";Fr.prototype.append=function(t,e,r){r=r||{};if(typeof r=="string"){r={filename:r}}var n=YG.prototype.append.bind(this);if(typeof e=="number"){e=""+e}if(qTe.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r);var s=this._multiPartFooter();n(i);n(e);n(s);this._trackLength(i,e,r)};Fr.prototype._trackLength=function(t,e,r){var n=0;if(r.knownLength!=null){n+=+r.knownLength}else if(Buffer.isBuffer(e)){n=e.length}else if(typeof e==="string"){n=Buffer.byteLength(e)}this._valueLength+=n;this._overheadLength+=Buffer.byteLength(t)+Fr.LINE_BREAK.length;if(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof APt)){return}if(!r.knownLength){this._valuesToMeasure.push(e)}};Fr.prototype._lengthRetriever=function(t,e){if(t.hasOwnProperty("fd")){if(t.end!=void 0&&t.end!=Infinity&&t.start!=void 0){e(null,t.end+1-(t.start?t.start:0))}else{TPt.stat(t.path,function(r,n){var i;if(r){e(r);return}i=n.size-(t.start?t.start:0);e(null,i)})}}else if(t.hasOwnProperty("httpVersion")){e(null,+t.headers["content-length"])}else if(t.hasOwnProperty("httpModule")){t.on("response",function(r){t.pause();e(null,+r.headers["content-length"])});t.resume()}else{e("Unknown stream")}};Fr.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string"){return r.header}var n=this._getContentDisposition(e,r);var i=this._getContentType(e,r);var s="";var a={"Content-Disposition":["form-data",'name="'+t+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};if(typeof r.header=="object"){KG(a,r.header)}var u;for(var l in a){if(!a.hasOwnProperty(l))continue;u=a[l];if(u==null){continue}if(!Array.isArray(u)){u=[u]}if(u.length){s+=l+": "+u.join("; ")+Fr.LINE_BREAK}}return"--"+this.getBoundary()+Fr.LINE_BREAK+s+Fr.LINE_BREAK};Fr.prototype._getContentDisposition=function(t,e){var r,n;if(typeof e.filepath==="string"){r=zG.normalize(e.filepath).replace(/\\/g,"/")}else if(e.filename||t.name||t.path){r=zG.basename(e.filename||t.name||t.path)}else if(t.readable&&t.hasOwnProperty("httpVersion")){r=zG.basename(t.client._httpMessage.path||"")}if(r){n='filename="'+r+'"'}return n};Fr.prototype._getContentType=function(t,e){var r=e.contentType;if(!r&&t.name){r=GG.lookup(t.name)}if(!r&&t.path){r=GG.lookup(t.path)}if(!r&&t.readable&&t.hasOwnProperty("httpVersion")){r=t.headers["content-type"]}if(!r&&(e.filepath||e.filename)){r=GG.lookup(e.filepath||e.filename)}if(!r&&typeof t=="object"){r=Fr.DEFAULT_CONTENT_TYPE}return r};Fr.prototype._multiPartFooter=function(){return function(t){var e=Fr.LINE_BREAK;var r=this._streams.length===0;if(r){e+=this._lastBoundary()}t(e)}.bind(this)};Fr.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Fr.LINE_BREAK};Fr.prototype.getHeaders=function(t){var e;var r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t){if(t.hasOwnProperty(e)){r[e.toLowerCase()]=t[e]}}return r};Fr.prototype.setBoundary=function(t){this._boundary=t};Fr.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};Fr.prototype.getBuffer=function(){var t=new Buffer.alloc(0);var e=this.getBoundary();for(var r=0,n=this._streams.length;r<n;r++){if(typeof this._streams[r]!=="function"){if(Buffer.isBuffer(this._streams[r])){t=Buffer.concat([t,this._streams[r]])}else{t=Buffer.concat([t,Buffer.from(this._streams[r])])}if(typeof this._streams[r]!=="string"||this._streams[r].substring(2,e.length+2)!==e){t=Buffer.concat([t,Buffer.from(Fr.LINE_BREAK)])}}}return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Fr.prototype._generateBoundary=function(){var t="--------------------------";for(var e=0;e<24;e++){t+=Math.floor(Math.random()*10).toString(16)}this._boundary=t};Fr.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;if(this._streams.length){t+=this._lastBoundary().length}if(!this.hasKnownLength()){this._error(new Error("Cannot calculate proper length in synchronous way."))}return t};Fr.prototype.hasKnownLength=function(){var t=true;if(this._valuesToMeasure.length){t=false}return t};Fr.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length){e+=this._lastBoundary().length}if(!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}xPt.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i});t(null,e)})};Fr.prototype.submit=function(t,e){var r,n,i={method:"post"};if(typeof t=="string"){t=SPt(t);n=KG({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)}else{n=KG(t,i);if(!n.port){n.port=n.protocol=="https:"?443:80}}n.headers=this.getHeaders(t.headers);if(n.protocol=="https:"){r=wPt.request(n)}else{r=bPt.request(n)}this.getLength(function(s,a){if(s&&s!=="Unknown stream"){this._error(s);return}if(a){r.setHeader("Content-Length",a)}this.pipe(r);if(e){var u;var l=o(function(c,d){r.removeListener("error",l);r.removeListener("response",u);return e.call(this,c,d)},"callback");u=l.bind(this,null);r.on("error",l);r.on("response",u)}}.bind(this));return r};Fr.prototype._error=function(t){if(!this.error){this.error=t;this.pause();this.emit("error",t)}};Fr.prototype.toString=function(){return"[object FormData]"}});var MTe=_(FTe=>{"use strict";var CPt=require("url").parse;var RPt={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var OPt=String.prototype.endsWith||function(t){return t.length<=this.length&&this.indexOf(t,this.length-t.length)!==-1};function NPt(t){var e=typeof t==="string"?CPt(t):t||{};var r=e.protocol;var n=e.host;var i=e.port;if(typeof n!=="string"||!n||typeof r!=="string"){return""}r=r.split(":",1)[0];n=n.replace(/:\d*$/,"");i=parseInt(i)||RPt[r]||0;if(!IPt(n,i)){return""}var s=ky("npm_config_"+r+"_proxy")||ky(r+"_proxy")||ky("npm_config_proxy")||ky("all_proxy");if(s&&s.indexOf("://")===-1){s=r+"://"+s}return s}o(NPt,"getProxyForUrl");function IPt(t,e){var r=(ky("npm_config_no_proxy")||ky("no_proxy")).toLowerCase();if(!r){return true}if(r==="*"){return false}return r.split(/[,\s]/).every(function(n){if(!n){return true}var i=n.match(/^(.+):(\d+)$/);var s=i?i[1]:n;var a=i?parseInt(i[2]):0;if(a&&a!==e){return true}if(!/^[.*]/.test(s)){return t!==s}if(s.charAt(0)==="*"){s=s.slice(1)}return!OPt.call(t,s)})}o(IPt,"shouldProxy");function ky(t){return process.env[t.toLowerCase()]||process.env[t.toUpperCase()]||""}o(ky,"getEnv");FTe.getProxyForUrl=NPt});var VTe=_((smr,BTe)=>{var Z6;BTe.exports=function(){if(!Z6){try{Z6=Qo()("follow-redirects")}catch(t){}if(typeof Z6!=="function"){Z6=o(function(){},"debug")}}Z6.apply(null,arguments)}});var YTe=_((omr,aK)=>{var rb=require("url");var eb=rb.URL;var PPt=require("http");var DPt=require("https");var ZG=require("stream").Writable;var eK=require("assert");var HTe=VTe();var tK=false;try{eK(new eb)}catch(t){tK=t.code==="ERR_INVALID_URL"}var kPt=["auth","host","hostname","href","path","pathname","port","protocol","query","search"];var rK=["abort","aborted","connect","error","socket","timeout"];var nK=Object.create(null);rK.forEach(function(t){nK[t]=function(e,r,n){this._redirectable.emit(t,e,r,n)}});var JG=nb("ERR_INVALID_URL","Invalid URL",TypeError);var QG=nb("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var $Pt=nb("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",QG);var LPt=nb("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var qPt=nb("ERR_STREAM_WRITE_AFTER_END","write after end");var jPt=ZG.prototype.destroy||GTe;function Ta(t,e){ZG.call(this);this._sanitizeOptions(t);this._options=t;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(e){this.on("response",e)}var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof QG?i:new QG({cause:i}))}};this._performRequest()}o(Ta,"RedirectableRequest");Ta.prototype=Object.create(ZG.prototype);Ta.prototype.abort=function(){sK(this._currentRequest);this._currentRequest.abort();this.emit("abort")};Ta.prototype.destroy=function(t){sK(this._currentRequest,t);jPt.call(this,t);return this};Ta.prototype.write=function(t,e,r){if(this._ending){throw new qPt}if(!Pm(t)&&!MPt(t)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(tb(e)){r=e;e=null}if(t.length===0){if(r){r()}return}if(this._requestBodyLength+t.length<=this._options.maxBodyLength){this._requestBodyLength+=t.length;this._requestBodyBuffers.push({data:t,encoding:e});this._currentRequest.write(t,e,r)}else{this.emit("error",new LPt);this.abort()}};Ta.prototype.end=function(t,e,r){if(tb(t)){r=t;t=e=null}else if(tb(e)){r=e;e=null}if(!t){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var i=this._currentRequest;this.write(t,e,function(){n._ended=true;i.end(null,null,r)});this._ending=true}};Ta.prototype.setHeader=function(t,e){this._options.headers[t]=e;this._currentRequest.setHeader(t,e)};Ta.prototype.removeHeader=function(t){delete this._options.headers[t];this._currentRequest.removeHeader(t)};Ta.prototype.setTimeout=function(t,e){var r=this;function n(a){a.setTimeout(t);a.removeListener("timeout",a.destroy);a.addListener("timeout",a.destroy)}o(n,"destroyOnTimeout");function i(a){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout(function(){r.emit("timeout");s()},t);n(a)}o(i,"startTimer");function s(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",s);r.removeListener("error",s);r.removeListener("response",s);r.removeListener("close",s);if(e){r.removeListener("timeout",e)}if(!r.socket){r._currentRequest.removeListener("socket",i)}}o(s,"clearTimer");if(e){this.on("timeout",e)}if(this.socket){i(this.socket)}else{this._currentRequest.once("socket",i)}this.on("socket",n);this.on("abort",s);this.on("error",s);this.on("response",s);this.on("close",s);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){Ta.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(Ta.prototype,t,{get:function(){return this._currentRequest[t]}})});Ta.prototype._sanitizeOptions=function(t){if(!t.headers){t.headers={}}if(t.host){if(!t.hostname){t.hostname=t.host}delete t.host}if(!t.pathname&&t.path){var e=t.path.indexOf("?");if(e<0){t.pathname=t.path}else{t.pathname=t.path.substring(0,e);t.search=t.path.substring(e)}}};Ta.prototype._performRequest=function(){var t=this._options.protocol;var e=this._options.nativeProtocols[t];if(!e){throw new TypeError("Unsupported protocol "+t)}if(this._options.agents){var r=t.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of rK){n.on(i,nK[i])}this._currentUrl=/^\//.test(this._options.path)?rb.format(this._options):this._options.path;if(this._isRedirect){var s=0;var a=this;var u=this._requestBodyBuffers;o(function l(c){if(n===a._currentRequest){if(c){a.emit("error",c)}else if(s<u.length){var d=u[s++];if(!n.finished){n.write(d.data,d.encoding,l)}}else if(a._ended){n.end()}}},"writeNext")()}};Ta.prototype._processResponse=function(t){var e=t.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e})}var r=t.headers.location;if(!r||this._options.followRedirects===false||e<300||e>=400){t.responseUrl=this._currentUrl;t.redirects=this._redirects;this.emit("response",t);this._requestBodyBuffers=[];return}sK(this._currentRequest);t.destroy();if(++this._redirectCount>this._options.maxRedirects){throw new $Pt}var n;var i=this._options.beforeRedirect;if(i){n=Object.assign({Host:t.req.getHeader("host")},this._options.headers)}var s=this._options.method;if((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];WG(/^content-/i,this._options.headers)}var a=WG(/^host$/i,this._options.headers);var u=iK(this._currentUrl);var l=a||u.host;var c=/^\w+:/.test(r)?this._currentUrl:rb.format(Object.assign(u,{host:l}));var d=UPt(r,c);HTe("redirecting to",d.href);this._isRedirect=true;XG(d,this._options);if(d.protocol!==u.protocol&&d.protocol!=="https:"||d.host!==l&&!FPt(d.host,l)){WG(/^(?:authorization|cookie)$/i,this._options.headers)}if(tb(i)){var p={headers:t.headers,statusCode:e};var f={url:c,method:s,headers:n};i(this._options,p,f);this._sanitizeOptions(this._options)}this._performRequest()};function zTe(t){var e={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(t).forEach(function(n){var i=n+":";var s=r[i]=t[n];var a=e[n]=Object.create(s);function u(c,d,p){if(BPt(c)){c=XG(c)}else if(Pm(c)){c=XG(iK(c))}else{p=d;d=KTe(c);c={protocol:i}}if(tb(d)){p=d;d=null}d=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},c,d);d.nativeProtocols=r;if(!Pm(d.host)&&!Pm(d.hostname)){d.hostname="::1"}eK.equal(d.protocol,i,"protocol mismatch");HTe("options",d);return new Ta(d,p)}o(u,"request");function l(c,d,p){var f=a.request(c,d,p);f.end();return f}o(l,"get");Object.defineProperties(a,{request:{value:u,configurable:true,enumerable:true,writable:true},get:{value:l,configurable:true,enumerable:true,writable:true}})});return e}o(zTe,"wrap");function GTe(){}o(GTe,"noop");function iK(t){var e;if(tK){e=new eb(t)}else{e=KTe(rb.parse(t));if(!Pm(e.protocol)){throw new JG({input:t})}}return e}o(iK,"parseUrl");function UPt(t,e){return tK?new eb(t,e):iK(rb.resolve(e,t))}o(UPt,"resolveUrl");function KTe(t){if(/^\[/.test(t.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(t.hostname)){throw new JG({input:t.href||t})}if(/^\[/.test(t.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(t.host)){throw new JG({input:t.href||t})}return t}o(KTe,"validateUrl");function XG(t,e){var r=e||{};for(var n of kPt){r[n]=t[n]}if(r.hostname.startsWith("[")){r.hostname=r.hostname.slice(1,-1)}if(r.port!==""){r.port=Number(r.port)}r.path=r.search?r.pathname+r.search:r.pathname;return r}o(XG,"spreadUrlObject");function WG(t,e){var r;for(var n in e){if(t.test(n)){r=e[n];delete e[n]}}return r===null||typeof r==="undefined"?void 0:String(r).trim()}o(WG,"removeMatchingHeaders");function nb(t,e,r){function n(i){Error.captureStackTrace(this,this.constructor);Object.assign(this,i||{});this.code=t;this.message=this.cause?e+": "+this.cause.message:e}o(n,"CustomError");n.prototype=new(r||Error);Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:false},name:{value:"Error ["+t+"]",enumerable:false}});return n}o(nb,"createErrorType");function sK(t,e){for(var r of rK){t.removeListener(r,nK[r])}t.on("error",GTe);t.destroy(e)}o(sK,"destroyRequest");function FPt(t,e){eK(Pm(t)&&Pm(e));var r=t.length-e.length-1;return r>0&&t[r]==="."&&t.endsWith(e)}o(FPt,"isSubdomain");function Pm(t){return typeof t==="string"||t instanceof String}o(Pm,"isString");function tb(t){return typeof t==="function"}o(tb,"isFunction");function MPt(t){return typeof t==="object"&&"length"in t}o(MPt,"isBuffer");function BPt(t){return eb&&t instanceof eb}o(BPt,"isURL");aK.exports=zTe({http:PPt,https:DPt});aK.exports.wrap=zTe});var mx=_((lmr,q7e)=>{"use strict";var VPt=UTe();var HPt=require("url");var zPt=MTe();var GPt=require("http");var KPt=require("https");var p7e=require("util");var YPt=YTe();var WPt=require("zlib");var f7e=require("stream");var JPt=require("events");function rd(t){return t&&typeof t==="object"&&"default"in t?t:{"default":t}}o(rd,"_interopDefaultLegacy");var h7e=rd(VPt);var QPt=rd(HPt);var XPt=rd(GPt);var ZPt=rd(KPt);var eDt=rd(p7e);var tDt=rd(YPt);var mf=rd(WPt);var ff=rd(f7e);var rDt=rd(JPt);function m7e(t,e){return o(function r(){return t.apply(e,arguments)},"wrap")}o(m7e,"bind");var{toString:nDt}=Object.prototype;var{getPrototypeOf:bK}=Object;var dx=(t=>e=>{const r=nDt.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));var Hl=o(t=>{t=t.toLowerCase();return e=>dx(e)===t},"kindOfTest");var px=o(t=>e=>typeof e===t,"typeOfTest");var{isArray:jy}=Array;var ab=px("undefined");function iDt(t){return t!==null&&!ab(t)&&t.constructor!==null&&!ab(t.constructor)&&Bo(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}o(iDt,"isBuffer");var g7e=Hl("ArrayBuffer");function sDt(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&g7e(t.buffer)}return e}o(sDt,"isArrayBufferView");var aDt=px("string");var Bo=px("function");var y7e=px("number");var fx=o(t=>t!==null&&typeof t==="object","isObject");var oDt=o(t=>t===true||t===false,"isBoolean");var ox=o(t=>{if(dx(t)!=="object"){return false}const e=bK(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},"isPlainObject");var uDt=Hl("Date");var lDt=Hl("File");var cDt=Hl("Blob");var dDt=Hl("FileList");var pDt=o(t=>fx(t)&&Bo(t.pipe),"isStream");var fDt=o(t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||Bo(t.append)&&((e=dx(t))==="formdata"||e==="object"&&Bo(t.toString)&&t.toString()==="[object FormData]"))},"isFormData");var hDt=Hl("URLSearchParams");var mDt=o(t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function ub(t,e,{allOwnKeys:r=false}={}){if(t===null||typeof t==="undefined"){return}let n;let i;if(typeof t!=="object"){t=[t]}if(jy(t)){for(n=0,i=t.length;n<i;n++){e.call(null,t[n],n,t)}}else{const s=r?Object.getOwnPropertyNames(t):Object.keys(t);const a=s.length;let u;for(n=0;n<a;n++){u=s[n];e.call(null,t[u],u,t)}}}o(ub,"forEach");function v7e(t,e){e=e.toLowerCase();const r=Object.keys(t);let n=r.length;let i;while(n-- >0){i=r[n];if(e===i.toLowerCase()){return i}}return null}o(v7e,"findKey");var _7e=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();var E7e=o(t=>!ab(t)&&t!==_7e,"isContextDefined");function dK(){const{caseless:t}=E7e(this)&&this||{};const e={};const r=o((n,i)=>{const s=t&&v7e(e,i)||i;if(ox(e[s])&&ox(n)){e[s]=dK(e[s],n)}else if(ox(n)){e[s]=dK({},n)}else if(jy(n)){e[s]=n.slice()}else{e[s]=n}},"assignValue");for(let n=0,i=arguments.length;n<i;n++){arguments[n]&&ub(arguments[n],r)}return e}o(dK,"merge");var gDt=o((t,e,r,{allOwnKeys:n}={})=>{ub(e,(i,s)=>{if(r&&Bo(i)){t[s]=m7e(i,r)}else{t[s]=i}},{allOwnKeys:n});return t},"extend");var yDt=o(t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t},"stripBOM");var vDt=o((t,e,r,n)=>{t.prototype=Object.create(e.prototype,n);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});r&&Object.assign(t.prototype,r)},"inherits");var _Dt=o((t,e,r,n)=>{let i;let s;let a;const u={};e=e||{};if(t==null)return e;do{i=Object.getOwnPropertyNames(t);s=i.length;while(s-- >0){a=i[s];if((!n||n(a,t,e))&&!u[a]){e[a]=t[a];u[a]=true}}t=r!==false&&bK(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},"toFlatObject");var EDt=o((t,e,r)=>{t=String(t);if(r===void 0||r>t.length){r=t.length}r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},"endsWith");var bDt=o(t=>{if(!t)return null;if(jy(t))return t;let e=t.length;if(!y7e(e))return null;const r=new Array(e);while(e-- >0){r[e]=t[e]}return r},"toArray");var wDt=(t=>{return e=>{return t&&e instanceof t}})(typeof Uint8Array!=="undefined"&&bK(Uint8Array));var SDt=o((t,e)=>{const r=t&&t[Symbol.iterator];const n=r.call(t);let i;while((i=n.next())&&!i.done){const s=i.value;e.call(t,s[0],s[1])}},"forEachEntry");var TDt=o((t,e)=>{let r;const n=[];while((r=t.exec(e))!==null){n.push(r)}return n},"matchAll");var ADt=Hl("HTMLFormElement");var xDt=o(t=>{return t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,o(function e(r,n,i){return n.toUpperCase()+i},"replacer"))},"toCamelCase");var WTe=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype);var CDt=Hl("RegExp");var b7e=o((t,e)=>{const r=Object.getOwnPropertyDescriptors(t);const n={};ub(r,(i,s)=>{let a;if((a=e(i,s,t))!==false){n[s]=a||i}});Object.defineProperties(t,n)},"reduceDescriptors");var RDt=o(t=>{b7e(t,(e,r)=>{if(Bo(t)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}const n=t[r];if(!Bo(n))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}}})},"freezeMethods");var ODt=o((t,e)=>{const r={};const n=o(i=>{i.forEach(s=>{r[s]=true})},"define");jy(t)?n(t):n(String(t).split(e));return r},"toObjectSet");var NDt=o(()=>{},"noop");var IDt=o((t,e)=>{t=+t;return Number.isFinite(t)?t:e},"toFiniteNumber");var oK="abcdefghijklmnopqrstuvwxyz";var JTe="0123456789";var w7e={DIGIT:JTe,ALPHA:oK,ALPHA_DIGIT:oK+oK.toUpperCase()+JTe};var PDt=o((t=16,e=w7e.ALPHA_DIGIT)=>{let r="";const{length:n}=e;while(t--){r+=e[Math.random()*n|0]}return r},"generateString");function DDt(t){return!!(t&&Bo(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}o(DDt,"isSpecCompliantForm");var kDt=o(t=>{const e=new Array(10);const r=o((n,i)=>{if(fx(n)){if(e.indexOf(n)>=0){return}if(!("toJSON"in n)){e[i]=n;const s=jy(n)?[]:{};ub(n,(a,u)=>{const l=r(a,i+1);!ab(l)&&(s[u]=l)});e[i]=void 0;return s}}return n},"visit");return r(t,0)},"toJSONObject");var $Dt=Hl("AsyncFunction");var LDt=o(t=>t&&(fx(t)||Bo(t))&&Bo(t.then)&&Bo(t.catch),"isThenable");var fe={isArray:jy,isArrayBuffer:g7e,isBuffer:iDt,isFormData:fDt,isArrayBufferView:sDt,isString:aDt,isNumber:y7e,isBoolean:oDt,isObject:fx,isPlainObject:ox,isUndefined:ab,isDate:uDt,isFile:lDt,isBlob:cDt,isRegExp:CDt,isFunction:Bo,isStream:pDt,isURLSearchParams:hDt,isTypedArray:wDt,isFileList:dDt,forEach:ub,merge:dK,extend:gDt,trim:mDt,stripBOM:yDt,inherits:vDt,toFlatObject:_Dt,kindOf:dx,kindOfTest:Hl,endsWith:EDt,toArray:bDt,forEachEntry:SDt,matchAll:TDt,isHTMLForm:ADt,hasOwnProperty:WTe,hasOwnProp:WTe,reduceDescriptors:b7e,freezeMethods:RDt,toObjectSet:ODt,toCamelCase:xDt,noop:NDt,toFiniteNumber:IDt,findKey:v7e,global:_7e,isContextDefined:E7e,ALPHABET:w7e,generateString:PDt,isSpecCompliantForm:DDt,toJSONObject:kDt,isAsyncFn:$Dt,isThenable:LDt};function nt(t,e,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error().stack}this.message=t;this.name="AxiosError";e&&(this.code=e);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}o(nt,"AxiosError");fe.inherits(nt,Error,{toJSON:o(function t(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}},"toJSON")});var S7e=nt.prototype;var T7e={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{T7e[t]={value:t}});Object.defineProperties(nt,T7e);Object.defineProperty(S7e,"isAxiosError",{value:true});nt.from=(t,e,r,n,i,s)=>{const a=Object.create(S7e);fe.toFlatObject(t,a,o(function u(l){return l!==Error.prototype},"filter"),u=>{return u!=="isAxiosError"});nt.call(a,t.message,e,r,n,i);a.cause=t;a.name=t.name;s&&Object.assign(a,s);return a};function pK(t){return fe.isPlainObject(t)||fe.isArray(t)}o(pK,"isVisitable");function A7e(t){return fe.endsWith(t,"[]")?t.slice(0,-2):t}o(A7e,"removeBrackets");function QTe(t,e,r){if(!t)return e;return t.concat(e).map(o(function n(i,s){i=A7e(i);return!r&&s?"["+i+"]":i},"each")).join(r?".":"")}o(QTe,"renderKey");function qDt(t){return fe.isArray(t)&&!t.some(pK)}o(qDt,"isFlatArray");var jDt=fe.toFlatObject(fe,{},null,o(function t(e){return/^is[A-Z]/.test(e)},"filter"));function hx(t,e,r){if(!fe.isObject(t)){throw new TypeError("target must be an object")}e=e||new(h7e["default"]||FormData);r=fe.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,o(function m(g,y){return!fe.isUndefined(y[g])},"defined"));const n=r.metaTokens;const i=r.visitor||d;const s=r.dots;const a=r.indexes;const u=r.Blob||typeof Blob!=="undefined"&&Blob;const l=u&&fe.isSpecCompliantForm(e);if(!fe.isFunction(i)){throw new TypeError("visitor must be a function")}function c(m){if(m===null)return"";if(fe.isDate(m)){return m.toISOString()}if(!l&&fe.isBlob(m)){throw new nt("Blob is not supported. Use a Buffer instead.")}if(fe.isArrayBuffer(m)||fe.isTypedArray(m)){return l&&typeof Blob==="function"?new Blob([m]):Buffer.from(m)}return m}o(c,"convertValue");function d(m,g,y){let v=m;if(m&&!y&&typeof m==="object"){if(fe.endsWith(g,"{}")){g=n?g:g.slice(0,-2);m=JSON.stringify(m)}else if(fe.isArray(m)&&qDt(m)||(fe.isFileList(m)||fe.endsWith(g,"[]"))&&(v=fe.toArray(m))){g=A7e(g);v.forEach(o(function w(E,b){!(fe.isUndefined(E)||E===null)&&e.append(a===true?QTe([g],b,s):a===null?g:g+"[]",c(E))},"each"));return false}}if(pK(m)){return true}e.append(QTe(y,g,s),c(m));return false}o(d,"defaultVisitor");const p=[];const f=Object.assign(jDt,{defaultVisitor:d,convertValue:c,isVisitable:pK});function h(m,g){if(fe.isUndefined(m))return;if(p.indexOf(m)!==-1){throw Error("Circular reference detected in "+g.join("."))}p.push(m);fe.forEach(m,o(function y(v,w){const E=!(fe.isUndefined(v)||v===null)&&i.call(e,v,fe.isString(w)?w.trim():w,g,f);if(E===true){h(v,g?g.concat(w):[w])}},"each"));p.pop()}o(h,"build");if(!fe.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}o(hx,"toFormData");function XTe(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,o(function r(n){return e[n]},"replacer"))}o(XTe,"encode$1");function x7e(t,e){this._pairs=[];t&&hx(t,this,e)}o(x7e,"AxiosURLSearchParams");var C7e=x7e.prototype;C7e.append=o(function t(e,r){this._pairs.push([e,r])},"append");C7e.toString=o(function t(e){const r=e?function(n){return e.call(this,n,XTe)}:XTe;return this._pairs.map(o(function n(i){return r(i[0])+"="+r(i[1])},"each"),"").join("&")},"toString");function UDt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}o(UDt,"encode");function wK(t,e,r){if(!e){return t}const n=r&&r.encode||UDt;const i=r&&r.serialize;let s;if(i){s=i(e,r)}else{s=fe.isURLSearchParams(e)?e.toString():new x7e(e,r).toString(n)}if(s){const a=t.indexOf("#");if(a!==-1){t=t.slice(0,a)}t+=(t.indexOf("?")===-1?"?":"&")+s}return t}o(wK,"buildURL");var fK=class{static{o(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,r,n){this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(e){if(this.handlers[e]){this.handlers[e]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(e){fe.forEach(this.handlers,o(function r(n){if(n!==null){e(n)}},"forEachHandler"))}};var ZTe=fK;var SK={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var FDt=QPt["default"].URLSearchParams;var MDt={isNode:true,classes:{URLSearchParams:FDt,FormData:h7e["default"],Blob:typeof Blob!=="undefined"&&Blob||null},protocols:["http","https","file","data"]};var R7e=typeof window!=="undefined"&&typeof document!=="undefined";var BDt=(t=>{return R7e&&["ReactNative","NativeScript","NS"].indexOf(t)<0})(typeof navigator!=="undefined"&&navigator.product);var VDt=(()=>{return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})();var HDt=Object.freeze({__proto__:null,hasBrowserEnv:R7e,hasStandardBrowserWebWorkerEnv:VDt,hasStandardBrowserEnv:BDt});var Mo={...HDt,...MDt};function zDt(t,e){return hx(t,new Mo.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){if(Mo.isNode&&fe.isBuffer(r)){this.append(n,r.toString("base64"));return false}return s.defaultVisitor.apply(this,arguments)}},e))}o(zDt,"toURLEncodedForm");function GDt(t){return fe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>{return e[0]==="[]"?"":e[1]||e[0]})}o(GDt,"parsePropPath");function KDt(t){const e={};const r=Object.keys(t);let n;const i=r.length;let s;for(n=0;n<i;n++){s=r[n];e[s]=t[s]}return e}o(KDt,"arrayToObject");function O7e(t){function e(r,n,i,s){let a=r[s++];const u=Number.isFinite(+a);const l=s>=r.length;a=!a&&fe.isArray(i)?i.length:a;if(l){if(fe.hasOwnProp(i,a)){i[a]=[i[a],n]}else{i[a]=n}return!u}if(!i[a]||!fe.isObject(i[a])){i[a]=[]}const c=e(r,n,i[a],s);if(c&&fe.isArray(i[a])){i[a]=KDt(i[a])}return!u}o(e,"buildPath");if(fe.isFormData(t)&&fe.isFunction(t.entries)){const r={};fe.forEachEntry(t,(n,i)=>{e(GDt(n),i,r,0)});return r}return null}o(O7e,"formDataToJSON");function YDt(t,e,r){if(fe.isString(t)){try{(e||JSON.parse)(t);return fe.trim(t)}catch(n){if(n.name!=="SyntaxError"){throw n}}}return(r||JSON.stringify)(t)}o(YDt,"stringifySafely");var TK={transitional:SK,adapter:["xhr","http"],transformRequest:[o(function t(e,r){const n=r.getContentType()||"";const i=n.indexOf("application/json")>-1;const s=fe.isObject(e);if(s&&fe.isHTMLForm(e)){e=new FormData(e)}const a=fe.isFormData(e);if(a){if(!i){return e}return i?JSON.stringify(O7e(e)):e}if(fe.isArrayBuffer(e)||fe.isBuffer(e)||fe.isStream(e)||fe.isFile(e)||fe.isBlob(e)){return e}if(fe.isArrayBufferView(e)){return e.buffer}if(fe.isURLSearchParams(e)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1){return zDt(e,this.formSerializer).toString()}if((u=fe.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return hx(u?{"files[]":e}:e,l&&new l,this.formSerializer)}}if(s||i){r.setContentType("application/json",false);return YDt(e)}return e},"transformRequest")],transformResponse:[o(function t(e){const r=this.transitional||TK.transitional;const n=r&&r.forcedJSONParsing;const i=this.responseType==="json";if(e&&fe.isString(e)&&(n&&!this.responseType||i)){const s=r&&r.silentJSONParsing;const a=!s&&i;try{return JSON.parse(e)}catch(u){if(a){if(u.name==="SyntaxError"){throw nt.from(u,nt.ERR_BAD_RESPONSE,this,null,this.response)}throw u}}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mo.classes.FormData,Blob:Mo.classes.Blob},validateStatus:o(function t(e){return e>=200&&e<300},"validateStatus"),headers:{common:{"Accept":"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],t=>{TK.headers[t]={}});var AK=TK;var WDt=fe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var JDt=o(t=>{const e={};let r;let n;let i;t&&t.split("\n").forEach(o(function s(a){i=a.indexOf(":");r=a.substring(0,i).trim().toLowerCase();n=a.substring(i+1).trim();if(!r||e[r]&&WDt[r]){return}if(r==="set-cookie"){if(e[r]){e[r].push(n)}else{e[r]=[n]}}else{e[r]=e[r]?e[r]+", "+n:n}},"parser"));return e},"parseHeaders");var e7e=Symbol("internals");function ib(t){return t&&String(t).trim().toLowerCase()}o(ib,"normalizeHeader");function ux(t){if(t===false||t==null){return t}return fe.isArray(t)?t.map(ux):String(t)}o(ux,"normalizeValue");function QDt(t){const e=Object.create(null);const r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;while(n=r.exec(t)){e[n[1]]=n[2]}return e}o(QDt,"parseTokens");var XDt=o(t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()),"isValidHeaderName");function uK(t,e,r,n,i){if(fe.isFunction(n)){return n.call(this,e,r)}if(i){e=r}if(!fe.isString(e))return;if(fe.isString(n)){return e.indexOf(n)!==-1}if(fe.isRegExp(n)){return n.test(e)}}o(uK,"matchHeaderValue");function ZDt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>{return r.toUpperCase()+n})}o(ZDt,"formatHeader");function ekt(t,e){const r=fe.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,s,a){return this[n].call(this,e,i,s,a)},configurable:true})})}o(ekt,"buildAccessors");var $y=class{static{o(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,r,n){const i=this;function s(u,l,c){const d=ib(l);if(!d){throw new Error("header name must be a non-empty string")}const p=fe.findKey(i,d);if(!p||i[p]===void 0||c===true||c===void 0&&i[p]!==false){i[p||l]=ux(u)}}o(s,"setHeader");const a=o((u,l)=>fe.forEach(u,(c,d)=>s(c,d,l)),"setHeaders");if(fe.isPlainObject(e)||e instanceof this.constructor){a(e,r)}else if(fe.isString(e)&&(e=e.trim())&&!XDt(e)){a(JDt(e),r)}else{e!=null&&s(r,e,n)}return this}get(e,r){e=ib(e);if(e){const n=fe.findKey(this,e);if(n){const i=this[n];if(!r){return i}if(r===true){return QDt(i)}if(fe.isFunction(r)){return r.call(this,i,n)}if(fe.isRegExp(r)){return r.exec(i)}throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){e=ib(e);if(e){const n=fe.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||uK(this,this[n],n,r)))}return false}delete(e,r){const n=this;let i=false;function s(a){a=ib(a);if(a){const u=fe.findKey(n,a);if(u&&(!r||uK(n,n[u],u,r))){delete n[u];i=true}}}o(s,"deleteHeader");if(fe.isArray(e)){e.forEach(s)}else{s(e)}return i}clear(e){const r=Object.keys(this);let n=r.length;let i=false;while(n--){const s=r[n];if(!e||uK(this,this[s],s,e,true)){delete this[s];i=true}}return i}normalize(e){const r=this;const n={};fe.forEach(this,(i,s)=>{const a=fe.findKey(n,s);if(a){r[a]=ux(i);delete r[s];return}const u=e?ZDt(s):String(s).trim();if(u!==s){delete r[s]}r[u]=ux(i);n[u]=true});return this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);fe.forEach(this,(n,i)=>{n!=null&&n!==false&&(r[i]=e&&fe.isArray(n)?n.join(", "):n)});return r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);r.forEach(i=>n.set(i));return n}static accessor(e){const r=this[e7e]=this[e7e]={accessors:{}};const n=r.accessors;const i=this.prototype;function s(a){const u=ib(a);if(!n[u]){ekt(i,a);n[u]=true}}o(s,"defineAccessor");fe.isArray(e)?e.forEach(s):s(e);return this}};$y.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors($y.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});fe.freezeMethods($y);var Vo=$y;function lK(t,e){const r=this||AK;const n=e||r;const i=Vo.from(n.headers);let s=n.data;fe.forEach(t,o(function a(u){s=u.call(r,s,i.normalize(),e?e.status:void 0)},"transform"));i.normalize();return s}o(lK,"transformData");function N7e(t){return!!(t&&t.__CANCEL__)}o(N7e,"isCancel");function Dm(t,e,r){nt.call(this,t==null?"canceled":t,nt.ERR_CANCELED,e,r);this.name="CanceledError"}o(Dm,"CanceledError");fe.inherits(Dm,nt,{__CANCEL__:true});function sb(t,e,r){const n=r.config.validateStatus;if(!r.status||!n||n(r.status)){t(r)}else{e(new nt("Request failed with status code "+r.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}o(sb,"settle");function tkt(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}o(tkt,"isAbsoluteURL");function rkt(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}o(rkt,"combineURLs");function xK(t,e){if(t&&!tkt(e)){return rkt(t,e)}return e}o(xK,"buildFullPath");var cx="1.6.2";function I7e(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}o(I7e,"parseProtocol");var nkt=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function ikt(t,e,r){const n=r&&r.Blob||Mo.classes.Blob;const i=I7e(t);if(e===void 0&&n){e=true}if(i==="data"){t=i.length?t.slice(i.length+1):t;const s=nkt.exec(t);if(!s){throw new nt("Invalid URL",nt.ERR_INVALID_URL)}const a=s[1];const u=s[2];const l=s[3];const c=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(e){if(!n){throw new nt("Blob is not supported",nt.ERR_NOT_SUPPORT)}return new n([c],{type:a})}return c}throw new nt("Unsupported protocol "+i,nt.ERR_NOT_SUPPORT)}o(ikt,"fromDataURI");function skt(t,e){let r=0;const n=1e3/e;let i=null;return o(function s(a,u){const l=Date.now();if(a||l-r>n){if(i){clearTimeout(i);i=null}r=l;return t.apply(null,u)}if(!i){i=setTimeout(()=>{i=null;r=Date.now();return t.apply(null,u)},n-(l-r))}},"throttled")}o(skt,"throttle");function P7e(t,e){t=t||10;const r=new Array(t);const n=new Array(t);let i=0;let s=0;let a;e=e!==void 0?e:1e3;return o(function u(l){const c=Date.now();const d=n[s];if(!a){a=c}r[i]=l;n[i]=c;let p=s;let f=0;while(p!==i){f+=r[p++];p=p%t}i=(i+1)%t;if(i===s){s=(s+1)%t}if(c-a<e){return}const h=d&&c-d;return h?Math.round(f*1e3/h):void 0},"push")}o(P7e,"speedometer");var ax=Symbol("internals");var hK=class extends ff["default"].Transform{static{o(this,"AxiosTransformStream")}constructor(e){e=fe.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(u,l)=>{return!fe.isUndefined(l[u])});super({readableHighWaterMark:e.chunkSize});const r=this;const n=this[ax]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:false,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};const i=P7e(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",u=>{if(u==="progress"){if(!n.isCaptured){n.isCaptured=true}}});let s=0;n.updateProgress=skt(o(function u(){const l=n.length;const c=n.bytesSeen;const d=c-s;if(!d||r.destroyed)return;const p=i(d);s=c;process.nextTick(()=>{r.emit("progress",{"loaded":c,"total":l,"progress":l?c/l:void 0,"bytes":d,"rate":p?p:void 0,"estimated":p&&l&&c<=l?(l-c)/p:void 0})})},"throttledHandler"),n.ticksRate);const a=o(()=>{n.updateProgress(true)},"onFinish");this.once("end",a);this.once("error",a)}_read(e){const r=this[ax];if(r.onReadCallback){r.onReadCallback()}return super._read(e)}_transform(e,r,n){const i=this;const s=this[ax];const a=s.maxRate;const u=this.readableHighWaterMark;const l=s.timeWindow;const c=1e3/l;const d=a/c;const p=s.minChunkSize!==false?Math.max(s.minChunkSize,d*.01):0;function f(m,g){const y=Buffer.byteLength(m);s.bytesSeen+=y;s.bytes+=y;if(s.isCaptured){s.updateProgress()}if(i.push(m)){process.nextTick(g)}else{s.onReadCallback=()=>{s.onReadCallback=null;process.nextTick(g)}}}o(f,"pushChunk");const h=o((m,g)=>{const y=Buffer.byteLength(m);let v=null;let w=u;let E;let b=0;if(a){const S=Date.now();if(!s.ts||(b=S-s.ts)>=l){s.ts=S;E=d-s.bytes;s.bytes=E<0?-E:0;b=0}E=d-s.bytes}if(a){if(E<=0){return setTimeout(()=>{g(null,m)},l-b)}if(E<w){w=E}}if(w&&y>w&&y-w>p){v=m.subarray(w);m=m.subarray(0,w)}f(m,v?()=>{process.nextTick(g,null,v)}:g)},"transformChunk");h(e,o(function m(g,y){if(g){return n(g)}if(y){h(y,m)}else{n(null)}},"transformNextChunk"))}setLength(e){this[ax].length=+e;return this}};var t7e=hK;var{asyncIterator:r7e}=Symbol;var akt=o(async function*(t){if(t.stream){yield*t.stream()}else if(t.arrayBuffer){yield await t.arrayBuffer()}else if(t[r7e]){yield*t[r7e]()}else{yield t}},"readBlob");var D7e=akt;var okt=fe.ALPHABET.ALPHA_DIGIT+"-_";var ob=new p7e.TextEncoder;var hf="\r\n";var ukt=ob.encode(hf);var lkt=2;var mK=class{static{o(this,"FormDataPart")}constructor(e,r){const{escapeName:n}=this.constructor;const i=fe.isString(r);let s=`Content-Disposition: form-data; name="${n(e)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${hf}`;if(i){r=ob.encode(String(r).replace(/\r?\n|\r\n?/g,hf))}else{s+=`Content-Type: ${r.type||"application/octet-stream"}${hf}`}this.headers=ob.encode(s+hf);this.contentLength=i?r.byteLength:r.size;this.size=this.headers.byteLength+this.contentLength+lkt;this.name=e;this.value=r}async*encode(){yield this.headers;const{value:e}=this;if(fe.isTypedArray(e)){yield e}else{yield*D7e(e)}yield ukt}static escapeName(e){return String(e).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}};var ckt=o((t,e,r)=>{const{tag:n="form-data-boundary",size:i=25,boundary:s=n+"-"+fe.generateString(i,okt)}=r||{};if(!fe.isFormData(t)){throw TypeError("FormData instance required")}if(s.length<1||s.length>70){throw Error("boundary must be 10-70 characters long")}const a=ob.encode("--"+s+hf);const u=ob.encode("--"+s+"--"+hf+hf);let l=u.byteLength;const c=Array.from(t.entries()).map(([p,f])=>{const h=new mK(p,f);l+=h.size;return h});l+=a.byteLength*c.length;l=fe.toFiniteNumber(l);const d={"Content-Type":`multipart/form-data; boundary=${s}`};if(Number.isFinite(l)){d["Content-Length"]=l}e&&e(d);return f7e.Readable.from(async function*(){for(const p of c){yield a;yield*p.encode()}yield u}())},"formDataToStream");var dkt=ckt;var gK=class extends ff["default"].Transform{static{o(this,"ZlibHeaderTransformStream")}__transform(e,r,n){this.push(e);n()}_transform(e,r,n){if(e.length!==0){this._transform=this.__transform;if(e[0]!==120){const i=Buffer.alloc(2);i[0]=120;i[1]=156;this.push(i,r)}}this.__transform(e,r,n)}};var pkt=gK;var fkt=o((t,e)=>{return fe.isAsyncFn(t)?function(...r){const n=r.pop();t.apply(this,r).then(i=>{try{e?n(null,...e(i)):n(null,i)}catch(s){n(s)}},n)}:t},"callbackify");var hkt=fkt;var n7e={flush:mf["default"].constants.Z_SYNC_FLUSH,finishFlush:mf["default"].constants.Z_SYNC_FLUSH};var mkt={flush:mf["default"].constants.BROTLI_OPERATION_FLUSH,finishFlush:mf["default"].constants.BROTLI_OPERATION_FLUSH};var i7e=fe.isFunction(mf["default"].createBrotliDecompress);var{http:gkt,https:ykt}=tDt["default"];var vkt=/https:?/;var s7e=Mo.protocols.map(t=>{return t+":"});function _kt(t){if(t.beforeRedirects.proxy){t.beforeRedirects.proxy(t)}if(t.beforeRedirects.config){t.beforeRedirects.config(t)}}o(_kt,"dispatchBeforeRedirect");function k7e(t,e,r){let n=e;if(!n&&n!==false){const i=zPt.getProxyForUrl(r);if(i){n=new URL(i)}}if(n){if(n.username){n.auth=(n.username||"")+":"+(n.password||"")}if(n.auth){if(n.auth.username||n.auth.password){n.auth=(n.auth.username||"")+":"+(n.auth.password||"")}const s=Buffer.from(n.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+s}t.headers.host=t.hostname+(t.port?":"+t.port:"");const i=n.hostname||n.host;t.hostname=i;t.host=i;t.port=n.port;t.path=r;if(n.protocol){t.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`}}t.beforeRedirects.proxy=o(function i(s){k7e(s,e,s.href)},"beforeRedirect")}o(k7e,"setProxy");var Ekt=typeof process!=="undefined"&&fe.kindOf(process)==="process";var bkt=o(t=>{return new Promise((e,r)=>{let n;let i;const s=o((l,c)=>{if(i)return;i=true;n&&n(l,c)},"done");const a=o(l=>{s(l);e(l)},"_resolve");const u=o(l=>{s(l,true);r(l)},"_reject");t(a,u,l=>n=l).catch(u)})},"wrapAsync");var wkt=o(({address:t,family:e})=>{if(!fe.isString(t)){throw TypeError("address must be a string")}return{address:t,family:e||(t.indexOf(".")<0?6:4)}},"resolveFamily");var a7e=o((t,e)=>wkt(fe.isObject(t)?t:{address:t,family:e}),"buildAddressEntry");var Skt=Ekt&&o(function t(e){return bkt(o(async function r(n,i,s){let{data:a,lookup:u,family:l}=e;const{responseType:c,responseEncoding:d}=e;const p=e.method.toUpperCase();let f;let h=false;let m;if(u){const ue=hkt(u,xe=>fe.isArray(xe)?xe:[xe]);u=o((xe,we,Pe)=>{ue(xe,we,(Ue,$e,ge)=>{const Je=fe.isArray($e)?$e.map(Le=>a7e(Le)):[a7e($e,ge)];we.all?Pe(Ue,Je):Pe(Ue,Je[0].address,Je[0].family)})},"lookup")}const g=new rDt["default"];const y=o(()=>{if(e.cancelToken){e.cancelToken.unsubscribe(v)}if(e.signal){e.signal.removeEventListener("abort",v)}g.removeAllListeners()},"onFinished");s((ue,xe)=>{f=true;if(xe){h=true;y()}});function v(ue){g.emit("abort",!ue||ue.type?new Dm(null,e,m):ue)}o(v,"abort");g.once("abort",i);if(e.cancelToken||e.signal){e.cancelToken&&e.cancelToken.subscribe(v);if(e.signal){e.signal.aborted?v():e.signal.addEventListener("abort",v)}}const w=xK(e.baseURL,e.url);const E=new URL(w,"http://localhost");const b=E.protocol||s7e[0];if(b==="data:"){let ue;if(p!=="GET"){return sb(n,i,{status:405,statusText:"method not allowed",headers:{},config:e})}try{ue=ikt(e.url,c==="blob",{Blob:e.env&&e.env.Blob})}catch(xe){throw nt.from(xe,nt.ERR_BAD_REQUEST,e)}if(c==="text"){ue=ue.toString(d);if(!d||d==="utf8"){ue=fe.stripBOM(ue)}}else if(c==="stream"){ue=ff["default"].Readable.from(ue)}return sb(n,i,{data:ue,status:200,statusText:"OK",headers:new Vo,config:e})}if(s7e.indexOf(b)===-1){return i(new nt("Unsupported protocol "+b,nt.ERR_BAD_REQUEST,e))}const S=Vo.from(e.headers).normalize();S.set("User-Agent","axios/"+cx,false);const T=e.onDownloadProgress;const A=e.onUploadProgress;const R=e.maxRate;let O=void 0;let j=void 0;if(fe.isSpecCompliantForm(a)){const ue=S.getContentType(/boundary=([-_\w\d]{10,70})/i);a=dkt(a,xe=>{S.set(xe)},{tag:`axios-${cx}-boundary`,boundary:ue&&ue[1]||void 0})}else if(fe.isFormData(a)&&fe.isFunction(a.getHeaders)){S.set(a.getHeaders());if(!S.hasContentLength()){try{const ue=await eDt["default"].promisify(a.getLength).call(a);Number.isFinite(ue)&&ue>=0&&S.setContentLength(ue)}catch(ue){}}}else if(fe.isBlob(a)){a.size&&S.setContentType(a.type||"application/octet-stream");S.setContentLength(a.size||0);a=ff["default"].Readable.from(D7e(a))}else if(a&&!fe.isStream(a)){if(Buffer.isBuffer(a));else if(fe.isArrayBuffer(a)){a=Buffer.from(new Uint8Array(a))}else if(fe.isString(a)){a=Buffer.from(a,"utf-8")}else{return i(new nt("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",nt.ERR_BAD_REQUEST,e))}S.setContentLength(a.length,false);if(e.maxBodyLength>-1&&a.length>e.maxBodyLength){return i(new nt("Request body larger than maxBodyLength limit",nt.ERR_BAD_REQUEST,e))}}const B=fe.toFiniteNumber(S.getContentLength());if(fe.isArray(R)){O=R[0];j=R[1]}else{O=j=R}if(a&&(A||O)){if(!fe.isStream(a)){a=ff["default"].Readable.from(a,{objectMode:false})}a=ff["default"].pipeline([a,new t7e({length:B,maxRate:fe.toFiniteNumber(O)})],fe.noop);A&&a.on("progress",ue=>{A(Object.assign(ue,{upload:true}))})}let U=void 0;if(e.auth){const ue=e.auth.username||"";const xe=e.auth.password||"";U=ue+":"+xe}if(!U&&E.username){const ue=E.username;const xe=E.password;U=ue+":"+xe}U&&S.delete("authorization");let Q;try{Q=wK(E.pathname+E.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(ue){const xe=new Error(ue.message);xe.config=e;xe.url=e.url;xe.exists=true;return i(xe)}S.set("Accept-Encoding","gzip, compress, deflate"+(i7e?", br":""),false);const oe={path:Q,method:p,headers:S.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:U,protocol:b,family:l,beforeRedirect:_kt,beforeRedirects:{}};!fe.isUndefined(u)&&(oe.lookup=u);if(e.socketPath){oe.socketPath=e.socketPath}else{oe.hostname=E.hostname;oe.port=E.port;k7e(oe,e.proxy,b+"//"+E.hostname+(E.port?":"+E.port:"")+oe.path)}let Te;const le=vkt.test(oe.protocol);oe.agent=le?e.httpsAgent:e.httpAgent;if(e.transport){Te=e.transport}else if(e.maxRedirects===0){Te=le?ZPt["default"]:XPt["default"]}else{if(e.maxRedirects){oe.maxRedirects=e.maxRedirects}if(e.beforeRedirect){oe.beforeRedirects.config=e.beforeRedirect}Te=le?ykt:gkt}if(e.maxBodyLength>-1){oe.maxBodyLength=e.maxBodyLength}else{oe.maxBodyLength=Infinity}if(e.insecureHTTPParser){oe.insecureHTTPParser=e.insecureHTTPParser}m=Te.request(oe,o(function ue(xe){if(m.destroyed)return;const we=[xe];const Pe=+xe.headers["content-length"];if(T){const Le=new t7e({length:fe.toFiniteNumber(Pe),maxRate:fe.toFiniteNumber(j)});T&&Le.on("progress",Ie=>{T(Object.assign(Ie,{download:true}))});we.push(Le)}let Ue=xe;const $e=xe.req||m;if(e.decompress!==false&&xe.headers["content-encoding"]){if(p==="HEAD"||xe.statusCode===204){delete xe.headers["content-encoding"]}switch((xe.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":we.push(mf["default"].createUnzip(n7e));delete xe.headers["content-encoding"];break;case"deflate":we.push(new pkt);we.push(mf["default"].createUnzip(n7e));delete xe.headers["content-encoding"];break;case"br":if(i7e){we.push(mf["default"].createBrotliDecompress(mkt));delete xe.headers["content-encoding"]}}}Ue=we.length>1?ff["default"].pipeline(we,fe.noop):we[0];const ge=ff["default"].finished(Ue,()=>{ge();y()});const Je={status:xe.statusCode,statusText:xe.statusMessage,headers:new Vo(xe.headers),config:e,request:$e};if(c==="stream"){Je.data=Ue;sb(n,i,Je)}else{const Le=[];let Ie=0;Ue.on("data",o(function Qe(qe){Le.push(qe);Ie+=qe.length;if(e.maxContentLength>-1&&Ie>e.maxContentLength){h=true;Ue.destroy();i(new nt("maxContentLength size of "+e.maxContentLength+" exceeded",nt.ERR_BAD_RESPONSE,e,$e))}},"handleStreamData"));Ue.on("aborted",o(function Qe(){if(h){return}const qe=new nt("maxContentLength size of "+e.maxContentLength+" exceeded",nt.ERR_BAD_RESPONSE,e,$e);Ue.destroy(qe);i(qe)},"handlerStreamAborted"));Ue.on("error",o(function Qe(qe){if(m.destroyed)return;i(nt.from(qe,null,e,$e))},"handleStreamError"));Ue.on("end",o(function Qe(){try{let qe=Le.length===1?Le[0]:Buffer.concat(Le);if(c!=="arraybuffer"){qe=qe.toString(d);if(!d||d==="utf8"){qe=fe.stripBOM(qe)}}Je.data=qe}catch(qe){return i(nt.from(qe,null,e,Je.request,Je))}sb(n,i,Je)},"handleStreamEnd"))}g.once("abort",Le=>{if(!Ue.destroyed){Ue.emit("error",Le);Ue.destroy()}})},"handleResponse"));g.once("abort",ue=>{i(ue);m.destroy(ue)});m.on("error",o(function ue(xe){i(nt.from(xe,null,e,m))},"handleRequestError"));m.on("socket",o(function ue(xe){xe.setKeepAlive(true,1e3*60)},"handleRequestSocket"));if(e.timeout){const ue=parseInt(e.timeout,10);if(Number.isNaN(ue)){i(new nt("error trying to parse `config.timeout` to int",nt.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(ue,o(function xe(){if(f)return;let we=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const Pe=e.transitional||SK;if(e.timeoutErrorMessage){we=e.timeoutErrorMessage}i(new nt(we,Pe.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,m));v()},"handleRequestTimeout"))}if(fe.isStream(a)){let ue=false;let xe=false;a.on("end",()=>{ue=true});a.once("error",we=>{xe=true;m.destroy(we)});a.on("close",()=>{if(!ue&&!xe){v(new Dm("Request stream has been aborted",e,m))}});a.pipe(m)}else{m.end(a)}},"dispatchHttpRequest"))},"httpAdapter");var Tkt=Mo.hasStandardBrowserEnv?{write(t,e,r,n,i,s){const a=[t+"="+encodeURIComponent(e)];fe.isNumber(r)&&a.push("expires="+new Date(r).toGMTString());fe.isString(n)&&a.push("path="+n);fe.isString(i)&&a.push("domain="+i);s===true&&a.push("secure");document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var Akt=Mo.hasStandardBrowserEnv?o(function t(){const e=/(msie|trident)/i.test(navigator.userAgent);const r=document.createElement("a");let n;function i(s){let a=s;if(e){r.setAttribute("href",a);a=r.href}r.setAttribute("href",a);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}o(i,"resolveURL");n=i(window.location.href);return o(function s(a){const u=fe.isString(a)?i(a):a;return u.protocol===n.protocol&&u.host===n.host},"isURLSameOrigin")},"standardBrowserEnv")():o(function t(){return o(function e(){return true},"isURLSameOrigin")},"nonStandardBrowserEnv")();function o7e(t,e){let r=0;const n=P7e(50,250);return i=>{const s=i.loaded;const a=i.lengthComputable?i.total:void 0;const u=s-r;const l=n(u);const c=s<=a;r=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:l?l:void 0,estimated:l&&a&&c?(a-s)/l:void 0,event:i};d[e?"download":"upload"]=true;t(d)}}o(o7e,"progressEventReducer");var xkt=typeof XMLHttpRequest!=="undefined";var Ckt=xkt&&function(t){return new Promise(o(function e(r,n){let i=t.data;const s=Vo.from(t.headers).normalize();let{responseType:a,withXSRFToken:u}=t;let l;function c(){if(t.cancelToken){t.cancelToken.unsubscribe(l)}if(t.signal){t.signal.removeEventListener("abort",l)}}o(c,"done");let d;if(fe.isFormData(i)){if(Mo.hasStandardBrowserEnv||Mo.hasStandardBrowserWebWorkerEnv){s.setContentType(false)}else if((d=s.getContentType())!==false){const[g,...y]=d?d.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([g||"multipart/form-data",...y].join("; "))}}let p=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"";const y=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(g+":"+y))}const f=xK(t.baseURL,t.url);p.open(t.method.toUpperCase(),wK(f,t.params,t.paramsSerializer),true);p.timeout=t.timeout;function h(){if(!p){return}const g=Vo.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());const y=!a||a==="text"||a==="json"?p.responseText:p.response;const v={data:y,status:p.status,statusText:p.statusText,headers:g,config:t,request:p};sb(o(function w(E){r(E);c()},"_resolve"),o(function w(E){n(E);c()},"_reject"),v);p=null}o(h,"onloadend");if("onloadend"in p){p.onloadend=h}else{p.onreadystatechange=o(function g(){if(!p||p.readyState!==4){return}if(p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)){return}setTimeout(h)},"handleLoad")}p.onabort=o(function g(){if(!p){return}n(new nt("Request aborted",nt.ECONNABORTED,t,p));p=null},"handleAbort");p.onerror=o(function g(){n(new nt("Network Error",nt.ERR_NETWORK,t,p));p=null},"handleError");p.ontimeout=o(function g(){let y=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const v=t.transitional||SK;if(t.timeoutErrorMessage){y=t.timeoutErrorMessage}n(new nt(y,v.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,t,p));p=null},"handleTimeout");if(Mo.hasStandardBrowserEnv){u&&fe.isFunction(u)&&(u=u(t));if(u||u!==false&&Akt(f)){const g=t.xsrfHeaderName&&t.xsrfCookieName&&Tkt.read(t.xsrfCookieName);if(g){s.set(t.xsrfHeaderName,g)}}}i===void 0&&s.setContentType(null);if("setRequestHeader"in p){fe.forEach(s.toJSON(),o(function g(y,v){p.setRequestHeader(v,y)},"setRequestHeader"))}if(!fe.isUndefined(t.withCredentials)){p.withCredentials=!!t.withCredentials}if(a&&a!=="json"){p.responseType=t.responseType}if(typeof t.onDownloadProgress==="function"){p.addEventListener("progress",o7e(t.onDownloadProgress,true))}if(typeof t.onUploadProgress==="function"&&p.upload){p.upload.addEventListener("progress",o7e(t.onUploadProgress))}if(t.cancelToken||t.signal){l=o(g=>{if(!p){return}n(!g||g.type?new Dm(null,t,p):g);p.abort();p=null},"onCanceled");t.cancelToken&&t.cancelToken.subscribe(l);if(t.signal){t.signal.aborted?l():t.signal.addEventListener("abort",l)}}const m=I7e(f);if(m&&Mo.protocols.indexOf(m)===-1){n(new nt("Unsupported protocol "+m+":",nt.ERR_BAD_REQUEST,t));return}p.send(i||null)},"dispatchXhrRequest"))};var yK={http:Skt,xhr:Ckt};fe.forEach(yK,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(r){}Object.defineProperty(t,"adapterName",{value:e})}});var u7e=o(t=>`- ${t}`,"renderReason");var Rkt=o(t=>fe.isFunction(t)||t===null||t===false,"isResolvedHandle");var $7e={getAdapter:t=>{t=fe.isArray(t)?t:[t];const{length:e}=t;let r;let n;const i={};for(let s=0;s<e;s++){r=t[s];let a;n=r;if(!Rkt(r)){n=yK[(a=String(r)).toLowerCase()];if(n===void 0){throw new nt(`Unknown adapter '${a}'`)}}if(n){break}i[a||"#"+s]=n}if(!n){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===false?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?"since :\n"+s.map(u7e).join("\n"):" "+u7e(s[0]):"as no adapter specified";throw new nt(`There is no suitable adapter to dispatch the request `+a,"ERR_NOT_SUPPORT")}return n},adapters:yK};function cK(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new Dm(null,t)}}o(cK,"throwIfCancellationRequested");function l7e(t){cK(t);t.headers=Vo.from(t.headers);t.data=lK.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=$7e.getAdapter(t.adapter||AK.adapter);return e(t).then(o(function r(n){cK(t);n.data=lK.call(t,t.transformResponse,n);n.headers=Vo.from(n.headers);return n},"onAdapterResolution"),o(function r(n){if(!N7e(n)){cK(t);if(n&&n.response){n.response.data=lK.call(t,t.transformResponse,n.response);n.response.headers=Vo.from(n.response.headers)}}return Promise.reject(n)},"onAdapterRejection"))}o(l7e,"dispatchRequest");var c7e=o(t=>t instanceof Vo?t.toJSON():t,"headersToObject");function Ly(t,e){e=e||{};const r={};function n(c,d,p){if(fe.isPlainObject(c)&&fe.isPlainObject(d)){return fe.merge.call({caseless:p},c,d)}else if(fe.isPlainObject(d)){return fe.merge({},d)}else if(fe.isArray(d)){return d.slice()}return d}o(n,"getMergedValue");function i(c,d,p){if(!fe.isUndefined(d)){return n(c,d,p)}else if(!fe.isUndefined(c)){return n(void 0,c,p)}}o(i,"mergeDeepProperties");function s(c,d){if(!fe.isUndefined(d)){return n(void 0,d)}}o(s,"valueFromConfig2");function a(c,d){if(!fe.isUndefined(d)){return n(void 0,d)}else if(!fe.isUndefined(c)){return n(void 0,c)}}o(a,"defaultToConfig2");function u(c,d,p){if(p in e){return n(c,d)}else if(p in t){return n(void 0,c)}}o(u,"mergeDirectKeys");const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:(c,d)=>i(c7e(c),c7e(d),true)};fe.forEach(Object.keys(Object.assign({},t,e)),o(function c(d){const p=l[d]||i;const f=p(t[d],e[d],d);fe.isUndefined(f)&&p!==u||(r[d]=f)},"computeConfigValue"));return r}o(Ly,"mergeConfig");var CK={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{CK[t]=o(function r(n){return typeof n===t||"a"+(e<1?"n ":" ")+t},"validator")});var d7e={};CK.transitional=o(function t(e,r,n){function i(s,a){return"[Axios v"+cx+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}o(i,"formatMessage");return(s,a,u)=>{if(e===false){throw new nt(i(a," has been removed"+(r?" in "+r:"")),nt.ERR_DEPRECATED)}if(r&&!d7e[a]){d7e[a]=true;console.warn(i(a," has been deprecated since v"+r+" and will be removed in the near future"))}return e?e(s,a,u):true}},"transitional");function Okt(t,e,r){if(typeof t!=="object"){throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE)}const n=Object.keys(t);let i=n.length;while(i-- >0){const s=n[i];const a=e[s];if(a){const u=t[s];const l=u===void 0||a(u,s,t);if(l!==true){throw new nt("option "+s+" must be "+l,nt.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new nt("Unknown option "+s,nt.ERR_BAD_OPTION)}}}o(Okt,"assertOptions");var vK={assertOptions:Okt,validators:CK};var pf=vK.validators;var qy=class{static{o(this,"Axios")}constructor(e){this.defaults=e;this.interceptors={request:new ZTe,response:new ZTe}}request(e,r){if(typeof e==="string"){r=r||{};r.url=e}else{r=e||{}}r=Ly(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;if(n!==void 0){vK.assertOptions(n,{silentJSONParsing:pf.transitional(pf.boolean),forcedJSONParsing:pf.transitional(pf.boolean),clarifyTimeoutError:pf.transitional(pf.boolean)},false)}if(i!=null){if(fe.isFunction(i)){r.paramsSerializer={serialize:i}}else{vK.assertOptions(i,{encode:pf.function,serialize:pf.function},true)}}r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=s&&fe.merge(s.common,s[r.method]);s&&fe.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]});r.headers=Vo.concat(a,s);const u=[];let l=true;this.interceptors.request.forEach(o(function m(g){if(typeof g.runWhen==="function"&&g.runWhen(r)===false){return}l=l&&g.synchronous;u.unshift(g.fulfilled,g.rejected)},"unshiftRequestInterceptors"));const c=[];this.interceptors.response.forEach(o(function m(g){c.push(g.fulfilled,g.rejected)},"pushResponseInterceptors"));let d;let p=0;let f;if(!l){const m=[l7e.bind(this),void 0];m.unshift.apply(m,u);m.push.apply(m,c);f=m.length;d=Promise.resolve(r);while(p<f){d=d.then(m[p++],m[p++])}return d}f=u.length;let h=r;p=0;while(p<f){const m=u[p++];const g=u[p++];try{h=m(h)}catch(y){g.call(this,y);break}}try{d=l7e.call(this,h)}catch(m){return Promise.reject(m)}p=0;f=c.length;while(p<f){d=d.then(c[p++],c[p++])}return d}getUri(e){e=Ly(this.defaults,e);const r=xK(e.baseURL,e.url);return wK(r,e.params,e.paramsSerializer)}};fe.forEach(["delete","get","head","options"],o(function t(e){qy.prototype[e]=function(r,n){return this.request(Ly(n||{},{method:e,url:r,data:(n||{}).data}))}},"forEachMethodNoData"));fe.forEach(["post","put","patch"],o(function t(e){function r(n){return o(function i(s,a,u){return this.request(Ly(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))},"httpMethod")}o(r,"generateHTTPMethod");qy.prototype[e]=r();qy.prototype[e+"Form"]=r(true)},"forEachMethodWithData"));var lx=qy;var _K=class t{static{o(this,"CancelToken")}constructor(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}let r;this.promise=new Promise(o(function i(s){r=s},"promiseExecutor"));const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;while(s-- >0){n._listeners[s](i)}n._listeners=null});this.promise.then=i=>{let s;const a=new Promise(u=>{n.subscribe(u);s=u}).then(i);a.cancel=o(function u(){n.unsubscribe(s)},"reject");return a};e(o(function i(s,a,u){if(n.reason){return}n.reason=new Dm(s,a,u);r(n.reason)},"cancel"))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}}unsubscribe(e){if(!this._listeners){return}const r=this._listeners.indexOf(e);if(r!==-1){this._listeners.splice(r,1)}}static source(){let e;const r=new t(o(function n(i){e=i},"executor"));return{token:r,cancel:e}}};var Nkt=_K;function Ikt(t){return o(function e(r){return t.apply(null,r)},"wrap")}o(Ikt,"spread");function Pkt(t){return fe.isObject(t)&&t.isAxiosError===true}o(Pkt,"isAxiosError");var EK={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(EK).forEach(([t,e])=>{EK[e]=t});var Dkt=EK;function L7e(t){const e=new lx(t);const r=m7e(lx.prototype.request,e);fe.extend(r,lx.prototype,e,{allOwnKeys:true});fe.extend(r,e,null,{allOwnKeys:true});r.create=o(function n(i){return L7e(Ly(t,i))},"create");return r}o(L7e,"createInstance");var fi=L7e(AK);fi.Axios=lx;fi.CanceledError=Dm;fi.CancelToken=Nkt;fi.isCancel=N7e;fi.VERSION=cx;fi.toFormData=hx;fi.AxiosError=nt;fi.Cancel=fi.CanceledError;fi.all=o(function t(e){return Promise.all(e)},"all");fi.spread=Ikt;fi.isAxiosError=Pkt;fi.mergeConfig=Ly;fi.AxiosHeaders=Vo;fi.formToJSON=t=>O7e(fe.isHTMLForm(t)?new FormData(t):t);fi.getAdapter=$7e.getAdapter;fi.HttpStatusCode=Dkt;fi.default=fi;q7e.exports=fi});var yx=_(gx=>{"use strict";Object.defineProperty(gx,"__esModule",{value:true});gx.CredentialsMethod=void 0;var j7e;(function(t){t["None"]="none";t["ApiToken"]="api_token";t["ClientCredentials"]="client_credentials"})(j7e||(gx.CredentialsMethod=j7e={}))});var $m=_(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:true});hi.FgaRequiredParamError=hi.FgaValidationError=hi.FgaApiAuthenticationError=hi.FgaApiInternalError=hi.FgaApiRateLimitExceededError=hi.FgaApiNotFoundError=hi.FgaApiValidationError=hi.FgaApiError=hi.FgaError=void 0;var Uy=class extends Error{static{o(this,"FgaError")}constructor(e,r){super(r||typeof e==="string"?e:`FGA Error${(e===null||e===void 0?void 0:e.message)?`: ${e.message}`:""}`);this.name="FgaError";if(e===null||e===void 0?void 0:e.stack){this.stack=e.stack}}};hi.FgaError=Uy;function _x(t){let e=(t||"").split("/");if(e.length<4){e=[]}const r=e[2]||"";const n=e[3]||"";return{storeId:r,endpointCategory:n}}o(_x,"getRequestMetadataFromPath");var U7e="fga-request-id";function kK(t){return t.response?Object.fromEntries(Object.entries(t.response.headers).map(([e,r])=>[e.toLowerCase(),r])):{}}o(kK,"getResponseHeaders");var km=class extends Uy{static{o(this,"FgaApiError")}constructor(e,r){var n,i,s,a,u,l,c,d,p,f;super(r?r:e);this.name="FgaApiError";this.statusCode=(n=e.response)===null||n===void 0?void 0:n.status;this.statusText=(i=e.response)===null||i===void 0?void 0:i.statusText;this.requestData=(s=e.config)===null||s===void 0?void 0:s.data;this.requestURL=(a=e.config)===null||a===void 0?void 0:a.url;this.method=(u=e.config)===null||u===void 0?void 0:u.method;const{storeId:h,endpointCategory:m}=_x((l=e.request)===null||l===void 0?void 0:l.path);this.storeId=h;this.endpointCategory=m;this.apiErrorMessage=(d=(c=e.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message;this.responseData=(p=e.response)===null||p===void 0?void 0:p.data;this.responseHeader=(f=e.response)===null||f===void 0?void 0:f.headers;const g=kK(e);this.requestId=g[U7e];if(e===null||e===void 0?void 0:e.stack){this.stack=e.stack}}};hi.FgaApiError=km;var RK=class extends km{static{o(this,"FgaApiValidationError")}constructor(e,r){var n,i,s,a,u,l,c,d;super(e);this.name="FgaApiValidationError";this.apiErrorCode=(i=(n=e.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:p}=_x((s=e.request)===null||s===void 0?void 0:s.path);this.message=r?r:((u=(a=e.response)===null||a===void 0?void 0:a.data)===null||u===void 0?void 0:u.message)?`FGA API Validation Error: ${(l=e.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=e.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:e.message}};hi.FgaApiValidationError=RK;var OK=class extends km{static{o(this,"FgaApiNotFoundError")}constructor(e,r){var n,i,s,a,u,l,c;super(e);this.name="FgaApiNotFoundError";this.apiErrorCode=(i=(n=e.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;this.message=r?r:((a=(s=e.response)===null||s===void 0?void 0:s.data)===null||a===void 0?void 0:a.message)?`FGA API NotFound Error: ${(u=e.config)===null||u===void 0?void 0:u.method} : Error ${(c=(l=e.response)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.message}`:e.message}};hi.FgaApiNotFoundError=OK;var NK=class extends km{static{o(this,"FgaApiRateLimitExceededError")}constructor(e,r){var n,i,s;super(e);this.name="FgaApiRateLimitExceededError";this.apiErrorCode=(i=(n=e.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:a}=_x((s=e.request)===null||s===void 0?void 0:s.path);const u=kK(e);this.message=r?r:`FGA API Rate Limit Error for ${this.method} ${a}`}};hi.FgaApiRateLimitExceededError=NK;var IK=class extends km{static{o(this,"FgaApiInternalError")}constructor(e,r){var n,i,s,a,u,l,c,d;super(e);this.name="FgaApiInternalError";const{endpointCategory:p}=_x((n=e.request)===null||n===void 0?void 0:n.path);this.apiErrorCode=(s=(i=e.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.code;this.message=r?r:((u=(a=e.response)===null||a===void 0?void 0:a.data)===null||u===void 0?void 0:u.message)?`FGA API Internal Error: ${(l=e.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=e.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:e.message}};hi.FgaApiInternalError=IK;var PK=class extends Uy{static{o(this,"FgaApiAuthenticationError")}constructor(e){var r,n,i,s,a,u,l,c,d,p;super(`FGA Authentication Error.${((r=e.response)===null||r===void 0?void 0:r.statusText)?` ${e.response.statusText}`:""}`);this.name="FgaApiAuthenticationError";this.statusCode=(n=e.response)===null||n===void 0?void 0:n.status;this.statusText=(i=e.response)===null||i===void 0?void 0:i.statusText;this.requestURL=(s=e.config)===null||s===void 0?void 0:s.url;this.method=(a=e.config)===null||a===void 0?void 0:a.method;this.responseData=(u=e.response)===null||u===void 0?void 0:u.data;this.responseHeader=(l=e.response)===null||l===void 0?void 0:l.headers;this.apiErrorCode=(d=(c=e.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.code;const f=kK(e);this.requestId=f[U7e];let h;try{h=JSON.parse(((p=e.config)===null||p===void 0?void 0:p.data)||"{}")}catch(m){}this.clientId=h===null||h===void 0?void 0:h.client_id;this.audience=h===null||h===void 0?void 0:h.audience;this.grantType=h===null||h===void 0?void 0:h.grant_type;if(e===null||e===void 0?void 0:e.stack){this.stack=e.stack}}};hi.FgaApiAuthenticationError=PK;var vx=class extends Uy{static{o(this,"FgaValidationError")}constructor(e,r){super(r);this.field=e;this.name="FgaValidationError"}};hi.FgaValidationError=vx;var DK=class extends vx{static{o(this,"FgaRequiredParamError")}constructor(e,r,n){super(r,n);this.functionName=e;this.name="FgaRequiredParamError"}};hi.FgaRequiredParamError=DK});var lb=_(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:true});gf.isWellFormedUlidString=gf.isWellFormedUriString=gf.assertParamExists=void 0;var kkt=$m();var $kt=o(function(t,e,r){if(r===null||r===void 0){throw new kkt.FgaRequiredParamError(t,e,`Required parameter ${e} was null or undefined when calling ${t}.`)}},"assertParamExists");gf.assertParamExists=$kt;var Lkt=o(t=>{try{const e=new URL(t);return(e.toString()===t||e.toString()===`${t}/`)&&(e.protocol==="https:"||e.protocol==="http:")}catch(e){return false}},"isWellFormedUriString");gf.isWellFormedUriString=Lkt;var qkt=o(t=>{var e;const r=/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/;return!!(typeof t==="string"&&((e=t.match(r))===null||e===void 0?void 0:e.length))},"isWellFormedUlidString");gf.isWellFormedUlidString=qkt});var LK=_(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:true});Fy.Configuration=Fy.GetDefaultRetryParams=void 0;var cb=yx();var $K=$m();var Ex=lb();var jkt=15;var Ukt=100;var Fkt="openfga-sdk js/0.3.0";function Mkt(t=jkt,e=Ukt){return{maxRetry:t,minWaitInMs:e}}o(Mkt,"GetDefaultRetryParams");Fy.GetDefaultRetryParams=Mkt;var bx=class{static{o(this,"Configuration")}constructor(e={}){this.apiScheme="https";this.getBasePath=()=>`${this.apiScheme}://${this.apiHost}`;this.apiScheme=e.apiScheme||this.apiScheme;this.apiHost=e.apiHost;this.storeId=e.storeId;const r=e.credentials;if(r){switch(r===null||r===void 0?void 0:r.method){case cb.CredentialsMethod.ApiToken:this.credentials={method:r.method,config:{token:r.config.token,headerName:"Authorization",headerValuePrefix:"Bearer"}};break;case cb.CredentialsMethod.ClientCredentials:this.credentials={method:cb.CredentialsMethod.ClientCredentials,config:{clientId:r.config.clientId,clientSecret:r.config.clientSecret,apiAudience:r.config.apiAudience,apiTokenIssuer:r.config.apiTokenIssuer}};break;case cb.CredentialsMethod.None:default:this.credentials={method:cb.CredentialsMethod.None};break}}const n=e.baseOptions||{};n.headers=n.headers||{};if(typeof process==="object"&&process.title==="node"&&!n.headers["User-Agent"]){n.headers["User-Agent"]=Fkt}this.baseOptions=n;this.retryParams=e.retryParams}isValid(){var e;(0,Ex.assertParamExists)("Configuration","apiScheme",this.apiScheme);(0,Ex.assertParamExists)("Configuration","apiHost",this.apiHost);if(!(0,Ex.isWellFormedUriString)(this.getBasePath())){throw new $K.FgaValidationError(`Configuration.apiScheme (${this.apiScheme}) and Configuration.apiHost (${this.apiHost}) do not form a valid URI (${this.getBasePath()})`)}if(this.storeId&&!(0,Ex.isWellFormedUlidString)(this.storeId)){throw new $K.FgaValidationError("storeId")}if(((e=this.retryParams)===null||e===void 0?void 0:e.maxRetry)&&this.retryParams.maxRetry>15){throw new $K.FgaValidationError("Configuration.retryParams.maxRetry exceeds maximum allowed limit of 15")}return true}};Fy.Configuration=bx;bx.sdkVersion="0.3.0"});var F7e=_(wx=>{"use strict";Object.defineProperty(wx,"__esModule",{value:true});wx.assertNever=void 0;function Bkt(t){throw new Error(`Assertion failed. Unacceptable value: '${t}'`)}o(Bkt,"assertNever");wx.assertNever=Bkt});var M7e=_(Sx=>{"use strict";Object.defineProperty(Sx,"__esModule",{value:true});Sx.chunkArray=void 0;function Vkt(t,e){const r=[];const n=[...t];while(n.length>0){r.push(n.splice(0,e))}return r}o(Vkt,"chunkArray");Sx.chunkArray=Vkt});var V7e=_(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:true});My.generateRandomIdWithNonUniqueFallback=My.generateRandomId=void 0;var Tx=require("crypto");function B7e(){if(typeof Tx.randomUUID==="function"){return(0,Tx.randomUUID)()}if(typeof Tx.randomBytes==="function"){return(0,Tx.randomBytes)(20).toString("hex")}return}o(B7e,"generateRandomId");My.generateRandomId=B7e;function Hkt(){return B7e()||"00000000-0000-0000-0000-000000000000"}o(Hkt,"generateRandomIdWithNonUniqueFallback");My.generateRandomIdWithNonUniqueFallback=Hkt});var H7e=_(Ax=>{"use strict";Object.defineProperty(Ax,"__esModule",{value:true});Ax.setHeaderIfNotSet=void 0;function zkt(t,e,r){if(!t[e]&&r){t[e]=r}}o(zkt,"setHeaderIfNotSet");Ax.setHeaderIfNotSet=zkt});var z7e=_(xx=>{"use strict";Object.defineProperty(xx,"__esModule",{value:true});xx.setNotEnumerableProperty=void 0;function Gkt(t,e,r){Object.defineProperty(t,e,{enumerable:false,writable:false,value:r})}o(Gkt,"setNotEnumerableProperty");xx.setNotEnumerableProperty=Gkt});var qK=_($u=>{"use strict";var Kkt=$u&&$u.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var db=$u&&$u.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))Kkt(e,t,r)};Object.defineProperty($u,"__esModule",{value:true});db(F7e(),$u);db(M7e(),$u);db(V7e(),$u);db(H7e(),$u);db(z7e(),$u)});var UK=_(yi=>{"use strict";var jK=yi&&yi.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}o(i,"adopt");return new(r||(r=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(p){a(p)}}o(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){a(p)}}o(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}o(c,"step");c((n=n.apply(t,e||[])).next())})};Object.defineProperty(yi,"__esModule",{value:true});yi.createRequestFunction=yi.attemptHttpRequest=yi.toPathString=yi.serializeDataIfNeeded=yi.setSearchParams=yi.setBearerAuthToObject=yi.DUMMY_BASE_URL=void 0;var Ykt=Cx();var Lm=$m();var Wkt=qK();yi.DUMMY_BASE_URL="https://example.com";var Jkt=o(function(t,e){return jK(this,void 0,void 0,function*(){const r=yield e.getAccessTokenHeader();if(r&&!t[r.name]){t[r.name]=r.value}})},"setBearerAuthToObject");yi.setBearerAuthToObject=Jkt;var Qkt=o(function(t,...e){const r=new URLSearchParams(t.search);for(const n of e){for(const i in n){if(Array.isArray(n[i])){r.delete(i);for(const s of n[i]){r.append(i,s)}}else{r.set(i,n[i])}}}t.search=r.toString()},"setSearchParams");yi.setSearchParams=Qkt;var Xkt=o(t=>{const e=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(e.test(t)||t.toLowerCase()==="application/json-patch+json")},"isJsonMime");var Zkt=o(function(t,e){const r=typeof t!=="string";const n=r?Xkt(e.headers["Content-Type"]):r;return n?JSON.stringify(t!==void 0?t:{}):t||""},"serializeDataIfNeeded");yi.serializeDataIfNeeded=Zkt;var e$t=o(function(t){return t.pathname+t.search+t.hash},"toPathString");yi.toPathString=e$t;function t$t(t){return t&&typeof t==="object"&&t.isAxiosError===true}o(t$t,"isAxiosError");function r$t(t,e){const r=Math.ceil(Math.pow(2,t)*e);const n=Math.ceil(Math.pow(2,t+1)*e);return Math.floor(Math.random()*(n-r)+r)}o(r$t,"randomTime");function G7e(t,e,r){var n;return jK(this,void 0,void 0,function*(){let i=0;do{i++;try{return yield r(t)}catch(s){if(!t$t(s)){throw new Lm.FgaError(s)}const a=(n=s===null||s===void 0?void 0:s.response)===null||n===void 0?void 0:n.status;if(a===400||a===422){throw new Lm.FgaApiValidationError(s)}else if(a===401||a===403){throw new Lm.FgaApiAuthenticationError(s)}else if(a===404){throw new Lm.FgaApiNotFoundError(s)}else if(a===429||a>=500){if(i>=e.maxRetry){if(a===429){throw new Lm.FgaApiRateLimitExceededError(s)}else{throw new Lm.FgaApiInternalError(s)}}yield new Promise(u=>setTimeout(u,r$t(i,e.minWaitInMs)))}else{throw new Lm.FgaApiError(s)}}}while(i<e.maxRetry+1)})}o(G7e,"attemptHttpRequest");yi.attemptHttpRequest=G7e;var n$t=o(function(t,e,r,n){var i,s;r.isValid();const a=((i=t.options)===null||i===void 0?void 0:i.retryParams)?(s=t.options)===null||s===void 0?void 0:s.retryParams:r.retryParams;const u=a?a.maxRetry:0;const l=a?a.minWaitInMs:0;if(!n){n=Ykt.Credentials.init(r)}return(c=e)=>jK(this,void 0,void 0,function*(){yield(0,yi.setBearerAuthToObject)(t.options.headers,n);const d=Object.assign(Object.assign({},t.options),{url:r.getBasePath()+t.url});const p=yield G7e(d,{maxRetry:u,minWaitInMs:l},c);const f=typeof(p===null||p===void 0?void 0:p.data)==="undefined"?{}:p===null||p===void 0?void 0:p.data;const h=Object.assign({},f);(0,Wkt.setNotEnumerableProperty)(h,"$response",p);return h})},"createRequestFunction");yi.createRequestFunction=n$t});var Y7e=_(By=>{"use strict";var FK=By&&By.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}o(i,"adopt");return new(r||(r=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(p){a(p)}}o(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){a(p)}}o(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}o(c,"step");c((n=n.apply(t,e||[])).next())})};Object.defineProperty(By,"__esModule",{value:true});By.Credentials=void 0;var K7e=mx();var yf=lb();var MK=$m();var i$t=UK();var Ho=yx();var BK=class t{static{o(this,"Credentials")}static init(e){return new t(e.credentials)}constructor(e,r=K7e.default){this.authConfig=e;this.axios=r;this.initConfig();this.isValid()}initConfig(){var e;switch((e=this.authConfig)===null||e===void 0?void 0:e.method){case Ho.CredentialsMethod.ApiToken:if(this.authConfig.config){if(!this.authConfig.config.headerName){this.authConfig.config.headerName="Authorization"}if(!this.authConfig.config.headerValuePrefix){this.authConfig.config.headerValuePrefix="Bearer"}}break;case Ho.CredentialsMethod.ClientCredentials:case Ho.CredentialsMethod.None:default:break}}isValid(){var e,r,n,i,s,a,u,l,c;const{authConfig:d}=this;switch(d===null||d===void 0?void 0:d.method){case Ho.CredentialsMethod.None:break;case Ho.CredentialsMethod.ApiToken:(0,yf.assertParamExists)("Credentials","config.token",(e=d.config)===null||e===void 0?void 0:e.token);(0,yf.assertParamExists)("Credentials","config.headerName",(r=d.config)===null||r===void 0?void 0:r.headerName);(0,yf.assertParamExists)("Credentials","config.headerName",(n=d.config)===null||n===void 0?void 0:n.headerName);break;case Ho.CredentialsMethod.ClientCredentials:(0,yf.assertParamExists)("Credentials","config.clientId",(i=d.config)===null||i===void 0?void 0:i.clientId);(0,yf.assertParamExists)("Credentials","config.clientSecret",(s=d.config)===null||s===void 0?void 0:s.clientSecret);(0,yf.assertParamExists)("Credentials","config.apiTokenIssuer",(a=d.config)===null||a===void 0?void 0:a.apiTokenIssuer);(0,yf.assertParamExists)("Credentials","config.apiAudience",(u=d.config)===null||u===void 0?void 0:u.apiAudience);if(!(0,yf.isWellFormedUriString)(`https://${(l=d.config)===null||l===void 0?void 0:l.apiTokenIssuer}`)){throw new MK.FgaValidationError(`Configuration.apiTokenIssuer does not form a valid URI (https://${(c=d.config)===null||c===void 0?void 0:c.apiTokenIssuer})`)}break}}getAccessTokenHeader(){var e;return FK(this,void 0,void 0,function*(){const r=yield this.getAccessTokenValue();switch((e=this.authConfig)===null||e===void 0?void 0:e.method){case Ho.CredentialsMethod.None:return;case Ho.CredentialsMethod.ApiToken:return{name:this.authConfig.config.headerName,value:`${this.authConfig.config.headerValuePrefix?`${this.authConfig.config.headerValuePrefix} `:""}${r}`};case Ho.CredentialsMethod.ClientCredentials:return{name:"Authorization",value:`Bearer ${r}`}}})}getAccessTokenValue(){var e;return FK(this,void 0,void 0,function*(){switch((e=this.authConfig)===null||e===void 0?void 0:e.method){case Ho.CredentialsMethod.None:return;case Ho.CredentialsMethod.ApiToken:return this.authConfig.config.token;case Ho.CredentialsMethod.ClientCredentials:if(this.accessToken&&(!this.accessTokenExpiryDate||this.accessTokenExpiryDate>new Date)){return this.accessToken}return this.refreshAccessToken()}})}refreshAccessToken(){var e;return FK(this,void 0,void 0,function*(){const r=(e=this.authConfig)===null||e===void 0?void 0:e.config;try{const n=yield(0,i$t.attemptHttpRequest)({url:`https://${r.apiTokenIssuer}/oauth/token`,method:"post",data:{client_id:r.clientId,client_secret:r.clientSecret,audience:r.apiAudience,grant_type:"client_credentials"}},{maxRetry:3,minWaitInMs:100},K7e.default);if(n){this.accessToken=n.data.access_token;this.accessTokenExpiryDate=new Date(Date.now()+n.data.expires_in*1e3)}return this.accessToken}catch(n){if(n instanceof MK.FgaApiError){n.constructor=MK.FgaApiAuthenticationError;n.name="FgaApiAuthenticationError";n.clientId=r.clientId;n.audience=r.apiAudience;n.grantType="client_credentials"}throw n}})}};By.Credentials=BK});var Cx=_(vf=>{"use strict";var s$t=vf&&vf.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var W7e=vf&&vf.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))s$t(e,t,r)};Object.defineProperty(vf,"__esModule",{value:true});W7e(Y7e(),vf);W7e(yx(),vf)});var HK=_(Rx=>{"use strict";Object.defineProperty(Rx,"__esModule",{value:true});Rx.BaseAPI=void 0;var a$t=mx();var o$t=require("http");var u$t=require("https");var J7e=LK();var l$t=Cx();var c$t=1e4;var VK=class{static{o(this,"BaseAPI")}constructor(e,r){var n;this.axios=r;if(e instanceof J7e.Configuration){this.configuration=e}else{this.configuration=new J7e.Configuration(e)}this.configuration.isValid();this.credentials=l$t.Credentials.init(this.configuration);if(!this.axios){const i=new o$t.Agent({keepAlive:true});const s=new u$t.Agent({keepAlive:true});this.axios=a$t.default.create({httpAgent:i,httpsAgent:s,timeout:c$t,headers:(n=this.configuration.baseOptions)===null||n===void 0?void 0:n.headers})}}get storeId(){return this.configuration.storeId}set storeId(e){this.configuration.storeId=e}};Rx.BaseAPI=VK});var GK=_(tn=>{"use strict";var Zr=tn&&tn.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}o(i,"adopt");return new(r||(r=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(p){a(p)}}o(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){a(p)}}o(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}o(c,"step");c((n=n.apply(t,e||[])).next())})};Object.defineProperty(tn,"__esModule",{value:true});tn.OpenFgaApi=tn.OpenFgaApiFactory=tn.OpenFgaApiFp=tn.OpenFgaApiAxiosParamCreator=void 0;var zs=mx();var d$t=HK();var We=UK();var Vn=lb();var p$t=o(function(t,e){return{check:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("check","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/check".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),createStore:(r,n={})=>Zr(this,void 0,void 0,function*(){const i="/stores";const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),deleteStore:(r={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const i=new URL(n,We.DUMMY_BASE_URL);let s;if(t){s=t.baseOptions}const a=Object.assign(Object.assign({method:"DELETE"},s),r);const u={};const l={};(0,We.setSearchParams)(i,l,r.query);a.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,We.toPathString)(i),options:a}}),expand:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("expand","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/expand".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),getStore:(r={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const i=new URL(n,We.DUMMY_BASE_URL);let s;if(t){s=t.baseOptions}const a=Object.assign(Object.assign({method:"GET"},s),r);const u={};const l={};(0,We.setSearchParams)(i,l,r.query);a.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,We.toPathString)(i),options:a}}),listObjects:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("listObjects","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/list-objects".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),listStores:(r,n,i={})=>Zr(this,void 0,void 0,function*(){const s="/stores";const a=new URL(s,We.DUMMY_BASE_URL);let u;if(t){u=t.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,We.setSearchParams)(a,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,We.toPathString)(a),options:l}}),read:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("read","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/read".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),readAssertions:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("readAssertions","authorizationModelId",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"GET"},a),n);const l={};const c={};(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,We.toPathString)(s),options:u}}),readAuthorizationModel:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("readAuthorizationModel","id",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/authorization-models/{id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId))).replace(`{${"id"}}`,encodeURIComponent(String(r)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"GET"},a),n);const l={};const c={};(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,We.toPathString)(s),options:u}}),readAuthorizationModels:(r,n,i={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const s="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const a=new URL(s,We.DUMMY_BASE_URL);let u;if(t){u=t.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,We.setSearchParams)(a,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,We.toPathString)(a),options:l}}),readChanges:(r,n,i,s={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const a="/stores/{store_id}/changes".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const u=new URL(a,We.DUMMY_BASE_URL);let l;if(t){l=t.baseOptions}const c=Object.assign(Object.assign({method:"GET"},l),s);const d={};const p={};if(r!==void 0){p["type"]=r}if(n!==void 0){p["page_size"]=n}if(i!==void 0){p["continuation_token"]=i}(0,We.setSearchParams)(u,p,s.query);c.headers=Object.assign(Object.assign({},d),s.headers);return{url:(0,We.toPathString)(u),options:c}}),write:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("write","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/write".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),writeAssertions:(r,n,i={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("writeAssertions","authorizationModelId",r);(0,Vn.assertParamExists)("writeAssertions","body",n);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const s="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const a=new URL(s,We.DUMMY_BASE_URL);let u;if(t){u=t.baseOptions}const l=Object.assign(Object.assign({method:"PUT"},u),i);const c={};const d={};c["Content-Type"]="application/json";(0,We.setSearchParams)(a,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);l.data=(0,We.serializeDataIfNeeded)(n,l);return{url:(0,We.toPathString)(a),options:l}}),writeAuthorizationModel:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("writeAuthorizationModel","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}})}},"OpenFgaApiAxiosParamCreator");tn.OpenFgaApiAxiosParamCreator=p$t;var f$t=o(function(t,e){const r=(0,tn.OpenFgaApiAxiosParamCreator)(t,e);return{check(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.check(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},createStore(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.createStore(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},deleteStore(n){return Zr(this,void 0,void 0,function*(){const i=yield r.deleteStore(n);return(0,We.createRequestFunction)(i,zs.default,t,e)})},expand(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.expand(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},getStore(n){return Zr(this,void 0,void 0,function*(){const i=yield r.getStore(n);return(0,We.createRequestFunction)(i,zs.default,t,e)})},listObjects(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.listObjects(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},listStores(n,i,s){return Zr(this,void 0,void 0,function*(){const a=yield r.listStores(n,i,s);return(0,We.createRequestFunction)(a,zs.default,t,e)})},read(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.read(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},readAssertions(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.readAssertions(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},readAuthorizationModel(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.readAuthorizationModel(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},readAuthorizationModels(n,i,s){return Zr(this,void 0,void 0,function*(){const a=yield r.readAuthorizationModels(n,i,s);return(0,We.createRequestFunction)(a,zs.default,t,e)})},readChanges(n,i,s,a){return Zr(this,void 0,void 0,function*(){const u=yield r.readChanges(n,i,s,a);return(0,We.createRequestFunction)(u,zs.default,t,e)})},write(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.write(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},writeAssertions(n,i,s){return Zr(this,void 0,void 0,function*(){const a=yield r.writeAssertions(n,i,s);return(0,We.createRequestFunction)(a,zs.default,t,e)})},writeAuthorizationModel(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.writeAuthorizationModel(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})}}},"OpenFgaApiFp");tn.OpenFgaApiFp=f$t;var h$t=o(function(t,e,r){const n=(0,tn.OpenFgaApiFp)(t,e);return{check(i,s){return n.check(i,s).then(a=>a(r))},createStore(i,s){return n.createStore(i,s).then(a=>a(r))},deleteStore(i){return n.deleteStore(i).then(s=>s(r))},expand(i,s){return n.expand(i,s).then(a=>a(r))},getStore(i){return n.getStore(i).then(s=>s(r))},listObjects(i,s){return n.listObjects(i,s).then(a=>a(r))},listStores(i,s,a){return n.listStores(i,s,a).then(u=>u(r))},read(i,s){return n.read(i,s).then(a=>a(r))},readAssertions(i,s){return n.readAssertions(i,s).then(a=>a(r))},readAuthorizationModel(i,s){return n.readAuthorizationModel(i,s).then(a=>a(r))},readAuthorizationModels(i,s,a){return n.readAuthorizationModels(i,s,a).then(u=>u(r))},readChanges(i,s,a,u){return n.readChanges(i,s,a,u).then(l=>l(r))},write(i,s){return n.write(i,s).then(a=>a(r))},writeAssertions(i,s,a){return n.writeAssertions(i,s,a).then(u=>u(r))},writeAuthorizationModel(i,s){return n.writeAuthorizationModel(i,s).then(a=>a(r))}}},"OpenFgaApiFactory");tn.OpenFgaApiFactory=h$t;var zK=class extends d$t.BaseAPI{static{o(this,"OpenFgaApi")}check(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).check(e,r).then(n=>n(this.axios))}createStore(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).createStore(e,r).then(n=>n(this.axios))}deleteStore(e){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).deleteStore(e).then(r=>r(this.axios))}expand(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).expand(e,r).then(n=>n(this.axios))}getStore(e){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).getStore(e).then(r=>r(this.axios))}listObjects(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).listObjects(e,r).then(n=>n(this.axios))}listStores(e,r,n){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).listStores(e,r,n).then(i=>i(this.axios))}read(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).read(e,r).then(n=>n(this.axios))}readAssertions(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).readAssertions(e,r).then(n=>n(this.axios))}readAuthorizationModel(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModel(e,r).then(n=>n(this.axios))}readAuthorizationModels(e,r,n){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModels(e,r,n).then(i=>i(this.axios))}readChanges(e,r,n,i){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).readChanges(e,r,n,i).then(s=>s(this.axios))}write(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).write(e,r).then(n=>n(this.axios))}writeAssertions(e,r,n){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).writeAssertions(e,r,n).then(i=>i(this.axios))}writeAuthorizationModel(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).writeAuthorizationModel(e,r).then(n=>n(this.axios))}};tn.OpenFgaApi=zK});var X7e=_((jmr,Q7e)=>{async function*m$t(t,e,r){const n=new Set;async function i(){const[s,a]=await Promise.race(n);n.delete(s);return a}o(i,"consume");for(const s of e){const a=(async()=>await r(s,e))().then(u=>[a,u]);n.add(a);if(n.size>=t){yield await i()}}while(n.size){yield await i()}}o(m$t,"asyncPool");Q7e.exports=m$t});var Z7e=_(zl=>{"use strict";var Hn=zl&&zl.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}o(i,"adopt");return new(r||(r=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(p){a(p)}}o(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){a(p)}}o(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}o(c,"step");c((n=n.apply(t,e||[])).next())})};var KK=zl&&zl.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values==="function"?__values(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(u,l){a=t[s](a),i(u,l,a.done,a.value)})}}o(n,"verb");function i(s,a,u,l){Promise.resolve(l).then(function(c){s({value:c,done:u})},a)}o(i,"settle")};Object.defineProperty(zl,"__esModule",{value:true});zl.OpenFgaClient=zl.ClientWriteStatus=void 0;var YK=X7e();var g$t=GK();var y$t=HK();var WK=$m();var Aa=qK();var v$t=lb();var JK=10;var Vy="X-OpenFGA-Client-Method";var QK="X-OpenFGA-Client-Bulk-Request-Id";var Hy;(function(t){t["SUCCESS"]="success";t["FAILURE"]="failure"})(Hy||(zl.ClientWriteStatus=Hy={}));var XK=class extends y$t.BaseAPI{static{o(this,"OpenFgaClient")}constructor(e,r){super(e,r);this.axios=r;this.api=new g$t.OpenFgaApi(this.configuration,r);this.authorizationModelId=e.authorizationModelId;this.getAuthorizationModelId()}getAuthorizationModelId(e={}){const r=(e===null||e===void 0?void 0:e.authorizationModelId)||this.authorizationModelId;if(r&&!(0,v$t.isWellFormedUlidString)(r)){throw new WK.FgaValidationError("authorizationModelId")}return r}checkValidApiConnection(e={}){return Hn(this,void 0,void 0,function*(){if(this.getAuthorizationModelId(e)){yield this.readAuthorizationModel(e)}else{yield this.readLatestAuthorizationModel(e)}})}listStores(e={}){return Hn(this,void 0,void 0,function*(){return this.api.listStores(e.pageSize,e.continuationToken,e)})}createStore(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.createStore(e,r)})}getStore(e={}){return Hn(this,void 0,void 0,function*(){return this.api.getStore(e)})}deleteStore(e={}){return Hn(this,void 0,void 0,function*(){return this.api.deleteStore(e)})}readAuthorizationModels(e={}){return Hn(this,void 0,void 0,function*(){return this.api.readAuthorizationModels(e.pageSize,e.continuationToken,e)})}writeAuthorizationModel(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.writeAuthorizationModel(e,r)})}readAuthorizationModel(e={}){return Hn(this,void 0,void 0,function*(){const r=this.getAuthorizationModelId(e);if(!r){throw new WK.FgaRequiredParamError("ClientConfiguration","authorizationModelId")}return this.api.readAuthorizationModel(r,e)})}readLatestAuthorizationModel(e={}){var r;return Hn(this,void 0,void 0,function*(){const{headers:n={}}=e;(0,Aa.setHeaderIfNotSet)(n,Vy,"ReadLatestAuthorizationModel");const i=yield this.readAuthorizationModels(Object.assign(Object.assign({},e),{pageSize:1,headers:n}));const s=i;s.authorization_model=(r=i.authorization_models)===null||r===void 0?void 0:r[0];delete s.authorization_models;return s})}readChanges(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.readChanges(e.type,r.pageSize,r.continuationToken,r)})}read(e={},r={}){return Hn(this,void 0,void 0,function*(){const n={page_size:r.pageSize,continuation_token:r.continuationToken};if(e.user||e.object||e.relation){n.tuple_key=e}return this.api.read(n,r)})}write(e,r={}){return Hn(this,void 0,void 0,function*(){const{transaction:n={},headers:i={}}=r;const{maxPerChunk:s=1,maxParallelRequests:a=JK}=n;const{writes:u,deletes:l}=e;const c=this.getAuthorizationModelId(r);if(!(n===null||n===void 0?void 0:n.disable)){const d={authorization_model_id:c};if(u===null||u===void 0?void 0:u.length){d.writes={tuple_keys:u}}if(l===null||l===void 0?void 0:l.length){d.deletes={tuple_keys:l}}yield this.api.write(d,r);return{writes:(u===null||u===void 0?void 0:u.map(p=>({tuple_key:p,status:Hy.SUCCESS})))||[],deletes:(l===null||l===void 0?void 0:l.map(p=>({tuple_key:p,status:Hy.SUCCESS})))||[]}}return Promise.all([(()=>Hn(this,void 0,void 0,function*(){var d,p,f,h,m,g,y,v;(0,Aa.setHeaderIfNotSet)(i,Vy,"Write");(0,Aa.setHeaderIfNotSet)(i,QK,(0,Aa.generateRandomIdWithNonUniqueFallback)());const w=[];if(u===null||u===void 0?void 0:u.length){try{for(var E=true,b=KK(YK(a,(0,Aa.chunkArray)(u,s),j=>this.writeTuples(j,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(B=>({writes:j.map(U=>({tuple_key:U,status:Hy.FAILURE,err:B})),deletes:[]})))),S;S=yield b.next(),d=S.done,!d;E=true){h=S.value;E=false;const j=h;w.push(j.writes)}}catch(j){p={error:j}}finally{try{if(!E&&!d&&(f=b.return))yield f.call(b)}finally{if(p)throw p.error}}}const T=[];if(l===null||l===void 0?void 0:l.length){try{for(var A=true,R=KK(YK(a,(0,Aa.chunkArray)(l,s),j=>this.deleteTuples(j,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(B=>({writes:[],deletes:j.map(U=>({tuple_key:U,status:Hy.FAILURE,err:B}))})))),O;O=yield R.next(),m=O.done,!m;A=true){v=O.value;A=false;const j=v;T.push(j.deletes)}}catch(j){g={error:j}}finally{try{if(!A&&!m&&(y=R.return))yield y.call(R)}finally{if(g)throw g.error}}}return{writes:w.flat(),deletes:T.flat()}}))(),this.checkValidApiConnection(r)]).then(d=>d[0])})}writeTuples(e,r={}){return Hn(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,Aa.setHeaderIfNotSet)(n,Vy,"WriteTuples");return this.write({writes:e},Object.assign(Object.assign({},r),{headers:n}))})}deleteTuples(e,r={}){return Hn(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,Aa.setHeaderIfNotSet)(n,Vy,"DeleteTuples");return this.write({deletes:e},Object.assign(Object.assign({},r),{headers:n}))})}check(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.check({tuple_key:{user:e.user,relation:e.relation,object:e.object},context:e.context,contextual_tuples:{tuple_keys:e.contextualTuples||[]},authorization_model_id:this.getAuthorizationModelId(r)},r)})}batchCheck(e,r={}){return Hn(this,void 0,void 0,function*(){return Promise.all([(()=>Hn(this,void 0,void 0,function*(){var n,i,s,a;const{headers:u={},maxParallelRequests:l=JK}=r;(0,Aa.setHeaderIfNotSet)(u,Vy,"BatchCheck");(0,Aa.setHeaderIfNotSet)(u,QK,(0,Aa.generateRandomIdWithNonUniqueFallback)());const c=[];try{for(var d=true,p=KK(YK(l,e,h=>this.check(h,Object.assign(Object.assign({},r),{headers:u})).then(m=>{m._request=h;return m}).catch(m=>{return{allowed:void 0,error:m,_request:h}}))),f;f=yield p.next(),n=f.done,!n;d=true){a=f.value;d=false;const h=a;c.push(h)}}catch(h){i={error:h}}finally{try{if(!d&&!n&&(s=p.return))yield s.call(p)}finally{if(i)throw i.error}}return{responses:c}}))(),this.checkValidApiConnection(r)]).then(n=>n[0])})}expand(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.expand({authorization_model_id:this.getAuthorizationModelId(r),tuple_key:e},r)})}listObjects(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.listObjects({authorization_model_id:this.getAuthorizationModelId(r),user:e.user,relation:e.relation,type:e.type,context:e.context,contextual_tuples:{tuple_keys:e.contextualTuples||[]}},r)})}listRelations(e,r={}){return Hn(this,void 0,void 0,function*(){const{user:n,object:i,relations:s,contextualTuples:a,context:u}=e;const{headers:l={},maxParallelRequests:c=JK}=r;(0,Aa.setHeaderIfNotSet)(l,Vy,"ListRelations");(0,Aa.setHeaderIfNotSet)(l,QK,(0,Aa.generateRandomIdWithNonUniqueFallback)());if(!(s===null||s===void 0?void 0:s.length)){throw new WK.FgaValidationError("relations","When calling listRelations, at least one relation must be passed in the relations field")}const d=yield this.batchCheck(s.map(f=>({user:n,relation:f,object:i,contextualTuples:a,context:u})),Object.assign(Object.assign({},r),{headers:l,maxParallelRequests:c}));const p=d.responses.find(f=>f.error);if(p){throw p.error}return{relations:d.responses.filter(f=>f.allowed).map(f=>f._request.relation)}})}readAssertions(e={}){return Hn(this,void 0,void 0,function*(){return this.api.readAssertions(this.getAuthorizationModelId(e),e)})}writeAssertions(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.writeAssertions(this.getAuthorizationModelId(r),{assertions:e.map(n=>({tuple_key:{user:n.user,relation:n.relation,object:n.object},expectation:n.expectation}))},r)})}};zl.OpenFgaClient=XK});var aAe=_(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:true});xa.TypeName=xa.TupleOperation=xa.NullValue=xa.NotFoundErrorCode=xa.InternalErrorCode=xa.ErrorCode=void 0;var eAe;(function(t){t["NoError"]="no_error";t["ValidationError"]="validation_error";t["AuthorizationModelNotFound"]="authorization_model_not_found";t["AuthorizationModelResolutionTooComplex"]="authorization_model_resolution_too_complex";t["InvalidWriteInput"]="invalid_write_input";t["CannotAllowDuplicateTuplesInOneRequest"]="cannot_allow_duplicate_tuples_in_one_request";t["CannotAllowDuplicateTypesInOneRequest"]="cannot_allow_duplicate_types_in_one_request";t["CannotAllowMultipleReferencesToOneRelation"]="cannot_allow_multiple_references_to_one_relation";t["InvalidContinuationToken"]="invalid_continuation_token";t["InvalidTupleSet"]="invalid_tuple_set";t["InvalidCheckInput"]="invalid_check_input";t["InvalidExpandInput"]="invalid_expand_input";t["UnsupportedUserSet"]="unsupported_user_set";t["InvalidObjectFormat"]="invalid_object_format";t["WriteFailedDueToInvalidInput"]="write_failed_due_to_invalid_input";t["AuthorizationModelAssertionsNotFound"]="authorization_model_assertions_not_found";t["LatestAuthorizationModelNotFound"]="latest_authorization_model_not_found";t["TypeNotFound"]="type_not_found";t["RelationNotFound"]="relation_not_found";t["EmptyRelationDefinition"]="empty_relation_definition";t["InvalidUser"]="invalid_user";t["InvalidTuple"]="invalid_tuple";t["UnknownRelation"]="unknown_relation";t["StoreIdInvalidLength"]="store_id_invalid_length";t["AssertionsTooManyItems"]="assertions_too_many_items";t["IdTooLong"]="id_too_long";t["AuthorizationModelIdTooLong"]="authorization_model_id_too_long";t["TupleKeyValueNotSpecified"]="tuple_key_value_not_specified";t["TupleKeysTooManyOrTooFewItems"]="tuple_keys_too_many_or_too_few_items";t["PageSizeInvalid"]="page_size_invalid";t["ParamMissingValue"]="param_missing_value";t["DifferenceBaseMissingValue"]="difference_base_missing_value";t["SubtractBaseMissingValue"]="subtract_base_missing_value";t["ObjectTooLong"]="object_too_long";t["RelationTooLong"]="relation_too_long";t["TypeDefinitionsTooFewItems"]="type_definitions_too_few_items";t["TypeInvalidLength"]="type_invalid_length";t["TypeInvalidPattern"]="type_invalid_pattern";t["RelationsTooFewItems"]="relations_too_few_items";t["RelationsTooLong"]="relations_too_long";t["RelationsInvalidPattern"]="relations_invalid_pattern";t["ObjectInvalidPattern"]="object_invalid_pattern";t["QueryStringTypeContinuationTokenMismatch"]="query_string_type_continuation_token_mismatch";t["ExceededEntityLimit"]="exceeded_entity_limit";t["InvalidContextualTuple"]="invalid_contextual_tuple";t["DuplicateContextualTuple"]="duplicate_contextual_tuple";t["InvalidAuthorizationModel"]="invalid_authorization_model";t["UnsupportedSchemaVersion"]="unsupported_schema_version"})(eAe||(xa.ErrorCode=eAe={}));var tAe;(function(t){t["NoInternalError"]="no_internal_error";t["InternalError"]="internal_error";t["Cancelled"]="cancelled";t["DeadlineExceeded"]="deadline_exceeded";t["AlreadyExists"]="already_exists";t["ResourceExhausted"]="resource_exhausted";t["FailedPrecondition"]="failed_precondition";t["Aborted"]="aborted";t["OutOfRange"]="out_of_range";t["Unavailable"]="unavailable";t["DataLoss"]="data_loss"})(tAe||(xa.InternalErrorCode=tAe={}));var rAe;(function(t){t["NoNotFoundError"]="no_not_found_error";t["UndefinedEndpoint"]="undefined_endpoint";t["StoreIdNotFound"]="store_id_not_found";t["Unimplemented"]="unimplemented"})(rAe||(xa.NotFoundErrorCode=rAe={}));var nAe;(function(t){t["NullValue"]="NULL_VALUE"})(nAe||(xa.NullValue=nAe={}));var iAe;(function(t){t["Write"]="TUPLE_OPERATION_WRITE";t["Delete"]="TUPLE_OPERATION_DELETE"})(iAe||(xa.TupleOperation=iAe={}));var sAe;(function(t){t["Unspecified"]="TYPE_NAME_UNSPECIFIED";t["Any"]="TYPE_NAME_ANY";t["Bool"]="TYPE_NAME_BOOL";t["String"]="TYPE_NAME_STRING";t["Int"]="TYPE_NAME_INT";t["Uint"]="TYPE_NAME_UINT";t["Double"]="TYPE_NAME_DOUBLE";t["Duration"]="TYPE_NAME_DURATION";t["Timestamp"]="TYPE_NAME_TIMESTAMP";t["Map"]="TYPE_NAME_MAP";t["List"]="TYPE_NAME_LIST";t["Ipaddress"]="TYPE_NAME_IPADDRESS"})(sAe||(xa.TypeName=sAe={}))});var lAe=_($i=>{"use strict";var _$t=$i&&$i.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var Ox=$i&&$i.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))_$t(e,t,r)};Object.defineProperty($i,"__esModule",{value:true});$i.CredentialsMethod=$i.Credentials=$i.GetDefaultRetryParams=$i.Configuration=void 0;Ox(GK(),$i);Ox(Z7e(),$i);Ox(aAe(),$i);var oAe=LK();Object.defineProperty($i,"Configuration",{enumerable:true,get:function(){return oAe.Configuration}});Object.defineProperty($i,"GetDefaultRetryParams",{enumerable:true,get:function(){return oAe.GetDefaultRetryParams}});var uAe=Cx();Object.defineProperty($i,"Credentials",{enumerable:true,get:function(){return uAe.Credentials}});Object.defineProperty($i,"CredentialsMethod",{enumerable:true,get:function(){return uAe.CredentialsMethod}});Ox($m(),$i)});var dAe=_(zy=>{"use strict";var E$t=zy&&zy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(zy,"__esModule",{value:true});zy.OpenFGAService=void 0;var pb=E$t(Oa());var cAe=lAe();var b$t=Ry();var ZK=class{static{o(this,"OpenFGAService")}logger;openFGAClient;baseUrl;apiHost;storeId;modelId;userSub;constructor(e,r){if(!pb.default.OPENFGA_SERVICE_URL){throw new Error("OPENFGA_SERVICE_URL is not set")}this.userSub=r&&r.userSub?r.userSub:e.getUserSub();this.baseUrl=pb.default.OPENFGA_SERVICE_URL;this.apiHost=pb.default.OPENFGA_SERVICE_URL.replace(/^(https:\/\/)/,"");this.storeId=pb.default.OPENFGA_STORE_ID;this.modelId=pb.default.OPENFGA_MODEL_ID;this.logger=e.log}async getOpenFgaClient(){if(!this.openFGAClient){const e=await(0,b$t.getServiceAccountIdToken)(this.baseUrl);this.openFGAClient=new cAe.OpenFgaClient({apiScheme:"https",apiHost:this.apiHost,storeId:this.storeId,authorizationModelId:this.modelId,credentials:{method:cAe.CredentialsMethod.ApiToken,config:{token:e}}})}return this.openFGAClient}async createAccountMember(e){try{const r=await this.getOpenFgaClient();await r.write({writes:[{user:`user:${this.userSub}`,relation:"admin",object:`account:${e}`}]})}catch(r){this.logger.warn(`RBAC failed to create account membership. Error: ${r.message}`)}}async getAccountMemberships(){const e=await this.getOpenFgaClient();const r=await e.listObjects({user:`user:${this.userSub}`,relation:"member",type:"account"});if(r){return r.objects.map(n=>n.replace(/^(account:)/,""))}return[]}async isAccountMember(e){try{const r=await this.getOpenFgaClient();const{allowed:n}=await r.check({user:`user:${this.userSub}`,relation:"member",object:`account:${e}`});if(!n){return false}return n}catch(r){this.logger.warn(`RBAC failed to check account membership. Error: ${r.message}`);return false}}async isZuploAdmin(){try{const e=await this.getOpenFgaClient();const{tuples:r}=await e.read({object:"role:zuplo-admin"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(e){this.logger.warn(`RBAC failed to check for zuplo admin. Error: ${e.message}`);return false}}async isDeployerServiceAccount(){try{const e=await this.getOpenFgaClient();const{tuples:r}=await e.read({object:"role:zuplo-deployer"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(e){this.logger.warn(`RBAC failed to check for zuplo deployer. Error: ${e.message}`);return false}}async createProjectAccountAssociation(e,r){try{const n=await this.getOpenFgaClient();await n.write({writes:[{user:`account:${e}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to create account-project association. Error: ${n.message}`)}}async deleteProjectAccountAssociation(e,r){try{const n=await this.getOpenFgaClient();await n.write({deletes:[{user:`account:${e}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to delete account-project association. Error: ${n.message}`)}}};zy.OpenFGAService=ZK});var hAe=_(Gy=>{"use strict";var fAe=Gy&&Gy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Gy,"__esModule",{value:true});Gy.TenantService=void 0;var w$t=fAe(ru());var pAe=fAe(Oa());var S$t=X6();var T$t=new w$t.default({max:500,maxAge:1e3*60*50});var eY=class extends S$t.ApiServiceClient{static{o(this,"TenantService")}constructor(e,r){if(!pAe.default.TENANT_API_URL){throw new Error("TENANT_API_URL is not set")}const n=r&&r.userSub?r.userSub:e.getUserSub();super(pAe.default.TENANT_API_URL,T$t,{userSub:n,logger:e.log,requestId:e.id})}};Gy.TenantService=eY});var gAe=_(Ky=>{"use strict";var mAe=Ky&&Ky.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Ky,"__esModule",{value:true});Ky.MeteringService=void 0;var A$t=mAe(ru());var tY=mAe(Oa());var x$t=X6();var C$t=new A$t.default({max:500,maxAge:1e3*60*50});var rY=class extends x$t.ApiServiceClient{static{o(this,"MeteringService")}constructor(e,r){if(!tY.default.METERING_SERVICE_URL){throw new Error("METERING_SERVICE_URL is not set")}const n=r&&r.userSub?r.userSub:e.getUserSub();super(tY.default.METERING_SERVICE_URL,C$t,{userSub:n,logger:e.log,requestId:e.id,targetAudience:tY.default.METERING_SERVICE_URL})}};Ky.MeteringService=rY});var yAe=_(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:true});Gl.validateHostname=Gl.kebabCase=Gl.snakeCase=Gl.sizeInBytes=void 0;function R$t(t){return new TextEncoder().encode(JSON.stringify(t)).length}o(R$t,"sizeInBytes");Gl.sizeInBytes=R$t;function O$t(t){if(!t||t===null){return""}return t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(e=>e.toLowerCase()).join("_")}o(O$t,"snakeCase");Gl.snakeCase=O$t;function N$t(t){if(!t||t===null){return""}const e=t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);if(e===null){return""}return e.map(r=>r.toLowerCase()).join("-")}o(N$t,"kebabCase");Gl.kebabCase=N$t;function I$t(t){try{const e=/^(?!https?:\/\/)([a-zA-Z0-9.-]*|(\*))*\.[a-zA-Z]+$/;if(t&&!e.test(t)){return false}return true}catch(e){}return false}o(I$t,"validateHostname");Gl.validateHostname=I$t});var EAe=_(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:true});G.Type=G.JsonType=G.JavaScriptTypeBuilder=G.JsonTypeBuilder=G.TypeBuilder=G.TypeBuilderError=G.TransformEncodeBuilder=G.TransformDecodeBuilder=G.TemplateLiteralDslParser=G.TemplateLiteralGenerator=G.TemplateLiteralGeneratorError=G.TemplateLiteralFinite=G.TemplateLiteralFiniteError=G.TemplateLiteralParser=G.TemplateLiteralParserError=G.TemplateLiteralResolver=G.TemplateLiteralPattern=G.TemplateLiteralPatternError=G.UnionResolver=G.KeyArrayResolver=G.KeyArrayResolverError=G.KeyResolver=G.ObjectMap=G.Intrinsic=G.IndexedAccessor=G.TypeClone=G.TypeExtends=G.TypeExtendsResult=G.TypeExtendsError=G.ExtendsUndefined=G.TypeGuard=G.TypeGuardUnknownTypeError=G.ValueGuard=G.FormatRegistry=G.TypeBoxError=G.TypeRegistry=G.PatternStringExact=G.PatternNumberExact=G.PatternBooleanExact=G.PatternString=G.PatternNumber=G.PatternBoolean=G.Kind=G.Hint=G.Optional=G.Readonly=G.Transform=void 0;G.Transform=Symbol.for("TypeBox.Transform");G.Readonly=Symbol.for("TypeBox.Readonly");G.Optional=Symbol.for("TypeBox.Optional");G.Hint=Symbol.for("TypeBox.Hint");G.Kind=Symbol.for("TypeBox.Kind");G.PatternBoolean="(true|false)";G.PatternNumber="(0|[1-9][0-9]*)";G.PatternString="(.*)";G.PatternBooleanExact=`^${G.PatternBoolean}$`;G.PatternNumberExact=`^${G.PatternNumber}$`;G.PatternStringExact=`^${G.PatternString}$`;var nY;(function(t){const e=new Map;function r(){return new Map(e)}o(r,"Entries");t.Entries=r;function n(){return e.clear()}o(n,"Clear");t.Clear=n;function i(l){return e.delete(l)}o(i,"Delete");t.Delete=i;function s(l){return e.has(l)}o(s,"Has");t.Has=s;function a(l,c){e.set(l,c)}o(a,"Set");t.Set=a;function u(l){return e.get(l)}o(u,"Get");t.Get=u})(nY||(G.TypeRegistry=nY={}));var Lu=class extends Error{static{o(this,"TypeBoxError")}constructor(e){super(e)}};G.TypeBoxError=Lu;var vAe;(function(t){const e=new Map;function r(){return new Map(e)}o(r,"Entries");t.Entries=r;function n(){return e.clear()}o(n,"Clear");t.Clear=n;function i(l){return e.delete(l)}o(i,"Delete");t.Delete=i;function s(l){return e.has(l)}o(s,"Has");t.Has=s;function a(l,c){e.set(l,c)}o(a,"Set");t.Set=a;function u(l){return e.get(l)}o(u,"Get");t.Get=u})(vAe||(G.FormatRegistry=vAe={}));var Be;(function(t){function e(c){return Array.isArray(c)}o(e,"IsArray");t.IsArray=e;function r(c){return typeof c==="bigint"}o(r,"IsBigInt");t.IsBigInt=r;function n(c){return typeof c==="boolean"}o(n,"IsBoolean");t.IsBoolean=n;function i(c){return c===null}o(i,"IsNull");t.IsNull=i;function s(c){return typeof c==="number"}o(s,"IsNumber");t.IsNumber=s;function a(c){return typeof c==="object"&&c!==null}o(a,"IsObject");t.IsObject=a;function u(c){return typeof c==="string"}o(u,"IsString");t.IsString=u;function l(c){return c===void 0}o(l,"IsUndefined");t.IsUndefined=l})(Be||(G.ValueGuard=Be={}));var iY=class extends Lu{static{o(this,"TypeGuardUnknownTypeError")}};G.TypeGuardUnknownTypeError=iY;var Y;(function(t){function e(x){try{new RegExp(x);return true}catch{return false}}o(e,"IsPattern");function r(x){if(!Be.IsString(x))return false;for(let ie=0;ie<x.length;ie++){const ce=x.charCodeAt(ie);if(ce>=7&&ce<=13||ce===27||ce===127){return false}}return true}o(r,"IsControlCharacterFree");function n(x){return a(x)||J(x)}o(n,"IsAdditionalProperties");function i(x){return Be.IsUndefined(x)||Be.IsBigInt(x)}o(i,"IsOptionalBigInt");function s(x){return Be.IsUndefined(x)||Be.IsNumber(x)}o(s,"IsOptionalNumber");function a(x){return Be.IsUndefined(x)||Be.IsBoolean(x)}o(a,"IsOptionalBoolean");function u(x){return Be.IsUndefined(x)||Be.IsString(x)}o(u,"IsOptionalString");function l(x){return Be.IsUndefined(x)||Be.IsString(x)&&r(x)&&e(x)}o(l,"IsOptionalPattern");function c(x){return Be.IsUndefined(x)||Be.IsString(x)&&r(x)}o(c,"IsOptionalFormat");function d(x){return Be.IsUndefined(x)||J(x)}o(d,"IsOptionalSchema");function p(x){return T(x,"Any")&&u(x.$id)}o(p,"TAny");t.TAny=p;function f(x){return T(x,"Array")&&x.type==="array"&&u(x.$id)&&J(x.items)&&s(x.minItems)&&s(x.maxItems)&&a(x.uniqueItems)&&d(x.contains)&&s(x.minContains)&&s(x.maxContains)}o(f,"TArray");t.TArray=f;function h(x){return T(x,"AsyncIterator")&&x.type==="AsyncIterator"&&u(x.$id)&&J(x.items)}o(h,"TAsyncIterator");t.TAsyncIterator=h;function m(x){return T(x,"BigInt")&&x.type==="bigint"&&u(x.$id)&&i(x.exclusiveMaximum)&&i(x.exclusiveMinimum)&&i(x.maximum)&&i(x.minimum)&&i(x.multipleOf)}o(m,"TBigInt");t.TBigInt=m;function g(x){return T(x,"Boolean")&&x.type==="boolean"&&u(x.$id)}o(g,"TBoolean");t.TBoolean=g;function y(x){return T(x,"Constructor")&&x.type==="constructor"&&u(x.$id)&&Be.IsArray(x.parameters)&&x.parameters.every(ie=>J(ie))&&J(x.returns)}o(y,"TConstructor");t.TConstructor=y;function v(x){return T(x,"Date")&&x.type==="Date"&&u(x.$id)&&s(x.exclusiveMaximumTimestamp)&&s(x.exclusiveMinimumTimestamp)&&s(x.maximumTimestamp)&&s(x.minimumTimestamp)&&s(x.multipleOfTimestamp)}o(v,"TDate");t.TDate=v;function w(x){return T(x,"Function")&&x.type==="function"&&u(x.$id)&&Be.IsArray(x.parameters)&&x.parameters.every(ie=>J(ie))&&J(x.returns)}o(w,"TFunction");t.TFunction=w;function E(x){return T(x,"Integer")&&x.type==="integer"&&u(x.$id)&&s(x.exclusiveMaximum)&&s(x.exclusiveMinimum)&&s(x.maximum)&&s(x.minimum)&&s(x.multipleOf)}o(E,"TInteger");t.TInteger=E;function b(x){return T(x,"Intersect")&&(Be.IsString(x.type)&&x.type!=="object"?false:true)&&Be.IsArray(x.allOf)&&x.allOf.every(ie=>J(ie)&&!Le(ie))&&u(x.type)&&(a(x.unevaluatedProperties)||d(x.unevaluatedProperties))&&u(x.$id)}o(b,"TIntersect");t.TIntersect=b;function S(x){return T(x,"Iterator")&&x.type==="Iterator"&&u(x.$id)&&J(x.items)}o(S,"TIterator");t.TIterator=S;function T(x,ie){return A(x)&&x[G.Kind]===ie}o(T,"TKindOf");t.TKindOf=T;function A(x){return Be.IsObject(x)&&G.Kind in x&&Be.IsString(x[G.Kind])}o(A,"TKind");t.TKind=A;function R(x){return B(x)&&Be.IsString(x.const)}o(R,"TLiteralString");t.TLiteralString=R;function O(x){return B(x)&&Be.IsNumber(x.const)}o(O,"TLiteralNumber");t.TLiteralNumber=O;function j(x){return B(x)&&Be.IsBoolean(x.const)}o(j,"TLiteralBoolean");t.TLiteralBoolean=j;function B(x){return T(x,"Literal")&&u(x.$id)&&(Be.IsBoolean(x.const)||Be.IsNumber(x.const)||Be.IsString(x.const))}o(B,"TLiteral");t.TLiteral=B;function U(x){return T(x,"Never")&&Be.IsObject(x.not)&&Object.getOwnPropertyNames(x.not).length===0}o(U,"TNever");t.TNever=U;function Q(x){return T(x,"Not")&&J(x.not)}o(Q,"TNot");t.TNot=Q;function oe(x){return T(x,"Null")&&x.type==="null"&&u(x.$id)}o(oe,"TNull");t.TNull=oe;function Te(x){return T(x,"Number")&&x.type==="number"&&u(x.$id)&&s(x.exclusiveMaximum)&&s(x.exclusiveMinimum)&&s(x.maximum)&&s(x.minimum)&&s(x.multipleOf)}o(Te,"TNumber");t.TNumber=Te;function le(x){return T(x,"Object")&&x.type==="object"&&u(x.$id)&&Be.IsObject(x.properties)&&n(x.additionalProperties)&&s(x.minProperties)&&s(x.maxProperties)&&Object.entries(x.properties).every(([ie,ce])=>r(ie)&&J(ce))}o(le,"TObject");t.TObject=le;function ue(x){return T(x,"Promise")&&x.type==="Promise"&&u(x.$id)&&J(x.item)}o(ue,"TPromise");t.TPromise=ue;function xe(x){return T(x,"Record")&&x.type==="object"&&u(x.$id)&&n(x.additionalProperties)&&Be.IsObject(x.patternProperties)&&(ie=>{const ce=Object.getOwnPropertyNames(ie.patternProperties);return ce.length===1&&e(ce[0])&&Be.IsObject(ie.patternProperties)&&J(ie.patternProperties[ce[0]])})(x)}o(xe,"TRecord");t.TRecord=xe;function we(x){return Be.IsObject(x)&&G.Hint in x&&x[G.Hint]==="Recursive"}o(we,"TRecursive");t.TRecursive=we;function Pe(x){return T(x,"Ref")&&u(x.$id)&&Be.IsString(x.$ref)}o(Pe,"TRef");t.TRef=Pe;function Ue(x){return T(x,"String")&&x.type==="string"&&u(x.$id)&&s(x.minLength)&&s(x.maxLength)&&l(x.pattern)&&c(x.format)}o(Ue,"TString");t.TString=Ue;function $e(x){return T(x,"Symbol")&&x.type==="symbol"&&u(x.$id)}o($e,"TSymbol");t.TSymbol=$e;function ge(x){return T(x,"TemplateLiteral")&&x.type==="string"&&Be.IsString(x.pattern)&&x.pattern[0]==="^"&&x.pattern[x.pattern.length-1]==="$"}o(ge,"TTemplateLiteral");t.TTemplateLiteral=ge;function Je(x){return T(x,"This")&&u(x.$id)&&Be.IsString(x.$ref)}o(Je,"TThis");t.TThis=Je;function Le(x){return Be.IsObject(x)&&G.Transform in x}o(Le,"TTransform");t.TTransform=Le;function Ie(x){return T(x,"Tuple")&&x.type==="array"&&u(x.$id)&&Be.IsNumber(x.minItems)&&Be.IsNumber(x.maxItems)&&x.minItems===x.maxItems&&(Be.IsUndefined(x.items)&&Be.IsUndefined(x.additionalItems)&&x.minItems===0||Be.IsArray(x.items)&&x.items.every(ie=>J(ie)))}o(Ie,"TTuple");t.TTuple=Ie;function Qe(x){return T(x,"Undefined")&&x.type==="undefined"&&u(x.$id)}o(Qe,"TUndefined");t.TUndefined=Qe;function qe(x){return C(x)&&x.anyOf.every(ie=>R(ie)||O(ie))}o(qe,"TUnionLiteral");t.TUnionLiteral=qe;function C(x){return T(x,"Union")&&u(x.$id)&&Be.IsObject(x)&&Be.IsArray(x.anyOf)&&x.anyOf.every(ie=>J(ie))}o(C,"TUnion");t.TUnion=C;function P(x){return T(x,"Uint8Array")&&x.type==="Uint8Array"&&u(x.$id)&&s(x.minByteLength)&&s(x.maxByteLength)}o(P,"TUint8Array");t.TUint8Array=P;function q(x){return T(x,"Unknown")&&u(x.$id)}o(q,"TUnknown");t.TUnknown=q;function z(x){return T(x,"Unsafe")}o(z,"TUnsafe");t.TUnsafe=z;function W(x){return T(x,"Void")&&x.type==="void"&&u(x.$id)}o(W,"TVoid");t.TVoid=W;function K(x){return Be.IsObject(x)&&x[G.Readonly]==="Readonly"}o(K,"TReadonly");t.TReadonly=K;function se(x){return Be.IsObject(x)&&x[G.Optional]==="Optional"}o(se,"TOptional");t.TOptional=se;function J(x){return Be.IsObject(x)&&(p(x)||f(x)||g(x)||m(x)||h(x)||y(x)||v(x)||w(x)||E(x)||b(x)||S(x)||B(x)||U(x)||Q(x)||oe(x)||Te(x)||le(x)||ue(x)||xe(x)||Pe(x)||Ue(x)||$e(x)||ge(x)||Je(x)||Ie(x)||Qe(x)||C(x)||P(x)||q(x)||z(x)||W(x)||A(x)&&nY.Has(x[G.Kind]))}o(J,"TSchema");t.TSchema=J})(Y||(G.TypeGuard=Y={}));var _Ae;(function(t){function e(r){return r[G.Kind]==="Intersect"?r.allOf.every(n=>e(n)):r[G.Kind]==="Union"?r.anyOf.some(n=>e(n)):r[G.Kind]==="Undefined"?true:r[G.Kind]==="Not"?!e(r.not):false}o(e,"Check");t.Check=e})(_Ae||(G.ExtendsUndefined=_Ae={}));var Nx=class extends Lu{static{o(this,"TypeExtendsError")}};G.TypeExtendsError=Nx;var Ee;(function(t){t[t["Union"]=0]="Union";t[t["True"]=1]="True";t[t["False"]=2]="False"})(Ee||(G.TypeExtendsResult=Ee={}));var qm;(function(t){function e(F){return F===Ee.False?F:Ee.True}o(e,"IntoBooleanResult");function r(F){throw new Nx(F)}o(r,"Throw");function n(F){return Y.TNever(F)||Y.TIntersect(F)||Y.TUnion(F)||Y.TUnknown(F)||Y.TAny(F)}o(n,"IsStructuralRight");function i(F,$){return Y.TNever($)?T(F,$):Y.TIntersect($)?w(F,$):Y.TUnion($)?Xe(F,$):Y.TUnknown($)?tr(F,$):Y.TAny($)?s(F,$):r("StructuralRight")}o(i,"StructuralRight");function s(F,$){return Ee.True}o(s,"TAnyRight");function a(F,$){return Y.TIntersect($)?w(F,$):Y.TUnion($)&&$.anyOf.some(Ye=>Y.TAny(Ye)||Y.TUnknown(Ye))?Ee.True:Y.TUnion($)?Ee.Union:Y.TUnknown($)?Ee.True:Y.TAny($)?Ee.True:Ee.Union}o(a,"TAny");function u(F,$){return Y.TUnknown(F)?Ee.False:Y.TAny(F)?Ee.Union:Y.TNever(F)?Ee.True:Ee.False}o(u,"TArrayRight");function l(F,$){return Y.TObject($)&&ge($)?Ee.True:n($)?i(F,$):!Y.TArray($)?Ee.False:e(ft(F.items,$.items))}o(l,"TArray");function c(F,$){return n($)?i(F,$):!Y.TAsyncIterator($)?Ee.False:e(ft(F.items,$.items))}o(c,"TAsyncIterator");function d(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TBigInt($)?Ee.True:Ee.False}o(d,"TBigInt");function p(F,$){return Y.TLiteral(F)&&Be.IsBoolean(F.const)?Ee.True:Y.TBoolean(F)?Ee.True:Ee.False}o(p,"TBooleanRight");function f(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TBoolean($)?Ee.True:Ee.False}o(f,"TBoolean");function h(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):!Y.TConstructor($)?Ee.False:F.parameters.length>$.parameters.length?Ee.False:!F.parameters.every((Ye,cr)=>e(ft($.parameters[cr],Ye))===Ee.True)?Ee.False:e(ft(F.returns,$.returns))}o(h,"TConstructor");function m(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TDate($)?Ee.True:Ee.False}o(m,"TDate");function g(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):!Y.TFunction($)?Ee.False:F.parameters.length>$.parameters.length?Ee.False:!F.parameters.every((Ye,cr)=>e(ft($.parameters[cr],Ye))===Ee.True)?Ee.False:e(ft(F.returns,$.returns))}o(g,"TFunction");function y(F,$){return Y.TLiteral(F)&&Be.IsNumber(F.const)?Ee.True:Y.TNumber(F)||Y.TInteger(F)?Ee.True:Ee.False}o(y,"TIntegerRight");function v(F,$){return Y.TInteger($)||Y.TNumber($)?Ee.True:n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Ee.False}o(v,"TInteger");function w(F,$){return $.allOf.every(Ye=>ft(F,Ye)===Ee.True)?Ee.True:Ee.False}o(w,"TIntersectRight");function E(F,$){return F.allOf.some(Ye=>ft(Ye,$)===Ee.True)?Ee.True:Ee.False}o(E,"TIntersect");function b(F,$){return n($)?i(F,$):!Y.TIterator($)?Ee.False:e(ft(F.items,$.items))}o(b,"TIterator");function S(F,$){return Y.TLiteral($)&&$.const===F.const?Ee.True:n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TString($)?W(F,$):Y.TNumber($)?B(F,$):Y.TInteger($)?y(F,$):Y.TBoolean($)?p(F,$):Ee.False}o(S,"TLiteral");function T(F,$){return Ee.False}o(T,"TNeverRight");function A(F,$){return Ee.True}o(A,"TNever");function R(F){let[$,Ye]=[F,0];while(true){if(!Y.TNot($))break;$=$.not;Ye+=1}return Ye%2===0?$:G.Type.Unknown()}o(R,"UnwrapTNot");function O(F,$){return Y.TNot(F)?ft(R(F),$):Y.TNot($)?ft(F,R($)):r("Invalid fallthrough for Not")}o(O,"TNot");function j(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TNull($)?Ee.True:Ee.False}o(j,"TNull");function B(F,$){return Y.TLiteralNumber(F)?Ee.True:Y.TNumber(F)||Y.TInteger(F)?Ee.True:Ee.False}o(B,"TNumberRight");function U(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TInteger($)||Y.TNumber($)?Ee.True:Ee.False}o(U,"TNumber");function Q(F,$){return Object.getOwnPropertyNames(F.properties).length===$}o(Q,"IsObjectPropertyCount");function oe(F){return ge(F)}o(oe,"IsObjectStringLike");function Te(F){return Q(F,0)||Q(F,1)&&"description"in F.properties&&Y.TUnion(F.properties.description)&&F.properties.description.anyOf.length===2&&(Y.TString(F.properties.description.anyOf[0])&&Y.TUndefined(F.properties.description.anyOf[1])||Y.TString(F.properties.description.anyOf[1])&&Y.TUndefined(F.properties.description.anyOf[0]))}o(Te,"IsObjectSymbolLike");function le(F){return Q(F,0)}o(le,"IsObjectNumberLike");function ue(F){return Q(F,0)}o(ue,"IsObjectBooleanLike");function xe(F){return Q(F,0)}o(xe,"IsObjectBigIntLike");function we(F){return Q(F,0)}o(we,"IsObjectDateLike");function Pe(F){return ge(F)}o(Pe,"IsObjectUint8ArrayLike");function Ue(F){const $=G.Type.Number();return Q(F,0)||Q(F,1)&&"length"in F.properties&&e(ft(F.properties["length"],$))===Ee.True}o(Ue,"IsObjectFunctionLike");function $e(F){return Q(F,0)}o($e,"IsObjectConstructorLike");function ge(F){const $=G.Type.Number();return Q(F,0)||Q(F,1)&&"length"in F.properties&&e(ft(F.properties["length"],$))===Ee.True}o(ge,"IsObjectArrayLike");function Je(F){const $=G.Type.Function([G.Type.Any()],G.Type.Any());return Q(F,0)||Q(F,1)&&"then"in F.properties&&e(ft(F.properties["then"],$))===Ee.True}o(Je,"IsObjectPromiseLike");function Le(F,$){return ft(F,$)===Ee.False?Ee.False:Y.TOptional(F)&&!Y.TOptional($)?Ee.False:Ee.True}o(Le,"Property");function Ie(F,$){return Y.TUnknown(F)?Ee.False:Y.TAny(F)?Ee.Union:Y.TNever(F)||Y.TLiteralString(F)&&oe($)||Y.TLiteralNumber(F)&&le($)||Y.TLiteralBoolean(F)&&ue($)||Y.TSymbol(F)&&Te($)||Y.TBigInt(F)&&xe($)||Y.TString(F)&&oe($)||Y.TSymbol(F)&&Te($)||Y.TNumber(F)&&le($)||Y.TInteger(F)&&le($)||Y.TBoolean(F)&&ue($)||Y.TUint8Array(F)&&Pe($)||Y.TDate(F)&&we($)||Y.TConstructor(F)&&$e($)||Y.TFunction(F)&&Ue($)?Ee.True:Y.TRecord(F)&&Y.TString(C(F))?(()=>{return $[G.Hint]==="Record"?Ee.True:Ee.False})():Y.TRecord(F)&&Y.TNumber(C(F))?(()=>{return Q($,0)?Ee.True:Ee.False})():Ee.False}o(Ie,"TObjectRight");function Qe(F,$){return n($)?i(F,$):Y.TRecord($)?q(F,$):!Y.TObject($)?Ee.False:(()=>{for(const Ye of Object.getOwnPropertyNames($.properties)){if(!(Ye in F.properties))return Ee.False;if(Le(F.properties[Ye],$.properties[Ye])===Ee.False){return Ee.False}}return Ee.True})()}o(Qe,"TObject");function qe(F,$){return n($)?i(F,$):Y.TObject($)&&Je($)?Ee.True:!Y.TPromise($)?Ee.False:e(ft(F.item,$.item))}o(qe,"TPromise");function C(F){return G.PatternNumberExact in F.patternProperties?G.Type.Number():G.PatternStringExact in F.patternProperties?G.Type.String():r("Unknown record key pattern")}o(C,"RecordKey");function P(F){return G.PatternNumberExact in F.patternProperties?F.patternProperties[G.PatternNumberExact]:G.PatternStringExact in F.patternProperties?F.patternProperties[G.PatternStringExact]:r("Unable to get record value schema")}o(P,"RecordValue");function q(F,$){const[Ye,cr]=[C($),P($)];return Y.TLiteralString(F)&&Y.TNumber(Ye)&&e(ft(F,cr))===Ee.True?Ee.True:Y.TUint8Array(F)&&Y.TNumber(Ye)?ft(F,cr):Y.TString(F)&&Y.TNumber(Ye)?ft(F,cr):Y.TArray(F)&&Y.TNumber(Ye)?ft(F,cr):Y.TObject(F)?(()=>{for(const vi of Object.getOwnPropertyNames(F.properties)){if(Le(cr,F.properties[vi])===Ee.False){return Ee.False}}return Ee.True})():Ee.False}o(q,"TRecordRight");function z(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):!Y.TRecord($)?Ee.False:ft(P(F),P($))}o(z,"TRecord");function W(F,$){return Y.TLiteral(F)&&Be.IsString(F.const)?Ee.True:Y.TString(F)?Ee.True:Ee.False}o(W,"TStringRight");function K(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TString($)?Ee.True:Ee.False}o(K,"TString");function se(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TSymbol($)?Ee.True:Ee.False}o(se,"TSymbol");function J(F,$){return Y.TTemplateLiteral(F)?ft(nd.Resolve(F),$):Y.TTemplateLiteral($)?ft(F,nd.Resolve($)):r("Invalid fallthrough for TemplateLiteral")}o(J,"TTemplateLiteral");function x(F,$){return Y.TArray($)&&F.items!==void 0&&F.items.every(Ye=>ft(Ye,$.items)===Ee.True)}o(x,"IsArrayOfTuple");function ie(F,$){return Y.TNever(F)?Ee.True:Y.TUnknown(F)?Ee.False:Y.TAny(F)?Ee.Union:Ee.False}o(ie,"TTupleRight");function ce(F,$){return n($)?i(F,$):Y.TObject($)&&ge($)?Ee.True:Y.TArray($)&&x(F,$)?Ee.True:!Y.TTuple($)?Ee.False:Be.IsUndefined(F.items)&&!Be.IsUndefined($.items)||!Be.IsUndefined(F.items)&&Be.IsUndefined($.items)?Ee.False:Be.IsUndefined(F.items)&&!Be.IsUndefined($.items)?Ee.True:F.items.every((Ye,cr)=>ft(Ye,$.items[cr])===Ee.True)?Ee.True:Ee.False}o(ce,"TTuple");function ve(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TUint8Array($)?Ee.True:Ee.False}o(ve,"TUint8Array");function je(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TVoid($)?Et(F,$):Y.TUndefined($)?Ee.True:Ee.False}o(je,"TUndefined");function Xe(F,$){return $.anyOf.some(Ye=>ft(F,Ye)===Ee.True)?Ee.True:Ee.False}o(Xe,"TUnionRight");function _t(F,$){return F.anyOf.every(Ye=>ft(Ye,$)===Ee.True)?Ee.True:Ee.False}o(_t,"TUnion");function tr(F,$){return Ee.True}o(tr,"TUnknownRight");function lr(F,$){return Y.TNever($)?T(F,$):Y.TIntersect($)?w(F,$):Y.TUnion($)?Xe(F,$):Y.TAny($)?s(F,$):Y.TString($)?W(F,$):Y.TNumber($)?B(F,$):Y.TInteger($)?y(F,$):Y.TBoolean($)?p(F,$):Y.TArray($)?u(F,$):Y.TTuple($)?ie(F,$):Y.TObject($)?Ie(F,$):Y.TUnknown($)?Ee.True:Ee.False}o(lr,"TUnknown");function Et(F,$){return Y.TUndefined(F)?Ee.True:Y.TUndefined(F)?Ee.True:Ee.False}o(Et,"VoidRight");function xt(F,$){return Y.TIntersect($)?w(F,$):Y.TUnion($)?Xe(F,$):Y.TUnknown($)?tr(F,$):Y.TAny($)?s(F,$):Y.TObject($)?Ie(F,$):Y.TVoid($)?Ee.True:Ee.False}o(xt,"TVoid");function ft(F,$){return Y.TTemplateLiteral(F)||Y.TTemplateLiteral($)?J(F,$):Y.TNot(F)||Y.TNot($)?O(F,$):Y.TAny(F)?a(F,$):Y.TArray(F)?l(F,$):Y.TBigInt(F)?d(F,$):Y.TBoolean(F)?f(F,$):Y.TAsyncIterator(F)?c(F,$):Y.TConstructor(F)?h(F,$):Y.TDate(F)?m(F,$):Y.TFunction(F)?g(F,$):Y.TInteger(F)?v(F,$):Y.TIntersect(F)?E(F,$):Y.TIterator(F)?b(F,$):Y.TLiteral(F)?S(F,$):Y.TNever(F)?A(F,$):Y.TNull(F)?j(F,$):Y.TNumber(F)?U(F,$):Y.TObject(F)?Qe(F,$):Y.TRecord(F)?z(F,$):Y.TString(F)?K(F,$):Y.TSymbol(F)?se(F,$):Y.TTuple(F)?ce(F,$):Y.TPromise(F)?qe(F,$):Y.TUint8Array(F)?ve(F,$):Y.TUndefined(F)?je(F,$):Y.TUnion(F)?_t(F,$):Y.TUnknown(F)?lr(F,$):Y.TVoid(F)?xt(F,$):r(`Unknown left type operand '${F[G.Kind]}'`)}o(ft,"Visit");function en(F,$){return ft(F,$)}o(en,"Extends");t.Extends=en})(qm||(G.TypeExtends=qm={}));var ct;(function(t){function e(a){const u=Object.getOwnPropertyNames(a).reduce((c,d)=>({...c,[d]:n(a[d])}),{});const l=Object.getOwnPropertySymbols(a).reduce((c,d)=>({...c,[d]:n(a[d])}),{});return{...u,...l}}o(e,"ObjectType");function r(a){return a.map(u=>n(u))}o(r,"ArrayType");function n(a){return Be.IsArray(a)?r(a):Be.IsObject(a)?e(a):a}o(n,"Visit");function i(a){return a.map(u=>s(u))}o(i,"Rest");t.Rest=i;function s(a,u={}){return{...n(a),...u}}o(s,"Type");t.Type=s})(ct||(G.TypeClone=ct={}));var sY;(function(t){function e(h){return h.map(m=>{const{[G.Optional]:g,...y}=ct.Type(m);return y})}o(e,"OptionalUnwrap");function r(h){return h.every(m=>Y.TOptional(m))}o(r,"IsIntersectOptional");function n(h){return h.some(m=>Y.TOptional(m))}o(n,"IsUnionOptional");function i(h){return r(h.allOf)?G.Type.Optional(G.Type.Intersect(e(h.allOf))):h}o(i,"ResolveIntersect");function s(h){return n(h.anyOf)?G.Type.Optional(G.Type.Union(e(h.anyOf))):h}o(s,"ResolveUnion");function a(h){return h[G.Kind]==="Intersect"?i(h):h[G.Kind]==="Union"?s(h):h}o(a,"ResolveOptional");function u(h,m){const g=h.allOf.reduce((y,v)=>{const w=p(v,m);return w[G.Kind]==="Never"?y:[...y,w]},[]);return a(G.Type.Intersect(g))}o(u,"TIntersect");function l(h,m){const g=h.anyOf.map(y=>p(y,m));return a(G.Type.Union(g))}o(l,"TUnion");function c(h,m){const g=h.properties[m];return Be.IsUndefined(g)?G.Type.Never():G.Type.Union([g])}o(c,"TObject");function d(h,m){const g=h.items;if(Be.IsUndefined(g))return G.Type.Never();const y=g[m];if(Be.IsUndefined(y))return G.Type.Never();return y}o(d,"TTuple");function p(h,m){return h[G.Kind]==="Intersect"?u(h,m):h[G.Kind]==="Union"?l(h,m):h[G.Kind]==="Object"?c(h,m):h[G.Kind]==="Tuple"?d(h,m):G.Type.Never()}o(p,"Visit");function f(h,m,g={}){const y=m.map(v=>p(h,v.toString()));return a(G.Type.Union(y,g))}o(f,"Resolve");t.Resolve=f})(sY||(G.IndexedAccessor=sY={}));var Yy;(function(t){function e(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toLowerCase()}${f}`}o(e,"Uncapitalize");function r(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toUpperCase()}${f}`}o(r,"Capitalize");function n(d){return d.toUpperCase()}o(n,"Uppercase");function i(d){return d.toLowerCase()}o(i,"Lowercase");function s(d,p){const f=Jy.ParseExact(d.pattern);const h=Qy.Check(f);if(!h)return{...d,pattern:a(d.pattern,p)};const m=[...Xy.Generate(f)];const g=m.map(w=>G.Type.Literal(w));const y=u(g,p);const v=G.Type.Union(y);return G.Type.TemplateLiteral([v])}o(s,"IntrinsicTemplateLiteral");function a(d,p){return typeof d==="string"?p==="Uncapitalize"?e(d):p==="Capitalize"?r(d):p==="Uppercase"?n(d):p==="Lowercase"?i(d):d:d.toString()}o(a,"IntrinsicLiteral");function u(d,p){if(d.length===0)return[];const[f,...h]=d;return[c(f,p),...u(h,p)]}o(u,"IntrinsicRest");function l(d,p){return Y.TTemplateLiteral(d)?s(d,p):Y.TUnion(d)?G.Type.Union(u(d.anyOf,p)):Y.TLiteral(d)?G.Type.Literal(a(d.const,p)):d}o(l,"Visit");function c(d,p){return l(d,p)}o(c,"Map");t.Map=c})(Yy||(G.Intrinsic=Yy={}));var Wy;(function(t){function e(a,u){return G.Type.Intersect(a.allOf.map(l=>i(l,u)),{...a})}o(e,"TIntersect");function r(a,u){return G.Type.Union(a.anyOf.map(l=>i(l,u)),{...a})}o(r,"TUnion");function n(a,u){return u(a)}o(n,"TObject");function i(a,u){return a[G.Kind]==="Intersect"?e(a,u):a[G.Kind]==="Union"?r(a,u):a[G.Kind]==="Object"?n(a,u):a}o(i,"Visit");function s(a,u,l){return{...i(ct.Type(a),u),...l}}o(s,"Map");t.Map=s})(Wy||(G.ObjectMap=Wy={}));var Ix;(function(t){function e(c){return c[0]==="^"&&c[c.length-1]==="$"?c.slice(1,c.length-1):c}o(e,"UnwrapPattern");function r(c,d){return c.allOf.reduce((p,f)=>[...p,...a(f,d)],[])}o(r,"TIntersect");function n(c,d){const p=c.anyOf.map(f=>a(f,d));return[...p.reduce((f,h)=>h.map(m=>p.every(g=>g.includes(m))?f.add(m):f)[0],new Set)]}o(n,"TUnion");function i(c,d){return Object.getOwnPropertyNames(c.properties)}o(i,"TObject");function s(c,d){return d.includePatterns?Object.getOwnPropertyNames(c.patternProperties):[]}o(s,"TRecord");function a(c,d){return Y.TIntersect(c)?r(c,d):Y.TUnion(c)?n(c,d):Y.TObject(c)?i(c,d):Y.TRecord(c)?s(c,d):[]}o(a,"Visit");function u(c,d){return[...new Set(a(c,d))]}o(u,"ResolveKeys");t.ResolveKeys=u;function l(c){const d=u(c,{includePatterns:true});const p=d.map(f=>`(${e(f)})`);return`^(${p.join("|")})$`}o(l,"ResolvePattern");t.ResolvePattern=l})(Ix||(G.KeyResolver=Ix={}));var Px=class extends Lu{static{o(this,"KeyArrayResolverError")}};G.KeyArrayResolverError=Px;var fb;(function(t){function e(r){return Array.isArray(r)?r:Y.TUnionLiteral(r)?r.anyOf.map(n=>n.const.toString()):Y.TLiteral(r)?[r.const]:Y.TTemplateLiteral(r)?(()=>{const n=Jy.ParseExact(r.pattern);if(!Qy.Check(n))throw new Px("Cannot resolve keys from infinite template expression");return[...Xy.Generate(n)]})():[]}o(e,"Resolve");t.Resolve=e})(fb||(G.KeyArrayResolver=fb={}));var aY;(function(t){function*e(n){for(const i of n.anyOf){if(i[G.Kind]==="Union"){yield*e(i)}else{yield i}}}o(e,"TUnion");function r(n){return G.Type.Union([...e(n)],{...n})}o(r,"Resolve");t.Resolve=r})(aY||(G.UnionResolver=aY={}));var Dx=class extends Lu{static{o(this,"TemplateLiteralPatternError")}};G.TemplateLiteralPatternError=Dx;var kx;(function(t){function e(s){throw new Dx(s)}o(e,"Throw");function r(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(r,"Escape");function n(s,a){return Y.TTemplateLiteral(s)?s.pattern.slice(1,s.pattern.length-1):Y.TUnion(s)?`(${s.anyOf.map(u=>n(u,a)).join("|")})`:Y.TNumber(s)?`${a}${G.PatternNumber}`:Y.TInteger(s)?`${a}${G.PatternNumber}`:Y.TBigInt(s)?`${a}${G.PatternNumber}`:Y.TString(s)?`${a}${G.PatternString}`:Y.TLiteral(s)?`${a}${r(s.const.toString())}`:Y.TBoolean(s)?`${a}${G.PatternBoolean}`:e(`Unexpected Kind '${s[G.Kind]}'`)}o(n,"Visit");function i(s){return`^${s.map(a=>n(a,"")).join("")}$`}o(i,"Create");t.Create=i})(kx||(G.TemplateLiteralPattern=kx={}));var nd;(function(t){function e(r){const n=Jy.ParseExact(r.pattern);if(!Qy.Check(n))return G.Type.String();const i=[...Xy.Generate(n)].map(s=>G.Type.Literal(s));return G.Type.Union(i)}o(e,"Resolve");t.Resolve=e})(nd||(G.TemplateLiteralResolver=nd={}));var hb=class extends Lu{static{o(this,"TemplateLiteralParserError")}};G.TemplateLiteralParserError=hb;var Jy;(function(t){function e(h,m,g){return h[m]===g&&h.charCodeAt(m-1)!==92}o(e,"IsNonEscaped");function r(h,m){return e(h,m,"(")}o(r,"IsOpenParen");function n(h,m){return e(h,m,")")}o(n,"IsCloseParen");function i(h,m){return e(h,m,"|")}o(i,"IsSeparator");function s(h){if(!(r(h,0)&&n(h,h.length-1)))return false;let m=0;for(let g=0;g<h.length;g++){if(r(h,g))m+=1;if(n(h,g))m-=1;if(m===0&&g!==h.length-1)return false}return true}o(s,"IsGroup");function a(h){return h.slice(1,h.length-1)}o(a,"InGroup");function u(h){let m=0;for(let g=0;g<h.length;g++){if(r(h,g))m+=1;if(n(h,g))m-=1;if(i(h,g)&&m===0)return true}return false}o(u,"IsPrecedenceOr");function l(h){for(let m=0;m<h.length;m++){if(r(h,m))return true}return false}o(l,"IsPrecedenceAnd");function c(h){let[m,g]=[0,0];const y=[];for(let w=0;w<h.length;w++){if(r(h,w))m+=1;if(n(h,w))m-=1;if(i(h,w)&&m===0){const E=h.slice(g,w);if(E.length>0)y.push(p(E));g=w+1}}const v=h.slice(g);if(v.length>0)y.push(p(v));if(y.length===0)return{type:"const",const:""};if(y.length===1)return y[0];return{type:"or",expr:y}}o(c,"Or");function d(h){function m(v,w){if(!r(v,w))throw new hb(`TemplateLiteralParser: Index must point to open parens`);let E=0;for(let b=w;b<v.length;b++){if(r(v,b))E+=1;if(n(v,b))E-=1;if(E===0)return[w,b]}throw new hb(`TemplateLiteralParser: Unclosed group parens in expression`)}o(m,"Group");function g(v,w){for(let E=w;E<v.length;E++){if(r(v,E))return[w,E]}return[w,v.length]}o(g,"Range");const y=[];for(let v=0;v<h.length;v++){if(r(h,v)){const[w,E]=m(h,v);const b=h.slice(w,E+1);y.push(p(b));v=E}else{const[w,E]=g(h,v);const b=h.slice(w,E);if(b.length>0)y.push(p(b));v=E-1}}return y.length===0?{type:"const",const:""}:y.length===1?y[0]:{type:"and",expr:y}}o(d,"And");function p(h){return s(h)?p(a(h)):u(h)?c(h):l(h)?d(h):{type:"const",const:h}}o(p,"Parse");t.Parse=p;function f(h){return p(h.slice(1,h.length-1))}o(f,"ParseExact");t.ParseExact=f})(Jy||(G.TemplateLiteralParser=Jy={}));var $x=class extends Lu{static{o(this,"TemplateLiteralFiniteError")}};G.TemplateLiteralFiniteError=$x;var Qy;(function(t){function e(a){throw new $x(a)}o(e,"Throw");function r(a){return a.type==="or"&&a.expr.length===2&&a.expr[0].type==="const"&&a.expr[0].const==="0"&&a.expr[1].type==="const"&&a.expr[1].const==="[1-9][0-9]*"}o(r,"IsNumber");function n(a){return a.type==="or"&&a.expr.length===2&&a.expr[0].type==="const"&&a.expr[0].const==="true"&&a.expr[1].type==="const"&&a.expr[1].const==="false"}o(n,"IsBoolean");function i(a){return a.type==="const"&&a.const===".*"}o(i,"IsString");function s(a){return n(a)?true:r(a)||i(a)?false:a.type==="and"?a.expr.every(u=>s(u)):a.type==="or"?a.expr.every(u=>s(u)):a.type==="const"?true:e(`Unknown expression type`)}o(s,"Check");t.Check=s})(Qy||(G.TemplateLiteralFinite=Qy={}));var Lx=class extends Lu{static{o(this,"TemplateLiteralGeneratorError")}};G.TemplateLiteralGeneratorError=Lx;var Xy;(function(t){function*e(a){if(a.length===1)return yield*a[0];for(const u of a[0]){for(const l of e(a.slice(1))){yield`${u}${l}`}}}o(e,"Reduce");function*r(a){return yield*e(a.expr.map(u=>[...s(u)]))}o(r,"And");function*n(a){for(const u of a.expr)yield*s(u)}o(n,"Or");function*i(a){return yield a.const}o(i,"Const");function*s(a){return a.type==="and"?yield*r(a):a.type==="or"?yield*n(a):a.type==="const"?yield*i(a):(()=>{throw new Lx("Unknown expression")})()}o(s,"Generate");t.Generate=s})(Xy||(G.TemplateLiteralGenerator=Xy={}));var oY;(function(t){function*e(s){const a=s.trim().replace(/"|'/g,"");return a==="boolean"?yield G.Type.Boolean():a==="number"?yield G.Type.Number():a==="bigint"?yield G.Type.BigInt():a==="string"?yield G.Type.String():yield(()=>{const u=a.split("|").map(l=>G.Type.Literal(l.trim()));return u.length===0?G.Type.Never():u.length===1?u[0]:G.Type.Union(u)})()}o(e,"ParseUnion");function*r(s){if(s[1]!=="{"){const a=G.Type.Literal("$");const u=n(s.slice(1));return yield*[a,...u]}for(let a=2;a<s.length;a++){if(s[a]==="}"){const u=e(s.slice(2,a));const l=n(s.slice(a+1));return yield*[...u,...l]}}yield G.Type.Literal(s)}o(r,"ParseTerminal");function*n(s){for(let a=0;a<s.length;a++){if(s[a]==="$"){const u=G.Type.Literal(s.slice(0,a));const l=r(s.slice(a));return yield*[u,...l]}}yield G.Type.Literal(s)}o(n,"ParseLiteral");function i(s){return[...n(s)]}o(i,"Parse");t.Parse=i})(oY||(G.TemplateLiteralDslParser=oY={}));var qx=class{static{o(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new jx(this.schema,e)}};G.TransformDecodeBuilder=qx;var jx=class{static{o(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e;this.decode=r}Encode(e){const r=ct.Type(this.schema);return Y.TTransform(r)?(()=>{const n=o(a=>r[G.Transform].Encode(e(a)),"Encode");const i=o(a=>this.decode(r[G.Transform].Decode(a)),"Decode");const s={Encode:n,Decode:i};return{...r,[G.Transform]:s}})():(()=>{const n={Decode:this.decode,Encode:e};return{...r,[G.Transform]:n}})()}};G.TransformEncodeBuilder=jx;var P$t=0;var Ux=class extends Lu{static{o(this,"TypeBuilderError")}};G.TypeBuilderError=Ux;var Fx=class{static{o(this,"TypeBuilder")}Create(e){return e}Throw(e){throw new Ux(e)}Discard(e,r){const{[r]:n,...i}=e;return i}Strict(e){return JSON.parse(JSON.stringify(e))}};G.TypeBuilder=Fx;var mb=class extends Fx{static{o(this,"JsonTypeBuilder")}ReadonlyOptional(e){return this.Readonly(this.Optional(e))}Readonly(e){return{...ct.Type(e),[G.Readonly]:"Readonly"}}Optional(e){return{...ct.Type(e),[G.Optional]:"Optional"}}Any(e={}){return this.Create({...e,[G.Kind]:"Any"})}Array(e,r={}){return this.Create({...r,[G.Kind]:"Array",type:"array",items:ct.Type(e)})}Boolean(e={}){return this.Create({...e,[G.Kind]:"Boolean",type:"boolean"})}Capitalize(e,r={}){return{...Yy.Map(ct.Type(e),"Capitalize"),...r}}Composite(e,r){const n=G.Type.Intersect(e,{});const i=Ix.ResolveKeys(n,{includePatterns:false});const s=i.reduce((a,u)=>({...a,[u]:G.Type.Index(n,[u])}),{});return G.Type.Object(s,r)}Enum(e,r={}){const n=Object.getOwnPropertyNames(e).filter(s=>isNaN(s)).map(s=>e[s]);const i=n.map(s=>Be.IsString(s)?{[G.Kind]:"Literal",type:"string",const:s}:{[G.Kind]:"Literal",type:"number",const:s});return this.Create({...r,[G.Kind]:"Union",anyOf:i})}Extends(e,r,n,i,s={}){switch(qm.Extends(e,r)){case Ee.Union:return this.Union([ct.Type(n,s),ct.Type(i,s)]);case Ee.True:return ct.Type(n,s);case Ee.False:return ct.Type(i,s)}}Exclude(e,r,n={}){return Y.TTemplateLiteral(e)?this.Exclude(nd.Resolve(e),r,n):Y.TTemplateLiteral(r)?this.Exclude(e,nd.Resolve(r),n):Y.TUnion(e)?(()=>{const i=e.anyOf.filter(s=>qm.Extends(s,r)===Ee.False);return i.length===1?ct.Type(i[0],n):this.Union(i,n)})():qm.Extends(e,r)!==Ee.False?this.Never(n):ct.Type(e,n)}Extract(e,r,n={}){return Y.TTemplateLiteral(e)?this.Extract(nd.Resolve(e),r,n):Y.TTemplateLiteral(r)?this.Extract(e,nd.Resolve(r),n):Y.TUnion(e)?(()=>{const i=e.anyOf.filter(s=>qm.Extends(s,r)!==Ee.False);return i.length===1?ct.Type(i[0],n):this.Union(i,n)})():qm.Extends(e,r)!==Ee.False?ct.Type(e,n):this.Never(n)}Index(e,r,n={}){return Y.TArray(e)&&Y.TNumber(r)?(()=>{return ct.Type(e.items,n)})():Y.TTuple(e)&&Y.TNumber(r)?(()=>{const i=Be.IsUndefined(e.items)?[]:e.items;const s=i.map(a=>ct.Type(a));return this.Union(s,n)})():(()=>{const i=fb.Resolve(r);const s=ct.Type(e);return sY.Resolve(s,i,n)})()}Integer(e={}){return this.Create({...e,[G.Kind]:"Integer",type:"integer"})}Intersect(e,r={}){if(e.length===0)return G.Type.Never();if(e.length===1)return ct.Type(e[0],r);if(e.some(a=>Y.TTransform(a)))this.Throw("Cannot intersect transform types");const n=e.every(a=>Y.TObject(a));const i=ct.Rest(e);const s=Y.TSchema(r.unevaluatedProperties)?{unevaluatedProperties:ct.Type(r.unevaluatedProperties)}:{};return r.unevaluatedProperties===false||Y.TSchema(r.unevaluatedProperties)||n?this.Create({...r,...s,[G.Kind]:"Intersect",type:"object",allOf:i}):this.Create({...r,...s,[G.Kind]:"Intersect",allOf:i})}KeyOf(e,r={}){return Y.TRecord(e)?(()=>{const n=Object.getOwnPropertyNames(e.patternProperties)[0];return n===G.PatternNumberExact?this.Number(r):n===G.PatternStringExact?this.String(r):this.Throw("Unable to resolve key type from Record key pattern")})():Y.TTuple(e)?(()=>{const n=Be.IsUndefined(e.items)?[]:e.items;const i=n.map((s,a)=>G.Type.Literal(a.toString()));return this.Union(i,r)})():Y.TArray(e)?(()=>{return this.Number(r)})():(()=>{const n=Ix.ResolveKeys(e,{includePatterns:false});if(n.length===0)return this.Never(r);const i=n.map(s=>this.Literal(s));return this.Union(i,r)})()}Literal(e,r={}){return this.Create({...r,[G.Kind]:"Literal",const:e,type:typeof e})}Lowercase(e,r={}){return{...Yy.Map(ct.Type(e),"Lowercase"),...r}}Never(e={}){return this.Create({...e,[G.Kind]:"Never",not:{}})}Not(e,r){return this.Create({...r,[G.Kind]:"Not",not:ct.Type(e)})}Null(e={}){return this.Create({...e,[G.Kind]:"Null",type:"null"})}Number(e={}){return this.Create({...e,[G.Kind]:"Number",type:"number"})}Object(e,r={}){const n=Object.getOwnPropertyNames(e);const i=n.filter(l=>Y.TOptional(e[l]));const s=n.filter(l=>!i.includes(l));const a=Y.TSchema(r.additionalProperties)?{additionalProperties:ct.Type(r.additionalProperties)}:{};const u=n.reduce((l,c)=>({...l,[c]:ct.Type(e[c])}),{});return s.length>0?this.Create({...r,...a,[G.Kind]:"Object",type:"object",properties:u,required:s}):this.Create({...r,...a,[G.Kind]:"Object",type:"object",properties:u})}Omit(e,r,n={}){const i=fb.Resolve(r);return Wy.Map(this.Discard(ct.Type(e),G.Transform),s=>{if(Be.IsArray(s.required)){s.required=s.required.filter(a=>!i.includes(a));if(s.required.length===0)delete s.required}for(const a of Object.getOwnPropertyNames(s.properties)){if(i.includes(a))delete s.properties[a]}return this.Create(s)},n)}Partial(e,r={}){return Wy.Map(this.Discard(ct.Type(e),G.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,a)=>{return{...s,[a]:this.Optional(n.properties[a])}},{});return this.Object(i,this.Discard(n,"required"))},r)}Pick(e,r,n={}){const i=fb.Resolve(r);return Wy.Map(this.Discard(ct.Type(e),G.Transform),s=>{if(Be.IsArray(s.required)){s.required=s.required.filter(a=>i.includes(a));if(s.required.length===0)delete s.required}for(const a of Object.getOwnPropertyNames(s.properties)){if(!i.includes(a))delete s.properties[a]}return this.Create(s)},n)}Record(e,r,n={}){return Y.TTemplateLiteral(e)?(()=>{const i=Jy.ParseExact(e.pattern);return Qy.Check(i)?this.Object([...Xy.Generate(i)].reduce((s,a)=>({...s,[a]:ct.Type(r)}),{}),n):this.Create({...n,[G.Kind]:"Record",type:"object",patternProperties:{[e.pattern]:ct.Type(r)}})})():Y.TUnion(e)?(()=>{const i=aY.Resolve(e);if(Y.TUnionLiteral(i)){const s=i.anyOf.reduce((a,u)=>({...a,[u.const]:ct.Type(r)}),{});return this.Object(s,{...n,[G.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():Y.TLiteral(e)?(()=>{return Be.IsString(e.const)||Be.IsNumber(e.const)?this.Object({[e.const]:ct.Type(r)},n):this.Throw("Record key of type literal is not of type string or number")})():Y.TInteger(e)||Y.TNumber(e)?(()=>{return this.Create({...n,[G.Kind]:"Record",type:"object",patternProperties:{[G.PatternNumberExact]:ct.Type(r)}})})():Y.TString(e)?(()=>{const i=Be.IsUndefined(e.pattern)?G.PatternStringExact:e.pattern;return this.Create({...n,[G.Kind]:"Record",type:"object",patternProperties:{[i]:ct.Type(r)}})})():this.Never()}Recursive(e,r={}){if(Be.IsUndefined(r.$id))r.$id=`T${P$t++}`;const n=e({[G.Kind]:"This",$ref:`${r.$id}`});n.$id=r.$id;return this.Create({...r,[G.Hint]:"Recursive",...n})}Ref(e,r={}){if(Be.IsString(e))return this.Create({...r,[G.Kind]:"Ref",$ref:e});if(Be.IsUndefined(e.$id))this.Throw("Reference target type must specify an $id");return this.Create({...r,[G.Kind]:"Ref",$ref:e.$id})}Required(e,r={}){return Wy.Map(this.Discard(ct.Type(e),G.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,a)=>{return{...s,[a]:this.Discard(n.properties[a],G.Optional)}},{});return this.Object(i,n)},r)}Rest(e){return Y.TTuple(e)&&!Be.IsUndefined(e.items)?ct.Rest(e.items):Y.TIntersect(e)?ct.Rest(e.allOf):Y.TUnion(e)?ct.Rest(e.anyOf):[]}String(e={}){return this.Create({...e,[G.Kind]:"String",type:"string"})}TemplateLiteral(e,r={}){const n=Be.IsString(e)?kx.Create(oY.Parse(e)):kx.Create(e);return this.Create({...r,[G.Kind]:"TemplateLiteral",type:"string",pattern:n})}Transform(e){return new qx(e)}Tuple(e,r={}){const[n,i,s]=[false,e.length,e.length];const a=ct.Rest(e);const u=e.length>0?{...r,[G.Kind]:"Tuple",type:"array",items:a,additionalItems:n,minItems:i,maxItems:s}:{...r,[G.Kind]:"Tuple",type:"array",minItems:i,maxItems:s};return this.Create(u)}Uncapitalize(e,r={}){return{...Yy.Map(ct.Type(e),"Uncapitalize"),...r}}Union(e,r={}){return Y.TTemplateLiteral(e)?nd.Resolve(e):(()=>{const n=e;if(n.length===0)return this.Never(r);if(n.length===1)return this.Create(ct.Type(n[0],r));const i=ct.Rest(n);return this.Create({...r,[G.Kind]:"Union",anyOf:i})})()}Unknown(e={}){return this.Create({...e,[G.Kind]:"Unknown"})}Unsafe(e={}){return this.Create({...e,[G.Kind]:e[G.Kind]||"Unsafe"})}Uppercase(e,r={}){return{...Yy.Map(ct.Type(e),"Uppercase"),...r}}};G.JsonTypeBuilder=mb;var Mx=class extends mb{static{o(this,"JavaScriptTypeBuilder")}AsyncIterator(e,r={}){return this.Create({...r,[G.Kind]:"AsyncIterator",type:"AsyncIterator",items:ct.Type(e)})}Awaited(e,r={}){const n=o(i=>i.length>0?(()=>{const[s,...a]=i;return[this.Awaited(s),...n(a)]})():i,"Unwrap");return Y.TIntersect(e)?G.Type.Intersect(n(e.allOf)):Y.TUnion(e)?G.Type.Union(n(e.anyOf)):Y.TPromise(e)?this.Awaited(e.item):ct.Type(e,r)}BigInt(e={}){return this.Create({...e,[G.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(e,r={}){return this.Tuple([...e.parameters],{...r})}Constructor(e,r,n){const[i,s]=[ct.Rest(e),ct.Type(r)];return this.Create({...n,[G.Kind]:"Constructor",type:"constructor",parameters:i,returns:s})}Date(e={}){return this.Create({...e,[G.Kind]:"Date",type:"Date"})}Function(e,r,n){const[i,s]=[ct.Rest(e),ct.Type(r)];return this.Create({...n,[G.Kind]:"Function",type:"function",parameters:i,returns:s})}InstanceType(e,r={}){return ct.Type(e.returns,r)}Iterator(e,r={}){return this.Create({...r,[G.Kind]:"Iterator",type:"Iterator",items:ct.Type(e)})}Parameters(e,r={}){return this.Tuple(e.parameters,{...r})}Promise(e,r={}){return this.Create({...r,[G.Kind]:"Promise",type:"Promise",item:ct.Type(e)})}RegExp(e,r={}){const n=Be.IsString(e)?e:e.source;return this.Create({...r,[G.Kind]:"String",type:"string",pattern:n})}RegEx(e,r={}){return this.RegExp(e,r)}ReturnType(e,r={}){return ct.Type(e.returns,r)}Symbol(e){return this.Create({...e,[G.Kind]:"Symbol",type:"symbol"})}Undefined(e={}){return this.Create({...e,[G.Kind]:"Undefined",type:"undefined"})}Uint8Array(e={}){return this.Create({...e,[G.Kind]:"Uint8Array",type:"Uint8Array"})}Void(e={}){return this.Create({...e,[G.Kind]:"Void",type:"void"})}};G.JavaScriptTypeBuilder=Mx;G.JsonType=new mb;G.Type=new Mx});var bAe=_(Bx=>{"use strict";Object.defineProperty(Bx,"__esModule",{value:true});Bx.CustomTypeBuilder=void 0;var gb=EAe();var uY=class extends gb.TypeBuilder{static{o(this,"CustomTypeBuilder")}static Date(){return gb.Type.Unsafe({type:"string",format:"date-time"})}static Nullable(e){return gb.Type.Union([e,gb.Type.Null()])}static StringEnum(e){return gb.Type.Unsafe({type:"string",enum:e})}};Bx.CustomTypeBuilder=uY});var AAe=_(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:true});lt.throwIfNotNumber=lt.throwIfNotString=lt.throwIfUndefinedOrNull=lt.throwIfUndefined=lt.ArgumentTypeError=lt.ArgumentUndefinedError=lt.ValidationError=lt.withUndefinedAsNull=lt.withNullAsUndefined=lt.validateConstraint=lt.validateConstraints=lt.areFunctions=lt.isFunction=lt.isEmptyObject=lt.assertAllDefined=lt.assertIsDefined=lt.assertType=lt.isUndefinedOrNull=lt.isDefined=lt.isUndefined=lt.isBoolean=lt.isIterable=lt.isNumber=lt.isTypedArray=lt.isObject=lt.isStringArray=lt.isString=void 0;function Vx(t){return typeof t==="string"}o(Vx,"isString");lt.isString=Vx;function D$t(t){return Array.isArray(t)&&t.every(e=>Vx(e))}o(D$t,"isStringArray");lt.isStringArray=D$t;function wAe(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}o(wAe,"isObject");lt.isObject=wAe;function k$t(t){const e=Object.getPrototypeOf(Uint8Array);return typeof t==="object"&&t instanceof e}o(k$t,"isTypedArray");lt.isTypedArray=k$t;function SAe(t){return typeof t==="number"&&!isNaN(t)}o(SAe,"isNumber");lt.isNumber=SAe;function $$t(t){return!!t&&typeof t[Symbol.iterator]==="function"}o($$t,"isIterable");lt.isIterable=$$t;function L$t(t){return t===true||t===false}o(L$t,"isBoolean");lt.isBoolean=L$t;function lY(t){return typeof t==="undefined"}o(lY,"isUndefined");lt.isUndefined=lY;function q$t(t){return!Zy(t)}o(q$t,"isDefined");lt.isDefined=q$t;function Zy(t){return lY(t)||t===null}o(Zy,"isUndefinedOrNull");lt.isUndefinedOrNull=Zy;function j$t(t,e){if(!t){throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}}o(j$t,"assertType");lt.assertType=j$t;function U$t(t){if(Zy(t)){throw new Error("Assertion Failed: argument is undefined or null")}return t}o(U$t,"assertIsDefined");lt.assertIsDefined=U$t;function F$t(...t){const e=[];for(let r=0;r<t.length;r++){const n=t[r];if(Zy(n)){throw new Error(`Assertion Failed: argument at index ${r} is undefined or null`)}e.push(n)}return e}o(F$t,"assertAllDefined");lt.assertAllDefined=F$t;var M$t=Object.prototype.hasOwnProperty;function B$t(t){if(!wAe(t)){return false}for(const e in t){if(M$t.call(t,e)){return false}}return true}o(B$t,"isEmptyObject");lt.isEmptyObject=B$t;function cY(t){return typeof t==="function"}o(cY,"isFunction");lt.isFunction=cY;function V$t(...t){return t.length>0&&t.every(cY)}o(V$t,"areFunctions");lt.areFunctions=V$t;function H$t(t,e){const r=Math.min(t.length,e.length);for(let n=0;n<r;n++){TAe(t[n],e[n])}}o(H$t,"validateConstraints");lt.validateConstraints=H$t;function TAe(t,e){if(Vx(e)){if(typeof t!==e){throw new Error(`argument does not match constraint: typeof ${e}`)}}else if(cY(e)){try{if(t instanceof e){return}}catch{}if(!Zy(t)&&t.constructor===e){return}if(e.length===1&&e.call(void 0,t)===true){return}throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}o(TAe,"validateConstraint");lt.validateConstraint=TAe;function z$t(t){return t===null?void 0:t}o(z$t,"withNullAsUndefined");lt.withNullAsUndefined=z$t;function G$t(t){return typeof t==="undefined"?null:t}o(G$t,"withUndefinedAsNull");lt.withUndefinedAsNull=G$t;var yb=class extends Error{static{o(this,"ValidationError")}constructor(e){super(e)}};lt.ValidationError=yb;var vb=class extends yb{static{o(this,"ArgumentUndefinedError")}constructor(e){super(`The argument '${e}' is undefined.`)}};lt.ArgumentUndefinedError=vb;var _b=class extends yb{static{o(this,"ArgumentTypeError")}constructor(e,r){super(`The argument '${e}' must be of type '${r}'.`)}};lt.ArgumentTypeError=_b;function K$t(t,e){if(lY(t)){throw new vb(e)}return true}o(K$t,"throwIfUndefined");lt.throwIfUndefined=K$t;function dY(t,e){if(Zy(t)){throw new vb(e)}}o(dY,"throwIfUndefinedOrNull");lt.throwIfUndefinedOrNull=dY;function Y$t(t,e){dY(t,e);if(!Vx(t)){throw new _b(e,"string")}return true}o(Y$t,"throwIfNotString");lt.throwIfNotString=Y$t;function W$t(t,e){dY(t,e);if(!SAe(t)){throw new _b(e,"number")}return true}o(W$t,"throwIfNotNumber");lt.throwIfNotNumber=W$t});var bb=_(Ae=>{"use strict";var xAe=Ae&&Ae.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var J$t=Ae&&Ae.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var Hx=Ae&&Ae.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))xAe(e,t,r)}J$t(e,t);return e};var _f=Ae&&Ae.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))xAe(e,t,r)};Object.defineProperty(Ae,"__esModule",{value:true});Ae.getRequiredEnvVar=Ae.env=Ae.EnvironmentalVariableRequiredError=Ae.xfs=Ae.RouteValidator=Ae.JsonValidator=Ae.MeteringService=Ae.TenantService=Ae.OpenFGAService=Ae.DevApiService=Ae.getContentApiStorageTarballPath=Ae.contentApiTarballFileName=Ae.ContentApiService=Ae.AuthApiService=Ae.getServiceAccountIdToken=Ae.createApiKeyServiceClient=Ae.ApiKeyService=Ae.RouteVersions=Ae.startsWithReservedKeyword=Ae.logger=Ae.createNewLogger=Ae.graphQL=Ae.CloudStorage=Ae.fly=Ae.ApiServer=Ae.featureFlagsPlugin=Ae.ensureZuploUserPlugin=Ae.ensureZuploAdminPlugin=Ae.ensureServiceAccountPlugin=Ae.apiKeyAuthPlugin=Ae.errorHandler=Ae.DeploymentLogState=Ae.signString=Ae.FeatureFlags=Ae.VALID_COMPATIBILITY_DATES=Ae.DEFAULT_COMPATIBILITY_DATE=Ae.COMPATIBILITY_FLAG_MAPPINGS=Ae.WARNING_STATUS=Ae.WARNING_SEVERITY=Ae.GOOD_STATUS=Ae.FAILURE_STATUS=Ae.ERROR_SEVERITY=Ae.BuildIssueError=Ae.hasBlockedNotifications=Ae.getDefaultFlags=Ae.getBuildFlagsForDeployment=Ae.CommonAuth=void 0;var pY=Hx(Oa());Ae.env=pY.default;Object.defineProperty(Ae,"EnvironmentalVariableRequiredError",{enumerable:true,get:function(){return pY.EnvironmentalVariableRequiredError}});Object.defineProperty(Ae,"getRequiredEnvVar",{enumerable:true,get:function(){return pY.getRequiredEnvVar}});_f(As(),Ae);var Q$t=sC();Object.defineProperty(Ae,"CommonAuth",{enumerable:true,get:function(){return Q$t.CommonAuth}});var fY=VY();Object.defineProperty(Ae,"getBuildFlagsForDeployment",{enumerable:true,get:function(){return fY.getBuildFlagsForDeployment}});Object.defineProperty(Ae,"getDefaultFlags",{enumerable:true,get:function(){return fY.getDefaultFlags}});Object.defineProperty(Ae,"hasBlockedNotifications",{enumerable:true,get:function(){return fY.hasBlockedNotifications}});var e2=HY();Object.defineProperty(Ae,"BuildIssueError",{enumerable:true,get:function(){return e2.BuildIssueError}});Object.defineProperty(Ae,"ERROR_SEVERITY",{enumerable:true,get:function(){return e2.ERROR_SEVERITY}});Object.defineProperty(Ae,"FAILURE_STATUS",{enumerable:true,get:function(){return e2.FAILURE_STATUS}});Object.defineProperty(Ae,"GOOD_STATUS",{enumerable:true,get:function(){return e2.GOOD_STATUS}});Object.defineProperty(Ae,"WARNING_SEVERITY",{enumerable:true,get:function(){return e2.WARNING_SEVERITY}});Object.defineProperty(Ae,"WARNING_STATUS",{enumerable:true,get:function(){return e2.WARNING_STATUS}});var X$t=zY();Object.defineProperty(Ae,"COMPATIBILITY_FLAG_MAPPINGS",{enumerable:true,get:function(){return X$t.COMPATIBILITY_FLAG_MAPPINGS}});var CAe=YY();Object.defineProperty(Ae,"DEFAULT_COMPATIBILITY_DATE",{enumerable:true,get:function(){return CAe.DEFAULT_COMPATIBILITY_DATE}});Object.defineProperty(Ae,"VALID_COMPATIBILITY_DATES",{enumerable:true,get:function(){return CAe.VALID_COMPATIBILITY_DATES}});var Z$t=aC();Object.defineProperty(Ae,"FeatureFlags",{enumerable:true,get:function(){return Z$t.FeatureFlags}});var eLt=WY();Object.defineProperty(Ae,"signString",{enumerable:true,get:function(){return eLt.signString}});_f(JY(),Ae);var tLt=lC();Object.defineProperty(Ae,"DeploymentLogState",{enumerable:true,get:function(){return tLt.DeploymentLogState}});_f(iW(),Ae);_f(cC(),Ae);var rLt=dC();Object.defineProperty(Ae,"errorHandler",{enumerable:true,get:function(){return rLt.errorHandler}});var Eb=gC();Object.defineProperty(Ae,"apiKeyAuthPlugin",{enumerable:true,get:function(){return Eb.apiKeyAuthPlugin}});Object.defineProperty(Ae,"ensureServiceAccountPlugin",{enumerable:true,get:function(){return Eb.ensureServiceAccountPlugin}});Object.defineProperty(Ae,"ensureZuploAdminPlugin",{enumerable:true,get:function(){return Eb.ensureZuploAdminPlugin}});Object.defineProperty(Ae,"ensureZuploUserPlugin",{enumerable:true,get:function(){return Eb.ensureZuploUserPlugin}});Object.defineProperty(Ae,"featureFlagsPlugin",{enumerable:true,get:function(){return Eb.featureFlagsPlugin}});var nLt=mge();Object.defineProperty(Ae,"ApiServer",{enumerable:true,get:function(){return nLt.ApiServer}});Ae.fly=Hx(vge());Ae.CloudStorage=Hx(abe());var iLt=obe();Object.defineProperty(Ae,"graphQL",{enumerable:true,get:function(){return iLt.graphQL}});_f(N5e(),Ae);var RAe=Tj();Object.defineProperty(Ae,"createNewLogger",{enumerable:true,get:function(){return RAe.createNewLogger}});Object.defineProperty(Ae,"logger",{enumerable:true,get:function(){return RAe.logger}});var sLt=fH();Object.defineProperty(Ae,"startsWithReservedKeyword",{enumerable:true,get:function(){return sLt.startsWithReservedKeyword}});var aLt=I5e();Object.defineProperty(Ae,"RouteVersions",{enumerable:true,get:function(){return aLt.RouteVersions}});var OAe=tTe();Object.defineProperty(Ae,"ApiKeyService",{enumerable:true,get:function(){return OAe.ApiKeyService}});Object.defineProperty(Ae,"createApiKeyServiceClient",{enumerable:true,get:function(){return OAe.createApiKeyServiceClient}});var oLt=Ry();Object.defineProperty(Ae,"getServiceAccountIdToken",{enumerable:true,get:function(){return oLt.getServiceAccountIdToken}});var uLt=nTe();Object.defineProperty(Ae,"AuthApiService",{enumerable:true,get:function(){return uLt.AuthApiService}});var hY=oTe();Object.defineProperty(Ae,"ContentApiService",{enumerable:true,get:function(){return hY.ContentApiService}});Object.defineProperty(Ae,"contentApiTarballFileName",{enumerable:true,get:function(){return hY.contentApiTarballFileName}});Object.defineProperty(Ae,"getContentApiStorageTarballPath",{enumerable:true,get:function(){return hY.getContentApiStorageTarballPath}});var lLt=cTe();Object.defineProperty(Ae,"DevApiService",{enumerable:true,get:function(){return lLt.DevApiService}});var cLt=dAe();Object.defineProperty(Ae,"OpenFGAService",{enumerable:true,get:function(){return cLt.OpenFGAService}});var dLt=hAe();Object.defineProperty(Ae,"TenantService",{enumerable:true,get:function(){return dLt.TenantService}});var pLt=gAe();Object.defineProperty(Ae,"MeteringService",{enumerable:true,get:function(){return pLt.MeteringService}});_f(yAe(),Ae);_f(bAe(),Ae);_f(AAe(),Ae);var fLt=$7();Object.defineProperty(Ae,"JsonValidator",{enumerable:true,get:function(){return fLt.JsonValidator}});var hLt=EH();Object.defineProperty(Ae,"RouteValidator",{enumerable:true,get:function(){return hLt.RouteValidator}});Ae.xfs=Hx(yB())});var wb=_(t2=>{"use strict";Object.defineProperty(t2,"__esModule",{value:true});t2.runPlugins=t2.PluginResult=void 0;var mY=class{static{o(this,"PluginResult")}errors=[];warnings=[];constructor(e){if(e){this.errors.push(e)}}};t2.PluginResult=mY;async function mLt(t,e){const r=[];const n=[];const i=new Map;for await(const s of t){try{const a=await s(e,i);n.push(...a.errors.map(u=>{if(u.pluginName===""){u.pluginName=s.name}return u}));r.push(...a.warnings);if(a.errors.length>0){break}}catch(a){n.push(a);break}}return{errors:n,warnings:r}}o(mLt,"runPlugins");t2.runPlugins=mLt});var IAe=_((o0r,NAe)=>{"use strict";function gLt(t){return t>=55296&&t<=56319}o(gLt,"isHighSurrogate");function yLt(t){return t>=56320&&t<=57343}o(yLt,"isLowSurrogate");NAe.exports=o(function t(e,r,n){if(typeof r!=="string"){throw new Error("Input must be string")}var i=r.length;var s=0;var a;var u;for(var l=0;l<i;l+=1){a=r.charCodeAt(l);u=r[l];if(gLt(a)&&yLt(r.charCodeAt(l+1))){l+=1;u+=r[l]}s+=e(u);if(s===n){return r.slice(0,l+1)}else if(s>n){return r.slice(0,l-u.length+1)}}return r},"truncate")});var DAe=_((l0r,PAe)=>{"use strict";var vLt=IAe();var _Lt=Buffer.byteLength.bind(Buffer);PAe.exports=vLt.bind(null,_Lt)});var kAe=_(r2=>{"use strict";var ELt=r2&&r2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(r2,"__esModule",{value:true});r2.sanitize=void 0;var bLt=ELt(DAe());var wLt=/[/?<>\\:*|"]/g;var SLt=/[\x00-\x1f\x80-\x9f]/g;var TLt=/^\.+$/;var ALt=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;var xLt=/[. ]+$/;function CLt(t,e=""){if(typeof t!=="string"){throw new Error("Input must be string")}const r=t.replace(wLt,e).replace(SLt,e).replace(TLt,e).replace(ALt,e).replace(xLt,e);return(0,bLt.default)(r,255)}o(CLt,"sanitize");r2.sanitize=CLt});var Kl=_(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:true});Fe.NODE_BUILD_OPEN_API_OUTPUT_FILE=Fe.NODE_BUILD_OUTPUT_FILE=Fe.NODE_ENTRY_NAME=Fe.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE=Fe.WORKER_BUILD_OUTPUT_FILE=Fe.WORKER_ENTRY_NAME=Fe.ENV_MODULE_FILE=Fe.ZUPLO_SYSTEM_ENV_FILE=Fe.ENV_FILE=Fe.CACHE_DIRECTORY=Fe.BUILD_CACHE_FILE=Fe.ZUPLO_FILE_SCHEMA=Fe.NON_STANDARD_NODE_ENV=Fe.GENERATED_TYPES_DIR_NAME=Fe.GENERATED_BUILD_JSON_FILE=Fe.GENERATED_SOURCE_DIR_NAME=Fe.BUILD_OUTPUT_DIR=Fe.DEFAULT_TEST_FILE=Fe.DEFAULT_DOCS_MARKDOWN_FILE=Fe.DOCS_THEME_FILE=Fe.DOCS_SIDEBAR_FILE=Fe.ZUPLO_FALLBACK_JSON_FILE=Fe.ZUPLO_PREFERRED_JSON_FILE=Fe.DEFAULT_MODULE_FILE=Fe.OPEN_API_FILE_SUFFIX=Fe.OPEN_API_CONFIG_FILE=Fe.OPEN_API_UNVERSIONED_DIR_NAME=Fe.DEV_PORTAL_OUTPUT_DIR_NAME=Fe.DEV_PORTAL_CONFIG_FILE=Fe.POLICIES_CONFIG_FILE=Fe.ROUTES_OAS_CONFIG_FILE=Fe.LOCAL_API_KEYS_CONFIG_FILE=Fe.DEV_PORTAL_V4_PATH=Fe.USER_DOCS_DIR_NAME=Fe.USER_SCHEMAS_DIR_NAME=Fe.USER_CONFIG_DIR_NAME=Fe.USER_TEST_DIR_NAME=Fe.USER_MODULES_DIR_NAME=void 0;Fe.USER_MODULES_DIR_NAME="modules";Fe.USER_TEST_DIR_NAME="tests";Fe.USER_CONFIG_DIR_NAME="config";Fe.USER_SCHEMAS_DIR_NAME="schemas";Fe.USER_DOCS_DIR_NAME="docs";Fe.DEV_PORTAL_V4_PATH="v4";Fe.LOCAL_API_KEYS_CONFIG_FILE="api-keys.json";Fe.ROUTES_OAS_CONFIG_FILE="routes.oas.json";Fe.POLICIES_CONFIG_FILE="policies.json";Fe.DEV_PORTAL_CONFIG_FILE="dev-portal.json";Fe.DEV_PORTAL_OUTPUT_DIR_NAME="dev-portal";Fe.OPEN_API_UNVERSIONED_DIR_NAME="unversioned";Fe.OPEN_API_CONFIG_FILE="open-api.json";Fe.OPEN_API_FILE_SUFFIX=".oas.json";Fe.DEFAULT_MODULE_FILE="hello-world.ts";Fe.ZUPLO_PREFERRED_JSON_FILE="zuplo.jsonc";Fe.ZUPLO_FALLBACK_JSON_FILE="zuplo.json";Fe.DOCS_SIDEBAR_FILE="sidebar.json";Fe.DOCS_THEME_FILE="theme.css";Fe.DEFAULT_DOCS_MARKDOWN_FILE="index.md";Fe.DEFAULT_TEST_FILE="hello-world.json";Fe.BUILD_OUTPUT_DIR="dist";Fe.GENERATED_SOURCE_DIR_NAME=".zuplo";Fe.GENERATED_BUILD_JSON_FILE="build.json";Fe.GENERATED_TYPES_DIR_NAME="types";Fe.NON_STANDARD_NODE_ENV=`You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against.`;Fe.ZUPLO_FILE_SCHEMA="zuplo";Fe.BUILD_CACHE_FILE="buildstate.json";Fe.CACHE_DIRECTORY=".cache";Fe.ENV_FILE=".env";Fe.ZUPLO_SYSTEM_ENV_FILE=".env.zuplo";Fe.ENV_MODULE_FILE="environment.ts";Fe.WORKER_ENTRY_NAME="worker.ts";Fe.WORKER_BUILD_OUTPUT_FILE="worker.js";Fe.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE="worker.js.map";Fe.NODE_ENTRY_NAME="server.ts";Fe.NODE_BUILD_OUTPUT_FILE="main.js";Fe.NODE_BUILD_OPEN_API_OUTPUT_FILE=Fe.OPEN_API_CONFIG_FILE});var jAe=_(n2=>{"use strict";var qAe=n2&&n2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(n2,"__esModule",{value:true});n2.createProjectDirs=void 0;var $Ae=qAe(require("fs/promises"));var RLt=qAe(require("path"));var Sb=Kl();var LAe=wb();var OLt=o(async function({sourceDirectory:t,logger:e}){e.debug("Creating project directories");const r=[Sb.USER_MODULES_DIR_NAME,Sb.USER_CONFIG_DIR_NAME,Sb.USER_TEST_DIR_NAME,Sb.USER_SCHEMAS_DIR_NAME,Sb.USER_DOCS_DIR_NAME,".vscode"];try{await $Ae.default.mkdir(t);for(const n of r){await $Ae.default.mkdir(RLt.default.join(t,n),{recursive:true})}}catch(n){e.error(n);return new LAe.PluginResult({message:`Cannot create project directory tree at ${t}`,pluginName:"create-project-dirs",severity:"error"})}return new LAe.PluginResult},"createProjectDirs");n2.createProjectDirs=OLt});var UAe=_(yY=>{"use strict";Object.defineProperty(yY,"__esModule",{value:true});var zx=require("perf_hooks");var gY=[];async function NLt(t,e){const r=zx.performance.timerify(e);const n=new zx.PerformanceObserver(i=>{const s=i.getEntries()[0];gY.push({name:t,duration:s.duration});n.disconnect()});n.observe({entryTypes:["function"]});return r()}o(NLt,"timeFn");var ILt={mark:t=>{zx.performance.mark(t)},measure:(t,e,r)=>{zx.performance.measure(t,e,r)},timeFn:NLt,report:()=>{if(gY.length>0){console.table(gY)}}};yY.default=ILt});var VAe=_(i2=>{"use strict";var BAe=i2&&i2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(i2,"__esModule",{value:true});i2.generateFromTemplate=void 0;var PLt=require("fs");var FAe=BAe(require("fs/promises"));var MAe=BAe(require("path"));async function DLt(t){const e=MAe.default.resolve(__dirname,"..","templates",t);if((0,PLt.existsSync)(e)){const r=await FAe.default.readFile(e,"utf-8");return r}else{const r=MAe.default.resolve(__dirname,"templates",t);const n=await FAe.default.readFile(r,"utf-8");return n}}o(DLt,"generateFromTemplate");i2.generateFromTemplate=DLt});var Ca=_(s2=>{"use strict";var vY=s2&&s2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(s2,"__esModule",{value:true});s2.generateFileFromTemplate=void 0;var kLt=bb();var $Lt=vY(require("fs/promises"));var LLt=vY(require("path"));var qLt=vY(UAe());var jLt=VAe();var ULt=o(function(t,e){return async({sourceDirectory:r,logger:n})=>{return qLt.default.timeFn(`Generating ${t}`,async()=>{n.debug(`Generating ${t}`);const i=LLt.default.join(r,t);if(await kLt.xfs.fileExists(i)){n.debug({sourceDirectory:r},`${t} already exists, skipping`);return{warnings:[],errors:[]}}return FLt(i,e,n)})}},"generateFileFromTemplate");s2.generateFileFromTemplate=ULt;async function FLt(t,e,r){const n=await(0,jLt.generateFromTemplate)(e);try{await $Lt.default.writeFile(t,n,"utf-8");r.debug(`File written to ${t}`)}catch(i){r.error(i);const s={message:`Error creating file at ${t}`,pluginName:"generate-file",severity:"error"};return{warnings:[],errors:[s]}}return{warnings:[],errors:[]}}o(FLt,"writeTemplate")});var zAe=_(a2=>{"use strict";var MLt=a2&&a2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(a2,"__esModule",{value:true});a2.generateDefaultDocsMarkdown=void 0;var BLt=MLt(require("path"));var HAe=Kl();var VLt=Ca();a2.generateDefaultDocsMarkdown=(0,VLt.generateFileFromTemplate)(BLt.default.join(HAe.USER_DOCS_DIR_NAME,HAe.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var KAe=_(o2=>{"use strict";var HLt=o2&&o2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(o2,"__esModule",{value:true});o2.generateDefaultDocsSidebar=void 0;var zLt=HLt(require("path"));var GAe=Kl();var GLt=Ca();o2.generateDefaultDocsSidebar=(0,GLt.generateFileFromTemplate)(zLt.default.join(GAe.USER_DOCS_DIR_NAME,GAe.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var WAe=_(u2=>{"use strict";var KLt=u2&&u2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(u2,"__esModule",{value:true});u2.generateDefaultDocsTheme=void 0;var YLt=KLt(require("path"));var YAe=Kl();var WLt=Ca();u2.generateDefaultDocsTheme=(0,WLt.generateFileFromTemplate)(YLt.default.join(YAe.USER_DOCS_DIR_NAME,YAe.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var QAe=_(l2=>{"use strict";var JLt=l2&&l2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(l2,"__esModule",{value:true});l2.generateDefaultModule=void 0;var QLt=JLt(require("path"));var JAe=Kl();var XLt=Ca();l2.generateDefaultModule=(0,XLt.generateFileFromTemplate)(QLt.default.join(JAe.USER_MODULES_DIR_NAME,JAe.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var ZAe=_(c2=>{"use strict";var ZLt=c2&&c2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(c2,"__esModule",{value:true});c2.generateDevPortalConfigJson=void 0;var eqt=ZLt(require("path"));var XAe=Kl();var tqt=Ca();c2.generateDevPortalConfigJson=(0,tqt.generateFileFromTemplate)(eqt.default.join(XAe.USER_CONFIG_DIR_NAME,XAe.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var exe=_(Gx=>{"use strict";Object.defineProperty(Gx,"__esModule",{value:true});Gx.generateEnvironment=void 0;var rqt=Ca();Gx.generateEnvironment=(0,rqt.generateFileFromTemplate)(".env","env.template")});var txe=_(Kx=>{"use strict";Object.defineProperty(Kx,"__esModule",{value:true});Kx.generateESLint=void 0;var nqt=Ca();Kx.generateESLint=(0,nqt.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var rxe=_(Yx=>{"use strict";Object.defineProperty(Yx,"__esModule",{value:true});Yx.generateGitignore=void 0;var iqt=Ca();Yx.generateGitignore=(0,iqt.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var nxe=_(d2=>{"use strict";var sqt=d2&&d2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(d2,"__esModule",{value:true});d2.generateLaunchJson=void 0;var aqt=sqt(require("path"));var oqt=Ca();d2.generateLaunchJson=(0,oqt.generateFileFromTemplate)(aqt.default.join(".vscode","launch.json"),"launch.template.jsonc")});var ixe=_(p2=>{"use strict";var uqt=p2&&p2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(p2,"__esModule",{value:true});p2.generateSettingsJson=void 0;var lqt=uqt(require("path"));var cqt=Ca();p2.generateSettingsJson=(0,cqt.generateFileFromTemplate)(lqt.default.join(".vscode","settings.json"),"settings.template.jsonc")});var axe=_(f2=>{"use strict";var dqt=f2&&f2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(f2,"__esModule",{value:true});f2.generateRouteOasConfig=void 0;var pqt=dqt(require("path"));var sxe=Kl();var fqt=Ca();f2.generateRouteOasConfig=(0,fqt.generateFileFromTemplate)(pqt.default.join(sxe.USER_CONFIG_DIR_NAME,sxe.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var cxe=_(zo=>{"use strict";var oxe=zo&&zo.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(zo,"__esModule",{value:true});zo.updateProjectPackageJson=zo.getProjectPackageJson=zo.getPackageOverrides=zo.generateDefaultPackageJson=void 0;var hqt=bb();var uxe=oxe(require("fs/promises"));var _Y=oxe(require("path"));async function mqt(t,e=hqt.env.USE_MONOREPO_PACKAGES){const r={name:t,version:"1.0.0",author:"",copyright:"",scripts:{dev:"zup dev",test:"zup test"},dependencies:{zuplo:"latest"}};if(e){const n=lxe();r.overrides=n;r.dependencies["@zuplo/runtime"]=n["@zuplo/runtime"];if(r.devDependencies&&"@zuplo/core"in r.devDependencies){r.devDependencies["@zuplo/core"]=n["@zuplo/core"]}if("@zuplo/core"in r.dependencies){r.dependencies["@zuplo/core"]=n["@zuplo/core"]}}return r}o(mqt,"generateDefaultPackageJson");zo.generateDefaultPackageJson=mqt;function lxe(){const t=_Y.default.resolve(__dirname,"..","..");return{"@zuplo/core":`file:${t}/core`,"@zuplo/runtime":`file:${t}/runtime`,"@zuplo/debug":`file:${t}/debug`,"@zuplo/errors":`file:${t}/errors`}}o(lxe,"getPackageOverrides");zo.getPackageOverrides=lxe;async function gqt(t){const e=_Y.default.join(t,"package.json");const r=await uxe.default.readFile(e,"utf-8");const n=JSON.parse(r);return n}o(gqt,"getProjectPackageJson");zo.getProjectPackageJson=gqt;async function yqt(t,e){const r=_Y.default.join(t,"package.json");const n=JSON.stringify(e,void 0,2);await uxe.default.writeFile(r,n,"utf-8")}o(yqt,"updateProjectPackageJson");zo.updateProjectPackageJson=yqt});var fxe=_(Wx=>{"use strict";Object.defineProperty(Wx,"__esModule",{value:true});Wx.generatePackageJson=void 0;var dxe=cxe();var pxe=wb();var vqt=o(async function({sourceDirectory:t,name:e,logger:r}){const n=await(0,dxe.generateDefaultPackageJson)(e);try{await(0,dxe.updateProjectPackageJson)(t,n)}catch(i){r.error(i);return new pxe.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new pxe.PluginResult},"generatePackageJson");Wx.generatePackageJson=vqt});var mxe=_(h2=>{"use strict";var _qt=h2&&h2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(h2,"__esModule",{value:true});h2.generatePoliciesConfig=void 0;var Eqt=_qt(require("path"));var hxe=Kl();var bqt=Ca();h2.generatePoliciesConfig=(0,bqt.generateFileFromTemplate)(Eqt.default.join(hxe.USER_CONFIG_DIR_NAME,hxe.POLICIES_CONFIG_FILE),"policies.template.json")});var gxe=_(Jx=>{"use strict";Object.defineProperty(Jx,"__esModule",{value:true});Jx.generateTSConfig=void 0;var wqt=Ca();Jx.generateTSConfig=(0,wqt.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var vxe=_(m2=>{"use strict";var Sqt=m2&&m2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(m2,"__esModule",{value:true});m2.generateZuploJson=void 0;var Tqt=bb();var Aqt=require("fs/promises");var xqt=Sqt(require("path"));var Cqt=Kl();var yxe=wb();var Rqt=o(async function({name:t,sourceDirectory:e,logger:r}){const n={version:1,project:t,compatibilityDate:Tqt.DEFAULT_COMPATIBILITY_DATE};const i=xqt.default.join(e,Cqt.ZUPLO_PREFERRED_JSON_FILE);const s=JSON.stringify(n,null,2);try{await(0,Aqt.writeFile)(i,s,"utf-8")}catch(a){r.error(a);return new yxe.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new yxe.PluginResult},"generateZuploJson");m2.generateZuploJson=Rqt});var Exe=_(g2=>{"use strict";var Oqt=g2&&g2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(g2,"__esModule",{value:true});g2.create=void 0;var EY=bb();var Nqt=require("fs/promises");var Iqt=Oqt(require("path"));var Pqt=wb();var _xe=kAe();var Dqt=jAe();var kqt=zAe();var $qt=KAe();var Lqt=WAe();var qqt=QAe();var jqt=ZAe();var Uqt=exe();var Fqt=txe();var Mqt=rxe();var Bqt=nxe();var Vqt=ixe();var Hqt=axe();var zqt=fxe();var Gqt=mxe();var Kqt=gxe();var Yqt=vxe();async function Wqt({name:t,accountName:e="",rootDirectory:r,logger:n}){const i=(0,_xe.sanitize)(t);const s=(0,_xe.sanitize)(e);const a=Iqt.default.join(r,s,i);const u={name:t,sourceDirectory:a,logger:n};const l=[];if(await EY.xfs.dirExists(a)){throw new EY.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:EY.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`})}l.push(...[Dqt.createProjectDirs,Hqt.generateRouteOasConfig,Yqt.generateZuploJson,jqt.generateDevPortalConfigJson,qqt.generateDefaultModule,$qt.generateDefaultDocsSidebar,kqt.generateDefaultDocsMarkdown,Lqt.generateDefaultDocsTheme,Gqt.generatePoliciesConfig]);l.push(...[Kqt.generateTSConfig,Mqt.generateGitignore,zqt.generatePackageJson,Uqt.generateEnvironment,Fqt.generateESLint,Bqt.generateLaunchJson,Vqt.generateSettingsJson]);const{errors:c,warnings:d}=await(0,Pqt.runPlugins)(l,u);if(d.length>0){d.forEach(f=>{n.warn(f)})}if(c.length>0){await(0,Nqt.rm)(a,{recursive:true,force:true});const f=c[0];if(f instanceof Error){throw f}else{throw new Error(f.message)}}const p={sourceDirectory:a,projectName:t};return p}o(Wqt,"create");g2.create=Wqt});Object.defineProperty(exports,"__esModule",{value:true});exports.create=void 0;var Jqt=Exe();Object.defineProperty(exports,"create",{enumerable:true,get:function(){return Jqt.create}});
410
+ `+await t.crypto.sha256DigestHex(h);const y=await PNt(t.crypto,t.securityCredentials.secretAccessKey,a,t.region,n);const v=await K6(t.crypto,y,g);const w=`${DSe} Credential=${t.securityCredentials.accessKeyId}/${m}, SignedHeaders=${p}, Signature=${(0,kSe.fromArrayBufferToHex)(v)}`;return{amzDate:u.date?void 0:s,authorizationHeader:w,canonicalQuerystring:t.canonicalQuerystring}}o(DNt,"generateAuthenticationHeaderMap")});var mG=_(VA=>{"use strict";Object.defineProperty(VA,"__esModule",{value:true});VA.AwsClient=void 0;var kNt=$Se();var $Nt=cf();var Y6=class extends $Nt.BaseExternalAccountClient{static{o(this,"AwsClient")}constructor(e,r){super(e,r);this.environmentId=e.credential_source.environment_id;this.regionUrl=e.credential_source.region_url;this.securityCredentialsUrl=e.credential_source.url;this.regionalCredVerificationUrl=e.credential_source.regional_cred_verification_url;this.imdsV2SessionTokenUrl=e.credential_source.imdsv2_session_token_url;this.awsRequestSigner=null;this.region="";this.validateEnvironmentId()}validateEnvironmentId(){var e;const r=(e=this.environmentId)===null||e===void 0?void 0:e.match(/^(aws)(\d+)$/);if(!r||!this.regionalCredVerificationUrl){throw new Error('No valid AWS "credential_source" provided')}else if(parseInt(r[2],10)!==1){throw new Error(`aws version "${r[2]}" is not supported in the current build.`)}}async retrieveSubjectToken(){if(!this.awsRequestSigner){const i={};if(this.shouldUseMetadataServer()&&this.imdsV2SessionTokenUrl){i["x-aws-ec2-metadata-token"]=await this.getImdsV2SessionToken()}this.region=await this.getAwsRegion(i);this.awsRequestSigner=new kNt.AwsRequestSigner(async()=>{if(this.securityCredentialsFromEnv){return this.securityCredentialsFromEnv}const s=await this.getAwsRoleName(i);const a=await this.getAwsSecurityCredentials(s,i);return{accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,token:a.Token}},this.region)}const e=await this.awsRequestSigner.getRequestOptions({url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"});const r=[];const n=Object.assign({"x-goog-cloud-target-resource":this.audience},e.headers);for(const i in n){r.push({key:i,value:n[i]})}return encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}async getImdsV2SessionToken(){const e={url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};const r=await this.transporter.request(e);return r.data}async getAwsRegion(e){if(this.regionFromEnv){return this.regionFromEnv}if(!this.regionUrl){throw new Error('Unable to determine AWS region due to missing "options.credential_source.region_url"')}const r={url:this.regionUrl,method:"GET",responseType:"text",headers:e};const n=await this.transporter.request(r);return n.data.substr(0,n.data.length-1)}async getAwsRoleName(e){if(!this.securityCredentialsUrl){throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"')}const r={url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:e};const n=await this.transporter.request(r);return n.data}async getAwsSecurityCredentials(e,r){const n=await this.transporter.request({url:`${this.securityCredentialsUrl}/${e}`,responseType:"json",headers:r});return n.data}shouldUseMetadataServer(){return!this.regionFromEnv||!this.securityCredentialsFromEnv}get regionFromEnv(){return process.env["AWS_REGION"]||process.env["AWS_DEFAULT_REGION"]||null}get securityCredentialsFromEnv(){if(process.env["AWS_ACCESS_KEY_ID"]&&process.env["AWS_SECRET_ACCESS_KEY"]){return{accessKeyId:process.env["AWS_ACCESS_KEY_ID"],secretAccessKey:process.env["AWS_SECRET_ACCESS_KEY"],token:process.env["AWS_SESSION_TOKEN"]}}return null}};VA.AwsClient=Y6;Y6.AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";Y6.AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254"});var EG=_(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:true});pi.InvalidSubjectTokenError=pi.InvalidMessageFieldError=pi.InvalidCodeFieldError=pi.InvalidTokenTypeFieldError=pi.InvalidExpirationTimeFieldError=pi.InvalidSuccessFieldError=pi.InvalidVersionFieldError=pi.ExecutableResponseError=pi.ExecutableResponse=void 0;var HA="urn:ietf:params:oauth:token-type:saml2";var gG="urn:ietf:params:oauth:token-type:id_token";var yG="urn:ietf:params:oauth:token-type:jwt";var vG=class{static{o(this,"ExecutableResponse")}constructor(e){if(!e.version){throw new zA("Executable response must contain a 'version' field.")}if(e.success===void 0){throw new GA("Executable response must contain a 'success' field.")}this.version=e.version;this.success=e.success;if(this.success){this.expirationTime=e.expiration_time;this.tokenType=e.token_type;if(this.tokenType!==HA&&this.tokenType!==gG&&this.tokenType!==yG){throw new KA(`Executable response must contain a 'token_type' field when successful and it must be one of ${gG}, ${yG}, or ${HA}.`)}if(this.tokenType===HA){if(!e.saml_response){throw new W6(`Executable response must contain a 'saml_response' field when token_type=${HA}.`)}this.subjectToken=e.saml_response}else{if(!e.id_token){throw new W6(`Executable response must contain a 'id_token' field when token_type=${gG} or ${yG}.`)}this.subjectToken=e.id_token}}else{if(!e.code){throw new YA("Executable response must contain a 'code' field when unsuccessful.")}if(!e.message){throw new WA("Executable response must contain a 'message' field when unsuccessful.")}this.errorCode=e.code;this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};pi.ExecutableResponse=vG;var Bl=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e);Object.setPrototypeOf(this,new.target.prototype)}};pi.ExecutableResponseError=Bl;var zA=class extends Bl{static{o(this,"InvalidVersionFieldError")}};pi.InvalidVersionFieldError=zA;var GA=class extends Bl{static{o(this,"InvalidSuccessFieldError")}};pi.InvalidSuccessFieldError=GA;var _G=class extends Bl{static{o(this,"InvalidExpirationTimeFieldError")}};pi.InvalidExpirationTimeFieldError=_G;var KA=class extends Bl{static{o(this,"InvalidTokenTypeFieldError")}};pi.InvalidTokenTypeFieldError=KA;var YA=class extends Bl{static{o(this,"InvalidCodeFieldError")}};pi.InvalidCodeFieldError=YA;var WA=class extends Bl{static{o(this,"InvalidMessageFieldError")}};pi.InvalidMessageFieldError=WA;var W6=class extends Bl{static{o(this,"InvalidSubjectTokenError")}};pi.InvalidSubjectTokenError=W6});var LSe=_(JA=>{"use strict";Object.defineProperty(JA,"__esModule",{value:true});JA.PluggableAuthHandler=void 0;var LNt=QA();var Nm=EG();var qNt=require("child_process");var bG=require("fs");var wG=class t{static{o(this,"PluggableAuthHandler")}constructor(e){if(!e.command){throw new Error("No command provided.")}this.commandComponents=t.parseCommand(e.command);this.timeoutMillis=e.timeoutMillis;if(!this.timeoutMillis){throw new Error("No timeoutMillis provided.")}this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((r,n)=>{const i=qNt.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}});let s="";i.stdout.on("data",u=>{s+=u});i.stderr.on("data",u=>{s+=u});const a=setTimeout(()=>{i.removeAllListeners();i.kill();return n(new Error("The executable failed to finish within the timeout specified."))},this.timeoutMillis);i.on("close",u=>{clearTimeout(a);if(u===0){try{const l=JSON.parse(s);const c=new Nm.ExecutableResponse(l);return r(c)}catch(l){if(l instanceof Nm.ExecutableResponseError){return n(l)}return n(new Nm.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}}else{return n(new LNt.ExecutableError(s,u.toString()))}})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0){return void 0}let e;try{e=await bG.promises.realpath(this.outputFile)}catch(n){return void 0}if(!(await bG.promises.lstat(e)).isFile()){return void 0}const r=await bG.promises.readFile(e,{encoding:"utf8"});if(r===""){return void 0}try{const n=JSON.parse(r);const i=new Nm.ExecutableResponse(n);if(i.isValid()){return new Nm.ExecutableResponse(n)}return void 0}catch(n){if(n instanceof Nm.ExecutableResponseError){throw n}throw new Nm.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(e){const r=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r){throw new Error(`Provided command: "${e}" could not be parsed.`)}for(let n=0;n<r.length;n++){if(r[n][0]==='"'&&r[n].slice(-1)==='"'){r[n]=r[n].slice(1,-1)}}return r}};JA.PluggableAuthHandler=wG});var QA=_(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:true});Sy.PluggableAuthClient=Sy.ExecutableError=void 0;var jNt=cf();var UNt=EG();var FNt=LSe();var XA=class extends Error{static{o(this,"ExecutableError")}constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`);this.code=r;Object.setPrototypeOf(this,new.target.prototype)}};Sy.ExecutableError=XA;var MNt=30*1e3;var qSe=5*1e3;var jSe=120*1e3;var BNt="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES";var USe=1;var SG=class extends jNt.BaseExternalAccountClient{static{o(this,"PluggableAuthClient")}constructor(e,r){super(e,r);if(!e.credential_source.executable){throw new Error('No valid Pluggable Auth "credential_source" provided.')}this.command=e.credential_source.executable.command;if(!this.command){throw new Error('No valid Pluggable Auth "credential_source" provided.')}if(e.credential_source.executable.timeout_millis===void 0){this.timeoutMillis=MNt}else{this.timeoutMillis=e.credential_source.executable.timeout_millis;if(this.timeoutMillis<qSe||this.timeoutMillis>jSe){throw new Error(`Timeout must be between ${qSe} and ${jSe} milliseconds.`)}}this.outputFile=e.credential_source.executable.output_file;this.handler=new FNt.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile})}async retrieveSubjectToken(){if(process.env[BNt]!=="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 e=void 0;if(this.outputFile){e=await this.handler.retrieveCachedResponse()}if(!e){const r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience);r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType);r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0");if(this.outputFile){r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile)}const n=this.getServiceAccountEmail();if(n){r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n)}e=await this.handler.retrieveResponseFromExecutable(r)}if(e.version>USe){throw new Error(`Version of executable is not currently supported, maximum supported version is ${USe}.`)}if(!e.success){throw new XA(e.errorMessage,e.errorCode)}if(this.outputFile){if(!e.expirationTime){throw new UNt.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.")}}if(e.isExpired()){throw new Error("Executable response is expired.")}return e.subjectToken}};Sy.PluggableAuthClient=SG});var AG=_(ZA=>{"use strict";Object.defineProperty(ZA,"__esModule",{value:true});ZA.ExternalAccountClient=void 0;var VNt=cf();var HNt=fG();var zNt=mG();var GNt=QA();var TG=class{static{o(this,"ExternalAccountClient")}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(e,r){var n,i;if(e&&e.type===VNt.EXTERNAL_ACCOUNT_TYPE){if((n=e.credential_source)===null||n===void 0?void 0:n.environment_id){return new zNt.AwsClient(e,r)}else if((i=e.credential_source)===null||i===void 0?void 0:i.executable){return new GNt.PluggableAuthClient(e,r)}else{return new HNt.IdentityPoolClient(e,r)}}else{return null}}};ZA.ExternalAccountClient=TG});var MSe=_(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:true});Ty.ExternalAccountAuthorizedUserClient=Ty.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var KNt=ny();var FSe=rG();var YNt=Jc();var WNt=require("stream");var JNt=cf();Ty.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var xG=class extends FSe.OAuthClientAuthHandler{static{o(this,"ExternalAccountAuthorizedUserHandler")}constructor(e,r,n){super(n);this.url=e;this.transporter=r}async refreshToken(e,r){const n=new URLSearchParams({grant_type:"refresh_token",refresh_token:e});const i={"Content-Type":"application/x-www-form-urlencoded",...r};const s={url:this.url,method:"POST",headers:i,data:n.toString(),responseType:"json"};this.applyClientAuthenticationOptions(s);try{const a=await this.transporter.request(s);const u=a.data;u.res=a;return u}catch(a){if(a instanceof YNt.GaxiosError&&a.response){throw(0,FSe.getErrorFromOAuthErrorResponse)(a.response.data,a)}throw a}}};var CG=class extends KNt.AuthClient{static{o(this,"ExternalAccountAuthorizedUserClient")}constructor(e,r){super();this.refreshToken=e.refresh_token;const n={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new xG(e.token_url,this.transporter,n);this.cachedAccessToken=null;this.quotaProjectId=e.quota_project_id;if(typeof(r===null||r===void 0?void 0:r.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=JNt.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=r.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(r===null||r===void 0?void 0:r.forceRefreshOnFailure)}async getAccessToken(){if(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){const e=await this.getAccessToken();const r={Authorization:`Bearer ${e.token}`};return this.addSharedMetadataHeaders(r)}request(e,r){if(r){this.requestAsync(e).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(e)}}async requestAsync(e,r=false){let n;try{const i=await this.getRequestHeaders();e.headers=e.headers||{};if(i&&i["x-goog-user-project"]){e.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){e.headers.Authorization=i.Authorization}n=await this.transporter.request(e)}catch(i){const s=i.response;if(s){const a=s.status;const u=s.config.data instanceof WNt.Readable;const l=a===401||a===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(e,true)}}throw i}return n}async refreshAccessTokenAsync(){const e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res};if(e.refresh_token!==void 0){this.refreshToken=e.refresh_token}return this.cachedAccessToken}isExpired(e){const r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:false}};Ty.ExternalAccountAuthorizedUserClient=CG});var HSe=_(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:true});xy.GoogleAuth=xy.CLOUD_SDK_CLIENT_ID=void 0;var QNt=require("child_process");var J6=require("fs");var RG=G7();var XNt=require("os");var OG=require("path");var ZNt=ty();var eIt=N6();var tIt=jH();var rIt=FH();var nIt=MH();var Ay=Jz();var NG=Xz();var ex=eG();var iIt=AG();var Q6=cf();var BSe=MSe();xy.CLOUD_SDK_CLIENT_ID="764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com";var VSe={NO_PROJECT_ID_FOUND:"Unable to detect a Project Id in the current environment. \nTo learn more about authentication and Google APIs, visit: \nhttps://cloud.google.com/docs/authentication/getting-started"};var tx=class{static{o(this,"GoogleAuth")}get isGCE(){return this.checkIsGCE}constructor(e){this.checkIsGCE=void 0;this.jsonContent=null;this.cachedCredential=null;e=e||{};this._cachedProjectId=e.projectId||null;this.cachedCredential=e.authClient||null;this.keyFilename=e.keyFilename||e.keyFile;this.scopes=e.scopes;this.jsonContent=e.credentials||null;this.clientOptions=e.clientOptions}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath;e.useJWTAccessWithScope=this.useJWTAccessWithScope;e.defaultScopes=this.defaultScopes}getProjectId(e){if(e){this.getProjectIdAsync().then(r=>e(null,r),e)}else{return this.getProjectIdAsync()}}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===VSe.NO_PROJECT_ID_FOUND){return null}else{throw e}}}async findAndCacheProjectId(){let e=null;e||(e=await this.getProductionProjectId());e||(e=await this.getFileProjectId());e||(e=await this.getDefaultServiceProjectId());e||(e=await this.getGCEProjectId());e||(e=await this.getExternalAccountClientProjectId());if(e){this._cachedProjectId=e;return e}else{throw new Error(VSe.NO_PROJECT_ID_FOUND)}}async getProjectIdAsync(){if(this._cachedProjectId){return this._cachedProjectId}if(!this._findProjectIdPromise){this._findProjectIdPromise=this.findAndCacheProjectId()}return this._findProjectIdPromise}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e==="function"){r=e}else{n=e}if(r){this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r)}else{return this.getApplicationDefaultAsync(n)}}async getApplicationDefaultAsync(e={}){if(this.cachedCredential){return await this.prepareAndCacheADC(this.cachedCredential)}const r=process.env["GOOGLE_CLOUD_QUOTA_PROJECT"];let n;n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e);if(n){if(n instanceof Ay.JWT){n.scopes=this.scopes}else if(n instanceof Q6.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}n=await this._tryGetApplicationCredentialsFromWellKnownFile(e);if(n){if(n instanceof Ay.JWT){n.scopes=this.scopes}else if(n instanceof Q6.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}let i;try{i=await this._checkIsGCE()}catch(s){if(s instanceof Error){s.message=`Unexpected error determining execution environment: ${s.message}`}throw s}if(!i){throw new Error("Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.")}e.scopes=this.getAnyScopes();return await this.prepareAndCacheADC(new tIt.Compute(e),r)}async prepareAndCacheADC(e,r){const n=await this.getProjectIdOptional();if(r){e.quotaProjectId=r}this.cachedCredential=e;return{credential:e,projectId:n}}async _checkIsGCE(){if(this.checkIsGCE===void 0){this.checkIsGCE=await RG.isAvailable()}return this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){const r=process.env["GOOGLE_APPLICATION_CREDENTIALS"]||process.env["google_application_credentials"];if(!r||r.length===0){return null}try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){if(n instanceof Error){n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`}throw n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows()){r=process.env["APPDATA"]}else{const i=process.env["HOME"];if(i){r=OG.join(i,".config")}}if(r){r=OG.join(r,"gcloud","application_default_credentials.json");if(!J6.existsSync(r)){r=null}}if(!r){return null}const n=await this._getApplicationCredentialsFromFilePath(r,e);return n}async _getApplicationCredentialsFromFilePath(e,r={}){if(!e||e.length===0){throw new Error("The file path is invalid.")}try{e=J6.realpathSync(e);if(!J6.lstatSync(e).isFile()){throw new Error}}catch(i){if(i instanceof Error){i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`}throw i}const n=J6.createReadStream(e);return this.fromStream(n,r)}fromImpersonatedJSON(e){var r,n,i,s;if(!e){throw new Error("Must pass in a JSON object containing an impersonated refresh token")}if(e.type!==ex.IMPERSONATED_ACCOUNT_TYPE){throw new Error(`The incoming JSON object does not have the "${ex.IMPERSONATED_ACCOUNT_TYPE}" type`)}if(!e.source_credentials){throw new Error("The incoming JSON object does not contain a source_credentials field")}if(!e.service_account_impersonation_url){throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field")}const a=new NG.UserRefreshClient(e.source_credentials.client_id,e.source_credentials.client_secret,e.source_credentials.refresh_token);const u=(n=(r=/(?<target>[^/]+):generateAccessToken$/.exec(e.service_account_impersonation_url))===null||r===void 0?void 0:r.groups)===null||n===void 0?void 0:n.target;if(!u){throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`)}const l=(i=this.getAnyScopes())!==null&&i!==void 0?i:[];const c=new ex.Impersonated({delegates:(s=e.delegates)!==null&&s!==void 0?s:[],sourceClient:a,targetPrincipal:u,targetScopes:Array.isArray(l)?l:[l]});return c}fromJSON(e,r={}){let n;r=r||{};if(e.type===NG.USER_REFRESH_ACCOUNT_TYPE){n=new NG.UserRefreshClient(r);n.fromJSON(e)}else if(e.type===ex.IMPERSONATED_ACCOUNT_TYPE){n=this.fromImpersonatedJSON(e)}else if(e.type===Q6.EXTERNAL_ACCOUNT_TYPE){n=iIt.ExternalAccountClient.fromJSON(e,r);n.scopes=this.getAnyScopes()}else if(e.type===BSe.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE){n=new BSe.ExternalAccountAuthorizedUserClient(e,r)}else{r.scopes=this.scopes;n=new Ay.JWT(r);this.setGapicJWTValues(n);n.fromJSON(e)}return n}_cacheClientFromJSON(e,r){const n=this.fromJSON(e,r);this.jsonContent=e;this.cachedCredential=n;return n}fromStream(e,r={},n){let i={};if(typeof r==="function"){n=r}else{i=r}if(n){this.fromStreamAsync(e,i).then(s=>n(null,s),n)}else{return this.fromStreamAsync(e,i)}}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e){throw new Error("Must pass in a stream containing the Google auth settings.")}let s="";e.setEncoding("utf8").on("error",i).on("data",a=>s+=a).on("end",()=>{try{try{const a=JSON.parse(s);const u=this._cacheClientFromJSON(a,r);return n(u)}catch(a){if(!this.keyFilename)throw a;const u=new Ay.JWT({...this.clientOptions,keyFile:this.keyFilename});this.cachedCredential=u;this.setGapicJWTValues(u);return n(u)}}catch(a){return i(a)}})})}fromAPIKey(e,r){r=r||{};const n=new Ay.JWT(r);n.fromAPIKey(e);return n}_isWindows(){const e=XNt.platform();if(e&&e.length>=3){if(e.substring(0,3).toLowerCase()==="win"){return true}}return false}async getDefaultServiceProjectId(){return new Promise(e=>{(0,QNt.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n){try{const i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch(i){}}e(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){const r=await this.getClient();if(r&&r.projectId){return r.projectId}}const e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();if(e){return e.projectId}else{return null}}async getExternalAccountClientProjectId(){if(!this.jsonContent||this.jsonContent.type!==Q6.EXTERNAL_ACCOUNT_TYPE){return null}const e=await this.getClient();return await e.getProjectId()}async getGCEProjectId(){try{const e=await RG.project("project-id");return e}catch(e){return null}}getCredentials(e){if(e){this.getCredentialsAsync().then(r=>e(null,r),e)}else{return this.getCredentialsAsync()}}async getCredentialsAsync(){const e=await this.getClient();if(e instanceof Q6.BaseExternalAccountClient){const i=e.getServiceAccountEmail();if(i){return{client_email:i}}}if(this.jsonContent){const i={client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key};return i}const r=await this._checkIsGCE();if(!r){throw new Error("Unknown error.")}const n=await RG.instance({property:"service-accounts/",params:{recursive:"true"}});if(!n||!n.default||!n.default.email){throw new Error("Failure from metadata server.")}return{client_email:n.default.email}}async getClient(){if(!this.cachedCredential){if(this.jsonContent){this._cacheClientFromJSON(this.jsonContent,this.clientOptions)}else if(this.keyFilename){const e=OG.resolve(this.keyFilename);const r=J6.createReadStream(e);await this.fromStreamAsync(r,this.clientOptions)}else{await this.getApplicationDefaultAsync(this.clientOptions)}}return this.cachedCredential}async getIdTokenClient(e){const r=await this.getClient();if(!("fetchIdToken"in r)){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 rIt.IdTokenClient({targetAudience:e,idTokenProvider:r})}async getAccessToken(){const e=await this.getClient();return(await e.getAccessToken()).token}async getRequestHeaders(e){const r=await this.getClient();return r.getRequestHeaders(e)}async authorizeRequest(e){e=e||{};const r=e.url||e.uri;const n=await this.getClient();const i=await n.getRequestHeaders(r);e.headers=Object.assign(e.headers||{},i);return e}async request(e){const r=await this.getClient();return r.request(e)}getEnv(){return(0,nIt.getEnv)()}async sign(e){const r=await this.getClient();const n=(0,ZNt.createCrypto)();if(r instanceof Ay.JWT&&r.key){const s=await n.sign(r.key,e);return s}const i=await this.getCredentials();if(!i.client_email){throw new Error("Cannot sign data without `client_email`.")}return this.signBlob(n,i.client_email,e)}async signBlob(e,r,n){const i=`https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/${r}:signBlob`;const s=await this.request({method:"POST",url:i,data:{payload:e.encodeBase64StringUtf8(n)}});return s.data.signedBlob}};xy.GoogleAuth=tx;tx.DefaultTransporter=eIt.DefaultTransporter});var zSe=_(rx=>{"use strict";Object.defineProperty(rx,"__esModule",{value:true});rx.IAMAuth=void 0;var IG=class{static{o(this,"IAMAuth")}constructor(e,r){this.selector=e;this.token=r;this.selector=e;this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};rx.IAMAuth=IG});var GSe=_(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:true});Du.DownscopedClient=Du.EXPIRATION_TIME_OFFSET=Du.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var sIt=require("stream");var aIt=ny();var oIt=iG();var uIt="urn:ietf:params:oauth:grant-type:token-exchange";var lIt="urn:ietf:params:oauth:token-type:access_token";var cIt="urn:ietf:params:oauth:token-type:access_token";var dIt="https://sts.googleapis.com/v1/token";Du.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Du.EXPIRATION_TIME_OFFSET=5*60*1e3;var PG=class extends aIt.AuthClient{static{o(this,"DownscopedClient")}constructor(e,r,n,i){super();this.authClient=e;this.credentialAccessBoundary=r;if(r.accessBoundary.accessBoundaryRules.length===0){throw new Error("At least one access boundary rule needs to be defined.")}else if(r.accessBoundary.accessBoundaryRules.length>Du.MAX_ACCESS_BOUNDARY_RULES_COUNT){throw new Error(`The provided access boundary has more than ${Du.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`)}for(const s of r.accessBoundary.accessBoundaryRules){if(s.availablePermissions.length===0){throw new Error("At least one permission should be defined in access boundary rules.")}}this.stsCredential=new oIt.StsCredentials(dIt);this.cachedDownscopedAccessToken=null;if(typeof(n===null||n===void 0?void 0:n.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=Du.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=n.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(n===null||n===void 0?void 0:n.forceRefreshOnFailure);this.quotaProjectId=i}setCredentials(e){if(!e.expiry_date){throw new Error("The access token expiry_date field is missing in the provided credentials.")}super.setCredentials(e);this.cachedDownscopedAccessToken=e}async getAccessToken(){if(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){const e=await this.getAccessToken();const r={Authorization:`Bearer ${e.token}`};return this.addSharedMetadataHeaders(r)}request(e,r){if(r){this.requestAsync(e).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(e)}}async requestAsync(e,r=false){let n;try{const i=await this.getRequestHeaders();e.headers=e.headers||{};if(i&&i["x-goog-user-project"]){e.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){e.headers.Authorization=i.Authorization}n=await this.transporter.request(e)}catch(i){const s=i.response;if(s){const a=s.status;const u=s.config.data instanceof sIt.Readable;const l=a===401||a===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(e,true)}}throw i}return n}async refreshAccessTokenAsync(){var e;const r=(await this.authClient.getAccessToken()).token;const n={grantType:uIt,requestedTokenType:lIt,subjectToken:r,subjectTokenType:cIt};const i=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary);const s=((e=this.authClient.credentials)===null||e===void 0?void 0:e.expiry_date)||null;const a=i.expires_in?new Date().getTime()+i.expires_in*1e3:s;this.cachedDownscopedAccessToken={access_token:i.access_token,expiry_date:a,res:i.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});return this.cachedDownscopedAccessToken}isExpired(e){const r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:false}};Du.DownscopedClient=PG});var DG=_(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:true});Ot.GoogleAuth=Ot.auth=Ot.DefaultTransporter=Ot.PluggableAuthClient=Ot.DownscopedClient=Ot.BaseExternalAccountClient=Ot.ExternalAccountClient=Ot.IdentityPoolClient=Ot.AwsClient=Ot.UserRefreshClient=Ot.LoginTicket=Ot.OAuth2Client=Ot.CodeChallengeMethod=Ot.Impersonated=Ot.JWT=Ot.JWTAccess=Ot.IdTokenClient=Ot.IAMAuth=Ot.GCPEnv=Ot.Compute=Ot.AuthClient=void 0;var KSe=HSe();Object.defineProperty(Ot,"GoogleAuth",{enumerable:true,get:function(){return KSe.GoogleAuth}});var pIt=ny();Object.defineProperty(Ot,"AuthClient",{enumerable:true,get:function(){return pIt.AuthClient}});var fIt=jH();Object.defineProperty(Ot,"Compute",{enumerable:true,get:function(){return fIt.Compute}});var hIt=MH();Object.defineProperty(Ot,"GCPEnv",{enumerable:true,get:function(){return hIt.GCPEnv}});var mIt=zSe();Object.defineProperty(Ot,"IAMAuth",{enumerable:true,get:function(){return mIt.IAMAuth}});var gIt=FH();Object.defineProperty(Ot,"IdTokenClient",{enumerable:true,get:function(){return gIt.IdTokenClient}});var yIt=Yz();Object.defineProperty(Ot,"JWTAccess",{enumerable:true,get:function(){return yIt.JWTAccess}});var vIt=Jz();Object.defineProperty(Ot,"JWT",{enumerable:true,get:function(){return vIt.JWT}});var _It=eG();Object.defineProperty(Ot,"Impersonated",{enumerable:true,get:function(){return _It.Impersonated}});var YSe=Em();Object.defineProperty(Ot,"CodeChallengeMethod",{enumerable:true,get:function(){return YSe.CodeChallengeMethod}});Object.defineProperty(Ot,"OAuth2Client",{enumerable:true,get:function(){return YSe.OAuth2Client}});var EIt=$H();Object.defineProperty(Ot,"LoginTicket",{enumerable:true,get:function(){return EIt.LoginTicket}});var bIt=Xz();Object.defineProperty(Ot,"UserRefreshClient",{enumerable:true,get:function(){return bIt.UserRefreshClient}});var wIt=mG();Object.defineProperty(Ot,"AwsClient",{enumerable:true,get:function(){return wIt.AwsClient}});var SIt=fG();Object.defineProperty(Ot,"IdentityPoolClient",{enumerable:true,get:function(){return SIt.IdentityPoolClient}});var TIt=AG();Object.defineProperty(Ot,"ExternalAccountClient",{enumerable:true,get:function(){return TIt.ExternalAccountClient}});var AIt=cf();Object.defineProperty(Ot,"BaseExternalAccountClient",{enumerable:true,get:function(){return AIt.BaseExternalAccountClient}});var xIt=GSe();Object.defineProperty(Ot,"DownscopedClient",{enumerable:true,get:function(){return xIt.DownscopedClient}});var CIt=QA();Object.defineProperty(Ot,"PluggableAuthClient",{enumerable:true,get:function(){return CIt.PluggableAuthClient}});var RIt=N6();Object.defineProperty(Ot,"DefaultTransporter",{enumerable:true,get:function(){return RIt.DefaultTransporter}});var OIt=new KSe.GoogleAuth;Ot.auth=OIt});var Ry=_(Cy=>{"use strict";var NIt=Cy&&Cy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Cy,"__esModule",{value:true});Cy.getServiceAccountIdToken=void 0;var IIt=DG();var PIt=NIt(ru());var DIt=new IIt.GoogleAuth;var WSe=new PIt.default({max:50,maxAge:1e3*60*50});async function kIt(t){let e=WSe.get(t);if(!e){const r=await DIt.getIdTokenClient(t);e=await r.idTokenProvider.fetchIdToken(t);WSe.set(t,e)}return e}o(kIt,"getServiceAccountIdToken");Cy.getServiceAccountIdToken=kIt});var eTe=_(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:true});Fo.mergeHeaders=Fo.createFinalURL=Fo.defaultBodySerializer=Fo.defaultQuerySerializer=Fo.createClient=void 0;var Oy=As();var $It=Ry();var LIt=/\/*$/;async function qIt(t){const{baseUrl:e,fetch:r=globalThis.fetch,querySerializer:n,bodySerializer:i,zuploExtensions:s,...a}=t;const u=s?.fastifyRequest.log;const l=s?.fastifyRequest.id;const c=s?.options?.userSub??s?.fastifyRequest.getUserSub();const d=new Headers({"zuplo-user":c,"zp-rid":l,...a.headers??{}});const p=await(0,$It.getServiceAccountIdToken)(e);d.set("Authorization",`Bearer ${p}`);if(["GET","DELETE","HEAD","OPTIONS","TRACE"].includes(a.method?.toUpperCase()??"")){d.delete("Content-Type")}else{d.set("Content-Type","application/json")}async function f(h,m){const{headers:g,body:y,params:v={},parseAs:w="json",querySerializer:E=n??JSe,bodySerializer:b=i??QSe,...S}=m||{};const T=XSe(h,{baseUrl:e,params:v,querySerializer:E});const A=ZSe(d,g,v.header);const R={redirect:"follow",...a,...S,headers:A};if(y)R.body=b(y);if(R.body instanceof FormData)A.delete("Content-Type");const O=await r(T,R);if(O.status===404){const j=await O.json();if(j&&j.hasOwnProperty("type")&&j.hasOwnProperty("title")&&j.hasOwnProperty("status")){throw new Oy.ApiError(j)}throw new Oy.ApiError(Oy.Problems.NOT_FOUND)}if(O.status===204||O.headers.get("Content-Length")==="0"){return O.ok?{data:{},response:O}:{error:{},response:O}}if(O.ok){let j=O.body;if(w!=="stream"){const B=O.clone();j=typeof B[w]==="function"?await B[w]():await B.text()}return{data:j,response:O}}else{u.debug(`Error on internal api: path: ${T}, status: ${O.status}, headers: ${JSON.stringify(O.headers)}, body: ${await O.clone().text()}`);let j={};try{j=await O.clone().json();if(j.type&&j.status&&j.title){throw new Oy.ApiError(j)}}catch(B){}throw new Oy.ApiError(Oy.Problems.INTERNAL_SERVER_ERROR)}}o(f,"coreFetch");return{async GET(h,m){return f(h,{...m,method:"GET"})},async PUT(h,m){return f(h,{...m,method:"PUT"})},async POST(h,m){return f(h,{...m,method:"POST"})},async DELETE(h,m){return f(h,{...m,method:"DELETE"})},async OPTIONS(h,m){return f(h,{...m,method:"OPTIONS"})},async HEAD(h,m){return f(h,{...m,method:"HEAD"})},async PATCH(h,m){return f(h,{...m,method:"PATCH"})},async TRACE(h,m){return f(h,{...m,method:"TRACE"})}}}o(qIt,"createClient");Fo.createClient=qIt;function JSe(t){const e=new URLSearchParams;if(t&&typeof t==="object"){for(const[r,n]of Object.entries(t)){if(n===void 0||n===null)continue;e.set(r,n)}}return e.toString()}o(JSe,"defaultQuerySerializer");Fo.defaultQuerySerializer=JSe;function QSe(t){return JSON.stringify(t)}o(QSe,"defaultBodySerializer");Fo.defaultBodySerializer=QSe;function XSe(t,e){let r=`${e.baseUrl?e.baseUrl.replace(LIt,""):""}${t}`;if(e.params.path){for(const[n,i]of Object.entries(e.params.path))r=r.replace(`{${n}}`,encodeURIComponent(String(i)))}if(e.params.query){const n=e.querySerializer(e.params.query);if(n)r+=`?${n}`}return r}o(XSe,"createFinalURL");Fo.createFinalURL=XSe;function ZSe(...t){const e=new Headers;for(const r of t){if(!r||typeof r!=="object")continue;const n=r instanceof Headers?r.entries():Object.entries(r);for(const[i,s]of n){if(s!==void 0&&s!==null){e.set(i,s)}}}return e}o(ZSe,"mergeHeaders");Fo.mergeHeaders=ZSe});var tTe=_(df=>{"use strict";var jIt=df&&df.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(df,"__esModule",{value:true});df.ApiKeyService=df.createApiKeyServiceClient=void 0;var Ny=As();var UIt=DG();var nx=jIt(Oa());var FIt=eTe();async function MIt(t){return(0,FIt.createClient)({baseUrl:nx.default.API_KEY_MANAGEMENT_SERVICE_URL,zuploExtensions:{fastifyRequest:t}})}o(MIt,"createApiKeyServiceClient");df.createApiKeyServiceClient=MIt;var kG=class{static{o(this,"ApiKeyService")}logger;requestId;constructor(e){this.logger=e.log;this.requestId=e.id}async fetchGCP(e,r={}){this.logger.info(`Fetching with GCP JWT ${r.method} ${e} from Api Key Service API.`);const n=new UIt.GoogleAuth;const i=await n.getIdTokenClient(nx.default.API_KEY_MANAGEMENT_SERVICE_URL);this.logger.info(`Payload to send: ${JSON.stringify({url:`${nx.default.API_KEY_MANAGEMENT_SERVICE_URL}/${e}`,method:"GET",body:r.body,headers:{...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}}})}`);const s=await i.getRequestHeaders();const a=await i.request({url:`${nx.default.API_KEY_MANAGEMENT_SERVICE_URL}/${e}`,method:r.method||"GET",body:r.body,headers:{...s,...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}},validateStatus:u=>u>=200&&u<500});if(a.status===404){const u=await a.data;if(u&&u.hasOwnProperty("type")&&u.hasOwnProperty("title")&&u.hasOwnProperty("status")){throw new Ny.ApiError(u)}throw new Ny.ApiError(Ny.Problems.NOT_FOUND)}if(a.status>=300){this.logger.debug(`Error on api-key-service: path: ${e}, status: ${a.status}, headers: ${JSON.stringify(a.headers)}, body: ${JSON.stringify(a.data)}`);const u=a.data;if(u.type&&u.status&&u.title){throw new Ny.ApiError(u)}this.logger.error(`Error not handled on api-key-service: path: ${e}, status: ${a.status}`);throw new Ny.ApiError(Ny.Problems.INTERNAL_SERVER_ERROR)}if(a.status===204){return{}}return a.data}};df.ApiKeyService=kG});var nTe=_(Iy=>{"use strict";var BIt=Iy&&Iy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Iy,"__esModule",{value:true});Iy.AuthApiService=void 0;var Im=As();var rTe=BIt(Oa());var VIt=Ry();var $G=class{static{o(this,"AuthApiService")}logger;requestId;baseUrl;constructor(e){this.logger=e.log;this.requestId=e.id;if(!rTe.default.AUTH_API_URL){throw new Error("AUTH_API_URL is not set")}this.baseUrl=rTe.default.AUTH_API_URL}async getClientJWT(e,r){let n;try{n=await this.fetch(`/v1/clients/${e}`,{method:"GET"})}catch(s){if(s.status===Im.Problems.NOT_FOUND.status){n=await this.fetch(`/v1/clients`,{method:"POST",body:JSON.stringify({client_id:e})})}else{throw s}}const i=await this.fetch(`/v1/oauth/token`,{method:"POST",body:JSON.stringify({client_id:e,client_secret:n.client_secret,grant_type:"client_credentials",custom_claims:r})});return i.access_token}async fetch(e,r){this.logger.info(`Fetching internally ${e} from Auth API V2.`);const n=new Headers({"content-type":"application/json","zp-rid":this.requestId,authorization:""});if(process.env.K_SERVICE){const s=await(0,VIt.getServiceAccountIdToken)(this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${e}`,{...r,headers:n});if(i.status===Im.HttpStatusCode.NOT_FOUND){throw new Im.ApiError(Im.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on auth-api: path: ${e}, status: ${i.status}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new Im.ApiError(s)}this.logger.error(`Error not handled on auth-api: path: ${e}, status: ${i.status}`);throw new Im.ApiError(Im.Problems.INTERNAL_SERVER_ERROR)}return i.clone().json()}};Iy.AuthApiService=$G});var X6=_(ix=>{"use strict";Object.defineProperty(ix,"__esModule",{value:true});ix.ApiServiceClient=void 0;var Py=As();var HIt=Ry();var LG=class{static{o(this,"ApiServiceClient")}userSub;logger;requestId;baseUrl;cache;targetAudience;constructor(e,r,n){this.userSub=n.userSub;this.logger=n.logger;this.requestId=n.requestId;this.baseUrl=e;this.cache=r;this.targetAudience=n.targetAudience}async cachedFetch(e,r,n){if(!this.userSub||!n){throw new Error("userSub and cacheKey parameters are required to use cachedFetch")}const i=`${this.userSub}@${n}`;if(this.cache.has(i)){return this.cache.get(i)}const s=await this.fetchInternally(e,r);this.cache.set(i,s);return s}async fetchInternally(e,r){this.logger.info(`Fetching internally ${r.method} ${this.baseUrl}${e}`);const n=new Headers({...r.headers,"zuplo-user":this.userSub,"content-type":"application/json","zp-rid":this.requestId});if(process.env.K_SERVICE){const s=await(0,HIt.getServiceAccountIdToken)(this.targetAudience??this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${e}`,{...r,headers:n});if(i.status===404){this.logger.debug(`Error on internal api: path: ${e}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.json();if(s&&s.hasOwnProperty("type")&&s.hasOwnProperty("title")&&s.hasOwnProperty("status")){throw new Py.ApiError(s)}throw new Py.ApiError(Py.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on internal api: path: ${e}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new Py.ApiError(s)}this.logger.error(`Error not handled on internal api: path: ${e}, status: ${i.status}`);throw new Py.ApiError(Py.Problems.INTERNAL_SERVER_ERROR)}if(i.status===204){return{}}return i.clone().json()}};ix.ApiServiceClient=LG});var oTe=_(Vl=>{"use strict";var sTe=Vl&&Vl.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Vl,"__esModule",{value:true});Vl.ContentApiService=Vl.getContentApiStorageTarballPath=Vl.contentApiTarballFileName=void 0;var zIt=sTe(ru());var iTe=sTe(Oa());var GIt=X6();var KIt=new zIt.default({max:500,maxAge:1e3*60*50});function aTe(t,e){return`${t}--${e}.tar.gz`}o(aTe,"contentApiTarballFileName");Vl.contentApiTarballFileName=aTe;function YIt(t,e){const r=aTe(t,e);return`${t}/builds/${r}`}o(YIt,"getContentApiStorageTarballPath");Vl.getContentApiStorageTarballPath=YIt;var qG=class extends GIt.ApiServiceClient{static{o(this,"ContentApiService")}constructor(e){if(!iTe.default.CONTENT_API_URL){throw new Error("CONTENT_API_URL is not set")}super(iTe.default.CONTENT_API_URL,KIt,e)}};Vl.ContentApiService=qG});var cTe=_(Dy=>{"use strict";var lTe=Dy&&Dy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Dy,"__esModule",{value:true});Dy.DevApiService=void 0;var WIt=lTe(ru());var uTe=lTe(Oa());var JIt=X6();var QIt=new WIt.default({max:500,maxAge:1e3*60*50});var jG=class extends JIt.ApiServiceClient{static{o(this,"DevApiService")}constructor(e,r){if(!uTe.default.DEV_API_URL){throw new Error("DEV_API_URL is not set")}const n=r&&r.userSub?r.userSub:e.getUserSub();super(uTe.default.DEV_API_URL,QIt,{userSub:n,logger:e.log,requestId:e.id})}};Dy.DevApiService=jG});var fTe=_((Ihr,pTe)=>{var dTe=require("stream").Stream;var XIt=require("util");pTe.exports=ku;function ku(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}o(ku,"DelayedStream");XIt.inherits(ku,dTe);ku.create=function(t,e){var r=new this;e=e||{};for(var n in e){r[n]=e[n]}r.source=t;var i=t.emit;t.emit=function(){r._handleEmit(arguments);return i.apply(t,arguments)};t.on("error",function(){});if(r.pauseStream){t.pause()}return r};Object.defineProperty(ku.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});ku.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ku.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};ku.prototype.pause=function(){this.source.pause()};ku.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this));this._bufferedEvents=[]};ku.prototype.pipe=function(){var t=dTe.prototype.pipe.apply(this,arguments);this.resume();return t};ku.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}if(t[0]==="data"){this.dataSize+=t[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(t)};ku.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}});var yTe=_((Dhr,gTe)=>{var ZIt=require("util");var mTe=require("stream").Stream;var hTe=fTe();gTe.exports=Xn;function Xn(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}o(Xn,"CombinedStream");ZIt.inherits(Xn,mTe);Xn.create=function(t){var e=new this;t=t||{};for(var r in t){e[r]=t[r]}return e};Xn.isStreamLike=function(t){return typeof t!=="function"&&typeof t!=="string"&&typeof t!=="boolean"&&typeof t!=="number"&&!Buffer.isBuffer(t)};Xn.prototype.append=function(t){var e=Xn.isStreamLike(t);if(e){if(!(t instanceof hTe)){var r=hTe.create(t,{maxDataSize:Infinity,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this));t=r}this._handleErrors(t);if(this.pauseStreams){t.pause()}}this._streams.push(t);return this};Xn.prototype.pipe=function(t,e){mTe.prototype.pipe.call(this,t,e);this.resume();return t};Xn.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};Xn.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t=="undefined"){this.end();return}if(typeof t!=="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=Xn.isStreamLike(r);if(n){r.on("data",this._checkDataSize.bind(this));this._handleErrors(r)}this._pipeNext(r)}.bind(this))};Xn.prototype._pipeNext=function(t){this._currentStream=t;var e=Xn.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this));t.pipe(this,{end:false});return}var r=t;this.write(r);this._getNext()};Xn.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};Xn.prototype.write=function(t){this.emit("data",t)};Xn.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};Xn.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};Xn.prototype.end=function(){this._reset();this.emit("end")};Xn.prototype.destroy=function(){this._reset();this.emit("close")};Xn.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};Xn.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))};Xn.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){if(!e.dataSize){return}t.dataSize+=e.dataSize});if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};Xn.prototype._emitError=function(t){this._reset();this.emit("error",t)}});var _Te=_(($hr,vTe)=>{vTe.exports=ePt;function ePt(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(e){e(t)}else{setTimeout(t,0)}}o(ePt,"defer")});var UG=_((qhr,bTe)=>{var ETe=_Te();bTe.exports=tPt;function tPt(t){var e=false;ETe(function(){e=true});return o(function r(n,i){if(e){t(n,i)}else{ETe(o(function s(){t(n,i)},"nextTick_callback"))}},"async_callback")}o(tPt,"async")});var FG=_((Uhr,wTe)=>{wTe.exports=rPt;function rPt(t){Object.keys(t.jobs).forEach(nPt.bind(t));t.jobs={}}o(rPt,"abort");function nPt(t){if(typeof this.jobs[t]=="function"){this.jobs[t]()}}o(nPt,"clean")});var MG=_((Mhr,TTe)=>{var STe=UG();var iPt=FG();TTe.exports=sPt;function sPt(t,e,r,n){var i=r["keyedList"]?r["keyedList"][r.index]:r.index;r.jobs[i]=aPt(e,i,t[i],function(s,a){if(!(i in r.jobs)){return}delete r.jobs[i];if(s){iPt(r)}else{r.results[i]=a}n(s,r.results)})}o(sPt,"iterate");function aPt(t,e,r,n){var i;if(t.length==2){i=t(r,STe(n))}else{i=t(r,e,STe(n))}return i}o(aPt,"runJob")});var BG=_((Vhr,ATe)=>{ATe.exports=oPt;function oPt(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};if(e){n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])})}return n}o(oPt,"state")});var VG=_((zhr,xTe)=>{var uPt=FG();var lPt=UG();xTe.exports=cPt;function cPt(t){if(!Object.keys(this.jobs).length){return}this.index=this.size;uPt(this);lPt(t)(null,this.results)}o(cPt,"terminator")});var RTe=_((Khr,CTe)=>{var dPt=MG();var pPt=BG();var fPt=VG();CTe.exports=hPt;function hPt(t,e,r){var n=pPt(t);while(n.index<(n["keyedList"]||t).length){dPt(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}});n.index++}return fPt.bind(n,r)}o(hPt,"parallel")});var HG=_((Whr,sx)=>{var OTe=MG();var mPt=BG();var gPt=VG();sx.exports=yPt;sx.exports.ascending=NTe;sx.exports.descending=vPt;function yPt(t,e,r,n){var i=mPt(t,r);OTe(t,e,i,o(function s(a,u){if(a){n(a,u);return}i.index++;if(i.index<(i["keyedList"]||t).length){OTe(t,e,i,s);return}n(null,i.results)},"iteratorHandler"));return gPt.bind(i,n)}o(yPt,"serialOrdered");function NTe(t,e){return t<e?-1:t>e?1:0}o(NTe,"ascending");function vPt(t,e){return-1*NTe(t,e)}o(vPt,"descending")});var PTe=_((Qhr,ITe)=>{var _Pt=HG();ITe.exports=EPt;function EPt(t,e,r){return _Pt(t,e,null,r)}o(EPt,"serial")});var kTe=_((Zhr,DTe)=>{DTe.exports={parallel:RTe(),serial:PTe(),serialOrdered:HG()}});var LTe=_((emr,$Te)=>{$Te.exports=function(t,e){Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]});return t}});var UTe=_((tmr,jTe)=>{var YG=yTe();var qTe=require("util");var zG=require("path");var bPt=require("http");var wPt=require("https");var SPt=require("url").parse;var TPt=require("fs");var APt=require("stream").Stream;var GG=RM();var xPt=kTe();var KG=LTe();jTe.exports=Fr;qTe.inherits(Fr,YG);function Fr(t){if(!(this instanceof Fr)){return new Fr(t)}this._overheadLength=0;this._valueLength=0;this._valuesToMeasure=[];YG.call(this);t=t||{};for(var e in t){this[e]=t[e]}}o(Fr,"FormData");Fr.LINE_BREAK="\r\n";Fr.DEFAULT_CONTENT_TYPE="application/octet-stream";Fr.prototype.append=function(t,e,r){r=r||{};if(typeof r=="string"){r={filename:r}}var n=YG.prototype.append.bind(this);if(typeof e=="number"){e=""+e}if(qTe.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r);var s=this._multiPartFooter();n(i);n(e);n(s);this._trackLength(i,e,r)};Fr.prototype._trackLength=function(t,e,r){var n=0;if(r.knownLength!=null){n+=+r.knownLength}else if(Buffer.isBuffer(e)){n=e.length}else if(typeof e==="string"){n=Buffer.byteLength(e)}this._valueLength+=n;this._overheadLength+=Buffer.byteLength(t)+Fr.LINE_BREAK.length;if(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof APt)){return}if(!r.knownLength){this._valuesToMeasure.push(e)}};Fr.prototype._lengthRetriever=function(t,e){if(t.hasOwnProperty("fd")){if(t.end!=void 0&&t.end!=Infinity&&t.start!=void 0){e(null,t.end+1-(t.start?t.start:0))}else{TPt.stat(t.path,function(r,n){var i;if(r){e(r);return}i=n.size-(t.start?t.start:0);e(null,i)})}}else if(t.hasOwnProperty("httpVersion")){e(null,+t.headers["content-length"])}else if(t.hasOwnProperty("httpModule")){t.on("response",function(r){t.pause();e(null,+r.headers["content-length"])});t.resume()}else{e("Unknown stream")}};Fr.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string"){return r.header}var n=this._getContentDisposition(e,r);var i=this._getContentType(e,r);var s="";var a={"Content-Disposition":["form-data",'name="'+t+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};if(typeof r.header=="object"){KG(a,r.header)}var u;for(var l in a){if(!a.hasOwnProperty(l))continue;u=a[l];if(u==null){continue}if(!Array.isArray(u)){u=[u]}if(u.length){s+=l+": "+u.join("; ")+Fr.LINE_BREAK}}return"--"+this.getBoundary()+Fr.LINE_BREAK+s+Fr.LINE_BREAK};Fr.prototype._getContentDisposition=function(t,e){var r,n;if(typeof e.filepath==="string"){r=zG.normalize(e.filepath).replace(/\\/g,"/")}else if(e.filename||t.name||t.path){r=zG.basename(e.filename||t.name||t.path)}else if(t.readable&&t.hasOwnProperty("httpVersion")){r=zG.basename(t.client._httpMessage.path||"")}if(r){n='filename="'+r+'"'}return n};Fr.prototype._getContentType=function(t,e){var r=e.contentType;if(!r&&t.name){r=GG.lookup(t.name)}if(!r&&t.path){r=GG.lookup(t.path)}if(!r&&t.readable&&t.hasOwnProperty("httpVersion")){r=t.headers["content-type"]}if(!r&&(e.filepath||e.filename)){r=GG.lookup(e.filepath||e.filename)}if(!r&&typeof t=="object"){r=Fr.DEFAULT_CONTENT_TYPE}return r};Fr.prototype._multiPartFooter=function(){return function(t){var e=Fr.LINE_BREAK;var r=this._streams.length===0;if(r){e+=this._lastBoundary()}t(e)}.bind(this)};Fr.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Fr.LINE_BREAK};Fr.prototype.getHeaders=function(t){var e;var r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t){if(t.hasOwnProperty(e)){r[e.toLowerCase()]=t[e]}}return r};Fr.prototype.setBoundary=function(t){this._boundary=t};Fr.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};Fr.prototype.getBuffer=function(){var t=new Buffer.alloc(0);var e=this.getBoundary();for(var r=0,n=this._streams.length;r<n;r++){if(typeof this._streams[r]!=="function"){if(Buffer.isBuffer(this._streams[r])){t=Buffer.concat([t,this._streams[r]])}else{t=Buffer.concat([t,Buffer.from(this._streams[r])])}if(typeof this._streams[r]!=="string"||this._streams[r].substring(2,e.length+2)!==e){t=Buffer.concat([t,Buffer.from(Fr.LINE_BREAK)])}}}return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Fr.prototype._generateBoundary=function(){var t="--------------------------";for(var e=0;e<24;e++){t+=Math.floor(Math.random()*10).toString(16)}this._boundary=t};Fr.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;if(this._streams.length){t+=this._lastBoundary().length}if(!this.hasKnownLength()){this._error(new Error("Cannot calculate proper length in synchronous way."))}return t};Fr.prototype.hasKnownLength=function(){var t=true;if(this._valuesToMeasure.length){t=false}return t};Fr.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length){e+=this._lastBoundary().length}if(!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}xPt.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i});t(null,e)})};Fr.prototype.submit=function(t,e){var r,n,i={method:"post"};if(typeof t=="string"){t=SPt(t);n=KG({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)}else{n=KG(t,i);if(!n.port){n.port=n.protocol=="https:"?443:80}}n.headers=this.getHeaders(t.headers);if(n.protocol=="https:"){r=wPt.request(n)}else{r=bPt.request(n)}this.getLength(function(s,a){if(s&&s!=="Unknown stream"){this._error(s);return}if(a){r.setHeader("Content-Length",a)}this.pipe(r);if(e){var u;var l=o(function(c,d){r.removeListener("error",l);r.removeListener("response",u);return e.call(this,c,d)},"callback");u=l.bind(this,null);r.on("error",l);r.on("response",u)}}.bind(this));return r};Fr.prototype._error=function(t){if(!this.error){this.error=t;this.pause();this.emit("error",t)}};Fr.prototype.toString=function(){return"[object FormData]"}});var MTe=_(FTe=>{"use strict";var CPt=require("url").parse;var RPt={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var OPt=String.prototype.endsWith||function(t){return t.length<=this.length&&this.indexOf(t,this.length-t.length)!==-1};function NPt(t){var e=typeof t==="string"?CPt(t):t||{};var r=e.protocol;var n=e.host;var i=e.port;if(typeof n!=="string"||!n||typeof r!=="string"){return""}r=r.split(":",1)[0];n=n.replace(/:\d*$/,"");i=parseInt(i)||RPt[r]||0;if(!IPt(n,i)){return""}var s=ky("npm_config_"+r+"_proxy")||ky(r+"_proxy")||ky("npm_config_proxy")||ky("all_proxy");if(s&&s.indexOf("://")===-1){s=r+"://"+s}return s}o(NPt,"getProxyForUrl");function IPt(t,e){var r=(ky("npm_config_no_proxy")||ky("no_proxy")).toLowerCase();if(!r){return true}if(r==="*"){return false}return r.split(/[,\s]/).every(function(n){if(!n){return true}var i=n.match(/^(.+):(\d+)$/);var s=i?i[1]:n;var a=i?parseInt(i[2]):0;if(a&&a!==e){return true}if(!/^[.*]/.test(s)){return t!==s}if(s.charAt(0)==="*"){s=s.slice(1)}return!OPt.call(t,s)})}o(IPt,"shouldProxy");function ky(t){return process.env[t.toLowerCase()]||process.env[t.toUpperCase()]||""}o(ky,"getEnv");FTe.getProxyForUrl=NPt});var VTe=_((smr,BTe)=>{var Z6;BTe.exports=function(){if(!Z6){try{Z6=Qo()("follow-redirects")}catch(t){}if(typeof Z6!=="function"){Z6=o(function(){},"debug")}}Z6.apply(null,arguments)}});var YTe=_((omr,aK)=>{var rb=require("url");var eb=rb.URL;var PPt=require("http");var DPt=require("https");var ZG=require("stream").Writable;var eK=require("assert");var HTe=VTe();var tK=false;try{eK(new eb)}catch(t){tK=t.code==="ERR_INVALID_URL"}var kPt=["auth","host","hostname","href","path","pathname","port","protocol","query","search"];var rK=["abort","aborted","connect","error","socket","timeout"];var nK=Object.create(null);rK.forEach(function(t){nK[t]=function(e,r,n){this._redirectable.emit(t,e,r,n)}});var JG=nb("ERR_INVALID_URL","Invalid URL",TypeError);var QG=nb("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var $Pt=nb("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",QG);var LPt=nb("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var qPt=nb("ERR_STREAM_WRITE_AFTER_END","write after end");var jPt=ZG.prototype.destroy||GTe;function Ta(t,e){ZG.call(this);this._sanitizeOptions(t);this._options=t;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(e){this.on("response",e)}var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof QG?i:new QG({cause:i}))}};this._performRequest()}o(Ta,"RedirectableRequest");Ta.prototype=Object.create(ZG.prototype);Ta.prototype.abort=function(){sK(this._currentRequest);this._currentRequest.abort();this.emit("abort")};Ta.prototype.destroy=function(t){sK(this._currentRequest,t);jPt.call(this,t);return this};Ta.prototype.write=function(t,e,r){if(this._ending){throw new qPt}if(!Pm(t)&&!MPt(t)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(tb(e)){r=e;e=null}if(t.length===0){if(r){r()}return}if(this._requestBodyLength+t.length<=this._options.maxBodyLength){this._requestBodyLength+=t.length;this._requestBodyBuffers.push({data:t,encoding:e});this._currentRequest.write(t,e,r)}else{this.emit("error",new LPt);this.abort()}};Ta.prototype.end=function(t,e,r){if(tb(t)){r=t;t=e=null}else if(tb(e)){r=e;e=null}if(!t){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var i=this._currentRequest;this.write(t,e,function(){n._ended=true;i.end(null,null,r)});this._ending=true}};Ta.prototype.setHeader=function(t,e){this._options.headers[t]=e;this._currentRequest.setHeader(t,e)};Ta.prototype.removeHeader=function(t){delete this._options.headers[t];this._currentRequest.removeHeader(t)};Ta.prototype.setTimeout=function(t,e){var r=this;function n(a){a.setTimeout(t);a.removeListener("timeout",a.destroy);a.addListener("timeout",a.destroy)}o(n,"destroyOnTimeout");function i(a){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout(function(){r.emit("timeout");s()},t);n(a)}o(i,"startTimer");function s(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",s);r.removeListener("error",s);r.removeListener("response",s);r.removeListener("close",s);if(e){r.removeListener("timeout",e)}if(!r.socket){r._currentRequest.removeListener("socket",i)}}o(s,"clearTimer");if(e){this.on("timeout",e)}if(this.socket){i(this.socket)}else{this._currentRequest.once("socket",i)}this.on("socket",n);this.on("abort",s);this.on("error",s);this.on("response",s);this.on("close",s);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){Ta.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(Ta.prototype,t,{get:function(){return this._currentRequest[t]}})});Ta.prototype._sanitizeOptions=function(t){if(!t.headers){t.headers={}}if(t.host){if(!t.hostname){t.hostname=t.host}delete t.host}if(!t.pathname&&t.path){var e=t.path.indexOf("?");if(e<0){t.pathname=t.path}else{t.pathname=t.path.substring(0,e);t.search=t.path.substring(e)}}};Ta.prototype._performRequest=function(){var t=this._options.protocol;var e=this._options.nativeProtocols[t];if(!e){throw new TypeError("Unsupported protocol "+t)}if(this._options.agents){var r=t.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of rK){n.on(i,nK[i])}this._currentUrl=/^\//.test(this._options.path)?rb.format(this._options):this._options.path;if(this._isRedirect){var s=0;var a=this;var u=this._requestBodyBuffers;o(function l(c){if(n===a._currentRequest){if(c){a.emit("error",c)}else if(s<u.length){var d=u[s++];if(!n.finished){n.write(d.data,d.encoding,l)}}else if(a._ended){n.end()}}},"writeNext")()}};Ta.prototype._processResponse=function(t){var e=t.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e})}var r=t.headers.location;if(!r||this._options.followRedirects===false||e<300||e>=400){t.responseUrl=this._currentUrl;t.redirects=this._redirects;this.emit("response",t);this._requestBodyBuffers=[];return}sK(this._currentRequest);t.destroy();if(++this._redirectCount>this._options.maxRedirects){throw new $Pt}var n;var i=this._options.beforeRedirect;if(i){n=Object.assign({Host:t.req.getHeader("host")},this._options.headers)}var s=this._options.method;if((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];WG(/^content-/i,this._options.headers)}var a=WG(/^host$/i,this._options.headers);var u=iK(this._currentUrl);var l=a||u.host;var c=/^\w+:/.test(r)?this._currentUrl:rb.format(Object.assign(u,{host:l}));var d=UPt(r,c);HTe("redirecting to",d.href);this._isRedirect=true;XG(d,this._options);if(d.protocol!==u.protocol&&d.protocol!=="https:"||d.host!==l&&!FPt(d.host,l)){WG(/^(?:authorization|cookie)$/i,this._options.headers)}if(tb(i)){var p={headers:t.headers,statusCode:e};var f={url:c,method:s,headers:n};i(this._options,p,f);this._sanitizeOptions(this._options)}this._performRequest()};function zTe(t){var e={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(t).forEach(function(n){var i=n+":";var s=r[i]=t[n];var a=e[n]=Object.create(s);function u(c,d,p){if(BPt(c)){c=XG(c)}else if(Pm(c)){c=XG(iK(c))}else{p=d;d=KTe(c);c={protocol:i}}if(tb(d)){p=d;d=null}d=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},c,d);d.nativeProtocols=r;if(!Pm(d.host)&&!Pm(d.hostname)){d.hostname="::1"}eK.equal(d.protocol,i,"protocol mismatch");HTe("options",d);return new Ta(d,p)}o(u,"request");function l(c,d,p){var f=a.request(c,d,p);f.end();return f}o(l,"get");Object.defineProperties(a,{request:{value:u,configurable:true,enumerable:true,writable:true},get:{value:l,configurable:true,enumerable:true,writable:true}})});return e}o(zTe,"wrap");function GTe(){}o(GTe,"noop");function iK(t){var e;if(tK){e=new eb(t)}else{e=KTe(rb.parse(t));if(!Pm(e.protocol)){throw new JG({input:t})}}return e}o(iK,"parseUrl");function UPt(t,e){return tK?new eb(t,e):iK(rb.resolve(e,t))}o(UPt,"resolveUrl");function KTe(t){if(/^\[/.test(t.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(t.hostname)){throw new JG({input:t.href||t})}if(/^\[/.test(t.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(t.host)){throw new JG({input:t.href||t})}return t}o(KTe,"validateUrl");function XG(t,e){var r=e||{};for(var n of kPt){r[n]=t[n]}if(r.hostname.startsWith("[")){r.hostname=r.hostname.slice(1,-1)}if(r.port!==""){r.port=Number(r.port)}r.path=r.search?r.pathname+r.search:r.pathname;return r}o(XG,"spreadUrlObject");function WG(t,e){var r;for(var n in e){if(t.test(n)){r=e[n];delete e[n]}}return r===null||typeof r==="undefined"?void 0:String(r).trim()}o(WG,"removeMatchingHeaders");function nb(t,e,r){function n(i){Error.captureStackTrace(this,this.constructor);Object.assign(this,i||{});this.code=t;this.message=this.cause?e+": "+this.cause.message:e}o(n,"CustomError");n.prototype=new(r||Error);Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:false},name:{value:"Error ["+t+"]",enumerable:false}});return n}o(nb,"createErrorType");function sK(t,e){for(var r of rK){t.removeListener(r,nK[r])}t.on("error",GTe);t.destroy(e)}o(sK,"destroyRequest");function FPt(t,e){eK(Pm(t)&&Pm(e));var r=t.length-e.length-1;return r>0&&t[r]==="."&&t.endsWith(e)}o(FPt,"isSubdomain");function Pm(t){return typeof t==="string"||t instanceof String}o(Pm,"isString");function tb(t){return typeof t==="function"}o(tb,"isFunction");function MPt(t){return typeof t==="object"&&"length"in t}o(MPt,"isBuffer");function BPt(t){return eb&&t instanceof eb}o(BPt,"isURL");aK.exports=zTe({http:PPt,https:DPt});aK.exports.wrap=zTe});var mx=_((lmr,q7e)=>{"use strict";var VPt=UTe();var HPt=require("url");var zPt=MTe();var GPt=require("http");var KPt=require("https");var p7e=require("util");var YPt=YTe();var WPt=require("zlib");var f7e=require("stream");var JPt=require("events");function rd(t){return t&&typeof t==="object"&&"default"in t?t:{"default":t}}o(rd,"_interopDefaultLegacy");var h7e=rd(VPt);var QPt=rd(HPt);var XPt=rd(GPt);var ZPt=rd(KPt);var eDt=rd(p7e);var tDt=rd(YPt);var mf=rd(WPt);var ff=rd(f7e);var rDt=rd(JPt);function m7e(t,e){return o(function r(){return t.apply(e,arguments)},"wrap")}o(m7e,"bind");var{toString:nDt}=Object.prototype;var{getPrototypeOf:bK}=Object;var dx=(t=>e=>{const r=nDt.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));var Hl=o(t=>{t=t.toLowerCase();return e=>dx(e)===t},"kindOfTest");var px=o(t=>e=>typeof e===t,"typeOfTest");var{isArray:jy}=Array;var ab=px("undefined");function iDt(t){return t!==null&&!ab(t)&&t.constructor!==null&&!ab(t.constructor)&&Bo(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}o(iDt,"isBuffer");var g7e=Hl("ArrayBuffer");function sDt(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&g7e(t.buffer)}return e}o(sDt,"isArrayBufferView");var aDt=px("string");var Bo=px("function");var y7e=px("number");var fx=o(t=>t!==null&&typeof t==="object","isObject");var oDt=o(t=>t===true||t===false,"isBoolean");var ox=o(t=>{if(dx(t)!=="object"){return false}const e=bK(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},"isPlainObject");var uDt=Hl("Date");var lDt=Hl("File");var cDt=Hl("Blob");var dDt=Hl("FileList");var pDt=o(t=>fx(t)&&Bo(t.pipe),"isStream");var fDt=o(t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||Bo(t.append)&&((e=dx(t))==="formdata"||e==="object"&&Bo(t.toString)&&t.toString()==="[object FormData]"))},"isFormData");var hDt=Hl("URLSearchParams");var mDt=o(t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function ub(t,e,{allOwnKeys:r=false}={}){if(t===null||typeof t==="undefined"){return}let n;let i;if(typeof t!=="object"){t=[t]}if(jy(t)){for(n=0,i=t.length;n<i;n++){e.call(null,t[n],n,t)}}else{const s=r?Object.getOwnPropertyNames(t):Object.keys(t);const a=s.length;let u;for(n=0;n<a;n++){u=s[n];e.call(null,t[u],u,t)}}}o(ub,"forEach");function v7e(t,e){e=e.toLowerCase();const r=Object.keys(t);let n=r.length;let i;while(n-- >0){i=r[n];if(e===i.toLowerCase()){return i}}return null}o(v7e,"findKey");var _7e=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();var E7e=o(t=>!ab(t)&&t!==_7e,"isContextDefined");function dK(){const{caseless:t}=E7e(this)&&this||{};const e={};const r=o((n,i)=>{const s=t&&v7e(e,i)||i;if(ox(e[s])&&ox(n)){e[s]=dK(e[s],n)}else if(ox(n)){e[s]=dK({},n)}else if(jy(n)){e[s]=n.slice()}else{e[s]=n}},"assignValue");for(let n=0,i=arguments.length;n<i;n++){arguments[n]&&ub(arguments[n],r)}return e}o(dK,"merge");var gDt=o((t,e,r,{allOwnKeys:n}={})=>{ub(e,(i,s)=>{if(r&&Bo(i)){t[s]=m7e(i,r)}else{t[s]=i}},{allOwnKeys:n});return t},"extend");var yDt=o(t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t},"stripBOM");var vDt=o((t,e,r,n)=>{t.prototype=Object.create(e.prototype,n);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});r&&Object.assign(t.prototype,r)},"inherits");var _Dt=o((t,e,r,n)=>{let i;let s;let a;const u={};e=e||{};if(t==null)return e;do{i=Object.getOwnPropertyNames(t);s=i.length;while(s-- >0){a=i[s];if((!n||n(a,t,e))&&!u[a]){e[a]=t[a];u[a]=true}}t=r!==false&&bK(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},"toFlatObject");var EDt=o((t,e,r)=>{t=String(t);if(r===void 0||r>t.length){r=t.length}r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},"endsWith");var bDt=o(t=>{if(!t)return null;if(jy(t))return t;let e=t.length;if(!y7e(e))return null;const r=new Array(e);while(e-- >0){r[e]=t[e]}return r},"toArray");var wDt=(t=>{return e=>{return t&&e instanceof t}})(typeof Uint8Array!=="undefined"&&bK(Uint8Array));var SDt=o((t,e)=>{const r=t&&t[Symbol.iterator];const n=r.call(t);let i;while((i=n.next())&&!i.done){const s=i.value;e.call(t,s[0],s[1])}},"forEachEntry");var TDt=o((t,e)=>{let r;const n=[];while((r=t.exec(e))!==null){n.push(r)}return n},"matchAll");var ADt=Hl("HTMLFormElement");var xDt=o(t=>{return t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,o(function e(r,n,i){return n.toUpperCase()+i},"replacer"))},"toCamelCase");var WTe=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype);var CDt=Hl("RegExp");var b7e=o((t,e)=>{const r=Object.getOwnPropertyDescriptors(t);const n={};ub(r,(i,s)=>{let a;if((a=e(i,s,t))!==false){n[s]=a||i}});Object.defineProperties(t,n)},"reduceDescriptors");var RDt=o(t=>{b7e(t,(e,r)=>{if(Bo(t)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}const n=t[r];if(!Bo(n))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}}})},"freezeMethods");var ODt=o((t,e)=>{const r={};const n=o(i=>{i.forEach(s=>{r[s]=true})},"define");jy(t)?n(t):n(String(t).split(e));return r},"toObjectSet");var NDt=o(()=>{},"noop");var IDt=o((t,e)=>{t=+t;return Number.isFinite(t)?t:e},"toFiniteNumber");var oK="abcdefghijklmnopqrstuvwxyz";var JTe="0123456789";var w7e={DIGIT:JTe,ALPHA:oK,ALPHA_DIGIT:oK+oK.toUpperCase()+JTe};var PDt=o((t=16,e=w7e.ALPHA_DIGIT)=>{let r="";const{length:n}=e;while(t--){r+=e[Math.random()*n|0]}return r},"generateString");function DDt(t){return!!(t&&Bo(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}o(DDt,"isSpecCompliantForm");var kDt=o(t=>{const e=new Array(10);const r=o((n,i)=>{if(fx(n)){if(e.indexOf(n)>=0){return}if(!("toJSON"in n)){e[i]=n;const s=jy(n)?[]:{};ub(n,(a,u)=>{const l=r(a,i+1);!ab(l)&&(s[u]=l)});e[i]=void 0;return s}}return n},"visit");return r(t,0)},"toJSONObject");var $Dt=Hl("AsyncFunction");var LDt=o(t=>t&&(fx(t)||Bo(t))&&Bo(t.then)&&Bo(t.catch),"isThenable");var fe={isArray:jy,isArrayBuffer:g7e,isBuffer:iDt,isFormData:fDt,isArrayBufferView:sDt,isString:aDt,isNumber:y7e,isBoolean:oDt,isObject:fx,isPlainObject:ox,isUndefined:ab,isDate:uDt,isFile:lDt,isBlob:cDt,isRegExp:CDt,isFunction:Bo,isStream:pDt,isURLSearchParams:hDt,isTypedArray:wDt,isFileList:dDt,forEach:ub,merge:dK,extend:gDt,trim:mDt,stripBOM:yDt,inherits:vDt,toFlatObject:_Dt,kindOf:dx,kindOfTest:Hl,endsWith:EDt,toArray:bDt,forEachEntry:SDt,matchAll:TDt,isHTMLForm:ADt,hasOwnProperty:WTe,hasOwnProp:WTe,reduceDescriptors:b7e,freezeMethods:RDt,toObjectSet:ODt,toCamelCase:xDt,noop:NDt,toFiniteNumber:IDt,findKey:v7e,global:_7e,isContextDefined:E7e,ALPHABET:w7e,generateString:PDt,isSpecCompliantForm:DDt,toJSONObject:kDt,isAsyncFn:$Dt,isThenable:LDt};function nt(t,e,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error().stack}this.message=t;this.name="AxiosError";e&&(this.code=e);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}o(nt,"AxiosError");fe.inherits(nt,Error,{toJSON:o(function t(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}},"toJSON")});var S7e=nt.prototype;var T7e={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{T7e[t]={value:t}});Object.defineProperties(nt,T7e);Object.defineProperty(S7e,"isAxiosError",{value:true});nt.from=(t,e,r,n,i,s)=>{const a=Object.create(S7e);fe.toFlatObject(t,a,o(function u(l){return l!==Error.prototype},"filter"),u=>{return u!=="isAxiosError"});nt.call(a,t.message,e,r,n,i);a.cause=t;a.name=t.name;s&&Object.assign(a,s);return a};function pK(t){return fe.isPlainObject(t)||fe.isArray(t)}o(pK,"isVisitable");function A7e(t){return fe.endsWith(t,"[]")?t.slice(0,-2):t}o(A7e,"removeBrackets");function QTe(t,e,r){if(!t)return e;return t.concat(e).map(o(function n(i,s){i=A7e(i);return!r&&s?"["+i+"]":i},"each")).join(r?".":"")}o(QTe,"renderKey");function qDt(t){return fe.isArray(t)&&!t.some(pK)}o(qDt,"isFlatArray");var jDt=fe.toFlatObject(fe,{},null,o(function t(e){return/^is[A-Z]/.test(e)},"filter"));function hx(t,e,r){if(!fe.isObject(t)){throw new TypeError("target must be an object")}e=e||new(h7e["default"]||FormData);r=fe.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,o(function m(g,y){return!fe.isUndefined(y[g])},"defined"));const n=r.metaTokens;const i=r.visitor||d;const s=r.dots;const a=r.indexes;const u=r.Blob||typeof Blob!=="undefined"&&Blob;const l=u&&fe.isSpecCompliantForm(e);if(!fe.isFunction(i)){throw new TypeError("visitor must be a function")}function c(m){if(m===null)return"";if(fe.isDate(m)){return m.toISOString()}if(!l&&fe.isBlob(m)){throw new nt("Blob is not supported. Use a Buffer instead.")}if(fe.isArrayBuffer(m)||fe.isTypedArray(m)){return l&&typeof Blob==="function"?new Blob([m]):Buffer.from(m)}return m}o(c,"convertValue");function d(m,g,y){let v=m;if(m&&!y&&typeof m==="object"){if(fe.endsWith(g,"{}")){g=n?g:g.slice(0,-2);m=JSON.stringify(m)}else if(fe.isArray(m)&&qDt(m)||(fe.isFileList(m)||fe.endsWith(g,"[]"))&&(v=fe.toArray(m))){g=A7e(g);v.forEach(o(function w(E,b){!(fe.isUndefined(E)||E===null)&&e.append(a===true?QTe([g],b,s):a===null?g:g+"[]",c(E))},"each"));return false}}if(pK(m)){return true}e.append(QTe(y,g,s),c(m));return false}o(d,"defaultVisitor");const p=[];const f=Object.assign(jDt,{defaultVisitor:d,convertValue:c,isVisitable:pK});function h(m,g){if(fe.isUndefined(m))return;if(p.indexOf(m)!==-1){throw Error("Circular reference detected in "+g.join("."))}p.push(m);fe.forEach(m,o(function y(v,w){const E=!(fe.isUndefined(v)||v===null)&&i.call(e,v,fe.isString(w)?w.trim():w,g,f);if(E===true){h(v,g?g.concat(w):[w])}},"each"));p.pop()}o(h,"build");if(!fe.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}o(hx,"toFormData");function XTe(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,o(function r(n){return e[n]},"replacer"))}o(XTe,"encode$1");function x7e(t,e){this._pairs=[];t&&hx(t,this,e)}o(x7e,"AxiosURLSearchParams");var C7e=x7e.prototype;C7e.append=o(function t(e,r){this._pairs.push([e,r])},"append");C7e.toString=o(function t(e){const r=e?function(n){return e.call(this,n,XTe)}:XTe;return this._pairs.map(o(function n(i){return r(i[0])+"="+r(i[1])},"each"),"").join("&")},"toString");function UDt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}o(UDt,"encode");function wK(t,e,r){if(!e){return t}const n=r&&r.encode||UDt;const i=r&&r.serialize;let s;if(i){s=i(e,r)}else{s=fe.isURLSearchParams(e)?e.toString():new x7e(e,r).toString(n)}if(s){const a=t.indexOf("#");if(a!==-1){t=t.slice(0,a)}t+=(t.indexOf("?")===-1?"?":"&")+s}return t}o(wK,"buildURL");var fK=class{static{o(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,r,n){this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(e){if(this.handlers[e]){this.handlers[e]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(e){fe.forEach(this.handlers,o(function r(n){if(n!==null){e(n)}},"forEachHandler"))}};var ZTe=fK;var SK={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var FDt=QPt["default"].URLSearchParams;var MDt={isNode:true,classes:{URLSearchParams:FDt,FormData:h7e["default"],Blob:typeof Blob!=="undefined"&&Blob||null},protocols:["http","https","file","data"]};var R7e=typeof window!=="undefined"&&typeof document!=="undefined";var BDt=(t=>{return R7e&&["ReactNative","NativeScript","NS"].indexOf(t)<0})(typeof navigator!=="undefined"&&navigator.product);var VDt=(()=>{return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})();var HDt=Object.freeze({__proto__:null,hasBrowserEnv:R7e,hasStandardBrowserWebWorkerEnv:VDt,hasStandardBrowserEnv:BDt});var Mo={...HDt,...MDt};function zDt(t,e){return hx(t,new Mo.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){if(Mo.isNode&&fe.isBuffer(r)){this.append(n,r.toString("base64"));return false}return s.defaultVisitor.apply(this,arguments)}},e))}o(zDt,"toURLEncodedForm");function GDt(t){return fe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>{return e[0]==="[]"?"":e[1]||e[0]})}o(GDt,"parsePropPath");function KDt(t){const e={};const r=Object.keys(t);let n;const i=r.length;let s;for(n=0;n<i;n++){s=r[n];e[s]=t[s]}return e}o(KDt,"arrayToObject");function O7e(t){function e(r,n,i,s){let a=r[s++];const u=Number.isFinite(+a);const l=s>=r.length;a=!a&&fe.isArray(i)?i.length:a;if(l){if(fe.hasOwnProp(i,a)){i[a]=[i[a],n]}else{i[a]=n}return!u}if(!i[a]||!fe.isObject(i[a])){i[a]=[]}const c=e(r,n,i[a],s);if(c&&fe.isArray(i[a])){i[a]=KDt(i[a])}return!u}o(e,"buildPath");if(fe.isFormData(t)&&fe.isFunction(t.entries)){const r={};fe.forEachEntry(t,(n,i)=>{e(GDt(n),i,r,0)});return r}return null}o(O7e,"formDataToJSON");function YDt(t,e,r){if(fe.isString(t)){try{(e||JSON.parse)(t);return fe.trim(t)}catch(n){if(n.name!=="SyntaxError"){throw n}}}return(r||JSON.stringify)(t)}o(YDt,"stringifySafely");var TK={transitional:SK,adapter:["xhr","http"],transformRequest:[o(function t(e,r){const n=r.getContentType()||"";const i=n.indexOf("application/json")>-1;const s=fe.isObject(e);if(s&&fe.isHTMLForm(e)){e=new FormData(e)}const a=fe.isFormData(e);if(a){if(!i){return e}return i?JSON.stringify(O7e(e)):e}if(fe.isArrayBuffer(e)||fe.isBuffer(e)||fe.isStream(e)||fe.isFile(e)||fe.isBlob(e)){return e}if(fe.isArrayBufferView(e)){return e.buffer}if(fe.isURLSearchParams(e)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1){return zDt(e,this.formSerializer).toString()}if((u=fe.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return hx(u?{"files[]":e}:e,l&&new l,this.formSerializer)}}if(s||i){r.setContentType("application/json",false);return YDt(e)}return e},"transformRequest")],transformResponse:[o(function t(e){const r=this.transitional||TK.transitional;const n=r&&r.forcedJSONParsing;const i=this.responseType==="json";if(e&&fe.isString(e)&&(n&&!this.responseType||i)){const s=r&&r.silentJSONParsing;const a=!s&&i;try{return JSON.parse(e)}catch(u){if(a){if(u.name==="SyntaxError"){throw nt.from(u,nt.ERR_BAD_RESPONSE,this,null,this.response)}throw u}}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mo.classes.FormData,Blob:Mo.classes.Blob},validateStatus:o(function t(e){return e>=200&&e<300},"validateStatus"),headers:{common:{"Accept":"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],t=>{TK.headers[t]={}});var AK=TK;var WDt=fe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var JDt=o(t=>{const e={};let r;let n;let i;t&&t.split("\n").forEach(o(function s(a){i=a.indexOf(":");r=a.substring(0,i).trim().toLowerCase();n=a.substring(i+1).trim();if(!r||e[r]&&WDt[r]){return}if(r==="set-cookie"){if(e[r]){e[r].push(n)}else{e[r]=[n]}}else{e[r]=e[r]?e[r]+", "+n:n}},"parser"));return e},"parseHeaders");var e7e=Symbol("internals");function ib(t){return t&&String(t).trim().toLowerCase()}o(ib,"normalizeHeader");function ux(t){if(t===false||t==null){return t}return fe.isArray(t)?t.map(ux):String(t)}o(ux,"normalizeValue");function QDt(t){const e=Object.create(null);const r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;while(n=r.exec(t)){e[n[1]]=n[2]}return e}o(QDt,"parseTokens");var XDt=o(t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()),"isValidHeaderName");function uK(t,e,r,n,i){if(fe.isFunction(n)){return n.call(this,e,r)}if(i){e=r}if(!fe.isString(e))return;if(fe.isString(n)){return e.indexOf(n)!==-1}if(fe.isRegExp(n)){return n.test(e)}}o(uK,"matchHeaderValue");function ZDt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>{return r.toUpperCase()+n})}o(ZDt,"formatHeader");function ekt(t,e){const r=fe.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,s,a){return this[n].call(this,e,i,s,a)},configurable:true})})}o(ekt,"buildAccessors");var $y=class{static{o(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,r,n){const i=this;function s(u,l,c){const d=ib(l);if(!d){throw new Error("header name must be a non-empty string")}const p=fe.findKey(i,d);if(!p||i[p]===void 0||c===true||c===void 0&&i[p]!==false){i[p||l]=ux(u)}}o(s,"setHeader");const a=o((u,l)=>fe.forEach(u,(c,d)=>s(c,d,l)),"setHeaders");if(fe.isPlainObject(e)||e instanceof this.constructor){a(e,r)}else if(fe.isString(e)&&(e=e.trim())&&!XDt(e)){a(JDt(e),r)}else{e!=null&&s(r,e,n)}return this}get(e,r){e=ib(e);if(e){const n=fe.findKey(this,e);if(n){const i=this[n];if(!r){return i}if(r===true){return QDt(i)}if(fe.isFunction(r)){return r.call(this,i,n)}if(fe.isRegExp(r)){return r.exec(i)}throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){e=ib(e);if(e){const n=fe.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||uK(this,this[n],n,r)))}return false}delete(e,r){const n=this;let i=false;function s(a){a=ib(a);if(a){const u=fe.findKey(n,a);if(u&&(!r||uK(n,n[u],u,r))){delete n[u];i=true}}}o(s,"deleteHeader");if(fe.isArray(e)){e.forEach(s)}else{s(e)}return i}clear(e){const r=Object.keys(this);let n=r.length;let i=false;while(n--){const s=r[n];if(!e||uK(this,this[s],s,e,true)){delete this[s];i=true}}return i}normalize(e){const r=this;const n={};fe.forEach(this,(i,s)=>{const a=fe.findKey(n,s);if(a){r[a]=ux(i);delete r[s];return}const u=e?ZDt(s):String(s).trim();if(u!==s){delete r[s]}r[u]=ux(i);n[u]=true});return this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);fe.forEach(this,(n,i)=>{n!=null&&n!==false&&(r[i]=e&&fe.isArray(n)?n.join(", "):n)});return r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);r.forEach(i=>n.set(i));return n}static accessor(e){const r=this[e7e]=this[e7e]={accessors:{}};const n=r.accessors;const i=this.prototype;function s(a){const u=ib(a);if(!n[u]){ekt(i,a);n[u]=true}}o(s,"defineAccessor");fe.isArray(e)?e.forEach(s):s(e);return this}};$y.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors($y.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});fe.freezeMethods($y);var Vo=$y;function lK(t,e){const r=this||AK;const n=e||r;const i=Vo.from(n.headers);let s=n.data;fe.forEach(t,o(function a(u){s=u.call(r,s,i.normalize(),e?e.status:void 0)},"transform"));i.normalize();return s}o(lK,"transformData");function N7e(t){return!!(t&&t.__CANCEL__)}o(N7e,"isCancel");function Dm(t,e,r){nt.call(this,t==null?"canceled":t,nt.ERR_CANCELED,e,r);this.name="CanceledError"}o(Dm,"CanceledError");fe.inherits(Dm,nt,{__CANCEL__:true});function sb(t,e,r){const n=r.config.validateStatus;if(!r.status||!n||n(r.status)){t(r)}else{e(new nt("Request failed with status code "+r.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}o(sb,"settle");function tkt(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}o(tkt,"isAbsoluteURL");function rkt(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}o(rkt,"combineURLs");function xK(t,e){if(t&&!tkt(e)){return rkt(t,e)}return e}o(xK,"buildFullPath");var cx="1.6.2";function I7e(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}o(I7e,"parseProtocol");var nkt=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function ikt(t,e,r){const n=r&&r.Blob||Mo.classes.Blob;const i=I7e(t);if(e===void 0&&n){e=true}if(i==="data"){t=i.length?t.slice(i.length+1):t;const s=nkt.exec(t);if(!s){throw new nt("Invalid URL",nt.ERR_INVALID_URL)}const a=s[1];const u=s[2];const l=s[3];const c=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(e){if(!n){throw new nt("Blob is not supported",nt.ERR_NOT_SUPPORT)}return new n([c],{type:a})}return c}throw new nt("Unsupported protocol "+i,nt.ERR_NOT_SUPPORT)}o(ikt,"fromDataURI");function skt(t,e){let r=0;const n=1e3/e;let i=null;return o(function s(a,u){const l=Date.now();if(a||l-r>n){if(i){clearTimeout(i);i=null}r=l;return t.apply(null,u)}if(!i){i=setTimeout(()=>{i=null;r=Date.now();return t.apply(null,u)},n-(l-r))}},"throttled")}o(skt,"throttle");function P7e(t,e){t=t||10;const r=new Array(t);const n=new Array(t);let i=0;let s=0;let a;e=e!==void 0?e:1e3;return o(function u(l){const c=Date.now();const d=n[s];if(!a){a=c}r[i]=l;n[i]=c;let p=s;let f=0;while(p!==i){f+=r[p++];p=p%t}i=(i+1)%t;if(i===s){s=(s+1)%t}if(c-a<e){return}const h=d&&c-d;return h?Math.round(f*1e3/h):void 0},"push")}o(P7e,"speedometer");var ax=Symbol("internals");var hK=class extends ff["default"].Transform{static{o(this,"AxiosTransformStream")}constructor(e){e=fe.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(u,l)=>{return!fe.isUndefined(l[u])});super({readableHighWaterMark:e.chunkSize});const r=this;const n=this[ax]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:false,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};const i=P7e(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",u=>{if(u==="progress"){if(!n.isCaptured){n.isCaptured=true}}});let s=0;n.updateProgress=skt(o(function u(){const l=n.length;const c=n.bytesSeen;const d=c-s;if(!d||r.destroyed)return;const p=i(d);s=c;process.nextTick(()=>{r.emit("progress",{"loaded":c,"total":l,"progress":l?c/l:void 0,"bytes":d,"rate":p?p:void 0,"estimated":p&&l&&c<=l?(l-c)/p:void 0})})},"throttledHandler"),n.ticksRate);const a=o(()=>{n.updateProgress(true)},"onFinish");this.once("end",a);this.once("error",a)}_read(e){const r=this[ax];if(r.onReadCallback){r.onReadCallback()}return super._read(e)}_transform(e,r,n){const i=this;const s=this[ax];const a=s.maxRate;const u=this.readableHighWaterMark;const l=s.timeWindow;const c=1e3/l;const d=a/c;const p=s.minChunkSize!==false?Math.max(s.minChunkSize,d*.01):0;function f(m,g){const y=Buffer.byteLength(m);s.bytesSeen+=y;s.bytes+=y;if(s.isCaptured){s.updateProgress()}if(i.push(m)){process.nextTick(g)}else{s.onReadCallback=()=>{s.onReadCallback=null;process.nextTick(g)}}}o(f,"pushChunk");const h=o((m,g)=>{const y=Buffer.byteLength(m);let v=null;let w=u;let E;let b=0;if(a){const S=Date.now();if(!s.ts||(b=S-s.ts)>=l){s.ts=S;E=d-s.bytes;s.bytes=E<0?-E:0;b=0}E=d-s.bytes}if(a){if(E<=0){return setTimeout(()=>{g(null,m)},l-b)}if(E<w){w=E}}if(w&&y>w&&y-w>p){v=m.subarray(w);m=m.subarray(0,w)}f(m,v?()=>{process.nextTick(g,null,v)}:g)},"transformChunk");h(e,o(function m(g,y){if(g){return n(g)}if(y){h(y,m)}else{n(null)}},"transformNextChunk"))}setLength(e){this[ax].length=+e;return this}};var t7e=hK;var{asyncIterator:r7e}=Symbol;var akt=o(async function*(t){if(t.stream){yield*t.stream()}else if(t.arrayBuffer){yield await t.arrayBuffer()}else if(t[r7e]){yield*t[r7e]()}else{yield t}},"readBlob");var D7e=akt;var okt=fe.ALPHABET.ALPHA_DIGIT+"-_";var ob=new p7e.TextEncoder;var hf="\r\n";var ukt=ob.encode(hf);var lkt=2;var mK=class{static{o(this,"FormDataPart")}constructor(e,r){const{escapeName:n}=this.constructor;const i=fe.isString(r);let s=`Content-Disposition: form-data; name="${n(e)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${hf}`;if(i){r=ob.encode(String(r).replace(/\r?\n|\r\n?/g,hf))}else{s+=`Content-Type: ${r.type||"application/octet-stream"}${hf}`}this.headers=ob.encode(s+hf);this.contentLength=i?r.byteLength:r.size;this.size=this.headers.byteLength+this.contentLength+lkt;this.name=e;this.value=r}async*encode(){yield this.headers;const{value:e}=this;if(fe.isTypedArray(e)){yield e}else{yield*D7e(e)}yield ukt}static escapeName(e){return String(e).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}};var ckt=o((t,e,r)=>{const{tag:n="form-data-boundary",size:i=25,boundary:s=n+"-"+fe.generateString(i,okt)}=r||{};if(!fe.isFormData(t)){throw TypeError("FormData instance required")}if(s.length<1||s.length>70){throw Error("boundary must be 10-70 characters long")}const a=ob.encode("--"+s+hf);const u=ob.encode("--"+s+"--"+hf+hf);let l=u.byteLength;const c=Array.from(t.entries()).map(([p,f])=>{const h=new mK(p,f);l+=h.size;return h});l+=a.byteLength*c.length;l=fe.toFiniteNumber(l);const d={"Content-Type":`multipart/form-data; boundary=${s}`};if(Number.isFinite(l)){d["Content-Length"]=l}e&&e(d);return f7e.Readable.from(async function*(){for(const p of c){yield a;yield*p.encode()}yield u}())},"formDataToStream");var dkt=ckt;var gK=class extends ff["default"].Transform{static{o(this,"ZlibHeaderTransformStream")}__transform(e,r,n){this.push(e);n()}_transform(e,r,n){if(e.length!==0){this._transform=this.__transform;if(e[0]!==120){const i=Buffer.alloc(2);i[0]=120;i[1]=156;this.push(i,r)}}this.__transform(e,r,n)}};var pkt=gK;var fkt=o((t,e)=>{return fe.isAsyncFn(t)?function(...r){const n=r.pop();t.apply(this,r).then(i=>{try{e?n(null,...e(i)):n(null,i)}catch(s){n(s)}},n)}:t},"callbackify");var hkt=fkt;var n7e={flush:mf["default"].constants.Z_SYNC_FLUSH,finishFlush:mf["default"].constants.Z_SYNC_FLUSH};var mkt={flush:mf["default"].constants.BROTLI_OPERATION_FLUSH,finishFlush:mf["default"].constants.BROTLI_OPERATION_FLUSH};var i7e=fe.isFunction(mf["default"].createBrotliDecompress);var{http:gkt,https:ykt}=tDt["default"];var vkt=/https:?/;var s7e=Mo.protocols.map(t=>{return t+":"});function _kt(t){if(t.beforeRedirects.proxy){t.beforeRedirects.proxy(t)}if(t.beforeRedirects.config){t.beforeRedirects.config(t)}}o(_kt,"dispatchBeforeRedirect");function k7e(t,e,r){let n=e;if(!n&&n!==false){const i=zPt.getProxyForUrl(r);if(i){n=new URL(i)}}if(n){if(n.username){n.auth=(n.username||"")+":"+(n.password||"")}if(n.auth){if(n.auth.username||n.auth.password){n.auth=(n.auth.username||"")+":"+(n.auth.password||"")}const s=Buffer.from(n.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+s}t.headers.host=t.hostname+(t.port?":"+t.port:"");const i=n.hostname||n.host;t.hostname=i;t.host=i;t.port=n.port;t.path=r;if(n.protocol){t.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`}}t.beforeRedirects.proxy=o(function i(s){k7e(s,e,s.href)},"beforeRedirect")}o(k7e,"setProxy");var Ekt=typeof process!=="undefined"&&fe.kindOf(process)==="process";var bkt=o(t=>{return new Promise((e,r)=>{let n;let i;const s=o((l,c)=>{if(i)return;i=true;n&&n(l,c)},"done");const a=o(l=>{s(l);e(l)},"_resolve");const u=o(l=>{s(l,true);r(l)},"_reject");t(a,u,l=>n=l).catch(u)})},"wrapAsync");var wkt=o(({address:t,family:e})=>{if(!fe.isString(t)){throw TypeError("address must be a string")}return{address:t,family:e||(t.indexOf(".")<0?6:4)}},"resolveFamily");var a7e=o((t,e)=>wkt(fe.isObject(t)?t:{address:t,family:e}),"buildAddressEntry");var Skt=Ekt&&o(function t(e){return bkt(o(async function r(n,i,s){let{data:a,lookup:u,family:l}=e;const{responseType:c,responseEncoding:d}=e;const p=e.method.toUpperCase();let f;let h=false;let m;if(u){const ue=hkt(u,xe=>fe.isArray(xe)?xe:[xe]);u=o((xe,we,Pe)=>{ue(xe,we,(Ue,$e,ge)=>{const Je=fe.isArray($e)?$e.map(Le=>a7e(Le)):[a7e($e,ge)];we.all?Pe(Ue,Je):Pe(Ue,Je[0].address,Je[0].family)})},"lookup")}const g=new rDt["default"];const y=o(()=>{if(e.cancelToken){e.cancelToken.unsubscribe(v)}if(e.signal){e.signal.removeEventListener("abort",v)}g.removeAllListeners()},"onFinished");s((ue,xe)=>{f=true;if(xe){h=true;y()}});function v(ue){g.emit("abort",!ue||ue.type?new Dm(null,e,m):ue)}o(v,"abort");g.once("abort",i);if(e.cancelToken||e.signal){e.cancelToken&&e.cancelToken.subscribe(v);if(e.signal){e.signal.aborted?v():e.signal.addEventListener("abort",v)}}const w=xK(e.baseURL,e.url);const E=new URL(w,"http://localhost");const b=E.protocol||s7e[0];if(b==="data:"){let ue;if(p!=="GET"){return sb(n,i,{status:405,statusText:"method not allowed",headers:{},config:e})}try{ue=ikt(e.url,c==="blob",{Blob:e.env&&e.env.Blob})}catch(xe){throw nt.from(xe,nt.ERR_BAD_REQUEST,e)}if(c==="text"){ue=ue.toString(d);if(!d||d==="utf8"){ue=fe.stripBOM(ue)}}else if(c==="stream"){ue=ff["default"].Readable.from(ue)}return sb(n,i,{data:ue,status:200,statusText:"OK",headers:new Vo,config:e})}if(s7e.indexOf(b)===-1){return i(new nt("Unsupported protocol "+b,nt.ERR_BAD_REQUEST,e))}const S=Vo.from(e.headers).normalize();S.set("User-Agent","axios/"+cx,false);const T=e.onDownloadProgress;const A=e.onUploadProgress;const R=e.maxRate;let O=void 0;let j=void 0;if(fe.isSpecCompliantForm(a)){const ue=S.getContentType(/boundary=([-_\w\d]{10,70})/i);a=dkt(a,xe=>{S.set(xe)},{tag:`axios-${cx}-boundary`,boundary:ue&&ue[1]||void 0})}else if(fe.isFormData(a)&&fe.isFunction(a.getHeaders)){S.set(a.getHeaders());if(!S.hasContentLength()){try{const ue=await eDt["default"].promisify(a.getLength).call(a);Number.isFinite(ue)&&ue>=0&&S.setContentLength(ue)}catch(ue){}}}else if(fe.isBlob(a)){a.size&&S.setContentType(a.type||"application/octet-stream");S.setContentLength(a.size||0);a=ff["default"].Readable.from(D7e(a))}else if(a&&!fe.isStream(a)){if(Buffer.isBuffer(a));else if(fe.isArrayBuffer(a)){a=Buffer.from(new Uint8Array(a))}else if(fe.isString(a)){a=Buffer.from(a,"utf-8")}else{return i(new nt("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",nt.ERR_BAD_REQUEST,e))}S.setContentLength(a.length,false);if(e.maxBodyLength>-1&&a.length>e.maxBodyLength){return i(new nt("Request body larger than maxBodyLength limit",nt.ERR_BAD_REQUEST,e))}}const B=fe.toFiniteNumber(S.getContentLength());if(fe.isArray(R)){O=R[0];j=R[1]}else{O=j=R}if(a&&(A||O)){if(!fe.isStream(a)){a=ff["default"].Readable.from(a,{objectMode:false})}a=ff["default"].pipeline([a,new t7e({length:B,maxRate:fe.toFiniteNumber(O)})],fe.noop);A&&a.on("progress",ue=>{A(Object.assign(ue,{upload:true}))})}let U=void 0;if(e.auth){const ue=e.auth.username||"";const xe=e.auth.password||"";U=ue+":"+xe}if(!U&&E.username){const ue=E.username;const xe=E.password;U=ue+":"+xe}U&&S.delete("authorization");let Q;try{Q=wK(E.pathname+E.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(ue){const xe=new Error(ue.message);xe.config=e;xe.url=e.url;xe.exists=true;return i(xe)}S.set("Accept-Encoding","gzip, compress, deflate"+(i7e?", br":""),false);const oe={path:Q,method:p,headers:S.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:U,protocol:b,family:l,beforeRedirect:_kt,beforeRedirects:{}};!fe.isUndefined(u)&&(oe.lookup=u);if(e.socketPath){oe.socketPath=e.socketPath}else{oe.hostname=E.hostname;oe.port=E.port;k7e(oe,e.proxy,b+"//"+E.hostname+(E.port?":"+E.port:"")+oe.path)}let Te;const le=vkt.test(oe.protocol);oe.agent=le?e.httpsAgent:e.httpAgent;if(e.transport){Te=e.transport}else if(e.maxRedirects===0){Te=le?ZPt["default"]:XPt["default"]}else{if(e.maxRedirects){oe.maxRedirects=e.maxRedirects}if(e.beforeRedirect){oe.beforeRedirects.config=e.beforeRedirect}Te=le?ykt:gkt}if(e.maxBodyLength>-1){oe.maxBodyLength=e.maxBodyLength}else{oe.maxBodyLength=Infinity}if(e.insecureHTTPParser){oe.insecureHTTPParser=e.insecureHTTPParser}m=Te.request(oe,o(function ue(xe){if(m.destroyed)return;const we=[xe];const Pe=+xe.headers["content-length"];if(T){const Le=new t7e({length:fe.toFiniteNumber(Pe),maxRate:fe.toFiniteNumber(j)});T&&Le.on("progress",Ie=>{T(Object.assign(Ie,{download:true}))});we.push(Le)}let Ue=xe;const $e=xe.req||m;if(e.decompress!==false&&xe.headers["content-encoding"]){if(p==="HEAD"||xe.statusCode===204){delete xe.headers["content-encoding"]}switch((xe.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":we.push(mf["default"].createUnzip(n7e));delete xe.headers["content-encoding"];break;case"deflate":we.push(new pkt);we.push(mf["default"].createUnzip(n7e));delete xe.headers["content-encoding"];break;case"br":if(i7e){we.push(mf["default"].createBrotliDecompress(mkt));delete xe.headers["content-encoding"]}}}Ue=we.length>1?ff["default"].pipeline(we,fe.noop):we[0];const ge=ff["default"].finished(Ue,()=>{ge();y()});const Je={status:xe.statusCode,statusText:xe.statusMessage,headers:new Vo(xe.headers),config:e,request:$e};if(c==="stream"){Je.data=Ue;sb(n,i,Je)}else{const Le=[];let Ie=0;Ue.on("data",o(function Qe(qe){Le.push(qe);Ie+=qe.length;if(e.maxContentLength>-1&&Ie>e.maxContentLength){h=true;Ue.destroy();i(new nt("maxContentLength size of "+e.maxContentLength+" exceeded",nt.ERR_BAD_RESPONSE,e,$e))}},"handleStreamData"));Ue.on("aborted",o(function Qe(){if(h){return}const qe=new nt("maxContentLength size of "+e.maxContentLength+" exceeded",nt.ERR_BAD_RESPONSE,e,$e);Ue.destroy(qe);i(qe)},"handlerStreamAborted"));Ue.on("error",o(function Qe(qe){if(m.destroyed)return;i(nt.from(qe,null,e,$e))},"handleStreamError"));Ue.on("end",o(function Qe(){try{let qe=Le.length===1?Le[0]:Buffer.concat(Le);if(c!=="arraybuffer"){qe=qe.toString(d);if(!d||d==="utf8"){qe=fe.stripBOM(qe)}}Je.data=qe}catch(qe){return i(nt.from(qe,null,e,Je.request,Je))}sb(n,i,Je)},"handleStreamEnd"))}g.once("abort",Le=>{if(!Ue.destroyed){Ue.emit("error",Le);Ue.destroy()}})},"handleResponse"));g.once("abort",ue=>{i(ue);m.destroy(ue)});m.on("error",o(function ue(xe){i(nt.from(xe,null,e,m))},"handleRequestError"));m.on("socket",o(function ue(xe){xe.setKeepAlive(true,1e3*60)},"handleRequestSocket"));if(e.timeout){const ue=parseInt(e.timeout,10);if(Number.isNaN(ue)){i(new nt("error trying to parse `config.timeout` to int",nt.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(ue,o(function xe(){if(f)return;let we=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const Pe=e.transitional||SK;if(e.timeoutErrorMessage){we=e.timeoutErrorMessage}i(new nt(we,Pe.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,m));v()},"handleRequestTimeout"))}if(fe.isStream(a)){let ue=false;let xe=false;a.on("end",()=>{ue=true});a.once("error",we=>{xe=true;m.destroy(we)});a.on("close",()=>{if(!ue&&!xe){v(new Dm("Request stream has been aborted",e,m))}});a.pipe(m)}else{m.end(a)}},"dispatchHttpRequest"))},"httpAdapter");var Tkt=Mo.hasStandardBrowserEnv?{write(t,e,r,n,i,s){const a=[t+"="+encodeURIComponent(e)];fe.isNumber(r)&&a.push("expires="+new Date(r).toGMTString());fe.isString(n)&&a.push("path="+n);fe.isString(i)&&a.push("domain="+i);s===true&&a.push("secure");document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var Akt=Mo.hasStandardBrowserEnv?o(function t(){const e=/(msie|trident)/i.test(navigator.userAgent);const r=document.createElement("a");let n;function i(s){let a=s;if(e){r.setAttribute("href",a);a=r.href}r.setAttribute("href",a);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}o(i,"resolveURL");n=i(window.location.href);return o(function s(a){const u=fe.isString(a)?i(a):a;return u.protocol===n.protocol&&u.host===n.host},"isURLSameOrigin")},"standardBrowserEnv")():o(function t(){return o(function e(){return true},"isURLSameOrigin")},"nonStandardBrowserEnv")();function o7e(t,e){let r=0;const n=P7e(50,250);return i=>{const s=i.loaded;const a=i.lengthComputable?i.total:void 0;const u=s-r;const l=n(u);const c=s<=a;r=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:l?l:void 0,estimated:l&&a&&c?(a-s)/l:void 0,event:i};d[e?"download":"upload"]=true;t(d)}}o(o7e,"progressEventReducer");var xkt=typeof XMLHttpRequest!=="undefined";var Ckt=xkt&&function(t){return new Promise(o(function e(r,n){let i=t.data;const s=Vo.from(t.headers).normalize();let{responseType:a,withXSRFToken:u}=t;let l;function c(){if(t.cancelToken){t.cancelToken.unsubscribe(l)}if(t.signal){t.signal.removeEventListener("abort",l)}}o(c,"done");let d;if(fe.isFormData(i)){if(Mo.hasStandardBrowserEnv||Mo.hasStandardBrowserWebWorkerEnv){s.setContentType(false)}else if((d=s.getContentType())!==false){const[g,...y]=d?d.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([g||"multipart/form-data",...y].join("; "))}}let p=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"";const y=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(g+":"+y))}const f=xK(t.baseURL,t.url);p.open(t.method.toUpperCase(),wK(f,t.params,t.paramsSerializer),true);p.timeout=t.timeout;function h(){if(!p){return}const g=Vo.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());const y=!a||a==="text"||a==="json"?p.responseText:p.response;const v={data:y,status:p.status,statusText:p.statusText,headers:g,config:t,request:p};sb(o(function w(E){r(E);c()},"_resolve"),o(function w(E){n(E);c()},"_reject"),v);p=null}o(h,"onloadend");if("onloadend"in p){p.onloadend=h}else{p.onreadystatechange=o(function g(){if(!p||p.readyState!==4){return}if(p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)){return}setTimeout(h)},"handleLoad")}p.onabort=o(function g(){if(!p){return}n(new nt("Request aborted",nt.ECONNABORTED,t,p));p=null},"handleAbort");p.onerror=o(function g(){n(new nt("Network Error",nt.ERR_NETWORK,t,p));p=null},"handleError");p.ontimeout=o(function g(){let y=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const v=t.transitional||SK;if(t.timeoutErrorMessage){y=t.timeoutErrorMessage}n(new nt(y,v.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,t,p));p=null},"handleTimeout");if(Mo.hasStandardBrowserEnv){u&&fe.isFunction(u)&&(u=u(t));if(u||u!==false&&Akt(f)){const g=t.xsrfHeaderName&&t.xsrfCookieName&&Tkt.read(t.xsrfCookieName);if(g){s.set(t.xsrfHeaderName,g)}}}i===void 0&&s.setContentType(null);if("setRequestHeader"in p){fe.forEach(s.toJSON(),o(function g(y,v){p.setRequestHeader(v,y)},"setRequestHeader"))}if(!fe.isUndefined(t.withCredentials)){p.withCredentials=!!t.withCredentials}if(a&&a!=="json"){p.responseType=t.responseType}if(typeof t.onDownloadProgress==="function"){p.addEventListener("progress",o7e(t.onDownloadProgress,true))}if(typeof t.onUploadProgress==="function"&&p.upload){p.upload.addEventListener("progress",o7e(t.onUploadProgress))}if(t.cancelToken||t.signal){l=o(g=>{if(!p){return}n(!g||g.type?new Dm(null,t,p):g);p.abort();p=null},"onCanceled");t.cancelToken&&t.cancelToken.subscribe(l);if(t.signal){t.signal.aborted?l():t.signal.addEventListener("abort",l)}}const m=I7e(f);if(m&&Mo.protocols.indexOf(m)===-1){n(new nt("Unsupported protocol "+m+":",nt.ERR_BAD_REQUEST,t));return}p.send(i||null)},"dispatchXhrRequest"))};var yK={http:Skt,xhr:Ckt};fe.forEach(yK,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(r){}Object.defineProperty(t,"adapterName",{value:e})}});var u7e=o(t=>`- ${t}`,"renderReason");var Rkt=o(t=>fe.isFunction(t)||t===null||t===false,"isResolvedHandle");var $7e={getAdapter:t=>{t=fe.isArray(t)?t:[t];const{length:e}=t;let r;let n;const i={};for(let s=0;s<e;s++){r=t[s];let a;n=r;if(!Rkt(r)){n=yK[(a=String(r)).toLowerCase()];if(n===void 0){throw new nt(`Unknown adapter '${a}'`)}}if(n){break}i[a||"#"+s]=n}if(!n){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===false?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?"since :\n"+s.map(u7e).join("\n"):" "+u7e(s[0]):"as no adapter specified";throw new nt(`There is no suitable adapter to dispatch the request `+a,"ERR_NOT_SUPPORT")}return n},adapters:yK};function cK(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new Dm(null,t)}}o(cK,"throwIfCancellationRequested");function l7e(t){cK(t);t.headers=Vo.from(t.headers);t.data=lK.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=$7e.getAdapter(t.adapter||AK.adapter);return e(t).then(o(function r(n){cK(t);n.data=lK.call(t,t.transformResponse,n);n.headers=Vo.from(n.headers);return n},"onAdapterResolution"),o(function r(n){if(!N7e(n)){cK(t);if(n&&n.response){n.response.data=lK.call(t,t.transformResponse,n.response);n.response.headers=Vo.from(n.response.headers)}}return Promise.reject(n)},"onAdapterRejection"))}o(l7e,"dispatchRequest");var c7e=o(t=>t instanceof Vo?t.toJSON():t,"headersToObject");function Ly(t,e){e=e||{};const r={};function n(c,d,p){if(fe.isPlainObject(c)&&fe.isPlainObject(d)){return fe.merge.call({caseless:p},c,d)}else if(fe.isPlainObject(d)){return fe.merge({},d)}else if(fe.isArray(d)){return d.slice()}return d}o(n,"getMergedValue");function i(c,d,p){if(!fe.isUndefined(d)){return n(c,d,p)}else if(!fe.isUndefined(c)){return n(void 0,c,p)}}o(i,"mergeDeepProperties");function s(c,d){if(!fe.isUndefined(d)){return n(void 0,d)}}o(s,"valueFromConfig2");function a(c,d){if(!fe.isUndefined(d)){return n(void 0,d)}else if(!fe.isUndefined(c)){return n(void 0,c)}}o(a,"defaultToConfig2");function u(c,d,p){if(p in e){return n(c,d)}else if(p in t){return n(void 0,c)}}o(u,"mergeDirectKeys");const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:(c,d)=>i(c7e(c),c7e(d),true)};fe.forEach(Object.keys(Object.assign({},t,e)),o(function c(d){const p=l[d]||i;const f=p(t[d],e[d],d);fe.isUndefined(f)&&p!==u||(r[d]=f)},"computeConfigValue"));return r}o(Ly,"mergeConfig");var CK={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{CK[t]=o(function r(n){return typeof n===t||"a"+(e<1?"n ":" ")+t},"validator")});var d7e={};CK.transitional=o(function t(e,r,n){function i(s,a){return"[Axios v"+cx+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}o(i,"formatMessage");return(s,a,u)=>{if(e===false){throw new nt(i(a," has been removed"+(r?" in "+r:"")),nt.ERR_DEPRECATED)}if(r&&!d7e[a]){d7e[a]=true;console.warn(i(a," has been deprecated since v"+r+" and will be removed in the near future"))}return e?e(s,a,u):true}},"transitional");function Okt(t,e,r){if(typeof t!=="object"){throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE)}const n=Object.keys(t);let i=n.length;while(i-- >0){const s=n[i];const a=e[s];if(a){const u=t[s];const l=u===void 0||a(u,s,t);if(l!==true){throw new nt("option "+s+" must be "+l,nt.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new nt("Unknown option "+s,nt.ERR_BAD_OPTION)}}}o(Okt,"assertOptions");var vK={assertOptions:Okt,validators:CK};var pf=vK.validators;var qy=class{static{o(this,"Axios")}constructor(e){this.defaults=e;this.interceptors={request:new ZTe,response:new ZTe}}request(e,r){if(typeof e==="string"){r=r||{};r.url=e}else{r=e||{}}r=Ly(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;if(n!==void 0){vK.assertOptions(n,{silentJSONParsing:pf.transitional(pf.boolean),forcedJSONParsing:pf.transitional(pf.boolean),clarifyTimeoutError:pf.transitional(pf.boolean)},false)}if(i!=null){if(fe.isFunction(i)){r.paramsSerializer={serialize:i}}else{vK.assertOptions(i,{encode:pf.function,serialize:pf.function},true)}}r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=s&&fe.merge(s.common,s[r.method]);s&&fe.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]});r.headers=Vo.concat(a,s);const u=[];let l=true;this.interceptors.request.forEach(o(function m(g){if(typeof g.runWhen==="function"&&g.runWhen(r)===false){return}l=l&&g.synchronous;u.unshift(g.fulfilled,g.rejected)},"unshiftRequestInterceptors"));const c=[];this.interceptors.response.forEach(o(function m(g){c.push(g.fulfilled,g.rejected)},"pushResponseInterceptors"));let d;let p=0;let f;if(!l){const m=[l7e.bind(this),void 0];m.unshift.apply(m,u);m.push.apply(m,c);f=m.length;d=Promise.resolve(r);while(p<f){d=d.then(m[p++],m[p++])}return d}f=u.length;let h=r;p=0;while(p<f){const m=u[p++];const g=u[p++];try{h=m(h)}catch(y){g.call(this,y);break}}try{d=l7e.call(this,h)}catch(m){return Promise.reject(m)}p=0;f=c.length;while(p<f){d=d.then(c[p++],c[p++])}return d}getUri(e){e=Ly(this.defaults,e);const r=xK(e.baseURL,e.url);return wK(r,e.params,e.paramsSerializer)}};fe.forEach(["delete","get","head","options"],o(function t(e){qy.prototype[e]=function(r,n){return this.request(Ly(n||{},{method:e,url:r,data:(n||{}).data}))}},"forEachMethodNoData"));fe.forEach(["post","put","patch"],o(function t(e){function r(n){return o(function i(s,a,u){return this.request(Ly(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))},"httpMethod")}o(r,"generateHTTPMethod");qy.prototype[e]=r();qy.prototype[e+"Form"]=r(true)},"forEachMethodWithData"));var lx=qy;var _K=class t{static{o(this,"CancelToken")}constructor(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}let r;this.promise=new Promise(o(function i(s){r=s},"promiseExecutor"));const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;while(s-- >0){n._listeners[s](i)}n._listeners=null});this.promise.then=i=>{let s;const a=new Promise(u=>{n.subscribe(u);s=u}).then(i);a.cancel=o(function u(){n.unsubscribe(s)},"reject");return a};e(o(function i(s,a,u){if(n.reason){return}n.reason=new Dm(s,a,u);r(n.reason)},"cancel"))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}}unsubscribe(e){if(!this._listeners){return}const r=this._listeners.indexOf(e);if(r!==-1){this._listeners.splice(r,1)}}static source(){let e;const r=new t(o(function n(i){e=i},"executor"));return{token:r,cancel:e}}};var Nkt=_K;function Ikt(t){return o(function e(r){return t.apply(null,r)},"wrap")}o(Ikt,"spread");function Pkt(t){return fe.isObject(t)&&t.isAxiosError===true}o(Pkt,"isAxiosError");var EK={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(EK).forEach(([t,e])=>{EK[e]=t});var Dkt=EK;function L7e(t){const e=new lx(t);const r=m7e(lx.prototype.request,e);fe.extend(r,lx.prototype,e,{allOwnKeys:true});fe.extend(r,e,null,{allOwnKeys:true});r.create=o(function n(i){return L7e(Ly(t,i))},"create");return r}o(L7e,"createInstance");var fi=L7e(AK);fi.Axios=lx;fi.CanceledError=Dm;fi.CancelToken=Nkt;fi.isCancel=N7e;fi.VERSION=cx;fi.toFormData=hx;fi.AxiosError=nt;fi.Cancel=fi.CanceledError;fi.all=o(function t(e){return Promise.all(e)},"all");fi.spread=Ikt;fi.isAxiosError=Pkt;fi.mergeConfig=Ly;fi.AxiosHeaders=Vo;fi.formToJSON=t=>O7e(fe.isHTMLForm(t)?new FormData(t):t);fi.getAdapter=$7e.getAdapter;fi.HttpStatusCode=Dkt;fi.default=fi;q7e.exports=fi});var yx=_(gx=>{"use strict";Object.defineProperty(gx,"__esModule",{value:true});gx.CredentialsMethod=void 0;var j7e;(function(t){t["None"]="none";t["ApiToken"]="api_token";t["ClientCredentials"]="client_credentials"})(j7e||(gx.CredentialsMethod=j7e={}))});var $m=_(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:true});hi.FgaRequiredParamError=hi.FgaValidationError=hi.FgaApiAuthenticationError=hi.FgaApiInternalError=hi.FgaApiRateLimitExceededError=hi.FgaApiNotFoundError=hi.FgaApiValidationError=hi.FgaApiError=hi.FgaError=void 0;var Uy=class extends Error{static{o(this,"FgaError")}constructor(e,r){super(r||typeof e==="string"?e:`FGA Error${(e===null||e===void 0?void 0:e.message)?`: ${e.message}`:""}`);this.name="FgaError";if(e===null||e===void 0?void 0:e.stack){this.stack=e.stack}}};hi.FgaError=Uy;function _x(t){let e=(t||"").split("/");if(e.length<4){e=[]}const r=e[2]||"";const n=e[3]||"";return{storeId:r,endpointCategory:n}}o(_x,"getRequestMetadataFromPath");var U7e="fga-request-id";function kK(t){return t.response?Object.fromEntries(Object.entries(t.response.headers).map(([e,r])=>[e.toLowerCase(),r])):{}}o(kK,"getResponseHeaders");var km=class extends Uy{static{o(this,"FgaApiError")}constructor(e,r){var n,i,s,a,u,l,c,d,p,f;super(r?r:e);this.name="FgaApiError";this.statusCode=(n=e.response)===null||n===void 0?void 0:n.status;this.statusText=(i=e.response)===null||i===void 0?void 0:i.statusText;this.requestData=(s=e.config)===null||s===void 0?void 0:s.data;this.requestURL=(a=e.config)===null||a===void 0?void 0:a.url;this.method=(u=e.config)===null||u===void 0?void 0:u.method;const{storeId:h,endpointCategory:m}=_x((l=e.request)===null||l===void 0?void 0:l.path);this.storeId=h;this.endpointCategory=m;this.apiErrorMessage=(d=(c=e.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message;this.responseData=(p=e.response)===null||p===void 0?void 0:p.data;this.responseHeader=(f=e.response)===null||f===void 0?void 0:f.headers;const g=kK(e);this.requestId=g[U7e];if(e===null||e===void 0?void 0:e.stack){this.stack=e.stack}}};hi.FgaApiError=km;var RK=class extends km{static{o(this,"FgaApiValidationError")}constructor(e,r){var n,i,s,a,u,l,c,d;super(e);this.name="FgaApiValidationError";this.apiErrorCode=(i=(n=e.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:p}=_x((s=e.request)===null||s===void 0?void 0:s.path);this.message=r?r:((u=(a=e.response)===null||a===void 0?void 0:a.data)===null||u===void 0?void 0:u.message)?`FGA API Validation Error: ${(l=e.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=e.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:e.message}};hi.FgaApiValidationError=RK;var OK=class extends km{static{o(this,"FgaApiNotFoundError")}constructor(e,r){var n,i,s,a,u,l,c;super(e);this.name="FgaApiNotFoundError";this.apiErrorCode=(i=(n=e.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;this.message=r?r:((a=(s=e.response)===null||s===void 0?void 0:s.data)===null||a===void 0?void 0:a.message)?`FGA API NotFound Error: ${(u=e.config)===null||u===void 0?void 0:u.method} : Error ${(c=(l=e.response)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.message}`:e.message}};hi.FgaApiNotFoundError=OK;var NK=class extends km{static{o(this,"FgaApiRateLimitExceededError")}constructor(e,r){var n,i,s;super(e);this.name="FgaApiRateLimitExceededError";this.apiErrorCode=(i=(n=e.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:a}=_x((s=e.request)===null||s===void 0?void 0:s.path);const u=kK(e);this.message=r?r:`FGA API Rate Limit Error for ${this.method} ${a}`}};hi.FgaApiRateLimitExceededError=NK;var IK=class extends km{static{o(this,"FgaApiInternalError")}constructor(e,r){var n,i,s,a,u,l,c,d;super(e);this.name="FgaApiInternalError";const{endpointCategory:p}=_x((n=e.request)===null||n===void 0?void 0:n.path);this.apiErrorCode=(s=(i=e.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.code;this.message=r?r:((u=(a=e.response)===null||a===void 0?void 0:a.data)===null||u===void 0?void 0:u.message)?`FGA API Internal Error: ${(l=e.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=e.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:e.message}};hi.FgaApiInternalError=IK;var PK=class extends Uy{static{o(this,"FgaApiAuthenticationError")}constructor(e){var r,n,i,s,a,u,l,c,d,p;super(`FGA Authentication Error.${((r=e.response)===null||r===void 0?void 0:r.statusText)?` ${e.response.statusText}`:""}`);this.name="FgaApiAuthenticationError";this.statusCode=(n=e.response)===null||n===void 0?void 0:n.status;this.statusText=(i=e.response)===null||i===void 0?void 0:i.statusText;this.requestURL=(s=e.config)===null||s===void 0?void 0:s.url;this.method=(a=e.config)===null||a===void 0?void 0:a.method;this.responseData=(u=e.response)===null||u===void 0?void 0:u.data;this.responseHeader=(l=e.response)===null||l===void 0?void 0:l.headers;this.apiErrorCode=(d=(c=e.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.code;const f=kK(e);this.requestId=f[U7e];let h;try{h=JSON.parse(((p=e.config)===null||p===void 0?void 0:p.data)||"{}")}catch(m){}this.clientId=h===null||h===void 0?void 0:h.client_id;this.audience=h===null||h===void 0?void 0:h.audience;this.grantType=h===null||h===void 0?void 0:h.grant_type;if(e===null||e===void 0?void 0:e.stack){this.stack=e.stack}}};hi.FgaApiAuthenticationError=PK;var vx=class extends Uy{static{o(this,"FgaValidationError")}constructor(e,r){super(r);this.field=e;this.name="FgaValidationError"}};hi.FgaValidationError=vx;var DK=class extends vx{static{o(this,"FgaRequiredParamError")}constructor(e,r,n){super(r,n);this.functionName=e;this.name="FgaRequiredParamError"}};hi.FgaRequiredParamError=DK});var lb=_(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:true});gf.isWellFormedUlidString=gf.isWellFormedUriString=gf.assertParamExists=void 0;var kkt=$m();var $kt=o(function(t,e,r){if(r===null||r===void 0){throw new kkt.FgaRequiredParamError(t,e,`Required parameter ${e} was null or undefined when calling ${t}.`)}},"assertParamExists");gf.assertParamExists=$kt;var Lkt=o(t=>{try{const e=new URL(t);return(e.toString()===t||e.toString()===`${t}/`)&&(e.protocol==="https:"||e.protocol==="http:")}catch(e){return false}},"isWellFormedUriString");gf.isWellFormedUriString=Lkt;var qkt=o(t=>{var e;const r=/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/;return!!(typeof t==="string"&&((e=t.match(r))===null||e===void 0?void 0:e.length))},"isWellFormedUlidString");gf.isWellFormedUlidString=qkt});var LK=_(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:true});Fy.Configuration=Fy.GetDefaultRetryParams=void 0;var cb=yx();var $K=$m();var Ex=lb();var jkt=15;var Ukt=100;var Fkt="openfga-sdk js/0.3.0";function Mkt(t=jkt,e=Ukt){return{maxRetry:t,minWaitInMs:e}}o(Mkt,"GetDefaultRetryParams");Fy.GetDefaultRetryParams=Mkt;var bx=class{static{o(this,"Configuration")}constructor(e={}){this.apiScheme="https";this.getBasePath=()=>`${this.apiScheme}://${this.apiHost}`;this.apiScheme=e.apiScheme||this.apiScheme;this.apiHost=e.apiHost;this.storeId=e.storeId;const r=e.credentials;if(r){switch(r===null||r===void 0?void 0:r.method){case cb.CredentialsMethod.ApiToken:this.credentials={method:r.method,config:{token:r.config.token,headerName:"Authorization",headerValuePrefix:"Bearer"}};break;case cb.CredentialsMethod.ClientCredentials:this.credentials={method:cb.CredentialsMethod.ClientCredentials,config:{clientId:r.config.clientId,clientSecret:r.config.clientSecret,apiAudience:r.config.apiAudience,apiTokenIssuer:r.config.apiTokenIssuer}};break;case cb.CredentialsMethod.None:default:this.credentials={method:cb.CredentialsMethod.None};break}}const n=e.baseOptions||{};n.headers=n.headers||{};if(typeof process==="object"&&process.title==="node"&&!n.headers["User-Agent"]){n.headers["User-Agent"]=Fkt}this.baseOptions=n;this.retryParams=e.retryParams}isValid(){var e;(0,Ex.assertParamExists)("Configuration","apiScheme",this.apiScheme);(0,Ex.assertParamExists)("Configuration","apiHost",this.apiHost);if(!(0,Ex.isWellFormedUriString)(this.getBasePath())){throw new $K.FgaValidationError(`Configuration.apiScheme (${this.apiScheme}) and Configuration.apiHost (${this.apiHost}) do not form a valid URI (${this.getBasePath()})`)}if(this.storeId&&!(0,Ex.isWellFormedUlidString)(this.storeId)){throw new $K.FgaValidationError("storeId")}if(((e=this.retryParams)===null||e===void 0?void 0:e.maxRetry)&&this.retryParams.maxRetry>15){throw new $K.FgaValidationError("Configuration.retryParams.maxRetry exceeds maximum allowed limit of 15")}return true}};Fy.Configuration=bx;bx.sdkVersion="0.3.0"});var F7e=_(wx=>{"use strict";Object.defineProperty(wx,"__esModule",{value:true});wx.assertNever=void 0;function Bkt(t){throw new Error(`Assertion failed. Unacceptable value: '${t}'`)}o(Bkt,"assertNever");wx.assertNever=Bkt});var M7e=_(Sx=>{"use strict";Object.defineProperty(Sx,"__esModule",{value:true});Sx.chunkArray=void 0;function Vkt(t,e){const r=[];const n=[...t];while(n.length>0){r.push(n.splice(0,e))}return r}o(Vkt,"chunkArray");Sx.chunkArray=Vkt});var V7e=_(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:true});My.generateRandomIdWithNonUniqueFallback=My.generateRandomId=void 0;var Tx=require("crypto");function B7e(){if(typeof Tx.randomUUID==="function"){return(0,Tx.randomUUID)()}if(typeof Tx.randomBytes==="function"){return(0,Tx.randomBytes)(20).toString("hex")}return}o(B7e,"generateRandomId");My.generateRandomId=B7e;function Hkt(){return B7e()||"00000000-0000-0000-0000-000000000000"}o(Hkt,"generateRandomIdWithNonUniqueFallback");My.generateRandomIdWithNonUniqueFallback=Hkt});var H7e=_(Ax=>{"use strict";Object.defineProperty(Ax,"__esModule",{value:true});Ax.setHeaderIfNotSet=void 0;function zkt(t,e,r){if(!t[e]&&r){t[e]=r}}o(zkt,"setHeaderIfNotSet");Ax.setHeaderIfNotSet=zkt});var z7e=_(xx=>{"use strict";Object.defineProperty(xx,"__esModule",{value:true});xx.setNotEnumerableProperty=void 0;function Gkt(t,e,r){Object.defineProperty(t,e,{enumerable:false,writable:false,value:r})}o(Gkt,"setNotEnumerableProperty");xx.setNotEnumerableProperty=Gkt});var qK=_($u=>{"use strict";var Kkt=$u&&$u.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var db=$u&&$u.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))Kkt(e,t,r)};Object.defineProperty($u,"__esModule",{value:true});db(F7e(),$u);db(M7e(),$u);db(V7e(),$u);db(H7e(),$u);db(z7e(),$u)});var UK=_(yi=>{"use strict";var jK=yi&&yi.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}o(i,"adopt");return new(r||(r=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(p){a(p)}}o(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){a(p)}}o(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}o(c,"step");c((n=n.apply(t,e||[])).next())})};Object.defineProperty(yi,"__esModule",{value:true});yi.createRequestFunction=yi.attemptHttpRequest=yi.toPathString=yi.serializeDataIfNeeded=yi.setSearchParams=yi.setBearerAuthToObject=yi.DUMMY_BASE_URL=void 0;var Ykt=Cx();var Lm=$m();var Wkt=qK();yi.DUMMY_BASE_URL="https://example.com";var Jkt=o(function(t,e){return jK(this,void 0,void 0,function*(){const r=yield e.getAccessTokenHeader();if(r&&!t[r.name]){t[r.name]=r.value}})},"setBearerAuthToObject");yi.setBearerAuthToObject=Jkt;var Qkt=o(function(t,...e){const r=new URLSearchParams(t.search);for(const n of e){for(const i in n){if(Array.isArray(n[i])){r.delete(i);for(const s of n[i]){r.append(i,s)}}else{r.set(i,n[i])}}}t.search=r.toString()},"setSearchParams");yi.setSearchParams=Qkt;var Xkt=o(t=>{const e=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(e.test(t)||t.toLowerCase()==="application/json-patch+json")},"isJsonMime");var Zkt=o(function(t,e){const r=typeof t!=="string";const n=r?Xkt(e.headers["Content-Type"]):r;return n?JSON.stringify(t!==void 0?t:{}):t||""},"serializeDataIfNeeded");yi.serializeDataIfNeeded=Zkt;var e$t=o(function(t){return t.pathname+t.search+t.hash},"toPathString");yi.toPathString=e$t;function t$t(t){return t&&typeof t==="object"&&t.isAxiosError===true}o(t$t,"isAxiosError");function r$t(t,e){const r=Math.ceil(Math.pow(2,t)*e);const n=Math.ceil(Math.pow(2,t+1)*e);return Math.floor(Math.random()*(n-r)+r)}o(r$t,"randomTime");function G7e(t,e,r){var n;return jK(this,void 0,void 0,function*(){let i=0;do{i++;try{return yield r(t)}catch(s){if(!t$t(s)){throw new Lm.FgaError(s)}const a=(n=s===null||s===void 0?void 0:s.response)===null||n===void 0?void 0:n.status;if(a===400||a===422){throw new Lm.FgaApiValidationError(s)}else if(a===401||a===403){throw new Lm.FgaApiAuthenticationError(s)}else if(a===404){throw new Lm.FgaApiNotFoundError(s)}else if(a===429||a>=500){if(i>=e.maxRetry){if(a===429){throw new Lm.FgaApiRateLimitExceededError(s)}else{throw new Lm.FgaApiInternalError(s)}}yield new Promise(u=>setTimeout(u,r$t(i,e.minWaitInMs)))}else{throw new Lm.FgaApiError(s)}}}while(i<e.maxRetry+1)})}o(G7e,"attemptHttpRequest");yi.attemptHttpRequest=G7e;var n$t=o(function(t,e,r,n){var i,s;r.isValid();const a=((i=t.options)===null||i===void 0?void 0:i.retryParams)?(s=t.options)===null||s===void 0?void 0:s.retryParams:r.retryParams;const u=a?a.maxRetry:0;const l=a?a.minWaitInMs:0;if(!n){n=Ykt.Credentials.init(r)}return(c=e)=>jK(this,void 0,void 0,function*(){yield(0,yi.setBearerAuthToObject)(t.options.headers,n);const d=Object.assign(Object.assign({},t.options),{url:r.getBasePath()+t.url});const p=yield G7e(d,{maxRetry:u,minWaitInMs:l},c);const f=typeof(p===null||p===void 0?void 0:p.data)==="undefined"?{}:p===null||p===void 0?void 0:p.data;const h=Object.assign({},f);(0,Wkt.setNotEnumerableProperty)(h,"$response",p);return h})},"createRequestFunction");yi.createRequestFunction=n$t});var Y7e=_(By=>{"use strict";var FK=By&&By.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}o(i,"adopt");return new(r||(r=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(p){a(p)}}o(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){a(p)}}o(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}o(c,"step");c((n=n.apply(t,e||[])).next())})};Object.defineProperty(By,"__esModule",{value:true});By.Credentials=void 0;var K7e=mx();var yf=lb();var MK=$m();var i$t=UK();var Ho=yx();var BK=class t{static{o(this,"Credentials")}static init(e){return new t(e.credentials)}constructor(e,r=K7e.default){this.authConfig=e;this.axios=r;this.initConfig();this.isValid()}initConfig(){var e;switch((e=this.authConfig)===null||e===void 0?void 0:e.method){case Ho.CredentialsMethod.ApiToken:if(this.authConfig.config){if(!this.authConfig.config.headerName){this.authConfig.config.headerName="Authorization"}if(!this.authConfig.config.headerValuePrefix){this.authConfig.config.headerValuePrefix="Bearer"}}break;case Ho.CredentialsMethod.ClientCredentials:case Ho.CredentialsMethod.None:default:break}}isValid(){var e,r,n,i,s,a,u,l,c;const{authConfig:d}=this;switch(d===null||d===void 0?void 0:d.method){case Ho.CredentialsMethod.None:break;case Ho.CredentialsMethod.ApiToken:(0,yf.assertParamExists)("Credentials","config.token",(e=d.config)===null||e===void 0?void 0:e.token);(0,yf.assertParamExists)("Credentials","config.headerName",(r=d.config)===null||r===void 0?void 0:r.headerName);(0,yf.assertParamExists)("Credentials","config.headerName",(n=d.config)===null||n===void 0?void 0:n.headerName);break;case Ho.CredentialsMethod.ClientCredentials:(0,yf.assertParamExists)("Credentials","config.clientId",(i=d.config)===null||i===void 0?void 0:i.clientId);(0,yf.assertParamExists)("Credentials","config.clientSecret",(s=d.config)===null||s===void 0?void 0:s.clientSecret);(0,yf.assertParamExists)("Credentials","config.apiTokenIssuer",(a=d.config)===null||a===void 0?void 0:a.apiTokenIssuer);(0,yf.assertParamExists)("Credentials","config.apiAudience",(u=d.config)===null||u===void 0?void 0:u.apiAudience);if(!(0,yf.isWellFormedUriString)(`https://${(l=d.config)===null||l===void 0?void 0:l.apiTokenIssuer}`)){throw new MK.FgaValidationError(`Configuration.apiTokenIssuer does not form a valid URI (https://${(c=d.config)===null||c===void 0?void 0:c.apiTokenIssuer})`)}break}}getAccessTokenHeader(){var e;return FK(this,void 0,void 0,function*(){const r=yield this.getAccessTokenValue();switch((e=this.authConfig)===null||e===void 0?void 0:e.method){case Ho.CredentialsMethod.None:return;case Ho.CredentialsMethod.ApiToken:return{name:this.authConfig.config.headerName,value:`${this.authConfig.config.headerValuePrefix?`${this.authConfig.config.headerValuePrefix} `:""}${r}`};case Ho.CredentialsMethod.ClientCredentials:return{name:"Authorization",value:`Bearer ${r}`}}})}getAccessTokenValue(){var e;return FK(this,void 0,void 0,function*(){switch((e=this.authConfig)===null||e===void 0?void 0:e.method){case Ho.CredentialsMethod.None:return;case Ho.CredentialsMethod.ApiToken:return this.authConfig.config.token;case Ho.CredentialsMethod.ClientCredentials:if(this.accessToken&&(!this.accessTokenExpiryDate||this.accessTokenExpiryDate>new Date)){return this.accessToken}return this.refreshAccessToken()}})}refreshAccessToken(){var e;return FK(this,void 0,void 0,function*(){const r=(e=this.authConfig)===null||e===void 0?void 0:e.config;try{const n=yield(0,i$t.attemptHttpRequest)({url:`https://${r.apiTokenIssuer}/oauth/token`,method:"post",data:{client_id:r.clientId,client_secret:r.clientSecret,audience:r.apiAudience,grant_type:"client_credentials"}},{maxRetry:3,minWaitInMs:100},K7e.default);if(n){this.accessToken=n.data.access_token;this.accessTokenExpiryDate=new Date(Date.now()+n.data.expires_in*1e3)}return this.accessToken}catch(n){if(n instanceof MK.FgaApiError){n.constructor=MK.FgaApiAuthenticationError;n.name="FgaApiAuthenticationError";n.clientId=r.clientId;n.audience=r.apiAudience;n.grantType="client_credentials"}throw n}})}};By.Credentials=BK});var Cx=_(vf=>{"use strict";var s$t=vf&&vf.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var W7e=vf&&vf.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))s$t(e,t,r)};Object.defineProperty(vf,"__esModule",{value:true});W7e(Y7e(),vf);W7e(yx(),vf)});var HK=_(Rx=>{"use strict";Object.defineProperty(Rx,"__esModule",{value:true});Rx.BaseAPI=void 0;var a$t=mx();var o$t=require("http");var u$t=require("https");var J7e=LK();var l$t=Cx();var c$t=1e4;var VK=class{static{o(this,"BaseAPI")}constructor(e,r){var n;this.axios=r;if(e instanceof J7e.Configuration){this.configuration=e}else{this.configuration=new J7e.Configuration(e)}this.configuration.isValid();this.credentials=l$t.Credentials.init(this.configuration);if(!this.axios){const i=new o$t.Agent({keepAlive:true});const s=new u$t.Agent({keepAlive:true});this.axios=a$t.default.create({httpAgent:i,httpsAgent:s,timeout:c$t,headers:(n=this.configuration.baseOptions)===null||n===void 0?void 0:n.headers})}}get storeId(){return this.configuration.storeId}set storeId(e){this.configuration.storeId=e}};Rx.BaseAPI=VK});var GK=_(tn=>{"use strict";var Zr=tn&&tn.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}o(i,"adopt");return new(r||(r=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(p){a(p)}}o(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){a(p)}}o(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}o(c,"step");c((n=n.apply(t,e||[])).next())})};Object.defineProperty(tn,"__esModule",{value:true});tn.OpenFgaApi=tn.OpenFgaApiFactory=tn.OpenFgaApiFp=tn.OpenFgaApiAxiosParamCreator=void 0;var zs=mx();var d$t=HK();var We=UK();var Vn=lb();var p$t=o(function(t,e){return{check:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("check","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/check".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),createStore:(r,n={})=>Zr(this,void 0,void 0,function*(){const i="/stores";const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),deleteStore:(r={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const i=new URL(n,We.DUMMY_BASE_URL);let s;if(t){s=t.baseOptions}const a=Object.assign(Object.assign({method:"DELETE"},s),r);const u={};const l={};(0,We.setSearchParams)(i,l,r.query);a.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,We.toPathString)(i),options:a}}),expand:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("expand","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/expand".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),getStore:(r={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const i=new URL(n,We.DUMMY_BASE_URL);let s;if(t){s=t.baseOptions}const a=Object.assign(Object.assign({method:"GET"},s),r);const u={};const l={};(0,We.setSearchParams)(i,l,r.query);a.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,We.toPathString)(i),options:a}}),listObjects:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("listObjects","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/list-objects".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),listStores:(r,n,i={})=>Zr(this,void 0,void 0,function*(){const s="/stores";const a=new URL(s,We.DUMMY_BASE_URL);let u;if(t){u=t.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,We.setSearchParams)(a,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,We.toPathString)(a),options:l}}),read:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("read","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/read".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),readAssertions:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("readAssertions","authorizationModelId",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"GET"},a),n);const l={};const c={};(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,We.toPathString)(s),options:u}}),readAuthorizationModel:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("readAuthorizationModel","id",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/authorization-models/{id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId))).replace(`{${"id"}}`,encodeURIComponent(String(r)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"GET"},a),n);const l={};const c={};(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,We.toPathString)(s),options:u}}),readAuthorizationModels:(r,n,i={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const s="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const a=new URL(s,We.DUMMY_BASE_URL);let u;if(t){u=t.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,We.setSearchParams)(a,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,We.toPathString)(a),options:l}}),readChanges:(r,n,i,s={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const a="/stores/{store_id}/changes".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const u=new URL(a,We.DUMMY_BASE_URL);let l;if(t){l=t.baseOptions}const c=Object.assign(Object.assign({method:"GET"},l),s);const d={};const p={};if(r!==void 0){p["type"]=r}if(n!==void 0){p["page_size"]=n}if(i!==void 0){p["continuation_token"]=i}(0,We.setSearchParams)(u,p,s.query);c.headers=Object.assign(Object.assign({},d),s.headers);return{url:(0,We.toPathString)(u),options:c}}),write:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("write","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/write".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}}),writeAssertions:(r,n,i={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("writeAssertions","authorizationModelId",r);(0,Vn.assertParamExists)("writeAssertions","body",n);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const s="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const a=new URL(s,We.DUMMY_BASE_URL);let u;if(t){u=t.baseOptions}const l=Object.assign(Object.assign({method:"PUT"},u),i);const c={};const d={};c["Content-Type"]="application/json";(0,We.setSearchParams)(a,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);l.data=(0,We.serializeDataIfNeeded)(n,l);return{url:(0,We.toPathString)(a),options:l}}),writeAuthorizationModel:(r,n={})=>Zr(this,void 0,void 0,function*(){(0,Vn.assertParamExists)("writeAuthorizationModel","body",r);(0,Vn.assertParamExists)("Configuration","storeId",t.storeId);const i="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(t.storeId)));const s=new URL(i,We.DUMMY_BASE_URL);let a;if(t){a=t.baseOptions}const u=Object.assign(Object.assign({method:"POST"},a),n);const l={};const c={};l["Content-Type"]="application/json";(0,We.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,We.serializeDataIfNeeded)(r,u);return{url:(0,We.toPathString)(s),options:u}})}},"OpenFgaApiAxiosParamCreator");tn.OpenFgaApiAxiosParamCreator=p$t;var f$t=o(function(t,e){const r=(0,tn.OpenFgaApiAxiosParamCreator)(t,e);return{check(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.check(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},createStore(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.createStore(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},deleteStore(n){return Zr(this,void 0,void 0,function*(){const i=yield r.deleteStore(n);return(0,We.createRequestFunction)(i,zs.default,t,e)})},expand(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.expand(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},getStore(n){return Zr(this,void 0,void 0,function*(){const i=yield r.getStore(n);return(0,We.createRequestFunction)(i,zs.default,t,e)})},listObjects(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.listObjects(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},listStores(n,i,s){return Zr(this,void 0,void 0,function*(){const a=yield r.listStores(n,i,s);return(0,We.createRequestFunction)(a,zs.default,t,e)})},read(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.read(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},readAssertions(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.readAssertions(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},readAuthorizationModel(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.readAuthorizationModel(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},readAuthorizationModels(n,i,s){return Zr(this,void 0,void 0,function*(){const a=yield r.readAuthorizationModels(n,i,s);return(0,We.createRequestFunction)(a,zs.default,t,e)})},readChanges(n,i,s,a){return Zr(this,void 0,void 0,function*(){const u=yield r.readChanges(n,i,s,a);return(0,We.createRequestFunction)(u,zs.default,t,e)})},write(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.write(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})},writeAssertions(n,i,s){return Zr(this,void 0,void 0,function*(){const a=yield r.writeAssertions(n,i,s);return(0,We.createRequestFunction)(a,zs.default,t,e)})},writeAuthorizationModel(n,i){return Zr(this,void 0,void 0,function*(){const s=yield r.writeAuthorizationModel(n,i);return(0,We.createRequestFunction)(s,zs.default,t,e)})}}},"OpenFgaApiFp");tn.OpenFgaApiFp=f$t;var h$t=o(function(t,e,r){const n=(0,tn.OpenFgaApiFp)(t,e);return{check(i,s){return n.check(i,s).then(a=>a(r))},createStore(i,s){return n.createStore(i,s).then(a=>a(r))},deleteStore(i){return n.deleteStore(i).then(s=>s(r))},expand(i,s){return n.expand(i,s).then(a=>a(r))},getStore(i){return n.getStore(i).then(s=>s(r))},listObjects(i,s){return n.listObjects(i,s).then(a=>a(r))},listStores(i,s,a){return n.listStores(i,s,a).then(u=>u(r))},read(i,s){return n.read(i,s).then(a=>a(r))},readAssertions(i,s){return n.readAssertions(i,s).then(a=>a(r))},readAuthorizationModel(i,s){return n.readAuthorizationModel(i,s).then(a=>a(r))},readAuthorizationModels(i,s,a){return n.readAuthorizationModels(i,s,a).then(u=>u(r))},readChanges(i,s,a,u){return n.readChanges(i,s,a,u).then(l=>l(r))},write(i,s){return n.write(i,s).then(a=>a(r))},writeAssertions(i,s,a){return n.writeAssertions(i,s,a).then(u=>u(r))},writeAuthorizationModel(i,s){return n.writeAuthorizationModel(i,s).then(a=>a(r))}}},"OpenFgaApiFactory");tn.OpenFgaApiFactory=h$t;var zK=class extends d$t.BaseAPI{static{o(this,"OpenFgaApi")}check(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).check(e,r).then(n=>n(this.axios))}createStore(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).createStore(e,r).then(n=>n(this.axios))}deleteStore(e){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).deleteStore(e).then(r=>r(this.axios))}expand(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).expand(e,r).then(n=>n(this.axios))}getStore(e){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).getStore(e).then(r=>r(this.axios))}listObjects(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).listObjects(e,r).then(n=>n(this.axios))}listStores(e,r,n){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).listStores(e,r,n).then(i=>i(this.axios))}read(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).read(e,r).then(n=>n(this.axios))}readAssertions(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).readAssertions(e,r).then(n=>n(this.axios))}readAuthorizationModel(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModel(e,r).then(n=>n(this.axios))}readAuthorizationModels(e,r,n){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModels(e,r,n).then(i=>i(this.axios))}readChanges(e,r,n,i){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).readChanges(e,r,n,i).then(s=>s(this.axios))}write(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).write(e,r).then(n=>n(this.axios))}writeAssertions(e,r,n){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).writeAssertions(e,r,n).then(i=>i(this.axios))}writeAuthorizationModel(e,r){return(0,tn.OpenFgaApiFp)(this.configuration,this.credentials).writeAuthorizationModel(e,r).then(n=>n(this.axios))}};tn.OpenFgaApi=zK});var X7e=_((jmr,Q7e)=>{async function*m$t(t,e,r){const n=new Set;async function i(){const[s,a]=await Promise.race(n);n.delete(s);return a}o(i,"consume");for(const s of e){const a=(async()=>await r(s,e))().then(u=>[a,u]);n.add(a);if(n.size>=t){yield await i()}}while(n.size){yield await i()}}o(m$t,"asyncPool");Q7e.exports=m$t});var Z7e=_(zl=>{"use strict";var Hn=zl&&zl.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}o(i,"adopt");return new(r||(r=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(p){a(p)}}o(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){a(p)}}o(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}o(c,"step");c((n=n.apply(t,e||[])).next())})};var KK=zl&&zl.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values==="function"?__values(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(u,l){a=t[s](a),i(u,l,a.done,a.value)})}}o(n,"verb");function i(s,a,u,l){Promise.resolve(l).then(function(c){s({value:c,done:u})},a)}o(i,"settle")};Object.defineProperty(zl,"__esModule",{value:true});zl.OpenFgaClient=zl.ClientWriteStatus=void 0;var YK=X7e();var g$t=GK();var y$t=HK();var WK=$m();var Aa=qK();var v$t=lb();var JK=10;var Vy="X-OpenFGA-Client-Method";var QK="X-OpenFGA-Client-Bulk-Request-Id";var Hy;(function(t){t["SUCCESS"]="success";t["FAILURE"]="failure"})(Hy||(zl.ClientWriteStatus=Hy={}));var XK=class extends y$t.BaseAPI{static{o(this,"OpenFgaClient")}constructor(e,r){super(e,r);this.axios=r;this.api=new g$t.OpenFgaApi(this.configuration,r);this.authorizationModelId=e.authorizationModelId;this.getAuthorizationModelId()}getAuthorizationModelId(e={}){const r=(e===null||e===void 0?void 0:e.authorizationModelId)||this.authorizationModelId;if(r&&!(0,v$t.isWellFormedUlidString)(r)){throw new WK.FgaValidationError("authorizationModelId")}return r}checkValidApiConnection(e={}){return Hn(this,void 0,void 0,function*(){if(this.getAuthorizationModelId(e)){yield this.readAuthorizationModel(e)}else{yield this.readLatestAuthorizationModel(e)}})}listStores(e={}){return Hn(this,void 0,void 0,function*(){return this.api.listStores(e.pageSize,e.continuationToken,e)})}createStore(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.createStore(e,r)})}getStore(e={}){return Hn(this,void 0,void 0,function*(){return this.api.getStore(e)})}deleteStore(e={}){return Hn(this,void 0,void 0,function*(){return this.api.deleteStore(e)})}readAuthorizationModels(e={}){return Hn(this,void 0,void 0,function*(){return this.api.readAuthorizationModels(e.pageSize,e.continuationToken,e)})}writeAuthorizationModel(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.writeAuthorizationModel(e,r)})}readAuthorizationModel(e={}){return Hn(this,void 0,void 0,function*(){const r=this.getAuthorizationModelId(e);if(!r){throw new WK.FgaRequiredParamError("ClientConfiguration","authorizationModelId")}return this.api.readAuthorizationModel(r,e)})}readLatestAuthorizationModel(e={}){var r;return Hn(this,void 0,void 0,function*(){const{headers:n={}}=e;(0,Aa.setHeaderIfNotSet)(n,Vy,"ReadLatestAuthorizationModel");const i=yield this.readAuthorizationModels(Object.assign(Object.assign({},e),{pageSize:1,headers:n}));const s=i;s.authorization_model=(r=i.authorization_models)===null||r===void 0?void 0:r[0];delete s.authorization_models;return s})}readChanges(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.readChanges(e.type,r.pageSize,r.continuationToken,r)})}read(e={},r={}){return Hn(this,void 0,void 0,function*(){const n={page_size:r.pageSize,continuation_token:r.continuationToken};if(e.user||e.object||e.relation){n.tuple_key=e}return this.api.read(n,r)})}write(e,r={}){return Hn(this,void 0,void 0,function*(){const{transaction:n={},headers:i={}}=r;const{maxPerChunk:s=1,maxParallelRequests:a=JK}=n;const{writes:u,deletes:l}=e;const c=this.getAuthorizationModelId(r);if(!(n===null||n===void 0?void 0:n.disable)){const d={authorization_model_id:c};if(u===null||u===void 0?void 0:u.length){d.writes={tuple_keys:u}}if(l===null||l===void 0?void 0:l.length){d.deletes={tuple_keys:l}}yield this.api.write(d,r);return{writes:(u===null||u===void 0?void 0:u.map(p=>({tuple_key:p,status:Hy.SUCCESS})))||[],deletes:(l===null||l===void 0?void 0:l.map(p=>({tuple_key:p,status:Hy.SUCCESS})))||[]}}return Promise.all([(()=>Hn(this,void 0,void 0,function*(){var d,p,f,h,m,g,y,v;(0,Aa.setHeaderIfNotSet)(i,Vy,"Write");(0,Aa.setHeaderIfNotSet)(i,QK,(0,Aa.generateRandomIdWithNonUniqueFallback)());const w=[];if(u===null||u===void 0?void 0:u.length){try{for(var E=true,b=KK(YK(a,(0,Aa.chunkArray)(u,s),j=>this.writeTuples(j,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(B=>({writes:j.map(U=>({tuple_key:U,status:Hy.FAILURE,err:B})),deletes:[]})))),S;S=yield b.next(),d=S.done,!d;E=true){h=S.value;E=false;const j=h;w.push(j.writes)}}catch(j){p={error:j}}finally{try{if(!E&&!d&&(f=b.return))yield f.call(b)}finally{if(p)throw p.error}}}const T=[];if(l===null||l===void 0?void 0:l.length){try{for(var A=true,R=KK(YK(a,(0,Aa.chunkArray)(l,s),j=>this.deleteTuples(j,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(B=>({writes:[],deletes:j.map(U=>({tuple_key:U,status:Hy.FAILURE,err:B}))})))),O;O=yield R.next(),m=O.done,!m;A=true){v=O.value;A=false;const j=v;T.push(j.deletes)}}catch(j){g={error:j}}finally{try{if(!A&&!m&&(y=R.return))yield y.call(R)}finally{if(g)throw g.error}}}return{writes:w.flat(),deletes:T.flat()}}))(),this.checkValidApiConnection(r)]).then(d=>d[0])})}writeTuples(e,r={}){return Hn(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,Aa.setHeaderIfNotSet)(n,Vy,"WriteTuples");return this.write({writes:e},Object.assign(Object.assign({},r),{headers:n}))})}deleteTuples(e,r={}){return Hn(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,Aa.setHeaderIfNotSet)(n,Vy,"DeleteTuples");return this.write({deletes:e},Object.assign(Object.assign({},r),{headers:n}))})}check(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.check({tuple_key:{user:e.user,relation:e.relation,object:e.object},context:e.context,contextual_tuples:{tuple_keys:e.contextualTuples||[]},authorization_model_id:this.getAuthorizationModelId(r)},r)})}batchCheck(e,r={}){return Hn(this,void 0,void 0,function*(){return Promise.all([(()=>Hn(this,void 0,void 0,function*(){var n,i,s,a;const{headers:u={},maxParallelRequests:l=JK}=r;(0,Aa.setHeaderIfNotSet)(u,Vy,"BatchCheck");(0,Aa.setHeaderIfNotSet)(u,QK,(0,Aa.generateRandomIdWithNonUniqueFallback)());const c=[];try{for(var d=true,p=KK(YK(l,e,h=>this.check(h,Object.assign(Object.assign({},r),{headers:u})).then(m=>{m._request=h;return m}).catch(m=>{return{allowed:void 0,error:m,_request:h}}))),f;f=yield p.next(),n=f.done,!n;d=true){a=f.value;d=false;const h=a;c.push(h)}}catch(h){i={error:h}}finally{try{if(!d&&!n&&(s=p.return))yield s.call(p)}finally{if(i)throw i.error}}return{responses:c}}))(),this.checkValidApiConnection(r)]).then(n=>n[0])})}expand(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.expand({authorization_model_id:this.getAuthorizationModelId(r),tuple_key:e},r)})}listObjects(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.listObjects({authorization_model_id:this.getAuthorizationModelId(r),user:e.user,relation:e.relation,type:e.type,context:e.context,contextual_tuples:{tuple_keys:e.contextualTuples||[]}},r)})}listRelations(e,r={}){return Hn(this,void 0,void 0,function*(){const{user:n,object:i,relations:s,contextualTuples:a,context:u}=e;const{headers:l={},maxParallelRequests:c=JK}=r;(0,Aa.setHeaderIfNotSet)(l,Vy,"ListRelations");(0,Aa.setHeaderIfNotSet)(l,QK,(0,Aa.generateRandomIdWithNonUniqueFallback)());if(!(s===null||s===void 0?void 0:s.length)){throw new WK.FgaValidationError("relations","When calling listRelations, at least one relation must be passed in the relations field")}const d=yield this.batchCheck(s.map(f=>({user:n,relation:f,object:i,contextualTuples:a,context:u})),Object.assign(Object.assign({},r),{headers:l,maxParallelRequests:c}));const p=d.responses.find(f=>f.error);if(p){throw p.error}return{relations:d.responses.filter(f=>f.allowed).map(f=>f._request.relation)}})}readAssertions(e={}){return Hn(this,void 0,void 0,function*(){return this.api.readAssertions(this.getAuthorizationModelId(e),e)})}writeAssertions(e,r={}){return Hn(this,void 0,void 0,function*(){return this.api.writeAssertions(this.getAuthorizationModelId(r),{assertions:e.map(n=>({tuple_key:{user:n.user,relation:n.relation,object:n.object},expectation:n.expectation}))},r)})}};zl.OpenFgaClient=XK});var aAe=_(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:true});xa.TypeName=xa.TupleOperation=xa.NullValue=xa.NotFoundErrorCode=xa.InternalErrorCode=xa.ErrorCode=void 0;var eAe;(function(t){t["NoError"]="no_error";t["ValidationError"]="validation_error";t["AuthorizationModelNotFound"]="authorization_model_not_found";t["AuthorizationModelResolutionTooComplex"]="authorization_model_resolution_too_complex";t["InvalidWriteInput"]="invalid_write_input";t["CannotAllowDuplicateTuplesInOneRequest"]="cannot_allow_duplicate_tuples_in_one_request";t["CannotAllowDuplicateTypesInOneRequest"]="cannot_allow_duplicate_types_in_one_request";t["CannotAllowMultipleReferencesToOneRelation"]="cannot_allow_multiple_references_to_one_relation";t["InvalidContinuationToken"]="invalid_continuation_token";t["InvalidTupleSet"]="invalid_tuple_set";t["InvalidCheckInput"]="invalid_check_input";t["InvalidExpandInput"]="invalid_expand_input";t["UnsupportedUserSet"]="unsupported_user_set";t["InvalidObjectFormat"]="invalid_object_format";t["WriteFailedDueToInvalidInput"]="write_failed_due_to_invalid_input";t["AuthorizationModelAssertionsNotFound"]="authorization_model_assertions_not_found";t["LatestAuthorizationModelNotFound"]="latest_authorization_model_not_found";t["TypeNotFound"]="type_not_found";t["RelationNotFound"]="relation_not_found";t["EmptyRelationDefinition"]="empty_relation_definition";t["InvalidUser"]="invalid_user";t["InvalidTuple"]="invalid_tuple";t["UnknownRelation"]="unknown_relation";t["StoreIdInvalidLength"]="store_id_invalid_length";t["AssertionsTooManyItems"]="assertions_too_many_items";t["IdTooLong"]="id_too_long";t["AuthorizationModelIdTooLong"]="authorization_model_id_too_long";t["TupleKeyValueNotSpecified"]="tuple_key_value_not_specified";t["TupleKeysTooManyOrTooFewItems"]="tuple_keys_too_many_or_too_few_items";t["PageSizeInvalid"]="page_size_invalid";t["ParamMissingValue"]="param_missing_value";t["DifferenceBaseMissingValue"]="difference_base_missing_value";t["SubtractBaseMissingValue"]="subtract_base_missing_value";t["ObjectTooLong"]="object_too_long";t["RelationTooLong"]="relation_too_long";t["TypeDefinitionsTooFewItems"]="type_definitions_too_few_items";t["TypeInvalidLength"]="type_invalid_length";t["TypeInvalidPattern"]="type_invalid_pattern";t["RelationsTooFewItems"]="relations_too_few_items";t["RelationsTooLong"]="relations_too_long";t["RelationsInvalidPattern"]="relations_invalid_pattern";t["ObjectInvalidPattern"]="object_invalid_pattern";t["QueryStringTypeContinuationTokenMismatch"]="query_string_type_continuation_token_mismatch";t["ExceededEntityLimit"]="exceeded_entity_limit";t["InvalidContextualTuple"]="invalid_contextual_tuple";t["DuplicateContextualTuple"]="duplicate_contextual_tuple";t["InvalidAuthorizationModel"]="invalid_authorization_model";t["UnsupportedSchemaVersion"]="unsupported_schema_version"})(eAe||(xa.ErrorCode=eAe={}));var tAe;(function(t){t["NoInternalError"]="no_internal_error";t["InternalError"]="internal_error";t["Cancelled"]="cancelled";t["DeadlineExceeded"]="deadline_exceeded";t["AlreadyExists"]="already_exists";t["ResourceExhausted"]="resource_exhausted";t["FailedPrecondition"]="failed_precondition";t["Aborted"]="aborted";t["OutOfRange"]="out_of_range";t["Unavailable"]="unavailable";t["DataLoss"]="data_loss"})(tAe||(xa.InternalErrorCode=tAe={}));var rAe;(function(t){t["NoNotFoundError"]="no_not_found_error";t["UndefinedEndpoint"]="undefined_endpoint";t["StoreIdNotFound"]="store_id_not_found";t["Unimplemented"]="unimplemented"})(rAe||(xa.NotFoundErrorCode=rAe={}));var nAe;(function(t){t["NullValue"]="NULL_VALUE"})(nAe||(xa.NullValue=nAe={}));var iAe;(function(t){t["Write"]="TUPLE_OPERATION_WRITE";t["Delete"]="TUPLE_OPERATION_DELETE"})(iAe||(xa.TupleOperation=iAe={}));var sAe;(function(t){t["Unspecified"]="TYPE_NAME_UNSPECIFIED";t["Any"]="TYPE_NAME_ANY";t["Bool"]="TYPE_NAME_BOOL";t["String"]="TYPE_NAME_STRING";t["Int"]="TYPE_NAME_INT";t["Uint"]="TYPE_NAME_UINT";t["Double"]="TYPE_NAME_DOUBLE";t["Duration"]="TYPE_NAME_DURATION";t["Timestamp"]="TYPE_NAME_TIMESTAMP";t["Map"]="TYPE_NAME_MAP";t["List"]="TYPE_NAME_LIST";t["Ipaddress"]="TYPE_NAME_IPADDRESS"})(sAe||(xa.TypeName=sAe={}))});var lAe=_($i=>{"use strict";var _$t=$i&&$i.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var Ox=$i&&$i.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))_$t(e,t,r)};Object.defineProperty($i,"__esModule",{value:true});$i.CredentialsMethod=$i.Credentials=$i.GetDefaultRetryParams=$i.Configuration=void 0;Ox(GK(),$i);Ox(Z7e(),$i);Ox(aAe(),$i);var oAe=LK();Object.defineProperty($i,"Configuration",{enumerable:true,get:function(){return oAe.Configuration}});Object.defineProperty($i,"GetDefaultRetryParams",{enumerable:true,get:function(){return oAe.GetDefaultRetryParams}});var uAe=Cx();Object.defineProperty($i,"Credentials",{enumerable:true,get:function(){return uAe.Credentials}});Object.defineProperty($i,"CredentialsMethod",{enumerable:true,get:function(){return uAe.CredentialsMethod}});Ox($m(),$i)});var dAe=_(zy=>{"use strict";var E$t=zy&&zy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(zy,"__esModule",{value:true});zy.OpenFGAService=void 0;var pb=E$t(Oa());var cAe=lAe();var b$t=Ry();var ZK=class{static{o(this,"OpenFGAService")}logger;openFGAClient;baseUrl;apiHost;storeId;modelId;userSub;constructor(e,r){if(!pb.default.OPENFGA_SERVICE_URL){throw new Error("OPENFGA_SERVICE_URL is not set")}this.userSub=r&&r.userSub?r.userSub:e.getUserSub();this.baseUrl=pb.default.OPENFGA_SERVICE_URL;this.apiHost=pb.default.OPENFGA_SERVICE_URL.replace(/^(https:\/\/)/,"");this.storeId=pb.default.OPENFGA_STORE_ID;this.modelId=pb.default.OPENFGA_MODEL_ID;this.logger=e.log}async getOpenFgaClient(){if(!this.openFGAClient){const e=await(0,b$t.getServiceAccountIdToken)(this.baseUrl);this.openFGAClient=new cAe.OpenFgaClient({apiScheme:"https",apiHost:this.apiHost,storeId:this.storeId,authorizationModelId:this.modelId,credentials:{method:cAe.CredentialsMethod.ApiToken,config:{token:e}}})}return this.openFGAClient}async createAccountMember(e){try{const r=await this.getOpenFgaClient();await r.write({writes:[{user:`user:${this.userSub}`,relation:"admin",object:`account:${e}`}]})}catch(r){this.logger.warn(`RBAC failed to create account membership. Error: ${r.message}`)}}async getAccountMemberships(){const e=await this.getOpenFgaClient();const r=await e.listObjects({user:`user:${this.userSub}`,relation:"member",type:"account"});if(r){return r.objects.map(n=>n.replace(/^(account:)/,""))}return[]}async isAccountMember(e){try{const r=await this.getOpenFgaClient();const{allowed:n}=await r.check({user:`user:${this.userSub}`,relation:"member",object:`account:${e}`});if(!n){return false}return n}catch(r){this.logger.warn(`RBAC failed to check account membership. Error: ${r.message}`);return false}}async isZuploAdmin(){try{const e=await this.getOpenFgaClient();const{tuples:r}=await e.read({object:"role:zuplo-admin"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(e){this.logger.warn(`RBAC failed to check for zuplo admin. Error: ${e.message}`);return false}}async isDeployerServiceAccount(){try{const e=await this.getOpenFgaClient();const{tuples:r}=await e.read({object:"role:zuplo-deployer"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(e){this.logger.warn(`RBAC failed to check for zuplo deployer. Error: ${e.message}`);return false}}async createProjectAccountAssociation(e,r){try{const n=await this.getOpenFgaClient();await n.write({writes:[{user:`account:${e}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to create account-project association. Error: ${n.message}`)}}async deleteProjectAccountAssociation(e,r){try{const n=await this.getOpenFgaClient();await n.write({deletes:[{user:`account:${e}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to delete account-project association. Error: ${n.message}`)}}};zy.OpenFGAService=ZK});var hAe=_(Gy=>{"use strict";var fAe=Gy&&Gy.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Gy,"__esModule",{value:true});Gy.TenantService=void 0;var w$t=fAe(ru());var pAe=fAe(Oa());var S$t=X6();var T$t=new w$t.default({max:500,maxAge:1e3*60*50});var eY=class extends S$t.ApiServiceClient{static{o(this,"TenantService")}constructor(e,r){if(!pAe.default.TENANT_API_URL){throw new Error("TENANT_API_URL is not set")}const n=r&&r.userSub?r.userSub:e.getUserSub();super(pAe.default.TENANT_API_URL,T$t,{userSub:n,logger:e.log,requestId:e.id})}};Gy.TenantService=eY});var gAe=_(Ky=>{"use strict";var mAe=Ky&&Ky.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(Ky,"__esModule",{value:true});Ky.MeteringService=void 0;var A$t=mAe(ru());var tY=mAe(Oa());var x$t=X6();var C$t=new A$t.default({max:500,maxAge:1e3*60*50});var rY=class extends x$t.ApiServiceClient{static{o(this,"MeteringService")}constructor(e,r){if(!tY.default.METERING_SERVICE_URL){throw new Error("METERING_SERVICE_URL is not set")}const n=r&&r.userSub?r.userSub:e.getUserSub();super(tY.default.METERING_SERVICE_URL,C$t,{userSub:n,logger:e.log,requestId:e.id,targetAudience:tY.default.METERING_SERVICE_URL})}};Ky.MeteringService=rY});var yAe=_(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:true});Gl.validateHostname=Gl.kebabCase=Gl.snakeCase=Gl.sizeInBytes=void 0;function R$t(t){return new TextEncoder().encode(JSON.stringify(t)).length}o(R$t,"sizeInBytes");Gl.sizeInBytes=R$t;function O$t(t){if(!t||t===null){return""}return t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(e=>e.toLowerCase()).join("_")}o(O$t,"snakeCase");Gl.snakeCase=O$t;function N$t(t){if(!t||t===null){return""}const e=t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);if(e===null){return""}return e.map(r=>r.toLowerCase()).join("-")}o(N$t,"kebabCase");Gl.kebabCase=N$t;function I$t(t){try{const e=/^(?!https?:\/\/)([a-zA-Z0-9.-]*|(\*))*\.[a-zA-Z]+$/;if(t&&!e.test(t)){return false}return true}catch(e){}return false}o(I$t,"validateHostname");Gl.validateHostname=I$t});var EAe=_(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:true});G.Type=G.JsonType=G.JavaScriptTypeBuilder=G.JsonTypeBuilder=G.TypeBuilder=G.TypeBuilderError=G.TransformEncodeBuilder=G.TransformDecodeBuilder=G.TemplateLiteralDslParser=G.TemplateLiteralGenerator=G.TemplateLiteralGeneratorError=G.TemplateLiteralFinite=G.TemplateLiteralFiniteError=G.TemplateLiteralParser=G.TemplateLiteralParserError=G.TemplateLiteralResolver=G.TemplateLiteralPattern=G.TemplateLiteralPatternError=G.UnionResolver=G.KeyArrayResolver=G.KeyArrayResolverError=G.KeyResolver=G.ObjectMap=G.Intrinsic=G.IndexedAccessor=G.TypeClone=G.TypeExtends=G.TypeExtendsResult=G.TypeExtendsError=G.ExtendsUndefined=G.TypeGuard=G.TypeGuardUnknownTypeError=G.ValueGuard=G.FormatRegistry=G.TypeBoxError=G.TypeRegistry=G.PatternStringExact=G.PatternNumberExact=G.PatternBooleanExact=G.PatternString=G.PatternNumber=G.PatternBoolean=G.Kind=G.Hint=G.Optional=G.Readonly=G.Transform=void 0;G.Transform=Symbol.for("TypeBox.Transform");G.Readonly=Symbol.for("TypeBox.Readonly");G.Optional=Symbol.for("TypeBox.Optional");G.Hint=Symbol.for("TypeBox.Hint");G.Kind=Symbol.for("TypeBox.Kind");G.PatternBoolean="(true|false)";G.PatternNumber="(0|[1-9][0-9]*)";G.PatternString="(.*)";G.PatternBooleanExact=`^${G.PatternBoolean}$`;G.PatternNumberExact=`^${G.PatternNumber}$`;G.PatternStringExact=`^${G.PatternString}$`;var nY;(function(t){const e=new Map;function r(){return new Map(e)}o(r,"Entries");t.Entries=r;function n(){return e.clear()}o(n,"Clear");t.Clear=n;function i(l){return e.delete(l)}o(i,"Delete");t.Delete=i;function s(l){return e.has(l)}o(s,"Has");t.Has=s;function a(l,c){e.set(l,c)}o(a,"Set");t.Set=a;function u(l){return e.get(l)}o(u,"Get");t.Get=u})(nY||(G.TypeRegistry=nY={}));var Lu=class extends Error{static{o(this,"TypeBoxError")}constructor(e){super(e)}};G.TypeBoxError=Lu;var vAe;(function(t){const e=new Map;function r(){return new Map(e)}o(r,"Entries");t.Entries=r;function n(){return e.clear()}o(n,"Clear");t.Clear=n;function i(l){return e.delete(l)}o(i,"Delete");t.Delete=i;function s(l){return e.has(l)}o(s,"Has");t.Has=s;function a(l,c){e.set(l,c)}o(a,"Set");t.Set=a;function u(l){return e.get(l)}o(u,"Get");t.Get=u})(vAe||(G.FormatRegistry=vAe={}));var Be;(function(t){function e(c){return Array.isArray(c)}o(e,"IsArray");t.IsArray=e;function r(c){return typeof c==="bigint"}o(r,"IsBigInt");t.IsBigInt=r;function n(c){return typeof c==="boolean"}o(n,"IsBoolean");t.IsBoolean=n;function i(c){return c===null}o(i,"IsNull");t.IsNull=i;function s(c){return typeof c==="number"}o(s,"IsNumber");t.IsNumber=s;function a(c){return typeof c==="object"&&c!==null}o(a,"IsObject");t.IsObject=a;function u(c){return typeof c==="string"}o(u,"IsString");t.IsString=u;function l(c){return c===void 0}o(l,"IsUndefined");t.IsUndefined=l})(Be||(G.ValueGuard=Be={}));var iY=class extends Lu{static{o(this,"TypeGuardUnknownTypeError")}};G.TypeGuardUnknownTypeError=iY;var Y;(function(t){function e(x){try{new RegExp(x);return true}catch{return false}}o(e,"IsPattern");function r(x){if(!Be.IsString(x))return false;for(let ie=0;ie<x.length;ie++){const ce=x.charCodeAt(ie);if(ce>=7&&ce<=13||ce===27||ce===127){return false}}return true}o(r,"IsControlCharacterFree");function n(x){return a(x)||J(x)}o(n,"IsAdditionalProperties");function i(x){return Be.IsUndefined(x)||Be.IsBigInt(x)}o(i,"IsOptionalBigInt");function s(x){return Be.IsUndefined(x)||Be.IsNumber(x)}o(s,"IsOptionalNumber");function a(x){return Be.IsUndefined(x)||Be.IsBoolean(x)}o(a,"IsOptionalBoolean");function u(x){return Be.IsUndefined(x)||Be.IsString(x)}o(u,"IsOptionalString");function l(x){return Be.IsUndefined(x)||Be.IsString(x)&&r(x)&&e(x)}o(l,"IsOptionalPattern");function c(x){return Be.IsUndefined(x)||Be.IsString(x)&&r(x)}o(c,"IsOptionalFormat");function d(x){return Be.IsUndefined(x)||J(x)}o(d,"IsOptionalSchema");function p(x){return T(x,"Any")&&u(x.$id)}o(p,"TAny");t.TAny=p;function f(x){return T(x,"Array")&&x.type==="array"&&u(x.$id)&&J(x.items)&&s(x.minItems)&&s(x.maxItems)&&a(x.uniqueItems)&&d(x.contains)&&s(x.minContains)&&s(x.maxContains)}o(f,"TArray");t.TArray=f;function h(x){return T(x,"AsyncIterator")&&x.type==="AsyncIterator"&&u(x.$id)&&J(x.items)}o(h,"TAsyncIterator");t.TAsyncIterator=h;function m(x){return T(x,"BigInt")&&x.type==="bigint"&&u(x.$id)&&i(x.exclusiveMaximum)&&i(x.exclusiveMinimum)&&i(x.maximum)&&i(x.minimum)&&i(x.multipleOf)}o(m,"TBigInt");t.TBigInt=m;function g(x){return T(x,"Boolean")&&x.type==="boolean"&&u(x.$id)}o(g,"TBoolean");t.TBoolean=g;function y(x){return T(x,"Constructor")&&x.type==="constructor"&&u(x.$id)&&Be.IsArray(x.parameters)&&x.parameters.every(ie=>J(ie))&&J(x.returns)}o(y,"TConstructor");t.TConstructor=y;function v(x){return T(x,"Date")&&x.type==="Date"&&u(x.$id)&&s(x.exclusiveMaximumTimestamp)&&s(x.exclusiveMinimumTimestamp)&&s(x.maximumTimestamp)&&s(x.minimumTimestamp)&&s(x.multipleOfTimestamp)}o(v,"TDate");t.TDate=v;function w(x){return T(x,"Function")&&x.type==="function"&&u(x.$id)&&Be.IsArray(x.parameters)&&x.parameters.every(ie=>J(ie))&&J(x.returns)}o(w,"TFunction");t.TFunction=w;function E(x){return T(x,"Integer")&&x.type==="integer"&&u(x.$id)&&s(x.exclusiveMaximum)&&s(x.exclusiveMinimum)&&s(x.maximum)&&s(x.minimum)&&s(x.multipleOf)}o(E,"TInteger");t.TInteger=E;function b(x){return T(x,"Intersect")&&(Be.IsString(x.type)&&x.type!=="object"?false:true)&&Be.IsArray(x.allOf)&&x.allOf.every(ie=>J(ie)&&!Le(ie))&&u(x.type)&&(a(x.unevaluatedProperties)||d(x.unevaluatedProperties))&&u(x.$id)}o(b,"TIntersect");t.TIntersect=b;function S(x){return T(x,"Iterator")&&x.type==="Iterator"&&u(x.$id)&&J(x.items)}o(S,"TIterator");t.TIterator=S;function T(x,ie){return A(x)&&x[G.Kind]===ie}o(T,"TKindOf");t.TKindOf=T;function A(x){return Be.IsObject(x)&&G.Kind in x&&Be.IsString(x[G.Kind])}o(A,"TKind");t.TKind=A;function R(x){return B(x)&&Be.IsString(x.const)}o(R,"TLiteralString");t.TLiteralString=R;function O(x){return B(x)&&Be.IsNumber(x.const)}o(O,"TLiteralNumber");t.TLiteralNumber=O;function j(x){return B(x)&&Be.IsBoolean(x.const)}o(j,"TLiteralBoolean");t.TLiteralBoolean=j;function B(x){return T(x,"Literal")&&u(x.$id)&&(Be.IsBoolean(x.const)||Be.IsNumber(x.const)||Be.IsString(x.const))}o(B,"TLiteral");t.TLiteral=B;function U(x){return T(x,"Never")&&Be.IsObject(x.not)&&Object.getOwnPropertyNames(x.not).length===0}o(U,"TNever");t.TNever=U;function Q(x){return T(x,"Not")&&J(x.not)}o(Q,"TNot");t.TNot=Q;function oe(x){return T(x,"Null")&&x.type==="null"&&u(x.$id)}o(oe,"TNull");t.TNull=oe;function Te(x){return T(x,"Number")&&x.type==="number"&&u(x.$id)&&s(x.exclusiveMaximum)&&s(x.exclusiveMinimum)&&s(x.maximum)&&s(x.minimum)&&s(x.multipleOf)}o(Te,"TNumber");t.TNumber=Te;function le(x){return T(x,"Object")&&x.type==="object"&&u(x.$id)&&Be.IsObject(x.properties)&&n(x.additionalProperties)&&s(x.minProperties)&&s(x.maxProperties)&&Object.entries(x.properties).every(([ie,ce])=>r(ie)&&J(ce))}o(le,"TObject");t.TObject=le;function ue(x){return T(x,"Promise")&&x.type==="Promise"&&u(x.$id)&&J(x.item)}o(ue,"TPromise");t.TPromise=ue;function xe(x){return T(x,"Record")&&x.type==="object"&&u(x.$id)&&n(x.additionalProperties)&&Be.IsObject(x.patternProperties)&&(ie=>{const ce=Object.getOwnPropertyNames(ie.patternProperties);return ce.length===1&&e(ce[0])&&Be.IsObject(ie.patternProperties)&&J(ie.patternProperties[ce[0]])})(x)}o(xe,"TRecord");t.TRecord=xe;function we(x){return Be.IsObject(x)&&G.Hint in x&&x[G.Hint]==="Recursive"}o(we,"TRecursive");t.TRecursive=we;function Pe(x){return T(x,"Ref")&&u(x.$id)&&Be.IsString(x.$ref)}o(Pe,"TRef");t.TRef=Pe;function Ue(x){return T(x,"String")&&x.type==="string"&&u(x.$id)&&s(x.minLength)&&s(x.maxLength)&&l(x.pattern)&&c(x.format)}o(Ue,"TString");t.TString=Ue;function $e(x){return T(x,"Symbol")&&x.type==="symbol"&&u(x.$id)}o($e,"TSymbol");t.TSymbol=$e;function ge(x){return T(x,"TemplateLiteral")&&x.type==="string"&&Be.IsString(x.pattern)&&x.pattern[0]==="^"&&x.pattern[x.pattern.length-1]==="$"}o(ge,"TTemplateLiteral");t.TTemplateLiteral=ge;function Je(x){return T(x,"This")&&u(x.$id)&&Be.IsString(x.$ref)}o(Je,"TThis");t.TThis=Je;function Le(x){return Be.IsObject(x)&&G.Transform in x}o(Le,"TTransform");t.TTransform=Le;function Ie(x){return T(x,"Tuple")&&x.type==="array"&&u(x.$id)&&Be.IsNumber(x.minItems)&&Be.IsNumber(x.maxItems)&&x.minItems===x.maxItems&&(Be.IsUndefined(x.items)&&Be.IsUndefined(x.additionalItems)&&x.minItems===0||Be.IsArray(x.items)&&x.items.every(ie=>J(ie)))}o(Ie,"TTuple");t.TTuple=Ie;function Qe(x){return T(x,"Undefined")&&x.type==="undefined"&&u(x.$id)}o(Qe,"TUndefined");t.TUndefined=Qe;function qe(x){return C(x)&&x.anyOf.every(ie=>R(ie)||O(ie))}o(qe,"TUnionLiteral");t.TUnionLiteral=qe;function C(x){return T(x,"Union")&&u(x.$id)&&Be.IsObject(x)&&Be.IsArray(x.anyOf)&&x.anyOf.every(ie=>J(ie))}o(C,"TUnion");t.TUnion=C;function P(x){return T(x,"Uint8Array")&&x.type==="Uint8Array"&&u(x.$id)&&s(x.minByteLength)&&s(x.maxByteLength)}o(P,"TUint8Array");t.TUint8Array=P;function q(x){return T(x,"Unknown")&&u(x.$id)}o(q,"TUnknown");t.TUnknown=q;function z(x){return T(x,"Unsafe")}o(z,"TUnsafe");t.TUnsafe=z;function W(x){return T(x,"Void")&&x.type==="void"&&u(x.$id)}o(W,"TVoid");t.TVoid=W;function K(x){return Be.IsObject(x)&&x[G.Readonly]==="Readonly"}o(K,"TReadonly");t.TReadonly=K;function se(x){return Be.IsObject(x)&&x[G.Optional]==="Optional"}o(se,"TOptional");t.TOptional=se;function J(x){return Be.IsObject(x)&&(p(x)||f(x)||g(x)||m(x)||h(x)||y(x)||v(x)||w(x)||E(x)||b(x)||S(x)||B(x)||U(x)||Q(x)||oe(x)||Te(x)||le(x)||ue(x)||xe(x)||Pe(x)||Ue(x)||$e(x)||ge(x)||Je(x)||Ie(x)||Qe(x)||C(x)||P(x)||q(x)||z(x)||W(x)||A(x)&&nY.Has(x[G.Kind]))}o(J,"TSchema");t.TSchema=J})(Y||(G.TypeGuard=Y={}));var _Ae;(function(t){function e(r){return r[G.Kind]==="Intersect"?r.allOf.every(n=>e(n)):r[G.Kind]==="Union"?r.anyOf.some(n=>e(n)):r[G.Kind]==="Undefined"?true:r[G.Kind]==="Not"?!e(r.not):false}o(e,"Check");t.Check=e})(_Ae||(G.ExtendsUndefined=_Ae={}));var Nx=class extends Lu{static{o(this,"TypeExtendsError")}};G.TypeExtendsError=Nx;var Ee;(function(t){t[t["Union"]=0]="Union";t[t["True"]=1]="True";t[t["False"]=2]="False"})(Ee||(G.TypeExtendsResult=Ee={}));var qm;(function(t){function e(F){return F===Ee.False?F:Ee.True}o(e,"IntoBooleanResult");function r(F){throw new Nx(F)}o(r,"Throw");function n(F){return Y.TNever(F)||Y.TIntersect(F)||Y.TUnion(F)||Y.TUnknown(F)||Y.TAny(F)}o(n,"IsStructuralRight");function i(F,$){return Y.TNever($)?T(F,$):Y.TIntersect($)?w(F,$):Y.TUnion($)?Xe(F,$):Y.TUnknown($)?tr(F,$):Y.TAny($)?s(F,$):r("StructuralRight")}o(i,"StructuralRight");function s(F,$){return Ee.True}o(s,"TAnyRight");function a(F,$){return Y.TIntersect($)?w(F,$):Y.TUnion($)&&$.anyOf.some(Ye=>Y.TAny(Ye)||Y.TUnknown(Ye))?Ee.True:Y.TUnion($)?Ee.Union:Y.TUnknown($)?Ee.True:Y.TAny($)?Ee.True:Ee.Union}o(a,"TAny");function u(F,$){return Y.TUnknown(F)?Ee.False:Y.TAny(F)?Ee.Union:Y.TNever(F)?Ee.True:Ee.False}o(u,"TArrayRight");function l(F,$){return Y.TObject($)&&ge($)?Ee.True:n($)?i(F,$):!Y.TArray($)?Ee.False:e(ft(F.items,$.items))}o(l,"TArray");function c(F,$){return n($)?i(F,$):!Y.TAsyncIterator($)?Ee.False:e(ft(F.items,$.items))}o(c,"TAsyncIterator");function d(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TBigInt($)?Ee.True:Ee.False}o(d,"TBigInt");function p(F,$){return Y.TLiteral(F)&&Be.IsBoolean(F.const)?Ee.True:Y.TBoolean(F)?Ee.True:Ee.False}o(p,"TBooleanRight");function f(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TBoolean($)?Ee.True:Ee.False}o(f,"TBoolean");function h(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):!Y.TConstructor($)?Ee.False:F.parameters.length>$.parameters.length?Ee.False:!F.parameters.every((Ye,cr)=>e(ft($.parameters[cr],Ye))===Ee.True)?Ee.False:e(ft(F.returns,$.returns))}o(h,"TConstructor");function m(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TDate($)?Ee.True:Ee.False}o(m,"TDate");function g(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):!Y.TFunction($)?Ee.False:F.parameters.length>$.parameters.length?Ee.False:!F.parameters.every((Ye,cr)=>e(ft($.parameters[cr],Ye))===Ee.True)?Ee.False:e(ft(F.returns,$.returns))}o(g,"TFunction");function y(F,$){return Y.TLiteral(F)&&Be.IsNumber(F.const)?Ee.True:Y.TNumber(F)||Y.TInteger(F)?Ee.True:Ee.False}o(y,"TIntegerRight");function v(F,$){return Y.TInteger($)||Y.TNumber($)?Ee.True:n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Ee.False}o(v,"TInteger");function w(F,$){return $.allOf.every(Ye=>ft(F,Ye)===Ee.True)?Ee.True:Ee.False}o(w,"TIntersectRight");function E(F,$){return F.allOf.some(Ye=>ft(Ye,$)===Ee.True)?Ee.True:Ee.False}o(E,"TIntersect");function b(F,$){return n($)?i(F,$):!Y.TIterator($)?Ee.False:e(ft(F.items,$.items))}o(b,"TIterator");function S(F,$){return Y.TLiteral($)&&$.const===F.const?Ee.True:n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TString($)?W(F,$):Y.TNumber($)?B(F,$):Y.TInteger($)?y(F,$):Y.TBoolean($)?p(F,$):Ee.False}o(S,"TLiteral");function T(F,$){return Ee.False}o(T,"TNeverRight");function A(F,$){return Ee.True}o(A,"TNever");function R(F){let[$,Ye]=[F,0];while(true){if(!Y.TNot($))break;$=$.not;Ye+=1}return Ye%2===0?$:G.Type.Unknown()}o(R,"UnwrapTNot");function O(F,$){return Y.TNot(F)?ft(R(F),$):Y.TNot($)?ft(F,R($)):r("Invalid fallthrough for Not")}o(O,"TNot");function j(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TNull($)?Ee.True:Ee.False}o(j,"TNull");function B(F,$){return Y.TLiteralNumber(F)?Ee.True:Y.TNumber(F)||Y.TInteger(F)?Ee.True:Ee.False}o(B,"TNumberRight");function U(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TInteger($)||Y.TNumber($)?Ee.True:Ee.False}o(U,"TNumber");function Q(F,$){return Object.getOwnPropertyNames(F.properties).length===$}o(Q,"IsObjectPropertyCount");function oe(F){return ge(F)}o(oe,"IsObjectStringLike");function Te(F){return Q(F,0)||Q(F,1)&&"description"in F.properties&&Y.TUnion(F.properties.description)&&F.properties.description.anyOf.length===2&&(Y.TString(F.properties.description.anyOf[0])&&Y.TUndefined(F.properties.description.anyOf[1])||Y.TString(F.properties.description.anyOf[1])&&Y.TUndefined(F.properties.description.anyOf[0]))}o(Te,"IsObjectSymbolLike");function le(F){return Q(F,0)}o(le,"IsObjectNumberLike");function ue(F){return Q(F,0)}o(ue,"IsObjectBooleanLike");function xe(F){return Q(F,0)}o(xe,"IsObjectBigIntLike");function we(F){return Q(F,0)}o(we,"IsObjectDateLike");function Pe(F){return ge(F)}o(Pe,"IsObjectUint8ArrayLike");function Ue(F){const $=G.Type.Number();return Q(F,0)||Q(F,1)&&"length"in F.properties&&e(ft(F.properties["length"],$))===Ee.True}o(Ue,"IsObjectFunctionLike");function $e(F){return Q(F,0)}o($e,"IsObjectConstructorLike");function ge(F){const $=G.Type.Number();return Q(F,0)||Q(F,1)&&"length"in F.properties&&e(ft(F.properties["length"],$))===Ee.True}o(ge,"IsObjectArrayLike");function Je(F){const $=G.Type.Function([G.Type.Any()],G.Type.Any());return Q(F,0)||Q(F,1)&&"then"in F.properties&&e(ft(F.properties["then"],$))===Ee.True}o(Je,"IsObjectPromiseLike");function Le(F,$){return ft(F,$)===Ee.False?Ee.False:Y.TOptional(F)&&!Y.TOptional($)?Ee.False:Ee.True}o(Le,"Property");function Ie(F,$){return Y.TUnknown(F)?Ee.False:Y.TAny(F)?Ee.Union:Y.TNever(F)||Y.TLiteralString(F)&&oe($)||Y.TLiteralNumber(F)&&le($)||Y.TLiteralBoolean(F)&&ue($)||Y.TSymbol(F)&&Te($)||Y.TBigInt(F)&&xe($)||Y.TString(F)&&oe($)||Y.TSymbol(F)&&Te($)||Y.TNumber(F)&&le($)||Y.TInteger(F)&&le($)||Y.TBoolean(F)&&ue($)||Y.TUint8Array(F)&&Pe($)||Y.TDate(F)&&we($)||Y.TConstructor(F)&&$e($)||Y.TFunction(F)&&Ue($)?Ee.True:Y.TRecord(F)&&Y.TString(C(F))?(()=>{return $[G.Hint]==="Record"?Ee.True:Ee.False})():Y.TRecord(F)&&Y.TNumber(C(F))?(()=>{return Q($,0)?Ee.True:Ee.False})():Ee.False}o(Ie,"TObjectRight");function Qe(F,$){return n($)?i(F,$):Y.TRecord($)?q(F,$):!Y.TObject($)?Ee.False:(()=>{for(const Ye of Object.getOwnPropertyNames($.properties)){if(!(Ye in F.properties))return Ee.False;if(Le(F.properties[Ye],$.properties[Ye])===Ee.False){return Ee.False}}return Ee.True})()}o(Qe,"TObject");function qe(F,$){return n($)?i(F,$):Y.TObject($)&&Je($)?Ee.True:!Y.TPromise($)?Ee.False:e(ft(F.item,$.item))}o(qe,"TPromise");function C(F){return G.PatternNumberExact in F.patternProperties?G.Type.Number():G.PatternStringExact in F.patternProperties?G.Type.String():r("Unknown record key pattern")}o(C,"RecordKey");function P(F){return G.PatternNumberExact in F.patternProperties?F.patternProperties[G.PatternNumberExact]:G.PatternStringExact in F.patternProperties?F.patternProperties[G.PatternStringExact]:r("Unable to get record value schema")}o(P,"RecordValue");function q(F,$){const[Ye,cr]=[C($),P($)];return Y.TLiteralString(F)&&Y.TNumber(Ye)&&e(ft(F,cr))===Ee.True?Ee.True:Y.TUint8Array(F)&&Y.TNumber(Ye)?ft(F,cr):Y.TString(F)&&Y.TNumber(Ye)?ft(F,cr):Y.TArray(F)&&Y.TNumber(Ye)?ft(F,cr):Y.TObject(F)?(()=>{for(const vi of Object.getOwnPropertyNames(F.properties)){if(Le(cr,F.properties[vi])===Ee.False){return Ee.False}}return Ee.True})():Ee.False}o(q,"TRecordRight");function z(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):!Y.TRecord($)?Ee.False:ft(P(F),P($))}o(z,"TRecord");function W(F,$){return Y.TLiteral(F)&&Be.IsString(F.const)?Ee.True:Y.TString(F)?Ee.True:Ee.False}o(W,"TStringRight");function K(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TString($)?Ee.True:Ee.False}o(K,"TString");function se(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TSymbol($)?Ee.True:Ee.False}o(se,"TSymbol");function J(F,$){return Y.TTemplateLiteral(F)?ft(nd.Resolve(F),$):Y.TTemplateLiteral($)?ft(F,nd.Resolve($)):r("Invalid fallthrough for TemplateLiteral")}o(J,"TTemplateLiteral");function x(F,$){return Y.TArray($)&&F.items!==void 0&&F.items.every(Ye=>ft(Ye,$.items)===Ee.True)}o(x,"IsArrayOfTuple");function ie(F,$){return Y.TNever(F)?Ee.True:Y.TUnknown(F)?Ee.False:Y.TAny(F)?Ee.Union:Ee.False}o(ie,"TTupleRight");function ce(F,$){return n($)?i(F,$):Y.TObject($)&&ge($)?Ee.True:Y.TArray($)&&x(F,$)?Ee.True:!Y.TTuple($)?Ee.False:Be.IsUndefined(F.items)&&!Be.IsUndefined($.items)||!Be.IsUndefined(F.items)&&Be.IsUndefined($.items)?Ee.False:Be.IsUndefined(F.items)&&!Be.IsUndefined($.items)?Ee.True:F.items.every((Ye,cr)=>ft(Ye,$.items[cr])===Ee.True)?Ee.True:Ee.False}o(ce,"TTuple");function ve(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TUint8Array($)?Ee.True:Ee.False}o(ve,"TUint8Array");function je(F,$){return n($)?i(F,$):Y.TObject($)?Ie(F,$):Y.TRecord($)?q(F,$):Y.TVoid($)?Et(F,$):Y.TUndefined($)?Ee.True:Ee.False}o(je,"TUndefined");function Xe(F,$){return $.anyOf.some(Ye=>ft(F,Ye)===Ee.True)?Ee.True:Ee.False}o(Xe,"TUnionRight");function _t(F,$){return F.anyOf.every(Ye=>ft(Ye,$)===Ee.True)?Ee.True:Ee.False}o(_t,"TUnion");function tr(F,$){return Ee.True}o(tr,"TUnknownRight");function lr(F,$){return Y.TNever($)?T(F,$):Y.TIntersect($)?w(F,$):Y.TUnion($)?Xe(F,$):Y.TAny($)?s(F,$):Y.TString($)?W(F,$):Y.TNumber($)?B(F,$):Y.TInteger($)?y(F,$):Y.TBoolean($)?p(F,$):Y.TArray($)?u(F,$):Y.TTuple($)?ie(F,$):Y.TObject($)?Ie(F,$):Y.TUnknown($)?Ee.True:Ee.False}o(lr,"TUnknown");function Et(F,$){return Y.TUndefined(F)?Ee.True:Y.TUndefined(F)?Ee.True:Ee.False}o(Et,"VoidRight");function xt(F,$){return Y.TIntersect($)?w(F,$):Y.TUnion($)?Xe(F,$):Y.TUnknown($)?tr(F,$):Y.TAny($)?s(F,$):Y.TObject($)?Ie(F,$):Y.TVoid($)?Ee.True:Ee.False}o(xt,"TVoid");function ft(F,$){return Y.TTemplateLiteral(F)||Y.TTemplateLiteral($)?J(F,$):Y.TNot(F)||Y.TNot($)?O(F,$):Y.TAny(F)?a(F,$):Y.TArray(F)?l(F,$):Y.TBigInt(F)?d(F,$):Y.TBoolean(F)?f(F,$):Y.TAsyncIterator(F)?c(F,$):Y.TConstructor(F)?h(F,$):Y.TDate(F)?m(F,$):Y.TFunction(F)?g(F,$):Y.TInteger(F)?v(F,$):Y.TIntersect(F)?E(F,$):Y.TIterator(F)?b(F,$):Y.TLiteral(F)?S(F,$):Y.TNever(F)?A(F,$):Y.TNull(F)?j(F,$):Y.TNumber(F)?U(F,$):Y.TObject(F)?Qe(F,$):Y.TRecord(F)?z(F,$):Y.TString(F)?K(F,$):Y.TSymbol(F)?se(F,$):Y.TTuple(F)?ce(F,$):Y.TPromise(F)?qe(F,$):Y.TUint8Array(F)?ve(F,$):Y.TUndefined(F)?je(F,$):Y.TUnion(F)?_t(F,$):Y.TUnknown(F)?lr(F,$):Y.TVoid(F)?xt(F,$):r(`Unknown left type operand '${F[G.Kind]}'`)}o(ft,"Visit");function en(F,$){return ft(F,$)}o(en,"Extends");t.Extends=en})(qm||(G.TypeExtends=qm={}));var ct;(function(t){function e(a){const u=Object.getOwnPropertyNames(a).reduce((c,d)=>({...c,[d]:n(a[d])}),{});const l=Object.getOwnPropertySymbols(a).reduce((c,d)=>({...c,[d]:n(a[d])}),{});return{...u,...l}}o(e,"ObjectType");function r(a){return a.map(u=>n(u))}o(r,"ArrayType");function n(a){return Be.IsArray(a)?r(a):Be.IsObject(a)?e(a):a}o(n,"Visit");function i(a){return a.map(u=>s(u))}o(i,"Rest");t.Rest=i;function s(a,u={}){return{...n(a),...u}}o(s,"Type");t.Type=s})(ct||(G.TypeClone=ct={}));var sY;(function(t){function e(h){return h.map(m=>{const{[G.Optional]:g,...y}=ct.Type(m);return y})}o(e,"OptionalUnwrap");function r(h){return h.every(m=>Y.TOptional(m))}o(r,"IsIntersectOptional");function n(h){return h.some(m=>Y.TOptional(m))}o(n,"IsUnionOptional");function i(h){return r(h.allOf)?G.Type.Optional(G.Type.Intersect(e(h.allOf))):h}o(i,"ResolveIntersect");function s(h){return n(h.anyOf)?G.Type.Optional(G.Type.Union(e(h.anyOf))):h}o(s,"ResolveUnion");function a(h){return h[G.Kind]==="Intersect"?i(h):h[G.Kind]==="Union"?s(h):h}o(a,"ResolveOptional");function u(h,m){const g=h.allOf.reduce((y,v)=>{const w=p(v,m);return w[G.Kind]==="Never"?y:[...y,w]},[]);return a(G.Type.Intersect(g))}o(u,"TIntersect");function l(h,m){const g=h.anyOf.map(y=>p(y,m));return a(G.Type.Union(g))}o(l,"TUnion");function c(h,m){const g=h.properties[m];return Be.IsUndefined(g)?G.Type.Never():G.Type.Union([g])}o(c,"TObject");function d(h,m){const g=h.items;if(Be.IsUndefined(g))return G.Type.Never();const y=g[m];if(Be.IsUndefined(y))return G.Type.Never();return y}o(d,"TTuple");function p(h,m){return h[G.Kind]==="Intersect"?u(h,m):h[G.Kind]==="Union"?l(h,m):h[G.Kind]==="Object"?c(h,m):h[G.Kind]==="Tuple"?d(h,m):G.Type.Never()}o(p,"Visit");function f(h,m,g={}){const y=m.map(v=>p(h,v.toString()));return a(G.Type.Union(y,g))}o(f,"Resolve");t.Resolve=f})(sY||(G.IndexedAccessor=sY={}));var Yy;(function(t){function e(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toLowerCase()}${f}`}o(e,"Uncapitalize");function r(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toUpperCase()}${f}`}o(r,"Capitalize");function n(d){return d.toUpperCase()}o(n,"Uppercase");function i(d){return d.toLowerCase()}o(i,"Lowercase");function s(d,p){const f=Jy.ParseExact(d.pattern);const h=Qy.Check(f);if(!h)return{...d,pattern:a(d.pattern,p)};const m=[...Xy.Generate(f)];const g=m.map(w=>G.Type.Literal(w));const y=u(g,p);const v=G.Type.Union(y);return G.Type.TemplateLiteral([v])}o(s,"IntrinsicTemplateLiteral");function a(d,p){return typeof d==="string"?p==="Uncapitalize"?e(d):p==="Capitalize"?r(d):p==="Uppercase"?n(d):p==="Lowercase"?i(d):d:d.toString()}o(a,"IntrinsicLiteral");function u(d,p){if(d.length===0)return[];const[f,...h]=d;return[c(f,p),...u(h,p)]}o(u,"IntrinsicRest");function l(d,p){return Y.TTemplateLiteral(d)?s(d,p):Y.TUnion(d)?G.Type.Union(u(d.anyOf,p)):Y.TLiteral(d)?G.Type.Literal(a(d.const,p)):d}o(l,"Visit");function c(d,p){return l(d,p)}o(c,"Map");t.Map=c})(Yy||(G.Intrinsic=Yy={}));var Wy;(function(t){function e(a,u){return G.Type.Intersect(a.allOf.map(l=>i(l,u)),{...a})}o(e,"TIntersect");function r(a,u){return G.Type.Union(a.anyOf.map(l=>i(l,u)),{...a})}o(r,"TUnion");function n(a,u){return u(a)}o(n,"TObject");function i(a,u){return a[G.Kind]==="Intersect"?e(a,u):a[G.Kind]==="Union"?r(a,u):a[G.Kind]==="Object"?n(a,u):a}o(i,"Visit");function s(a,u,l){return{...i(ct.Type(a),u),...l}}o(s,"Map");t.Map=s})(Wy||(G.ObjectMap=Wy={}));var Ix;(function(t){function e(c){return c[0]==="^"&&c[c.length-1]==="$"?c.slice(1,c.length-1):c}o(e,"UnwrapPattern");function r(c,d){return c.allOf.reduce((p,f)=>[...p,...a(f,d)],[])}o(r,"TIntersect");function n(c,d){const p=c.anyOf.map(f=>a(f,d));return[...p.reduce((f,h)=>h.map(m=>p.every(g=>g.includes(m))?f.add(m):f)[0],new Set)]}o(n,"TUnion");function i(c,d){return Object.getOwnPropertyNames(c.properties)}o(i,"TObject");function s(c,d){return d.includePatterns?Object.getOwnPropertyNames(c.patternProperties):[]}o(s,"TRecord");function a(c,d){return Y.TIntersect(c)?r(c,d):Y.TUnion(c)?n(c,d):Y.TObject(c)?i(c,d):Y.TRecord(c)?s(c,d):[]}o(a,"Visit");function u(c,d){return[...new Set(a(c,d))]}o(u,"ResolveKeys");t.ResolveKeys=u;function l(c){const d=u(c,{includePatterns:true});const p=d.map(f=>`(${e(f)})`);return`^(${p.join("|")})$`}o(l,"ResolvePattern");t.ResolvePattern=l})(Ix||(G.KeyResolver=Ix={}));var Px=class extends Lu{static{o(this,"KeyArrayResolverError")}};G.KeyArrayResolverError=Px;var fb;(function(t){function e(r){return Array.isArray(r)?r:Y.TUnionLiteral(r)?r.anyOf.map(n=>n.const.toString()):Y.TLiteral(r)?[r.const]:Y.TTemplateLiteral(r)?(()=>{const n=Jy.ParseExact(r.pattern);if(!Qy.Check(n))throw new Px("Cannot resolve keys from infinite template expression");return[...Xy.Generate(n)]})():[]}o(e,"Resolve");t.Resolve=e})(fb||(G.KeyArrayResolver=fb={}));var aY;(function(t){function*e(n){for(const i of n.anyOf){if(i[G.Kind]==="Union"){yield*e(i)}else{yield i}}}o(e,"TUnion");function r(n){return G.Type.Union([...e(n)],{...n})}o(r,"Resolve");t.Resolve=r})(aY||(G.UnionResolver=aY={}));var Dx=class extends Lu{static{o(this,"TemplateLiteralPatternError")}};G.TemplateLiteralPatternError=Dx;var kx;(function(t){function e(s){throw new Dx(s)}o(e,"Throw");function r(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(r,"Escape");function n(s,a){return Y.TTemplateLiteral(s)?s.pattern.slice(1,s.pattern.length-1):Y.TUnion(s)?`(${s.anyOf.map(u=>n(u,a)).join("|")})`:Y.TNumber(s)?`${a}${G.PatternNumber}`:Y.TInteger(s)?`${a}${G.PatternNumber}`:Y.TBigInt(s)?`${a}${G.PatternNumber}`:Y.TString(s)?`${a}${G.PatternString}`:Y.TLiteral(s)?`${a}${r(s.const.toString())}`:Y.TBoolean(s)?`${a}${G.PatternBoolean}`:e(`Unexpected Kind '${s[G.Kind]}'`)}o(n,"Visit");function i(s){return`^${s.map(a=>n(a,"")).join("")}$`}o(i,"Create");t.Create=i})(kx||(G.TemplateLiteralPattern=kx={}));var nd;(function(t){function e(r){const n=Jy.ParseExact(r.pattern);if(!Qy.Check(n))return G.Type.String();const i=[...Xy.Generate(n)].map(s=>G.Type.Literal(s));return G.Type.Union(i)}o(e,"Resolve");t.Resolve=e})(nd||(G.TemplateLiteralResolver=nd={}));var hb=class extends Lu{static{o(this,"TemplateLiteralParserError")}};G.TemplateLiteralParserError=hb;var Jy;(function(t){function e(h,m,g){return h[m]===g&&h.charCodeAt(m-1)!==92}o(e,"IsNonEscaped");function r(h,m){return e(h,m,"(")}o(r,"IsOpenParen");function n(h,m){return e(h,m,")")}o(n,"IsCloseParen");function i(h,m){return e(h,m,"|")}o(i,"IsSeparator");function s(h){if(!(r(h,0)&&n(h,h.length-1)))return false;let m=0;for(let g=0;g<h.length;g++){if(r(h,g))m+=1;if(n(h,g))m-=1;if(m===0&&g!==h.length-1)return false}return true}o(s,"IsGroup");function a(h){return h.slice(1,h.length-1)}o(a,"InGroup");function u(h){let m=0;for(let g=0;g<h.length;g++){if(r(h,g))m+=1;if(n(h,g))m-=1;if(i(h,g)&&m===0)return true}return false}o(u,"IsPrecedenceOr");function l(h){for(let m=0;m<h.length;m++){if(r(h,m))return true}return false}o(l,"IsPrecedenceAnd");function c(h){let[m,g]=[0,0];const y=[];for(let w=0;w<h.length;w++){if(r(h,w))m+=1;if(n(h,w))m-=1;if(i(h,w)&&m===0){const E=h.slice(g,w);if(E.length>0)y.push(p(E));g=w+1}}const v=h.slice(g);if(v.length>0)y.push(p(v));if(y.length===0)return{type:"const",const:""};if(y.length===1)return y[0];return{type:"or",expr:y}}o(c,"Or");function d(h){function m(v,w){if(!r(v,w))throw new hb(`TemplateLiteralParser: Index must point to open parens`);let E=0;for(let b=w;b<v.length;b++){if(r(v,b))E+=1;if(n(v,b))E-=1;if(E===0)return[w,b]}throw new hb(`TemplateLiteralParser: Unclosed group parens in expression`)}o(m,"Group");function g(v,w){for(let E=w;E<v.length;E++){if(r(v,E))return[w,E]}return[w,v.length]}o(g,"Range");const y=[];for(let v=0;v<h.length;v++){if(r(h,v)){const[w,E]=m(h,v);const b=h.slice(w,E+1);y.push(p(b));v=E}else{const[w,E]=g(h,v);const b=h.slice(w,E);if(b.length>0)y.push(p(b));v=E-1}}return y.length===0?{type:"const",const:""}:y.length===1?y[0]:{type:"and",expr:y}}o(d,"And");function p(h){return s(h)?p(a(h)):u(h)?c(h):l(h)?d(h):{type:"const",const:h}}o(p,"Parse");t.Parse=p;function f(h){return p(h.slice(1,h.length-1))}o(f,"ParseExact");t.ParseExact=f})(Jy||(G.TemplateLiteralParser=Jy={}));var $x=class extends Lu{static{o(this,"TemplateLiteralFiniteError")}};G.TemplateLiteralFiniteError=$x;var Qy;(function(t){function e(a){throw new $x(a)}o(e,"Throw");function r(a){return a.type==="or"&&a.expr.length===2&&a.expr[0].type==="const"&&a.expr[0].const==="0"&&a.expr[1].type==="const"&&a.expr[1].const==="[1-9][0-9]*"}o(r,"IsNumber");function n(a){return a.type==="or"&&a.expr.length===2&&a.expr[0].type==="const"&&a.expr[0].const==="true"&&a.expr[1].type==="const"&&a.expr[1].const==="false"}o(n,"IsBoolean");function i(a){return a.type==="const"&&a.const===".*"}o(i,"IsString");function s(a){return n(a)?true:r(a)||i(a)?false:a.type==="and"?a.expr.every(u=>s(u)):a.type==="or"?a.expr.every(u=>s(u)):a.type==="const"?true:e(`Unknown expression type`)}o(s,"Check");t.Check=s})(Qy||(G.TemplateLiteralFinite=Qy={}));var Lx=class extends Lu{static{o(this,"TemplateLiteralGeneratorError")}};G.TemplateLiteralGeneratorError=Lx;var Xy;(function(t){function*e(a){if(a.length===1)return yield*a[0];for(const u of a[0]){for(const l of e(a.slice(1))){yield`${u}${l}`}}}o(e,"Reduce");function*r(a){return yield*e(a.expr.map(u=>[...s(u)]))}o(r,"And");function*n(a){for(const u of a.expr)yield*s(u)}o(n,"Or");function*i(a){return yield a.const}o(i,"Const");function*s(a){return a.type==="and"?yield*r(a):a.type==="or"?yield*n(a):a.type==="const"?yield*i(a):(()=>{throw new Lx("Unknown expression")})()}o(s,"Generate");t.Generate=s})(Xy||(G.TemplateLiteralGenerator=Xy={}));var oY;(function(t){function*e(s){const a=s.trim().replace(/"|'/g,"");return a==="boolean"?yield G.Type.Boolean():a==="number"?yield G.Type.Number():a==="bigint"?yield G.Type.BigInt():a==="string"?yield G.Type.String():yield(()=>{const u=a.split("|").map(l=>G.Type.Literal(l.trim()));return u.length===0?G.Type.Never():u.length===1?u[0]:G.Type.Union(u)})()}o(e,"ParseUnion");function*r(s){if(s[1]!=="{"){const a=G.Type.Literal("$");const u=n(s.slice(1));return yield*[a,...u]}for(let a=2;a<s.length;a++){if(s[a]==="}"){const u=e(s.slice(2,a));const l=n(s.slice(a+1));return yield*[...u,...l]}}yield G.Type.Literal(s)}o(r,"ParseTerminal");function*n(s){for(let a=0;a<s.length;a++){if(s[a]==="$"){const u=G.Type.Literal(s.slice(0,a));const l=r(s.slice(a));return yield*[u,...l]}}yield G.Type.Literal(s)}o(n,"ParseLiteral");function i(s){return[...n(s)]}o(i,"Parse");t.Parse=i})(oY||(G.TemplateLiteralDslParser=oY={}));var qx=class{static{o(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new jx(this.schema,e)}};G.TransformDecodeBuilder=qx;var jx=class{static{o(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e;this.decode=r}Encode(e){const r=ct.Type(this.schema);return Y.TTransform(r)?(()=>{const n=o(a=>r[G.Transform].Encode(e(a)),"Encode");const i=o(a=>this.decode(r[G.Transform].Decode(a)),"Decode");const s={Encode:n,Decode:i};return{...r,[G.Transform]:s}})():(()=>{const n={Decode:this.decode,Encode:e};return{...r,[G.Transform]:n}})()}};G.TransformEncodeBuilder=jx;var P$t=0;var Ux=class extends Lu{static{o(this,"TypeBuilderError")}};G.TypeBuilderError=Ux;var Fx=class{static{o(this,"TypeBuilder")}Create(e){return e}Throw(e){throw new Ux(e)}Discard(e,r){const{[r]:n,...i}=e;return i}Strict(e){return JSON.parse(JSON.stringify(e))}};G.TypeBuilder=Fx;var mb=class extends Fx{static{o(this,"JsonTypeBuilder")}ReadonlyOptional(e){return this.Readonly(this.Optional(e))}Readonly(e){return{...ct.Type(e),[G.Readonly]:"Readonly"}}Optional(e){return{...ct.Type(e),[G.Optional]:"Optional"}}Any(e={}){return this.Create({...e,[G.Kind]:"Any"})}Array(e,r={}){return this.Create({...r,[G.Kind]:"Array",type:"array",items:ct.Type(e)})}Boolean(e={}){return this.Create({...e,[G.Kind]:"Boolean",type:"boolean"})}Capitalize(e,r={}){return{...Yy.Map(ct.Type(e),"Capitalize"),...r}}Composite(e,r){const n=G.Type.Intersect(e,{});const i=Ix.ResolveKeys(n,{includePatterns:false});const s=i.reduce((a,u)=>({...a,[u]:G.Type.Index(n,[u])}),{});return G.Type.Object(s,r)}Enum(e,r={}){const n=Object.getOwnPropertyNames(e).filter(s=>isNaN(s)).map(s=>e[s]);const i=n.map(s=>Be.IsString(s)?{[G.Kind]:"Literal",type:"string",const:s}:{[G.Kind]:"Literal",type:"number",const:s});return this.Create({...r,[G.Kind]:"Union",anyOf:i})}Extends(e,r,n,i,s={}){switch(qm.Extends(e,r)){case Ee.Union:return this.Union([ct.Type(n,s),ct.Type(i,s)]);case Ee.True:return ct.Type(n,s);case Ee.False:return ct.Type(i,s)}}Exclude(e,r,n={}){return Y.TTemplateLiteral(e)?this.Exclude(nd.Resolve(e),r,n):Y.TTemplateLiteral(r)?this.Exclude(e,nd.Resolve(r),n):Y.TUnion(e)?(()=>{const i=e.anyOf.filter(s=>qm.Extends(s,r)===Ee.False);return i.length===1?ct.Type(i[0],n):this.Union(i,n)})():qm.Extends(e,r)!==Ee.False?this.Never(n):ct.Type(e,n)}Extract(e,r,n={}){return Y.TTemplateLiteral(e)?this.Extract(nd.Resolve(e),r,n):Y.TTemplateLiteral(r)?this.Extract(e,nd.Resolve(r),n):Y.TUnion(e)?(()=>{const i=e.anyOf.filter(s=>qm.Extends(s,r)!==Ee.False);return i.length===1?ct.Type(i[0],n):this.Union(i,n)})():qm.Extends(e,r)!==Ee.False?ct.Type(e,n):this.Never(n)}Index(e,r,n={}){return Y.TArray(e)&&Y.TNumber(r)?(()=>{return ct.Type(e.items,n)})():Y.TTuple(e)&&Y.TNumber(r)?(()=>{const i=Be.IsUndefined(e.items)?[]:e.items;const s=i.map(a=>ct.Type(a));return this.Union(s,n)})():(()=>{const i=fb.Resolve(r);const s=ct.Type(e);return sY.Resolve(s,i,n)})()}Integer(e={}){return this.Create({...e,[G.Kind]:"Integer",type:"integer"})}Intersect(e,r={}){if(e.length===0)return G.Type.Never();if(e.length===1)return ct.Type(e[0],r);if(e.some(a=>Y.TTransform(a)))this.Throw("Cannot intersect transform types");const n=e.every(a=>Y.TObject(a));const i=ct.Rest(e);const s=Y.TSchema(r.unevaluatedProperties)?{unevaluatedProperties:ct.Type(r.unevaluatedProperties)}:{};return r.unevaluatedProperties===false||Y.TSchema(r.unevaluatedProperties)||n?this.Create({...r,...s,[G.Kind]:"Intersect",type:"object",allOf:i}):this.Create({...r,...s,[G.Kind]:"Intersect",allOf:i})}KeyOf(e,r={}){return Y.TRecord(e)?(()=>{const n=Object.getOwnPropertyNames(e.patternProperties)[0];return n===G.PatternNumberExact?this.Number(r):n===G.PatternStringExact?this.String(r):this.Throw("Unable to resolve key type from Record key pattern")})():Y.TTuple(e)?(()=>{const n=Be.IsUndefined(e.items)?[]:e.items;const i=n.map((s,a)=>G.Type.Literal(a.toString()));return this.Union(i,r)})():Y.TArray(e)?(()=>{return this.Number(r)})():(()=>{const n=Ix.ResolveKeys(e,{includePatterns:false});if(n.length===0)return this.Never(r);const i=n.map(s=>this.Literal(s));return this.Union(i,r)})()}Literal(e,r={}){return this.Create({...r,[G.Kind]:"Literal",const:e,type:typeof e})}Lowercase(e,r={}){return{...Yy.Map(ct.Type(e),"Lowercase"),...r}}Never(e={}){return this.Create({...e,[G.Kind]:"Never",not:{}})}Not(e,r){return this.Create({...r,[G.Kind]:"Not",not:ct.Type(e)})}Null(e={}){return this.Create({...e,[G.Kind]:"Null",type:"null"})}Number(e={}){return this.Create({...e,[G.Kind]:"Number",type:"number"})}Object(e,r={}){const n=Object.getOwnPropertyNames(e);const i=n.filter(l=>Y.TOptional(e[l]));const s=n.filter(l=>!i.includes(l));const a=Y.TSchema(r.additionalProperties)?{additionalProperties:ct.Type(r.additionalProperties)}:{};const u=n.reduce((l,c)=>({...l,[c]:ct.Type(e[c])}),{});return s.length>0?this.Create({...r,...a,[G.Kind]:"Object",type:"object",properties:u,required:s}):this.Create({...r,...a,[G.Kind]:"Object",type:"object",properties:u})}Omit(e,r,n={}){const i=fb.Resolve(r);return Wy.Map(this.Discard(ct.Type(e),G.Transform),s=>{if(Be.IsArray(s.required)){s.required=s.required.filter(a=>!i.includes(a));if(s.required.length===0)delete s.required}for(const a of Object.getOwnPropertyNames(s.properties)){if(i.includes(a))delete s.properties[a]}return this.Create(s)},n)}Partial(e,r={}){return Wy.Map(this.Discard(ct.Type(e),G.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,a)=>{return{...s,[a]:this.Optional(n.properties[a])}},{});return this.Object(i,this.Discard(n,"required"))},r)}Pick(e,r,n={}){const i=fb.Resolve(r);return Wy.Map(this.Discard(ct.Type(e),G.Transform),s=>{if(Be.IsArray(s.required)){s.required=s.required.filter(a=>i.includes(a));if(s.required.length===0)delete s.required}for(const a of Object.getOwnPropertyNames(s.properties)){if(!i.includes(a))delete s.properties[a]}return this.Create(s)},n)}Record(e,r,n={}){return Y.TTemplateLiteral(e)?(()=>{const i=Jy.ParseExact(e.pattern);return Qy.Check(i)?this.Object([...Xy.Generate(i)].reduce((s,a)=>({...s,[a]:ct.Type(r)}),{}),n):this.Create({...n,[G.Kind]:"Record",type:"object",patternProperties:{[e.pattern]:ct.Type(r)}})})():Y.TUnion(e)?(()=>{const i=aY.Resolve(e);if(Y.TUnionLiteral(i)){const s=i.anyOf.reduce((a,u)=>({...a,[u.const]:ct.Type(r)}),{});return this.Object(s,{...n,[G.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():Y.TLiteral(e)?(()=>{return Be.IsString(e.const)||Be.IsNumber(e.const)?this.Object({[e.const]:ct.Type(r)},n):this.Throw("Record key of type literal is not of type string or number")})():Y.TInteger(e)||Y.TNumber(e)?(()=>{return this.Create({...n,[G.Kind]:"Record",type:"object",patternProperties:{[G.PatternNumberExact]:ct.Type(r)}})})():Y.TString(e)?(()=>{const i=Be.IsUndefined(e.pattern)?G.PatternStringExact:e.pattern;return this.Create({...n,[G.Kind]:"Record",type:"object",patternProperties:{[i]:ct.Type(r)}})})():this.Never()}Recursive(e,r={}){if(Be.IsUndefined(r.$id))r.$id=`T${P$t++}`;const n=e({[G.Kind]:"This",$ref:`${r.$id}`});n.$id=r.$id;return this.Create({...r,[G.Hint]:"Recursive",...n})}Ref(e,r={}){if(Be.IsString(e))return this.Create({...r,[G.Kind]:"Ref",$ref:e});if(Be.IsUndefined(e.$id))this.Throw("Reference target type must specify an $id");return this.Create({...r,[G.Kind]:"Ref",$ref:e.$id})}Required(e,r={}){return Wy.Map(this.Discard(ct.Type(e),G.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,a)=>{return{...s,[a]:this.Discard(n.properties[a],G.Optional)}},{});return this.Object(i,n)},r)}Rest(e){return Y.TTuple(e)&&!Be.IsUndefined(e.items)?ct.Rest(e.items):Y.TIntersect(e)?ct.Rest(e.allOf):Y.TUnion(e)?ct.Rest(e.anyOf):[]}String(e={}){return this.Create({...e,[G.Kind]:"String",type:"string"})}TemplateLiteral(e,r={}){const n=Be.IsString(e)?kx.Create(oY.Parse(e)):kx.Create(e);return this.Create({...r,[G.Kind]:"TemplateLiteral",type:"string",pattern:n})}Transform(e){return new qx(e)}Tuple(e,r={}){const[n,i,s]=[false,e.length,e.length];const a=ct.Rest(e);const u=e.length>0?{...r,[G.Kind]:"Tuple",type:"array",items:a,additionalItems:n,minItems:i,maxItems:s}:{...r,[G.Kind]:"Tuple",type:"array",minItems:i,maxItems:s};return this.Create(u)}Uncapitalize(e,r={}){return{...Yy.Map(ct.Type(e),"Uncapitalize"),...r}}Union(e,r={}){return Y.TTemplateLiteral(e)?nd.Resolve(e):(()=>{const n=e;if(n.length===0)return this.Never(r);if(n.length===1)return this.Create(ct.Type(n[0],r));const i=ct.Rest(n);return this.Create({...r,[G.Kind]:"Union",anyOf:i})})()}Unknown(e={}){return this.Create({...e,[G.Kind]:"Unknown"})}Unsafe(e={}){return this.Create({...e,[G.Kind]:e[G.Kind]||"Unsafe"})}Uppercase(e,r={}){return{...Yy.Map(ct.Type(e),"Uppercase"),...r}}};G.JsonTypeBuilder=mb;var Mx=class extends mb{static{o(this,"JavaScriptTypeBuilder")}AsyncIterator(e,r={}){return this.Create({...r,[G.Kind]:"AsyncIterator",type:"AsyncIterator",items:ct.Type(e)})}Awaited(e,r={}){const n=o(i=>i.length>0?(()=>{const[s,...a]=i;return[this.Awaited(s),...n(a)]})():i,"Unwrap");return Y.TIntersect(e)?G.Type.Intersect(n(e.allOf)):Y.TUnion(e)?G.Type.Union(n(e.anyOf)):Y.TPromise(e)?this.Awaited(e.item):ct.Type(e,r)}BigInt(e={}){return this.Create({...e,[G.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(e,r={}){return this.Tuple([...e.parameters],{...r})}Constructor(e,r,n){const[i,s]=[ct.Rest(e),ct.Type(r)];return this.Create({...n,[G.Kind]:"Constructor",type:"constructor",parameters:i,returns:s})}Date(e={}){return this.Create({...e,[G.Kind]:"Date",type:"Date"})}Function(e,r,n){const[i,s]=[ct.Rest(e),ct.Type(r)];return this.Create({...n,[G.Kind]:"Function",type:"function",parameters:i,returns:s})}InstanceType(e,r={}){return ct.Type(e.returns,r)}Iterator(e,r={}){return this.Create({...r,[G.Kind]:"Iterator",type:"Iterator",items:ct.Type(e)})}Parameters(e,r={}){return this.Tuple(e.parameters,{...r})}Promise(e,r={}){return this.Create({...r,[G.Kind]:"Promise",type:"Promise",item:ct.Type(e)})}RegExp(e,r={}){const n=Be.IsString(e)?e:e.source;return this.Create({...r,[G.Kind]:"String",type:"string",pattern:n})}RegEx(e,r={}){return this.RegExp(e,r)}ReturnType(e,r={}){return ct.Type(e.returns,r)}Symbol(e){return this.Create({...e,[G.Kind]:"Symbol",type:"symbol"})}Undefined(e={}){return this.Create({...e,[G.Kind]:"Undefined",type:"undefined"})}Uint8Array(e={}){return this.Create({...e,[G.Kind]:"Uint8Array",type:"Uint8Array"})}Void(e={}){return this.Create({...e,[G.Kind]:"Void",type:"void"})}};G.JavaScriptTypeBuilder=Mx;G.JsonType=new mb;G.Type=new Mx});var bAe=_(Bx=>{"use strict";Object.defineProperty(Bx,"__esModule",{value:true});Bx.CustomTypeBuilder=void 0;var gb=EAe();var uY=class extends gb.TypeBuilder{static{o(this,"CustomTypeBuilder")}static Date(){return gb.Type.Unsafe({type:"string",format:"date-time"})}static Nullable(e){return gb.Type.Union([e,gb.Type.Null()])}static StringEnum(e){return gb.Type.Unsafe({type:"string",enum:e})}};Bx.CustomTypeBuilder=uY});var AAe=_(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:true});lt.throwIfNotNumber=lt.throwIfNotString=lt.throwIfUndefinedOrNull=lt.throwIfUndefined=lt.ArgumentTypeError=lt.ArgumentUndefinedError=lt.ValidationError=lt.withUndefinedAsNull=lt.withNullAsUndefined=lt.validateConstraint=lt.validateConstraints=lt.areFunctions=lt.isFunction=lt.isEmptyObject=lt.assertAllDefined=lt.assertIsDefined=lt.assertType=lt.isUndefinedOrNull=lt.isDefined=lt.isUndefined=lt.isBoolean=lt.isIterable=lt.isNumber=lt.isTypedArray=lt.isObject=lt.isStringArray=lt.isString=void 0;function Vx(t){return typeof t==="string"}o(Vx,"isString");lt.isString=Vx;function D$t(t){return Array.isArray(t)&&t.every(e=>Vx(e))}o(D$t,"isStringArray");lt.isStringArray=D$t;function wAe(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}o(wAe,"isObject");lt.isObject=wAe;function k$t(t){const e=Object.getPrototypeOf(Uint8Array);return typeof t==="object"&&t instanceof e}o(k$t,"isTypedArray");lt.isTypedArray=k$t;function SAe(t){return typeof t==="number"&&!isNaN(t)}o(SAe,"isNumber");lt.isNumber=SAe;function $$t(t){return!!t&&typeof t[Symbol.iterator]==="function"}o($$t,"isIterable");lt.isIterable=$$t;function L$t(t){return t===true||t===false}o(L$t,"isBoolean");lt.isBoolean=L$t;function lY(t){return typeof t==="undefined"}o(lY,"isUndefined");lt.isUndefined=lY;function q$t(t){return!Zy(t)}o(q$t,"isDefined");lt.isDefined=q$t;function Zy(t){return lY(t)||t===null}o(Zy,"isUndefinedOrNull");lt.isUndefinedOrNull=Zy;function j$t(t,e){if(!t){throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}}o(j$t,"assertType");lt.assertType=j$t;function U$t(t){if(Zy(t)){throw new Error("Assertion Failed: argument is undefined or null")}return t}o(U$t,"assertIsDefined");lt.assertIsDefined=U$t;function F$t(...t){const e=[];for(let r=0;r<t.length;r++){const n=t[r];if(Zy(n)){throw new Error(`Assertion Failed: argument at index ${r} is undefined or null`)}e.push(n)}return e}o(F$t,"assertAllDefined");lt.assertAllDefined=F$t;var M$t=Object.prototype.hasOwnProperty;function B$t(t){if(!wAe(t)){return false}for(const e in t){if(M$t.call(t,e)){return false}}return true}o(B$t,"isEmptyObject");lt.isEmptyObject=B$t;function cY(t){return typeof t==="function"}o(cY,"isFunction");lt.isFunction=cY;function V$t(...t){return t.length>0&&t.every(cY)}o(V$t,"areFunctions");lt.areFunctions=V$t;function H$t(t,e){const r=Math.min(t.length,e.length);for(let n=0;n<r;n++){TAe(t[n],e[n])}}o(H$t,"validateConstraints");lt.validateConstraints=H$t;function TAe(t,e){if(Vx(e)){if(typeof t!==e){throw new Error(`argument does not match constraint: typeof ${e}`)}}else if(cY(e)){try{if(t instanceof e){return}}catch{}if(!Zy(t)&&t.constructor===e){return}if(e.length===1&&e.call(void 0,t)===true){return}throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}o(TAe,"validateConstraint");lt.validateConstraint=TAe;function z$t(t){return t===null?void 0:t}o(z$t,"withNullAsUndefined");lt.withNullAsUndefined=z$t;function G$t(t){return typeof t==="undefined"?null:t}o(G$t,"withUndefinedAsNull");lt.withUndefinedAsNull=G$t;var yb=class extends Error{static{o(this,"ValidationError")}constructor(e){super(e)}};lt.ValidationError=yb;var vb=class extends yb{static{o(this,"ArgumentUndefinedError")}constructor(e){super(`The argument '${e}' is undefined.`)}};lt.ArgumentUndefinedError=vb;var _b=class extends yb{static{o(this,"ArgumentTypeError")}constructor(e,r){super(`The argument '${e}' must be of type '${r}'.`)}};lt.ArgumentTypeError=_b;function K$t(t,e){if(lY(t)){throw new vb(e)}return true}o(K$t,"throwIfUndefined");lt.throwIfUndefined=K$t;function dY(t,e){if(Zy(t)){throw new vb(e)}}o(dY,"throwIfUndefinedOrNull");lt.throwIfUndefinedOrNull=dY;function Y$t(t,e){dY(t,e);if(!Vx(t)){throw new _b(e,"string")}return true}o(Y$t,"throwIfNotString");lt.throwIfNotString=Y$t;function W$t(t,e){dY(t,e);if(!SAe(t)){throw new _b(e,"number")}return true}o(W$t,"throwIfNotNumber");lt.throwIfNotNumber=W$t});var bb=_(Ae=>{"use strict";var xAe=Ae&&Ae.__createBinding||(Object.create?function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}:function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]});var J$t=Ae&&Ae.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var Hx=Ae&&Ae.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var r in t)if(r!=="default"&&Object.prototype.hasOwnProperty.call(t,r))xAe(e,t,r)}J$t(e,t);return e};var _f=Ae&&Ae.__exportStar||function(t,e){for(var r in t)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r))xAe(e,t,r)};Object.defineProperty(Ae,"__esModule",{value:true});Ae.getRequiredEnvVar=Ae.env=Ae.EnvironmentalVariableRequiredError=Ae.xfs=Ae.RouteValidator=Ae.JsonValidator=Ae.MeteringService=Ae.TenantService=Ae.OpenFGAService=Ae.DevApiService=Ae.getContentApiStorageTarballPath=Ae.contentApiTarballFileName=Ae.ContentApiService=Ae.AuthApiService=Ae.getServiceAccountIdToken=Ae.createApiKeyServiceClient=Ae.ApiKeyService=Ae.RouteVersions=Ae.startsWithReservedKeyword=Ae.logger=Ae.createNewLogger=Ae.graphQL=Ae.CloudStorage=Ae.fly=Ae.ApiServer=Ae.featureFlagsPlugin=Ae.ensureZuploUserPlugin=Ae.ensureZuploAdminPlugin=Ae.ensureServiceAccountPlugin=Ae.apiKeyAuthPlugin=Ae.errorHandler=Ae.DeploymentLogState=Ae.signString=Ae.FeatureFlags=Ae.VALID_COMPATIBILITY_DATES=Ae.DEFAULT_COMPATIBILITY_DATE=Ae.COMPATIBILITY_FLAG_MAPPINGS=Ae.WARNING_STATUS=Ae.WARNING_SEVERITY=Ae.GOOD_STATUS=Ae.FAILURE_STATUS=Ae.ERROR_SEVERITY=Ae.BuildIssueError=Ae.hasBlockedNotifications=Ae.getDefaultFlags=Ae.getBuildFlagsForDeployment=Ae.CommonAuth=void 0;var pY=Hx(Oa());Ae.env=pY.default;Object.defineProperty(Ae,"EnvironmentalVariableRequiredError",{enumerable:true,get:function(){return pY.EnvironmentalVariableRequiredError}});Object.defineProperty(Ae,"getRequiredEnvVar",{enumerable:true,get:function(){return pY.getRequiredEnvVar}});_f(As(),Ae);var Q$t=sC();Object.defineProperty(Ae,"CommonAuth",{enumerable:true,get:function(){return Q$t.CommonAuth}});var fY=VY();Object.defineProperty(Ae,"getBuildFlagsForDeployment",{enumerable:true,get:function(){return fY.getBuildFlagsForDeployment}});Object.defineProperty(Ae,"getDefaultFlags",{enumerable:true,get:function(){return fY.getDefaultFlags}});Object.defineProperty(Ae,"hasBlockedNotifications",{enumerable:true,get:function(){return fY.hasBlockedNotifications}});var e2=HY();Object.defineProperty(Ae,"BuildIssueError",{enumerable:true,get:function(){return e2.BuildIssueError}});Object.defineProperty(Ae,"ERROR_SEVERITY",{enumerable:true,get:function(){return e2.ERROR_SEVERITY}});Object.defineProperty(Ae,"FAILURE_STATUS",{enumerable:true,get:function(){return e2.FAILURE_STATUS}});Object.defineProperty(Ae,"GOOD_STATUS",{enumerable:true,get:function(){return e2.GOOD_STATUS}});Object.defineProperty(Ae,"WARNING_SEVERITY",{enumerable:true,get:function(){return e2.WARNING_SEVERITY}});Object.defineProperty(Ae,"WARNING_STATUS",{enumerable:true,get:function(){return e2.WARNING_STATUS}});var X$t=zY();Object.defineProperty(Ae,"COMPATIBILITY_FLAG_MAPPINGS",{enumerable:true,get:function(){return X$t.COMPATIBILITY_FLAG_MAPPINGS}});var CAe=YY();Object.defineProperty(Ae,"DEFAULT_COMPATIBILITY_DATE",{enumerable:true,get:function(){return CAe.DEFAULT_COMPATIBILITY_DATE}});Object.defineProperty(Ae,"VALID_COMPATIBILITY_DATES",{enumerable:true,get:function(){return CAe.VALID_COMPATIBILITY_DATES}});var Z$t=aC();Object.defineProperty(Ae,"FeatureFlags",{enumerable:true,get:function(){return Z$t.FeatureFlags}});var eLt=WY();Object.defineProperty(Ae,"signString",{enumerable:true,get:function(){return eLt.signString}});_f(JY(),Ae);var tLt=lC();Object.defineProperty(Ae,"DeploymentLogState",{enumerable:true,get:function(){return tLt.DeploymentLogState}});_f(iW(),Ae);_f(cC(),Ae);var rLt=dC();Object.defineProperty(Ae,"errorHandler",{enumerable:true,get:function(){return rLt.errorHandler}});var Eb=gC();Object.defineProperty(Ae,"apiKeyAuthPlugin",{enumerable:true,get:function(){return Eb.apiKeyAuthPlugin}});Object.defineProperty(Ae,"ensureServiceAccountPlugin",{enumerable:true,get:function(){return Eb.ensureServiceAccountPlugin}});Object.defineProperty(Ae,"ensureZuploAdminPlugin",{enumerable:true,get:function(){return Eb.ensureZuploAdminPlugin}});Object.defineProperty(Ae,"ensureZuploUserPlugin",{enumerable:true,get:function(){return Eb.ensureZuploUserPlugin}});Object.defineProperty(Ae,"featureFlagsPlugin",{enumerable:true,get:function(){return Eb.featureFlagsPlugin}});var nLt=mge();Object.defineProperty(Ae,"ApiServer",{enumerable:true,get:function(){return nLt.ApiServer}});Ae.fly=Hx(vge());Ae.CloudStorage=Hx(abe());var iLt=obe();Object.defineProperty(Ae,"graphQL",{enumerable:true,get:function(){return iLt.graphQL}});_f(N5e(),Ae);var RAe=Tj();Object.defineProperty(Ae,"createNewLogger",{enumerable:true,get:function(){return RAe.createNewLogger}});Object.defineProperty(Ae,"logger",{enumerable:true,get:function(){return RAe.logger}});var sLt=fH();Object.defineProperty(Ae,"startsWithReservedKeyword",{enumerable:true,get:function(){return sLt.startsWithReservedKeyword}});var aLt=I5e();Object.defineProperty(Ae,"RouteVersions",{enumerable:true,get:function(){return aLt.RouteVersions}});var OAe=tTe();Object.defineProperty(Ae,"ApiKeyService",{enumerable:true,get:function(){return OAe.ApiKeyService}});Object.defineProperty(Ae,"createApiKeyServiceClient",{enumerable:true,get:function(){return OAe.createApiKeyServiceClient}});var oLt=Ry();Object.defineProperty(Ae,"getServiceAccountIdToken",{enumerable:true,get:function(){return oLt.getServiceAccountIdToken}});var uLt=nTe();Object.defineProperty(Ae,"AuthApiService",{enumerable:true,get:function(){return uLt.AuthApiService}});var hY=oTe();Object.defineProperty(Ae,"ContentApiService",{enumerable:true,get:function(){return hY.ContentApiService}});Object.defineProperty(Ae,"contentApiTarballFileName",{enumerable:true,get:function(){return hY.contentApiTarballFileName}});Object.defineProperty(Ae,"getContentApiStorageTarballPath",{enumerable:true,get:function(){return hY.getContentApiStorageTarballPath}});var lLt=cTe();Object.defineProperty(Ae,"DevApiService",{enumerable:true,get:function(){return lLt.DevApiService}});var cLt=dAe();Object.defineProperty(Ae,"OpenFGAService",{enumerable:true,get:function(){return cLt.OpenFGAService}});var dLt=hAe();Object.defineProperty(Ae,"TenantService",{enumerable:true,get:function(){return dLt.TenantService}});var pLt=gAe();Object.defineProperty(Ae,"MeteringService",{enumerable:true,get:function(){return pLt.MeteringService}});_f(yAe(),Ae);_f(bAe(),Ae);_f(AAe(),Ae);var fLt=$7();Object.defineProperty(Ae,"JsonValidator",{enumerable:true,get:function(){return fLt.JsonValidator}});var hLt=EH();Object.defineProperty(Ae,"RouteValidator",{enumerable:true,get:function(){return hLt.RouteValidator}});Ae.xfs=Hx(yB())});var wb=_(t2=>{"use strict";Object.defineProperty(t2,"__esModule",{value:true});t2.runPlugins=t2.PluginResult=void 0;var mY=class{static{o(this,"PluginResult")}errors=[];warnings=[];constructor(e){if(e){this.errors.push(e)}}};t2.PluginResult=mY;async function mLt(t,e){const r=[];const n=[];const i=new Map;for await(const s of t){try{const a=await s(e,i);n.push(...a.errors.map(u=>{if(u.pluginName===""){u.pluginName=s.name}return u}));r.push(...a.warnings);if(a.errors.length>0){break}}catch(a){n.push(a);break}}return{errors:n,warnings:r}}o(mLt,"runPlugins");t2.runPlugins=mLt});var IAe=_((o0r,NAe)=>{"use strict";function gLt(t){return t>=55296&&t<=56319}o(gLt,"isHighSurrogate");function yLt(t){return t>=56320&&t<=57343}o(yLt,"isLowSurrogate");NAe.exports=o(function t(e,r,n){if(typeof r!=="string"){throw new Error("Input must be string")}var i=r.length;var s=0;var a;var u;for(var l=0;l<i;l+=1){a=r.charCodeAt(l);u=r[l];if(gLt(a)&&yLt(r.charCodeAt(l+1))){l+=1;u+=r[l]}s+=e(u);if(s===n){return r.slice(0,l+1)}else if(s>n){return r.slice(0,l-u.length+1)}}return r},"truncate")});var DAe=_((l0r,PAe)=>{"use strict";var vLt=IAe();var _Lt=Buffer.byteLength.bind(Buffer);PAe.exports=vLt.bind(null,_Lt)});var kAe=_(r2=>{"use strict";var ELt=r2&&r2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(r2,"__esModule",{value:true});r2.sanitize=void 0;var bLt=ELt(DAe());var wLt=/[/?<>\\:*|"]/g;var SLt=/[\x00-\x1f\x80-\x9f]/g;var TLt=/^\.+$/;var ALt=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;var xLt=/[. ]+$/;function CLt(t,e=""){if(typeof t!=="string"){throw new Error("Input must be string")}const r=t.replace(wLt,e).replace(SLt,e).replace(TLt,e).replace(ALt,e).replace(xLt,e);return(0,bLt.default)(r,255)}o(CLt,"sanitize");r2.sanitize=CLt});var Kl=_(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:true});Fe.NODE_BUILD_OPEN_API_OUTPUT_FILE=Fe.NODE_BUILD_OUTPUT_FILE=Fe.NODE_ENTRY_NAME=Fe.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE=Fe.WORKER_BUILD_OUTPUT_FILE=Fe.WORKER_ENTRY_NAME=Fe.ENV_MODULE_FILE=Fe.ZUPLO_SYSTEM_ENV_FILE=Fe.ENV_FILE=Fe.CACHE_DIRECTORY=Fe.BUILD_CACHE_FILE=Fe.ZUPLO_FILE_SCHEMA=Fe.NON_STANDARD_NODE_ENV=Fe.GENERATED_TYPES_DIR_NAME=Fe.GENERATED_BUILD_JSON_FILE=Fe.GENERATED_SOURCE_DIR_NAME=Fe.BUILD_OUTPUT_DIR=Fe.DEFAULT_TEST_FILE=Fe.DEFAULT_DOCS_MARKDOWN_FILE=Fe.DOCS_THEME_FILE=Fe.DOCS_SIDEBAR_FILE=Fe.ZUPLO_FALLBACK_JSON_FILE=Fe.ZUPLO_PREFERRED_JSON_FILE=Fe.DEFAULT_MODULE_FILE=Fe.OPEN_API_FILE_SUFFIX=Fe.OPEN_API_CONFIG_FILE=Fe.OPEN_API_UNVERSIONED_DIR_NAME=Fe.DEV_PORTAL_OUTPUT_DIR_NAME=Fe.DEV_PORTAL_CONFIG_FILE=Fe.POLICIES_CONFIG_FILE=Fe.ROUTES_OAS_CONFIG_FILE=Fe.LOCAL_API_KEYS_CONFIG_FILE=Fe.DEV_PORTAL_V4_PATH=Fe.USER_DOCS_DIR_NAME=Fe.USER_SCHEMAS_DIR_NAME=Fe.USER_CONFIG_DIR_NAME=Fe.USER_TEST_DIR_NAME=Fe.USER_MODULES_DIR_NAME=void 0;Fe.USER_MODULES_DIR_NAME="modules";Fe.USER_TEST_DIR_NAME="tests";Fe.USER_CONFIG_DIR_NAME="config";Fe.USER_SCHEMAS_DIR_NAME="schemas";Fe.USER_DOCS_DIR_NAME="docs";Fe.DEV_PORTAL_V4_PATH="v4";Fe.LOCAL_API_KEYS_CONFIG_FILE="api-keys.json";Fe.ROUTES_OAS_CONFIG_FILE="routes.oas.json";Fe.POLICIES_CONFIG_FILE="policies.json";Fe.DEV_PORTAL_CONFIG_FILE="dev-portal.json";Fe.DEV_PORTAL_OUTPUT_DIR_NAME="dev-portal";Fe.OPEN_API_UNVERSIONED_DIR_NAME="unversioned";Fe.OPEN_API_CONFIG_FILE="open-api.json";Fe.OPEN_API_FILE_SUFFIX=".oas.json";Fe.DEFAULT_MODULE_FILE="hello-world.ts";Fe.ZUPLO_PREFERRED_JSON_FILE="zuplo.jsonc";Fe.ZUPLO_FALLBACK_JSON_FILE="zuplo.json";Fe.DOCS_SIDEBAR_FILE="sidebar.json";Fe.DOCS_THEME_FILE="theme.css";Fe.DEFAULT_DOCS_MARKDOWN_FILE="index.md";Fe.DEFAULT_TEST_FILE="hello-world.json";Fe.BUILD_OUTPUT_DIR="dist";Fe.GENERATED_SOURCE_DIR_NAME=".zuplo";Fe.GENERATED_BUILD_JSON_FILE="build.json";Fe.GENERATED_TYPES_DIR_NAME="types";Fe.NON_STANDARD_NODE_ENV=`You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against.`;Fe.ZUPLO_FILE_SCHEMA="zuplo";Fe.BUILD_CACHE_FILE="buildstate.json";Fe.CACHE_DIRECTORY=".cache";Fe.ENV_FILE=".env";Fe.ZUPLO_SYSTEM_ENV_FILE=".env.zuplo";Fe.ENV_MODULE_FILE="environment.ts";Fe.WORKER_ENTRY_NAME="worker.ts";Fe.WORKER_BUILD_OUTPUT_FILE="worker.js";Fe.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE="worker.js.map";Fe.NODE_ENTRY_NAME="server.ts";Fe.NODE_BUILD_OUTPUT_FILE="main.js";Fe.NODE_BUILD_OPEN_API_OUTPUT_FILE=Fe.OPEN_API_CONFIG_FILE});var jAe=_(n2=>{"use strict";var qAe=n2&&n2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(n2,"__esModule",{value:true});n2.createProjectDirs=void 0;var $Ae=qAe(require("fs/promises"));var RLt=qAe(require("path"));var Sb=Kl();var LAe=wb();var OLt=o(async function({sourceDirectory:t,logger:e}){e.debug("Creating project directories");const r=[Sb.USER_MODULES_DIR_NAME,Sb.USER_CONFIG_DIR_NAME,Sb.USER_TEST_DIR_NAME,Sb.USER_SCHEMAS_DIR_NAME,Sb.USER_DOCS_DIR_NAME,".vscode"];try{await $Ae.default.mkdir(t);for(const n of r){await $Ae.default.mkdir(RLt.default.join(t,n),{recursive:true})}}catch(n){e.error(n);return new LAe.PluginResult({message:`Cannot create project directory tree at ${t}`,pluginName:"create-project-dirs",severity:"error"})}return new LAe.PluginResult},"createProjectDirs");n2.createProjectDirs=OLt});var UAe=_(yY=>{"use strict";Object.defineProperty(yY,"__esModule",{value:true});var zx=require("perf_hooks");var gY=[];async function NLt(t,e){const r=zx.performance.timerify(e);const n=new zx.PerformanceObserver(i=>{const s=i.getEntries()[0];gY.push({name:t,duration:s.duration});n.disconnect()});n.observe({entryTypes:["function"]});return r()}o(NLt,"timeFn");var ILt={mark:t=>{zx.performance.mark(t)},measure:(t,e,r)=>{zx.performance.measure(t,e,r)},timeFn:NLt,report:()=>{if(gY.length>0){console.table(gY)}}};yY.default=ILt});var VAe=_(i2=>{"use strict";var BAe=i2&&i2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(i2,"__esModule",{value:true});i2.generateFromTemplate=void 0;var PLt=require("fs");var FAe=BAe(require("fs/promises"));var MAe=BAe(require("path"));async function DLt(t){const e=MAe.default.resolve(__dirname,"..","templates",t);if((0,PLt.existsSync)(e)){const r=await FAe.default.readFile(e,"utf-8");return r}else{const r=MAe.default.resolve(__dirname,"templates",t);const n=await FAe.default.readFile(r,"utf-8");return n}}o(DLt,"generateFromTemplate");i2.generateFromTemplate=DLt});var Ca=_(s2=>{"use strict";var vY=s2&&s2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(s2,"__esModule",{value:true});s2.generateFileFromTemplate=void 0;var kLt=bb();var $Lt=vY(require("fs/promises"));var LLt=vY(require("path"));var qLt=vY(UAe());var jLt=VAe();var ULt=o(function(t,e){return async({sourceDirectory:r,logger:n})=>{return qLt.default.timeFn(`Generating ${t}`,async()=>{n.debug(`Generating ${t}`);const i=LLt.default.join(r,t);if(await kLt.xfs.fileExists(i)){n.debug({sourceDirectory:r},`${t} already exists, skipping`);return{warnings:[],errors:[]}}return FLt(i,e,n)})}},"generateFileFromTemplate");s2.generateFileFromTemplate=ULt;async function FLt(t,e,r){const n=await(0,jLt.generateFromTemplate)(e);try{await $Lt.default.writeFile(t,n,"utf-8");r.debug(`File written to ${t}`)}catch(i){r.error(i);const s={message:`Error creating file at ${t}`,pluginName:"generate-file",severity:"error"};return{warnings:[],errors:[s]}}return{warnings:[],errors:[]}}o(FLt,"writeTemplate")});var zAe=_(a2=>{"use strict";var MLt=a2&&a2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(a2,"__esModule",{value:true});a2.generateDefaultDocsMarkdown=void 0;var BLt=MLt(require("path"));var HAe=Kl();var VLt=Ca();a2.generateDefaultDocsMarkdown=(0,VLt.generateFileFromTemplate)(BLt.default.join(HAe.USER_DOCS_DIR_NAME,HAe.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var KAe=_(o2=>{"use strict";var HLt=o2&&o2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(o2,"__esModule",{value:true});o2.generateDefaultDocsSidebar=void 0;var zLt=HLt(require("path"));var GAe=Kl();var GLt=Ca();o2.generateDefaultDocsSidebar=(0,GLt.generateFileFromTemplate)(zLt.default.join(GAe.USER_DOCS_DIR_NAME,GAe.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var WAe=_(u2=>{"use strict";var KLt=u2&&u2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(u2,"__esModule",{value:true});u2.generateDefaultDocsTheme=void 0;var YLt=KLt(require("path"));var YAe=Kl();var WLt=Ca();u2.generateDefaultDocsTheme=(0,WLt.generateFileFromTemplate)(YLt.default.join(YAe.USER_DOCS_DIR_NAME,YAe.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var QAe=_(l2=>{"use strict";var JLt=l2&&l2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(l2,"__esModule",{value:true});l2.generateDefaultModule=void 0;var QLt=JLt(require("path"));var JAe=Kl();var XLt=Ca();l2.generateDefaultModule=(0,XLt.generateFileFromTemplate)(QLt.default.join(JAe.USER_MODULES_DIR_NAME,JAe.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var ZAe=_(c2=>{"use strict";var ZLt=c2&&c2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(c2,"__esModule",{value:true});c2.generateDevPortalConfigJson=void 0;var eqt=ZLt(require("path"));var XAe=Kl();var tqt=Ca();c2.generateDevPortalConfigJson=(0,tqt.generateFileFromTemplate)(eqt.default.join(XAe.USER_CONFIG_DIR_NAME,XAe.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var exe=_(Gx=>{"use strict";Object.defineProperty(Gx,"__esModule",{value:true});Gx.generateEnvironment=void 0;var rqt=Ca();Gx.generateEnvironment=(0,rqt.generateFileFromTemplate)(".env","env.template")});var txe=_(Kx=>{"use strict";Object.defineProperty(Kx,"__esModule",{value:true});Kx.generateESLint=void 0;var nqt=Ca();Kx.generateESLint=(0,nqt.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var rxe=_(Yx=>{"use strict";Object.defineProperty(Yx,"__esModule",{value:true});Yx.generateGitignore=void 0;var iqt=Ca();Yx.generateGitignore=(0,iqt.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var nxe=_(d2=>{"use strict";var sqt=d2&&d2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(d2,"__esModule",{value:true});d2.generateLaunchJson=void 0;var aqt=sqt(require("path"));var oqt=Ca();d2.generateLaunchJson=(0,oqt.generateFileFromTemplate)(aqt.default.join(".vscode","launch.json"),"launch.template.jsonc")});var ixe=_(p2=>{"use strict";var uqt=p2&&p2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(p2,"__esModule",{value:true});p2.generateSettingsJson=void 0;var lqt=uqt(require("path"));var cqt=Ca();p2.generateSettingsJson=(0,cqt.generateFileFromTemplate)(lqt.default.join(".vscode","settings.json"),"settings.template.jsonc")});var axe=_(f2=>{"use strict";var dqt=f2&&f2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(f2,"__esModule",{value:true});f2.generateRouteOasConfig=void 0;var pqt=dqt(require("path"));var sxe=Kl();var fqt=Ca();f2.generateRouteOasConfig=(0,fqt.generateFileFromTemplate)(pqt.default.join(sxe.USER_CONFIG_DIR_NAME,sxe.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var cxe=_(zo=>{"use strict";var oxe=zo&&zo.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(zo,"__esModule",{value:true});zo.updateProjectPackageJson=zo.getProjectPackageJson=zo.getPackageOverrides=zo.generateDefaultPackageJson=void 0;var hqt=bb();var uxe=oxe(require("fs/promises"));var _Y=oxe(require("path"));async function mqt(t,e=hqt.env.USE_MONOREPO_PACKAGES){const r={name:t,version:"1.0.0",author:"",copyright:"",scripts:{dev:"zup dev",test:"zup test"},dependencies:{zuplo:"latest"}};if(e){const n=lxe();r.overrides=n;r.dependencies["@zuplo/runtime"]=n["@zuplo/runtime"];if(r.devDependencies&&"@zuplo/core"in r.devDependencies){r.devDependencies["@zuplo/core"]=n["@zuplo/core"]}if("@zuplo/core"in r.dependencies){r.dependencies["@zuplo/core"]=n["@zuplo/core"]}}return r}o(mqt,"generateDefaultPackageJson");zo.generateDefaultPackageJson=mqt;function lxe(){const t=_Y.default.resolve(__dirname,"..","..");return{"@zuplo/core":`file:${t}/core`,"@zuplo/runtime":`file:${t}/runtime`,"@zuplo/debug":`file:${t}/debug`,"@zuplo/errors":`file:${t}/errors`}}o(lxe,"getPackageOverrides");zo.getPackageOverrides=lxe;async function gqt(t){const e=_Y.default.join(t,"package.json");const r=await uxe.default.readFile(e,"utf-8");const n=JSON.parse(r);return n}o(gqt,"getProjectPackageJson");zo.getProjectPackageJson=gqt;async function yqt(t,e){const r=_Y.default.join(t,"package.json");const n=JSON.stringify(e,void 0,2);await uxe.default.writeFile(r,n,"utf-8")}o(yqt,"updateProjectPackageJson");zo.updateProjectPackageJson=yqt});var fxe=_(Wx=>{"use strict";Object.defineProperty(Wx,"__esModule",{value:true});Wx.generatePackageJson=void 0;var dxe=cxe();var pxe=wb();var vqt=o(async function({sourceDirectory:t,name:e,logger:r}){const n=await(0,dxe.generateDefaultPackageJson)(e);try{await(0,dxe.updateProjectPackageJson)(t,n)}catch(i){r.error(i);return new pxe.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new pxe.PluginResult},"generatePackageJson");Wx.generatePackageJson=vqt});var mxe=_(h2=>{"use strict";var _qt=h2&&h2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(h2,"__esModule",{value:true});h2.generatePoliciesConfig=void 0;var Eqt=_qt(require("path"));var hxe=Kl();var bqt=Ca();h2.generatePoliciesConfig=(0,bqt.generateFileFromTemplate)(Eqt.default.join(hxe.USER_CONFIG_DIR_NAME,hxe.POLICIES_CONFIG_FILE),"policies.template.json")});var gxe=_(Jx=>{"use strict";Object.defineProperty(Jx,"__esModule",{value:true});Jx.generateTSConfig=void 0;var wqt=Ca();Jx.generateTSConfig=(0,wqt.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var vxe=_(m2=>{"use strict";var Sqt=m2&&m2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(m2,"__esModule",{value:true});m2.generateZuploJson=void 0;var Tqt=bb();var Aqt=require("fs/promises");var xqt=Sqt(require("path"));var Cqt=Kl();var yxe=wb();var Rqt=o(async function({name:t,sourceDirectory:e,logger:r}){const n={version:1,project:t,compatibilityDate:Tqt.DEFAULT_COMPATIBILITY_DATE};const i=xqt.default.join(e,Cqt.ZUPLO_PREFERRED_JSON_FILE);const s=JSON.stringify(n,null,2);try{await(0,Aqt.writeFile)(i,s,"utf-8")}catch(a){r.error(a);return new yxe.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new yxe.PluginResult},"generateZuploJson");m2.generateZuploJson=Rqt});var Exe=_(g2=>{"use strict";var Oqt=g2&&g2.__importDefault||function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(g2,"__esModule",{value:true});g2.create=void 0;var EY=bb();var Nqt=require("fs/promises");var Iqt=Oqt(require("path"));var Pqt=wb();var _xe=kAe();var Dqt=jAe();var kqt=zAe();var $qt=KAe();var Lqt=WAe();var qqt=QAe();var jqt=ZAe();var Uqt=exe();var Fqt=txe();var Mqt=rxe();var Bqt=nxe();var Vqt=ixe();var Hqt=axe();var zqt=fxe();var Gqt=mxe();var Kqt=gxe();var Yqt=vxe();async function Wqt({name:t,accountName:e="",rootDirectory:r,logger:n}){const i=(0,_xe.sanitize)(t);const s=(0,_xe.sanitize)(e);const a=Iqt.default.join(r,s,i);const u={name:t,sourceDirectory:a,logger:n};const l=[];if(await EY.xfs.dirExists(a)){throw new EY.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:EY.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`})}l.push(...[Dqt.createProjectDirs,Hqt.generateRouteOasConfig,Yqt.generateZuploJson,jqt.generateDevPortalConfigJson,qqt.generateDefaultModule,$qt.generateDefaultDocsSidebar,kqt.generateDefaultDocsMarkdown,Lqt.generateDefaultDocsTheme,Gqt.generatePoliciesConfig]);l.push(...[Kqt.generateTSConfig,Mqt.generateGitignore,zqt.generatePackageJson,Uqt.generateEnvironment,Fqt.generateESLint,Bqt.generateLaunchJson,Vqt.generateSettingsJson]);const{errors:c,warnings:d}=await(0,Pqt.runPlugins)(l,u);if(d.length>0){d.forEach(f=>{n.warn(f)})}if(c.length>0){await(0,Nqt.rm)(a,{recursive:true,force:true});const f=c[0];if(f instanceof Error){throw f}else{throw new Error(f.message)}}const p={sourceDirectory:a,projectName:t};return p}o(Wqt,"create");g2.create=Wqt});Object.defineProperty(exports,"__esModule",{value:true});exports.create=void 0;var Jqt=Exe();Object.defineProperty(exports,"create",{enumerable:true,get:function(){return Jqt.create}});
411
411
  /*! For license information please see create.index.minified.js.LEGAL.txt */