afv-library/plugins/builder/salesforce-development/scripts/sf-org-info.bundled.js

249 lines
2.6 MiB
JavaScript
Raw Normal View History

#!/usr/bin/env node
var m9=Object.defineProperty;var jge=Object.getOwnPropertyDescriptor;var Mge=Object.getOwnPropertyNames;var Rge=Object.prototype.hasOwnProperty;var Fge=(e,t)=>()=>(e&&(t=e(e=0)),t);var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$ge=(e,t)=>{for(var r in t)m9(e,r,{get:t[r],enumerable:!0})},Uge=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mge(t))!Rge.call(e,i)&&i!==r&&m9(e,i,{get:()=>t[i],enumerable:!(n=jge(t,i))||n.enumerable});return e};var Ei=e=>Uge(m9({},"__esModule",{value:!0}),e);var u1=h(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.isString=h9;Yr.isNumber=Xj;Yr.isBoolean=Yj;Yr.isObject=iv;Yr.isFunction=g9;Yr.isPlainObject=av;Yr.isDictionary=zge;Yr.isInstance=qge;Yr.isClassAssignableTo=Bge;Yr.isArray=y9;Yr.isArrayLike=Vge;Yr.isAnyJson=Wge;Yr.isJsonMap=Zge;Yr.isJsonArray=Hge;Yr.isKeyOf=Gge;function h9(e){return typeof e=="string"}function Xj(e){return typeof e=="number"}function Yj(e){return typeof e=="boolean"}function iv(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function g9(e){return typeof e=="function"}function av(e){let t=n=>iv(n)&&Object.prototype.toString.call(n)==="[object Object]";if(!t(e))return!1;let r=e.constructor;return!(!g9(r)||!t(r.prototype)||!r.prototype.hasOwnProperty("isPrototypeOf"))}function zge(e){return av(e)}function qge(e,t){return e instanceof t}function Bge(e,t){return e===t||((n,i)=>iv(n)&&i in n)(e,"prototype")&&e.prototype instanceof t}function y9(e){return Array.isArray(e)}function Vge(e){let t=r=>iv(r)&&"length"in r;return!g9(e)&&(h9(e)||t(e))}function Wge(e){return e===null||h9(e)||Xj(e)||Yj(e)||av(e)||y9(e)}function Zge(e){return av(e)}function Hge(e){return y9(e)}function Gge(e,t){return Object.keys(e).includes(t)}});var fd=h(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.asString=Jge;xi.asNumber=Kge;xi.asBoolean=Xge;xi.asObject=Yge;xi.asPlainObject=Qge;xi.asDictionary=e0e;xi.asInstance=t0e;xi.asArray=r0e;xi.asFunction=n0e;xi.asJsonMap=i0e;xi.asJsonArray=a0e;var Ka=u1();function Jge(e,t){return(0,Ka.isString)(e)?e:t}function Kge(e,t){return(0,Ka.isNumber)(e)?e:t}function Xge(e,t){return(0,Ka.isBoolean)(e)?e:t}function Yge(e,t){return(0,Ka.isObject)(e)?e:t}function Qge(e,t){return(0,Ka.isPlainObject)(e)?e:t}function e0e(e,t){return(0,Ka.isDictionary)(e)?e:t}function t0e(e,t,r){return(0,Ka.isInstance)(e,t)?e:r}function r0e(e,t){return(0,Ka.isArray)(e)?e:t}function n0e(e,t){return(0,Ka.isFunction)(e)?e:t}function i0e(e,t){return(0,Ka.isJsonMap)(e)?e:t}function a0e(e,t){return(0,Ka.isJsonArray)(e)?e:t}});var ov=h(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.JsonCloneError=Fo.UnexpectedValueTypeError=Fo.AssertionFailedError=Fo.NamedError=void 0;var af=class extends Error{name;constructor(t,r){super(r),this.name=t}};Fo.NamedError=af;var b9=class extends af{constructor(t){super("AssertionFailedError",t)}};Fo.AssertionFailedError=b9;var v9=class extends af{constructor(t){super("UnexpectedValueTypeError",t)}};Fo.UnexpectedValueTypeError=v9;var _9=class extends af{constructor(t){super("JsonCloneError",t.message)}};Fo.JsonCloneError=_9});var sv=h(d1=>{"use strict";Object.defineProperty(d1,"__esModule",{value:!0});d1.toAnyJson=w9;d1.toJsonMap=s0e;d1.toJsonArray=l0e;var o0e=ov(),Qj=fd();function w9(e,t){try{return e!==void 0?JSON.parse(JSON.stringify(e)):t}catch(r){throw new o0e.JsonCloneError(r)}}function s0e(e,t){return(0,Qj.asJsonMap)(w9(e))??t}function l0e(e,t){return(0,Qj.asJsonArray)(w9(e))??t}});var tM=h(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.assert=eM;_n.assertNonNull=Oi;_n.assertString=d0e;_n.assertNumber=p0e;_n.assertBoolean=f0e;_n.assertObject=m0e;_n.assertPlainObject=h0e;_n.assertDictionary=g0e;_n.assertInstance=y0e;_n.assertArray=b0e;_n.assertFunction=v0e;_n.assertAnyJson=_0e;_n.assertJsonMap=w0e;_n.assertJsonArray=S0e;var c0e=ov(),Xa=fd(),u0e=sv();function eM(e,t){if(!e)throw new c0e.AssertionFailedError(t??"Assertion condition was false")}function Oi(e,t){eM(e!=null,t??"Value is not defined")}function d0e(e,t){Oi(
`).length;return new e(t,n,u,c)}static format(t,r,n,i){return n==null?t.message||"Unknown cause":`Parse error in file ${r??"unknown"} on line ${n}
${i??t.message}`}};ia.JsonParseError=k9;var N9=class extends hd{constructor(t){super("JsonStringifyError",t)}};ia.JsonStringifyError=N9;var P9=class extends hd{constructor(t){super("JsonDataFormatError",t)}};ia.JsonDataFormatError=P9;var j9=class extends hd{constructor(t){super("InvalidDefaultEnvValueError",t)}};ia.InvalidDefaultEnvValueError=j9});var CM=h((lf,f1)=>{(function(){function e(g,x,L){switch(L.length){case 0:return g.call(x);case 1:return g.call(x,L[0]);case 2:return g.call(x,L[0],L[1]);case 3:return g.call(x,L[0],L[1],L[2])}return g.apply(x,L)}function t(g,x,L,U){for(var V=-1,Q=g==null?0:g.length;++V<Q;){var X=g[V];x(U,X,L(X),g)}return U}function r(g,x){for(var L=-1,U=g==null?0:g.length;++L<U&&x(g[L],L,g)!==!1;);}function n(g,x){for(var L=-1,U=g==null?0:g.length,V=0,Q=[];++L<U;){var X=g[L];x(X,L,g)&&(Q[V++]=X)}return Q}function i(g,x){for(var L=-1,U=g==null?0:g.length,V=Array(U);++L<U;)V[L]=x(g[L],L,g);return V}function a(g,x){for(var L=-1,U=x.length,V=g.length;++L<U;)g[V+L]=x[L];return g}function o(g,x){for(var L=-1,U=g==null?0:g.length;++L<U;)if(x(g[L],L,g))return!0;return!1}function s(g,x,L){var U;return L(g,function(V,Q,X){if(x(V,Q,X))return U=Q,!1}),U}function l(g){return function(x){return x==null?Ee:x[g]}}function c(g,x){var L=g.length;for(g.sort(x);L--;)g[L]=g[L].c;return g}function u(g){return function(x){return g(x)}}function d(g,x){return i(x,function(L){return g[L]})}function f(g){var x=-1,L=Array(g.size);return g.forEach(function(U,V){L[++x]=[V,U]}),L}function p(g){var x=Object;return function(L){return g(x(L))}}function m(g){var x=-1,L=Array(g.size);return g.forEach(function(U){L[++x]=U}),L}function y(g){for(var x=g.length;x--&&age.test(g.charAt(x)););return x}function _(){}function S(g){var x=-1,L=g==null?0:g.length;for(this.clear();++x<L;){var U=g[x];this.set(U[0],U[1])}}function E(g){var x=-1,L=g==null?0:g.length;for(this.clear();++x<L;){var U=g[x];this.set(U[0],U[1])}}function w(g){var x=-1,L=g==null?0:g.length;for(this.clear();++x<L;){var U=g[x];this.set(U[0],U[1])}}function v(g){var x=-1,L=g==null?0:g.length;for(this.__data__=new w;++x<L;)this.add(g[x])}function b(g){this.size=(this.__data__=new E(g)).size}function A(g,x){var L=Xr(g),U=!L&&rf(g),V=!L&&!U&&nf(g),Q=!L&&!U&&!V&&ev(g);if(L=L||U||V||Q){for(var U=g.length,Ae=String,X=-1,ue=Array(U);++X<U;)ue[X]=Ae(X);U=ue}else U=[];var we,Ae=U.length;for(we in g)!x&&!Mn.call(g,we)||L&&(we=="length"||V&&(we=="offset"||we=="parent")||Q&&(we=="buffer"||we=="byteLength"||we=="byteOffset")||Bb(we,Ae))||U.push(we);return U}function P(g,x,L){(L===Ee||sd(g[x],L))&&(L!==Ee||x in g)||$(g,x,L)}function j(g,x,L){var U=g[x];Mn.call(g,x)&&sd(U,L)&&(L!==Ee||x in g)||$(g,x,L)}function T(g,x){for(var L=g.length;L--;)if(sd(g[L][0],x))return L;return-1}function N(g,x,L,U){return Wj(g,function(V,Q,X){x(U,V,L(V),X)}),U}function k(g,x){return g&&El(x,ld(x),g)}function B(g,x){return g&&El(x,cd(x),g)}function $(g,x,L){x=="__proto__"&&Yb?Yb(g,x,{configurable:!0,enumerable:!0,value:L,writable:!0}):g[x]=L}function K(g,x,L,U,V,Q){var X,ue=1&x,$e=2&x,we=4&x;if(L&&(X=V?L(g,U,V,Q):L(g)),X!==Ee)return X;if(!jn(g))return g;if(U=Xr(g)){if(X=Y1e(g),!ue)return Ub(g,X)}else{var Ae=Ja(g),Ze=Ae=="[object Function]"||Ae=="[object GeneratorFunction]";if(nf(g))return ta(g,ue);if(Ae=="[object Object]"||Ae=="[object Arguments]"||Ze&&!V){if(X=$e||Ze?{}:mj(g),!ue)return $e?zb(g,B(X,g)):i1(g,k(X,g))}else{if(!It[Ae])return V?g:{};X=Q1e(g,Ae,ue)}}if(Q||(Q=new b),V=Q.get(g))return V;Q.set(g,X),Kj(g)?g.forEach(function(zt){X.add(K(zt,x,L,zt,g,Q))}):Jj(g)&&g.forEach(function(zt,hr){X.set(hr,K(zt,x,L,hr,g,Q))});var $e=we?$e?fj:H8:$e?cd:ld,Pt=U?Ee:$e(g);return r(Pt||g,function(zt,hr){Pt&&(hr=zt,zt=g[hr]),j(X,hr,K(zt,x,L,hr,g,Q))}),X}function ae(g,x,L){for(var U=-1,V=g.length;++U<V;){var Q=g[U],X=x(Q);if(X!=null&&(ue===Ee?X===X&&!Lc(X):L(X,ue)))var ue=X,we=Q}return we}function ne(g,x,L,U,V){var Q=-1,X=g.length;for(L||(L=ege),V||(V=[]);++Q<X;){var ue=g[Q];0<x&&L(ue)?1<x?ne(ue,x-1,L,U,V):a(V,ue):U||(V[V.length]=ue)}return V}function re(g,x){return g&&Zj(g,x,ld)}function ce(g,x){x=mr(x,g);for(var L=0,
causes have become circular...`;let n=U9(e);return n?(t.add(e),r+`
caused by: `+FM(n,t)):r},ibe=e=>FM(e,new Set),$M=(e,t,r)=>{if(!g1(e))return"";let n=r?"":e.message||"";if(t.has(e))return n+": ...";let i=U9(e);if(i){t.add(e);let a=typeof e.cause=="function";return n+(a?"":": ")+$M(i,t,a)}else return n},abe=e=>$M(e,new Set);UM.exports={isErrorLike:g1,getErrorCause:U9,stackWithCauses:ibe,messageWithCauses:abe}});var q9=h((vyt,qM)=>{"use strict";var obe=Symbol("circular-ref-tag"),fv=Symbol("pino-raw-err-ref"),zM=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[fv]},set:function(e){this[fv]=e}}});Object.defineProperty(zM,fv,{writable:!0,value:{}});qM.exports={pinoErrProto:zM,pinoErrorSymbols:{seen:obe,rawSymbol:fv}}});var WM=h((_yt,VM)=>{"use strict";VM.exports=V9;var{messageWithCauses:sbe,stackWithCauses:lbe,isErrorLike:BM}=z9(),{pinoErrProto:cbe,pinoErrorSymbols:ube}=q9(),{seen:B9}=ube,{toString:dbe}=Object.prototype;function V9(e){if(!BM(e))return e;e[B9]=void 0;let t=Object.create(cbe);t.type=dbe.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=sbe(e),t.stack=lbe(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>V9(r)));for(let r in e)if(t[r]===void 0){let n=e[r];BM(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,B9)&&(t[r]=V9(n)):t[r]=n}return delete e[B9],t.raw=e,t}});var HM=h((wyt,ZM)=>{"use strict";ZM.exports=hv;var{isErrorLike:W9}=z9(),{pinoErrProto:pbe,pinoErrorSymbols:fbe}=q9(),{seen:mv}=fbe,{toString:mbe}=Object.prototype;function hv(e){if(!W9(e))return e;e[mv]=void 0;let t=Object.create(pbe);t.type=mbe.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>hv(r))),W9(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,mv)&&(t.cause=hv(e.cause));for(let r in e)if(t[r]===void 0){let n=e[r];W9(n)?Object.prototype.hasOwnProperty.call(n,mv)||(t[r]=hv(n)):t[r]=n}return delete e[mv],t.raw=e,t}});var XM=h((Syt,KM)=>{"use strict";KM.exports={mapHttpRequest:hbe,reqSerializer:JM};var Z9=Symbol("pino-raw-req-ref"),GM=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Z9]},set:function(e){this[Z9]=e}}});Object.defineProperty(GM,Z9,{writable:!0,value:{}});function JM(e){let t=e.info||e.socket,r=Object.create(GM);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else{let n=e.path;r.url=typeof n=="string"?n:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function hbe(e){return{req:JM(e)}}});var tR=h((Eyt,eR)=>{"use strict";eR.exports={mapHttpResponse:gbe,resSerializer:QM};var H9=Symbol("pino-raw-res-ref"),YM=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[H9]},set:function(e){this[H9]=e}}});Object.defineProperty(YM,H9,{writable:!0,value:{}});function QM(e){let t=Object.create(YM);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function gbe(e){return{res:QM(e)}}});var J9=h((xyt,rR)=>{"use strict";var G9=WM(),ybe=HM(),gv=XM(),yv=tR();rR.exports={err:G9,errWithCause:ybe,mapHttpRequest:gv.mapHttpRequest,mapHttpResponse:yv.mapHttpResponse,req:gv.reqSerializer,res:yv.resSerializer,wrapErrorSerializer:function(t){return t===G9?t:function(n){return t(G9(n))}},wrapRequestSerializer:fu
${E}`,b=`,
${E}`);let B=Math.min(w.length,s),$=0;for(;$<B-1;$++){let ae=l(String($),w,y,_,S,E);v+=ae!==void 0?ae:"null",v+=b}let K=l(String($),w,y,_,S,E);if(v+=K!==void 0?K:"null",w.length-1>s){let ae=w.length-s-1;v+=`${b}"... ${vd(ae)} not stringified"`}return S!==""&&(v+=`
${A}`),y.pop(),`[${v}]`}let P=Object.keys(w),j=P.length;if(j===0)return"{}";if(o<y.length+1)return'"[Object]"';let T="",N="";S!==""&&(E+=S,b=`,
${E}`,T=" ");let k=Math.min(j,s);i&&!O7(w)&&(P=x7(P,a)),y.push(w);for(let B=0;B<k;B++){let $=P[B],K=l($,w,y,_,S,E);K!==void 0&&(v+=`${N}${Rc($)}:${T}${K}`,N=b)}if(j>s){let B=j-s;v+=`${N}"...":${T}"${vd(B)} not stringified"`,N=b}return S!==""&&N.length>1&&(v=`
${E}${v}
${A}`),y.pop(),`{${v}}`}case"number":return isFinite(w)?String(w):t?t(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(w);default:return t?t(w):void 0}}function c(p,m,y,_,S,E){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(p)),typeof m){case"string":return Rc(m);case"object":{if(m===null)return"null";if(y.indexOf(m)!==-1)return r;let w=E,v="",b=",";if(Array.isArray(m)){if(m.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(m),S!==""&&(E+=S,v+=`
${E}`,b=`,
${E}`);let j=Math.min(m.length,s),T=0;for(;T<j-1;T++){let k=c(String(T),m[T],y,_,S,E);v+=k!==void 0?k:"null",v+=b}let N=c(String(T),m[T],y,_,S,E);if(v+=N!==void 0?N:"null",m.length-1>s){let k=m.length-s-1;v+=`${b}"... ${vd(k)} not stringified"`}return S!==""&&(v+=`
${w}`),y.pop(),`[${v}]`}y.push(m);let A="";S!==""&&(E+=S,b=`,
${E}`,A=" ");let P="";for(let j of _){let T=c(j,m[j],y,_,S,E);T!==void 0&&(v+=`${P}${Rc(j)}:${A}${T}`,P=b)}return S!==""&&P.length>1&&(v=`
${E}${v}
${w}`),y.pop(),`{${v}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return t?t(m):void 0}}function u(p,m,y,_,S){switch(typeof m){case"string":return Rc(m);case"object":{if(m===null)return"null";if(typeof m.toJSON=="function"){if(m=m.toJSON(p),typeof m!="object")return u(p,m,y,_,S);if(m===null)return"null"}if(y.indexOf(m)!==-1)return r;let E=S;if(Array.isArray(m)){if(m.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(m),S+=_;let T=`
${S}`,N=`,
${S}`,k=Math.min(m.length,s),B=0;for(;B<k-1;B++){let K=u(String(B),m[B],y,_,S);T+=K!==void 0?K:"null",T+=N}let $=u(String(B),m[B],y,_,S);if(T+=$!==void 0?$:"null",m.length-1>s){let K=m.length-s-1;T+=`${N}"... ${vd(K)} not stringified"`}return T+=`
${E}`,y.pop(),`[${T}]`}let w=Object.keys(m),v=w.length;if(v===0)return"{}";if(o<y.length+1)return'"[Object]"';S+=_;let b=`,
${S}`,A="",P="",j=Math.min(v,s);O7(m)&&(A+=yF(m,b,s),w=w.slice(m.length),j-=m.length,P=b),i&&(w=x7(w,a)),y.push(m);for(let T=0;T<j;T++){let N=w[T],k=u(N,m[N],y,_,S);k!==void 0&&(A+=`${P}${Rc(N)}: ${k}`,P=b)}if(v>s){let T=v-s;A+=`${P}"...": "${vd(T)} not stringified"`,P=b}return P!==""&&(A=`
${S}${A}
${E}`),y.pop(),`{${A}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return t?t(m):void 0}}function d(p,m,y){switch(typeof m){case"string":return Rc(m);case"object":{if(m===null)return"null";if(typeof m.toJSON=="function"){if(m=m.toJSON(p),typeof m!="object")return d(p,m,y);if(m===null)return"null"}if(y.indexOf(m)!==-1)return r;let _="",S=m.length!==void 0;if(S&&Array.isArray(m)){if(m.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(m);let A=Math.min(m.length,s),P=0;for(;P<A-1;P++){let T=d(String(P),m[P],y);_+=T!==void 0?T:"null",_+=","}let j=d(String(P),m[P],y);if(_+=j!==void 0?j:"null",m.length-1>s){let T=m.length-s-1;_+=`,"... ${vd(T)} not stringified"`}return y.pop(),`[${_}]`}let E=Object.keys(m),w=E.length;if(w===0)return"{}";if(o<y.length+1)return'"[Object]"';let v="",b=Math.min(w,s);S&&O7(m)&&(_+=yF(m,",",s),E=E.slice(m.length),b-=m.length,v=","),i&&(E=x7(E,a)),y.push(m);for(let A=0;A<b;A++){let P=E[A],j=d(P,m[P],y);j!==void 0&&(_+=`${v}${Rc(P)}:${j}`,v=",")}if(w>s){let A=w-s;_+=`${v}"...":"${vd(A)} not stringified"`}return y.pop(),`{${_}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return t?t(m):void 0}}function f(p,m,y){if(arguments.length>1){let _="";if(typeof y=="number"?_=" ".repeat(Math.min(y,10)):typeof y=="string"&&(_=y.slice(0,10)),m!=null){if(typeof m=="function")return l("",{"":p},[],m,_,"");if(Array.isArray(m))return c("",p,[],U2e(m),_,"")}if(_.length!==0)return u("",p,[],_,"")}return d("",p,[])}return f}});var xF=h((Wyt,EF)=>{"use strict";var I7=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:SF}=Dv(),q2e=SF.info;function B2e(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create(SF);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(d=>{r[d]=t.levels[d]});let n={write:i,add:s,remove:l,emit:a,flushSync:o,end:c,minLevel:0,lastId:0,streams:[],clone:u,[I7]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(s,n):s.call(n,e),e=null,n;function i(d){let f,p=this.lastLevel,{streams:m}=this,y=0,_;for(let S=V2e(m.length,t.dedupe);Z2e(S,m.length,t.dedupe);S=W2e(S,t.dedupe))if(f=m[S],f.level<=p){if(y!==0&&y!==f.level)break;if(_=f.stream,_[I7]){let{lastTime:E,lastMsg:w,lastObj:v,lastLogger:b}=this;_.lastLevel=p,_.lastTime=E,_.lastMsg=w,_.lastObj=v,_.lastLogger=b}_.write(d),t.dedupe&&(y=f.level)}else if(!t.dedupe)break}function a(...d){for(let{stream:f}of this.streams)typeof f.emit=="function"&&f.emit(...d)}function o(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync()}function s(d){if(!d)return n;let f=typeof d.write=="function"||d.stream,p=d.write?d:d.stream;if(!f)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:y}=this,_;typeof d.levelVal=="number"?_=d.levelVal:typeof d.level=="string"?_=y[d.level]:typeof d.level=="number"?_=d.level:_=q2e;let S={stream:p,level:_,levelVal:void 0,id:++n.lastId};return m.unshift(S),m.sort(wF),this.minLevel=m[0].level,n}function l(d){let{streams:f}=this,p=f.findIndex(m=>m.id===d);return p>=0&&(f.splice(p,1),f.sort(wF),this.minLevel=f.length>0?f[0].level:-1),n}function c(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync(),d.end()}function u(d){let f=new Array(this.streams.length);for(let p=0;p<f.length;p++)f[p]={level:d,stream:this.streams[p].stream};return{write:i,add:s,remove:l,minLevel:d,streams:f,clone:u,emit:a,flushSync:o,[I7]:!0}}}function wF(e,t){return e.level-t.level}function V2e(e,t){return t?e-1:0}function W2e(e,t){return t?e-1:e+1}function Z2e(e,t,r){return r?e>=0:e<t}EF.exports=B2e});var FF=h((Zyt,oa)=>{"use strict";var H2e=require("node:os"),kF=J9(),G2e=K9(),J2e=Q9(),NF=yR(),K2e=gF(),PF=uf(),{configure:X2e}=_F(),{assertDefaultLevelFound:Y2e,mappings:jF,genLsCache:Q2e,genLevelComparison:e4e,assertLevelComparison:t4e}=v7(),{DEFAULT_LEVELS:MF,SORTING_ORDER:r4e}=Dv(),{
`:`
`),ae=i4e.bind(null,{[TF]:"",[IF]:o,[DF]:B,[AF]:A7,[D7]:T,[LF]:N}),ne="";d!==null&&(f===void 0?ne=ae(d):ne=ae(Object.assign({},d,{name:f})));let re=s instanceof Function?s:s?RF:O4e,ce=re().indexOf(":")+1;if(E&&!m)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(_&&typeof _!="function")throw Error(`Unknown mixin type "${typeof _}" - expected "function"`);if(j&&typeof j!="string")throw Error(`Unknown msgPrefix type "${typeof j}" - expected "string"`);Y2e(p,m,E);let _e=jF(m,E);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:_e,messageKey:l,errorKey:c}}),t4e(y);let We=e4e(y);return Object.assign(t,{levels:_e,[v4e]:We,[_4e]:E,[d4e]:n,[c4e]:re,[u4e]:ce,[AF]:A7,[D7]:T,[DF]:B,[f4e]:K,[m4e]:$,[h4e]:l,[g4e]:c,[y4e]:u,[S4e]:u?`,${JSON.stringify(u)}:{`:"",[IF]:o,[b4e]:_,[E4e]:S,[TF]:ne,[LF]:N,[w4e]:v,silent:o4e,onChild:P,[x4e]:j}),Object.setPrototypeOf(t,K2e()),Q2e(t),t[p4e](p),t}oa.exports=L7;oa.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=CF(e.dest||process.stdout.fd),OF(e)):OF({dest:CF(e),minLength:0});oa.exports.transport=f7();oa.exports.multistream=xF();oa.exports.levels=jF();oa.exports.stdSerializers=L4e;oa.exports.stdTimeFunctions=Object.assign({},NF);oa.exports.symbols=PF;oa.exports.version=s4e;oa.exports.default=L7;oa.exports.pino=L7});var io=h(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.constants=mf.SEP=void 0;mf.SEP="/";mf.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_SYMLINK:2097152,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});var k7=h(_1=>{"use strict";Object.defineProperty(_1,"__esModule",{value:!0});_1.Stats=void 0;var k4e=io(),{S_IFMT:N4e,S_IFDIR:P4e,S_IFREG:j4e,S_IFBLK:M4e,S_IFCHR:R4e,S_IFLNK:F4e,S_IFIFO:$4e,S_IFSOCK:U4e}=k4e.constants,Pv=class e{static build(t,r=!1){let n=new e,{uid:i,gid:a,atime:o,mtime:s,ctime:l}=t,c=r?d=>BigInt(d):d=>d;n.uid=c(i),n.gid=c(a),n.rdev=c(t.rdev),n.blksize=c(4096),n.ino=c(t.ino),n.size=c(t.getSize()),n.blocks=c(1),n.atime=o,n.mtime=s,n.ctime=l,n.birthtime=l,n.atimeMs=c(o.getTime()),n.mtimeMs=c(s.getTime());let u=c(l.getTime());if(n.ctimeMs=u,n.birthtimeMs=u,r){n.atimeNs=BigInt(o.getTime())*BigInt(1e6),n.mtimeNs=BigInt(s.getTime())*BigInt(1e6);let d=BigInt(l.getTime())*BigInt(1e6);n.ctimeNs=d,n.birthtimeNs=d}return n.dev=c(0),n.mode=c(t.mode),n.nlink=c(t.nlink),n}_checkModeProperty(t){return(Number(this.mode)&N4e)===t}isDirectory(){return this._checkModeProperty(P4e)}isFile(){return this._checkModeProperty(j4e)}isBlockDevice(){return this._checkModeProperty(M4e)}isCharacterDevice(){return this._checkModeProperty(R4e)}isSymbolicLink(){return this._checkModeProperty(F4e)}isFIFO(){return this._checkModeProperty($4e)}isSocket(){return this._checkModeProperty(U4e)}};_1.Stats=Pv;_1.default=Pv});var Al=h(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.bufferFrom=Fc.bufferAllocUnsafe=Fc.Buffer=void 0;var jv=require("buffer");Object.defineProperty(Fc,"Buffer",{enumerable:!0,get:function(){return jv.Buffer}});function $F(e,...t){return new jv.Buffer(e,...t)}var z4e=jv.Buffer.allocUnsafe||$F;Fc.bufferAllocUnsafe=z4e;var q4e=jv.Buffer.from||$F;Fc.bufferFrom=q4e});var Fv=h(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.AssertionError=ri.RangeError=ri.TypeError=ri.Error=void 0;ri.message=qF;ri.E=ge;var $c=require("assert"),N7=require("util"),UF=typeof Symbol>"u"?"_kCode":Symbol("code"),zF={};function j7(e){return class extends e{constructor(r,...n){super(qF(r,n)),this.code=r,this[UF]=r,
`+e+l+(s?" "+s:"")}return r};p_.printTree=I6e});var B$=h(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});f_.printBinary=void 0;var A6e=(e="",t)=>{let r=t[0],n=t[1],i="";return r&&(i+=`
`+e+"\u2190 "+r(e+" ")),n&&(i+=`
`+e+"\u2192 "+n(e+" ")),i};f_.printBinary=A6e});var V$=h(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});m_.printJson=void 0;var D6e=(e="",t,r=2)=>(JSON.stringify(t,null,r)||"nil").split(`
`).join(`
`+e);m_.printJson=D6e});var W$=h(O1=>{"use strict";Object.defineProperty(O1,"__esModule",{value:!0});var nE=(ii(),Ei(ni));nE.__exportStar(q$(),O1);nE.__exportStar(B$(),O1);nE.__exportStar(V$(),O1)});var Z$=h(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.newNotAllowedError=Sn.newTypeMismatchError=Sn.newNotFoundError=Sn.assertCanWrite=Sn.assertName=Sn.basename=Sn.ctx=void 0;var L6e=(e={})=>Object.assign({separator:"/",syncHandleAllowed:!1,mode:"read"},e);Sn.ctx=L6e;var k6e=(e,t)=>{e[e.length-1]===t&&(e=e.slice(0,-1));let r=e.lastIndexOf(t);return r===-1?e:e.slice(r+1)};Sn.basename=k6e;var N6e=/^(\.{1,2})$|^(.*([\/\\]).*)$/,P6e=(e,t,r)=>{if(!e||N6e.test(e))throw new TypeError(`Failed to execute '${t}' on '${r}': Name is not allowed.`)};Sn.assertName=P6e;var j6e=e=>{if(e!=="readwrite")throw new DOMException("The request is not allowed by the user agent or the platform in the current context.","NotAllowedError")};Sn.assertCanWrite=j6e;var M6e=()=>new DOMException("A requested file or directory could not be found at the time an operation was processed.","NotFoundError");Sn.newNotFoundError=M6e;var R6e=()=>new DOMException("The path supplied exists, but was not an entry of requested type.","TypeMismatchError");Sn.newTypeMismatchError=R6e;var F6e=()=>new DOMException("Permission not granted.","NotAllowedError");Sn.newNotAllowedError=F6e});var H$=h(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});C1.toTreeSync=void 0;var $6e=W$(),U6e=Z$(),z6e=(e,t={})=>{var r;let n=t.separator||"/",i=t.dir||n;i[i.length-1]!==n&&(i+=n);let a=t.tab||"",o=(r=t.depth)!==null&&r!==void 0?r:10,s=" (...)";if(o>0){let c=e.readdirSync(i,{withFileTypes:!0});s=(0,$6e.printTree)(a,c.map(u=>d=>u.isDirectory()?(0,C1.toTreeSync)(e,{dir:i+u.name,depth:o-1,tab:d}):u.isSymbolicLink()?""+u.name+" \u2192 "+e.readlinkSync(i+u.name):""+u.name))}return(0,U6e.basename)(i,n)+n+s};C1.toTreeSync=z6e});var K$=h(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.getWriteFileOptions=xe.writeFileDefaults=xe.getRealpathOptsAndCb=xe.getRealpathOptions=xe.getStatfsOptsAndCb=xe.getStatfsOptions=xe.getStatOptsAndCb=xe.getStatOptions=xe.getAppendFileOptsAndCb=xe.getAppendFileOpts=xe.getOpendirOptsAndCb=xe.getOpendirOptions=xe.getReaddirOptsAndCb=xe.getReaddirOptions=xe.getReadFileOptions=xe.getRmOptsAndCb=xe.getRmdirOptions=xe.getDefaultOptsAndCb=xe.getDefaultOpts=xe.optsDefaults=xe.getMkdirOptions=void 0;xe.getOptions=J$;xe.optsGenerator=kl;xe.optsAndCbGenerator=Sd;var h_=bf(),q6e=w1(),iE=zc(),G$={mode:511,recursive:!1},B6e=e=>typeof e=="number"?Object.assign({},G$,{mode:e}):Object.assign({},G$,e);xe.getMkdirOptions=B6e;var V6e=e=>`Expected options to be either an object or a string, but got ${e} instead`;function J$(e,t){let r;if(t){let n=typeof t;switch(n){case"string":r=Object.assign({},e,{encoding:t});break;case"object":r=Object.assign({},e,t);break;default:throw TypeError(V6e(n))}}else return e;return r.encoding!=="buffer"&&(0,q6e.assertEncoding)(r.encoding),r}function kl(e){return t=>J$(e,t)}function Sd(e){return(t,r)=>typeof t=="function"?[e(),t]:[e(t),(0,iE.validateCallback)(r)]}xe.optsDefaults={encoding:"utf8"};xe.getDefaultOpts=kl(xe.optsDefaults);xe.getDefaultOptsAndCb=Sd(xe.getDefaultOpts);var W6e={recursive:!1},Z6e=e=>Object.assign({},W6e,e);xe.getRmdirOptions=Z6e;var H6e=kl(xe.optsDefaults);xe.getRmOptsAndCb=Sd(H6e);var G6e={flag:"r"};xe.getReadFileOptions=kl(G6e);var J6e={encoding:"utf8",recursive:!1,withFileTypes:!1};xe.getReaddirOptions=kl(J6e);xe.getReaddirOptsAndCb=Sd(xe.getReaddirOptions);var K6e={encoding:"utf8",bufferSize:32,recursive:!1};xe.getOpendirOptions=kl(K6e);xe.getOpendirOptsAndCb=Sd(xe.getOpendirOptions);var X6e={encoding:"utf8",mode:438,flag:h_.FLAGS[h_.FLAGS.a]};xe.getAppendFileOpts=kl(X6e);xe.getAppendFileOptsAndCb=Sd(xe.getAppendFileOpts);var Y6e={bigint:!1},Q6e=(e={})=>Object.assign({},Y6e,e);xe.getStatOptions=Q6e;var e3e=(e,t)=>typeof e=="function"?[(0,xe.getStatOptions)(),e]:[(0,xe.getStatOptions)(e),(0,iE.validateCallback)(t)];xe.getStatOptsAndCb=e3e;var t3e={bigint:!1},r3e=(e={
`),s=o.shift(),l=o.join(`
`).trim();if(s&&l.length>0){let c=s.trim();if(o.filter(d=>!!d.trim()).every(d=>HSe.exec(d))){let f=l.split(GSe).filter(n).map(p=>p.split(`
`).filter(m=>!!m.trim()).map(m=>m.trim()).join(`
`));r.set(c,f)}else r.set(c,l)}else throw new Error(`Invalid markdown message file: ${e}
The line "# <key>" must be immediately followed by the message on a new line.`)}return r},KSe=(e,t)=>{let r;try{if(r=JSON.parse(t),!(0,k1.isObject)(r))throw new Error(`Unexpected token. Found returned content type '${typeof r}'.`)}catch(n){let i=n;if(i.message.startsWith("Unexpected token")){let a=new Error(`Invalid JSON content in message file: ${e}
${i.message}`);throw a.name=i.name,a}throw n}return new Map(Object.entries(r))},k_=class e{messages;static loaders=new Map;static bundles=new Map;locale;bundleName;constructor(t,r,n){this.messages=n,this.bundleName=t,this.locale=r}static readFile=t=>require(t);static getLocale(){return"en_US"}static setLoaderFunction(t,r,n){this.loaders.set(EE(t,r),n)}static generateFileLoaderFunction(t,r){let n=Bo.extname(r);if(![".json",".js",".md"].includes(n))throw new Error(`Only json, js and md message files are allowed, not ${n}: ${r}`);return i=>{let a,o;if(n===".md"?(a=L_.readFileSync(r,"utf-8"),o=JSe):(a=JSON.stringify(e.readFile(r)),(a==="null"||a==='""')&&(a=""),o=KSe),!a||a.trim().length===0){let l=new Error(`Invalid message file: ${r}. No content.`);throw l.name="SfError",l}let s=o(r,a);return new e(t,i,s)}}static importMessageFile(t,r){let n=Bo.basename(r,Bo.extname(r));e.isCached(t,n)||this.setLoaderFunction(t,n,e.generateFileLoaderFunction(n,r))}static importMessagesDirectoryFromMetaUrl(t,r=!0,n){return e.importMessagesDirectory(Bo.dirname((0,BSe.fileURLToPath)(t)),r,n)}static importMessagesDirectory(t,r=!0,n){let i=t,a=t;if(!Bo.isAbsolute(t))throw new Error("Invalid module path. Relative URLs are not allowed.");for(;a.length>=0;)try{L_.statSync(Bo.join(a,"package.json"));break}catch(s){if(s.code!=="ENOENT")throw s;a=a.substring(0,a.lastIndexOf(Bo.sep))}r&&(i=a);let o=n??XSe(i);i+=`${Bo.sep}messages`;for(let s of L_.readdirSync(i)){let l=Bo.join(i,s),c=L_.statSync(l);c&&(c.isDirectory()||c.isFile()&&this.importMessageFile(o,l))}}static loadMessages(t,r){let n=EE(t,r),i;if(this.isCached(t,r))i=this.bundles.get(n);else if(this.loaders.has(n)){let a=this.loaders.get(n);a&&(i=a(e.getLocale()),this.bundles.set(n,i),i=this.bundles.get(n))}if(i)return i;throw new L1.SfError(`Missing bundle ${n} for locale ${e.getLocale()}.`,"MissingBundleError")}static isCached(t,r){return this.bundles.has(EE(t,r))}getMessage(t,r=[]){return this.getMessageWithMap(t,r,this.messages).join(zSe.EOL)}getMessages(t,r=[]){return this.getMessageWithMap(t,r,this.messages)}createError(t,r=[],n=[],i,a){let{message:o,name:s,actions:l}=this.formatMessageContents({type:"error",key:t,tokens:r,actionTokens:n});return new L1.SfError(o,s,l,i,a)}createWarning(t,r=[],n=[]){return this.formatMessageContents({type:"warning",key:t,tokens:r,actionTokens:n})}createInfo(t,r=[],n=[]){return this.formatMessageContents({type:"info",key:t,tokens:r,actionTokens:n})}formatMessageContents({type:t,key:r,tokens:n=[],actionTokens:i=[],preserveName:a=!1}){let o=(0,SE.upperFirst)(t),s=new RegExp(`${o}$`),l=t==="error"?/^error.*\./:new RegExp(`^${t}.`),c=`${(0,SE.upperFirst)(r.replace(l,""))}${s.exec(r)??a?"":o}`,u=this.getMessage(r,n),d;try{d=this.getMessageWithMap(`${r}.actions`,i,this.messages)}catch{}return{message:u,name:c,actions:d}}getMessageWithMap(t,r=[],n){let i=RegExp(/([a-zA-Z0-9_-]+)\.(.*)/).exec(t);if(i){let l=i[1],c=i[2],u=n.get(l);if(u&&(0,k1.isJsonMap)(u)){let d=new Map(Object.entries(u));return this.getMessageWithMap(c,r,d)}}let a=n.get(t);if(!a)throw new L1.SfError(`Missing message ${this.bundleName}:${t} for locale ${e.getLocale()}.`,"MissingMessageError");let o=(0,SE.ensureArray)(a),s=0;return o.map(l=>{let c=(0,k1.ensureString)(l),u=new RegExp("%[sdifjoO]{1}","gm"),f=(c.match(u)??[]).length;if(f>0){let p=r.slice(s,s+f);return s+=f,qSe.format(c,...p)}else r.length>0&&VSe.Logger.childFromRoot("core:messages").warn(`Unable to render tokens in message. Ensure a specifier (e.g. %s) exists in the message:
${c}`);return c})}};Vo.Messages=k_;var XSe=e=>{let t=`Invalid or missing package.json file at '${e}'. If not using a package.json, pass in a packageName.`;try{let r=(0,k1.asString)((0,k1.ensureJsonMap)(k_.readFile(Bo.join(e,"package.json"))).name);if(!r)throw L1.SfError.create({message:t,name:"MissingPackageName"});return r}catch(r){throw L1.SfError.create({message:t,name:"MissingPackageName",cause:r})}}});var xE=h(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.traverse=ai.SFDX_PROJECT_JSON=void 0;ai.resolveProjectPath=QSe;ai.resolveProjectPathSync=e5e;var P_=require("node:path"),kU=Mr(),YSe=bt(),NU=new YSe.Messages("@salesforce/core","config",new Map([["unknownConfigKey","Unknown config name: %s."],["deprecatedConfigKey","Deprecated config name: %s. Please use %s instead."],["invalidWrite","The writeSync method is not allowed on SfdxConfig. Use the async write method instead."],["invalidConfigValue","Invalid config value: %s."],["invalidInstanceUrl","Specify a valid Salesforce instance URL."],["invalidApiVersion","Specify a valid Salesforce API version, for example, 42.0."],["invalidCustomOrgMetadataTemplates","Specify a valid repository URL or directory for the custom org metadata templates."],["invalidIsvDebuggerSid","Specify a valid Debugger SID."],["invalidIsvDebuggerUrl","Specify a valid Debugger URL."],["invalidNumberConfigValue","Specify a valid positive integer, for example, 150000."],["invalidBooleanConfigValue","The config value can only be set to true or false."],["invalidProjectWorkspace","%s does not contain a valid Salesforce DX project."],["schemaValidationError",`The config file "%s" is not schema valid.
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]]));ai.SFDX_PROJECT_JSON="sfdx-project.json";async function QSe(e=process.cwd()){let t=await ai.traverse.forFile(e,ai.SFDX_PROJECT_JSON);if(!t)throw NU.createError("invalidProjectWorkspace",[e]);return t}function e5e(e=process.cwd()){let t=ai.traverse.forFileSync(e,ai.SFDX_PROJECT_JSON);if(!t)throw NU.createError("invalidProjectWorkspace",[e]);return t}ai.traverse={forFile:async(e,t)=>{let r;try{kU.fs.statSync((0,P_.join)(e,t)),r=e}catch(n){if(n&&n.code==="ENOENT"){let i=(0,P_.resolve)(e,"..");i!==e&&(r=await ai.traverse.forFile(i,t))}}return r},forFileSync:(e,t)=>{let r;try{kU.fs.statSync((0,P_.join)(e,t)),r=e}catch(n){if(n&&n.code==="ENOENT"){let i=(0,P_.resolve)(e,"..");i!==e&&(r=ai.traverse.forFileSync(i,t))}}return r}}});var jU=h((rvt,PU)=>{var Wc=require("constants"),t5e=process.cwd,j_=null,r5e=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return j_||(j_=t5e.call(process)),j_};try{process.cwd()}catch{}typeof process.chdir=="function"&&(OE=process.chdir,process.chdir=function(e){j_=null,OE.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,OE));var OE;PU.exports=n5e;function n5e(e){Wc.hasOwnProperty("O_SYMLINK")&&proces
GFS4: `),console.error(e)});Ht[tn]||(zU=global[tn]||[],BU(Ht,zU),Ht.close=function(e){function t(r,n){return e.call(Ht,r,function(i){i||qU(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,F_,{value:e}),t}(Ht.close),Ht.closeSync=function(e){function t(r){e.apply(Ht,arguments),qU()}return Object.defineProperty(t,F_,{value:e}),t}(Ht.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Id(Ht[tn]),require("assert").equal(Ht[tn].length,0)}));var zU;global[tn]||BU(global,Ht[tn]);IE.exports=CE(c5e(Ht));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ht.__patched&&(IE.exports=CE(Ht),Ht.__patched=!0);function CE(e){s5e(e),e.gracefulify=CE,e.createReadStream=b,e.createWriteStream=A;var t=e.readFile;e.readFile=r;function r(T,N,k){return typeof N=="function"&&(k=N,N=null),B(T,N,k);function B($,K,ae,ne){return t($,K,function(re){re&&(re.code==="EMFILE"||re.code==="ENFILE")?Of([B,[$,K,ae],re,ne||Date.now(),Date.now()]):typeof ae=="function"&&ae.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=i;function i(T,N,k,B){return typeof k=="function"&&(B=k,k=null),$(T,N,k,B);function $(K,ae,ne,re,ce){return n(K,ae,ne,function(_e){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?Of([$,[K,ae,ne,re],_e,ce||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=o);function o(T,N,k,B){return typeof k=="function"&&(B=k,k=null),$(T,N,k,B);function $(K,ae,ne,re,ce){return a(K,ae,ne,function(_e){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?Of([$,[K,ae,ne,re],_e,ce||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=l);function l(T,N,k,B){return typeof k=="function"&&(B=k,k=0),$(T,N,k,B);function $(K,ae,ne,re,ce){return s(K,ae,ne,function(_e){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?Of([$,[K,ae,ne,re],_e,ce||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var c=e.readdir;e.readdir=d;var u=/^v[0-5]\./;function d(T,N,k){typeof N=="function"&&(k=N,N=null);var B=u.test(process.version)?function(ae,ne,re,ce){return c(ae,$(ae,ne,re,ce))}:function(ae,ne,re,ce){return c(ae,ne,$(ae,ne,re,ce))};return B(T,N,k);function $(K,ae,ne,re){return function(ce,_e){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?Of([B,[K,ae,ne],ce,re||Date.now(),Date.now()]):(_e&&_e.sort&&_e.sort(),typeof ne=="function"&&ne.call(this,ce,_e))}}}if(process.version.substr(0,4)==="v0.8"){var f=l5e(e);S=f.ReadStream,w=f.WriteStream}var p=e.ReadStream;p&&(S.prototype=Object.create(p.prototype),S.prototype.open=E);var m=e.WriteStream;m&&(w.prototype=Object.create(m.prototype),w.prototype.open=v),Object.defineProperty(e,"ReadStream",{get:function(){return S},set:function(T){S=T},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return w},set:function(T){w=T},enumerable:!0,configurable:!0});var y=S;Object.defineProperty(e,"FileReadStream",{get:function(){return y},set:function(T){y=T},enumerable:!0,configurable:!0});var _=w;Object.defineProperty(e,"FileWriteStream",{get:function(){return _},set:function(T){_=T},enumerable:!0,configurable:!0});function S(T,N){return this instanceof S?(p.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}function E(){var T=this;j(T.path,T.flags,T.mode,function(N,k){N?(T.autoClose&&T.destroy(),T.emit("error",N)):(T.fd=k,T.emit("open",k),T.read())})}function w(T,N){return this instanceof w?(m.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function v(){var T=this;j(T.path,T.flags,T.mode,function(N,k){N?(T.destroy(),T.emit("error",N)):(T.fd=k,T.emit("open",k))})}function b(T,N){return new e.ReadStream(T,N)}function A(T,N){return new e.WriteStream(T,N)}var P=e.open;e.open=j;function j(T,N,k,B){return typeof k=="function"&&(B=k,k=null),$(T,N,k,B);function $(K,ae,ne,re,ce){return P(K,ae,ne,function(_e,We){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?Of([$,[K,ae,ne,re],_e,ce||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}return e}function Of(e){Id("ENQUEUE",e[0].
%s`],["passwordNotFoundError.actions",["Ensure a valid password is returned with the following command: [%s]"]],["setCredentialError",`Command failed with response:
%s`],["setCredentialError.actions",["Determine why this command failed to set an encryption key for user %s: [%s]."]],["macKeychainOutOfSync","We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."],["v1CryptoWithV2KeyWarning",'The SF_CRYPTO_V2 environment variable was set to "false" but a v2 crypto key was detected. v1 crypto can only be used with a v1 key. Unset the SF_CRYPTO_V2 environment variable.'],["v2CryptoWithV1KeyWarning",'SF_CRYPTO_V2 was set to "true" but a v1 crypto key was detected. v2 crypto can only be used with a v2 key. To generate a v2 key:\n\n1. Logout of all orgs: `sf org logout --all`\n2. Delete the sfdx keychain entry (account: local, service: sfdx). If `SF_USE_GENERIC_UNIX_KEYCHAIN=true` env var is set, you can delete the `key.json` file.\n3. Set `SF_CRYPTO_V2=true` env var.\n4. Re-Authenticate with your orgs using the CLI org login commands.']])),yB=3,q1=e=>e.join(" "),bB=(e,t,r)=>process.platform==="win32"?!0:!!(e&parseInt("0001",8)||e&parseInt("0010",8)&&process.getgid&&t===process.getgid()||e&parseInt("0100",8)&&process.getuid&&r===process.getuid()),dx=async(e,t,r)=>{let n;try{let i=t.statSync(e);n=!r(i.mode,i.gid,i.uid)}catch{throw Fr.createError("missingCredentialProgramError",[e])}if(n)throw Fr.createError("credentialProgramAccessError",[e])},B1=class{osImpl;fsIfc;constructor(t,r){this.osImpl=t,this.fsIfc=r}async validateProgram(){await dx(this.osImpl.getProgram(),this.fsIfc,bB)}async getPassword(t,r,n=0){if(t.service==null){r(Fr.createError("keyChainServiceRequiredError"));return}if(t.account==null){r(Fr.createError("keyChainAccountRequiredError"));return}await this.validateProgram();let i=this.osImpl.getCommandFunc(t,gB.spawn),a="",o="";i.stdout&&i.stdout.on("data",s=>{a+=s}),i.stderr&&i.stderr.on("data",s=>{o+=s}),i.on("close",async s=>{try{return await this.osImpl.onGetCommandClose(s,a,o,t,r)}catch(l){if(l.retry){if(n>=yB)throw Fr.createError("passwordRetryError",[yB]);return this.getPassword(t,r,n+1)}else throw l}}),i.stdin&&i.stdin.end()}async setPassword(t,r){if(t.service==null){r(Fr.createError("keyChainServiceRequiredError"));return}if(t.account==null){r(Fr.createError("keyChainAccountRequiredError"));return}if(t.password==null){r(Fr.createError("passwordRequiredError"));return}await dx(this.osImpl.getProgram(),this.fsIfc,bB);let n=this.osImpl.setCommandFunc(t,gB.spawn),i="",a="";n.stdout&&n.stdout.on("data",o=>{i+=o}),n.stderr&&n.stderr.on("data",o=>{a+=o}),n.on("close",async o=>this.osImpl.onSetCommandClose(o,i,a,t,r)),n.stdin&&n.stdin.end()}};$r.KeychainAccess=B1;var Ml={getProgram(){return process.env.SFDX_SECRET_TOOL_PATH??Nd.join(Nd.sep,"usr","bin","secret-tool")},getProgramOptions(e){return["lookup","user",e.account,"domain",e.service]},getCommandFunc(e,t){return t(Ml.getProgram(),Ml.getProgramOptions(e))},async onGetCommandClose(e,t,r,n,i){if(e===1){let a=`${Ml.getProgram()} ${q1(Ml.getProgramOptions(n))}`,o=Fr.createError("passwordNotFoundError",[],[a]);if(r?.includes("invalid or unencryptable secret"))throw o.retry=!0,o;i(o)}else i(null,t.trim())},setProgramOptions(e){return["store","--label='salesforce.com'","user",e.account,"domain",e.service]},setCommandFunc(e,t){let r=t(Ml.getProgram(),Ml.setProgramOptions(e));return r.stdin&&r.stdin.write(`${e.password??""}
`),r},async onSetCommandClose(e,t,r,n,i){if(e!==0){let a=`${Ml.getProgram()} ${q1(Ml.setProgramOptions(n))}`;i(Fr.createError("setCredentialError",[`${t} - ${r}`],[_B.userInfo().username,a]))}else i(null)}},oo={getProgram(){return Nd.join(Nd.sep,"usr","bin","security")},getProgramOptions(e){return["find-generic-password","-a",e.account,"-s",e.service,"-g"]},getCommandFunc(e,t){return t(oo.getProgram(),oo.getProgramOptions(e))},async onGetCommandClose(e,t,r,n,i){let a;if(e!==0){switch(e){case 128:{a=Fr.createError("keyChainUserCanceledError");break}default:{let o=`${oo.getProgram()} ${q1(oo.getProgramOptions(n))}`;a=Fr.createError("passwordNotFoundError",[`${t} - ${r}`],[o])}}i(a);return}if(r.includes("password")){let o=RegExp(/"(.*)"/).exec(r);o?.[1]?i(null,o[1]):i(Fr.createError("passwordNotFoundError",[`${t} - ${r}`]))}else{let o=`${oo.getProgram()} ${q1(oo.getProgramOptions(n))}`;i(Fr.createError("passwordNotFoundError",[`${t} - ${r}`],[o]))}},setProgramOptions(e){let t=["add-generic-password","-a",e.account,"-s",e.service];return e.password&&t.push("-w",e.password),t},setCommandFunc(e,t){return t(oo.getProgram(),oo.setProgramOptions(e))},async onSetCommandClose(e,t,r,n,i){if(e!==0){let a=`${oo.getProgram()} ${q1(oo.setProgramOptions(n))}`;i(Fr.createError("setCredentialError",[`${t} - ${r}`],[_B.userInfo().username,a]))}else i(null)}},W1=()=>Nd.join(wB.Global.DIR,"key.json"),Gc;(function(e){e.SERVICE="service",e.ACCOUNT="account",e.KEY="key"})(Gc||(Gc={}));async function vB(e,t){try{let r={[Gc.ACCOUNT]:e.account,[Gc.KEY]:e.password,[Gc.SERVICE]:e.service},n=W1();await ji.fs.promises.mkdir(Nd.dirname(n),{recursive:!0}),await ji.fs.promises.writeFile(n,JSON.stringify(r,null,4),{mode:"600"}),t(null,r)}catch(r){t(r)}}async function dEe(){let e=(0,cEe.parseJsonMap)(await ji.fs.promises.readFile(W1(),"utf8"));return{account:(0,ux.ensureString)(e[Gc.ACCOUNT]),password:(0,ux.asString)(e[Gc.KEY]),service:(0,ux.ensureString)(e[Gc.SERVICE])}}var V1=class{async getPassword(t,r){await this.isValidFileAccess(async n=>{if(n==null)try{let{service:i,account:a,password:o}=await dEe();t.service===i&&t.account===a?r(null,o):r(Fr.createError("genericKeychainServiceError",[W1()]))}catch(i){r(i)}else n.code==="ENOENT"?r(Fr.createError("passwordNotFoundError")):r(n)})}async setPassword(t,r){await this.isValidFileAccess(async n=>{n!=null?n.code==="ENOENT"?await vB.call(this,t,r):r(n):await vB.call(this,t,r)})}async isValidFileAccess(t){try{let r=(0,lEe.homedir)();await ji.fs.promises.access(Nd.join(r,wB.Global.SFDX_STATE_FOLDER),ji.fs.constants.R_OK|ji.fs.constants.X_OK|ji.fs.constants.W_OK),await t(null)}catch(r){await t(r)}}};$r.GenericKeychainAccess=V1;var d2=class extends V1{async isValidFileAccess(t){await super.isValidFileAccess(async r=>{if(r!=null)await t(r);else{let n=W1(),a=((await ji.fs.promises.stat(n)).mode&511).toString(8),o="600";a===o?await t(null):t(Fr.createError("genericKeychainInvalidPermsError",[n],[n,o]))}})}};$r.GenericUnixKeychainAccess=d2;var p2=class extends V1{async isValidFileAccess(t){await super.isValidFileAccess(async r=>{if(r!=null)await t(r);else try{await ji.fs.promises.access(W1(),ji.fs.constants.R_OK|ji.fs.constants.W_OK),await t(null)}catch(n){await t(n)}})}};$r.GenericWindowsKeychainAccess=p2;$r.keyChainImpl={generic_unix:new d2,generic_windows:new p2,darwin:new B1(oo,ji.fs),linux:new B1(Ml,ji.fs),validateProgram:dx}});var EB=h(f2=>{"use strict";Object.defineProperty(f2,"__esModule",{value:!0});f2.retrieveKeychain=void 0;var pEe=He(),fEe=yt(),mEe=bt(),Jc=SB(),hEe=new mEe.Messages("@salesforce/core","encryption",new Map([["invalidEncryptedFormatError","The encrypted data is not properly formatted."],["invalidEncryptedFormatError.actions",["If attempting to create a scratch org then re-authorize. Otherwise create a new scratch org."]],["authDecryptError","Failed to decipher auth data. reason: %s."],["unsupportedOperatingSystemError","Unsupported Operating System: %s"],["missingCredentialProgramError","Unable to find required security software: %s"],["credentialProgramAccessError","Unable to execute securi
%s`],["passwordNotFoundError.actions",["Ensure a valid password is returned with the following command: [%s]"]],["setCredentialError",`Command failed with response:
%s`],["setCredentialError.actions",["Determine why this command failed to set an encryption key for user %s: [%s]."]],["macKeychainOutOfSync","We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."],["v1CryptoWithV2KeyWarning",'The SF_CRYPTO_V2 environment variable was set to "false" but a v2 crypto key was detected. v1 crypto can only be used with a v1 key. Unset the SF_CRYPTO_V2 environment variable.'],["v2CryptoWithV1KeyWarning",'SF_CRYPTO_V2 was set to "true" but a v1 crypto key was detected. v2 crypto can only be used with a v2 key. To generate a v2 key:\n\n1. Logout of all orgs: `sf org logout --all`\n2. Delete the sfdx keychain entry (account: local, service: sfdx). If `SF_USE_GENERIC_UNIX_KEYCHAIN=true` env var is set, you can delete the `key.json` file.\n3. Set `SF_CRYPTO_V2=true` env var.\n4. Re-Authenticate with your orgs using the CLI org login commands.']])),gEe=async e=>{let t=await fEe.Logger.child("keyChain"),r=pEe.env.getBoolean("SF_USE_GENERIC_UNIX_KEYCHAIN");if(e.startsWith("win"))return t.debug(`platform: ${e}. Using generic Windows keychain.`),Jc.keyChainImpl.generic_windows;if(e.includes("darwin"))return r?(t.debug(`platform: ${e}. Using generic Unix keychain.`),Jc.keyChainImpl.generic_unix):(t.debug(`platform: ${e}. Using Darwin native keychain.`),Jc.keyChainImpl.darwin);if(e.includes("linux")){if(r)return t.debug(`platform: ${e}. Using generic Unix keychain.`),Jc.keyChainImpl.generic_unix;try{return t.debug(`platform: ${e}. Using Linux keychain.`),await Jc.keyChainImpl.linux.validateProgram(),Jc.keyChainImpl.linux}catch{return t.debug(`platform: ${e}. Using generic Unix keychain.`),Jc.keyChainImpl.generic_unix}}else{if(e==="browser")return t.debug(`platform: ${e}. Using generic keychain.`),Jc.keyChainImpl.generic_unix;throw hEe.createError("unsupportedOperatingSystemError",[e])}};f2.retrieveKeychain=gEe});var hx=h(Ho=>{"use strict";var yEe=Ho&&Ho.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),bEe=Ho&&Ho.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vEe=Ho&&Ho.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&yEe(t,e,r);return bEe(t,e),t};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.SecureBuffer=void 0;var Zo=vEe(require("node:crypto")),_Ee=Ke(),fx="aes-256-cbc",wEe=32,mx=class{key=Zo.randomBytes(wEe);iv=Zo.randomBytes(16);secret;value(t){if(t){let r=Zo.createDecipheriv(fx,this.key,this.iv),n=r.update((0,_Ee.ensure)(this.secret)),i=r.final(),a=Buffer.concat([n,i]);try{return t(a)}finally{Zo.randomFillSync(n),Zo.randomFillSync(i),Zo.randomFillSync(a)}}}clear(){this.secret&&Zo.randomFillSync(this.secret);let t=Zo.createCipheriv(fx,this.key,this.iv);this.secret=Buffer.concat([t.update(Buffer.from("")),t.final()])}consume(t){let r=t;r||(r=Buffer.from(""));let n=Zo.createCipheriv(fx,this.key,this.iv);this.secret=Buffer.concat([n.update(r),n.final()]),Zo.randomFillSync(r)}};Ho.SecureBuffer=mx});var NB=h(Go=>{"use strict";var SEe=Go&&Go.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),EEe=Go&&Go.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),DB=Go&&Go.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.
%s`],["passwordNotFoundError.actions",["Ensure a valid password is returned with the following command: [%s]"]],["setCredentialError",`Command failed with response:
%s`],["setCredentialError.actions",["Determine why this command failed to set an encryption key for user %s: [%s]."]],["macKeychainOutOfSync","We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."],["v1CryptoWithV2KeyWarning",'The SF_CRYPTO_V2 environment variable was set to "false" but a v2 crypto key was detected. v1 crypto can only be used with a v1 key. Unset the SF_CRYPTO_V2 environment variable.'],["v2CryptoWithV1KeyWarning",'SF_CRYPTO_V2 was set to "true" but a v1 crypto key was detected. v2 crypto can only be used with a v2 key. To generate a v2 key:\n\n1. Logout of all orgs: `sf org logout --all`\n2. Delete the sfdx keychain entry (account: local, service: sfdx). If `SF_USE_GENERIC_UNIX_KEYCHAIN=true` env var is set, you can delete the `key.json` file.\n3. Set `SF_CRYPTO_V2=true` env var.\n4. Re-Authenticate with your orgs using the CLI org login commands.']])),IB=(e,t)=>{let r=new LB.SecureBuffer;return r.consume(Buffer.from(e,t)),r},AB={getPassword(e,t,r){let n=`${TEe.Global.DIR}:${t}:${r}`,i=yx.Cache.get(n);if(i){let a=bx[Yc()],o=(0,g2.ensure)(i.value(s=>s.toString(a)),"Expected the keychain password to be set");return yx.Cache.set(n,IB(o,a)),new Promise(s=>s({username:r,password:o}))}else return new Promise((a,o)=>e.getPassword({service:t,account:r},(s,l)=>{if(s)return o(s);let c=(0,g2.ensure)(l,"Expected the keychain password to be set");return LEe(c),yx.Cache.set(n,IB(c,bx[Yc()])),a({username:r,password:c})}))},setPassword(e,t,r,n){return new Promise((i,a)=>e.setPassword({service:t,account:r,password:n},o=>o?a(o):i({username:r,password:n})))}},_x=class extends Z1.AsyncOptionalCreatable{key=new LB.SecureBuffer;options;noResetOnClose;constructor(t){super(t),this.options=t??{}}static unsetCryptoVersion(){Qc=void 0}encrypt(t){if(t!=null){if(this.key==null)throw Kc.createError("keychainPasswordCreationError");return this.isV2Crypto()?this.encryptV2(t):this.encryptV1(t)}}decrypt(t){if(t==null)return;let r=t.split(m2);if(r.length!==2)throw Kc.createError("invalidEncryptedFormatError");return this.isV2Crypto()?this.decryptV2(r):this.decryptV1(r)}isEncrypted(t){if(t==null)return!1;let r=t.split(m2);if(r.length!==2)return!1;let n=r[1],i=r[0];return n.length===DEe&&i.length>=jd[Yc()]&&xB.test(n)&&xB.test(r[0])}close(){this.noResetOnClose||this.key.clear()}isV2Crypto(){return Yc()==="v2"}async init(){this.options.platform||(this.options.platform=gx.platform()),this.noResetOnClose=!!this.options.noResetOnClose;try{let t=await this.getKeyChain(this.options.platform),r=(await AB.getPassword(t,OB,CB)).password;this.key.consume(Buffer.from(r,bx[Yc()]))}catch(t){if(t.name==="PasswordNotFoundError"){if(this.options.retryStatus==="KEY_SET")throw Xc().debug("a key was set but the retry to get the password failed."),t;Xc().debug(`password not found in keychain. Creating new one (Crypto ${Yc()}) and re-init.`);let r=Pd.randomBytes(vx[Yc()]).toString("hex");return await AB.setPassword((0,g2.ensure)(this.options.keychain),OB,CB,r),this.init()}else throw t}}encryptV1(t){let r=Pd.randomBytes(jd.v1).toString("hex");return this.key.value(n=>{let i=Pd.createCipheriv(h2,n.toString("utf8"),r),a=i.update(t,"utf8","hex");a+=i.final("hex");let o=i.getAuthTag().toString("hex");return`${r}${a}${m2}${o}`})}encryptV2(t){let r=Pd.randomBytes(jd.v2);return this.key.value(n=>{let i=Pd.createCipheriv(h2,n,r),a=r.toString("hex"),o=i.update(t,"utf8","hex");o+=i.final("hex");let s=i.getAuthTag().toString("hex");return`${a}${o}${m2}${s}`})}decryptV1(t){let r=t[1],n=t[0].substring(0,jd.v1*2),i=t[0].substring(jd.v1*2,t[0].length);return this.key.value(a=>{let o=Pd.createDecipheriv(h2,a.toString("utf8"),n);try{return o.setAuthTag(Buffer.from(r,"hex")),`${o.update(i,"hex","utf8")}${o.final("utf8")}`}catch(s){let l=Kc.createError("authDecryptError",[s.message],[],s),c=Z1.env.getBoolean("SF_USE_GENERIC_UNIX_KEYCHAIN")||Z1.env.getBoolean("USE_GENERIC_UNIX_KEYCHAIN");throw gx.platform()==="darwin"&&!c&&(l.ac
Your environment has both variables populated, and with different values. The value from %s will be used.`],["sfCapitalizeRecordTypes","Whether record types are capitalized on scratch org creation."]])),z;(function(e){e.FORCE_OPEN_URL="FORCE_OPEN_URL",e.FORCE_SHOW_SPINNER="FORCE_SHOW_SPINNER",e.FORCE_SPINNER_DELAY="FORCE_SPINNER_DELAY",e.HTTP_PROXY="HTTP_PROXY",e.HTTPS_PROXY="HTTPS_PROXY",e.NODE_EXTRA_CA_CERTS="NODE_EXTRA_CA_CERTS",e.NODE_TLS_REJECT_UNAUTHORIZED="NODE_TLS_REJECT_UNAUTHORIZED",e.SFDX_ACCESS_TOKEN="SFDX_ACCESS_TOKEN",e.SFDX_API_VERSION="SFDX_API_VERSION",e.SFDX_AUDIENCE_URL="SFDX_AUDIENCE_URL",e.SFDX_CONTENT_TYPE="SFDX_CONTENT_TYPE",e.SFDX_DEFAULTDEVHUBUSERNAME="SFDX_DEFAULTDEVHUBUSERNAME",e.SFDX_DEFAULTUSERNAME="SFDX_DEFAULTUSERNAME",e.SFDX_DISABLE_AUTOUPDATE="SFDX_DISABLE_AUTOUPDATE",e.SFDX_AUTOUPDATE_DISABLE="SFDX_AUTOUPDATE_DISABLE",e.SFDX_DISABLE_SOURCE_MEMBER_POLLING="SFDX_DISABLE_SOURCE_MEMBER_POLLING",e.SFDX_SOURCE_TRACKING_BATCH_SIZE="SFDX_SOURCE_TRACKING_BATCH_SIZE",e.SFDX_DISABLE_TELEMETRY="SFDX_DISABLE_TELEMETRY",e.SFDX_DNS_TIMEOUT="SFDX_DNS_TIMEOUT",e.SFDX_DOMAIN_RETRY="SFDX_DOMAIN_RETRY",e.SFDX_IMPROVED_CODE_COVERAGE="SFDX_IMPROVED_CODE_COVERAGE",e.SFDX_INSTANCE_URL="SFDX_INSTANCE_URL",e.SFDX_JSON_TO_STDOUT="SFDX_JSON_TO_STDOUT",e.SFDX_DISABLE_LOG_FILE="SFDX_DISABLE_LOG_FILE",e.SFDX_LOG_LEVEL="SFDX_LOG_LEVEL",e.SFDX_LOG_ROTATION_COUNT="SFDX_LOG_ROTATION_COUNT",e.SFDX_LOG_ROTATION_PERIOD="SFDX_LOG_ROTATION_PERIOD",e.SFDX_MAX_QUERY_LIMIT="SFDX_MAX_QUERY_LIMIT",e.SFDX_MDAPI_TEMP_DIR="SFDX_MDAPI_TEMP_DIR",e.SFDX_NPM_REGISTRY="SFDX_NPM_REGISTRY",e.SFDX_PRECOMPILE_ENABLE="SFDX_PRECOMPILE_ENABLE",e.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE="SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE",e.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE="SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE",e.SFDX_REST_DEPLOY="SFDX_REST_DEPLOY",e.SFDX_SOURCE_MEMBER_POLLING_TIMEOUT="SFDX_SOURCE_MEMBER_POLLING_TIMEOUT",e.SFDX_USE_GENERIC_UNIX_KEYCHAIN="SFDX_USE_GENERIC_UNIX_KEYCHAIN",e.SFDX_USE_PROGRESS_BAR="SFDX_USE_PROGRESS_BAR",e.SFDX_LAZY_LOAD_MODULES="SFDX_LAZY_LOAD_MODULES",e.SFDX_S3_HOST="SFDX_S3_HOST",e.SFDX_UPDATE_INSTRUCTIONS="SFDX_UPDATE_INSTRUCTIONS",e.SFDX_INSTALLER="SFDX_INSTALLER",e.SFDX_ENV="SFDX_ENV",e.SF_TARGET_ORG="SF_TARGET_ORG",e.SF_TARGET_DEV_HUB="SF_TARGET_DEV_HUB",e.SF_ACCESS_TOKEN="SF_ACCESS_TOKEN",e.SF_ORG_API_VERSION="SF_ORG_API_VERSION",e.SF_AUDIENCE_URL="SF_AUDIENCE_URL",e.SF_CONTENT_TYPE="SF_CONTENT_TYPE",e.SF_DISABLE_AUTOUPDATE="SF_DISABLE_AUTOUPDATE",e.SF_AUTOUPDATE_DISABLE="SF_AUTOUPDATE_DISABLE",e.SF_DISABLE_SOURCE_MEMBER_POLLING="SF_DISABLE_SOURCE_MEMBER_POLLING",e.SF_DISABLE_TELEMETRY="SF_DISABLE_TELEMETRY",e.SF_DNS_TIMEOUT="SF_DNS_TIMEOUT",e.SF_DOMAIN_RETRY="SF_DOMAIN_RETRY",e.SF_IMPROVED_CODE_COVERAGE="SF_IMPROVED_CODE_COVERAGE",e.SF_ORG_INSTANCE_URL="SF_ORG_INSTANCE_URL",e.SF_JSON_TO_STDOUT="SF_JSON_TO_STDOUT",e.SF_DISABLE_LOG_FILE="SF_DISABLE_LOG_FILE",e.SF_LOG_LEVEL="SF_LOG_LEVEL",e.SF_LOG_ROTATION_COUNT="SF_LOG_ROTATION_COUNT",e.SF_LOG_ROTATION_PERIOD="SF_LOG_ROTATION_PERIOD",e.SF_ORG_MAX_QUERY_LIMIT="SF_ORG_MAX_QUERY_LIMIT",e.SF_MDAPI_TEMP_DIR="SF_MDAPI_TEMP_DIR",e.SF_NPM_REGISTRY="SF_NPM_REGISTRY",e.SF_PRECOMPILE_ENABLE="SF_PRECOMPILE_ENABLE",e.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE="SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE",e.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE="SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE",e.SF_SOURCE_MEMBER_POLLING_TIMEOUT="SF_SOURCE_MEMBER_POLLING_TIMEOUT",e.SF_SOURCE_TRACKING_BATCH_SIZE="SF_SOURCE_TRACKING_BATCH_SIZE",e.SF_USE_GENERIC_UNIX_KEYCHAIN="SF_USE_GENERIC_UNIX_KEYCHAIN",e.SF_USE_PROGRESS_BAR="SF_USE_PROGRESS_BAR",e.SF_LAZY_LOAD_MODULES="SF_LAZY_LOAD_MODULES",e.SF_S3_HOST="SF_S3_HOST",e.SF_UPDATE_INSTRUCTIONS="SF_UPDATE_INSTRUCTIONS",e.SF_INSTALLER="SF_INSTALLER",e.SF_ENV="SF_ENV",e.SF_CAPITALIZE_RECORD_TYPES="SF_CAPITALIZE_RECORD_TYPES"})(z||(ga.EnvironmentVariable=z={}));var pe=e=>J1.getMessage((0,F2.camelCase)(e));ga.SUPPORTED_ENV_VARS={[z.FORCE_SHOW_SPINNER]:{d
Due to: %s`],["jwtAuthError","Error authenticating with JWT config due to: %s"],["jwtAuthErrors",`Error authenticating with JWT.
Errors encountered:
%s`],["refreshTokenAuthError","Error authenticating with the refresh token due to: %s"],["invalidSfdxAuthUrlError",`Invalid SFDX authorization URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the "instanceUrl" inside the SFDX authorization URL doesn\\'t include the protocol ("https://"). Run "org display --target-org" on an org to see an example of an SFDX authorization URL.`],["orgDataNotAvailableError","An attempt to refresh the authentication token failed with a 'Data Not Found Error'. The org identified by username %s does not appear to exist. Likely cause is that the org was deleted by another user or has expired."],["orgDataNotAvailableError.actions",["Run `sfdx force:org:list --clean` to remove stale org authentications.","Use `sfdx force:config:set` to update the defaultusername.","Use `sfdx force:org:create` to create a new org.","Use `sfdx auth` to authenticate an existing org."]],["namedOrgNotFound","No authorization information found for %s."],["noAliasesFound","Nothing to set."],["invalidFormat","Setting aliases must be in the format <key>=<value> but found: [%s]."],["invalidJsonCasing",'All JSON input must have heads down camelcase keys. E.g., `{ sfdcLoginUrl: "https://login.salesforce.com" }`\nFound "%s" at %s'],["missingClientId","Client ID is required for JWT authentication."]])).createError("namedOrgNotFound",[t]);return i&&this.contents.set(t,i.getContents(r)),this.contents.get(t)}getAll(t=!1){return[...this.configs.keys()].map(r=>this.get(r,t)).filter(r=>!(0,cV.isEmpty)(r))}has(t){return this.contents.has(t)}async exists(t){let r=this.configs.get(t);return r?r.exists():!1}async stat(t){let r=this.configs.get(t);return r?r.stat():null}async hasFile(t){try{return await uV.fs.promises.access(this.parseFilename(t)),!0}catch{return this.logger.debug(`No auth file found for ${t}`),!1}}async list(){return this.getAllFiles()}set(t,r){let n=this.configs.get(t);n?((0,Wxe.entriesOf)(r).map(([i,a])=>n.set(i,a)),n.has("username")||n.set("username",t)):this.contents.set(t,{...r,username:r.username??t})}update(t,r){let n=this.get(t)||{},i=Object.assign({},n,r);return this.set(t,i)}async remove(t){await this.configs.get(t)?.unlink(),this.configs.delete(t),this.contents.delete(t)}async write(t){let r=this.configs.get(t);if(r)return await r.write();{let n=this.contents.get(t)??{};await this.read(t,!1,!1);let i=this.configs.get(t);if(i)return i.setContentsFromObject(n),await i.write();this.logger.debug(`Failed to write auth file for ${t}. readConfig not found.`)}}async init(){this.logger=await Zxe.Logger.child(this.constructor.name)}async getAllFiles(){let t=this.getFileRegex();try{return(await uV.fs.promises.readdir(pV.Global.DIR)).filter(r=>t.test(r))}catch{return[]}}parseUsername(t){return t.replace(this.getFileExtension(),"")}parseFilename(t){return Vxe.join(pV.Global.DIR,`${t}${this.getFileExtension()}`)}};ya.BaseOrgAccessor=Z2;var $x=class extends Z2{async initAuthFile(t,r=!1){return dV.AuthInfoConfig.create({...dV.AuthInfoConfig.getOptions(t),throwOnNotFound:r})}getFileRegex(){return/^[^.][^@]*@[^.]+(\.[^.\s]+)+\.json$/}getFileExtension(){return".json"}};ya.OrgAccessor=$x});var mV=h(X1=>{"use strict";Object.defineProperty(X1,"__esModule",{value:!0});X1.SandboxOrgConfig=void 0;var Kxe=Or(),Xxe=eu(),K1=class extends Xxe.ConfigFile{constructor(t){super(t)}static getOptions(t){return{isGlobal:!0,isState:!0,filename:`${t}.sandbox.json`,orgId:t,stateFolder:Kxe.Global.SFDX_STATE_FOLDER}}};X1.SandboxOrgConfig=K1;(function(e){let t;(function(r){r.PROD_ORG_USERNAME="prodOrgUsername"})(t=e.Fields||(e.Fields={}))})(K1||(X1.SandboxOrgConfig=K1={}))});var gV=h(H2=>{"use strict";Object.defineProperty(H2,"__esModule",{value:!0});H2.SandboxAccessor=void 0;var hV=mV(),Yxe=Ux(),zx=class extends Yxe.BaseOrgAccessor{async initAuthFile(t,r=!1){return hV.SandboxOrgConfig.create({...hV.SandboxOrgConfig.getOptions(t),throwOnNotFound:r})}getFileRegex(){return/^(00D.*?)\.sandbox\.json$/}getFileExtension(){return".sandbox.json"}};H2.SandboxAccessor=zx});var Rf=h(G2=>{"use strict";Object
`).join(`
`+a),e.push(i+"m+"+n4.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=pCe()+t+" "+e[0]}function pCe(){return qr.inspectOpts.hideDate?"":new Date().toISOString()+" "}function fCe(...e){return process.stderr.write(r4.formatWithOptions(qr.inspectOpts,...e)+`
`)}function mCe(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function hCe(){return process.env.DEBUG}function gCe(e){e.inspectOpts={};let t=Object.keys(qr.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=qr.inspectOpts[t[r]]}n4.exports=nO()(qr);var{formatters:aW}=n4.exports;aW.o=function(e){return this.inspectOpts.colors=this.useColors,r4.inspect(e,this.inspectOpts).split(`
`).map(t=>t.trim()).join(" ")};aW.O=function(e){return this.inspectOpts.colors=this.useColors,r4.inspect(e,this.inspectOpts)}});var i4=h((a2t,iO)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?iO.exports=iW():iO.exports=oW()});var sW=h(aO=>{"use strict";Object.defineProperty(aO,"__esModule",{value:!0});function yCe(e){return function(t,r){return new Promise((n,i)=>{e.call(this,t,r,(a,o)=>{a?i(a):n(o)})})}}aO.default=yCe});var uW=h((sO,cW)=>{"use strict";var lW=sO&&sO.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bCe=require("events"),vCe=lW(i4()),_Ce=lW(sW()),og=vCe.default("agent-base");function wCe(e){return!!e&&typeof e.addRequest=="function"}function oO(){let{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
`).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function a4(e,t){return new a4.Agent(e,t)}(function(e){class t extends bCe.EventEmitter{constructor(n,i){super();let a=i;typeof n=="function"?this.callback=n:n&&(a=n),this.timeout=null,a&&typeof a.timeout=="number"&&(this.timeout=a.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:oO()?443:80}set defaultPort(n){this.explicitDefaultPort=n}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:oO()?"https:":"http:"}set protocol(n){this.explicitProtocol=n}callback(n,i,a){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(n,i){let a=Object.assign({},i);typeof a.secureEndpoint!="boolean"&&(a.secureEndpoint=oO()),a.host==null&&(a.host="localhost"),a.port==null&&(a.port=a.secureEndpoint?443:80),a.protocol==null&&(a.protocol=a.secureEndpoint?"https:":"http:"),a.host&&a.path&&delete a.path,delete a.agent,delete a.hostname,delete a._defaultAgent,delete a.defaultPort,delete a.createConnection,n._last=!0,n.shouldKeepAlive=!1;let o=!1,s=null,l=a.timeout||this.timeout,c=p=>{n._hadError||(n.emit("error",p),n._hadError=!0)},u=()=>{s=null,o=!0;let p=new Error(`A "socket" was not created for HTTP request before ${l}ms`);p.code="ETIMEOUT",c(p)},d=p=>{o||(s!==null&&(clearTimeout(s),s=null),c(p))},f=p=>{if(o)return;if(s!=null&&(clearTimeout(s),s=null),wCe(p)){og("Callback returned another Agent instance %o",p.constructor.name),p.addRequest(n,a);return}if(p){p.once("free",()=>{this.freeSocket(p,a)}),n.onSocket(p);return}let m=new Error(`no Duplex stream was returned to agent-base for \`${n.method} ${n.path}\``);c(m)};if(typeof this.callback!="function"){c(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(og("Converting legacy callback function to promise"),this.promisifiedCallback=_Ce.default(this.callback)):this.promisifiedCallback=this.callback),typeof l=="number"&&l>0&&(s=setTimeout(u,l)),"port"in a&&typeof a.port!="number"&&(a.port=Number(a.port));try{og("Resolving socket for %o request: %o",a.protocol,`${n.method} ${n.path}`),Promise.resolve(this.promisifiedCallback(n,a)).then(f,d)}catch(p){Promise.reject(p).catch(d)}}freeSocket(n,i){og("Freeing socket %o %o",n.constructor.name,i),n.destroy()}destroy(){og("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(a4||(a4={}));cW.exports=a4});var dW=h(lg=>{"use strict";var SCe=lg&&lg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lg,"__esModule",{value:!0});var ECe=SCe(i4()),sg=ECe.default("https-proxy-agent:parse-proxy-response");function xCe(e){return new Promise((t,r)=>{let n=0,i=[];function a(){let d=e.read();d?u(d):e.once("readable",a)}function o(){e.removeListener("end",l),e.removeListener("error",c),e.removeListener("close",s),e.removeListener("readable",a)}function s(d){sg("onclose had error %o",d)}function l(){sg("onend")}function c(d){o(),sg("onerror %o",d),r(d)}function u(d){i.push(d),n+=d.length;let f=Buffer.concat(i,n);if(f.indexOf(`\r
\r
`)===-1){sg("have not received end of HTTP headers yet..."),a();return}let m=f.toString("ascii",0,f.indexOf(`\r
`)),y=+m.split(" ")[1];sg("got proxy server response: %o",m),t({statusCode:y,buffered:f})}e.on("error",c),e.on("close",s),e.on("end",l),a()})}lg.default=xCe});var mW=h(zd=>{"use strict";var OCe=zd&&zd.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(u){try{c(n.next(u))}catch(d){o(d)}}function l(u){try{c(n.throw(u))}catch(d){o(d)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((n=n.apply(e,t||[])).next())})},Hf=zd&&zd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zd,"__esModule",{value:!0});var pW=Hf(require("net")),fW=Hf(require("tls")),CCe=Hf(require("url")),TCe=Hf(require("assert")),ICe=Hf(i4()),ACe=uW(),DCe=Hf(dW()),cg=ICe.default("https-proxy-agent:agent"),lO=class extends ACe.Agent{constructor(t){let r;if(typeof t=="string"?r=CCe.default.parse(t):r=t,!r)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");cg("creating new HttpsProxyAgent instance: %o",r),super(r);let n=Object.assign({},r);this.secureProxy=r.secureProxy||NCe(n.protocol),n.host=n.hostname||n.host,typeof n.port=="string"&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(t,r){return OCe(this,void 0,void 0,function*(){let{proxy:n,secureProxy:i}=this,a;i?(cg("Creating `tls.Socket`: %o",n),a=fW.default.connect(n)):(cg("Creating `net.Socket`: %o",n),a=pW.default.connect(n));let o=Object.assign({},n.headers),l=`CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r
`;n.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:c,port:u,secureEndpoint:d}=r;kCe(u,d)||(c+=`:${u}`),o.Host=c,o.Connection="close";for(let _ of Object.keys(o))l+=`${_}: ${o[_]}\r
`;let f=DCe.default(a);a.write(`${l}\r
`);let{statusCode:p,buffered:m}=yield f;if(p===200){if(t.once("socket",LCe),r.secureEndpoint){cg("Upgrading socket connection to TLS");let _=r.servername||r.host;return fW.default.connect(Object.assign(Object.assign({},PCe(r,"host","hostname","path","port")),{socket:a,servername:_}))}return a}a.destroy();let y=new pW.default.Socket({writable:!1});return y.readable=!0,t.once("socket",_=>{cg("replaying proxy buffer for failed request"),TCe.default(_.listenerCount("data")>0),_.push(m),_.push(null)}),y})}};zd.default=lO;function LCe(e){e.resume()}function kCe(e,t){return!!(!t&&e===80||t&&e===443)}function NCe(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function PCe(e,...t){let r={},n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}});var gW=h((dO,hW)=>{"use strict";var jCe=dO&&dO.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},cO=jCe(mW());function uO(e){return new cO.default(e)}(function(e){e.HttpsProxyAgent=cO.default,e.prototype=cO.default.prototype})(uO||(uO={}));hW.exports=uO});var po=h(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.getLogger=yr.Logger=yr.LogLevels=void 0;yr.LogLevels={DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5,NONE:6};var MCe=["","DEBUG","INFO","WARN","ERROR","FATAL","NONE"],RCe=(()=>{let e=process.env.JSFORCE_LOG_LEVEL||global.__JSFORCE_LOG_LEVEL__||"NONE";if(/^(DEBUG|INFO|WARN|ERROR|FATAL|NONE)$/i.test(e))return{"*":e};try{return JSON.parse(e)}catch{return{"*":"NONE"}}})();function FCe(e,t){let r=e[t]||e["*"];return typeof r=="number"?r:yr.LogLevels[r]||yr.LogLevels.NONE}var o4=class e{_moduleName;_logLevel;constructor(t,r=RCe){this._moduleName=t,this._logLevel=typeof r=="number"?r:typeof r=="string"?yr.LogLevels[r]||yr.LogLevels.NONE:FCe(r,t)}createInstance(t=this._logLevel){return new e(this._moduleName,t)}setLogLevel(t){typeof t=="string"?this._logLevel=yr.LogLevels[t]||yr.LogLevels.NONE:this._logLevel=t}log(t,...r){if(this._logLevel<=t){let n=[`${MCe[t]} [${this._moduleName}] `,...r];t<yr.LogLevels.ERROR?console.log(...n):console.error(...n)}}debug(...t){this.log(yr.LogLevels.DEBUG,...t)}info(...t){this.log(yr.LogLevels.INFO,...t)}warn(...t){this.log(yr.LogLevels.WARN,...t)}error(...t){this.log(yr.LogLevels.ERROR,...t)}fatal(...t){this.log(yr.LogLevels.FATAL,...t)}};yr.Logger=o4;var yW={};function $Ce(e){let t=yW[e]||new o4(e);return yW[e]=t,t}yr.getLogger=$Ce});var Gf=h(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.concatStreamsAsDuplex=lu.readAll=lu.createLazyStream=void 0;var s4=require("stream"),UCe=po(),pO=(0,UCe.getLogger)("stream");function zCe(){let e=new s4.PassThrough,t=new s4.PassThrough,r=bW(e,t),n=!1;return{stream:r,setStream:a=>{if(n)throw new Error("stream is already piped to actual stream");n=!0,e.pipe(a).pipe(t)}}}lu.createLazyStream=zCe;var fO=class extends s4.Writable{_chunks;_totalBytes;constructor(){super(),this._chunks=[],this._totalBytes=0}_write(t,r,n){this._chunks.push(t),this._totalBytes+=t.length,n()}_writev(t,r){for(let{chunk:n}of t)this._chunks.push(n),this._totalBytes+=n.length;r()}toString(t="utf-8"){return Buffer.concat(this._chunks).toString(t)}};async function qCe(e,t="utf-8"){pO.debug("readAll: starting to read stream");let r=Date.now();return new Promise((n,i)=>{let a=new fO;e.on("error",o=>{pO.error(`readAll: stream error: ${o.message}`),i(o)}).pipe(a).on("finish",()=>{pO.debug(`readAll: stream finished in ${Date.now()-r}ms`),n(a.toString(t))})})}lu.readAll=qCe;var mO=class extends s4.Duplex{_writable;_readable;constructor(t,r,n={}){super({writableObjectMode:n.writableObjectMode??t.writableObjectMode,readableObjectMode:n.readableObjectMode??r.readableObjectMode}),this._writable=t,this._readable=r,t.once("finish",()=>{this.end()}),this.once("finish",()=>{t.end()}),r.on("readable",()=>{this._readStream()}),r.once("end",()=>{this.push(null)}),t.on("error",i=>this.emit("error",i)),r.on("error",i=>this.emit("error",i))}_write(t,r,n){this._writable.write(t,r,n)}_read(t){this._readStream(t)}_readStream(t){let r;for(;(r=this._readable.read(t))!==null;)this.push(r)}};function bW(e,t,r){return new m
`;rt.DEFAULT_CONTENT_TYPE="application/octet-stream";rt.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=NO.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),a=this._multiPartFooter();n(i),n(t),n(a),this._trackLength(i,t,r)};rt.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+rt.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&cu(t,"httpVersion"))&&!(t instanceof EIe))&&(r.knownLength||this._valuesToMeasure.push(t))};rt.prototype._lengthRetriever=function(e,t){cu(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):SIe.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):cu(e,"httpVersion")?t(null,Number(e.headers["content-length"])):cu(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};rt.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),a="",o={"Content-Disposition":["form-data",'name="'+_H(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&kO(o,r.header);var s;for(var l in o)if(cu(o,l)){if(s=o[l],s==null)continue;Array.isArray(s)||(s=[s]),s.length&&(a+=l+": "+s.join("; ")+rt.LINE_BREAK)}return"--"+this.getBoundary()+rt.LINE_BREAK+a+rt.LINE_BREAK};rt.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=DO.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=DO.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&cu(e,"httpVersion")&&(r=DO.basename(e.client._httpMessage.path||"")),r)return'filename="'+_H(r)+'"'};rt.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=LO.lookup(e.name)),!r&&e&&e.path&&(r=LO.lookup(e.path)),!r&&e&&e.readable&&cu(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=LO.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=rt.DEFAULT_CONTENT_TYPE),r};rt.prototype._multiPartFooter=function(){return function(e){var t=rt.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};rt.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+rt.LINE_BREAK};rt.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)cu(e,t)&&(r[t.toLowerCase()]=e[t]);return r};rt.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};rt.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};rt.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(rt.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};rt.prototype._generateBoundary=function(){this._boundary="--------------------------"+xIe.randomBytes(12).toString("hex")};rt.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};rt.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};rt.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(HO)});var Xo=h((ZH,du)=>{(function(){var e,t,r,n,i,a,o,s=[].slice,l={}.hasOwnProperty;e=function(){var c,u,d,f,p,m;if(m=arguments[0],p=2<=arguments.length?s.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(c=0,d=p.length;c<d;c++)if(f=p[c],f!=null)for(u in f)l.call(f,u)&&(m[u]=f[u]);return m},i=function(c){return!!c&&Object.prototype.toString.call(c)==="[object Function]"},a=function(c){var u;return!!c&&((u=typeof c)=="function"||u==="object")},r=function(c){return i(Array.isArray)?Array.isArray(c):Object.prototype.toString.call(c)==="[object Array]"},n=function(c){var u;if(r(c))return!c.length;for(u in c)if(l.call(c,u))return!1;return!0},o=function(c){var u,d;return a(c)&&(d=Object.getPrototypeOf(c))&&(u=d.constructor)&&typeof u=="function"&&u instanceof u&&Function.prototype.toString.call(u)===Function.prototype.toString.call(Object)},t=function(c){return i(c.valueOf)?c.valueOf():c},du.exports.assign=e,du.exports.isFunction=i,du.exports.isObject=a,du.exports.isArray=r,du.exports.isEmpty=n,du.exports.isPlainObject=o,du.exports.getValue=t}).call(ZH)});var GO=h((HH,GH)=>{(function(){var e;GH.exports=e=function(){function t(){}return t.prototype.hasFeature=function(r,n){return!0},t.prototype.createDocumentType=function(r,n,i){throw new Error("This DOM method is not implemented.")},t.prototype.createDocument=function(r,n,i){throw new Error("This DOM method is not implemented.")},t.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")},t.prototype.getFeature=function(r,n){throw new Error("This DOM method is not implemented.")},t}()}).call(HH)});var XH=h((JH,KH)=>{(function(){var e;KH.exports=e=function(){function t(){}return t.prototype.handleError=function(r){throw new Error(r)},t}()}).call(JH)});var eG=h((YH,QH)=>{(function(){var e;QH.exports=e=function(){function t(r){this.arr=r||[]}return Object.defineProperty(t.prototype,"length",{get:function(){return this.arr.length}}),t.prototype.item=function(r){return this.arr[r]||null},t.prototype.contains=function(r){return this.arr.indexOf(r)!==-1},t}()}).call(YH)});var nG=h((tG,rG)=>{(function(){var e,t,r;t=XH(),r=eG(),rG.exports=e=function(){function n(){var i;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new t,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=i=Object.create(this.defaultParams)}return Object.defineProperty(n.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}}),n.prototype.getParameter=function(i){return this.params.hasOwnProperty(i)?this.params[i]:null},n.prototype.canSetParameter=function(i,a){return!0},n.prototype.setParameter=function(i,a){return a!=null?this.params[i]=a:delete this.params[i]},n}()}).call(tG)});var cr=h((iG,aG)=>{(function(){aG.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(iG)});var JO=h((oG,sG)=>{(function(){var e,t,r;e=cr(),r=Ui(),sG.exports=t=function(){function n(i,a,o){if(this.parent=i,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),a==null)throw new Error("Missing attribute name. "+this.debugInfo(a));this.name=this.stringify.name(a),this.value=this.stringify.attValue(o),this.type=e.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(n.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(n.prototype,"textContent",{get:function(){return this.value},set:function(i){return this.value=i||""}}),Object.defin
`,v.offset=(P=w.offset)!=null?P:0,v.dontPrettyTextNodes=(j=(T=w.dontPrettyTextNodes)!=null?T:w.dontprettytextnodes)!=null?j:0,v.spaceBeforeSlash=(N=(k=w.spaceBeforeSlash)!=null?k:w.spacebeforeslash)!=null?N:"",v.spaceBeforeSlash===!0&&(v.spaceBeforeSlash=" "),v.suppressPrettyCount=0,v.user={},v.state=t.None,v},E.prototype.indent=function(w,v,b){var A;return!v.pretty||v.suppressPrettyCount?"":v.pretty&&(A=(b||0)+v.offset+1,A>0)?new Array(A).join(v.indent):""},E.prototype.endline=function(w,v,b){return!v.pretty||v.suppressPrettyCount?"":v.newline},E.prototype.attribute=function(w,v,b){var A;return this.openAttribute(w,v,b),A=" "+w.name+'="'+w.value+'"',this.closeAttribute(w,v,b),A},E.prototype.cdata=function(w,v,b){var A;return this.openNode(w,v,b),v.state=t.OpenTag,A=this.indent(w,v,b)+"<![CDATA[",v.state=t.InsideTag,A+=w.value,v.state=t.CloseTag,A+="]]>"+this.endline(w,v,b),v.state=t.None,this.closeNode(w,v,b),A},E.prototype.comment=function(w,v,b){var A;return this.openNode(w,v,b),v.state=t.OpenTag,A=this.indent(w,v,b)+"<!-- ",v.state=t.InsideTag,A+=w.value,v.state=t.CloseTag,A+=" -->"+this.endline(w,v,b),v.state=t.None,this.closeNode(w,v,b),A},E.prototype.declaration=function(w,v,b){var A;return this.openNode(w,v,b),v.state=t.OpenTag,A=this.indent(w,v,b)+"<?xml",v.state=t.InsideTag,A+=' version="'+w.version+'"',w.encoding!=null&&(A+=' encoding="'+w.encoding+'"'),w.standalone!=null&&(A+=' standalone="'+w.standalone+'"'),v.state=t.CloseTag,A+=v.spaceBeforeSlash+"?>",A+=this.endline(w,v,b),v.state=t.None,this.closeNode(w,v,b),A},E.prototype.docType=function(w,v,b){var A,P,j,T,N;if(b||(b=0),this.openNode(w,v,b),v.state=t.OpenTag,T=this.indent(w,v,b),T+="<!DOCTYPE "+w.root().name,w.pubID&&w.sysID?T+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(T+=' SYSTEM "'+w.sysID+'"'),w.children.length>0){for(T+=" [",T+=this.endline(w,v,b),v.state=t.InsideTag,N=w.children,P=0,j=N.length;P<j;P++)A=N[P],T+=this.writeChildNode(A,v,b+1);v.state=t.CloseTag,T+="]"}return v.state=t.CloseTag,T+=v.spaceBeforeSlash+">",T+=this.endline(w,v,b),v.state=t.None,this.closeNode(w,v,b),T},E.prototype.element=function(w,v,b){var A,P,j,T,N,k,B,$,K,ae,ne,re,ce,_e;b||(b=0),ae=!1,ne="",this.openNode(w,v,b),v.state=t.OpenTag,ne+=this.indent(w,v,b)+"<"+w.name,re=w.attribs;for(K in re)S.call(re,K)&&(A=re[K],ne+=this.attribute(A,v,b));if(j=w.children.length,T=j===0?null:w.children[0],j===0||w.children.every(function(We){return(We.type===e.Text||We.type===e.Raw)&&We.value===""}))v.allowEmpty?(ne+=">",v.state=t.CloseTag,ne+="</"+w.name+">"+this.endline(w,v,b)):(v.state=t.CloseTag,ne+=v.spaceBeforeSlash+"/>"+this.endline(w,v,b));else if(v.pretty&&j===1&&(T.type===e.Text||T.type===e.Raw)&&T.value!=null)ne+=">",v.state=t.InsideTag,v.suppressPrettyCount++,ae=!0,ne+=this.writeChildNode(T,v,b+1),v.suppressPrettyCount--,ae=!1,v.state=t.CloseTag,ne+="</"+w.name+">"+this.endline(w,v,b);else{if(v.dontPrettyTextNodes){for(ce=w.children,N=0,B=ce.length;N<B;N++)if(P=ce[N],(P.type===e.Text||P.type===e.Raw)&&P.value!=null){v.suppressPrettyCount++,ae=!0;break}}for(ne+=">"+this.endline(w,v,b),v.state=t.InsideTag,_e=w.children,k=0,$=_e.length;k<$;k++)P=_e[k],ne+=this.writeChildNode(P,v,b+1);v.state=t.CloseTag,ne+=this.indent(w,v,b)+"</"+w.name+">",ae&&v.suppressPrettyCount--,ne+=this.endline(w,v,b),v.state=t.None}return this.closeNode(w,v,b),ne},E.prototype.writeChildNode=function(w,v,b){switch(w.type){case e.CData:return this.cdata(w,v,b);case e.Comment:return this.comment(w,v,b);case e.Element:return this.element(w,v,b);case e.Raw:return this.raw(w,v,b);case e.Text:return this.text(w,v,b);case e.ProcessingInstruction:return this.processingInstruction(w,v,b);case e.Dummy:return"";case e.Declaration:return this.declaration(w,v,b);case e.DocType:return this.docType(w,v,b);case e.AttributeDeclaration:return this.dtdAttList(w,v,b);case e.ElementDeclaration:return this.dtdElement(w,v,b);case e.EntityDeclaration:return this.dtdEntity(w,v,b);case e.NotationDeclaration:return this.dtdNotation(w,v,b);default:throw new Error("Unknown XML node type: "+w.constructor.name)}},E.prototype.proc
`||D==="\r"||D===" "}function b(D){return D==='"'||D==="'"}function A(D){return D===">"||v(D)}function P(D,I){return D.test(I)}function j(D,I){return!P(D,I)}var T=0;e.STATE={BEGIN:T++,BEGIN_WHITESPACE:T++,TEXT:T++,TEXT_ENTITY:T++,OPEN_WAKA:T++,SGML_DECL:T++,SGML_DECL_QUOTED:T++,DOCTYPE:T++,DOCTYPE_QUOTED:T++,DOCTYPE_DTD:T++,DOCTYPE_DTD_QUOTED:T++,COMMENT_STARTING:T++,COMMENT:T++,COMMENT_ENDING:T++,COMMENT_ENDED:T++,CDATA:T++,CDATA_ENDING:T++,CDATA_ENDING_2:T++,PROC_INST:T++,PROC_INST_BODY:T++,PROC_INST_ENDING:T++,OPEN_TAG:T++,OPEN_TAG_SLASH:T++,ATTRIB:T++,ATTRIB_NAME:T++,ATTRIB_NAME_SAW_WHITE:T++,ATTRIB_VALUE:T++,ATTRIB_VALUE_QUOTED:T++,ATTRIB_VALUE_CLOSED:T++,ATTRIB_VALUE_UNQUOTED:T++,ATTRIB_VALUE_ENTITY_Q:T++,ATTRIB_VALUE_ENTITY_U:T++,CLOSE_TAG:T++,CLOSE_TAG_SAW_WHITE:T++,SCRIPT:T++,SCRIPT_ENDING:T++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(D){var I=e.ENTITIES[D],W=typeof I=="number"?String.fromCharCode(I):I;e.ENTITIES[D]=W});for(var N in e.STATE)e.STATE[e.STATE[N]]=N;T=e.STATE;function k(D,I,W){D[I]&&D[I](W)}function B(D){var I=D&&D.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return I?I[2]:null}function $(D){return D?D.toLowerCase().replace(/[^a-z0-9]/g,""):null}function K(D,I){let W=$(D),q=$(I);return!W||!q?!0:q==="utf16"?W==="utf16le"||W==="utf16be":W===q}function ae(D,I){if(!(!D.strict||!D.encoding||!I||I.name!=="xml")){var W=B(I.body);W&&!K(D.encoding,W)&&Me(D,"XML declaration encoding "+W+" does not match detected stream encoding "+D.encoding.toUpperCase())}}fu
Line: `+D.line+`
Column: `+D.column+`
Char: `+D.c),I=new Error(I),D.error=I,k(D,"onerror",I),D}function We(D){return D.sawRoot&&!D.closedRoot&&Me(D,"Unclosed root tag"),D.state!==T.BEGIN&&D.state!==T.BEGIN_WHITESPACE&&D.state!==T.TEXT&&_e(D,"Unexpected end"),re(D),D.c="",D.closed=!0,k(D,"onend"),r.call(D,D.strict,D.opt),D}function Me(D,I){if(typeof D!="object"||!(D instanceof r))throw new Error("bad call to strictFail");D.strict&&_e(D,I)}function Mo(D){D.strict||(D.tagName=D.tagName[D.looseCase]());var I=D.tags[D.tags.length-1]||D,W=D.tag={name:D.tagName,attributes:{}};D.opt.xmlns&&(W.ns=I.ns),D.attribList.length=0,ne(D,"onopentagstart",W)}function Ro(D,I){var W=D.indexOf(":"),q=W<0?["",D]:D.split(":"),mt=q[0],kt=q[1];return I&&D==="xmlns"&&(mt="xmlns",kt=""),{prefix:mt,local:kt}}function e1(D){if(D.strict||(D.attribName=D.attribName[D.looseCase]()),D.attribList.indexOf(D.attribName)!==-1||D.tag.attributes.hasOwnProperty(D.attribName)){D.attribName=D.attribValue="";return}if(D.opt.xmlns){var I=Ro(D.attribName,!0),W=I.prefix,q=I.local;if(W==="xmlns")if(q==="xml"&&D.attribValue!==p)Me(D,"xml: prefix must be bound to "+p+`
Actual: `+D.attribValue);else if(q==="xmlns"&&D.attribValue!==m)Me(D,"xmlns: prefix must be bound to "+m+`
Actual: `+D.attribValue);else{var mt=D.tag,kt=D.tags[D.tags.length-1]||D;mt.ns===kt.ns&&(mt.ns=Object.create(kt.ns)),mt.ns[q]=D.attribValue}D.attribList.push([D.attribName,D.attribValue])}else D.tag.attributes[D.attribName]=D.attribValue,ne(D,"onattribute",{name:D.attribName,value:D.attribValue});D.attribName=D.attribValue=""}function Sl(D,I){if(D.opt.xmlns){var W=D.tag,q=Ro(D.tagName);W.prefix=q.prefix,W.local=q.local,W.uri=W.ns[q.prefix]||"",W.prefix&&!W.uri&&(Me(D,"Unbound namespace prefix: "+JSON.stringify(D.tagName)),W.uri=q.prefix);var mt=D.tags[D.tags.length-1]||D;W.ns&&mt.ns!==W.ns&&Object.keys(W.ns).forEach(function(zb){ne(D,"onopennamespace",{prefix:zb,uri:W.ns[zb]})});for(var kt=0,Kt=D.attribList.length;kt<Kt;kt++){var vn=D.attribList[kt],mr=vn[0],ta=vn[1],ar=Ro(mr,!0),ra=ar.prefix,Ub=ar.local,El=ra===""?"":W.ns[ra]||"",i1={name:mr,value:ta,prefix:ra,local:Ub,uri:El};ra&&ra!=="xmlns"&&!El&&(Me(D,"Unbound namespace prefix: "+JSON.stringify(ra)),i1.uri=ra),D.tag.attributes[mr]=i1,ne(D,"onattribute",i1)}D.attribList.length=0}D.tag.isSelfClosing=!!I,D.sawRoot=!0,D.tags.push(D.tag),ne(D,"onopentag",D.tag),I||(!D.noscript&&D.tagName.toLowerCase()==="script"?D.state=T.SCRIPT:D.state=T.TEXT,D.tag=null,D.tagName=""),D.attribName=D.attribValue="",D.attribList.length=0}function t1(D){if(!D.tagName){Me(D,"Weird empty close tag."),D.textNode+="</>",D.state=T.TEXT;return}if(D.script){if(D.tagName!=="script"){D.script+="</"+D.tagName+">",D.tagName="",D.state=T.SCRIPT;return}ne(D,"onscript",D.script),D.script=""}var I=D.tags.length,W=D.tagName;D.strict||(W=W[D.looseCase]());for(var q=W;I--;){var mt=D.tags[I];if(mt.name!==q)Me(D,"Unexpected close tag");else break}if(I<0){Me(D,"Unmatched closing tag: "+D.tagName),D.textNode+="</"+D.tagName+">",D.state=T.TEXT;return}D.tagName=W;for(var kt=D.tags.length;kt-- >I;){var Kt=D.tag=D.tags.pop();D.tagName=D.tag.name,ne(D,"onclosetag",D.tagName);var vn={};for(var mr in Kt.ns)vn[mr]=Kt.ns[mr];var ta=D.tags[D.tags.length-1]||D;D.opt.xmlns&&Kt.ns!==ta.ns&&Object.keys(Kt.ns).forEach(function(ar){var ra=Kt.ns[ar];ne(D,"onclosenamespace",{prefix:ar,uri:ra})})}I===0&&(D.closedRoot=!0),D.tagName=D.attribValue=D.attribName="",D.attribList.length=0,D.state=T.TEXT}function W8(D){var I=D.entity,W=I.toLowerCase(),q,mt="";return D.ENTITIES[I]?D.ENTITIES[I]:D.ENTITIES[W]?D.ENTITIES[W]:(I=W,I.charAt(0)==="#"&&(I.charAt(1)==="x"?(I=I.slice(2),q=parseInt(I,16),mt=q.toString(16)):(I=I.slice(1),q=parseInt(I,10),mt=q.toString(10))),I=I.replace(/^0+/,""),isNaN(q)||mt.toLowerCase()!==I||q<0||q>1114111?(Me(D,"Invalid character entity"),"&"+D.entity+";"):String.fromCodePoint(q))}function r1(D,I){I==="<"?(D.state=T.OPEN_WAKA,D.startTagPosition=D.position):v(I)||(Me(D,"Non-whitespace before first tag."),D.textNode=I,D.state=T.TEXT)}function n1(D,I){var W="";return I<D.length&&(W=D.charAt(I)),W}function Z8(D){var I=this;if(this.error)throw this.error;if(I.closed)return _e(I,"Cannot write after close. Assign an onready handler.");if(D===null)return We(I);typeof D=="object"&&(D=D.toString());for(var W=0,q="";q=n1(D,W++),I.c=q,!!q;)switch(I.trackPosition&&(I.position++,q===`
`?(I.line++,I.column=0):I.column++),I.state){case T.BEGIN:if(I.state=T.BEGIN_WHITESPACE,q==="\uFEFF")continue;r1(I,q);continue;case T.BEGIN_WHITESPACE:r1(I,q);continue;case T.TEXT:if(I.sawRoot&&!I.closedRoot){for(var kt=W-1;q&&q!=="<"&&q!=="&";)q=n1(D,W++),q&&I.trackPosition&&(I.position++,q===`
`?(I.line++,I.column=0):I.column++);I.textNode+=D.substring(kt,W-1)}q==="<"&&!(I.sawRoot&&I.closedRoot&&!I.strict)?(I.state=T.OPEN_WAKA,I.startTagPosition=I.position):(!v(q)&&(!I.sawRoot||I.closedRoot)&&Me(I,"Text data outside of root node."),q==="&"?I.state=T.TEXT_ENTITY:I.textNode+=q);continue;case T.SCRIPT:q==="<"?I.state=T.SCRIPT_ENDING:I.script+=q;continue;case T.SCRIPT_ENDING:q==="/"?I.state=T.CLOSE_TAG:(I.script+="<"+q,I.state=T.SCRIPT);continue;case T.OPEN_WAKA:if(q==="!")I.state=T.SGML_DECL,I.sgmlDecl="";else if(!v(q))if(P(_,q))I.state=T.OPEN_TAG,I.tagName=q;else if(q==="/")I.state=T.CLOSE_TAG,I.tagName="";else if(q==="?")I.state=T.PROC_INST,I.procInstName=I.procInstBody="";else{if(Me(I,"Unencoded <"),I.startTagPosition+1<I.position){var mt=I.position-I.startTagPosition;q=new Array(mt).join(" ")+q}I.textNode+="<"+q,I.state=T.TEXT}continue;case T.SGML_DECL:if(I.sgmlDecl+q==="--"){I.state=T.COMMENT,I.comment="",I.sgmlDecl="";continue}I.doctype&&I.doctype!==!0&&I.sgmlDecl?(I.state=T.DOCTYPE_DTD,I.doctype+="<!"+I.sgmlDecl+q,I.sgmlDecl=""):(I.sgmlDecl+q).toUpperCase()===d?(ne(I,"onopencdata"),I.state=T.CDATA,I.sgmlDecl="",I.cdata=""):(I.sgmlDecl+q).toUpperCase()===f?(I.state=T.DOCTYPE,(I.doctype||I.sawRoot)&&Me(I,"Inappropriately located doctype declaration"),I.doctype="",I.sgmlDecl=""):q===">"?(ne(I,"onsgmldeclaration",I.sgmlDecl),I.sgmlDecl="",I.state=T.TEXT):(b(q)&&(I.state=T.SGML_DECL_QUOTED),I.sgmlDecl+=q);continue;case T.SGML_DECL_QUOTED:q===I.q&&(I.state=T.SGML_DECL,I.q=""),I.sgmlDecl+=q;continue;case T.DOCTYPE:q===">"?(I.state=T.TEXT,ne(I,"ondoctype",I.doctype),I.doctype=!0):(I.doctype+=q,q==="["?I.state=T.DOCTYPE_DTD:b(q)&&(I.state=T.DOCTYPE_QUOTED,I.q=q));continue;case T.DOCTYPE_QUOTED:I.doctype+=q,q===I.q&&(I.q="",I.state=T.DOCTYPE);continue;case T.DOCTYPE_DTD:q==="]"?(I.doctype+=q,I.state=T.DOCTYPE):q==="<"?(I.state=T.OPEN_WAKA,I.startTagPosition=I.position):b(q)?(I.doctype+=q,I.state=T.DOCTYPE_DTD_QUOTED,I.q=q):I.doctype+=q;continue;case T.DOCTYPE_DTD_QUOTED:I.doctype+=q,q===I.q&&(I.state=T.DOCTYPE_DTD,I.q="");continue;case T.COMMENT:q==="-"?I.state=T.COMMENT_ENDING:I.comment+=q;continue;case T.COMMENT_ENDING:q==="-"?(I.state=T.COMMENT_ENDED,I.comment=ce(I.opt,I.comment),I.comment&&ne(I,"oncomment",I.comment),I.comment=""):(I.comment+="-"+q,I.state=T.COMMENT);continue;case T.COMMENT_ENDED:q!==">"?(Me(I,"Malformed comment"),I.comment+="--"+q,I.state=T.COMMENT):I.doctype&&I.doctype!==!0?I.state=T.DOCTYPE_DTD:I.state=T.TEXT;continue;case T.CDATA:for(var kt=W-1;q&&q!=="]";)q=n1(D,W++),q&&I.trackPosition&&(I.position++,q===`
`?(I.line++,I.column=0):I.column++);I.cdata+=D.substring(kt,W-1),q==="]"&&(I.state=T.CDATA_ENDING);continue;case T.CDATA_ENDING:q==="]"?I.state=T.CDATA_ENDING_2:(I.cdata+="]"+q,I.state=T.CDATA);continue;case T.CDATA_ENDING_2:q===">"?(I.cdata&&ne(I,"oncdata",I.cdata),ne(I,"onclosecdata"),I.cdata="",I.state=T.TEXT):q==="]"?I.cdata+="]":(I.cdata+="]]"+q,I.state=T.CDATA);continue;case T.PROC_INST:q==="?"?I.state=T.PROC_INST_ENDING:v(q)?I.state=T.PROC_INST_BODY:I.procInstName+=q;continue;case T.PROC_INST_BODY:if(!I.procInstBody&&v(q))continue;q==="?"?I.state=T.PROC_INST_ENDING:I.procInstBody+=q;continue;case T.PROC_INST_ENDING:if(q===">"){let ta={name:I.procInstName,body:I.procInstBody};ae(I,ta),ne(I,"onprocessinginstruction",ta),I.procInstName=I.procInstBody="",I.state=T.TEXT}else I.procInstBody+="?"+q,I.state=T.PROC_INST_BODY;continue;case T.OPEN_TAG:P(S,q)?I.tagName+=q:(Mo(I),q===">"?Sl(I):q==="/"?I.state=T.OPEN_TAG_SLASH:(v(q)||Me(I,"Invalid character in tag name"),I.state=T.ATTRIB));continue;case T.OPEN_TAG_SLASH:q===">"?(Sl(I,!0),t1(I)):(Me(I,"Forward-slash in opening tag not followed by >"),I.state=T.ATTRIB);continue;case T.ATTRIB:if(v(q))continue;q===">"?Sl(I):q==="/"?I.state=T.OPEN_TAG_SLASH:P(_,q)?(I.attribName=q,I.attribValue="",I.state=T.ATTRIB_NAME):Me(I,"Invalid attribute name");continue;case T.ATTRIB_NAME:q==="="?I.state=T.ATTRIB_VALUE:q===">"?(Me(I,"Attribute without value"),I.attribValue=I.attribName,e1(I),Sl(I)):v(q)?I.state=T.ATTRIB_NAME_SAW_WHITE:P(S,q)?I.attribName+=q:Me(I,"Invalid attribute name");continue;case T.ATTRIB_NAME_SAW_WHITE:if(q==="=")I.state=T.ATTRIB_VALUE;else{if(v(q))continue;Me(I,"Attribute without value"),I.tag.attributes[I.attribName]="",I.attribValue="",ne(I,"onattribute",{name:I.attribName,value:""}),I.attribName="",q===">"?Sl(I):P(_,q)?(I.attribName=q,I.state=T.ATTRIB_NAME):(Me(I,"Invalid attribute name"),I.state=T.ATTRIB)}continue;case T.ATTRIB_VALUE:if(v(q))continue;b(q)?(I.q=q,I.state=T.ATTRIB_VALUE_QUOTED):(I.opt.unquotedAttributeValues||_e(I,"Unquoted attribute value"),I.state=T.ATTRIB_VALUE_UNQUOTED,I.attribValue=q);continue;case T.ATTRIB_VALUE_QUOTED:if(q!==I.q){q==="&"?I.state=T.ATTRIB_VALUE_ENTITY_Q:I.attribValue+=q;continue}e1(I),I.q="",I.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:v(q)?I.state=T.ATTRIB:q===">"?Sl(I):q==="/"?I.state=T.OPEN_TAG_SLASH:P(_,q)?(Me(I,"No whitespace between attributes"),I.attribName=q,I.attribValue="",I.state=T.ATTRIB_NAME):Me(I,"Invalid attribute name");continue;case T.ATTRIB_VALUE_UNQUOTED:if(!A(q)){q==="&"?I.state=T.ATTRIB_VALUE_ENTITY_U:I.attribValue+=q;continue}e1(I),q===">"?Sl(I):I.state=T.ATTRIB;continue;case T.CLOSE_TAG:if(I.tagName)q===">"?t1(I):P(S,q)?I.tagName+=q:I.script?(I.script+="</"+I.tagName+q,I.tagName="",I.state=T.SCRIPT):(v(q)||Me(I,"Invalid tagname in closing tag"),I.state=T.CLOSE_TAG_SAW_WHITE);else{if(v(q))continue;j(_,q)?I.script?(I.script+="</"+q,I.state=T.SCRIPT):Me(I,"Invalid tagname in closing tag."):I.tagName=q}continue;case T.CLOSE_TAG_SAW_WHITE:if(v(q))continue;q===">"?t1(I):Me(I,"Invalid characters in closing tag");continue;case T.TEXT_ENTITY:case T.ATTRIB_VALUE_ENTITY_Q:case T.ATTRIB_VALUE_ENTITY_U:var Kt,vn;switch(I.state){case T.TEXT_ENTITY:Kt=T.TEXT,vn="textNode";break;case T.ATTRIB_VALUE_ENTITY_Q:Kt=T.ATTRIB_VALUE_QUOTED,vn="attribValue";break;case T.ATTRIB_VALUE_ENTITY_U:Kt=T.ATTRIB_VALUE_UNQUOTED,vn="attribValue";break}if(q===";"){var mr=W8(I);I.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(mr)?((I.entityCount+=1)>I.opt.maxEntityCount&&_e(I,"Parsed entity count exceeds max entity count"),(I.entityDepth+=1)>I.opt.maxEntityDepth&&_e(I,"Parsed entity depth exceeds max entity depth"),I.entity="",I.state=Kt,I.write(mr),I.entityDepth-=1):(I[vn]+=mr,I.entity="",I.state=Kt)}else P(I.entity.length?w:E,q)?I.entity+=q:(Me(I,"Invalid character in entity name"),I[vn]+="&"+I.entity+q,I.entity="",I.state=Kt);continue;default:throw new Error(I,"Unknown state: "+I.state)}return I.position>=I.bufferCheckPosition&&n(I),I}String.fromCodePoint||function(){var D=String.fromCharCode,I=Math.floor
`,o).length:d,c?(s===null?0:s.length)+l.length:0,c?l.length+d:0);return f<p},parse:function(n,i,a,o){let{bom:s,comment_no_infix:l,encoding:c,from_line:u,ltrim:d,max_record_size:f,raw:p,relax_quotes:m,rtrim:y,skip_empty_lines:_,to:S,to_line:E}=this.options,{comment:w,escape:v,quote:b,record_delimiter:A}=this.options,{bomSkipped:P,previousBuf:j,rawBuffer:T,escapeIsQuote:N}=this.state,k;if(j===void 0)if(n===void 0){o();return}else k=n;else j!==void 0&&n===void 0?k=j:k=Buffer.concat([j,n]);if(P===!1)if(s===!1)this.state.bomSkipped=!0;else if(k.length<3){if(i===!1){this.state.previousBuf=k;return}}else{for(let K in em)if(em[K].compare(k,0,em[K].length)===0){let ae=em[K].length;this.state.bufBytesStart+=ae,k=k.slice(ae),this.options=hJ({...this.original_options,encoding:K}),{comment:w,escape:v,quote:b}=this.options;break}this.state.bomSkipped=!0}let B=k.length,$;for($=0;$<B&&!this.__needMoreData($,B,i);$++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),E!==-1&&this.info.lines>E){this.state.stop=!0,o();return}this.state.quoting===!1&&A.length===0&&this.__autoDiscoverRecordDelimiter(k,$)&&(A=this.options.record_delimiter);let K=k[$];if(p===!0&&T.append(K),(K===LAe||K===kAe)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(v!==null&&this.state.quoting===!0&&this.__isEscape(k,$,K)&&$+v.length<B)if(N){if(this.__isQuote(k,$+v.length)){this.state.escaping=!0,$+=v.length-1;continue}}else{this.state.escaping=!0,$+=v.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(k,$))if(this.state.quoting===!0){let re=k[$+b.length],ce=y&&this.__isCharTrimable(k,$+b.length),_e=w!==null&&this.__compareBytes(w,k,$+b.length,re),We=this.__isDelimiter(k,$+b.length,re),Me=A.length===0?this.__autoDiscoverRecordDelimiter(k,$+b.length):this.__isRecordDelimiter(re,k,$+b.length);if(v!==null&&this.__isEscape(k,$,K)&&this.__isQuote(k,$+v.length))$+=v.length-1;else if(!re||We||Me||_e||ce){this.state.quoting=!1,this.state.wasQuoting=!0,$+=b.length-1;continue}else if(m===!1){let Mo=this.__error(new ct("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(re)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(Mo!==void 0)return Mo}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(b),$+=b.length-1}else if(this.state.field.length!==0){if(m===!1){let re=this.__infoField(),ce=Object.keys(em).map(We=>em[We].equals(this.state.field.toString())?We:!1).filter(Boolean)[0],_e=this.__error(new ct("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(re.column)} at line ${re.lines}, value is ${JSON.stringify(this.state.field.toString(c))}`,ce?`(${ce} bom)`:void 0],this.options,re,{field:this.state.field}));if(_e!==void 0)return _e}}else{this.state.quoting=!0,$+=b.length-1;continue}if(this.state.quoting===!1){let re=this.__isRecordDelimiter(K,k,$);if(re!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=u){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),$+=re-1;continue}if(_===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,$+=re-1;continue}this.info.bytes=this.state.bufBytesStart+$;let We=this.__onField();if(We!==void 0)return We;this.info.bytes=this.state.bufBytesStart+$+re;let Me=this.__onRecord(a);if(Me!==void 0)return Me;if(S!==-1&&this.info.records>=S){this.state.stop=!0,o();return}}this.state.commenting=!1,$+=re-1;continue}if(this.state.commenting)continue;if(w!==null&&(l===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(w,k,$,K)!==0){this.state.commenting=!0;continue}let ce=this.__isDelimiter(k,$,K);if(ce!==0){this.info.bytes=this.state.bufBytesStart+$;le
`,a),Buffer.from(`
`,a),Buffer.from("\r",a)];e:for(let s=0;s<o.length;s++){let l=o[s].length;for(let c=0;c<l;c++)if(o[s][c]!==n[i+c])continue e;return this.options.record_delimiter.push(o[s]),this.state.recordDelimiterMaxLength=o[s].length,o[s].length}return 0},__error:function(n){let{encoding:i,raw:a,skip_records_with_error:o}=this.options,s=typeof n=="string"?new Error(n):n;if(o){this.state.recordHasError=!0,this.options.on_skip!==void 0&&this.options.on_skip(s,a?this.state.rawBuffer.toString(i):void 0);return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:n,raw:i,encoding:a}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:n===!0,index:this.state.record.length,raw:i?this.state.rawBuffer.toString(a):void 0}},__infoField:function(){let{columns:n}=this.options,i=Array.isArray(n);return{...this.__infoRecord(),column:i===!0?n.length>this.state.record.length?n[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}},z4=class extends EAe.Transform{constructor(t={}){super({readableObjectMode:!0,...t,encoding:null}),this.api=NAe({on_skip:(r,n)=>{this.emit("skip",r,n)},...t}),this.state=this.api.state,this.options=this.api.options,this.info=this.api.info}_transform(t,r,n){if(this.state.stop===!0)return;let i=this.api.parse(t,!1,a=>{this.push(a)},()=>{this.push(null),this.end(),this.on("end",this.destroy)});i!==void 0&&(this.state.stop=!0),n(i)}_flush(t){if(this.state.stop===!0)return;let r=this.api.parse(void 0,!0,n=>{this.push(n)},()=>{this.push(null),this.on("end",this.destroy)});t(r)}},PAe=function(){let e,t,r;for(let i in arguments){let a=arguments[i],o=typeof a;if(e===void 0&&(typeof a=="string"||Buffer.isBuffer(a)))e=a;else if(t===void 0&&yJ(a))t=a;else if(r===void 0&&o==="function")r=a;else throw new ct("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(a)} at index ${i}`],t||{})}let n=new z4(t);if(r){let i=t===void 0||t.objname===void 0?[]:{};n.on("readable",function(){let a;for(;(a=this.read())!==null;)t===void 0||t.objname===void 0?i.push(a):i[a[0]]=a[1]}),n.on("error",function(a){r(a,void 0,n.api.__infoDataSet())}),n.on("end",function(){r(void 0,i,n.api.__infoDataSet())})}if(e!==void 0){let i=function(){n.write(e),n.end()};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}return n};q4.CsvError=ct;q4.Parser=z4;q4.parse=PAe});var EJ=h(nC=>{"use strict";var ht=class e extends Error{constructor(t,r,n,...i){Array.isArray(r)&&(r=r.join(" ").trim()),super(r),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,e),this.code=t;for(let a of i)for(let o in a){let s=a[o];this[o]=Buffer.isBuffer(s)?s.toString(n.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}},jAe=function(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)},SJ=function(e){let t=[];for(let r=0,n=e.length;r<n;r++){let i=e[r];if(i==null||i===!1)t[r]={disabled:!0};else if(typeof i=="string")t[r]={name:i};else if(jAe(i)){if(typeof i.name!="string")throw new ht("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${r}`,"when column is an object literal"]);t[r]=i}else throw new ht("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(i)} at position ${r}`])}return t},B4=class{constructor(t=100){this.size=t,this.length=0,this.buf=Buffer.allocUnsafe(t)}prepend(t){if(Buffer.isBuffer(t)){let r=this.length+t.length;if(r>=this.size&&(this.resize(),r>=this.size))throw Error("INVALID_BUFFER_STATE");let n=this.buf;this.buf=Buffer.allocUnsafe(this.size),t.copy(this.buf,0),n.copy(this.buf,t.length),this.length+=t.length}else{let r=this.length++;r===this.size&&this.resize();let n=this.clone();this.buf[0]=t,n.copy(this.buf,1,0,r)}}append(t){let r=this.length++;r===this.size&&this.resize(),this.buf[r]=t}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let t=this.length;this.size=this.size*2;let r=Buffer.allocUnsafe(this.size);this.buf.copy(r,0,0,t),this.buf=r}toString(t){ret
`,o).length:d,c?(s===null?0:s.length)+l.length:0,c?l.length+d:0);return f<p},parse:function(n,i,a,o){let{bom:s,comment_no_infix:l,encoding:c,from_line:u,ltrim:d,max_record_size:f,raw:p,relax_quotes:m,rtrim:y,skip_empty_lines:_,to:S,to_line:E}=this.options,{comment:w,escape:v,quote:b,record_delimiter:A}=this.options,{bomSkipped:P,previousBuf:j,rawBuffer:T,escapeIsQuote:N}=this.state,k;if(j===void 0)if(n===void 0){o();return}else k=n;else j!==void 0&&n===void 0?k=j:k=Buffer.concat([j,n]);if(P===!1)if(s===!1)this.state.bomSkipped=!0;else if(k.length<3){if(i===!1){this.state.previousBuf=k;return}}else{for(let K in tm)if(tm[K].compare(k,0,tm[K].length)===0){let ae=tm[K].length;this.state.bufBytesStart+=ae,k=k.slice(ae),this.options=_J({...this.original_options,encoding:K}),{comment:w,escape:v,quote:b}=this.options;break}this.state.bomSkipped=!0}let B=k.length,$;for($=0;$<B&&!this.__needMoreData($,B,i);$++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),E!==-1&&this.info.lines>E){this.state.stop=!0,o();return}this.state.quoting===!1&&A.length===0&&this.__autoDiscoverRecordDelimiter(k,$)&&(A=this.options.record_delimiter);let K=k[$];if(p===!0&&T.append(K),(K===BAe||K===VAe)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(v!==null&&this.state.quoting===!0&&this.__isEscape(k,$,K)&&$+v.length<B)if(N){if(this.__isQuote(k,$+v.length)){this.state.escaping=!0,$+=v.length-1;continue}}else{this.state.escaping=!0,$+=v.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(k,$))if(this.state.quoting===!0){let re=k[$+b.length],ce=y&&this.__isCharTrimable(k,$+b.length),_e=w!==null&&this.__compareBytes(w,k,$+b.length,re),We=this.__isDelimiter(k,$+b.length,re),Me=A.length===0?this.__autoDiscoverRecordDelimiter(k,$+b.length):this.__isRecordDelimiter(re,k,$+b.length);if(v!==null&&this.__isEscape(k,$,K)&&this.__isQuote(k,$+v.length))$+=v.length-1;else if(!re||We||Me||_e||ce){this.state.quoting=!1,this.state.wasQuoting=!0,$+=b.length-1;continue}else if(m===!1){let Mo=this.__error(new ht("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(re)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(Mo!==void 0)return Mo}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(b),$+=b.length-1}else if(this.state.field.length!==0){if(m===!1){let re=this.__infoField(),ce=Object.keys(tm).map(We=>tm[We].equals(this.state.field.toString())?We:!1).filter(Boolean)[0],_e=this.__error(new ht("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(re.column)} at line ${re.lines}, value is ${JSON.stringify(this.state.field.toString(c))}`,ce?`(${ce} bom)`:void 0],this.options,re,{field:this.state.field}));if(_e!==void 0)return _e}}else{this.state.quoting=!0,$+=b.length-1;continue}if(this.state.quoting===!1){let re=this.__isRecordDelimiter(K,k,$);if(re!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=u){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),$+=re-1;continue}if(_===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,$+=re-1;continue}this.info.bytes=this.state.bufBytesStart+$;let We=this.__onField();if(We!==void 0)return We;this.info.bytes=this.state.bufBytesStart+$+re;let Me=this.__onRecord(a);if(Me!==void 0)return Me;if(S!==-1&&this.info.records>=S){this.state.stop=!0,o();return}}this.state.commenting=!1,$+=re-1;continue}if(this.state.commenting)continue;if(w!==null&&(l===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(w,k,$,K)!==0){this.state.commenting=!0;continue}let ce=this.__isDelimiter(k,$,K);if(ce!==0){this.info.bytes=this.state.bufBytesStart+$;le
`,a),Buffer.from(`
`,a),Buffer.from("\r",a)];e:for(let s=0;s<o.length;s++){let l=o[s].length;for(let c=0;c<l;c++)if(o[s][c]!==n[i+c])continue e;return this.options.record_delimiter.push(o[s]),this.state.recordDelimiterMaxLength=o[s].length,o[s].length}return 0},__error:function(n){let{encoding:i,raw:a,skip_records_with_error:o}=this.options,s=typeof n=="string"?new Error(n):n;if(o){this.state.recordHasError=!0,this.options.on_skip!==void 0&&this.options.on_skip(s,a?this.state.rawBuffer.toString(i):void 0);return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:n,raw:i,encoding:a}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:n===!0,index:this.state.record.length,raw:i?this.state.rawBuffer.toString(a):void 0}},__infoField:function(){let{columns:n}=this.options,i=Array.isArray(n);return{...this.__infoRecord(),column:i===!0?n.length>this.state.record.length?n[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}},ZAe=function(e,t={}){typeof e=="string"&&(e=Buffer.from(e));let r=t&&t.objname?{}:[],n=WAe(t),i=l=>{n.options.objname===void 0?r.push(l):r[l[0]]=l[1]},a=()=>{},o=n.parse(e,!1,i,a);if(o!==void 0)throw o;let s=n.parse(void 0,!0,i,a);if(s!==void 0)throw s;return r};nC.CsvError=ht;nC.parse=ZAe});var IJ=h(W4=>{"use strict";var HAe=require("stream"),mo=class e extends Error{constructor(t,r,...n){Array.isArray(r)&&(r=r.join(" ")),super(r),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,e),this.code=t;for(let i of n)for(let a in i){let o=i[a];this[a]=Buffer.isBuffer(o)?o.toString():o==null?o:JSON.parse(JSON.stringify(o))}}},xJ=function(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)},GAe=46,JAe=/\\(\\)?/g,KAe=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),XAe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,YAe=/^\w*$/,QAe=function(e){return Object.prototype.toString.call(e)},OJ=function(e){let t=typeof e;return t==="symbol"||t==="object"&&e&&QAe(e)==="[object Symbol]"},eDe=function(e,t){if(Array.isArray(e))return!1;let r=typeof e;return r==="number"||r==="symbol"||r==="boolean"||!e||OJ(e)?!0:YAe.test(e)||!XAe.test(e)||t!=null&&e in Object(t)},tDe=function(e){let t=[];return e.charCodeAt(0)===GAe&&t.push(""),e.replace(KAe,function(r,n,i,a){let o=r;i?o=a.replace(JAe,"$1"):n&&(o=n.trim()),t.push(o)}),t},rDe=function(e,t){return Array.isArray(e)?e:eDe(e,t)?[e]:tDe(e)},nDe=function(e){if(typeof e=="string"||OJ(e))return e;let t=`${e}`;return t=="0"&&1/e==-1/0?"-0":t},iDe=function(e,t){t=rDe(t,e);let r=0,n=t.length;for(;e!=null&&r<n;)e=e[nDe(t[r++])];return r&&r===n?e:void 0},CJ=function(e){if(e==null)return[void 0,void 0];if(typeof e!="object")return[Error('Invalid option "columns": expect an array or an object')];if(Array.isArray(e)){let t=[];for(let r of e)if(typeof r=="string")t.push({key:r,header:r});else if(typeof r=="object"&&r!==null&&!Array.isArray(r)){if(!r.key)return[Error('Invalid column definition: property "key" is required')];r.header===void 0&&(r.header=r.key),t.push(r)}else return[Error("Invalid column definition: expect a string or an object")];e=t}else{let t=[];for(let r in e)t.push({key:r,header:e[r]});e=t}return[void 0,e]},aDe=function(e){return e.replace(/([A-Z])/g,function(t,r){return"_"+r.toLowerCase()})},TJ=function(e){let t={};for(let i in e)t[aDe(i)]=e[i];if(t.bom===void 0||t.bom===null||t.bom===!1)t.bom=!1;else if(t.bom!==!0)return[new mo("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify(t.bom)}`])];if(t.delimiter===void 0||t.delimiter===null)t.delimiter=",";else if(Buffer.isBuffer(t.delimiter))t.delimiter=t.delimiter.toString();else if(typeof t.delimiter!="string")return[new mo("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify(t.delimiter)}`])];if(t.quote===void 0||t.quote===null)t.quote='"';else if(t.quote===!0)t.quote='"';else if(t.quote===!1)t.quote=""
`;else if(Buffer.isBuffer(t.record_delimiter))t.record_delimiter=t.record_delimiter.toString();else if(typeof t.record_delimiter!="string")return[Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(t.record_delimiter)}`)];switch(t.record_delimiter){case"unix":t.record_delimiter=`
`;break;case"mac":t.record_delimiter="\r";break;case"windows":t.record_delimiter=`\r
`;break;case"ascii":t.record_delimiter="";break;case"unicode":t.record_delimiter="\u2028";break}return[void 0,t]},oDe=Buffer.from([239,187,191]),sDe=function(e,t,r){return{options:e,state:t,info:r,__transform:function(n,i){if(!Array.isArray(n)&&typeof n!="object")return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(n)}`);if(this.info.records===0){if(Array.isArray(n)){if(this.options.header===!0&&this.options.columns===void 0)return Error("Undiscoverable Columns: header option requires column option or object records")}else if(this.options.columns===void 0){let[s,l]=CJ(Object.keys(n));if(s)return;this.options.columns=l}}if(this.info.records===0){this.bom(i);let s=this.headers(i);if(s)return s}try{this.options.on_record&&this.options.on_record(n,this.info.records)}catch(s){return s}let a,o;if(this.options.eof){if([a,o]=this.stringify(n),a)return a;if(o===void 0)return;o=o+this.options.record_delimiter}else{if([a,o]=this.stringify(n),a)return a;if(o===void 0)return;(this.options.header||this.info.records)&&(o=this.options.record_delimiter+o)}this.info.records++,i(o)},stringify:function(n,i=!1){if(typeof n!="object")return[void 0,n];let{columns:a}=this.options,o=[];if(Array.isArray(n)){a&&n.splice(a.length);for(let l=0;l<n.length;l++){let c=n[l],[u,d]=this.__cast(c,{index:l,column:l,records:this.info.records,header:i});if(u)return[u];o[l]=[d,c]}}else for(let l=0;l<a.length;l++){let c=iDe(n,a[l].key),[u,d]=this.__cast(c,{index:l,column:a[l].key,records:this.info.records,header:i});if(u)return[u];o[l]=[d,c]}let s="";for(let l=0;l<o.length;l++){let c,u,[d,f]=o[l];if(typeof d=="string")c=this.options;else if(xJ(d)){if(c=d,d=c.value,delete c.value,typeof d!="string"&&d!==void 0&&d!==null&&u)return[Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(d)}`)];if(c={...this.options,...c},[u,c]=TJ(c),u!==void 0)return[u]}else if(d==null)c=this.options;else return[Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(d)}`)];let{delimiter:p,escape:m,quote:y,quoted:_,quoted_empty:S,quoted_string:E,quoted_match:w,record_delimiter:v,escape_formulas:b}=c;if(d===""&&f===""){let A=w&&w.filter(j=>typeof j=="string"?d.indexOf(j)!==-1:j.test(d));A=A&&A.length>0,(A||S===!0||E===!0&&S!==!1)===!0&&(d=y+d+y),s+=d}else if(d){if(typeof d!="string")return[Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(d)}`)];let A=p.length&&d.indexOf(p)>=0,P=y!==""&&d.indexOf(y)>=0,j=d.indexOf(m)>=0&&m!==y,T=d.indexOf(v)>=0,N=E&&typeof f=="string",k=w&&w.filter($=>typeof $=="string"?d.indexOf($)!==-1:$.test(d));if(k=k&&k.length>0,b)switch(d[0]){case"=":case"+":case"-":case"@":case" ":case"\r":case"\uFF1D":case"\uFF0B":case"\uFF0D":case"\uFF20":d=`'${d}`;break}let B=P===!0||A||T||_||N||k;if(B===!0&&j===!0){let $=m==="\\"?new RegExp(m+m,"g"):new RegExp(m,"g");d=d.replace($,m+m)}if(P===!0){let $=new RegExp(y,"g");d=d.replace($,m+y)}B===!0&&(d=y+d+y),s+=d}else(S===!0||f===""&&E===!0&&S!==!1)&&(s+=y+y);l!==o.length-1&&(s+=p)}return[void 0,s]},bom:function(n){this.options.bom===!0&&n(oDe)},headers:function(n){if(this.options.header===!1||this.options.columns===void 0)return;let i,a=this.options.columns.map(o=>o.header);if(this.options.eof?([i,a]=this.stringify(a,!0),a+=this.options.record_delimiter):[i,a]=this.stringify(a),i)return i;this.options.header_as_comment&&(a=this.options.header_as_comment+" "+a),n(a)},__cast:function(n,i){let a=typeof n;try{return a==="string"?[void 0,this.options.cast.string(n,i)]:a==="bigint"?[void 0,this.options.cast.bigint(n,i)]:a==="number"?[void 0,this.options.cast.number(n,i)]:a==="boolean"?[void 0,this.options.cast.boolean(n,i)]:n instanceof Date?[void 0,this.options.cast.date(n,i)]:a==="object"&&n!==null?[void 0,this.options.cast.object(n,i)]:n===null&&this.options.cast.null!==void 0?[void 0,this.options.cast.null(n,i)]:n===void 0&&this.options.cast.undefined!==void 0?[void 0,this.options.cast.undefined(n,i)]:[void 0,n]}catch(o){return[o]}}}},V4=class extends HAe
`;else if(Buffer.isBuffer(t.record_delimiter))t.record_delimiter=t.record_delimiter.toString();else if(typeof t.record_delimiter!="string")return[Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(t.record_delimiter)}`)];switch(t.record_delimiter){case"unix":t.record_delimiter=`
`;break;case"mac":t.record_delimiter="\r";break;case"windows":t.record_delimiter=`\r
`;break;case"ascii":t.record_delimiter="";break;case"unicode":t.record_delimiter="\u2028";break}return[void 0,t]},wDe=Buffer.from([239,187,191]),SDe=function(e,t,r){return{options:e,state:t,info:r,__transform:function(n,i){if(!Array.isArray(n)&&typeof n!="object")return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(n)}`);if(this.info.records===0){if(Array.isArray(n)){if(this.options.header===!0&&this.options.columns===void 0)return Error("Undiscoverable Columns: header option requires column option or object records")}else if(this.options.columns===void 0){let[s,l]=DJ(Object.keys(n));if(s)return;this.options.columns=l}}if(this.info.records===0){this.bom(i);let s=this.headers(i);if(s)return s}try{this.options.on_record&&this.options.on_record(n,this.info.records)}catch(s){return s}let a,o;if(this.options.eof){if([a,o]=this.stringify(n),a)return a;if(o===void 0)return;o=o+this.options.record_delimiter}else{if([a,o]=this.stringify(n),a)return a;if(o===void 0)return;(this.options.header||this.info.records)&&(o=this.options.record_delimiter+o)}this.info.records++,i(o)},stringify:function(n,i=!1){if(typeof n!="object")return[void 0,n];let{columns:a}=this.options,o=[];if(Array.isArray(n)){a&&n.splice(a.length);for(let l=0;l<n.length;l++){let c=n[l],[u,d]=this.__cast(c,{index:l,column:l,records:this.info.records,header:i});if(u)return[u];o[l]=[d,c]}}else for(let l=0;l<a.length;l++){let c=bDe(n,a[l].key),[u,d]=this.__cast(c,{index:l,column:a[l].key,records:this.info.records,header:i});if(u)return[u];o[l]=[d,c]}let s="";for(let l=0;l<o.length;l++){let c,u,[d,f]=o[l];if(typeof d=="string")c=this.options;else if(vDe(d)){if(c=d,d=c.value,delete c.value,typeof d!="string"&&d!==void 0&&d!==null&&u)return[Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(d)}`)];if(c={...this.options,...c},[u,c]=LJ(c),u!==void 0)return[u]}else if(d==null)c=this.options;else return[Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(d)}`)];let{delimiter:p,escape:m,quote:y,quoted:_,quoted_empty:S,quoted_string:E,quoted_match:w,record_delimiter:v,escape_formulas:b}=c;if(d===""&&f===""){let A=w&&w.filter(j=>typeof j=="string"?d.indexOf(j)!==-1:j.test(d));A=A&&A.length>0,(A||S===!0||E===!0&&S!==!1)===!0&&(d=y+d+y),s+=d}else if(d){if(typeof d!="string")return[Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(d)}`)];let A=p.length&&d.indexOf(p)>=0,P=y!==""&&d.indexOf(y)>=0,j=d.indexOf(m)>=0&&m!==y,T=d.indexOf(v)>=0,N=E&&typeof f=="string",k=w&&w.filter($=>typeof $=="string"?d.indexOf($)!==-1:$.test(d));if(k=k&&k.length>0,b)switch(d[0]){case"=":case"+":case"-":case"@":case" ":case"\r":case"\uFF1D":case"\uFF0B":case"\uFF0D":case"\uFF20":d=`'${d}`;break}let B=P===!0||A||T||_||N||k;if(B===!0&&j===!0){let $=m==="\\"?new RegExp(m+m,"g"):new RegExp(m,"g");d=d.replace($,m+m)}if(P===!0){let $=new RegExp(y,"g");d=d.replace($,m+y)}B===!0&&(d=y+d+y),s+=d}else(S===!0||f===""&&E===!0&&S!==!1)&&(s+=y+y);l!==o.length-1&&(s+=p)}return[void 0,s]},bom:function(n){this.options.bom===!0&&n(wDe)},headers:function(n){if(this.options.header===!1||this.options.columns===void 0)return;let i,a=this.options.columns.map(o=>o.header);if(this.options.eof?([i,a]=this.stringify(a,!0),a+=this.options.record_delimiter):[i,a]=this.stringify(a),i)return i;this.options.header_as_comment&&(a=this.options.header_as_comment+" "+a),n(a)},__cast:function(n,i){let a=typeof n;try{return a==="string"?[void 0,this.options.cast.string(n,i)]:a==="bigint"?[void 0,this.options.cast.bigint(n,i)]:a==="number"?[void 0,this.options.cast.number(n,i)]:a==="boolean"?[void 0,this.options.cast.boolean(n,i)]:n instanceof Date?[void 0,this.options.cast.date(n,i)]:a==="object"&&n!==null?[void 0,this.options.cast.object(n,i)]:n===null&&this.options.cast.null!==void 0?[void 0,this.options.cast.null(n,i)]:n===void 0&&this.options.cast.undefined!==void 0?[void 0,this.options.cast.undefined(n,i)]:[void 0,n]}catch(o){return[o]}}}},EDe=function(e,t={}
Check that the org exists and can be reached.
HTTP status code: ${t.statusCode}.
REST API Status Codes and Error Responses:
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/errorcodes.htm
See \`error.data\` for the full html response.`,n.errorCode,n.message)):n instanceof Vd?n:new Vd(n.message,n.errorCode,n)}};Vl.HttpApi=Z4;var Vd=class extends Error{data;errorCode;constructor(t,r,n){super(t),this.name=r||this.name,this.errorCode=this.name,this.data=n}get content(){return this.data}};Vl.default=Z4;Vl.isBrowser="window"in globalThis||"self"in globalThis});var PJ=h(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.SessionRefreshDelegate=void 0;var ZDe=po(),H4=class e{static _logger=(0,ZDe.getLogger)("session-refresh-delegate");_refreshFn;_conn;_logger;_lastRefreshedAt=void 0;_refreshPromise=void 0;constructor(t,r){this._conn=t,this._logger=t._logLevel?e._logger.createInstance(t._logLevel):e._logger,this._refreshFn=r}async refresh(t){if(!(this._lastRefreshedAt&&this._lastRefreshedAt>t)){if(this._refreshPromise){await this._refreshPromise;return}try{this._logger.info("<refresh token>"),this._refreshPromise=new Promise((r,n)=>{this._refreshFn(this._conn,(i,a,o)=>{i?n(i):(this._logger.debug("Connection refresh completed."),this._conn.accessToken=a,this._conn.emit("refresh",a,o),r())})}),await this._refreshPromise,this._logger.info("<refresh complete>")}catch(r){throw new Error(`Unable to refresh session due to: ${r.message}`)}finally{this._refreshPromise=void 0,this._lastRefreshedAt=Date.now()}}}isRefreshing(){return!!this._refreshPromise}async waitRefresh(){return this._refreshPromise}};xg.SessionRefreshDelegate=H4;xg.default=H4});var Og=h(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.Parsable=Wl.Serializable=Wl.RecordStream=void 0;var im=require("stream"),jJ=iC(),HDe=Gf();function GDe(e,t){if(typeof e=="string"){let r=/^\$\{(\w+)\}$/.exec(e);return r?t[r[1]]:e.replace(/\$\{(\w+)\}/g,(n,i)=>{let a=t[i];return typeof a>"u"||a===null?"":String(a)})}return e}function MJ(e,t={}){return Object.keys(e).reduce((r,n)=>{let i=r[n],a;if(n==="attributes")return a={...r},delete a[n],a;if(t.nullValue&&i===null)return{...r,[n]:t.nullValue};if(i!==null&&typeof i=="object"){let o=MJ(i,t);return Object.keys(o).reduce((s,l)=>(s[`${n}.${l}`]=o[l],s),{...r})}return r},e)}function JDe(e,t){return e.pipe(t),(0,HDe.concatStreamsAsDuplex)(e,t,{writableObjectMode:!0})}var KDe={serialize(e={}){let{nullValue:t,...r}=e;return JDe(Wd.map(n=>MJ(n,e)),(0,jJ.serializeCSVStream)(r))},parse(e={}){return(0,jJ.parseCSVStream)(e)}},RJ={csv:KDe},Wd=class e extends im.PassThrough{constructor(){super({objectMode:!0})}map(t){return this.pipe(e.map(t))}filter(t){return this.pipe(e.filter(t))}on(t,r){return super.on(t==="record"?"data":t,r)}addListener=this.on;static map(t){let r=new im.Transform({objectMode:!0,transform(n,i,a){let o=t(n)||n;r.push(o),a()}});return r}static recordMapStream(t,r){return e.map(n=>{let i={Id:n.Id};for(let a of Object.keys(t))i[a]=r?t[a]:GDe(t[a],n);return i})}static filter(t){let r=new im.Transform({objectMode:!0,transform(n,i,a){t(n)&&r.push(n),a()}});return r}};Wl.RecordStream=Wd;var oC=class extends Wd{_dataStreams={};stream(t="csv",r={}){if(this._dataStreams[t])return this._dataStreams[t];let n=RJ[t];if(!n)throw new Error(`Converting [${t}] data stream is not supported.`);let i=new im.PassThrough;return this.pipe(n.serialize(r)).pipe(i),this._dataStreams[t]=i,i}};Wl.Serializable=oC;var sC=class extends Wd{_dataStreams={};_execParse=!1;_incomings=[];stream(t="csv",r={}){if(this._dataStreams[t])return this._dataStreams[t];let n=RJ[t];if(!n)throw new Error(`Converting [${t}] data stream is not supported.`);let i=new im.PassThrough,a=n.parse(r);return a.on("error",o=>this.emit("error",o)),a.pipe(this).pipe(new im.PassThrough({objectMode:!0,highWaterMark:500*1e3})),this._execParse?i.pipe(a):this._incomings.push([i,a]),this._dataStreams[t]=i,i}on(t,r){if((t==="readable"||t==="record")&&!this._execParse){this._execParse=!0;for(let[n,i]of this._incomings)n.pipe(i)}return super.on(t,r)}addListener=this.on};Wl.Parsable=sC;Wl.default=Wd});var lC=h(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.formatDate=om.zeroPad=void 0;function am(e,t=2){let r="";for(let n=
<?xml version="1.0" encoding="UTF-8"?>
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<operation>${n}</operation>
<object>${this.type}</object>
${r.extIdField?`<externalIdFieldName>${r.extIdField}</externalIdFieldName>`:""}
${r.concurrencyMode?`<concurrencyMode>${r.concurrencyMode}</concurrencyMode>`:""}
${r.assignmentRuleId?`<assignmentRuleId>${r.assignmentRuleId}</assignmentRuleId>`:""}
<contentType>CSV</contentType>
</jobInfo>
`.trim();this._jobInfo=(async()=>{try{let a=await t._request({method:"POST",path:"/job",body:i,headers:{"Content-Type":"application/xml; charset=utf-8"},responseType:"application/xml"});return this.emit("open",a.jobInfo),this.id=a.jobInfo.id,this.state=a.jobInfo.state,a.jobInfo}catch(a){throw this.emit("error",a),a}})()}return this._jobInfo}createBatch(){let t=new Jg(this);return t.on("queue",()=>{this._batches[t.id]=t}),t}batch(t){let r=this._batches[t];return r||(r=new Jg(this,t),this._batches[t]=r),r}check(){let t=this._bulk,r=t._logger;return this._jobInfo=(async()=>{let n=await this.ready(),i=await t._request({method:"GET",path:"/job/"+n,responseType:"application/xml"});return r.debug(i.jobInfo),this.id=i.jobInfo.id,this.type=i.jobInfo.object,this.operation=i.jobInfo.operation,this.state=i.jobInfo.state,i.jobInfo})(),this._jobInfo}ready(){return this.id?Promise.resolve(this.id):this.open().then(({id:t})=>t)}async list(){let t=this._bulk,r=t._logger,n=await this.ready(),i=await t._request({method:"GET",path:"/job/"+n+"/batch",responseType:"application/xml"});return r.debug(i.batchInfoList.batchInfo),Array.isArray(i.batchInfoList.batchInfo)?i.batchInfoList.batchInfo:[i.batchInfoList.batchInfo]}async close(){if(this.id)try{let t=await this._changeState("Closed");return this.id=null,this.emit("close",t),t}catch(t){throw this.emit("error",t),t}}async abort(){if(this.id)try{let t=await this._changeState("Aborted");return this.id=null,this.emit("abort",t),t}catch(t){throw this.emit("error",t),t}}async _changeState(t){let r=this._bulk,n=r._logger;return this._jobInfo=(async()=>{let i=await this.ready(),a=`
<?xml version="1.0" encoding="UTF-8"?>
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<state>${t}</state>
</jobInfo>
`.trim(),o=await r._request({method:"POST",path:"/job/"+i,body:a,headers:{"Content-Type":"application/xml; charset=utf-8"},responseType:"application/xml"});return n.debug(o.jobInfo),this.state=o.jobInfo.state,o.jobInfo})(),this._jobInfo}};yo.Job=Gg;var Iw=class extends Error{jobId;batchId;constructor(t,r,n){super(t),this.name="PollingTimeout",this.jobId=r,this.batchId=n}},Jg=class extends vPe.Writable{job;id;_bulk;_uploadStream;_downloadStream;_dataStream;_result;_error;constructor(t,r){super({objectMode:!0}),this.job=t,this.id=r,this._bulk=t._bulk,this.on("error",l=>this._error=l);let n={nullValue:"#N/A"},i=this._uploadStream=new Tw.Serializable,a=i.stream("csv",n),s=(this._downloadStream=new Tw.Parsable).stream("csv",n);this.on("finish",()=>i.end()),a.once("readable",async()=>{try{await this.job.ready(),a.pipe(this._createRequestStream())}catch(l){this.emit("error",l)}}),this._dataStream=(0,EPe.concatStreamsAsDuplex)(a,s)}_createRequestStream(){let t=this._bulk,r=t._logger,n=t._request({method:"POST",path:"/job/"+this.job.id+"/batch",headers:{"Content-Type":"text/csv"},responseType:"application/xml"});return(async()=>{try{let i=await n;r.debug(i.batchInfo),this.id=i.batchInfo.id,this.emit("queue",i.batchInfo)}catch(i){this.emit("error",i)}})(),n.stream()}_write(t,r,n){let{Id:i,type:a,attributes:o,...s}=t,l;switch(this.job.operation){case"insert":l=s;break;case"delete":case"hardDelete":l={Id:i};break;default:l={Id:i,...s}}this._uploadStream.write(l,r,n)}stream(){return this._dataStream}execute(t){if(this._result)throw new Error("Batch already executed.");if(this._result=new Promise((r,n)=>{this.once("response",r),this.once("error",n)}),yX.default.nodeStream(t))t.pipe(this._dataStream);else{let r=structuredClone(t);if(Array.isArray(r)){for(let n of r){for(let i of Object.keys(n))typeof n[i]=="boolean"&&(n[i]=String(n[i]));this.write(n)}this.end()}else typeof r=="string"&&(this._dataStream.write(r,"utf8"),this._dataStream.end())}return this}run=this.execute;exec=this.execute;then(t,r){return this._result||this.execute(),this._result.then(t,r)}async check(){let t=this._bulk,r=t._logger,n=this.job.id,i=this.id;if(!n||!i)throw new Error("Batch not started.");let a=await t._request({method:"GET",path:"/job/"+n+"/batch/"+i,responseType:"application/xml"});return r.debug(a.batchInfo),a.batchInfo}poll(t,r){let n=this.job.id,i=this.id;if(!n||!i)throw new Error("Batch not started.");let o=new Date().getTime()+r;if(r===0)throw new Iw(`Skipping polling because of timeout = 0ms. Job Id = ${n} | Batch Id = ${i}`,n,i);let s=async()=>{let l=new Date().getTime();if(o<l){let u=new Iw("Polling time out. Job Id = "+n+" , batch Id = "+i,n,i);this.emit("error",u);return}let c;try{c=await this.check()}catch(u){this.emit("error",u);return}c.state==="Failed"?parseInt(c.numberRecordsProcessed,10)>0?this.retrieve():this.emit("error",new Error(c.stateMessage)):c.state==="Completed"?this.retrieve():c.state==="NotProcessed"?this.emit("error",new Error("Job has been aborted")):(this.emit("inProgress",c),setTimeout(s,t))};setTimeout(s,t)}async retrieve(){let t=this._bulk,r=this.job.id,n=this.job,i=this.id;if(!r||!i)throw new Error("Batch not started.");try{let a=await t._request({method:"GET",path:"/job/"+r+"/batch/"+i+"/result"}),o;if(n.operation==="query"||n.operation==="queryAll"){let l=a["result-list"].result;o=(Array.isArray(l)?l:[l]).map(c=>({id:c,batchId:i,jobId:r}))}else o=a.map(l=>({id:l.Id||null,success:l.Success==="true",created:l.Created==="true",errors:l.Error?[l.Error]:[]}));return this.emit("response",o),o}catch(a){throw this.emit("error",a),a}}result(t){let r=this.job.id,n=this.id;if(!r||!n)throw new Error("Batch not started.");let i=new Tw.Parsable,a=i.stream("csv");return this._bulk._request({method:"GET",path:"/job/"+r+"/batch/"+n+"/result/"+t,responseType:"application/octet-stream"}).stream().pipe(a),i}};yo.Batch=Jg;var rT=class extends wPe.default{beforeSend(t){t.headers={...t.headers,"X-SFDC-SESSION":this._conn.accessToken??""}}isSessionExpired(t){return t.statusCode===400&&t.body.includes("<exceptionCode>InvalidSessionId</
\\[?(?:
(?:[a-fA-F\\d]{1,4}:){7}(?:[a-fA-F\\d]{1,4}|:)|
(?:[a-fA-F\\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|:[a-fA-F\\d]{1,4}|:)|
(?:[a-fA-F\\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,2}|:)|
(?:[a-fA-F\\d]{1,4}:){4}(?:(?::[a-fA-F\\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,3}|:)|
(?:[a-fA-F\\d]{1,4}:){3}(?:(?::[a-fA-F\\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,4}|:)|
(?:[a-fA-F\\d]{1,4}:){2}(?:(?::[a-fA-F\\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,5}|:)|
(?:[a-fA-F\\d]{1,4}:){1}(?:(?::[a-fA-F\\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,6}|:)|
(?::(?:(?::[a-fA-F\\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,7}|:))
)(?:%[0-9a-zA-Z]{1,})?\\]?
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),kT=new RegExp(`^${Kje}$`),Xje="(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])",Yje=new RegExp(`^${Xje}$`);function IY(e){return new URL(`http://${e}`).hostname}function ip(e){if(e==null)return;let t=e.trim().replace(/^\./,"");return kT.test(t)?(t.startsWith("[")||(t="["+t),t.endsWith("]")||(t=t+"]"),IY(t).slice(1,-1)):/[^\u0001-\u007f]/.test(t)?IY(t):t.toLowerCase()}function qY(e){return e.toUTCString()}function Jw(e){if(!e)return;let t={foundTime:void 0,foundDayOfMonth:void 0,foundMonth:void 0,foundYear:void 0},r=e.split(eMe).filter(i=>i.length>0);for(let i of r){if(t.foundTime===void 0){let[,a,o,s]=tMe.exec(i)||[];if(a!=null&&o!=null&&s!=null){let l=parseInt(a,10),c=parseInt(o,10),u=parseInt(s,10);if(!isNaN(l)&&!isNaN(c)&&!isNaN(u)){t.foundTime={hours:l,minutes:c,seconds:u};continue}}}if(t.foundDayOfMonth===void 0&&rMe.test(i)){let a=parseInt(i,10);if(!isNaN(a)){t.foundDayOfMonth=a;continue}}if(t.foundMonth===void 0&&nMe.test(i)){let a=Qje.indexOf(i.substring(0,3).toLowerCase());if(a>=0&&a<=11){t.foundMonth=a;continue}}if(t.foundYear===void 0&&iMe.test(i)){let a=parseInt(i,10);if(!isNaN(a)){t.foundYear=a;continue}}}if(t.foundYear!==void 0&&t.foundYear>=70&&t.foundYear<=99&&(t.foundYear+=1900),t.foundYear!==void 0&&t.foundYear>=0&&t.foundYear<=69&&(t.foundYear+=2e3),t.foundDayOfMonth===void 0||t.foundMonth===void 0||t.foundYear===void 0||t.foundTime===void 0||t.foundDayOfMonth<1||t.foundDayOfMonth>31||t.foundYear<1601||t.foundTime.hours>23||t.foundTime.minutes>59||t.foundTime.seconds>59)return;let n=new Date(Date.UTC(t.foundYear,t.foundMonth,t.foundDayOfMonth,t.foundTime.hours,t.foundTime.minutes,t.foundTime.seconds));if(!(n.getUTCFullYear()!==t.foundYear||n.getUTCMonth()!==t.foundMonth||n.getUTCDate()!==t.foundDayOfMonth))return n}var Qje=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],eMe=/[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/,tMe=/^(\d{1,2}):(\d{1,2}):(\d{1,2})(?:[\x00-\x2F\x3A-\xFF][\x00-\xFF]*)?$/,rMe=/^[0-9]{1,2}(?:[\x00-\x2F\x3A-\xFF][\x00-\xFF]*)?$/,nMe=/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[\x00-\xFF]*$/i,iMe=/^[\x30-\x39]{2,4}(?:[\x00-\x2F\x3A-\xFF][\x00-\xFF]*)?$/,aMe=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/,oMe=/[\x20-\x3A\x3C-\x7E]+/,AY=/[\x00-\x1F]/,DY=[`
`,"\r","\0"];function sMe(e){if(DT(e))return e;for(let t=0;t<DY.length;t++){let r=DY[t],n=r?e.indexOf(r):-1;n!==-1&&(e=e.slice(0,n))}return e}function lMe(e,t){e=sMe(e);let r=e.indexOf("=");if(t)r===0&&(e=e.substring(1),r=e.indexOf("="));else if(r<=0)return;let n,i;if(r<=0?(n="",i=e.trim()):(n=e.slice(0,r).trim(),i=e.slice(r+1).trim()),AY.test(n)||AY.test(i))return;let a=new Bn;return a.key=n,a.value=i,a}function cMe(e,t){if(DT(e)||!UY(e))return;e=e.trim();let r=e.indexOf(";"),n=r===-1?e:e.slice(0,r),i=lMe(n,t?.loose??!1);if(!i)return;if(r===-1)return i;let a=e.slice(r+1).trim();if(a.length===0)return i;let o=a.split(";");for(;o.length;){let s=(o.shift()??"").trim();if(s.length===0)continue;let l=s.indexOf("="),c,u;switch(l===-1?(c=s,u=null):(c=s.slice(0,l),u=s.slice(l+1)),c=c.trim().toLowerCase(),u&&(u=u.trim()),c){case"expires":if(u){let d=Jw(u);d&&(i.expires=d)}break;case"max-age":if(u&&/^-?[0-9]+$/.test(u)){let d=parseInt(u,10);i.setMaxAge(d)}break;case"domain":if(u){let d=u.trim().replace(/^\./,"");d&&(i.domain=d.toLowerCase())}break;case"path":i.path=u&&u[0]==="/"?u:null;break;case"secure":i.secure=!0;break;case"httponly":i.httpOnly=!0;break;case"samesite":switch(u?u.toLowerCase():""){case"strict":i.sameSite="strict";break;case"lax":i.sameSite="lax";break;case"none":i.sameSite="none";break;default:i.sameSite=void 0;break}break;default:i.extensions=i.extensions||[],i.extensions.push(s);break}}return i}function LY(e){if(!e||DT(e))return;let t;if(typeof e=="string")try{t=JSON.parse(e)}catch{return}else t=e;let r=new Bn;return Bn.serializableProperties.forEach(n=>{if(t&&typeof t=="object"&&f0(n,t)){let i=t[n];if(i===void 0||f0(n,ln)&&i===ln[n])return;switch(n){case"key":case"value":case"sameSite":typeof i=="string"&&(r[n]=i);break;case"expires":case"creation":case"lastAccessed":typeof i=="number"||typeof i=="string"||i instanceof Date?r[n]=t[n]=="Infinity"?"Infinity":new Date(i):i===null&&(r[n]=null);break;case"maxAge":(typeof i=="number"||i==="Infinity"||i==="-Infinity")&&(r[n]=i);break;case"domain":case"path":(typeof i=="string"||i===null)&&(r[n]=i);break;case"secure":case"httpOnly":typeof i=="boolean"&&(r[n]=i);break;case"extensions":Array.isArray(i)&&i.every(a=>typeof a=="string")&&(r[n]=i);break;case"hostOnly":case"pathIsDefault":(typeof i=="boolean"||i===null)&&(r[n]=i);break}}}),r}var ln={key:"",value:"",expires:"Infinity",maxAge:null,domain:null,path:null,secure:!1,httpOnly:!1,extensions:null,hostOnly:null,pathIsDefault:null,creation:null,lastAccessed:null,sameSite:void 0},m0=class vu{constructor(t={}){this.key=t.key??ln.key,this.value=t.value??ln.value,this.expires=t.expires??ln.expires,this.maxAge=t.maxAge??ln.maxAge,this.domain=t.domain??ln.domain,this.path=t.path??ln.path,this.secure=t.secure??ln.secure,this.httpOnly=t.httpOnly??ln.httpOnly,this.extensions=t.extensions??ln.extensions,this.creation=t.creation??ln.creation,this.hostOnly=t.hostOnly??ln.hostOnly,this.pathIsDefault=t.pathIsDefault??ln.pathIsDefault,this.lastAccessed=t.lastAccessed??ln.lastAccessed,this.sameSite=t.sameSite??ln.sameSite,this.creation=t.creation??new Date,Object.defineProperty(this,"creationIndex",{configurable:!1,enumerable:!1,writable:!0,value:++vu.cookiesCreated}),this.creationIndex=vu.cookiesCreated}[Symbol.for("nodejs.util.inspect.custom")](){let t=Date.now(),r=this.hostOnly!=null?this.hostOnly.toString():"?",n=this.creation&&this.creation!=="Infinity"?`${String(t-this.creation.getTime())}ms`:"?",i=this.lastAccessed&&this.lastAccessed!=="Infinity"?`${String(t-this.lastAccessed.getTime())}ms`:"?";return`Cookie="${this.toString()}; hostOnly=${r}; aAge=${i}; cAge=${n}"`}toJSON(){let t={};for(let r of vu.serializableProperties){let n=this[r];if(n!==ln[r])switch(r){case"key":case"value":case"sameSite":typeof n=="string"&&(t[r]=n);break;case"expires":case"creation":case"lastAccessed":typeof n=="number"||typeof n=="string"||n instanceof Date?t[r]=n=="Infinity"?"Infinity":new Date(n).toISOString():n===null&&(t[r]=null);break;case"maxAge":(typeof n=="number"||n==="Infinity"||n==="-Infinity")&&(t[r]=n);break;case"domain":case"path":(ty
`))}};Dm.prototype.toString=function(){return this._lines.join("")};Dm.prototype._strip=function(e){return e.toString().replace(/^ */,"").replace(/ *$/,"")};AQ.exports=Dm});var LQ=h((_6t,DQ)=>{"use strict";var a6=Zr().Buffer,o6=function(){this._queue=[],this._queueSize=0,this._offset=0};o6.prototype.put=function(e){!e||e.length===0||(a6.isBuffer(e)||(e=a6.from(e)),this._queue.push(e),this._queueSize+=e.length)};o6.prototype.read=function(e){if(e>this._queueSize)return null;if(e===0)return a6.alloc(0);this._queueSize-=e;var t=this._queue,r=e,n=t[0],i,a;if(n.length>=e)return n.length===e?t.shift():(a=n.slice(0,e),t[0]=n.slice(e),a);for(var o=0,s=t.length;o<s&&!(r<t[o].length);o++)r-=t[o].length;return i=t.splice(0,o),r>0&&t.length>0&&(i.push(t[0].slice(0,r)),t[0]=t[0].slice(r)),a6.concat(i,e)};o6.prototype.eachByte=function(e,t){for(var r,n,i;this._queue.length>0;){for(r=this._queue[0],n=r.length;this._offset<n;)i=this._offset,this._offset+=1,e.call(t,r[i]);this._offset=0,this._queue.shift()}};DQ.exports=o6});var wu=h((w6t,RQ)=>{"use strict";var kQ=Zr().Buffer,jQ=require("events").EventEmitter,bRe=require("util"),NQ=IQ(),MQ=i6(),vRe=LQ(),Wn=function(e,t,r){jQ.call(this),Wn.validateOptions(r||{},["maxLength","masking","requireMasking","protocols"]),this._request=e,this._reader=new vRe,this._options=r||{},this._maxLength=this._options.maxLength||this.MAX_LENGTH,this._headers=new MQ,this.__queue=[],this.readyState=0,this.url=t,this.io=new NQ.IO(this),this.messages=new NQ.Messages(this),this._bindEventListeners()};bRe.inherits(Wn,jQ);Wn.isWebSocket=function(e){var t=e.headers.connection||"",r=e.headers.upgrade||"";return e.method==="GET"&&t.toLowerCase().split(/ *, */).indexOf("upgrade")>=0&&r.toLowerCase()==="websocket"};Wn.validateOptions=function(e,t){for(var r in e)if(t.indexOf(r)<0)throw new Error("Unrecognized option: "+r)};var PQ={MAX_LENGTH:67108863,STATES:["connecting","open","closing","closed"],_bindEventListeners:function(){var e=this;this.messages.on("error",function(){}),this.on("message",function(t){var r=e.messages;r.readable&&r.emit("data",t.data)}),this.on("error",function(t){var r=e.messages;r.readable&&r.emit("error",t)}),this.on("close",function(){var t=e.messages;t.readable&&(t.readable=t.writable=!1,t.emit("end"))})},getState:function(){return this.STATES[this.readyState]||null},addExtension:function(e){return!1},setHeader:function(e,t){return this.readyState>0?!1:(this._headers.set(e,t),!0)},start:function(){if(this.readyState!==0)return!1;if(!Wn.isWebSocket(this._request))return this._failHandshake(new Error("Not a WebSocket request"));var e;try{e=this._handshakeResponse()}catch(t){return this._failHandshake(t)}return this._write(e),this._stage!==-1&&this._open(),!0},_failHandshake:function(e){var t=new MQ;return t.set("Content-Type","text/plain"),t.set("Content-Length",kQ.byteLength(e.message,"utf8")),t=["HTTP/1.1 400 Bad Request",t.toString(),e.message],this._write(kQ.from(t.join(`\r
`),"utf8")),this._fail("protocol_error",e.message),!1},text:function(e){return this.frame(e)},binary:function(e){return!1},ping:function(){return!1},pong:function(){return!1},close:function(e,t){return this.readyState!==1?!1:(this.readyState=3,this.emit("close",new Wn.CloseEvent(null,null)),!0)},_open:function(){this.readyState=1,this.__queue.forEach(function(e){this.frame.apply(this,e)},this),this.__queue=[],this.emit("open",new Wn.OpenEvent)},_queue:function(e){return this.__queue.push(e),!0},_write:function(e){var t=this.io;t.readable&&t.emit("data",e)},_fail:function(e,t){this.readyState=2,this.emit("error",new Error(t)),this.close()}};for(HT in PQ)Wn.prototype[HT]=PQ[HT];var HT;Wn.ConnectEvent=function(){};Wn.OpenEvent=function(){};Wn.CloseEvent=function(e,t){this.code=e,this.reason=t};Wn.MessageEvent=function(e){this.data=e};Wn.PingEvent=function(e){this.data=e};Wn.PongEvent=function(e){this.data=e};RQ.exports=Wn});var qQ=h(KT=>{KT.HTTPParser=Te;function Te(e){if(e!==void 0&&e!==Te.REQUEST&&e!==Te.RESPONSE)throw new Error("type must be REQUEST or RESPONSE");e===void 0||this.initialize(e),this.maxHeaderSize=Te.maxHeaderSize}Te.prototype.initialize=function(e,t){if(e!==Te.REQUEST&&e!==Te.RESPONSE)throw new Error("type must be REQUEST or RESPONSE");this.type=e,this.state=e+"_LINE",this.info={headers:[],upgrade:!1},this.trailers=[],this.line="",this.isChunked=!1,this.connection="",this.headerSize=0,this.body_bytes=null,this.isUserCall=!1,this.hadError=!1};Te.encoding="ascii";Te.maxHeaderSize=80*1024;Te.REQUEST="REQUEST";Te.RESPONSE="RESPONSE";var FQ=Te.kOnHeaders=1,GT=Te.kOnHeadersComplete=2,s6=Te.kOnBody=3,JT=Te.kOnMessageComplete=4;Te.prototype[FQ]=Te.prototype[GT]=Te.prototype[s6]=Te.prototype[JT]=function(){};var $Q=!0;Object.defineProperty(Te,"kOnExecute",{get:function(){return $Q=!1,99}});var UQ=KT.methods=Te.methods=["DELETE","GET","HEAD","POST","PUT","CONNECT","OPTIONS","TRACE","COPY","LOCK","MKCOL","MOVE","PROPFIND","PROPPATCH","SEARCH","UNLOCK","BIND","REBIND","UNBIND","ACL","REPORT","MKACTIVITY","CHECKOUT","MERGE","M-SEARCH","NOTIFY","SUBSCRIBE","UNSUBSCRIBE","PATCH","PURGE","MKCALENDAR","LINK","UNLINK","SOURCE"],zQ=UQ.indexOf("CONNECT");Te.prototype.reinitialize=Te;Te.prototype.close=Te.prototype.pause=Te.prototype.resume=Te.prototype.remove=Te.prototype.free=function(){};Te.prototype._compatMode0_11=!1;Te.prototype.getAsyncId=function(){return 0};var _Re={REQUEST_LINE:!0,RESPONSE_LINE:!0,HEADER:!0};Te.prototype.execute=function(e,t,r){if(!(this instanceof Te))throw new TypeError("not a HTTPParser");t=t||0,r=typeof r=="number"?r:e.length,this.chunk=e,this.offset=t;var n=this.end=t+r;try{for(;this.offset<n&&!this[this.state](););}catch(i){if(this.isUserCall)throw i;return this.hadError=!0,i}return this.chunk=null,r=this.offset-t,_Re[this.state]&&(this.headerSize+=r,this.headerSize>(this.maxHeaderSize||Te.maxHeaderSize))?new Error("max header size exceeded"):r};var wRe={REQUEST_LINE:!0,RESPONSE_LINE:!0,BODY_RAW:!0};Te.prototype.finish=function(){if(!this.hadError){if(!wRe[this.state])return new Error("invalid state for EOF");this.state==="BODY_RAW"&&this.userCall()(this[JT]())}};Te.prototype.consume=Te.prototype.unconsume=Te.prototype.getCurrentBuffer=function(){};Te.prototype.userCall=function(){this.isUserCall=!0;var e=this;return function(t){return e.isUserCall=!1,t}};Te.prototype.nextRequest=function(){this.userCall()(this[JT]()),this.reinitialize(this.type)};Te.prototype.consumeLine=function(){for(var e=this.end,t=this.chunk,r=this.offset;r<e;r++)if(t[r]===10){var n=this.line+t.toString(Te.encoding,this.offset,r);return n.charAt(n.length-1)==="\r"&&(n=n.substr(0,n.length-1)),this.line="",this.offset=r+1,n}this.line+=t.toString(Te.encoding,this.offset,this.end),this.offset=this.end};var SRe=/^([^: \t]+):[ \t]*((?:.*[^ \t])|)/,ERe=/^[ \t]+(.*[^ \t])/;Te.prototype.parseHeader=function(e,t){if(e.indexOf("\r")!==-1)throw l6("HPE_LF_EXPECTED");var r=SRe.exec(e),n=r&&r[1];if(n)t.push(n),t.push(r[2]);else{var i=ERe.exec(e);i&&t.length&&(t[t.length-1]&&(t[t.length-1]+=" "),t[t.length-1]+=i[1])}};var xRe=/^([A-Z-
`),"utf8")},_shutdown:function(e,t,r){delete this._frame,delete this._message,this._stage=5;var n=this.readyState===1;this.readyState=2,this._extensions.close(function(){n&&this.frame(t,"close",e),this.readyState=3,r&&this.emit("error",new Error(t)),this.emit("close",new up.CloseEvent(e,t))},this)},_fail:function(e,t){this.readyState>1||this._shutdown(this.ERRORS[e],t,!0)},_parseOpcode:function(e){var t=[this.RSV1,this.RSV2,this.RSV3].map(function(n){return(e&n)===n}),r=this._frame=new hee;if(r.final=(e&this.FIN)===this.FIN,r.rsv1=t[0],r.rsv2=t[1],r.rsv3=t[2],r.opcode=e&this.OPCODE,this._stage=1,!this._extensions.validFrameRsv(r))return this._fail("protocol_error","One or more reserved bits are on: reserved1 = "+(r.rsv1?1:0)+", reserved2 = "+(r.rsv2?1:0)+", reserved3 = "+(r.rsv3?1:0));if(this.OPCODE_CODES.indexOf(r.opcode)<0)return this._fail("protocol_error","Unrecognized frame opcode: "+r.opcode);if(this.MESSAGE_OPCODES.indexOf(r.opcode)<0&&!r.final)return this._fail("protocol_error","Received fragmented control frame: opcode = "+r.opcode);if(this._message&&this.OPENING_OPCODES.indexOf(r.opcode)>=0)return this._fail("protocol_error","Received new data frame but previous continuous frame is unfinished")},_parseLength:function(e){var t=this._frame;if(t.masked=(e&this.MASK)===this.MASK,t.length=e&this.LENGTH,t.length>=0&&t.length<=125){if(this._stage=t.masked?3:4,!this._checkFrameLength())return}else this._stage=2,t.lengthBytes=t.length===126?2:8;if(this._requireMasking&&!t.masked)return this._fail("unacceptable","Received unmasked frame but masking is required")},_parseExtendedLength:function(e){var t=this._frame;if(t.length=this._readUInt(e),this._stage=t.masked?3:4,this.MESSAGE_OPCODES.indexOf(t.opcode)<0&&t.length>125)return this._fail("protocol_error","Received control frame having too long payload: "+t.length);this._checkFrameLength()},_checkFrameLength:function(){var e=this._message?this._message.length:0;return e+this._frame.length>this._maxLength?(this._fail("too_large","WebSocket frame length too large"),!1):!0},_emitFrame:function(e){var t=this._frame,r=t.payload=Zi.mask(e,t.maskingKey),n=t.opcode,i,a,o,s,l;if(delete this._frame,n===this.OPCODES.continuation){if(!this._message)return this._fail("protocol_error","Received unexpected continuation frame");this._message.pushFrame(t)}if((n===this.OPCODES.text||n===this.OPCODES.binary)&&(this._message=new gee,this._message.pushFrame(t)),t.final&&this.MESSAGE_OPCODES.indexOf(n)>=0)return this._emitMessage(this._message);n===this.OPCODES.close&&(a=r.length>=2?r.readUInt16BE(0):null,o=r.length>2?this._encode(r.slice(2)):null,r.length!==0&&!(a!==null&&a>=this.MIN_RESERVED_ERROR&&a<=this.MAX_RESERVED_ERROR)&&this.ERROR_CODES.indexOf(a)<0&&(a=this.ERRORS.protocol_error),(r.length>125||r.length>2&&!o)&&(a=this.ERRORS.protocol_error),this._shutdown(a||this.DEFAULT_ERROR_CODE,o||"")),n===this.OPCODES.ping&&(this.frame(r,"pong"),this.emit("ping",new up.PingEvent(r.toString()))),n===this.OPCODES.pong&&(s=this._pingCallbacks,i=this._encode(r),l=s[i],delete s[i],l&&l(),this.emit("pong",new up.PongEvent(r.toString())))},_emitMessage:function(t){var t=this._message;t.read(),delete this._message,this._extensions.processIncomingMessage(t,function(r,n){if(r)return this._fail("extension_error",r.message);var i=n.data;if(i.length>this._maxLength)return this._fail("too_large","WebSocket frame length too large");if(n.opcode===this.OPCODES.text&&(i=this._encode(i)),i===null)return this._fail("encoding_error","Could not decode a text frame as UTF-8");this.emit("message",new up.MessageEvent(i))},this)},_encode:function(e){try{var t=e.toString("binary",0,e.length);if(!this.UTF8_MATCH.test(t))return null}catch{}return e.toString("utf8",0,e.length)},_readUInt:function(e){return e.length===2?e.readUInt16BE(0):e.readUInt32BE(0)*4294967296+e.readUInt32BE(4)}};for(aI in yee)Zi.prototype[aI]=yee[aI];var aI;vee.exports=Zi});var xee=h((P6t,Eee)=>{"use strict";var See=Zr().Buffer,zRe=require("stream").Stream,_ee=require("url"),qRe=require("util"),BRe=wu(),VRe=i6(),WRe=u6(),ZRe={"ws:":80,"wss:":443},lI
`),"utf8")),!0},pause:function(){this._paused=!0},resume:function(){this._paused=!1,this.emit("drain")},write:function(e){if(!this.writable)return!1;if(this._http.parse(e),!this._http.isComplete())return!this._paused;if(this.statusCode=this._http.statusCode,this.headers=this._http.headers,this.statusCode===200)this.emit("connect",new BRe.ConnectEvent);else{var t="Can't establish a connection to the server at "+this._origin.href;this.emit("error",new Error(t))}return this.end(),!this._paused},end:function(e){this.writable&&(e!==void 0&&this.write(e),this.readable=this.writable=!1,this.emit("close"),this.emit("end"))},destroy:function(){this.end()}};for(sI in wee)lI.prototype[sI]=wee[sI];var sI;Eee.exports=lI});var Iee=h((j6t,Tee)=>{"use strict";var Cee=Zr().Buffer,HRe=require("crypto"),GRe=require("url"),JRe=require("util"),KRe=u6(),XRe=wu(),km=oI(),YRe=xee(),O0=function(e,t){this.version="hybi-"+km.VERSION,km.call(this,null,e,t),this.readyState=-1,this._key=O0.generateKey(),this._accept=km.generateAccept(this._key),this._http=new KRe("response");var r=GRe.parse(this.url),n=r.auth&&Cee.from(r.auth,"utf8").toString("base64");if(this.VALID_PROTOCOLS.indexOf(r.protocol)<0)throw new Error(this.url+" is not a valid WebSocket URL");this._pathname=(r.pathname||"/")+(r.search||""),this._headers.set("Host",r.host),this._headers.set("Upgrade","websocket"),this._headers.set("Connection","Upgrade"),this._headers.set("Sec-WebSocket-Key",this._key),this._headers.set("Sec-WebSocket-Version",km.VERSION),this._protocols.length>0&&this._headers.set("Sec-WebSocket-Protocol",this._protocols.join(", ")),n&&this._headers.set("Authorization","Basic "+n)};JRe.inherits(O0,km);O0.generateKey=function(){return HRe.randomBytes(16).toString("base64")};var Oee={VALID_PROTOCOLS:["ws:","wss:"],proxy:function(e,t){return new YRe(this,e,t)},start:function(){return this.readyState!==-1?!1:(this._write(this._handshakeRequest()),this.readyState=0,!0)},parse:function(e){if(this.readyState!==3){if(this.readyState>0)return km.prototype.parse.call(this,e);this._http.parse(e),this._http.isComplete()&&(this._validateHandshake(),this.readyState!==3&&(this._open(),this.parse(this._http.body)))}},_handshakeRequest:function(){var e=this._extensions.generateOffer();e&&this._headers.set("Sec-WebSocket-Extensions",e);var t="GET "+this._pathname+" HTTP/1.1",r=[t,this._headers.toString(),""];return Cee.from(r.join(`\r
`),"utf8")},_failHandshake:function(e){e="Error during WebSocket handshake: "+e,this.readyState=3,this.emit("error",new Error(e)),this.emit("close",new XRe.CloseEvent(this.ERRORS.protocol_error,e))},_validateHandshake:function(){if(this.statusCode=this._http.statusCode,this.headers=this._http.headers,this._http.error)return this._failHandshake(this._http.error.message);if(this._http.statusCode!==101)return this._failHandshake("Unexpected response code: "+this._http.statusCode);var e=this._http.headers,t=e.upgrade||"",r=e.connection||"",n=e["sec-websocket-accept"]||"",i=e["sec-websocket-protocol"]||"";if(t==="")return this._failHandshake("'Upgrade' header is missing");if(t.toLowerCase()!=="websocket")return this._failHandshake("'Upgrade' header value is not 'WebSocket'");if(r==="")return this._failHandshake("'Connection' header is missing");if(r.toLowerCase()!=="upgrade")return this._failHandshake("'Connection' header value is not 'Upgrade'");if(n!==this._accept)return this._failHandshake("Sec-WebSocket-Accept mismatch");if(this.protocol=null,i!==""){if(this._protocols.indexOf(i)<0)return this._failHandshake("Sec-WebSocket-Protocol mismatch");this.protocol=i}try{this._extensions.activate(this.headers["sec-websocket-extensions"])}catch(a){return this._failHandshake(a.message)}}};for(cI in Oee)O0.prototype[cI]=Oee[cI];var cI;Tee.exports=O0});var pI=h((M6t,Dee)=>{"use strict";var p6=Zr().Buffer,f6=wu(),QRe=require("util"),dI=function(e,t,r){f6.apply(this,arguments),this._stage=0,this.version="hixie-75",this._headers.set("Upgrade","WebSocket"),this._headers.set("Connection","Upgrade"),this._headers.set("WebSocket-Origin",this._request.headers.origin),this._headers.set("WebSocket-Location",this.url)};QRe.inherits(dI,f6);var Aee={close:function(){return this.readyState===3?!1:(this.readyState=3,this.emit("close",new f6.CloseEvent(null,null)),!0)},parse:function(e){this.readyState>1||(this._reader.put(e),this._reader.eachByte(function(t){var r;switch(this._stage){case-1:this._body.push(t),this._sendHandshakeBody();break;case 0:this._parseLeadingByte(t);break;case 1:if(this._length=(t&127)+128*this._length,this._length>this._maxLength)return this.close();if(this._closing&&this._length===0)return this.close();(t&128)!==128&&(this._length===0?this._stage=0:(this._skipped=0,this._stage=2));break;case 2:if(t===255)this._stage=0,r=p6.from(this._buffer).toString("utf8",0,this._buffer.length),this.emit("message",new f6.MessageEvent(r));else if(this._length)this._skipped+=1,this._skipped===this._length&&(this._stage=0);else if(this._buffer.push(t),this._buffer.length>this._maxLength)return this.close();break}},this))},frame:function(e){if(this.readyState===0)return this._queue([e]);if(this.readyState>1)return!1;typeof e!="string"&&(e=e.toString());var t=p6.byteLength(e),r=p6.allocUnsafe(t+2);return r[0]=0,r.write(e,1),r[r.length-1]=255,this._write(r),!0},_handshakeResponse:function(){var e="HTTP/1.1 101 Web Socket Protocol Handshake",t=[e,this._headers.toString(),""];return p6.from(t.join(`\r
`),"utf8")},_parseLeadingByte:function(e){(e&128)===128?(this._length=0,this._stage=1):(delete this._length,delete this._skipped,this._buffer=[],this._stage=2)}};for(uI in Aee)dI.prototype[uI]=Aee[uI];var uI;Dee.exports=dI});var jee=h((R6t,Pee)=>{"use strict";var C0=Zr().Buffer,eFe=wu(),m6=pI(),tFe=require("crypto"),rFe=require("util"),Lee=function(e){return parseInt((e.match(/[0-9]/g)||[]).join(""),10)},kee=function(e){return(e.match(/ /g)||[]).length},mI=function(e,t,r){m6.apply(this,arguments),this._stage=-1,this._body=[],this.version="hixie-76",this._headers.clear(),this._headers.set("Upgrade","WebSocket"),this._headers.set("Connection","Upgrade"),this._headers.set("Sec-WebSocket-Origin",this._request.headers.origin),this._headers.set("Sec-WebSocket-Location",this.url)};rFe.inherits(mI,m6);var Nee={BODY_SIZE:8,start:function(){return m6.prototype.start.call(this)?(this._started=!0,this._sendHandshakeBody(),!0):!1},close:function(){return this.readyState===3?!1:(this.readyState===1&&this._write(C0.from([255,0])),this.readyState=3,this.emit("close",new eFe.CloseEvent(null,null)),!0)},_handshakeResponse:function(){var s=this._request.headers,e=s["sec-websocket-key1"],t=s["sec-websocket-key2"];if(!e)throw new Error("Missing required header: Sec-WebSocket-Key1");if(!t)throw new Error("Missing required header: Sec-WebSocket-Key2");var r=Lee(e),n=kee(e),i=Lee(t),a=kee(t);if(r%n!==0||i%a!==0)throw new Error("Client sent invalid Sec-WebSocket-Key headers");this._keyValues=[r/n,i/a];var o="HTTP/1.1 101 WebSocket Protocol Handshake",s=[o,this._headers.toString(),""];return C0.from(s.join(`\r
`),"binary")},_handshakeSignature:function(){if(this._body.length<this.BODY_SIZE)return null;var e=tFe.createHash("md5"),t=C0.allocUnsafe(8+this.BODY_SIZE);return t.writeUInt32BE(this._keyValues[0],0),t.writeUInt32BE(this._keyValues[1],4),C0.from(this._body).copy(t,8,0,this.BODY_SIZE),e.update(t),C0.from(e.digest("binary"),"binary")},_sendHandshakeBody:function(){if(this._started){var e=this._handshakeSignature();e&&(this._write(e),this._stage=0,this._open(),this._body.length>this.BODY_SIZE&&this.parse(this._body.slice(this.BODY_SIZE)))}},_parseLeadingByte:function(e){if(e!==255)return m6.prototype._parseLeadingByte.call(this,e);this._closing=!0,this._length=0,this._stage=1}};for(fI in Nee)mI.prototype[fI]=Nee[fI];var fI;Pee.exports=mI});var Ree=h((F6t,Mee)=>{"use strict";var nFe=require("util"),iFe=u6(),yI=wu(),aFe=pI(),oFe=jee(),sFe=oI(),dp=function(e){yI.call(this,null,null,e),this._http=new iFe("request")};nFe.inherits(dp,yI);var gI={EVENTS:["open","message","error","close","ping","pong"],_bindEventListeners:function(){this.messages.on("error",function(){}),this.on("error",function(){})},parse:function(e){if(this._delegate)return this._delegate.parse(e);if(this._http.parse(e),!!this._http.isComplete()){this.method=this._http.method,this.url=this._http.url,this.headers=this._http.headers,this.body=this._http.body;var t=this;this._delegate=dp.http(this,this._options),this._delegate.messages=this.messages,this._delegate.io=this.io,this._open(),this.EVENTS.forEach(function(r){this._delegate.on(r,function(n){t.emit(r,n)})},this),this.protocol=this._delegate.protocol,this.version=this._delegate.version,this.parse(this._http.body),this.emit("connect",new yI.ConnectEvent)}},_open:function(){this.__queue.forEach(function(e){this._delegate[e[0]].apply(this._delegate,e[1])},this),this.__queue=[]}};["addExtension","setHeader","start","frame","text","binary","ping","close"].forEach(function(e){gI[e]=function(){return this._delegate?this._delegate[e].apply(this._delegate,arguments):(this.__queue.push([e,arguments]),!0)}});for(hI in gI)dp.prototype[hI]=gI[hI];var hI;dp.isSecureRequest=function(e){if(e.connection&&e.connection.authorized!==void 0||e.socket&&e.socket.secure)return!0;var t=e.headers;return t?t.https==="on"||t["x-forwarded-ssl"]==="on"||t["x-forwarded-scheme"]==="https"||t["x-forwarded-proto"]==="https":!1};dp.determineUrl=function(e){var t=this.isSecureRequest(e)?"wss:":"ws:";return t+"//"+e.headers.host+e.url};dp.http=function(e,t){t=t||{},t.requireMasking===void 0&&(t.requireMasking=!0);var r=e.headers,n=r["sec-websocket-version"],i=r["sec-websocket-key"],a=r["sec-websocket-key1"],o=r["sec-websocket-key2"],s=this.determineUrl(e);return n||i?new sFe(e,s,t):a||o?new oFe(e,s,t):new aFe(e,s,t)};Mee.exports=dp});var T0=h(($6t,$ee)=>{"use strict";var Fee=wu(),lFe=Iee(),h6=Ree(),cFe={client:function(e,t){return t=t||{},t.masking===void 0&&(t.masking=!0),new lFe(e,t)},server:function(e){return e=e||{},e.requireMasking===void 0&&(e.requireMasking=!0),new h6(e)},http:function(){return h6.http.apply(h6,arguments)},isSecureRequest:function(e){return h6.isSecureRequest(e)},isWebSocket:function(e){return Fee.isWebSocket(e)},validateOptions:function(e,t){Fee.validateOptions(e,t)}};$ee.exports=cFe});var I0=h((U6t,Uee)=>{"use strict";var pp=function(e,t){this.type=e;for(var r in t)this[r]=t[r]};pp.prototype.initEvent=function(e,t,r){this.type=e,this.bubbles=t,this.cancelable=r};pp.prototype.stopPropagation=function(){};pp.prototype.preventDefault=function(){};pp.CAPTURING_PHASE=1;pp.AT_TARGET=2;pp.BUBBLING_PHASE=3;Uee.exports=pp});var bI=h((z6t,zee)=>{"use strict";var uFe=I0(),dFe={onopen:null,onmessage:null,onerror:null,onclose:null,addEventListener:function(e,t,r){this.on(e,t)},removeEventListener:function(e,t,r){this.removeListener(e,t)},dispatchEvent:function(e){e.target=e.currentTarget=this,e.eventPhase=uFe.AT_TARGET,this["on"+e.type]&&this["on"+e.type](e),this.emit(e.type,e)}};zee.exports=dFe});var y6=h((q6t,Vee)=>{"use strict";var pFe=require("stream").Stream,fFe=require("util"),mFe=T0(),qee=bI(),g6=I0(),Bt=function(e){e=e||
Content-Type: text/event-stream\r
Cache-Control: no-cache, no-store\r
Connection: close\r
`+i.toString()+`\r
retry: `+Math.floor(this._retry*1e3)+`\r
\r
`;this._write(s),this._stream.on("drain",function(){a.emit("drain")}),this._ping&&(this._pingTimer=setInterval(function(){a.ping()},this._ping*1e3)),["error","end"].forEach(function(l){a._stream.on(l,function(){a.close()})})}};_Fe.inherits(A0,vFe);A0.isEventSource=function(e){if(e.method!=="GET")return!1;var t=(e.headers.accept||"").split(/\s*,\s*/);return t.indexOf("text/event-stream")>=0};var Qee={DEFAULT_PING:10,DEFAULT_RETRY:5,_write:function(e){if(!this.writable)return!1;try{return this._stream.write(e,"utf8")}catch{return!1}},_open:function(){if(this.readyState===Nm.CONNECTING){this.readyState=Nm.OPEN;var e=new Yee("open");e.initEvent("open",!1,!1),this.dispatchEvent(e)}},write:function(e){return this.send(e)},end:function(e){e!==void 0&&this.write(e),this.close()},send:function(e,t){if(this.readyState>Nm.OPEN)return!1;e=String(e).replace(/(\r\n|\r|\n)/g,"$1data: "),t=t||{};var r="";return t.event&&(r+="event: "+t.event+`\r
`),t.id&&(r+="id: "+t.id+`\r
`),r+="data: "+e+`\r
\r
`,this._write(r)},ping:function(){return this._write(`:\r
\r
`)},close:function(){if(this.readyState>Nm.OPEN)return!1;this.readyState=Nm.CLOSED,this.writable=!1,this._pingTimer&&clearInterval(this._pingTimer),this._stream&&this._stream.end();var e=new Yee("close");return e.initEvent("close",!1,!1),this.dispatchEvent(e),!0}};for(wI in Qee)A0.prototype[wI]=Qee[wI];var wI;for(SI in Xee)A0.prototype[SI]=Xee[SI];var SI;ete.exports=A0});var xI=h((Z6t,nte)=>{"use strict";var EFe=require("util"),EI=T0(),rte=y6(),Su=function(e,t,r,n,i){i=i||{},this._stream=t,this._driver=EI.http(e,{maxLength:i.maxLength,protocols:n});var a=this;if(!(!this._stream||!this._stream.writable)){if(!this._stream.readable)return this._stream.end();var o=function(){a._stream.removeListener("data",o)};this._stream.on("data",o),rte.call(this,i),process.nextTick(function(){a._driver.start(),a._driver.io.write(r)})}};EFe.inherits(Su,rte);Su.isWebSocket=function(e){return EI.isWebSocket(e)};Su.validateOptions=function(e,t){EI.validateOptions(e,t)};Su.WebSocket=Su;Su.Client=Kee();Su.EventSource=tte();nte.exports=Su});var ate=h((H6t,ite)=>{"use strict";var xFe=xI().Client;ite.exports={create:function(e,t,r){return new xFe(e,t,r)}}});var cte=h((G6t,lte)=>{"use strict";var OFe=Dr(),CFe=Em(),TFe=FT(),IFe=c0(),ote=fT(),AFe=Qw(),ste=Ar(),DFe=wm(),LFe=ate(),kFe=Om(),NFe=g0(),Pm=ste(OFe(NFe,{UNCONNECTED:1,CONNECTING:2,CONNECTED:3,batching:!1,isUsable:function(e,t){this.callback(function(){e.call(t,!0)}),this.errback(function(){e.call(t,!1)}),this.connect()},request:function(e){this._pending=this._pending||new TFe;for(var t=0,r=e.length;t<r;t++)this._pending.add(e[t]);var n=this,i=new CFe(function(a,o){n.callback(function(s){!s||s.readyState!==1||(s.send(DFe(e)),a(s))}),n.connect()});return{abort:function(){i.then(function(a){a.close()})}}},connect:function(){if(!Pm._unloaded&&(this._state=this._state||this.UNCONNECTED,this._state===this.UNCONNECTED)){this._state=this.CONNECTING;var e=this._createSocket();if(!e)return this.setDeferredStatus("failed");var t=this;e.onopen=function(){e.headers&&t._storeCookies(e.headers["set-cookie"]),t._socket=e,t._state=t.CONNECTED,t._everConnected=!0,t.setDeferredStatus("succeeded",e)};var r=!1;e.onclose=e.onerror=function(){if(!r){r=!0;var n=t._state===t.CONNECTED;e.onopen=e.onclose=e.onerror=e.onmessage=null,delete t._socket,t._state=t.UNCONNECTED;var i=t._pending?t._pending.toArray():[];delete t._pending,n||t._everConnected?(t.setDeferredStatus("unknown"),t._handleError(i,n)):t.setDeferredStatus("failed")}},e.onmessage=function(n){var i;try{i=JSON.parse(n.data)}catch{}if(i){i=[].concat(i);for(var a=0,o=i.length;a<o;a++)i[a].successful!==void 0&&t._pending.remove(i[a]);t._receive(i)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var e=Pm.getSocketUrl(this.endpoint),t=this._dispatcher.headers,r=this._dispatcher.wsExtensions,n=this._getCookies(),i=this._dispatcher.tls,a={extensions:r,headers:t,proxy:this._proxy,tls:i};n!==""&&(a.headers.Cookie=n);try{return LFe.create(e,[],a)}catch{}}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(e,t){var r=e.transports.websocket=e.transports.websocket||{};return r[t.href]=r[t.href]||new this(e,t),r[t.href]},getSocketUrl:function(e){return e=AFe(e),e.protocol=this.PROTOCOLS[e.protocol],IFe.stringify(e)},isUsable:function(e,t,r,n){this.create(e,t).isUsable(r,n)}});ste(Pm.prototype,kFe);ote.Event&&global.onbeforeunload!==void 0&&ote.Event.on(global,"beforeunload",function(){Pm._unloaded===void 0&&(Pm._unloaded=!0)});lte.exports=Pm});var fte=h(jm=>{"use strict";var J6t=require("net"),PFe=require("tls"),OI=require("http"),ute=require("https"),jFe=require("events"),MFe=require("assert"),RFe=require("util"),FFe=Zr().Buffer;jm.httpOverHttp=$Fe;jm.httpsOverHttp=UFe;jm.httpOverHttps=zFe;jm.httpsOverHttps=qFe;function $Fe(e){var t=new as(e);return t.request=OI.request,t}function UFe(e){var t=new as(e);return t.request=OI.request,t.createSocket=dte,t.defaultPort=443,t}function zFe(e){var t=new as(e);return t.request=ute.request,t}function qFe(e){var t=new as(e);return t.request=ute.request,t.createSocket=dte,t.defaultPort=4
`,d.message,d.stack);var f=new Error("tunneling socket could not be established, cause="+d.message);f.code="ECONNRESET",t.request.emit("error",f),n.removeSocket(i)}};as.prototype.removeSocket=function(t){var r=this.sockets.indexOf(t);if(r!==-1){this.sockets.splice(r,1);var n=this.requests.shift();n&&this.createConnection(n)}};function dte(e,t){var r=this;as.prototype.createSocket.call(r,e,function(n){var i=PFe.connect(0,pte({},r.options,{servername:e.host,socket:n}));r.sockets[r.sockets.indexOf(n)]=i,t(i)})}function pte(e){for(var t=1,r=arguments.length;t<r;++t){var n=arguments[t];if(typeof n=="object")for(var i=Object.keys(n),a=0,o=i.length;a<o;++a){var s=i[a];n[s]!==void 0&&(e[s]=n[s])}}return e}var fp;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?fp=function(){var e=Array.prototype.slice.call(arguments);typeof e[0]=="string"?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:fp=function(){};jm.debug=fp});var _te=h((X6t,vte)=>{"use strict";var CI=Zr().Buffer,mte=require("http"),hte=require("https"),gte=fte(),BFe=Dr(),yte=c0(),mp=Ar(),VFe=wm(),bte=g0(),WFe=mp(BFe(bte,{className:"NodeHttp",SECURE_PROTOCOLS:["https:","wss:"],initialize:function(){bte.prototype.initialize.apply(this,arguments),this._endpointSecure=this.SECURE_PROTOCOLS.indexOf(this.endpoint.protocol)>=0,this._httpClient=this._endpointSecure?hte:mte;var e=this._proxy;if(e.origin){if(this._proxyUri=yte.parse(e.origin),this._proxySecure=this.SECURE_PROTOCOLS.indexOf(this._proxyUri.protocol)>=0,!this._endpointSecure){this._httpClient=this._proxySecure?hte:mte;return}var t=mp({proxy:{host:this._proxyUri.hostname,port:this._proxyUri.port||this.DEFAULT_PORTS[this._proxyUri.protocol],proxyAuth:this._proxyUri.auth,headers:mp({host:this.endpoint.host},e.headers)}},this._dispatcher.tls);this._proxySecure?(mp(t.proxy,e.tls),this._tunnel=gte.httpsOverHttps(t)):this._tunnel=gte.httpsOverHttp(t)}},encode:function(e){return VFe(e)},request:function(e){var t=CI.from(this.encode(e),"utf8"),r=this._buildParams(t),n=this._httpClient.request(r),i=this;return n.on("response",function(a){i._handleResponse(e,a),i._storeCookies(a.headers["set-cookie"])}),n.on("error",function(a){i.error("HTTP error: "+a.message),i._handleError(e)}),n.end(t),n},_buildParams:function(e){var t=this.endpoint,r=this._proxyUri,n=this._tunnel?t:r||t,i={"Content-Length":e.length,"Content-Type":"application/json",Host:t.host};t.auth&&(i.Authorization="Basic "+CI.from(t.auth,"utf8").toString("base64"));var a={method:"POST",host:n.hostname,port:n.port||this.DEFAULT_PORTS[n.protocol],path:t.path,headers:mp(i,this._dispatcher.headers)},o=this._getCookies();return o!==""&&(a.headers.Cookie=o),this._tunnel?a.agent=this._tunnel:this._endpointSecure?mp(a,this._dispatcher.tls):r&&(a.path=this.endpoint.href,mp(a,this._proxy.tls),r.auth&&(a.headers["Proxy-Authorization"]=CI.from(r.auth,"utf8").toString("base64"))),a},_handleResponse:function(e,t){var r="",n=this;t.setEncoding("utf8"),t.on("data",function(i){r+=i}),t.on("end",function(){var i;try{i=JSON.parse(r)}catch{}i?n._receive(i):n._handleError(e)})}}),{isUsable:function(e,t,r,n){r.call(n,yte.isURI(t))}});vte.exports=WFe});var Ste=h((Y6t,wte)=>{"use strict";var v6=g0();v6.register("in-process",EQ());v6.register("websocket",cte());v6.register("long-polling",_te());wte.exports=v6});var TI=h((Q6t,xte)=>{"use strict";var ZFe=Ar(),Ete=function(e,t){this.message=e,this.options=t,this.attempts=0};ZFe(Ete.prototype,{getTimeout:function(){return this.options.timeout},getInterval:function(){return this.options.interval},isDeliverable:function(){var e=this.options.attempts,t=this.attempts,r=this.options.deadline,n=new Date().getTime();return!(e!==void 0&&t>=e||r!==void 0&&n>r)},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}});xte.exports=Ete});var Ate=h((e3t,Ite)=>{"use strict";var HFe=Dr(),Ote=c0(),Cte=NT(),Tte=Ar(),GFe=Xl(),JFe=Cm(),II=Ste(),KFe=TI(),D0=HFe({className:"Dispatcher",MAX_REQUEST_SIZE:2048,DEFAULT_RETRY:5,UP:1,DOWN:2,initialize:function(e,t,r){this._client=e,this.endpoint
Backtrace:
`+u.stack)}},i.onclose=function(s){o._server.closeSocket(a),i=null}},handleEventSource:function(e,t){var r=new Kte(e,t,{ping:this._options.ping}),n=r.url.split("/").pop(),i=this;this.debug("Opened EventSource connection for ?",n),this._server.openSocket(n,r,e),r.onclose=function(a){i._server.closeSocket(n),r=null}},_handleOptions:function(e,t){var r=e.headers.origin||e.headers.referer,n={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Accept, Authorization, Content-Type, Pragma, X-Requested-With","Access-Control-Allow-Methods":"POST, GET","Access-Control-Allow-Origin":r||"*","Access-Control-Max-Age":"86400"};t.writeHead(200,n),t.end("")},_concatStream:function(e,t,r){var n=[],i=0;e.on("data",function(a){n.push(a),i+=a.length}),e.on("end",function(){for(var a=Hte.alloc(i),o=0,s=0,l=n.length;s<l;s++)n[s].copy(a,o),o+=n[s].length;t.call(r,a.toString("utf8"))})},_parseJSON:function(e){var t=JSON.parse(e);if(typeof t=="object")return t;throw new SyntaxError("JSON messages must contain an object or array")},_formatRequest:function(e){var t=e.method.toUpperCase(),r="curl -X "+t;return r+=" 'http://"+e.headers.host+e.url+"'",t==="POST"&&(r+=" -H 'Content-Type: "+e.headers["content-type"]+"'",r+=" -d '"+e.body+"'"),r},_returnError:function(e,t){var r=t.message;t.stack&&(r+=`
Backtrace:
`+t.stack),this.error(r),e&&(e.writeHead(400,NI.TYPE_TEXT),e.end("Bad request"))}});for(Yte in E$e)(function(e){PI.prototype[e]=function(){return this._server._engine[e].apply(this._server._engine,arguments)}})(Yte);var Yte;ere(PI.prototype,S$e);tre.exports=PI});var jI=h((c3t,ire)=>{"use strict";var T$e=_m(),I$e=Xl(),nre={VERSION:T$e.VERSION,Client:LI(),Scheduler:TI(),NodeAdapter:rre()};I$e.wrapper=nre;ire.exports=nre});var ore=h(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});Mm.Replay=Mm.AuthFailure=void 0;var MI=class{_failureCallback;constructor(t){this._failureCallback=t}incoming(t,r){(t.channel==="/meta/connect"||t.channel==="/meta/handshake")&&t.advice&&t.advice.reconnect=="none"?this._failureCallback(t):r(t)}};Mm.AuthFailure=MI;var are="replay",RI=class{_extensionEnabled;_replay;_channel;constructor(t,r){this._extensionEnabled=r!=null,this._channel=t,this._replay=r}setExtensionEnabled(t){this._extensionEnabled=t}setReplay(t){this._replay=parseInt(t,10)}setChannel(t){this._channel=t}incoming(t,r){t.channel==="/meta/handshake"?t.ext&&t.ext[are]==!0&&(this._extensionEnabled=!0):t.channel===this._channel&&t.data?.event?.replayId&&(this._replay=t.data.event.replayId),r(t)}outgoing(t,r){if(t.channel==="/meta/subscribe"&&this._extensionEnabled){t.ext||(t.ext={});let n={[this._channel]:this._replay};t.ext[are]=n}r(t)}};Mm.Replay=RI});var sre=h(cn=>{"use strict";var A$e=cn&&cn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),D$e=cn&&cn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),L$e=cn&&cn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&A$e(t,e,r);return D$e(t,e),t};Object.defineProperty(cn,"__esModule",{value:!0});cn.StreamingExtension=cn.Streaming=cn.Subscription=cn.Client=void 0;var k$e=require("events"),UI=jI();Object.defineProperty(cn,"Client",{enumerable:!0,get:function(){return UI.Client}});Object.defineProperty(cn,"Subscription",{enumerable:!0,get:function(){return UI.Subscription}});var N$e=Bi(),P$e=L$e(ore());cn.StreamingExtension=P$e;var FI=class{_streaming;name;constructor(t,r){this._streaming=t,this.name=r}subscribe(t){return this._streaming.subscribe(this.name,t)}unsubscribe(t){return this._streaming.unsubscribe(this.name,t),this}},$I=class{_streaming;_id;name;constructor(t,r){this._streaming=t,this.name=r}subscribe(t){return this._streaming.subscribe(this.name,t)}unsubscribe(t){return this._streaming.unsubscribe(this.name,t),this}async push(t){let r=Array.isArray(t),n=Array.isArray(t)?t:[t],i=this._streaming._conn;this._id||(this._id=i.sobject("StreamingChannel").findOne({Name:this.name},["Id"]).then(l=>l?.Id));let a=await this._id;if(!a)throw new Error(`No streaming channel available for name: ${this.name}`);let o=`/sobjects/StreamingChannel/${a}/push`,s=await i.requestPost(o,{pushEvents:n});return r?s:s[0]}},N0=class extends k$e.EventEmitter{_conn;_topics={};_fayeClients={};constructor(t){super(),this._conn=t}_createClient(t,r){let n=typeof t=="string"&&t.startsWith("/u/"),i=[this._conn.instanceUrl,"cometd"+(n&&this._conn.version==="36.0"?"/replay":""),this._conn.version].join("/"),a=new UI.Client(i,{});if(a.setHeader("Authorization","OAuth "+this._conn.accessToken),Array.isArray(r))for(let s of r)a.addExtension(s);let o=a._dispatcher;return o.getConnectionTypes().indexOf("callback-polling")===-1&&(o.selectTransport("long-polling"),o._transport.batching=!1),a}_getFayeClient(t){let n=t.startsWith("/u/")?"generic":"pushTopic";return this._fayeClients[n]||(this._fayeClients[n]=this._createClient(t)),this._fayeClients[n]}topic(t){return this._topics=this._topics||{},this._topics[t]=this._topics[t]||new FI(this,t)}channel(t){return new $I(this,t)}subscribe(t
Supported algorithms are:
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,M0="secret must be a string or buffer",$m="key must be a string or a buffer",TUe="key must be a string, a buffer or an object",YI=typeof Da.createPublicKey=="function";YI&&($m+=" or a KeyObject",M0+="or a KeyObject");function Vre(e){if(!Um.isBuffer(e)&&typeof e!="string"&&(!YI||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw vo($m)}function Wre(e){if(!Um.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw vo(TUe)}function IUe(e){if(!Um.isBuffer(e)){if(typeof e=="string")return e;if(!YI||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw vo(M0)}}function QI(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Zre(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function vo(e){var t=[].slice.call(arguments,1),r=qre.format.bind(qre,e).apply(null,t);return new TypeError(r)}function AUe(e){return Um.isBuffer(e)||typeof e=="string"}function R0(e){return AUe(e)||(e=JSON.stringify(e)),e}function Hre(e){return function(r,n){IUe(n),r=R0(r);var i=Da.createHmac("sha"+e,n),a=(i.update(r),i.digest("base64"));return QI(a)}}var XI,DUe="timingSafeEqual"in Da?function(t,r){return t.byteLength!==r.byteLength?!1:Da.timingSafeEqual(t,r)}:function(t,r){return XI||(XI=zre()),XI(t,r)};function LUe(e){return function(r,n,i){var a=Hre(e)(r,i);return DUe(Um.from(n),Um.from(a))}}function Gre(e){return function(r,n){Wre(n),r=R0(r);var i=Da.createSign("RSA-SHA"+e),a=(i.update(r),i.sign(n,"base64"));return QI(a)}}function Jre(e){return function(r,n,i){Vre(i),r=R0(r),n=Zre(n);var a=Da.createVerify("RSA-SHA"+e);return a.update(r),a.verify(i,n,"base64")}}function kUe(e){return function(r,n){Wre(n),r=R0(r);var i=Da.createSign("RSA-SHA"+e),a=(i.update(r),i.sign({key:n,padding:Da.constants.RSA_PKCS1_PSS_PADDING,saltLength:Da.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return QI(a)}}function NUe(e){return function(r,n,i){Vre(i),r=R0(r),n=Zre(n);var a=Da.createVerify("RSA-SHA"+e);return a.update(r),a.verify({key:i,padding:Da.constants.RSA_PKCS1_PSS_PADDING,saltLength:Da.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function PUe(e){var t=Gre(e);return function(){var n=t.apply(null,arguments);return n=Bre.derToJose(n,"ES"+e),n}}function jUe(e){var t=Jre(e);return function(n,i,a){i=Bre.joseToDer(i,"ES"+e).toString("base64");var o=t(n,i,a);return o}}function MUe(){return function(){return""}}function RUe(){return function(t,r){return r===""}}Kre.exports=function(t){var r={hs:Hre,rs:Gre,ps:kUe,es:PUe,none:MUe},n={hs:LUe,rs:Jre,ps:NUe,es:jUe,none:RUe},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw vo(CUe,t);var a=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:r[a](o),verify:n[a](o)}}});var tA=h((A3t,Xre)=>{var FUe=require("buffer").Buffer;Xre.exports=function(t){return typeof t=="string"?t:typeof t=="number"||FUe.isBuffer(t)?t.toString():JSON.stringify(t)}});var nne=h((D3t,rne)=>{var $Ue=Zr().Buffer,Yre=GI(),UUe=eA(),zUe=require("stream"),Qre=tA(),rA=require("util");function ene(e,t){return $Ue.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function qUe(e,t,r){r=r||"utf8";var n=ene(Qre(e),"binary"),i=ene(Qre(t),r);return rA.format("%s.%s",n,i)}function tne(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,a=UUe(t.alg),o=qUe(t,r,i),s=a.sign(o,n);return rA.format("%s.%s",o,s)}function T6(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Yre(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Yre(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]])),vr;(function(e){e.TARGET_ORG="target-org",e.TARGET_DEV_HUB="target-dev-hub",e.ORG_API_VERSION="org-api-version",e.ORG_CUSTOM_METADATA_TEMPLATES="org-custom-metadata-templates",e.ORG_MAX_QUERY_LIMIT="org-max-query-limit",e.ORG_INSTANCE_URL="org-instance-url",e.ORG_ISV_DEBUGGER_SID="org-isv-debugger-sid",e.ORG_ISV_DEBUGGER_URL="org-isv-debugger-url",e.ORG_CAPITALIZE_RECORD_TYPES="org-capitalize-record-types"})(vr||(Vm.OrgConfigProperties=vr={}));Vm.ORG_CONFIG_ALLOWED_PROPERTIES=[{key:vr.ORG_CAPITALIZE_RECORD_TYPES,description:pi.getMessage(vr.ORG_CAPITALIZE_RECORD_TYPES)},{key:vr.ORG_CUSTOM_METADATA_TEMPLATES,description:pi.getMessage(vr.ORG_CUSTOM_METADATA_TEMPLATES)},{key:vr.TARGET_ORG,description:pi.getMessage(vr.TARGET_ORG)},{key:vr.TARGET_DEV_HUB,description:pi.getMessage(vr.TARGET_DEV_HUB)},{key:vr.ORG_INSTANCE_URL,description:pi.getMessage(vr.ORG_INSTANCE_URL),input:{validator:e=>e==null?!0:(0,F6.isString)(e)&&bA.SfdcUrl.isValidUrl(e)&&(new bA.SfdcUrl(e).isSalesforceDomain()||new bA.SfdcUrl(e).isInternalUrl()),failedMessage:pi.getMessage("invalidInstanceUrl")}},{key:vr.ORG_API_VERSION,description:pi.getMessage(vr.ORG_API_VERSION),hidden:!0,input:{validator:e=>e==null|
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]])),$Be="sfdx-config.json",UBe="config.json",B0;(function(e){e.DISABLE_TELEMETRY="disable-telemetry"})(B0||(On.SfConfigProperties=B0={}));On.SF_ALLOWED_PROPERTIES=[{key:B0.DISABLE_TELEMETRY,description:Dt.getMessage(B0.DISABLE_TELEMETRY),input:{validator:e=>e==null||wA(e),failedMessage:Dt.getMessage("invalidBooleanConfigValue")}}];var _r;(function(e){e.DEFAULT_DEV_HUB_USERNAME="defaultdevhubusername",e.DEFAULT_USERNAME="defaultusername",e.ISV_DEBUGGER_SID="isvDebuggerSid",e.ISV_DEBUGGER_URL="isvDebuggerUrl",e.API_VERSION="apiVersion",e.DISABLE_TELEMETRY="disableTelemetry",e.CUSTOM_ORG_METADATA_TEMPLATES="customOrgMetadataTemplates",e.MAX_QUERY_LIMIT="maxQueryLimit",e.REST_DEPLOY="restDeploy",e.INSTANCE_URL="instanceUrl"})(_r||(On.SfdxPropertyKeys=_r={}));On.SFDX_ALLOWED_PROPERTIES=[{key:_r.INSTANCE_URL,description:Dt.getMessage(_r.INSTANCE_URL),newKey:tc.OrgConfigProperties.ORG_INSTANCE_URL,deprecated:!0,input:{validator:e=>e==null?!0:(0,Iu.isString)(e)&&vA.SfdcUrl.isValidUrl(e)&&(new vA.SfdcUrl(e).isSalesforceDomain()||new vA.SfdcUrl(e).isInternalUrl()),failedMessage:Dt.getMessage("invalidInstanceUrl")}},{key:_r.API_VERSION,newKey:tc.OrgConfigProperties.ORG_API_VERSION,deprec
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]])),OA=class e extends xA.AsyncOptionalCreatable{static encrypted=!0;static instances=new Map;static mutex=new ZBe.Mutex;allowedProperties;localConfig;globalConfig;envVars={};constructor(t){super(t??{});try{this.localConfig=new Zm.Config({...Zm.Config.getDefaultOptions(!1),...t?.projectPath?{rootFolder:t.projectPath}:{}})}catch(r){if(r.name!=="InvalidProjectWorkspaceError")throw r}this.globalConfig=new Zm.Config(Zm.Config.getDefaultOptions(!0)),this.setAllowedProperties(Zm.Config.getAllowedProperties())}get config(){return this.resolveProperties(this.globalConfig.getContents(),this.localConfig?.getContents())}static async create(t){return e.mutex.lock(async()=>{let r=t?.projectPath?(0,EA.resolve)(t.projectPath):process.cwd();if(!e.instances.has(r)){let i=new this(t);e.instances.set(r,i),await i.init()}let n=e.instances.get(r);return e.encrypted&&await n.loadProperties(),t?.customConfigMeta&&Zm.Config.addAllowedProperties(t.customConfigMeta),n})}static async clearInstance(t){return e.mutex.lock(()=>{if(t){let r=(0,EA.resolve)(t);e.instances.delete(r)}else e.instances.clear();e.encrypted=!0})}static getValue(t,r){return this.getInstance(r??process.cwd()).getInfo(t)}static getIns
`)}});var MA=h(de=>{"use strict";var hWe=de&&de.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),gWe=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jA=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&hWe(t,e,r);return gWe(t,e),t};Object.defineProperty(de,"__esModule",{value:!0});de.safeDecodeAsync=de._safeDecodeAsync=de.safeEncodeAsync=de._safeEncodeAsync=de.safeDecode=de._safeDecode=de.safeEncode=de._safeEncode=de.decodeAsync=de._decodeAsync=de.encodeAsync=de._encodeAsync=de.decode=de._decode=de.encode=de._encode=de.safeParseAsync=de._safeParseAsync=de.safeParse=de._safeParse=de.parseAsync=de._parseAsync=de.parse=de._parse=void 0;var Jm=jA(vp()),Hi=jA(PA()),Km=jA(Se()),yWe=e=>(t,r,n,i)=>{let a=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Jm.$ZodAsyncError;if(o.issues.length){let s=new(i?.Err??e)(o.issues.map(l=>Km.finalizeIssue(l,a,Jm.config())));throw Km.captureStackTrace(s,i?.callee),s}return o.value};de._parse=yWe;de.parse=(0,de._parse)(Hi.$ZodRealError);var bWe=e=>async(t,r,n,i)=>{let a=n?{...n,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let s=new(i?.Err??e)(o.issues.map(l=>Km.finalizeIssue(l,a,Jm.config())));throw Km.captureStackTrace(s,i?.callee),s}return o.value};de._parseAsync=bWe;de.parseAsync=(0,de._parseAsync)(Hi.$ZodRealError);var vWe=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Jm.$ZodAsyncError;return a.issues.length?{success:!1,error:new(e??Hi.$ZodError)(a.issues.map(o=>Km.finalizeIssue(o,i,Jm.config())))}:{success:!0,data:a.value}};de._safeParse=vWe;de.safeParse=(0,de._safeParse)(Hi.$ZodRealError);var _We=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>Km.finalizeIssue(o,i,Jm.config())))}:{success:!0,data:a.value}};de._safeParseAsync=_We;de.safeParseAsync=(0,de._safeParseAsync)(Hi.$ZodRealError);var wWe=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,de._parse)(e)(t,r,i)};de._encode=wWe;de.encode=(0,de._encode)(Hi.$ZodRealError);var SWe=e=>(t,r,n)=>(0,de._parse)(e)(t,r,n);de._decode=SWe;de.decode=(0,de._decode)(Hi.$ZodRealError);var EWe=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,de._parseAsync)(e)(t,r,i)};de._encodeAsync=EWe;de.encodeAsync=(0,de._encodeAsync)(Hi.$ZodRealError);var xWe=e=>async(t,r,n)=>(0,de._parseAsync)(e)(t,r,n);de._decodeAsync=xWe;de.decodeAsync=(0,de._decodeAsync)(Hi.$ZodRealError);var OWe=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,de._safeParse)(e)(t,r,i)};de._safeEncode=OWe;de.safeEncode=(0,de._safeEncode)(Hi.$ZodRealError);var CWe=e=>(t,r,n)=>(0,de._safeParse)(e)(t,r,n);de._safeDecode=CWe;de.safeDecode=(0,de._safeDecode)(Hi.$ZodRealError);var TWe=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,de._safeParseAsync)(e)(t,r,i)};de._safeEncodeAsync=TWe;de.safeEncodeAsync=(0,de._safeEncodeAsync)(Hi.$ZodRealError);var IWe=e=>async(t,r,n)=>(0,de._safeParseAsync)(e)(t,r,n);de._safeDecodeAsync=IWe;de.safeDecodeAsync=(0,de._safeDecodeAsync)(Hi.$ZodRealError)});var H6=h(J=>{"use strict";var AWe=J&&J.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=
`).filter(o=>o),i=Math.min(...n.map(o=>o.length-o.trimStart().length)),a=n.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(let o of a)this.content.push(o)}compile(){let t=Function,r=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...r,i.join(`
`))}};J6.Doc=$A});var zA=h(K6=>{"use strict";Object.defineProperty(K6,"__esModule",{value:!0});K6.version=void 0;K6.version={major:4,minor:4,patch:3}});var VA=h(F=>{"use strict";var VWe=F&&F.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),WWe=F&&F.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),t3=F&&F.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&VWe(t,e,r);return WWe(t,e),t};Object.defineProperty(F,"__esModule",{value:!0});F.$ZodTuple=F.$ZodIntersection=F.$ZodDiscriminatedUnion=F.$ZodXor=F.$ZodUnion=F.$ZodObjectJIT=F.$ZodObject=F.$ZodArray=F.$ZodDate=F.$ZodVoid=F.$ZodNever=F.$ZodUnknown=F.$ZodAny=F.$ZodNull=F.$ZodUndefined=F.$ZodSymbol=F.$ZodBigIntFormat=F.$ZodBigInt=F.$ZodBoolean=F.$ZodNumberFormat=F.$ZodNumber=F.$ZodCustomStringFormat=F.$ZodJWT=F.$ZodE164=F.$ZodBase64URL=F.$ZodBase64=F.$ZodCIDRv6=F.$ZodCIDRv4=F.$ZodMAC=F.$ZodIPv6=F.$ZodIPv4=F.$ZodISODuration=F.$ZodISOTime=F.$ZodISODate=F.$ZodISODateTime=F.$ZodKSUID=F.$ZodXID=F.$ZodULID=F.$ZodCUID2=F.$ZodCUID=F.$ZodNanoID=F.$ZodEmoji=F.$ZodURL=F.$ZodEmail=F.$ZodUUID=F.$ZodGUID=F.$ZodStringFormat=F.$ZodString=F.clone=F.$ZodType=void 0;F.$ZodCustom=F.$ZodLazy=F.$ZodPromise=F.$ZodFunction=F.$ZodTemplateLiteral=F.$ZodReadonly=F.$ZodPreprocess=F.$ZodCodec=F.$ZodPipe=F.$ZodNaN=F.$ZodCatch=F.$ZodSuccess=F.$ZodNonOptional=F.$ZodPrefault=F.$ZodDefault=F.$ZodNullable=F.$ZodExactOptional=F.$ZodOptional=F.$ZodTransform=F.$ZodFile=F.$ZodLiteral=F.$ZodEnum=F.$ZodSet=F.$ZodMap=F.$ZodRecord=void 0;F.isValidBase64=BA;F.isValidBase64URL=aae;F.isValidJWT=oae;var r3=t3(G6()),oe=t3(vp()),ZWe=UA(),Xm=MA(),ut=t3(H6()),se=t3(Se()),HWe=zA();F.$ZodType=oe.$constructor("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=HWe.version;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let a of i._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(o,s,l)=>{let c=se.aborted(o),u;for(let d of s){if(d._zod.def.when){if(se.explicitlyAborted(o)||!d._zod.def.when(o))continue}else if(c)continue;let f=o.issues.length,p=d._zod.check(o);if(p instanceof Promise&&l?.async===!1)throw new oe.$ZodAsyncError;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,o.issues.length!==f&&(c||(c=se.aborted(o,f)))});else{if(o.issues.length===f)continue;c||(c=se.aborted(o,f))}}return u?u.then(()=>o):o},a=(o,s,l)=>{if(se.aborted(o))return o.aborted=!0,o;let c=i(s,n,l);if(c instanceof Promise){if(l.async===!1)throw new oe.$ZodAsyncError;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(o,s)=>{if(s.skipChecks)return e._zod.parse(o,s);if(s.direction==="backward"){let c=e._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(u=>a(u,o,s)):a(c,o,s)}let l=e._zod.parse(o,s);if(l instanceof Promise){if(s.async===!1)throw new oe.$ZodAsyncError;return l.then(c=>i(c,n,s))}return i(l,n,s)}}se.defineLazy(e,"~standard",()=>({validate:i=>{try{let a=(0,Xm.safeParse)(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return(0,Xm.safeParseAsync)(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))});var GWe=Se();Object.defineProperty(F,"clone",{enumerable:!0,get:function(){return GWe.clone}});F.$ZodString=oe.$constructor("$ZodString",(e,t)=>{F.$ZodType.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ut.string(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}
if (${v}.issues.length) {
if (${b} in input) {
payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
...iss,
path: iss.path ? [${b}, ...iss.path] : [${b}]
})));
}
}
if (${v}.value === undefined) {
if (${b} in input) {
newResult[${b}] = undefined;
}
} else {
newResult[${b}] = ${v}.value;
}
`):P?p.write(`
if (${v}.issues.length) {
payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
...iss,
path: iss.path ? [${b}, ...iss.path] : [${b}]
})));
}
if (${v}.value === undefined) {
if (${b} in input) {
newResult[${b}] = undefined;
}
} else {
newResult[${b}] = ${v}.value;
}
`):p.write(`
const ${v}_present = ${b} in input;
if (${v}.issues.length) {
payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
...iss,
path: iss.path ? [${b}, ...iss.path] : [${b}]
})));
}
if (!${v}_present && !${v}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${b}]
});
}
if (${v}_present) {
if (${v}.value === undefined) {
newResult[${b}] = undefined;
} else {
newResult[${b}] = ${v}.value;
}
}
`)}p.write("payload.value = newResult;"),p.write("return payload;");let E=p.compile();return(w,v)=>E(f,w,v)},a,o=se.isObject,s=!oe.globalConfig.jitless,l=se.allowsEval,c=s&&l.value,u=t.catchall,d;e._zod.parse=(f,p)=>{d??(d=n.value);let m=f.value;return o(m)?s&&c&&p?.async===!1&&p.jitless!==!0?(a||(a=i(t.shape)),f=a(f,p),u?lae([],m,f,p,d,e):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function Zie(e,t,r,n){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let i=e.filter(a=>!se.aborted(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(o=>se.finalizeIssue(o,n,oe.config())))}),t)}F.$ZodUnion=oe.$constructor("$ZodUnion",(e,t)=>{F.$ZodType.init(e,t),se.defineLazy(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),se.defineLazy(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),se.defineLazy(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),se.defineLazy(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>se.cleanRegex(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of t.options){let l=s._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)o.push(l),a=!0;else{if(l.issues.length===0)return l;o.push(l)}}return a?Promise.all(o).then(s=>Zie(s,n,e,i)):Zie(o,n,e,i)}});function Hie(e,t,r,n){let i=e.filter(a=>a.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(o=>se.finalizeIssue(o,n,oe.config())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}F.$ZodXor=oe.$constructor("$ZodXor",(e,t)=>{F.$ZodUnion.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of t.options){let l=s._zod.run({value:n.value,issues:[]},i);l instanceof Promise?(o.push(l),a=!0):o.push(l)}return a?Promise.all(o).then(s=>Hie(s,n,e,i)):Hie(o,n,e,i)}});F.$ZodDiscriminatedUnion=oe.$constructor("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,F.$ZodUnion.init(e,t);let r=e._zod.parse;se.defineLazy(e._zod,"propValues",()=>{let i={};for(let a of t.options){let o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[s,l]of Object.entries(o)){i[s]||(i[s]=new Set);for(let c of l)i[s].add(c)}}return i});let n=se.cached(()=>{let i=t.options,a=new Map;for(let o of i){let s=o._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let l of s){if(a.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);a.set(l,o)}}return a});e._zod.parse=(i,a)=>{let o=i.value;if(!se.isObject(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;let s=n.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction==="backward"?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}});F.$ZodIntersection=oe.$constructor("$ZodIntersection",(e,t)=>{F.$ZodType.init(e,t),e._zod.parse=(r,n)=>{let i=r.value,a=t.left._zod.run({value:i,issues:[]},n),o=t.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([l,c])=>Gie(r,l,c)):Gie(r,a,o)}});function qA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(se.isPlainObject(e)&&se.isPlainObject(t)){let r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of e.seen.entries()){let s=o[1];if(t===o[0]){a(o);continue}if(e.external){let c=e.external.registry.get(o[0])?.id;if(t!==o[0]&&c){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&e.reused==="ref"){a(o);continue}}}function XA(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let l=e.seen.get(s);if(l.ref===null)return;let c=l.def??l.schema,u={...c},d=l.ref;if(l.ref=null,d){n(d);let p=e.seen.get(d),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,u),s._zod.parent===d)for(let _ in c)_==="$ref"||_==="allOf"||_ in u||delete c[_];if(m.$ref&&p.def)for(let _ in c)_==="$ref"||_==="allOf"||_ in p.def&&JSON.stringify(c[_])===JSON.stringify(p.def[_])&&delete c[_]}let f=s._zod.parent;if(f&&f!==d){n(f);let p=e.seen.get(f);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(let m in c)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(c[m])===JSON.stringify(p.def[m])&&delete c[m]}e.override({zodSchema:s,jsonSchema:c,path:l.path??[]})};for(let s of[...e.seen.entries()].reverse())n(s[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(s)}Object.assign(i,r.def??r.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let s of e.seen.entries()){let l=s[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,o[l.defId]=l.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:(0,La.createStandardJSONSchemaMethod)(t,"input",e.processors),output:(0,La.createStandardJSONSchemaMethod)(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Gn(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Gn(n.element,r);if(n.type==="set")return Gn(n.valueType,r);if(n.type==="lazy")return Gn(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Gn(n.innerType,r);if(n.type==="intersection")return Gn(n.left,r)||Gn(n.right,r);if(n.type==="record"||n.type==="map")return Gn(n.keyType,r)||Gn(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Gn(n.in,r)||Gn(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Gn(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Gn(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Gn(i,r))return!0;return!!(n.rest&&Gn(n.rest,r))}return!1}var MQe=(e,t={})=>r=>{let n=JA({...r,processors:t});return nS(e,n),KA(n,e),XA(n,e)};La.createToJSONSchemaMethod=MQe;var RQe=(e,t,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=JA({...i??{},target:a,io:t,processors:r});return nS(e,o),KA(o,e),XA(o,e)};La.createStandardJSONSchemaMethod=RQe});var ty=h(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.allProcessors=Y.lazyProcessor=Y.optionalProcessor=Y.promiseProcessor=Y.readonlyProcessor=Y.pipeProcessor=Y.catchProcessor=Y.prefaultProcessor=Y.defaultProcessor=Y.nonoptionalProcessor=Y.nullableProcessor=Y.recordProcessor=Y.tupleProcessor=Y.intersectionProcessor=Y.unionProcessor=Y.objectProcessor=Y.arrayProcessor=Y.setProcessor=Y.mapProcessor=Y.transformProcessor=Y.functionProcessor=Y.customProcessor=Y.successProcessor=Y.f
Due to: %s`],["jwtAuthError","Error authenticating with JWT config due to: %s"],["jwtAuthErrors",`Error authenticating with JWT.
Errors encountered:
%s`],["refreshTokenAuthError","Error authenticating with the refresh token due to: %s"],["invalidSfdxAuthUrlError",`Invalid SFDX authorization URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the "instanceUrl" inside the SFDX authorization URL doesn\\'t include the protocol ("https://"). Run "org display --target-org" on an org to see an example of an SFDX authorization URL.`],["orgDataNotAvailableError","An attempt to refresh the authentication token failed with a 'Data Not Found Error'. The org identified by username %s does not appear to exist. Likely cause is that the org was deleted by another user or has expired."],["orgDataNotAvailableError.actions",["Run `sfdx force:org:list --clean` to remove stale org authentications.","Use `sfdx force:config:set` to update the defaultusername.","Use `sfdx force:org:create` to create a new org.","Use `sfdx auth` to authenticate an existing org."]],["namedOrgNotFound","No authorization information found for %s."],["noAliasesFound","Nothing to set."],["invalidFormat","Setting aliases must be in the format <key>=<value> but found: [%s]."],["invalidJsonCasing",'All JSON input must have heads down camelcase keys. E.g., `{ sfdcLoginUrl: "https://login.salesforce.com" }`\nFound "%s" at %s'],["missingClientId","Client ID is required for JWT authentication."]])),Jrt=e=>(t=[])=>r=>{let n=nle(r,t),i=n.filter(a=>/^[A-Z]/.test(a)).join(", ");return Wrt.strict.strictEqual(i.length,0,Grt.getMessage("invalidJsonCasing",[i,e])),n};xS.ensureNoUppercaseKeys=Jrt;var nle=(e,t)=>Object.entries(e).filter(([r])=>!t.includes(r)).flatMap(([r,n])=>(0,Zrt.isJsonMap)(n)?[r,...nle(n,t)]:[r])});var uy=h(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.isNamedPackagingDirectory=hi.isPackagingDirectory=hi.SfProject=hi.SfProjectJson=void 0;var il=require("node:path"),pD=He(),Krt=Ke(),ale=uD(),Xrt=Mr(),Yrt=ec(),Qrt=rc(),ole=eu(),fD=xE(),dD=wt(),ent=bt(),tnt=ile(),sle=an(),Ra=new ent.Messages("@salesforce/core","config",new Map([["unknownConfigKey","Unknown config name: %s."],["deprecatedConfigKey","Deprecated config name: %s. Please use %s instead."],["invalidWrite","The writeSync method is not allowed on SfdxConfig. Use the async write method instead."],["invalidConfigValue","Invalid config value: %s."],["invalidInstanceUrl","Specify a valid Salesforce instance URL."],["invalidApiVersion","Specify a valid Salesforce API version, for example, 42.0."],["invalidCustomOrgMetadataTemplates","Specify a valid repository URL or directory for the custom org metadata templates."],["invalidIsvDebuggerSid","Specify a valid Debugger SID."],["invalidIsvDebuggerUrl","Specify a valid Debugger URL."],["invalidNumberConfigValue","Specify a valid positive integer, for example, 150000."],["invalidBooleanConfigValue","The config value can only be set to true or false."],["invalidProjectWorkspace","%s does not contain a valid Salesforce DX project."],["schemaValidationError",`The config file "%s" is not schema valid.
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]])),oc=class e extends ole.ConfigFile{static BLOCKLIST=["packageAliases","plugins","packageBundleAliases"];static getFileName(){return fD.SFDX_PROJECT_JSON}static getDefaultOptions(t=!1){let r=ole.ConfigFile.getDefaultOptions(t,e.getFileName());return r.isState=!1,r}async read(){let t=await super.read();return this.validateKeys(),t}refreshSync(){return super.readSync(!1,!0),this}readSync(){let t=super.readSync();return this.validateKeys(),t}async write(){return this.validateKeys(),super.write()}writeSync(){return this.validateKeys(),super.writeSync()}getDefaultOptions(t){return{isState:!1,...t??{}}}async schemaValidate(){this.hasRead||await this.read();let t=ale.ProjectJsonSchema.safeParse(this.getContents());if(!t.success){let r=t.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`).join(`
`),n=Ra.getMessage("schemaValidationError",[this.getPath(),r]);if(pD.env.getBoolean("SFDX_PROJECT_JSON_VALIDATION",!1)&&!this.options.isGlobal)throw Ra.createError("schemaValidationError",[this.getPath(),r],[this.getPath()]);await sle.Lifecycle.getInstance().emitWarning(n)}}async getPackageDirectories(){return this.getPackageDirectoriesSync()}schemaValidateSync(){this.hasRead||this.readSync();let t=ale.ProjectJsonSchema.safeParse(this.getContents());if(!t.success){let r=t.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`).join(`
`),n=Ra.getMessage("schemaValidationError",[this.getPath(),r]);if(pD.env.getBoolean("SFDX_PROJECT_JSON_VALIDATION",!1)&&!this.options.isGlobal)throw Ra.createError("schemaValidationError",[this.getPath(),r],[this.getPath()]);sle.Lifecycle.getInstance().emitWarning(n)}}getPackageDirectoriesSync(){let r=(this.getContents().packageDirectories||[]).map(i=>{if((0,il.isAbsolute)(i.path))throw Ra.createError("invalidPackageDirectory",[i.path]);let a=il.sep==="/"?/\\/g:/\//g,o=i.path.replace(a,il.sep),s=(0,il.normalize)(o).replace(new RegExp(`\\${il.sep}$`),""),l=`${(0,il.dirname)(this.getPath())}${il.sep}${s}${il.sep}`;if(!this.doesPackageExist(l))throw Ra.createError("missingPackageDirectory",[i.path]);return Object.assign({},i,{name:s,path:o,fullPath:l})});if(r.length===1){if(r[0].default===!1)throw Ra.createError("singleNonDefaultPackage");r[0].default=!0}let n=r.filter(i=>i.default);if(n.length===0&&!this.isGlobal())throw Ra.createError("missingDefaultPath");if(n.length>1)throw Ra.createError("multipleDefaultPaths");return r}getUniquePackageDirectories(){let t=new Set,r=[];return this.getPackageDirectoriesSync().forEach(n=>{t.has(n.name)||(t.add(n.name),r.push(n))}),r}getUniquePackageNames(){return this.getUniquePackageDirectories().map(t=>t.name)}hasPackages(){return this.getContents()?.packageDirectories?.length>0}hasMultiplePackages(){return this.getContents()?.packageDirectories?.length>1}hasMultiplePackageBundles(){return(this.getContents()?.packageBundles?.length??0)>1}async hasPackageAliases(){return Object.keys(this.getContents().packageAliases??{}).length>0}getPackageAliases(){return this.getContents().packageAliases}addPackageAlias(t,r){if(!/^.{15,18}$/.test(r))throw Ra.createError("invalidId",[r]);let n={...this.getContents().packageAliases??{},[t]:r};this.contents.set("packageAliases",n)}addPackageDirectory(t){let r=this.getContents().packageDirectories.findIndex(int(t)),n=Object.assign({},r>-1?this.getContents().packageDirectories[r]:t,t),i=r>-1?this.getContents().packageDirectories.map((a,o)=>o===r?t:a):[...this.getContents()?.packageDirectories??[],n];this.set("packageDirectories",i)}getPackageBundles(){return this.get("packageBundles")??[]}addPackageBundle(t){let r=this.getPackageBundles(),n=r.findIndex(o=>o.name===t.name),i={...n>-1?r[n]:t,...t},a=n>-1?r.map(o=>o.name===t.name?i:o):[...r,i];this.set("packageBundles",a)}hasPackageBundleAliases(){return Object.keys(this.getContents().packageBundleAliases??{}).length>0}getPackageBundleAliases(){return this.get("packageBundleAliases")}addPackageBundleAlias(t,r){let n={...this.get("packageBundleAliases")??{},[t]:r};this.set("packageBundleAliases",n)}doesPackageExist(t){return Xrt.fs.existsSync(t)}validateKeys(){(0,tnt.ensureNoUppercaseKeys)(this.getPath())(e.BLOCKLIST)(this.toObject())}};hi.SfProjectJson=oc;var mD=class e{path;static instances=new Map;projectConfig;sfProjectJson;sfProjectJsonGlobal;packageDirectories;activePackage;packageAliases;packageBundleAliases;constructor(t){this.path=t}static clearInstances(){e.instances.clear()}static async resolve(t){let r=await this.resolveProjectPath(t??process.cwd());return this.getMemoizedInstance(r)}static getInstance(t){let r=this.resolveProjectPathSync(t??process.cwd());return this.getMemoizedInstance(r)}static async resolveProjectPath(t){return(0,fD.resolveProjectPath)(t)}static resolveProjectPathSync(t){return(0,fD.resolveProjectPathSync)(t)}static getMemoizedInstance(t){if(!e.instances.has(t)){let r=new e(t);e.instances.set(t,r)}return(0,Krt.ensure)(e.instances.get(t))}getPath(){return this.path}async retrieveSfProjectJson(t=!1){let r=oc.getDefaultOptions(t);return t?(this.sfProjectJsonGlobal||(this.sfProjectJsonGlobal=await oc.create(r)),this.sfProjectJsonGlobal):(r.rootFolder=this.getPath(),this.sfProjectJson||(this.sfProjectJson=await oc.create(r)),this.sfProjectJson)}getSfProjectJson(t=!1){let r=oc.getDefaultOptions(t);return t?(this.sfProjectJsonGlobal||(this.sfProjectJsonGlobal=new oc(r),this.sfProjectJsonGlobal.readSync()),this.sfProjectJsonGlobal):(r.rootFolder=this.getPath(),this.sfProjectJson||(this
If you still see this error after enabling the Dev Hub feature, then re-authenticate to the org.`]])),$nt=new wle.Messages("@salesforce/core","scratchOrgErrorCodes",new Map([["SignupFailedError","The request to create a scratch org failed with error code: %s."],["SignupFailedUnknownError","An unknown server error occurred. Please try again. If you still see this error, contact Salesforce support for assistance. Include the information from 'sfdx force:data:record:get -s ScratchOrgInfo -i %s -u %s'."],["SignupFailedActionError","See https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_error_codes.htm for information on error code %s."],["SignupUnexpectedError","The request to create a scratch org returned an unexpected status"],["StillInProgressError","The scratch org isn't ready yet (Status = %s)."],["action.StillInProgress","Wait for a few minutes, and then try the command again"],["NoScratchOrgInfoError","No ScratchOrgInfo object found in the Dev Hub you specified. Check that the ID and the Dev Hub are correct."],["ScratchOrgDeletedError","That scratch org has been deleted, so you can't connect to it anymore."],["INVALID_ID_FIELD","Provide a valid template ID, in the format 0TTxxxxxxxxxxxx."],["T-0002","We couldn\u2019t find a template or snapshot with the ID or name specified in the scratch org definition. If you\u2019re sure the ID is correct, contact Salesforce Support."],["T-0003","The template specified in the scratch org definition is unapproved. Contact Salesforce Support to request template approval."],["T-0004","The Trialforce Source Organization (TSO) for the template doesn\u2019t exist or has expired."],["S-1006","Provide a valid email address in your scratch org definition or your %s file."],["S-2006","Provide a valid country code in your scratch org definition or your %s file."],["S-1017","Specify a namespace that\u2019s used by a release org associated with your Dev Hub org."],["S-1018","Provide a valid My Domain value. This value can\u2019t include double hyphens, end in a hyphen, include restricted words, or be more than 40 characters long."],["S-1019","The My Domain value you chose is already in use."],["S-1026","Provide a valid namespace value. This value must begin with a letter. It can\u2019t include consecutive underscores, end in an underscore, be more than 15 characters long, or be a restricted or reserved namespace. Only alphanumeric characters and underscores are allowed."],["S-9999","A fatal signup error occurred. Please try again. If you still see this error, contact Salesforce Support for assistance."],["SH-0001","Can\u2019t create scratch org. Contact the source org admin to add your Dev Hub org ID to Setup > Org Shape. Then try again."],["SH-0002","Can\u2019t create scratch org. No org shape exists for the specified sourceOrg. Create an org shape and try again."],["SH-0003","Can\u2019t create scratch org from org shape. The org shape version is outdated. Recreate the org shape and try again."],["C-1007","The username provided to the org:create command is already in use. Run 'force:org:list --clean' to remove stale org authentications or create the org with a different username."],["C-1015","We encountered a problem while registering your My Domain value with the DNS provider. Please try again."],["C-1016","We encountered a problem while attempting to configure and approve the Connected App for your org. Verify the Connected App configuration with your Salesforce admin."],["C-1017","Provide a valid namespace prefix. This value must begin with a letter. It can\u2019t include consecutive underscores, end in an underscore, be more than 15 characters long, or be a restricted or reserved namespace. Only alphanumeric characters and underscores are allowed."],["C-1020","We couldn't find a template with the ID specified in the scratch org definition. If you\u2019re sure the ID is correct, contact Salesforce Support."],["C-1027","The template specified in the Scratch Definition isn\u2019t supported. Specify a generic edition (such as Developer or Enterprise
${(0,Dnt.inspect)(u)}`),c}}else throw c}return await l.save({devHubUsername:r.getUsername(),created:new Date(t.CreatedDate??new Date).valueOf().toString(),expirationDate:t.ExpirationDate,clientId:t.ConnectedAppConsumerKey,createdOrgInstance:t.SignupInstance,isDevHub:!1,isScratch:!0,isSandbox:!1,...t.Namespace?{namespacePrefix:t.Namespace}:{},...t.Snapshot?{snapshot:t.Snapshot}:{}}),l};wr.authorizeScratchOrg=Bnt;var Vnt=async e=>{let t=Object.keys(e).find(n=>n.toUpperCase()==="USERNAME");if(!t)return;let r=e[t];if(r&&r.length>0){try{await _D.AuthInfo.create({username:r.toLowerCase()})}catch(n){let i=al.SfError.wrap(n);if(i.name==="NamedOrgNotFoundError")return;throw i}throw $nt.createError("C-1007")}},Wnt=async(e,t,r)=>{if(!e.isDevHubOrg())throw AS.createError("hubOrgIsNotDevHub",[e.getUsername(),e.getOrgId()]);if(t.orgPreferences&&r.hasSettings())throw new al.SfError("SignupDuplicateSettingsSpecifiedError");if(t.orgPreferences)throw new al.SfError(AS.getMessage("DeprecatedPrefFormat"));let n=(0,Mnt.default)((0,ol.omit)(t,["settings","objectSettings"]),ol.upperFirst,!0);typeof n.Username=="string"&&(n.Username=n.Username.toLowerCase()),await Vnt(n);try{return await(0,wD.emit)({stage:"send request"}),await e.getConnection().sobject("ScratchOrgInfo").create(n)}catch(i){let a=i;throw a.errorCode==="REQUIRED_FIELD_MISSING"?new al.SfError(AS.getMessage("SignupFieldsMissingError",[a.fields.toString()])):al.SfError.wrap(a)}};wr.requestScratchOrgCreation=Wnt;var Znt=async(e,t,r=ol.Duration.minutes(15))=>{let n=await nh.Logger.child("scratchOrgInfoApi-pollForScratchOrgInfo");n.debug(`PollingTimeout in minutes: ${r.minutes}`);let i={async poll(){try{let o=await(0,wr.queryScratchOrgInfo)(e,t);return n.debug(`polling client result: ${JSON.stringify(o,null,4)}`),o.Status==="Active"||o.Status==="Error"?{completed:!0,payload:o}:(await(0,wD.emit)({stage:"wait for org",scratchOrgInfo:o}),n.debug(`Scratch org status is ${o.Status}`),{completed:!1})}catch(o){return n.debug(`An error occurred trying to retrieve scratchOrgInfo for ${t}`),n.debug(`Error: ${o.message}`),n.debug("Re-trying deploy check again...."),{completed:!1}}},timeout:r,frequency:ol.Duration.seconds(1),timeoutErrorName:"ScratchOrgInfoTimeoutError"},a=await Nnt.PollingClient.create(i);try{let o=await a.subscribe();return await(0,Fnt.checkScratchOrgInfoForErrors)(o,e.getUsername())}catch(o){if(o instanceof Error){let s=al.SfError.wrap(o);throw s.setData({username:e.getUsername(),orgId:e.getOrgId(),scratchOrgInfoId:t}),s}throw new al.SfError(`The scratch org did not complete within ${r.minutes} minutes`,"orgCreationTimeout",["Try your force:org:create command again with a longer --wait value"])}};wr.pollForScratchOrgInfo=Znt;var Hnt=async(e,t,r,n=ol.Duration.minutes(10))=>{let i=await nh.Logger.child("scratchOrgInfoApi-deploySettings");if(t.hasSettings()){i.debug(`deploying scratch org settings with apiVersion ${r}`);try{await t.createDeploy(),await t.deploySettingsViaFolder(e,r,n),await(0,wr.updateRevisionCounterToZero)(e),i.trace("Settings deployed to org")}catch(a){throw al.SfError.wrap(a)}}};wr.deploySettings=Hnt;var Gnt=async e=>{let t=await nh.Logger.child("scratchOrgInfoApi-resolveUrl"),{instanceUrl:r}=e.getFields();if(!r)throw al.SfError.create({message:"Org does not have instanceUrl",data:{orgId:e.getFields().orgId,username:e.getFields().username,instanceUrl:r}});t.debug(`processScratchOrgInfoResult - resultData.instanceUrl: ${r}`);let n={timeout:ol.Duration.minutes(3),frequency:ol.Duration.seconds(10),url:new knt.SfdcUrl(r)};try{return await(await Pnt.MyDomainResolver.create(n)).resolve(),e}catch(i){let a=al.SfError.wrap(i);throw t.debug("processScratchOrgInfoResult - err: %s",i),a.name==="MyDomainResolverTimeoutError"&&(a.setData({orgId:e.getFields().orgId,username:e.getFields().username,instanceUrl:r}),t.debug("processScratchOrgInfoResult - err data: %s",a.data)),a}};wr.resolveUrl=Gnt;var Jnt=async e=>{let t=e.getConnection(),r=await t.tooling.sobject("SourceMember").find({RevisionCounter:{$gt:0}},["Id"]);if(r.length!==0)try{await Promise.all(r.map(n=>t.tooling.sob
`,this.pretty=!0,(0,DS.isUndefined)(t.doubleQuotes)||(this.doubleQuotes=t.doubleQuotes),(0,DS.isUndefined)(t.indent)||(this.indent=t.indent),(0,DS.isUndefined)(t.newline)||(this.newline=t.newline),(0,DS.isUndefined)(t.pretty)||(this.pretty=t.pretty)}return e}();LS.StringOptions=rit});var kS=h(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.escapeDoubleQuotes=Fa.escapeSingleQuotes=Fa.escapeRightAngleBracketsInCdataTerminator=Fa.escapeLeftAngleBrackets=Fa.escapeAmpersands=void 0;function nit(e){return e.replace(/&/g,"&amp;")}Fa.escapeAmpersands=nit;function iit(e){return e.replace(/</g,"&lt;")}Fa.escapeLeftAngleBrackets=iit;function ait(e){return e.replace(/]]>/g,"]]&gt;")}Fa.escapeRightAngleBracketsInCdataTerminator=ait;function oit(e){return e.replace(/'/g,"&apos;")}Fa.escapeSingleQuotes=oit;function sit(e){return e.replace(/"/g,"&quot;")}Fa.escapeDoubleQuotes=sit});var xD=h(ED=>{"use strict";Object.defineProperty(ED,"__esModule",{value:!0});var lit=pn(),Sle=kS(),SD=kr(),cit=function(){function e(t,r,n){this._validation=r,(0,SD.isUndefined)(n.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=n.replaceInvalidCharsInCharData,this._parent=t,this.charData=n.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,SD.fixChar)(t);else if(this._validation&&!(0,SD.validateChar)(t))throw new Error((0,lit.getContext)(this.up())+": attribute text"+(' "'+t+'" should not contain characters not')+" allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t=this._charData;return t=(0,Sle.escapeAmpersands)(t),t=(0,Sle.escapeLeftAngleBrackets)(t),t},e.prototype.up=function(){return this._parent},e}();ED.default=cit});var NS=h(OD=>{"use strict";Object.defineProperty(OD,"__esModule",{value:!0});var Ele=pn(),xle=kr(),uit=function(){function e(t,r,n){this._hex=!1,this._validation=r,this._parent=t,this.char=n.char,(0,xle.isUndefined)(n.hex)||(this.hex=n.hex)}return Object.defineProperty(e.prototype,"char",{get:function(){return this._char},set:function(t){if(this._validation&&!(0,xle.validateSingleChar)(t))throw new Error((0,Ele.getContext)(this.up())+": character reference"+(' "'+t+'" should reference a single character,')+" and this character should be allowed in XML");this._char=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hex",{get:function(){return this._hex},set:function(t){this._hex=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t;if(this._char.length===1)t=this._char.charCodeAt(0);else{var r=this._char.charCodeAt(0);if(r>=55296&&r<=56319&&this._char.length>1){var n=this._char.charCodeAt(1);if(n>=56320&&n<=57343)t=(r-55296)*1024+n-56320+65536;else throw new Error((0,Ele.getContext)(this.up())+": character"+(' reference "'+this.char+'" should')+" reference a valid Unicode character")}else t=r}return this._hex?"&#x"+t.toString(16)+";":"&#"+t+";"},e.prototype.up=function(){return this._parent},e}();OD.default=uit});var PS=h(CD=>{"use strict";Object.defineProperty(CD,"__esModule",{value:!0});var dit=pn(),pit=kr(),fit=function(){function e(t,r,n){this._validation=r,this._parent=t,this.name=n.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._validation&&!(0,pit.validateName)(t))throw new Error((0,dit.getContext)(this.up())+": entity reference name"+(' "'+t+'" should not contain characters not')+" allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"&"+this._name+";"},e.prototype.up=function(){return this._parent},e}();CD.default=fit});var jS=h(hy=>{"use strict";var AD=hy&&hy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hy,"__esModule",{value:!0});var TD=pn(),Ole=kS(),mit=ah(),ID=kr(),hit=AD(xD()),git=AD(NS()),yit=AD(PS()),bit=function(){function e(t,r,n){this._validation=r,(0,ID.isUndefined)(n.replaceInvalidCh
\0`,k+=Lt(j,2),k+=s.magic,k+=Lt(_,2),k+=Lt(S,2),k+=Lt(P.crc32,4),k+=Lt(P.compressedSize,4),k+=Lt(P.uncompressedSize,4),k+=Lt(c.length,2),k+=Lt(E.length,2);var B=N5.LOCAL_FILE_HEADER+k+c+E,$=N5.CENTRAL_FILE_HEADER+Lt(N,2)+k+Lt(f.length,2)+"\0\0\0\0"+Lt(T,4)+Lt(n,4)+c+E+f;return{fileRecord:B,dirRecord:$}},Tct=function(e,t,r,n,i){var a="",o=Ah.transformTo("string",i(n));return a=N5.CENTRAL_DIRECTORY_END+"\0\0\0\0"+Lt(e,2)+Lt(e,2)+Lt(t,4)+Lt(r,4)+Lt(o.length,2)+o,a},Ict=function(e){var t="";return t=N5.DATA_DESCRIPTOR+Lt(e.crc32,4)+Lt(e.compressedSize,4)+Lt(e.uncompressedSize,4),t};function Co(e,t,r,n){Dh.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Ah.inherits(Co,Dh);Co.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,Dh.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))};Co.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=dpe(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0};Co.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=dpe(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:Ict(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};Co.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=Tct(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})};Co.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};Co.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(r){t.processChunk(r)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(r){t.error(r)}),this};Co.prototype.resume=function(){if(!Dh.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};Co.prototype.error=function(e){var t=this._sources;if(!Dh.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch{}return!0};Co.prototype.lock=function(){Dh.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};ppe.exports=Co});var hpe=h(mpe=>{"use strict";var Act=Ak(),Dct=fpe(),Lct=function(e,t){var r=e||t,n=Act[r];if(!n)throw new Error(r+" is not a valid compression method !");return n};mpe.generateWorker=function(e,t,r){var n=new Dct(t.streamFiles,r,t.platform,t.encodeFileName),i=0;try{e.forEach(function(a,o){i++;var s=Lct(o.options.compression,t.compression),l=o.options.compressionOptions||t.compressionOptions||{},c=o.dir,u=o.date;o._compressWorker(s,l).withStreamInfo("file",{name:a,dir:c,date:u,comment:o.comment||"",unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions}).pipe(n)}),n.entriesCount=i}catch(a){n.error(a)}return n}});var ype=h((_8t,gpe)=>{"use strict";var kct=Jt(),P5=Xi();function rb(e,t){P5.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}kct.inherits(rb,P5);rb.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(r){t.push({data:r,meta:{per
`);throw _ut.SfError.create({message:`A scratch org was created with username ${i??"<undefined>"}, but the settings failed to deploy due to:
${m}`,name:"ProblemDeployingSettings",data:{...c,username:i}})}}async createDeployPackageContents(t){let r=(0,hn.createObjectFileContent)({allRecordTypes:this.allRecordTypes,allBusinessProcesses:this.allBusinessProcesses,apiVersion:t,settingData:this.settingData,objectSettingsData:this.objectSettingsData}),n=Bk.parse("Package",r);await this.writer.addToStore(n,this.packageFilePath),await this.writer.finalize()}getShapeDirName(){return this.shapeDirName}getDestinationPath(){return this.writer.getDestinationPath()}async writeObjectSettingsIfNeeded(t,r,n){this.objectSettingsData&&await Promise.all(Object.entries(this.objectSettingsData).map(([i,a])=>{let o=(0,hn.createRecordTypeAndBusinessProcessFileContent)(i,a,r,n,this.capitalizeRecordTypes),s=Bk.parse("CustomObject",o);return this.writer.addToStore(s,$p.join(t,(0,Qi.upperFirst)(i)+".object"))}))}async writeSettingsIfNeeded(t){this.settingData&&await Promise.all(Object.entries(this.settingData).map(([r,n])=>{let i=(0,Qi.upperFirst)(r),a=i.replace("Settings",""),o=Bk.parse(i,n);return this.writer.addToStore(o,$p.join(t,a+".settings"))}))}};hn.default=Wk});var ofe=h($5=>{"use strict";Object.defineProperty($5,"__esModule",{value:!0});$5.simpleFeaturesList=void 0;$5.simpleFeaturesList=["AIAttribution","API","AccountInspection","AccountingSubledgerGrowthEdition","AccountingSubledgerStarterEdition","AccountingSubledgerUser","AdmissionsConnectUser","AdvisorLinkFeature","AdvisorLinkPathwaysFeature","AllUserIdServiceAccess","AnalyticsAdminPerms","AnalyticsAppEmbedded","ApexGuruCodeAnalyzer","ApexUserModeWithPermSet","ArcGraphCommunity","Assessments","AssociationEngine","AuthorApex","B2BCommerce","B2BLoyaltyManagement","B2CCommerceGMV","B2CLoyaltyManagement","B2CLoyaltyManagementPlus","BYOCCaaS","BYOOTT","BatchManagement","BenefitManagement","BigObjectsBulkAPI","BillingAdvanced","Briefcase","BudgetManagement","BusinessRulesEngine","CGAnalytics","CMSMaxContType","CMSMaxNodesPerContType","CMSUnlimitedUse","CPQ","CacheOnlyKeys","CampaignInfluence2","CascadeDelete","CaseClassification","CaseWrapUp","ChangeDataCapture","Chatbot","ChatterEmailFooterLogo","ChatterEmailFooterText","ChatterEmailSenderName","CloneApplication","Communities","CompareReportsOrgPerm","ConAppPluginExecuteAsUser","ConnectedAppCustomNotifSubscription","ConnectedAppToolingAPI","ConsentEventStream","ContactsToMultipleAccounts","ContractApprovals","ContractManagement","ContractMgmtInd","CoreCpq","CustomFieldDataTranslation","CustomNotificationType","CustomerDataPlatform","CustomerDataPlatformLite","CustomerExperienceAnalytics","DSARPortability","DataComDnbAccounts","DataComFullClean","DataMaskUser","DataProcessingEngine","DebugApex","DecisionTable","DefaultWorkflowUser","DeferSharingCalc","DevOpsCenter","DevelopmentWave","DeviceTrackingEnabled","DisableManageIdConfAPI","DisclosureFramework","Division","DocGen","DocGenDesigner","DocGenInd","DocumentChecklist","DocumentReaderPageLimit","DurableClassicStreamingAPI","DurableGenericStreamingAPI","DynamicClientCreationLimit","EAOutputConnectors","EASyncOut","EAndUDigitalSales","EAndUSelfServicePortal","ERMAnalytics","EdPredictionM3Threshold","EdPredictionTimeout","EdPredictionTimeoutBulk","EdPredictionTimeoutByomBulk","Einstein1AIPlatform","EinsteinAnalyticsPlus","EinsteinArticleRecommendations","EinsteinBuilderFree","EinsteinDocReader","EinsteinGPTForDevelopers","EinsteinRecommendationBuilder","EinsteinRecommendationBuilderMetadata","EinsteinSalesRepFdbk","EinsteinSearch","EinsteinVisits","EinsteinVisitsED","EmbeddedLoginForIE","EnableManageIdConfUI","EnablePRM","EnableSetPasswordInApi","Enablement","EnergyAndUtilitiesCloud","Entitlements","EntityTranslation","EventLogFile","ExcludeSAMLSessionIndex","Explainability","ExpressionSetMaxExecPerHour","ExternalIdentityLogin","FSCAlertFramework","FSCServiceProcess","FieldAuditTrail","FieldServiceMobileExtension","FinanceLogging","FinancialServicesInsuranceUser","FlowSites","ForceComPlatform","ForecastEnableCustomField","Functions","Fundraising","GenericStreaming","Grantmaking","GuidanceHubAllowed","HLSAnalytics","HealthCloudAddO
`);return await hfe.Lifecycle.getInstance().emitWarning(`Scratch org definition validation issues in ${t}:
${n}`),e}return r.data},Yut=async e=>{try{let t=await qut.fs.promises.readFile(e,"utf8"),r=(0,Uut.parseJson)(t);delete r.$schema;let n=mfe.ScratchOrgDefSchema.safeParse(r);if(n.success)return n.data;{let i=n.error.issues.map(a=>`${a.path.join(".")}: ${a.message}`).join(`
`);return await hfe.Lifecycle.getInstance().emitWarning(`Scratch org definition validation issues in ${e}:
${i}`),r}}catch(t){let r=t;throw r.name==="JsonParseError"?new yl.SfError(`An error occurred parsing ${e}`):yl.SfError.wrap(r)}}});var Yk=h(Io=>{"use strict";var Qut=Io&&Io.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Io,"__esModule",{value:!0});Io.scratchOrgCreate=Io.scratchOrgResume=Io.DEFAULT_STREAM_TIMEOUT_MINUTES=void 0;var W5=He(),edt=Ke(),tdt=bt(),Kk=yt(),Xk=rc(),bfe=Tu(),rdt=uy(),ndt=Rf(),idt=wt(),Z5=ih(),vc=vD(),vfe=Qut(Zk()),yfe=gfe(),adt=sc(),Gu=fy(),_fe=IS(),odt=bD(),ab=new tdt.Messages("@salesforce/core","scratchOrgCreate",new Map([["UnsupportedSnapshotOrgCreateOptionsError","Org snapshots don\u2019t support one or more options you specified: %s."],["DurationDaysValidationMinError","Expected 'durationDays' greater than or equal to %s but received %s."],["DurationDaysValidationMaxError","Expected 'durationDays' less than or equal to %s but received %s."],["DurationDaysNotIntError","Expected 'durationDays' to be an integer number."],["RetryNotIntError","Expected 'retry' to be an integer number."],["CacheMissError","The ScratchOrgInfoId %s was not found in the cache."]]));Io.DEFAULT_STREAM_TIMEOUT_MINUTES=6;var sdt=e=>{if(Number.isInteger(e)){if(e<1)throw ab.createError("DurationDaysValidationMinError",[1,e]);if(e>30)throw ab.createError("DurationDaysValidationMaxError",[30,e]);return}throw ab.createError("DurationDaysNotIntError")},ldt=e=>{if(!Number.isInteger(e))throw ab.createError("RetryNotIntError")},cdt=async(e,t=W5.Duration.minutes(15))=>{let[r,n]=await Promise.all([Kk.Logger.child("scratchOrgResume"),_fe.ScratchOrgCache.create(),(0,Gu.emit)({stage:"send request"})]);r.debug(`resuming scratch org creation for jobId: ${e}`);let i=n.get(e,!0);if(!i)throw ab.createError("CacheMissError",[e]);let{hubUsername:a,apiVersion:o,clientSecret:s,signupTargetLoginUrlConfig:l,definitionjson:c,alias:u,setDefault:d,tracksSource:f}=i,p=l??await wfe();p&&r.debug(`resuming org create with LoginUrl override= ${p}`);let m=await Z5.Org.create({aliasOrUsername:a}),y=await(0,odt.validateScratchOrgInfoForResume)({jobId:e,hubOrg:m,cache:n,hubUsername:a,timeout:t}),_=y.Username??y.SignupUsername,E=await(await ndt.StateAggregator.getInstance()).orgs.exists(_)?await adt.AuthInfo.create({username:_}):await(0,vc.authorizeScratchOrg)({scratchOrgInfoComplete:y,hubOrg:m,clientSecret:s,signupTargetLoginUrl:p,retry:0});await H5(68)(E.handleAliasAndDefaultSettings({alias:u,setDefault:d??!1,setDefaultDevHub:!1,setTracksSource:f??!0}));let w=await Z5.Org.create({aliasOrUsername:_}),v=await Xk.ConfigAggregator.create();await(0,Gu.emit)({stage:"deploy settings",scratchOrgInfo:y});let b=await Sfe(),A=new vfe.default({capitalizeRecordTypes:b});await A.extract({...y,...c});let[P]=await H5(68)(Promise.all([(0,vc.resolveUrl)(E),(0,vc.deploySettings)(w,A,o??v.getPropertyValue(bfe.OrgConfigProperties.ORG_API_VERSION)??await w.retrieveMaxApiVersion())]));n.unset(y.Id??e);let j=P.getFields();return await Promise.all([(0,Gu.emit)({stage:"done",scratchOrgInfo:y}),n.write(),(0,Gu.emitPostOrgCreate)(j)]),{username:_,scratchOrgInfo:y,authInfo:P,authFields:j,warnings:[]}};Io.scratchOrgResume=cdt;var udt=async e=>{let t=await Kk.Logger.child("scratchOrgCreate"),r=Date.now();t.debug("preparing scratch org signup request..."),await(0,Gu.emit)({stage:"prepare request"});let{hubOrg:n,connectedAppConsumerKey:i,durationDays:a=1,nonamespace:o,noancestors:s,wait:l=W5.Duration.minutes(Io.DEFAULT_STREAM_TIMEOUT_MINUTES),retry:c=0,apiversion:u,definitionjson:d,definitionfile:f,orgConfig:p,clientSecret:m=void 0,alias:y,setDefault:_=!1,tracksSource:S=!0}=e;sdt(a),ldt(c);let{scratchOrgInfoPayload:E,ignoreAncestorIds:w,warnings:v}=await(0,yfe.getScratchOrgInfoPayload)({definitionjson:d,definitionfile:f,connectedAppConsumerKey:i,durationDays:a,nonamespace:o,noancestors:s,orgConfig:p}),b=await(0,yfe.generateScratchOrgInfo)({hubOrg:n,scratchOrgInfoPayload:E,nonamespace:o,ignoreAncestorIds:w}),A=await Sfe(),P=new vfe.default({capitalizeRecordTypes:A}),j=await P.extract(b);t.debug(`the scratch org def file has settings: ${P.hasSettings
Due to: %s`],["jwtAuthError","Error authenticating with JWT config due to: %s"],["jwtAuthErrors",`Error authenticating with JWT.
Errors encountered:
%s`],["refreshTokenAuthError","Error authenticating with the refresh token due to: %s"],["invalidSfdxAuthUrlError",`Invalid SFDX authorization URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the "instanceUrl" inside the SFDX authorization URL doesn\\'t include the protocol ("https://"). Run "org display --target-org" on an org to see an example of an SFDX authorization URL.`],["orgDataNotAvailableError","An attempt to refresh the authentication token failed with a 'Data Not Found Error'. The org identified by username %s does not appear to exist. Likely cause is that the org was deleted by another user or has expired."],["orgDataNotAvailableError.actions",["Run `sfdx force:org:list --clean` to remove stale org authentications.","Use `sfdx force:config:set` to update the defaultusername.","Use `sfdx force:org:create` to create a new org.","Use `sfdx auth` to authenticate an existing org."]],["namedOrgNotFound","No authorization information found for %s."],["noAliasesFound","Nothing to set."],["invalidFormat","Setting aliases must be in the format <key>=<value> but found: [%s]."],["invalidJsonCasing",'All JSON input must have heads down camelcase keys. E.g., `{ sfdcLoginUrl: "https://login.salesforce.com" }`\nFound "%s" at %s'],["missingClientId","Client ID is required for JWT authentication."]]));function sN(e){let t=e.split("/"),r=t.pop(),n=t.pop();return{userId:r,orgId:n,url:e}}Pr.DEFAULT_CONNECTED_APP_INFO={clientId:"PlatformCLI",clientSecret:""};Pr.CODE_BUILDER_CONNECTED_APP_INFO={clientId:"CodeBuilder",clientSecret:""};var lN=class e extends jh.AsyncOptionalCreatable{usingAccessToken=!1;logger;stateAggregator;username;options;constructor(t){super(t),this.options=t??{}}static getDefaultInstanceUrl(){return iN.ConfigAggregator.getValue(K5.OrgConfigProperties.ORG_INSTANCE_URL)?.value??bl.SfdcUrl.PRODUCTION}static async listAllAuthorizations(t=r=>!!r){let r=await J5.StateAggregator.getInstance(),n=(await iN.ConfigAggregator.create()).getConfigInfo(),i=await r.orgs.readAll(),a=[];for(let o of i){let s=(0,Ct.ensureString)(o.username),l=r.aliases.getAll(s)??void 0,c=n.filter(u=>l.includes(u.value)||u.value===s).map(u=>u.key);try{let u=await e.create({username:s}),{orgId:d,instanceUrl:f,devHubUsername:p,expirationDate:m,isDevHub:y}=u.getFields();a.push({aliases:l,configs:c,username:s,instanceUrl:f,isScratchOrg:!!p,isDevHub:y??!1,isSandbox:await r.sandboxes.hasFile(d),orgId:d,accessToken:u.getConnectionOptions().accessToken,oauthMethod:u.isJwt()?"jwt":u.isOauth()?"web":"token",isExpired:p&&m?new Date((0,Ct.ensureString)(m)).getTime()<new Date().getTime():"unknown"})}catch(u){a.push({aliases:l,configs:c,username:s,orgId:o.orgId,instanceUrl:o.instanceUrl,accessToken:void 0,oauthMethod:"unknown",error:u.message,isExpired:"unknown"})}}return a.filter(t)}static async hasAuthentications(){try{let t=await(await J5.StateAggregator.getInstance()).orgs.list();return!(0,jh.isEmpty)(t)}catch(t){let r=t;if(r.name==="OrgDataNotAvailableError"||r.code==="ENOENT")return!1;throw r}}static getAuthorizationUrl(t,r){let n=r??new lb.OAuth2({useVerifier:!0,...t}),i={state:t.state??(0,Tdt.randomBytes)(Math.ceil(6)).toString("hex"),prompt:"login",scope:t.scope??jh.env.getString("SFDX_AUTH_SCOPES","refresh_token api web")};return n.getAuthorizationUrl(i)}static parseSfdxAuthUrl(t){let r=t.match(/^force:\/\/([a-zA-Z0-9._-]+={0,2}):([a-zA-Z0-9._-]*={0,2}):([a-zA-Z0-9._-]+={0,2})@([a-zA-Z0-9:._-]+)/);if(!r)throw new Ec.SfError(Lo.getMessage("invalidSfdxAuthUrlError"),"INVALID_SFDX_AUTH_URL");let[,n,i,a,o]=r;return{clientId:n,clientSecret:i,refreshToken:a,loginUrl:`https://${o}`}}static async identifyPossibleScratchOrgs(t,r){let n=await aN.Logger.child("Common",{tag:"identifyPossibleScratchOrgs"});if(await(0,Nfe.determineOrg)(r),t.isDevHub||t.devHubUsername||!t.orgId)return;n.debug("getting devHubs and prod orgs to identify scratch orgs and sandboxes");let i=await e.getDevHubAuthInfos(),a=await e.listAllAuthorizations(o=>o&&!o.isScratchOrg&&!o.isSandbox);n.debug(`found ${i.length} DevHubs`),n.debug(
`)]),"JwtAuthError");let u={accessToken:(0,Ct.asString)(s.access_token),orgId:sN((0,Ct.ensureString)(s.id)).orgId,loginUrl:t.loginUrl,privateKey:t.privateKey,clientId:t.clientId},d=(0,Ct.ensureString)(s.instance_url),f=new bl.SfdcUrl(d);try{await f.lookup(),u.instanceUrl=d}catch{this.logger.debug(`Instance URL [${s.instance_url}] is not available. DNS lookup failed. Using loginUrl [${t.loginUrl}] instead. This may result in a "Destination URL not reset" error.`),u.instanceUrl=t.loginUrl}return u}async tryJwtAuth(t,r,n,i){let a=Adt.sign({iss:t,sub:this.getUsername(),aud:n,exp:Date.now()+300},i,{algorithm:"RS256"}),o=new lb.OAuth2({loginUrl:r});return(0,Ct.ensureJsonMap)(await o.requestToken({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:a}))}async buildRefreshTokenConfig(t){let r={...t,redirectUri:t.redirectUri??this.getRedirectUri(),...t.clientId?{}:{clientId:Pr.DEFAULT_CONNECTED_APP_INFO.clientId,clientSecret:Pr.DEFAULT_CONNECTED_APP_INFO.clientSecret}},n=new lb.OAuth2(r),i;try{i=await n.refreshToken((0,Ct.ensure)(r.refreshToken))}catch(s){let l=s instanceof Error?s:Ec.SfError.wrap(s);throw Lo.createError("refreshTokenAuthError",[l.message],void 0,l)}let{orgId:a}=sN(i.id),o=this.getUsername();if(!o){let s=await this.retrieveUserInfo(i.instance_url,i.access_token);o=(0,Ct.ensureString)(s?.username)}return{orgId:a,username:o,accessToken:i.access_token,instanceUrl:i.instance_url,loginUrl:r.loginUrl??i.instance_url,refreshToken:r.refreshToken,clientId:r.clientId,clientSecret:r.clientSecret}}async exchangeToken(t,r=new lb.OAuth2(t)){r.redirectUri||(r.redirectUri=this.getRedirectUri()),r.clientId||(r.clientId=this.getClientId());let n;try{this.logger.debug(`Exchanging auth code for access token using loginUrl: ${t.loginUrl??"<undefined>"}`),n=await r.requestToken((0,Ct.ensure)(t.authCode)),this.logger.debug(`Successfully requested an access token with scopes: "${n.scope}".`)}catch(o){let s=o instanceof Error?`${o.name}::${o.message}`:typeof o=="string"?o:"UNKNOWN",l=(0,Ldt.filterSecrets)(t);throw Ec.SfError.create({message:Lo.getMessage("authCodeExchangeError",[s]),name:"AuthCodeExchangeError",...o instanceof Error?{cause:o}:{},data:(0,Ct.isArray)(l)?l[0]:l})}let{orgId:i}=sN(n.id),a=this.getUsername();return a||(a=(await this.retrieveUserInfo(n.instance_url,n.access_token))?.username),{accessToken:n.access_token,instanceUrl:n.instance_url,orgId:i,username:a,loginUrl:t.loginUrl??n.instance_url,refreshToken:n.refresh_token,clientId:t.clientId,clientSecret:t.clientSecret}}async retrieveUserInfo(t,r){let n="v51.0",i=(0,Ct.ensure)(t),a=new bl.SfdcUrl(i),o=`${a.toString()}services/oauth2/userinfo`,s=Object.assign({Authorization:`Bearer ${r}`},kfe.SFDX_HTTP_HEADERS);try{this.logger.info(`Sending request for Username after successful auth code exchange to URL: ${o}`);let l=await new nN.default().httpRequest({url:o,method:"GET",headers:s});if(l.statusCode>=400)this.throwUserGetException(l);else{let c=(0,jh.parseJsonMap)(l.body),u=`${a.toString()}services/data/${n}/sobjects/User/${c.user_id}`;return this.logger.info(`Sending request for User SObject after successful auth code exchange to URL: ${u}`),l=await new nN.default().httpRequest({url:u,method:"GET",headers:s}),l.statusCode>=400?this.throwUserGetException(l):c.preferred_username=(0,jh.parseJsonMap)(l.body).Username,{username:c.preferred_username,organizationId:c.organization_id}}}catch(l){throw Lo.createError("authCodeUsernameRetrievalError",[l.message])}}throwUserGetException(t){let r="",n=t.body??JSON.stringify({message:"UNKNOWN",errorCode:"UNKNOWN"});try{let i=(0,jh.parseJson)(n);(0,Ct.isArray)(i)?r=i.map(a=>a.message??a.errorCode??"UNKNOWN").join(Idt.EOL):r=i.message??i.errorCode??"UNKNOWN"}catch{r=`${n}`}throw new Ec.SfError(r)}async determineIfDevHub(t,r){let n="v51.0",i=(0,Ct.ensure)(t),o=`${new bl.SfdcUrl(i).toString()}/services/data/${n}/query?q=SELECT%20Id%20FROM%20ScratchOrgInfo%20limit%201`,s=Object.assign({Authorization:`Bearer ${r}`},kfe.SFDX_HTTP_HEADERS);try{return!((await new nN.default().httpRequest({url:o,method:"GET",headers:s})).statusC
`:""},this._extScope=t,this._scope=new ko.Scope({parent:t}),this._nodes=[new ON]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let a=this._scope.toName(r);return n!==void 0&&i&&(this._constants[a.str]=n),this._leafNode(new vN(t,a,n)),a}const(t,r,n){return this._def(ko.varKinds.const,t,r,n)}let(t,r,n){return this._def(ko.varKinds.let,t,r,n)}var(t,r,n){return this._def(ko.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new o8(t,r,n))}add(t,r){return this._leafNode(new _N(t,Ue.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==et.nil&&this._leafNode(new xN(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,et.addCodeArg)(r,i));return r.push("}"),new et._Code(r)}if(t,r,n){if(this._blockNode(new zp(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new zp(t))}else(){return this._elseNode(new Rh)}endIf(){return this._endBlockNode(zp,Rh)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new CN(t),r)}forRange(t,r,n,i,a=this.opts.es5?ko.varKinds.var:ko.varKinds.let){let o=this._scope.toName(t);return this._for(new TN(a,o,r,n),()=>i(o))}forOf(t,r,n,i=ko.varKinds.const){let a=this._scope.toName(t);if(this.opts.es5){let o=r instanceof et.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,et._)`${o}.length`,s=>{this.var(a,(0,et._)`${o}[${s}]`),n(a)})}return this._for(new s8("of",i,a,r),()=>n(a))}forIn(t,r,n,i=this.opts.es5?ko.varKinds.var:ko.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,et._)`Object.keys(${r})`,n);let a=this._scope.toName(t);return this._for(new s8("in",i,a,r),()=>n(a))}endFor(){return this._endBlockNode(qp)}label(t){return this._leafNode(new wN(t))}break(t){return this._leafNode(new SN(t))}return(t){let r=new mb;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(mb)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new IN;if(this._blockNode(i),this.code(t),r){let a=this.name("e");this._currNode=i.catch=new hb(a),r(a)}return n&&(this._currNode=i.finally=new gb,this.code(n)),this._endBlockNode(hb,gb)}throw(t){return this._leafNode(new EN(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=et.nil,n,i){return this._blockNode(new fb(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(fb)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof zp))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Ue.CodeGen=AN;function Bp(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function l8(e,t){return t in
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(s,(0,je._)`+${i}`);return;case"integer":n.elseIf((0,je._)`${o} === "boolean" || ${i} === null
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(s,(0,je._)`+${i}`);return;case"boolean":n.elseIf((0,je._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(s,!1).elseIf((0,je._)`${i} === "true" || ${i} === 1`).assign(s,!0);return;case"null":n.elseIf((0,je._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(s,null);return;case"array":n.elseIf((0,je._)`${o} === "string" || ${o} === "number"
|| ${o} === "boolean" || ${i} === null`).assign(s,(0,je._)`[${i}]`)}}}function Gpt({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,je._)`${t} !== undefined`,()=>e.assign((0,je._)`${t}[${r}]`,n))}function RN(e,t,r,n=zh.Correct){let i=n===zh.Correct?je.operators.EQ:je.operators.NEQ,a;switch(e){case"null":return(0,je._)`${t} ${i} null`;case"array":a=(0,je._)`Array.isArray(${t})`;break;case"object":a=(0,je._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=o((0,je._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=o();break;default:return(0,je._)`typeof ${t} ${i} ${e}`}return n===zh.Correct?a:(0,je.not)(a);function o(s=je.nil){return(0,je.and)((0,je._)`typeof ${t} == "number"`,s,r?(0,je._)`isFinite(${t})`:je.nil)}}Pn.checkDataType=RN;function FN(e,t,r,n){if(e.length===1)return RN(e[0],t,r,n);let i,a=(0,dme.toHash)(e);if(a.array&&a.object){let o=(0,je._)`typeof ${t} != "object"`;i=a.null?o:(0,je._)`!${t} || ${o}`,delete a.null,delete a.array,delete a.object}else i=je.nil;a.number&&delete a.integer;for(let o in a)i=(0,je.and)(i,RN(o,t,r,n));return i}Pn.checkDataTypes=FN;var Jpt={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,je._)`{type: ${e}}`:(0,je._)`{type: ${t}}`};function $N(e){let t=Kpt(e);(0,Bpt.reportError)(t,Jpt)}Pn.reportTypeError=$N;function Kpt(e){let{gen:t,data:r,schema:n}=e,i=(0,dme.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var hme=h(d8=>{"use strict";Object.defineProperty(d8,"__esModule",{value:!0});d8.assignDefaults=void 0;var qh=Be(),Xpt=it();function Ypt(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)mme(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,a)=>mme(e,a,i.default))}d8.assignDefaults=Ypt;function mme(e,t,r){let{gen:n,compositeRule:i,data:a,opts:o}=e;if(r===void 0)return;let s=(0,qh._)`${a}${(0,qh.getProperty)(t)}`;if(i){(0,Xpt.checkStrictMode)(e,`default is ignored for: ${s}`);return}let l=(0,qh._)`${s} === undefined`;o.useDefaults==="empty"&&(l=(0,qh._)`${l} || ${s} === null || ${s} === ""`),n.if(l,(0,qh._)`${s} = ${(0,qh.stringify)(r)}`)}});var Wa=h(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.validateUnion=St.validateArray=St.usePattern=St.callValidateCode=St.schemaProperties=St.allSchemaProperties=St.noPropertyInData=St.propertyInData=St.isOwnProperty=St.hasPropFunc=St.reportMissingProp=St.checkMissingProp=St.checkReportMissingProp=void 0;var $t=Be(),UN=it(),Qu=Cc(),Qpt=it();function eft(e,t){let{gen:r,data:n,it:i}=e;r.if(qN(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,$t._)`${t}`},!0),e.error()})}St.checkReportMissingProp=eft;function tft({gen:e,data:t,it:{opts:r}},n,i){return(0,$t.or)(...n.map(a=>(0,$t.and)(qN(e,t,a,r.ownProperties),(0,$t._)`${i} = ${a}`)))}St.checkMissingProp=tft;function rft(e,t){e.setParams({missingProperty:t},!0),e.error()}St.reportMissingProp=rft;function gme(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,$t._)`Object.prototype.hasOwnProperty`})}St.hasPropFunc=gme;function zN(e,t,r){return(0,$t._)`${gme(e)}.call(${t}, ${r})`}St.isOwnProperty=zN;function nft(e,t,r,n){let i=(0,$t._)`${t}${(0,$t.getProperty)(r)} !== undefined`;return n?(0,$t._)`${i} && ${zN(e,t,r)}`:i}St.propertyInData=nft;function qN(e,t,r,n){let i=(0,$t._)`${t}${(0,$t.getProperty)(r)} === undefined`;return n?(0,$t.or)(i,(0,$t.not)(zN(e,t,r))):i}St.noPropertyInData=qN;function yme(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}St.allSchemaProperties=yme;function ift(e,t){return yme(t).filter(r=>!(0,UN.alwaysValidSchema)(e,t[r]))}St.schemaProperties=ift;function aft({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:a},it:o},s,l,c){let u=c?(0,$t._)`${e}, ${t}, ${n}${i}`:t,d=[[Qu.default.instancePath,(0,$t.strConcat)(Qu.default.instancePath,a)],[Qu.default.parentData,o.parentData],[Qu.default.parentDataProperty,o.parentDataProperty],[Qu.default.rootData,Qu.default.rootDat
missingProperty: ${n},
depsCount: ${t},
deps: ${r}}`};var T1t={keyword:"dependencies",type:"object",schemaType:"object",error:wl.error,code(e){let[t,r]=I1t(e);Zhe(e,t),Hhe(e,r)}};function I1t({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function Zhe(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let a=r.let("missing");for(let o in t){let s=t[o];if(s.length===0)continue;let l=(0,Mb.propertyInData)(r,n,o,i.opts.ownProperties);e.setParams({property:o,depsCount:s.length,deps:s.join(", ")}),i.allErrors?r.if(l,()=>{for(let c of s)(0,Mb.checkReportMissingProp)(e,c)}):(r.if((0,NP._)`${l} && (${(0,Mb.checkMissingProp)(e,s,a)})`),(0,Mb.reportMissingProp)(e,a),r.else())}}wl.validatePropertyDeps=Zhe;function Hhe(e,t=e.schema){let{gen:r,data:n,keyword:i,it:a}=e,o=r.name("valid");for(let s in t)(0,C1t.alwaysValidSchema)(a,t[s])||(r.if((0,Mb.propertyInData)(r,n,s,a.opts.ownProperties),()=>{let l=e.subschema({keyword:i,schemaProp:s},o);e.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),e.ok(o))}wl.validateSchemaDeps=Hhe;wl.default=T1t});var Khe=h(PP=>{"use strict";Object.defineProperty(PP,"__esModule",{value:!0});var Jhe=Be(),A1t=it(),D1t={message:"property name must be valid",params:({params:e})=>(0,Jhe._)`{propertyName: ${e.propertyName}}`},L1t={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:D1t,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,A1t.alwaysValidSchema)(i,r))return;let a=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},a),t.if((0,Jhe.not)(a),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(a)}};PP.default=L1t});var MP=h(jP=>{"use strict";Object.defineProperty(jP,"__esModule",{value:!0});var A8=Wa(),jo=Be(),k1t=Cc(),D8=it(),N1t={message:"must NOT have additional properties",params:({params:e})=>(0,jo._)`{additionalProperty: ${e.additionalProperty}}`},P1t={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:N1t,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:a,it:o}=e;if(!a)throw new Error("ajv implementation error");let{allErrors:s,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,D8.alwaysValidSchema)(o,r))return;let c=(0,A8.allSchemaProperties)(n.properties),u=(0,A8.allSchemaProperties)(n.patternProperties);d(),e.ok((0,jo._)`${a} === ${k1t.default.errors}`);function d(){t.forIn("key",i,_=>{!c.length&&!u.length?m(_):t.if(f(_),()=>m(_))})}function f(_){let S;if(c.length>8){let E=(0,D8.schemaRefOrVal)(o,n.properties,"properties");S=(0,A8.isOwnProperty)(t,E,_)}else c.length?S=(0,jo.or)(...c.map(E=>(0,jo._)`${_} === ${E}`)):S=jo.nil;return u.length&&(S=(0,jo.or)(S,...u.map(E=>(0,jo._)`${(0,A8.usePattern)(e,E)}.test(${_})`))),(0,jo.not)(S)}function p(_){t.code((0,jo._)`delete ${i}[${_}]`)}function m(_){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){p(_);return}if(r===!1){e.setParams({additionalProperty:_}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,D8.alwaysValidSchema)(o,r)){let S=t.name("valid");l.removeAdditional==="failing"?(y(_,S,!1),t.if((0,jo.not)(S),()=>{e.reset(),p(_)})):(y(_,S),s||t.if((0,jo.not)(S),()=>t.break()))}}function y(_,S,E){let w={keyword:"additionalProperties",dataProp:_,dataPropType:D8.Type.Str};E===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(w,S)}}};jP.default=P1t});var Qhe=h(FP=>{"use strict";Object.defineProperty(FP,"__esModule",{value:!0});var j1t=Sb(),Xhe=Wa(),RP=it(),Yhe=MP(),M1t={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:a}=e;a.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Yhe.default.code(new j1t.KeywordCxt(a,Yhe.default,"additionalProperties"));let o=(0,Xhe.allSchemaProperties)(r);for(let d of o)a.definedProperties.add(d);a.opts.unevaluated&&o.length&&a.props!==!0&&(a.props=RP.mergeEvaluated.props(t,(0,RP.toHash)(o),a.props));let s=o.filter(d=>!(0,RP.alwaysValidSchema)(
${l}`,"ValidationSchemaFieldError")}else throw new ej.SfError("Unknown schema validation error","ValidationSchemaUnknownError");return o}loadExternalSchemas(t){return(0,M8.getJsonValuesByName)(t,"$ref").map(r=>r&&RegExp(/([\w\.]+)#/).exec(r)).map(r=>r?.[1]).filter(r=>!!r).map(r=>this.loadExternalSchema(r))}loadExternalSchema(t){let r=O1e.join(this.schemasDir,`${t}.json`);try{return(0,M8.parseJsonMap)(QP.fs.readFileSync(r,"utf8"))}catch(n){throw n.code==="ENOENT"?new ej.SfError(`Schema not found: ${r}`,"ValidationSchemaNotFound"):n}}getErrorsText(t){return t.map(r=>{let n=`${r.schemaPath}: ${r.message??"<no error message>"}`;switch(r.keyword){case"additionalProperties":return`${n} '${r.params.additionalProperty}'`;case"enum":return`${n} '${r.params.allowedValues.join(", ")}'`;default:return n}}).join(`
`)}};Ga.SchemaValidator=tj});var T1e=h(R8=>{"use strict";Object.defineProperty(R8,"__esModule",{value:!0});R8.CometClient=void 0;var Ugt=require("node:events"),rj=class extends Ugt.EventEmitter{};R8.CometClient=rj});var D1e=h(Ic=>{"use strict";var zgt=Ic&&Ic.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ic,"__esModule",{value:!0});Ic.StreamingClient=Ic.CometClient=void 0;var qgt=require("node:url"),Qh=He(),nj=Ke(),ij=zgt(jI()),A1e=yt(),F8=wt(),Bgt=bt(),Vgt=T1e();Object.defineProperty(Ic,"CometClient",{enumerable:!0,get:function(){return Vgt.CometClient}});var Rb=new Bgt.Messages("@salesforce/core","streaming",new Map([["genericTimeout","Socket timeout occurred while listening for results."],["genericHandshakeTimeout","The streaming request failed to handshake at %s."],["handshakeApiVersionError","Invalid API version specified for streaming connection handshake: %s"],["handshakeApiVersionError.actions",["Set the API version to match the org as an environment variable (e.g., SFDX_API_VERSION=XX.0)."]],["waitParamValidValueError","Invalid value was specified for wait. Please provide a wait value greater than %s minutes."],["invalidApiVersion","Invalid api version is being reported by config (apiVersion=%s)."]]));function I1e(e,t){if(e.milliseconds>=t.milliseconds)return e;throw Rb.createError("waitParamValidValueError",[t.minutes])}var Fb=class e extends Qh.AsyncOptionalCreatable{targetUrl;options;logger;cometClient;constructor(t){super(t),this.options=(0,nj.ensure)(t);let r=(0,nj.ensure)(this.options.org.getConnection().getAuthInfoFields().instanceUrl);this.targetUrl=(0,qgt.resolve)(r,`cometd/${this.options.apiVersion}`),this.cometClient=this.options.streamingImpl.getCometClient(this.targetUrl),this.options.streamingImpl.setLogger(this.log.bind(this)),this.cometClient.on("transport:up",()=>this.log("Transport up event received")),this.cometClient.on("transport:down",()=>this.log("Transport down event received")),this.cometClient.addExtension({incoming:this.incoming.bind(this)}),this.cometClient.disable("websocket")}async init(){let t=this.options.org.getConnection();this.options.apiVersion=this.options.apiVersion||t.getApiVersion(),this.logger=await A1e.Logger.child(this.constructor.name),await this.options.org.refreshAuth();let r=t.getConnectionOptions().accessToken;if(r&&r.length>5)this.logger.debug(`accessToken: XXXXXX${r.substring(r.length-5,r.length-1)}`),this.cometClient.setHeader("Authorization",`OAuth ${r}`);else throw new F8.SfError("Missing or invalid access token","MissingOrInvalidAccessToken");this.log(`Streaming client target url: ${this.targetUrl}`),this.log(`options.subscribeTimeout (ms): ${this.options.subscribeTimeout.milliseconds}`),this.log(`options.handshakeTimeout (ms): ${this.options.handshakeTimeout.milliseconds}`)}replay(t){this.cometClient.addExtension({outgoing:(r,n)=>{if(r.channel==="/meta/subscribe"){r.ext||(r.ext={});let i={};i[this.options.channel]=t,(0,Qh.set)(r,"ext.replay",i)}n(r)}})}handshake(){let t;return new Promise((r,n)=>{t=setTimeout(()=>{let i=Rb.createError("genericHandshakeTimeout",[this.targetUrl]);this.doTimeout(t,i),n(i)},this.options.handshakeTimeout.milliseconds),this.cometClient.handshake(()=>{this.log("handshake completed"),clearTimeout(t),this.log("cleared handshake timeout"),r(e.ConnectionState.CONNECTED)})})}subscribe(t){let r;return new Promise((n,i)=>new Promise((a,o)=>{r=setTimeout(()=>{let l=Rb.createError("genericTimeout");this.doTimeout(r,l),i(l)},this.options.subscribeTimeout.milliseconds);let s=this.cometClient.subscribe(this.options.channel,l=>{try{let c=this.options.streamProcessor(l);c?.completed&&(clearTimeout(r),this.disconnectClient(),n(c.payload))}catch(c){clearTimeout(r),this.disconnectClient(),i(c)}});s.callback(()=>{a()}),s.errback(l=>{o(l)})}).then(()=>t?.()).catch(a=>{this.disconnect(),clearTimeout(r),i(a)}))}incoming(t,r){if(this.log(t),t&&t.channel==="/meta/handshake"&&t.error&&(0,nj.ensureString)(t.error).includes("400::API version in the URI is mandatory"))throw Rb.createError("handshakeApiVersionError",
`)[0]}console.log(JSON.stringify(e))}M0t();