@northflank/js-client 0.5.7 → 0.6.0-beta.2

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.
@@ -1,4 +1,4 @@
1
- import t,{EventEmitter as e}from"events";import n,{Transform as r}from"stream";import o from"http";import i,{fileURLToPath as s}from"url";import a from"punycode";import u from"https";import c from"zlib";import l from"os";import*as h from"net";import d,{Socket as p}from"net";import{spawn as f,execSync as v}from"child_process";import m from"fs";import b from"path";import y from"tls";import g from"crypto";import w from"dgram";
1
+ import t,{EventEmitter as e}from"events";import*as n from"stream";import r,{Transform as o}from"stream";import i from"http";import s,{fileURLToPath as a}from"url";import u from"punycode";import c from"https";import l from"zlib";import d from"os";import*as h from"net";import p,{Socket as f}from"net";import{spawn as v,execSync as m}from"child_process";import b from"fs";import y from"path";import g from"tls";import w from"crypto";import _ from"dgram";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var _=function(t,e){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},_(t,e)};function j(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var S=function(){return S=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},S.apply(this,arguments)};function A(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))}function E(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function C(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var x="object"==typeof global&&global&&global.Object===Object&&global,O="object"==typeof self&&self&&self.Object===Object&&self,I=x||O||Function("return this")(),k=I.Symbol,U=Object.prototype,D=U.hasOwnProperty,P=U.toString,B=k?k.toStringTag:void 0;var N=Object.prototype.toString;var T=k?k.toStringTag:void 0;function L(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":T&&T in Object(t)?function(t){var e=D.call(t,B),n=t[B];try{t[B]=void 0;var r=!0}catch(t){}var o=P.call(t);return r&&(e?t[B]=n:delete t[B]),o}(t):function(t){return N.call(t)}(t)}function F(t){return null!=t&&"object"==typeof t}function R(t){return"symbol"==typeof t||F(t)&&"[object Symbol]"==L(t)}function M(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var W=Array.isArray,q=k?k.prototype:void 0,z=q?q.toString:void 0;function $(t){if("string"==typeof t)return t;if(W(t))return M(t,$)+"";if(R(t))return z?z.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function G(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function H(t){return t}function V(t){if(!G(t))return!1;var e=L(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var J,Y=I["__core-js_shared__"],Z=(J=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+J:"";var K=Function.prototype.toString;function X(t){if(null!=t){try{return K.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Q=/^\[object .+?Constructor\]$/,tt=Function.prototype,et=Object.prototype,nt=tt.toString,rt=et.hasOwnProperty,ot=RegExp("^"+nt.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function it(t){return!(!G(t)||(e=t,Z&&Z in e))&&(V(t)?ot:Q).test(X(t));var e}function st(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return it(n)?n:void 0}var at=st(I,"WeakMap"),ut=Object.create,ct=function(){function t(){}return function(e){if(!G(e))return{};if(ut)return ut(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function lt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var ht=Date.now;var dt,pt,ft,vt=function(){try{var t=st(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),mt=vt,bt=mt?function(t,e){return mt(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:H,yt=(dt=bt,pt=0,ft=0,function(){var t=ht(),e=16-(t-ft);if(ft=t,e>0){if(++pt>=800)return arguments[0]}else pt=0;return dt.apply(void 0,arguments)}),gt=/^(?:0|[1-9]\d*)$/;function wt(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&gt.test(t))&&t>-1&&t%1==0&&t<e}function _t(t,e,n){"__proto__"==e&&mt?mt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function jt(t,e){return t===e||t!=t&&e!=e}var St=Object.prototype.hasOwnProperty;function At(t,e,n){var r=t[e];St.call(t,e)&&jt(r,n)&&(void 0!==n||e in t)||_t(t,e,n)}var Et=Math.max;function Ct(t,e){return yt(function(t,e,n){return e=Et(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Et(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),lt(t,this,a)}}(t,e,H),t+"")}function xt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Ot(t){return null!=t&&xt(t.length)&&!V(t)}var It=Object.prototype;function kt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function Ut(t){return F(t)&&"[object Arguments]"==L(t)}var Dt=Object.prototype,Pt=Dt.hasOwnProperty,Bt=Dt.propertyIsEnumerable,Nt=Ut(function(){return arguments}())?Ut:function(t){return F(t)&&Pt.call(t,"callee")&&!Bt.call(t,"callee")};var Tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Lt=Tt&&"object"==typeof module&&module&&!module.nodeType&&module,Ft=Lt&&Lt.exports===Tt?I.Buffer:void 0,Rt=(Ft?Ft.isBuffer:void 0)||function(){return!1},Mt={};Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=!0,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=!1;var Wt="object"==typeof exports&&exports&&!exports.nodeType&&exports,qt=Wt&&"object"==typeof module&&module&&!module.nodeType&&module,zt=qt&&qt.exports===Wt&&x.process,$t=function(){try{var t=qt&&qt.require&&qt.require("util").types;return t||zt&&zt.binding&&zt.binding("util")}catch(t){}}(),Gt=$t&&$t.isTypedArray,Ht=Gt?function(t){return function(e){return t(e)}}(Gt):function(t){return F(t)&&xt(t.length)&&!!Mt[L(t)]},Vt=Ht,Jt=Object.prototype.hasOwnProperty;function Yt(t,e){var n=W(t),r=!n&&Nt(t),o=!n&&!r&&Rt(t),i=!n&&!r&&!o&&Vt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=a.length;for(var c in t)!e&&!Jt.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wt(c,u))||a.push(c);return a}function Zt(t,e){return function(n){return t(e(n))}}var Kt=Zt(Object.keys,Object),Xt=Object.prototype.hasOwnProperty;function Qt(t){return Ot(t)?Yt(t):function(t){if(!kt(t))return Kt(t);var e=[];for(var n in Object(t))Xt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}var te=Object.prototype.hasOwnProperty;function ee(t){if(!G(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=kt(t),n=[];for(var r in t)("constructor"!=r||!e&&te.call(t,r))&&n.push(r);return n}function ne(t){return Ot(t)?Yt(t,!0):ee(t)}var re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oe=/^\w*$/;function ie(t,e){if(W(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!R(t))||(oe.test(t)||!re.test(t)||null!=e&&t in Object(e))}var se=st(Object,"create");var ae=Object.prototype.hasOwnProperty;var ue=Object.prototype.hasOwnProperty;function ce(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function le(t,e){for(var n=t.length;n--;)if(jt(t[n][0],e))return n;return-1}ce.prototype.clear=function(){this.__data__=se?se(null):{},this.size=0},ce.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ce.prototype.get=function(t){var e=this.__data__;if(se){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ae.call(e,t)?e[t]:void 0},ce.prototype.has=function(t){var e=this.__data__;return se?void 0!==e[t]:ue.call(e,t)},ce.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=se&&void 0===e?"__lodash_hash_undefined__":e,this};var he=Array.prototype.splice;function de(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}de.prototype.clear=function(){this.__data__=[],this.size=0},de.prototype.delete=function(t){var e=this.__data__,n=le(e,t);return!(n<0)&&(n==e.length-1?e.pop():he.call(e,n,1),--this.size,!0)},de.prototype.get=function(t){var e=this.__data__,n=le(e,t);return n<0?void 0:e[n][1]},de.prototype.has=function(t){return le(this.__data__,t)>-1},de.prototype.set=function(t,e){var n=this.__data__,r=le(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var pe=st(I,"Map");function fe(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function ve(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ve.prototype.clear=function(){this.size=0,this.__data__={hash:new ce,map:new(pe||de),string:new ce}},ve.prototype.delete=function(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e},ve.prototype.get=function(t){return fe(this,t).get(t)},ve.prototype.has=function(t){return fe(this,t).has(t)},ve.prototype.set=function(t,e){var n=fe(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function me(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(me.Cache||ve),n}me.Cache=ve;var be=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ye=/\\(\\)?/g,ge=function(t){var e=me(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(be,(function(t,n,r,o){e.push(r?o.replace(ye,"$1"):n||t)})),e})),we=ge;function _e(t){return null==t?"":$(t)}function je(t,e){return W(t)?t:ie(t,e)?[t]:we(_e(t))}function Se(t){if("string"==typeof t||R(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function Ae(t,e){for(var n=0,r=(e=je(e,t)).length;null!=t&&n<r;)t=t[Se(e[n++])];return n&&n==r?t:void 0}function Ee(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var Ce=k?k.isConcatSpreadable:void 0;function xe(t){return W(t)||Nt(t)||!!(Ce&&t&&t[Ce])}function Oe(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=xe),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?Oe(a,e-1,n,r,o):Ee(o,a):r||(o[o.length]=a)}return o}var Ie=Zt(Object.getPrototypeOf,Object),ke=Function.prototype,Ue=Object.prototype,De=ke.toString,Pe=Ue.hasOwnProperty,Be=De.call(Object);function Ne(t){var e=this.__data__=new de(t);this.size=e.size}Ne.prototype.clear=function(){this.__data__=new de,this.size=0},Ne.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Ne.prototype.get=function(t){return this.__data__.get(t)},Ne.prototype.has=function(t){return this.__data__.has(t)},Ne.prototype.set=function(t,e){var n=this.__data__;if(n instanceof de){var r=n.__data__;if(!pe||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ve(r)}return n.set(t,e),this.size=n.size,this};var Te="object"==typeof exports&&exports&&!exports.nodeType&&exports,Le=Te&&"object"==typeof module&&module&&!module.nodeType&&module,Fe=Le&&Le.exports===Te?I.Buffer:void 0,Re=Fe?Fe.allocUnsafe:void 0;var Me=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,qe=We?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}(We(t),(function(e){return Me.call(t,e)})))}:function(){return[]};function ze(t){return function(t,e,n){var r=e(t);return W(t)?r:Ee(r,n(t))}(t,Qt,qe)}var $e=st(I,"DataView"),Ge=st(I,"Promise"),He=st(I,"Set"),Ve=X($e),Je=X(pe),Ye=X(Ge),Ze=X(He),Ke=X(at),Xe=L;($e&&"[object DataView]"!=Xe(new $e(new ArrayBuffer(1)))||pe&&"[object Map]"!=Xe(new pe)||Ge&&"[object Promise]"!=Xe(Ge.resolve())||He&&"[object Set]"!=Xe(new He)||at&&"[object WeakMap]"!=Xe(new at))&&(Xe=function(t){var e=L(t),n="[object Object]"==e?t.constructor:void 0,r=n?X(n):"";if(r)switch(r){case Ve:return"[object DataView]";case Je:return"[object Map]";case Ye:return"[object Promise]";case Ze:return"[object Set]";case Ke:return"[object WeakMap]"}return e});var Qe=Xe,tn=I.Uint8Array;function en(t,e){var n,r,o=e?(n=t.buffer,r=new n.constructor(n.byteLength),new tn(r).set(new tn(n)),r):t.buffer;return new t.constructor(o,t.byteOffset,t.length)}function nn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new ve;++e<n;)this.add(t[e])}function rn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}nn.prototype.add=nn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},nn.prototype.has=function(t){return this.__data__.has(t)};function on(t,e,n,r,o,i){var s=1&n,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var h=-1,d=!0,p=2&n?new nn:void 0;for(i.set(t,e),i.set(e,t);++h<a;){var f=t[h],v=e[h];if(r)var m=s?r(v,f,h,e,t,i):r(f,v,h,t,e,i);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!rn(e,(function(t,e){if(s=e,!p.has(s)&&(f===t||o(f,t,n,r,i)))return p.push(e);var s}))){d=!1;break}}else if(f!==v&&!o(f,v,n,r,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function sn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var un=k?k.prototype:void 0,cn=un?un.valueOf:void 0;var ln=Object.prototype.hasOwnProperty;var hn="[object Object]",dn=Object.prototype.hasOwnProperty;function pn(t,e,n,r,o,i){var s=W(t),a=W(e),u=s?"[object Array]":Qe(t),c=a?"[object Array]":Qe(e),l=(u="[object Arguments]"==u?hn:u)==hn,h=(c="[object Arguments]"==c?hn:c)==hn,d=u==c;if(d&&Rt(t)){if(!Rt(e))return!1;s=!0,l=!1}if(d&&!l)return i||(i=new Ne),s||Vt(t)?on(t,e,n,r,o,i):function(t,e,n,r,o,i,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new tn(t),new tn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return jt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=sn;case"[object Set]":var u=1&r;if(a||(a=an),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;r|=2,s.set(t,e);var l=on(a(t),a(e),r,o,i,s);return s.delete(t),l;case"[object Symbol]":if(cn)return cn.call(t)==cn.call(e)}return!1}(t,e,u,n,r,o,i);if(!(1&n)){var p=l&&dn.call(t,"__wrapped__"),f=h&&dn.call(e,"__wrapped__");if(p||f){var v=p?t.value():t,m=f?e.value():e;return i||(i=new Ne),o(v,m,n,r,i)}}return!!d&&(i||(i=new Ne),function(t,e,n,r,o,i){var s=1&n,a=ze(t),u=a.length;if(u!=ze(e).length&&!s)return!1;for(var c=u;c--;){var l=a[c];if(!(s?l in e:ln.call(e,l)))return!1}var h=i.get(t),d=i.get(e);if(h&&d)return h==e&&d==t;var p=!0;i.set(t,e),i.set(e,t);for(var f=s;++c<u;){var v=t[l=a[c]],m=e[l];if(r)var b=s?r(m,v,l,e,t,i):r(v,m,l,t,e,i);if(!(void 0===b?v===m||o(v,m,n,r,i):b)){p=!1;break}f||(f="constructor"==l)}if(p&&!f){var y=t.constructor,g=e.constructor;y==g||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,n,r,o,i))}function fn(t,e,n,r,o){return t===e||(null==t||null==e||!F(t)&&!F(e)?t!=t&&e!=e:pn(t,e,n,r,fn,o))}function vn(t){return t==t&&!G(t)}function mn(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function bn(t){var e=function(t){for(var e=Qt(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,vn(o)]}return e}(t);return 1==e.length&&e[0][2]?mn(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var o=n.length,i=o,s=!r;if(null==t)return!i;for(t=Object(t);o--;){var a=n[o];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var u=(a=n[o])[0],c=t[u],l=a[1];if(s&&a[2]){if(void 0===c&&!(u in t))return!1}else{var h=new Ne;if(r)var d=r(c,l,u,t,e,h);if(!(void 0===d?fn(l,c,3,r,h):d))return!1}}return!0}(n,t,e)}}function yn(t,e){return null!=t&&e in Object(t)}function gn(t,e){return null!=t&&function(t,e,n){for(var r=-1,o=(e=je(e,t)).length,i=!1;++r<o;){var s=Se(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&xt(o)&&wt(s,o)&&(W(t)||Nt(t))}(t,e,yn)}function wn(t,e){return ie(t)&&vn(e)?mn(Se(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:Ae(t,e);return void 0===r?n:r}(n,t);return void 0===r&&r===e?gn(n,t):fn(e,r,3)}}function _n(t){return ie(t)?(e=Se(t),function(t){return null==t?void 0:t[e]}):function(t){return function(e){return Ae(e,t)}}(t);var e}function jn(t){return"function"==typeof t?t:null==t?H:"object"==typeof t?W(t)?wn(t[0],t[1]):bn(t):_n(t)}var Sn,An=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[Sn?s:++r];if(!1===e(o[a],a,o))break}return t};var En=function(t,e){return function(n,r){if(null==n)return n;if(!Ot(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=Object(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}((function(t,e){return t&&An(t,e,Qt)})),Cn=En;function xn(t,e,n){(void 0!==n&&!jt(t[e],n)||void 0===n&&!(e in t))&&_t(t,e,n)}function On(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function In(t){return function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,s=e.length;++i<s;){var a=e[i],u=r?r(n[a],t[a],a,n,t):void 0;void 0===u&&(u=t[a]),o?_t(n,a,u):At(n,a,u)}return n}(t,ne(t))}function kn(t,e,n,r,o,i,s){var a=On(t,n),u=On(e,n),c=s.get(u);if(c)xn(t,n,c);else{var l,h=i?i(a,u,n+"",t,e,s):void 0,d=void 0===h;if(d){var p=W(u),f=!p&&Rt(u),v=!p&&!f&&Vt(u);h=u,p||f||v?W(a)?h=a:F(l=a)&&Ot(l)?h=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(a):f?(d=!1,h=function(t,e){if(e)return t.slice();var n=t.length,r=Re?Re(n):new t.constructor(n);return t.copy(r),r}(u,!0)):v?(d=!1,h=en(u,!0)):h=[]:function(t){if(!F(t)||"[object Object]"!=L(t))return!1;var e=Ie(t);if(null===e)return!0;var n=Pe.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}(u)||Nt(u)?(h=a,Nt(a)?h=In(a):G(a)&&!V(a)||(h=function(t){return"function"!=typeof t.constructor||kt(t)?{}:ct(Ie(t))}(u))):d=!1}d&&(s.set(u,h),o(h,u,r,i,s),s.delete(u)),xn(t,n,h)}}function Un(t,e,n,r,o){t!==e&&An(e,(function(i,s){if(o||(o=new Ne),G(i))kn(t,e,s,n,Un,r,o);else{var a=r?r(On(t,s),i,s+"",t,e,o):void 0;void 0===a&&(a=i),xn(t,s,a)}}),ne)}var Dn=/[\\^$.*+?()[\]{}|]/g,Pn=RegExp(Dn.source);function Bn(t,e){var n=-1,r=Ot(t)?Array(t.length):[];return Cn(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function Nn(t,e){return Oe(function(t,e){return(W(t)?M:Bn)(t,jn(e))}(t,e),1)}function Tn(t,e){return t>e}function Ln(t){return"string"==typeof t||!W(t)&&F(t)&&"[object String]"==L(t)}function Fn(t,e){return t&&t.length?function(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],s=e(i);if(null!=s&&(void 0===a?s==s&&!R(s):n(s,a)))var a=s,u=i}return u}(t,jn(e),Tn):void 0}var Rn,Mn=(Rn=function(t,e,n){Un(t,e,n)},Ct((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Rn.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!G(n))return!1;var r=typeof e;return!!("number"==r?Ot(n)&&wt(e,n.length):"string"==r&&e in n)&&jt(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Rn(t,s,n,o)}return t})));function Wn(t,e){return t(e={exports:{}},e.exports),e.exports}var qn={},zn=qn;function $n(t){return t<0?-1:1}function Gn(t,e){e.unsigned||--t;const n=e.unsigned?0:-Math.pow(2,t),r=Math.pow(2,t)-1,o=e.moduloBitLength?Math.pow(2,e.moduloBitLength):Math.pow(2,t),i=e.moduloBitLength?Math.pow(2,e.moduloBitLength-1):Math.pow(2,t-1);return function(t,s){s||(s={});let a=+t;if(s.enforceRange){if(!Number.isFinite(a))throw new TypeError("Argument is not a finite number");if(a=$n(a)*Math.floor(Math.abs(a)),a<n||a>r)throw new TypeError("Argument is not in byte range");return a}if(!isNaN(a)&&s.clamp)return a=function(t){return t%1==.5&&0==(1&t)?Math.floor(t):Math.round(t)}(a),a<n&&(a=n),a>r&&(a=r),a;if(!Number.isFinite(a)||0===a)return 0;if(a=$n(a)*Math.floor(Math.abs(a)),a%=o,!e.unsigned&&a>=i)return a-o;if(e.unsigned)if(a<0)a+=o;else if(-0===a)return 0;return a}}qn.void=function(){},qn.boolean=function(t){return!!t},qn.byte=Gn(8,{unsigned:!1}),qn.octet=Gn(8,{unsigned:!0}),qn.short=Gn(16,{unsigned:!1}),qn["unsigned short"]=Gn(16,{unsigned:!0}),qn.long=Gn(32,{unsigned:!1}),qn["unsigned long"]=Gn(32,{unsigned:!0}),qn["long long"]=Gn(32,{unsigned:!1,moduloBitLength:64}),qn["unsigned long long"]=Gn(32,{unsigned:!0,moduloBitLength:64}),qn.double=function(t){const e=+t;if(!Number.isFinite(e))throw new TypeError("Argument is not a finite floating-point value");return e},qn["unrestricted double"]=function(t){const e=+t;if(isNaN(e))throw new TypeError("Argument is NaN");return e},qn.float=qn.double,qn["unrestricted float"]=qn["unrestricted double"],qn.DOMString=function(t,e){return e||(e={}),e.treatNullAsEmptyString&&null===t?"":String(t)},qn.ByteString=function(t,e){const n=String(t);let r;for(let t=0;void 0!==(r=n.codePointAt(t));++t)if(r>255)throw new TypeError("Argument is not a valid bytestring");return n},qn.USVString=function(t){const e=String(t),n=e.length,r=[];for(let t=0;t<n;++t){const o=e.charCodeAt(t);if(o<55296||o>57343)r.push(String.fromCodePoint(o));else if(56320<=o&&o<=57343)r.push(String.fromCodePoint(65533));else if(t===n-1)r.push(String.fromCodePoint(65533));else{const n=e.charCodeAt(t+1);if(56320<=n&&n<=57343){const e=1023&o,i=1023&n;r.push(String.fromCodePoint(65536+1024*e+i)),++t}else r.push(String.fromCodePoint(65533))}}return r.join("")},qn.Date=function(t,e){if(!(t instanceof Date))throw new TypeError("Argument is not a Date object");if(!isNaN(t))return t},qn.RegExp=function(t,e){return t instanceof RegExp||(t=new RegExp(t)),t};var Hn=Wn((function(t){t.exports.mixin=function(t,e){const n=Object.getOwnPropertyNames(e);for(let r=0;r<n.length;++r)Object.defineProperty(t,n[r],Object.getOwnPropertyDescriptor(e,n[r]))},t.exports.wrapperSymbol=Symbol("wrapper"),t.exports.implSymbol=Symbol("impl"),t.exports.wrapperForImpl=function(e){return e[t.exports.wrapperSymbol]},t.exports.implForWrapper=function(e){return e[t.exports.implSymbol]}}));Hn.mixin,Hn.wrapperSymbol,Hn.implSymbol,Hn.wrapperForImpl,Hn.implForWrapper;var Vn,Jn=(Vn=Object.freeze({__proto__:null}))&&Vn.default||Vn,Yn={TRANSITIONAL:0,NONTRANSITIONAL:1};function Zn(t){return t.split("\0").map((function(t){return t.normalize("NFC")})).join("\0")}function Kn(t){for(var e=0,n=Jn.length-1;e<=n;){var r=Math.floor((e+n)/2),o=Jn[r];if(o[0][0]<=t&&o[0][1]>=t)return o;o[0][0]>t?n=r-1:e=r+1}return null}var Xn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function Qn(t){return t.replace(Xn,"_").length}var tr=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;function er(t,e){"xn--"===t.substr(0,4)&&(t=a.toUnicode(t));var n=!1;(Zn(t)!==t||"-"===t[3]&&"-"===t[4]||"-"===t[0]||"-"===t[t.length-1]||-1!==t.indexOf(".")||0===t.search(tr))&&(n=!0);for(var r=Qn(t),o=0;o<r;++o){var i=Kn(t.codePointAt(o));if(nr===Yn.TRANSITIONAL&&"valid"!==i[1]||nr===Yn.NONTRANSITIONAL&&"valid"!==i[1]&&"deviation"!==i[1]){n=!0;break}}return{label:t,error:n}}function nr(t,e,n){var r=function(t,e,n){for(var r=!1,o="",i=Qn(t),s=0;s<i;++s){var a=t.codePointAt(s),u=Kn(a);switch(u[1]){case"disallowed":r=!0,o+=String.fromCodePoint(a);break;case"ignored":break;case"mapped":o+=String.fromCodePoint.apply(String,u[2]);break;case"deviation":o+=n===Yn.TRANSITIONAL?String.fromCodePoint.apply(String,u[2]):String.fromCodePoint(a);break;case"valid":o+=String.fromCodePoint(a);break;case"disallowed_STD3_mapped":e?(r=!0,o+=String.fromCodePoint(a)):o+=String.fromCodePoint.apply(String,u[2]);break;case"disallowed_STD3_valid":e&&(r=!0),o+=String.fromCodePoint(a)}}return{string:o,error:r}}(t,e,n);r.string=Zn(r.string);for(var o=r.string.split("."),i=0;i<o.length;++i)try{var s=er(o[i]);o[i]=s.label,r.error=r.error||s.error}catch(t){r.error=!0}return{string:o.join("."),error:r.error}}var rr={toASCII:function(t,e,n,r){var o=nr(t,e,n),i=o.string.split(".");if(i=i.map((function(t){try{return a.toASCII(t)}catch(e){return o.error=!0,t}})),r){var s=i.slice(0,i.length-1).join(".").length;(s.length>253||0===s.length)&&(o.error=!0);for(var u=0;u<i.length;++u)if(i.length>63||0===i.length){o.error=!0;break}}return o.error?null:i.join(".")},toUnicode:function(t,e){var n=nr(t,e,Yn.NONTRANSITIONAL);return{domain:n.string,error:n.error}},PROCESSING_OPTIONS:Yn},or=Wn((function(t){const e={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},n=Symbol("failure");function r(t){return a.ucs2.decode(t).length}function o(t,e){const n=t[e];return isNaN(n)?void 0:String.fromCodePoint(n)}function i(t){return t>=48&&t<=57}function s(t){return t>=65&&t<=90||t>=97&&t<=122}function u(t){return i(t)||t>=65&&t<=70||t>=97&&t<=102}function c(t){return"."===t||"%2e"===t.toLowerCase()}function l(t){return 2===t.length&&s(t.codePointAt(0))&&(":"===t[1]||"|"===t[1])}function h(t){return void 0!==e[t]}function d(t){return h(t.scheme)}function p(t){let e=t.toString(16).toUpperCase();return 1===e.length&&(e="0"+e),"%"+e}function f(t){return t<=31||t>126}const v=new Set([32,34,35,60,62,63,96,123,125]);function m(t){return f(t)||v.has(t)}const b=new Set([47,58,59,61,64,91,92,93,94,124]);function y(t){return m(t)||b.has(t)}function g(t,e){const n=String.fromCodePoint(t);return e(t)?function(t){const e=new Buffer(t);let n="";for(let t=0;t<e.length;++t)n+=p(e[t]);return n}(n):n}function w(t){let e=10;if(t.length>=2&&"0"===t.charAt(0)&&"x"===t.charAt(1).toLowerCase()?(t=t.substring(2),e=16):t.length>=2&&"0"===t.charAt(0)&&(t=t.substring(1),e=8),""===t)return 0;return(10===e?/[^0-9]/:16===e?/[^0-9A-Fa-f]/:/[^0-7]/).test(t)?n:parseInt(t,e)}function _(t,e){if("["===t[0])return"]"!==t[t.length-1]?n:function(t){const e=[0,0,0,0,0,0,0,0];let r=0,s=null,c=0;if(58===(t=a.ucs2.decode(t))[c]){if(58!==t[c+1])return n;c+=2,++r,s=r}for(;c<t.length;){if(8===r)return n;if(58===t[c]){if(null!==s)return n;++c,++r,s=r;continue}let a=0,l=0;for(;l<4&&u(t[c]);)a=16*a+parseInt(o(t,c),16),++c,++l;if(46===t[c]){if(0===l)return n;if(c-=l,r>6)return n;let s=0;for(;void 0!==t[c];){let a=null;if(s>0){if(!(46===t[c]&&s<4))return n;++c}if(!i(t[c]))return n;for(;i(t[c]);){const e=parseInt(o(t,c));if(null===a)a=e;else{if(0===a)return n;a=10*a+e}if(a>255)return n;++c}e[r]=256*e[r]+a,++s,2!==s&&4!==s||++r}if(4!==s)return n;break}if(58===t[c]){if(++c,void 0===t[c])return n}else if(void 0!==t[c])return n;e[r]=a,++r}if(null!==s){let t=r-s;for(r=7;0!==r&&t>0;){const n=e[s+t-1];e[s+t-1]=e[r],e[r]=n,--r,--t}}else if(null===s&&8!==r)return n;return e}(t.substring(1,t.length-1));if(!e)return function(t){if(e=t,-1!==e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/))return n;var e;let r="";const o=a.ucs2.decode(t);for(let t=0;t<o.length;++t)r+=g(o[t],f);return r}(t);const r=function(t){const e=new Buffer(t),n=[];for(let t=0;t<e.length;++t)37!==e[t]?n.push(e[t]):37===e[t]&&u(e[t+1])&&u(e[t+2])?(n.push(parseInt(e.slice(t+1,t+3).toString(),16)),t+=2):n.push(e[t]);return new Buffer(n).toString()}(t),s=rr.toASCII(r,!1,rr.PROCESSING_OPTIONS.NONTRANSITIONAL,!1);if(null===s)return n;if(-1!==s.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/))return n;const c=function(t){const e=t.split(".");if(""===e[e.length-1]&&e.length>1&&e.pop(),e.length>4)return t;const r=[];for(const o of e){if(""===o)return t;const e=w(o);if(e===n)return t;r.push(e)}for(let t=0;t<r.length-1;++t)if(r[t]>255)return n;if(r[r.length-1]>=Math.pow(256,5-r.length))return n;let o=r.pop(),i=0;for(const t of r)o+=t*Math.pow(256,3-i),++i;return o}(s);return"number"==typeof c||c===n?c:s}function j(t){return"number"==typeof t?function(t){let e="",n=t;for(let t=1;t<=4;++t)e=String(n%256)+e,4!==t&&(e="."+e),n=Math.floor(n/256);return e}(t):t instanceof Array?"["+function(t){let e="";const n=function(t){let e=null,n=1,r=null,o=0;for(let i=0;i<t.length;++i)0!==t[i]?(o>n&&(e=r,n=o),r=null,o=0):(null===r&&(r=i),++o);return o>n&&(e=r,n=o),{idx:e,len:n}}(t).idx;let r=!1;for(let o=0;o<=7;++o)r&&0===t[o]||(r&&(r=!1),n!==o?(e+=t[o].toString(16),7!==o&&(e+=":")):(e+=0===o?"::":":",r=!0));return e}(t)+"]":t}function S(t){const e=t.path;var n;0!==e.length&&("file"===t.scheme&&1===e.length&&(n=e[0],/^[A-Za-z]:$/.test(n))||e.pop())}function A(t){return""!==t.username||""!==t.password}function E(t,e,r,o,i){if(this.pointer=0,this.input=t,this.base=e||null,this.encodingOverride=r||"utf-8",this.stateOverride=i,this.url=o,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};const t=function(t){return t.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}(this.input);t!==this.input&&(this.parseError=!0),this.input=t}const s=function(t){return t.replace(/\u0009|\u000A|\u000D/g,"")}(this.input);for(s!==this.input&&(this.parseError=!0),this.input=s,this.state=i||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=a.ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){const t=this.input[this.pointer],e=isNaN(t)?void 0:String.fromCodePoint(t),r=this["parse "+this.state](t,e);if(!r)break;if(r===n){this.failure=!0;break}}}E.prototype["parse scheme start"]=function(t,e){if(s(t))this.buffer+=e.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,n;this.state="no scheme",--this.pointer}return!0},E.prototype["parse scheme"]=function(t,e){if(function(t){return s(t)||i(t)}(t)||43===t||45===t||46===t)this.buffer+=e.toLowerCase();else if(58===t){if(this.stateOverride){if(d(this.url)&&!h(this.buffer))return!1;if(!d(this.url)&&h(this.buffer))return!1;if((A(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.buffer="",this.stateOverride)return!1;"file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):d(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":d(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,n;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},E.prototype["parse no scheme"]=function(t){return null===this.base||this.base.cannotBeABaseURL&&35!==t?n:(this.base.cannotBeABaseURL&&35===t?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},E.prototype["parse special relative or authority"]=function(t){return 47===t&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},E.prototype["parse path or authority"]=function(t){return 47===t?this.state="authority":(this.state="path",--this.pointer),!0},E.prototype["parse relative"]=function(t){return this.url.scheme=this.base.scheme,isNaN(t)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===t?this.state="relative slash":63===t?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===t?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):d(this.url)&&92===t?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},E.prototype["parse relative slash"]=function(t){return!d(this.url)||47!==t&&92!==t?47===t?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===t&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},E.prototype["parse special authority slashes"]=function(t){return 47===t&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},E.prototype["parse special authority ignore slashes"]=function(t){return 47!==t&&92!==t?(this.state="authority",--this.pointer):this.parseError=!0,!0},E.prototype["parse authority"]=function(t,e){if(64===t){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;const t=r(this.buffer);for(let e=0;e<t;++e){const t=this.buffer.codePointAt(e);if(58===t&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}const n=g(t,y);this.passwordTokenSeenFlag?this.url.password+=n:this.url.username+=n}this.buffer=""}else if(isNaN(t)||47===t||63===t||35===t||d(this.url)&&92===t){if(this.atFlag&&""===this.buffer)return this.parseError=!0,n;this.pointer-=r(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=e;return!0},E.prototype["parse hostname"]=E.prototype["parse host"]=function(t,e){if(this.stateOverride&&"file"===this.url.scheme)--this.pointer,this.state="file host";else if(58!==t||this.arrFlag)if(isNaN(t)||47===t||63===t||35===t||d(this.url)&&92===t){if(--this.pointer,d(this.url)&&""===this.buffer)return this.parseError=!0,n;if(this.stateOverride&&""===this.buffer&&(A(this.url)||null!==this.url.port))return this.parseError=!0,!1;const t=_(this.buffer,d(this.url));if(t===n)return n;if(this.url.host=t,this.buffer="",this.state="path start",this.stateOverride)return!1}else 91===t?this.arrFlag=!0:93===t&&(this.arrFlag=!1),this.buffer+=e;else{if(""===this.buffer)return this.parseError=!0,n;const t=_(this.buffer,d(this.url));if(t===n)return n;if(this.url.host=t,this.buffer="",this.state="port","hostname"===this.stateOverride)return!1}return!0},E.prototype["parse port"]=function(t,r){if(i(t))this.buffer+=r;else{if(!(isNaN(t)||47===t||63===t||35===t||d(this.url)&&92===t||this.stateOverride))return this.parseError=!0,n;if(""!==this.buffer){const t=parseInt(this.buffer);if(t>Math.pow(2,16)-1)return this.parseError=!0,n;this.url.port=t===(o=this.url.scheme,e[o])?null:t,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}var o;return!0};const C=new Set([47,92,63,35]);E.prototype["parse file"]=function(t){var e,n;return this.url.scheme="file",47===t||92===t?(92===t&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(t)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===t?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===t?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(this.input.length-this.pointer-1==0||(e=t,n=this.input[this.pointer+1],!s(e)||58!==n&&124!==n)||this.input.length-this.pointer-1>=2&&!C.has(this.input[this.pointer+2])?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),S(this.url)):this.parseError=!0,this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},E.prototype["parse file slash"]=function(t){var e;return 47===t||92===t?(92===t&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(2===(e=this.base.path[0]).length&&s(e.codePointAt(0))&&":"===e[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},E.prototype["parse file host"]=function(t,e){if(isNaN(t)||47===t||92===t||63===t||35===t)if(--this.pointer,!this.stateOverride&&l(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let t=_(this.buffer,d(this.url));if(t===n)return n;if("localhost"===t&&(t=""),this.url.host=t,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=e;return!0},E.prototype["parse path start"]=function(t){return d(this.url)?(92===t&&(this.parseError=!0),this.state="path",47!==t&&92!==t&&--this.pointer):this.stateOverride||63!==t?this.stateOverride||35!==t?void 0!==t&&(this.state="path",47!==t&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},E.prototype["parse path"]=function(t){if(isNaN(t)||47===t||d(this.url)&&92===t||!this.stateOverride&&(63===t||35===t)){if(d(this.url)&&92===t&&(this.parseError=!0),".."===(e=(e=this.buffer).toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e?(S(this.url),47===t||d(this.url)&&92===t||this.url.path.push("")):!c(this.buffer)||47===t||d(this.url)&&92===t?c(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&l(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="","file"===this.url.scheme&&(void 0===t||63===t||35===t))for(;this.url.path.length>1&&""===this.url.path[0];)this.parseError=!0,this.url.path.shift();63===t&&(this.url.query="",this.state="query"),35===t&&(this.url.fragment="",this.state="fragment")}else 37!==t||u(this.input[this.pointer+1])&&u(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=g(t,m);var e;return!0},E.prototype["parse cannot-be-a-base-URL path"]=function(t){return 63===t?(this.url.query="",this.state="query"):35===t?(this.url.fragment="",this.state="fragment"):(isNaN(t)||37===t||(this.parseError=!0),37!==t||u(this.input[this.pointer+1])&&u(this.input[this.pointer+2])||(this.parseError=!0),isNaN(t)||(this.url.path[0]=this.url.path[0]+g(t,f))),!0},E.prototype["parse query"]=function(t,e){if(isNaN(t)||!this.stateOverride&&35===t){d(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8");const e=new Buffer(this.buffer);for(let t=0;t<e.length;++t)e[t]<33||e[t]>126||34===e[t]||35===e[t]||60===e[t]||62===e[t]?this.url.query+=p(e[t]):this.url.query+=String.fromCodePoint(e[t]);this.buffer="",35===t&&(this.url.fragment="",this.state="fragment")}else 37!==t||u(this.input[this.pointer+1])&&u(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=e;return!0},E.prototype["parse fragment"]=function(t){return isNaN(t)||(0===t?this.parseError=!0:(37!==t||u(this.input[this.pointer+1])&&u(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=g(t,f))),!0},t.exports.serializeURL=function(t,e){let n=t.scheme+":";if(null!==t.host?(n+="//",""===t.username&&""===t.password||(n+=t.username,""!==t.password&&(n+=":"+t.password),n+="@"),n+=j(t.host),null!==t.port&&(n+=":"+t.port)):null===t.host&&"file"===t.scheme&&(n+="//"),t.cannotBeABaseURL)n+=t.path[0];else for(const e of t.path)n+="/"+e;return null!==t.query&&(n+="?"+t.query),e||null===t.fragment||(n+="#"+t.fragment),n},t.exports.serializeURLOrigin=function(e){switch(e.scheme){case"blob":try{return t.exports.serializeURLOrigin(t.exports.parseURL(e.path[0]))}catch(t){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return function(t){let e=t.scheme+"://";return e+=j(t.host),null!==t.port&&(e+=":"+t.port),e}({scheme:e.scheme,host:e.host,port:e.port});case"file":return"file://";default:return"null"}},t.exports.basicURLParse=function(t,e){void 0===e&&(e={});const n=new E(t,e.baseURL,e.encodingOverride,e.url,e.stateOverride);return n.failure?"failure":n.url},t.exports.setTheUsername=function(t,e){t.username="";const n=a.ucs2.decode(e);for(let e=0;e<n.length;++e)t.username+=g(n[e],y)},t.exports.setThePassword=function(t,e){t.password="";const n=a.ucs2.decode(e);for(let e=0;e<n.length;++e)t.password+=g(n[e],y)},t.exports.serializeHost=j,t.exports.cannotHaveAUsernamePasswordPort=function(t){return null===t.host||""===t.host||t.cannotBeABaseURL||"file"===t.scheme},t.exports.serializeInteger=function(t){return String(t)},t.exports.parseURL=function(e,n){return void 0===n&&(n={}),t.exports.basicURLParse(e,{baseURL:n.baseURL,encodingOverride:n.encodingOverride})}}));or.serializeURL,or.serializeURLOrigin,or.basicURLParse,or.setTheUsername,or.setThePassword,or.serializeHost,or.cannotHaveAUsernamePasswordPort,or.serializeInteger,or.parseURL;var ir=class{constructor(t){const e=t[0],n=t[1];let r=null;if(void 0!==n&&(r=or.basicURLParse(n),"failure"===r))throw new TypeError("Invalid base URL");const o=or.basicURLParse(e,{baseURL:r});if("failure"===o)throw new TypeError("Invalid URL");this._url=o}get href(){return or.serializeURL(this._url)}set href(t){const e=or.basicURLParse(t);if("failure"===e)throw new TypeError("Invalid URL");this._url=e}get origin(){return or.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(t){or.basicURLParse(t+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(t){or.cannotHaveAUsernamePasswordPort(this._url)||or.setTheUsername(this._url,t)}get password(){return this._url.password}set password(t){or.cannotHaveAUsernamePasswordPort(this._url)||or.setThePassword(this._url,t)}get host(){const t=this._url;return null===t.host?"":null===t.port?or.serializeHost(t.host):or.serializeHost(t.host)+":"+or.serializeInteger(t.port)}set host(t){this._url.cannotBeABaseURL||or.basicURLParse(t,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":or.serializeHost(this._url.host)}set hostname(t){this._url.cannotBeABaseURL||or.basicURLParse(t,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":or.serializeInteger(this._url.port)}set port(t){or.cannotHaveAUsernamePasswordPort(this._url)||(""===t?this._url.port=null:or.basicURLParse(t,{url:this._url,stateOverride:"port"}))}get pathname(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")}set pathname(t){this._url.cannotBeABaseURL||(this._url.path=[],or.basicURLParse(t,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query}set search(t){const e=this._url;if(""===t)return void(e.query=null);const n="?"===t[0]?t.substring(1):t;e.query="",or.basicURLParse(n,{url:e,stateOverride:"query"})}get hash(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment}set hash(t){if(""===t)return void(this._url.fragment=null);const e="#"===t[0]?t.substring(1):t;this._url.fragment="",or.basicURLParse(e,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}},sr=Wn((function(t){const e=Hn.implSymbol;function n(r){if(!this||this[e]||!(this instanceof n))throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");if(arguments.length<1)throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.");const o=[];for(let t=0;t<arguments.length&&t<2;++t)o[t]=arguments[t];o[0]=zn.USVString(o[0]),void 0!==o[1]&&(o[1]=zn.USVString(o[1])),t.exports.setup(this,o)}n.prototype.toJSON=function(){if(!this||!t.exports.is(this))throw new TypeError("Illegal invocation");const n=[];for(let t=0;t<arguments.length&&t<0;++t)n[t]=arguments[t];return this[e].toJSON.apply(this[e],n)},Object.defineProperty(n.prototype,"href",{get(){return this[e].href},set(t){t=zn.USVString(t),this[e].href=t},enumerable:!0,configurable:!0}),n.prototype.toString=function(){if(!this||!t.exports.is(this))throw new TypeError("Illegal invocation");return this.href},Object.defineProperty(n.prototype,"origin",{get(){return this[e].origin},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"protocol",{get(){return this[e].protocol},set(t){t=zn.USVString(t),this[e].protocol=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"username",{get(){return this[e].username},set(t){t=zn.USVString(t),this[e].username=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"password",{get(){return this[e].password},set(t){t=zn.USVString(t),this[e].password=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"host",{get(){return this[e].host},set(t){t=zn.USVString(t),this[e].host=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hostname",{get(){return this[e].hostname},set(t){t=zn.USVString(t),this[e].hostname=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"port",{get(){return this[e].port},set(t){t=zn.USVString(t),this[e].port=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pathname",{get(){return this[e].pathname},set(t){t=zn.USVString(t),this[e].pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"search",{get(){return this[e].search},set(t){t=zn.USVString(t),this[e].search=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hash",{get(){return this[e].hash},set(t){t=zn.USVString(t),this[e].hash=t},enumerable:!0,configurable:!0}),t.exports={is:t=>!!t&&t[e]instanceof ir,create(t,e){let r=Object.create(n.prototype);return this.setup(r,t,e),r},setup(t,n,r){r||(r={}),r.wrapper=t,t[e]=new ir(n,r),t[e][Hn.wrapperSymbol]=t},interface:n,expose:{Window:{URL:n},Worker:{URL:n}}}}));sr.is,sr.create,sr.setup,sr.expose;var ar={URL:sr.interface,serializeURL:or.serializeURL,serializeURLOrigin:or.serializeURLOrigin,basicURLParse:or.basicURLParse,setTheUsername:or.setTheUsername,setThePassword:or.setThePassword,serializeHost:or.serializeHost,serializeInteger:or.serializeInteger,parseURL:or.parseURL};const ur=n.Readable,cr=Symbol("buffer"),lr=Symbol("type");class hr{constructor(){this[lr]="";const t=arguments[0],e=arguments[1],n=[];let r=0;if(t){const e=t,o=Number(e.length);for(let t=0;t<o;t++){const o=e[t];let i;i=o instanceof Buffer?o:ArrayBuffer.isView(o)?Buffer.from(o.buffer,o.byteOffset,o.byteLength):o instanceof ArrayBuffer?Buffer.from(o):o instanceof hr?o[cr]:Buffer.from("string"==typeof o?o:String(o)),r+=i.length,n.push(i)}}this[cr]=Buffer.concat(n);let o=e&&void 0!==e.type&&String(e.type).toLowerCase();o&&!/[^\u0020-\u007E]/.test(o)&&(this[lr]=o)}get size(){return this[cr].length}get type(){return this[lr]}text(){return Promise.resolve(this[cr].toString())}arrayBuffer(){const t=this[cr],e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return Promise.resolve(e)}stream(){const t=new ur;return t._read=function(){},t.push(this[cr]),t.push(null),t}toString(){return"[object Blob]"}slice(){const t=this.size,e=arguments[0],n=arguments[1];let r,o;r=void 0===e?0:e<0?Math.max(t+e,0):Math.min(e,t),o=void 0===n?t:n<0?Math.max(t+n,0):Math.min(n,t);const i=Math.max(o-r,0),s=this[cr].slice(r,r+i),a=new hr([],{type:arguments[2]});return a[cr]=s,a}}function dr(t,e,n){Error.call(this,t),this.message=t,this.type=e,n&&(this.code=this.errno=n.code),Error.captureStackTrace(this,this.constructor)}let pr;Object.defineProperties(hr.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(hr.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),dr.prototype=Object.create(Error.prototype),dr.prototype.constructor=dr,dr.prototype.name="FetchError";try{pr=require("encoding").convert}catch(t){}const fr=Symbol("Body internals"),vr=n.PassThrough;function mr(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.size;let i=void 0===o?0:o;var s=r.timeout;let a=void 0===s?0:s;null==t?t=null:yr(t)?t=Buffer.from(t.toString()):gr(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof n||(t=Buffer.from(String(t)))),this[fr]={body:t,disturbed:!1,error:null},this.size=i,this.timeout=a,t instanceof n&&t.on("error",(function(t){const n="AbortError"===t.name?t:new dr(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t);e[fr].error=n}))}function br(){var t=this;if(this[fr].disturbed)return mr.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[fr].disturbed=!0,this[fr].error)return mr.Promise.reject(this[fr].error);let e=this.body;if(null===e)return mr.Promise.resolve(Buffer.alloc(0));if(gr(e)&&(e=e.stream()),Buffer.isBuffer(e))return mr.Promise.resolve(e);if(!(e instanceof n))return mr.Promise.resolve(Buffer.alloc(0));let r=[],o=0,i=!1;return new mr.Promise((function(n,s){let a;t.timeout&&(a=setTimeout((function(){i=!0,s(new dr(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),e.on("error",(function(e){"AbortError"===e.name?(i=!0,s(e)):s(new dr(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),e.on("data",(function(e){if(!i&&null!==e){if(t.size&&o+e.length>t.size)return i=!0,void s(new dr(`content size at ${t.url} over limit: ${t.size}`,"max-size"));o+=e.length,r.push(e)}})),e.on("end",(function(){if(!i){clearTimeout(a);try{n(Buffer.concat(r,o))}catch(e){s(new dr(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function yr(t){return"object"==typeof t&&"function"==typeof t.append&&"function"==typeof t.delete&&"function"==typeof t.get&&"function"==typeof t.getAll&&"function"==typeof t.has&&"function"==typeof t.set&&("URLSearchParams"===t.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(t)||"function"==typeof t.sort)}function gr(t){return"object"==typeof t&&"function"==typeof t.arrayBuffer&&"string"==typeof t.type&&"function"==typeof t.stream&&"function"==typeof t.constructor&&"string"==typeof t.constructor.name&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function wr(t){let e,r,o=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof n&&"function"!=typeof o.getBoundary&&(e=new vr,r=new vr,o.pipe(e),o.pipe(r),t[fr].body=e,o=r),o}function _r(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":yr(t)?"application/x-www-form-urlencoded;charset=UTF-8":gr(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof n?null:"text/plain;charset=UTF-8"}function jr(t){const e=t.body;return null===e?0:gr(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0==e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}mr.prototype={get body(){return this[fr].body},get bodyUsed(){return this[fr].disturbed},arrayBuffer(){return br.call(this).then((function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}))},blob(){let t=this.headers&&this.headers.get("content-type")||"";return br.call(this).then((function(e){return Object.assign(new hr([],{type:t.toLowerCase()}),{[cr]:e})}))},json(){var t=this;return br.call(this).then((function(e){try{return JSON.parse(e.toString())}catch(e){return mr.Promise.reject(new dr(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}}))},text(){return br.call(this).then((function(t){return t.toString()}))},buffer(){return br.call(this)},textConverted(){var t=this;return br.call(this).then((function(e){return function(t,e){if("function"!=typeof pr)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=e.get("content-type");let r,o,i="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));o=t.slice(0,1024).toString(),!r&&o&&(r=/<meta.+?charset=(['"])(.+?)\1/i.exec(o));!r&&o&&(r=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(o),r||(r=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(o),r&&r.pop()),r&&(r=/charset=(.*)/i.exec(r.pop())));!r&&o&&(r=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(o));r&&(i=r.pop(),"gb2312"!==i&&"gbk"!==i||(i="gb18030"));return pr(t,"UTF-8",i).toString()}(e,t.headers)}))}},Object.defineProperties(mr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),mr.mixIn=function(t){for(const e of Object.getOwnPropertyNames(mr.prototype))if(!(e in t)){const n=Object.getOwnPropertyDescriptor(mr.prototype,e);Object.defineProperty(t,e,n)}},mr.Promise=global.Promise;const Sr=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Ar=/[^\t\x20-\x7e\x80-\xff]/;function Er(t){if(t=`${t}`,Sr.test(t)||""===t)throw new TypeError(`${t} is not a legal HTTP header name`)}function Cr(t){if(t=`${t}`,Ar.test(t))throw new TypeError(`${t} is not a legal HTTP header value`)}function xr(t,e){e=e.toLowerCase();for(const n in t)if(n.toLowerCase()===e)return n}const Or=Symbol("map");class Ir{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[Or]=Object.create(null),t instanceof Ir){const e=t.raw(),n=Object.keys(e);for(const t of n)for(const n of e[t])this.append(t,n)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const n=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(e))}for(const t of n){if(2!==t.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(t[0],t[1])}}else for(const e of Object.keys(t)){const n=t[e];this.append(e,n)}}}}get(t){Er(t=`${t}`);const e=xr(this[Or],t);return void 0===e?null:this[Or][e].join(", ")}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=kr(this),r=0;for(;r<n.length;){var o=n[r];const i=o[0],s=o[1];t.call(e,s,i,this),n=kr(this),r++}}set(t,e){e=`${e}`,Er(t=`${t}`),Cr(e);const n=xr(this[Or],t);this[Or][void 0!==n?n:t]=[e]}append(t,e){e=`${e}`,Er(t=`${t}`),Cr(e);const n=xr(this[Or],t);void 0!==n?this[Or][n].push(e):this[Or][t]=[e]}has(t){return Er(t=`${t}`),void 0!==xr(this[Or],t)}delete(t){Er(t=`${t}`);const e=xr(this[Or],t);void 0!==e&&delete this[Or][e]}raw(){return this[Or]}keys(){return Dr(this,"key")}values(){return Dr(this,"value")}[Symbol.iterator](){return Dr(this,"key+value")}}function kr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";const n=Object.keys(t[Or]).sort();return n.map("key"===e?function(t){return t.toLowerCase()}:"value"===e?function(e){return t[Or][e].join(", ")}:function(e){return[e.toLowerCase(),t[Or][e].join(", ")]})}Ir.prototype.entries=Ir.prototype[Symbol.iterator],Object.defineProperty(Ir.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Ir.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const Ur=Symbol("internal");function Dr(t,e){const n=Object.create(Pr);return n[Ur]={target:t,kind:e,index:0},n}const Pr=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==Pr)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[Ur];const e=t.target,n=t.kind,r=t.index,o=kr(e,n);return r>=o.length?{value:void 0,done:!0}:(this[Ur].index=r+1,{value:o[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function Br(t){const e=Object.assign({__proto__:null},t[Or]),n=xr(t[Or],"Host");return void 0!==n&&(e[n]=e[n][0]),e}Object.defineProperty(Pr,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const Nr=Symbol("Response internals"),Tr=o.STATUS_CODES;class Lr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};mr.call(this,t,e);const n=e.status||200,r=new Ir(e.headers);if(null!=t&&!r.has("Content-Type")){const e=_r(t);e&&r.append("Content-Type",e)}this[Nr]={url:e.url,status:n,statusText:e.statusText||Tr[n],headers:r,counter:e.counter}}get url(){return this[Nr].url||""}get status(){return this[Nr].status}get ok(){return this[Nr].status>=200&&this[Nr].status<300}get redirected(){return this[Nr].counter>0}get statusText(){return this[Nr].statusText}get headers(){return this[Nr].headers}clone(){return new Lr(wr(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}mr.mixIn(Lr.prototype),Object.defineProperties(Lr.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Lr.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const Fr=Symbol("Request internals"),Rr=i.URL||ar.URL,Mr=i.parse,Wr=i.format;function qr(t){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(t)&&(t=new Rr(t).toString()),Mr(t)}const zr="destroy"in n.Readable.prototype;function $r(t){return"object"==typeof t&&"object"==typeof t[Fr]}class Gr{constructor(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$r(t)?e=qr(t.url):(e=t&&t.href?qr(t.href):qr(`${t}`),t={});let r=n.method||t.method||"GET";if(r=r.toUpperCase(),(null!=n.body||$r(t)&&null!==t.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let o=null!=n.body?n.body:$r(t)&&null!==t.body?wr(t):null;mr.call(this,o,{timeout:n.timeout||t.timeout||0,size:n.size||t.size||0});const i=new Ir(n.headers||t.headers||{});if(null!=o&&!i.has("Content-Type")){const t=_r(o);t&&i.append("Content-Type",t)}let s=$r(t)?t.signal:null;if("signal"in n&&(s=n.signal),null!=s&&!function(t){const e=t&&"object"==typeof t&&Object.getPrototypeOf(t);return!(!e||"AbortSignal"!==e.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[Fr]={method:r,redirect:n.redirect||t.redirect||"follow",headers:i,parsedURL:e,signal:s},this.follow=void 0!==n.follow?n.follow:void 0!==t.follow?t.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===t.compress||t.compress,this.counter=n.counter||t.counter||0,this.agent=n.agent||t.agent}get method(){return this[Fr].method}get url(){return Wr(this[Fr].parsedURL)}get headers(){return this[Fr].headers}get redirect(){return this[Fr].redirect}get signal(){return this[Fr].signal}clone(){return new Gr(this)}}function Hr(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}mr.mixIn(Gr.prototype),Object.defineProperty(Gr.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Gr.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),Hr.prototype=Object.create(Error.prototype),Hr.prototype.constructor=Hr,Hr.prototype.name="AbortError";const Vr=i.URL||ar.URL,Jr=n.PassThrough;function Yr(t,e){if(!Yr.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return mr.Promise=Yr.Promise,new Yr.Promise((function(r,i){const s=new Gr(t,e),a=function(t){const e=t[Fr].parsedURL,r=new Ir(t[Fr].headers);if(r.has("Accept")||r.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof n.Readable&&!zr)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(o="0"),null!=t.body){const e=jr(t);"number"==typeof e&&(o=String(e))}o&&r.set("Content-Length",o),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=t.agent;return"function"==typeof i&&(i=i(e)),r.has("Connection")||i||r.set("Connection","close"),Object.assign({},e,{method:t.method,headers:Br(r),agent:i})}(s),l=("https:"===a.protocol?u:o).request,h=s.signal;let d=null;const p=function(){let t=new Hr("The user aborted a request.");i(t),s.body&&s.body instanceof n.Readable&&s.body.destroy(t),d&&d.body&&d.body.emit("error",t)};if(h&&h.aborted)return void p();const f=function(){p(),b()},v=l(a);let m;function b(){v.abort(),h&&h.removeEventListener("abort",f),clearTimeout(m)}h&&h.addEventListener("abort",f),s.timeout&&v.once("socket",(function(t){m=setTimeout((function(){i(new dr(`network timeout at: ${s.url}`,"request-timeout")),b()}),s.timeout)})),v.on("error",(function(t){i(new dr(`request to ${s.url} failed, reason: ${t.message}`,"system",t)),b()})),v.on("response",(function(t){clearTimeout(m);const e=function(t){const e=new Ir;for(const n of Object.keys(t))if(!Sr.test(n))if(Array.isArray(t[n]))for(const r of t[n])Ar.test(r)||(void 0===e[Or][n]?e[Or][n]=[r]:e[Or][n].push(r));else Ar.test(t[n])||(e[Or][n]=[t[n]]);return e}(t.headers);if(Yr.isRedirect(t.statusCode)){const n=e.get("Location");let o=null;try{o=null===n?null:new Vr(n,s.url).toString()}catch(t){if("manual"!==s.redirect)return i(new dr(`uri requested responds with an invalid redirect URL: ${n}`,"invalid-redirect")),void b()}switch(s.redirect){case"error":return i(new dr(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`,"no-redirect")),void b();case"manual":if(null!==o)try{e.set("Location",o)}catch(t){i(t)}break;case"follow":if(null===o)break;if(s.counter>=s.follow)return i(new dr(`maximum redirect reached at: ${s.url}`,"max-redirect")),void b();const n={headers:new Ir(s.headers),follow:s.follow,counter:s.counter+1,agent:s.agent,compress:s.compress,method:s.method,body:s.body,signal:s.signal,timeout:s.timeout,size:s.size};if(!function(t,e){const n=new Vr(e).hostname,r=new Vr(t).hostname;return n===r||"."===n[n.length-r.length-1]&&n.endsWith(r)}(s.url,o))for(const t of["authorization","www-authenticate","cookie","cookie2"])n.headers.delete(t);return 303!==t.statusCode&&s.body&&null===jr(s)?(i(new dr("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void b()):(303!==t.statusCode&&(301!==t.statusCode&&302!==t.statusCode||"POST"!==s.method)||(n.method="GET",n.body=void 0,n.headers.delete("content-length")),r(Yr(new Gr(o,n))),void b())}}t.once("end",(function(){h&&h.removeEventListener("abort",f)}));let n=t.pipe(new Jr);const o={url:s.url,status:t.statusCode,statusText:t.statusMessage,headers:e,size:s.size,timeout:s.timeout,counter:s.counter},a=e.get("Content-Encoding");if(!s.compress||"HEAD"===s.method||null===a||204===t.statusCode||304===t.statusCode)return d=new Lr(n,o),void r(d);const u={flush:c.Z_SYNC_FLUSH,finishFlush:c.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return n=n.pipe(c.createGunzip(u)),d=new Lr(n,o),void r(d);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof c.createBrotliDecompress)return n=n.pipe(c.createBrotliDecompress()),d=new Lr(n,o),void r(d);d=new Lr(n,o),r(d)}else{t.pipe(new Jr).once("data",(function(t){n=8==(15&t[0])?n.pipe(c.createInflate()):n.pipe(c.createInflateRaw()),d=new Lr(n,o),r(d)}))}})),function(t,e){const n=e.body;null===n?t.end():gr(n)?n.stream().pipe(t):Buffer.isBuffer(n)?(t.write(n),t.end()):n.pipe(t)}(v,s)}))}Yr.isRedirect=function(t){return 301===t||302===t||303===t||307===t||308===t},Yr.Promise=global.Promise;var Zr=function(){function t(t){this.contextProvider=t}return t.prototype.getServiceDetails=function(t,e){return A(this,void 0,void 0,(function(){return E(this,(function(n){return[2,this.fetch("".concat(this.contextProvider.getCurrentBaseUrl(),"/v1/port-forwarding/info/projects/").concat(t,"/services/").concat(e))]}))}))},t.prototype.getAddonDetails=function(t,e){return A(this,void 0,void 0,(function(){return E(this,(function(n){return[2,this.fetch("".concat(this.contextProvider.getCurrentBaseUrl(),"/v1/port-forwarding/info/projects/").concat(t,"/addons/").concat(e))]}))}))},t.prototype.fetch=function(t,e){return A(this,void 0,void 0,(function(){var n,r,o,i,s;return E(this,(function(a){switch(a.label){case 0:return n=Mn({},{headers:{Authorization:"Bearer ".concat(this.contextProvider.getCurrentToken()),"Content-Type":"application/json"}},S({},e)),[4,Yr(t,n)];case 1:return(r=a.sent()).ok?[3,3]:(o=Error.bind,s=(i=JSON).stringify,[4,r.json()]);case 2:throw new(o.apply(Error,[void 0,s.apply(i,[a.sent()])]));case 3:return[4,r.json()];case 4:return[2,a.sent()]}}))}))},t}(),Kr=function(t,e,n){return A(void 0,void 0,void 0,(function(){var r,o,i,s,a;return E(this,(function(u){switch(u.label){case 0:if(r=to(e||"127.0.0.1"),(o=to(n||"127.255.255.255"))<r)throw new Error("Invalid IP range");"darwin"===l.platform()&&(i=function(t){return A(void 0,void 0,void 0,(function(){var e;return E(this,(function(n){switch(n.label){case 0:return e="lo0 alias ".concat(t," up"),[4,Qr.apply(void 0,e.split(" "))];case 1:return n.sent(),[2]}}))}))}),s=r,u.label=1;case 1:return s<=o?(a=eo(s),[4,Xr(t,a)]):[3,6];case 2:return u.sent()?i?[4,i(a)]:[3,4]:[3,5];case 3:u.sent(),u.label=4;case 4:return[2,a];case 5:return s+=1,[3,1];case 6:throw new Error("No ip available")}}))}))},Xr=function(t,e){return new Promise((function(n){var r=new p,o=!1;r.on("connect",(function(){o=!0,r.destroy()})),r.setTimeout(400),r.on("timeout",(function(){o=!1,r.destroy()})),r.on("error",(function(){o=!1})),r.on("close",(function(){n(!o)})),e?r.connect(t,e):r.connect(t)}))},Qr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return A(void 0,void 0,void 0,(function(){return E(this,(function(e){switch(e.label){case 0:return"/sbin/ifconfig",[4,no("/sbin/ifconfig",t).resultPromise];case 1:return[2,e.sent()]}}))}))},to=function(t){var e=t.split(".").reverse();if(4!==e.length)throw new Error("Invalid ip address: ".concat(t));for(var n=0,r=0;r<4;r+=1){var o=Number.parseInt(e[r],10);if(o<0||o>255)throw new Error("Invalid ip address: ".concat(t));n+=o<<8*r}return n},eo=function(t){if(!Number.isSafeInteger(t))throw new Error("Number is not an integer");if(t<0||t>4294967295)throw new Error("Number is out of range 0x0-0xffffffff");for(var e=[],n=0;n<4;n+=1)e.push(t>>8*n&255);return e.reverse().join(".")},no=function(t,e,n){var r=f(t,e,S({windowsHide:!0},n)),o=new Promise((function(o,i){var s="",a="";(null===(null==n?void 0:n.stdio)||void 0===(null==n?void 0:n.stdio))&&(r.stdout&&r.stdout.on("data",(function(t){s+=t})),r.stderr&&r.stderr.on("data",(function(t){a+=t}))),r.on("close",(function(n){var r={code:n,stdout:s,stderr:a};if(0!==n){var u="Error during execution of command '".concat(t," ").concat(e.join(" "),"': ").concat(a);i({message:u,result:r})}else o(r)}))}));return{process:r,resultPromise:o}},ro=function(t,e,n){return A(void 0,void 0,void 0,(function(){var r,o;return E(this,(function(i){switch(i.label){case 0:return r=oo(t,10),[4,m.promises.writeFile(r,e,n)];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,4,,6]),[4,m.promises.rename(r,t)];case 3:return i.sent(),[3,6];case 4:return o=i.sent(),[4,m.promises.unlink(r).catch((function(){}))];case 5:throw i.sent(),o;case 6:return[2]}}))}))},oo=function(t,e){for(var n,r=b.dirname(t),o=b.basename(t),i=0;null===(n=i<e)||void 0===n||n;i+=1){var s=C([],Array(16),!0).map((function(){return Math.floor(16*Math.random()).toString(16)})).join(""),a=".".concat(s,".").concat(o),u=b.join(r,a);if(!m.existsSync(u))return u}throw new Error("Could not write file to file '".concat(t,"'."))},io="win32"===process.platform?"\r\n":"\n",so=function(){function t(t,e){this.nodes=t,this.config=e}return t.prototype.add=function(t,e,n){var r=this;if(0===e.length)return this;var o=this.findOrCreateEntry(t,n);return e.forEach((function(t){if(!o.hosts.find((function(e){return e.host===t}))){var e=1;0===o.hosts.length&&(e=r.config.indent-"".concat(o.ipPrefixWhitespace).concat(o.ip).length),o.hosts.push({whitespace:" ".repeat(e<1?1:e),host:t})}})),this},t.prototype.remove=function(t,e){var n=this;return this.findEntries(t).forEach((function(t){e.forEach((function(e){var r=t.hosts.findIndex((function(t){return t.host===e}));r<0||(0===r&&void 0!==t.hosts[1]&&(t.hosts[1].whitespace=t.hosts[0].whitespace),t.hosts.splice(r,1),0===t.hosts.length&&n.removeEntry(t))}))})),this},t.prototype.removeHosts=function(t){var e=this;fo(this.nodes,"entry").forEach((function(n){e.remove(n.ip,t)}))},t.prototype.removeIps=function(t){var e=this;return t.forEach((function(t){e.findEntries(t).forEach((function(t){return e.removeEntry(t)}))})),this},t.prototype.resolveHosts=function(t){return Nn(this.findEntries(t),(function(t){return t.hosts.map((function(t){return t.host}))}))},t.prototype.resolveIps=function(t){return fo(this.nodes,"entry").filter((function(e){return e.hosts.some((function(e){return e.host===t}))})).map((function(t){return t.ip}))},t.prototype.toString=function(){return lo(this.nodes,this.config.eol)},t.prototype.removeEntry=function(t){var e,n="number"==typeof(e=t)||F(e)&&"[object Number]"==L(e)?t:this.nodes.findIndex((function(e){return e===t}));n<0||this.nodes.splice(n,1)},t.prototype.findEntries=function(t){return fo(this.nodes,"entry").filter((function(e){return e.ip===t}))},t.prototype.findOrCreateEntry=function(t,e){var n=this.findEntries(t)[0];if(n)return n;var r=this.makeEntry(t);if(e){var o=co(e),i=this.nodes.findIndex((function(t){return"comment"===t.type&&t.line===o}));if(i>=0)this.insertAt(i+1,r);else{var s="blank"!==this.nodes[this.nodes.length-1].type?[ao(),uo(o),r]:[uo(o),r];this.insertAt.apply(this,C([this.nodes.length],s,!1))}}else this.insertAt(this.nodes.length,r);return r},t.prototype.insertAt=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(e=this.nodes).splice.apply(e,C([t,0],n,!1))},t.prototype.makeEntry=function(t,e){var n=this.config.ipPrefixWhitespace;return S({type:"entry",ip:t,ipPrefixWhitespace:n,hosts:[]},e)},t.fromNodes=function(e,n){var r,o;return new t(e.filter((function(t){return"eol"!==t.type})),{eol:null!==(r=null==n?void 0:n.eol)&&void 0!==r?r:function(){var t,n=fo(e,"eol").map((function(t){return t.line}));return null!==(t=vo(n))&&void 0!==t?t:io}(),indent:null!==(o=null==n?void 0:n.indent)&&void 0!==o?o:function(){var t,n=Nn(fo(e,"entry"),(function(t){var e=t.ipPrefixWhitespace,n=t.ip,r=t.hosts[0];return r?["".concat(e).concat(n).concat(r.whitespace).length]:[]}));return null!==(t=vo(n))&&void 0!==t?t:17}(),ipPrefixWhitespace:""})},t.parse=function(t,e){return this.fromNodes(ho(t),e)},t}(),ao=function(){return{type:"blank",line:""}},uo=function(t){return{type:"comment",line:co(t)}},co=function(t){return t.startsWith("#")?t:"# ".concat(t)},lo=function(t,e){var n=t.map((function(t){switch(t.type){case"entry":var e=t.hosts.map((function(t){var e=t.whitespace,n=t.host;return"".concat(e).concat(n)})).join("");return"".concat(t.ipPrefixWhitespace).concat(t.ip).concat(e);case"blank":case"comment":case"invalid":return t.line;default:return""}}));return n.join(null!=e?e:io)},ho=function(t){return t.split(/(\r?\n)/).map((function(t){return function(t){return t.match(/^\s*#.*$/)}(t)?{type:"comment",line:t}:function(t){return t.match(/^(\r?\n)$/)}(t)?{type:"eol",line:t}:function(t){return t.match(/^\s*$/)}(t)?{type:"blank",line:t}:po(t)}))},po=function(t){var e=t.match(/^(\s*)(\S+)(.+)?$/);if(!e)return{type:"invalid",line:t};var n=e[1],r=e[2],o=e.slice(3),i=!1,s=Nn(o.filter((function(t){return void 0!==t})),(function(t){var e=t.match(/(\s+)(\S+)/g);return e?e.map((function(t){var e=t.match(/^(\s+)(\S+)$/);e||(i=!0);var n=null!=e?e:[];return{whitespace:n[1],host:n[2]}})):(i=!0,[])}));return i?{type:"invalid",line:t}:{type:"entry",ipPrefixWhitespace:n,ip:r,hosts:s}},fo=function(t,e){return t.filter((function(t){return t.type===e}))},vo=function(t){var e=new Map;t.forEach((function(t){var n;e.set(t,(null!==(n=e.get(t))&&void 0!==n?n:0)+1)}));var n=Fn(Array.from(e.entries()),(function(t){return t[1]}));if(n)return n[0]},mo="win32"===process.platform?"C:/Windows/System32/drivers/etc/hosts":"/etc/hosts",bo=function(){function t(t){this.ast=so.fromNodes([]);var e={writeMode:"atomic",hostsFile:mo};this.config=S(S({},e),t)}return t.prototype.add=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!Ln(t))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof t,"."));return e.forEach((function(t){if(!Ln(t))throw new Error("Expected 'host' to be a string, but got ".concat(typeof t,"."))})),this.ast.add(t,e,this.config.header),this},t.prototype.remove=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!Ln(t))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof t,"."));return e.forEach((function(t){if(!Ln(t))throw new Error("Expected 'host' to be a string, but got ".concat(typeof t,"."))})),this.ast.remove(t,e),this},t.prototype.removeHosts=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.forEach((function(t){if(!Ln(t))throw new Error("Expected 'host' to be a string, but got ".concat(typeof t,"."))})),this.ast.removeHosts(t),this},t.prototype.removeIps=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.forEach((function(t){if(!Ln(t))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof t,"."))})),this.ast.removeIps(t),this},t.prototype.read=function(){return A(this,void 0,void 0,(function(){var t;return E(this,(function(e){switch(e.label){case 0:return[4,m.promises.readFile(this.config.hostsFile)];case 1:return t=e.sent(),this.ast=so.parse(t.toString(),this.config),[2,this]}}))}))},t.prototype.write=function(t){return A(this,void 0,void 0,(function(){var e,n,r,o;return E(this,(function(i){switch(i.label){case 0:switch(e=S(S({},this.config),t),n=e.hostsFile,r=e.writeMode,o=this.ast.toString(),r){case void 0:case"atomic":return[3,1];case"standard":return[3,3];case"disabled":return[3,5]}return[3,5];case 1:return[4,ro(n,o)];case 2:case 4:return i.sent(),[3,6];case 3:return[4,m.promises.writeFile(n,o)];case 5:return[3,6];case 6:return[2,this]}}))}))},t.prototype.backup=function(t){return A(this,void 0,void 0,(function(){var e,n,r,o;return E(this,(function(i){switch(i.label){case 0:return m.existsSync(this.config.hostsFile)?(e=b.dirname(this.config.hostsFile),n=b.basename(this.config.hostsFile),r="".concat(n).concat(t.suffix),o=b.resolve(e,r),m.existsSync(o)&&!t.rewrite?[3,2]:[4,m.promises.copyFile(this.config.hostsFile,o)]):[2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},t.load=function(e){return A(this,void 0,void 0,(function(){return E(this,(function(n){switch(n.label){case 0:return[4,new t(e).read()];case 1:return[2,n.sent()]}}))}))},t}(),yo=function(){function t(){this.previousPromise=Promise.resolve()}return t.prototype.enter=function(t){return A(this,void 0,void 0,(function(){var e;return E(this,(function(n){return e=this.previousPromise.then((function(){return t()})).catch((function(){return t()})),this.previousPromise=e,[2,e]}))}))},t}(),go=function t(e,n){if(e&&n)return t(e)(n);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){r[t]=e[t]})),r;function r(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),o=t[t.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach((function(t){r[t]=o[t]})),r}};var wo=go(jo),_o=go(So);function jo(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function So(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},n=t.name||"Function wrapped with `once`";return e.onceError=n+" shouldn't be called more than once",e.called=!1,e}jo.proto=jo((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return jo(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return So(this)},configurable:!0})})),wo.strict=_o;var Ao=function(){},Eo=function(t,e,n){if("function"==typeof e)return Eo(t,null,e);e||(e={}),n=wo(n||Ao);var r=t._writableState,o=t._readableState,i=e.readable||!1!==e.readable&&t.readable,s=e.writable||!1!==e.writable&&t.writable,a=!1,u=function(){t.writable||c()},c=function(){s=!1,i||n.call(t)},l=function(){i=!1,s||n.call(t)},h=function(e){n.call(t,e?new Error("exited with error code: "+e):null)},d=function(e){n.call(t,e)},p=function(){process.nextTick(f)},f=function(){if(!a)return(!i||o&&o.ended&&!o.destroyed)&&(!s||r&&r.ended&&!r.destroyed)?void 0:n.call(t,new Error("premature close"))},v=function(){t.req.on("finish",c)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(t)?s&&!r&&(t.on("end",u),t.on("close",u)):(t.on("complete",c),t.on("abort",p),t.req?v():t.on("request",v)),function(t){return t.stdio&&Array.isArray(t.stdio)&&3===t.stdio.length}(t)&&t.on("exit",h),t.on("end",l),t.on("finish",c),!1!==e.error&&t.on("error",d),t.on("close",p),function(){a=!0,t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("exit",h),t.removeListener("end",l),t.removeListener("error",d),t.removeListener("close",p)}},Co=Eo,xo=function(){},Oo=/^v?\.0/.test(process.version),Io=function(t){return"function"==typeof t},ko=function(t,e,n,r){r=wo(r);var o=!1;t.on("close",(function(){o=!0})),Co(t,{readable:e,writable:n},(function(t){if(t)return r(t);o=!0,r()}));var i=!1;return function(e){if(!o&&!i)return i=!0,function(t){return!!Oo&&!!m&&(t instanceof(m.ReadStream||xo)||t instanceof(m.WriteStream||xo))&&Io(t.close)}(t)?t.close(xo):function(t){return t.setHeader&&Io(t.abort)}(t)?t.abort():Io(t.destroy)?t.destroy():void r(e||new Error("stream was destroyed"))}},Uo=function(t){t()},Do=function(t,e){return t.pipe(e)},Po=function(){var t,e=Array.prototype.slice.call(arguments),n=Io(e[e.length-1]||xo)&&e.pop()||xo;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r=e.map((function(o,i){var s=i<e.length-1;return ko(o,s,i>0,(function(e){t||(t=e),e&&r.forEach(Uo),s||(r.forEach(Uo),n(t))}))}));return e.reduce(Do)};const{Duplex:Bo}=n;function No(t){t.emit("close")}function To(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Lo(t){this.removeListener("error",Lo),this.destroy(),0===this.listenerCount("error")&&this.emit("error",t)}var Fo=function(t,e){let n=!0;const r=new Bo({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",(function(e,n){const o=!n&&r._readableState.objectMode?e.toString():e;r.push(o)||t.pause()})),t.once("error",(function(t){r.destroyed||(n=!1,r.destroy(t))})),t.once("close",(function(){r.destroyed||r.push(null)})),r._destroy=function(e,o){if(t.readyState===t.CLOSED)return o(e),void process.nextTick(No,r);let i=!1;t.once("error",(function(t){i=!0,o(t)})),t.once("close",(function(){i||o(e),process.nextTick(No,r)})),n&&t.terminate()},r._final=function(e){t.readyState!==t.CONNECTING?null!==t._socket&&(t._socket._writableState.finished?(e(),r._readableState.endEmitted&&r.destroy()):(t._socket.once("finish",(function(){e()})),t.close())):t.once("open",(function(){r._final(e)}))},r._read=function(){t.isPaused&&t.resume()},r._write=function(e,n,o){t.readyState!==t.CONNECTING?t.send(e,o):t.once("open",(function(){r._write(e,n,o)}))},r.on("end",To),r.on("error",Lo),r},Ro={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}},Mo="function"==typeof __webpack_require__?__non_webpack_require__:function(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")},Wo=process.config&&process.config.variables||{},qo=!!process.env.PREBUILDS_ONLY,zo=process.versions.modules,$o=!(!process.versions||!process.versions.electron)||!!process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":"node",Go=l.arch(),Ho=l.platform(),Vo=process.env.LIBC||(function(t){return"linux"===t&&m.existsSync("/etc/alpine-release")}(Ho)?"musl":"glibc"),Jo=process.env.ARM_VERSION||("arm64"===Go?"8":Wo.arm_version)||"",Yo=(process.versions.uv||"").split(".")[0],Zo=Ko;function Ko(t){return Mo(Ko.path(t))}function Xo(t){try{return m.readdirSync(t)}catch(t){return[]}}function Qo(t,e){var n=Xo(t).filter(e);return n[0]&&b.join(t,n[0])}function ti(t){return/\.node$/.test(t)}function ei(t){var e=t.split("-");if(2===e.length){var n=e[0],r=e[1].split("+");if(n&&r.length&&r.every(Boolean))return{name:t,platform:n,architectures:r}}}function ni(t,e){return function(n){return null!=n&&(n.platform===t&&n.architectures.includes(e))}}function ri(t,e){return t.architectures.length-e.architectures.length}function oi(t){var e=t.split("."),n={file:t,specificity:0};if("node"===e.pop()){for(var r=0;r<e.length;r++){var o=e[r];if("node"===o||"electron"===o||"node-webkit"===o)n.runtime=o;else if("napi"===o)n.napi=!0;else if("abi"===o.slice(0,3))n.abi=o.slice(3);else if("uv"===o.slice(0,2))n.uv=o.slice(2);else if("armv"===o.slice(0,4))n.armv=o.slice(4);else{if("glibc"!==o&&"musl"!==o)continue;n.libc=o}n.specificity++}return n}}function ii(t,e){return function(n){return null!=n&&(!(n.runtime!==t&&!function(t){return"node"===t.runtime&&t.napi}(n))&&(!(n.abi!==e&&!n.napi)&&((!n.uv||n.uv===Yo)&&((!n.armv||n.armv===Jo)&&(!n.libc||n.libc===Vo)))))}}function si(t){return function(e,n){return e.runtime!==n.runtime?e.runtime===t?-1:1:e.abi!==n.abi?e.abi?-1:1:e.specificity!==n.specificity?e.specificity>n.specificity?-1:1:0}}Ko.path=function(t){t=b.resolve(t||".");try{var e=Mo(b.join(t,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(t=process.env[e+"_PREBUILD"])}catch(t){}if(!qo){var n=Qo(b.join(t,"build/Release"),ti);if(n)return n;var r=Qo(b.join(t,"build/Debug"),ti);if(r)return r}var o=a(t);if(o)return o;var i=a(b.dirname(process.execPath));if(i)return i;var s=["platform="+Ho,"arch="+Go,"runtime="+$o,"abi="+zo,"uv="+Yo,Jo?"armv="+Jo:"","libc="+Vo,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"","function"==typeof __webpack_require__?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+s+"\n loaded from: "+t+"\n");function a(t){var e=Xo(b.join(t,"prebuilds")).map(ei).filter(ni(Ho,Go)).sort(ri)[0];if(e){var n=b.join(t,"prebuilds",e.name),r=Xo(n).map(oi).filter(ii($o,zo)).sort(si($o))[0];return r?b.join(n,r.file):void 0}}},Ko.parseTags=oi,Ko.matchTags=ii,Ko.compareTags=si,Ko.parseTuple=ei,Ko.matchTuple=ni,Ko.compareTuples=ri;var ai={mask:(t,e,n,r,o)=>{for(var i=0;i<o;i++)n[r+i]=t[i]^e[3&i]},unmask:(t,e)=>{const n=t.length;for(var r=0;r<n;r++)t[r]^=e[3&r]}},ui=Wn((function(t){try{t.exports=Zo(__dirname)}catch(e){t.exports=ai}})),ci=Wn((function(t){const{EMPTY_BUFFER:e}=Ro;function n(t,n){if(0===t.length)return e;if(1===t.length)return t[0];const r=Buffer.allocUnsafe(n);let o=0;for(let e=0;e<t.length;e++){const n=t[e];r.set(n,o),o+=n.length}return o<n?r.slice(0,o):r}function r(t,e,n,r,o){for(let i=0;i<o;i++)n[r+i]=t[i]^e[3&i]}function o(t,e){for(let n=0;n<t.length;n++)t[n]^=e[3&n]}function i(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function s(t){if(s.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=Buffer.from(t):ArrayBuffer.isView(t)?e=Buffer.from(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),s.readOnly=!1),e}try{const e=ui;t.exports={concat:n,mask(t,n,o,i,s){s<48?r(t,n,o,i,s):e.mask(t,n,o,i,s)},toArrayBuffer:i,toBuffer:s,unmask(t,n){t.length<32?o(t,n):e.unmask(t,n)}}}catch(e){t.exports={concat:n,mask:r,toArrayBuffer:i,toBuffer:s,unmask:o}}}));ci.concat,ci.mask,ci.toArrayBuffer,ci.toBuffer,ci.unmask;const li=Symbol("kDone"),hi=Symbol("kRun");var di=class{constructor(t){this[li]=()=>{this.pending--,this[hi]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[hi]()}[hi](){if(this.pending!==this.concurrency&&this.jobs.length){const t=this.jobs.shift();this.pending++,t(this[li])}}};const{kStatusCode:pi}=Ro,fi=Buffer.from([0,0,255,255]),vi=Symbol("permessage-deflate"),mi=Symbol("total-length"),bi=Symbol("callback"),yi=Symbol("buffers"),gi=Symbol("error");let wi;var _i=class{constructor(t,e,n){if(this._maxPayload=0|n,this._options=t||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!e,this._deflate=null,this._inflate=null,this.params=null,!wi){const t=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;wi=new di(t)}}static get extensionName(){return"permessage-deflate"}offer(){const t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const t=this._deflate[bi];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){const e=this._options,n=t.find((t=>!(!1===e.serverNoContextTakeover&&t.server_no_context_takeover||t.server_max_window_bits&&(!1===e.serverMaxWindowBits||"number"==typeof e.serverMaxWindowBits&&e.serverMaxWindowBits>t.server_max_window_bits)||"number"==typeof e.clientMaxWindowBits&&!t.client_max_window_bits)));if(!n)throw new Error("None of the extension offers can be accepted");return e.serverNoContextTakeover&&(n.server_no_context_takeover=!0),e.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof e.serverMaxWindowBits&&(n.server_max_window_bits=e.serverMaxWindowBits),"number"==typeof e.clientMaxWindowBits?n.client_max_window_bits=e.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==e.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(t){const e=t[0];if(!1===this._options.clientNoContextTakeover&&e.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(e.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&e.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(e.client_max_window_bits=this._options.clientMaxWindowBits);return e}normalizeParams(t){return t.forEach((t=>{Object.keys(t).forEach((e=>{let n=t[e];if(n.length>1)throw new Error(`Parameter "${e}" must have only a single value`);if(n=n[0],"client_max_window_bits"===e){if(!0!==n){const t=+n;if(!Number.isInteger(t)||t<8||t>15)throw new TypeError(`Invalid value for parameter "${e}": ${n}`);n=t}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${e}": ${n}`)}else if("server_max_window_bits"===e){const t=+n;if(!Number.isInteger(t)||t<8||t>15)throw new TypeError(`Invalid value for parameter "${e}": ${n}`);n=t}else{if("client_no_context_takeover"!==e&&"server_no_context_takeover"!==e)throw new Error(`Unknown parameter "${e}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${e}": ${n}`)}t[e]=n}))})),t}decompress(t,e,n){wi.add((r=>{this._decompress(t,e,((t,e)=>{r(),n(t,e)}))}))}compress(t,e,n){wi.add((r=>{this._compress(t,e,((t,e)=>{r(),n(t,e)}))}))}_decompress(t,e,n){const r=this._isServer?"client":"server";if(!this._inflate){const t=`${r}_max_window_bits`,e="number"!=typeof this.params[t]?c.Z_DEFAULT_WINDOWBITS:this.params[t];this._inflate=c.createInflateRaw({...this._options.zlibInflateOptions,windowBits:e}),this._inflate[vi]=this,this._inflate[mi]=0,this._inflate[yi]=[],this._inflate.on("error",Ai),this._inflate.on("data",Si)}this._inflate[bi]=n,this._inflate.write(t),e&&this._inflate.write(fi),this._inflate.flush((()=>{const t=this._inflate[gi];if(t)return this._inflate.close(),this._inflate=null,void n(t);const o=ci.concat(this._inflate[yi],this._inflate[mi]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[mi]=0,this._inflate[yi]=[],e&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),n(null,o)}))}_compress(t,e,n){const r=this._isServer?"server":"client";if(!this._deflate){const t=`${r}_max_window_bits`,e="number"!=typeof this.params[t]?c.Z_DEFAULT_WINDOWBITS:this.params[t];this._deflate=c.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:e}),this._deflate[mi]=0,this._deflate[yi]=[],this._deflate.on("data",ji)}this._deflate[bi]=n,this._deflate.write(t),this._deflate.flush(c.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let t=ci.concat(this._deflate[yi],this._deflate[mi]);e&&(t=t.slice(0,t.length-4)),this._deflate[bi]=null,this._deflate[mi]=0,this._deflate[yi]=[],e&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),n(null,t)}))}};function ji(t){this[yi].push(t),this[mi]+=t.length}function Si(t){this[mi]+=t.length,this[vi]._maxPayload<1||this[mi]<=this[vi]._maxPayload?this[yi].push(t):(this[gi]=new RangeError("Max payload size exceeded"),this[gi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[gi][pi]=1009,this.removeListener("data",Si),this.reset())}function Ai(t){this[vi]._inflate=null,t[pi]=1007,this[bi](t)}var Ei=function(t){const e=t.length;let n=0;for(;n<e;)if(0==(128&t[n]))n++;else if(192==(224&t[n])){if(n+1===e||128!=(192&t[n+1])||192==(254&t[n]))return!1;n+=2}else if(224==(240&t[n])){if(n+2>=e||128!=(192&t[n+1])||128!=(192&t[n+2])||224===t[n]&&128==(224&t[n+1])||237===t[n]&&160==(224&t[n+1]))return!1;n+=3}else{if(240!=(248&t[n]))return!1;if(n+3>=e||128!=(192&t[n+1])||128!=(192&t[n+2])||128!=(192&t[n+3])||240===t[n]&&128==(240&t[n+1])||244===t[n]&&t[n+1]>143||t[n]>244)return!1;n+=4}return!0},Ci=Wn((function(t){try{t.exports=Zo(__dirname)}catch(e){t.exports=Ei}})),xi=Wn((function(t){const e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function n(t){return t>=1e3&&t<=1014&&1004!==t&&1005!==t&&1006!==t||t>=3e3&&t<=4999}function r(t){const e=t.length;let n=0;for(;n<e;)if(0==(128&t[n]))n++;else if(192==(224&t[n])){if(n+1===e||128!=(192&t[n+1])||192==(254&t[n]))return!1;n+=2}else if(224==(240&t[n])){if(n+2>=e||128!=(192&t[n+1])||128!=(192&t[n+2])||224===t[n]&&128==(224&t[n+1])||237===t[n]&&160==(224&t[n+1]))return!1;n+=3}else{if(240!=(248&t[n]))return!1;if(n+3>=e||128!=(192&t[n+1])||128!=(192&t[n+2])||128!=(192&t[n+3])||240===t[n]&&128==(240&t[n+1])||244===t[n]&&t[n+1]>143||t[n]>244)return!1;n+=4}return!0}try{const o=Ci;t.exports={isValidStatusCode:n,isValidUTF8:t=>t.length<150?r(t):o(t),tokenChars:e}}catch(o){t.exports={isValidStatusCode:n,isValidUTF8:r,tokenChars:e}}}));xi.isValidStatusCode,xi.isValidUTF8,xi.tokenChars;const{Writable:Oi}=n,{BINARY_TYPES:Ii,EMPTY_BUFFER:ki,kStatusCode:Ui,kWebSocket:Di}=Ro,{concat:Pi,toArrayBuffer:Bi,unmask:Ni}=ci,{isValidStatusCode:Ti,isValidUTF8:Li}=xi;var Fi=class extends Oi{constructor(t={}){super(),this._binaryType=t.binaryType||Ii[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=0|t.maxPayload,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Di]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(t,e,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){const e=this._buffers[0];return this._buffers[0]=e.slice(t),e.slice(0,t)}const e=Buffer.allocUnsafe(t);do{const n=this._buffers[0],r=e.length-t;t>=n.length?e.set(this._buffers.shift(),r):(e.set(new Uint8Array(n.buffer,n.byteOffset,t),r),this._buffers[0]=n.slice(t)),t-=n.length}while(t>0);return e}startLoop(t){let e;this._loop=!0;do{switch(this._state){case 0:e=this.getInfo();break;case 1:e=this.getPayloadLength16();break;case 2:e=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:e=this.getData(t);break;default:return void(this._loop=!1)}}while(this._loop);t(e)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const t=this.consume(2);if(0!=(48&t[0]))return this._loop=!1,Ri(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");const e=64==(64&t[0]);if(e&&!this._extensions[_i.extensionName])return this._loop=!1,Ri(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=128==(128&t[0]),this._opcode=15&t[0],this._payloadLength=127&t[1],0===this._opcode){if(e)return this._loop=!1,Ri(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Ri(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,Ri(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=e}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,Ri(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin)return this._loop=!1,Ri(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(e)return this._loop=!1,Ri(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,Ri(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&t[1]),this._isServer){if(!this._masked)return this._loop=!1,Ri(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Ri(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const t=this.consume(8),e=t.readUInt32BE(0);return e>Math.pow(2,21)-1?(this._loop=!1,Ri(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=e*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Ri(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(t){let e=ki;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);e=this.consume(this._payloadLength),this._masked&&0!=(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])&&Ni(e,this._mask)}return this._opcode>7?this.controlMessage(e):this._compressed?(this._state=5,void this.decompress(e,t)):(e.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(e)),this.dataMessage())}decompress(t,e){this._extensions[_i.extensionName].decompress(t,this._fin,((t,n)=>{if(t)return e(t);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return e(Ri(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(n)}const r=this.dataMessage();if(r)return e(r);this.startLoop(e)}))}dataMessage(){if(this._fin){const t=this._messageLength,e=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let n;n="nodebuffer"===this._binaryType?Pi(e,t):"arraybuffer"===this._binaryType?Bi(Pi(e,t)):e,this.emit("message",n,!0)}else{const n=Pi(e,t);if(!this._skipUTF8Validation&&!Li(n))return this._loop=!1,Ri(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n,!1)}}this._state=0}controlMessage(t){if(8===this._opcode)if(this._loop=!1,0===t.length)this.emit("conclude",1005,ki),this.end();else{if(1===t.length)return Ri(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{const e=t.readUInt16BE(0);if(!Ti(e))return Ri(RangeError,`invalid status code ${e}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");const n=t.slice(2);if(!this._skipUTF8Validation&&!Li(n))return Ri(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",e,n),this.end()}}else 9===this._opcode?this.emit("ping",t):this.emit("pong",t);this._state=0}};function Ri(t,e,n,r,o){const i=new t(n?`Invalid WebSocket frame: ${e}`:e);return Error.captureStackTrace(i,Ri),i.code=o,i[Ui]=r,i}const{randomFillSync:Mi}=g,{EMPTY_BUFFER:Wi}=Ro,{isValidStatusCode:qi}=xi,{mask:zi,toBuffer:$i}=ci,Gi=Symbol("kByteLength"),Hi=Buffer.alloc(4);class Vi{constructor(t,e,n){this._extensions=e||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,e){let n,r,o=!1,i=2,s=!1;e.mask&&(n=e.maskBuffer||Hi,e.generateMask?e.generateMask(n):Mi(n,0,4),s=0==(n[0]|n[1]|n[2]|n[3]),i=6),"string"==typeof t?r=e.mask&&!s||void 0===e[Gi]?(t=Buffer.from(t)).length:e[Gi]:(r=t.length,o=e.mask&&e.readOnly&&!s);let a=r;r>=65536?(i+=8,a=127):r>125&&(i+=2,a=126);const u=Buffer.allocUnsafe(o?r+i:i);return u[0]=e.fin?128|e.opcode:e.opcode,e.rsv1&&(u[0]|=64),u[1]=a,126===a?u.writeUInt16BE(r,2):127===a&&(u[2]=u[3]=0,u.writeUIntBE(r,4,6)),e.mask?(u[1]|=128,u[i-4]=n[0],u[i-3]=n[1],u[i-2]=n[2],u[i-1]=n[3],s?[u,t]:o?(zi(t,n,u,i,r),[u]):(zi(t,n,t,0,r),[u,t])):[u,t]}close(t,e,n,r){let o;if(void 0===t)o=Wi;else{if("number"!=typeof t||!qi(t))throw new TypeError("First argument must be a valid error code number");if(void 0!==e&&e.length){const n=Buffer.byteLength(e);if(n>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+n),o.writeUInt16BE(t,0),"string"==typeof e?o.write(e,2):o.set(e,2)}else o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0)}const i={[Gi]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,i,r]):this.sendFrame(Vi.frame(o,i),r)}ping(t,e,n){let r,o;if("string"==typeof t?(r=Buffer.byteLength(t),o=!1):(r=(t=$i(t)).length,o=$i.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const i={[Gi]:r,fin:!0,generateMask:this._generateMask,mask:e,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,i,n]):this.sendFrame(Vi.frame(t,i),n)}pong(t,e,n){let r,o;if("string"==typeof t?(r=Buffer.byteLength(t),o=!1):(r=(t=$i(t)).length,o=$i.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const i={[Gi]:r,fin:!0,generateMask:this._generateMask,mask:e,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,i,n]):this.sendFrame(Vi.frame(t,i),n)}send(t,e,n){const r=this._extensions[_i.extensionName];let o,i,s=e.binary?2:1,a=e.compress;if("string"==typeof t?(o=Buffer.byteLength(t),i=!1):(o=(t=$i(t)).length,i=$i.readOnly),this._firstFragment?(this._firstFragment=!1,a&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=o>=r._threshold),this._compress=a):(a=!1,s=0),e.fin&&(this._firstFragment=!0),r){const r={[Gi]:o,fin:e.fin,generateMask:this._generateMask,mask:e.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:i,rsv1:a};this._deflating?this.enqueue([this.dispatch,t,this._compress,r,n]):this.dispatch(t,this._compress,r,n)}else this.sendFrame(Vi.frame(t,{[Gi]:o,fin:e.fin,generateMask:this._generateMask,mask:e.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:i,rsv1:!1}),n)}dispatch(t,e,n,r){if(!e)return void this.sendFrame(Vi.frame(t,n),r);const o=this._extensions[_i.extensionName];this._bufferedBytes+=n[Gi],this._deflating=!0,o.compress(t,n.fin,((t,e)=>{if(this._socket.destroyed){const t=new Error("The socket was closed while data was being compressed");"function"==typeof r&&r(t);for(let e=0;e<this._queue.length;e++){const n=this._queue[e],r=n[n.length-1];"function"==typeof r&&r(t)}}else this._bufferedBytes-=n[Gi],this._deflating=!1,n.readOnly=!1,this.sendFrame(Vi.frame(e,n),r),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const t=this._queue.shift();this._bufferedBytes-=t[3][Gi],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Gi],this._queue.push(t)}sendFrame(t,e){2===t.length?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],e),this._socket.uncork()):this._socket.write(t[0],e)}}var Ji=Vi;const{kForOnEventAttribute:Yi,kListener:Zi}=Ro,Ki=Symbol("kCode"),Xi=Symbol("kData"),Qi=Symbol("kError"),ts=Symbol("kMessage"),es=Symbol("kReason"),ns=Symbol("kTarget"),rs=Symbol("kType"),os=Symbol("kWasClean");class is{constructor(t){this[ns]=null,this[rs]=t}get target(){return this[ns]}get type(){return this[rs]}}Object.defineProperty(is.prototype,"target",{enumerable:!0}),Object.defineProperty(is.prototype,"type",{enumerable:!0});class ss extends is{constructor(t,e={}){super(t),this[Ki]=void 0===e.code?0:e.code,this[es]=void 0===e.reason?"":e.reason,this[os]=void 0!==e.wasClean&&e.wasClean}get code(){return this[Ki]}get reason(){return this[es]}get wasClean(){return this[os]}}Object.defineProperty(ss.prototype,"code",{enumerable:!0}),Object.defineProperty(ss.prototype,"reason",{enumerable:!0}),Object.defineProperty(ss.prototype,"wasClean",{enumerable:!0});class as extends is{constructor(t,e={}){super(t),this[Qi]=void 0===e.error?null:e.error,this[ts]=void 0===e.message?"":e.message}get error(){return this[Qi]}get message(){return this[ts]}}Object.defineProperty(as.prototype,"error",{enumerable:!0}),Object.defineProperty(as.prototype,"message",{enumerable:!0});class us extends is{constructor(t,e={}){super(t),this[Xi]=void 0===e.data?null:e.data}get data(){return this[Xi]}}Object.defineProperty(us.prototype,"data",{enumerable:!0});const cs={addEventListener(t,e,n={}){let r;if("message"===t)r=function(t,n){const r=new us("message",{data:n?t:t.toString()});r[ns]=this,e.call(this,r)};else if("close"===t)r=function(t,n){const r=new ss("close",{code:t,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[ns]=this,e.call(this,r)};else if("error"===t)r=function(t){const n=new as("error",{error:t,message:t.message});n[ns]=this,e.call(this,n)};else{if("open"!==t)return;r=function(){const t=new is("open");t[ns]=this,e.call(this,t)}}r[Yi]=!!n[Yi],r[Zi]=e,n.once?this.once(t,r):this.on(t,r)},removeEventListener(t,e){for(const n of this.listeners(t))if(n[Zi]===e&&!n[Yi]){this.removeListener(t,n);break}}};var ls={CloseEvent:ss,ErrorEvent:as,Event:is,EventTarget:cs,MessageEvent:us};const{tokenChars:hs}=xi;function ds(t,e,n){void 0===t[e]?t[e]=[n]:t[e].push(n)}var ps={format:function(t){return Object.keys(t).map((e=>{let n=t[e];return Array.isArray(n)||(n=[n]),n.map((t=>[e].concat(Object.keys(t).map((e=>{let n=t[e];return Array.isArray(n)||(n=[n]),n.map((t=>!0===t?e:`${e}=${t}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(t){const e=Object.create(null);let n,r,o=Object.create(null),i=!1,s=!1,a=!1,u=-1,c=-1,l=-1,h=0;for(;h<t.length;h++)if(c=t.charCodeAt(h),void 0===n)if(-1===l&&1===hs[c])-1===u&&(u=h);else if(0===h||32!==c&&9!==c){if(59!==c&&44!==c)throw new SyntaxError(`Unexpected character at index ${h}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${h}`);-1===l&&(l=h);const r=t.slice(u,l);44===c?(ds(e,r,o),o=Object.create(null)):n=r,u=l=-1}}else-1===l&&-1!==u&&(l=h);else if(void 0===r)if(-1===l&&1===hs[c])-1===u&&(u=h);else if(32===c||9===c)-1===l&&-1!==u&&(l=h);else if(59===c||44===c){if(-1===u)throw new SyntaxError(`Unexpected character at index ${h}`);-1===l&&(l=h),ds(o,t.slice(u,l),!0),44===c&&(ds(e,n,o),o=Object.create(null),n=void 0),u=l=-1}else{if(61!==c||-1===u||-1!==l)throw new SyntaxError(`Unexpected character at index ${h}`);r=t.slice(u,h),u=l=-1}else if(s){if(1!==hs[c])throw new SyntaxError(`Unexpected character at index ${h}`);-1===u?u=h:i||(i=!0),s=!1}else if(a)if(1===hs[c])-1===u&&(u=h);else if(34===c&&-1!==u)a=!1,l=h;else{if(92!==c)throw new SyntaxError(`Unexpected character at index ${h}`);s=!0}else if(34===c&&61===t.charCodeAt(h-1))a=!0;else if(-1===l&&1===hs[c])-1===u&&(u=h);else if(-1===u||32!==c&&9!==c){if(59!==c&&44!==c)throw new SyntaxError(`Unexpected character at index ${h}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${h}`);-1===l&&(l=h);let s=t.slice(u,l);i&&(s=s.replace(/\\/g,""),i=!1),ds(o,r,s),44===c&&(ds(e,n,o),o=Object.create(null),n=void 0),r=void 0,u=l=-1}}else-1===l&&(l=h);if(-1===u||a||32===c||9===c)throw new SyntaxError("Unexpected end of input");-1===l&&(l=h);const d=t.slice(u,l);return void 0===n?ds(e,d,o):(void 0===r?ds(o,d,!0):ds(o,r,i?d.replace(/\\/g,""):d),ds(e,n,o)),e}};const{randomBytes:fs,createHash:vs}=g,{URL:ms}=i,{BINARY_TYPES:bs,EMPTY_BUFFER:ys,GUID:gs,kForOnEventAttribute:ws,kListener:_s,kStatusCode:js,kWebSocket:Ss,NOOP:As}=Ro,{EventTarget:{addEventListener:Es,removeEventListener:Cs}}=ls,{format:xs,parse:Os}=ps,{toBuffer:Is}=ci,ks=["CONNECTING","OPEN","CLOSING","CLOSED"],Us=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ds=[8,13];class Ps extends t{constructor(t,e,n){super(),this._binaryType=bs[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ys,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=Ps.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==t?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===e?e=[]:Array.isArray(e)||("object"==typeof e&&null!==e?(n=e,e=[]):e=[e]),Ns(this,t,e,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){bs.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,e,n){const r=new Fi({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation});this._sender=new Ji(t,this._extensions,n.generateMask),this._receiver=r,this._socket=t,r[Ss]=this,t[Ss]=this,r.on("conclude",Ws),r.on("drain",qs),r.on("error",zs),r.on("message",Gs),r.on("ping",Hs),r.on("pong",Vs),t.setTimeout(0),t.setNoDelay(),e.length>0&&t.unshift(e),t.on("close",Ys),t.on("data",Zs),t.on("end",Ks),t.on("error",Xs),this._readyState=Ps.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=Ps.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[_i.extensionName]&&this._extensions[_i.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=Ps.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,e){if(this.readyState!==Ps.CLOSED){if(this.readyState===Ps.CONNECTING){const t="WebSocket was closed before the connection was established";return Rs(this,this._req,t)}this.readyState!==Ps.CLOSING?(this._readyState=Ps.CLOSING,this._sender.close(t,e,!this._isServer,(t=>{t||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())})),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end()}}pause(){this.readyState!==Ps.CONNECTING&&this.readyState!==Ps.CLOSED&&(this._paused=!0,this._socket.pause())}ping(t,e,n){if(this.readyState===Ps.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(n=t,t=e=void 0):"function"==typeof e&&(n=e,e=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===Ps.OPEN?(void 0===e&&(e=!this._isServer),this._sender.ping(t||ys,e,n)):Ms(this,t,n)}pong(t,e,n){if(this.readyState===Ps.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(n=t,t=e=void 0):"function"==typeof e&&(n=e,e=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===Ps.OPEN?(void 0===e&&(e=!this._isServer),this._sender.pong(t||ys,e,n)):Ms(this,t,n)}resume(){this.readyState!==Ps.CONNECTING&&this.readyState!==Ps.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,e,n){if(this.readyState===Ps.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof e&&(n=e,e={}),"number"==typeof t&&(t=t.toString()),this.readyState!==Ps.OPEN)return void Ms(this,t,n);const r={binary:"string"!=typeof t,mask:!this._isServer,compress:!0,fin:!0,...e};this._extensions[_i.extensionName]||(r.compress=!1),this._sender.send(t||ys,r,n)}terminate(){if(this.readyState!==Ps.CLOSED){if(this.readyState===Ps.CONNECTING){const t="WebSocket was closed before the connection was established";return Rs(this,this._req,t)}this._socket&&(this._readyState=Ps.CLOSING,this._socket.destroy())}}}Object.defineProperty(Ps,"CONNECTING",{enumerable:!0,value:ks.indexOf("CONNECTING")}),Object.defineProperty(Ps.prototype,"CONNECTING",{enumerable:!0,value:ks.indexOf("CONNECTING")}),Object.defineProperty(Ps,"OPEN",{enumerable:!0,value:ks.indexOf("OPEN")}),Object.defineProperty(Ps.prototype,"OPEN",{enumerable:!0,value:ks.indexOf("OPEN")}),Object.defineProperty(Ps,"CLOSING",{enumerable:!0,value:ks.indexOf("CLOSING")}),Object.defineProperty(Ps.prototype,"CLOSING",{enumerable:!0,value:ks.indexOf("CLOSING")}),Object.defineProperty(Ps,"CLOSED",{enumerable:!0,value:ks.indexOf("CLOSED")}),Object.defineProperty(Ps.prototype,"CLOSED",{enumerable:!0,value:ks.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((t=>{Object.defineProperty(Ps.prototype,t,{enumerable:!0})})),["open","error","close","message"].forEach((t=>{Object.defineProperty(Ps.prototype,`on${t}`,{enumerable:!0,get(){for(const e of this.listeners(t))if(e[ws])return e[_s];return null},set(e){for(const e of this.listeners(t))if(e[ws]){this.removeListener(t,e);break}"function"==typeof e&&this.addEventListener(t,e,{[ws]:!0})}})})),Ps.prototype.addEventListener=Es,Ps.prototype.removeEventListener=Cs;var Bs=Ps;function Ns(t,e,n,r){const i={protocolVersion:Ds[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!Ds.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Ds.join(", ")})`);let s;if(e instanceof ms)s=e,t._url=e.href;else{try{s=new ms(e)}catch(t){throw new SyntaxError(`Invalid URL: ${e}`)}t._url=e}const a="wss:"===s.protocol,c="ws+unix:"===s.protocol;let l;if("ws:"===s.protocol||a||c?c&&!s.pathname?l="The URL's pathname is empty":s.hash&&(l="The URL contains a fragment identifier"):l='The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"',l){const e=new SyntaxError(l);if(0===t._redirects)throw e;return void Ts(t,e)}const h=a?443:80,d=fs(16).toString("base64"),p=a?u.get:o.get,f=new Set;let v;if(i.createConnection=a?Fs:Ls,i.defaultPort=i.defaultPort||h,i.port=s.port||h,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket",...i.headers},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(v=new _i(!0!==i.perMessageDeflate?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=xs({[_i.extensionName]:v.offer()})),n.length){for(const t of n){if("string"!=typeof t||!Us.test(t)||f.has(t))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(t)}i.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),c){const t=i.path.split(":");i.socketPath=t[0],i.path=t[1]}if(i.followRedirects){if(0===t._redirects){t._originalHost=s.host;const e=r&&r.headers;if(r={...r,headers:{}},e)for(const[t,n]of Object.entries(e))r.headers[t.toLowerCase()]=n}else s.host!==t._originalHost&&(delete i.headers.authorization,delete i.headers.cookie,delete i.headers.host,i.auth=void 0);i.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64"))}let m=t._req=p(i);i.timeout&&m.on("timeout",(()=>{Rs(t,m,"Opening handshake has timed out")})),m.on("error",(e=>{null===m||m.aborted||(m=t._req=null,Ts(t,e))})),m.on("response",(o=>{const s=o.headers.location,a=o.statusCode;if(s&&i.followRedirects&&a>=300&&a<400){if(++t._redirects>i.maxRedirects)return void Rs(t,m,"Maximum redirects exceeded");let o;m.abort();try{o=new ms(s,e)}catch(e){const n=new SyntaxError(`Invalid URL: ${s}`);return void Ts(t,n)}Ns(t,o,n,r)}else t.emit("unexpected-response",m,o)||Rs(t,m,`Unexpected server response: ${o.statusCode}`)})),m.on("upgrade",((e,n,r)=>{if(t.emit("upgrade",e),t.readyState!==Ps.CONNECTING)return;m=t._req=null;const o=vs("sha1").update(d+gs).digest("base64");if(e.headers["sec-websocket-accept"]!==o)return void Rs(t,n,"Invalid Sec-WebSocket-Accept header");const s=e.headers["sec-websocket-protocol"];let a;if(void 0!==s?f.size?f.has(s)||(a="Server sent an invalid subprotocol"):a="Server sent a subprotocol but none was requested":f.size&&(a="Server sent no subprotocol"),a)return void Rs(t,n,a);s&&(t._protocol=s);const u=e.headers["sec-websocket-extensions"];if(void 0!==u){if(!v){return void Rs(t,n,"Server sent a Sec-WebSocket-Extensions header but no extension was requested")}let e;try{e=Os(u)}catch(e){return void Rs(t,n,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(e);if(1!==r.length||r[0]!==_i.extensionName){return void Rs(t,n,"Server indicated an extension that was not requested")}try{v.accept(e[_i.extensionName])}catch(e){return void Rs(t,n,"Invalid Sec-WebSocket-Extensions header")}t._extensions[_i.extensionName]=v}t.setSocket(n,r,{generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}))}function Ts(t,e){t._readyState=Ps.CLOSING,t.emit("error",e),t.emitClose()}function Ls(t){return t.path=t.socketPath,d.connect(t)}function Fs(t){return t.path=void 0,t.servername||""===t.servername||(t.servername=d.isIP(t.host)?"":t.host),y.connect(t)}function Rs(t,e,n){t._readyState=Ps.CLOSING;const r=new Error(n);Error.captureStackTrace(r,Rs),e.setHeader?(e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),e.once("abort",t.emitClose.bind(t)),t.emit("error",r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Ms(t,e,n){if(e){const n=Is(e).length;t._socket?t._sender._bufferedBytes+=n:t._bufferedAmount+=n}if(n){n(new Error(`WebSocket is not open: readyState ${t.readyState} (${ks[t.readyState]})`))}}function Ws(t,e){const n=this[Ss];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,void 0!==n._socket[Ss]&&(n._socket.removeListener("data",Zs),process.nextTick(Js,n._socket),1005===t?n.close():n.close(t,e))}function qs(){const t=this[Ss];t.isPaused||t._socket.resume()}function zs(t){const e=this[Ss];void 0!==e._socket[Ss]&&(e._socket.removeListener("data",Zs),process.nextTick(Js,e._socket),e.close(t[js])),e.emit("error",t)}function $s(){this[Ss].emitClose()}function Gs(t,e){this[Ss].emit("message",t,e)}function Hs(t){const e=this[Ss];e.pong(t,!e._isServer,As),e.emit("ping",t)}function Vs(t){this[Ss].emit("pong",t)}function Js(t){t.resume()}function Ys(){const t=this[Ss];let e;this.removeListener("close",Ys),this.removeListener("data",Zs),this.removeListener("end",Ks),t._readyState=Ps.CLOSING,this._readableState.endEmitted||t._closeFrameReceived||t._receiver._writableState.errorEmitted||null===(e=t._socket.read())||t._receiver.write(e),t._receiver.end(),this[Ss]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",$s),t._receiver.on("finish",$s))}function Zs(t){this[Ss]._receiver.write(t)||this.pause()}function Ks(){const t=this[Ss];t._readyState=Ps.CLOSING,t._receiver.end(),this.end()}function Xs(){const t=this[Ss];this.removeListener("error",Xs),this.on("error",As),t&&(t._readyState=Ps.CLOSING,this.destroy())}var Qs=function(t){function e(e,n,r,o,i){void 0===i&&(i=5e3);var s=t.call(this)||this;s.endpoint=e,s.headers=n,s.rewriteHostHeader=r,s.bindToAssign=o,s.closeTimeout=i,s.protocol="TCP",s.openConnections=new Set,s.tcpServer=h.createServer(s.handleConnection.bind(s));var a=null==r?void 0:r.altHostnames.map((function(t){return(e=_e(e=t))&&Pn.test(e)?e.replace(Dn,"\\$&"):e;var e})).join("|");return s.hostRegex=new RegExp("Host: (?:".concat(a,")(:.*$|$)"),"im"),s}return j(e,t),Object.defineProperty(e.prototype,"bindTo",{get:function(){var t;return null!==(t=this.boundTo)&&void 0!==t?t:this.bindToAssign},enumerable:!1,configurable:!0}),e.prototype.open=function(){return A(this,void 0,void 0,(function(){var t=this;return E(this,(function(e){return[2,new Promise((function(e){if(t.bindToAssign){var n=t.bindToAssign,r=n.port,o=n.address;t.tcpServer.listen(r,o,(function(){t.emit("tunnel-open",{address:o,port:r}),e({address:o,port:r})}))}else t.tcpServer.listen(0,(function(){var n=t.tcpServer.address(),r=n.address,o=n.port,i="0.0.0.0"===r||"::"===r?"127.0.0.1":r;t.boundTo={address:i,port:o},t.emit("tunnel-open",t.boundTo),e(t.boundTo)}))}))]}))}))},e.prototype.close=function(){return A(this,void 0,void 0,(function(){var t,e=this;return E(this,(function(n){switch(n.label){case 0:return t=!1,[4,Promise.race([new Promise((function(n){e.tcpServer.close((function(){t=!0,e.emit("tunnel-close"),n()}))})),new Promise((function(n){new Promise((function(t){return setTimeout(t,e.closeTimeout)})).then((function(){t||(e.openConnections.forEach((function(t){t.destroy(),e.openConnections.delete(t)})),n())}))}))])];case 1:return n.sent(),[2]}}))}))},e.prototype.handleConnection=function(t){var e=this;this.openConnections.add(t);var n=new Bs(this.endpoint.replace("https:","wss:"),{headers:this.headers}),r=Fo(n),o=this.getHeaderTransform();this.rewriteHostHeader&&o?Po(t,o,r):Po(t,r),Po(r,t),n.on("close",(function(t,n,r){e.emit("connection-close",t,n,r)})),r.on("error",(function(t){e.emit("connection-error",t)})),t.on("error",(function(t){e.emit("connection-error",t)})),this.emit("connection-accept")},e.prototype.getHeaderTransform=function(){if(this.rewriteHostHeader){var t=this.rewriteHostHeader.targetHostname,e=this.hostRegex;return new r({transform:function(n,r,o){var i=n.toString();if(i.split("\n",1)[0].includes("HTTP")){var s=i.replace(e,"Host: ".concat(t));o(null,Buffer.from(s))}else o(null,n)}})}},e}(e),ta=function(t){function e(e,n,r){var o=t.call(this)||this;return o.endpoint=e,o.headers=n,o.bindToAssign=r,o.protocol="UDP",o.udpSocket=w.createSocket("udp4"),o.handleConnection(),o}return j(e,t),Object.defineProperty(e.prototype,"bindTo",{get:function(){return this.boundTo},enumerable:!1,configurable:!0}),e.prototype.open=function(){return A(this,void 0,void 0,(function(){var t=this;return E(this,(function(e){return[2,new Promise((function(e){if(t.bindToAssign){var n=t.bindToAssign,r=n.port,o=n.address;t.udpSocket.bind(r,o,(function(){t.emit("tunnel-open",{address:o,port:r}),e({address:o,port:r})}))}else t.udpSocket.bind(0,(function(){var n=t.udpSocket.address(),r=n.address,o=n.port,i="0.0.0.0"===r||"::"===r?"127.0.0.1":r;t.boundTo={address:i,port:o},t.emit("tunnel-open",t.boundTo),e(t.boundTo)}))}))]}))}))},e.prototype.close=function(){return A(this,void 0,void 0,(function(){var t=this;return E(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){t.udpSocket.close((function(){t.emit("tunnel-close"),e()}))}))];case 1:return e.sent(),[2]}}))}))},e.prototype.handleConnection=function(){var t,e=this,n=new Bs(this.endpoint.replace("https:","wss:"),{headers:this.headers}),r=Fo(n);this.udpSocket.on("message",(function(e,n){t=n,r.write(e)})),r.on("data",(function(n){t&&e.udpSocket.send(n,t.port,t.address,(function(t){t&&e.emit("connection-error",t)}))})),this.udpSocket.on("error",(function(t){e.emit("connection-error",t)})),r.on("error",(function(t){e.emit("connection-error",t)})),n.on("connection-close",(function(t,n,r){e.emit("connection-close",t,n,r)})),n.on("connection-error",(function(t){e.emit("connection-error",t)})),this.emit("connection-accept")},e}(e);var ea="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,na=function(t,e){return A(void 0,void 0,void 0,(function(){var n;return E(this,(function(r){return n=Promise.resolve([]),[2,t.reduce((function(t,n){return t.then((function(t){return e(n).then((function(e){return t.push(e),t}))}))}),n)]}))}))},ra=function(t){function e(e,n,r){var o=t.call(this)||this;return o.contextProvider=e,o.listServices=n,o.listAddons=r,o.connections=[],o.hostsFileMutex=new yo,o.ipAllocationMutex=new yo,o.stopForwarding=function(t){return A(o,void 0,void 0,(function(){var e,n,r,o,i,s;return E(this,(function(a){switch(a.label){case 0:return[4,t.tunnel.close()];case 1:return a.sent(),e=t.forwardingContext,n=e.projectId,r=e.type,o=e.id,(i=e.hostnames).length>0?[4,this.unregisterHostnames(null===(s=t.tunnel.bindTo)||void 0===s?void 0:s.address,i)]:[3,3];case 2:a.sent(),a.label=3;case 3:return this.connections.splice(this.connections.findIndex((function(t){var e=t.forwardingContext,i=e.type,s=e.id,a=e.projectId;return s===o&&a===n&&i===r})),1),[2]}}))}))},o.canExecuteWithHostnames=function(){return"win32"!==process.platform?process.getuid&&0!==process.getuid()?{error:!0,message:"You are not running this command with sufficient privileges (uid=".concat(process.getuid(),"). Try running with 'sudo'.")}:{error:!1,type:"unix-admin"}:function(){try{return v("fsutil dirty query %systemdrive%"),!0}catch(t){if("ENOENT"===t.code)try{return v("fltmc"),!0}catch(t){return!1}return!1}}()?{error:!1,type:"windows-admin"}:{error:!0,message:"You are not running this command as administrator. Please start command line with admin rights."}},o.assertStartedWithNodejs=function(){if(!ea)throw new Error("Port forwarding only possible when started with nodejs")},o.proxyApiClient=new Zr(e),o}return j(e,t),e.prototype.withProjectForwarding=function(t,e,n){return void 0===n&&(n=!0),A(this,void 0,void 0,(function(){var r;return E(this,(function(o){switch(o.label){case 0:return[4,this.forwardProject(t,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,e(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopProjectForwarding(t)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},e.prototype.forwardProject=function(t,e){return void 0===e&&(e=!0),A(this,void 0,void 0,(function(){var n,r,o,i,s,a=this;return E(this,(function(u){switch(u.label){case 0:return this.assertStartedWithNodejs(),n=t.projectId,[4,this.listServices({parameters:{projectId:n}})];case 1:return r=u.sent(),[4,this.listAddons({parameters:{projectId:n}})];case 2:return o=u.sent(),[4,Promise.all(r.data.services.map((function(t){return A(a,void 0,void 0,(function(){return E(this,(function(r){return[2,this.forwardService({projectId:n,serviceId:t.id},e)]}))}))})))];case 3:return i=u.sent(),[4,Promise.all(o.data.addons.map((function(t){return A(a,void 0,void 0,(function(){return E(this,(function(r){switch(r.label){case 0:return[4,this.forwardAddon({projectId:n,addonId:t.id},e)];case 1:return[2,r.sent()]}}))}))})))];case 4:return s=u.sent(),[2,{services:i,addons:s}]}}))}))},e.prototype.withServiceForwarding=function(t,e,n){return void 0===n&&(n=!0),A(this,void 0,void 0,(function(){var r;return E(this,(function(o){switch(o.label){case 0:return[4,this.forwardService(t,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,e(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopServiceForwarding(t)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},e.prototype.forwardService=function(t,e){return void 0===e&&(e=!0),A(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c=this;return E(this,(function(l){switch(l.label){case 0:return this.assertStartedWithNodejs(),n=t.projectId,r=t.serviceId,[4,this.proxyApiClient.getServiceDetails(n,r)];case 1:return o=l.sent(),i=o.namespace,s=o.targetDomain,a=o.instances,u=o.ports,0===a.length?[2,[]]:[4,na(u,(function(t){var o,u="https://".concat(s,"/tunnel/projects/").concat(n,"/services/").concat(r,"/instance/").concat(a[0].podName,"/port/").concat(t.internalPort),l="".concat(r,".").concat(i,".svc.cluster.local"),h=["".concat(r)];t.name&&h.push("".concat(t.name,".").concat(r)),"HTTP"===t.protocol&&(o={altHostnames:h,targetHostname:l});var d=e?[]:C([l],h,!0);return c.forwardPort(u,t,d,"service",r,n,e,o)}))];case 2:return[2,l.sent()]}}))}))},e.prototype.withAddonForwarding=function(t,e,n){return void 0===n&&(n=!0),A(this,void 0,void 0,(function(){var r;return E(this,(function(o){switch(o.label){case 0:return[4,this.forwardAddon(t,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,e(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopAddonForwarding(t)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},e.prototype.forwardAddon=function(t,e){return void 0===e&&(e=!0),A(this,void 0,void 0,(function(){var n,r,o,i,s=this;return E(this,(function(a){switch(a.label){case 0:return this.assertStartedWithNodejs(),n=t.addonId,r=t.projectId,[4,this.proxyApiClient.getAddonDetails(r,n)];case 1:return o=a.sent(),i=o.instances.map((function(t){var e=t.podName,n=t.internalHostname;return t.ports.map((function(t){return{podName:e,internalHostname:n,port:t}}))})),[4,na((u=i,null!=u&&u.length?Oe(u,1/0):[]),(function(t){var i=t.podName,a=t.internalHostname,u=t.port;return A(s,void 0,void 0,(function(){var t;return E(this,(function(s){return t="https://".concat(o.targetDomain,"/tunnel/projects/").concat(r,"/addons/").concat(n,"/instance/").concat(i,"/port/").concat(u.internalPort),[2,this.forwardPort(t,u,e?[]:[a],"addon",n,r,e)]}))}))}))];case 2:return[2,a.sent()]}var u}))}))},e.prototype.allocateIpAddress=function(t){return A(this,void 0,void 0,(function(){var e=this;return E(this,(function(n){return[2,this.ipAllocationMutex.enter((function(){return A(e,void 0,void 0,(function(){var e,n,r,o,i;return E(this,(function(s){switch(s.label){case 0:return e="127.24.1.1",n="127.24.255.255",r=null!==(i=this.nextIpAddress)&&void 0!==i?i:e,[4,Kr(t,r,n)];case 1:return o=s.sent(),this.nextIpAddress=eo(to(o)+1),to(this.nextIpAddress)>to(n)&&(this.nextIpAddress=e),[2,o]}}))}))}))]}))}))},e.prototype.forwardPort=function(t,e,n,r,o,i,s,a){var u;return void 0===s&&(s=!0),A(this,void 0,void 0,(function(){var c,l,h,d,p,f,v=this;return E(this,(function(m){switch(m.label){case 0:if(c={Authorization:"Bearer ".concat(this.contextProvider.getCurrentToken())},!s&&(l=this.canExecuteWithHostnames()).error)throw new Error("".concat(l.message," Alternatively, you can use the ipOnly mode when port-forwarding (apiClient.forwarding.forwardAddon({ projectId, addonId }, true))"));return[4,this.determineSocketAddress(i,o,r,e,s)];case 1:return h=m.sent(),d="UDP"===e.protocol?new ta(t,c,h):new Qs(t,c,a,h),s?[3,3]:[4,this.registerHostnames(null===(u=d.bindTo)||void 0===u?void 0:u.address,n)];case 2:m.sent(),m.label=3;case 3:return d.on("connection-accept",(function(){return v.emit("connection-accept",d)})),d.on("connection-close",(function(){return A(v,void 0,void 0,(function(){return E(this,(function(t){return[2,this.emit("connection-close",d)]}))}))})),[4,d.open()];case 4:return p=m.sent(),f={projectId:i,id:o,type:r,hostnames:n,port:p.port,address:p.address,protocol:e.protocol,portName:e.name},this.emit("tunnel-open",d,f),d.on("connection-error",(function(t){return v.emit("connection-error",d,f,t)})),d.on("tunnel-close",(function(){return v.emit("tunnel-close",d,f)})),this.connections.push({tunnel:d,forwardingContext:f}),[2,{data:f}]}}))}))},e.prototype.determineSocketAddress=function(t,e,n,r,o){var i;return A(this,void 0,void 0,(function(){var s,a,u;return E(this,(function(c){switch(c.label){case 0:return o?[2,void 0]:(s=this.connections.find((function(r){return r.forwardingContext.projectId===t&&r.forwardingContext.id===e&&r.forwardingContext.type===n})),a=(null===(i=null==s?void 0:s.forwardingContext)||void 0===i?void 0:i.port)!==r.internalPort,s&&a?[2,{address:s.forwardingContext.address,port:r.internalPort}]:(u={},[4,this.allocateIpAddress(r.internalPort)]));case 1:return[2,(u.address=c.sent(),u.port=r.internalPort,u)]}}))}))},e.prototype.registerHostnames=function(t,e){return A(this,void 0,void 0,(function(){return E(this,(function(n){switch(n.label){case 0:return[4,this.modifyHostsFile((function(n){n.removeHosts.apply(n,e),n.add.apply(n,C([t],e,!1))}))];case 1:return n.sent(),[2]}}))}))},e.prototype.unregisterHostnames=function(t,e){return A(this,void 0,void 0,(function(){return E(this,(function(n){switch(n.label){case 0:return[4,this.modifyHostsFile((function(n){n.remove.apply(n,C([t],e,!1))}))];case 1:return n.sent(),[2]}}))}))},e.prototype.modifyHostsFile=function(t){return A(this,void 0,void 0,(function(){var e=this;return E(this,(function(n){switch(n.label){case 0:return[4,this.hostsFileMutex.enter((function(){return A(e,void 0,void 0,(function(){var e,n=this;return E(this,(function(r){switch(r.label){case 0:return[4,bo.load({header:"Northflank Proxy"})];case 1:return e=r.sent(),t(e),[4,e.backup({suffix:".backup-pre-northflank"})];case 2:r.sent(),r.label=3;case 3:return r.trys.push([3,5,,7]),[4,oa(5)((function(){return A(n,void 0,void 0,(function(){return E(this,(function(t){switch(t.label){case 0:return[4,e.write({writeMode:"atomic"})];case 1:return t.sent(),[2]}}))}))}))];case 4:return r.sent(),[3,7];case 5:return r.sent(),[4,oa(5)((function(){return A(n,void 0,void 0,(function(){return E(this,(function(t){switch(t.label){case 0:return[4,e.write({writeMode:"standard"})];case 1:return t.sent(),[2]}}))}))}))];case 6:return r.sent(),[3,7];case 7:return[2]}}))}))}))];case 1:return n.sent(),[2]}}))}))},e.prototype.stopProjectForwarding=function(t){return A(this,void 0,void 0,(function(){var e=this;return E(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(e){return e.forwardingContext.projectId===t.projectId})).map((function(t){return e.stopForwarding(t)})))];case 1:return n.sent(),[2]}}))}))},e.prototype.stopServiceForwarding=function(t){return A(this,void 0,void 0,(function(){var e=this;return E(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(e){return"service"===e.forwardingContext.type&&e.forwardingContext.projectId===t.projectId&&e.forwardingContext.id===t.serviceId})).map((function(t){return e.stopForwarding(t)})))];case 1:return n.sent(),[2]}}))}))},e.prototype.stopAddonForwarding=function(t){return A(this,void 0,void 0,(function(){var e=this;return E(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(e){return"addon"===e.forwardingContext.type&&e.forwardingContext.projectId===t.projectId&&e.forwardingContext.id===t.addonId})).map((function(t){return e.stopForwarding(t)})))];case 1:return n.sent(),[2]}}))}))},e.prototype.stop=function(){return A(this,void 0,void 0,(function(){var t=this;return E(this,(function(e){switch(e.label){case 0:return[4,Promise.all(this.connections.map((function(e){return A(t,void 0,void 0,(function(){return E(this,(function(t){return[2,this.stopForwarding(e)]}))}))})))];case 1:return e.sent(),[2]}}))}))},e}(e),oa=function(t,e){return void 0===e&&(e=50),function(n){var r=t,o=function(){return A(void 0,void 0,void 0,(function(){var t;return E(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,n()];case 1:return[2,i.sent()];case 2:if(t=i.sent(),r<=0)throw t;return r-=1,[4,new Promise((function(t){return setTimeout((function(){return t()}),e)}))];case 3:return i.sent(),[2,o()];case 4:return[2]}}))}))};return o()}},ia=ea?Yr:window.fetch,sa=function(){if(ea)try{return JSON.parse(m.readFileSync(b.join(b.dirname(s(import.meta.url)),"../../package.json")).toString())}catch(t){return console.log("Failed to check version of northflank CLI (".concat(t.message,")")),{}}return{}},aa=function(){function t(t,e){var n=this;this.opts=e,this.call=function(t){return A(n,void 0,void 0,(function(){var e,n,r,o,i,s,a,u,c,l,h,d,p=this;return E(this,(function(f){switch(f.label){case 0:if(e=this.method,n={method:e,headers:this.getDefaultHeaders()},!(r=null===(d=this.contextProvider)||void 0===d?void 0:d.getCurrentBaseUrl()))throw new Error("Api client context not correctly initialized, please provide a url to the context.");return o="".concat(r).concat(this.endpointUrl(t)),i=this.body(t),s=S(S({url:o},n),{body:i}),[4,ha(o,S(S({},n),{body:i}))];case 1:return[4,(a=f.sent()).text()];case 2:return u=f.sent(),c=function(){if(200!==a.status){var t=null==l?void 0:l.error,e=401===a.status?" (Make sure your API token has sufficient permissions)":"",n="".concat((null==t?void 0:t.message)||"").concat(e);if(p.opts.throwErrorOnHttpErrorCode)throw Error(n);return{status:a.status,message:n,id:null==t?void 0:t.id,details:null==t?void 0:t.details}}},l=function(){try{return JSON.parse(u)}catch(t){throw Error("Failed reading api request result: \n\tStatus: ".concat(a.statusText," (").concat(a.status,")\n\tMessage: ").concat(u))}}(),h=c(),[2,{data:null==l?void 0:l.data,rawResponse:a,request:s,error:h,pagination:null==l?void 0:l.pagination}]}}))}))},this.contextProvider=t}return t.prototype.getDefaultHeaders=function(){var t,e,n=this.contextProvider.getCurrentToken(),r=(null===(t=this.opts)||void 0===t?void 0:t.customUserAgent)?" (".concat(this.opts.customUserAgent,")"):"";return{Authorization:this.withAuth?"Bearer ".concat(n):void 0,"Content-Type":"application/json","User-Agent":"northflank-js-client/".concat(null===(e=sa())||void 0===e?void 0:e.version).concat(r)}},t}(),ua=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.method="get",e.body=function(){},e}return j(e,t),e}(aa),ca=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.method="post",e}return j(e,t),e}(aa),la=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.method="delete",e.body=function(){},e}return j(e,t),e}(aa),ha=function(t,e,n,r){return void 0===e&&(e={}),void 0===n&&(n=3),void 0===r&&(r=500),new Promise((function(o,i){var s=function(n){return ia(t,e).then((function(t){o(t)})).catch((function(t){return A(void 0,void 0,void 0,(function(){return E(this,(function(e){switch(e.label){case 0:return n>0?[4,(o=r,new Promise((function(t){setTimeout((function(){t()}),o)})))]:[3,2];case 1:return e.sent(),[2,s(n-1)];case 2:return[2,i(t)]}var o}))}))}))};return s(n)}))},da=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists projects for the authenticated user or team.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects".concat(r)},e.body=function(){},e}return j(e,t),e}(ua),pa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new project.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects"},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),fa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get information about the given project",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId)},e.body=function(){},e}return j(e,t),e}(ua),va=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Delete the given project. Fails if the project isn't empty.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId)},e.body=function(){},e}return j(e,t),e}(la),ma=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of addons belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/addons").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),ba=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new addon",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),ya=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the given addon",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId)},e.body=function(){},e}return j(e,t),e}(ua),ga=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId)},e.body=function(){},e}return j(e,t),e}(la),wa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns the credentials for connecting to the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/credentials")},e.body=function(){},e}return j(e,t),e}(ua),_a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the available addon types",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/addon-types"},e.body=function(){},e}return j(e,t),e}(ua),ja=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Modifies the allocated resources for the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/scale")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Sa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about the current addon version including available upgrades and upgrade history.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/version")},e.body=function(){},e}return j(e,t),e}(ua),Aa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Upgrades the addon to a new version.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/version")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Ea=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the network settings for the addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/network-settings")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Ca=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the security rules for the addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/security")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),xa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns a list of backups for the given addon.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),Oa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Initiates a backup for the given addon",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Ia=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about a given backup including restore history",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId)},e.body=function(){},e}return j(e,t),e}(ua),ka=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes a given backup",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId)},e.body=function(){},e}return j(e,t),e}(la),Ua=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Restores the given addon to the given backup state.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId,"/restore")},e.body=function(){},e}return j(e,t),e}(ca),Da=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Imports a database from an external archive or existing live database.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/import")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Pa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of containers for the given addon.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/containers").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),Ba=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Pause the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/pause")},e.body=function(){},e}return j(e,t),e}(ca),Na=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Resume the given addon if it is paused.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/resume")},e.body=function(){},e}return j(e,t),e}(ca),Ta=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Restart the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/restart")},e.body=function(){},e}return j(e,t),e}(ca),La=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts the in progress backup.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId,"/abort")},e.body=function(){},e}return j(e,t),e}(ca),Fa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Generates a temporary download link for downloading the given backup.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId,"/download-link")},e.body=function(){},e}return j(e,t),e}(ua),Ra=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts an in-progress backup restore.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId,"/abort-restore")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Ma=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of jobs belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),Wa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the given job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId)},e.body=function(){},e}return j(e,t),e}(ua),qa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId)},e.body=function(){},e}return j(e,t),e}(la),za=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new manual job that only runs when initiated via the UI, CLI, API or JS client.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/manual")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),$a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new cron job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/cron")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Ga=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Fetches run history for the given job",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runs").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),Ha=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Starts a new job run for the given job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runs")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Va=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns data about the given job run",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runs/").concat(t.parameters.runId)},e.body=function(){},e}return j(e,t),e}(ua),Ja=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts the given job run",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runs/").concat(t.parameters.runId)},e.body=function(){},e}return j(e,t),e}(la),Ya=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates settings for the job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/settings")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Za=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the health checks for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/health-checks")},e.body=function(){},e}return j(e,t),e}(ua),Ka=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates health checks for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/health-checks")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Xa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists builds for the given job.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),Qa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Start a new build for the given job. Given a commit sha, it will build that commit.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),tu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about a build for the job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build/").concat(t.parameters.buildId)},e.body=function(){},e}return j(e,t),e}(ua),eu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts the given job build",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build/").concat(t.parameters.buildId)},e.body=function(){},e}return j(e,t),e}(la),nu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the build options for a given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-options")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),ru=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the version control source for a given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-source")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),ou=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the Docker CMD override for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/cmd-override")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),iu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets the build arguments of the given job. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-arguments").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),su=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets build arguments for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-arguments")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),au=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about the build arguments accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-arguments/details")},e.body=function(){},e}return j(e,t),e}(ua),uu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns the runtime environment for the given job. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runtime-environment").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),cu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the runtime environment for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runtime-environment")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),lu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about the runtime environment accessible by the given job. Also requires the permission 'Project > Secrets > General > Read'",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runtime-environment/details")},e.body=function(){},e}return j(e,t),e}(ua),hu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the deployment of the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/deployment")},e.body=function(){},e}return j(e,t),e}(ua),du=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the deployment settings of the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/deployment")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),pu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of containers for the given job.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/containers").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),fu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the branches of the given job.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/branches").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),vu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the pull-requests of the given job.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/pull-requests").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),mu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the container registry credentials saved to this account. Does not display secrets.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/registry-credentials".concat(r)},e.body=function(){},e}return j(e,t),e}(ua),bu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Adds a new set of container registry credentials to this account.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/registry-credentials"},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),yu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Views a set of registry credential data.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/registry-credentials/".concat(t.parameters.credentialId)},e.body=function(){},e}return j(e,t),e}(ua),gu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes a set of registry credential data.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/registry-credentials/".concat(t.parameters.credentialId)},e.body=function(){},e}return j(e,t),e}(la),wu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates a set of registry credential data.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/registry-credentials/".concat(t.parameters.credentialId,"/modify")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),_u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists available domains",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/domains".concat(r)},e.body=function(){},e}return j(e,t),e}(ua),ju=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Registers a new domain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains"},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Su=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about domain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain)},e.body=function(){},e}return j(e,t),e}(ua),Au=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes a domain and each of its registered subdomains.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain)},e.body=function(){},e}return j(e,t),e}(la),Eu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Attempts to verify the domain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/verify")},e.body=function(){},e}return j(e,t),e}(ca),Cu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Adds a new subdomain to the domain.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),xu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about the given subdomain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain)},e.body=function(){},e}return j(e,t),e}(ua),Ou=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Removes a subdomain from a domain.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain)},e.body=function(){},e}return j(e,t),e}(la),Iu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about the given subdomain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain,"/verify")},e.body=function(){},e}return j(e,t),e}(ca),ku=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Assigns a service port to the given subdomain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain,"/assign")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Uu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Removes a subdomain from its assigned service",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain,"/assign")},e.body=function(){},e}return j(e,t),e}(la),Du=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists available billing plans",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/plans"},e.body=function(){},e}return j(e,t),e}(ua),Pu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists available project regions",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/regions"},e.body=function(){},e}return j(e,t),e}(ua),Bu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns the partially random string used when generating host names for the authenticated account.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/dns-id"},e.body=function(){},e}return j(e,t),e}(ua),Nu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists linked version control providers",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/vcs"},e.body=function(){},e}return j(e,t),e}(ua),Tu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of secrets belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/secrets").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),Lu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a secret with the specified payload",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Fu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="View a secret including its contents",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId).concat(r)},e.body=function(){},e}return j(e,t),e}(ua),Ru=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Delete a secret",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId)},e.body=function(){},e}return j(e,t),e}(la),Mu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Update a secret",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId)},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Wu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="View a secret with details about its linked addons",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId,"/details")},e.body=function(){},e}return j(e,t),e}(ua),qu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Link an addon to the secret group or edit the settings of the linked addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId,"/addons/").concat(t.parameters.addonId)},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),zu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about a given addon link.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId,"/addons/").concat(t.parameters.addonId)},e.body=function(){},e}return j(e,t),e}(ua),$u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Unlinks an addon from the secret group.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId,"/addons/").concat(t.parameters.addonId)},e.body=function(){},e}return j(e,t),e}(la),Gu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of services belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),Hu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new combined service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/combined")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Vu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new deployment service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/deployment")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Ju=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new build service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/build")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Yu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId)},e.body=function(){},e}return j(e,t),e}(ua),Zu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId)},e.body=function(){},e}return j(e,t),e}(la),Ku=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Modifies the scaling settings for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/scale")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Xu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the deployment of the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/deployment")},e.body=function(){},e}return j(e,t),e}(ua),Qu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the deployment settings of the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/deployment")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),tc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Restarts the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/restart")},e.body=function(){},e}return j(e,t),e}(ca),ec=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Pause the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/pause")},e.body=function(){},e}return j(e,t),e}(ca),nc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Resumes the given service. Optionally takes `instances` to resume with a given number of instances.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/resume")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),rc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the ports for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/ports")},e.body=function(){},e}return j(e,t),e}(ua),oc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the list of ports for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/ports")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),ic=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the build options for a given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-options")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),sc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the version control source for a given build or combined service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-source")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),ac=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the Docker CMD override for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/cmd-override")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),uc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the health checks for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/health-checks")},e.body=function(){},e}return j(e,t),e}(ua),cc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates health checks for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/health-checks")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),lc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the builds for the service",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),hc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Start a new build for the given combined or build service. If given a commit sha, it will build that commit. Otherwise, the most recent relevant commit will be built. If the service provided is a build service, a branch name or pull request to build from is required.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),dc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about a build for the service",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build/").concat(t.parameters.buildId)},e.body=function(){},e}return j(e,t),e}(ua),pc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts the given service build",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build/").concat(t.parameters.buildId)},e.body=function(){},e}return j(e,t),e}(la),fc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of containers for the given service.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/containers").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),vc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the branches of the given service.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/branches").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),mc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the pull-requests of the given service.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/pull-requests").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),bc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of repositories accessible to this account",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/vcs/repos".concat(r)},e.body=function(){},e}return j(e,t),e}(ua),yc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of branches for the repo",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/vcs/repos/".concat(t.parameters.vcsService,"/").concat(t.parameters.repositoryOwner,"/").concat(t.parameters.repositoryName,"/branches").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),gc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of volumes belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes")},e.body=function(){},e}return j(e,t),e}(ua),wc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a volume with the specified payload",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),_c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Retrieve a volume",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId)},e.body=function(){},e}return j(e,t),e}(ua),jc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Update volume mounts and storage size",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId)},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Sc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes this volume and its associated data.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId)},e.body=function(){},e}return j(e,t),e}(la),Ac=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Attach a volume",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId,"/attach")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Ec=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Detach a volume",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId,"/detach")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Cc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets the build arguments of the given service. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-arguments").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),xc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the build arguments for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-arguments")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Oc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about the build arguments accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-arguments/details")},e.body=function(){},e}return j(e,t),e}(ua),Ic=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets the runtime environment of the given service. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/runtime-environment").concat(r)},e.body=function(){},e}return j(e,t),e}(ua),kc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the runtime environment for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/runtime-environment")},e.body=function(t){return JSON.stringify(t.data)},e}return j(e,t),e}(ca),Uc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about the runtime environment accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/runtime-environment/details")},e.body=function(){},e}return j(e,t),e}(ua),Dc=function(){function t(){this.loadContext()}return t.prototype.loadContext=function(){this.contextWrapper=this.loadContextWrapper()},t.prototype.getInfo=function(){return""},t.prototype.storeContext=function(t){return A(this,void 0,void 0,(function(){return E(this,(function(e){switch(e.label){case 0:return[4,this.writeContext(t)];case 1:return e.sent(),this.contextWrapper=t,[2]}}))}))},t.prototype.addContext=function(t,e){return void 0===e&&(e=!0),A(this,void 0,void 0,(function(){var n,r,o;return E(this,(function(i){switch(i.label){case 0:if(e||void 0===this.findContext(t.name))return[3,1];throw new Error("Context with name ".concat(t.name," already exists"));case 1:return[4,this.removeContext(t.name)];case 2:i.sent(),i.label=3;case 3:return n=S({host:"https://api.northflank.com"},t),r=this.contextWrapper,o={current:n.name,contexts:C(C([],r.contexts,!0),[n],!1),lastUpdateCheck:r.lastUpdateCheck},[4,this.storeContext(o)];case 4:return i.sent(),[2]}}))}))},t.prototype.removeContext=function(t){return A(this,void 0,void 0,(function(){var e,n,r,o;return E(this,(function(i){switch(i.label){case 0:return e=this.contextWrapper,n=e.contexts.filter((function(e){return e.name!==t})),r=e.current===t?void 0:e.current,o={current:r,contexts:C([],n,!0),lastUpdateCheck:e.lastUpdateCheck},[4,this.storeContext(o)];case 1:return i.sent(),[2]}}))}))},t.prototype.getCurrentContext=function(){var t=this.contextWrapper.current;return void 0===t?t:this.findContext(t)},t.prototype.findContext=function(t){return this.contextWrapper.contexts.find((function(e){return e.name===t}))},t.prototype.getCurrentBaseUrl=function(){var t=this.getCurrentContext();return null==t?void 0:t.host},t.prototype.getCurrentProjectName=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.project},t.prototype.getCurrentName=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.name},t.prototype.getCurrentToken=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.token},t.prototype.getCurrentServiceName=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.service},t.prototype.getCurrentJobName=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.job},t.prototype.getCurrentPlanId=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.plan},t.prototype.getCurrentRegion=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.region},t.prototype.useContext=function(t){return A(this,void 0,void 0,(function(){var e,n;return E(this,(function(r){switch(r.label){case 0:if(!this.findContext(t))throw new Error("Context with name ".concat(t," doesn't exist"));return e=this.contextWrapper,n=S(S({},e),{current:t}),[4,this.storeContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.updateToken=function(t,e){return A(this,void 0,void 0,(function(){var n,r,o,i,s;return E(this,(function(a){switch(a.label){case 0:if(n=null!=e?e:this.getCurrentName(),!(r=this.findContext(n)))throw new Error("Context with name ".concat(e," doesn't exist"));return o=this.contextWrapper,i=o.contexts.map((function(e){return e.name===n?S(S({},r),{token:t}):e})),s=S(S({},o),{contexts:i}),[4,this.storeContext(s)];case 1:return a.sent(),[2]}}))}))},t.prototype.useProjectId=function(t){return A(this,void 0,void 0,(function(){var e,n;return E(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set project id to current context, current context not defined");return n=S(S({},e),{project:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.useServiceId=function(t){return A(this,void 0,void 0,(function(){var e,n;return E(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set service id to current context, current context not defined");return n=S(S({},e),{service:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.useJobId=function(t){return A(this,void 0,void 0,(function(){var e,n;return E(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set job id to current context, current context not defined");return n=S(S({},e),{job:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.usePlanId=function(t){return A(this,void 0,void 0,(function(){var e,n;return E(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set plan id to current context, current context not defined");return n=S(S({},e),{plan:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.useRegion=function(t){return A(this,void 0,void 0,(function(){var e,n;return E(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set region id to current context, current context not defined");return n=S(S({},e),{region:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.getLastUpdateCheck=function(){return this.contextWrapper.lastUpdateCheck||new Date},t.prototype.setLastUpdateCheck=function(t){return A(this,void 0,void 0,(function(){var e,n;return E(this,(function(r){switch(r.label){case 0:return e=this.contextWrapper,n=S(S({},e),{lastUpdateCheck:t}),[4,this.storeContext(n)];case 1:return r.sent(),[2]}}))}))},t}(),Pc=function(t){function e(e){var n=t.call(this)||this;return n.assertDir=function(t){return A(n,void 0,void 0,(function(){var e;return E(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,m.promises.mkdir(t,{recursive:!0})];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.log("Failed to login, local files could not be created: ".concat(t,", error: ").concat(e.message)),e;case 3:return[2]}}))}))},n.configPath=e||"".concat(l.homedir(),"/.northflank"),n.configFile="".concat(n.configPath,"/config.json"),n.loadContext(),n}return j(e,t),e.prototype.loadContextWrapper=function(){try{return JSON.parse(m.readFileSync(this.configFile,"utf8"))}catch(t){return{contexts:[],lastUpdateCheck:new Date(0)}}},e.prototype.writeContext=function(t){return A(this,void 0,void 0,(function(){var e;return E(this,(function(n){switch(n.label){case 0:return[4,this.assertConfigDir()];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,m.promises.writeFile(this.configFile,JSON.stringify(t,null,"\t"),{mode:416})];case 3:return n.sent(),[3,5];case 4:throw e=n.sent(),console.log("Failed to persist api context, local files could not be created, error: ".concat(e.message)),e;case 5:return[2]}}))}))},e.prototype.assertConfigDir=function(){return A(this,void 0,void 0,(function(){return E(this,(function(t){switch(t.label){case 0:return[4,this.assertDir(this.configPath)];case 1:return t.sent(),[2]}}))}))},e.prototype.getInfo=function(){return"Cli config stored in: ".concat(this.configPath)},e}(Dc),Bc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.inMemoryContextWrapper={contexts:[],lastUpdateCheck:new Date(0)},e}return j(e,t),e.prototype.loadContextWrapper=function(){return this.inMemoryContextWrapper||(this.inMemoryContextWrapper={contexts:[],lastUpdateCheck:new Date(0)}),this.inMemoryContextWrapper},e.prototype.writeContext=function(t){return A(this,void 0,void 0,(function(){return E(this,(function(e){return this.inMemoryContextWrapper=t,[2]}))}))},e}(Dc),Nc=function(t,e){var n,r=this;void 0===e&&(e={}),this.baseUrl=function(){return r.contextProvider.getCurrentBaseUrl()},this.contextProvider=t,this.forwarding=new ra(t,new Gu(t,e).call,new ma(t,e).call),this.endpoints={list:(n={},n.projects=new da(t,e),n.addons=new ma(t,e),n.jobs=new Ma(t,e),n.registryCredentials=new mu(t,e),n.domains=new _u(t,e),n.plans=new Du(t,e),n.regions=new Pu(t,e),n.vcs=new Nu(t,e),n.secrets=new Tu(t,e),n.services=new Gu(t,e),n.repos=new bc(t,e),n.branches=new yc(t,e),n.volumes=new gc(t,e),n),create:function(){var n,r={};return r.project=new pa(t,e),r.addon=new ba(t,e),r.job=((n={}).manual=new za(t,e),n.cron=new $a(t,e),n),r.domain=new ju(t,e),r.secret=new Lu(t,e),r.service=function(){var n={};return n.combined=new Hu(t,e),n.deployment=new Vu(t,e),n.build=new Ju(t,e),n}(),r.volume=new wc(t,e),r}(),get:function(){var n,r,o={};return o.project=new fa(t,e),o.addon=((r=new ya(t,e)).credentials=new wa(t,e),r.types=new _a(t,e),r.version=new Sa(t,e),r.backups=new xa(t,e),r.backup=((n=new Ia(t,e)).download=new Fa(t,e),n),r.containers=new Pa(t,e),r),o.job=function(){var n=new Wa(t,e);return n.runs=new Ga(t,e),n.run=new Va(t,e),n.healthChecks=new Za(t,e),n.builds=new Xa(t,e),n.build=new tu(t,e),n.buildArguments=new iu(t,e),n.buildArgumentDetails=new au(t,e),n.runtimeEnvironment=new uu(t,e),n.runtimeEnvironmentDetails=new lu(t,e),n.deployment=new hu(t,e),n.containers=new pu(t,e),n.branches=new fu(t,e),n.pullRequests=new vu(t,e),n}(),o.registryCredentials=new yu(t,e),o.domain=new Su(t,e),o.subdomain=new xu(t,e),o.dnsId=new Bu(t,e),o.secret=new Fu(t,e),o.secretDetails=new Wu(t,e),o.secretLink=new zu(t,e),o.service=function(){var n=new Yu(t,e);return n.deployment=new Xu(t,e),n.ports=new rc(t,e),n.healthChecks=new uc(t,e),n.builds=new lc(t,e),n.build=new dc(t,e),n.containers=new fc(t,e),n.branches=new vc(t,e),n.pullRequests=new mc(t,e),n.buildArguments=new Cc(t,e),n.buildArgumentDetails=new Oc(t,e),n.runtimeEnvironment=new Ic(t,e),n.runtimeEnvironmentDetails=new Uc(t,e),n}(),o.volume=new _c(t,e),o}(),delete:function(){var n={};return n.project=new va(t,e),n.addon=new ga(t,e),n.backup=new ka(t,e),n.job=new qa(t,e),n.registryCredentials=new gu(t,e),n.domain=new Au(t,e),n.subdomain=new Ou(t,e),n.secret=new Ru(t,e),n.secretLink=new $u(t,e),n.service=new Zu(t,e),n.volume=new Sc(t,e),n}(),scale:function(){var n={};return n.addon=new ja(t,e),n.service=new Ku(t,e),n}(),update:function(){var n,r={};return r.addon=((n={}).version=new Aa(t,e),n.networkSettings=new Ea(t,e),n.security=new Ca(t,e),n),r.job=function(){var n={};return n.settings=new Ya(t,e),n.healthChecks=new Ka(t,e),n.buildOptions=new nu(t,e),n.buildSource=new ru(t,e),n.cmdOverride=new ou(t,e),n.buildArguments=new su(t,e),n.runtimeEnvironment=new cu(t,e),n.deployment=new du(t,e),n}(),r.registryCredentials=new wu(t,e),r.secret=new Mu(t,e),r.secretLink=new qu(t,e),r.service=function(){var n={};return n.deployment=new Qu(t,e),n.ports=new oc(t,e),n.buildOptions=new ic(t,e),n.buildSource=new sc(t,e),n.cmdOverride=new ac(t,e),n.healthChecks=new cc(t,e),n.buildArguments=new xc(t,e),n.runtimeEnvironment=new kc(t,e),n}(),r.volume=new jc(t,e),r}(),backup:function(){var n={};return n.addon=new Oa(t,e),n}(),restore:function(){var n,r={};return r.addon=((n={}).backup=new Ua(t,e),n),r}(),import:function(){var n,r={};return r.addon=((n={}).backup=new Da(t,e),n),r}(),pause:function(){var n={};return n.addon=new Ba(t,e),n.service=new ec(t,e),n}(),resume:function(){var n={};return n.addon=new Na(t,e),n.service=new nc(t,e),n}(),restart:function(){var n={};return n.addon=new Ta(t,e),n.service=new tc(t,e),n}(),abort:function(){var n,r={};return r.addon=((n={}).backup=new La(t,e),n.restore=new Ra(t,e),n),r.job=function(){var n={};return n.run=new Ja(t,e),n.build=new eu(t,e),n}(),r.service=function(){var n={};return n.build=new pc(t,e),n}(),r}(),start:function(){var n,r={};return r.job=((n={}).run=new Ha(t,e),n.build=new Qa(t,e),n),r.service=function(){var n={};return n.build=new hc(t,e),n}(),r}(),add:function(){var n,r={};return r.registryCredentials=new bu(t,e),r.domain=((n={}).subdomain=new Cu(t,e),n),r}(),verify:function(){var n={};return n.domain=new Eu(t,e),n.subdomain=new Iu(t,e),n}(),assign:function(){var n,r={};return r.subdomain=((n={}).service=new ku(t,e),n),r}(),unassign:function(){var n={};return n.subdomain=new Uu(t,e),n}(),attach:function(){var n={};return n.volume=new Ac(t,e),n}(),detach:function(){var n={};return n.volume=new Ec(t,e),n}()},this.list=function(){var t={};return t.projects=r.endpoints.list.projects.call,t.addons=r.endpoints.list.addons.call,t.jobs=r.endpoints.list.jobs.call,t.registryCredentials=r.endpoints.list.registryCredentials.call,t.domains=r.endpoints.list.domains.call,t.plans=r.endpoints.list.plans.call,t.regions=r.endpoints.list.regions.call,t.vcs=r.endpoints.list.vcs.call,t.secrets=r.endpoints.list.secrets.call,t.services=r.endpoints.list.services.call,t.repos=r.endpoints.list.repos.call,t.branches=r.endpoints.list.branches.call,t.volumes=r.endpoints.list.volumes.call,t}(),this.create=function(){var t,e={};return e.project=r.endpoints.create.project.call,e.addon=r.endpoints.create.addon.call,e.job=((t={}).manual=r.endpoints.create.job.manual.call,t.cron=r.endpoints.create.job.cron.call,t),e.domain=r.endpoints.create.domain.call,e.secret=r.endpoints.create.secret.call,e.service=function(){var t={};return t.combined=r.endpoints.create.service.combined.call,t.deployment=r.endpoints.create.service.deployment.call,t.build=r.endpoints.create.service.build.call,t}(),e.volume=r.endpoints.create.volume.call,e}(),this.get=function(){var t,e,n={};return n.project=r.endpoints.get.project.call,n.addon=((e=r.endpoints.get.addon.call).credentials=r.endpoints.get.addon.credentials.call,e.types=r.endpoints.get.addon.types.call,e.version=r.endpoints.get.addon.version.call,e.backups=r.endpoints.get.addon.backups.call,e.backup=((t=r.endpoints.get.addon.backup.call).download=r.endpoints.get.addon.backup.download.call,t),e.containers=r.endpoints.get.addon.containers.call,e),n.job=function(){var t=r.endpoints.get.job.call;return t.runs=r.endpoints.get.job.runs.call,t.run=r.endpoints.get.job.run.call,t.healthChecks=r.endpoints.get.job.healthChecks.call,t.builds=r.endpoints.get.job.builds.call,t.build=r.endpoints.get.job.build.call,t.buildArguments=r.endpoints.get.job.buildArguments.call,t.buildArgumentDetails=r.endpoints.get.job.buildArgumentDetails.call,t.runtimeEnvironment=r.endpoints.get.job.runtimeEnvironment.call,t.runtimeEnvironmentDetails=r.endpoints.get.job.runtimeEnvironmentDetails.call,t.deployment=r.endpoints.get.job.deployment.call,t.containers=r.endpoints.get.job.containers.call,t.branches=r.endpoints.get.job.branches.call,t.pullRequests=r.endpoints.get.job.pullRequests.call,t}(),n.registryCredentials=r.endpoints.get.registryCredentials.call,n.domain=r.endpoints.get.domain.call,n.subdomain=r.endpoints.get.subdomain.call,n.dnsId=r.endpoints.get.dnsId.call,n.secret=r.endpoints.get.secret.call,n.secretDetails=r.endpoints.get.secretDetails.call,n.secretLink=r.endpoints.get.secretLink.call,n.service=function(){var t=r.endpoints.get.service.call;return t.deployment=r.endpoints.get.service.deployment.call,t.ports=r.endpoints.get.service.ports.call,t.healthChecks=r.endpoints.get.service.healthChecks.call,t.builds=r.endpoints.get.service.builds.call,t.build=r.endpoints.get.service.build.call,t.containers=r.endpoints.get.service.containers.call,t.branches=r.endpoints.get.service.branches.call,t.pullRequests=r.endpoints.get.service.pullRequests.call,t.buildArguments=r.endpoints.get.service.buildArguments.call,t.buildArgumentDetails=r.endpoints.get.service.buildArgumentDetails.call,t.runtimeEnvironment=r.endpoints.get.service.runtimeEnvironment.call,t.runtimeEnvironmentDetails=r.endpoints.get.service.runtimeEnvironmentDetails.call,t}(),n.volume=r.endpoints.get.volume.call,n}(),this.delete=function(){var t={};return t.project=r.endpoints.delete.project.call,t.addon=r.endpoints.delete.addon.call,t.backup=r.endpoints.delete.backup.call,t.job=r.endpoints.delete.job.call,t.registryCredentials=r.endpoints.delete.registryCredentials.call,t.domain=r.endpoints.delete.domain.call,t.subdomain=r.endpoints.delete.subdomain.call,t.secret=r.endpoints.delete.secret.call,t.secretLink=r.endpoints.delete.secretLink.call,t.service=r.endpoints.delete.service.call,t.volume=r.endpoints.delete.volume.call,t}(),this.scale=function(){var t={};return t.addon=r.endpoints.scale.addon.call,t.service=r.endpoints.scale.service.call,t}(),this.update=function(){var t,e={};return e.addon=((t={}).version=r.endpoints.update.addon.version.call,t.networkSettings=r.endpoints.update.addon.networkSettings.call,t.security=r.endpoints.update.addon.security.call,t),e.job=function(){var t={};return t.settings=r.endpoints.update.job.settings.call,t.healthChecks=r.endpoints.update.job.healthChecks.call,t.buildOptions=r.endpoints.update.job.buildOptions.call,t.buildSource=r.endpoints.update.job.buildSource.call,t.cmdOverride=r.endpoints.update.job.cmdOverride.call,t.buildArguments=r.endpoints.update.job.buildArguments.call,t.runtimeEnvironment=r.endpoints.update.job.runtimeEnvironment.call,t.deployment=r.endpoints.update.job.deployment.call,t}(),e.registryCredentials=r.endpoints.update.registryCredentials.call,e.secret=r.endpoints.update.secret.call,e.secretLink=r.endpoints.update.secretLink.call,e.service=function(){var t={};return t.deployment=r.endpoints.update.service.deployment.call,t.ports=r.endpoints.update.service.ports.call,t.buildOptions=r.endpoints.update.service.buildOptions.call,t.buildSource=r.endpoints.update.service.buildSource.call,t.cmdOverride=r.endpoints.update.service.cmdOverride.call,t.healthChecks=r.endpoints.update.service.healthChecks.call,t.buildArguments=r.endpoints.update.service.buildArguments.call,t.runtimeEnvironment=r.endpoints.update.service.runtimeEnvironment.call,t}(),e.volume=r.endpoints.update.volume.call,e}(),this.backup=function(){var t={};return t.addon=r.endpoints.backup.addon.call,t}(),this.restore=function(){var t,e={};return e.addon=((t={}).backup=r.endpoints.restore.addon.backup.call,t),e}(),this.import=function(){var t,e={};return e.addon=((t={}).backup=r.endpoints.import.addon.backup.call,t),e}(),this.pause=function(){var t={};return t.addon=r.endpoints.pause.addon.call,t.service=r.endpoints.pause.service.call,t}(),this.resume=function(){var t={};return t.addon=r.endpoints.resume.addon.call,t.service=r.endpoints.resume.service.call,t}(),this.restart=function(){var t={};return t.addon=r.endpoints.restart.addon.call,t.service=r.endpoints.restart.service.call,t}(),this.abort=function(){var t,e={};return e.addon=((t={}).backup=r.endpoints.abort.addon.backup.call,t.restore=r.endpoints.abort.addon.restore.call,t),e.job=function(){var t={};return t.run=r.endpoints.abort.job.run.call,t.build=r.endpoints.abort.job.build.call,t}(),e.service=function(){var t={};return t.build=r.endpoints.abort.service.build.call,t}(),e}(),this.start=function(){var t,e={};return e.job=((t={}).run=r.endpoints.start.job.run.call,t.build=r.endpoints.start.job.build.call,t),e.service=function(){var t={};return t.build=r.endpoints.start.service.build.call,t}(),e}(),this.add=function(){var t,e={};return e.registryCredentials=r.endpoints.add.registryCredentials.call,e.domain=((t={}).subdomain=r.endpoints.add.domain.subdomain.call,t),e}(),this.verify=function(){var t={};return t.domain=r.endpoints.verify.domain.call,t.subdomain=r.endpoints.verify.subdomain.call,t}(),this.assign=function(){var t,e={};return e.subdomain=((t={}).service=r.endpoints.assign.subdomain.service.call,t),e}(),this.unassign=function(){var t={};return t.subdomain=r.endpoints.unassign.subdomain.call,t}(),this.attach=function(){var t={};return t.volume=r.endpoints.attach.volume.call,t}(),this.detach=function(){var t={};return t.volume=r.endpoints.detach.volume.call,t}()};export{La as AbortAddonBackupEndpoint,Ra as AbortAddonRestoreEndpoint,eu as AbortJobBuildEndpoint,Ja as AbortJobRunEndpoint,pc as AbortServiceBuildEndpoint,Cu as AddDomainSubdomainEndpoint,bu as AddRegistrycredentialsEndpoint,Nc as ApiClient,Dc as ApiClientContextProvider,Pc as ApiClientFileContextProvider,Bc as ApiClientInMemoryContextProvider,aa as ApiEndpoint,ku as AssignSubdomainServiceEndpoint,Ac as AttachVolumeEndpoint,Oa as BackupAddonEndpoint,ba as CreateAddonEndpoint,ju as CreateDomainEndpoint,$a as CreateJobCronEndpoint,za as CreateJobManualEndpoint,pa as CreateProjectEndpoint,Lu as CreateSecretEndpoint,Ju as CreateServiceBuildEndpoint,Hu as CreateServiceCombinedEndpoint,Vu as CreateServiceDeploymentEndpoint,wc as CreateVolumeEndpoint,ga as DeleteAddonEndpoint,la as DeleteApiEndpoint,ka as DeleteBackupEndpoint,Au as DeleteDomainEndpoint,qa as DeleteJobEndpoint,va as DeleteProjectEndpoint,gu as DeleteRegistrycredentialsEndpoint,Ru as DeleteSecretEndpoint,$u as DeleteSecretlinkEndpoint,Zu as DeleteServiceEndpoint,Ou as DeleteSubdomainEndpoint,Sc as DeleteVolumeEndpoint,Ec as DetachVolumeEndpoint,Fa as GetAddonBackupDownloadEndpoint,Ia as GetAddonBackupEndpoint,xa as GetAddonBackupsEndpoint,Pa as GetAddonContainersEndpoint,wa as GetAddonCredentialsEndpoint,ya as GetAddonEndpoint,_a as GetAddonTypesEndpoint,Sa as GetAddonVersionEndpoint,ua as GetApiEndpoint,Bu as GetDnsidEndpoint,Su as GetDomainEndpoint,fu as GetJobBranchesEndpoint,tu as GetJobBuildEndpoint,au as GetJobBuildargumentdetailsEndpoint,iu as GetJobBuildargumentsEndpoint,Xa as GetJobBuildsEndpoint,pu as GetJobContainersEndpoint,hu as GetJobDeploymentEndpoint,Wa as GetJobEndpoint,Za as GetJobHealthchecksEndpoint,vu as GetJobPullrequestsEndpoint,Va as GetJobRunEndpoint,Ga as GetJobRunsEndpoint,uu as GetJobRuntimeenvironmentEndpoint,lu as GetJobRuntimeenvironmentdetailsEndpoint,fa as GetProjectEndpoint,yu as GetRegistrycredentialsEndpoint,Fu as GetSecretEndpoint,Wu as GetSecretdetailsEndpoint,zu as GetSecretlinkEndpoint,vc as GetServiceBranchesEndpoint,dc as GetServiceBuildEndpoint,Oc as GetServiceBuildargumentdetailsEndpoint,Cc as GetServiceBuildargumentsEndpoint,lc as GetServiceBuildsEndpoint,fc as GetServiceContainersEndpoint,Xu as GetServiceDeploymentEndpoint,Yu as GetServiceEndpoint,uc as GetServiceHealthchecksEndpoint,rc as GetServicePortsEndpoint,mc as GetServicePullrequestsEndpoint,Ic as GetServiceRuntimeenvironmentEndpoint,Uc as GetServiceRuntimeenvironmentdetailsEndpoint,xu as GetSubdomainEndpoint,_c as GetVolumeEndpoint,Da as ImportAddonBackupEndpoint,ma as ListAddonsEndpoint,yc as ListBranchesEndpoint,_u as ListDomainsEndpoint,Ma as ListJobsEndpoint,Du as ListPlansEndpoint,da as ListProjectsEndpoint,Pu as ListRegionsEndpoint,mu as ListRegistrycredentialsEndpoint,bc as ListReposEndpoint,Tu as ListSecretsEndpoint,Gu as ListServicesEndpoint,Nu as ListVcsEndpoint,gc as ListVolumesEndpoint,ra as NorthflankPortForwarder,Ba as PauseAddonEndpoint,ec as PauseServiceEndpoint,ca as PostApiEndpoint,Ta as RestartAddonEndpoint,tc as RestartServiceEndpoint,Ua as RestoreAddonBackupEndpoint,Na as ResumeAddonEndpoint,nc as ResumeServiceEndpoint,ja as ScaleAddonEndpoint,Ku as ScaleServiceEndpoint,Qa as StartJobBuildEndpoint,Ha as StartJobRunEndpoint,hc as StartServiceBuildEndpoint,Uu as UnassignSubdomainEndpoint,Ea as UpdateAddonNetworksettingsEndpoint,Ca as UpdateAddonSecurityEndpoint,Aa as UpdateAddonVersionEndpoint,su as UpdateJobBuildargumentsEndpoint,nu as UpdateJobBuildoptionsEndpoint,ru as UpdateJobBuildsourceEndpoint,ou as UpdateJobCmdoverrideEndpoint,du as UpdateJobDeploymentEndpoint,Ka as UpdateJobHealthchecksEndpoint,cu as UpdateJobRuntimeenvironmentEndpoint,Ya as UpdateJobSettingsEndpoint,wu as UpdateRegistrycredentialsEndpoint,Mu as UpdateSecretEndpoint,qu as UpdateSecretlinkEndpoint,xc as UpdateServiceBuildargumentsEndpoint,ic as UpdateServiceBuildoptionsEndpoint,sc as UpdateServiceBuildsourceEndpoint,ac as UpdateServiceCmdoverrideEndpoint,Qu as UpdateServiceDeploymentEndpoint,cc as UpdateServiceHealthchecksEndpoint,oc as UpdateServicePortsEndpoint,kc as UpdateServiceRuntimeenvironmentEndpoint,jc as UpdateVolumeEndpoint,Eu as VerifyDomainEndpoint,Iu as VerifySubdomainEndpoint};
15
+ ***************************************************************************** */var j=function(t,e){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},j(t,e)};function S(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var A=function(){return A=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},A.apply(this,arguments)};function E(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))}function C(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function x(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var O="object"==typeof global&&global&&global.Object===Object&&global,I="object"==typeof self&&self&&self.Object===Object&&self,k=O||I||Function("return this")(),U=k.Symbol,P=Object.prototype,D=P.hasOwnProperty,N=P.toString,B=U?U.toStringTag:void 0;var T=Object.prototype.toString;var L=U?U.toStringTag:void 0;function F(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":L&&L in Object(t)?function(t){var e=D.call(t,B),n=t[B];try{t[B]=void 0;var r=!0}catch(t){}var o=N.call(t);return r&&(e?t[B]=n:delete t[B]),o}(t):function(t){return T.call(t)}(t)}function R(t){return null!=t&&"object"==typeof t}function M(t){return"symbol"==typeof t||R(t)&&"[object Symbol]"==F(t)}function z(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var W=Array.isArray,q=U?U.prototype:void 0,$=q?q.toString:void 0;function G(t){if("string"==typeof t)return t;if(W(t))return z(t,G)+"";if(M(t))return $?$.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function H(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function V(t){return t}function J(t){if(!H(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Y,Z=k["__core-js_shared__"],K=(Y=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"";var X=Function.prototype.toString;function Q(t){if(null!=t){try{return X.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var tt=/^\[object .+?Constructor\]$/,et=Function.prototype,nt=Object.prototype,rt=et.toString,ot=nt.hasOwnProperty,it=RegExp("^"+rt.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function st(t){return!(!H(t)||(e=t,K&&K in e))&&(J(t)?it:tt).test(Q(t));var e}function at(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return st(n)?n:void 0}var ut=at(k,"WeakMap"),ct=Object.create,lt=function(){function t(){}return function(e){if(!H(e))return{};if(ct)return ct(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function dt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var ht=Date.now;var pt,ft,vt,mt=function(){try{var t=at(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),bt=mt,yt=bt?function(t,e){return bt(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:V,gt=(pt=yt,ft=0,vt=0,function(){var t=ht(),e=16-(t-vt);if(vt=t,e>0){if(++ft>=800)return arguments[0]}else ft=0;return pt.apply(void 0,arguments)}),wt=/^(?:0|[1-9]\d*)$/;function _t(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&wt.test(t))&&t>-1&&t%1==0&&t<e}function jt(t,e,n){"__proto__"==e&&bt?bt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function St(t,e){return t===e||t!=t&&e!=e}var At=Object.prototype.hasOwnProperty;function Et(t,e,n){var r=t[e];At.call(t,e)&&St(r,n)&&(void 0!==n||e in t)||jt(t,e,n)}var Ct=Math.max;function xt(t,e){return gt(function(t,e,n){return e=Ct(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Ct(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),dt(t,this,a)}}(t,e,V),t+"")}function Ot(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function It(t){return null!=t&&Ot(t.length)&&!J(t)}var kt=Object.prototype;function Ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||kt)}function Pt(t){return R(t)&&"[object Arguments]"==F(t)}var Dt=Object.prototype,Nt=Dt.hasOwnProperty,Bt=Dt.propertyIsEnumerable,Tt=Pt(function(){return arguments}())?Pt:function(t){return R(t)&&Nt.call(t,"callee")&&!Bt.call(t,"callee")};var Lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ft=Lt&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Ft&&Ft.exports===Lt?k.Buffer:void 0,Mt=(Rt?Rt.isBuffer:void 0)||function(){return!1},zt={};zt["[object Float32Array]"]=zt["[object Float64Array]"]=zt["[object Int8Array]"]=zt["[object Int16Array]"]=zt["[object Int32Array]"]=zt["[object Uint8Array]"]=zt["[object Uint8ClampedArray]"]=zt["[object Uint16Array]"]=zt["[object Uint32Array]"]=!0,zt["[object Arguments]"]=zt["[object Array]"]=zt["[object ArrayBuffer]"]=zt["[object Boolean]"]=zt["[object DataView]"]=zt["[object Date]"]=zt["[object Error]"]=zt["[object Function]"]=zt["[object Map]"]=zt["[object Number]"]=zt["[object Object]"]=zt["[object RegExp]"]=zt["[object Set]"]=zt["[object String]"]=zt["[object WeakMap]"]=!1;var Wt="object"==typeof exports&&exports&&!exports.nodeType&&exports,qt=Wt&&"object"==typeof module&&module&&!module.nodeType&&module,$t=qt&&qt.exports===Wt&&O.process,Gt=function(){try{var t=qt&&qt.require&&qt.require("util").types;return t||$t&&$t.binding&&$t.binding("util")}catch(t){}}(),Ht=Gt&&Gt.isTypedArray,Vt=Ht?function(t){return function(e){return t(e)}}(Ht):function(t){return R(t)&&Ot(t.length)&&!!zt[F(t)]},Jt=Vt,Yt=Object.prototype.hasOwnProperty;function Zt(t,e){var n=W(t),r=!n&&Tt(t),o=!n&&!r&&Mt(t),i=!n&&!r&&!o&&Jt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=a.length;for(var c in t)!e&&!Yt.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||_t(c,u))||a.push(c);return a}function Kt(t,e){return function(n){return t(e(n))}}var Xt=Kt(Object.keys,Object),Qt=Object.prototype.hasOwnProperty;function te(t){return It(t)?Zt(t):function(t){if(!Ut(t))return Xt(t);var e=[];for(var n in Object(t))Qt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}var ee=Object.prototype.hasOwnProperty;function ne(t){if(!H(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Ut(t),n=[];for(var r in t)("constructor"!=r||!e&&ee.call(t,r))&&n.push(r);return n}function re(t){return It(t)?Zt(t,!0):ne(t)}var oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ie=/^\w*$/;function se(t,e){if(W(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!M(t))||(ie.test(t)||!oe.test(t)||null!=e&&t in Object(e))}var ae=at(Object,"create");var ue=Object.prototype.hasOwnProperty;var ce=Object.prototype.hasOwnProperty;function le(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function de(t,e){for(var n=t.length;n--;)if(St(t[n][0],e))return n;return-1}le.prototype.clear=function(){this.__data__=ae?ae(null):{},this.size=0},le.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},le.prototype.get=function(t){var e=this.__data__;if(ae){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ue.call(e,t)?e[t]:void 0},le.prototype.has=function(t){var e=this.__data__;return ae?void 0!==e[t]:ce.call(e,t)},le.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ae&&void 0===e?"__lodash_hash_undefined__":e,this};var he=Array.prototype.splice;function pe(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}pe.prototype.clear=function(){this.__data__=[],this.size=0},pe.prototype.delete=function(t){var e=this.__data__,n=de(e,t);return!(n<0)&&(n==e.length-1?e.pop():he.call(e,n,1),--this.size,!0)},pe.prototype.get=function(t){var e=this.__data__,n=de(e,t);return n<0?void 0:e[n][1]},pe.prototype.has=function(t){return de(this.__data__,t)>-1},pe.prototype.set=function(t,e){var n=this.__data__,r=de(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var fe=at(k,"Map");function ve(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function me(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}me.prototype.clear=function(){this.size=0,this.__data__={hash:new le,map:new(fe||pe),string:new le}},me.prototype.delete=function(t){var e=ve(this,t).delete(t);return this.size-=e?1:0,e},me.prototype.get=function(t){return ve(this,t).get(t)},me.prototype.has=function(t){return ve(this,t).has(t)},me.prototype.set=function(t,e){var n=ve(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function be(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(be.Cache||me),n}be.Cache=me;var ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ge=/\\(\\)?/g,we=function(t){var e=be(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ye,(function(t,n,r,o){e.push(r?o.replace(ge,"$1"):n||t)})),e})),_e=we;function je(t){return null==t?"":G(t)}function Se(t,e){return W(t)?t:se(t,e)?[t]:_e(je(t))}function Ae(t){if("string"==typeof t||M(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function Ee(t,e){for(var n=0,r=(e=Se(e,t)).length;null!=t&&n<r;)t=t[Ae(e[n++])];return n&&n==r?t:void 0}function Ce(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var xe=U?U.isConcatSpreadable:void 0;function Oe(t){return W(t)||Tt(t)||!!(xe&&t&&t[xe])}function Ie(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=Oe),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?Ie(a,e-1,n,r,o):Ce(o,a):r||(o[o.length]=a)}return o}var ke=Kt(Object.getPrototypeOf,Object),Ue=Function.prototype,Pe=Object.prototype,De=Ue.toString,Ne=Pe.hasOwnProperty,Be=De.call(Object);function Te(t){var e=this.__data__=new pe(t);this.size=e.size}Te.prototype.clear=function(){this.__data__=new pe,this.size=0},Te.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Te.prototype.get=function(t){return this.__data__.get(t)},Te.prototype.has=function(t){return this.__data__.has(t)},Te.prototype.set=function(t,e){var n=this.__data__;if(n instanceof pe){var r=n.__data__;if(!fe||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new me(r)}return n.set(t,e),this.size=n.size,this};var Le="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fe=Le&&"object"==typeof module&&module&&!module.nodeType&&module,Re=Fe&&Fe.exports===Le?k.Buffer:void 0,Me=Re?Re.allocUnsafe:void 0;var ze=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,qe=We?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}(We(t),(function(e){return ze.call(t,e)})))}:function(){return[]};function $e(t){return function(t,e,n){var r=e(t);return W(t)?r:Ce(r,n(t))}(t,te,qe)}var Ge=at(k,"DataView"),He=at(k,"Promise"),Ve=at(k,"Set"),Je=Q(Ge),Ye=Q(fe),Ze=Q(He),Ke=Q(Ve),Xe=Q(ut),Qe=F;(Ge&&"[object DataView]"!=Qe(new Ge(new ArrayBuffer(1)))||fe&&"[object Map]"!=Qe(new fe)||He&&"[object Promise]"!=Qe(He.resolve())||Ve&&"[object Set]"!=Qe(new Ve)||ut&&"[object WeakMap]"!=Qe(new ut))&&(Qe=function(t){var e=F(t),n="[object Object]"==e?t.constructor:void 0,r=n?Q(n):"";if(r)switch(r){case Je:return"[object DataView]";case Ye:return"[object Map]";case Ze:return"[object Promise]";case Ke:return"[object Set]";case Xe:return"[object WeakMap]"}return e});var tn=Qe,en=k.Uint8Array;function nn(t,e){var n,r,o=e?(n=t.buffer,r=new n.constructor(n.byteLength),new en(r).set(new en(n)),r):t.buffer;return new t.constructor(o,t.byteOffset,t.length)}function rn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new me;++e<n;)this.add(t[e])}function on(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}rn.prototype.add=rn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},rn.prototype.has=function(t){return this.__data__.has(t)};function sn(t,e,n,r,o,i){var s=1&n,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var d=-1,h=!0,p=2&n?new rn:void 0;for(i.set(t,e),i.set(e,t);++d<a;){var f=t[d],v=e[d];if(r)var m=s?r(v,f,d,e,t,i):r(f,v,d,t,e,i);if(void 0!==m){if(m)continue;h=!1;break}if(p){if(!on(e,(function(t,e){if(s=e,!p.has(s)&&(f===t||o(f,t,n,r,i)))return p.push(e);var s}))){h=!1;break}}else if(f!==v&&!o(f,v,n,r,i)){h=!1;break}}return i.delete(t),i.delete(e),h}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var cn=U?U.prototype:void 0,ln=cn?cn.valueOf:void 0;var dn=Object.prototype.hasOwnProperty;var hn="[object Object]",pn=Object.prototype.hasOwnProperty;function fn(t,e,n,r,o,i){var s=W(t),a=W(e),u=s?"[object Array]":tn(t),c=a?"[object Array]":tn(e),l=(u="[object Arguments]"==u?hn:u)==hn,d=(c="[object Arguments]"==c?hn:c)==hn,h=u==c;if(h&&Mt(t)){if(!Mt(e))return!1;s=!0,l=!1}if(h&&!l)return i||(i=new Te),s||Jt(t)?sn(t,e,n,r,o,i):function(t,e,n,r,o,i,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new en(t),new en(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return St(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=an;case"[object Set]":var u=1&r;if(a||(a=un),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;r|=2,s.set(t,e);var l=sn(a(t),a(e),r,o,i,s);return s.delete(t),l;case"[object Symbol]":if(ln)return ln.call(t)==ln.call(e)}return!1}(t,e,u,n,r,o,i);if(!(1&n)){var p=l&&pn.call(t,"__wrapped__"),f=d&&pn.call(e,"__wrapped__");if(p||f){var v=p?t.value():t,m=f?e.value():e;return i||(i=new Te),o(v,m,n,r,i)}}return!!h&&(i||(i=new Te),function(t,e,n,r,o,i){var s=1&n,a=$e(t),u=a.length;if(u!=$e(e).length&&!s)return!1;for(var c=u;c--;){var l=a[c];if(!(s?l in e:dn.call(e,l)))return!1}var d=i.get(t),h=i.get(e);if(d&&h)return d==e&&h==t;var p=!0;i.set(t,e),i.set(e,t);for(var f=s;++c<u;){var v=t[l=a[c]],m=e[l];if(r)var b=s?r(m,v,l,e,t,i):r(v,m,l,t,e,i);if(!(void 0===b?v===m||o(v,m,n,r,i):b)){p=!1;break}f||(f="constructor"==l)}if(p&&!f){var y=t.constructor,g=e.constructor;y==g||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,n,r,o,i))}function vn(t,e,n,r,o){return t===e||(null==t||null==e||!R(t)&&!R(e)?t!=t&&e!=e:fn(t,e,n,r,vn,o))}function mn(t){return t==t&&!H(t)}function bn(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function yn(t){var e=function(t){for(var e=te(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,mn(o)]}return e}(t);return 1==e.length&&e[0][2]?bn(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var o=n.length,i=o,s=!r;if(null==t)return!i;for(t=Object(t);o--;){var a=n[o];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var u=(a=n[o])[0],c=t[u],l=a[1];if(s&&a[2]){if(void 0===c&&!(u in t))return!1}else{var d=new Te;if(r)var h=r(c,l,u,t,e,d);if(!(void 0===h?vn(l,c,3,r,d):h))return!1}}return!0}(n,t,e)}}function gn(t,e){return null!=t&&e in Object(t)}function wn(t,e){return null!=t&&function(t,e,n){for(var r=-1,o=(e=Se(e,t)).length,i=!1;++r<o;){var s=Ae(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Ot(o)&&_t(s,o)&&(W(t)||Tt(t))}(t,e,gn)}function _n(t,e){return se(t)&&mn(e)?bn(Ae(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:Ee(t,e);return void 0===r?n:r}(n,t);return void 0===r&&r===e?wn(n,t):vn(e,r,3)}}function jn(t){return se(t)?(e=Ae(t),function(t){return null==t?void 0:t[e]}):function(t){return function(e){return Ee(e,t)}}(t);var e}function Sn(t){return"function"==typeof t?t:null==t?V:"object"==typeof t?W(t)?_n(t[0],t[1]):yn(t):jn(t)}var An,En=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[An?s:++r];if(!1===e(o[a],a,o))break}return t};var Cn=function(t,e){return function(n,r){if(null==n)return n;if(!It(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=Object(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}((function(t,e){return t&&En(t,e,te)})),xn=Cn;function On(t,e,n){(void 0!==n&&!St(t[e],n)||void 0===n&&!(e in t))&&jt(t,e,n)}function In(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function kn(t){return function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,s=e.length;++i<s;){var a=e[i],u=r?r(n[a],t[a],a,n,t):void 0;void 0===u&&(u=t[a]),o?jt(n,a,u):Et(n,a,u)}return n}(t,re(t))}function Un(t,e,n,r,o,i,s){var a=In(t,n),u=In(e,n),c=s.get(u);if(c)On(t,n,c);else{var l,d=i?i(a,u,n+"",t,e,s):void 0,h=void 0===d;if(h){var p=W(u),f=!p&&Mt(u),v=!p&&!f&&Jt(u);d=u,p||f||v?W(a)?d=a:R(l=a)&&It(l)?d=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(a):f?(h=!1,d=function(t,e){if(e)return t.slice();var n=t.length,r=Me?Me(n):new t.constructor(n);return t.copy(r),r}(u,!0)):v?(h=!1,d=nn(u,!0)):d=[]:function(t){if(!R(t)||"[object Object]"!=F(t))return!1;var e=ke(t);if(null===e)return!0;var n=Ne.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}(u)||Tt(u)?(d=a,Tt(a)?d=kn(a):H(a)&&!J(a)||(d=function(t){return"function"!=typeof t.constructor||Ut(t)?{}:lt(ke(t))}(u))):h=!1}h&&(s.set(u,d),o(d,u,r,i,s),s.delete(u)),On(t,n,d)}}function Pn(t,e,n,r,o){t!==e&&En(e,(function(i,s){if(o||(o=new Te),H(i))Un(t,e,s,n,Pn,r,o);else{var a=r?r(In(t,s),i,s+"",t,e,o):void 0;void 0===a&&(a=i),On(t,s,a)}}),re)}var Dn=/[\\^$.*+?()[\]{}|]/g,Nn=RegExp(Dn.source);function Bn(t,e){var n=-1,r=It(t)?Array(t.length):[];return xn(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function Tn(t,e){return Ie(function(t,e){return(W(t)?z:Bn)(t,Sn(e))}(t,e),1)}function Ln(t,e){return t>e}function Fn(t){return"string"==typeof t||!W(t)&&R(t)&&"[object String]"==F(t)}function Rn(t,e){return t&&t.length?function(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],s=e(i);if(null!=s&&(void 0===a?s==s&&!M(s):n(s,a)))var a=s,u=i}return u}(t,Sn(e),Ln):void 0}var Mn,zn=(Mn=function(t,e,n){Pn(t,e,n)},xt((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Mn.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!H(n))return!1;var r=typeof e;return!!("number"==r?It(n)&&_t(e,n.length):"string"==r&&e in n)&&St(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Mn(t,s,n,o)}return t})));function Wn(t,e){return t(e={exports:{}},e.exports),e.exports}var qn={},$n=qn;function Gn(t){return t<0?-1:1}function Hn(t,e){e.unsigned||--t;const n=e.unsigned?0:-Math.pow(2,t),r=Math.pow(2,t)-1,o=e.moduloBitLength?Math.pow(2,e.moduloBitLength):Math.pow(2,t),i=e.moduloBitLength?Math.pow(2,e.moduloBitLength-1):Math.pow(2,t-1);return function(t,s){s||(s={});let a=+t;if(s.enforceRange){if(!Number.isFinite(a))throw new TypeError("Argument is not a finite number");if(a=Gn(a)*Math.floor(Math.abs(a)),a<n||a>r)throw new TypeError("Argument is not in byte range");return a}if(!isNaN(a)&&s.clamp)return a=function(t){return t%1==.5&&0==(1&t)?Math.floor(t):Math.round(t)}(a),a<n&&(a=n),a>r&&(a=r),a;if(!Number.isFinite(a)||0===a)return 0;if(a=Gn(a)*Math.floor(Math.abs(a)),a%=o,!e.unsigned&&a>=i)return a-o;if(e.unsigned)if(a<0)a+=o;else if(-0===a)return 0;return a}}qn.void=function(){},qn.boolean=function(t){return!!t},qn.byte=Hn(8,{unsigned:!1}),qn.octet=Hn(8,{unsigned:!0}),qn.short=Hn(16,{unsigned:!1}),qn["unsigned short"]=Hn(16,{unsigned:!0}),qn.long=Hn(32,{unsigned:!1}),qn["unsigned long"]=Hn(32,{unsigned:!0}),qn["long long"]=Hn(32,{unsigned:!1,moduloBitLength:64}),qn["unsigned long long"]=Hn(32,{unsigned:!0,moduloBitLength:64}),qn.double=function(t){const e=+t;if(!Number.isFinite(e))throw new TypeError("Argument is not a finite floating-point value");return e},qn["unrestricted double"]=function(t){const e=+t;if(isNaN(e))throw new TypeError("Argument is NaN");return e},qn.float=qn.double,qn["unrestricted float"]=qn["unrestricted double"],qn.DOMString=function(t,e){return e||(e={}),e.treatNullAsEmptyString&&null===t?"":String(t)},qn.ByteString=function(t,e){const n=String(t);let r;for(let t=0;void 0!==(r=n.codePointAt(t));++t)if(r>255)throw new TypeError("Argument is not a valid bytestring");return n},qn.USVString=function(t){const e=String(t),n=e.length,r=[];for(let t=0;t<n;++t){const o=e.charCodeAt(t);if(o<55296||o>57343)r.push(String.fromCodePoint(o));else if(56320<=o&&o<=57343)r.push(String.fromCodePoint(65533));else if(t===n-1)r.push(String.fromCodePoint(65533));else{const n=e.charCodeAt(t+1);if(56320<=n&&n<=57343){const e=1023&o,i=1023&n;r.push(String.fromCodePoint(65536+1024*e+i)),++t}else r.push(String.fromCodePoint(65533))}}return r.join("")},qn.Date=function(t,e){if(!(t instanceof Date))throw new TypeError("Argument is not a Date object");if(!isNaN(t))return t},qn.RegExp=function(t,e){return t instanceof RegExp||(t=new RegExp(t)),t};var Vn=Wn((function(t){t.exports.mixin=function(t,e){const n=Object.getOwnPropertyNames(e);for(let r=0;r<n.length;++r)Object.defineProperty(t,n[r],Object.getOwnPropertyDescriptor(e,n[r]))},t.exports.wrapperSymbol=Symbol("wrapper"),t.exports.implSymbol=Symbol("impl"),t.exports.wrapperForImpl=function(e){return e[t.exports.wrapperSymbol]},t.exports.implForWrapper=function(e){return e[t.exports.implSymbol]}}));Vn.mixin,Vn.wrapperSymbol,Vn.implSymbol,Vn.wrapperForImpl,Vn.implForWrapper;var Jn,Yn=(Jn=Object.freeze({__proto__:null}))&&Jn.default||Jn,Zn={TRANSITIONAL:0,NONTRANSITIONAL:1};function Kn(t){return t.split("\0").map((function(t){return t.normalize("NFC")})).join("\0")}function Xn(t){for(var e=0,n=Yn.length-1;e<=n;){var r=Math.floor((e+n)/2),o=Yn[r];if(o[0][0]<=t&&o[0][1]>=t)return o;o[0][0]>t?n=r-1:e=r+1}return null}var Qn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function tr(t){return t.replace(Qn,"_").length}var er=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;function nr(t,e){"xn--"===t.substr(0,4)&&(t=u.toUnicode(t));var n=!1;(Kn(t)!==t||"-"===t[3]&&"-"===t[4]||"-"===t[0]||"-"===t[t.length-1]||-1!==t.indexOf(".")||0===t.search(er))&&(n=!0);for(var r=tr(t),o=0;o<r;++o){var i=Xn(t.codePointAt(o));if(rr===Zn.TRANSITIONAL&&"valid"!==i[1]||rr===Zn.NONTRANSITIONAL&&"valid"!==i[1]&&"deviation"!==i[1]){n=!0;break}}return{label:t,error:n}}function rr(t,e,n){var r=function(t,e,n){for(var r=!1,o="",i=tr(t),s=0;s<i;++s){var a=t.codePointAt(s),u=Xn(a);switch(u[1]){case"disallowed":r=!0,o+=String.fromCodePoint(a);break;case"ignored":break;case"mapped":o+=String.fromCodePoint.apply(String,u[2]);break;case"deviation":o+=n===Zn.TRANSITIONAL?String.fromCodePoint.apply(String,u[2]):String.fromCodePoint(a);break;case"valid":o+=String.fromCodePoint(a);break;case"disallowed_STD3_mapped":e?(r=!0,o+=String.fromCodePoint(a)):o+=String.fromCodePoint.apply(String,u[2]);break;case"disallowed_STD3_valid":e&&(r=!0),o+=String.fromCodePoint(a)}}return{string:o,error:r}}(t,e,n);r.string=Kn(r.string);for(var o=r.string.split("."),i=0;i<o.length;++i)try{var s=nr(o[i]);o[i]=s.label,r.error=r.error||s.error}catch(t){r.error=!0}return{string:o.join("."),error:r.error}}var or={toASCII:function(t,e,n,r){var o=rr(t,e,n),i=o.string.split(".");if(i=i.map((function(t){try{return u.toASCII(t)}catch(e){return o.error=!0,t}})),r){var s=i.slice(0,i.length-1).join(".").length;(s.length>253||0===s.length)&&(o.error=!0);for(var a=0;a<i.length;++a)if(i.length>63||0===i.length){o.error=!0;break}}return o.error?null:i.join(".")},toUnicode:function(t,e){var n=rr(t,e,Zn.NONTRANSITIONAL);return{domain:n.string,error:n.error}},PROCESSING_OPTIONS:Zn},ir=Wn((function(t){const e={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},n=Symbol("failure");function r(t){return u.ucs2.decode(t).length}function o(t,e){const n=t[e];return isNaN(n)?void 0:String.fromCodePoint(n)}function i(t){return t>=48&&t<=57}function s(t){return t>=65&&t<=90||t>=97&&t<=122}function a(t){return i(t)||t>=65&&t<=70||t>=97&&t<=102}function c(t){return"."===t||"%2e"===t.toLowerCase()}function l(t){return 2===t.length&&s(t.codePointAt(0))&&(":"===t[1]||"|"===t[1])}function d(t){return void 0!==e[t]}function h(t){return d(t.scheme)}function p(t){let e=t.toString(16).toUpperCase();return 1===e.length&&(e="0"+e),"%"+e}function f(t){return t<=31||t>126}const v=new Set([32,34,35,60,62,63,96,123,125]);function m(t){return f(t)||v.has(t)}const b=new Set([47,58,59,61,64,91,92,93,94,124]);function y(t){return m(t)||b.has(t)}function g(t,e){const n=String.fromCodePoint(t);return e(t)?function(t){const e=new Buffer(t);let n="";for(let t=0;t<e.length;++t)n+=p(e[t]);return n}(n):n}function w(t){let e=10;if(t.length>=2&&"0"===t.charAt(0)&&"x"===t.charAt(1).toLowerCase()?(t=t.substring(2),e=16):t.length>=2&&"0"===t.charAt(0)&&(t=t.substring(1),e=8),""===t)return 0;return(10===e?/[^0-9]/:16===e?/[^0-9A-Fa-f]/:/[^0-7]/).test(t)?n:parseInt(t,e)}function _(t,e){if("["===t[0])return"]"!==t[t.length-1]?n:function(t){const e=[0,0,0,0,0,0,0,0];let r=0,s=null,c=0;if(58===(t=u.ucs2.decode(t))[c]){if(58!==t[c+1])return n;c+=2,++r,s=r}for(;c<t.length;){if(8===r)return n;if(58===t[c]){if(null!==s)return n;++c,++r,s=r;continue}let u=0,l=0;for(;l<4&&a(t[c]);)u=16*u+parseInt(o(t,c),16),++c,++l;if(46===t[c]){if(0===l)return n;if(c-=l,r>6)return n;let s=0;for(;void 0!==t[c];){let a=null;if(s>0){if(!(46===t[c]&&s<4))return n;++c}if(!i(t[c]))return n;for(;i(t[c]);){const e=parseInt(o(t,c));if(null===a)a=e;else{if(0===a)return n;a=10*a+e}if(a>255)return n;++c}e[r]=256*e[r]+a,++s,2!==s&&4!==s||++r}if(4!==s)return n;break}if(58===t[c]){if(++c,void 0===t[c])return n}else if(void 0!==t[c])return n;e[r]=u,++r}if(null!==s){let t=r-s;for(r=7;0!==r&&t>0;){const n=e[s+t-1];e[s+t-1]=e[r],e[r]=n,--r,--t}}else if(null===s&&8!==r)return n;return e}(t.substring(1,t.length-1));if(!e)return function(t){if(e=t,-1!==e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/))return n;var e;let r="";const o=u.ucs2.decode(t);for(let t=0;t<o.length;++t)r+=g(o[t],f);return r}(t);const r=function(t){const e=new Buffer(t),n=[];for(let t=0;t<e.length;++t)37!==e[t]?n.push(e[t]):37===e[t]&&a(e[t+1])&&a(e[t+2])?(n.push(parseInt(e.slice(t+1,t+3).toString(),16)),t+=2):n.push(e[t]);return new Buffer(n).toString()}(t),s=or.toASCII(r,!1,or.PROCESSING_OPTIONS.NONTRANSITIONAL,!1);if(null===s)return n;if(-1!==s.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/))return n;const c=function(t){const e=t.split(".");if(""===e[e.length-1]&&e.length>1&&e.pop(),e.length>4)return t;const r=[];for(const o of e){if(""===o)return t;const e=w(o);if(e===n)return t;r.push(e)}for(let t=0;t<r.length-1;++t)if(r[t]>255)return n;if(r[r.length-1]>=Math.pow(256,5-r.length))return n;let o=r.pop(),i=0;for(const t of r)o+=t*Math.pow(256,3-i),++i;return o}(s);return"number"==typeof c||c===n?c:s}function j(t){return"number"==typeof t?function(t){let e="",n=t;for(let t=1;t<=4;++t)e=String(n%256)+e,4!==t&&(e="."+e),n=Math.floor(n/256);return e}(t):t instanceof Array?"["+function(t){let e="";const n=function(t){let e=null,n=1,r=null,o=0;for(let i=0;i<t.length;++i)0!==t[i]?(o>n&&(e=r,n=o),r=null,o=0):(null===r&&(r=i),++o);return o>n&&(e=r,n=o),{idx:e,len:n}}(t).idx;let r=!1;for(let o=0;o<=7;++o)r&&0===t[o]||(r&&(r=!1),n!==o?(e+=t[o].toString(16),7!==o&&(e+=":")):(e+=0===o?"::":":",r=!0));return e}(t)+"]":t}function S(t){const e=t.path;var n;0!==e.length&&("file"===t.scheme&&1===e.length&&(n=e[0],/^[A-Za-z]:$/.test(n))||e.pop())}function A(t){return""!==t.username||""!==t.password}function E(t,e,r,o,i){if(this.pointer=0,this.input=t,this.base=e||null,this.encodingOverride=r||"utf-8",this.stateOverride=i,this.url=o,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};const t=function(t){return t.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}(this.input);t!==this.input&&(this.parseError=!0),this.input=t}const s=function(t){return t.replace(/\u0009|\u000A|\u000D/g,"")}(this.input);for(s!==this.input&&(this.parseError=!0),this.input=s,this.state=i||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=u.ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){const t=this.input[this.pointer],e=isNaN(t)?void 0:String.fromCodePoint(t),r=this["parse "+this.state](t,e);if(!r)break;if(r===n){this.failure=!0;break}}}E.prototype["parse scheme start"]=function(t,e){if(s(t))this.buffer+=e.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,n;this.state="no scheme",--this.pointer}return!0},E.prototype["parse scheme"]=function(t,e){if(function(t){return s(t)||i(t)}(t)||43===t||45===t||46===t)this.buffer+=e.toLowerCase();else if(58===t){if(this.stateOverride){if(h(this.url)&&!d(this.buffer))return!1;if(!h(this.url)&&d(this.buffer))return!1;if((A(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.buffer="",this.stateOverride)return!1;"file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):h(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":h(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,n;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},E.prototype["parse no scheme"]=function(t){return null===this.base||this.base.cannotBeABaseURL&&35!==t?n:(this.base.cannotBeABaseURL&&35===t?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},E.prototype["parse special relative or authority"]=function(t){return 47===t&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},E.prototype["parse path or authority"]=function(t){return 47===t?this.state="authority":(this.state="path",--this.pointer),!0},E.prototype["parse relative"]=function(t){return this.url.scheme=this.base.scheme,isNaN(t)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===t?this.state="relative slash":63===t?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===t?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):h(this.url)&&92===t?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},E.prototype["parse relative slash"]=function(t){return!h(this.url)||47!==t&&92!==t?47===t?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===t&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},E.prototype["parse special authority slashes"]=function(t){return 47===t&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},E.prototype["parse special authority ignore slashes"]=function(t){return 47!==t&&92!==t?(this.state="authority",--this.pointer):this.parseError=!0,!0},E.prototype["parse authority"]=function(t,e){if(64===t){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;const t=r(this.buffer);for(let e=0;e<t;++e){const t=this.buffer.codePointAt(e);if(58===t&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}const n=g(t,y);this.passwordTokenSeenFlag?this.url.password+=n:this.url.username+=n}this.buffer=""}else if(isNaN(t)||47===t||63===t||35===t||h(this.url)&&92===t){if(this.atFlag&&""===this.buffer)return this.parseError=!0,n;this.pointer-=r(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=e;return!0},E.prototype["parse hostname"]=E.prototype["parse host"]=function(t,e){if(this.stateOverride&&"file"===this.url.scheme)--this.pointer,this.state="file host";else if(58!==t||this.arrFlag)if(isNaN(t)||47===t||63===t||35===t||h(this.url)&&92===t){if(--this.pointer,h(this.url)&&""===this.buffer)return this.parseError=!0,n;if(this.stateOverride&&""===this.buffer&&(A(this.url)||null!==this.url.port))return this.parseError=!0,!1;const t=_(this.buffer,h(this.url));if(t===n)return n;if(this.url.host=t,this.buffer="",this.state="path start",this.stateOverride)return!1}else 91===t?this.arrFlag=!0:93===t&&(this.arrFlag=!1),this.buffer+=e;else{if(""===this.buffer)return this.parseError=!0,n;const t=_(this.buffer,h(this.url));if(t===n)return n;if(this.url.host=t,this.buffer="",this.state="port","hostname"===this.stateOverride)return!1}return!0},E.prototype["parse port"]=function(t,r){if(i(t))this.buffer+=r;else{if(!(isNaN(t)||47===t||63===t||35===t||h(this.url)&&92===t||this.stateOverride))return this.parseError=!0,n;if(""!==this.buffer){const t=parseInt(this.buffer);if(t>Math.pow(2,16)-1)return this.parseError=!0,n;this.url.port=t===(o=this.url.scheme,e[o])?null:t,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}var o;return!0};const C=new Set([47,92,63,35]);E.prototype["parse file"]=function(t){var e,n;return this.url.scheme="file",47===t||92===t?(92===t&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(t)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===t?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===t?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(this.input.length-this.pointer-1==0||(e=t,n=this.input[this.pointer+1],!s(e)||58!==n&&124!==n)||this.input.length-this.pointer-1>=2&&!C.has(this.input[this.pointer+2])?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),S(this.url)):this.parseError=!0,this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},E.prototype["parse file slash"]=function(t){var e;return 47===t||92===t?(92===t&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(2===(e=this.base.path[0]).length&&s(e.codePointAt(0))&&":"===e[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},E.prototype["parse file host"]=function(t,e){if(isNaN(t)||47===t||92===t||63===t||35===t)if(--this.pointer,!this.stateOverride&&l(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let t=_(this.buffer,h(this.url));if(t===n)return n;if("localhost"===t&&(t=""),this.url.host=t,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=e;return!0},E.prototype["parse path start"]=function(t){return h(this.url)?(92===t&&(this.parseError=!0),this.state="path",47!==t&&92!==t&&--this.pointer):this.stateOverride||63!==t?this.stateOverride||35!==t?void 0!==t&&(this.state="path",47!==t&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},E.prototype["parse path"]=function(t){if(isNaN(t)||47===t||h(this.url)&&92===t||!this.stateOverride&&(63===t||35===t)){if(h(this.url)&&92===t&&(this.parseError=!0),".."===(e=(e=this.buffer).toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e?(S(this.url),47===t||h(this.url)&&92===t||this.url.path.push("")):!c(this.buffer)||47===t||h(this.url)&&92===t?c(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&l(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="","file"===this.url.scheme&&(void 0===t||63===t||35===t))for(;this.url.path.length>1&&""===this.url.path[0];)this.parseError=!0,this.url.path.shift();63===t&&(this.url.query="",this.state="query"),35===t&&(this.url.fragment="",this.state="fragment")}else 37!==t||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=g(t,m);var e;return!0},E.prototype["parse cannot-be-a-base-URL path"]=function(t){return 63===t?(this.url.query="",this.state="query"):35===t?(this.url.fragment="",this.state="fragment"):(isNaN(t)||37===t||(this.parseError=!0),37!==t||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),isNaN(t)||(this.url.path[0]=this.url.path[0]+g(t,f))),!0},E.prototype["parse query"]=function(t,e){if(isNaN(t)||!this.stateOverride&&35===t){h(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8");const e=new Buffer(this.buffer);for(let t=0;t<e.length;++t)e[t]<33||e[t]>126||34===e[t]||35===e[t]||60===e[t]||62===e[t]?this.url.query+=p(e[t]):this.url.query+=String.fromCodePoint(e[t]);this.buffer="",35===t&&(this.url.fragment="",this.state="fragment")}else 37!==t||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=e;return!0},E.prototype["parse fragment"]=function(t){return isNaN(t)||(0===t?this.parseError=!0:(37!==t||a(this.input[this.pointer+1])&&a(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=g(t,f))),!0},t.exports.serializeURL=function(t,e){let n=t.scheme+":";if(null!==t.host?(n+="//",""===t.username&&""===t.password||(n+=t.username,""!==t.password&&(n+=":"+t.password),n+="@"),n+=j(t.host),null!==t.port&&(n+=":"+t.port)):null===t.host&&"file"===t.scheme&&(n+="//"),t.cannotBeABaseURL)n+=t.path[0];else for(const e of t.path)n+="/"+e;return null!==t.query&&(n+="?"+t.query),e||null===t.fragment||(n+="#"+t.fragment),n},t.exports.serializeURLOrigin=function(e){switch(e.scheme){case"blob":try{return t.exports.serializeURLOrigin(t.exports.parseURL(e.path[0]))}catch(t){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return function(t){let e=t.scheme+"://";return e+=j(t.host),null!==t.port&&(e+=":"+t.port),e}({scheme:e.scheme,host:e.host,port:e.port});case"file":return"file://";default:return"null"}},t.exports.basicURLParse=function(t,e){void 0===e&&(e={});const n=new E(t,e.baseURL,e.encodingOverride,e.url,e.stateOverride);return n.failure?"failure":n.url},t.exports.setTheUsername=function(t,e){t.username="";const n=u.ucs2.decode(e);for(let e=0;e<n.length;++e)t.username+=g(n[e],y)},t.exports.setThePassword=function(t,e){t.password="";const n=u.ucs2.decode(e);for(let e=0;e<n.length;++e)t.password+=g(n[e],y)},t.exports.serializeHost=j,t.exports.cannotHaveAUsernamePasswordPort=function(t){return null===t.host||""===t.host||t.cannotBeABaseURL||"file"===t.scheme},t.exports.serializeInteger=function(t){return String(t)},t.exports.parseURL=function(e,n){return void 0===n&&(n={}),t.exports.basicURLParse(e,{baseURL:n.baseURL,encodingOverride:n.encodingOverride})}}));ir.serializeURL,ir.serializeURLOrigin,ir.basicURLParse,ir.setTheUsername,ir.setThePassword,ir.serializeHost,ir.cannotHaveAUsernamePasswordPort,ir.serializeInteger,ir.parseURL;var sr=class{constructor(t){const e=t[0],n=t[1];let r=null;if(void 0!==n&&(r=ir.basicURLParse(n),"failure"===r))throw new TypeError("Invalid base URL");const o=ir.basicURLParse(e,{baseURL:r});if("failure"===o)throw new TypeError("Invalid URL");this._url=o}get href(){return ir.serializeURL(this._url)}set href(t){const e=ir.basicURLParse(t);if("failure"===e)throw new TypeError("Invalid URL");this._url=e}get origin(){return ir.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(t){ir.basicURLParse(t+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(t){ir.cannotHaveAUsernamePasswordPort(this._url)||ir.setTheUsername(this._url,t)}get password(){return this._url.password}set password(t){ir.cannotHaveAUsernamePasswordPort(this._url)||ir.setThePassword(this._url,t)}get host(){const t=this._url;return null===t.host?"":null===t.port?ir.serializeHost(t.host):ir.serializeHost(t.host)+":"+ir.serializeInteger(t.port)}set host(t){this._url.cannotBeABaseURL||ir.basicURLParse(t,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":ir.serializeHost(this._url.host)}set hostname(t){this._url.cannotBeABaseURL||ir.basicURLParse(t,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":ir.serializeInteger(this._url.port)}set port(t){ir.cannotHaveAUsernamePasswordPort(this._url)||(""===t?this._url.port=null:ir.basicURLParse(t,{url:this._url,stateOverride:"port"}))}get pathname(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")}set pathname(t){this._url.cannotBeABaseURL||(this._url.path=[],ir.basicURLParse(t,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query}set search(t){const e=this._url;if(""===t)return void(e.query=null);const n="?"===t[0]?t.substring(1):t;e.query="",ir.basicURLParse(n,{url:e,stateOverride:"query"})}get hash(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment}set hash(t){if(""===t)return void(this._url.fragment=null);const e="#"===t[0]?t.substring(1):t;this._url.fragment="",ir.basicURLParse(e,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}},ar=Wn((function(t){const e=Vn.implSymbol;function n(r){if(!this||this[e]||!(this instanceof n))throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");if(arguments.length<1)throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.");const o=[];for(let t=0;t<arguments.length&&t<2;++t)o[t]=arguments[t];o[0]=$n.USVString(o[0]),void 0!==o[1]&&(o[1]=$n.USVString(o[1])),t.exports.setup(this,o)}n.prototype.toJSON=function(){if(!this||!t.exports.is(this))throw new TypeError("Illegal invocation");const n=[];for(let t=0;t<arguments.length&&t<0;++t)n[t]=arguments[t];return this[e].toJSON.apply(this[e],n)},Object.defineProperty(n.prototype,"href",{get(){return this[e].href},set(t){t=$n.USVString(t),this[e].href=t},enumerable:!0,configurable:!0}),n.prototype.toString=function(){if(!this||!t.exports.is(this))throw new TypeError("Illegal invocation");return this.href},Object.defineProperty(n.prototype,"origin",{get(){return this[e].origin},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"protocol",{get(){return this[e].protocol},set(t){t=$n.USVString(t),this[e].protocol=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"username",{get(){return this[e].username},set(t){t=$n.USVString(t),this[e].username=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"password",{get(){return this[e].password},set(t){t=$n.USVString(t),this[e].password=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"host",{get(){return this[e].host},set(t){t=$n.USVString(t),this[e].host=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hostname",{get(){return this[e].hostname},set(t){t=$n.USVString(t),this[e].hostname=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"port",{get(){return this[e].port},set(t){t=$n.USVString(t),this[e].port=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pathname",{get(){return this[e].pathname},set(t){t=$n.USVString(t),this[e].pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"search",{get(){return this[e].search},set(t){t=$n.USVString(t),this[e].search=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hash",{get(){return this[e].hash},set(t){t=$n.USVString(t),this[e].hash=t},enumerable:!0,configurable:!0}),t.exports={is:t=>!!t&&t[e]instanceof sr,create(t,e){let r=Object.create(n.prototype);return this.setup(r,t,e),r},setup(t,n,r){r||(r={}),r.wrapper=t,t[e]=new sr(n,r),t[e][Vn.wrapperSymbol]=t},interface:n,expose:{Window:{URL:n},Worker:{URL:n}}}}));ar.is,ar.create,ar.setup,ar.expose;var ur={URL:ar.interface,serializeURL:ir.serializeURL,serializeURLOrigin:ir.serializeURLOrigin,basicURLParse:ir.basicURLParse,setTheUsername:ir.setTheUsername,setThePassword:ir.setThePassword,serializeHost:ir.serializeHost,serializeInteger:ir.serializeInteger,parseURL:ir.parseURL};const cr=r.Readable,lr=Symbol("buffer"),dr=Symbol("type");class hr{constructor(){this[dr]="";const t=arguments[0],e=arguments[1],n=[];let r=0;if(t){const e=t,o=Number(e.length);for(let t=0;t<o;t++){const o=e[t];let i;i=o instanceof Buffer?o:ArrayBuffer.isView(o)?Buffer.from(o.buffer,o.byteOffset,o.byteLength):o instanceof ArrayBuffer?Buffer.from(o):o instanceof hr?o[lr]:Buffer.from("string"==typeof o?o:String(o)),r+=i.length,n.push(i)}}this[lr]=Buffer.concat(n);let o=e&&void 0!==e.type&&String(e.type).toLowerCase();o&&!/[^\u0020-\u007E]/.test(o)&&(this[dr]=o)}get size(){return this[lr].length}get type(){return this[dr]}text(){return Promise.resolve(this[lr].toString())}arrayBuffer(){const t=this[lr],e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return Promise.resolve(e)}stream(){const t=new cr;return t._read=function(){},t.push(this[lr]),t.push(null),t}toString(){return"[object Blob]"}slice(){const t=this.size,e=arguments[0],n=arguments[1];let r,o;r=void 0===e?0:e<0?Math.max(t+e,0):Math.min(e,t),o=void 0===n?t:n<0?Math.max(t+n,0):Math.min(n,t);const i=Math.max(o-r,0),s=this[lr].slice(r,r+i),a=new hr([],{type:arguments[2]});return a[lr]=s,a}}function pr(t,e,n){Error.call(this,t),this.message=t,this.type=e,n&&(this.code=this.errno=n.code),Error.captureStackTrace(this,this.constructor)}let fr;Object.defineProperties(hr.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(hr.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),pr.prototype=Object.create(Error.prototype),pr.prototype.constructor=pr,pr.prototype.name="FetchError";try{fr=require("encoding").convert}catch(t){}const vr=Symbol("Body internals"),mr=r.PassThrough;function br(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.size;let i=void 0===o?0:o;var s=n.timeout;let a=void 0===s?0:s;null==t?t=null:gr(t)?t=Buffer.from(t.toString()):wr(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof r||(t=Buffer.from(String(t)))),this[vr]={body:t,disturbed:!1,error:null},this.size=i,this.timeout=a,t instanceof r&&t.on("error",(function(t){const n="AbortError"===t.name?t:new pr(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t);e[vr].error=n}))}function yr(){var t=this;if(this[vr].disturbed)return br.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[vr].disturbed=!0,this[vr].error)return br.Promise.reject(this[vr].error);let e=this.body;if(null===e)return br.Promise.resolve(Buffer.alloc(0));if(wr(e)&&(e=e.stream()),Buffer.isBuffer(e))return br.Promise.resolve(e);if(!(e instanceof r))return br.Promise.resolve(Buffer.alloc(0));let n=[],o=0,i=!1;return new br.Promise((function(r,s){let a;t.timeout&&(a=setTimeout((function(){i=!0,s(new pr(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),e.on("error",(function(e){"AbortError"===e.name?(i=!0,s(e)):s(new pr(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),e.on("data",(function(e){if(!i&&null!==e){if(t.size&&o+e.length>t.size)return i=!0,void s(new pr(`content size at ${t.url} over limit: ${t.size}`,"max-size"));o+=e.length,n.push(e)}})),e.on("end",(function(){if(!i){clearTimeout(a);try{r(Buffer.concat(n,o))}catch(e){s(new pr(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function gr(t){return"object"==typeof t&&"function"==typeof t.append&&"function"==typeof t.delete&&"function"==typeof t.get&&"function"==typeof t.getAll&&"function"==typeof t.has&&"function"==typeof t.set&&("URLSearchParams"===t.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(t)||"function"==typeof t.sort)}function wr(t){return"object"==typeof t&&"function"==typeof t.arrayBuffer&&"string"==typeof t.type&&"function"==typeof t.stream&&"function"==typeof t.constructor&&"string"==typeof t.constructor.name&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function _r(t){let e,n,o=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof r&&"function"!=typeof o.getBoundary&&(e=new mr,n=new mr,o.pipe(e),o.pipe(n),t[vr].body=e,o=n),o}function jr(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":gr(t)?"application/x-www-form-urlencoded;charset=UTF-8":wr(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof r?null:"text/plain;charset=UTF-8"}function Sr(t){const e=t.body;return null===e?0:wr(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0==e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}br.prototype={get body(){return this[vr].body},get bodyUsed(){return this[vr].disturbed},arrayBuffer(){return yr.call(this).then((function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}))},blob(){let t=this.headers&&this.headers.get("content-type")||"";return yr.call(this).then((function(e){return Object.assign(new hr([],{type:t.toLowerCase()}),{[lr]:e})}))},json(){var t=this;return yr.call(this).then((function(e){try{return JSON.parse(e.toString())}catch(e){return br.Promise.reject(new pr(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}}))},text(){return yr.call(this).then((function(t){return t.toString()}))},buffer(){return yr.call(this)},textConverted(){var t=this;return yr.call(this).then((function(e){return function(t,e){if("function"!=typeof fr)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=e.get("content-type");let r,o,i="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));o=t.slice(0,1024).toString(),!r&&o&&(r=/<meta.+?charset=(['"])(.+?)\1/i.exec(o));!r&&o&&(r=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(o),r||(r=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(o),r&&r.pop()),r&&(r=/charset=(.*)/i.exec(r.pop())));!r&&o&&(r=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(o));r&&(i=r.pop(),"gb2312"!==i&&"gbk"!==i||(i="gb18030"));return fr(t,"UTF-8",i).toString()}(e,t.headers)}))}},Object.defineProperties(br.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),br.mixIn=function(t){for(const e of Object.getOwnPropertyNames(br.prototype))if(!(e in t)){const n=Object.getOwnPropertyDescriptor(br.prototype,e);Object.defineProperty(t,e,n)}},br.Promise=global.Promise;const Ar=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Er=/[^\t\x20-\x7e\x80-\xff]/;function Cr(t){if(t=`${t}`,Ar.test(t)||""===t)throw new TypeError(`${t} is not a legal HTTP header name`)}function xr(t){if(t=`${t}`,Er.test(t))throw new TypeError(`${t} is not a legal HTTP header value`)}function Or(t,e){e=e.toLowerCase();for(const n in t)if(n.toLowerCase()===e)return n}const Ir=Symbol("map");class kr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[Ir]=Object.create(null),t instanceof kr){const e=t.raw(),n=Object.keys(e);for(const t of n)for(const n of e[t])this.append(t,n)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const n=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(e))}for(const t of n){if(2!==t.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(t[0],t[1])}}else for(const e of Object.keys(t)){const n=t[e];this.append(e,n)}}}}get(t){Cr(t=`${t}`);const e=Or(this[Ir],t);return void 0===e?null:this[Ir][e].join(", ")}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=Ur(this),r=0;for(;r<n.length;){var o=n[r];const i=o[0],s=o[1];t.call(e,s,i,this),n=Ur(this),r++}}set(t,e){e=`${e}`,Cr(t=`${t}`),xr(e);const n=Or(this[Ir],t);this[Ir][void 0!==n?n:t]=[e]}append(t,e){e=`${e}`,Cr(t=`${t}`),xr(e);const n=Or(this[Ir],t);void 0!==n?this[Ir][n].push(e):this[Ir][t]=[e]}has(t){return Cr(t=`${t}`),void 0!==Or(this[Ir],t)}delete(t){Cr(t=`${t}`);const e=Or(this[Ir],t);void 0!==e&&delete this[Ir][e]}raw(){return this[Ir]}keys(){return Dr(this,"key")}values(){return Dr(this,"value")}[Symbol.iterator](){return Dr(this,"key+value")}}function Ur(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";const n=Object.keys(t[Ir]).sort();return n.map("key"===e?function(t){return t.toLowerCase()}:"value"===e?function(e){return t[Ir][e].join(", ")}:function(e){return[e.toLowerCase(),t[Ir][e].join(", ")]})}kr.prototype.entries=kr.prototype[Symbol.iterator],Object.defineProperty(kr.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(kr.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const Pr=Symbol("internal");function Dr(t,e){const n=Object.create(Nr);return n[Pr]={target:t,kind:e,index:0},n}const Nr=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==Nr)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[Pr];const e=t.target,n=t.kind,r=t.index,o=Ur(e,n);return r>=o.length?{value:void 0,done:!0}:(this[Pr].index=r+1,{value:o[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function Br(t){const e=Object.assign({__proto__:null},t[Ir]),n=Or(t[Ir],"Host");return void 0!==n&&(e[n]=e[n][0]),e}Object.defineProperty(Nr,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const Tr=Symbol("Response internals"),Lr=i.STATUS_CODES;class Fr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};br.call(this,t,e);const n=e.status||200,r=new kr(e.headers);if(null!=t&&!r.has("Content-Type")){const e=jr(t);e&&r.append("Content-Type",e)}this[Tr]={url:e.url,status:n,statusText:e.statusText||Lr[n],headers:r,counter:e.counter}}get url(){return this[Tr].url||""}get status(){return this[Tr].status}get ok(){return this[Tr].status>=200&&this[Tr].status<300}get redirected(){return this[Tr].counter>0}get statusText(){return this[Tr].statusText}get headers(){return this[Tr].headers}clone(){return new Fr(_r(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}br.mixIn(Fr.prototype),Object.defineProperties(Fr.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Fr.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const Rr=Symbol("Request internals"),Mr=s.URL||ur.URL,zr=s.parse,Wr=s.format;function qr(t){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(t)&&(t=new Mr(t).toString()),zr(t)}const $r="destroy"in r.Readable.prototype;function Gr(t){return"object"==typeof t&&"object"==typeof t[Rr]}class Hr{constructor(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Gr(t)?e=qr(t.url):(e=t&&t.href?qr(t.href):qr(`${t}`),t={});let r=n.method||t.method||"GET";if(r=r.toUpperCase(),(null!=n.body||Gr(t)&&null!==t.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let o=null!=n.body?n.body:Gr(t)&&null!==t.body?_r(t):null;br.call(this,o,{timeout:n.timeout||t.timeout||0,size:n.size||t.size||0});const i=new kr(n.headers||t.headers||{});if(null!=o&&!i.has("Content-Type")){const t=jr(o);t&&i.append("Content-Type",t)}let s=Gr(t)?t.signal:null;if("signal"in n&&(s=n.signal),null!=s&&!function(t){const e=t&&"object"==typeof t&&Object.getPrototypeOf(t);return!(!e||"AbortSignal"!==e.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[Rr]={method:r,redirect:n.redirect||t.redirect||"follow",headers:i,parsedURL:e,signal:s},this.follow=void 0!==n.follow?n.follow:void 0!==t.follow?t.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===t.compress||t.compress,this.counter=n.counter||t.counter||0,this.agent=n.agent||t.agent}get method(){return this[Rr].method}get url(){return Wr(this[Rr].parsedURL)}get headers(){return this[Rr].headers}get redirect(){return this[Rr].redirect}get signal(){return this[Rr].signal}clone(){return new Hr(this)}}function Vr(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}br.mixIn(Hr.prototype),Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Hr.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),Vr.prototype=Object.create(Error.prototype),Vr.prototype.constructor=Vr,Vr.prototype.name="AbortError";const Jr=s.URL||ur.URL,Yr=r.PassThrough;function Zr(t,e){if(!Zr.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return br.Promise=Zr.Promise,new Zr.Promise((function(n,o){const s=new Hr(t,e),a=function(t){const e=t[Rr].parsedURL,n=new kr(t[Rr].headers);if(n.has("Accept")||n.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof r.Readable&&!$r)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(o="0"),null!=t.body){const e=Sr(t);"number"==typeof e&&(o=String(e))}o&&n.set("Content-Length",o),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let i=t.agent;return"function"==typeof i&&(i=i(e)),n.has("Connection")||i||n.set("Connection","close"),Object.assign({},e,{method:t.method,headers:Br(n),agent:i})}(s),u=("https:"===a.protocol?c:i).request,d=s.signal;let h=null;const p=function(){let t=new Vr("The user aborted a request.");o(t),s.body&&s.body instanceof r.Readable&&s.body.destroy(t),h&&h.body&&h.body.emit("error",t)};if(d&&d.aborted)return void p();const f=function(){p(),b()},v=u(a);let m;function b(){v.abort(),d&&d.removeEventListener("abort",f),clearTimeout(m)}d&&d.addEventListener("abort",f),s.timeout&&v.once("socket",(function(t){m=setTimeout((function(){o(new pr(`network timeout at: ${s.url}`,"request-timeout")),b()}),s.timeout)})),v.on("error",(function(t){o(new pr(`request to ${s.url} failed, reason: ${t.message}`,"system",t)),b()})),v.on("response",(function(t){clearTimeout(m);const e=function(t){const e=new kr;for(const n of Object.keys(t))if(!Ar.test(n))if(Array.isArray(t[n]))for(const r of t[n])Er.test(r)||(void 0===e[Ir][n]?e[Ir][n]=[r]:e[Ir][n].push(r));else Er.test(t[n])||(e[Ir][n]=[t[n]]);return e}(t.headers);if(Zr.isRedirect(t.statusCode)){const r=e.get("Location");let i=null;try{i=null===r?null:new Jr(r,s.url).toString()}catch(t){if("manual"!==s.redirect)return o(new pr(`uri requested responds with an invalid redirect URL: ${r}`,"invalid-redirect")),void b()}switch(s.redirect){case"error":return o(new pr(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`,"no-redirect")),void b();case"manual":if(null!==i)try{e.set("Location",i)}catch(t){o(t)}break;case"follow":if(null===i)break;if(s.counter>=s.follow)return o(new pr(`maximum redirect reached at: ${s.url}`,"max-redirect")),void b();const r={headers:new kr(s.headers),follow:s.follow,counter:s.counter+1,agent:s.agent,compress:s.compress,method:s.method,body:s.body,signal:s.signal,timeout:s.timeout,size:s.size};if(!function(t,e){const n=new Jr(e).hostname,r=new Jr(t).hostname;return n===r||"."===n[n.length-r.length-1]&&n.endsWith(r)}(s.url,i))for(const t of["authorization","www-authenticate","cookie","cookie2"])r.headers.delete(t);return 303!==t.statusCode&&s.body&&null===Sr(s)?(o(new pr("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void b()):(303!==t.statusCode&&(301!==t.statusCode&&302!==t.statusCode||"POST"!==s.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),n(Zr(new Hr(i,r))),void b())}}t.once("end",(function(){d&&d.removeEventListener("abort",f)}));let r=t.pipe(new Yr);const i={url:s.url,status:t.statusCode,statusText:t.statusMessage,headers:e,size:s.size,timeout:s.timeout,counter:s.counter},a=e.get("Content-Encoding");if(!s.compress||"HEAD"===s.method||null===a||204===t.statusCode||304===t.statusCode)return h=new Fr(r,i),void n(h);const u={flush:l.Z_SYNC_FLUSH,finishFlush:l.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return r=r.pipe(l.createGunzip(u)),h=new Fr(r,i),void n(h);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof l.createBrotliDecompress)return r=r.pipe(l.createBrotliDecompress()),h=new Fr(r,i),void n(h);h=new Fr(r,i),n(h)}else{t.pipe(new Yr).once("data",(function(t){r=8==(15&t[0])?r.pipe(l.createInflate()):r.pipe(l.createInflateRaw()),h=new Fr(r,i),n(h)}))}})),function(t,e){const n=e.body;null===n?t.end():wr(n)?n.stream().pipe(t):Buffer.isBuffer(n)?(t.write(n),t.end()):n.pipe(t)}(v,s)}))}Zr.isRedirect=function(t){return 301===t||302===t||303===t||307===t||308===t},Zr.Promise=global.Promise;var Kr=function(){function t(t){this.contextProvider=t}return t.prototype.getServiceDetails=function(t,e){return E(this,void 0,void 0,(function(){return C(this,(function(n){return[2,this.fetch("".concat(this.contextProvider.getCurrentBaseUrl(),"/v1/port-forwarding/info/projects/").concat(t,"/services/").concat(e))]}))}))},t.prototype.getAddonDetails=function(t,e){return E(this,void 0,void 0,(function(){return C(this,(function(n){return[2,this.fetch("".concat(this.contextProvider.getCurrentBaseUrl(),"/v1/port-forwarding/info/projects/").concat(t,"/addons/").concat(e))]}))}))},t.prototype.fetch=function(t,e){return E(this,void 0,void 0,(function(){var n,r,o,i,s;return C(this,(function(a){switch(a.label){case 0:return n=zn({},{headers:{Authorization:"Bearer ".concat(this.contextProvider.getCurrentToken()),"Content-Type":"application/json"}},A({},e)),[4,Zr(t,n)];case 1:return(r=a.sent()).ok?[3,3]:(o=Error.bind,s=(i=JSON).stringify,[4,r.json()]);case 2:throw new(o.apply(Error,[void 0,s.apply(i,[a.sent()])]));case 3:return[4,r.json()];case 4:return[2,a.sent()]}}))}))},t}(),Xr=function(t,e,n){return E(void 0,void 0,void 0,(function(){var r,o,i,s,a;return C(this,(function(u){switch(u.label){case 0:if(r=eo(e||"127.0.0.1"),(o=eo(n||"127.255.255.255"))<r)throw new Error("Invalid IP range");"darwin"===d.platform()&&(i=function(t){return E(void 0,void 0,void 0,(function(){var e;return C(this,(function(n){switch(n.label){case 0:return e="lo0 alias ".concat(t," up"),[4,to.apply(void 0,e.split(" "))];case 1:return n.sent(),[2]}}))}))}),s=r,u.label=1;case 1:return s<=o?(a=no(s),[4,Qr(t,a)]):[3,6];case 2:return u.sent()?i?[4,i(a)]:[3,4]:[3,5];case 3:u.sent(),u.label=4;case 4:return[2,a];case 5:return s+=1,[3,1];case 6:throw new Error("No ip available")}}))}))},Qr=function(t,e){return new Promise((function(n){var r=new f,o=!1;r.on("connect",(function(){o=!0,r.destroy()})),r.setTimeout(400),r.on("timeout",(function(){o=!1,r.destroy()})),r.on("error",(function(){o=!1})),r.on("close",(function(){n(!o)})),e?r.connect(t,e):r.connect(t)}))},to=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return E(void 0,void 0,void 0,(function(){return C(this,(function(e){switch(e.label){case 0:return"/sbin/ifconfig",[4,ro("/sbin/ifconfig",t).resultPromise];case 1:return[2,e.sent()]}}))}))},eo=function(t){var e=t.split(".").reverse();if(4!==e.length)throw new Error("Invalid ip address: ".concat(t));for(var n=0,r=0;r<4;r+=1){var o=Number.parseInt(e[r],10);if(o<0||o>255)throw new Error("Invalid ip address: ".concat(t));n+=o<<8*r}return n},no=function(t){if(!Number.isSafeInteger(t))throw new Error("Number is not an integer");if(t<0||t>4294967295)throw new Error("Number is out of range 0x0-0xffffffff");for(var e=[],n=0;n<4;n+=1)e.push(t>>8*n&255);return e.reverse().join(".")},ro=function(t,e,n){var r=v(t,e,A({windowsHide:!0},n)),o=new Promise((function(o,i){var s="",a="";(null===(null==n?void 0:n.stdio)||void 0===(null==n?void 0:n.stdio))&&(r.stdout&&r.stdout.on("data",(function(t){s+=t})),r.stderr&&r.stderr.on("data",(function(t){a+=t}))),r.on("close",(function(n){var r={code:n,stdout:s,stderr:a};if(0!==n){var u="Error during execution of command '".concat(t," ").concat(e.join(" "),"': ").concat(a);i({message:u,result:r})}else o(r)}))}));return{process:r,resultPromise:o}},oo=function(t,e,n){return E(void 0,void 0,void 0,(function(){var r,o;return C(this,(function(i){switch(i.label){case 0:return r=io(t,10),[4,b.promises.writeFile(r,e,n)];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,4,,6]),[4,b.promises.rename(r,t)];case 3:return i.sent(),[3,6];case 4:return o=i.sent(),[4,b.promises.unlink(r).catch((function(){}))];case 5:throw i.sent(),o;case 6:return[2]}}))}))},io=function(t,e){for(var n,r=y.dirname(t),o=y.basename(t),i=0;null===(n=i<e)||void 0===n||n;i+=1){var s=x([],Array(16),!0).map((function(){return Math.floor(16*Math.random()).toString(16)})).join(""),a=".".concat(s,".").concat(o),u=y.join(r,a);if(!b.existsSync(u))return u}throw new Error("Could not write file to file '".concat(t,"'."))},so="win32"===process.platform?"\r\n":"\n",ao=function(){function t(t,e){this.nodes=t,this.config=e}return t.prototype.add=function(t,e,n){var r=this;if(0===e.length)return this;var o=this.findOrCreateEntry(t,n);return e.forEach((function(t){if(!o.hosts.find((function(e){return e.host===t}))){var e=1;0===o.hosts.length&&(e=r.config.indent-"".concat(o.ipPrefixWhitespace).concat(o.ip).length),o.hosts.push({whitespace:" ".repeat(e<1?1:e),host:t})}})),this},t.prototype.remove=function(t,e){var n=this;return this.findEntries(t).forEach((function(t){e.forEach((function(e){var r=t.hosts.findIndex((function(t){return t.host===e}));r<0||(0===r&&void 0!==t.hosts[1]&&(t.hosts[1].whitespace=t.hosts[0].whitespace),t.hosts.splice(r,1),0===t.hosts.length&&n.removeEntry(t))}))})),this},t.prototype.removeHosts=function(t){var e=this;vo(this.nodes,"entry").forEach((function(n){e.remove(n.ip,t)}))},t.prototype.removeIps=function(t){var e=this;return t.forEach((function(t){e.findEntries(t).forEach((function(t){return e.removeEntry(t)}))})),this},t.prototype.resolveHosts=function(t){return Tn(this.findEntries(t),(function(t){return t.hosts.map((function(t){return t.host}))}))},t.prototype.resolveIps=function(t){return vo(this.nodes,"entry").filter((function(e){return e.hosts.some((function(e){return e.host===t}))})).map((function(t){return t.ip}))},t.prototype.toString=function(){return ho(this.nodes,this.config.eol)},t.prototype.removeEntry=function(t){var e,n="number"==typeof(e=t)||R(e)&&"[object Number]"==F(e)?t:this.nodes.findIndex((function(e){return e===t}));n<0||this.nodes.splice(n,1)},t.prototype.findEntries=function(t){return vo(this.nodes,"entry").filter((function(e){return e.ip===t}))},t.prototype.findOrCreateEntry=function(t,e){var n=this.findEntries(t)[0];if(n)return n;var r=this.makeEntry(t);if(e){var o=lo(e),i=this.nodes.findIndex((function(t){return"comment"===t.type&&t.line===o}));if(i>=0)this.insertAt(i+1,r);else{var s="blank"!==this.nodes[this.nodes.length-1].type?[uo(),co(o),r]:[co(o),r];this.insertAt.apply(this,x([this.nodes.length],s,!1))}}else this.insertAt(this.nodes.length,r);return r},t.prototype.insertAt=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(e=this.nodes).splice.apply(e,x([t,0],n,!1))},t.prototype.makeEntry=function(t,e){var n=this.config.ipPrefixWhitespace;return A({type:"entry",ip:t,ipPrefixWhitespace:n,hosts:[]},e)},t.fromNodes=function(e,n){var r,o;return new t(e.filter((function(t){return"eol"!==t.type})),{eol:null!==(r=null==n?void 0:n.eol)&&void 0!==r?r:function(){var t,n=vo(e,"eol").map((function(t){return t.line}));return null!==(t=mo(n))&&void 0!==t?t:so}(),indent:null!==(o=null==n?void 0:n.indent)&&void 0!==o?o:function(){var t,n=Tn(vo(e,"entry"),(function(t){var e=t.ipPrefixWhitespace,n=t.ip,r=t.hosts[0];return r?["".concat(e).concat(n).concat(r.whitespace).length]:[]}));return null!==(t=mo(n))&&void 0!==t?t:17}(),ipPrefixWhitespace:""})},t.parse=function(t,e){return this.fromNodes(po(t),e)},t}(),uo=function(){return{type:"blank",line:""}},co=function(t){return{type:"comment",line:lo(t)}},lo=function(t){return t.startsWith("#")?t:"# ".concat(t)},ho=function(t,e){var n=t.map((function(t){switch(t.type){case"entry":var e=t.hosts.map((function(t){var e=t.whitespace,n=t.host;return"".concat(e).concat(n)})).join("");return"".concat(t.ipPrefixWhitespace).concat(t.ip).concat(e);case"blank":case"comment":case"invalid":return t.line;default:return""}}));return n.join(null!=e?e:so)},po=function(t){return t.split(/(\r?\n)/).map((function(t){return function(t){return t.match(/^\s*#.*$/)}(t)?{type:"comment",line:t}:function(t){return t.match(/^(\r?\n)$/)}(t)?{type:"eol",line:t}:function(t){return t.match(/^\s*$/)}(t)?{type:"blank",line:t}:fo(t)}))},fo=function(t){var e=t.match(/^(\s*)(\S+)(.+)?$/);if(!e)return{type:"invalid",line:t};var n=e[1],r=e[2],o=e.slice(3),i=!1,s=Tn(o.filter((function(t){return void 0!==t})),(function(t){var e=t.match(/(\s+)(\S+)/g);return e?e.map((function(t){var e=t.match(/^(\s+)(\S+)$/);e||(i=!0);var n=null!=e?e:[];return{whitespace:n[1],host:n[2]}})):(i=!0,[])}));return i?{type:"invalid",line:t}:{type:"entry",ipPrefixWhitespace:n,ip:r,hosts:s}},vo=function(t,e){return t.filter((function(t){return t.type===e}))},mo=function(t){var e=new Map;t.forEach((function(t){var n;e.set(t,(null!==(n=e.get(t))&&void 0!==n?n:0)+1)}));var n=Rn(Array.from(e.entries()),(function(t){return t[1]}));if(n)return n[0]},bo="win32"===process.platform?"C:/Windows/System32/drivers/etc/hosts":"/etc/hosts",yo=function(){function t(t){this.ast=ao.fromNodes([]);var e={writeMode:"atomic",hostsFile:bo};this.config=A(A({},e),t)}return t.prototype.add=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!Fn(t))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof t,"."));return e.forEach((function(t){if(!Fn(t))throw new Error("Expected 'host' to be a string, but got ".concat(typeof t,"."))})),this.ast.add(t,e,this.config.header),this},t.prototype.remove=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!Fn(t))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof t,"."));return e.forEach((function(t){if(!Fn(t))throw new Error("Expected 'host' to be a string, but got ".concat(typeof t,"."))})),this.ast.remove(t,e),this},t.prototype.removeHosts=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.forEach((function(t){if(!Fn(t))throw new Error("Expected 'host' to be a string, but got ".concat(typeof t,"."))})),this.ast.removeHosts(t),this},t.prototype.removeIps=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.forEach((function(t){if(!Fn(t))throw new Error("Expected 'ip' to be a string, but got ".concat(typeof t,"."))})),this.ast.removeIps(t),this},t.prototype.read=function(){return E(this,void 0,void 0,(function(){var t;return C(this,(function(e){switch(e.label){case 0:return[4,b.promises.readFile(this.config.hostsFile)];case 1:return t=e.sent(),this.ast=ao.parse(t.toString(),this.config),[2,this]}}))}))},t.prototype.write=function(t){return E(this,void 0,void 0,(function(){var e,n,r,o;return C(this,(function(i){switch(i.label){case 0:switch(e=A(A({},this.config),t),n=e.hostsFile,r=e.writeMode,o=this.ast.toString(),r){case void 0:case"atomic":return[3,1];case"standard":return[3,3];case"disabled":return[3,5]}return[3,5];case 1:return[4,oo(n,o)];case 2:case 4:return i.sent(),[3,6];case 3:return[4,b.promises.writeFile(n,o)];case 5:return[3,6];case 6:return[2,this]}}))}))},t.prototype.backup=function(t){return E(this,void 0,void 0,(function(){var e,n,r,o;return C(this,(function(i){switch(i.label){case 0:return b.existsSync(this.config.hostsFile)?(e=y.dirname(this.config.hostsFile),n=y.basename(this.config.hostsFile),r="".concat(n).concat(t.suffix),o=y.resolve(e,r),b.existsSync(o)&&!t.rewrite?[3,2]:[4,b.promises.copyFile(this.config.hostsFile,o)]):[2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},t.load=function(e){return E(this,void 0,void 0,(function(){return C(this,(function(n){switch(n.label){case 0:return[4,new t(e).read()];case 1:return[2,n.sent()]}}))}))},t}(),go=function(){function t(){this.previousPromise=Promise.resolve()}return t.prototype.enter=function(t){return E(this,void 0,void 0,(function(){var e;return C(this,(function(n){return e=this.previousPromise.then((function(){return t()})).catch((function(){return t()})),this.previousPromise=e,[2,e]}))}))},t}(),wo=function t(e,n){if(e&&n)return t(e)(n);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){r[t]=e[t]})),r;function r(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),o=t[t.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach((function(t){r[t]=o[t]})),r}};var _o=wo(So),jo=wo(Ao);function So(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function Ao(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},n=t.name||"Function wrapped with `once`";return e.onceError=n+" shouldn't be called more than once",e.called=!1,e}So.proto=So((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return So(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Ao(this)},configurable:!0})})),_o.strict=jo;var Eo=function(){},Co=function(t,e,n){if("function"==typeof e)return Co(t,null,e);e||(e={}),n=_o(n||Eo);var r=t._writableState,o=t._readableState,i=e.readable||!1!==e.readable&&t.readable,s=e.writable||!1!==e.writable&&t.writable,a=!1,u=function(){t.writable||c()},c=function(){s=!1,i||n.call(t)},l=function(){i=!1,s||n.call(t)},d=function(e){n.call(t,e?new Error("exited with error code: "+e):null)},h=function(e){n.call(t,e)},p=function(){process.nextTick(f)},f=function(){if(!a)return(!i||o&&o.ended&&!o.destroyed)&&(!s||r&&r.ended&&!r.destroyed)?void 0:n.call(t,new Error("premature close"))},v=function(){t.req.on("finish",c)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(t)?s&&!r&&(t.on("end",u),t.on("close",u)):(t.on("complete",c),t.on("abort",p),t.req?v():t.on("request",v)),function(t){return t.stdio&&Array.isArray(t.stdio)&&3===t.stdio.length}(t)&&t.on("exit",d),t.on("end",l),t.on("finish",c),!1!==e.error&&t.on("error",h),t.on("close",p),function(){a=!0,t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("exit",d),t.removeListener("end",l),t.removeListener("error",h),t.removeListener("close",p)}},xo=Co,Oo=function(){},Io=/^v?\.0/.test(process.version),ko=function(t){return"function"==typeof t},Uo=function(t,e,n,r){r=_o(r);var o=!1;t.on("close",(function(){o=!0})),xo(t,{readable:e,writable:n},(function(t){if(t)return r(t);o=!0,r()}));var i=!1;return function(e){if(!o&&!i)return i=!0,function(t){return!!Io&&!!b&&(t instanceof(b.ReadStream||Oo)||t instanceof(b.WriteStream||Oo))&&ko(t.close)}(t)?t.close(Oo):function(t){return t.setHeader&&ko(t.abort)}(t)?t.abort():ko(t.destroy)?t.destroy():void r(e||new Error("stream was destroyed"))}},Po=function(t){t()},Do=function(t,e){return t.pipe(e)},No=function(){var t,e=Array.prototype.slice.call(arguments),n=ko(e[e.length-1]||Oo)&&e.pop()||Oo;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r=e.map((function(o,i){var s=i<e.length-1;return Uo(o,s,i>0,(function(e){t||(t=e),e&&r.forEach(Po),s||(r.forEach(Po),n(t))}))}));return e.reduce(Do)};const{Duplex:Bo}=r;function To(t){t.emit("close")}function Lo(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Fo(t){this.removeListener("error",Fo),this.destroy(),0===this.listenerCount("error")&&this.emit("error",t)}var Ro=function(t,e){let n=!0;const r=new Bo({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",(function(e,n){const o=!n&&r._readableState.objectMode?e.toString():e;r.push(o)||t.pause()})),t.once("error",(function(t){r.destroyed||(n=!1,r.destroy(t))})),t.once("close",(function(){r.destroyed||r.push(null)})),r._destroy=function(e,o){if(t.readyState===t.CLOSED)return o(e),void process.nextTick(To,r);let i=!1;t.once("error",(function(t){i=!0,o(t)})),t.once("close",(function(){i||o(e),process.nextTick(To,r)})),n&&t.terminate()},r._final=function(e){t.readyState!==t.CONNECTING?null!==t._socket&&(t._socket._writableState.finished?(e(),r._readableState.endEmitted&&r.destroy()):(t._socket.once("finish",(function(){e()})),t.close())):t.once("open",(function(){r._final(e)}))},r._read=function(){t.isPaused&&t.resume()},r._write=function(e,n,o){t.readyState!==t.CONNECTING?t.send(e,o):t.once("open",(function(){r._write(e,n,o)}))},r.on("end",Lo),r.on("error",Fo),r},Mo={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}},zo="function"==typeof __webpack_require__?__non_webpack_require__:function(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")},Wo=process.config&&process.config.variables||{},qo=!!process.env.PREBUILDS_ONLY,$o=process.versions.modules,Go=!(!process.versions||!process.versions.electron)||!!process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":"node",Ho=d.arch(),Vo=d.platform(),Jo=process.env.LIBC||(function(t){return"linux"===t&&b.existsSync("/etc/alpine-release")}(Vo)?"musl":"glibc"),Yo=process.env.ARM_VERSION||("arm64"===Ho?"8":Wo.arm_version)||"",Zo=(process.versions.uv||"").split(".")[0],Ko=Xo;function Xo(t){return zo(Xo.path(t))}function Qo(t){try{return b.readdirSync(t)}catch(t){return[]}}function ti(t,e){var n=Qo(t).filter(e);return n[0]&&y.join(t,n[0])}function ei(t){return/\.node$/.test(t)}function ni(t){var e=t.split("-");if(2===e.length){var n=e[0],r=e[1].split("+");if(n&&r.length&&r.every(Boolean))return{name:t,platform:n,architectures:r}}}function ri(t,e){return function(n){return null!=n&&(n.platform===t&&n.architectures.includes(e))}}function oi(t,e){return t.architectures.length-e.architectures.length}function ii(t){var e=t.split("."),n={file:t,specificity:0};if("node"===e.pop()){for(var r=0;r<e.length;r++){var o=e[r];if("node"===o||"electron"===o||"node-webkit"===o)n.runtime=o;else if("napi"===o)n.napi=!0;else if("abi"===o.slice(0,3))n.abi=o.slice(3);else if("uv"===o.slice(0,2))n.uv=o.slice(2);else if("armv"===o.slice(0,4))n.armv=o.slice(4);else{if("glibc"!==o&&"musl"!==o)continue;n.libc=o}n.specificity++}return n}}function si(t,e){return function(n){return null!=n&&(!(n.runtime!==t&&!function(t){return"node"===t.runtime&&t.napi}(n))&&(!(n.abi!==e&&!n.napi)&&((!n.uv||n.uv===Zo)&&((!n.armv||n.armv===Yo)&&(!n.libc||n.libc===Jo)))))}}function ai(t){return function(e,n){return e.runtime!==n.runtime?e.runtime===t?-1:1:e.abi!==n.abi?e.abi?-1:1:e.specificity!==n.specificity?e.specificity>n.specificity?-1:1:0}}Xo.path=function(t){t=y.resolve(t||".");try{var e=zo(y.join(t,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(t=process.env[e+"_PREBUILD"])}catch(t){}if(!qo){var n=ti(y.join(t,"build/Release"),ei);if(n)return n;var r=ti(y.join(t,"build/Debug"),ei);if(r)return r}var o=a(t);if(o)return o;var i=a(y.dirname(process.execPath));if(i)return i;var s=["platform="+Vo,"arch="+Ho,"runtime="+Go,"abi="+$o,"uv="+Zo,Yo?"armv="+Yo:"","libc="+Jo,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"","function"==typeof __webpack_require__?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+s+"\n loaded from: "+t+"\n");function a(t){var e=Qo(y.join(t,"prebuilds")).map(ni).filter(ri(Vo,Ho)).sort(oi)[0];if(e){var n=y.join(t,"prebuilds",e.name),r=Qo(n).map(ii).filter(si(Go,$o)).sort(ai(Go))[0];return r?y.join(n,r.file):void 0}}},Xo.parseTags=ii,Xo.matchTags=si,Xo.compareTags=ai,Xo.parseTuple=ni,Xo.matchTuple=ri,Xo.compareTuples=oi;var ui={mask:(t,e,n,r,o)=>{for(var i=0;i<o;i++)n[r+i]=t[i]^e[3&i]},unmask:(t,e)=>{const n=t.length;for(var r=0;r<n;r++)t[r]^=e[3&r]}},ci=Wn((function(t){try{t.exports=Ko(__dirname)}catch(e){t.exports=ui}})),li=Wn((function(t){const{EMPTY_BUFFER:e}=Mo;function n(t,n){if(0===t.length)return e;if(1===t.length)return t[0];const r=Buffer.allocUnsafe(n);let o=0;for(let e=0;e<t.length;e++){const n=t[e];r.set(n,o),o+=n.length}return o<n?r.slice(0,o):r}function r(t,e,n,r,o){for(let i=0;i<o;i++)n[r+i]=t[i]^e[3&i]}function o(t,e){for(let n=0;n<t.length;n++)t[n]^=e[3&n]}function i(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function s(t){if(s.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=Buffer.from(t):ArrayBuffer.isView(t)?e=Buffer.from(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),s.readOnly=!1),e}try{const e=ci;t.exports={concat:n,mask(t,n,o,i,s){s<48?r(t,n,o,i,s):e.mask(t,n,o,i,s)},toArrayBuffer:i,toBuffer:s,unmask(t,n){t.length<32?o(t,n):e.unmask(t,n)}}}catch(e){t.exports={concat:n,mask:r,toArrayBuffer:i,toBuffer:s,unmask:o}}}));li.concat,li.mask,li.toArrayBuffer,li.toBuffer,li.unmask;const di=Symbol("kDone"),hi=Symbol("kRun");var pi=class{constructor(t){this[di]=()=>{this.pending--,this[hi]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[hi]()}[hi](){if(this.pending!==this.concurrency&&this.jobs.length){const t=this.jobs.shift();this.pending++,t(this[di])}}};const{kStatusCode:fi}=Mo,vi=Buffer.from([0,0,255,255]),mi=Symbol("permessage-deflate"),bi=Symbol("total-length"),yi=Symbol("callback"),gi=Symbol("buffers"),wi=Symbol("error");let _i;var ji=class{constructor(t,e,n){if(this._maxPayload=0|n,this._options=t||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!e,this._deflate=null,this._inflate=null,this.params=null,!_i){const t=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;_i=new pi(t)}}static get extensionName(){return"permessage-deflate"}offer(){const t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const t=this._deflate[yi];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){const e=this._options,n=t.find((t=>!(!1===e.serverNoContextTakeover&&t.server_no_context_takeover||t.server_max_window_bits&&(!1===e.serverMaxWindowBits||"number"==typeof e.serverMaxWindowBits&&e.serverMaxWindowBits>t.server_max_window_bits)||"number"==typeof e.clientMaxWindowBits&&!t.client_max_window_bits)));if(!n)throw new Error("None of the extension offers can be accepted");return e.serverNoContextTakeover&&(n.server_no_context_takeover=!0),e.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof e.serverMaxWindowBits&&(n.server_max_window_bits=e.serverMaxWindowBits),"number"==typeof e.clientMaxWindowBits?n.client_max_window_bits=e.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==e.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(t){const e=t[0];if(!1===this._options.clientNoContextTakeover&&e.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(e.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&e.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(e.client_max_window_bits=this._options.clientMaxWindowBits);return e}normalizeParams(t){return t.forEach((t=>{Object.keys(t).forEach((e=>{let n=t[e];if(n.length>1)throw new Error(`Parameter "${e}" must have only a single value`);if(n=n[0],"client_max_window_bits"===e){if(!0!==n){const t=+n;if(!Number.isInteger(t)||t<8||t>15)throw new TypeError(`Invalid value for parameter "${e}": ${n}`);n=t}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${e}": ${n}`)}else if("server_max_window_bits"===e){const t=+n;if(!Number.isInteger(t)||t<8||t>15)throw new TypeError(`Invalid value for parameter "${e}": ${n}`);n=t}else{if("client_no_context_takeover"!==e&&"server_no_context_takeover"!==e)throw new Error(`Unknown parameter "${e}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${e}": ${n}`)}t[e]=n}))})),t}decompress(t,e,n){_i.add((r=>{this._decompress(t,e,((t,e)=>{r(),n(t,e)}))}))}compress(t,e,n){_i.add((r=>{this._compress(t,e,((t,e)=>{r(),n(t,e)}))}))}_decompress(t,e,n){const r=this._isServer?"client":"server";if(!this._inflate){const t=`${r}_max_window_bits`,e="number"!=typeof this.params[t]?l.Z_DEFAULT_WINDOWBITS:this.params[t];this._inflate=l.createInflateRaw({...this._options.zlibInflateOptions,windowBits:e}),this._inflate[mi]=this,this._inflate[bi]=0,this._inflate[gi]=[],this._inflate.on("error",Ei),this._inflate.on("data",Ai)}this._inflate[yi]=n,this._inflate.write(t),e&&this._inflate.write(vi),this._inflate.flush((()=>{const t=this._inflate[wi];if(t)return this._inflate.close(),this._inflate=null,void n(t);const o=li.concat(this._inflate[gi],this._inflate[bi]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[bi]=0,this._inflate[gi]=[],e&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),n(null,o)}))}_compress(t,e,n){const r=this._isServer?"server":"client";if(!this._deflate){const t=`${r}_max_window_bits`,e="number"!=typeof this.params[t]?l.Z_DEFAULT_WINDOWBITS:this.params[t];this._deflate=l.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:e}),this._deflate[bi]=0,this._deflate[gi]=[],this._deflate.on("data",Si)}this._deflate[yi]=n,this._deflate.write(t),this._deflate.flush(l.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let t=li.concat(this._deflate[gi],this._deflate[bi]);e&&(t=t.slice(0,t.length-4)),this._deflate[yi]=null,this._deflate[bi]=0,this._deflate[gi]=[],e&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),n(null,t)}))}};function Si(t){this[gi].push(t),this[bi]+=t.length}function Ai(t){this[bi]+=t.length,this[mi]._maxPayload<1||this[bi]<=this[mi]._maxPayload?this[gi].push(t):(this[wi]=new RangeError("Max payload size exceeded"),this[wi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[wi][fi]=1009,this.removeListener("data",Ai),this.reset())}function Ei(t){this[mi]._inflate=null,t[fi]=1007,this[yi](t)}var Ci=function(t){const e=t.length;let n=0;for(;n<e;)if(0==(128&t[n]))n++;else if(192==(224&t[n])){if(n+1===e||128!=(192&t[n+1])||192==(254&t[n]))return!1;n+=2}else if(224==(240&t[n])){if(n+2>=e||128!=(192&t[n+1])||128!=(192&t[n+2])||224===t[n]&&128==(224&t[n+1])||237===t[n]&&160==(224&t[n+1]))return!1;n+=3}else{if(240!=(248&t[n]))return!1;if(n+3>=e||128!=(192&t[n+1])||128!=(192&t[n+2])||128!=(192&t[n+3])||240===t[n]&&128==(240&t[n+1])||244===t[n]&&t[n+1]>143||t[n]>244)return!1;n+=4}return!0},xi=Wn((function(t){try{t.exports=Ko(__dirname)}catch(e){t.exports=Ci}})),Oi=Wn((function(t){const e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function n(t){return t>=1e3&&t<=1014&&1004!==t&&1005!==t&&1006!==t||t>=3e3&&t<=4999}function r(t){const e=t.length;let n=0;for(;n<e;)if(0==(128&t[n]))n++;else if(192==(224&t[n])){if(n+1===e||128!=(192&t[n+1])||192==(254&t[n]))return!1;n+=2}else if(224==(240&t[n])){if(n+2>=e||128!=(192&t[n+1])||128!=(192&t[n+2])||224===t[n]&&128==(224&t[n+1])||237===t[n]&&160==(224&t[n+1]))return!1;n+=3}else{if(240!=(248&t[n]))return!1;if(n+3>=e||128!=(192&t[n+1])||128!=(192&t[n+2])||128!=(192&t[n+3])||240===t[n]&&128==(240&t[n+1])||244===t[n]&&t[n+1]>143||t[n]>244)return!1;n+=4}return!0}try{const o=xi;t.exports={isValidStatusCode:n,isValidUTF8:t=>t.length<150?r(t):o(t),tokenChars:e}}catch(o){t.exports={isValidStatusCode:n,isValidUTF8:r,tokenChars:e}}}));Oi.isValidStatusCode,Oi.isValidUTF8,Oi.tokenChars;const{Writable:Ii}=r,{BINARY_TYPES:ki,EMPTY_BUFFER:Ui,kStatusCode:Pi,kWebSocket:Di}=Mo,{concat:Ni,toArrayBuffer:Bi,unmask:Ti}=li,{isValidStatusCode:Li,isValidUTF8:Fi}=Oi;var Ri=class extends Ii{constructor(t={}){super(),this._binaryType=t.binaryType||ki[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=0|t.maxPayload,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Di]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(t,e,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){const e=this._buffers[0];return this._buffers[0]=e.slice(t),e.slice(0,t)}const e=Buffer.allocUnsafe(t);do{const n=this._buffers[0],r=e.length-t;t>=n.length?e.set(this._buffers.shift(),r):(e.set(new Uint8Array(n.buffer,n.byteOffset,t),r),this._buffers[0]=n.slice(t)),t-=n.length}while(t>0);return e}startLoop(t){let e;this._loop=!0;do{switch(this._state){case 0:e=this.getInfo();break;case 1:e=this.getPayloadLength16();break;case 2:e=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:e=this.getData(t);break;default:return void(this._loop=!1)}}while(this._loop);t(e)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const t=this.consume(2);if(0!=(48&t[0]))return this._loop=!1,Mi(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");const e=64==(64&t[0]);if(e&&!this._extensions[ji.extensionName])return this._loop=!1,Mi(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=128==(128&t[0]),this._opcode=15&t[0],this._payloadLength=127&t[1],0===this._opcode){if(e)return this._loop=!1,Mi(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Mi(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,Mi(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=e}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,Mi(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin)return this._loop=!1,Mi(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(e)return this._loop=!1,Mi(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,Mi(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&t[1]),this._isServer){if(!this._masked)return this._loop=!1,Mi(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Mi(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const t=this.consume(8),e=t.readUInt32BE(0);return e>Math.pow(2,21)-1?(this._loop=!1,Mi(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=e*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Mi(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(t){let e=Ui;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);e=this.consume(this._payloadLength),this._masked&&0!=(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])&&Ti(e,this._mask)}return this._opcode>7?this.controlMessage(e):this._compressed?(this._state=5,void this.decompress(e,t)):(e.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(e)),this.dataMessage())}decompress(t,e){this._extensions[ji.extensionName].decompress(t,this._fin,((t,n)=>{if(t)return e(t);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return e(Mi(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(n)}const r=this.dataMessage();if(r)return e(r);this.startLoop(e)}))}dataMessage(){if(this._fin){const t=this._messageLength,e=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let n;n="nodebuffer"===this._binaryType?Ni(e,t):"arraybuffer"===this._binaryType?Bi(Ni(e,t)):e,this.emit("message",n,!0)}else{const n=Ni(e,t);if(!this._skipUTF8Validation&&!Fi(n))return this._loop=!1,Mi(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n,!1)}}this._state=0}controlMessage(t){if(8===this._opcode)if(this._loop=!1,0===t.length)this.emit("conclude",1005,Ui),this.end();else{if(1===t.length)return Mi(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{const e=t.readUInt16BE(0);if(!Li(e))return Mi(RangeError,`invalid status code ${e}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");const n=t.slice(2);if(!this._skipUTF8Validation&&!Fi(n))return Mi(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",e,n),this.end()}}else 9===this._opcode?this.emit("ping",t):this.emit("pong",t);this._state=0}};function Mi(t,e,n,r,o){const i=new t(n?`Invalid WebSocket frame: ${e}`:e);return Error.captureStackTrace(i,Mi),i.code=o,i[Pi]=r,i}const{randomFillSync:zi}=w,{EMPTY_BUFFER:Wi}=Mo,{isValidStatusCode:qi}=Oi,{mask:$i,toBuffer:Gi}=li,Hi=Symbol("kByteLength"),Vi=Buffer.alloc(4);class Ji{constructor(t,e,n){this._extensions=e||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,e){let n,r,o=!1,i=2,s=!1;e.mask&&(n=e.maskBuffer||Vi,e.generateMask?e.generateMask(n):zi(n,0,4),s=0==(n[0]|n[1]|n[2]|n[3]),i=6),"string"==typeof t?r=e.mask&&!s||void 0===e[Hi]?(t=Buffer.from(t)).length:e[Hi]:(r=t.length,o=e.mask&&e.readOnly&&!s);let a=r;r>=65536?(i+=8,a=127):r>125&&(i+=2,a=126);const u=Buffer.allocUnsafe(o?r+i:i);return u[0]=e.fin?128|e.opcode:e.opcode,e.rsv1&&(u[0]|=64),u[1]=a,126===a?u.writeUInt16BE(r,2):127===a&&(u[2]=u[3]=0,u.writeUIntBE(r,4,6)),e.mask?(u[1]|=128,u[i-4]=n[0],u[i-3]=n[1],u[i-2]=n[2],u[i-1]=n[3],s?[u,t]:o?($i(t,n,u,i,r),[u]):($i(t,n,t,0,r),[u,t])):[u,t]}close(t,e,n,r){let o;if(void 0===t)o=Wi;else{if("number"!=typeof t||!qi(t))throw new TypeError("First argument must be a valid error code number");if(void 0!==e&&e.length){const n=Buffer.byteLength(e);if(n>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+n),o.writeUInt16BE(t,0),"string"==typeof e?o.write(e,2):o.set(e,2)}else o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0)}const i={[Hi]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,i,r]):this.sendFrame(Ji.frame(o,i),r)}ping(t,e,n){let r,o;if("string"==typeof t?(r=Buffer.byteLength(t),o=!1):(r=(t=Gi(t)).length,o=Gi.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const i={[Hi]:r,fin:!0,generateMask:this._generateMask,mask:e,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,i,n]):this.sendFrame(Ji.frame(t,i),n)}pong(t,e,n){let r,o;if("string"==typeof t?(r=Buffer.byteLength(t),o=!1):(r=(t=Gi(t)).length,o=Gi.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");const i={[Hi]:r,fin:!0,generateMask:this._generateMask,mask:e,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,i,n]):this.sendFrame(Ji.frame(t,i),n)}send(t,e,n){const r=this._extensions[ji.extensionName];let o,i,s=e.binary?2:1,a=e.compress;if("string"==typeof t?(o=Buffer.byteLength(t),i=!1):(o=(t=Gi(t)).length,i=Gi.readOnly),this._firstFragment?(this._firstFragment=!1,a&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=o>=r._threshold),this._compress=a):(a=!1,s=0),e.fin&&(this._firstFragment=!0),r){const r={[Hi]:o,fin:e.fin,generateMask:this._generateMask,mask:e.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:i,rsv1:a};this._deflating?this.enqueue([this.dispatch,t,this._compress,r,n]):this.dispatch(t,this._compress,r,n)}else this.sendFrame(Ji.frame(t,{[Hi]:o,fin:e.fin,generateMask:this._generateMask,mask:e.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:i,rsv1:!1}),n)}dispatch(t,e,n,r){if(!e)return void this.sendFrame(Ji.frame(t,n),r);const o=this._extensions[ji.extensionName];this._bufferedBytes+=n[Hi],this._deflating=!0,o.compress(t,n.fin,((t,e)=>{if(this._socket.destroyed){const t=new Error("The socket was closed while data was being compressed");"function"==typeof r&&r(t);for(let e=0;e<this._queue.length;e++){const n=this._queue[e],r=n[n.length-1];"function"==typeof r&&r(t)}}else this._bufferedBytes-=n[Hi],this._deflating=!1,n.readOnly=!1,this.sendFrame(Ji.frame(e,n),r),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const t=this._queue.shift();this._bufferedBytes-=t[3][Hi],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Hi],this._queue.push(t)}sendFrame(t,e){2===t.length?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],e),this._socket.uncork()):this._socket.write(t[0],e)}}var Yi=Ji;const{kForOnEventAttribute:Zi,kListener:Ki}=Mo,Xi=Symbol("kCode"),Qi=Symbol("kData"),ts=Symbol("kError"),es=Symbol("kMessage"),ns=Symbol("kReason"),rs=Symbol("kTarget"),os=Symbol("kType"),is=Symbol("kWasClean");class ss{constructor(t){this[rs]=null,this[os]=t}get target(){return this[rs]}get type(){return this[os]}}Object.defineProperty(ss.prototype,"target",{enumerable:!0}),Object.defineProperty(ss.prototype,"type",{enumerable:!0});class as extends ss{constructor(t,e={}){super(t),this[Xi]=void 0===e.code?0:e.code,this[ns]=void 0===e.reason?"":e.reason,this[is]=void 0!==e.wasClean&&e.wasClean}get code(){return this[Xi]}get reason(){return this[ns]}get wasClean(){return this[is]}}Object.defineProperty(as.prototype,"code",{enumerable:!0}),Object.defineProperty(as.prototype,"reason",{enumerable:!0}),Object.defineProperty(as.prototype,"wasClean",{enumerable:!0});class us extends ss{constructor(t,e={}){super(t),this[ts]=void 0===e.error?null:e.error,this[es]=void 0===e.message?"":e.message}get error(){return this[ts]}get message(){return this[es]}}Object.defineProperty(us.prototype,"error",{enumerable:!0}),Object.defineProperty(us.prototype,"message",{enumerable:!0});class cs extends ss{constructor(t,e={}){super(t),this[Qi]=void 0===e.data?null:e.data}get data(){return this[Qi]}}Object.defineProperty(cs.prototype,"data",{enumerable:!0});const ls={addEventListener(t,e,n={}){let r;if("message"===t)r=function(t,n){const r=new cs("message",{data:n?t:t.toString()});r[rs]=this,e.call(this,r)};else if("close"===t)r=function(t,n){const r=new as("close",{code:t,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[rs]=this,e.call(this,r)};else if("error"===t)r=function(t){const n=new us("error",{error:t,message:t.message});n[rs]=this,e.call(this,n)};else{if("open"!==t)return;r=function(){const t=new ss("open");t[rs]=this,e.call(this,t)}}r[Zi]=!!n[Zi],r[Ki]=e,n.once?this.once(t,r):this.on(t,r)},removeEventListener(t,e){for(const n of this.listeners(t))if(n[Ki]===e&&!n[Zi]){this.removeListener(t,n);break}}};var ds={CloseEvent:as,ErrorEvent:us,Event:ss,EventTarget:ls,MessageEvent:cs};const{tokenChars:hs}=Oi;function ps(t,e,n){void 0===t[e]?t[e]=[n]:t[e].push(n)}var fs={format:function(t){return Object.keys(t).map((e=>{let n=t[e];return Array.isArray(n)||(n=[n]),n.map((t=>[e].concat(Object.keys(t).map((e=>{let n=t[e];return Array.isArray(n)||(n=[n]),n.map((t=>!0===t?e:`${e}=${t}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(t){const e=Object.create(null);let n,r,o=Object.create(null),i=!1,s=!1,a=!1,u=-1,c=-1,l=-1,d=0;for(;d<t.length;d++)if(c=t.charCodeAt(d),void 0===n)if(-1===l&&1===hs[c])-1===u&&(u=d);else if(0===d||32!==c&&9!==c){if(59!==c&&44!==c)throw new SyntaxError(`Unexpected character at index ${d}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d);const r=t.slice(u,l);44===c?(ps(e,r,o),o=Object.create(null)):n=r,u=l=-1}}else-1===l&&-1!==u&&(l=d);else if(void 0===r)if(-1===l&&1===hs[c])-1===u&&(u=d);else if(32===c||9===c)-1===l&&-1!==u&&(l=d);else if(59===c||44===c){if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d),ps(o,t.slice(u,l),!0),44===c&&(ps(e,n,o),o=Object.create(null),n=void 0),u=l=-1}else{if(61!==c||-1===u||-1!==l)throw new SyntaxError(`Unexpected character at index ${d}`);r=t.slice(u,d),u=l=-1}else if(s){if(1!==hs[c])throw new SyntaxError(`Unexpected character at index ${d}`);-1===u?u=d:i||(i=!0),s=!1}else if(a)if(1===hs[c])-1===u&&(u=d);else if(34===c&&-1!==u)a=!1,l=d;else{if(92!==c)throw new SyntaxError(`Unexpected character at index ${d}`);s=!0}else if(34===c&&61===t.charCodeAt(d-1))a=!0;else if(-1===l&&1===hs[c])-1===u&&(u=d);else if(-1===u||32!==c&&9!==c){if(59!==c&&44!==c)throw new SyntaxError(`Unexpected character at index ${d}`);{if(-1===u)throw new SyntaxError(`Unexpected character at index ${d}`);-1===l&&(l=d);let s=t.slice(u,l);i&&(s=s.replace(/\\/g,""),i=!1),ps(o,r,s),44===c&&(ps(e,n,o),o=Object.create(null),n=void 0),r=void 0,u=l=-1}}else-1===l&&(l=d);if(-1===u||a||32===c||9===c)throw new SyntaxError("Unexpected end of input");-1===l&&(l=d);const h=t.slice(u,l);return void 0===n?ps(e,h,o):(void 0===r?ps(o,h,!0):ps(o,r,i?h.replace(/\\/g,""):h),ps(e,n,o)),e}};const{randomBytes:vs,createHash:ms}=w,{URL:bs}=s,{BINARY_TYPES:ys,EMPTY_BUFFER:gs,GUID:ws,kForOnEventAttribute:_s,kListener:js,kStatusCode:Ss,kWebSocket:As,NOOP:Es}=Mo,{EventTarget:{addEventListener:Cs,removeEventListener:xs}}=ds,{format:Os,parse:Is}=fs,{toBuffer:ks}=li,Us=["CONNECTING","OPEN","CLOSING","CLOSED"],Ps=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ds=[8,13];class Ns extends t{constructor(t,e,n){super(),this._binaryType=ys[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=gs,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=Ns.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==t?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===e?e=[]:Array.isArray(e)||("object"==typeof e&&null!==e?(n=e,e=[]):e=[e]),Ts(this,t,e,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){ys.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,e,n){const r=new Ri({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation});this._sender=new Yi(t,this._extensions,n.generateMask),this._receiver=r,this._socket=t,r[As]=this,t[As]=this,r.on("conclude",Ws),r.on("drain",qs),r.on("error",$s),r.on("message",Hs),r.on("ping",Vs),r.on("pong",Js),t.setTimeout(0),t.setNoDelay(),e.length>0&&t.unshift(e),t.on("close",Zs),t.on("data",Ks),t.on("end",Xs),t.on("error",Qs),this._readyState=Ns.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=Ns.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[ji.extensionName]&&this._extensions[ji.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=Ns.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,e){if(this.readyState!==Ns.CLOSED){if(this.readyState===Ns.CONNECTING){const t="WebSocket was closed before the connection was established";return Ms(this,this._req,t)}this.readyState!==Ns.CLOSING?(this._readyState=Ns.CLOSING,this._sender.close(t,e,!this._isServer,(t=>{t||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())})),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end()}}pause(){this.readyState!==Ns.CONNECTING&&this.readyState!==Ns.CLOSED&&(this._paused=!0,this._socket.pause())}ping(t,e,n){if(this.readyState===Ns.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(n=t,t=e=void 0):"function"==typeof e&&(n=e,e=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===Ns.OPEN?(void 0===e&&(e=!this._isServer),this._sender.ping(t||gs,e,n)):zs(this,t,n)}pong(t,e,n){if(this.readyState===Ns.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(n=t,t=e=void 0):"function"==typeof e&&(n=e,e=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===Ns.OPEN?(void 0===e&&(e=!this._isServer),this._sender.pong(t||gs,e,n)):zs(this,t,n)}resume(){this.readyState!==Ns.CONNECTING&&this.readyState!==Ns.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,e,n){if(this.readyState===Ns.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof e&&(n=e,e={}),"number"==typeof t&&(t=t.toString()),this.readyState!==Ns.OPEN)return void zs(this,t,n);const r={binary:"string"!=typeof t,mask:!this._isServer,compress:!0,fin:!0,...e};this._extensions[ji.extensionName]||(r.compress=!1),this._sender.send(t||gs,r,n)}terminate(){if(this.readyState!==Ns.CLOSED){if(this.readyState===Ns.CONNECTING){const t="WebSocket was closed before the connection was established";return Ms(this,this._req,t)}this._socket&&(this._readyState=Ns.CLOSING,this._socket.destroy())}}}Object.defineProperty(Ns,"CONNECTING",{enumerable:!0,value:Us.indexOf("CONNECTING")}),Object.defineProperty(Ns.prototype,"CONNECTING",{enumerable:!0,value:Us.indexOf("CONNECTING")}),Object.defineProperty(Ns,"OPEN",{enumerable:!0,value:Us.indexOf("OPEN")}),Object.defineProperty(Ns.prototype,"OPEN",{enumerable:!0,value:Us.indexOf("OPEN")}),Object.defineProperty(Ns,"CLOSING",{enumerable:!0,value:Us.indexOf("CLOSING")}),Object.defineProperty(Ns.prototype,"CLOSING",{enumerable:!0,value:Us.indexOf("CLOSING")}),Object.defineProperty(Ns,"CLOSED",{enumerable:!0,value:Us.indexOf("CLOSED")}),Object.defineProperty(Ns.prototype,"CLOSED",{enumerable:!0,value:Us.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((t=>{Object.defineProperty(Ns.prototype,t,{enumerable:!0})})),["open","error","close","message"].forEach((t=>{Object.defineProperty(Ns.prototype,`on${t}`,{enumerable:!0,get(){for(const e of this.listeners(t))if(e[_s])return e[js];return null},set(e){for(const e of this.listeners(t))if(e[_s]){this.removeListener(t,e);break}"function"==typeof e&&this.addEventListener(t,e,{[_s]:!0})}})})),Ns.prototype.addEventListener=Cs,Ns.prototype.removeEventListener=xs;var Bs=Ns;function Ts(t,e,n,r){const o={protocolVersion:Ds[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!Ds.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${Ds.join(", ")})`);let s;if(e instanceof bs)s=e,t._url=e.href;else{try{s=new bs(e)}catch(t){throw new SyntaxError(`Invalid URL: ${e}`)}t._url=e}const a="wss:"===s.protocol,u="ws+unix:"===s.protocol;let l;if("ws:"===s.protocol||a||u?u&&!s.pathname?l="The URL's pathname is empty":s.hash&&(l="The URL contains a fragment identifier"):l='The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"',l){const e=new SyntaxError(l);if(0===t._redirects)throw e;return void Ls(t,e)}const d=a?443:80,h=vs(16).toString("base64"),p=a?c.get:i.get,f=new Set;let v;if(o.createConnection=a?Rs:Fs,o.defaultPort=o.defaultPort||d,o.port=s.port||d,o.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":h,Connection:"Upgrade",Upgrade:"websocket",...o.headers},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(v=new ji(!0!==o.perMessageDeflate?o.perMessageDeflate:{},!1,o.maxPayload),o.headers["Sec-WebSocket-Extensions"]=Os({[ji.extensionName]:v.offer()})),n.length){for(const t of n){if("string"!=typeof t||!Ps.test(t)||f.has(t))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(t)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),u){const t=o.path.split(":");o.socketPath=t[0],o.path=t[1]}if(o.followRedirects){if(0===t._redirects){t._originalHost=s.host;const e=r&&r.headers;if(r={...r,headers:{}},e)for(const[t,n]of Object.entries(e))r.headers[t.toLowerCase()]=n}else s.host!==t._originalHost&&(delete o.headers.authorization,delete o.headers.cookie,delete o.headers.host,o.auth=void 0);o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64"))}let m=t._req=p(o);o.timeout&&m.on("timeout",(()=>{Ms(t,m,"Opening handshake has timed out")})),m.on("error",(e=>{null===m||m.aborted||(m=t._req=null,Ls(t,e))})),m.on("response",(i=>{const s=i.headers.location,a=i.statusCode;if(s&&o.followRedirects&&a>=300&&a<400){if(++t._redirects>o.maxRedirects)return void Ms(t,m,"Maximum redirects exceeded");let i;m.abort();try{i=new bs(s,e)}catch(e){const n=new SyntaxError(`Invalid URL: ${s}`);return void Ls(t,n)}Ts(t,i,n,r)}else t.emit("unexpected-response",m,i)||Ms(t,m,`Unexpected server response: ${i.statusCode}`)})),m.on("upgrade",((e,n,r)=>{if(t.emit("upgrade",e),t.readyState!==Ns.CONNECTING)return;m=t._req=null;const i=ms("sha1").update(h+ws).digest("base64");if(e.headers["sec-websocket-accept"]!==i)return void Ms(t,n,"Invalid Sec-WebSocket-Accept header");const s=e.headers["sec-websocket-protocol"];let a;if(void 0!==s?f.size?f.has(s)||(a="Server sent an invalid subprotocol"):a="Server sent a subprotocol but none was requested":f.size&&(a="Server sent no subprotocol"),a)return void Ms(t,n,a);s&&(t._protocol=s);const u=e.headers["sec-websocket-extensions"];if(void 0!==u){if(!v){return void Ms(t,n,"Server sent a Sec-WebSocket-Extensions header but no extension was requested")}let e;try{e=Is(u)}catch(e){return void Ms(t,n,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(e);if(1!==r.length||r[0]!==ji.extensionName){return void Ms(t,n,"Server indicated an extension that was not requested")}try{v.accept(e[ji.extensionName])}catch(e){return void Ms(t,n,"Invalid Sec-WebSocket-Extensions header")}t._extensions[ji.extensionName]=v}t.setSocket(n,r,{generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}))}function Ls(t,e){t._readyState=Ns.CLOSING,t.emit("error",e),t.emitClose()}function Fs(t){return t.path=t.socketPath,p.connect(t)}function Rs(t){return t.path=void 0,t.servername||""===t.servername||(t.servername=p.isIP(t.host)?"":t.host),g.connect(t)}function Ms(t,e,n){t._readyState=Ns.CLOSING;const r=new Error(n);Error.captureStackTrace(r,Ms),e.setHeader?(e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),e.once("abort",t.emitClose.bind(t)),t.emit("error",r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function zs(t,e,n){if(e){const n=ks(e).length;t._socket?t._sender._bufferedBytes+=n:t._bufferedAmount+=n}if(n){n(new Error(`WebSocket is not open: readyState ${t.readyState} (${Us[t.readyState]})`))}}function Ws(t,e){const n=this[As];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,void 0!==n._socket[As]&&(n._socket.removeListener("data",Ks),process.nextTick(Ys,n._socket),1005===t?n.close():n.close(t,e))}function qs(){const t=this[As];t.isPaused||t._socket.resume()}function $s(t){const e=this[As];void 0!==e._socket[As]&&(e._socket.removeListener("data",Ks),process.nextTick(Ys,e._socket),e.close(t[Ss])),e.emit("error",t)}function Gs(){this[As].emitClose()}function Hs(t,e){this[As].emit("message",t,e)}function Vs(t){const e=this[As];e.pong(t,!e._isServer,Es),e.emit("ping",t)}function Js(t){this[As].emit("pong",t)}function Ys(t){t.resume()}function Zs(){const t=this[As];let e;this.removeListener("close",Zs),this.removeListener("data",Ks),this.removeListener("end",Xs),t._readyState=Ns.CLOSING,this._readableState.endEmitted||t._closeFrameReceived||t._receiver._writableState.errorEmitted||null===(e=t._socket.read())||t._receiver.write(e),t._receiver.end(),this[As]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Gs),t._receiver.on("finish",Gs))}function Ks(t){this[As]._receiver.write(t)||this.pause()}function Xs(){const t=this[As];t._readyState=Ns.CLOSING,t._receiver.end(),this.end()}function Qs(){const t=this[As];this.removeListener("error",Qs),this.on("error",Es),t&&(t._readyState=Ns.CLOSING,this.destroy())}var ta=function(t){function e(e,n,r,o,i){void 0===i&&(i=5e3);var s=t.call(this)||this;s.endpoint=e,s.headers=n,s.rewriteHostHeader=r,s.bindToAssign=o,s.closeTimeout=i,s.protocol="TCP",s.openConnections=new Set,s.tcpServer=h.createServer(s.handleConnection.bind(s));var a=null==r?void 0:r.altHostnames.map((function(t){return(e=je(e=t))&&Nn.test(e)?e.replace(Dn,"\\$&"):e;var e})).join("|");return s.hostRegex=new RegExp("Host: (?:".concat(a,")(:.*$|$)"),"im"),s}return S(e,t),Object.defineProperty(e.prototype,"bindTo",{get:function(){var t;return null!==(t=this.boundTo)&&void 0!==t?t:this.bindToAssign},enumerable:!1,configurable:!0}),e.prototype.open=function(){return E(this,void 0,void 0,(function(){var t=this;return C(this,(function(e){return[2,new Promise((function(e){if(t.bindToAssign){var n=t.bindToAssign,r=n.port,o=n.address;t.tcpServer.listen(r,o,(function(){t.emit("tunnel-open",{address:o,port:r}),e({address:o,port:r})}))}else t.tcpServer.listen(0,(function(){var n=t.tcpServer.address(),r=n.address,o=n.port,i="0.0.0.0"===r||"::"===r?"127.0.0.1":r;t.boundTo={address:i,port:o},t.emit("tunnel-open",t.boundTo),e(t.boundTo)}))}))]}))}))},e.prototype.close=function(){return E(this,void 0,void 0,(function(){var t,e=this;return C(this,(function(n){switch(n.label){case 0:return t=!1,[4,Promise.race([new Promise((function(n){e.tcpServer.close((function(){t=!0,e.emit("tunnel-close"),n()}))})),new Promise((function(n){new Promise((function(t){return setTimeout(t,e.closeTimeout)})).then((function(){t||(e.openConnections.forEach((function(t){t.destroy(),e.openConnections.delete(t)})),n())}))}))])];case 1:return n.sent(),[2]}}))}))},e.prototype.handleConnection=function(t){var e=this;this.openConnections.add(t);var n=new Bs(this.endpoint.replace("https:","wss:"),{headers:this.headers}),r=Ro(n),o=this.getHeaderTransform();this.rewriteHostHeader&&o?No(t,o,r):No(t,r),No(r,t),n.on("close",(function(t,n,r){e.emit("connection-close",t,n,r)})),r.on("error",(function(t){e.emit("connection-error",t)})),t.on("error",(function(t){e.emit("connection-error",t)})),this.emit("connection-accept")},e.prototype.getHeaderTransform=function(){if(this.rewriteHostHeader){var t=this.rewriteHostHeader.targetHostname,e=this.hostRegex;return new o({transform:function(n,r,o){var i=n.toString();if(i.split("\n",1)[0].includes("HTTP")){var s=i.replace(e,"Host: ".concat(t));o(null,Buffer.from(s))}else o(null,n)}})}},e}(e),ea=function(t){function e(e,n,r){var o=t.call(this)||this;return o.endpoint=e,o.headers=n,o.bindToAssign=r,o.protocol="UDP",o.udpSocket=_.createSocket("udp4"),o.handleConnection(),o}return S(e,t),Object.defineProperty(e.prototype,"bindTo",{get:function(){var t;return null!==(t=this.boundTo)&&void 0!==t?t:this.bindToAssign},enumerable:!1,configurable:!0}),e.prototype.open=function(){return E(this,void 0,void 0,(function(){var t=this;return C(this,(function(e){return[2,new Promise((function(e){if(t.bindToAssign){var n=t.bindToAssign,r=n.port,o=n.address;t.udpSocket.bind(r,o,(function(){t.emit("tunnel-open",{address:o,port:r}),e({address:o,port:r})}))}else t.udpSocket.bind(0,(function(){var n=t.udpSocket.address(),r=n.address,o=n.port,i="0.0.0.0"===r||"::"===r?"127.0.0.1":r;t.boundTo={address:i,port:o},t.emit("tunnel-open",t.boundTo),e(t.boundTo)}))}))]}))}))},e.prototype.close=function(){return E(this,void 0,void 0,(function(){var t=this;return C(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){t.udpSocket.close((function(){t.emit("tunnel-close"),e()}))}))];case 1:return e.sent(),[2]}}))}))},e.prototype.handleConnection=function(){var t,e=this,n=new Bs(this.endpoint.replace("https:","wss:"),{headers:this.headers}),r=Ro(n);this.udpSocket.on("message",(function(e,n){t=n,r.write(e)})),r.on("data",(function(n){t&&e.udpSocket.send(n,t.port,t.address,(function(t){t&&e.emit("connection-error",t)}))})),this.udpSocket.on("error",(function(t){e.emit("connection-error",t)})),r.on("error",(function(t){e.emit("connection-error",t)})),n.on("connection-close",(function(t,n,r){e.emit("connection-close",t,n,r)})),n.on("connection-error",(function(t){e.emit("connection-error",t)})),this.emit("connection-accept")},e}(e);var na="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,ra=function(t,e){return E(void 0,void 0,void 0,(function(){var n;return C(this,(function(r){return n=Promise.resolve([]),[2,t.reduce((function(t,n){return t.then((function(t){return e(n).then((function(e){return t.push(e),t}))}))}),n)]}))}))},oa=function(t){function e(e){void 0===e&&(e=8192);var n=t.call(this)||this;return n.bufferDefaultSize=e,n._size=0,n.buffer=Buffer.alloc(n.bufferDefaultSize),n}return S(e,t),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.getContentsAsString=function(t,e){void 0===t&&(t="utf8");var n=this.buffer.toString(t,0,Math.min(e||this.size,this.size)),r=Buffer.byteLength(n);return r<this.size&&this.buffer.copy(this.buffer,0,r),this._size-=r,n},e.prototype.adaptBuffer=function(t){if(this.buffer.length-this.size<t){var e=Math.ceil((t-(this.buffer.length-this.size))/this.bufferDefaultSize),n=Buffer.alloc(this.buffer.length+this.bufferDefaultSize*e);this.buffer.copy(n,0,0,this.size),this.buffer=n}},e.prototype._write=function(t,e,n){this.adaptBuffer(t.length),t.copy(this.buffer,this.size,0),this._size+=t.length,n()},e}(r.Writable),ia=function(t){function e(e,n,r){var o=t.call(this)||this;return o.contextProvider=e,o.listServices=n,o.listAddons=r,o.connections=[],o.hostsFileMutex=new go,o.ipAllocationMutex=new go,o.stopForwarding=function(t){return E(o,void 0,void 0,(function(){var e,n,r,o,i,s;return C(this,(function(a){switch(a.label){case 0:return[4,t.tunnel.close()];case 1:return a.sent(),e=t.forwardingContext,n=e.projectId,r=e.type,o=e.id,(i=e.hostnames).length>0?[4,this.unregisterHostnames(null===(s=t.tunnel.bindTo)||void 0===s?void 0:s.address,i)]:[3,3];case 2:a.sent(),a.label=3;case 3:return this.connections.splice(this.connections.findIndex((function(t){var e=t.forwardingContext,i=e.type,s=e.id,a=e.projectId;return s===o&&a===n&&i===r})),1),[2]}}))}))},o.canExecuteWithHostnames=function(){return"win32"!==process.platform?process.getuid&&0!==process.getuid()?{error:!0,message:"You are not running this command with sufficient privileges (uid=".concat(process.getuid(),"). Try running with 'sudo'.")}:{error:!1,type:"unix-admin"}:function(){try{return m("fsutil dirty query %systemdrive%"),!0}catch(t){if("ENOENT"===t.code)try{return m("fltmc"),!0}catch(t){return!1}return!1}}()?{error:!1,type:"windows-admin"}:{error:!0,message:"You are not running this command as administrator. Please start command line with admin rights."}},o.assertStartedWithNodejs=function(){if(!na)throw new Error("Port forwarding only possible when started with nodejs")},o.proxyApiClient=new Kr(e),o}return S(e,t),e.prototype.withProjectForwarding=function(t,e,n){return void 0===n&&(n=!0),E(this,void 0,void 0,(function(){var r;return C(this,(function(o){switch(o.label){case 0:return[4,this.forwardProject(t,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,e(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopProjectForwarding(t)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},e.prototype.forwardProject=function(t,e){return void 0===e&&(e=!0),E(this,void 0,void 0,(function(){var n,r,o,i,s,a=this;return C(this,(function(u){switch(u.label){case 0:return this.assertStartedWithNodejs(),n=t.projectId,[4,this.listServices({parameters:{projectId:n}})];case 1:return r=u.sent(),[4,this.listAddons({parameters:{projectId:n}})];case 2:return o=u.sent(),[4,Promise.all(r.data.services.map((function(t){return E(a,void 0,void 0,(function(){return C(this,(function(r){return[2,this.forwardService({projectId:n,serviceId:t.id},e)]}))}))})))];case 3:return i=u.sent(),[4,Promise.all(o.data.addons.map((function(t){return E(a,void 0,void 0,(function(){return C(this,(function(r){switch(r.label){case 0:return[4,this.forwardAddon({projectId:n,addonId:t.id},e)];case 1:return[2,r.sent()]}}))}))})))];case 4:return s=u.sent(),[2,{services:i,addons:s}]}}))}))},e.prototype.withServiceForwarding=function(t,e,n){return void 0===n&&(n=!0),E(this,void 0,void 0,(function(){var r;return C(this,(function(o){switch(o.label){case 0:return[4,this.forwardService(t,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,e(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopServiceForwarding(t)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},e.prototype.forwardService=function(t,e){return void 0===e&&(e=!0),E(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c=this;return C(this,(function(l){switch(l.label){case 0:return this.assertStartedWithNodejs(),n=t.projectId,r=t.serviceId,[4,this.proxyApiClient.getServiceDetails(n,r)];case 1:return o=l.sent(),i=o.namespace,s=o.targetDomain,a=o.instances,u=o.ports,0===a.length?[2,[]]:[4,ra(u,(function(t){var o,u="https://".concat(s,"/tunnel/projects/").concat(n,"/services/").concat(r,"/instance/").concat(a[0].podName,"/port/").concat(t.internalPort),l="".concat(r,".").concat(i,".svc.cluster.local"),d=["".concat(r)];t.name&&d.push("".concat(t.name,".").concat(r)),"HTTP"===t.protocol&&(o={altHostnames:d,targetHostname:l});var h=e?[]:x([l],d,!0);return c.forwardPort(u,t,h,"service",r,n,e,o)}))];case 2:return[2,l.sent()]}}))}))},e.prototype.withAddonForwarding=function(t,e,n){return void 0===n&&(n=!0),E(this,void 0,void 0,(function(){var r;return C(this,(function(o){switch(o.label){case 0:return[4,this.forwardAddon(t,n)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,6]),[4,e(r)];case 3:return[2,o.sent()];case 4:return[4,this.stopAddonForwarding(t)];case 5:return o.sent(),[7];case 6:return[2]}}))}))},e.prototype.forwardAddon=function(t,e){return void 0===e&&(e=!0),E(this,void 0,void 0,(function(){var n,r,o,i,s=this;return C(this,(function(a){switch(a.label){case 0:return this.assertStartedWithNodejs(),n=t.addonId,r=t.projectId,[4,this.proxyApiClient.getAddonDetails(r,n)];case 1:return o=a.sent(),i=o.instances.map((function(t){var e=t.podName,n=t.internalHostname;return t.ports.map((function(t){return{podName:e,internalHostname:n,port:t}}))})),[4,ra((u=i,null!=u&&u.length?Ie(u,1/0):[]),(function(t){var i=t.podName,a=t.internalHostname,u=t.port;return E(s,void 0,void 0,(function(){var t;return C(this,(function(s){return t="https://".concat(o.targetDomain,"/tunnel/projects/").concat(r,"/addons/").concat(n,"/instance/").concat(i,"/port/").concat(u.internalPort),[2,this.forwardPort(t,u,e?[]:[a],"addon",n,r,e)]}))}))}))];case 2:return[2,a.sent()]}var u}))}))},e.prototype.allocateIpAddress=function(t){return E(this,void 0,void 0,(function(){var e=this;return C(this,(function(n){return[2,this.ipAllocationMutex.enter((function(){return E(e,void 0,void 0,(function(){var e,n,r,o,i;return C(this,(function(s){switch(s.label){case 0:return e="127.24.1.1",n="127.24.255.255",r=null!==(i=this.nextIpAddress)&&void 0!==i?i:e,[4,Xr(t,r,n)];case 1:return o=s.sent(),this.nextIpAddress=no(eo(o)+1),eo(this.nextIpAddress)>eo(n)&&(this.nextIpAddress=e),[2,o]}}))}))}))]}))}))},e.prototype.forwardPort=function(t,e,n,r,o,i,s,a){var u;return void 0===s&&(s=!0),E(this,void 0,void 0,(function(){var c,l,d,h,p,f,v=this;return C(this,(function(m){switch(m.label){case 0:if(c={Authorization:"Bearer ".concat(this.contextProvider.getCurrentToken())},!s&&(l=this.canExecuteWithHostnames()).error)throw new Error("".concat(l.message," Alternatively, you can use the ipOnly mode when port-forwarding (apiClient.forwarding.forwardAddon({ projectId, addonId }, true))"));return[4,this.determineSocketAddress(i,o,r,e,s)];case 1:return d=m.sent(),h="UDP"===e.protocol?new ea(t,c,d):new ta(t,c,a,d),s?[3,3]:[4,this.registerHostnames(null===(u=h.bindTo)||void 0===u?void 0:u.address,n)];case 2:m.sent(),m.label=3;case 3:return h.on("connection-accept",(function(){return v.emit("connection-accept",h)})),h.on("connection-close",(function(){return E(v,void 0,void 0,(function(){return C(this,(function(t){return[2,this.emit("connection-close",h)]}))}))})),[4,h.open()];case 4:return p=m.sent(),f={projectId:i,id:o,type:r,hostnames:n,port:p.port,address:p.address,protocol:e.protocol,portName:e.name},this.emit("tunnel-open",h,f),h.on("connection-error",(function(t){return v.emit("connection-error",h,f,t)})),h.on("tunnel-close",(function(){return v.emit("tunnel-close",h,f)})),this.connections.push({tunnel:h,forwardingContext:f}),[2,{data:f}]}}))}))},e.prototype.determineSocketAddress=function(t,e,n,r,o){var i;return E(this,void 0,void 0,(function(){var s,a,u;return C(this,(function(c){switch(c.label){case 0:return o?[2,void 0]:(s=this.connections.find((function(r){return r.forwardingContext.projectId===t&&r.forwardingContext.id===e&&r.forwardingContext.type===n})),a=(null===(i=null==s?void 0:s.forwardingContext)||void 0===i?void 0:i.port)!==r.internalPort,s&&a?[2,{address:s.forwardingContext.address,port:r.internalPort}]:(u={},[4,this.allocateIpAddress(r.internalPort)]));case 1:return[2,(u.address=c.sent(),u.port=r.internalPort,u)]}}))}))},e.prototype.registerHostnames=function(t,e){return E(this,void 0,void 0,(function(){return C(this,(function(n){switch(n.label){case 0:return[4,this.modifyHostsFile((function(n){n.removeHosts.apply(n,e),n.add.apply(n,x([t],e,!1))}))];case 1:return n.sent(),[2]}}))}))},e.prototype.unregisterHostnames=function(t,e){return E(this,void 0,void 0,(function(){return C(this,(function(n){switch(n.label){case 0:return[4,this.modifyHostsFile((function(n){n.remove.apply(n,x([t],e,!1))}))];case 1:return n.sent(),[2]}}))}))},e.prototype.modifyHostsFile=function(t){return E(this,void 0,void 0,(function(){var e=this;return C(this,(function(n){switch(n.label){case 0:return[4,this.hostsFileMutex.enter((function(){return E(e,void 0,void 0,(function(){var e,n=this;return C(this,(function(r){switch(r.label){case 0:return[4,yo.load({header:"Northflank Proxy"})];case 1:return e=r.sent(),t(e),[4,e.backup({suffix:".backup-pre-northflank"})];case 2:r.sent(),r.label=3;case 3:return r.trys.push([3,5,,7]),[4,sa(5)((function(){return E(n,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,e.write({writeMode:"atomic"})];case 1:return t.sent(),[2]}}))}))}))];case 4:return r.sent(),[3,7];case 5:return r.sent(),[4,sa(5)((function(){return E(n,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,e.write({writeMode:"standard"})];case 1:return t.sent(),[2]}}))}))}))];case 6:return r.sent(),[3,7];case 7:return[2]}}))}))}))];case 1:return n.sent(),[2]}}))}))},e.prototype.stopProjectForwarding=function(t){return E(this,void 0,void 0,(function(){var e=this;return C(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(e){return e.forwardingContext.projectId===t.projectId})).map((function(t){return e.stopForwarding(t)})))];case 1:return n.sent(),[2]}}))}))},e.prototype.stopServiceForwarding=function(t){return E(this,void 0,void 0,(function(){var e=this;return C(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(e){return"service"===e.forwardingContext.type&&e.forwardingContext.projectId===t.projectId&&e.forwardingContext.id===t.serviceId})).map((function(t){return e.stopForwarding(t)})))];case 1:return n.sent(),[2]}}))}))},e.prototype.stopAddonForwarding=function(t){return E(this,void 0,void 0,(function(){var e=this;return C(this,(function(n){switch(n.label){case 0:return[4,Promise.all(this.connections.filter((function(e){return"addon"===e.forwardingContext.type&&e.forwardingContext.projectId===t.projectId&&e.forwardingContext.id===t.addonId})).map((function(t){return e.stopForwarding(t)})))];case 1:return n.sent(),[2]}}))}))},e.prototype.stop=function(){return E(this,void 0,void 0,(function(){var t=this;return C(this,(function(e){switch(e.label){case 0:return[4,Promise.all(this.connections.map((function(e){return E(t,void 0,void 0,(function(){return C(this,(function(t){return[2,this.stopForwarding(e)]}))}))})))];case 1:return e.sent(),[2]}}))}))},e}(e),sa=function(t,e){return void 0===e&&(e=50),function(n){var r=t,o=function(){return E(void 0,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,n()];case 1:return[2,i.sent()];case 2:if(t=i.sent(),r<=0)throw t;return r-=1,[4,new Promise((function(t){return setTimeout((function(){return t()}),e)}))];case 3:return i.sent(),[2,o()];case 4:return[2]}}))}))};return o()}},aa=function(t){function e(e,r,o,i,s,a){void 0===i&&(i=new n.PassThrough),void 0===s&&(s=new n.PassThrough),void 0===a&&(a=new n.PassThrough);var u=t.call(this)||this;return u.baseUrl=e,u.execConfig=r,u.token=o,u.stdOut=i,u.stdErr=s,u.stdIn=a,u.waitForCommandResult=function(){return E(u,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:if(void 0===this.currentCommand)throw new Error("No command is running");return[4,this.currentCommand];case 1:return[2,t.sent()]}}))}))},u.sendInputToCurrentCommand=function(t){return E(u,void 0,void 0,(function(){var e;return C(this,(function(n){if(void 0===this.currentCommand||void 0===this.duplex)throw new Error("No command is running");return null===(e=this.duplex)||void 0===e||e.write(this.constructPayloadPacket(t)),[2]}))}))},u.resizeTerminal=function(t){return E(u,void 0,void 0,(function(){var e;return C(this,(function(n){if(void 0===this.currentCommand||void 0===this.duplex)throw new Error("No command is running, can't resize terminal");return null===(e=this.duplex)||void 0===e||e.write(JSON.stringify({type:"resize",data:{ttyRows:null==t?void 0:t.rows,ttyColumns:null==t?void 0:t.columns}})),[2]}))}))},u.constructPayloadPacket=function(t){return JSON.stringify({type:"payload",data:t.toString()})},u}return S(e,t),Object.defineProperty(e.prototype,"execEndpoint",{get:function(){var t=this.execConfig,e=t.entityId,n=t.entityType,r=t.projectId,o="".concat(this.baseUrl,"/v1/command-exec/projects/").concat(r,"/");return"".concat(o).concat(function(){switch(n){case"service":return"services/".concat(e);case"job":return"jobs/".concat(e);case"addon":return"addons/".concat(e);case"build":return"builds/".concat(e);default:throw new Error("Unexpected Northflank entity type received in command exec endpoint generation: ".concat(n))}}())},enumerable:!1,configurable:!0}),e.prototype.start=function(){return E(this,void 0,void 0,(function(){var t=this;return C(this,(function(e){if(void 0!==this.currentCommand)throw new Error("Command is already running");return this.currentCommand=new Promise((function(e,n){void 0!==t.remote&&n(Error("Command is already running"));var r,o=t.execEndpoint.replace("https:","wss:").replace("http:","ws:");t.remote=new Bs(o);try{t.duplex=Ro(t.remote)}catch(t){throw new Error("Failed to establish connection to command execution proxy: ".concat(t.message))}t.initialAuth(),t.stdIn.on("data",(function(e){var n,r;(null===(n=t.duplex)||void 0===n?void 0:n.writable)&&(null===(r=t.duplex)||void 0===r||r.write(t.constructPayloadPacket(e)))})),t.duplex.on("data",(function(e){var n,o,s=JSON.parse(e.toString());switch(null==s?void 0:s.type){case"init":var a=s.data;"successful"!==a.auth&&i("Command initialization failed: ".concat(null!==(n=null==a?void 0:a.message)&&void 0!==n?n:"Reason unknown"));break;case"completion":r=s.data,t.emit("command-result",r),null===(o=t.duplex)||void 0===o||o.end();break;case"stdOut":t.emit("std-out-data",s.data),t.stdOut.write(s.data);break;case"stdErr":t.emit("std-err-data",s.data),t.stdErr.write(s.data);break;case"error":i(s.data);break;default:var u="unable to parse message: ".concat(JSON.stringify(s));i(u)}})),t.duplex.on("end",(function(){t.emit("command-completed"),t.reset(),e(r)})),t.duplex.on("error",(function(n){t.emit("error",n),t.emit("command-completed"),t.reset(),e(r)}));var i=function(e){t.emit("error",e),t.reset(),n(new Error(e))};t.emit("command-started")})),[2,this.currentCommand]}))}))},e.prototype.initialAuth=function(){var t,e=this.execConfig,n=e.command,r=e.containerName,o=e.shell,i=e.user,s=e.group,a=e.ttyColumns,u=e.ttyRows,c={type:"init",data:{auth:{type:"apiToken",apiToken:this.token},context:{containerId:r,command:n,shell:o,user:i,group:s,ttyColumns:a,ttyRows:u}}};null===(t=this.duplex)||void 0===t||t.write(JSON.stringify(c))},e.prototype.reset=function(){var t;this.remote=void 0,this.currentCommand=void 0,null===(t=this.duplex)||void 0===t||t.destroy(),this.duplex=void 0},e}(e),ua=function(){function t(t){this.contextProvider=t,this.assertStartedWithNodejs=function(){if(!na)throw new Error("Command exec only possible when started with nodejs")}}return t.prototype.execServiceCommand=function(t,e){return E(this,void 0,void 0,(function(){var n,r,o;return C(this,(function(i){return n=t.serviceId,r=t.projectId,"service",o=A({projectId:r,entityId:n,entityType:"service"},e),[2,this.execCommand(o)]}))}))},t.prototype.execServiceSession=function(t,e){return E(this,void 0,void 0,(function(){var n,r,o;return C(this,(function(i){return n=t.serviceId,r=t.projectId,"service",o=A({projectId:r,entityId:n,entityType:"service"},e),[2,this.shellSession(o)]}))}))},t.prototype.execJobCommand=function(t,e){return E(this,void 0,void 0,(function(){var n,r,o;return C(this,(function(i){return n=t.jobId,r=t.projectId,"job",o=A({projectId:r,entityId:n,entityType:"job"},e),[2,this.execCommand(o)]}))}))},t.prototype.execJobSession=function(t,e){return E(this,void 0,void 0,(function(){var n,r,o;return C(this,(function(i){return n=t.jobId,r=t.projectId,"job",o=A({projectId:r,entityId:n,entityType:"job"},e),[2,this.shellSession(o)]}))}))},t.prototype.execCommand=function(t){return E(this,void 0,void 0,(function(){var e,n,r;return C(this,(function(o){switch(o.label){case 0:return this.assertStartedWithNodejs(),e=this.getCommandRunner(A({shell:"none"},t)),n=new oa,r=new oa,e.stdOut.pipe(n),e.stdErr.pipe(r),e.on("error",(function(t){throw new Error(t)})),[4,e.start()];case 1:return[2,{commandResult:o.sent(),stdOut:n.getContentsAsString(),stdErr:r.getContentsAsString()}]}}))}))},t.prototype.shellSession=function(t){this.assertStartedWithNodejs();var e=this.getCommandRunner(t);return e.start(),e},t.prototype.getCommandRunner=function(t){var e=this.contextProvider.getCurrentBaseUrl(!0),n=this.contextProvider.getCurrentToken();if(!n)throw Error("API token not found");return new aa(e,t,n)},t}(),ca=na?Zr:window.fetch,la=function(){if(na)try{return JSON.parse(b.readFileSync(y.join(y.dirname(a(import.meta.url)),"../../package.json")).toString())}catch(t){return console.log("Failed to check version of northflank CLI (".concat(t.message,")")),{}}return{}},da=function(){function t(t,e){var n=this;this.opts=e,this.call=function(t){return E(n,void 0,void 0,(function(){var e,n,r,o,i,s,a,u,c,l,d,h,p=this;return C(this,(function(f){switch(f.label){case 0:if(e=this.method,n={method:e,headers:this.getDefaultHeaders()},!(r=null===(h=this.contextProvider)||void 0===h?void 0:h.getCurrentBaseUrl()))throw new Error("Api client context not correctly initialized, please provide a url to the context.");return o="".concat(r).concat(this.endpointUrl(t)),i=this.body(t),s=A(A({url:o},n),{body:i}),[4,va(o,A(A({},n),{body:i}))];case 1:return[4,(a=f.sent()).text()];case 2:return u=f.sent(),c=function(){if(200!==a.status){var t=null==l?void 0:l.error,e=401===a.status?" (Make sure your API token has sufficient permissions)":"",n="".concat((null==t?void 0:t.message)||"").concat(e);if(p.opts.throwErrorOnHttpErrorCode)throw Error(n);return{status:a.status,message:n,id:null==t?void 0:t.id,details:null==t?void 0:t.details}}},l=function(){try{return JSON.parse(u)}catch(t){throw Error("Failed reading api request result: \n\tStatus: ".concat(a.statusText," (").concat(a.status,")\n\tMessage: ").concat(u))}}(),d=c(),[2,{data:null==l?void 0:l.data,rawResponse:a,request:s,error:d,pagination:null==l?void 0:l.pagination}]}}))}))},this.contextProvider=t}return t.prototype.getDefaultHeaders=function(){var t,e,n=this.contextProvider.getCurrentToken(),r=(null===(t=this.opts)||void 0===t?void 0:t.customUserAgent)?" (".concat(this.opts.customUserAgent,")"):"";return{Authorization:this.withAuth?"Bearer ".concat(n):void 0,"Content-Type":"application/json","User-Agent":"northflank-js-client/".concat(null===(e=la())||void 0===e?void 0:e.version).concat(r)}},t}(),ha=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.method="get",e.body=function(){},e}return S(e,t),e}(da),pa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.method="post",e}return S(e,t),e}(da),fa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.method="delete",e.body=function(){},e}return S(e,t),e}(da),va=function(t,e,n,r){return void 0===e&&(e={}),void 0===n&&(n=3),void 0===r&&(r=500),new Promise((function(o,i){var s=function(n){return ca(t,e).then((function(t){o(t)})).catch((function(t){return E(void 0,void 0,void 0,(function(){return C(this,(function(e){switch(e.label){case 0:return n>0?[4,(o=r,new Promise((function(t){setTimeout((function(){t()}),o)})))]:[3,2];case 1:return e.sent(),[2,s(n-1)];case 2:return[2,i(t)]}var o}))}))}))};return s(n)}))},ma=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists projects for the authenticated user or team.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects".concat(r)},e.body=function(){},e}return S(e,t),e}(ha),ba=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new project.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects"},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),ya=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get information about the given project",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId)},e.body=function(){},e}return S(e,t),e}(ha),ga=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Delete the given project. Fails if the project isn't empty.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId)},e.body=function(){},e}return S(e,t),e}(fa),wa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of addons belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/addons").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),_a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new addon",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),ja=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the given addon",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId)},e.body=function(){},e}return S(e,t),e}(ha),Sa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId)},e.body=function(){},e}return S(e,t),e}(fa),Aa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns the credentials for connecting to the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/credentials")},e.body=function(){},e}return S(e,t),e}(ha),Ea=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the available addon types",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/addon-types"},e.body=function(){},e}return S(e,t),e}(ha),Ca=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Modifies the allocated resources for the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/scale")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),xa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about the current addon version including available upgrades and upgrade history.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/version")},e.body=function(){},e}return S(e,t),e}(ha),Oa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Upgrades the addon to a new version.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/version")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Ia=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the network settings for the addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/network-settings")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),ka=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the security rules for the addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/security")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Ua=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns a list of backups for the given addon.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Pa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Initiates a backup for the given addon",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Da=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about a given backup including restore history",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId)},e.body=function(){},e}return S(e,t),e}(ha),Na=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes a given backup",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId)},e.body=function(){},e}return S(e,t),e}(fa),Ba=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Restores the given addon to the given backup state.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId,"/restore")},e.body=function(){},e}return S(e,t),e}(pa),Ta=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Imports a database from an external archive or existing live database.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/import")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),La=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of containers for the given addon.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/containers").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Fa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Pause the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/pause")},e.body=function(){},e}return S(e,t),e}(pa),Ra=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Resume the given addon if it is paused.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/resume")},e.body=function(){},e}return S(e,t),e}(pa),Ma=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Restart the given addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/restart")},e.body=function(){},e}return S(e,t),e}(pa),za=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts the in progress backup.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId,"/abort")},e.body=function(){},e}return S(e,t),e}(pa),Wa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Generates a temporary download link for downloading the given backup.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId,"/download-link")},e.body=function(){},e}return S(e,t),e}(ha),qa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts an in-progress backup restore.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/addons/").concat(t.parameters.addonId,"/backups/").concat(t.parameters.backupId,"/abort-restore")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),$a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of jobs belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Ga=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the given job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId)},e.body=function(){},e}return S(e,t),e}(ha),Ha=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId)},e.body=function(){},e}return S(e,t),e}(fa),Va=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new manual job that only runs when initiated via the UI, CLI, API or JS client.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/manual")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Ja=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new cron job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/cron")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Ya=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Modifies the scaling settings for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/scale")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Za=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Fetches run history for the given job",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runs").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Ka=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Starts a new job run for the given job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runs")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Xa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns data about the given job run",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runs/").concat(t.parameters.runId)},e.body=function(){},e}return S(e,t),e}(ha),Qa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts the given job run",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runs/").concat(t.parameters.runId)},e.body=function(){},e}return S(e,t),e}(fa),tu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates settings for the job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/settings")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),eu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the health checks for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/health-checks")},e.body=function(){},e}return S(e,t),e}(ha),nu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates health checks for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/health-checks")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),ru=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists builds for the given job.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),ou=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Start a new build for the given job. Given a commit sha, it will build that commit.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),iu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about a build for the job",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build/").concat(t.parameters.buildId)},e.body=function(){},e}return S(e,t),e}(ha),su=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts the given job build",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build/").concat(t.parameters.buildId)},e.body=function(){},e}return S(e,t),e}(fa),au=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the build options for a given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-options")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),uu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the version control source for a given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-source")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),cu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the Docker CMD override for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/cmd-override")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),lu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets the build arguments of the given job. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-arguments").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),du=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets build arguments for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-arguments")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),hu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about the build arguments accessible by the given job. Also requires the permission 'Project > Secrets > General > Read'",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/build-arguments/details")},e.body=function(){},e}return S(e,t),e}(ha),pu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns the runtime environment for the given job. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runtime-environment").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),fu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the runtime environment for the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runtime-environment")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),vu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about the runtime environment accessible by the given job. Also requires the permission 'Project > Secrets > General > Read'",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/runtime-environment/details")},e.body=function(){},e}return S(e,t),e}(ha),mu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the deployment of the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/deployment")},e.body=function(){},e}return S(e,t),e}(ha),bu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the deployment settings of the given job.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/deployment")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),yu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of containers for the given job.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/containers").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),gu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the branches of the given job.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/branches").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),wu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the pull-requests of the given job.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/jobs/").concat(t.parameters.jobId,"/pull-requests").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),_u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the container registry credentials saved to this account. Does not display secrets.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/registry-credentials".concat(r)},e.body=function(){},e}return S(e,t),e}(ha),ju=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Adds a new set of container registry credentials to this account.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/registry-credentials"},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Su=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Views a set of registry credential data.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/registry-credentials/".concat(t.parameters.credentialId)},e.body=function(){},e}return S(e,t),e}(ha),Au=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes a set of registry credential data.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/registry-credentials/".concat(t.parameters.credentialId)},e.body=function(){},e}return S(e,t),e}(fa),Eu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates a set of registry credential data.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/registry-credentials/".concat(t.parameters.credentialId,"/modify")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Cu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists available domains",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/domains".concat(r)},e.body=function(){},e}return S(e,t),e}(ha),xu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Registers a new domain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains"},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Ou=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about domain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain)},e.body=function(){},e}return S(e,t),e}(ha),Iu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes a domain and each of its registered subdomains.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain)},e.body=function(){},e}return S(e,t),e}(fa),ku=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Attempts to verify the domain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/verify")},e.body=function(){},e}return S(e,t),e}(pa),Uu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Adds a new subdomain to the domain.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Pu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about the given subdomain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain)},e.body=function(){},e}return S(e,t),e}(ha),Du=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Removes a subdomain from a domain.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain)},e.body=function(){},e}return S(e,t),e}(fa),Nu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets details about the given subdomain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain,"/verify")},e.body=function(){},e}return S(e,t),e}(pa),Bu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Assigns a service port to the given subdomain",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain,"/assign")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Tu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Removes a subdomain from its assigned service",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/domains/".concat(t.parameters.domain,"/subdomains/").concat(t.parameters.subdomain,"/assign")},e.body=function(){},e}return S(e,t),e}(fa),Lu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists available billing plans",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/plans"},e.body=function(){},e}return S(e,t),e}(ha),Fu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists available project regions",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/regions"},e.body=function(){},e}return S(e,t),e}(ha),Ru=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Returns the partially random string used when generating host names for the authenticated account.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/dns-id"},e.body=function(){},e}return S(e,t),e}(ha),Mu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists linked version control providers",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/vcs"},e.body=function(){},e}return S(e,t),e}(ha),zu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of secrets belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/secrets").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Wu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a secret with the specified payload",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),qu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="View a secret including its contents",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId).concat(r)},e.body=function(){},e}return S(e,t),e}(ha),$u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Delete a secret",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId)},e.body=function(){},e}return S(e,t),e}(fa),Gu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Update a secret",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId)},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Hu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="View a secret with details about its linked addons",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId,"/details")},e.body=function(){},e}return S(e,t),e}(ha),Vu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Link an addon to the secret group or edit the settings of the linked addon.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId,"/addons/").concat(t.parameters.addonId)},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Ju=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about a given addon link.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId,"/addons/").concat(t.parameters.addonId)},e.body=function(){},e}return S(e,t),e}(ha),Yu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Unlinks an addon from the secret group.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/secrets/").concat(t.parameters.secretId,"/addons/").concat(t.parameters.addonId)},e.body=function(){},e}return S(e,t),e}(fa),Zu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of services belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Ku=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new combined service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/combined")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Xu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new deployment service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/deployment")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Qu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a new build service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/build")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),tc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId)},e.body=function(){},e}return S(e,t),e}(ha),ec=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId)},e.body=function(){},e}return S(e,t),e}(fa),nc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Modifies the scaling settings for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/scale")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),rc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the deployment of the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/deployment")},e.body=function(){},e}return S(e,t),e}(ha),oc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the deployment settings of the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/deployment")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),ic=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Restarts the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/restart")},e.body=function(){},e}return S(e,t),e}(pa),sc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Pause the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/pause")},e.body=function(){},e}return S(e,t),e}(pa),ac=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Resumes the given service. Optionally takes `instances` to resume with a given number of instances.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/resume")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),uc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the ports for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/ports")},e.body=function(){},e}return S(e,t),e}(ha),cc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the list of ports for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/ports")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),lc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the build options for a given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-options")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),dc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates the version control source for a given build or combined service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-source")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),hc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the Docker CMD override for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/cmd-override")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),pc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the health checks for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/health-checks")},e.body=function(){},e}return S(e,t),e}(ha),fc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Updates health checks for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/health-checks")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),vc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Lists the builds for the service",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),mc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Start a new build for the given combined or build service. If given a commit sha, it will build that commit. Otherwise, the most recent relevant commit will be built. If the service provided is a build service, a branch name or pull request to build from is required.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),bc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about a build for the service",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build/").concat(t.parameters.buildId)},e.body=function(){},e}return S(e,t),e}(ha),yc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Aborts the given service build",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build/").concat(t.parameters.buildId)},e.body=function(){},e}return S(e,t),e}(fa),gc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of containers for the given service.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/containers").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),wc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the branches of the given service.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/branches").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),_c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets information about the pull-requests of the given service.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/pull-requests").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),jc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of repositories accessible to this account",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/vcs/repos".concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Sc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of branches for the repo",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/vcs/repos/".concat(t.parameters.vcsService,"/").concat(t.parameters.repositoryOwner,"/").concat(t.parameters.repositoryName,"/branches").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Ac=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets a list of volumes belonging to the project",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes")},e.body=function(){},e}return S(e,t),e}(ha),Ec=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Creates a volume with the specified payload",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Cc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Retrieve a volume",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId)},e.body=function(){},e}return S(e,t),e}(ha),xc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Update volume mounts and storage size",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId)},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Oc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Deletes this volume and its associated data.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId)},e.body=function(){},e}return S(e,t),e}(fa),Ic=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Attach a volume",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId,"/attach")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),kc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Detach a volume",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/volumes/").concat(t.parameters.volumeId,"/detach")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Uc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets the build arguments of the given service. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-arguments").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Pc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the build arguments for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-arguments")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Dc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about the build arguments accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/build-arguments/details")},e.body=function(){},e}return S(e,t),e}(ha),Nc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Gets the runtime environment of the given service. If the API key does not have the permission 'Project > Secrets > General > Read', secrets inherited from secret groups will not be displayed.",e.withAuth=!0,e.endpointUrl=function(t){var e,n=Object.entries(null!==(e=null==t?void 0:t.options)&&void 0!==e?e:{}),r=n.length>0?"?".concat(n.map((function(t){return"".concat(t[0],"=").concat(t[1])})).join("&")):"";return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/runtime-environment").concat(r)},e.body=function(){},e}return S(e,t),e}(ha),Bc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Sets the runtime environment for the given service.",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/runtime-environment")},e.body=function(t){return JSON.stringify(t.data)},e}return S(e,t),e}(pa),Tc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.description="Get details about the runtime environment accessible by the given service. Also requires the permission 'Project > Secrets > General > Read'",e.withAuth=!0,e.endpointUrl=function(t){return"/v1/projects/".concat(t.parameters.projectId,"/services/").concat(t.parameters.serviceId,"/runtime-environment/details")},e.body=function(){},e}return S(e,t),e}(ha),Lc=function(){function t(){this.loadContext()}return t.prototype.loadContext=function(){this.contextWrapper=this.loadContextWrapper()},t.prototype.getInfo=function(){return""},t.prototype.storeContext=function(t){return E(this,void 0,void 0,(function(){return C(this,(function(e){switch(e.label){case 0:return[4,this.writeContext(t)];case 1:return e.sent(),this.contextWrapper=t,[2]}}))}))},t.prototype.addContext=function(t,e){return void 0===e&&(e=!0),E(this,void 0,void 0,(function(){var n,r,o;return C(this,(function(i){switch(i.label){case 0:if(e||void 0===this.findContext(t.name))return[3,1];throw new Error("Context with name ".concat(t.name," already exists"));case 1:return[4,this.removeContext(t.name)];case 2:i.sent(),i.label=3;case 3:return n=A({host:"https://api.northflank.com"},t),r=this.contextWrapper,o={current:n.name,contexts:x(x([],r.contexts,!0),[n],!1),lastUpdateCheck:r.lastUpdateCheck},[4,this.storeContext(o)];case 4:return i.sent(),[2]}}))}))},t.prototype.removeContext=function(t){return E(this,void 0,void 0,(function(){var e,n,r,o;return C(this,(function(i){switch(i.label){case 0:return e=this.contextWrapper,n=e.contexts.filter((function(e){return e.name!==t})),r=e.current===t?void 0:e.current,o={current:r,contexts:x([],n,!0),lastUpdateCheck:e.lastUpdateCheck},[4,this.storeContext(o)];case 1:return i.sent(),[2]}}))}))},t.prototype.getCurrentContext=function(){var t=this.contextWrapper.current;return void 0===t?t:this.findContext(t)},t.prototype.findContext=function(t){return this.contextWrapper.contexts.find((function(e){return e.name===t}))},t.prototype.getCurrentBaseUrl=function(t){var e=this.getCurrentContext();if(!0===t&&!(null==e?void 0:e.host))throw new Error("Context (".concat(null==e?void 0:e.name,") doesn't have a target API host. Please login again."));return null==e?void 0:e.host},t.prototype.getCurrentProjectName=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.project},t.prototype.getCurrentName=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.name},t.prototype.getCurrentToken=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.token},t.prototype.getCurrentServiceName=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.service},t.prototype.getCurrentJobName=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.job},t.prototype.getCurrentPlanId=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.plan},t.prototype.getCurrentRegion=function(){var t;return null===(t=this.getCurrentContext())||void 0===t?void 0:t.region},t.prototype.useContext=function(t){return E(this,void 0,void 0,(function(){var e,n;return C(this,(function(r){switch(r.label){case 0:if(!this.findContext(t))throw new Error("Context with name ".concat(t," doesn't exist"));return e=this.contextWrapper,n=A(A({},e),{current:t}),[4,this.storeContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.updateToken=function(t,e){return E(this,void 0,void 0,(function(){var n,r,o,i,s;return C(this,(function(a){switch(a.label){case 0:if(n=null!=e?e:this.getCurrentName(),!(r=this.findContext(n)))throw new Error("Context with name ".concat(e," doesn't exist"));return o=this.contextWrapper,i=o.contexts.map((function(e){return e.name===n?A(A({},r),{token:t}):e})),s=A(A({},o),{contexts:i}),[4,this.storeContext(s)];case 1:return a.sent(),[2]}}))}))},t.prototype.useProjectId=function(t){return E(this,void 0,void 0,(function(){var e,n;return C(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set project id to current context, current context not defined");return n=A(A({},e),{project:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.useServiceId=function(t){return E(this,void 0,void 0,(function(){var e,n;return C(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set service id to current context, current context not defined");return n=A(A({},e),{service:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.useJobId=function(t){return E(this,void 0,void 0,(function(){var e,n;return C(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set job id to current context, current context not defined");return n=A(A({},e),{job:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.usePlanId=function(t){return E(this,void 0,void 0,(function(){var e,n;return C(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set plan id to current context, current context not defined");return n=A(A({},e),{plan:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.useRegion=function(t){return E(this,void 0,void 0,(function(){var e,n;return C(this,(function(r){switch(r.label){case 0:if(void 0===(e=this.getCurrentContext()))throw new Error("Failed to set region id to current context, current context not defined");return n=A(A({},e),{region:t}),[4,this.addContext(n)];case 1:return r.sent(),[2]}}))}))},t.prototype.getLastUpdateCheck=function(){return this.contextWrapper.lastUpdateCheck||new Date},t.prototype.setLastUpdateCheck=function(t){return E(this,void 0,void 0,(function(){var e,n;return C(this,(function(r){switch(r.label){case 0:return e=this.contextWrapper,n=A(A({},e),{lastUpdateCheck:t}),[4,this.storeContext(n)];case 1:return r.sent(),[2]}}))}))},t}(),Fc=function(t){function e(e){var n=t.call(this)||this;return n.assertDir=function(t){return E(n,void 0,void 0,(function(){var e;return C(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,b.promises.mkdir(t,{recursive:!0})];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.log("Failed to login, local files could not be created: ".concat(t,", error: ").concat(e.message)),e;case 3:return[2]}}))}))},n.configPath=e||"".concat(d.homedir(),"/.northflank"),n.configFile="".concat(n.configPath,"/config.json"),n.loadContext(),n}return S(e,t),e.prototype.loadContextWrapper=function(){try{return JSON.parse(b.readFileSync(this.configFile,"utf8"))}catch(t){return{contexts:[],lastUpdateCheck:new Date(0)}}},e.prototype.writeContext=function(t){return E(this,void 0,void 0,(function(){var e;return C(this,(function(n){switch(n.label){case 0:return[4,this.assertConfigDir()];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,b.promises.writeFile(this.configFile,JSON.stringify(t,null,"\t"),{mode:416})];case 3:return n.sent(),[3,5];case 4:throw e=n.sent(),console.log("Failed to persist api context, local files could not be created, error: ".concat(e.message)),e;case 5:return[2]}}))}))},e.prototype.assertConfigDir=function(){return E(this,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.assertDir(this.configPath)];case 1:return t.sent(),[2]}}))}))},e.prototype.getInfo=function(){return"Cli config stored in: ".concat(this.configPath)},e}(Lc),Rc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.inMemoryContextWrapper={contexts:[],lastUpdateCheck:new Date(0)},e}return S(e,t),e.prototype.loadContextWrapper=function(){return this.inMemoryContextWrapper||(this.inMemoryContextWrapper={contexts:[],lastUpdateCheck:new Date(0)}),this.inMemoryContextWrapper},e.prototype.writeContext=function(t){return E(this,void 0,void 0,(function(){return C(this,(function(e){return this.inMemoryContextWrapper=t,[2]}))}))},e}(Lc),Mc=function(t,e){void 0===e&&(e={});var n,r=this;this.baseUrl=function(){return r.contextProvider.getCurrentBaseUrl()},this.contextProvider=t,this.forwarding=new ia(t,new Zu(t,e).call,new wa(t,e).call),this.exec=new ua(t),this.endpoints={list:(n={},n.projects=new ma(t,e),n.addons=new wa(t,e),n.jobs=new $a(t,e),n.registryCredentials=new _u(t,e),n.domains=new Cu(t,e),n.plans=new Lu(t,e),n.regions=new Fu(t,e),n.vcs=new Mu(t,e),n.secrets=new zu(t,e),n.services=new Zu(t,e),n.repos=new jc(t,e),n.branches=new Sc(t,e),n.volumes=new Ac(t,e),n),create:function(){var n,r={};return r.project=new ba(t,e),r.addon=new _a(t,e),r.job=((n={}).manual=new Va(t,e),n.cron=new Ja(t,e),n),r.domain=new xu(t,e),r.secret=new Wu(t,e),r.service=function(){var n={};return n.combined=new Ku(t,e),n.deployment=new Xu(t,e),n.build=new Qu(t,e),n}(),r.volume=new Ec(t,e),r}(),get:function(){var n,r,o={};return o.project=new ya(t,e),o.addon=((r=new ja(t,e)).credentials=new Aa(t,e),r.types=new Ea(t,e),r.version=new xa(t,e),r.backups=new Ua(t,e),r.backup=((n=new Da(t,e)).download=new Wa(t,e),n),r.containers=new La(t,e),r),o.job=function(){var n=new Ga(t,e);return n.runs=new Za(t,e),n.run=new Xa(t,e),n.healthChecks=new eu(t,e),n.builds=new ru(t,e),n.build=new iu(t,e),n.buildArguments=new lu(t,e),n.buildArgumentDetails=new hu(t,e),n.runtimeEnvironment=new pu(t,e),n.runtimeEnvironmentDetails=new vu(t,e),n.deployment=new mu(t,e),n.containers=new yu(t,e),n.branches=new gu(t,e),n.pullRequests=new wu(t,e),n}(),o.registryCredentials=new Su(t,e),o.domain=new Ou(t,e),o.subdomain=new Pu(t,e),o.dnsId=new Ru(t,e),o.secret=new qu(t,e),o.secretDetails=new Hu(t,e),o.secretLink=new Ju(t,e),o.service=function(){var n=new tc(t,e);return n.deployment=new rc(t,e),n.ports=new uc(t,e),n.healthChecks=new pc(t,e),n.builds=new vc(t,e),n.build=new bc(t,e),n.containers=new gc(t,e),n.branches=new wc(t,e),n.pullRequests=new _c(t,e),n.buildArguments=new Uc(t,e),n.buildArgumentDetails=new Dc(t,e),n.runtimeEnvironment=new Nc(t,e),n.runtimeEnvironmentDetails=new Tc(t,e),n}(),o.volume=new Cc(t,e),o}(),delete:function(){var n={};return n.project=new ga(t,e),n.addon=new Sa(t,e),n.backup=new Na(t,e),n.job=new Ha(t,e),n.registryCredentials=new Au(t,e),n.domain=new Iu(t,e),n.subdomain=new Du(t,e),n.secret=new $u(t,e),n.secretLink=new Yu(t,e),n.service=new ec(t,e),n.volume=new Oc(t,e),n}(),scale:function(){var n={};return n.addon=new Ca(t,e),n.job=new Ya(t,e),n.service=new nc(t,e),n}(),update:function(){var n,r={};return r.addon=((n={}).version=new Oa(t,e),n.networkSettings=new Ia(t,e),n.security=new ka(t,e),n),r.job=function(){var n={};return n.settings=new tu(t,e),n.healthChecks=new nu(t,e),n.buildOptions=new au(t,e),n.buildSource=new uu(t,e),n.cmdOverride=new cu(t,e),n.buildArguments=new du(t,e),n.runtimeEnvironment=new fu(t,e),n.deployment=new bu(t,e),n}(),r.registryCredentials=new Eu(t,e),r.secret=new Gu(t,e),r.secretLink=new Vu(t,e),r.service=function(){var n={};return n.deployment=new oc(t,e),n.ports=new cc(t,e),n.buildOptions=new lc(t,e),n.buildSource=new dc(t,e),n.cmdOverride=new hc(t,e),n.healthChecks=new fc(t,e),n.buildArguments=new Pc(t,e),n.runtimeEnvironment=new Bc(t,e),n}(),r.volume=new xc(t,e),r}(),backup:function(){var n={};return n.addon=new Pa(t,e),n}(),restore:function(){var n,r={};return r.addon=((n={}).backup=new Ba(t,e),n),r}(),import:function(){var n,r={};return r.addon=((n={}).backup=new Ta(t,e),n),r}(),pause:function(){var n={};return n.addon=new Fa(t,e),n.service=new sc(t,e),n}(),resume:function(){var n={};return n.addon=new Ra(t,e),n.service=new ac(t,e),n}(),restart:function(){var n={};return n.addon=new Ma(t,e),n.service=new ic(t,e),n}(),abort:function(){var n,r={};return r.addon=((n={}).backup=new za(t,e),n.restore=new qa(t,e),n),r.job=function(){var n={};return n.run=new Qa(t,e),n.build=new su(t,e),n}(),r.service=function(){var n={};return n.build=new yc(t,e),n}(),r}(),start:function(){var n,r={};return r.job=((n={}).run=new Ka(t,e),n.build=new ou(t,e),n),r.service=function(){var n={};return n.build=new mc(t,e),n}(),r}(),add:function(){var n,r={};return r.registryCredentials=new ju(t,e),r.domain=((n={}).subdomain=new Uu(t,e),n),r}(),verify:function(){var n={};return n.domain=new ku(t,e),n.subdomain=new Nu(t,e),n}(),assign:function(){var n,r={};return r.subdomain=((n={}).service=new Bu(t,e),n),r}(),unassign:function(){var n={};return n.subdomain=new Tu(t,e),n}(),attach:function(){var n={};return n.volume=new Ic(t,e),n}(),detach:function(){var n={};return n.volume=new kc(t,e),n}()},this.list=function(){var t={};return t.projects=r.endpoints.list.projects.call,t.addons=r.endpoints.list.addons.call,t.jobs=r.endpoints.list.jobs.call,t.registryCredentials=r.endpoints.list.registryCredentials.call,t.domains=r.endpoints.list.domains.call,t.plans=r.endpoints.list.plans.call,t.regions=r.endpoints.list.regions.call,t.vcs=r.endpoints.list.vcs.call,t.secrets=r.endpoints.list.secrets.call,t.services=r.endpoints.list.services.call,t.repos=r.endpoints.list.repos.call,t.branches=r.endpoints.list.branches.call,t.volumes=r.endpoints.list.volumes.call,t}(),this.create=function(){var t,e={};return e.project=r.endpoints.create.project.call,e.addon=r.endpoints.create.addon.call,e.job=((t={}).manual=r.endpoints.create.job.manual.call,t.cron=r.endpoints.create.job.cron.call,t),e.domain=r.endpoints.create.domain.call,e.secret=r.endpoints.create.secret.call,e.service=function(){var t={};return t.combined=r.endpoints.create.service.combined.call,t.deployment=r.endpoints.create.service.deployment.call,t.build=r.endpoints.create.service.build.call,t}(),e.volume=r.endpoints.create.volume.call,e}(),this.get=function(){var t,e,n={};return n.project=r.endpoints.get.project.call,n.addon=((e=r.endpoints.get.addon.call).credentials=r.endpoints.get.addon.credentials.call,e.types=r.endpoints.get.addon.types.call,e.version=r.endpoints.get.addon.version.call,e.backups=r.endpoints.get.addon.backups.call,e.backup=((t=r.endpoints.get.addon.backup.call).download=r.endpoints.get.addon.backup.download.call,t),e.containers=r.endpoints.get.addon.containers.call,e),n.job=function(){var t=r.endpoints.get.job.call;return t.runs=r.endpoints.get.job.runs.call,t.run=r.endpoints.get.job.run.call,t.healthChecks=r.endpoints.get.job.healthChecks.call,t.builds=r.endpoints.get.job.builds.call,t.build=r.endpoints.get.job.build.call,t.buildArguments=r.endpoints.get.job.buildArguments.call,t.buildArgumentDetails=r.endpoints.get.job.buildArgumentDetails.call,t.runtimeEnvironment=r.endpoints.get.job.runtimeEnvironment.call,t.runtimeEnvironmentDetails=r.endpoints.get.job.runtimeEnvironmentDetails.call,t.deployment=r.endpoints.get.job.deployment.call,t.containers=r.endpoints.get.job.containers.call,t.branches=r.endpoints.get.job.branches.call,t.pullRequests=r.endpoints.get.job.pullRequests.call,t}(),n.registryCredentials=r.endpoints.get.registryCredentials.call,n.domain=r.endpoints.get.domain.call,n.subdomain=r.endpoints.get.subdomain.call,n.dnsId=r.endpoints.get.dnsId.call,n.secret=r.endpoints.get.secret.call,n.secretDetails=r.endpoints.get.secretDetails.call,n.secretLink=r.endpoints.get.secretLink.call,n.service=function(){var t=r.endpoints.get.service.call;return t.deployment=r.endpoints.get.service.deployment.call,t.ports=r.endpoints.get.service.ports.call,t.healthChecks=r.endpoints.get.service.healthChecks.call,t.builds=r.endpoints.get.service.builds.call,t.build=r.endpoints.get.service.build.call,t.containers=r.endpoints.get.service.containers.call,t.branches=r.endpoints.get.service.branches.call,t.pullRequests=r.endpoints.get.service.pullRequests.call,t.buildArguments=r.endpoints.get.service.buildArguments.call,t.buildArgumentDetails=r.endpoints.get.service.buildArgumentDetails.call,t.runtimeEnvironment=r.endpoints.get.service.runtimeEnvironment.call,t.runtimeEnvironmentDetails=r.endpoints.get.service.runtimeEnvironmentDetails.call,t}(),n.volume=r.endpoints.get.volume.call,n}(),this.delete=function(){var t={};return t.project=r.endpoints.delete.project.call,t.addon=r.endpoints.delete.addon.call,t.backup=r.endpoints.delete.backup.call,t.job=r.endpoints.delete.job.call,t.registryCredentials=r.endpoints.delete.registryCredentials.call,t.domain=r.endpoints.delete.domain.call,t.subdomain=r.endpoints.delete.subdomain.call,t.secret=r.endpoints.delete.secret.call,t.secretLink=r.endpoints.delete.secretLink.call,t.service=r.endpoints.delete.service.call,t.volume=r.endpoints.delete.volume.call,t}(),this.scale=function(){var t={};return t.addon=r.endpoints.scale.addon.call,t.job=r.endpoints.scale.job.call,t.service=r.endpoints.scale.service.call,t}(),this.update=function(){var t,e={};return e.addon=((t={}).version=r.endpoints.update.addon.version.call,t.networkSettings=r.endpoints.update.addon.networkSettings.call,t.security=r.endpoints.update.addon.security.call,t),e.job=function(){var t={};return t.settings=r.endpoints.update.job.settings.call,t.healthChecks=r.endpoints.update.job.healthChecks.call,t.buildOptions=r.endpoints.update.job.buildOptions.call,t.buildSource=r.endpoints.update.job.buildSource.call,t.cmdOverride=r.endpoints.update.job.cmdOverride.call,t.buildArguments=r.endpoints.update.job.buildArguments.call,t.runtimeEnvironment=r.endpoints.update.job.runtimeEnvironment.call,t.deployment=r.endpoints.update.job.deployment.call,t}(),e.registryCredentials=r.endpoints.update.registryCredentials.call,e.secret=r.endpoints.update.secret.call,e.secretLink=r.endpoints.update.secretLink.call,e.service=function(){var t={};return t.deployment=r.endpoints.update.service.deployment.call,t.ports=r.endpoints.update.service.ports.call,t.buildOptions=r.endpoints.update.service.buildOptions.call,t.buildSource=r.endpoints.update.service.buildSource.call,t.cmdOverride=r.endpoints.update.service.cmdOverride.call,t.healthChecks=r.endpoints.update.service.healthChecks.call,t.buildArguments=r.endpoints.update.service.buildArguments.call,t.runtimeEnvironment=r.endpoints.update.service.runtimeEnvironment.call,t}(),e.volume=r.endpoints.update.volume.call,e}(),this.backup=function(){var t={};return t.addon=r.endpoints.backup.addon.call,t}(),this.restore=function(){var t,e={};return e.addon=((t={}).backup=r.endpoints.restore.addon.backup.call,t),e}(),this.import=function(){var t,e={};return e.addon=((t={}).backup=r.endpoints.import.addon.backup.call,t),e}(),this.pause=function(){var t={};return t.addon=r.endpoints.pause.addon.call,t.service=r.endpoints.pause.service.call,t}(),this.resume=function(){var t={};return t.addon=r.endpoints.resume.addon.call,t.service=r.endpoints.resume.service.call,t}(),this.restart=function(){var t={};return t.addon=r.endpoints.restart.addon.call,t.service=r.endpoints.restart.service.call,t}(),this.abort=function(){var t,e={};return e.addon=((t={}).backup=r.endpoints.abort.addon.backup.call,t.restore=r.endpoints.abort.addon.restore.call,t),e.job=function(){var t={};return t.run=r.endpoints.abort.job.run.call,t.build=r.endpoints.abort.job.build.call,t}(),e.service=function(){var t={};return t.build=r.endpoints.abort.service.build.call,t}(),e}(),this.start=function(){var t,e={};return e.job=((t={}).run=r.endpoints.start.job.run.call,t.build=r.endpoints.start.job.build.call,t),e.service=function(){var t={};return t.build=r.endpoints.start.service.build.call,t}(),e}(),this.add=function(){var t,e={};return e.registryCredentials=r.endpoints.add.registryCredentials.call,e.domain=((t={}).subdomain=r.endpoints.add.domain.subdomain.call,t),e}(),this.verify=function(){var t={};return t.domain=r.endpoints.verify.domain.call,t.subdomain=r.endpoints.verify.subdomain.call,t}(),this.assign=function(){var t,e={};return e.subdomain=((t={}).service=r.endpoints.assign.subdomain.service.call,t),e}(),this.unassign=function(){var t={};return t.subdomain=r.endpoints.unassign.subdomain.call,t}(),this.attach=function(){var t={};return t.volume=r.endpoints.attach.volume.call,t}(),this.detach=function(){var t={};return t.volume=r.endpoints.detach.volume.call,t}()};export{za as AbortAddonBackupEndpoint,qa as AbortAddonRestoreEndpoint,su as AbortJobBuildEndpoint,Qa as AbortJobRunEndpoint,yc as AbortServiceBuildEndpoint,Uu as AddDomainSubdomainEndpoint,ju as AddRegistrycredentialsEndpoint,Mc as ApiClient,Lc as ApiClientContextProvider,Fc as ApiClientFileContextProvider,Rc as ApiClientInMemoryContextProvider,da as ApiEndpoint,Bu as AssignSubdomainServiceEndpoint,Ic as AttachVolumeEndpoint,Pa as BackupAddonEndpoint,_a as CreateAddonEndpoint,xu as CreateDomainEndpoint,Ja as CreateJobCronEndpoint,Va as CreateJobManualEndpoint,ba as CreateProjectEndpoint,Wu as CreateSecretEndpoint,Qu as CreateServiceBuildEndpoint,Ku as CreateServiceCombinedEndpoint,Xu as CreateServiceDeploymentEndpoint,Ec as CreateVolumeEndpoint,Sa as DeleteAddonEndpoint,fa as DeleteApiEndpoint,Na as DeleteBackupEndpoint,Iu as DeleteDomainEndpoint,Ha as DeleteJobEndpoint,ga as DeleteProjectEndpoint,Au as DeleteRegistrycredentialsEndpoint,$u as DeleteSecretEndpoint,Yu as DeleteSecretlinkEndpoint,ec as DeleteServiceEndpoint,Du as DeleteSubdomainEndpoint,Oc as DeleteVolumeEndpoint,kc as DetachVolumeEndpoint,aa as ExecCommandStandard,Wa as GetAddonBackupDownloadEndpoint,Da as GetAddonBackupEndpoint,Ua as GetAddonBackupsEndpoint,La as GetAddonContainersEndpoint,Aa as GetAddonCredentialsEndpoint,ja as GetAddonEndpoint,Ea as GetAddonTypesEndpoint,xa as GetAddonVersionEndpoint,ha as GetApiEndpoint,Ru as GetDnsidEndpoint,Ou as GetDomainEndpoint,gu as GetJobBranchesEndpoint,iu as GetJobBuildEndpoint,hu as GetJobBuildargumentdetailsEndpoint,lu as GetJobBuildargumentsEndpoint,ru as GetJobBuildsEndpoint,yu as GetJobContainersEndpoint,mu as GetJobDeploymentEndpoint,Ga as GetJobEndpoint,eu as GetJobHealthchecksEndpoint,wu as GetJobPullrequestsEndpoint,Xa as GetJobRunEndpoint,Za as GetJobRunsEndpoint,pu as GetJobRuntimeenvironmentEndpoint,vu as GetJobRuntimeenvironmentdetailsEndpoint,ya as GetProjectEndpoint,Su as GetRegistrycredentialsEndpoint,qu as GetSecretEndpoint,Hu as GetSecretdetailsEndpoint,Ju as GetSecretlinkEndpoint,wc as GetServiceBranchesEndpoint,bc as GetServiceBuildEndpoint,Dc as GetServiceBuildargumentdetailsEndpoint,Uc as GetServiceBuildargumentsEndpoint,vc as GetServiceBuildsEndpoint,gc as GetServiceContainersEndpoint,rc as GetServiceDeploymentEndpoint,tc as GetServiceEndpoint,pc as GetServiceHealthchecksEndpoint,uc as GetServicePortsEndpoint,_c as GetServicePullrequestsEndpoint,Nc as GetServiceRuntimeenvironmentEndpoint,Tc as GetServiceRuntimeenvironmentdetailsEndpoint,Pu as GetSubdomainEndpoint,Cc as GetVolumeEndpoint,Ta as ImportAddonBackupEndpoint,wa as ListAddonsEndpoint,Sc as ListBranchesEndpoint,Cu as ListDomainsEndpoint,$a as ListJobsEndpoint,Lu as ListPlansEndpoint,ma as ListProjectsEndpoint,Fu as ListRegionsEndpoint,_u as ListRegistrycredentialsEndpoint,jc as ListReposEndpoint,zu as ListSecretsEndpoint,Zu as ListServicesEndpoint,Mu as ListVcsEndpoint,Ac as ListVolumesEndpoint,ua as NorthflankExecCommand,ia as NorthflankPortForwarder,Fa as PauseAddonEndpoint,sc as PauseServiceEndpoint,pa as PostApiEndpoint,Ma as RestartAddonEndpoint,ic as RestartServiceEndpoint,Ba as RestoreAddonBackupEndpoint,Ra as ResumeAddonEndpoint,ac as ResumeServiceEndpoint,Ca as ScaleAddonEndpoint,Ya as ScaleJobEndpoint,nc as ScaleServiceEndpoint,ou as StartJobBuildEndpoint,Ka as StartJobRunEndpoint,mc as StartServiceBuildEndpoint,Tu as UnassignSubdomainEndpoint,Ia as UpdateAddonNetworksettingsEndpoint,ka as UpdateAddonSecurityEndpoint,Oa as UpdateAddonVersionEndpoint,du as UpdateJobBuildargumentsEndpoint,au as UpdateJobBuildoptionsEndpoint,uu as UpdateJobBuildsourceEndpoint,cu as UpdateJobCmdoverrideEndpoint,bu as UpdateJobDeploymentEndpoint,nu as UpdateJobHealthchecksEndpoint,fu as UpdateJobRuntimeenvironmentEndpoint,tu as UpdateJobSettingsEndpoint,Eu as UpdateRegistrycredentialsEndpoint,Gu as UpdateSecretEndpoint,Vu as UpdateSecretlinkEndpoint,Pc as UpdateServiceBuildargumentsEndpoint,lc as UpdateServiceBuildoptionsEndpoint,dc as UpdateServiceBuildsourceEndpoint,hc as UpdateServiceCmdoverrideEndpoint,oc as UpdateServiceDeploymentEndpoint,fc as UpdateServiceHealthchecksEndpoint,cc as UpdateServicePortsEndpoint,Bc as UpdateServiceRuntimeenvironmentEndpoint,xc as UpdateVolumeEndpoint,ku as VerifyDomainEndpoint,Nu as VerifySubdomainEndpoint};