@e2b/cli 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -39,13 +39,13 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Ke=H,y=ee);let ce={cod
39
39
  `,i)}while(r!==-1);return a+=e.substr(i),a};wR.exports={stringReplaceAll:TB,stringEncaseCRLFWithFirstIndex:hB}});var UR=f((wZ,BR)=>{"use strict";l();var bB=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,PR=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,DB=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,CB=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,RB=new Map([["n",`
40
40
  `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function kR(e){let t=e[0]==="u",n=e[1]==="{";return t&&!n&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):RB.get(e)||e}function AB(e,t){let n=[],r=t.trim().split(/\s*,\s*/g),i;for(let a of r){let s=Number(a);if(!Number.isNaN(s))n.push(s);else if(i=a.match(DB))n.push(i[2].replace(CB,(o,c,u)=>c?kR(c):u));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${e}')`)}return n}function OB(e){PR.lastIndex=0;let t=[],n;for(;(n=PR.exec(e))!==null;){let r=n[1];if(n[2]){let i=AB(r,n[2]);t.push([r].concat(i))}else t.push([r])}return t}function FR(e,t){let n={};for(let i of t)for(let a of i.styles)n[a[0]]=i.inverse?null:a.slice(1);let r=e;for(let[i,a]of Object.entries(n))if(Array.isArray(a)){if(!(i in r))throw new Error(`Unknown Chalk style: ${i}`);r=a.length>0?r[i](...a):r[i]}return r}BR.exports=(e,t)=>{let n=[],r=[],i=[];if(t.replace(bB,(a,s,o,c,u,d)=>{if(s)i.push(kR(s));else if(c){let p=i.join("");i=[],r.push(n.length===0?p:FR(e,n)(p)),n.push({inverse:o,styles:OB(c)})}else if(u){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");r.push(FR(e,n)(i.join(""))),i=[],n.pop()}else i.push(d)}),r.push(i.join("")),n.length>0){let a=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return r.join("")}});var KR=f((PZ,$R)=>{"use strict";l();var Ta=NR(),{stdout:i_,stderr:a_}=MR(),{stringReplaceAll:NB,stringEncaseCRLFWithFirstIndex:yB}=LR(),{isArray:To}=Array,HR=["ansi","ansi","ansi256","ansi16m"],li=Object.create(null),IB=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=i_?i_.level:0;e.level=t.level===void 0?n:t.level},s_=class{constructor(t){return YR(t)}},YR=e=>{let t={};return IB(t,e),t.template=(...n)=>VR(t.template,...n),Object.setPrototypeOf(t,ho.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=s_,t.template};function ho(e){return YR(e)}for(let[e,t]of Object.entries(Ta))li[e]={get(){let n=bo(this,o_(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};li.visible={get(){let e=bo(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var qR=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of qR)li[e]={get(){let{level:t}=this;return function(...n){let r=o_(Ta.color[HR[t]][e](...n),Ta.color.close,this._styler);return bo(this,r,this._isEmpty)}}};for(let e of qR){let t="bg"+e[0].toUpperCase()+e.slice(1);li[t]={get(){let{level:n}=this;return function(...r){let i=o_(Ta.bgColor[HR[n]][e](...r),Ta.bgColor.close,this._styler);return bo(this,i,this._isEmpty)}}}}var vB=Object.defineProperties(()=>{},{...li,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),o_=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},bo=(e,t,n)=>{let r=(...i)=>To(i[0])&&To(i[0].raw)?GR(r,VR(r,...i)):GR(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,vB),r._generator=e,r._styler=t,r._isEmpty=n,r},GR=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.indexOf("\x1B")!==-1)for(;n!==void 0;)t=NB(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
41
41
  `);return a!==-1&&(t=yB(t,i,r,a)),r+t+i},r_,VR=(e,...t)=>{let[n]=t;if(!To(n)||!To(n.raw))return t.join(" ");let r=t.slice(1),i=[n.raw[0]];for(let a=1;a<n.length;a++)i.push(String(r[a-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[a]));return r_===void 0&&(r_=UR()),r_(e,i.join(""))};Object.defineProperties(ho.prototype,li);var Do=ho();Do.supportsColor=i_;Do.stderr=ho({level:a_?a_.level:0});Do.stderr.supportsColor=a_;$R.exports=Do});var l_=f(he=>{"use strict";l();var xB=he&&he.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(he,"__esModule",{value:!0});he.parse=he.stringify=he.toJson=he.fromJson=he.DEFAULT_THEME=he.plain=void 0;var Qe=xB(KR()),MB=function(e){return e};he.plain=MB;he.DEFAULT_THEME={keyword:Qe.default.blue,built_in:Qe.default.cyan,type:Qe.default.cyan.dim,literal:Qe.default.blue,number:Qe.default.green,regexp:Qe.default.red,string:Qe.default.red,subst:he.plain,symbol:he.plain,class:Qe.default.blue,function:Qe.default.yellow,title:he.plain,params:he.plain,comment:Qe.default.green,doctag:Qe.default.green,meta:Qe.default.grey,"meta-keyword":he.plain,"meta-string":he.plain,section:he.plain,tag:Qe.default.grey,name:Qe.default.blue,"builtin-name":he.plain,attr:Qe.default.cyan,attribute:he.plain,variable:he.plain,bullet:he.plain,code:he.plain,emphasis:Qe.default.italic,strong:Qe.default.bold,formula:he.plain,link:Qe.default.underline,quote:he.plain,"selector-tag":he.plain,"selector-id":he.plain,"selector-class":he.plain,"selector-attr":he.plain,"selector-pseudo":he.plain,"template-tag":he.plain,"template-variable":he.plain,addition:Qe.default.green,deletion:Qe.default.red,default:he.plain};function WR(e){for(var t={},n=0,r=Object.keys(e);n<r.length;n++){var i=r[n],a=e[i];Array.isArray(a)?t[i]=a.reduce(function(s,o){return o==="plain"?he.plain:s[o]},Qe.default):t[i]=Qe.default[a]}return t}he.fromJson=WR;function zR(e){for(var t={},n=0,r=Object.keys(t);n<r.length;n++){var i=r[n],a=t[i];t[i]=a._styles}return t}he.toJson=zR;function wB(e){return JSON.stringify(zR(e))}he.stringify=wB;function LB(e){return WR(JSON.parse(e))}he.parse=LB});var jR=f(nt=>{"use strict";l();var QR=nt&&nt.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),PB=nt&&nt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),XR=nt&&nt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&QR(t,e,n);return PB(t,e),t},FB=nt&&nt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&QR(t,e,n)},kB=nt&&nt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nt,"__esModule",{value:!0});nt.supportsLanguage=nt.listLanguages=nt.highlight=void 0;var Ro=XR($D()),BB=XR(rR()),UB=kB(mR()),Co=l_();function c_(e,t,n){switch(t===void 0&&(t={}),e.type){case"text":{var r=e.data;return n===void 0?(t.default||Co.DEFAULT_THEME.default||Co.plain)(r):r}case"tag":{var i=/hljs-(\w+)/.exec(e.attribs.class);if(i){var a=i[1],s=e.childNodes.map(function(o){return c_(o,t,a)}).join("");return(t[a]||Co.DEFAULT_THEME[a]||Co.plain)(s)}return e.childNodes.map(function(o){return c_(o,t)}).join("")}}throw new Error("Invalid node type "+e.type)}function GB(e,t){t===void 0&&(t={});var n=BB.parseFragment(e,{treeAdapter:UB.default});return n.childNodes.map(function(r){return c_(r,t)}).join("")}function JR(e,t){t===void 0&&(t={});var n;return t.language?n=Ro.highlight(e,{language:t.language,ignoreIllegals:t.ignoreIllegals}).value:n=Ro.highlightAuto(e,t.languageSubset).value,GB(n,t.theme)}nt.highlight=JR;function HB(){return Ro.listLanguages()}nt.listLanguages=HB;function YB(e){return!!Ro.getLanguage(e)}nt.supportsLanguage=YB;nt.default=JR;FB(l_(),nt)});var eA=f(($Z,d_)=>{"use strict";l();var tr={};typeof d_>"u"?window.eastasianwidth=tr:d_.exports=tr;tr.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?"F":r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?"H":4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?"W":32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?"Na":r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?"A":"N"};tr.characterLength=function(e){var t=this.eastAsianWidth(e);return t=="F"||t=="W"||t=="A"?2:1};function ZR(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}tr.length=function(e){for(var t=ZR(e),n=0,r=0;r<t.length;r++)n=n+this.characterLength(t[r]);return n};tr.slice=function(e,t,n){textLen=tr.length(e),t=t||0,n=n||1,t<0&&(t=textLen+t),n<0&&(n=textLen+n);for(var r="",i=0,a=ZR(e),s=0;s<a.length;s++){var o=a[s],c=tr.length(o);if(i>=t-(c==2?1:0))if(i+c<=n)r+=o;else break;i+=c}return r}});var nA=f((WZ,tA)=>{"use strict";l();tA.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var aA=f((tee,$B)=>{$B.exports={single:{topLeft:"\u250C",top:"\u2500",topRight:"\u2510",right:"\u2502",bottomRight:"\u2518",bottom:"\u2500",bottomLeft:"\u2514",left:"\u2502"},double:{topLeft:"\u2554",top:"\u2550",topRight:"\u2557",right:"\u2551",bottomRight:"\u255D",bottom:"\u2550",bottomLeft:"\u255A",left:"\u2551"},round:{topLeft:"\u256D",top:"\u2500",topRight:"\u256E",right:"\u2502",bottomRight:"\u256F",bottom:"\u2500",bottomLeft:"\u2570",left:"\u2502"},bold:{topLeft:"\u250F",top:"\u2501",topRight:"\u2513",right:"\u2503",bottomRight:"\u251B",bottom:"\u2501",bottomLeft:"\u2517",left:"\u2503"},singleDouble:{topLeft:"\u2553",top:"\u2500",topRight:"\u2556",right:"\u2551",bottomRight:"\u255C",bottom:"\u2500",bottomLeft:"\u2559",left:"\u2551"},doubleSingle:{topLeft:"\u2552",top:"\u2550",topRight:"\u2555",right:"\u2502",bottomRight:"\u255B",bottom:"\u2550",bottomLeft:"\u2558",left:"\u2502"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"\u2198",top:"\u2193",topRight:"\u2199",right:"\u2190",bottomRight:"\u2196",bottom:"\u2191",bottomLeft:"\u2197",left:"\u2192"}}});var m_=f((nee,__)=>{"use strict";l();var sA=aA();__.exports=sA;__.exports.default=sA});var _A=f((see,dA)=>{"use strict";l();dA.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var pA=f((lee,mA)=>{"use strict";l();var jB=_A();mA.exports=e=>typeof e=="string"?e.replace(jB(),""):e});var fA=f((uee,f_)=>{"use strict";l();var EA=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);f_.exports=EA;f_.exports.default=EA});var SA=f((_ee,gA)=>{"use strict";l();gA.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var hA=f((pee,g_)=>{"use strict";l();var ZB=pA(),e6=fA(),t6=SA(),TA=e=>{if(typeof e!="string"||e.length===0||(e=ZB(e),e.length===0))return 0;e=e.replace(t6()," ");let t=0;for(let n=0;n<e.length;n++){let r=e.codePointAt(n);r<=31||r>=127&&r<=159||r>=768&&r<=879||(r>65535&&n++,t+=e6(r)?2:1)}return t};g_.exports=TA;g_.exports.default=TA});var DA=f((fee,bA)=>{"use strict";l();var n6=hA();function Cr(e,t){if(!e)return e;t=t||{};let n=t.align||"center";if(n==="left")return e;let r=t.split||`
42
- `,i=t.pad||" ",a=n!=="right"?r6:i6,s=!1;Array.isArray(e)||(s=!0,e=String(e).split(r));let o,c=0;return e=e.map(function(u){return u=String(u),o=n6(u),c=Math.max(o,c),{str:u,width:o}}).map(function(u){return new Array(a(c,u.width)+1).join(i)+u.str}),s?e.join(r):e}Cr.left=function(t){return Cr(t,{align:"left"})};Cr.center=function(t){return Cr(t,{align:"center"})};Cr.right=function(t){return Cr(t,{align:"right"})};bA.exports=Cr;function r6(e,t){return Math.floor((e-t)/2)}function i6(e,t){return e-t}});var zA=f((Bee,x_)=>{"use strict";l();var VA=require("child_process").exec,$A=require("child_process").execSync,Io=require("fs"),qA=require("path"),KA=Io.access,WA=Io.accessSync,ui=Io.constants||Io,I_=process.platform=="win32",N6=function(e,t){KA(e,ui.F_OK,function(n){t(!n)})},y6=function(e){try{return WA(e,ui.F_OK),!1}catch{return!0}},I6=function(e,t){KA(e,ui.F_OK|ui.X_OK,function(n){t(null,!n)})},v6=function(e){try{return WA(e,ui.F_OK|ui.X_OK),!0}catch{return!1}},x6=function(e,t,n){N6(e,function(r){if(!r){var i=VA("command -v "+t+" 2>/dev/null && { echo >&1 "+t+"; exit 0; }",function(a,s,o){n(null,!!s)});return}I6(e,n)})},M6=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)){n(null,!1);return}var r=VA("where "+t,function(i){i!==null?n(null,!1):n(null,!0)})},w6=function(e,t){if(y6(e))try{var n=$A("command -v "+t+" 2>/dev/null && { echo >&1 "+t+"; exit 0; }");return!!n}catch{return!1}return v6(e)},L6=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{var r=$A("where "+t,{stdio:[]});return!!r}catch{return!1}},v_=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e="'"+e.replace(/'/g,"'\\''")+"'",e=e.replace(/^(?:'')+/g,"").replace(/\\'''/g,"\\'")),e};I_&&(v_=function(e){var t=/[\\]/.test(e);if(t){var n='"'+qA.dirname(e)+'"',r='"'+qA.basename(e)+'"';return n+":"+r}return'"'+e+'"'});x_.exports=function e(t,n){var r=v_(t);if(!n&&typeof Promise<"u")return new Promise(function(i,a){e(t,function(s,o){o?i(t):a(s)})});I_?M6(t,r,n):x6(t,r,n)};x_.exports.sync=function(e){var t=v_(e);return I_?L6(e,t):w6(e,t)}});var XA=f((Gee,QA)=>{"use strict";l();QA.exports=zA()});var tO=f((xo,Aa)=>{"use strict";l();(function(){"use strict";var e={function:!0,object:!0},t=e[typeof window]&&window||this,n=t,r=e[typeof xo]&&xo,i=e[typeof Aa]&&Aa&&!Aa.nodeType&&Aa,a=r&&i&&typeof global=="object"&&global;a&&(a.global===a||a.window===a||a.self===a)&&(t=a);var s=Math.pow(2,53)-1,o=/\bOpera/,c=this,u=Object.prototype,d=u.hasOwnProperty,p=u.toString;function S(L){return L=String(L),L.charAt(0).toUpperCase()+L.slice(1)}function g(L,P,$){var J={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return P&&$&&/^Win/i.test(L)&&!/^Windows Phone /i.test(L)&&(J=J[/[\d.]+$/.exec(L)])&&(L="Windows "+J),L=String(L),P&&$&&(L=L.replace(RegExp(P,"i"),$)),L=N(L.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),L}function T(L,P){var $=-1,J=L?L.length:0;if(typeof J=="number"&&J>-1&&J<=s)for(;++$<J;)P(L[$],$,L);else w(L,P)}function N(L){return L=re(L),/^(?:webOS|i(?:OS|P))/.test(L)?L:S(L)}function w(L,P){for(var $ in L)d.call(L,$)&&P(L[$],$,L)}function k(L){return L==null?S(L):p.call(L).slice(8,-1)}function M(L,P){var $=L!=null?typeof L[P]:"number";return!/^(?:boolean|number|string|undefined)$/.test($)&&($=="object"?!!L[P]:!0)}function B(L){return String(L).replace(/([ -])(?!$)/g,"$1?")}function Y(L,P){var $=null;return T(L,function(J,_e){$=P($,J,_e,L)}),$}function re(L){return String(L).replace(/^ +| +$/g,"")}function Q(L){var P=t,$=L&&typeof L=="object"&&k(L)!="String";$&&(P=L,L=null);var J=P.navigator||{},_e=J.userAgent||"";L||(L=_e);var Se=$||c==n,xe=$?!!J.likeChrome:/\bChrome\b/.test(L)&&!/internal|\n/i.test(p.toString()),Te="Object",je=$?Te:"ScriptBridgingProxyObject",Ze=$?Te:"Environment",$e=$&&P.java?"JavaPackage":k(P.java),Yt=$?Te:"RuntimeObject",et=/\bJava/.test($e)&&P.java,tt=et&&k(P.environment)==Ze,At=et?"a":"\u03B1",H=et?"b":"\u03B2",ee=P.document||{},le=P.operamini||P.opera,ge=o.test(ge=$&&le?le["[[Class]]"]:k(le))?ge:le=null,y,Ke=L,ce=[],Ee=null,Me=L==_e,te=Me&&le&&typeof le.version=="function"&&le.version(),Zt,De=Ut([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),K=Dn(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),fe=Ot([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),Fe=Yn({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),X=W(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function Ut(R){return Y(R,function(v,O){return v||RegExp("\\b"+(O.pattern||B(O))+"\\b","i").exec(L)&&(O.label||O)})}function Yn(R){return Y(R,function(v,O,I){return v||(O[fe]||O[/^[a-z]+(?: +[a-z]+\b)*/i.exec(fe)]||RegExp("\\b"+B(I)+"(?:\\b|\\w*\\d)","i").exec(L))&&I})}function Dn(R){return Y(R,function(v,O){return v||RegExp("\\b"+(O.pattern||B(O))+"\\b","i").exec(L)&&(O.label||O)})}function W(R){return Y(R,function(v,O){var I=O.pattern||B(O);return!v&&(v=RegExp("\\b"+I+"(?:/[\\d.]+|[ \\w.]*)","i").exec(L))&&(v=g(v,I,O.label||O)),v})}function Ot(R){return Y(R,function(v,O){var I=O.pattern||B(O);return!v&&(v=RegExp("\\b"+I+" *\\d+[.\\w_]*","i").exec(L)||RegExp("\\b"+I+" *\\w+-[\\w]*","i").exec(L)||RegExp("\\b"+I+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(L))&&((v=String(O.label&&!RegExp(I,"i").test(O.label)?O.label:v).split("/"))[1]&&!/[\d.]+/.test(v[0])&&(v[0]+=" "+v[1]),O=O.label||O,v=N(v[0].replace(RegExp(I,"i"),O).replace(RegExp("; *(?:"+O+"[_-])?","i")," ").replace(RegExp("("+O+")[-_.]?(\\w)","i"),"$1 $2"))),v})}function m(R){return Y(R,function(v,O){return v||(RegExp(O+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(L)||0)[1]||null})}function E(){return this.description||""}if(De&&(De=[De]),/\bAndroid\b/.test(X)&&!fe&&(y=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(L))&&(fe=re(y[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),Fe&&!fe?fe=Ot([Fe]):Fe&&fe&&(fe=fe.replace(RegExp("^("+B(Fe)+")[-_.\\s]","i"),Fe+" ").replace(RegExp("^("+B(Fe)+")[-_.]?(\\w)","i"),Fe+" $2")),(y=/\bGoogle TV\b/.exec(fe))&&(fe=y[0]),/\bSimulator\b/i.test(L)&&(fe=(fe?fe+" ":"")+"Simulator"),K=="Opera Mini"&&/\bOPiOS\b/.test(L)&&ce.push("running in Turbo/Uncompressed mode"),K=="IE"&&/\blike iPhone OS\b/.test(L)?(y=Q(L.replace(/like iPhone OS/,"")),Fe=y.manufacturer,fe=y.product):/^iP/.test(fe)?(K||(K="Safari"),X="iOS"+((y=/ OS ([\d_]+)/i.exec(L))?" "+y[1].replace(/_/g,"."):"")):K=="Konqueror"&&/^Linux\b/i.test(X)?X="Kubuntu":Fe&&Fe!="Google"&&(/Chrome/.test(K)&&!/\bMobile Safari\b/i.test(L)||/\bVita\b/.test(fe))||/\bAndroid\b/.test(X)&&/^Chrome/.test(K)&&/\bVersion\//i.test(L)?(K="Android Browser",X=/\bAndroid\b/.test(X)?X:"Android"):K=="Silk"?(/\bMobi/i.test(L)||(X="Android",ce.unshift("desktop mode")),/Accelerated *= *true/i.test(L)&&ce.unshift("accelerated")):K=="UC Browser"&&/\bUCWEB\b/.test(L)?ce.push("speed mode"):K=="PaleMoon"&&(y=/\bFirefox\/([\d.]+)\b/.exec(L))?ce.push("identifying as Firefox "+y[1]):K=="Firefox"&&(y=/\b(Mobile|Tablet|TV)\b/i.exec(L))?(X||(X="Firefox OS"),fe||(fe=y[1])):!K||(y=!/\bMinefield\b/i.test(L)&&/\b(?:Firefox|Safari)\b/.exec(K))?(K&&!fe&&/[\/,]|^[^(]+?\)/.test(L.slice(L.indexOf(y+"/")+8))&&(K=null),(y=fe||Fe||X)&&(fe||Fe||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(X))&&(K=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(X)?X:y)+" Browser")):K=="Electron"&&(y=(/\bChrome\/([\d.]+)\b/.exec(L)||0)[1])&&ce.push("Chromium "+y),te||(te=m(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",B(K),"(?:Firefox|Minefield|NetFront)"])),(y=De=="iCab"&&parseFloat(te)>3&&"WebKit"||/\bOpera\b/.test(K)&&(/\bOPR\b/.test(L)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(L)&&!/^(?:Trident|EdgeHTML)$/.test(De)&&"WebKit"||!De&&/\bMSIE\b/i.test(L)&&(X=="Mac OS"?"Tasman":"Trident")||De=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(K)&&"NetFront")&&(De=[y]),K=="IE"&&(y=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(L)||0)[1])?(K+=" Mobile",X="Windows Phone "+(/\+$/.test(y)?y:y+".x"),ce.unshift("desktop mode")):/\bWPDesktop\b/i.test(L)?(K="IE Mobile",X="Windows Phone 8.x",ce.unshift("desktop mode"),te||(te=(/\brv:([\d.]+)/.exec(L)||0)[1])):K!="IE"&&De=="Trident"&&(y=/\brv:([\d.]+)/.exec(L))&&(K&&ce.push("identifying as "+K+(te?" "+te:"")),K="IE",te=y[1]),Me){if(M(P,"global"))if(et&&(y=et.lang.System,Ke=y.getProperty("os.arch"),X=X||y.getProperty("os.name")+" "+y.getProperty("os.version")),tt){try{te=P.require("ringo/engine").version.join("."),K="RingoJS"}catch{(y=P.system)&&y.global.system==P.system&&(K="Narwhal",X||(X=y[0].os||null))}K||(K="Rhino")}else typeof P.process=="object"&&!P.process.browser&&(y=P.process)&&(typeof y.versions=="object"&&(typeof y.versions.electron=="string"?(ce.push("Node "+y.versions.node),K="Electron",te=y.versions.electron):typeof y.versions.nw=="string"&&(ce.push("Chromium "+te,"Node "+y.versions.node),K="NW.js",te=y.versions.nw)),K||(K="Node.js",Ke=y.arch,X=y.platform,te=/[\d.]+/.exec(y.version),te=te?te[0]:null));else k(y=P.runtime)==je?(K="Adobe AIR",X=y.flash.system.Capabilities.os):k(y=P.phantom)==Yt?(K="PhantomJS",te=(y=y.version||null)&&y.major+"."+y.minor+"."+y.patch):typeof ee.documentMode=="number"&&(y=/\bTrident\/(\d+)/i.exec(L))?(te=[te,ee.documentMode],(y=+y[1]+4)!=te[1]&&(ce.push("IE "+te[1]+" mode"),De&&(De[1]=""),te[1]=y),te=K=="IE"?String(te[1].toFixed(1)):te[0]):typeof ee.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(K)&&(ce.push("masking as "+K+" "+te),K="IE",te="11.0",De=["Trident"],X="Windows");X=X&&N(X)}if(te&&(y=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(te)||/(?:alpha|beta)(?: ?\d)?/i.exec(L+";"+(Me&&J.appMinorVersion))||/\bMinefield\b/i.test(L)&&"a")&&(Ee=/b/i.test(y)?"beta":"alpha",te=te.replace(RegExp(y+"\\+?$"),"")+(Ee=="beta"?H:At)+(/\d+\+?/.exec(y)||"")),K=="Fennec"||K=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(X))K="Firefox Mobile";else if(K=="Maxthon"&&te)te=te.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(fe))fe=="Xbox 360"&&(X=null),fe=="Xbox 360"&&/\bIEMobile\b/.test(L)&&ce.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(K)||K&&!fe&&!/Browser|Mobi/.test(K))&&(X=="Windows CE"||/Mobi/i.test(L)))K+=" Mobile";else if(K=="IE"&&Me)try{P.external===null&&ce.unshift("platform preview")}catch{ce.unshift("embedded")}else(/\bBlackBerry\b/.test(fe)||/\bBB10\b/.test(L))&&(y=(RegExp(fe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(L)||0)[1]||te)?(y=[y,/BB10/.test(L)],X=(y[1]?(fe=null,Fe="BlackBerry"):"Device Software")+" "+y[0],te=null):this!=w&&fe!="Wii"&&(Me&&le||/Opera/.test(K)&&/\b(?:MSIE|Firefox)\b/i.test(L)||K=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(X)||K=="IE"&&(X&&!/^Win/.test(X)&&te>5.5||/\bWindows XP\b/.test(X)&&te>8||te==8&&!/\bTrident\b/.test(L)))&&!o.test(y=Q.call(w,L.replace(o,"")+";"))&&y.name&&(y="ing as "+y.name+((y=y.version)?" "+y:""),o.test(K)?(/\bIE\b/.test(y)&&X=="Mac OS"&&(X=null),y="identify"+y):(y="mask"+y,ge?K=N(ge.replace(/([a-z])([A-Z])/g,"$1 $2")):K="Opera",/\bIE\b/.test(y)&&(X=null),Me||(te=null)),De=["Presto"],ce.push(y));(y=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(L)||0)[1])&&(y=[parseFloat(y.replace(/\.(\d)$/,".0$1")),y],K=="Safari"&&y[1].slice(-1)=="+"?(K="WebKit Nightly",Ee="alpha",te=y[1].slice(0,-1)):(te==y[1]||te==(y[2]=(/\bSafari\/([\d.]+\+?)/i.exec(L)||0)[1]))&&(te=null),y[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(L)||0)[1],y[0]==537.36&&y[2]==537.36&&parseFloat(y[1])>=28&&De=="WebKit"&&(De=["Blink"]),!Me||!xe&&!y[1]?(De&&(De[1]="like Safari"),y=(y=y[0],y<400?1:y<500?2:y<526?3:y<533?4:y<534?"4+":y<535?5:y<537?6:y<538?7:y<601?8:y<602?9:y<604?10:y<606?11:y<608?12:"12")):(De&&(De[1]="like Chrome"),y=y[1]||(y=y[0],y<530?1:y<532?2:y<532.05?3:y<533?4:y<534.03?5:y<534.07?6:y<534.1?7:y<534.13?8:y<534.16?9:y<534.24?10:y<534.3?11:y<535.01?12:y<535.02?"13+":y<535.07?15:y<535.11?16:y<535.19?17:y<536.05?18:y<536.1?19:y<537.01?20:y<537.11?"21+":y<537.13?23:y<537.18?24:y<537.24?25:y<537.36?26:De!="Blink"?"27":"28")),De&&(De[1]+=" "+(y+=typeof y=="number"?".x":/[.+]/.test(y)?"":"+")),K=="Safari"&&(!te||parseInt(te)>45)?te=y:K=="Chrome"&&/\bHeadlessChrome/i.test(L)&&ce.unshift("headless")),K=="Opera"&&(y=/\bzbov|zvav$/.exec(X))?(K+=" ",ce.unshift("desktop mode"),y=="zvav"?(K+="Mini",te=null):K+="Mobile",X=X.replace(RegExp(" *"+y+"$"),"")):K=="Safari"&&/\bChrome\b/.exec(De&&De[1])?(ce.unshift("desktop mode"),K="Chrome Mobile",te=null,/\bOS X\b/.test(X)?(Fe="Apple",X="iOS 4.3+"):X=null):/\bSRWare Iron\b/.test(K)&&!te&&(te=m("Chrome")),te&&te.indexOf(y=/[\d.]+$/.exec(X))==0&&L.indexOf("/"+y+"-")>-1&&(X=re(X.replace(y,""))),X&&X.indexOf(K)!=-1&&!RegExp(K+" OS").test(X)&&(X=X.replace(RegExp(" *"+B(K)+" *"),"")),De&&!/\b(?:Avant|Nook)\b/.test(K)&&(/Browser|Lunascape|Maxthon/.test(K)||K!="Safari"&&/^iOS/.test(X)&&/\bSafari\b/.test(De[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(K)&&De[1])&&(y=De[De.length-1])&&ce.push(y),ce.length&&(ce=["("+ce.join("; ")+")"]),Fe&&fe&&fe.indexOf(Fe)<0&&ce.push("on "+Fe),fe&&ce.push((/^on /.test(ce[ce.length-1])?"":"on ")+fe),X&&(y=/ ([\d.+]+)$/.exec(X),Zt=y&&X.charAt(X.length-y[0].length-1)=="/",X={architecture:32,family:y&&!Zt?X.replace(y[0],""):X,version:y?y[1]:null,toString:function(){var R=this.version;return this.family+(R&&!Zt?" "+R:"")+(this.architecture==64?" 64-bit":"")}}),(y=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Ke))&&!/\bi686\b/i.test(Ke)?(X&&(X.architecture=64,X.family=X.family.replace(RegExp(" *"+y),"")),K&&(/\bWOW64\b/i.test(L)||Me&&/\w(?:86|32)$/.test(J.cpuClass||J.platform)&&!/\bWin64; x64\b/i.test(L))&&ce.unshift("32-bit")):X&&/^OS X/.test(X.family)&&K=="Chrome"&&parseFloat(te)>=39&&(X.architecture=64),L||(L=null);var b={};return b.description=L,b.layout=De&&De[0],b.manufacturer=Fe,b.name=K,b.prerelease=Ee,b.product=fe,b.ua=L,b.version=K&&te,b.os=X||{architecture:null,family:null,version:null,toString:function(){return"null"}},b.parse=Q,b.toString=E,b.version&&ce.unshift(te),b.name&&ce.unshift(K),X&&K&&!(X==String(X).split(" ")[0]&&(X==K.split(" ")[0]||fe))&&ce.push(fe?"("+X+")":"on "+X),ce.length&&(b.description=ce.join(" ")),b}var ae=Q();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(t.platform=ae,define(function(){return ae})):r&&i?w(ae,function(L,P){r[P]=L}):t.platform=ae}).call(xo)});var RN=f((hle,CN)=>{"use strict";l();function wr(e){this._maxSize=e,this.clear()}wr.prototype.clear=function(){this._size=0,this._values=Object.create(null)};wr.prototype.get=function(e){return this._values[e]};wr.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var MU=/[^.^\]^[]+|(?=\[\]|\.\.)/g,DN=/^\d+$/,wU=/^\d/,LU=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,PU=/^\s*(['"]?)(.*?)(\1)\s*$/,Dm=512,TN=new wr(Dm),hN=new wr(Dm),bN=new wr(Dm);CN.exports={Cache:wr,split:bm,normalizePath:hm,setter:function(e){var t=hm(e);return hN.get(e)||hN.set(e,function(r,i){for(var a=0,s=t.length,o=r;a<s-1;){var c=t[a];if(c==="__proto__"||c==="constructor"||c==="prototype")return r;o=o[t[a++]]}o[t[a]]=i})},getter:function(e,t){var n=hm(e);return bN.get(e)||bN.set(e,function(i){for(var a=0,s=n.length;a<s;)if(i!=null||!t)i=i[n[a++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Cm(n)||DN.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){FU(Array.isArray(e)?e:bm(e),t,n)}};function hm(e){return TN.get(e)||TN.set(e,bm(e).map(function(t){return t.replace(PU,"$2")}))}function bm(e){return e.match(MU)||[""]}function FU(e,t,n){var r=e.length,i,a,s,o;for(a=0;a<r;a++)i=e[a],i&&(UU(i)&&(i='"'+i+'"'),o=Cm(i),s=!o&&/^\d+$/.test(i),t.call(n,i,o,s,a,e))}function Cm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function kU(e){return e.match(wU)&&!e.match(DN)}function BU(e){return LU.test(e)}function UU(e){return!Cm(e)&&(kU(e)||BU(e))}});var NN=f((Dle,ON)=>{"use strict";l();var GU=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,oc=e=>e.match(GU)||[],lc=e=>e[0].toUpperCase()+e.slice(1),Rm=(e,t)=>oc(e).join(t).toLowerCase(),AN=e=>oc(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),HU=e=>lc(AN(e)),YU=e=>Rm(e,"_"),qU=e=>Rm(e,"-"),VU=e=>lc(Rm(e," ")),$U=e=>oc(e).map(lc).join(" ");ON.exports={words:oc,upperFirst:lc,camelCase:AN,pascalCase:HU,snakeCase:YU,kebabCase:qU,sentenceCase:VU,titleCase:$U}});var IN=f((Rle,Am)=>{"use strict";l();Am.exports=function(e){return yN(KU(e),e)};Am.exports.array=yN;function yN(e,t){var n=e.length,r=new Array(n),i={},a=n,s=WU(t),o=zU(e);for(t.forEach(function(u){if(!o.has(u[0])||!o.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||c(e[a],a,new Set);return r;function c(u,d,p){if(p.has(u)){var S;try{S=", node was:"+JSON.stringify(u)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!o.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[d]){i[d]=!0;var g=s.get(u)||new Set;if(g=Array.from(g),d=g.length){p.add(u);do{var T=g[--d];c(T,o.get(T),p)}while(d);p.delete(u)}r[--n]=u}}}function KU(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function WU(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function zU(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}});var YN=f((yle,HN)=>{"use strict";l();var Pr=class e extends Error{constructor(t,n,r){super("[ParserError] "+t,n,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},Cc=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},Va=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new Cc(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let n;for(;n===!1||this.nextChar();)n=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new Pr("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,n){n&&this.next(n),this.stack.push(this.state),this.state=new Cc(t)}callNow(t,n){return this.call(t,n),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new Pr("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new Pr("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new Pr("Must declare a parseStart method")}};Va.END=1114112;Va.Error=Pr;HN.exports=Va});var VN=f((vle,qN)=>{"use strict";l();qN.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Rc=f((Mle,$N)=>{"use strict";l();$N.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var WN=f((Lle,KN)=>{"use strict";l();var Ri=Rc(),vm=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${Ri(2,this.getUTCMonth()+1)}-${Ri(2,this.getUTCDate())}`,n=`${Ri(2,this.getUTCHours())}:${Ri(2,this.getUTCMinutes())}:${Ri(2,this.getUTCSeconds())}.${Ri(3,this.getUTCMilliseconds())}`;return`${t}T${n}`}};KN.exports=e=>{let t=new vm(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var XN=f((Fle,QN)=>{"use strict";l();var zN=Rc(),D7=global.Date,xm=class extends D7{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${zN(2,this.getUTCMonth()+1)}-${zN(2,this.getUTCDate())}`}};QN.exports=e=>{let t=new xm(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var jN=f((Ble,JN)=>{"use strict";l();var Ac=Rc(),Mm=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${Ac(2,this.getUTCHours())}:${Ac(2,this.getUTCMinutes())}:${Ac(2,this.getUTCSeconds())}.${Ac(3,this.getUTCMilliseconds())}`}};JN.exports=e=>{let t=new Mm(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Oc=f((exports,module)=>{"use strict";l();module.exports=makeParserClass(YN());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=VN(),createDateTimeFloat=WN(),createDate=XN(),createTime=jN(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
43
- `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(r){let i=this.ctx,a=r.key.pop();for(let s of r.key){if(hasKey(i,s)&&(!isTable(i[s])||i[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[s]=i[s]||Table()}if(hasKey(i,a))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[a]=r.value.valueOf():i[a]=r.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(r){return this.state.resultTable?this.state.resultTable.push(r):this.state.resultTable=[r],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(r){return this.returnNow({key:this.state.resultTable,value:r})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)&&(!isTable(this.ctx[r])||this.ctx[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[r]=this.ctx[r]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)||(this.ctx[r]=List()),isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[r])){let i=Table();this.ctx[r].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else{if(isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(r){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(r){return this.returnNow(r)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let r="\\u00";return this.char<16&&(r+="0"),r+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${r} instead`))}recordMultiEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(r){try{let i=parseInt(r,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(r){if(this.state.resultArr){let i=this.state.resultArr[_contentType],a=tomlType(r);if(i!==a)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${a}`))}else this.state.resultArr=InlineList(tomlType(r));return isFloat(r)||isInteger(r)?this.state.resultArr.push(r.valueOf()):this.state.resultArr.push(r),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(r){let i=this.state.resultTable,a=r.key.pop();for(let s of r.key){if(hasKey(i,s)&&(!isTable(i[s])||i[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[s]=i[s]||Table()}if(hasKey(i,a))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[a]=r.value.valueOf():i[a]=r.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var Nc=f((Hle,ZN)=>{"use strict";l();ZN.exports=C7;function C7(e,t){if(e.pos==null||e.line==null)return e;let n=e.message;if(n+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
42
+ `,i=t.pad||" ",a=n!=="right"?r6:i6,s=!1;Array.isArray(e)||(s=!0,e=String(e).split(r));let o,c=0;return e=e.map(function(u){return u=String(u),o=n6(u),c=Math.max(o,c),{str:u,width:o}}).map(function(u){return new Array(a(c,u.width)+1).join(i)+u.str}),s?e.join(r):e}Cr.left=function(t){return Cr(t,{align:"left"})};Cr.center=function(t){return Cr(t,{align:"center"})};Cr.right=function(t){return Cr(t,{align:"right"})};bA.exports=Cr;function r6(e,t){return Math.floor((e-t)/2)}function i6(e,t){return e-t}});var zA=f((Bee,x_)=>{"use strict";l();var VA=require("child_process").exec,$A=require("child_process").execSync,Io=require("fs"),qA=require("path"),KA=Io.access,WA=Io.accessSync,ui=Io.constants||Io,I_=process.platform=="win32",N6=function(e,t){KA(e,ui.F_OK,function(n){t(!n)})},y6=function(e){try{return WA(e,ui.F_OK),!1}catch{return!0}},I6=function(e,t){KA(e,ui.F_OK|ui.X_OK,function(n){t(null,!n)})},v6=function(e){try{return WA(e,ui.F_OK|ui.X_OK),!0}catch{return!1}},x6=function(e,t,n){N6(e,function(r){if(!r){var i=VA("command -v "+t+" 2>/dev/null && { echo >&1 "+t+"; exit 0; }",function(a,s,o){n(null,!!s)});return}I6(e,n)})},M6=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)){n(null,!1);return}var r=VA("where "+t,function(i){i!==null?n(null,!1):n(null,!0)})},w6=function(e,t){if(y6(e))try{var n=$A("command -v "+t+" 2>/dev/null && { echo >&1 "+t+"; exit 0; }");return!!n}catch{return!1}return v6(e)},L6=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{var r=$A("where "+t,{stdio:[]});return!!r}catch{return!1}},v_=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e="'"+e.replace(/'/g,"'\\''")+"'",e=e.replace(/^(?:'')+/g,"").replace(/\\'''/g,"\\'")),e};I_&&(v_=function(e){var t=/[\\]/.test(e);if(t){var n='"'+qA.dirname(e)+'"',r='"'+qA.basename(e)+'"';return n+":"+r}return'"'+e+'"'});x_.exports=function e(t,n){var r=v_(t);if(!n&&typeof Promise<"u")return new Promise(function(i,a){e(t,function(s,o){o?i(t):a(s)})});I_?M6(t,r,n):x6(t,r,n)};x_.exports.sync=function(e){var t=v_(e);return I_?L6(e,t):w6(e,t)}});var XA=f((Gee,QA)=>{"use strict";l();QA.exports=zA()});var tO=f((xo,Aa)=>{"use strict";l();(function(){"use strict";var e={function:!0,object:!0},t=e[typeof window]&&window||this,n=t,r=e[typeof xo]&&xo,i=e[typeof Aa]&&Aa&&!Aa.nodeType&&Aa,a=r&&i&&typeof global=="object"&&global;a&&(a.global===a||a.window===a||a.self===a)&&(t=a);var s=Math.pow(2,53)-1,o=/\bOpera/,c=this,u=Object.prototype,d=u.hasOwnProperty,p=u.toString;function S(L){return L=String(L),L.charAt(0).toUpperCase()+L.slice(1)}function g(L,P,$){var J={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return P&&$&&/^Win/i.test(L)&&!/^Windows Phone /i.test(L)&&(J=J[/[\d.]+$/.exec(L)])&&(L="Windows "+J),L=String(L),P&&$&&(L=L.replace(RegExp(P,"i"),$)),L=N(L.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),L}function T(L,P){var $=-1,J=L?L.length:0;if(typeof J=="number"&&J>-1&&J<=s)for(;++$<J;)P(L[$],$,L);else w(L,P)}function N(L){return L=re(L),/^(?:webOS|i(?:OS|P))/.test(L)?L:S(L)}function w(L,P){for(var $ in L)d.call(L,$)&&P(L[$],$,L)}function k(L){return L==null?S(L):p.call(L).slice(8,-1)}function M(L,P){var $=L!=null?typeof L[P]:"number";return!/^(?:boolean|number|string|undefined)$/.test($)&&($=="object"?!!L[P]:!0)}function B(L){return String(L).replace(/([ -])(?!$)/g,"$1?")}function Y(L,P){var $=null;return T(L,function(J,_e){$=P($,J,_e,L)}),$}function re(L){return String(L).replace(/^ +| +$/g,"")}function Q(L){var P=t,$=L&&typeof L=="object"&&k(L)!="String";$&&(P=L,L=null);var J=P.navigator||{},_e=J.userAgent||"";L||(L=_e);var Se=$||c==n,xe=$?!!J.likeChrome:/\bChrome\b/.test(L)&&!/internal|\n/i.test(p.toString()),Te="Object",je=$?Te:"ScriptBridgingProxyObject",Ze=$?Te:"Environment",$e=$&&P.java?"JavaPackage":k(P.java),Yt=$?Te:"RuntimeObject",et=/\bJava/.test($e)&&P.java,tt=et&&k(P.environment)==Ze,At=et?"a":"\u03B1",H=et?"b":"\u03B2",ee=P.document||{},le=P.operamini||P.opera,ge=o.test(ge=$&&le?le["[[Class]]"]:k(le))?ge:le=null,y,Ke=L,ce=[],Ee=null,Me=L==_e,te=Me&&le&&typeof le.version=="function"&&le.version(),Zt,De=Ut([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),K=Dn(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),fe=Ot([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),Fe=Yn({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),X=W(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function Ut(R){return Y(R,function(v,O){return v||RegExp("\\b"+(O.pattern||B(O))+"\\b","i").exec(L)&&(O.label||O)})}function Yn(R){return Y(R,function(v,O,I){return v||(O[fe]||O[/^[a-z]+(?: +[a-z]+\b)*/i.exec(fe)]||RegExp("\\b"+B(I)+"(?:\\b|\\w*\\d)","i").exec(L))&&I})}function Dn(R){return Y(R,function(v,O){return v||RegExp("\\b"+(O.pattern||B(O))+"\\b","i").exec(L)&&(O.label||O)})}function W(R){return Y(R,function(v,O){var I=O.pattern||B(O);return!v&&(v=RegExp("\\b"+I+"(?:/[\\d.]+|[ \\w.]*)","i").exec(L))&&(v=g(v,I,O.label||O)),v})}function Ot(R){return Y(R,function(v,O){var I=O.pattern||B(O);return!v&&(v=RegExp("\\b"+I+" *\\d+[.\\w_]*","i").exec(L)||RegExp("\\b"+I+" *\\w+-[\\w]*","i").exec(L)||RegExp("\\b"+I+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(L))&&((v=String(O.label&&!RegExp(I,"i").test(O.label)?O.label:v).split("/"))[1]&&!/[\d.]+/.test(v[0])&&(v[0]+=" "+v[1]),O=O.label||O,v=N(v[0].replace(RegExp(I,"i"),O).replace(RegExp("; *(?:"+O+"[_-])?","i")," ").replace(RegExp("("+O+")[-_.]?(\\w)","i"),"$1 $2"))),v})}function m(R){return Y(R,function(v,O){return v||(RegExp(O+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(L)||0)[1]||null})}function E(){return this.description||""}if(De&&(De=[De]),/\bAndroid\b/.test(X)&&!fe&&(y=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(L))&&(fe=re(y[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),Fe&&!fe?fe=Ot([Fe]):Fe&&fe&&(fe=fe.replace(RegExp("^("+B(Fe)+")[-_.\\s]","i"),Fe+" ").replace(RegExp("^("+B(Fe)+")[-_.]?(\\w)","i"),Fe+" $2")),(y=/\bGoogle TV\b/.exec(fe))&&(fe=y[0]),/\bSimulator\b/i.test(L)&&(fe=(fe?fe+" ":"")+"Simulator"),K=="Opera Mini"&&/\bOPiOS\b/.test(L)&&ce.push("running in Turbo/Uncompressed mode"),K=="IE"&&/\blike iPhone OS\b/.test(L)?(y=Q(L.replace(/like iPhone OS/,"")),Fe=y.manufacturer,fe=y.product):/^iP/.test(fe)?(K||(K="Safari"),X="iOS"+((y=/ OS ([\d_]+)/i.exec(L))?" "+y[1].replace(/_/g,"."):"")):K=="Konqueror"&&/^Linux\b/i.test(X)?X="Kubuntu":Fe&&Fe!="Google"&&(/Chrome/.test(K)&&!/\bMobile Safari\b/i.test(L)||/\bVita\b/.test(fe))||/\bAndroid\b/.test(X)&&/^Chrome/.test(K)&&/\bVersion\//i.test(L)?(K="Android Browser",X=/\bAndroid\b/.test(X)?X:"Android"):K=="Silk"?(/\bMobi/i.test(L)||(X="Android",ce.unshift("desktop mode")),/Accelerated *= *true/i.test(L)&&ce.unshift("accelerated")):K=="UC Browser"&&/\bUCWEB\b/.test(L)?ce.push("speed mode"):K=="PaleMoon"&&(y=/\bFirefox\/([\d.]+)\b/.exec(L))?ce.push("identifying as Firefox "+y[1]):K=="Firefox"&&(y=/\b(Mobile|Tablet|TV)\b/i.exec(L))?(X||(X="Firefox OS"),fe||(fe=y[1])):!K||(y=!/\bMinefield\b/i.test(L)&&/\b(?:Firefox|Safari)\b/.exec(K))?(K&&!fe&&/[\/,]|^[^(]+?\)/.test(L.slice(L.indexOf(y+"/")+8))&&(K=null),(y=fe||Fe||X)&&(fe||Fe||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(X))&&(K=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(X)?X:y)+" Browser")):K=="Electron"&&(y=(/\bChrome\/([\d.]+)\b/.exec(L)||0)[1])&&ce.push("Chromium "+y),te||(te=m(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",B(K),"(?:Firefox|Minefield|NetFront)"])),(y=De=="iCab"&&parseFloat(te)>3&&"WebKit"||/\bOpera\b/.test(K)&&(/\bOPR\b/.test(L)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(L)&&!/^(?:Trident|EdgeHTML)$/.test(De)&&"WebKit"||!De&&/\bMSIE\b/i.test(L)&&(X=="Mac OS"?"Tasman":"Trident")||De=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(K)&&"NetFront")&&(De=[y]),K=="IE"&&(y=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(L)||0)[1])?(K+=" Mobile",X="Windows Phone "+(/\+$/.test(y)?y:y+".x"),ce.unshift("desktop mode")):/\bWPDesktop\b/i.test(L)?(K="IE Mobile",X="Windows Phone 8.x",ce.unshift("desktop mode"),te||(te=(/\brv:([\d.]+)/.exec(L)||0)[1])):K!="IE"&&De=="Trident"&&(y=/\brv:([\d.]+)/.exec(L))&&(K&&ce.push("identifying as "+K+(te?" "+te:"")),K="IE",te=y[1]),Me){if(M(P,"global"))if(et&&(y=et.lang.System,Ke=y.getProperty("os.arch"),X=X||y.getProperty("os.name")+" "+y.getProperty("os.version")),tt){try{te=P.require("ringo/engine").version.join("."),K="RingoJS"}catch{(y=P.system)&&y.global.system==P.system&&(K="Narwhal",X||(X=y[0].os||null))}K||(K="Rhino")}else typeof P.process=="object"&&!P.process.browser&&(y=P.process)&&(typeof y.versions=="object"&&(typeof y.versions.electron=="string"?(ce.push("Node "+y.versions.node),K="Electron",te=y.versions.electron):typeof y.versions.nw=="string"&&(ce.push("Chromium "+te,"Node "+y.versions.node),K="NW.js",te=y.versions.nw)),K||(K="Node.js",Ke=y.arch,X=y.platform,te=/[\d.]+/.exec(y.version),te=te?te[0]:null));else k(y=P.runtime)==je?(K="Adobe AIR",X=y.flash.system.Capabilities.os):k(y=P.phantom)==Yt?(K="PhantomJS",te=(y=y.version||null)&&y.major+"."+y.minor+"."+y.patch):typeof ee.documentMode=="number"&&(y=/\bTrident\/(\d+)/i.exec(L))?(te=[te,ee.documentMode],(y=+y[1]+4)!=te[1]&&(ce.push("IE "+te[1]+" mode"),De&&(De[1]=""),te[1]=y),te=K=="IE"?String(te[1].toFixed(1)):te[0]):typeof ee.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(K)&&(ce.push("masking as "+K+" "+te),K="IE",te="11.0",De=["Trident"],X="Windows");X=X&&N(X)}if(te&&(y=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(te)||/(?:alpha|beta)(?: ?\d)?/i.exec(L+";"+(Me&&J.appMinorVersion))||/\bMinefield\b/i.test(L)&&"a")&&(Ee=/b/i.test(y)?"beta":"alpha",te=te.replace(RegExp(y+"\\+?$"),"")+(Ee=="beta"?H:At)+(/\d+\+?/.exec(y)||"")),K=="Fennec"||K=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(X))K="Firefox Mobile";else if(K=="Maxthon"&&te)te=te.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(fe))fe=="Xbox 360"&&(X=null),fe=="Xbox 360"&&/\bIEMobile\b/.test(L)&&ce.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(K)||K&&!fe&&!/Browser|Mobi/.test(K))&&(X=="Windows CE"||/Mobi/i.test(L)))K+=" Mobile";else if(K=="IE"&&Me)try{P.external===null&&ce.unshift("platform preview")}catch{ce.unshift("embedded")}else(/\bBlackBerry\b/.test(fe)||/\bBB10\b/.test(L))&&(y=(RegExp(fe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(L)||0)[1]||te)?(y=[y,/BB10/.test(L)],X=(y[1]?(fe=null,Fe="BlackBerry"):"Device Software")+" "+y[0],te=null):this!=w&&fe!="Wii"&&(Me&&le||/Opera/.test(K)&&/\b(?:MSIE|Firefox)\b/i.test(L)||K=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(X)||K=="IE"&&(X&&!/^Win/.test(X)&&te>5.5||/\bWindows XP\b/.test(X)&&te>8||te==8&&!/\bTrident\b/.test(L)))&&!o.test(y=Q.call(w,L.replace(o,"")+";"))&&y.name&&(y="ing as "+y.name+((y=y.version)?" "+y:""),o.test(K)?(/\bIE\b/.test(y)&&X=="Mac OS"&&(X=null),y="identify"+y):(y="mask"+y,ge?K=N(ge.replace(/([a-z])([A-Z])/g,"$1 $2")):K="Opera",/\bIE\b/.test(y)&&(X=null),Me||(te=null)),De=["Presto"],ce.push(y));(y=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(L)||0)[1])&&(y=[parseFloat(y.replace(/\.(\d)$/,".0$1")),y],K=="Safari"&&y[1].slice(-1)=="+"?(K="WebKit Nightly",Ee="alpha",te=y[1].slice(0,-1)):(te==y[1]||te==(y[2]=(/\bSafari\/([\d.]+\+?)/i.exec(L)||0)[1]))&&(te=null),y[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(L)||0)[1],y[0]==537.36&&y[2]==537.36&&parseFloat(y[1])>=28&&De=="WebKit"&&(De=["Blink"]),!Me||!xe&&!y[1]?(De&&(De[1]="like Safari"),y=(y=y[0],y<400?1:y<500?2:y<526?3:y<533?4:y<534?"4+":y<535?5:y<537?6:y<538?7:y<601?8:y<602?9:y<604?10:y<606?11:y<608?12:"12")):(De&&(De[1]="like Chrome"),y=y[1]||(y=y[0],y<530?1:y<532?2:y<532.05?3:y<533?4:y<534.03?5:y<534.07?6:y<534.1?7:y<534.13?8:y<534.16?9:y<534.24?10:y<534.3?11:y<535.01?12:y<535.02?"13+":y<535.07?15:y<535.11?16:y<535.19?17:y<536.05?18:y<536.1?19:y<537.01?20:y<537.11?"21+":y<537.13?23:y<537.18?24:y<537.24?25:y<537.36?26:De!="Blink"?"27":"28")),De&&(De[1]+=" "+(y+=typeof y=="number"?".x":/[.+]/.test(y)?"":"+")),K=="Safari"&&(!te||parseInt(te)>45)?te=y:K=="Chrome"&&/\bHeadlessChrome/i.test(L)&&ce.unshift("headless")),K=="Opera"&&(y=/\bzbov|zvav$/.exec(X))?(K+=" ",ce.unshift("desktop mode"),y=="zvav"?(K+="Mini",te=null):K+="Mobile",X=X.replace(RegExp(" *"+y+"$"),"")):K=="Safari"&&/\bChrome\b/.exec(De&&De[1])?(ce.unshift("desktop mode"),K="Chrome Mobile",te=null,/\bOS X\b/.test(X)?(Fe="Apple",X="iOS 4.3+"):X=null):/\bSRWare Iron\b/.test(K)&&!te&&(te=m("Chrome")),te&&te.indexOf(y=/[\d.]+$/.exec(X))==0&&L.indexOf("/"+y+"-")>-1&&(X=re(X.replace(y,""))),X&&X.indexOf(K)!=-1&&!RegExp(K+" OS").test(X)&&(X=X.replace(RegExp(" *"+B(K)+" *"),"")),De&&!/\b(?:Avant|Nook)\b/.test(K)&&(/Browser|Lunascape|Maxthon/.test(K)||K!="Safari"&&/^iOS/.test(X)&&/\bSafari\b/.test(De[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(K)&&De[1])&&(y=De[De.length-1])&&ce.push(y),ce.length&&(ce=["("+ce.join("; ")+")"]),Fe&&fe&&fe.indexOf(Fe)<0&&ce.push("on "+Fe),fe&&ce.push((/^on /.test(ce[ce.length-1])?"":"on ")+fe),X&&(y=/ ([\d.+]+)$/.exec(X),Zt=y&&X.charAt(X.length-y[0].length-1)=="/",X={architecture:32,family:y&&!Zt?X.replace(y[0],""):X,version:y?y[1]:null,toString:function(){var R=this.version;return this.family+(R&&!Zt?" "+R:"")+(this.architecture==64?" 64-bit":"")}}),(y=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Ke))&&!/\bi686\b/i.test(Ke)?(X&&(X.architecture=64,X.family=X.family.replace(RegExp(" *"+y),"")),K&&(/\bWOW64\b/i.test(L)||Me&&/\w(?:86|32)$/.test(J.cpuClass||J.platform)&&!/\bWin64; x64\b/i.test(L))&&ce.unshift("32-bit")):X&&/^OS X/.test(X.family)&&K=="Chrome"&&parseFloat(te)>=39&&(X.architecture=64),L||(L=null);var b={};return b.description=L,b.layout=De&&De[0],b.manufacturer=Fe,b.name=K,b.prerelease=Ee,b.product=fe,b.ua=L,b.version=K&&te,b.os=X||{architecture:null,family:null,version:null,toString:function(){return"null"}},b.parse=Q,b.toString=E,b.version&&ce.unshift(te),b.name&&ce.unshift(K),X&&K&&!(X==String(X).split(" ")[0]&&(X==K.split(" ")[0]||fe))&&ce.push(fe?"("+X+")":"on "+X),ce.length&&(b.description=ce.join(" ")),b}var ae=Q();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(t.platform=ae,define(function(){return ae})):r&&i?w(ae,function(L,P){r[P]=L}):t.platform=ae}).call(xo)});var RN=f((ble,CN)=>{"use strict";l();function wr(e){this._maxSize=e,this.clear()}wr.prototype.clear=function(){this._size=0,this._values=Object.create(null)};wr.prototype.get=function(e){return this._values[e]};wr.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var MU=/[^.^\]^[]+|(?=\[\]|\.\.)/g,DN=/^\d+$/,wU=/^\d/,LU=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,PU=/^\s*(['"]?)(.*?)(\1)\s*$/,Dm=512,TN=new wr(Dm),hN=new wr(Dm),bN=new wr(Dm);CN.exports={Cache:wr,split:bm,normalizePath:hm,setter:function(e){var t=hm(e);return hN.get(e)||hN.set(e,function(r,i){for(var a=0,s=t.length,o=r;a<s-1;){var c=t[a];if(c==="__proto__"||c==="constructor"||c==="prototype")return r;o=o[t[a++]]}o[t[a]]=i})},getter:function(e,t){var n=hm(e);return bN.get(e)||bN.set(e,function(i){for(var a=0,s=n.length;a<s;)if(i!=null||!t)i=i[n[a++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Cm(n)||DN.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){FU(Array.isArray(e)?e:bm(e),t,n)}};function hm(e){return TN.get(e)||TN.set(e,bm(e).map(function(t){return t.replace(PU,"$2")}))}function bm(e){return e.match(MU)||[""]}function FU(e,t,n){var r=e.length,i,a,s,o;for(a=0;a<r;a++)i=e[a],i&&(UU(i)&&(i='"'+i+'"'),o=Cm(i),s=!o&&/^\d+$/.test(i),t.call(n,i,o,s,a,e))}function Cm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function kU(e){return e.match(wU)&&!e.match(DN)}function BU(e){return LU.test(e)}function UU(e){return!Cm(e)&&(kU(e)||BU(e))}});var NN=f((Cle,ON)=>{"use strict";l();var GU=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,oc=e=>e.match(GU)||[],lc=e=>e[0].toUpperCase()+e.slice(1),Rm=(e,t)=>oc(e).join(t).toLowerCase(),AN=e=>oc(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),HU=e=>lc(AN(e)),YU=e=>Rm(e,"_"),qU=e=>Rm(e,"-"),VU=e=>lc(Rm(e," ")),$U=e=>oc(e).map(lc).join(" ");ON.exports={words:oc,upperFirst:lc,camelCase:AN,pascalCase:HU,snakeCase:YU,kebabCase:qU,sentenceCase:VU,titleCase:$U}});var IN=f((Ale,Am)=>{"use strict";l();Am.exports=function(e){return yN(KU(e),e)};Am.exports.array=yN;function yN(e,t){var n=e.length,r=new Array(n),i={},a=n,s=WU(t),o=zU(e);for(t.forEach(function(u){if(!o.has(u[0])||!o.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||c(e[a],a,new Set);return r;function c(u,d,p){if(p.has(u)){var S;try{S=", node was:"+JSON.stringify(u)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!o.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[d]){i[d]=!0;var g=s.get(u)||new Set;if(g=Array.from(g),d=g.length){p.add(u);do{var T=g[--d];c(T,o.get(T),p)}while(d);p.delete(u)}r[--n]=u}}}function KU(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function WU(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function zU(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}});var YN=f((Ile,HN)=>{"use strict";l();var Pr=class e extends Error{constructor(t,n,r){super("[ParserError] "+t,n,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},Cc=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},Va=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new Cc(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let n;for(;n===!1||this.nextChar();)n=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new Pr("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,n){n&&this.next(n),this.stack.push(this.state),this.state=new Cc(t)}callNow(t,n){return this.call(t,n),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new Pr("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new Pr("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new Pr("Must declare a parseStart method")}};Va.END=1114112;Va.Error=Pr;HN.exports=Va});var VN=f((xle,qN)=>{"use strict";l();qN.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Rc=f((wle,$N)=>{"use strict";l();$N.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var WN=f((Ple,KN)=>{"use strict";l();var Ri=Rc(),vm=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${Ri(2,this.getUTCMonth()+1)}-${Ri(2,this.getUTCDate())}`,n=`${Ri(2,this.getUTCHours())}:${Ri(2,this.getUTCMinutes())}:${Ri(2,this.getUTCSeconds())}.${Ri(3,this.getUTCMilliseconds())}`;return`${t}T${n}`}};KN.exports=e=>{let t=new vm(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var XN=f((kle,QN)=>{"use strict";l();var zN=Rc(),D7=global.Date,xm=class extends D7{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${zN(2,this.getUTCMonth()+1)}-${zN(2,this.getUTCDate())}`}};QN.exports=e=>{let t=new xm(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var jN=f((Ule,JN)=>{"use strict";l();var Ac=Rc(),Mm=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${Ac(2,this.getUTCHours())}:${Ac(2,this.getUTCMinutes())}:${Ac(2,this.getUTCSeconds())}.${Ac(3,this.getUTCMilliseconds())}`}};JN.exports=e=>{let t=new Mm(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Oc=f((exports,module)=>{"use strict";l();module.exports=makeParserClass(YN());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=VN(),createDateTimeFloat=WN(),createDate=XN(),createTime=jN(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
43
+ `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(r){let i=this.ctx,a=r.key.pop();for(let s of r.key){if(hasKey(i,s)&&(!isTable(i[s])||i[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[s]=i[s]||Table()}if(hasKey(i,a))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[a]=r.value.valueOf():i[a]=r.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(r){return this.state.resultTable?this.state.resultTable.push(r):this.state.resultTable=[r],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(r){return this.returnNow({key:this.state.resultTable,value:r})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)&&(!isTable(this.ctx[r])||this.ctx[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[r]=this.ctx[r]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)||(this.ctx[r]=List()),isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[r])){let i=Table();this.ctx[r].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else{if(isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(r){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(r){return this.returnNow(r)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let r="\\u00";return this.char<16&&(r+="0"),r+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${r} instead`))}recordMultiEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(r){try{let i=parseInt(r,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(r){if(this.state.resultArr){let i=this.state.resultArr[_contentType],a=tomlType(r);if(i!==a)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${a}`))}else this.state.resultArr=InlineList(tomlType(r));return isFloat(r)||isInteger(r)?this.state.resultArr.push(r.valueOf()):this.state.resultArr.push(r),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(r){let i=this.state.resultTable,a=r.key.pop();for(let s of r.key){if(hasKey(i,s)&&(!isTable(i[s])||i[s][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[s]=i[s]||Table()}if(hasKey(i,a))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[a]=r.value.valueOf():i[a]=r.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var Nc=f((Yle,ZN)=>{"use strict";l();ZN.exports=C7;function C7(e,t){if(e.pos==null||e.line==null)return e;let n=e.message;if(n+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
44
44
  `,t&&t.split){let r=t.split(/\n/),i=String(Math.min(r.length,e.line+3)).length,a=" ";for(;a.length<i;)a+=" ";for(let s=Math.max(0,e.line-1);s<Math.min(r.length,e.line+2);++s){let o=String(s+1);if(o.length<i&&(o=" "+o),e.line===s){n+=o+"> "+r[s]+`
45
45
  `,n+=a+" ";for(let c=0;c<e.col;++c)n+=" ";n+=`^
46
46
  `}else n+=o+": "+r[s]+`
47
47
  `}}return e.message=n+`
48
- `,e}});var ty=f((qle,ey)=>{"use strict";l();ey.exports=O7;var R7=Oc(),A7=Nc();function O7(e){global.Buffer&&global.Buffer.isBuffer(e)&&(e=e.toString("utf8"));let t=new R7;try{return t.parse(e),t.finish()}catch(n){throw A7(n,e)}}});var iy=f(($le,ry)=>{"use strict";l();ry.exports=y7;var N7=Oc(),ny=Nc();function y7(e,t){t||(t={});let n=0,r=t.blocksize||40960,i=new N7;return new Promise((s,o)=>{setImmediate(a,n,r,s,o)});function a(s,o,c,u){if(s>=e.length)try{return c(i.finish())}catch(d){return u(ny(d,e))}try{i.parse(e.slice(s,s+o)),setImmediate(a,s+o,o,c,u)}catch(d){u(ny(d,e))}}}});var oy=f((Wle,sy)=>{"use strict";l();sy.exports=v7;var I7=require("stream"),ay=Oc();function v7(e){return e?x7(e):M7(e)}function x7(e){let t=new ay;return e.setEncoding("utf8"),new Promise((n,r)=>{let i,a=!1,s=!1;function o(){if(a=!0,!i)try{n(t.finish())}catch(d){r(d)}}function c(d){s=!0,r(d)}e.once("end",o),e.once("error",c),u();function u(){i=!0;let d;for(;(d=e.read())!==null;)try{t.parse(d)}catch(p){return c(p)}if(i=!1,a)return o();s||e.once("readable",u)}})}function M7(){let e=new ay;return new I7.Transform({objectMode:!0,transform(t,n,r){try{e.parse(t.toString(n))}catch(i){this.emit("error",i)}r()},flush(t){try{this.push(e.finish())}catch(n){this.emit("error",n)}t()}})}});var ly=f((Qle,$a)=>{"use strict";l();$a.exports=ty();$a.exports.async=iy();$a.exports.stream=oy();$a.exports.prettyError=Nc()});var fy=f((Jle,Pm)=>{"use strict";l();Pm.exports=w7;Pm.exports.value=Lm;function w7(e){if(e===null)throw Fr("null");if(e===void 0)throw Fr("undefined");if(typeof e!="object")throw Fr(typeof e);if(typeof e.toJSON=="function"&&(e=e.toJSON()),e==null)return null;let t=kt(e);if(t!=="table")throw Fr(t);return wm("","",e)}function Fr(e){return new Error("Can only stringify objects, not "+e)}function L7(){return new Error("Array values can't have mixed types")}function cy(e){return Object.keys(e).filter(t=>uy(e[t]))}function P7(e){return Object.keys(e).filter(t=>!uy(e[t]))}function yc(e){let t=Array.isArray(e)?[]:Object.prototype.hasOwnProperty.call(e,"__proto__")?{["__proto__"]:void 0}:{};for(let n of Object.keys(e))e[n]&&typeof e[n].toJSON=="function"&&!("toISOString"in e[n])?t[n]=e[n].toJSON():t[n]=e[n];return t}function wm(e,t,n){n=yc(n);var r,i;r=cy(n),i=P7(n);var a=[],s=t||"";r.forEach(c=>{var u=kt(n[c]);u!=="undefined"&&u!=="null"&&a.push(s+Ic(c)+" = "+my(n[c],!0))}),a.length>0&&a.push("");var o=e&&r.length>0?t+" ":"";return i.forEach(c=>{a.push(K7(e,o,c,n[c]))}),a.join(`
48
+ `,e}});var ty=f((Vle,ey)=>{"use strict";l();ey.exports=O7;var R7=Oc(),A7=Nc();function O7(e){global.Buffer&&global.Buffer.isBuffer(e)&&(e=e.toString("utf8"));let t=new R7;try{return t.parse(e),t.finish()}catch(n){throw A7(n,e)}}});var iy=f((Kle,ry)=>{"use strict";l();ry.exports=y7;var N7=Oc(),ny=Nc();function y7(e,t){t||(t={});let n=0,r=t.blocksize||40960,i=new N7;return new Promise((s,o)=>{setImmediate(a,n,r,s,o)});function a(s,o,c,u){if(s>=e.length)try{return c(i.finish())}catch(d){return u(ny(d,e))}try{i.parse(e.slice(s,s+o)),setImmediate(a,s+o,o,c,u)}catch(d){u(ny(d,e))}}}});var oy=f((zle,sy)=>{"use strict";l();sy.exports=v7;var I7=require("stream"),ay=Oc();function v7(e){return e?x7(e):M7(e)}function x7(e){let t=new ay;return e.setEncoding("utf8"),new Promise((n,r)=>{let i,a=!1,s=!1;function o(){if(a=!0,!i)try{n(t.finish())}catch(d){r(d)}}function c(d){s=!0,r(d)}e.once("end",o),e.once("error",c),u();function u(){i=!0;let d;for(;(d=e.read())!==null;)try{t.parse(d)}catch(p){return c(p)}if(i=!1,a)return o();s||e.once("readable",u)}})}function M7(){let e=new ay;return new I7.Transform({objectMode:!0,transform(t,n,r){try{e.parse(t.toString(n))}catch(i){this.emit("error",i)}r()},flush(t){try{this.push(e.finish())}catch(n){this.emit("error",n)}t()}})}});var ly=f((Xle,$a)=>{"use strict";l();$a.exports=ty();$a.exports.async=iy();$a.exports.stream=oy();$a.exports.prettyError=Nc()});var fy=f((jle,Pm)=>{"use strict";l();Pm.exports=w7;Pm.exports.value=Lm;function w7(e){if(e===null)throw Fr("null");if(e===void 0)throw Fr("undefined");if(typeof e!="object")throw Fr(typeof e);if(typeof e.toJSON=="function"&&(e=e.toJSON()),e==null)return null;let t=kt(e);if(t!=="table")throw Fr(t);return wm("","",e)}function Fr(e){return new Error("Can only stringify objects, not "+e)}function L7(){return new Error("Array values can't have mixed types")}function cy(e){return Object.keys(e).filter(t=>uy(e[t]))}function P7(e){return Object.keys(e).filter(t=>!uy(e[t]))}function yc(e){let t=Array.isArray(e)?[]:Object.prototype.hasOwnProperty.call(e,"__proto__")?{["__proto__"]:void 0}:{};for(let n of Object.keys(e))e[n]&&typeof e[n].toJSON=="function"&&!("toISOString"in e[n])?t[n]=e[n].toJSON():t[n]=e[n];return t}function wm(e,t,n){n=yc(n);var r,i;r=cy(n),i=P7(n);var a=[],s=t||"";r.forEach(c=>{var u=kt(n[c]);u!=="undefined"&&u!=="null"&&a.push(s+Ic(c)+" = "+my(n[c],!0))}),a.length>0&&a.push("");var o=e&&r.length>0?t+" ":"";return i.forEach(c=>{a.push(K7(e,o,c,n[c]))}),a.join(`
49
49
  `)}function uy(e){switch(kt(e)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return e.length===0||kt(e[0])!=="table";case"table":return Object.keys(e).length===0;default:return!1}}function kt(e){return e===void 0?"undefined":e===null?"null":typeof e=="bigint"||Number.isInteger(e)&&!Object.is(e,-0)?"integer":typeof e=="number"?"float":typeof e=="boolean"?"boolean":typeof e=="string"?"string":"toISOString"in e?isNaN(e)?"undefined":"datetime":Array.isArray(e)?"array":"table"}function Ic(e){var t=String(e);return/^[-A-Za-z0-9_]+$/.test(t)?t:dy(t)}function dy(e){return'"'+_y(e).replace(/"/g,'\\"')+'"'}function F7(e){return"'"+e+"'"}function k7(e,t){for(;t.length<e;)t="0"+t;return t}function _y(e){return e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/([\u0000-\u001f\u007f])/,t=>"\\u"+k7(4,t.codePointAt(0).toString(16)))}function B7(e){let t=e.split(/\n/).map(n=>_y(n).replace(/"(?="")/g,'\\"')).join(`
50
50
  `);return t.slice(-1)==='"'&&(t+=`\\
51
51
  `),`"""
@@ -56,11 +56,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Ke=H,y=ee);let ce={cod
56
56
  `),s+=t+"[["+a+`]]
57
57
  `,s+=wm(a+".",t,o)}),s}function z7(e,t,n,r){var i=e+Ic(n),a="";return cy(r).length>0&&(a+=t+"["+i+`]
58
58
  `),a+wm(i+".",t,r)}});var gy=f(Fm=>{"use strict";l();Fm.parse=ly();Fm.stringify=fy()});var Gm=f(Ii=>{"use strict";l();Object.defineProperty(Ii,"__esModule",{value:!0});Ii.DEFAULT_COLOR_MAP=void 0;Ii.DEFAULT_COLOR_MAP={red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",white_bold:"\x1B[01m",reset:"\x1B[0m"};var Um=class{constructor(t=Ii.DEFAULT_COLOR_MAP){this.text="",this.colorMap=t}addCharsWithColor(t,n){let r=this.colorMap[t];this.text+=r!==void 0?`${r}${n}${this.colorMap.reset}`:n}renderConsole(){return this.text}};Ii.default=Um});var Wa=f(rt=>{"use strict";l();Object.defineProperty(rt,"__esModule",{value:!0});rt.DEFAULT_HEADER_ALIGNMENT=rt.DEFAULT_ROW_ALIGNMENT=rt.DEFAULT_HEADER_FONT_COLOR=rt.DEFAULT_ROW_FONT_COLOR=rt.COLORS=rt.ALIGNMENTS=rt.DEFAULT_TABLE_STYLE=rt.DEFAULT_ROW_SEPARATOR=rt.DEFAULT_COLUMN_LEN=void 0;rt.DEFAULT_COLUMN_LEN=20;rt.DEFAULT_ROW_SEPARATOR=!1;rt.DEFAULT_TABLE_STYLE={headerTop:{left:"\u250C",mid:"\u252C",right:"\u2510",other:"\u2500"},headerBottom:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"},tableBottom:{left:"\u2514",mid:"\u2534",right:"\u2518",other:"\u2500"},vertical:"\u2502",rowSeparator:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"}};rt.ALIGNMENTS=["right","left","center"];rt.COLORS=["red","green","yellow","white","blue","magenta","cyan","white_bold","reset"];rt.DEFAULT_ROW_FONT_COLOR="white";rt.DEFAULT_HEADER_FONT_COLOR="white_bold";rt.DEFAULT_ROW_ALIGNMENT="right";rt.DEFAULT_HEADER_ALIGNMENT="center"});var Hm=f(Hn=>{"use strict";l();Object.defineProperty(Hn,"__esModule",{value:!0});Hn.rawColumnToInternalColumn=Hn.objIfExists=void 0;var oG=Wa(),lG=(e,t)=>t?{[e]:t}:{};Hn.objIfExists=lG;var cG=e=>{var t;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(t=e.title)!==null&&t!==void 0?t:e.name},(0,Hn.objIfExists)("color",e.color)),(0,Hn.objIfExists)("maxLen",e.maxLen)),(0,Hn.objIfExists)("minLen",e.minLen)),{alignment:e.alignment||oG.DEFAULT_ROW_ALIGNMENT})};Hn.rawColumnToInternalColumn=cG});var Ry=f(Ym=>{"use strict";l();Object.defineProperty(Ym,"__esModule",{value:!0});var uG=[{first:768,last:879},{first:1155,last:1158},{first:1160,last:1161},{first:1425,last:1469},{first:1471,last:1471},{first:1473,last:1474},{first:1476,last:1477},{first:1479,last:1479},{first:1536,last:1539},{first:1552,last:1557},{first:1611,last:1630},{first:1648,last:1648},{first:1750,last:1764},{first:1767,last:1768},{first:1770,last:1773},{first:1807,last:1807},{first:1809,last:1809},{first:1840,last:1866},{first:1958,last:1968},{first:2027,last:2035},{first:2305,last:2306},{first:2364,last:2364},{first:2369,last:2376},{first:2381,last:2381},{first:2385,last:2388},{first:2402,last:2403},{first:2433,last:2433},{first:2492,last:2492},{first:2497,last:2500},{first:2509,last:2509},{first:2530,last:2531},{first:2561,last:2562},{first:2620,last:2620},{first:2625,last:2626},{first:2631,last:2632},{first:2635,last:2637},{first:2672,last:2673},{first:2689,last:2690},{first:2748,last:2748},{first:2753,last:2757},{first:2759,last:2760},{first:2765,last:2765},{first:2786,last:2787},{first:2817,last:2817},{first:2876,last:2876},{first:2879,last:2879},{first:2881,last:2883},{first:2893,last:2893},{first:2902,last:2902},{first:2946,last:2946},{first:3008,last:3008},{first:3021,last:3021},{first:3134,last:3136},{first:3142,last:3144},{first:3146,last:3149},{first:3157,last:3158},{first:3260,last:3260},{first:3263,last:3263},{first:3270,last:3270},{first:3276,last:3277},{first:3298,last:3299},{first:3393,last:3395},{first:3405,last:3405},{first:3530,last:3530},{first:3538,last:3540},{first:3542,last:3542},{first:3633,last:3633},{first:3636,last:3642},{first:3655,last:3662},{first:3761,last:3761},{first:3764,last:3769},{first:3771,last:3772},{first:3784,last:3789},{first:3864,last:3865},{first:3893,last:3893},{first:3895,last:3895},{first:3897,last:3897},{first:3953,last:3966},{first:3968,last:3972},{first:3974,last:3975},{first:3984,last:3991},{first:3993,last:4028},{first:4038,last:4038},{first:4141,last:4144},{first:4146,last:4146},{first:4150,last:4151},{first:4153,last:4153},{first:4184,last:4185},{first:4448,last:4607},{first:4959,last:4959},{first:5906,last:5908},{first:5938,last:5940},{first:5970,last:5971},{first:6002,last:6003},{first:6068,last:6069},{first:6071,last:6077},{first:6086,last:6086},{first:6089,last:6099},{first:6109,last:6109},{first:6155,last:6157},{first:6313,last:6313},{first:6432,last:6434},{first:6439,last:6440},{first:6450,last:6450},{first:6457,last:6459},{first:6679,last:6680},{first:6912,last:6915},{first:6964,last:6964},{first:6966,last:6970},{first:6972,last:6972},{first:6978,last:6978},{first:7019,last:7027},{first:7616,last:7626},{first:7678,last:7679},{first:8203,last:8207},{first:8234,last:8238},{first:8288,last:8291},{first:8298,last:8303},{first:8400,last:8431},{first:12330,last:12335},{first:12441,last:12442},{first:43014,last:43014},{first:43019,last:43019},{first:43045,last:43046},{first:64286,last:64286},{first:65024,last:65039},{first:65056,last:65059},{first:65279,last:65279},{first:65529,last:65531},{first:68097,last:68099},{first:68101,last:68102},{first:68108,last:68111},{first:68152,last:68154},{first:68159,last:68159},{first:119143,last:119145},{first:119155,last:119170},{first:119173,last:119179},{first:119210,last:119213},{first:119362,last:119364},{first:917505,last:917505},{first:917536,last:917631},{first:917760,last:917999}];Ym.default=uG});var Ay=f(qm=>{"use strict";l();Object.defineProperty(qm,"__esModule",{value:!0});var dG=(e,t,n)=>{let r=0,i,a=n;if(e<t[0].first||e>t[a].last)return 0;for(;a>=r;)if(i=Math.floor((r+a)/2),e>t[i].last)r=i+1;else if(e<t[i].first)a=i-1;else return 1;return 0};qm.default=dG});var Vm=f(za=>{"use strict";l();var Ny=za&&za.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(za,"__esModule",{value:!0});var Oy=Ny(Ry()),_G=Ny(Ay()),mG=e=>e===0?0:e<32||e>=127&&e<160?-1:_G.default(e,Oy.default,Oy.default.length-1)?0:1+ +(e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141));za.default=mG});var yy=f(Qa=>{"use strict";l();var pG=Qa&&Qa.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qa,"__esModule",{value:!0});var EG=pG(Vm()),fG=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n),i=EG.default(r);if(i<0)return-1;t+=i}return t};Qa.default=fG});var vy=f(ur=>{"use strict";l();var Iy=ur&&ur.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ur,"__esModule",{value:!0});ur.wcswidth=ur.wcwidth=void 0;var gG=Iy(yy());ur.wcswidth=gG.default;var SG=Iy(Vm());ur.wcwidth=SG.default});var $m=f(kr=>{"use strict";l();Object.defineProperty(kr,"__esModule",{value:!0});kr.findWidthInConsole=kr.stripAnsi=void 0;var TG=vy(),hG=/\x1b\[\d{1,3}(;\d{1,3})*m/g,bG=e=>e.replace(hG,"");kr.stripAnsi=bG;var DG=(e,t)=>{let n=0;return e=(0,kr.stripAnsi)(e),t&&Object.entries(t).forEach(([r,i])=>{let a=new RegExp(r,"g");n+=(e.match(a)||[]).length*i,e=e.replace(r,"")}),n+=(0,TG.wcswidth)(e),n};kr.findWidthInConsole=DG});var Wm=f(dr=>{"use strict";l();Object.defineProperty(dr,"__esModule",{value:!0});dr.biggestWordInSentence=dr.limitWidth=dr.textWithPadding=void 0;var Km=$m(),CG=(e,t,n,r)=>{let i=(0,Km.findWidthInConsole)(e,r),a=Math.floor((n-i)/2),s=n-a-i;if(n<i)return e;switch(t){case"left":return e.concat(" ".repeat(n-i));case"center":return" ".repeat(a).concat(e).concat(" ".repeat(s));case"right":default:return" ".repeat(n-i).concat(e)}};dr.textWithPadding=CG;var RG=(e,t,n)=>{let r=[],i=e.split(" "),a=[],s=0;return i.forEach(o=>{let c=(0,Km.findWidthInConsole)(o,n);s+c<=t?(s+=c+1,a.push(o)):(r.push(a.join(" ")),a=[o],s=c+1)}),r.push(a.join(" ")),r};dr.limitWidth=RG;var AG=(e,t)=>e.split(" ").reduce((n,r)=>Math.max(n,(0,Km.findWidthInConsole)(r,t)),0);dr.biggestWordInSentence=AG});var Xa=f(Ue=>{"use strict";l();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.getWidthLimitedColumnsArray=Ue.createHeaderAsRow=Ue.renderTableHorizontalBorders=Ue.findLenOfColumn=Ue.createRow=Ue.createColumFromComputedColumn=Ue.createColumFromOnlyName=Ue.createTableHorizontalBorders=Ue.convertRawRowOptionsToStandard=Ue.cellText=void 0;var zm=Hm(),xy=$m(),Qm=Wm(),wc=Wa(),vi=(e,t)=>Math.max(e,t),OG=e=>e==null?"":`${e}`;Ue.cellText=OG;var NG=e=>{if(e)return{color:e.color,separator:e.separator||wc.DEFAULT_ROW_SEPARATOR}};Ue.convertRawRowOptionsToStandard=NG;var yG=({left:e,mid:t,right:n,other:r},i)=>{let a=e;return i.forEach(s=>{a+=r.repeat(s+2),a+=t}),a=a.slice(0,-t.length),a+=n,a};Ue.createTableHorizontalBorders=yG;var IG=e=>({name:e,title:e});Ue.createColumFromOnlyName=IG;var vG=e=>{var t;return Object.assign(Object.assign(Object.assign(Object.assign({name:e.name,title:(t=e.title)!==null&&t!==void 0?t:e.name},(0,zm.objIfExists)("color",e.color)),(0,zm.objIfExists)("maxLen",e.maxLen)),(0,zm.objIfExists)("minLen",e.minLen)),{alignment:e.alignment||wc.DEFAULT_ROW_ALIGNMENT})};Ue.createColumFromComputedColumn=vG;var xG=(e,t,n)=>({color:e,separator:n,text:t});Ue.createRow=xG;var MG=(e,t,n)=>{let r=e.name,i=e.title,a=vi(0,e?.minLen||0);return e.maxLen?(a=vi(a,vi(e.maxLen,(0,Qm.biggestWordInSentence)(i,n))),a=t.reduce((s,o)=>vi(s,(0,Qm.biggestWordInSentence)((0,Ue.cellText)(o.text[r]),n)),a),a):(a=vi(a,(0,xy.findWidthInConsole)(i,n)),t.forEach(s=>{a=vi(a,(0,xy.findWidthInConsole)((0,Ue.cellText)(s.text[r]),n))}),a)};Ue.findLenOfColumn=MG;var wG=(e,t)=>(0,Ue.createTableHorizontalBorders)(e,t);Ue.renderTableHorizontalBorders=wG;var LG=(e,t)=>{let n=wc.DEFAULT_HEADER_FONT_COLOR,r=e(n,{},!1);return t.forEach(i=>{r.text[i.name]=i.title}),r};Ue.createHeaderAsRow=LG;var PG=(e,t,n)=>{let r={};return e.forEach(i=>{r[i.name]=(0,Qm.limitWidth)((0,Ue.cellText)(t.text[i.name]),i.length||wc.DEFAULT_COLUMN_LEN,n)}),r};Ue.getWidthLimitedColumnsArray=PG});var My=f(xi=>{"use strict";l();Object.defineProperty(xi,"__esModule",{value:!0});xi.preProcessRows=xi.preProcessColumns=void 0;var FG=Xa(),kG=e=>{e.computedColumns.length&&e.computedColumns.forEach(t=>{e.addColumn(t),e.rows.forEach(n=>{n.text[t.name]=t.function(n.text)})})},BG=e=>{e.enabledColumns.length&&(e.columns=e.columns.filter(t=>e.enabledColumns.includes(t.name)))},UG=e=>{e.disabledColumns.length&&(e.columns=e.columns.filter(t=>!e.disabledColumns.includes(t.name)))},GG=e=>{e.columns.forEach(t=>{t.length=(0,FG.findLenOfColumn)(t,e.rows,e.charLength)})},HG=e=>{kG(e),UG(e),BG(e),GG(e)};xi.preProcessColumns=HG;var YG=e=>{let t=e.rows.filter(n=>e.filterFunction(n.text)).sort((n,r)=>e.sortFunction(n.text,r.text));e.rows=t};xi.preProcessRows=YG});var Xm=f(jt=>{"use strict";l();var Ly=jt&&jt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jt,"__esModule",{value:!0});jt.printSimpleTable=jt.renderSimpleTable=jt.renderTable=void 0;var Py=Ly(Gm()),Fy=Wm(),_n=Wa(),_r=Xa(),qG=Ly(Jm()),wy=My(),VG=(e,t,n,r,i,a,s,o)=>{let c=new Py.default(s);return c.addCharsWithColor("",e.vertical),t.forEach(u=>{let p=n<r[u.name].length?(0,_r.cellText)(r[u.name][n]):"";c.addCharsWithColor(_n.DEFAULT_ROW_FONT_COLOR," "),c.addCharsWithColor(i&&_n.DEFAULT_HEADER_FONT_COLOR||u.color||a.color,(0,Fy.textWithPadding)(p,u.alignment||_n.DEFAULT_ROW_ALIGNMENT,u.length||_n.DEFAULT_COLUMN_LEN,o)),c.addCharsWithColor("",` ${e.vertical}`)}),c.renderConsole()},ky=(e,t,n,r,i,a)=>{let s=(0,_r.getWidthLimitedColumnsArray)(t,n,a),o=Object.values(s).reduce((u,d)=>Math.max(u,d.length),0),c=[];for(let u=0;u<o;u+=1){let d=VG(e,t,u,s,i,n,r,a);c.push(d)}return c},$G=(e,t)=>{let n=[];return n=n.concat(ky(e.tableStyle,e.columns,t,e.colorMap,void 0,e.charLength)),n},KG=e=>{let t=[];if(e.title===void 0)return t;let n=()=>{let a=(s,o)=>s+o+2+1;return e.columns.map(s=>s.length||_n.DEFAULT_COLUMN_LEN).reduce(a,1)},r=(0,Fy.textWithPadding)(e.title,_n.DEFAULT_HEADER_ALIGNMENT,n()),i=new Py.default(e.colorMap);return i.addCharsWithColor(_n.DEFAULT_HEADER_FONT_COLOR,r),t.push(i.renderConsole()),t},WG=e=>{let t=[];t.push((0,_r.renderTableHorizontalBorders)(e.tableStyle.headerTop,e.columns.map(r=>r.length||_n.DEFAULT_COLUMN_LEN)));let n=(0,_r.createHeaderAsRow)(_r.createRow,e.columns);return t=t.concat(ky(e.tableStyle,e.columns,n,e.colorMap,!0)),t.push((0,_r.renderTableHorizontalBorders)(e.tableStyle.headerBottom,e.columns.map(r=>r.length||_n.DEFAULT_COLUMN_LEN))),t},zG=e=>{let t=[];return t.push((0,_r.renderTableHorizontalBorders)(e.tableStyle.tableBottom,e.columns.map(n=>n.length||_n.DEFAULT_COLUMN_LEN))),t},QG=(e,t)=>{let n=[],r=e.rows.length-1;return e.rows.indexOf(t)!==r&&t.separator&&n.push((0,_r.renderTableHorizontalBorders)(e.tableStyle.rowSeparator,e.columns.map(a=>a.length||_n.DEFAULT_COLUMN_LEN))),n},XG=e=>{(0,wy.preProcessColumns)(e),(0,wy.preProcessRows)(e);let t=[];return KG(e).forEach(n=>t.push(n)),WG(e).forEach(n=>t.push(n)),e.rows.forEach(n=>{$G(e,n).forEach(r=>t.push(r)),QG(e,n).forEach(r=>t.push(r))}),zG(e).forEach(n=>t.push(n)),t.join(`
59
- `)};jt.renderTable=XG;var JG=e=>{let t=new qG.default;return t.addRows(e),(0,jt.renderTable)(t)};jt.renderSimpleTable=JG;var jG=e=>{console.log((0,jt.renderSimpleTable)(e))};jt.printSimpleTable=jG});var Jm=f(Zm=>{"use strict";l();Object.defineProperty(Zm,"__esModule",{value:!0});var ZG=Gm(),Lc=Wa(),Pc=Xa(),eH=Hm(),tH=Xm(),nH=()=>0,rH=()=>!0,jm=class{initSimple(t){this.columns=t.map(n=>({name:n,title:n,alignment:Lc.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var n;this.title=t?.title||this.title,this.tableStyle=t?.style||this.tableStyle,this.sortFunction=t?.sort||this.sortFunction,this.filterFunction=t?.filter||this.filterFunction,this.enabledColumns=t?.enabledColumns||this.enabledColumns,this.disabledColumns=t?.disabledColumns||this.disabledColumns,this.computedColumns=t?.computedColumns||this.computedColumns,this.columns=((n=t?.columns)===null||n===void 0?void 0:n.map(eH.rawColumnToInternalColumn))||this.columns,this.rowSeparator=t?.rowSeparator||this.rowSeparator,this.charLength=t?.charLength||this.charLength,t?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=Lc.DEFAULT_TABLE_STYLE,this.filterFunction=rH,this.sortFunction=nH,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=Lc.DEFAULT_ROW_SEPARATOR,this.colorMap=ZG.DEFAULT_COLOR_MAP,this.charLength={},t instanceof Array?this.initSimple(t):typeof t=="object"&&this.initDetailed(t)}createColumnFromRow(t){let n=this.columns.map(r=>r.name);Object.keys(t).forEach(r=>{n.includes(r)||this.columns.push((0,Pc.createColumFromOnlyName)(r))})}addColumn(t){typeof t=="string"?this.columns.push((0,Pc.createColumFromOnlyName)(t)):this.columns.push((0,Pc.createColumFromComputedColumn)(t))}addColumns(t){t.forEach(n=>{this.addColumn(n)})}addRow(t,n){this.createColumnFromRow(t),this.rows.push((0,Pc.createRow)(n?.color||Lc.DEFAULT_ROW_FONT_COLOR,t,n?.separator!==void 0?n?.separator:this.rowSeparator))}addRows(t,n){t.forEach(r=>{this.addRow(r,n)})}renderTable(){return(0,tH.renderTable)(this)}};Zm.default=jm});var Uy=f(Ja=>{"use strict";l();var iH=Ja&&Ja.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ja,"__esModule",{value:!0});var aH=iH(Jm()),By=Xa(),ep=class{constructor(t){this.table=new aH.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,n){return this.table.addRow(t,(0,By.convertRawRowOptionsToStandard)(n)),this}addRows(t,n){return this.table.addRows(t,(0,By.convertRawRowOptionsToStandard)(n)),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};Ja.default=ep});var tp=f(hn=>{"use strict";l();var sH=hn&&hn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hn,"__esModule",{value:!0});hn.renderTable=hn.printTable=hn.Table=void 0;var oH=sH(Uy());hn.Table=oH.default;var Gy=Xm();Object.defineProperty(hn,"printTable",{enumerable:!0,get:function(){return Gy.printSimpleTable}});Object.defineProperty(hn,"renderTable",{enumerable:!0,get:function(){return Gy.renderSimpleTable}})});var mI=f(ja=>{"use strict";l();Object.defineProperty(ja,"__esModule",{value:!0});ja.listen=void 0;var gH=require("http"),SH=require("https"),TH=require("path"),hH=require("events"),bH=e=>{if(typeof e.protocol=="string")return e.protocol;if(e instanceof gH.Server)return"http";if(e instanceof SH.Server)return"https"};async function _I(e,...t){e.listen(...t,()=>{}),await(0,hH.once)(e,"listening");let n=e.address();if(!n)throw new Error("Server not listening");let r,i=bH(e);if(typeof n=="string")r=encodeURIComponent((0,TH.resolve)(n)),i?i+="+unix":i="unix";else{let{address:a,port:s,family:o}=n;r=o==="IPv6"?`[${a}]`:a,r+=`:${s}`,i||(i="tcp")}return new URL(`${i}://${r}`)}ja.listen=_I;ja.default=_I});var fI=f((hde,EI)=>{"use strict";l();var pI=require("fs"),sp;function DH(){try{return pI.statSync("/.dockerenv"),!0}catch{return!1}}function CH(){try{return pI.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}EI.exports=()=>(sp===void 0&&(sp=DH()||CH()),sp)});var TI=f((Dde,op)=>{"use strict";l();var RH=require("os"),AH=require("fs"),gI=fI(),SI=()=>{if(process.platform!=="linux")return!1;if(RH.release().toLowerCase().includes("microsoft"))return!gI();try{return AH.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!gI():!1}catch{return!1}};process.env.__IS_WSL_TEST__?op.exports=SI:op.exports=SI()});var hI=f((Ode,Bc)=>{"use strict";l();var st=function(e){"use strict";var t=1e7,n=7,r=9007199254740992,i=S(r),a="0123456789abcdefghijklmnopqrstuvwxyz",s=typeof BigInt=="function";function o(m,E,b,R){return typeof m>"u"?o[0]:typeof E<"u"?+E==10&&!b?W(m):K(m,E,b,R):W(m)}function c(m,E){this.value=m,this.sign=E,this.isSmall=!1}c.prototype=Object.create(o.prototype);function u(m){this.value=m,this.sign=m<0,this.isSmall=!0}u.prototype=Object.create(o.prototype);function d(m){this.value=m}d.prototype=Object.create(o.prototype);function p(m){return-r<m&&m<r}function S(m){return m<1e7?[m]:m<1e14?[m%1e7,Math.floor(m/1e7)]:[m%1e7,Math.floor(m/1e7)%1e7,Math.floor(m/1e14)]}function g(m){T(m);var E=m.length;if(E<4&&$e(m,i)<0)switch(E){case 0:return 0;case 1:return m[0];case 2:return m[0]+m[1]*t;default:return m[0]+(m[1]+m[2]*t)*t}return m}function T(m){for(var E=m.length;m[--E]===0;);m.length=E+1}function N(m){for(var E=new Array(m),b=-1;++b<m;)E[b]=0;return E}function w(m){return m>0?Math.floor(m):Math.ceil(m)}function k(m,E){var b=m.length,R=E.length,v=new Array(b),O=0,I=t,x,F;for(F=0;F<R;F++)x=m[F]+E[F]+O,O=x>=I?1:0,v[F]=x-O*I;for(;F<b;)x=m[F]+O,O=x===I?1:0,v[F++]=x-O*I;return O>0&&v.push(O),v}function M(m,E){return m.length>=E.length?k(m,E):k(E,m)}function B(m,E){var b=m.length,R=new Array(b),v=t,O,I;for(I=0;I<b;I++)O=m[I]-v+E,E=Math.floor(O/v),R[I]=O-E*v,E+=1;for(;E>0;)R[I++]=E%v,E=Math.floor(E/v);return R}c.prototype.add=function(m){var E=W(m);if(this.sign!==E.sign)return this.subtract(E.negate());var b=this.value,R=E.value;return E.isSmall?new c(B(b,Math.abs(R)),this.sign):new c(M(b,R),this.sign)},c.prototype.plus=c.prototype.add,u.prototype.add=function(m){var E=W(m),b=this.value;if(b<0!==E.sign)return this.subtract(E.negate());var R=E.value;if(E.isSmall){if(p(b+R))return new u(b+R);R=S(Math.abs(R))}return new c(B(R,Math.abs(b)),b<0)},u.prototype.plus=u.prototype.add,d.prototype.add=function(m){return new d(this.value+W(m).value)},d.prototype.plus=d.prototype.add;function Y(m,E){var b=m.length,R=E.length,v=new Array(b),O=0,I=t,x,F;for(x=0;x<R;x++)F=m[x]-O-E[x],F<0?(F+=I,O=1):O=0,v[x]=F;for(x=R;x<b;x++){if(F=m[x]-O,F<0)F+=I;else{v[x++]=F;break}v[x]=F}for(;x<b;x++)v[x]=m[x];return T(v),v}function re(m,E,b){var R;return $e(m,E)>=0?R=Y(m,E):(R=Y(E,m),b=!b),R=g(R),typeof R=="number"?(b&&(R=-R),new u(R)):new c(R,b)}function Q(m,E,b){var R=m.length,v=new Array(R),O=-E,I=t,x,F;for(x=0;x<R;x++)F=m[x]+O,O=Math.floor(F/I),F%=I,v[x]=F<0?F+I:F;return v=g(v),typeof v=="number"?(b&&(v=-v),new u(v)):new c(v,b)}c.prototype.subtract=function(m){var E=W(m);if(this.sign!==E.sign)return this.add(E.negate());var b=this.value,R=E.value;return E.isSmall?Q(b,Math.abs(R),this.sign):re(b,R,this.sign)},c.prototype.minus=c.prototype.subtract,u.prototype.subtract=function(m){var E=W(m),b=this.value;if(b<0!==E.sign)return this.add(E.negate());var R=E.value;return E.isSmall?new u(b-R):Q(R,Math.abs(b),b>=0)},u.prototype.minus=u.prototype.subtract,d.prototype.subtract=function(m){return new d(this.value-W(m).value)},d.prototype.minus=d.prototype.subtract,c.prototype.negate=function(){return new c(this.value,!this.sign)},u.prototype.negate=function(){var m=this.sign,E=new u(-this.value);return E.sign=!m,E},d.prototype.negate=function(){return new d(-this.value)},c.prototype.abs=function(){return new c(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},d.prototype.abs=function(){return new d(this.value>=0?this.value:-this.value)};function ae(m,E){var b=m.length,R=E.length,v=b+R,O=N(v),I=t,x,F,j,de,me;for(j=0;j<b;++j){de=m[j];for(var Ae=0;Ae<R;++Ae)me=E[Ae],x=de*me+O[j+Ae],F=Math.floor(x/I),O[j+Ae]=x-F*I,O[j+Ae+1]+=F}return T(O),O}function L(m,E){var b=m.length,R=new Array(b),v=t,O=0,I,x;for(x=0;x<b;x++)I=m[x]*E+O,O=Math.floor(I/v),R[x]=I-O*v;for(;O>0;)R[x++]=O%v,O=Math.floor(O/v);return R}function P(m,E){for(var b=[];E-- >0;)b.push(0);return b.concat(m)}function $(m,E){var b=Math.max(m.length,E.length);if(b<=30)return ae(m,E);b=Math.ceil(b/2);var R=m.slice(b),v=m.slice(0,b),O=E.slice(b),I=E.slice(0,b),x=$(v,I),F=$(R,O),j=$(M(v,R),M(I,O)),de=M(M(x,P(Y(Y(j,x),F),b)),P(F,2*b));return T(de),de}function J(m,E){return-.012*m-.012*E+15e-6*m*E>0}c.prototype.multiply=function(m){var E=W(m),b=this.value,R=E.value,v=this.sign!==E.sign,O;if(E.isSmall){if(R===0)return o[0];if(R===1)return this;if(R===-1)return this.negate();if(O=Math.abs(R),O<t)return new c(L(b,O),v);R=S(O)}return J(b.length,R.length)?new c($(b,R),v):new c(ae(b,R),v)},c.prototype.times=c.prototype.multiply;function _e(m,E,b){return m<t?new c(L(E,m),b):new c(ae(E,S(m)),b)}u.prototype._multiplyBySmall=function(m){return p(m.value*this.value)?new u(m.value*this.value):_e(Math.abs(m.value),S(Math.abs(this.value)),this.sign!==m.sign)},c.prototype._multiplyBySmall=function(m){return m.value===0?o[0]:m.value===1?this:m.value===-1?this.negate():_e(Math.abs(m.value),this.value,this.sign!==m.sign)},u.prototype.multiply=function(m){return W(m)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,d.prototype.multiply=function(m){return new d(this.value*W(m).value)},d.prototype.times=d.prototype.multiply;function Se(m){var E=m.length,b=N(E+E),R=t,v,O,I,x,F;for(I=0;I<E;I++){x=m[I],O=0-x*x;for(var j=I;j<E;j++)F=m[j],v=2*(x*F)+b[I+j]+O,O=Math.floor(v/R),b[I+j]=v-O*R;b[I+E]=O}return T(b),b}c.prototype.square=function(){return new c(Se(this.value),!1)},u.prototype.square=function(){var m=this.value*this.value;return p(m)?new u(m):new c(Se(S(Math.abs(this.value))),!1)},d.prototype.square=function(m){return new d(this.value*this.value)};function xe(m,E){var b=m.length,R=E.length,v=t,O=N(E.length),I=E[R-1],x=Math.ceil(v/(2*I)),F=L(m,x),j=L(E,x),de,me,Ae,Nt,Tt,$i,Ki;for(F.length<=b&&F.push(0),j.push(0),I=j[R-1],me=b-R;me>=0;me--){for(de=v-1,F[me+R]!==I&&(de=Math.floor((F[me+R]*v+F[me+R-1])/I)),Ae=0,Nt=0,$i=j.length,Tt=0;Tt<$i;Tt++)Ae+=de*j[Tt],Ki=Math.floor(Ae/v),Nt+=F[me+Tt]-(Ae-Ki*v),Ae=Ki,Nt<0?(F[me+Tt]=Nt+v,Nt=-1):(F[me+Tt]=Nt,Nt=0);for(;Nt!==0;){for(de-=1,Ae=0,Tt=0;Tt<$i;Tt++)Ae+=F[me+Tt]-v+j[Tt],Ae<0?(F[me+Tt]=Ae+v,Ae=0):(F[me+Tt]=Ae,Ae=1);Nt+=Ae}O[me]=de}return F=je(F,x)[0],[g(O),g(F)]}function Te(m,E){for(var b=m.length,R=E.length,v=[],O=[],I=t,x,F,j,de,me;b;){if(O.unshift(m[--b]),T(O),$e(O,E)<0){v.push(0);continue}F=O.length,j=O[F-1]*I+O[F-2],de=E[R-1]*I+E[R-2],F>R&&(j=(j+1)*I),x=Math.ceil(j/de);do{if(me=L(E,x),$e(me,O)<=0)break;x--}while(x);v.push(x),O=Y(O,me)}return v.reverse(),[g(v),g(O)]}function je(m,E){var b=m.length,R=N(b),v=t,O,I,x,F;for(x=0,O=b-1;O>=0;--O)F=x*v+m[O],I=w(F/E),x=F-I*E,R[O]=I|0;return[R,x|0]}function Ze(m,E){var b,R=W(E);if(s)return[new d(m.value/R.value),new d(m.value%R.value)];var v=m.value,O=R.value,I;if(O===0)throw new Error("Cannot divide by zero");if(m.isSmall)return R.isSmall?[new u(w(v/O)),new u(v%O)]:[o[0],m];if(R.isSmall){if(O===1)return[m,o[0]];if(O==-1)return[m.negate(),o[0]];var x=Math.abs(O);if(x<t){b=je(v,x),I=g(b[0]);var F=b[1];return m.sign&&(F=-F),typeof I=="number"?(m.sign!==R.sign&&(I=-I),[new u(I),new u(F)]):[new c(I,m.sign!==R.sign),new u(F)]}O=S(x)}var j=$e(v,O);if(j===-1)return[o[0],m];if(j===0)return[o[m.sign===R.sign?1:-1],o[0]];v.length+O.length<=200?b=xe(v,O):b=Te(v,O),I=b[0];var de=m.sign!==R.sign,me=b[1],Ae=m.sign;return typeof I=="number"?(de&&(I=-I),I=new u(I)):I=new c(I,de),typeof me=="number"?(Ae&&(me=-me),me=new u(me)):me=new c(me,Ae),[I,me]}c.prototype.divmod=function(m){var E=Ze(this,m);return{quotient:E[0],remainder:E[1]}},d.prototype.divmod=u.prototype.divmod=c.prototype.divmod,c.prototype.divide=function(m){return Ze(this,m)[0]},d.prototype.over=d.prototype.divide=function(m){return new d(this.value/W(m).value)},u.prototype.over=u.prototype.divide=c.prototype.over=c.prototype.divide,c.prototype.mod=function(m){return Ze(this,m)[1]},d.prototype.mod=d.prototype.remainder=function(m){return new d(this.value%W(m).value)},u.prototype.remainder=u.prototype.mod=c.prototype.remainder=c.prototype.mod,c.prototype.pow=function(m){var E=W(m),b=this.value,R=E.value,v,O,I;if(R===0)return o[1];if(b===0)return o[0];if(b===1)return o[1];if(b===-1)return E.isEven()?o[1]:o[-1];if(E.sign)return o[0];if(!E.isSmall)throw new Error("The exponent "+E.toString()+" is too large.");if(this.isSmall&&p(v=Math.pow(b,R)))return new u(w(v));for(O=this,I=o[1];R&!0&&(I=I.times(O),--R),R!==0;)R/=2,O=O.square();return I},u.prototype.pow=c.prototype.pow,d.prototype.pow=function(m){var E=W(m),b=this.value,R=E.value,v=BigInt(0),O=BigInt(1),I=BigInt(2);if(R===v)return o[1];if(b===v)return o[0];if(b===O)return o[1];if(b===BigInt(-1))return E.isEven()?o[1]:o[-1];if(E.isNegative())return new d(v);for(var x=this,F=o[1];(R&O)===O&&(F=F.times(x),--R),R!==v;)R/=I,x=x.square();return F},c.prototype.modPow=function(m,E){if(m=W(m),E=W(E),E.isZero())throw new Error("Cannot take modPow with modulus 0");var b=o[1],R=this.mod(E);for(m.isNegative()&&(m=m.multiply(o[-1]),R=R.modInv(E));m.isPositive();){if(R.isZero())return o[0];m.isOdd()&&(b=b.multiply(R).mod(E)),m=m.divide(2),R=R.square().mod(E)}return b},d.prototype.modPow=u.prototype.modPow=c.prototype.modPow;function $e(m,E){if(m.length!==E.length)return m.length>E.length?1:-1;for(var b=m.length-1;b>=0;b--)if(m[b]!==E[b])return m[b]>E[b]?1:-1;return 0}c.prototype.compareAbs=function(m){var E=W(m),b=this.value,R=E.value;return E.isSmall?1:$e(b,R)},u.prototype.compareAbs=function(m){var E=W(m),b=Math.abs(this.value),R=E.value;return E.isSmall?(R=Math.abs(R),b===R?0:b>R?1:-1):-1},d.prototype.compareAbs=function(m){var E=this.value,b=W(m).value;return E=E>=0?E:-E,b=b>=0?b:-b,E===b?0:E>b?1:-1},c.prototype.compare=function(m){if(m===1/0)return-1;if(m===-1/0)return 1;var E=W(m),b=this.value,R=E.value;return this.sign!==E.sign?E.sign?1:-1:E.isSmall?this.sign?-1:1:$e(b,R)*(this.sign?-1:1)},c.prototype.compareTo=c.prototype.compare,u.prototype.compare=function(m){if(m===1/0)return-1;if(m===-1/0)return 1;var E=W(m),b=this.value,R=E.value;return E.isSmall?b==R?0:b>R?1:-1:b<0!==E.sign?b<0?-1:1:b<0?1:-1},u.prototype.compareTo=u.prototype.compare,d.prototype.compare=function(m){if(m===1/0)return-1;if(m===-1/0)return 1;var E=this.value,b=W(m).value;return E===b?0:E>b?1:-1},d.prototype.compareTo=d.prototype.compare,c.prototype.equals=function(m){return this.compare(m)===0},d.prototype.eq=d.prototype.equals=u.prototype.eq=u.prototype.equals=c.prototype.eq=c.prototype.equals,c.prototype.notEquals=function(m){return this.compare(m)!==0},d.prototype.neq=d.prototype.notEquals=u.prototype.neq=u.prototype.notEquals=c.prototype.neq=c.prototype.notEquals,c.prototype.greater=function(m){return this.compare(m)>0},d.prototype.gt=d.prototype.greater=u.prototype.gt=u.prototype.greater=c.prototype.gt=c.prototype.greater,c.prototype.lesser=function(m){return this.compare(m)<0},d.prototype.lt=d.prototype.lesser=u.prototype.lt=u.prototype.lesser=c.prototype.lt=c.prototype.lesser,c.prototype.greaterOrEquals=function(m){return this.compare(m)>=0},d.prototype.geq=d.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals=c.prototype.geq=c.prototype.greaterOrEquals,c.prototype.lesserOrEquals=function(m){return this.compare(m)<=0},d.prototype.leq=d.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals=c.prototype.leq=c.prototype.lesserOrEquals,c.prototype.isEven=function(){return(this.value[0]&1)===0},u.prototype.isEven=function(){return(this.value&1)===0},d.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},c.prototype.isOdd=function(){return(this.value[0]&1)===1},u.prototype.isOdd=function(){return(this.value&1)===1},d.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},c.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},d.prototype.isPositive=u.prototype.isPositive,c.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},d.prototype.isNegative=u.prototype.isNegative,c.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return Math.abs(this.value)===1},d.prototype.isUnit=function(){return this.abs().value===BigInt(1)},c.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return this.value===0},d.prototype.isZero=function(){return this.value===BigInt(0)},c.prototype.isDivisibleBy=function(m){var E=W(m);return E.isZero()?!1:E.isUnit()?!0:E.compareAbs(2)===0?this.isEven():this.mod(E).isZero()},d.prototype.isDivisibleBy=u.prototype.isDivisibleBy=c.prototype.isDivisibleBy;function Yt(m){var E=m.abs();if(E.isUnit())return!1;if(E.equals(2)||E.equals(3)||E.equals(5))return!0;if(E.isEven()||E.isDivisibleBy(3)||E.isDivisibleBy(5))return!1;if(E.lesser(49))return!0}function et(m,E){for(var b=m.prev(),R=b,v=0,O,I,x,F;R.isEven();)R=R.divide(2),v++;e:for(x=0;x<E.length;x++)if(!m.lesser(E[x])&&(F=st(E[x]).modPow(R,m),!(F.isUnit()||F.equals(b)))){for(O=v-1;O!=0;O--){if(F=F.square().mod(m),F.isUnit())return!1;if(F.equals(b))continue e}return!1}return!0}c.prototype.isPrime=function(m){var E=Yt(this);if(E!==e)return E;var b=this.abs(),R=b.bitLength();if(R<=64)return et(b,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var v=Math.log(2)*R.toJSNumber(),O=Math.ceil(m===!0?2*Math.pow(v,2):v),I=[],x=0;x<O;x++)I.push(st(x+2));return et(b,I)},d.prototype.isPrime=u.prototype.isPrime=c.prototype.isPrime,c.prototype.isProbablePrime=function(m,E){var b=Yt(this);if(b!==e)return b;for(var R=this.abs(),v=m===e?5:m,O=[],I=0;I<v;I++)O.push(st.randBetween(2,R.minus(2),E));return et(R,O)},d.prototype.isProbablePrime=u.prototype.isProbablePrime=c.prototype.isProbablePrime,c.prototype.modInv=function(m){for(var E=st.zero,b=st.one,R=W(m),v=this.abs(),O,I,x;!v.isZero();)O=R.divide(v),I=E,x=R,E=b,R=v,b=I.subtract(O.multiply(b)),v=x.subtract(O.multiply(v));if(!R.isUnit())throw new Error(this.toString()+" and "+m.toString()+" are not co-prime");return E.compare(0)===-1&&(E=E.add(m)),this.isNegative()?E.negate():E},d.prototype.modInv=u.prototype.modInv=c.prototype.modInv,c.prototype.next=function(){var m=this.value;return this.sign?Q(m,1,this.sign):new c(B(m,1),this.sign)},u.prototype.next=function(){var m=this.value;return m+1<r?new u(m+1):new c(i,!1)},d.prototype.next=function(){return new d(this.value+BigInt(1))},c.prototype.prev=function(){var m=this.value;return this.sign?new c(B(m,1),!0):Q(m,1,this.sign)},u.prototype.prev=function(){var m=this.value;return m-1>-r?new u(m-1):new c(i,!0)},d.prototype.prev=function(){return new d(this.value-BigInt(1))};for(var tt=[1];2*tt[tt.length-1]<=t;)tt.push(2*tt[tt.length-1]);var At=tt.length,H=tt[At-1];function ee(m){return Math.abs(m)<=t}c.prototype.shiftLeft=function(m){var E=W(m).toJSNumber();if(!ee(E))throw new Error(String(E)+" is too large for shifting.");if(E<0)return this.shiftRight(-E);var b=this;if(b.isZero())return b;for(;E>=At;)b=b.multiply(H),E-=At-1;return b.multiply(tt[E])},d.prototype.shiftLeft=u.prototype.shiftLeft=c.prototype.shiftLeft,c.prototype.shiftRight=function(m){var E,b=W(m).toJSNumber();if(!ee(b))throw new Error(String(b)+" is too large for shifting.");if(b<0)return this.shiftLeft(-b);for(var R=this;b>=At;){if(R.isZero()||R.isNegative()&&R.isUnit())return R;E=Ze(R,H),R=E[1].isNegative()?E[0].prev():E[0],b-=At-1}return E=Ze(R,tt[b]),E[1].isNegative()?E[0].prev():E[0]},d.prototype.shiftRight=u.prototype.shiftRight=c.prototype.shiftRight;function le(m,E,b){E=W(E);for(var R=m.isNegative(),v=E.isNegative(),O=R?m.not():m,I=v?E.not():E,x=0,F=0,j=null,de=null,me=[];!O.isZero()||!I.isZero();)j=Ze(O,H),x=j[1].toJSNumber(),R&&(x=H-1-x),de=Ze(I,H),F=de[1].toJSNumber(),v&&(F=H-1-F),O=j[0],I=de[0],me.push(b(x,F));for(var Ae=b(R?1:0,v?1:0)!==0?st(-1):st(0),Nt=me.length-1;Nt>=0;Nt-=1)Ae=Ae.multiply(H).add(st(me[Nt]));return Ae}c.prototype.not=function(){return this.negate().prev()},d.prototype.not=u.prototype.not=c.prototype.not,c.prototype.and=function(m){return le(this,m,function(E,b){return E&b})},d.prototype.and=u.prototype.and=c.prototype.and,c.prototype.or=function(m){return le(this,m,function(E,b){return E|b})},d.prototype.or=u.prototype.or=c.prototype.or,c.prototype.xor=function(m){return le(this,m,function(E,b){return E^b})},d.prototype.xor=u.prototype.xor=c.prototype.xor;var ge=1<<30,y=(t&-t)*(t&-t)|ge;function Ke(m){var E=m.value,b=typeof E=="number"?E|ge:typeof E=="bigint"?E|BigInt(ge):E[0]+E[1]*t|y;return b&-b}function ce(m,E){if(E.compareTo(m)<=0){var b=ce(m,E.square(E)),R=b.p,v=b.e,O=R.multiply(E);return O.compareTo(m)<=0?{p:O,e:v*2+1}:{p:R,e:v*2}}return{p:st(1),e:0}}c.prototype.bitLength=function(){var m=this;return m.compareTo(st(0))<0&&(m=m.negate().subtract(st(1))),m.compareTo(st(0))===0?st(0):st(ce(m,st(2)).e).add(st(1))},d.prototype.bitLength=u.prototype.bitLength=c.prototype.bitLength;function Ee(m,E){return m=W(m),E=W(E),m.greater(E)?m:E}function Me(m,E){return m=W(m),E=W(E),m.lesser(E)?m:E}function te(m,E){if(m=W(m).abs(),E=W(E).abs(),m.equals(E))return m;if(m.isZero())return E;if(E.isZero())return m;for(var b=o[1],R,v;m.isEven()&&E.isEven();)R=Me(Ke(m),Ke(E)),m=m.divide(R),E=E.divide(R),b=b.multiply(R);for(;m.isEven();)m=m.divide(Ke(m));do{for(;E.isEven();)E=E.divide(Ke(E));m.greater(E)&&(v=E,E=m,m=v),E=E.subtract(m)}while(!E.isZero());return b.isUnit()?m:m.multiply(b)}function Zt(m,E){return m=W(m).abs(),E=W(E).abs(),m.divide(te(m,E)).multiply(E)}function De(m,E,b){m=W(m),E=W(E);var R=b||Math.random,v=Me(m,E),O=Ee(m,E),I=O.subtract(v).add(1);if(I.isSmall)return v.add(Math.floor(R()*I));for(var x=X(I,t).value,F=[],j=!0,de=0;de<x.length;de++){var me=j?x[de]+(de+1<x.length?x[de+1]/t:0):t,Ae=w(R()*me);F.push(Ae),Ae<x[de]&&(j=!1)}return v.add(o.fromArray(F,t,!1))}var K=function(m,E,b,R){b=b||a,m=String(m),R||(m=m.toLowerCase(),b=b.toLowerCase());var v=m.length,O,I=Math.abs(E),x={};for(O=0;O<b.length;O++)x[b[O]]=O;for(O=0;O<v;O++){var F=m[O];if(F!=="-"&&F in x&&x[F]>=I){if(F==="1"&&I===1)continue;throw new Error(F+" is not a valid digit in base "+E+".")}}E=W(E);var j=[],de=m[0]==="-";for(O=de?1:0;O<m.length;O++){var F=m[O];if(F in x)j.push(W(x[F]));else if(F==="<"){var me=O;do O++;while(m[O]!==">"&&O<m.length);j.push(W(m.slice(me+1,O)))}else throw new Error(F+" is not a valid character")}return fe(j,E,de)};function fe(m,E,b){var R=o[0],v=o[1],O;for(O=m.length-1;O>=0;O--)R=R.add(m[O].times(v)),v=v.times(E);return b?R.negate():R}function Fe(m,E){return E=E||a,m<E.length?E[m]:"<"+m+">"}function X(m,E){if(E=st(E),E.isZero()){if(m.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(E.equals(-1)){if(m.isZero())return{value:[0],isNegative:!1};if(m.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-m.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var b=Array.apply(null,Array(m.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return b.unshift([1]),{value:[].concat.apply([],b),isNegative:!1}}var R=!1;if(m.isNegative()&&E.isPositive()&&(R=!0,m=m.abs()),E.isUnit())return m.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(m.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:R};for(var v=[],O=m,I;O.isNegative()||O.compareAbs(E)>=0;){I=O.divmod(E),O=I.quotient;var x=I.remainder;x.isNegative()&&(x=E.minus(x).abs(),O=O.next()),v.push(x.toJSNumber())}return v.push(O.toJSNumber()),{value:v.reverse(),isNegative:R}}function Ut(m,E,b){var R=X(m,E);return(R.isNegative?"-":"")+R.value.map(function(v){return Fe(v,b)}).join("")}c.prototype.toArray=function(m){return X(this,m)},u.prototype.toArray=function(m){return X(this,m)},d.prototype.toArray=function(m){return X(this,m)},c.prototype.toString=function(m,E){if(m===e&&(m=10),m!==10)return Ut(this,m,E);for(var b=this.value,R=b.length,v=String(b[--R]),O="0000000",I;--R>=0;)I=String(b[R]),v+=O.slice(I.length)+I;var x=this.sign?"-":"";return x+v},u.prototype.toString=function(m,E){return m===e&&(m=10),m!=10?Ut(this,m,E):String(this.value)},d.prototype.toString=u.prototype.toString,d.prototype.toJSON=c.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},c.prototype.valueOf=function(){return parseInt(this.toString(),10)},c.prototype.toJSNumber=c.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf,d.prototype.valueOf=d.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function Yn(m){if(p(+m)){var E=+m;if(E===w(E))return s?new d(BigInt(E)):new u(E);throw new Error("Invalid integer: "+m)}var b=m[0]==="-";b&&(m=m.slice(1));var R=m.split(/e/i);if(R.length>2)throw new Error("Invalid integer: "+R.join("e"));if(R.length===2){var v=R[1];if(v[0]==="+"&&(v=v.slice(1)),v=+v,v!==w(v)||!p(v))throw new Error("Invalid integer: "+v+" is not a valid exponent.");var O=R[0],I=O.indexOf(".");if(I>=0&&(v-=O.length-I-1,O=O.slice(0,I)+O.slice(I+1)),v<0)throw new Error("Cannot include negative exponent part for integers");O+=new Array(v+1).join("0"),m=O}var x=/^([0-9][0-9]*)$/.test(m);if(!x)throw new Error("Invalid integer: "+m);if(s)return new d(BigInt(b?"-"+m:m));for(var F=[],j=m.length,de=n,me=j-de;j>0;)F.push(+m.slice(me,j)),me-=de,me<0&&(me=0),j-=de;return T(F),new c(F,b)}function Dn(m){if(s)return new d(BigInt(m));if(p(m)){if(m!==w(m))throw new Error(m+" is not an integer.");return new u(m)}return Yn(m.toString())}function W(m){return typeof m=="number"?Dn(m):typeof m=="string"?Yn(m):typeof m=="bigint"?new d(m):m}for(var Ot=0;Ot<1e3;Ot++)o[Ot]=W(Ot),Ot>0&&(o[-Ot]=W(-Ot));return o.one=o[1],o.zero=o[0],o.minusOne=o[-1],o.max=Ee,o.min=Me,o.gcd=te,o.lcm=Zt,o.isInstance=function(m){return m instanceof c||m instanceof u||m instanceof d},o.randBetween=De,o.fromArray=function(m,E,b){return fe(m.map(W),W(E||10),b)},o}();typeof Bc<"u"&&Bc.hasOwnProperty("exports")&&(Bc.exports=st);typeof define=="function"&&define.amd&&define(function(){return st})});var bI=f(ot=>{"use strict";l();var OH=require("fs"),NH=hI(),mr=!1;ot.maxObjectSize=100*1e3*1e3;ot.maxObjectCount=32768;var yH=9783072e5,IH=ot.UID=function(e){this.UID=e},yde=ot.parseFile=function(e,t){return new Promise(function(n,r){function i(a){let s=null,o;try{o=vH(a),n(o)}catch(c){s=c,r(s)}finally{t&&t(s,o)}}if(Buffer.isBuffer(e))return i(e);OH.readFile(e,function(a,s){if(a)return r(a),t(a);i(s)})})},vH=ot.parseBuffer=function(e){if(e.slice(0,6).toString("utf8")!=="bplist")throw new Error("Invalid binary plist. Expected 'bplist' at offset 0.");let n=e.slice(e.length-32,e.length),r=n.readUInt8(6);mr&&console.log("offsetSize: "+r);let i=n.readUInt8(7);mr&&console.log("objectRefSize: "+i);let a=lp(n,8);mr&&console.log("numObjects: "+a);let s=lp(n,16);mr&&console.log("topObject: "+s);let o=lp(n,24);if(mr&&console.log("offsetTableOffset: "+o),a>ot.maxObjectCount)throw new Error("maxObjectCount exceeded");let c=[];for(let d=0;d<a;d++){let p=e.slice(o+d*r,o+(d+1)*r);c[d]=Bt(p,0),mr&&console.log("Offset for Object #"+d+" is "+c[d]+" ["+c[d].toString(16)+"]")}function u(d){let p=c[d],S=e[p],g=(S&240)>>4,T=S&15;switch(g){case 0:return N();case 1:return k();case 8:return M();case 2:return B();case 3:return Y();case 4:return re();case 5:return Q();case 6:return Q(!0);case 10:return ae();case 13:return L();default:throw new Error("Unhandled type 0x"+g.toString(16))}function N(){switch(T){case 0:return null;case 8:return!1;case 9:return!0;case 15:return null;default:throw new Error("Unhandled simple type 0x"+g.toString(16))}}function w(P){let $="",J;for(J=0;J<P.length&&P[J]==0;J++);for(;J<P.length;J++){let _e="00"+P[J].toString(16);$+=_e.substr(_e.length-2)}return $}function k(){let P=Math.pow(2,T);if(T==4){let $=e.slice(p+1,p+1+P),J=w($);return NH(J,16)}if(T==3)return e.readInt32BE(p+1);if(P<ot.maxObjectSize)return Bt(e.slice(p+1,p+1+P));throw new Error("To little heap space available! Wanted to read "+P+" bytes, but only "+ot.maxObjectSize+" are available.")}function M(){let P=T+1;if(P<ot.maxObjectSize)return new IH(Bt(e.slice(p+1,p+1+P)));throw new Error("To little heap space available! Wanted to read "+P+" bytes, but only "+ot.maxObjectSize+" are available.")}function B(){let P=Math.pow(2,T);if(P<ot.maxObjectSize){let $=e.slice(p+1,p+1+P);if(P===4)return $.readFloatBE(0);if(P===8)return $.readDoubleBE(0)}else throw new Error("To little heap space available! Wanted to read "+P+" bytes, but only "+ot.maxObjectSize+" are available.")}function Y(){T!=3&&console.error("Unknown date type :"+T+". Parsing anyway...");let P=e.slice(p+1,p+9);return new Date(yH+1e3*P.readDoubleBE(0))}function re(){let P=1,$=T;if(T==15){let J=e[p+1],_e=(J&240)/16;_e!=1&&console.error("0x4: UNEXPECTED LENGTH-INT TYPE! "+_e);let Se=J&15,xe=Math.pow(2,Se);P=2+xe,xe<3,$=Bt(e.slice(p+2,p+2+xe))}if($<ot.maxObjectSize)return e.slice(p+P,p+P+$);throw new Error("To little heap space available! Wanted to read "+$+" bytes, but only "+ot.maxObjectSize+" are available.")}function Q(P){P=P||0;let $="utf8",J=T,_e=1;if(T==15){let Se=e[p+1],xe=(Se&240)/16;xe!=1&&console.err("UNEXPECTED LENGTH-INT TYPE! "+xe);let Te=Se&15,je=Math.pow(2,Te);_e=2+je,je<3,J=Bt(e.slice(p+2,p+2+je))}if(J*=P+1,J<ot.maxObjectSize){let Se=Buffer.from(e.slice(p+_e,p+_e+J));return P&&(Se=xH(Se),$="ucs2"),Se.toString($)}throw new Error("To little heap space available! Wanted to read "+J+" bytes, but only "+ot.maxObjectSize+" are available.")}function ae(){let P=T,$=1;if(T==15){let _e=e[p+1],Se=(_e&240)/16;Se!=1&&console.error("0xa: UNEXPECTED LENGTH-INT TYPE! "+Se);let xe=_e&15,Te=Math.pow(2,xe);$=2+Te,Te<3,P=Bt(e.slice(p+2,p+2+Te))}if(P*i>ot.maxObjectSize)throw new Error("To little heap space available!");let J=[];for(let _e=0;_e<P;_e++){let Se=Bt(e.slice(p+$+_e*i,p+$+(_e+1)*i));J[_e]=u(Se)}return J}function L(){let P=T,$=1;if(T==15){let _e=e[p+1],Se=(_e&240)/16;Se!=1&&console.error("0xD: UNEXPECTED LENGTH-INT TYPE! "+Se);let xe=_e&15,Te=Math.pow(2,xe);$=2+Te,Te<3,P=Bt(e.slice(p+2,p+2+Te))}if(P*2*i>ot.maxObjectSize)throw new Error("To little heap space available!");mr&&console.log("Parsing dictionary #"+d);let J={};for(let _e=0;_e<P;_e++){let Se=Bt(e.slice(p+$+_e*i,p+$+(_e+1)*i)),xe=Bt(e.slice(p+$+P*i+_e*i,p+$+P*i+(_e+1)*i)),Te=u(Se),je=u(xe);mr&&console.log(" DICT #"+d+": Mapped "+Te+" to "+je),J[Te]=je}return J}}return[u(s)]};function Bt(e,t){t=t||0;let n=0;for(let r=t;r<e.length;r++)n<<=8,n|=e[r]&255;return n}function lp(e,t){return e.slice(t,t+8).readUInt32BE(4,8)}function xH(e){let t=e.length;for(let n=0;n<t;n+=2){let r=e[n];e[n]=e[n+1],e[n+1]=r}return e}});var RI=f((xde,CI)=>{"use strict";l();var MH=require("os"),DI=MH.homedir();CI.exports=e=>{if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return DI?e.replace(/^~(?=$|\/|\\)/,DI):e}});var wI=f((Pde,MI)=>{"use strict";l();MI.exports=xI;xI.sync=FH;var II=require("fs");function PH(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function vI(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:PH(t,n)}function xI(e,t,n){II.stat(e,function(r,i){n(r,r?!1:vI(i,e,t))})}function FH(e,t){return vI(II.statSync(e),e,t)}});var BI=f((kde,kI)=>{"use strict";l();kI.exports=PI;PI.sync=kH;var LI=require("fs");function PI(e,t,n){LI.stat(e,function(r,i){n(r,r?!1:FI(i,t))})}function kH(e,t){return FI(LI.statSync(e),t)}function FI(e,t){return e.isFile()&&BH(e,t)}function BH(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),o=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),d=o|c,p=n&u||n&c&&i===s||n&o&&r===a||n&d&&a===0;return p}});var GI=f((Gde,UI)=>{"use strict";l();var Ude=require("fs"),Uc;process.platform==="win32"||global.TESTING_WINDOWS?Uc=wI():Uc=BI();UI.exports=up;up.sync=UH;function up(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){up(e,t||{},function(a,s){a?i(a):r(s)})})}Uc(e,t||{},function(r,i){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function UH(e,t){try{return Uc.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var WI=f((Yde,KI)=>{"use strict";l();var Mi=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",HI=require("path"),GH=Mi?";":":",YI=GI(),qI=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),VI=(e,t)=>{let n=t.colon||GH,r=e.match(/\//)||Mi&&e.match(/\\/)?[""]:[...Mi?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],i=Mi?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=Mi?i.split(n):[""];return Mi&&e.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:r,pathExt:a,pathExtExe:i}},$I=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:i,pathExtExe:a}=VI(e,t),s=[],o=u=>new Promise((d,p)=>{if(u===r.length)return t.all&&s.length?d(s):p(qI(e));let S=r[u],g=/^".*"$/.test(S)?S.slice(1,-1):S,T=HI.join(g,e),N=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+T:T;d(c(N,u,0))}),c=(u,d,p)=>new Promise((S,g)=>{if(p===i.length)return S(o(d+1));let T=i[p];YI(u+T,{pathExt:a},(N,w)=>{if(!N&&w)if(t.all)s.push(u+T);else return S(u+T);return S(c(u,d,p+1))})});return n?o(0).then(u=>n(null,u),n):o(0)},HH=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:i}=VI(e,t),a=[];for(let s=0;s<n.length;s++){let o=n[s],c=/^".*"$/.test(o)?o.slice(1,-1):o,u=HI.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let p=0;p<r.length;p++){let S=d+r[p];try{if(YI.sync(S,{pathExt:i}))if(t.all)a.push(S);else return S}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw qI(e)};KI.exports=$I;$I.sync=HH});var _p=f((Vde,dp)=>{"use strict";l();var zI=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};dp.exports=zI;dp.exports.default=zI});var jI=f((Kde,JI)=>{"use strict";l();var QI=require("path"),YH=WI(),qH=_p();function XI(e,t){let n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let s;try{s=YH.sync(e.command,{path:n[qH({env:n})],pathExt:t?QI.delimiter:void 0})}catch{}finally{a&&process.chdir(r)}return s&&(s=QI.resolve(i?e.options.cwd:"",s)),s}function VH(e){return XI(e)||XI(e,!0)}JI.exports=VH});var ZI=f((zde,pp)=>{"use strict";l();var mp=/([()\][%!^"`<>&|;, *?])/g;function $H(e){return e=e.replace(mp,"^$1"),e}function KH(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(mp,"^$1"),t&&(e=e.replace(mp,"^$1")),e}pp.exports.command=$H;pp.exports.argument=KH});var tv=f((Xde,ev)=>{"use strict";l();ev.exports=/^#!(.*)/});var rv=f((jde,nv)=>{"use strict";l();var WH=tv();nv.exports=(e="")=>{let t=e.match(WH);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i}});var av=f((e_e,iv)=>{"use strict";l();var Ep=require("fs"),zH=rv();function QH(e){let n=Buffer.alloc(150),r;try{r=Ep.openSync(e,"r"),Ep.readSync(r,n,0,150,0),Ep.closeSync(r)}catch{}return zH(n.toString())}iv.exports=QH});var cv=f((n_e,lv)=>{"use strict";l();var XH=require("path"),sv=jI(),ov=ZI(),JH=av(),jH=process.platform==="win32",ZH=/\.(?:com|exe)$/i,eY=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function tY(e){e.file=sv(e);let t=e.file&&JH(e.file);return t?(e.args.unshift(e.file),e.command=t,sv(e)):e.file}function nY(e){if(!jH)return e;let t=tY(e),n=!ZH.test(t);if(e.options.forceShell||n){let r=eY.test(t);e.command=XH.normalize(e.command),e.command=ov.command(e.command),e.args=e.args.map(a=>ov.argument(a,r));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function rY(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:nY(r)}lv.exports=rY});var _v=f((i_e,dv)=>{"use strict";l();var fp=process.platform==="win32";function gp(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function iY(e,t){if(!fp)return;let n=e.emit;e.emit=function(r,i){if(r==="exit"){let a=uv(i,t,"spawn");if(a)return n.call(e,"error",a)}return n.apply(e,arguments)}}function uv(e,t){return fp&&e===1&&!t.file?gp(t.original,"spawn"):null}function aY(e,t){return fp&&e===1&&!t.file?gp(t.original,"spawnSync"):null}dv.exports={hookChildProcess:iY,verifyENOENT:uv,verifyENOENTSync:aY,notFoundError:gp}});var hp=f((s_e,wi)=>{"use strict";l();var mv=require("child_process"),Sp=cv(),Tp=_v();function pv(e,t,n){let r=Sp(e,t,n),i=mv.spawn(r.command,r.args,r.options);return Tp.hookChildProcess(i,r),i}function sY(e,t,n){let r=Sp(e,t,n),i=mv.spawnSync(r.command,r.args,r.options);return i.error=i.error||Tp.verifyENOENTSync(i.status,r),i}wi.exports=pv;wi.exports.spawn=pv;wi.exports.sync=sY;wi.exports._parse=Sp;wi.exports._enoent=Tp});var fv=f((l_e,Ev)=>{"use strict";l();Ev.exports=e=>{let t=typeof e=="string"?`
59
+ `)};jt.renderTable=XG;var JG=e=>{let t=new qG.default;return t.addRows(e),(0,jt.renderTable)(t)};jt.renderSimpleTable=JG;var jG=e=>{console.log((0,jt.renderSimpleTable)(e))};jt.printSimpleTable=jG});var Jm=f(Zm=>{"use strict";l();Object.defineProperty(Zm,"__esModule",{value:!0});var ZG=Gm(),Lc=Wa(),Pc=Xa(),eH=Hm(),tH=Xm(),nH=()=>0,rH=()=>!0,jm=class{initSimple(t){this.columns=t.map(n=>({name:n,title:n,alignment:Lc.DEFAULT_ROW_ALIGNMENT}))}initDetailed(t){var n;this.title=t?.title||this.title,this.tableStyle=t?.style||this.tableStyle,this.sortFunction=t?.sort||this.sortFunction,this.filterFunction=t?.filter||this.filterFunction,this.enabledColumns=t?.enabledColumns||this.enabledColumns,this.disabledColumns=t?.disabledColumns||this.disabledColumns,this.computedColumns=t?.computedColumns||this.computedColumns,this.columns=((n=t?.columns)===null||n===void 0?void 0:n.map(eH.rawColumnToInternalColumn))||this.columns,this.rowSeparator=t?.rowSeparator||this.rowSeparator,this.charLength=t?.charLength||this.charLength,t?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),t.colorMap)),t.rows!==void 0&&this.addRows(t.rows)}constructor(t){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=Lc.DEFAULT_TABLE_STYLE,this.filterFunction=rH,this.sortFunction=nH,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=Lc.DEFAULT_ROW_SEPARATOR,this.colorMap=ZG.DEFAULT_COLOR_MAP,this.charLength={},t instanceof Array?this.initSimple(t):typeof t=="object"&&this.initDetailed(t)}createColumnFromRow(t){let n=this.columns.map(r=>r.name);Object.keys(t).forEach(r=>{n.includes(r)||this.columns.push((0,Pc.createColumFromOnlyName)(r))})}addColumn(t){typeof t=="string"?this.columns.push((0,Pc.createColumFromOnlyName)(t)):this.columns.push((0,Pc.createColumFromComputedColumn)(t))}addColumns(t){t.forEach(n=>{this.addColumn(n)})}addRow(t,n){this.createColumnFromRow(t),this.rows.push((0,Pc.createRow)(n?.color||Lc.DEFAULT_ROW_FONT_COLOR,t,n?.separator!==void 0?n?.separator:this.rowSeparator))}addRows(t,n){t.forEach(r=>{this.addRow(r,n)})}renderTable(){return(0,tH.renderTable)(this)}};Zm.default=jm});var Uy=f(Ja=>{"use strict";l();var iH=Ja&&Ja.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ja,"__esModule",{value:!0});var aH=iH(Jm()),By=Xa(),ep=class{constructor(t){this.table=new aH.default(t)}addColumn(t){return this.table.addColumn(t),this}addColumns(t){return this.table.addColumns(t),this}addRow(t,n){return this.table.addRow(t,(0,By.convertRawRowOptionsToStandard)(n)),this}addRows(t,n){return this.table.addRows(t,(0,By.convertRawRowOptionsToStandard)(n)),this}printTable(){let t=this.table.renderTable();console.log(t)}render(){return this.table.renderTable()}};Ja.default=ep});var tp=f(hn=>{"use strict";l();var sH=hn&&hn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hn,"__esModule",{value:!0});hn.renderTable=hn.printTable=hn.Table=void 0;var oH=sH(Uy());hn.Table=oH.default;var Gy=Xm();Object.defineProperty(hn,"printTable",{enumerable:!0,get:function(){return Gy.printSimpleTable}});Object.defineProperty(hn,"renderTable",{enumerable:!0,get:function(){return Gy.renderSimpleTable}})});var mI=f(ja=>{"use strict";l();Object.defineProperty(ja,"__esModule",{value:!0});ja.listen=void 0;var gH=require("http"),SH=require("https"),TH=require("path"),hH=require("events"),bH=e=>{if(typeof e.protocol=="string")return e.protocol;if(e instanceof gH.Server)return"http";if(e instanceof SH.Server)return"https"};async function _I(e,...t){e.listen(...t,()=>{}),await(0,hH.once)(e,"listening");let n=e.address();if(!n)throw new Error("Server not listening");let r,i=bH(e);if(typeof n=="string")r=encodeURIComponent((0,TH.resolve)(n)),i?i+="+unix":i="unix";else{let{address:a,port:s,family:o}=n;r=o==="IPv6"?`[${a}]`:a,r+=`:${s}`,i||(i="tcp")}return new URL(`${i}://${r}`)}ja.listen=_I;ja.default=_I});var fI=f((bde,EI)=>{"use strict";l();var pI=require("fs"),sp;function DH(){try{return pI.statSync("/.dockerenv"),!0}catch{return!1}}function CH(){try{return pI.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}EI.exports=()=>(sp===void 0&&(sp=DH()||CH()),sp)});var TI=f((Cde,op)=>{"use strict";l();var RH=require("os"),AH=require("fs"),gI=fI(),SI=()=>{if(process.platform!=="linux")return!1;if(RH.release().toLowerCase().includes("microsoft"))return!gI();try{return AH.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!gI():!1}catch{return!1}};process.env.__IS_WSL_TEST__?op.exports=SI:op.exports=SI()});var hI=f((Nde,Bc)=>{"use strict";l();var st=function(e){"use strict";var t=1e7,n=7,r=9007199254740992,i=S(r),a="0123456789abcdefghijklmnopqrstuvwxyz",s=typeof BigInt=="function";function o(m,E,b,R){return typeof m>"u"?o[0]:typeof E<"u"?+E==10&&!b?W(m):K(m,E,b,R):W(m)}function c(m,E){this.value=m,this.sign=E,this.isSmall=!1}c.prototype=Object.create(o.prototype);function u(m){this.value=m,this.sign=m<0,this.isSmall=!0}u.prototype=Object.create(o.prototype);function d(m){this.value=m}d.prototype=Object.create(o.prototype);function p(m){return-r<m&&m<r}function S(m){return m<1e7?[m]:m<1e14?[m%1e7,Math.floor(m/1e7)]:[m%1e7,Math.floor(m/1e7)%1e7,Math.floor(m/1e14)]}function g(m){T(m);var E=m.length;if(E<4&&$e(m,i)<0)switch(E){case 0:return 0;case 1:return m[0];case 2:return m[0]+m[1]*t;default:return m[0]+(m[1]+m[2]*t)*t}return m}function T(m){for(var E=m.length;m[--E]===0;);m.length=E+1}function N(m){for(var E=new Array(m),b=-1;++b<m;)E[b]=0;return E}function w(m){return m>0?Math.floor(m):Math.ceil(m)}function k(m,E){var b=m.length,R=E.length,v=new Array(b),O=0,I=t,x,F;for(F=0;F<R;F++)x=m[F]+E[F]+O,O=x>=I?1:0,v[F]=x-O*I;for(;F<b;)x=m[F]+O,O=x===I?1:0,v[F++]=x-O*I;return O>0&&v.push(O),v}function M(m,E){return m.length>=E.length?k(m,E):k(E,m)}function B(m,E){var b=m.length,R=new Array(b),v=t,O,I;for(I=0;I<b;I++)O=m[I]-v+E,E=Math.floor(O/v),R[I]=O-E*v,E+=1;for(;E>0;)R[I++]=E%v,E=Math.floor(E/v);return R}c.prototype.add=function(m){var E=W(m);if(this.sign!==E.sign)return this.subtract(E.negate());var b=this.value,R=E.value;return E.isSmall?new c(B(b,Math.abs(R)),this.sign):new c(M(b,R),this.sign)},c.prototype.plus=c.prototype.add,u.prototype.add=function(m){var E=W(m),b=this.value;if(b<0!==E.sign)return this.subtract(E.negate());var R=E.value;if(E.isSmall){if(p(b+R))return new u(b+R);R=S(Math.abs(R))}return new c(B(R,Math.abs(b)),b<0)},u.prototype.plus=u.prototype.add,d.prototype.add=function(m){return new d(this.value+W(m).value)},d.prototype.plus=d.prototype.add;function Y(m,E){var b=m.length,R=E.length,v=new Array(b),O=0,I=t,x,F;for(x=0;x<R;x++)F=m[x]-O-E[x],F<0?(F+=I,O=1):O=0,v[x]=F;for(x=R;x<b;x++){if(F=m[x]-O,F<0)F+=I;else{v[x++]=F;break}v[x]=F}for(;x<b;x++)v[x]=m[x];return T(v),v}function re(m,E,b){var R;return $e(m,E)>=0?R=Y(m,E):(R=Y(E,m),b=!b),R=g(R),typeof R=="number"?(b&&(R=-R),new u(R)):new c(R,b)}function Q(m,E,b){var R=m.length,v=new Array(R),O=-E,I=t,x,F;for(x=0;x<R;x++)F=m[x]+O,O=Math.floor(F/I),F%=I,v[x]=F<0?F+I:F;return v=g(v),typeof v=="number"?(b&&(v=-v),new u(v)):new c(v,b)}c.prototype.subtract=function(m){var E=W(m);if(this.sign!==E.sign)return this.add(E.negate());var b=this.value,R=E.value;return E.isSmall?Q(b,Math.abs(R),this.sign):re(b,R,this.sign)},c.prototype.minus=c.prototype.subtract,u.prototype.subtract=function(m){var E=W(m),b=this.value;if(b<0!==E.sign)return this.add(E.negate());var R=E.value;return E.isSmall?new u(b-R):Q(R,Math.abs(b),b>=0)},u.prototype.minus=u.prototype.subtract,d.prototype.subtract=function(m){return new d(this.value-W(m).value)},d.prototype.minus=d.prototype.subtract,c.prototype.negate=function(){return new c(this.value,!this.sign)},u.prototype.negate=function(){var m=this.sign,E=new u(-this.value);return E.sign=!m,E},d.prototype.negate=function(){return new d(-this.value)},c.prototype.abs=function(){return new c(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},d.prototype.abs=function(){return new d(this.value>=0?this.value:-this.value)};function ae(m,E){var b=m.length,R=E.length,v=b+R,O=N(v),I=t,x,F,j,de,me;for(j=0;j<b;++j){de=m[j];for(var Ae=0;Ae<R;++Ae)me=E[Ae],x=de*me+O[j+Ae],F=Math.floor(x/I),O[j+Ae]=x-F*I,O[j+Ae+1]+=F}return T(O),O}function L(m,E){var b=m.length,R=new Array(b),v=t,O=0,I,x;for(x=0;x<b;x++)I=m[x]*E+O,O=Math.floor(I/v),R[x]=I-O*v;for(;O>0;)R[x++]=O%v,O=Math.floor(O/v);return R}function P(m,E){for(var b=[];E-- >0;)b.push(0);return b.concat(m)}function $(m,E){var b=Math.max(m.length,E.length);if(b<=30)return ae(m,E);b=Math.ceil(b/2);var R=m.slice(b),v=m.slice(0,b),O=E.slice(b),I=E.slice(0,b),x=$(v,I),F=$(R,O),j=$(M(v,R),M(I,O)),de=M(M(x,P(Y(Y(j,x),F),b)),P(F,2*b));return T(de),de}function J(m,E){return-.012*m-.012*E+15e-6*m*E>0}c.prototype.multiply=function(m){var E=W(m),b=this.value,R=E.value,v=this.sign!==E.sign,O;if(E.isSmall){if(R===0)return o[0];if(R===1)return this;if(R===-1)return this.negate();if(O=Math.abs(R),O<t)return new c(L(b,O),v);R=S(O)}return J(b.length,R.length)?new c($(b,R),v):new c(ae(b,R),v)},c.prototype.times=c.prototype.multiply;function _e(m,E,b){return m<t?new c(L(E,m),b):new c(ae(E,S(m)),b)}u.prototype._multiplyBySmall=function(m){return p(m.value*this.value)?new u(m.value*this.value):_e(Math.abs(m.value),S(Math.abs(this.value)),this.sign!==m.sign)},c.prototype._multiplyBySmall=function(m){return m.value===0?o[0]:m.value===1?this:m.value===-1?this.negate():_e(Math.abs(m.value),this.value,this.sign!==m.sign)},u.prototype.multiply=function(m){return W(m)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,d.prototype.multiply=function(m){return new d(this.value*W(m).value)},d.prototype.times=d.prototype.multiply;function Se(m){var E=m.length,b=N(E+E),R=t,v,O,I,x,F;for(I=0;I<E;I++){x=m[I],O=0-x*x;for(var j=I;j<E;j++)F=m[j],v=2*(x*F)+b[I+j]+O,O=Math.floor(v/R),b[I+j]=v-O*R;b[I+E]=O}return T(b),b}c.prototype.square=function(){return new c(Se(this.value),!1)},u.prototype.square=function(){var m=this.value*this.value;return p(m)?new u(m):new c(Se(S(Math.abs(this.value))),!1)},d.prototype.square=function(m){return new d(this.value*this.value)};function xe(m,E){var b=m.length,R=E.length,v=t,O=N(E.length),I=E[R-1],x=Math.ceil(v/(2*I)),F=L(m,x),j=L(E,x),de,me,Ae,Nt,Tt,$i,Ki;for(F.length<=b&&F.push(0),j.push(0),I=j[R-1],me=b-R;me>=0;me--){for(de=v-1,F[me+R]!==I&&(de=Math.floor((F[me+R]*v+F[me+R-1])/I)),Ae=0,Nt=0,$i=j.length,Tt=0;Tt<$i;Tt++)Ae+=de*j[Tt],Ki=Math.floor(Ae/v),Nt+=F[me+Tt]-(Ae-Ki*v),Ae=Ki,Nt<0?(F[me+Tt]=Nt+v,Nt=-1):(F[me+Tt]=Nt,Nt=0);for(;Nt!==0;){for(de-=1,Ae=0,Tt=0;Tt<$i;Tt++)Ae+=F[me+Tt]-v+j[Tt],Ae<0?(F[me+Tt]=Ae+v,Ae=0):(F[me+Tt]=Ae,Ae=1);Nt+=Ae}O[me]=de}return F=je(F,x)[0],[g(O),g(F)]}function Te(m,E){for(var b=m.length,R=E.length,v=[],O=[],I=t,x,F,j,de,me;b;){if(O.unshift(m[--b]),T(O),$e(O,E)<0){v.push(0);continue}F=O.length,j=O[F-1]*I+O[F-2],de=E[R-1]*I+E[R-2],F>R&&(j=(j+1)*I),x=Math.ceil(j/de);do{if(me=L(E,x),$e(me,O)<=0)break;x--}while(x);v.push(x),O=Y(O,me)}return v.reverse(),[g(v),g(O)]}function je(m,E){var b=m.length,R=N(b),v=t,O,I,x,F;for(x=0,O=b-1;O>=0;--O)F=x*v+m[O],I=w(F/E),x=F-I*E,R[O]=I|0;return[R,x|0]}function Ze(m,E){var b,R=W(E);if(s)return[new d(m.value/R.value),new d(m.value%R.value)];var v=m.value,O=R.value,I;if(O===0)throw new Error("Cannot divide by zero");if(m.isSmall)return R.isSmall?[new u(w(v/O)),new u(v%O)]:[o[0],m];if(R.isSmall){if(O===1)return[m,o[0]];if(O==-1)return[m.negate(),o[0]];var x=Math.abs(O);if(x<t){b=je(v,x),I=g(b[0]);var F=b[1];return m.sign&&(F=-F),typeof I=="number"?(m.sign!==R.sign&&(I=-I),[new u(I),new u(F)]):[new c(I,m.sign!==R.sign),new u(F)]}O=S(x)}var j=$e(v,O);if(j===-1)return[o[0],m];if(j===0)return[o[m.sign===R.sign?1:-1],o[0]];v.length+O.length<=200?b=xe(v,O):b=Te(v,O),I=b[0];var de=m.sign!==R.sign,me=b[1],Ae=m.sign;return typeof I=="number"?(de&&(I=-I),I=new u(I)):I=new c(I,de),typeof me=="number"?(Ae&&(me=-me),me=new u(me)):me=new c(me,Ae),[I,me]}c.prototype.divmod=function(m){var E=Ze(this,m);return{quotient:E[0],remainder:E[1]}},d.prototype.divmod=u.prototype.divmod=c.prototype.divmod,c.prototype.divide=function(m){return Ze(this,m)[0]},d.prototype.over=d.prototype.divide=function(m){return new d(this.value/W(m).value)},u.prototype.over=u.prototype.divide=c.prototype.over=c.prototype.divide,c.prototype.mod=function(m){return Ze(this,m)[1]},d.prototype.mod=d.prototype.remainder=function(m){return new d(this.value%W(m).value)},u.prototype.remainder=u.prototype.mod=c.prototype.remainder=c.prototype.mod,c.prototype.pow=function(m){var E=W(m),b=this.value,R=E.value,v,O,I;if(R===0)return o[1];if(b===0)return o[0];if(b===1)return o[1];if(b===-1)return E.isEven()?o[1]:o[-1];if(E.sign)return o[0];if(!E.isSmall)throw new Error("The exponent "+E.toString()+" is too large.");if(this.isSmall&&p(v=Math.pow(b,R)))return new u(w(v));for(O=this,I=o[1];R&!0&&(I=I.times(O),--R),R!==0;)R/=2,O=O.square();return I},u.prototype.pow=c.prototype.pow,d.prototype.pow=function(m){var E=W(m),b=this.value,R=E.value,v=BigInt(0),O=BigInt(1),I=BigInt(2);if(R===v)return o[1];if(b===v)return o[0];if(b===O)return o[1];if(b===BigInt(-1))return E.isEven()?o[1]:o[-1];if(E.isNegative())return new d(v);for(var x=this,F=o[1];(R&O)===O&&(F=F.times(x),--R),R!==v;)R/=I,x=x.square();return F},c.prototype.modPow=function(m,E){if(m=W(m),E=W(E),E.isZero())throw new Error("Cannot take modPow with modulus 0");var b=o[1],R=this.mod(E);for(m.isNegative()&&(m=m.multiply(o[-1]),R=R.modInv(E));m.isPositive();){if(R.isZero())return o[0];m.isOdd()&&(b=b.multiply(R).mod(E)),m=m.divide(2),R=R.square().mod(E)}return b},d.prototype.modPow=u.prototype.modPow=c.prototype.modPow;function $e(m,E){if(m.length!==E.length)return m.length>E.length?1:-1;for(var b=m.length-1;b>=0;b--)if(m[b]!==E[b])return m[b]>E[b]?1:-1;return 0}c.prototype.compareAbs=function(m){var E=W(m),b=this.value,R=E.value;return E.isSmall?1:$e(b,R)},u.prototype.compareAbs=function(m){var E=W(m),b=Math.abs(this.value),R=E.value;return E.isSmall?(R=Math.abs(R),b===R?0:b>R?1:-1):-1},d.prototype.compareAbs=function(m){var E=this.value,b=W(m).value;return E=E>=0?E:-E,b=b>=0?b:-b,E===b?0:E>b?1:-1},c.prototype.compare=function(m){if(m===1/0)return-1;if(m===-1/0)return 1;var E=W(m),b=this.value,R=E.value;return this.sign!==E.sign?E.sign?1:-1:E.isSmall?this.sign?-1:1:$e(b,R)*(this.sign?-1:1)},c.prototype.compareTo=c.prototype.compare,u.prototype.compare=function(m){if(m===1/0)return-1;if(m===-1/0)return 1;var E=W(m),b=this.value,R=E.value;return E.isSmall?b==R?0:b>R?1:-1:b<0!==E.sign?b<0?-1:1:b<0?1:-1},u.prototype.compareTo=u.prototype.compare,d.prototype.compare=function(m){if(m===1/0)return-1;if(m===-1/0)return 1;var E=this.value,b=W(m).value;return E===b?0:E>b?1:-1},d.prototype.compareTo=d.prototype.compare,c.prototype.equals=function(m){return this.compare(m)===0},d.prototype.eq=d.prototype.equals=u.prototype.eq=u.prototype.equals=c.prototype.eq=c.prototype.equals,c.prototype.notEquals=function(m){return this.compare(m)!==0},d.prototype.neq=d.prototype.notEquals=u.prototype.neq=u.prototype.notEquals=c.prototype.neq=c.prototype.notEquals,c.prototype.greater=function(m){return this.compare(m)>0},d.prototype.gt=d.prototype.greater=u.prototype.gt=u.prototype.greater=c.prototype.gt=c.prototype.greater,c.prototype.lesser=function(m){return this.compare(m)<0},d.prototype.lt=d.prototype.lesser=u.prototype.lt=u.prototype.lesser=c.prototype.lt=c.prototype.lesser,c.prototype.greaterOrEquals=function(m){return this.compare(m)>=0},d.prototype.geq=d.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals=c.prototype.geq=c.prototype.greaterOrEquals,c.prototype.lesserOrEquals=function(m){return this.compare(m)<=0},d.prototype.leq=d.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals=c.prototype.leq=c.prototype.lesserOrEquals,c.prototype.isEven=function(){return(this.value[0]&1)===0},u.prototype.isEven=function(){return(this.value&1)===0},d.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},c.prototype.isOdd=function(){return(this.value[0]&1)===1},u.prototype.isOdd=function(){return(this.value&1)===1},d.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},c.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},d.prototype.isPositive=u.prototype.isPositive,c.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},d.prototype.isNegative=u.prototype.isNegative,c.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return Math.abs(this.value)===1},d.prototype.isUnit=function(){return this.abs().value===BigInt(1)},c.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return this.value===0},d.prototype.isZero=function(){return this.value===BigInt(0)},c.prototype.isDivisibleBy=function(m){var E=W(m);return E.isZero()?!1:E.isUnit()?!0:E.compareAbs(2)===0?this.isEven():this.mod(E).isZero()},d.prototype.isDivisibleBy=u.prototype.isDivisibleBy=c.prototype.isDivisibleBy;function Yt(m){var E=m.abs();if(E.isUnit())return!1;if(E.equals(2)||E.equals(3)||E.equals(5))return!0;if(E.isEven()||E.isDivisibleBy(3)||E.isDivisibleBy(5))return!1;if(E.lesser(49))return!0}function et(m,E){for(var b=m.prev(),R=b,v=0,O,I,x,F;R.isEven();)R=R.divide(2),v++;e:for(x=0;x<E.length;x++)if(!m.lesser(E[x])&&(F=st(E[x]).modPow(R,m),!(F.isUnit()||F.equals(b)))){for(O=v-1;O!=0;O--){if(F=F.square().mod(m),F.isUnit())return!1;if(F.equals(b))continue e}return!1}return!0}c.prototype.isPrime=function(m){var E=Yt(this);if(E!==e)return E;var b=this.abs(),R=b.bitLength();if(R<=64)return et(b,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var v=Math.log(2)*R.toJSNumber(),O=Math.ceil(m===!0?2*Math.pow(v,2):v),I=[],x=0;x<O;x++)I.push(st(x+2));return et(b,I)},d.prototype.isPrime=u.prototype.isPrime=c.prototype.isPrime,c.prototype.isProbablePrime=function(m,E){var b=Yt(this);if(b!==e)return b;for(var R=this.abs(),v=m===e?5:m,O=[],I=0;I<v;I++)O.push(st.randBetween(2,R.minus(2),E));return et(R,O)},d.prototype.isProbablePrime=u.prototype.isProbablePrime=c.prototype.isProbablePrime,c.prototype.modInv=function(m){for(var E=st.zero,b=st.one,R=W(m),v=this.abs(),O,I,x;!v.isZero();)O=R.divide(v),I=E,x=R,E=b,R=v,b=I.subtract(O.multiply(b)),v=x.subtract(O.multiply(v));if(!R.isUnit())throw new Error(this.toString()+" and "+m.toString()+" are not co-prime");return E.compare(0)===-1&&(E=E.add(m)),this.isNegative()?E.negate():E},d.prototype.modInv=u.prototype.modInv=c.prototype.modInv,c.prototype.next=function(){var m=this.value;return this.sign?Q(m,1,this.sign):new c(B(m,1),this.sign)},u.prototype.next=function(){var m=this.value;return m+1<r?new u(m+1):new c(i,!1)},d.prototype.next=function(){return new d(this.value+BigInt(1))},c.prototype.prev=function(){var m=this.value;return this.sign?new c(B(m,1),!0):Q(m,1,this.sign)},u.prototype.prev=function(){var m=this.value;return m-1>-r?new u(m-1):new c(i,!0)},d.prototype.prev=function(){return new d(this.value-BigInt(1))};for(var tt=[1];2*tt[tt.length-1]<=t;)tt.push(2*tt[tt.length-1]);var At=tt.length,H=tt[At-1];function ee(m){return Math.abs(m)<=t}c.prototype.shiftLeft=function(m){var E=W(m).toJSNumber();if(!ee(E))throw new Error(String(E)+" is too large for shifting.");if(E<0)return this.shiftRight(-E);var b=this;if(b.isZero())return b;for(;E>=At;)b=b.multiply(H),E-=At-1;return b.multiply(tt[E])},d.prototype.shiftLeft=u.prototype.shiftLeft=c.prototype.shiftLeft,c.prototype.shiftRight=function(m){var E,b=W(m).toJSNumber();if(!ee(b))throw new Error(String(b)+" is too large for shifting.");if(b<0)return this.shiftLeft(-b);for(var R=this;b>=At;){if(R.isZero()||R.isNegative()&&R.isUnit())return R;E=Ze(R,H),R=E[1].isNegative()?E[0].prev():E[0],b-=At-1}return E=Ze(R,tt[b]),E[1].isNegative()?E[0].prev():E[0]},d.prototype.shiftRight=u.prototype.shiftRight=c.prototype.shiftRight;function le(m,E,b){E=W(E);for(var R=m.isNegative(),v=E.isNegative(),O=R?m.not():m,I=v?E.not():E,x=0,F=0,j=null,de=null,me=[];!O.isZero()||!I.isZero();)j=Ze(O,H),x=j[1].toJSNumber(),R&&(x=H-1-x),de=Ze(I,H),F=de[1].toJSNumber(),v&&(F=H-1-F),O=j[0],I=de[0],me.push(b(x,F));for(var Ae=b(R?1:0,v?1:0)!==0?st(-1):st(0),Nt=me.length-1;Nt>=0;Nt-=1)Ae=Ae.multiply(H).add(st(me[Nt]));return Ae}c.prototype.not=function(){return this.negate().prev()},d.prototype.not=u.prototype.not=c.prototype.not,c.prototype.and=function(m){return le(this,m,function(E,b){return E&b})},d.prototype.and=u.prototype.and=c.prototype.and,c.prototype.or=function(m){return le(this,m,function(E,b){return E|b})},d.prototype.or=u.prototype.or=c.prototype.or,c.prototype.xor=function(m){return le(this,m,function(E,b){return E^b})},d.prototype.xor=u.prototype.xor=c.prototype.xor;var ge=1<<30,y=(t&-t)*(t&-t)|ge;function Ke(m){var E=m.value,b=typeof E=="number"?E|ge:typeof E=="bigint"?E|BigInt(ge):E[0]+E[1]*t|y;return b&-b}function ce(m,E){if(E.compareTo(m)<=0){var b=ce(m,E.square(E)),R=b.p,v=b.e,O=R.multiply(E);return O.compareTo(m)<=0?{p:O,e:v*2+1}:{p:R,e:v*2}}return{p:st(1),e:0}}c.prototype.bitLength=function(){var m=this;return m.compareTo(st(0))<0&&(m=m.negate().subtract(st(1))),m.compareTo(st(0))===0?st(0):st(ce(m,st(2)).e).add(st(1))},d.prototype.bitLength=u.prototype.bitLength=c.prototype.bitLength;function Ee(m,E){return m=W(m),E=W(E),m.greater(E)?m:E}function Me(m,E){return m=W(m),E=W(E),m.lesser(E)?m:E}function te(m,E){if(m=W(m).abs(),E=W(E).abs(),m.equals(E))return m;if(m.isZero())return E;if(E.isZero())return m;for(var b=o[1],R,v;m.isEven()&&E.isEven();)R=Me(Ke(m),Ke(E)),m=m.divide(R),E=E.divide(R),b=b.multiply(R);for(;m.isEven();)m=m.divide(Ke(m));do{for(;E.isEven();)E=E.divide(Ke(E));m.greater(E)&&(v=E,E=m,m=v),E=E.subtract(m)}while(!E.isZero());return b.isUnit()?m:m.multiply(b)}function Zt(m,E){return m=W(m).abs(),E=W(E).abs(),m.divide(te(m,E)).multiply(E)}function De(m,E,b){m=W(m),E=W(E);var R=b||Math.random,v=Me(m,E),O=Ee(m,E),I=O.subtract(v).add(1);if(I.isSmall)return v.add(Math.floor(R()*I));for(var x=X(I,t).value,F=[],j=!0,de=0;de<x.length;de++){var me=j?x[de]+(de+1<x.length?x[de+1]/t:0):t,Ae=w(R()*me);F.push(Ae),Ae<x[de]&&(j=!1)}return v.add(o.fromArray(F,t,!1))}var K=function(m,E,b,R){b=b||a,m=String(m),R||(m=m.toLowerCase(),b=b.toLowerCase());var v=m.length,O,I=Math.abs(E),x={};for(O=0;O<b.length;O++)x[b[O]]=O;for(O=0;O<v;O++){var F=m[O];if(F!=="-"&&F in x&&x[F]>=I){if(F==="1"&&I===1)continue;throw new Error(F+" is not a valid digit in base "+E+".")}}E=W(E);var j=[],de=m[0]==="-";for(O=de?1:0;O<m.length;O++){var F=m[O];if(F in x)j.push(W(x[F]));else if(F==="<"){var me=O;do O++;while(m[O]!==">"&&O<m.length);j.push(W(m.slice(me+1,O)))}else throw new Error(F+" is not a valid character")}return fe(j,E,de)};function fe(m,E,b){var R=o[0],v=o[1],O;for(O=m.length-1;O>=0;O--)R=R.add(m[O].times(v)),v=v.times(E);return b?R.negate():R}function Fe(m,E){return E=E||a,m<E.length?E[m]:"<"+m+">"}function X(m,E){if(E=st(E),E.isZero()){if(m.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(E.equals(-1)){if(m.isZero())return{value:[0],isNegative:!1};if(m.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-m.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var b=Array.apply(null,Array(m.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return b.unshift([1]),{value:[].concat.apply([],b),isNegative:!1}}var R=!1;if(m.isNegative()&&E.isPositive()&&(R=!0,m=m.abs()),E.isUnit())return m.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(m.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:R};for(var v=[],O=m,I;O.isNegative()||O.compareAbs(E)>=0;){I=O.divmod(E),O=I.quotient;var x=I.remainder;x.isNegative()&&(x=E.minus(x).abs(),O=O.next()),v.push(x.toJSNumber())}return v.push(O.toJSNumber()),{value:v.reverse(),isNegative:R}}function Ut(m,E,b){var R=X(m,E);return(R.isNegative?"-":"")+R.value.map(function(v){return Fe(v,b)}).join("")}c.prototype.toArray=function(m){return X(this,m)},u.prototype.toArray=function(m){return X(this,m)},d.prototype.toArray=function(m){return X(this,m)},c.prototype.toString=function(m,E){if(m===e&&(m=10),m!==10)return Ut(this,m,E);for(var b=this.value,R=b.length,v=String(b[--R]),O="0000000",I;--R>=0;)I=String(b[R]),v+=O.slice(I.length)+I;var x=this.sign?"-":"";return x+v},u.prototype.toString=function(m,E){return m===e&&(m=10),m!=10?Ut(this,m,E):String(this.value)},d.prototype.toString=u.prototype.toString,d.prototype.toJSON=c.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},c.prototype.valueOf=function(){return parseInt(this.toString(),10)},c.prototype.toJSNumber=c.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf,d.prototype.valueOf=d.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function Yn(m){if(p(+m)){var E=+m;if(E===w(E))return s?new d(BigInt(E)):new u(E);throw new Error("Invalid integer: "+m)}var b=m[0]==="-";b&&(m=m.slice(1));var R=m.split(/e/i);if(R.length>2)throw new Error("Invalid integer: "+R.join("e"));if(R.length===2){var v=R[1];if(v[0]==="+"&&(v=v.slice(1)),v=+v,v!==w(v)||!p(v))throw new Error("Invalid integer: "+v+" is not a valid exponent.");var O=R[0],I=O.indexOf(".");if(I>=0&&(v-=O.length-I-1,O=O.slice(0,I)+O.slice(I+1)),v<0)throw new Error("Cannot include negative exponent part for integers");O+=new Array(v+1).join("0"),m=O}var x=/^([0-9][0-9]*)$/.test(m);if(!x)throw new Error("Invalid integer: "+m);if(s)return new d(BigInt(b?"-"+m:m));for(var F=[],j=m.length,de=n,me=j-de;j>0;)F.push(+m.slice(me,j)),me-=de,me<0&&(me=0),j-=de;return T(F),new c(F,b)}function Dn(m){if(s)return new d(BigInt(m));if(p(m)){if(m!==w(m))throw new Error(m+" is not an integer.");return new u(m)}return Yn(m.toString())}function W(m){return typeof m=="number"?Dn(m):typeof m=="string"?Yn(m):typeof m=="bigint"?new d(m):m}for(var Ot=0;Ot<1e3;Ot++)o[Ot]=W(Ot),Ot>0&&(o[-Ot]=W(-Ot));return o.one=o[1],o.zero=o[0],o.minusOne=o[-1],o.max=Ee,o.min=Me,o.gcd=te,o.lcm=Zt,o.isInstance=function(m){return m instanceof c||m instanceof u||m instanceof d},o.randBetween=De,o.fromArray=function(m,E,b){return fe(m.map(W),W(E||10),b)},o}();typeof Bc<"u"&&Bc.hasOwnProperty("exports")&&(Bc.exports=st);typeof define=="function"&&define.amd&&define(function(){return st})});var bI=f(ot=>{"use strict";l();var OH=require("fs"),NH=hI(),mr=!1;ot.maxObjectSize=100*1e3*1e3;ot.maxObjectCount=32768;var yH=9783072e5,IH=ot.UID=function(e){this.UID=e},Ide=ot.parseFile=function(e,t){return new Promise(function(n,r){function i(a){let s=null,o;try{o=vH(a),n(o)}catch(c){s=c,r(s)}finally{t&&t(s,o)}}if(Buffer.isBuffer(e))return i(e);OH.readFile(e,function(a,s){if(a)return r(a),t(a);i(s)})})},vH=ot.parseBuffer=function(e){if(e.slice(0,6).toString("utf8")!=="bplist")throw new Error("Invalid binary plist. Expected 'bplist' at offset 0.");let n=e.slice(e.length-32,e.length),r=n.readUInt8(6);mr&&console.log("offsetSize: "+r);let i=n.readUInt8(7);mr&&console.log("objectRefSize: "+i);let a=lp(n,8);mr&&console.log("numObjects: "+a);let s=lp(n,16);mr&&console.log("topObject: "+s);let o=lp(n,24);if(mr&&console.log("offsetTableOffset: "+o),a>ot.maxObjectCount)throw new Error("maxObjectCount exceeded");let c=[];for(let d=0;d<a;d++){let p=e.slice(o+d*r,o+(d+1)*r);c[d]=Bt(p,0),mr&&console.log("Offset for Object #"+d+" is "+c[d]+" ["+c[d].toString(16)+"]")}function u(d){let p=c[d],S=e[p],g=(S&240)>>4,T=S&15;switch(g){case 0:return N();case 1:return k();case 8:return M();case 2:return B();case 3:return Y();case 4:return re();case 5:return Q();case 6:return Q(!0);case 10:return ae();case 13:return L();default:throw new Error("Unhandled type 0x"+g.toString(16))}function N(){switch(T){case 0:return null;case 8:return!1;case 9:return!0;case 15:return null;default:throw new Error("Unhandled simple type 0x"+g.toString(16))}}function w(P){let $="",J;for(J=0;J<P.length&&P[J]==0;J++);for(;J<P.length;J++){let _e="00"+P[J].toString(16);$+=_e.substr(_e.length-2)}return $}function k(){let P=Math.pow(2,T);if(T==4){let $=e.slice(p+1,p+1+P),J=w($);return NH(J,16)}if(T==3)return e.readInt32BE(p+1);if(P<ot.maxObjectSize)return Bt(e.slice(p+1,p+1+P));throw new Error("To little heap space available! Wanted to read "+P+" bytes, but only "+ot.maxObjectSize+" are available.")}function M(){let P=T+1;if(P<ot.maxObjectSize)return new IH(Bt(e.slice(p+1,p+1+P)));throw new Error("To little heap space available! Wanted to read "+P+" bytes, but only "+ot.maxObjectSize+" are available.")}function B(){let P=Math.pow(2,T);if(P<ot.maxObjectSize){let $=e.slice(p+1,p+1+P);if(P===4)return $.readFloatBE(0);if(P===8)return $.readDoubleBE(0)}else throw new Error("To little heap space available! Wanted to read "+P+" bytes, but only "+ot.maxObjectSize+" are available.")}function Y(){T!=3&&console.error("Unknown date type :"+T+". Parsing anyway...");let P=e.slice(p+1,p+9);return new Date(yH+1e3*P.readDoubleBE(0))}function re(){let P=1,$=T;if(T==15){let J=e[p+1],_e=(J&240)/16;_e!=1&&console.error("0x4: UNEXPECTED LENGTH-INT TYPE! "+_e);let Se=J&15,xe=Math.pow(2,Se);P=2+xe,xe<3,$=Bt(e.slice(p+2,p+2+xe))}if($<ot.maxObjectSize)return e.slice(p+P,p+P+$);throw new Error("To little heap space available! Wanted to read "+$+" bytes, but only "+ot.maxObjectSize+" are available.")}function Q(P){P=P||0;let $="utf8",J=T,_e=1;if(T==15){let Se=e[p+1],xe=(Se&240)/16;xe!=1&&console.err("UNEXPECTED LENGTH-INT TYPE! "+xe);let Te=Se&15,je=Math.pow(2,Te);_e=2+je,je<3,J=Bt(e.slice(p+2,p+2+je))}if(J*=P+1,J<ot.maxObjectSize){let Se=Buffer.from(e.slice(p+_e,p+_e+J));return P&&(Se=xH(Se),$="ucs2"),Se.toString($)}throw new Error("To little heap space available! Wanted to read "+J+" bytes, but only "+ot.maxObjectSize+" are available.")}function ae(){let P=T,$=1;if(T==15){let _e=e[p+1],Se=(_e&240)/16;Se!=1&&console.error("0xa: UNEXPECTED LENGTH-INT TYPE! "+Se);let xe=_e&15,Te=Math.pow(2,xe);$=2+Te,Te<3,P=Bt(e.slice(p+2,p+2+Te))}if(P*i>ot.maxObjectSize)throw new Error("To little heap space available!");let J=[];for(let _e=0;_e<P;_e++){let Se=Bt(e.slice(p+$+_e*i,p+$+(_e+1)*i));J[_e]=u(Se)}return J}function L(){let P=T,$=1;if(T==15){let _e=e[p+1],Se=(_e&240)/16;Se!=1&&console.error("0xD: UNEXPECTED LENGTH-INT TYPE! "+Se);let xe=_e&15,Te=Math.pow(2,xe);$=2+Te,Te<3,P=Bt(e.slice(p+2,p+2+Te))}if(P*2*i>ot.maxObjectSize)throw new Error("To little heap space available!");mr&&console.log("Parsing dictionary #"+d);let J={};for(let _e=0;_e<P;_e++){let Se=Bt(e.slice(p+$+_e*i,p+$+(_e+1)*i)),xe=Bt(e.slice(p+$+P*i+_e*i,p+$+P*i+(_e+1)*i)),Te=u(Se),je=u(xe);mr&&console.log(" DICT #"+d+": Mapped "+Te+" to "+je),J[Te]=je}return J}}return[u(s)]};function Bt(e,t){t=t||0;let n=0;for(let r=t;r<e.length;r++)n<<=8,n|=e[r]&255;return n}function lp(e,t){return e.slice(t,t+8).readUInt32BE(4,8)}function xH(e){let t=e.length;for(let n=0;n<t;n+=2){let r=e[n];e[n]=e[n+1],e[n+1]=r}return e}});var RI=f((Mde,CI)=>{"use strict";l();var MH=require("os"),DI=MH.homedir();CI.exports=e=>{if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return DI?e.replace(/^~(?=$|\/|\\)/,DI):e}});var wI=f((Fde,MI)=>{"use strict";l();MI.exports=xI;xI.sync=FH;var II=require("fs");function PH(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function vI(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:PH(t,n)}function xI(e,t,n){II.stat(e,function(r,i){n(r,r?!1:vI(i,e,t))})}function FH(e,t){return vI(II.statSync(e),e,t)}});var BI=f((Bde,kI)=>{"use strict";l();kI.exports=PI;PI.sync=kH;var LI=require("fs");function PI(e,t,n){LI.stat(e,function(r,i){n(r,r?!1:FI(i,t))})}function kH(e,t){return FI(LI.statSync(e),t)}function FI(e,t){return e.isFile()&&BH(e,t)}function BH(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),o=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),d=o|c,p=n&u||n&c&&i===s||n&o&&r===a||n&d&&a===0;return p}});var GI=f((Hde,UI)=>{"use strict";l();var Gde=require("fs"),Uc;process.platform==="win32"||global.TESTING_WINDOWS?Uc=wI():Uc=BI();UI.exports=up;up.sync=UH;function up(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){up(e,t||{},function(a,s){a?i(a):r(s)})})}Uc(e,t||{},function(r,i){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function UH(e,t){try{return Uc.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var WI=f((qde,KI)=>{"use strict";l();var Mi=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",HI=require("path"),GH=Mi?";":":",YI=GI(),qI=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),VI=(e,t)=>{let n=t.colon||GH,r=e.match(/\//)||Mi&&e.match(/\\/)?[""]:[...Mi?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],i=Mi?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=Mi?i.split(n):[""];return Mi&&e.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:r,pathExt:a,pathExtExe:i}},$I=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:i,pathExtExe:a}=VI(e,t),s=[],o=u=>new Promise((d,p)=>{if(u===r.length)return t.all&&s.length?d(s):p(qI(e));let S=r[u],g=/^".*"$/.test(S)?S.slice(1,-1):S,T=HI.join(g,e),N=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+T:T;d(c(N,u,0))}),c=(u,d,p)=>new Promise((S,g)=>{if(p===i.length)return S(o(d+1));let T=i[p];YI(u+T,{pathExt:a},(N,w)=>{if(!N&&w)if(t.all)s.push(u+T);else return S(u+T);return S(c(u,d,p+1))})});return n?o(0).then(u=>n(null,u),n):o(0)},HH=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:i}=VI(e,t),a=[];for(let s=0;s<n.length;s++){let o=n[s],c=/^".*"$/.test(o)?o.slice(1,-1):o,u=HI.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let p=0;p<r.length;p++){let S=d+r[p];try{if(YI.sync(S,{pathExt:i}))if(t.all)a.push(S);else return S}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw qI(e)};KI.exports=$I;$I.sync=HH});var _p=f(($de,dp)=>{"use strict";l();var zI=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};dp.exports=zI;dp.exports.default=zI});var jI=f((Wde,JI)=>{"use strict";l();var QI=require("path"),YH=WI(),qH=_p();function XI(e,t){let n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let s;try{s=YH.sync(e.command,{path:n[qH({env:n})],pathExt:t?QI.delimiter:void 0})}catch{}finally{a&&process.chdir(r)}return s&&(s=QI.resolve(i?e.options.cwd:"",s)),s}function VH(e){return XI(e)||XI(e,!0)}JI.exports=VH});var ZI=f((Qde,pp)=>{"use strict";l();var mp=/([()\][%!^"`<>&|;, *?])/g;function $H(e){return e=e.replace(mp,"^$1"),e}function KH(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(mp,"^$1"),t&&(e=e.replace(mp,"^$1")),e}pp.exports.command=$H;pp.exports.argument=KH});var tv=f((Jde,ev)=>{"use strict";l();ev.exports=/^#!(.*)/});var rv=f((Zde,nv)=>{"use strict";l();var WH=tv();nv.exports=(e="")=>{let t=e.match(WH);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i}});var av=f((t_e,iv)=>{"use strict";l();var Ep=require("fs"),zH=rv();function QH(e){let n=Buffer.alloc(150),r;try{r=Ep.openSync(e,"r"),Ep.readSync(r,n,0,150,0),Ep.closeSync(r)}catch{}return zH(n.toString())}iv.exports=QH});var cv=f((r_e,lv)=>{"use strict";l();var XH=require("path"),sv=jI(),ov=ZI(),JH=av(),jH=process.platform==="win32",ZH=/\.(?:com|exe)$/i,eY=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function tY(e){e.file=sv(e);let t=e.file&&JH(e.file);return t?(e.args.unshift(e.file),e.command=t,sv(e)):e.file}function nY(e){if(!jH)return e;let t=tY(e),n=!ZH.test(t);if(e.options.forceShell||n){let r=eY.test(t);e.command=XH.normalize(e.command),e.command=ov.command(e.command),e.args=e.args.map(a=>ov.argument(a,r));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function rY(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:nY(r)}lv.exports=rY});var _v=f((a_e,dv)=>{"use strict";l();var fp=process.platform==="win32";function gp(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function iY(e,t){if(!fp)return;let n=e.emit;e.emit=function(r,i){if(r==="exit"){let a=uv(i,t,"spawn");if(a)return n.call(e,"error",a)}return n.apply(e,arguments)}}function uv(e,t){return fp&&e===1&&!t.file?gp(t.original,"spawn"):null}function aY(e,t){return fp&&e===1&&!t.file?gp(t.original,"spawnSync"):null}dv.exports={hookChildProcess:iY,verifyENOENT:uv,verifyENOENTSync:aY,notFoundError:gp}});var hp=f((o_e,wi)=>{"use strict";l();var mv=require("child_process"),Sp=cv(),Tp=_v();function pv(e,t,n){let r=Sp(e,t,n),i=mv.spawn(r.command,r.args,r.options);return Tp.hookChildProcess(i,r),i}function sY(e,t,n){let r=Sp(e,t,n),i=mv.spawnSync(r.command,r.args,r.options);return i.error=i.error||Tp.verifyENOENTSync(i.status,r),i}wi.exports=pv;wi.exports.spawn=pv;wi.exports.sync=sY;wi.exports._parse=Sp;wi.exports._enoent=Tp});var fv=f((c_e,Ev)=>{"use strict";l();Ev.exports=e=>{let t=typeof e=="string"?`
60
60
  `:`
61
- `.charCodeAt(),n=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e}});var Tv=f((u_e,es)=>{"use strict";l();var Za=require("path"),gv=_p(),Sv=e=>{e={cwd:process.cwd(),path:process.env[gv()],execPath:process.execPath,...e};let t,n=Za.resolve(e.cwd),r=[];for(;t!==n;)r.push(Za.join(n,"node_modules/.bin")),t=n,n=Za.resolve(n,"..");let i=Za.resolve(e.cwd,e.execPath,"..");return r.push(i),r.concat(e.path).join(Za.delimiter)};es.exports=Sv;es.exports.default=Sv;es.exports.env=e=>{e={env:process.env,...e};let t={...e.env},n=gv({env:t});return e.path=t[n],t[n]=es.exports(e),t}});var bv=f((__e,bp)=>{"use strict";l();var hv=(e,t)=>{for(let n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};bp.exports=hv;bp.exports.default=hv});var Cv=f((p_e,Hc)=>{"use strict";l();var oY=bv(),Gc=new WeakMap,Dv=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,i=e.displayName||e.name||"<anonymous>",a=function(...s){if(Gc.set(a,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return oY(a,e),Gc.set(a,r),a};Hc.exports=Dv;Hc.exports.default=Dv;Hc.exports.callCount=e=>{if(!Gc.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Gc.get(e)}});var Rv=f(Yc=>{"use strict";l();Object.defineProperty(Yc,"__esModule",{value:!0});Yc.SIGNALS=void 0;var lY=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Yc.SIGNALS=lY});var Dp=f(Li=>{"use strict";l();Object.defineProperty(Li,"__esModule",{value:!0});Li.SIGRTMAX=Li.getRealtimeSignals=void 0;var cY=function(){let e=Ov-Av+1;return Array.from({length:e},uY)};Li.getRealtimeSignals=cY;var uY=function(e,t){return{name:`SIGRT${t+1}`,number:Av+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},Av=34,Ov=64;Li.SIGRTMAX=Ov});var Nv=f(qc=>{"use strict";l();Object.defineProperty(qc,"__esModule",{value:!0});qc.getSignals=void 0;var dY=require("os"),_Y=Rv(),mY=Dp(),pY=function(){let e=(0,mY.getRealtimeSignals)();return[..._Y.SIGNALS,...e].map(EY)};qc.getSignals=pY;var EY=function({name:e,number:t,description:n,action:r,forced:i=!1,standard:a}){let{signals:{[e]:s}}=dY.constants,o=s!==void 0;return{name:e,number:o?s:t,description:n,supported:o,action:r,forced:i,standard:a}}});var Iv=f(Pi=>{"use strict";l();Object.defineProperty(Pi,"__esModule",{value:!0});Pi.signalsByNumber=Pi.signalsByName=void 0;var fY=require("os"),yv=Nv(),gY=Dp(),SY=function(){return(0,yv.getSignals)().reduce(TY,{})},TY=function(e,{name:t,number:n,description:r,supported:i,action:a,forced:s,standard:o}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:a,forced:s,standard:o}}},hY=SY();Pi.signalsByName=hY;var bY=function(){let e=(0,yv.getSignals)(),t=gY.SIGRTMAX+1,n=Array.from({length:t},(r,i)=>DY(i,e));return Object.assign({},...n)},DY=function(e,t){let n=CY(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:s,forced:o,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:s,forced:o,standard:c}}},CY=function(e,t){let n=t.find(({name:r})=>fY.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},RY=bY();Pi.signalsByNumber=RY});var xv=f((R_e,vv)=>{"use strict";l();var{signalsByName:AY}=Iv(),OY=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",NY=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:s,escapedCommand:o,timedOut:c,isCanceled:u,killed:d,parsed:{options:{timeout:p}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;let S=i===void 0?void 0:AY[i].description,g=r&&r.code,N=`Command ${OY({timedOut:c,timeout:p,errorCode:g,signal:i,signalDescription:S,exitCode:a,isCanceled:u})}: ${s}`,w=Object.prototype.toString.call(r)==="[object Error]",k=w?`${N}
61
+ `.charCodeAt(),n=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e}});var Tv=f((d_e,es)=>{"use strict";l();var Za=require("path"),gv=_p(),Sv=e=>{e={cwd:process.cwd(),path:process.env[gv()],execPath:process.execPath,...e};let t,n=Za.resolve(e.cwd),r=[];for(;t!==n;)r.push(Za.join(n,"node_modules/.bin")),t=n,n=Za.resolve(n,"..");let i=Za.resolve(e.cwd,e.execPath,"..");return r.push(i),r.concat(e.path).join(Za.delimiter)};es.exports=Sv;es.exports.default=Sv;es.exports.env=e=>{e={env:process.env,...e};let t={...e.env},n=gv({env:t});return e.path=t[n],t[n]=es.exports(e),t}});var bv=f((m_e,bp)=>{"use strict";l();var hv=(e,t)=>{for(let n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};bp.exports=hv;bp.exports.default=hv});var Cv=f((E_e,Hc)=>{"use strict";l();var oY=bv(),Gc=new WeakMap,Dv=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,i=e.displayName||e.name||"<anonymous>",a=function(...s){if(Gc.set(a,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return oY(a,e),Gc.set(a,r),a};Hc.exports=Dv;Hc.exports.default=Dv;Hc.exports.callCount=e=>{if(!Gc.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Gc.get(e)}});var Rv=f(Yc=>{"use strict";l();Object.defineProperty(Yc,"__esModule",{value:!0});Yc.SIGNALS=void 0;var lY=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Yc.SIGNALS=lY});var Dp=f(Li=>{"use strict";l();Object.defineProperty(Li,"__esModule",{value:!0});Li.SIGRTMAX=Li.getRealtimeSignals=void 0;var cY=function(){let e=Ov-Av+1;return Array.from({length:e},uY)};Li.getRealtimeSignals=cY;var uY=function(e,t){return{name:`SIGRT${t+1}`,number:Av+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},Av=34,Ov=64;Li.SIGRTMAX=Ov});var Nv=f(qc=>{"use strict";l();Object.defineProperty(qc,"__esModule",{value:!0});qc.getSignals=void 0;var dY=require("os"),_Y=Rv(),mY=Dp(),pY=function(){let e=(0,mY.getRealtimeSignals)();return[..._Y.SIGNALS,...e].map(EY)};qc.getSignals=pY;var EY=function({name:e,number:t,description:n,action:r,forced:i=!1,standard:a}){let{signals:{[e]:s}}=dY.constants,o=s!==void 0;return{name:e,number:o?s:t,description:n,supported:o,action:r,forced:i,standard:a}}});var Iv=f(Pi=>{"use strict";l();Object.defineProperty(Pi,"__esModule",{value:!0});Pi.signalsByNumber=Pi.signalsByName=void 0;var fY=require("os"),yv=Nv(),gY=Dp(),SY=function(){return(0,yv.getSignals)().reduce(TY,{})},TY=function(e,{name:t,number:n,description:r,supported:i,action:a,forced:s,standard:o}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:a,forced:s,standard:o}}},hY=SY();Pi.signalsByName=hY;var bY=function(){let e=(0,yv.getSignals)(),t=gY.SIGRTMAX+1,n=Array.from({length:t},(r,i)=>DY(i,e));return Object.assign({},...n)},DY=function(e,t){let n=CY(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:s,forced:o,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:s,forced:o,standard:c}}},CY=function(e,t){let n=t.find(({name:r})=>fY.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},RY=bY();Pi.signalsByNumber=RY});var xv=f((A_e,vv)=>{"use strict";l();var{signalsByName:AY}=Iv(),OY=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",NY=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:s,escapedCommand:o,timedOut:c,isCanceled:u,killed:d,parsed:{options:{timeout:p}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;let S=i===void 0?void 0:AY[i].description,g=r&&r.code,N=`Command ${OY({timedOut:c,timeout:p,errorCode:g,signal:i,signalDescription:S,exitCode:a,isCanceled:u})}: ${s}`,w=Object.prototype.toString.call(r)==="[object Error]",k=w?`${N}
62
62
  ${r.message}`:N,M=[k,t,e].filter(Boolean).join(`
63
- `);return w?(r.originalMessage=r.message,r.message=M):r=new Error(M),r.shortMessage=k,r.command=s,r.escapedCommand=o,r.exitCode=a,r.signal=i,r.signalDescription=S,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=u,r.killed=d&&!c,r};vv.exports=NY});var wv=f((O_e,Cp)=>{"use strict";l();var Vc=["stdin","stdout","stderr"],yY=e=>Vc.some(t=>e[t]!==void 0),Mv=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Vc.map(r=>e[r]);if(yY(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Vc.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,Vc.length);return Array.from({length:n},(r,i)=>t[i])};Cp.exports=Mv;Cp.exports.node=e=>{let t=Mv(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}});var Lv=f((y_e,$c)=>{"use strict";l();$c.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&$c.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&$c.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Op=f((v_e,Bi)=>{"use strict";l();var Ve=global.process,Ur=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Ur(Ve)?(Pv=require("assert"),Fi=Lv(),Fv=/^win/i.test(Ve.platform),ts=require("events"),typeof ts!="function"&&(ts=ts.EventEmitter),Ve.__signal_exit_emitter__?mt=Ve.__signal_exit_emitter__:(mt=Ve.__signal_exit_emitter__=new ts,mt.count=0,mt.emitted={}),mt.infinite||(mt.setMaxListeners(1/0),mt.infinite=!0),Bi.exports=function(e,t){if(!Ur(global.process))return function(){};Pv.equal(typeof e,"function","a callback must be provided for exit handler"),ki===!1&&Rp();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){mt.removeListener(n,e),mt.listeners("exit").length===0&&mt.listeners("afterexit").length===0&&Kc()};return mt.on(n,e),r},Kc=function(){!ki||!Ur(global.process)||(ki=!1,Fi.forEach(function(t){try{Ve.removeListener(t,Wc[t])}catch{}}),Ve.emit=zc,Ve.reallyExit=Ap,mt.count-=1)},Bi.exports.unload=Kc,Gr=function(t,n,r){mt.emitted[t]||(mt.emitted[t]=!0,mt.emit(t,n,r))},Wc={},Fi.forEach(function(e){Wc[e]=function(){if(Ur(global.process)){var n=Ve.listeners(e);n.length===mt.count&&(Kc(),Gr("exit",null,e),Gr("afterexit",null,e),Fv&&e==="SIGHUP"&&(e="SIGINT"),Ve.kill(Ve.pid,e))}}}),Bi.exports.signals=function(){return Fi},ki=!1,Rp=function(){ki||!Ur(global.process)||(ki=!0,mt.count+=1,Fi=Fi.filter(function(t){try{return Ve.on(t,Wc[t]),!0}catch{return!1}}),Ve.emit=Bv,Ve.reallyExit=kv)},Bi.exports.load=Rp,Ap=Ve.reallyExit,kv=function(t){Ur(global.process)&&(Ve.exitCode=t||0,Gr("exit",Ve.exitCode,null),Gr("afterexit",Ve.exitCode,null),Ap.call(Ve,Ve.exitCode))},zc=Ve.emit,Bv=function(t,n){if(t==="exit"&&Ur(global.process)){n!==void 0&&(Ve.exitCode=n);var r=zc.apply(this,arguments);return Gr("exit",Ve.exitCode,null),Gr("afterexit",Ve.exitCode,null),r}else return zc.apply(this,arguments)}):Bi.exports=function(){return function(){}};var Pv,Fi,Fv,ts,mt,Kc,Gr,Wc,ki,Rp,Ap,kv,zc,Bv});var Gv=f((M_e,Uv)=>{"use strict";l();var IY=require("os"),vY=Op(),xY=1e3*5,MY=(e,t="SIGTERM",n={})=>{let r=e(t);return wY(e,t,n,r),r},wY=(e,t,n,r)=>{if(!LY(t,n,r))return;let i=FY(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},LY=(e,{forceKillAfterTimeout:t},n)=>PY(e)&&t!==!1&&n,PY=e=>e===IY.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",FY=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return xY;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},kY=(e,t)=>{e.kill()&&(t.isCanceled=!0)},BY=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},UY=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((o,c)=>{i=setTimeout(()=>{BY(e,n,c)},t)}),s=r.finally(()=>{clearTimeout(i)});return Promise.race([a,s])},GY=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},HY=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let i=vY(()=>{e.kill()});return r.finally(()=>{i()})};Uv.exports={spawnedKill:MY,spawnedCancel:kY,setupTimeout:UY,validateTimeout:GY,setExitHandler:HY}});var Yv=f((L_e,Hv)=>{"use strict";l();var bn=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";bn.writable=e=>bn(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";bn.readable=e=>bn(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";bn.duplex=e=>bn.writable(e)&&bn.readable(e);bn.transform=e=>bn.duplex(e)&&typeof e._transform=="function";Hv.exports=bn});var Vv=f((F_e,qv)=>{"use strict";l();var{PassThrough:YY}=require("stream");qv.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",i=!1;t?i=!(n||r):n=n||"utf8",r&&(n=null);let a=new YY({objectMode:i});n&&a.setEncoding(n);let s=0,o=[];return a.on("data",c=>{o.push(c),i?s=o.length:s+=c.length}),a.getBufferedValue=()=>t?o:r?Buffer.concat(o,s):o.join(""),a.getBufferedLength=()=>s,a}});var yp=f((B_e,ns)=>{"use strict";l();var{constants:qY}=require("buffer"),VY=require("stream"),{promisify:$Y}=require("util"),KY=Vv(),WY=$Y(VY.pipeline),Qc=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Np(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=KY(t);return await new Promise((i,a)=>{let s=o=>{o&&r.getBufferedLength()<=qY.MAX_LENGTH&&(o.bufferedData=r.getBufferedValue()),a(o)};(async()=>{try{await WY(e,r),i()}catch(o){s(o)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new Qc)})}),r.getBufferedValue()}ns.exports=Np;ns.exports.buffer=(e,t)=>Np(e,{...t,encoding:"buffer"});ns.exports.array=(e,t)=>Np(e,{...t,array:!0});ns.exports.MaxBufferError=Qc});var Ip=f((G_e,$v)=>{"use strict";l();var{PassThrough:zY}=require("stream");$v.exports=function(){var e=[],t=new zY({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),t;function n(a){return Array.isArray(a)?(a.forEach(n),this):(e.push(a),a.once("end",i.bind(null,a)),a.once("error",t.emit.bind(t,"error")),a.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(a){e=e.filter(function(s){return s!==a}),!e.length&&t.readable&&t.end()}}});var Qv=f((Y_e,zv)=>{"use strict";l();var Wv=Yv(),Kv=yp(),QY=Ip(),XY=(e,t)=>{t===void 0||e.stdin===void 0||(Wv(t)?t.pipe(e.stdin):e.stdin.end(t))},JY=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=QY();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},vp=async(e,t)=>{if(e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},xp=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?Kv(e,{encoding:t,maxBuffer:r}):Kv.buffer(e,{maxBuffer:r})},jY=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},s)=>{let o=xp(e,{encoding:r,buffer:i,maxBuffer:a}),c=xp(t,{encoding:r,buffer:i,maxBuffer:a}),u=xp(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([s,o,c,u])}catch(d){return Promise.all([{error:d,signal:d.signal,timedOut:d.timedOut},vp(e,o),vp(t,c),vp(n,u)])}},ZY=({input:e})=>{if(Wv(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};zv.exports={handleInput:XY,makeAllStream:JY,getSpawnedResult:jY,validateInputSync:ZY}});var Jv=f((V_e,Xv)=>{"use strict";l();var eq=(async()=>{})().constructor.prototype,tq=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(eq,e)]),nq=(e,t)=>{for(let[n,r]of tq){let i=typeof t=="function"?(...a)=>Reflect.apply(r.value,t(),a):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}return e},rq=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});Xv.exports={mergePromise:nq,getSpawnedPromise:rq}});var ex=f((K_e,Zv)=>{"use strict";l();var jv=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],iq=/^[\w.-]+$/,aq=/"/g,sq=e=>typeof e!="string"||iq.test(e)?e:`"${e.replace(aq,'\\"')}"`,oq=(e,t)=>jv(e,t).join(" "),lq=(e,t)=>jv(e,t).map(n=>sq(n)).join(" "),cq=/ +/g,uq=e=>{let t=[];for(let n of e.trim().split(cq)){let r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};Zv.exports={joinCommand:oq,getEscapedCommand:lq,parseCommand:uq}});var ox=f((z_e,Ui)=>{"use strict";l();var dq=require("path"),Mp=require("child_process"),_q=hp(),mq=fv(),pq=Tv(),Eq=Cv(),Xc=xv(),nx=wv(),{spawnedKill:fq,spawnedCancel:gq,setupTimeout:Sq,validateTimeout:Tq,setExitHandler:hq}=Gv(),{handleInput:bq,getSpawnedResult:Dq,makeAllStream:Cq,validateInputSync:Rq}=Qv(),{mergePromise:tx,getSpawnedPromise:Aq}=Jv(),{joinCommand:rx,parseCommand:ix,getEscapedCommand:ax}=ex(),Oq=1e3*1e3*100,Nq=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...process.env,...e}:e;return n?pq.env({env:a,cwd:r,execPath:i}):a},sx=(e,t,n={})=>{let r=_q._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:Oq,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=Nq(n),n.stdio=nx(n),process.platform==="win32"&&dq.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},rs=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?mq(t):t,Jc=(e,t,n)=>{let r=sx(e,t,n),i=rx(e,t),a=ax(e,t);Tq(r.options);let s;try{s=Mp.spawn(r.file,r.args,r.options)}catch(g){let T=new Mp.ChildProcess,N=Promise.reject(Xc({error:g,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return tx(T,N)}let o=Aq(s),c=Sq(s,r.options,o),u=hq(s,r.options,c),d={isCanceled:!1};s.kill=fq.bind(null,s.kill.bind(s)),s.cancel=gq.bind(null,s,d);let S=Eq(async()=>{let[{error:g,exitCode:T,signal:N,timedOut:w},k,M,B]=await Dq(s,r.options,u),Y=rs(r.options,k),re=rs(r.options,M),Q=rs(r.options,B);if(g||T!==0||N!==null){let ae=Xc({error:g,exitCode:T,signal:N,stdout:Y,stderr:re,all:Q,command:i,escapedCommand:a,parsed:r,timedOut:w,isCanceled:d.isCanceled,killed:s.killed});if(!r.options.reject)return ae;throw ae}return{command:i,escapedCommand:a,exitCode:0,stdout:Y,stderr:re,all:Q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return bq(s,r.options.input),s.all=Cq(s,r.options),tx(s,S)};Ui.exports=Jc;Ui.exports.sync=(e,t,n)=>{let r=sx(e,t,n),i=rx(e,t),a=ax(e,t);Rq(r.options);let s;try{s=Mp.spawnSync(r.file,r.args,r.options)}catch(u){throw Xc({error:u,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let o=rs(r.options,s.stdout,s.error),c=rs(r.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let u=Xc({stdout:o,stderr:c,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:a,parsed:r,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!r.options.reject)return u;throw u}return{command:i,escapedCommand:a,exitCode:0,stdout:o,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};Ui.exports.command=(e,t)=>{let[n,...r]=ix(e);return Jc(n,r,t)};Ui.exports.commandSync=(e,t)=>{let[n,...r]=ix(e);return Jc.sync(n,r,t)};Ui.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);let r=nx.node(n),i=process.execArgv.filter(o=>!o.startsWith("--inspect")),{nodePath:a=process.execPath,nodeOptions:s=i}=n;return Jc(a,[...s,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})}});var TM=f((lEe,SM)=>{"use strict";l();var hV=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function mu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pt=SM.exports={},Vi=function(t){return function(n,r){return"#".repeat(t)+" "+r(n)}},sE=function e(t,n,r){var i=t;return typeof t=="string"&&(i=t.split(`
63
+ `);return w?(r.originalMessage=r.message,r.message=M):r=new Error(M),r.shortMessage=k,r.command=s,r.escapedCommand=o,r.exitCode=a,r.signal=i,r.signalDescription=S,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=u,r.killed=d&&!c,r};vv.exports=NY});var wv=f((N_e,Cp)=>{"use strict";l();var Vc=["stdin","stdout","stderr"],yY=e=>Vc.some(t=>e[t]!==void 0),Mv=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Vc.map(r=>e[r]);if(yY(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Vc.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,Vc.length);return Array.from({length:n},(r,i)=>t[i])};Cp.exports=Mv;Cp.exports.node=e=>{let t=Mv(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}});var Lv=f((I_e,$c)=>{"use strict";l();$c.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&$c.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&$c.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Op=f((x_e,Bi)=>{"use strict";l();var Ve=global.process,Ur=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Ur(Ve)?(Pv=require("assert"),Fi=Lv(),Fv=/^win/i.test(Ve.platform),ts=require("events"),typeof ts!="function"&&(ts=ts.EventEmitter),Ve.__signal_exit_emitter__?mt=Ve.__signal_exit_emitter__:(mt=Ve.__signal_exit_emitter__=new ts,mt.count=0,mt.emitted={}),mt.infinite||(mt.setMaxListeners(1/0),mt.infinite=!0),Bi.exports=function(e,t){if(!Ur(global.process))return function(){};Pv.equal(typeof e,"function","a callback must be provided for exit handler"),ki===!1&&Rp();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){mt.removeListener(n,e),mt.listeners("exit").length===0&&mt.listeners("afterexit").length===0&&Kc()};return mt.on(n,e),r},Kc=function(){!ki||!Ur(global.process)||(ki=!1,Fi.forEach(function(t){try{Ve.removeListener(t,Wc[t])}catch{}}),Ve.emit=zc,Ve.reallyExit=Ap,mt.count-=1)},Bi.exports.unload=Kc,Gr=function(t,n,r){mt.emitted[t]||(mt.emitted[t]=!0,mt.emit(t,n,r))},Wc={},Fi.forEach(function(e){Wc[e]=function(){if(Ur(global.process)){var n=Ve.listeners(e);n.length===mt.count&&(Kc(),Gr("exit",null,e),Gr("afterexit",null,e),Fv&&e==="SIGHUP"&&(e="SIGINT"),Ve.kill(Ve.pid,e))}}}),Bi.exports.signals=function(){return Fi},ki=!1,Rp=function(){ki||!Ur(global.process)||(ki=!0,mt.count+=1,Fi=Fi.filter(function(t){try{return Ve.on(t,Wc[t]),!0}catch{return!1}}),Ve.emit=Bv,Ve.reallyExit=kv)},Bi.exports.load=Rp,Ap=Ve.reallyExit,kv=function(t){Ur(global.process)&&(Ve.exitCode=t||0,Gr("exit",Ve.exitCode,null),Gr("afterexit",Ve.exitCode,null),Ap.call(Ve,Ve.exitCode))},zc=Ve.emit,Bv=function(t,n){if(t==="exit"&&Ur(global.process)){n!==void 0&&(Ve.exitCode=n);var r=zc.apply(this,arguments);return Gr("exit",Ve.exitCode,null),Gr("afterexit",Ve.exitCode,null),r}else return zc.apply(this,arguments)}):Bi.exports=function(){return function(){}};var Pv,Fi,Fv,ts,mt,Kc,Gr,Wc,ki,Rp,Ap,kv,zc,Bv});var Gv=f((w_e,Uv)=>{"use strict";l();var IY=require("os"),vY=Op(),xY=1e3*5,MY=(e,t="SIGTERM",n={})=>{let r=e(t);return wY(e,t,n,r),r},wY=(e,t,n,r)=>{if(!LY(t,n,r))return;let i=FY(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},LY=(e,{forceKillAfterTimeout:t},n)=>PY(e)&&t!==!1&&n,PY=e=>e===IY.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",FY=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return xY;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},kY=(e,t)=>{e.kill()&&(t.isCanceled=!0)},BY=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},UY=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((o,c)=>{i=setTimeout(()=>{BY(e,n,c)},t)}),s=r.finally(()=>{clearTimeout(i)});return Promise.race([a,s])},GY=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},HY=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let i=vY(()=>{e.kill()});return r.finally(()=>{i()})};Uv.exports={spawnedKill:MY,spawnedCancel:kY,setupTimeout:UY,validateTimeout:GY,setExitHandler:HY}});var Yv=f((P_e,Hv)=>{"use strict";l();var bn=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";bn.writable=e=>bn(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";bn.readable=e=>bn(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";bn.duplex=e=>bn.writable(e)&&bn.readable(e);bn.transform=e=>bn.duplex(e)&&typeof e._transform=="function";Hv.exports=bn});var Vv=f((k_e,qv)=>{"use strict";l();var{PassThrough:YY}=require("stream");qv.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",i=!1;t?i=!(n||r):n=n||"utf8",r&&(n=null);let a=new YY({objectMode:i});n&&a.setEncoding(n);let s=0,o=[];return a.on("data",c=>{o.push(c),i?s=o.length:s+=c.length}),a.getBufferedValue=()=>t?o:r?Buffer.concat(o,s):o.join(""),a.getBufferedLength=()=>s,a}});var yp=f((U_e,ns)=>{"use strict";l();var{constants:qY}=require("buffer"),VY=require("stream"),{promisify:$Y}=require("util"),KY=Vv(),WY=$Y(VY.pipeline),Qc=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Np(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=KY(t);return await new Promise((i,a)=>{let s=o=>{o&&r.getBufferedLength()<=qY.MAX_LENGTH&&(o.bufferedData=r.getBufferedValue()),a(o)};(async()=>{try{await WY(e,r),i()}catch(o){s(o)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new Qc)})}),r.getBufferedValue()}ns.exports=Np;ns.exports.buffer=(e,t)=>Np(e,{...t,encoding:"buffer"});ns.exports.array=(e,t)=>Np(e,{...t,array:!0});ns.exports.MaxBufferError=Qc});var Ip=f((H_e,$v)=>{"use strict";l();var{PassThrough:zY}=require("stream");$v.exports=function(){var e=[],t=new zY({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),t;function n(a){return Array.isArray(a)?(a.forEach(n),this):(e.push(a),a.once("end",i.bind(null,a)),a.once("error",t.emit.bind(t,"error")),a.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(a){e=e.filter(function(s){return s!==a}),!e.length&&t.readable&&t.end()}}});var Qv=f((q_e,zv)=>{"use strict";l();var Wv=Yv(),Kv=yp(),QY=Ip(),XY=(e,t)=>{t===void 0||e.stdin===void 0||(Wv(t)?t.pipe(e.stdin):e.stdin.end(t))},JY=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=QY();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},vp=async(e,t)=>{if(e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},xp=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?Kv(e,{encoding:t,maxBuffer:r}):Kv.buffer(e,{maxBuffer:r})},jY=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},s)=>{let o=xp(e,{encoding:r,buffer:i,maxBuffer:a}),c=xp(t,{encoding:r,buffer:i,maxBuffer:a}),u=xp(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([s,o,c,u])}catch(d){return Promise.all([{error:d,signal:d.signal,timedOut:d.timedOut},vp(e,o),vp(t,c),vp(n,u)])}},ZY=({input:e})=>{if(Wv(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};zv.exports={handleInput:XY,makeAllStream:JY,getSpawnedResult:jY,validateInputSync:ZY}});var Jv=f(($_e,Xv)=>{"use strict";l();var eq=(async()=>{})().constructor.prototype,tq=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(eq,e)]),nq=(e,t)=>{for(let[n,r]of tq){let i=typeof t=="function"?(...a)=>Reflect.apply(r.value,t(),a):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}return e},rq=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});Xv.exports={mergePromise:nq,getSpawnedPromise:rq}});var ex=f((W_e,Zv)=>{"use strict";l();var jv=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],iq=/^[\w.-]+$/,aq=/"/g,sq=e=>typeof e!="string"||iq.test(e)?e:`"${e.replace(aq,'\\"')}"`,oq=(e,t)=>jv(e,t).join(" "),lq=(e,t)=>jv(e,t).map(n=>sq(n)).join(" "),cq=/ +/g,uq=e=>{let t=[];for(let n of e.trim().split(cq)){let r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};Zv.exports={joinCommand:oq,getEscapedCommand:lq,parseCommand:uq}});var ox=f((Q_e,Ui)=>{"use strict";l();var dq=require("path"),Mp=require("child_process"),_q=hp(),mq=fv(),pq=Tv(),Eq=Cv(),Xc=xv(),nx=wv(),{spawnedKill:fq,spawnedCancel:gq,setupTimeout:Sq,validateTimeout:Tq,setExitHandler:hq}=Gv(),{handleInput:bq,getSpawnedResult:Dq,makeAllStream:Cq,validateInputSync:Rq}=Qv(),{mergePromise:tx,getSpawnedPromise:Aq}=Jv(),{joinCommand:rx,parseCommand:ix,getEscapedCommand:ax}=ex(),Oq=1e3*1e3*100,Nq=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...process.env,...e}:e;return n?pq.env({env:a,cwd:r,execPath:i}):a},sx=(e,t,n={})=>{let r=_q._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:Oq,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=Nq(n),n.stdio=nx(n),process.platform==="win32"&&dq.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},rs=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?mq(t):t,Jc=(e,t,n)=>{let r=sx(e,t,n),i=rx(e,t),a=ax(e,t);Tq(r.options);let s;try{s=Mp.spawn(r.file,r.args,r.options)}catch(g){let T=new Mp.ChildProcess,N=Promise.reject(Xc({error:g,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return tx(T,N)}let o=Aq(s),c=Sq(s,r.options,o),u=hq(s,r.options,c),d={isCanceled:!1};s.kill=fq.bind(null,s.kill.bind(s)),s.cancel=gq.bind(null,s,d);let S=Eq(async()=>{let[{error:g,exitCode:T,signal:N,timedOut:w},k,M,B]=await Dq(s,r.options,u),Y=rs(r.options,k),re=rs(r.options,M),Q=rs(r.options,B);if(g||T!==0||N!==null){let ae=Xc({error:g,exitCode:T,signal:N,stdout:Y,stderr:re,all:Q,command:i,escapedCommand:a,parsed:r,timedOut:w,isCanceled:d.isCanceled,killed:s.killed});if(!r.options.reject)return ae;throw ae}return{command:i,escapedCommand:a,exitCode:0,stdout:Y,stderr:re,all:Q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return bq(s,r.options.input),s.all=Cq(s,r.options),tx(s,S)};Ui.exports=Jc;Ui.exports.sync=(e,t,n)=>{let r=sx(e,t,n),i=rx(e,t),a=ax(e,t);Rq(r.options);let s;try{s=Mp.spawnSync(r.file,r.args,r.options)}catch(u){throw Xc({error:u,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let o=rs(r.options,s.stdout,s.error),c=rs(r.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let u=Xc({stdout:o,stderr:c,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:a,parsed:r,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!r.options.reject)return u;throw u}return{command:i,escapedCommand:a,exitCode:0,stdout:o,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};Ui.exports.command=(e,t)=>{let[n,...r]=ix(e);return Jc(n,r,t)};Ui.exports.commandSync=(e,t)=>{let[n,...r]=ix(e);return Jc.sync(n,r,t)};Ui.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);let r=nx.node(n),i=process.execArgv.filter(o=>!o.startsWith("--inspect")),{nodePath:a=process.execPath,nodeOptions:s=i}=n;return Jc(a,[...s,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})}});var TM=f((cEe,SM)=>{"use strict";l();var hV=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function mu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pt=SM.exports={},Vi=function(t){return function(n,r){return"#".repeat(t)+" "+r(n)}},sE=function e(t,n,r){var i=t;return typeof t=="string"&&(i=t.split(`
64
64
  `)),r?i.length<=1?i.join(`
65
65
  `):i[0]+`
66
66
  `+e(i.slice(1),n,!1):i.map(function(a){return" ".repeat(n)+a}).join(`
@@ -73,12 +73,12 @@ ${r.message}`:N,M=[k,t,e].filter(Boolean).join(`
73
73
  `):n+=e.content,n+="\n```",n};pt.p=function(e,t){return us(t(e,`
74
74
  `))};pt.table=function(e,t){var n,r={CENTER:"center",RIGHT:"right",LEFT:"left",NONE:"none"},i=(n={},mu(n,r.CENTER,3),mu(n,r.RIGHT,2),mu(n,r.LEFT,2),mu(n,r.NONE,1),n);if((typeof e>"u"?"undefined":hV(e))!=="object"||!e.hasOwnProperty("headers")||!e.hasOwnProperty("rows"))return"";var a=e.headers.map(function(k,M){return e.aligns&&e.aligns[M]?e.aligns[M]:r.NONE}),s=e.headers.map(function(k,M){return Math.max(i[a[M]],k.length-2)});e.pretty===!0&&e.rows.forEach(function(k){(Array.isArray(k)?k:e.headers.map(function(M){return k[M]})).forEach(function(M,B){s[B]=Math.max(s[B],M.length-2)})});var o=function(M,B){return" ".repeat(M)+B},c=function(M,B){return B+" ".repeat(M)},u=function(M,B){return" ".repeat(Math.floor(M/2))+B+" ".repeat(Math.ceil(M/2))},d=function(M,B){var Y=s[B]+2-M.length;switch(a[B]){case r.RIGHT:return o(Y,M);case r.LEFT:return c(Y,M);case r.CENTER:case r.NONE:default:return u(Y,M)}},p=function(M,B){var Y=s[B]+2-M.length;switch(a[B]){case r.RIGHT:return o(Y,M);case r.NONE:case r.LEFT:return c(Y,M);case r.CENTER:default:return u(Y,M)}},S=e.headers.map(d),g="| "+S.join(" | ")+" |",T="| "+e.headers.map(function(k,M){var B="-".repeat(s[M]);switch(a[M]){case r.CENTER:return":"+B+":";case r.RIGHT:return"-"+B+":";case r.LEFT:return":"+B+"-";case r.NONE:default:return"-"+B+"-"}}).join(" | ")+" |",N=function(M,B){return e.pretty!==!0?M:p(M,B)},w=e.rows.map(function(k){return"| "+(Array.isArray(k)?k:e.headers.map(function(M){return k[M]})).map(function(M){return t(M)}).map(function(M){return us(M)}).map(function(M){return M.replace(/([^\\])\|/,"$1\\|")}).map(function(M){return M.trim()}).map(N).join(" | ")+" |"}).join(`
75
75
  `);return[g,T,w].join(`
76
- `)};pt.link=function(e,t){return Array.isArray(e)?t(e,"","link"):typeof e=="string"?pt.link({source:e,title:""}):"["+e.title+"]("+e.source+")"};pt.hr=function(e,t){return"---"}});var bM=f((uEe,hM)=>{"use strict";l();function bV(e,t,n){return n=typeof n!="string"?" ":n,String(e).replace(/^/gm,n.repeat(t))}hM.exports=bV});var CM=f((_Ee,DM)=>{"use strict";l();var pu=TM(),Hr=bM();function pr(e,t,n){if(t=t||"",typeof e=="string"||typeof e=="number")return Hr(e,1,t);var r=[];if(Array.isArray(e)){for(var i=0;i<e.length;++i)r.push(Hr(pr(e[i],"",n),1,t));return r.join(`
76
+ `)};pt.link=function(e,t){return Array.isArray(e)?t(e,"","link"):typeof e=="string"?pt.link({source:e,title:""}):"["+e.title+"]("+e.source+")"};pt.hr=function(e,t){return"---"}});var bM=f((dEe,hM)=>{"use strict";l();function bV(e,t,n){return n=typeof n!="string"?" ":n,String(e).replace(/^/gm,n.repeat(t))}hM.exports=bV});var CM=f((mEe,DM)=>{"use strict";l();var pu=TM(),Hr=bM();function pr(e,t,n){if(t=t||"",typeof e=="string"||typeof e=="number")return Hr(e,1,t);var r=[];if(Array.isArray(e)){for(var i=0;i<e.length;++i)r.push(Hr(pr(e[i],"",n),1,t));return r.join(`
77
77
  `)}else if(n){var a="",s=pu[n||type];if(typeof s=="function")a+=Hr(s(n?e:e[type],pr),1,t)+`
78
78
  `;else throw new Error("There is no such converter: "+type);return a}else{var o="";return Object.keys(e).forEach(function(c,u,d){var p=pu[n||c];if(typeof p=="function")o+=Hr(p(n?e:e[c],pr),1,t)+`
79
79
  `;else throw new Error("There is no such converter: "+c)}),o}}pr.async=function(e,t,n){return Promise.resolve().then(function(){if(t=t||"",typeof e=="string"||typeof e=="number")return Hr(e,1,t);var r=[];if(Array.isArray(e)){var i=e.map(function(o,c){return Promise.resolve().then(function(){return pr.async(o,"",n)}).then(function(u){return Hr(u,1,t)}).then(function(u){r[c]=u})});return Promise.all(i).then(function(){return r.join(`
80
80
  `)})}else{var a=Object.keys(e)[0],s=pu[n||a];if(typeof s=="function")return Promise.resolve().then(function(){return s(n?e:e[a],pr)}).then(function(o){return Hr(o,1,t)+`
81
- `});throw new Error("There is no such converter: "+a)}})};pr.converters=pu;DM.exports=pr});var DV={};pE(DV,{pkg:()=>du});module.exports=Yw(DV);l();var NM=Z(require("update-notifier"));l();var vE=Z(IE(),1),{program:GV,createCommand:HV,createArgument:YV,createOption:qV,CommanderError:VV,InvalidArgumentError:$V,InvalidOptionArgumentError:KV,Command:Oe,Argument:WV,Option:qn,Help:zV}=vE.default;var vu={};pE(vu,{author:()=>dL,bin:()=>hL,bugs:()=>_L,default:()=>CL,dependencies:()=>bL,description:()=>lL,devDependencies:()=>SL,engines:()=>DL,files:()=>TL,homepage:()=>cL,keywords:()=>EL,license:()=>uL,name:()=>oL,publishConfig:()=>pL,repository:()=>mL,scripts:()=>gL,sideEffects:()=>fL,version:()=>xu});var oL="@e2b/cli",xu="1.0.4",lL="CLI for managing e2b sandbox templates",cL="https://e2b.dev",uL="MIT",dL={name:"FoundryLabs, Inc.",email:"hello@e2b.dev",url:"https://e2b.dev"},_L="https://github.com/e2b-dev/e2b/issues",mL={type:"git",url:"https://github.com/e2b-dev/e2b",directory:"packages/cli"},pL={access:"public"},EL=["e2b","ai-agents","agents","ai","code-interpreter","sandbox","code","cli","runtime","vm","nodejs","javascript","typescript"],fL=!1,gL={prepublishOnly:"pnpm build",build:"tsc --noEmit --skipLibCheck && tsup --minify",dev:"tsup --watch",test:"pnpm build && cd testground/demo-basic && ../../dist/index.js template build","check-deps":"knip","update-deps":"ncu -u && pnpm i","generate-api-reference":"./scripts/generate_api_ref.sh"},SL={"@types/command-exists":"^1.2.3","@types/inquirer":"^9.0.7","@types/json2md":"^1.5.4","@types/node":"^18.18.6","@types/update-notifier":"6.0.5",json2md:"^2.0.1",knip:"^2.33.4","npm-check-updates":"^16.14.6",tsup:"^7.2.0",typescript:"^5.2.2"},TL=["dist","LICENSE","README","package.json"],hL={e2b:"dist/index.js"},bL={"@iarna/toml":"^2.2.5","async-listen":"^3.0.1",boxen:"^7.1.1",chalk:"^5.3.0","cli-highlight":"^2.1.11","command-exists":"^1.2.9",commander:"^11.1.0","console-table-printer":"^2.11.2",e2b:"^1.0.1",inquirer:"^9.2.12",open:"^9.1.0","strip-ansi":"^7.1.0","update-notifier":"5.1.0",yup:"^1.3.2"},DL={node:">=18"},CL={name:oL,version:xu,description:lL,homepage:cL,license:uL,author:dL,bugs:_L,repository:mL,publishConfig:pL,keywords:EL,sideEffects:fL,scripts:gL,devDependencies:SL,files:TL,bin:hL,dependencies:bL,engines:DL};l();l();l();l();var xE=(e=0)=>t=>`\x1B[${t+e}m`,ME=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,wE=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,Ye={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},XV=Object.keys(Ye.modifier),RL=Object.keys(Ye.color),AL=Object.keys(Ye.bgColor),JV=[...RL,...AL];function OL(){let e=new Map;for(let[t,n]of Object.entries(Ye)){for(let[r,i]of Object.entries(n))Ye[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[r]=Ye[r],e.set(i[0],i[1]);Object.defineProperty(Ye,t,{value:n,enumerable:!1})}return Object.defineProperty(Ye,"codes",{value:e,enumerable:!1}),Ye.color.close="\x1B[39m",Ye.bgColor.close="\x1B[49m",Ye.color.ansi=xE(),Ye.color.ansi256=ME(),Ye.color.ansi16m=wE(),Ye.bgColor.ansi=xE(10),Ye.bgColor.ansi256=ME(10),Ye.bgColor.ansi16m=wE(10),Object.defineProperties(Ye,{rgbToAnsi256:{value(t,n,r){return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(a=>a+a).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>Ye.rgbToAnsi256(...Ye.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,i;if(t>=232)n=((t-232)*10+8)/255,r=n,i=n;else{t-=16;let o=t%36;n=Math.floor(t/36)/5,r=Math.floor(o/6)/5,i=o%6/5}let a=Math.max(n,r,i)*2;if(a===0)return 30;let s=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(n));return a===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>Ye.ansi256ToAnsi(Ye.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>Ye.ansi256ToAnsi(Ye.hexToAnsi256(t)),enumerable:!1}}),Ye}var NL=OL(),tn=NL;l();var gs=Z(require("process"),1),PE=Z(require("os"),1),Mu=Z(require("tty"),1);function qt(e,t=globalThis.Deno?globalThis.Deno.args:gs.default.argv){let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:We}=gs.default,fs;qt("no-color")||qt("no-colors")||qt("color=false")||qt("color=never")?fs=0:(qt("color")||qt("colors")||qt("color=true")||qt("color=always"))&&(fs=1);function yL(){if("FORCE_COLOR"in We)return We.FORCE_COLOR==="true"?1:We.FORCE_COLOR==="false"?0:We.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(We.FORCE_COLOR,10),3)}function IL(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function vL(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=yL();r!==void 0&&(fs=r);let i=n?fs:r;if(i===0)return 0;if(n){if(qt("color=16m")||qt("color=full")||qt("color=truecolor"))return 3;if(qt("color=256"))return 2}if("TF_BUILD"in We&&"AGENT_NAME"in We)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(We.TERM==="dumb")return a;if(gs.default.platform==="win32"){let s=PE.default.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in We)return"GITHUB_ACTIONS"in We||"GITEA_ACTIONS"in We?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in We)||We.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in We)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(We.TEAMCITY_VERSION)?1:0;if(We.COLORTERM==="truecolor"||We.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in We){let s=Number.parseInt((We.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(We.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(We.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(We.TERM)||"COLORTERM"in We?1:a}function LE(e,t={}){let n=vL(e,{streamIsTTY:e&&e.isTTY,...t});return IL(n)}var xL={stdout:LE({isTTY:Mu.default.isatty(1)}),stderr:LE({isTTY:Mu.default.isatty(2)})},FE=xL;l();function kE(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,s="";do s+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return s+=e.slice(a),s}function BE(e,t,n,r){let i=0,a="";do{let s=e[r-1]==="\r";a+=e.slice(i,s?r-1:r)+t+(s?`\r
81
+ `});throw new Error("There is no such converter: "+a)}})};pr.converters=pu;DM.exports=pr});var DV={};pE(DV,{pkg:()=>du});module.exports=Yw(DV);l();var NM=Z(require("update-notifier"));l();var vE=Z(IE(),1),{program:GV,createCommand:HV,createArgument:YV,createOption:qV,CommanderError:VV,InvalidArgumentError:$V,InvalidOptionArgumentError:KV,Command:Oe,Argument:WV,Option:qn,Help:zV}=vE.default;var vu={};pE(vu,{author:()=>dL,bin:()=>hL,bugs:()=>_L,default:()=>CL,dependencies:()=>bL,description:()=>lL,devDependencies:()=>SL,engines:()=>DL,files:()=>TL,homepage:()=>cL,keywords:()=>EL,license:()=>uL,name:()=>oL,publishConfig:()=>pL,repository:()=>mL,scripts:()=>gL,sideEffects:()=>fL,version:()=>xu});var oL="@e2b/cli",xu="1.0.5",lL="CLI for managing e2b sandbox templates",cL="https://e2b.dev",uL="MIT",dL={name:"FoundryLabs, Inc.",email:"hello@e2b.dev",url:"https://e2b.dev"},_L="https://github.com/e2b-dev/e2b/issues",mL={type:"git",url:"https://github.com/e2b-dev/e2b",directory:"packages/cli"},pL={access:"public"},EL=["e2b","ai-agents","agents","ai","code-interpreter","sandbox","code","cli","runtime","vm","nodejs","javascript","typescript"],fL=!1,gL={prepublishOnly:"pnpm build",build:"tsc --noEmit --skipLibCheck && tsup --minify",dev:"tsup --watch",test:"pnpm build && cd testground/demo-basic && ../../dist/index.js template build","check-deps":"knip","update-deps":"ncu -u && pnpm i","generate-api-reference":"./scripts/generate_api_ref.sh"},SL={"@types/command-exists":"^1.2.3","@types/inquirer":"^9.0.7","@types/json2md":"^1.5.4","@types/node":"^18.18.6","@types/update-notifier":"6.0.5",json2md:"^2.0.1",knip:"^2.33.4","npm-check-updates":"^16.14.6",tsup:"^7.2.0",typescript:"^5.2.2"},TL=["dist","LICENSE","README","package.json"],hL={e2b:"dist/index.js"},bL={"@iarna/toml":"^2.2.5","async-listen":"^3.0.1",boxen:"^7.1.1",chalk:"^5.3.0","cli-highlight":"^2.1.11","command-exists":"^1.2.9",commander:"^11.1.0","console-table-printer":"^2.11.2",e2b:"^1.0.1",inquirer:"^9.2.12",open:"^9.1.0","strip-ansi":"^7.1.0","update-notifier":"5.1.0",yup:"^1.3.2"},DL={node:">=18"},CL={name:oL,version:xu,description:lL,homepage:cL,license:uL,author:dL,bugs:_L,repository:mL,publishConfig:pL,keywords:EL,sideEffects:fL,scripts:gL,devDependencies:SL,files:TL,bin:hL,dependencies:bL,engines:DL};l();l();l();l();var xE=(e=0)=>t=>`\x1B[${t+e}m`,ME=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,wE=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,Ye={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},XV=Object.keys(Ye.modifier),RL=Object.keys(Ye.color),AL=Object.keys(Ye.bgColor),JV=[...RL,...AL];function OL(){let e=new Map;for(let[t,n]of Object.entries(Ye)){for(let[r,i]of Object.entries(n))Ye[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[r]=Ye[r],e.set(i[0],i[1]);Object.defineProperty(Ye,t,{value:n,enumerable:!1})}return Object.defineProperty(Ye,"codes",{value:e,enumerable:!1}),Ye.color.close="\x1B[39m",Ye.bgColor.close="\x1B[49m",Ye.color.ansi=xE(),Ye.color.ansi256=ME(),Ye.color.ansi16m=wE(),Ye.bgColor.ansi=xE(10),Ye.bgColor.ansi256=ME(10),Ye.bgColor.ansi16m=wE(10),Object.defineProperties(Ye,{rgbToAnsi256:{value(t,n,r){return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(a=>a+a).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>Ye.rgbToAnsi256(...Ye.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,i;if(t>=232)n=((t-232)*10+8)/255,r=n,i=n;else{t-=16;let o=t%36;n=Math.floor(t/36)/5,r=Math.floor(o/6)/5,i=o%6/5}let a=Math.max(n,r,i)*2;if(a===0)return 30;let s=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(n));return a===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>Ye.ansi256ToAnsi(Ye.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>Ye.ansi256ToAnsi(Ye.hexToAnsi256(t)),enumerable:!1}}),Ye}var NL=OL(),tn=NL;l();var gs=Z(require("process"),1),PE=Z(require("os"),1),Mu=Z(require("tty"),1);function qt(e,t=globalThis.Deno?globalThis.Deno.args:gs.default.argv){let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:We}=gs.default,fs;qt("no-color")||qt("no-colors")||qt("color=false")||qt("color=never")?fs=0:(qt("color")||qt("colors")||qt("color=true")||qt("color=always"))&&(fs=1);function yL(){if("FORCE_COLOR"in We)return We.FORCE_COLOR==="true"?1:We.FORCE_COLOR==="false"?0:We.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(We.FORCE_COLOR,10),3)}function IL(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function vL(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=yL();r!==void 0&&(fs=r);let i=n?fs:r;if(i===0)return 0;if(n){if(qt("color=16m")||qt("color=full")||qt("color=truecolor"))return 3;if(qt("color=256"))return 2}if("TF_BUILD"in We&&"AGENT_NAME"in We)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(We.TERM==="dumb")return a;if(gs.default.platform==="win32"){let s=PE.default.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in We)return"GITHUB_ACTIONS"in We||"GITEA_ACTIONS"in We?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in We)||We.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in We)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(We.TEAMCITY_VERSION)?1:0;if(We.COLORTERM==="truecolor"||We.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in We){let s=Number.parseInt((We.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(We.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(We.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(We.TERM)||"COLORTERM"in We?1:a}function LE(e,t={}){let n=vL(e,{streamIsTTY:e&&e.isTTY,...t});return IL(n)}var xL={stdout:LE({isTTY:Mu.default.isatty(1)}),stderr:LE({isTTY:Mu.default.isatty(2)})},FE=xL;l();function kE(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,s="";do s+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return s+=e.slice(a),s}function BE(e,t,n,r){let i=0,a="";do{let s=e[r-1]==="\r";a+=e.slice(i,s?r-1:r)+t+(s?`\r
82
82
  `:`
83
83
  `)+n,i=r+1,r=e.indexOf(`
84
84
  `,i)}while(r!==-1);return a+=e.slice(i),a}var{stdout:UE,stderr:GE}=FE,wu=Symbol("GENERATOR"),Yr=Symbol("STYLER"),zi=Symbol("IS_EMPTY"),HE=["ansi","ansi","ansi256","ansi16m"],qr=Object.create(null),ML=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=UE?UE.level:0;e.level=t.level===void 0?n:t.level};var wL=e=>{let t=(...n)=>n.join(" ");return ML(t,e),Object.setPrototypeOf(t,Qi.prototype),t};function Qi(e){return wL(e)}Object.setPrototypeOf(Qi.prototype,Function.prototype);for(let[e,t]of Object.entries(tn))qr[e]={get(){let n=Ss(this,Pu(t.open,t.close,this[Yr]),this[zi]);return Object.defineProperty(this,e,{value:n}),n}};qr.visible={get(){let e=Ss(this,this[Yr],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Lu=(e,t,n,...r)=>e==="rgb"?t==="ansi16m"?tn[n].ansi16m(...r):t==="ansi256"?tn[n].ansi256(tn.rgbToAnsi256(...r)):tn[n].ansi(tn.rgbToAnsi(...r)):e==="hex"?Lu("rgb",t,n,...tn.hexToRgb(...r)):tn[n][e](...r),LL=["rgb","hex","ansi256"];for(let e of LL){qr[e]={get(){let{level:n}=this;return function(...r){let i=Pu(Lu(e,HE[n],"color",...r),tn.color.close,this[Yr]);return Ss(this,i,this[zi])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);qr[t]={get(){let{level:n}=this;return function(...r){let i=Pu(Lu(e,HE[n],"bgColor",...r),tn.bgColor.close,this[Yr]);return Ss(this,i,this[zi])}}}}var PL=Object.defineProperties(()=>{},{...qr,level:{enumerable:!0,get(){return this[wu].level},set(e){this[wu].level=e}}}),Pu=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},Ss=(e,t,n)=>{let r=(...i)=>FL(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,PL),r[wu]=e,r[Yr]=t,r[zi]=n,r},FL=(e,t)=>{if(e.level<=0||!t)return e[zi]?"":t;let n=e[Yr];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes("\x1B"))for(;n!==void 0;)t=kE(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
@@ -94,15 +94,15 @@ ${r.message}`:N,M=[k,t,e].filter(Boolean).join(`
94
94
  `),N=Math.max(...T.map(w=>dt(w)));for(let w of T){let k;switch(r){case"center":{k=It.repeat((o-N)/2)+w;break}case"right":{k=It.repeat(o-N)+w;break}default:{k=w;break}}d.push(k)}}a=d}r==="center"&&s<o?a=a.map(d=>It.repeat((o-s)/2)+d):r==="right"&&s<o&&(a=a.map(d=>It.repeat(o-s)+d));let c=It.repeat(t.left),u=It.repeat(t.right);return a=a.map(d=>c+d+u),a=a.map(d=>{if(n-dt(d)>0)switch(r){case"center":return d+It.repeat(n-dt(d));case"right":return d+It.repeat(n-dt(d));default:return d+It.repeat(n-dt(d))}return d}),t.top>0&&(a=[...Array.from({length:t.top}).fill(It.repeat(n)),...a]),t.bottom>0&&(a=[...a,...Array.from({length:t.bottom}).fill(It.repeat(n))]),i&&a.length>i?a=a.slice(0,i):i&&a.length<i&&(a=[...a,...Array.from({length:i-a.length}).fill(It.repeat(n))]),a.join(nr)},g6=(e,t,n)=>{let r=d=>{let p=n.borderColor?h6(n.borderColor)(d):d;return n.dimBorder?ye.dim(p):p},i=d=>n.backgroundColor?b6(n.backgroundColor)(d):d,a=p6(n.borderStyle),s=PA(),o=It.repeat(n.margin.left);if(n.float==="center"){let d=Math.max((s-t-Da(n.borderStyle))/2,0);o=It.repeat(d)}else if(n.float==="right"){let d=Math.max(s-t-n.margin.right-Da(n.borderStyle),0);o=It.repeat(d)}let c="";n.margin.top&&(c+=nr.repeat(n.margin.top)),(n.borderStyle!==ba||n.title)&&(c+=r(o+a.topLeft+(n.title?E6(n.title,a.top.repeat(t),n.titleAlignment):a.top.repeat(t))+a.topRight)+nr);let u=e.split(nr);return c+=u.map(d=>o+r(a.left)+i(d)+r(a.right)).join(nr),n.borderStyle!==ba&&(c+=nr+r(o+a.bottomLeft+a.bottom.repeat(t)+a.bottomRight)),n.margin.bottom&&(c+=nr.repeat(n.margin.bottom)),c},S6=e=>{if(e.fullscreen&&ha.default?.stdout){let t=[ha.default.stdout.columns,ha.default.stdout.rows];typeof e.fullscreen=="function"&&(t=e.fullscreen(...t)),e.width||(e.width=t[0]),e.height||(e.height=t[1])}return e.width&&(e.width=Math.max(1,e.width-Da(e.borderStyle))),e.height&&(e.height=Math.max(1,e.height-Da(e.borderStyle))),e},MA=(e,t)=>t===ba?e:` ${e} `,T6=(e,t)=>{t=S6(t);let n=t.width!==void 0,r=PA(),i=Da(t.borderStyle),a=r-t.margin.left-t.margin.right-i,s=Ao(No(e,r-i,{hard:!0,trim:!1}))+t.padding.left+t.padding.right;if(t.title&&n?(t.title=t.title.slice(0,Math.max(0,t.width-2)),t.title&&(t.title=MA(t.title,t.borderStyle))):t.title&&(t.title=t.title.slice(0,Math.max(0,a-2)),t.title&&(t.title=MA(t.title,t.borderStyle),dt(t.title)>s&&(t.width=dt(t.title)))),t.width=t.width?t.width:s,!n){if(t.margin.left&&t.margin.right&&t.width>a){let c=(r-t.width-i)/(t.margin.left+t.margin.right);t.margin.left=Math.max(0,Math.floor(t.margin.left*c)),t.margin.right=Math.max(0,Math.floor(t.margin.right*c))}t.width=Math.min(t.width,r-i-t.margin.left-t.margin.right)}return t.width-(t.padding.left+t.padding.right)<=0&&(t.padding.left=0,t.padding.right=0),t.height&&t.height-(t.padding.top+t.padding.bottom)<=0&&(t.padding.top=0,t.padding.bottom=0),t},D_=e=>e.match(/^#(?:[0-f]{3}){1,2}$/i),wA=e=>typeof e=="string"&&(ye[e]??D_(e)),h6=e=>D_(e)?ye.hex(e):ye[e],b6=e=>D_(e)?ye.bgHex(e):ye[E_(["bg",e])];function Rr(e,t){if(t={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",...t},t.align&&(t.textAlignment=t.align),t.borderColor&&!wA(t.borderColor))throw new Error(`${t.borderColor} is not a valid borderColor`);if(t.backgroundColor&&!wA(t.backgroundColor))throw new Error(`${t.backgroundColor} is not a valid backgroundColor`);return t.padding=xA(t.padding),t.margin=xA(t.margin),t=T6(e,t),e=f6(e,t),g6(e,t.width,t)}l();var ci=Z(require("path"));function rr(e){let t=process.cwd();return e?ci.isAbsolute(e)?e:ci.resolve(t,e):t}function FA(e){return ci.relative(process.cwd(),e)}var C6="#FFB766";function yo(e){let t=pe(e.email),n=e.teamName?pe(e.teamName):R6("Log out and log in to get team name"),r=pe(e.teamId||e.defaultTeamId);return`You are logged in as ${t},
95
95
  Selected team: ${n} (${r})`}function UA(e,t){let n=pe(e.name),r=pe(e.teamID),i=e.teamID==t?Lt(" (currently selected team)"):"";return`${n} (${r})${i}`}function gt(e,t){let n=N_(e.aliases),r=n?pe(n):"",i=t?A6(" <-> ")+bt(t):"";return`${`${e.templateID} `}${r}${i}`.trim()}function R6(e){return ye.redBright(e)}function Ar(e,t){return ye.redBright(`${e?`${e}
96
96
  `:""}${t?t.stack:""}
97
- `)}function A6(e){return ye.dim(e)}function pe(e){return ye.bold(e)}function Lt(e){return ye.hex(C6)(e)}function GA(e){return ye.blue(e)}function Pt(e){return ye.blue(e)}function bt(e){return e?Pt("./"+FA(e)):""}function A_(e){return ye.blueBright(e)}function O_(e){return ye.underline(e)}function N_(e){if(e)return e.join(" | ")}function HA(e){return R_.default(e,{language:"typescript",ignoreIllegals:!0})}function YA(e){return R_.default(e,{language:"python",ignoreIllegals:!0})}var O6={topLeft:"",topRight:"",bottomLeft:"",bottomRight:"",top:"",bottom:"",left:"",right:""},kA=2,BA=1;function y_(e,t,n){return Rr(e,{borderStyle:{...O6,top:"\u2500",bottom:n?"\u2500":""},titleAlignment:"center",float:"left",title:t?pe(t):void 0,margin:{top:0,bottom:0,left:1,right:0},fullscreen:r=>[r,0],padding:{bottom:n?BA:0,left:kA,right:kA,top:BA}})}l();l();var Ka=Z(require("fs")),Gn=Z(require("path"));var Dy=Z(XA());l();async function Ca(e){return new Promise(t=>setTimeout(t,e))}l();l();l();l();var P6={"Content-Type":"application/json"},F6=/\{[^{}]+\}/g,M_=class extends Request{constructor(t,n){super(t,n);for(let r in n)r in this||(this[r]=n[r])}};function Ra(e){let{baseUrl:t="",fetch:n=globalThis.fetch,querySerializer:r,bodySerializer:i,headers:a,...s}={...e};t.endsWith("/")&&(t=t.substring(0,t.length-1)),a=jA(P6,a);let o=[];async function c(u,d){let{fetch:p=n,headers:S,params:g={},parseAs:T="json",querySerializer:N,bodySerializer:w=i??B6,...k}=d||{},M=typeof r=="function"?r:JA(r);N&&(M=typeof N=="function"?N:JA({...typeof r=="object"?r:{},...N}));let B={redirect:"follow",...s,...k,headers:jA(a,S,g.header)};B.body&&(B.body=w(B.body)),B.body instanceof FormData&&B.headers.delete("Content-Type");let Y=new M_(U6(u,{baseUrl:t,params:g,querySerializer:M}),B),re={baseUrl:t,fetch:p,parseAs:T,querySerializer:M,bodySerializer:w};for(let L of o)if(L&&typeof L=="object"&&typeof L.onRequest=="function"){Y.schemaPath=u,Y.params=g;let P=await L.onRequest(Y,re);if(P){if(!(P instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");Y=P}}let Q=await p(Y);for(let L=o.length-1;L>=0;L--){let P=o[L];if(P&&typeof P=="object"&&typeof P.onResponse=="function"){Y.schemaPath=u,Y.params=g;let $=await P.onResponse(Q,re,Y);if($){if(!($ instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");Q=$}}}if(Q.status===204||Q.headers.get("Content-Length")==="0")return Q.ok?{data:{},response:Q}:{error:{},response:Q};if(Q.ok)return T==="stream"?{data:Q.body,response:Q}:{data:await Q[T](),response:Q};let ae=await Q.text();try{ae=JSON.parse(ae)}catch{}return{error:ae,response:Q}}return{async GET(u,d){return c(u,{...d,method:"GET"})},async PUT(u,d){return c(u,{...d,method:"PUT"})},async POST(u,d){return c(u,{...d,method:"POST"})},async DELETE(u,d){return c(u,{...d,method:"DELETE"})},async OPTIONS(u,d){return c(u,{...d,method:"OPTIONS"})},async HEAD(u,d){return c(u,{...d,method:"HEAD"})},async PATCH(u,d){return c(u,{...d,method:"PATCH"})},async TRACE(u,d){return c(u,{...d,method:"TRACE"})},use(...u){for(let d of u)if(d){if(typeof d!="object"||!("onRequest"in d||"onResponse"in d))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");o.push(d)}},eject(...u){for(let d of u){let p=o.indexOf(d);p!==-1&&o.splice(p,1)}}}}function vo(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function ZA(e,t,n){if(!t||typeof t!="object")return"";let r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(let o in t)r.push(o,n.allowReserved===!0?t[o]:encodeURIComponent(t[o]));let s=r.join(",");switch(n.style){case"form":return`${e}=${s}`;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return s}}for(let s in t){let o=n.style==="deepObject"?`${e}[${s}]`:s;r.push(vo(o,t[s],n))}let a=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function eO(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){let a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",s=(n.allowReserved===!0?t:t.map(o=>encodeURIComponent(o))).join(a);switch(n.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return`${e}=${s}`}}let r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(let a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(vo(e,a,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function JA(e){return function(n){let r=[];if(n&&typeof n=="object")for(let i in n){let a=n[i];if(a!=null){if(Array.isArray(a)){r.push(eO(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){r.push(ZA(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}r.push(vo(i,a,e))}}return r.join("&")}}function k6(e,t){let n=e;for(let r of e.match(F6)??[]){let i=r.substring(1,r.length-1),a=!1,s="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(s="label",i=i.substring(1)):i.startsWith(";")&&(s="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;let o=t[i];if(Array.isArray(o)){n=n.replace(r,eO(i,o,{style:s,explode:a}));continue}if(typeof o=="object"){n=n.replace(r,ZA(i,o,{style:s,explode:a}));continue}if(s==="matrix"){n=n.replace(r,`;${vo(i,o)}`);continue}n=n.replace(r,s==="label"?`.${o}`:o)}return n}function B6(e){return JSON.stringify(e)}function U6(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=k6(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function jA(...e){let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,a]of r)if(a===null)t.delete(i);else if(Array.isArray(a))for(let s of a)t.append(i,s);else a!==void 0&&t.set(i,a)}return t}l();var Oa=Z(tO());var nO="1.0.1";function H6(){return globalThis.Bun?{runtime:"bun",version:globalThis.Bun.version}:globalThis.Deno?{runtime:"deno",version:globalThis.Deno.version.deno}:globalThis.process?.release?.name==="node"?{runtime:"node",version:Oa.default.version||"unknown"}:typeof EdgeRuntime=="string"?{runtime:"vercel-edge",version:"unknown"}:globalThis.navigator?.userAgent==="Cloudflare-Workers"?{runtime:"cloudflare-worker",version:"unknown"}:typeof window<"u"?{runtime:"browser",version:Oa.default.version||"unknown"}:{runtime:"unknown",version:"unknown"}}var{runtime:Mo,version:Y6}=H6(),rO={browser:typeof window<"u"&&Oa.default.name||"unknown",lang:"js",lang_version:Y6,package_version:nO,publisher:"e2b",sdk_runtime:Mo,system:Oa.default.os?.family||"unknown"};function Na(e){return Mo==="deno"?Deno.env.get(e):process.env[e]}l();function Po(e){return new di(`${e}: This error is likely due to sandbox timeout. You can modify the sandbox timeout by passing 'timeoutMs' when starting the sandbox or calling '.setTimeout' on the sandbox with the desired timeout.`)}var _t=class extends Error{constructor(t){super(t),this.name="SandboxError"}},di=class extends _t{constructor(t){super(t),this.name="TimeoutError"}},_i=class extends _t{constructor(t){super(t),this.name="InvalidArgumentError"}},wo=class extends _t{constructor(t){super(t),this.name="NotEnoughSpaceError"}},ir=class extends _t{constructor(t){super(t),this.name="NotFoundError"}},Ln=class extends _t{constructor(t){super(t),this.name="AuthenticationError"}},Lo=class extends _t{constructor(t){super(t),this.name="TemplateError"}};l();function iO(e){return JSON.parse(JSON.stringify(e))}function aO(e){async function*t(n){for await(let r of n)e.debug?.("Response stream:",iO(r)),yield r}return n=>async r=>{e.info?.(`Request: POST ${r.url}`);let i=await n(r);return i.stream?{...i,message:t(i.message)}:(e.info?.("Response:",iO(i.message)),i)}}function Fo(e){return{async onRequest(t){return e.info?.(`Request ${t.method} ${t.url}`),t},async onResponse(t){return t.status>=400?e.error?.("Response:",t.status,t.statusText):e.info?.("Response:",t.status,t.statusText),t}}}function ya(e){if(e)return new _t(`${e.code}: ${e.message}`)}var Qt=class{api;constructor(t,n={requireAccessToken:!1,requireApiKey:!0}){if(!n?.requireApiKey&&!t.apiKey)throw new Ln("API key is required, please visit https://e2b.dev/docs to get your API key. You can either set the environment variable `E2B_API_KEY` or you can pass it directly to the sandbox like Sandbox.create({ apiKey: 'e2b_...' })");if(n?.requireAccessToken&&!t.accessToken)throw new Ln("Access token is required, please visit https://e2b.dev/docs to get your access token. You can set the environment variable `E2B_ACCESS_TOKEN` or pass the `accessToken` in options.");this.api=Ra({baseUrl:t.apiUrl,headers:{...rO,...t.apiKey&&{"X-API-KEY":t.apiKey},...t.accessToken&&{Authorization:`Bearer ${t.accessToken}`}}}),t.logger&&this.api.use(Fo(t.logger))}};l();var q6=3e4,Or=50,Nr="Keepalive-Ping-Interval",Dt=class e{debug;domain;apiUrl;logger;requestTimeoutMs;apiKey;accessToken;constructor(t){this.apiKey=t?.apiKey||e.apiKey,this.debug=t?.debug||e.debug,this.domain=t?.domain||e.domain,this.accessToken=t?.accessToken||e.accessToken,this.requestTimeoutMs=t?.requestTimeoutMs??q6,this.logger=t?.logger,this.apiUrl=this.debug?"http://localhost:3000":`https://api.${this.domain}`}static get domain(){return Na("E2B_DOMAIN")||"e2b.dev"}static get debug(){return(Na("E2B_DEBUG")||"false").toLowerCase()==="true"}static get apiKey(){return Na("E2B_API_KEY")}static get accessToken(){return Na("E2B_ACCESS_TOKEN")}getSignal(t){let n=t??this.requestTimeoutMs;return n?AbortSignal.timeout(n):void 0}},yr="user";l();l();l();l();l();var oe;(function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"})(oe||(oe={}));l();function Ia(e){let t=oe[e];return typeof t!="string"?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}var ko;function sO(e){if(!ko){ko={};for(let t of Object.values(oe))typeof t!="string"&&(ko[Ia(t)]=t)}return ko[e]}var be=class e extends Error{constructor(t,n=oe.Unknown,r,i,a){super(V6(t,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=t,this.code=n,this.metadata=new Headers(r??{}),this.details=i??[],this.cause=a}static from(t,n=oe.Unknown){return t instanceof e?t:t instanceof Error?t.name=="AbortError"?new e(t.message,oe.Canceled):new e(t.message,n,void 0,void 0,t):new e(String(t),n,void 0,void 0,t)}static[Symbol.hasInstance](t){return t instanceof Error?Object.getPrototypeOf(t)===e.prototype?!0:t.name==="ConnectError"&&"code"in t&&typeof t.code=="number"&&"metadata"in t&&"details"in t&&Array.isArray(t.details)&&"rawMessage"in t&&typeof t.rawMessage=="string"&&"cause"in t:!1}findDetails(t){let n="typeName"in t?{findMessage:i=>i===t.typeName?t:void 0}:t,r=[];for(let i of this.details){if("getType"in i){n.findMessage(i.getType().typeName)&&r.push(i);continue}let a=n.findMessage(i.type);if(a)try{r.push(a.fromBinary(i.value))}catch{}}return r}};function V6(e,t){return e.length?`[${Ia(t)}] ${e}`:`[${Ia(t)}]`}l();l();l();l();l();l();function Pe(e,t){if(!e)throw new Error(t)}var $6=34028234663852886e22,K6=-34028234663852886e22,W6=4294967295,z6=2147483647,Q6=-2147483648;function mi(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>z6||e<Q6)throw new Error("invalid int 32: "+e)}function va(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>W6||e<0)throw new Error("invalid uint 32: "+e)}function Bo(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>$6||e<K6))throw new Error("invalid float 32: "+e)}var oO=Symbol("@bufbuild/protobuf/enum-type");function lO(e){let t=e[oO];return Pe(t,"missing enum type on enum object"),t}function w_(e,t,n,r){e[oO]=L_(t,n.map(i=>({no:i.no,name:i.name,localName:e[i.no]})),r)}function L_(e,t,n){let r=Object.create(null),i=Object.create(null),a=[];for(let s of t){let o=uO(s);a.push(o),r[s.name]=o,i[s.no]=o}return{typeName:e,values:a,findName(s){return r[s]},findNumber(s){return i[s]}}}function cO(e,t,n){let r={};for(let i of t){let a=uO(i);r[a.localName]=a.no,r[a.no]=a.localName}return w_(r,e,t,n),r}function uO(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}l();l();var se=class{equals(t){return this.getType().runtime.util.equals(this.getType(),this,t)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(t,n){let r=this.getType(),i=r.runtime.bin,a=i.makeReadOptions(n);return i.readMessage(this,a.readerFactory(t),t.byteLength,a),this}fromJson(t,n){let r=this.getType(),i=r.runtime.json,a=i.makeReadOptions(n);return i.readMessage(r,t,a,this),this}fromJsonString(t,n){let r;try{r=JSON.parse(t)}catch(i){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${i instanceof Error?i.message:String(i)}`)}return this.fromJson(r,n)}toBinary(t){let n=this.getType(),r=n.runtime.bin,i=r.makeWriteOptions(t),a=i.writerFactory();return r.writeMessage(this,a,i),a.finish()}toJson(t){let n=this.getType(),r=n.runtime.json,i=r.makeWriteOptions(t);return r.writeMessage(this,i)}toJsonString(t){var n;let r=this.toJson(t);return JSON.stringify(r,null,(n=t?.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}};function dO(e,t,n,r){var i;let a=(i=r?.localName)!==null&&i!==void 0?i:t.substring(t.lastIndexOf(".")+1),s={[a]:function(o){e.util.initFields(this),e.util.initPartial(o,this)}}[a];return Object.setPrototypeOf(s.prototype,new se),Object.assign(s,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary(o,c){return new s().fromBinary(o,c)},fromJson(o,c){return new s().fromJson(o,c)},fromJsonString(o,c){return new s().fromJsonString(o,c)},equals(o,c){return e.util.equals(s,o,c)}}),s}l();l();l();l();function mO(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<r,!(i&128))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Go(e,t,n){for(let a=0;a<28;a=a+7){let s=e>>>a,o=!(!(s>>>7)&&t==0),c=(o?s|128:s)&255;if(n.push(c),!o)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),!!i){for(let a=3;a<31;a=a+7){let s=t>>>a,o=!!(s>>>7),c=(o?s|128:s)&255;if(n.push(c),!o)return}n.push(t>>>31&1)}}var Uo=4294967296;function P_(e){let t=e[0]==="-";t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(s,o){let c=Number(e.slice(s,o));i*=n,r=r*n+c,r>=Uo&&(i=i+(r/Uo|0),r=r%Uo)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?EO(r,i):k_(r,i)}function pO(e,t){let n=k_(e,t),r=n.hi&2147483648;r&&(n=EO(n.lo,n.hi));let i=F_(n.lo,n.hi);return r?"-"+i:i}function F_(e,t){if({lo:e,hi:t}=X6(e,t),t<=2097151)return String(Uo*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,s=r+i*8147497,o=i*2,c=1e7;return a>=c&&(s+=Math.floor(a/c),a%=c),s>=c&&(o+=Math.floor(s/c),s%=c),o.toString()+_O(s)+_O(a)}function X6(e,t){return{lo:e>>>0,hi:t>>>0}}function k_(e,t){return{lo:e|0,hi:t|0}}function EO(e,t){return t=~t,e?e=~e+1:t+=1,k_(e,t)}var _O=e=>{let t=String(e);return"0000000".slice(t.length)+t};function B_(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function fO(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}function J6(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),a=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(c){let u=typeof c=="bigint"?c:BigInt(c);if(u>a||u<i)throw new Error(`int64 invalid: ${c}`);return u},uParse(c){let u=typeof c=="bigint"?c:BigInt(c);if(u>o||u<s)throw new Error(`uint64 invalid: ${c}`);return u},enc(c){return e.setBigInt64(0,this.parse(c),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(c){return e.setBigInt64(0,this.uParse(c),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(c,u){return e.setInt32(0,c,!0),e.setInt32(4,u,!0),e.getBigInt64(0,!0)},uDec(c,u){return e.setInt32(0,c,!0),e.setInt32(4,u,!0),e.getBigUint64(0,!0)}}}let n=i=>Pe(/^-?[0-9]+$/.test(i),`int64 invalid: ${i}`),r=i=>Pe(/^[0-9]+$/.test(i),`uint64 invalid: ${i}`);return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),n(i),P_(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),P_(i)},dec(i,a){return pO(i,a)},uDec(i,a){return F_(i,a)}}}var Ct=J6();l();var G;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(G||(G={}));var sn;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"})(sn||(sn={}));function Pn(e,t,n){if(t===n)return!0;if(e==G.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array)||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}switch(e){case G.UINT64:case G.FIXED64:case G.INT64:case G.SFIXED64:case G.SINT64:return t==n}return!1}function on(e,t){switch(e){case G.BOOL:return!1;case G.UINT64:case G.FIXED64:case G.INT64:case G.SFIXED64:case G.SINT64:return t==0?Ct.zero:"0";case G.DOUBLE:case G.FLOAT:return 0;case G.BYTES:return new Uint8Array(0);case G.STRING:return"";default:return 0}}function Ho(e,t){switch(e){case G.BOOL:return t===!1;case G.STRING:return t==="";case G.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}l();var Xe;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Xe||(Xe={}));var Yo=class{constructor(t){this.stack=[],this.textEncoder=t??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let n=new Uint8Array(t),r=0;for(let i=0;i<this.chunks.length;i++)n.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,n){return this.uint32((t<<3|n)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(va(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return mi(t),B_(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){Bo(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){va(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){mi(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return mi(t),t=(t<<1^t>>31)>>>0,B_(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Ct.enc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Ct.uEnc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(t){let n=Ct.enc(t);return Go(n.lo,n.hi,this.buf),this}sint64(t){let n=Ct.enc(t),r=n.hi>>31,i=n.lo<<1^r,a=(n.hi<<1|n.lo>>>31)^r;return Go(i,a,this.buf),this}uint64(t){let n=Ct.uEnc(t);return Go(n.lo,n.hi,this.buf),this}},qo=class{constructor(t,n){this.varint64=mO,this.uint32=fO,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n??new TextDecoder}tag(){let t=this.uint32(),n=t>>>3,r=t&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(t,n){let r=this.pos;switch(t){case Xe.Varint:for(;this.buf[this.pos++]&128;);break;case Xe.Bit64:this.pos+=4;case Xe.Bit32:this.pos+=4;break;case Xe.LengthDelimited:let i=this.uint32();this.pos+=i;break;case Xe.StartGroup:for(;;){let[a,s]=this.tag();if(s===Xe.EndGroup){if(n!==void 0&&a!==n)throw new Error("invalid end group tag");break}this.skip(s,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Ct.dec(...this.varint64())}uint64(){return Ct.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),r=-(t&1);return t=(t>>>1|(n&1)<<31)^r,n=n>>>1^r,Ct.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ct.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ct.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}};function gO(e,t,n,r){let i;return{typeName:t,extendee:n,get field(){if(!i){let a=typeof r=="function"?r():r;a.name=t.split(".").pop(),a.jsonName=`[${t}]`,i=e.util.newFieldList([a]).list()[0]}return i},runtime:e}}function Vo(e){let t=e.field.localName,n=Object.create(null);return n[t]=j6(e),[n,()=>n[t]]}function j6(e){let t=e.field;if(t.repeated)return[];if(t.default!==void 0)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return on(t.T,t.L);case"message":let n=t.T,r=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function SO(e,t){if(!t.repeated&&(t.kind=="enum"||t.kind=="scalar")){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.no)return[e[n]];return[]}return e.filter(n=>n.no===t.no)}l();l();var Fn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),$o=[];for(let e=0;e<Fn.length;e++)$o[Fn[e].charCodeAt(0)]=e;$o["-".charCodeAt(0)]=Fn.indexOf("+");$o["_".charCodeAt(0)]=Fn.indexOf("/");var ar={dec(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let n=new Uint8Array(t),r=0,i=0,a,s=0;for(let o=0;o<e.length;o++){if(a=$o[e.charCodeAt(o)],a===void 0)switch(e[o]){case"=":i=0;case`
98
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=a,i=1;break;case 1:n[r++]=s<<2|(a&48)>>4,s=a,i=2;break;case 2:n[r++]=(s&15)<<4|(a&60)>>2,s=a,i=3;break;case 3:n[r++]=(s&3)<<6|a,i=0;break}}if(i==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc(e){let t="",n=0,r,i=0;for(let a=0;a<e.length;a++)switch(r=e[a],n){case 0:t+=Fn[r>>2],i=(r&3)<<4,n=1;break;case 1:t+=Fn[i|r>>4],i=(r&15)<<2,n=2;break;case 2:t+=Fn[i|r>>6],t+=Fn[r&63],n=0;break}return n&&(t+=Fn[i],t+="=",n==1&&(t+="=")),t}};l();function TO(e,t,n){bO(t,e);let r=t.runtime.bin.makeReadOptions(n),i=SO(e.getType().runtime.bin.listUnknownFields(e),t.field),[a,s]=Vo(t);for(let o of i)t.runtime.bin.readField(a,r.readerFactory(o.data),t.field,o.wireType,r);return s()}function hO(e,t,n,r){bO(t,e);let i=t.runtime.bin.makeReadOptions(r),a=t.runtime.bin.makeWriteOptions(r);if(U_(e,t)){let u=e.getType().runtime.bin.listUnknownFields(e).filter(d=>d.no!=t.field.no);e.getType().runtime.bin.discardUnknownFields(e);for(let d of u)e.getType().runtime.bin.onUnknownField(e,d.no,d.wireType,d.data)}let s=a.writerFactory(),o=t.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(o,n,s,a);let c=i.readerFactory(s.finish());for(;c.pos<c.len;){let[u,d]=c.tag(),p=c.skip(d,u);e.getType().runtime.bin.onUnknownField(e,u,d,p)}}function U_(e,t){let n=e.getType();return t.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(e).find(r=>r.no==t.field.no)}function bO(e,t){Pe(e.extendee.typeName==t.getType().typeName,`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}l();function Ko(e,t){let n=e.localName;if(e.repeated)return t[n].length>0;if(e.oneof)return t[e.oneof.localName].case===n;switch(e.kind){case"enum":case"scalar":return e.opt||e.req?t[n]!==void 0:e.kind=="enum"?t[n]!==e.T.values[0].no:!Ho(e.T,t[n]);case"message":return t[n]!==void 0;case"map":return Object.keys(t[n]).length>0}}function G_(e,t){let n=e.localName,r=!e.opt&&!e.req;if(e.repeated)t[n]=[];else if(e.oneof)t[e.oneof.localName]={case:void 0};else switch(e.kind){case"map":t[n]={};break;case"enum":t[n]=r?e.T.values[0].no:void 0;break;case"scalar":t[n]=r?on(e.T,e.L):void 0;break;case"message":t[n]=void 0;break}}l();l();function ln(e,t){if(e===null||typeof e!="object"||!Object.getOwnPropertyNames(se.prototype).every(r=>r in e&&typeof e[r]=="function"))return!1;let n=e.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:t===void 0?!0:n.typeName==t.typeName}function Wo(e,t){return ln(t)||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}var une={"google.protobuf.DoubleValue":G.DOUBLE,"google.protobuf.FloatValue":G.FLOAT,"google.protobuf.Int64Value":G.INT64,"google.protobuf.UInt64Value":G.UINT64,"google.protobuf.Int32Value":G.INT32,"google.protobuf.UInt32Value":G.UINT32,"google.protobuf.BoolValue":G.BOOL,"google.protobuf.StringValue":G.STRING,"google.protobuf.BytesValue":G.BYTES};var DO={ignoreUnknownFields:!1},CO={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Z6(e){return e?Object.assign(Object.assign({},DO),e):DO}function eU(e){return e?Object.assign(Object.assign({},CO),e):CO}var Xo=Symbol(),zo=Symbol();function OO(){return{makeReadOptions:Z6,makeWriteOptions:eU,readMessage(e,t,n,r){if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.typeName} from JSON: ${gn(t)}`);r=r??new e;let i=new Map,a=n.typeRegistry;for(let[s,o]of Object.entries(t)){let c=e.fields.findJsonName(s);if(c){if(c.oneof){if(o===null&&c.kind=="scalar")continue;let u=i.get(c.oneof);if(u!==void 0)throw new Error(`cannot decode message ${e.typeName} from JSON: multiple keys for oneof "${c.oneof.name}" present: "${u}", "${s}"`);i.set(c.oneof,s)}RO(r,o,c,n,e)}else{let u=!1;if(a?.findExtension&&s.startsWith("[")&&s.endsWith("]")){let d=a.findExtension(s.substring(1,s.length-1));if(d&&d.extendee.typeName==e.typeName){u=!0;let[p,S]=Vo(d);RO(p,o,d.field,n,d),hO(r,d,S(),n)}}if(!u&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${e.typeName} from JSON: key "${s}" is unknown`)}}return r},writeMessage(e,t){let n=e.getType(),r={},i;try{for(i of n.fields.byNumber()){if(!Ko(i,e)){if(i.req)throw"required field not set";if(!t.emitDefaultValues||!nU(i))continue}let s=i.oneof?e[i.oneof.localName].value:e[i.localName],o=AO(i,s,t);o!==void 0&&(r[t.useProtoFieldName?i.name:i.jsonName]=o)}let a=t.typeRegistry;if(a?.findExtensionFor)for(let s of n.runtime.bin.listUnknownFields(e)){let o=a.findExtensionFor(n.typeName,s.no);if(o&&U_(e,o)){let c=TO(e,o,t),u=AO(o.field,c,t);u!==void 0&&(r[o.field.jsonName]=u)}}}catch(a){let s=i?`cannot encode field ${n.typeName}.${i.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,o=a instanceof Error?a.message:String(a);throw new Error(s+(o.length>0?`: ${o}`:""))}return r},readScalar(e,t,n){return xa(e,t,n??sn.BIGINT,!0)},writeScalar(e,t,n){if(t!==void 0&&(n||Ho(e,t)))return Qo(e,t)},debug:gn}}function gn(e){if(e===null)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function RO(e,t,n,r,i){let a=n.localName;if(n.repeated){if(Pe(n.kind!="map"),t===null)return;if(!Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(t)}`);let s=e[a];for(let o of t){if(o===null)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(o)}`);switch(n.kind){case"message":s.push(n.T.fromJson(o,r));break;case"enum":let c=H_(n.T,o,r.ignoreUnknownFields,!0);c!==zo&&s.push(c);break;case"scalar":try{s.push(xa(n.T,o,n.L,!0))}catch(u){let d=`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(o)}`;throw u instanceof Error&&u.message.length>0&&(d+=`: ${u.message}`),new Error(d)}break}}}else if(n.kind=="map"){if(t===null)return;if(typeof t!="object"||Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(t)}`);let s=e[a];for(let[o,c]of Object.entries(t)){if(c===null)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: map value null`);let u;try{u=tU(n.K,o)}catch(d){let p=`cannot decode map key for field ${i.typeName}.${n.name} from JSON: ${gn(t)}`;throw d instanceof Error&&d.message.length>0&&(p+=`: ${d.message}`),new Error(p)}switch(n.V.kind){case"message":s[u]=n.V.T.fromJson(c,r);break;case"enum":let d=H_(n.V.T,c,r.ignoreUnknownFields,!0);d!==zo&&(s[u]=d);break;case"scalar":try{s[u]=xa(n.V.T,c,sn.BIGINT,!0)}catch(p){let S=`cannot decode map value for field ${i.typeName}.${n.name} from JSON: ${gn(t)}`;throw p instanceof Error&&p.message.length>0&&(S+=`: ${p.message}`),new Error(S)}break}}}else switch(n.oneof&&(e=e[n.oneof.localName]={case:a},a="value"),n.kind){case"message":let s=n.T;if(t===null&&s.typeName!="google.protobuf.Value")return;let o=e[a];ln(o)?o.fromJson(t,r):(e[a]=o=s.fromJson(t,r),s.fieldWrapper&&!n.oneof&&(e[a]=s.fieldWrapper.unwrapField(o)));break;case"enum":let c=H_(n.T,t,r.ignoreUnknownFields,!1);switch(c){case Xo:G_(n,e);break;case zo:break;default:e[a]=c;break}break;case"scalar":try{let u=xa(n.T,t,n.L,!1);switch(u){case Xo:G_(n,e);break;default:e[a]=u;break}}catch(u){let d=`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(t)}`;throw u instanceof Error&&u.message.length>0&&(d+=`: ${u.message}`),new Error(d)}break}}function tU(e,t){if(e===G.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1;break}return xa(e,t,sn.BIGINT,!0).toString()}function xa(e,t,n,r){if(t===null)return r?on(e,n):Xo;switch(e){case G.DOUBLE:case G.FLOAT:if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""||typeof t=="string"&&t.trim().length!==t.length||typeof t!="string"&&typeof t!="number")break;let i=Number(t);if(Number.isNaN(i)||!Number.isFinite(i))break;return e==G.FLOAT&&Bo(i),i;case G.INT32:case G.FIXED32:case G.SFIXED32:case G.SINT32:case G.UINT32:let a;if(typeof t=="number"?a=t:typeof t=="string"&&t.length>0&&t.trim().length===t.length&&(a=Number(t)),a===void 0)break;return e==G.UINT32||e==G.FIXED32?va(a):mi(a),a;case G.INT64:case G.SFIXED64:case G.SINT64:if(typeof t!="number"&&typeof t!="string")break;let s=Ct.parse(t);return n?s.toString():s;case G.FIXED64:case G.UINT64:if(typeof t!="number"&&typeof t!="string")break;let o=Ct.uParse(t);return n?o.toString():o;case G.BOOL:if(typeof t!="boolean")break;return t;case G.STRING:if(typeof t!="string")break;try{encodeURIComponent(t)}catch{throw new Error("invalid UTF8")}return t;case G.BYTES:if(t==="")return new Uint8Array(0);if(typeof t!="string")break;return ar.dec(t)}throw new Error}function H_(e,t,n,r){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:r?e.values[0].no:Xo;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":let i=e.findName(t);if(i!==void 0)return i.no;if(n)return zo;break}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${gn(t)}`)}function nU(e){return e.repeated||e.kind=="map"?!0:!(e.oneof||e.kind=="message"||e.opt||e.req)}function AO(e,t,n){if(e.kind=="map"){Pe(typeof t=="object"&&t!=null);let r={},i=Object.entries(t);switch(e.V.kind){case"scalar":for(let[s,o]of i)r[s.toString()]=Qo(e.V.T,o);break;case"message":for(let[s,o]of i)r[s.toString()]=o.toJson(n);break;case"enum":let a=e.V.T;for(let[s,o]of i)r[s.toString()]=Y_(a,o,n.enumAsInteger);break}return n.emitDefaultValues||i.length>0?r:void 0}if(e.repeated){Pe(Array.isArray(t));let r=[];switch(e.kind){case"scalar":for(let i=0;i<t.length;i++)r.push(Qo(e.T,t[i]));break;case"enum":for(let i=0;i<t.length;i++)r.push(Y_(e.T,t[i],n.enumAsInteger));break;case"message":for(let i=0;i<t.length;i++)r.push(t[i].toJson(n));break}return n.emitDefaultValues||r.length>0?r:void 0}switch(e.kind){case"scalar":return Qo(e.T,t);case"enum":return Y_(e.T,t,n.enumAsInteger);case"message":return Wo(e.T,t).toJson(n)}}function Y_(e,t,n){var r;if(Pe(typeof t=="number"),e.typeName=="google.protobuf.NullValue")return null;if(n)return t;let i=e.findNumber(t);return(r=i?.name)!==null&&r!==void 0?r:t}function Qo(e,t){switch(e){case G.INT32:case G.SFIXED32:case G.SINT32:case G.FIXED32:case G.UINT32:return Pe(typeof t=="number"),t;case G.FLOAT:case G.DOUBLE:return Pe(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case G.STRING:return Pe(typeof t=="string"),t;case G.BOOL:return Pe(typeof t=="boolean"),t;case G.UINT64:case G.FIXED64:case G.INT64:case G.SFIXED64:case G.SINT64:return Pe(typeof t=="bigint"||typeof t=="string"||typeof t=="number"),t.toString();case G.BYTES:return Pe(t instanceof Uint8Array),ar.enc(t)}}l();var pi=Symbol("@bufbuild/protobuf/unknown-fields"),NO={readUnknownFields:!0,readerFactory:e=>new qo(e)},yO={writeUnknownFields:!0,writerFactory:()=>new Yo};function rU(e){return e?Object.assign(Object.assign({},NO),e):NO}function iU(e){return e?Object.assign(Object.assign({},yO),e):yO}function MO(){return{makeReadOptions:rU,makeWriteOptions:iU,listUnknownFields(e){var t;return(t=e[pi])!==null&&t!==void 0?t:[]},discardUnknownFields(e){delete e[pi]},writeUnknownFields(e,t){let r=e[pi];if(r)for(let i of r)t.tag(i.no,i.wireType).raw(i.data)},onUnknownField(e,t,n,r){let i=e;Array.isArray(i[pi])||(i[pi]=[]),i[pi].push({no:t,wireType:n,data:r})},readMessage(e,t,n,r,i){let a=e.getType(),s=i?t.len:t.pos+n,o,c;for(;t.pos<s&&([o,c]=t.tag(),!(i===!0&&c==Xe.EndGroup));){let u=a.fields.find(o);if(!u){let d=t.skip(c,o);r.readUnknownFields&&this.onUnknownField(e,o,c,d);continue}IO(e,t,u,c,r)}if(i&&(c!=Xe.EndGroup||o!==n))throw new Error("invalid end group tag")},readField:IO,writeMessage(e,t,n){let r=e.getType();for(let i of r.fields.byNumber()){if(!Ko(i,e)){if(i.req)throw new Error(`cannot encode field ${r.typeName}.${i.name} to binary: required field not set`);continue}let a=i.oneof?e[i.oneof.localName].value:e[i.localName];vO(i,a,t,n)}return n.writeUnknownFields&&this.writeUnknownFields(e,t),t},writeField(e,t,n,r){t!==void 0&&vO(e,t,n,r)}}}function IO(e,t,n,r,i){let{repeated:a,localName:s}=n;switch(n.oneof&&(e=e[n.oneof.localName],e.case!=s&&delete e.value,e.case=s,s="value"),n.kind){case"scalar":case"enum":let o=n.kind=="enum"?G.INT32:n.T,c=jo;if(n.kind=="scalar"&&n.L>0&&(c=sU),a){let S=e[s];if(r==Xe.LengthDelimited&&o!=G.STRING&&o!=G.BYTES){let T=t.uint32()+t.pos;for(;t.pos<T;)S.push(c(t,o))}else S.push(c(t,o))}else e[s]=c(t,o);break;case"message":let u=n.T;a?e[s].push(Jo(t,new u,i,n)):ln(e[s])?Jo(t,e[s],i,n):(e[s]=Jo(t,new u,i,n),u.fieldWrapper&&!n.oneof&&!n.repeated&&(e[s]=u.fieldWrapper.unwrapField(e[s])));break;case"map":let[d,p]=aU(n,t,i);e[s][d]=p;break}}function Jo(e,t,n,r){let i=t.getType().runtime.bin,a=r?.delimited;return i.readMessage(t,e,a?r.no:e.uint32(),n,a),t}function aU(e,t,n){let r=t.uint32(),i=t.pos+r,a,s;for(;t.pos<i;){let[o]=t.tag();switch(o){case 1:a=jo(t,e.K);break;case 2:switch(e.V.kind){case"scalar":s=jo(t,e.V.T);break;case"enum":s=t.int32();break;case"message":s=Jo(t,new e.V.T,n,void 0);break}break}}if(a===void 0&&(a=on(e.K,sn.BIGINT)),typeof a!="string"&&typeof a!="number"&&(a=a.toString()),s===void 0)switch(e.V.kind){case"scalar":s=on(e.V.T,sn.BIGINT);break;case"enum":s=e.V.T.values[0].no;break;case"message":s=new e.V.T;break}return[a,s]}function sU(e,t){let n=jo(e,t);return typeof n=="bigint"?n.toString():n}function jo(e,t){switch(t){case G.STRING:return e.string();case G.BOOL:return e.bool();case G.DOUBLE:return e.double();case G.FLOAT:return e.float();case G.INT32:return e.int32();case G.INT64:return e.int64();case G.UINT64:return e.uint64();case G.FIXED64:return e.fixed64();case G.BYTES:return e.bytes();case G.FIXED32:return e.fixed32();case G.SFIXED32:return e.sfixed32();case G.SFIXED64:return e.sfixed64();case G.SINT64:return e.sint64();case G.UINT32:return e.uint32();case G.SINT32:return e.sint32()}}function vO(e,t,n,r){Pe(t!==void 0);let i=e.repeated;switch(e.kind){case"scalar":case"enum":let a=e.kind=="enum"?G.INT32:e.T;if(i)if(Pe(Array.isArray(t)),e.packed)lU(n,a,e.no,t);else for(let s of t)Ma(n,a,e.no,s);else Ma(n,a,e.no,t);break;case"message":if(i){Pe(Array.isArray(t));for(let s of t)xO(n,r,e,s)}else xO(n,r,e,t);break;case"map":Pe(typeof t=="object"&&t!=null);for(let[s,o]of Object.entries(t))oU(n,r,e,s,o);break}}function oU(e,t,n,r,i){e.tag(n.no,Xe.LengthDelimited),e.fork();let a=r;switch(n.K){case G.INT32:case G.FIXED32:case G.UINT32:case G.SFIXED32:case G.SINT32:a=Number.parseInt(r);break;case G.BOOL:Pe(r=="true"||r=="false"),a=r=="true";break}switch(Ma(e,n.K,1,a),n.V.kind){case"scalar":Ma(e,n.V.T,2,i);break;case"enum":Ma(e,G.INT32,2,i);break;case"message":Pe(i!==void 0),e.tag(2,Xe.LengthDelimited).bytes(i.toBinary(t));break}e.join()}function xO(e,t,n,r){let i=Wo(n.T,r);n.delimited?e.tag(n.no,Xe.StartGroup).raw(i.toBinary(t)).tag(n.no,Xe.EndGroup):e.tag(n.no,Xe.LengthDelimited).bytes(i.toBinary(t))}function Ma(e,t,n,r){Pe(r!==void 0);let[i,a]=wO(t);e.tag(n,i)[a](r)}function lU(e,t,n,r){if(!r.length)return;e.tag(n,Xe.LengthDelimited).fork();let[,i]=wO(t);for(let a=0;a<r.length;a++)e[i](r[a]);e.join()}function wO(e){let t=Xe.Varint;switch(e){case G.BYTES:case G.STRING:t=Xe.LengthDelimited;break;case G.DOUBLE:case G.FIXED64:case G.SFIXED64:t=Xe.Bit64;break;case G.FIXED32:case G.SFIXED32:case G.FLOAT:t=Xe.Bit32;break}let n=G[e].toLowerCase();return[t,n]}l();function LO(){return{setEnumType:w_,initPartial(e,t){if(e===void 0)return;let n=t.getType();for(let r of n.fields.byMember()){let i=r.localName,a=t,s=e;if(s[i]!=null)switch(r.kind){case"oneof":let o=s[i].case;if(o===void 0)continue;let c=r.findField(o),u=s[i].value;c&&c.kind=="message"&&!ln(u,c.T)?u=new c.T(u):c&&c.kind==="scalar"&&c.T===G.BYTES&&(u=wa(u)),a[i]={case:o,value:u};break;case"scalar":case"enum":let d=s[i];r.T===G.BYTES&&(d=r.repeated?d.map(wa):wa(d)),a[i]=d;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===G.BYTES)for(let[g,T]of Object.entries(s[i]))a[i][g]=wa(T);else Object.assign(a[i],s[i]);break;case"message":let S=r.V.T;for(let g of Object.keys(s[i])){let T=s[i][g];S.fieldWrapper||(T=new S(T)),a[i][g]=T}break}break;case"message":let p=r.T;if(r.repeated)a[i]=s[i].map(S=>ln(S,p)?S:new p(S));else{let S=s[i];p.fieldWrapper?p.typeName==="google.protobuf.BytesValue"?a[i]=wa(S):a[i]=S:a[i]=ln(S,p)?S:new p(S)}break}}},equals(e,t,n){return t===n?!0:!t||!n?!1:e.fields.byMember().every(r=>{let i=t[r.localName],a=n[r.localName];if(r.repeated){if(i.length!==a.length)return!1;switch(r.kind){case"message":return i.every((s,o)=>r.T.equals(s,a[o]));case"scalar":return i.every((s,o)=>Pn(r.T,s,a[o]));case"enum":return i.every((s,o)=>Pn(G.INT32,s,a[o]))}throw new Error(`repeated cannot contain ${r.kind}`)}switch(r.kind){case"message":return r.T.equals(i,a);case"enum":return Pn(G.INT32,i,a);case"scalar":return Pn(r.T,i,a);case"oneof":if(i.case!==a.case)return!1;let s=r.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,a.value);case"enum":return Pn(G.INT32,i.value,a.value);case"scalar":return Pn(s.T,i.value,a.value)}throw new Error(`oneof cannot contain ${s.kind}`);case"map":let o=Object.keys(i).concat(Object.keys(a));switch(r.V.kind){case"message":let c=r.V.T;return o.every(d=>c.equals(i[d],a[d]));case"enum":return o.every(d=>Pn(G.INT32,i[d],a[d]));case"scalar":let u=r.V.T;return o.every(d=>Pn(u,i[d],a[d]))}break}})},clone(e){let t=e.getType(),n=new t,r=n;for(let i of t.fields.byMember()){let a=e[i.localName],s;if(i.repeated)s=a.map(Zo);else if(i.kind=="map"){s=r[i.localName];for(let[o,c]of Object.entries(a))s[o]=Zo(c)}else i.kind=="oneof"?s=i.findField(a.case)?{case:a.case,value:Zo(a.value)}:{case:void 0}:s=Zo(a);r[i.localName]=s}for(let i of t.runtime.bin.listUnknownFields(e))t.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return n}}}function Zo(e){if(e===void 0)return e;if(ln(e))return e.clone();if(e instanceof Uint8Array){let t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function wa(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function PO(e,t,n){return{syntax:e,json:OO(),bin:MO(),util:Object.assign(Object.assign({},LO()),{newFieldList:t,initFields:n}),makeMessageType(r,i,a){return dO(this,r,i,a)},makeEnum:cO,makeEnumType:L_,getEnumType:lO,makeExtension(r,i,a){return gO(this,r,i,a)}}}l();var el=class{constructor(t,n){this._fields=t,this._normalizer=n}findJsonName(t){if(!this.jsonNames){let n={};for(let r of this.list())n[r.jsonName]=n[r.name]=r;this.jsonNames=n}return this.jsonNames[t]}find(t){if(!this.numbers){let n={};for(let r of this.list())n[r.no]=r;this.numbers=n}return this.numbers[t]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((t,n)=>t.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];let t=this.members,n;for(let r of this.list())r.oneof?r.oneof!==n&&(n=r.oneof,t.push(n)):t.push(r)}return this.members}};l();l();l();function q_(e,t){let n=BO(e);return t?n:_U(dU(n))}function FO(e){return q_(e,!1)}var kO=BO;function BO(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);switch(i){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),n.push(i);break}}return n.join("")}var cU=new Set(["constructor","toString","toJSON","valueOf"]),uU=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),UO=e=>`${e}$`,dU=e=>uU.has(e)?UO(e):e,_U=e=>cU.has(e)?UO(e):e;var tl=class{constructor(t){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=t,this.localName=FO(t)}addField(t){Pe(t.oneof===this,`field ${t.name} not one of ${this.name}`),this.fields.push(t)}findField(t){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n<this.fields.length;n++)this._lookup[this.fields[n].localName]=this.fields[n]}return this._lookup[t]}};function GO(e,t){var n,r,i,a,s,o;let c=[],u;for(let d of typeof e=="function"?e():e){let p=d;if(p.localName=q_(d.name,d.oneof!==void 0),p.jsonName=(n=d.jsonName)!==null&&n!==void 0?n:kO(d.name),p.repeated=(r=d.repeated)!==null&&r!==void 0?r:!1,d.kind=="scalar"&&(p.L=(i=d.L)!==null&&i!==void 0?i:sn.BIGINT),p.delimited=(a=d.delimited)!==null&&a!==void 0?a:!1,p.req=(s=d.req)!==null&&s!==void 0?s:!1,p.opt=(o=d.opt)!==null&&o!==void 0?o:!1,d.packed===void 0&&(t?p.packed=d.kind=="enum"||d.kind=="scalar"&&d.T!=G.BYTES&&d.T!=G.STRING:p.packed=!1),d.oneof!==void 0){let S=typeof d.oneof=="string"?d.oneof:d.oneof.name;(!u||u.name!=S)&&(u=new tl(S)),p.oneof=u,u.addField(p)}c.push(p)}return c}var C=PO("proto3",e=>new el(e,t=>GO(t,!0)),e=>{for(let t of e.getType().fields.byMember()){if(t.opt)continue;let n=t.localName,r=e;if(t.repeated){r[n]=[];continue}switch(t.kind){case"oneof":r[n]={case:void 0};break;case"enum":r[n]=0;break;case"map":r[n]={};break;case"scalar":r[n]=on(t.T,t.L);break;case"message":break}}});l();var ve;(function(e){e[e.Unary=0]="Unary",e[e.ServerStreaming=1]="ServerStreaming",e[e.ClientStreaming=2]="ClientStreaming",e[e.BiDiStreaming=3]="BiDiStreaming"})(ve||(ve={}));var La;(function(e){e[e.NoSideEffects=1]="NoSideEffects",e[e.Idempotent=2]="Idempotent"})(La||(La={}));function V_(...e){let t=new Headers;for(let n of e)n.forEach((r,i)=>{t.append(i,r)});return t}l();function HO(e,t){let n={};for(let[r,i]of Object.entries(e.methods)){let a=t(Object.assign(Object.assign({},i),{localName:r,service:e}));a!=null&&(n[r]=a)}return n}l();l();l();var nl=1;function $_(e){let t,n=new Uint8Array(0);function r(i){let a=new Uint8Array(n.length+i.length);a.set(n),a.set(i,n.length),n=a}return new ReadableStream({start(){t=e.getReader()},async pull(i){let a;for(;;){if(a===void 0&&n.byteLength>=5){let c=0;for(let u=1;u<5;u++)c=(c<<8)+n[u];a={flags:n[0],length:c}}if(a!==void 0&&n.byteLength>=a.length+5)break;let o=await t.read();if(o.done)break;r(o.value)}if(a===void 0){if(n.byteLength==0){i.close();return}i.error(new be("premature end of stream",oe.DataLoss));return}let s=n.subarray(5,5+a.length);n=n.subarray(5+a.length),i.enqueue({flags:a.flags,data:s})}})}function K_(e,t){let n=new Uint8Array(t.length+5);n.set(t,5);let r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,e),r.setUint32(1,t.length),n}var mU=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(s){return new Promise(function(o,c){s=e[a](s),i(o,c,s.done,s.value)})}}function i(a,s,o,c){Promise.resolve(c).then(function(u){a({value:u,done:o})},s)}},Pa=function(e){return this instanceof Pa?(this.v=e,this):new Pa(e)},pU=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(T){return Promise.resolve(T).then(g,p)}}function o(g,T){r[g]&&(i[g]=function(N){return new Promise(function(w,k){a.push([g,N,w,k])>1||c(g,N)})},T&&(i[g]=T(i[g])))}function c(g,T){try{u(r[g](T))}catch(N){S(a[0][3],N)}}function u(g){g.value instanceof Pa?Promise.resolve(g.value.v).then(d,p):S(a[0][2],g)}function d(g){c("next",g)}function p(g){c("throw",g)}function S(g,T){g(T),a.shift(),a.length&&c(a[0][0],a[0][1])}},EU=function(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,a){t[i]=e[i]?function(s){return(n=!n)?{value:Pa(e[i](s)),done:!1}:a?a(s):s}:a}};function YO(e){return pU(this,arguments,function*(){yield Pa(yield*EU(mU(e)))})}l();var qO=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(s){return new Promise(function(o,c){s=e[a](s),i(o,c,s.done,s.value)})}}function i(a,s,o,c){Promise.resolve(c).then(function(u){a({value:u,done:o})},s)}},Ei=function(e){return this instanceof Ei?(this.v=e,this):new Ei(e)},fU=function(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,a){t[i]=e[i]?function(s){return(n=!n)?{value:Ei(e[i](s)),done:!1}:a?a(s):s}:a}},gU=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(T){return Promise.resolve(T).then(g,p)}}function o(g,T){r[g]&&(i[g]=function(N){return new Promise(function(w,k){a.push([g,N,w,k])>1||c(g,N)})},T&&(i[g]=T(i[g])))}function c(g,T){try{u(r[g](T))}catch(N){S(a[0][3],N)}}function u(g){g.value instanceof Ei?Promise.resolve(g.value.v).then(d,p):S(a[0][2],g)}function d(g){c("next",g)}function p(g){c("throw",g)}function S(g,T){g(T),a.shift(),a.length&&c(a[0][0],a[0][1])}};function Ir(e,t){return HO(e,n=>{switch(n.kind){case ve.Unary:return SU(t,e,n);case ve.ServerStreaming:return TU(t,e,n);case ve.ClientStreaming:return hU(t,e,n);case ve.BiDiStreaming:return bU(t,e,n);default:return null}})}function SU(e,t,n){return async function(r,i){var a,s;let o=await e.unary(t,n,i?.signal,i?.timeoutMs,i?.headers,r,i?.contextValues);return(a=i?.onHeader)===null||a===void 0||a.call(i,o.header),(s=i?.onTrailer)===null||s===void 0||s.call(i,o.trailer),o.message}}function TU(e,t,n){return function(r,i){return VO(e.stream(t,n,i?.signal,i?.timeoutMs,i?.headers,YO([r]),i?.contextValues),i)}}function hU(e,t,n){return async function(r,i){var a,s,o,c,u,d;let p=await e.stream(t,n,i?.signal,i?.timeoutMs,i?.headers,r,i?.contextValues);(u=i?.onHeader)===null||u===void 0||u.call(i,p.header);let S,g=0;try{for(var T=!0,N=qO(p.message),w;w=await N.next(),a=w.done,!a;T=!0)c=w.value,T=!1,S=c,g++}catch(k){s={error:k}}finally{try{!T&&!a&&(o=N.return)&&await o.call(N)}finally{if(s)throw s.error}}if(!S)throw new be("protocol error: missing response message",oe.Unimplemented);if(g>1)throw new be("protocol error: received extra messages for client streaming method",oe.Unimplemented);return(d=i?.onTrailer)===null||d===void 0||d.call(i,p.trailer),S}}function bU(e,t,n){return function(r,i){return VO(e.stream(t,n,i?.signal,i?.timeoutMs,i?.headers,r,i?.contextValues),i)}}function VO(e,t){let n=function(){return gU(this,arguments,function*(){var r,i;let a=yield Ei(e);(r=t?.onHeader)===null||r===void 0||r.call(t,a.header),yield Ei(yield*fU(qO(a.message))),(i=t?.onTrailer)===null||i===void 0||i.call(t,a.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}l();function $O(...e){let t=new AbortController,n=e.filter(i=>i!==void 0).concat(t.signal);for(let i of n){if(i.aborted){r.apply(i);break}i.addEventListener("abort",r)}function r(){t.signal.aborted||t.abort(W_(this));for(let i of n)i.removeEventListener("abort",r)}return t}function KO(e){let t=new AbortController,n=()=>{t.abort(new be("the operation timed out",oe.DeadlineExceeded))},r;return e!==void 0&&(e<=0?n():r=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(r)}}function W_(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;let t=new Error("This operation was aborted");return t.name="AbortError",t}l();function rl(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}l();function il(e,t,n){let r=typeof t=="string"?t:t.typeName,i=typeof n=="string"?n:n.name;return e.toString().replace(/\/?$/,`/${r}/${i}`)}l();function z_(e,t){return t instanceof e?t:new e(t)}function WO(e,t){function n(r){return r.done===!0?r:{done:r.done,value:z_(e,r.value)}}return{[Symbol.asyncIterator](){let r=t[Symbol.asyncIterator](),i={next:()=>r.next().then(n)};return r.throw!==void 0&&(i.throw=a=>r.throw(a).then(n)),r.return!==void 0&&(i.return=a=>r.return(a).then(n)),i}}}l();function Q_(e,t){var n;return(n=t?.concat().reverse().reduce((r,i)=>i(r),e))!==null&&n!==void 0?n:e}l();function al(e){var t;let n=Object.assign({},e);return(t=n.ignoreUnknownFields)!==null&&t!==void 0||(n.ignoreUnknownFields=!0),n}function sl(e,t,n,r){let i=t?zO(e.I,r):QO(e.I,n);return{parse:(t?zO(e.O,r):QO(e.O,n)).parse,serialize:i.serialize}}function zO(e,t){return{parse(n){try{return e.fromBinary(n,t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new be(`parse binary: ${i}`,oe.Internal)}},serialize(n){try{return n.toBinary(t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new be(`serialize binary: ${i}`,oe.Internal)}}}}function QO(e,t){var n,r;let i=(n=t?.textEncoder)!==null&&n!==void 0?n:new TextEncoder,a=(r=t?.textDecoder)!==null&&r!==void 0?r:new TextDecoder,s=al(t);return{parse(o){try{let c=a.decode(o);return e.fromJsonString(c,s)}catch(c){throw be.from(c,oe.InvalidArgument)}},serialize(o){try{let c=o.toJsonString(s);return i.encode(c)}catch(c){throw be.from(c,oe.Internal)}}}}l();var DU=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i;var XO="application/proto",JO="application/json",jO="application/connect+proto",ZO="application/connect+json";function eN(e){let t=e?.match(DU);if(!t)return;let n=!!t[1],r=!!t[3];return{stream:n,binary:r}}l();l();function Fa(e,t,n){var r;if(t&&new Headers(t).forEach((o,c)=>n.metadata.append(c,o)),typeof e!="object"||e==null||Array.isArray(e))throw n;let i=n.code;"code"in e&&typeof e.code=="string"&&(i=(r=sO(e.code))!==null&&r!==void 0?r:i);let a=e.message;if(a!=null&&typeof a!="string")throw n;let s=new be(a??"",i,t);if("details"in e&&Array.isArray(e.details))for(let o of e.details){if(o===null||typeof o!="object"||Array.isArray(o)||typeof o.type!="string"||typeof o.value!="string")throw n;try{s.details.push({type:o.type,value:ar.dec(o.value),debug:o.debug})}catch{throw n}}return s}var ol=2;function X_(e){let t=new be("invalid end stream",oe.Unknown),n;try{n=JSON.parse(typeof e=="string"?e:new TextDecoder().decode(e))}catch{throw t}if(typeof n!="object"||n==null||Array.isArray(n))throw t;let r=new Headers;if("metadata"in n){if(typeof n.metadata!="object"||n.metadata==null||Array.isArray(n.metadata))throw t;for(let[a,s]of Object.entries(n.metadata)){if(!Array.isArray(s)||s.some(o=>typeof o!="string"))throw t;for(let o of s)r.append(a,o)}}let i="error"in n&&n.error!=null?Fa(n.error,r,t):void 0;return{metadata:r,error:i}}l();var vr="Content-Type",tN="Content-Length",ka="Content-Encoding";var J_="Accept-Encoding";var nN="Connect-Timeout-Ms",ll="Connect-Protocol-Version",rN="User-Agent";l();function iN(e){switch(e){case 400:return oe.Internal;case 401:return oe.Unauthenticated;case 403:return oe.PermissionDenied;case 404:return oe.Unimplemented;case 429:return oe.Unavailable;case 502:return oe.Unavailable;case 503:return oe.Unavailable;case 504:return oe.Unavailable;default:return oe.Unknown}}l();function cl(e){let t=new Headers,n=new Headers;return e.forEach((r,i)=>{i.toLowerCase().startsWith("trailer-")?n.append(i.substring(8),r):t.append(i,r)}),[t,n]}l();var ul="1";l();function dl(e,t,n,r,i){let a=new Headers(r??{});return n!==void 0&&a.set(nN,`${n}`),a.set(vr,e==ve.Unary?t?XO:JO:t?jO:ZO),a.set(ll,ul),i&&a.set(rN,"connect-es/1.5.0"),a}l();function _l(e,t,n,r){let i=r.get(vr),a=eN(i);if(n!==200){let o=new be(`HTTP ${n}`,iN(n),r);if(e==ve.Unary&&a&&!a.binary)return{isUnaryError:!0,unaryError:o};throw o}let s={binary:t,stream:e!==ve.Unary};if(a?.binary!==s.binary||a.stream!==s.stream)throw new be(`unsupported content type ${i}`,a===void 0?oe.Unknown:oe.Internal,r);return{isUnaryError:!1}}l();var aN="application/";function AU(e,t){return t?ar.enc(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):encodeURIComponent(new TextDecoder().decode(e))}function j_(e,t,n){let r=`?connect=v${ul}`,i=e.header.get(vr);i?.indexOf(aN)===0&&(r+="&encoding="+encodeURIComponent(i.slice(aN.length)));let a=e.header.get(ka);a!==null&&a!=="identity"&&(r+="&compression="+encodeURIComponent(a),n=!0),n&&(r+="&base64=1"),r+="&message="+AU(t,n);let s=e.url+r,o=new Headers(e.header);return[ll,vr,tN,ka,J_].forEach(c=>o.delete(c)),Object.assign(Object.assign({},e),{init:Object.assign(Object.assign({},e.init),{method:"GET"}),url:s,header:o})}l();function Z_(e){let t=Q_(e.next,e.interceptors),[n,r,i]=sN(e),a=Object.assign(Object.assign({},e.req),{message:z_(e.req.method.I,e.req.message),signal:n});return t(a).then(s=>(i(),s),r)}function em(e){let t=Q_(e.next,e.interceptors),[n,r,i]=sN(e),a=Object.assign(Object.assign({},e.req),{message:WO(e.req.method.I,e.req.message),signal:n}),s=!1;return n.addEventListener("abort",function(){var o,c;let u=e.req.message[Symbol.asyncIterator]();s||(o=u.throw)===null||o===void 0||o.call(u,this.reason).catch(()=>{}),(c=u.return)===null||c===void 0||c.call(u).catch(()=>{})}),t(a).then(o=>Object.assign(Object.assign({},o),{message:{[Symbol.asyncIterator](){let c=o.message[Symbol.asyncIterator]();return{next(){return c.next().then(u=>(u.done==!0&&(s=!0,i()),u),r)}}}}}),r)}function sN(e){let{signal:t,cleanup:n}=KO(e.timeoutMs),r=$O(e.signal,t);return[r.signal,function(a){let s=be.from(t.aborted?W_(t):a);return r.abort(s),n(),Promise.reject(s)},function(){n(),r.abort()}]}function Je(e){if(e instanceof be)switch(e.code){case oe.InvalidArgument:return new _i(e.message);case oe.Unauthenticated:return new Ln(e.message);case oe.NotFound:return new ir(e.message);case oe.Unavailable:return Po(e.message);case oe.Canceled:return new di(`${e.message}: This error is likely due to exceeding 'requestTimeoutMs'. You can pass the request timeout value as an option when making the request.`);case oe.DeadlineExceeded:return new di(`${e.message}: This error is likely due to exceeding 'timeoutMs' \u2014 the total time a long running request (like command execution or directory watch) can be active. It can be modified by passing 'timeoutMs' when making the request. Use '0' to disable the timeout.`);default:return new _t(`${e.code}: ${e.message}`)}return e}function OU(e){switch(Mo){case"deno":return btoa(e);case"node":return Buffer.from(e).toString("base64");case"bun":return Buffer.from(e).toString("base64");default:return btoa(e)}}function cn(e){let t=`${e||yr}:`;return{Authorization:`Basic ${OU(t)}`}}l();var rm=(r=>(r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.FILE=1]="FILE",r[r.DIRECTORY=2]="DIRECTORY",r))(rm||{});C.util.setEnumType(rm,"filesystem.FileType",[{no:0,name:"FILE_TYPE_UNSPECIFIED"},{no:1,name:"FILE_TYPE_FILE"},{no:2,name:"FILE_TYPE_DIRECTORY"}]);var im=(s=>(s[s.UNSPECIFIED=0]="UNSPECIFIED",s[s.CREATE=1]="CREATE",s[s.WRITE=2]="WRITE",s[s.REMOVE=3]="REMOVE",s[s.RENAME=4]="RENAME",s[s.CHMOD=5]="CHMOD",s))(im||{});C.util.setEnumType(im,"filesystem.EventType",[{no:0,name:"EVENT_TYPE_UNSPECIFIED"},{no:1,name:"EVENT_TYPE_CREATE"},{no:2,name:"EVENT_TYPE_WRITE"},{no:3,name:"EVENT_TYPE_REMOVE"},{no:4,name:"EVENT_TYPE_RENAME"},{no:5,name:"EVENT_TYPE_CHMOD"}]);var ml=class e extends se{source="";destination="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.MoveRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"source",kind:"scalar",T:9},{no:2,name:"destination",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},pl=class e extends se{entry;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.MoveResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"entry",kind:"message",T:fi}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},El=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.MakeDirRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},fl=class e extends se{entry;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.MakeDirResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"entry",kind:"message",T:fi}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},gl=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.RemoveRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Sl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.RemoveResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Tl=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.StatRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},hl=class e extends se{entry;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.StatResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"entry",kind:"message",T:fi}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},fi=class e extends se{name="";type=0;path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.EntryInfo";static fields=C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:C.getEnumType(rm)},{no:3,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},bl=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.ListDirRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Dl=class e extends se{entries=[];constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.ListDirResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"entries",kind:"message",T:fi,repeated:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Cl=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.WatchDirRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Rl=class e extends se{name="";type=0;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.FilesystemEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:C.getEnumType(im)}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Al=class e extends se{event={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.WatchDirResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"start",kind:"message",T:tm,oneof:"event"},{no:2,name:"filesystem",kind:"message",T:Rl,oneof:"event"},{no:3,name:"keepalive",kind:"message",T:nm,oneof:"event"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},tm=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.WatchDirResponse.StartEvent";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},nm=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.WatchDirResponse.KeepAlive";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Ol=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.CreateWatcherRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Nl=class e extends se{watcherId="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.CreateWatcherResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"watcher_id",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},yl=class e extends se{watcherId="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.GetWatcherEventsRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"watcher_id",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Il=class e extends se{events=[];constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.GetWatcherEventsResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"events",kind:"message",T:Rl,repeated:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},vl=class e extends se{watcherId="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.RemoveWatcherRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"watcher_id",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},xl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.RemoveWatcherResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}};function NU(e){switch(e){case 5:return"chmod";case 1:return"create";case 3:return"remove";case 4:return"rename";case 2:return"write"}}var Ml=class{constructor(t,n,r,i){this.handleStop=t;this.events=n;this.onEvent=r;this.onExit=i;this.handleEvents()}async stop(){this.handleStop()}async*iterateEvents(){try{for await(let t of this.events)switch(t.event.case){case"filesystem":yield t.event;break}}catch(t){throw Je(t)}}async handleEvents(){try{for await(let t of this.iterateEvents()){let n=NU(t.value.type);n!==void 0&&this.onEvent?.({name:t.value.name,type:n})}this.onExit?.()}catch(t){this.onExit?.(t)}}};l();l();async function Ba(e){if(!e.error)return;let t=typeof e.error=="string"?e.error:e.error?.message||await e.response.text();switch(e.response.status){case 400:return new _i(t);case 401:return new Ln(t);case 404:return new ir(t);case 429:return new _t(`${e.response.status}: ${t}: The requests are being rate limited.`);case 502:return Po(t);case 507:return new wo(t);default:return new _t(`${e.response.status}: ${t}`)}}async function Ua(e){let t;try{t=(await e[Symbol.asyncIterator]().next()).value}catch(n){throw n instanceof be&&n.code===oe.Unavailable?new ir("Sandbox is probably not running anymore"):n}if(t.event?.event.case!=="start")throw new Error("Expected start event");return t.event.event.value.pid}async function oN(e){let t;try{t=(await e[Symbol.asyncIterator]().next()).value}catch(n){throw n instanceof be&&n.code===oe.Unavailable?new ir("Sandbox is probably not running anymore"):n}if(t.event?.case!=="start")throw new Error("Expected start event");return t.event.value}var wl=class{api;constructor(t){this.api=Ra({baseUrl:t.apiUrl}),t.logger&&this.api.use(Fo(t.logger))}};l();var lN={typeName:"filesystem.Filesystem",methods:{stat:{name:"Stat",I:Tl,O:hl,kind:ve.Unary},makeDir:{name:"MakeDir",I:El,O:fl,kind:ve.Unary},move:{name:"Move",I:ml,O:pl,kind:ve.Unary},listDir:{name:"ListDir",I:bl,O:Dl,kind:ve.Unary},remove:{name:"Remove",I:gl,O:Sl,kind:ve.Unary},watchDir:{name:"WatchDir",I:Cl,O:Al,kind:ve.ServerStreaming},createWatcher:{name:"CreateWatcher",I:Ol,O:Nl,kind:ve.Unary},getWatcherEvents:{name:"GetWatcherEvents",I:yl,O:Il,kind:ve.Unary},removeWatcher:{name:"RemoveWatcher",I:vl,O:xl,kind:ve.Unary}}};function cN(e){switch(e){case 2:return"dir";case 1:return"file"}}var Ll=class{constructor(t,n,r){this.envdApi=n;this.connectionConfig=r;this.rpc=Ir(lN,t)}rpc;defaultWatchTimeout=6e4;async read(t,n){let r=n?.format??"text",i=await this.envdApi.api.GET("/files",{params:{query:{path:t,username:n?.user||yr}},parseAs:r==="bytes"?"arrayBuffer":r,signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),a=await Ba(i);if(a)throw a;return r==="bytes"?new Uint8Array(i.data):i.response.headers.get("content-length")==="0"?"":i.data}async write(t,n,r){let i=await new Response(n).blob(),a=await this.envdApi.api.POST("/files",{params:{query:{path:t,username:r?.user||yr}},bodySerializer(){let c=new FormData;return c.append("file",i),c},body:{},signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)}),s=await Ba(a);if(s)throw s;let o=a.data;if(!o||o.length===0)throw new Error("Expected to receive information about written file");return o[0]}async list(t,n){try{let r=await this.rpc.listDir({path:t},{headers:cn(n?.user),signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),i=[];for(let a of r.entries){let s=cN(a.type);s&&i.push({name:a.name,type:s,path:a.path})}return i}catch(r){throw Je(r)}}async makeDir(t,n){try{return await this.rpc.makeDir({path:t},{headers:cn(n?.user),signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),!0}catch(r){if(r instanceof be&&r.code===oe.AlreadyExists)return!1;throw Je(r)}}async rename(t,n,r){try{let a=(await this.rpc.move({source:t,destination:n},{headers:cn(r?.user),signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)})).entry;if(!a)throw new Error("Expected to receive information about moved object");return{name:a.name,type:cN(a.type),path:a.path}}catch(i){throw Je(i)}}async remove(t,n){try{await this.rpc.remove({path:t},{headers:cn(n?.user),signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)})}catch(r){throw Je(r)}}async exists(t,n){try{return await this.rpc.stat({path:t},{headers:cn(n?.user),signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),!0}catch(r){if(r instanceof be&&r.code===oe.NotFound)return!1;throw Je(r)}}async watchDir(t,n,r){let i=r?.requestTimeoutMs??this.connectionConfig.requestTimeoutMs,a=new AbortController,s=i?setTimeout(()=>{a.abort()},i):void 0,o=this.rpc.watchDir({path:t},{headers:{...cn(r?.user),[Nr]:Or.toString()},signal:a.signal,timeoutMs:r?.timeoutMs??this.defaultWatchTimeout});try{return await oN(o),clearTimeout(s),new Ml(()=>a.abort(),o,n,r?.onExit)}catch(c){throw Je(c)}}};l();var gi=class extends _t{constructor(n){super(n.error);this.result=n;this.name="CommandExitError"}get exitCode(){return this.result.exitCode}get error(){return this.result.error}get stdout(){return this.result.stdout}get stderr(){return this.result.stderr}},xr=class{constructor(t,n,r,i,a,s,o){this.pid=t;this.handleDisconnect=n;this.handleKill=r;this.events=i;this.onStdout=a;this.onStderr=s;this.onPty=o;this._wait=this.handleEvents()}_stdout="";_stderr="";result;iterationError;_wait;get exitCode(){return this.result?.exitCode}get error(){return this.result?.error}get stderr(){return this._stderr}get stdout(){return this._stdout}async wait(){if(await this._wait,this.iterationError)throw this.iterationError;if(!this.result)throw new _t("Process exited without a result");if(this.result.exitCode!==0)throw new gi(this.result);return this.result}async disconnect(){this.handleDisconnect()}async kill(){return await this.handleKill()}async*iterateEvents(){for await(let t of this.events){let n=t?.event?.event,r;switch(n?.case){case"data":switch(n.value.output.case){case"stdout":r=new TextDecoder().decode(n.value.output.value),this._stdout+=r,yield[r,null,null];break;case"stderr":r=new TextDecoder().decode(n.value.output.value),this._stderr+=r,yield[null,r,null];break;case"pty":yield[null,null,n.value.output.value];break}break;case"end":this.result={exitCode:n.value.exitCode,error:n.value.error,stdout:this.stdout,stderr:this.stderr};break}}}async handleEvents(){try{for await(let[t,n,r]of this.iterateEvents())t!==null?this.onStdout?.(t):n!==null?this.onStderr?.(n):r&&this.onPty?.(r)}catch(t){this.iterationError=Je(t)}}};l();l();l();l();l();l();function uN(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}var Ga=function(e){return this instanceof Ga?(this.v=e,this):new Ga(e)},yU=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(T){return Promise.resolve(T).then(g,p)}}function o(g,T){r[g]&&(i[g]=function(N){return new Promise(function(w,k){a.push([g,N,w,k])>1||c(g,N)})},T&&(i[g]=T(i[g])))}function c(g,T){try{u(r[g](T))}catch(N){S(a[0][3],N)}}function u(g){g.value instanceof Ga?Promise.resolve(g.value.v).then(d,p):S(a[0][2],g)}function d(g){c("next",g)}function p(g){c("throw",g)}function S(g,T){g(T),a.shift(),a.length&&c(a[0][0],a[0][1])}};function am(e){var t;uN();let n=(t=e.useBinaryFormat)!==null&&t!==void 0?t:!1;return{async unary(r,i,a,s,o,c,u){var d;let{serialize:p,parse:S}=sl(i,n,e.jsonOptions,e.binaryOptions);return s=s===void 0?e.defaultTimeoutMs:s<=0?void 0:s,await Z_({interceptors:e.interceptors,signal:a,timeoutMs:s,req:{stream:!1,service:r,method:i,url:il(e.baseUrl,r,i),init:{method:"POST",credentials:(d=e.credentials)!==null&&d!==void 0?d:"same-origin",redirect:"error",mode:"cors"},header:dl(i.kind,n,s,o,!1),contextValues:u??rl(),message:c},next:async g=>{var T;let N=e.useHttpGet===!0&&i.idempotency===La.NoSideEffects,w=null;N?g=j_(g,p(g.message),n):w=p(g.message);let M=await((T=e.fetch)!==null&&T!==void 0?T:globalThis.fetch)(g.url,Object.assign(Object.assign({},g.init),{headers:g.header,signal:g.signal,body:w})),{isUnaryError:B,unaryError:Y}=_l(i.kind,n,M.status,M.headers);if(B)throw Fa(await M.json(),V_(...cl(M.headers)),Y);let[re,Q]=cl(M.headers);return{stream:!1,service:r,method:i,header:re,message:n?S(new Uint8Array(await M.arrayBuffer())):i.O.fromJson(await M.json(),al(e.jsonOptions)),trailer:Q}}})},async stream(r,i,a,s,o,c,u){var d;let{serialize:p,parse:S}=sl(i,n,e.jsonOptions,e.binaryOptions);function g(N,w,k,M){return yU(this,arguments,function*(){let Y=$_(N).getReader(),re=!1;for(;;){let Q=yield Ga(Y.read());if(Q.done)break;let{flags:ae,data:L}=Q.value;if((ae&nl)===nl)throw new be("protocol error: received unsupported compressed output",oe.Internal);if((ae&ol)===ol){re=!0;let P=X_(L);if(P.error){let $=P.error;throw k.forEach((J,_e)=>{$.metadata.append(_e,J)}),$}P.metadata.forEach(($,J)=>w.set(J,$));continue}yield yield Ga(S(L))}if("throwIfAborted"in M&&M.throwIfAborted(),!re)throw"missing EndStreamResponse"})}async function T(N){if(i.kind!=ve.ServerStreaming)throw"The fetch API does not support streaming request bodies";let w=await N[Symbol.asyncIterator]().next();if(w.done==!0)throw"missing request message";return K_(0,p(w.value))}return s=s===void 0?e.defaultTimeoutMs:s<=0?void 0:s,await em({interceptors:e.interceptors,timeoutMs:s,signal:a,req:{stream:!0,service:r,method:i,url:il(e.baseUrl,r,i),init:{method:"POST",credentials:(d=e.credentials)!==null&&d!==void 0?d:"same-origin",redirect:"error",mode:"cors"},header:dl(i.kind,n,s,o,!1),contextValues:u??rl(),message:c},next:async N=>{var w;let M=await((w=e.fetch)!==null&&w!==void 0?w:globalThis.fetch)(N.url,Object.assign(Object.assign({},N.init),{headers:N.header,signal:N.signal,body:await T(N.message)}));if(_l(i.kind,n,M.status,M.headers),M.body===null)throw"missing response body";let B=new Headers;return Object.assign(Object.assign({},N),{header:M.headers,trailer:B,message:g(M.body,B,M.headers,N.signal)})}})}}}l();l();l();var Em=(r=>(r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.SIGTERM=15]="SIGTERM",r[r.SIGKILL=9]="SIGKILL",r))(Em||{});C.util.setEnumType(Em,"process.Signal",[{no:0,name:"SIGNAL_UNSPECIFIED"},{no:15,name:"SIGNAL_SIGTERM"},{no:9,name:"SIGNAL_SIGKILL"}]);var Pl=class e extends se{size;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.PTY";static fields=C.util.newFieldList(()=>[{no:1,name:"size",kind:"message",T:sm}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},sm=class e extends se{cols=0;rows=0;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.PTY.Size";static fields=C.util.newFieldList(()=>[{no:1,name:"cols",kind:"scalar",T:13},{no:2,name:"rows",kind:"scalar",T:13}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Fl=class e extends se{cmd="";args=[];envs={};cwd;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessConfig";static fields=C.util.newFieldList(()=>[{no:1,name:"cmd",kind:"scalar",T:9},{no:2,name:"args",kind:"scalar",T:9,repeated:!0},{no:3,name:"envs",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"cwd",kind:"scalar",T:9,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},kl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ListRequest";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},om=class e extends se{config;pid=0;tag;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessInfo";static fields=C.util.newFieldList(()=>[{no:1,name:"config",kind:"message",T:Fl},{no:2,name:"pid",kind:"scalar",T:13},{no:3,name:"tag",kind:"scalar",T:9,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Bl=class e extends se{processes=[];constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ListResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"processes",kind:"message",T:om,repeated:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Ul=class e extends se{process;pty;tag;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StartRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Fl},{no:2,name:"pty",kind:"message",T:Pl,opt:!0},{no:3,name:"tag",kind:"scalar",T:9,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Gl=class e extends se{process;pty;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.UpdateRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr},{no:2,name:"pty",kind:"message",T:Pl,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Hl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.UpdateResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Yl=class e extends se{event={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"start",kind:"message",T:lm,oneof:"event"},{no:2,name:"data",kind:"message",T:cm,oneof:"event"},{no:3,name:"end",kind:"message",T:um,oneof:"event"},{no:4,name:"keepalive",kind:"message",T:dm,oneof:"event"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},lm=class e extends se{pid=0;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent.StartEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"pid",kind:"scalar",T:13}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},cm=class e extends se{output={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent.DataEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"stdout",kind:"scalar",T:12,oneof:"output"},{no:2,name:"stderr",kind:"scalar",T:12,oneof:"output"},{no:3,name:"pty",kind:"scalar",T:12,oneof:"output"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},um=class e extends se{exitCode=0;exited=!1;status="";error;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent.EndEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"exit_code",kind:"scalar",T:17},{no:2,name:"exited",kind:"scalar",T:8},{no:3,name:"status",kind:"scalar",T:9},{no:4,name:"error",kind:"scalar",T:9,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},dm=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent.KeepAlive";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},ql=class e extends se{event;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StartResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"event",kind:"message",T:Yl}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Vl=class e extends se{event;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ConnectResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"event",kind:"message",T:Yl}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},$l=class e extends se{process;input;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.SendInputRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr},{no:2,name:"input",kind:"message",T:Wl}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Kl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.SendInputResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Wl=class e extends se{input={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessInput";static fields=C.util.newFieldList(()=>[{no:1,name:"stdin",kind:"scalar",T:12,oneof:"input"},{no:2,name:"pty",kind:"scalar",T:12,oneof:"input"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},zl=class e extends se{event={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"start",kind:"message",T:_m,oneof:"event"},{no:2,name:"data",kind:"message",T:mm,oneof:"event"},{no:3,name:"keepalive",kind:"message",T:pm,oneof:"event"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},_m=class e extends se{process;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputRequest.StartEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},mm=class e extends se{input;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputRequest.DataEvent";static fields=C.util.newFieldList(()=>[{no:2,name:"input",kind:"message",T:Wl}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},pm=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputRequest.KeepAlive";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Ql=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Xl=class e extends se{process;signal=0;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.SendSignalRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr},{no:2,name:"signal",kind:"enum",T:C.getEnumType(Em)}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Jl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.SendSignalResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},jl=class e extends se{process;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ConnectRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Mr=class e extends se{selector={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessSelector";static fields=C.util.newFieldList(()=>[{no:1,name:"pid",kind:"scalar",T:13,oneof:"selector"},{no:2,name:"tag",kind:"scalar",T:9,oneof:"selector"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}};var Zl={typeName:"process.Process",methods:{list:{name:"List",I:kl,O:Bl,kind:ve.Unary},connect:{name:"Connect",I:jl,O:Vl,kind:ve.ServerStreaming},start:{name:"Start",I:Ul,O:ql,kind:ve.ServerStreaming},update:{name:"Update",I:Gl,O:Hl,kind:ve.Unary},streamInput:{name:"StreamInput",I:zl,O:Ql,kind:ve.ClientStreaming},sendInput:{name:"SendInput",I:$l,O:Kl,kind:ve.Unary},sendSignal:{name:"SendSignal",I:Xl,O:Jl,kind:ve.Unary}}};l();var Ha=class{constructor(t,n){this.transport=t;this.connectionConfig=n;this.rpc=Ir(Zl,this.transport)}rpc;async create(t){let n=t?.requestTimeoutMs??this.connectionConfig.requestTimeoutMs,r=t?.envs??{};r.TERM="xterm-256color";let i=new AbortController,a=setTimeout(()=>{i.abort()},n),s=this.rpc.start({process:{cmd:"/bin/bash",args:["-i","-l"],envs:r,cwd:t?.cwd},pty:{size:{cols:t.cols,rows:t.rows}}},{headers:{...cn(t?.user),[Nr]:Or.toString()},signal:i.signal,timeoutMs:t?.timeoutMs??6e4});try{let o=await Ua(s);return clearTimeout(a),new xr(o,()=>i.abort(),()=>this.kill(o),s,void 0,void 0,t.onData)}catch(o){throw Je(o)}}async sendInput(t,n,r){try{await this.rpc.sendInput({input:{input:{case:"pty",value:n}},process:{selector:{case:"pid",value:t}}},{signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)})}catch(i){throw Je(i)}}async resize(t,n,r){try{await this.rpc.update({process:{selector:{case:"pid",value:t}},pty:{size:n}},{signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)})}catch(i){throw Je(i)}}async kill(t,n){try{return await this.rpc.sendSignal({process:{selector:{case:"pid",value:t}},signal:9},{signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),!0}catch(r){if(r instanceof be&&r.code===oe.NotFound)return!1;throw Je(r)}}};var ec=class{constructor(t,n){this.connectionConfig=n;this.rpc=Ir(Zl,t)}rpc;defaultProcessConnectionTimeout=6e4;async list(t){try{return(await this.rpc.list({},{signal:this.connectionConfig.getSignal(t?.requestTimeoutMs)})).processes.map(r=>({pid:r.pid,...r.tag&&{tag:r.tag},args:r.config.args,envs:r.config.envs,cmd:r.config.cmd,...r.config.cwd&&{cwd:r.config.cwd}}))}catch(n){throw Je(n)}}async sendStdin(t,n,r){try{await this.rpc.sendInput({process:{selector:{case:"pid",value:t}},input:{input:{case:"stdin",value:new TextEncoder().encode(n)}}},{signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)})}catch(i){throw Je(i)}}async kill(t,n){try{return await this.rpc.sendSignal({process:{selector:{case:"pid",value:t}},signal:9},{signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),!0}catch(r){if(r instanceof be&&r.code===oe.NotFound)return!1;throw Je(r)}}async connect(t,n){let r=n?.requestTimeoutMs??this.connectionConfig.requestTimeoutMs,i=new AbortController,a=r?setTimeout(()=>{i.abort()},r):void 0,s=this.rpc.connect({process:{selector:{case:"pid",value:t}}},{signal:i.signal,headers:{[Nr]:Or.toString()},timeoutMs:n?.timeoutMs??this.defaultProcessConnectionTimeout});try{let o=await Ua(s);return clearTimeout(a),new xr(o,()=>i.abort(),()=>this.kill(o),s,n?.onStdout,n?.onStderr,void 0)}catch(o){throw Je(o)}}async run(t,n){let r=await this.start(t,n);return n?.background?r:r.wait()}async start(t,n){let r=n?.requestTimeoutMs??this.connectionConfig.requestTimeoutMs,i=new AbortController,a=r?setTimeout(()=>{i.abort()},r):void 0,s=this.rpc.start({process:{cmd:"/bin/bash",cwd:n?.cwd,envs:n?.envs,args:["-l","-c",t]}},{headers:{...cn(n?.user),[Nr]:Or.toString()},signal:i.signal,timeoutMs:n?.timeoutMs??this.defaultProcessConnectionTimeout});try{let o=await Ua(s);return clearTimeout(a),new xr(o,()=>i.abort(),()=>this.kill(o),s,n?.onStdout,n?.onStderr,void 0)}catch(o){throw Je(o)}}};l();l();l();l();var IU=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,fm=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(IU);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},dN=e=>e==="*"||e==="x"||e==="X",_N=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},vU=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],xU=(e,t)=>{if(dN(e)||dN(t))return 0;let[n,r]=vU(_N(e),_N(t));return n>r?1:n<r?-1:0},gm=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){let r=xU(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0};var Sm=(e,t)=>{let n=fm(e),r=fm(t),i=n.pop(),a=r.pop(),s=gm(n,r);return s!==0?s:i&&a?gm(i.split("."),a.split(".")):i||a?i?-1:1:0};var tc=class{constructor(){}static async kill(t,n){let r=new Dt(n),a=await new Qt(r).api.DELETE("/sandboxes/{sandboxID}",{params:{path:{sandboxID:t}},signal:r.getSignal(n?.requestTimeoutMs)});if(a.error?.code===404)return!1;let s=ya(a.error);if(s)throw s;return!0}static async list(t){let n=new Dt(t),i=await new Qt(n).api.GET("/sandboxes",{signal:n.getSignal(t?.requestTimeoutMs)}),a=ya(i.error);if(a)throw a;return i.data?.map(s=>({sandboxId:this.getSandboxId({sandboxId:s.sandboxID,clientId:s.clientID}),templateId:s.templateID,...s.alias&&{name:s.alias},metadata:s.metadata??{},startedAt:new Date(s.startedAt)}))??[]}static async setTimeout(t,n,r){let i=new Dt(r),s=await new Qt(i).api.POST("/sandboxes/{sandboxID}/timeout",{params:{path:{sandboxID:t}},body:{timeout:this.timeoutToSeconds(n)},signal:i.getSignal(r?.requestTimeoutMs)}),o=ya(s.error);if(o)throw o}static async createSandbox(t,n,r){let i=new Dt(r),s=await new Qt(i).api.POST("/sandboxes",{body:{templateID:t,metadata:r?.metadata,envVars:r?.envs,timeout:this.timeoutToSeconds(n)},signal:i.getSignal(r?.requestTimeoutMs)}),o=ya(s.error);if(o)throw o;if(Sm(s.data.envdVersion,"0.1.0")<0)throw await this.kill(this.getSandboxId({sandboxId:s.data.sandboxID,clientId:s.data.clientID}),r),new Lo("You need to update the template to use the new SDK. You can do this by running `e2b template build` in the directory with the template.");return this.getSandboxId({sandboxId:s.data.sandboxID,clientId:s.data.clientID})}static timeoutToSeconds(t){return Math.ceil(t/1e3)}static getSandboxId({sandboxId:t,clientId:n}){return`${t}-${n}`}};var Sn=class e extends tc{static defaultTemplate="base";static defaultSandboxTimeoutMs=3e5;files;commands;pty;sandboxId;envdPort=49983;connectionConfig;envdApiUrl;envdApi;constructor(t){super(),this.sandboxId=t.sandboxId,this.connectionConfig=new Dt(t),this.envdApiUrl=`${this.connectionConfig.debug?"http":"https"}://${this.getHost(this.envdPort)}`;let n=am({baseUrl:this.envdApiUrl,useBinaryFormat:!1,interceptors:t?.logger?[aO(t.logger)]:void 0});this.envdApi=new wl({apiUrl:this.envdApiUrl,logger:t?.logger}),this.files=new Ll(n,this.envdApi,this.connectionConfig),this.commands=new ec(n,this.connectionConfig),this.pty=new Ha(n,this.connectionConfig)}static async create(t,n){let{template:r,sandboxOpts:i}=typeof t=="string"?{template:t,sandboxOpts:n}:{template:this.defaultTemplate,sandboxOpts:t},a=new Dt(i),s=a.debug?"debug_sandbox_id":await this.createSandbox(r,i?.timeoutMs??this.defaultSandboxTimeoutMs,i);return new this({sandboxId:s,...a})}static async connect(t,n){let r=new Dt(n);return new this({sandboxId:t,...r})}getHost(t){return this.connectionConfig.debug?`localhost:${t}`:`${t}-${this.sandboxId}.${this.connectionConfig.domain}`}async isRunning(t){let n=this.connectionConfig.getSignal(t?.requestTimeoutMs),r=await this.envdApi.api.GET("/health",{signal:n});if(r.response.status==502)return!1;let i=await Ba(r);if(i)throw i;return!0}async setTimeout(t,n){this.connectionConfig.debug||await e.setTimeout(this.sandboxId,t,{...this.connectionConfig,...n})}async kill(t){this.connectionConfig.debug||await e.kill(this.sandboxId,{...this.connectionConfig,...t})}uploadUrl(t){return this.fileUrl(t)}downloadUrl(t){return this.fileUrl(t)}fileUrl(t){let n=new URL("/files",this.envdApiUrl);return n.searchParams.set("username",yr),t&&n.searchParams.set("path",t),n.toString()}};l();var mN=Z(require("os")),pN=Z(require("path")),nc=Z(require("fs")),Xt=pN.join(mN.homedir(),".e2b","config.json"),Tm=process.env.E2B_DOCS_BASE||"https://e2b.dev/docs";function Gt(){return nc.existsSync(Xt)?JSON.parse(nc.readFileSync(Xt,"utf8")):null}var rc=process.env.E2B_API_KEY,ic=process.env.E2B_ACCESS_TOKEN,fN=Rr(`You must be logged in to use this command. Run ${pe("e2b auth login")}.
97
+ `)}function A6(e){return ye.dim(e)}function pe(e){return ye.bold(e)}function Lt(e){return ye.hex(C6)(e)}function GA(e){return ye.blue(e)}function Pt(e){return ye.blue(e)}function bt(e){return e?Pt("./"+FA(e)):""}function A_(e){return ye.blueBright(e)}function O_(e){return ye.underline(e)}function N_(e){if(e)return e.join(" | ")}function HA(e){return R_.default(e,{language:"typescript",ignoreIllegals:!0})}function YA(e){return R_.default(e,{language:"python",ignoreIllegals:!0})}var O6={topLeft:"",topRight:"",bottomLeft:"",bottomRight:"",top:"",bottom:"",left:"",right:""},kA=2,BA=1;function y_(e,t,n){return Rr(e,{borderStyle:{...O6,top:"\u2500",bottom:n?"\u2500":""},titleAlignment:"center",float:"left",title:t?pe(t):void 0,margin:{top:0,bottom:0,left:1,right:0},fullscreen:r=>[r,0],padding:{bottom:n?BA:0,left:kA,right:kA,top:BA}})}l();l();var Ka=Z(require("fs")),Gn=Z(require("path"));var Dy=Z(XA());l();async function Ca(e){return new Promise(t=>setTimeout(t,e))}l();l();l();l();var P6={"Content-Type":"application/json"},F6=/\{[^{}]+\}/g,M_=class extends Request{constructor(t,n){super(t,n);for(let r in n)r in this||(this[r]=n[r])}};function Ra(e){let{baseUrl:t="",fetch:n=globalThis.fetch,querySerializer:r,bodySerializer:i,headers:a,...s}={...e};t.endsWith("/")&&(t=t.substring(0,t.length-1)),a=jA(P6,a);let o=[];async function c(u,d){let{fetch:p=n,headers:S,params:g={},parseAs:T="json",querySerializer:N,bodySerializer:w=i??B6,...k}=d||{},M=typeof r=="function"?r:JA(r);N&&(M=typeof N=="function"?N:JA({...typeof r=="object"?r:{},...N}));let B={redirect:"follow",...s,...k,headers:jA(a,S,g.header)};B.body&&(B.body=w(B.body)),B.body instanceof FormData&&B.headers.delete("Content-Type");let Y=new M_(U6(u,{baseUrl:t,params:g,querySerializer:M}),B),re={baseUrl:t,fetch:p,parseAs:T,querySerializer:M,bodySerializer:w};for(let L of o)if(L&&typeof L=="object"&&typeof L.onRequest=="function"){Y.schemaPath=u,Y.params=g;let P=await L.onRequest(Y,re);if(P){if(!(P instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");Y=P}}let Q=await p(Y);for(let L=o.length-1;L>=0;L--){let P=o[L];if(P&&typeof P=="object"&&typeof P.onResponse=="function"){Y.schemaPath=u,Y.params=g;let $=await P.onResponse(Q,re,Y);if($){if(!($ instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");Q=$}}}if(Q.status===204||Q.headers.get("Content-Length")==="0")return Q.ok?{data:{},response:Q}:{error:{},response:Q};if(Q.ok)return T==="stream"?{data:Q.body,response:Q}:{data:await Q[T](),response:Q};let ae=await Q.text();try{ae=JSON.parse(ae)}catch{}return{error:ae,response:Q}}return{async GET(u,d){return c(u,{...d,method:"GET"})},async PUT(u,d){return c(u,{...d,method:"PUT"})},async POST(u,d){return c(u,{...d,method:"POST"})},async DELETE(u,d){return c(u,{...d,method:"DELETE"})},async OPTIONS(u,d){return c(u,{...d,method:"OPTIONS"})},async HEAD(u,d){return c(u,{...d,method:"HEAD"})},async PATCH(u,d){return c(u,{...d,method:"PATCH"})},async TRACE(u,d){return c(u,{...d,method:"TRACE"})},use(...u){for(let d of u)if(d){if(typeof d!="object"||!("onRequest"in d||"onResponse"in d))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");o.push(d)}},eject(...u){for(let d of u){let p=o.indexOf(d);p!==-1&&o.splice(p,1)}}}}function vo(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function ZA(e,t,n){if(!t||typeof t!="object")return"";let r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(let o in t)r.push(o,n.allowReserved===!0?t[o]:encodeURIComponent(t[o]));let s=r.join(",");switch(n.style){case"form":return`${e}=${s}`;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return s}}for(let s in t){let o=n.style==="deepObject"?`${e}[${s}]`:s;r.push(vo(o,t[s],n))}let a=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function eO(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){let a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",s=(n.allowReserved===!0?t:t.map(o=>encodeURIComponent(o))).join(a);switch(n.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return`${e}=${s}`}}let r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(let a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(vo(e,a,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function JA(e){return function(n){let r=[];if(n&&typeof n=="object")for(let i in n){let a=n[i];if(a!=null){if(Array.isArray(a)){r.push(eO(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){r.push(ZA(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}r.push(vo(i,a,e))}}return r.join("&")}}function k6(e,t){let n=e;for(let r of e.match(F6)??[]){let i=r.substring(1,r.length-1),a=!1,s="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(s="label",i=i.substring(1)):i.startsWith(";")&&(s="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;let o=t[i];if(Array.isArray(o)){n=n.replace(r,eO(i,o,{style:s,explode:a}));continue}if(typeof o=="object"){n=n.replace(r,ZA(i,o,{style:s,explode:a}));continue}if(s==="matrix"){n=n.replace(r,`;${vo(i,o)}`);continue}n=n.replace(r,s==="label"?`.${o}`:o)}return n}function B6(e){return JSON.stringify(e)}function U6(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=k6(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function jA(...e){let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,a]of r)if(a===null)t.delete(i);else if(Array.isArray(a))for(let s of a)t.append(i,s);else a!==void 0&&t.set(i,a)}return t}l();var Oa=Z(tO());var nO="1.0.2";function H6(){return globalThis.Bun?{runtime:"bun",version:globalThis.Bun.version}:globalThis.Deno?{runtime:"deno",version:globalThis.Deno.version.deno}:globalThis.process?.release?.name==="node"?{runtime:"node",version:Oa.default.version||"unknown"}:typeof EdgeRuntime=="string"?{runtime:"vercel-edge",version:"unknown"}:globalThis.navigator?.userAgent==="Cloudflare-Workers"?{runtime:"cloudflare-worker",version:"unknown"}:typeof window<"u"?{runtime:"browser",version:Oa.default.version||"unknown"}:{runtime:"unknown",version:"unknown"}}var{runtime:Mo,version:Y6}=H6(),rO={browser:typeof window<"u"&&Oa.default.name||"unknown",lang:"js",lang_version:Y6,package_version:nO,publisher:"e2b",sdk_runtime:Mo,system:Oa.default.os?.family||"unknown"};function Na(e){return Mo==="deno"?Deno.env.get(e):process.env[e]}l();function Po(e){return new di(`${e}: This error is likely due to sandbox timeout. You can modify the sandbox timeout by passing 'timeoutMs' when starting the sandbox or calling '.setTimeout' on the sandbox with the desired timeout.`)}var _t=class extends Error{constructor(t){super(t),this.name="SandboxError"}},di=class extends _t{constructor(t){super(t),this.name="TimeoutError"}},_i=class extends _t{constructor(t){super(t),this.name="InvalidArgumentError"}},wo=class extends _t{constructor(t){super(t),this.name="NotEnoughSpaceError"}},ir=class extends _t{constructor(t){super(t),this.name="NotFoundError"}},Ln=class extends _t{constructor(t){super(t),this.name="AuthenticationError"}},Lo=class extends _t{constructor(t){super(t),this.name="TemplateError"}};l();function iO(e){return JSON.parse(JSON.stringify(e))}function aO(e){async function*t(n){for await(let r of n)e.debug?.("Response stream:",iO(r)),yield r}return n=>async r=>{e.info?.(`Request: POST ${r.url}`);let i=await n(r);return i.stream?{...i,message:t(i.message)}:(e.info?.("Response:",iO(i.message)),i)}}function Fo(e){return{async onRequest(t){return e.info?.(`Request ${t.method} ${t.url}`),t},async onResponse(t){return t.status>=400?e.error?.("Response:",t.status,t.statusText):e.info?.("Response:",t.status,t.statusText),t}}}function ya(e){if(!e.error)return;let t=e.error?.message??e.error;return new _t(`${e.response.status}: ${t}`)}var Qt=class{api;constructor(t,n={requireAccessToken:!1,requireApiKey:!0}){if(!n?.requireApiKey&&!t.apiKey)throw new Ln("API key is required, please visit https://e2b.dev/docs to get your API key. You can either set the environment variable `E2B_API_KEY` or you can pass it directly to the sandbox like Sandbox.create({ apiKey: 'e2b_...' })");if(n?.requireAccessToken&&!t.accessToken)throw new Ln("Access token is required, please visit https://e2b.dev/docs to get your access token. You can set the environment variable `E2B_ACCESS_TOKEN` or pass the `accessToken` in options.");this.api=Ra({baseUrl:t.apiUrl,headers:{...rO,...t.apiKey&&{"X-API-KEY":t.apiKey},...t.accessToken&&{Authorization:`Bearer ${t.accessToken}`}}}),t.logger&&this.api.use(Fo(t.logger))}};l();var q6=3e4,Or=50,Nr="Keepalive-Ping-Interval",Dt=class e{debug;domain;apiUrl;logger;requestTimeoutMs;apiKey;accessToken;constructor(t){this.apiKey=t?.apiKey||e.apiKey,this.debug=t?.debug||e.debug,this.domain=t?.domain||e.domain,this.accessToken=t?.accessToken||e.accessToken,this.requestTimeoutMs=t?.requestTimeoutMs??q6,this.logger=t?.logger,this.apiUrl=this.debug?"http://localhost:3000":`https://api.${this.domain}`}static get domain(){return Na("E2B_DOMAIN")||"e2b.dev"}static get debug(){return(Na("E2B_DEBUG")||"false").toLowerCase()==="true"}static get apiKey(){return Na("E2B_API_KEY")}static get accessToken(){return Na("E2B_ACCESS_TOKEN")}getSignal(t){let n=t??this.requestTimeoutMs;return n?AbortSignal.timeout(n):void 0}},yr="user";l();l();l();l();l();var oe;(function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"})(oe||(oe={}));l();function Ia(e){let t=oe[e];return typeof t!="string"?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}var ko;function sO(e){if(!ko){ko={};for(let t of Object.values(oe))typeof t!="string"&&(ko[Ia(t)]=t)}return ko[e]}var be=class e extends Error{constructor(t,n=oe.Unknown,r,i,a){super(V6(t,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=t,this.code=n,this.metadata=new Headers(r??{}),this.details=i??[],this.cause=a}static from(t,n=oe.Unknown){return t instanceof e?t:t instanceof Error?t.name=="AbortError"?new e(t.message,oe.Canceled):new e(t.message,n,void 0,void 0,t):new e(String(t),n,void 0,void 0,t)}static[Symbol.hasInstance](t){return t instanceof Error?Object.getPrototypeOf(t)===e.prototype?!0:t.name==="ConnectError"&&"code"in t&&typeof t.code=="number"&&"metadata"in t&&"details"in t&&Array.isArray(t.details)&&"rawMessage"in t&&typeof t.rawMessage=="string"&&"cause"in t:!1}findDetails(t){let n="typeName"in t?{findMessage:i=>i===t.typeName?t:void 0}:t,r=[];for(let i of this.details){if("getType"in i){n.findMessage(i.getType().typeName)&&r.push(i);continue}let a=n.findMessage(i.type);if(a)try{r.push(a.fromBinary(i.value))}catch{}}return r}};function V6(e,t){return e.length?`[${Ia(t)}] ${e}`:`[${Ia(t)}]`}l();l();l();l();l();l();function Pe(e,t){if(!e)throw new Error(t)}var $6=34028234663852886e22,K6=-34028234663852886e22,W6=4294967295,z6=2147483647,Q6=-2147483648;function mi(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>z6||e<Q6)throw new Error("invalid int 32: "+e)}function va(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>W6||e<0)throw new Error("invalid uint 32: "+e)}function Bo(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>$6||e<K6))throw new Error("invalid float 32: "+e)}var oO=Symbol("@bufbuild/protobuf/enum-type");function lO(e){let t=e[oO];return Pe(t,"missing enum type on enum object"),t}function w_(e,t,n,r){e[oO]=L_(t,n.map(i=>({no:i.no,name:i.name,localName:e[i.no]})),r)}function L_(e,t,n){let r=Object.create(null),i=Object.create(null),a=[];for(let s of t){let o=uO(s);a.push(o),r[s.name]=o,i[s.no]=o}return{typeName:e,values:a,findName(s){return r[s]},findNumber(s){return i[s]}}}function cO(e,t,n){let r={};for(let i of t){let a=uO(i);r[a.localName]=a.no,r[a.no]=a.localName}return w_(r,e,t,n),r}function uO(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}l();l();var se=class{equals(t){return this.getType().runtime.util.equals(this.getType(),this,t)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(t,n){let r=this.getType(),i=r.runtime.bin,a=i.makeReadOptions(n);return i.readMessage(this,a.readerFactory(t),t.byteLength,a),this}fromJson(t,n){let r=this.getType(),i=r.runtime.json,a=i.makeReadOptions(n);return i.readMessage(r,t,a,this),this}fromJsonString(t,n){let r;try{r=JSON.parse(t)}catch(i){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${i instanceof Error?i.message:String(i)}`)}return this.fromJson(r,n)}toBinary(t){let n=this.getType(),r=n.runtime.bin,i=r.makeWriteOptions(t),a=i.writerFactory();return r.writeMessage(this,a,i),a.finish()}toJson(t){let n=this.getType(),r=n.runtime.json,i=r.makeWriteOptions(t);return r.writeMessage(this,i)}toJsonString(t){var n;let r=this.toJson(t);return JSON.stringify(r,null,(n=t?.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}};function dO(e,t,n,r){var i;let a=(i=r?.localName)!==null&&i!==void 0?i:t.substring(t.lastIndexOf(".")+1),s={[a]:function(o){e.util.initFields(this),e.util.initPartial(o,this)}}[a];return Object.setPrototypeOf(s.prototype,new se),Object.assign(s,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary(o,c){return new s().fromBinary(o,c)},fromJson(o,c){return new s().fromJson(o,c)},fromJsonString(o,c){return new s().fromJsonString(o,c)},equals(o,c){return e.util.equals(s,o,c)}}),s}l();l();l();l();function mO(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<r,!(i&128))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Go(e,t,n){for(let a=0;a<28;a=a+7){let s=e>>>a,o=!(!(s>>>7)&&t==0),c=(o?s|128:s)&255;if(n.push(c),!o)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),!!i){for(let a=3;a<31;a=a+7){let s=t>>>a,o=!!(s>>>7),c=(o?s|128:s)&255;if(n.push(c),!o)return}n.push(t>>>31&1)}}var Uo=4294967296;function P_(e){let t=e[0]==="-";t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(s,o){let c=Number(e.slice(s,o));i*=n,r=r*n+c,r>=Uo&&(i=i+(r/Uo|0),r=r%Uo)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?EO(r,i):k_(r,i)}function pO(e,t){let n=k_(e,t),r=n.hi&2147483648;r&&(n=EO(n.lo,n.hi));let i=F_(n.lo,n.hi);return r?"-"+i:i}function F_(e,t){if({lo:e,hi:t}=X6(e,t),t<=2097151)return String(Uo*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,s=r+i*8147497,o=i*2,c=1e7;return a>=c&&(s+=Math.floor(a/c),a%=c),s>=c&&(o+=Math.floor(s/c),s%=c),o.toString()+_O(s)+_O(a)}function X6(e,t){return{lo:e>>>0,hi:t>>>0}}function k_(e,t){return{lo:e|0,hi:t|0}}function EO(e,t){return t=~t,e?e=~e+1:t+=1,k_(e,t)}var _O=e=>{let t=String(e);return"0000000".slice(t.length)+t};function B_(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function fO(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}function J6(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),a=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(c){let u=typeof c=="bigint"?c:BigInt(c);if(u>a||u<i)throw new Error(`int64 invalid: ${c}`);return u},uParse(c){let u=typeof c=="bigint"?c:BigInt(c);if(u>o||u<s)throw new Error(`uint64 invalid: ${c}`);return u},enc(c){return e.setBigInt64(0,this.parse(c),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(c){return e.setBigInt64(0,this.uParse(c),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(c,u){return e.setInt32(0,c,!0),e.setInt32(4,u,!0),e.getBigInt64(0,!0)},uDec(c,u){return e.setInt32(0,c,!0),e.setInt32(4,u,!0),e.getBigUint64(0,!0)}}}let n=i=>Pe(/^-?[0-9]+$/.test(i),`int64 invalid: ${i}`),r=i=>Pe(/^[0-9]+$/.test(i),`uint64 invalid: ${i}`);return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),n(i),P_(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),P_(i)},dec(i,a){return pO(i,a)},uDec(i,a){return F_(i,a)}}}var Ct=J6();l();var G;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(G||(G={}));var sn;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"})(sn||(sn={}));function Pn(e,t,n){if(t===n)return!0;if(e==G.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array)||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}switch(e){case G.UINT64:case G.FIXED64:case G.INT64:case G.SFIXED64:case G.SINT64:return t==n}return!1}function on(e,t){switch(e){case G.BOOL:return!1;case G.UINT64:case G.FIXED64:case G.INT64:case G.SFIXED64:case G.SINT64:return t==0?Ct.zero:"0";case G.DOUBLE:case G.FLOAT:return 0;case G.BYTES:return new Uint8Array(0);case G.STRING:return"";default:return 0}}function Ho(e,t){switch(e){case G.BOOL:return t===!1;case G.STRING:return t==="";case G.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}l();var Xe;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Xe||(Xe={}));var Yo=class{constructor(t){this.stack=[],this.textEncoder=t??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let n=new Uint8Array(t),r=0;for(let i=0;i<this.chunks.length;i++)n.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,n){return this.uint32((t<<3|n)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(va(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return mi(t),B_(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){Bo(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){va(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){mi(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return mi(t),t=(t<<1^t>>31)>>>0,B_(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Ct.enc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Ct.uEnc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(t){let n=Ct.enc(t);return Go(n.lo,n.hi,this.buf),this}sint64(t){let n=Ct.enc(t),r=n.hi>>31,i=n.lo<<1^r,a=(n.hi<<1|n.lo>>>31)^r;return Go(i,a,this.buf),this}uint64(t){let n=Ct.uEnc(t);return Go(n.lo,n.hi,this.buf),this}},qo=class{constructor(t,n){this.varint64=mO,this.uint32=fO,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n??new TextDecoder}tag(){let t=this.uint32(),n=t>>>3,r=t&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(t,n){let r=this.pos;switch(t){case Xe.Varint:for(;this.buf[this.pos++]&128;);break;case Xe.Bit64:this.pos+=4;case Xe.Bit32:this.pos+=4;break;case Xe.LengthDelimited:let i=this.uint32();this.pos+=i;break;case Xe.StartGroup:for(;;){let[a,s]=this.tag();if(s===Xe.EndGroup){if(n!==void 0&&a!==n)throw new Error("invalid end group tag");break}this.skip(s,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Ct.dec(...this.varint64())}uint64(){return Ct.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),r=-(t&1);return t=(t>>>1|(n&1)<<31)^r,n=n>>>1^r,Ct.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ct.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ct.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}};function gO(e,t,n,r){let i;return{typeName:t,extendee:n,get field(){if(!i){let a=typeof r=="function"?r():r;a.name=t.split(".").pop(),a.jsonName=`[${t}]`,i=e.util.newFieldList([a]).list()[0]}return i},runtime:e}}function Vo(e){let t=e.field.localName,n=Object.create(null);return n[t]=j6(e),[n,()=>n[t]]}function j6(e){let t=e.field;if(t.repeated)return[];if(t.default!==void 0)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return on(t.T,t.L);case"message":let n=t.T,r=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function SO(e,t){if(!t.repeated&&(t.kind=="enum"||t.kind=="scalar")){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.no)return[e[n]];return[]}return e.filter(n=>n.no===t.no)}l();l();var Fn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),$o=[];for(let e=0;e<Fn.length;e++)$o[Fn[e].charCodeAt(0)]=e;$o["-".charCodeAt(0)]=Fn.indexOf("+");$o["_".charCodeAt(0)]=Fn.indexOf("/");var ar={dec(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let n=new Uint8Array(t),r=0,i=0,a,s=0;for(let o=0;o<e.length;o++){if(a=$o[e.charCodeAt(o)],a===void 0)switch(e[o]){case"=":i=0;case`
98
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=a,i=1;break;case 1:n[r++]=s<<2|(a&48)>>4,s=a,i=2;break;case 2:n[r++]=(s&15)<<4|(a&60)>>2,s=a,i=3;break;case 3:n[r++]=(s&3)<<6|a,i=0;break}}if(i==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc(e){let t="",n=0,r,i=0;for(let a=0;a<e.length;a++)switch(r=e[a],n){case 0:t+=Fn[r>>2],i=(r&3)<<4,n=1;break;case 1:t+=Fn[i|r>>4],i=(r&15)<<2,n=2;break;case 2:t+=Fn[i|r>>6],t+=Fn[r&63],n=0;break}return n&&(t+=Fn[i],t+="=",n==1&&(t+="=")),t}};l();function TO(e,t,n){bO(t,e);let r=t.runtime.bin.makeReadOptions(n),i=SO(e.getType().runtime.bin.listUnknownFields(e),t.field),[a,s]=Vo(t);for(let o of i)t.runtime.bin.readField(a,r.readerFactory(o.data),t.field,o.wireType,r);return s()}function hO(e,t,n,r){bO(t,e);let i=t.runtime.bin.makeReadOptions(r),a=t.runtime.bin.makeWriteOptions(r);if(U_(e,t)){let u=e.getType().runtime.bin.listUnknownFields(e).filter(d=>d.no!=t.field.no);e.getType().runtime.bin.discardUnknownFields(e);for(let d of u)e.getType().runtime.bin.onUnknownField(e,d.no,d.wireType,d.data)}let s=a.writerFactory(),o=t.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(o,n,s,a);let c=i.readerFactory(s.finish());for(;c.pos<c.len;){let[u,d]=c.tag(),p=c.skip(d,u);e.getType().runtime.bin.onUnknownField(e,u,d,p)}}function U_(e,t){let n=e.getType();return t.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(e).find(r=>r.no==t.field.no)}function bO(e,t){Pe(e.extendee.typeName==t.getType().typeName,`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}l();function Ko(e,t){let n=e.localName;if(e.repeated)return t[n].length>0;if(e.oneof)return t[e.oneof.localName].case===n;switch(e.kind){case"enum":case"scalar":return e.opt||e.req?t[n]!==void 0:e.kind=="enum"?t[n]!==e.T.values[0].no:!Ho(e.T,t[n]);case"message":return t[n]!==void 0;case"map":return Object.keys(t[n]).length>0}}function G_(e,t){let n=e.localName,r=!e.opt&&!e.req;if(e.repeated)t[n]=[];else if(e.oneof)t[e.oneof.localName]={case:void 0};else switch(e.kind){case"map":t[n]={};break;case"enum":t[n]=r?e.T.values[0].no:void 0;break;case"scalar":t[n]=r?on(e.T,e.L):void 0;break;case"message":t[n]=void 0;break}}l();l();function ln(e,t){if(e===null||typeof e!="object"||!Object.getOwnPropertyNames(se.prototype).every(r=>r in e&&typeof e[r]=="function"))return!1;let n=e.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:t===void 0?!0:n.typeName==t.typeName}function Wo(e,t){return ln(t)||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}var dne={"google.protobuf.DoubleValue":G.DOUBLE,"google.protobuf.FloatValue":G.FLOAT,"google.protobuf.Int64Value":G.INT64,"google.protobuf.UInt64Value":G.UINT64,"google.protobuf.Int32Value":G.INT32,"google.protobuf.UInt32Value":G.UINT32,"google.protobuf.BoolValue":G.BOOL,"google.protobuf.StringValue":G.STRING,"google.protobuf.BytesValue":G.BYTES};var DO={ignoreUnknownFields:!1},CO={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Z6(e){return e?Object.assign(Object.assign({},DO),e):DO}function eU(e){return e?Object.assign(Object.assign({},CO),e):CO}var Xo=Symbol(),zo=Symbol();function OO(){return{makeReadOptions:Z6,makeWriteOptions:eU,readMessage(e,t,n,r){if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.typeName} from JSON: ${gn(t)}`);r=r??new e;let i=new Map,a=n.typeRegistry;for(let[s,o]of Object.entries(t)){let c=e.fields.findJsonName(s);if(c){if(c.oneof){if(o===null&&c.kind=="scalar")continue;let u=i.get(c.oneof);if(u!==void 0)throw new Error(`cannot decode message ${e.typeName} from JSON: multiple keys for oneof "${c.oneof.name}" present: "${u}", "${s}"`);i.set(c.oneof,s)}RO(r,o,c,n,e)}else{let u=!1;if(a?.findExtension&&s.startsWith("[")&&s.endsWith("]")){let d=a.findExtension(s.substring(1,s.length-1));if(d&&d.extendee.typeName==e.typeName){u=!0;let[p,S]=Vo(d);RO(p,o,d.field,n,d),hO(r,d,S(),n)}}if(!u&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${e.typeName} from JSON: key "${s}" is unknown`)}}return r},writeMessage(e,t){let n=e.getType(),r={},i;try{for(i of n.fields.byNumber()){if(!Ko(i,e)){if(i.req)throw"required field not set";if(!t.emitDefaultValues||!nU(i))continue}let s=i.oneof?e[i.oneof.localName].value:e[i.localName],o=AO(i,s,t);o!==void 0&&(r[t.useProtoFieldName?i.name:i.jsonName]=o)}let a=t.typeRegistry;if(a?.findExtensionFor)for(let s of n.runtime.bin.listUnknownFields(e)){let o=a.findExtensionFor(n.typeName,s.no);if(o&&U_(e,o)){let c=TO(e,o,t),u=AO(o.field,c,t);u!==void 0&&(r[o.field.jsonName]=u)}}}catch(a){let s=i?`cannot encode field ${n.typeName}.${i.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,o=a instanceof Error?a.message:String(a);throw new Error(s+(o.length>0?`: ${o}`:""))}return r},readScalar(e,t,n){return xa(e,t,n??sn.BIGINT,!0)},writeScalar(e,t,n){if(t!==void 0&&(n||Ho(e,t)))return Qo(e,t)},debug:gn}}function gn(e){if(e===null)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function RO(e,t,n,r,i){let a=n.localName;if(n.repeated){if(Pe(n.kind!="map"),t===null)return;if(!Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(t)}`);let s=e[a];for(let o of t){if(o===null)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(o)}`);switch(n.kind){case"message":s.push(n.T.fromJson(o,r));break;case"enum":let c=H_(n.T,o,r.ignoreUnknownFields,!0);c!==zo&&s.push(c);break;case"scalar":try{s.push(xa(n.T,o,n.L,!0))}catch(u){let d=`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(o)}`;throw u instanceof Error&&u.message.length>0&&(d+=`: ${u.message}`),new Error(d)}break}}}else if(n.kind=="map"){if(t===null)return;if(typeof t!="object"||Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(t)}`);let s=e[a];for(let[o,c]of Object.entries(t)){if(c===null)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: map value null`);let u;try{u=tU(n.K,o)}catch(d){let p=`cannot decode map key for field ${i.typeName}.${n.name} from JSON: ${gn(t)}`;throw d instanceof Error&&d.message.length>0&&(p+=`: ${d.message}`),new Error(p)}switch(n.V.kind){case"message":s[u]=n.V.T.fromJson(c,r);break;case"enum":let d=H_(n.V.T,c,r.ignoreUnknownFields,!0);d!==zo&&(s[u]=d);break;case"scalar":try{s[u]=xa(n.V.T,c,sn.BIGINT,!0)}catch(p){let S=`cannot decode map value for field ${i.typeName}.${n.name} from JSON: ${gn(t)}`;throw p instanceof Error&&p.message.length>0&&(S+=`: ${p.message}`),new Error(S)}break}}}else switch(n.oneof&&(e=e[n.oneof.localName]={case:a},a="value"),n.kind){case"message":let s=n.T;if(t===null&&s.typeName!="google.protobuf.Value")return;let o=e[a];ln(o)?o.fromJson(t,r):(e[a]=o=s.fromJson(t,r),s.fieldWrapper&&!n.oneof&&(e[a]=s.fieldWrapper.unwrapField(o)));break;case"enum":let c=H_(n.T,t,r.ignoreUnknownFields,!1);switch(c){case Xo:G_(n,e);break;case zo:break;default:e[a]=c;break}break;case"scalar":try{let u=xa(n.T,t,n.L,!1);switch(u){case Xo:G_(n,e);break;default:e[a]=u;break}}catch(u){let d=`cannot decode field ${i.typeName}.${n.name} from JSON: ${gn(t)}`;throw u instanceof Error&&u.message.length>0&&(d+=`: ${u.message}`),new Error(d)}break}}function tU(e,t){if(e===G.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1;break}return xa(e,t,sn.BIGINT,!0).toString()}function xa(e,t,n,r){if(t===null)return r?on(e,n):Xo;switch(e){case G.DOUBLE:case G.FLOAT:if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""||typeof t=="string"&&t.trim().length!==t.length||typeof t!="string"&&typeof t!="number")break;let i=Number(t);if(Number.isNaN(i)||!Number.isFinite(i))break;return e==G.FLOAT&&Bo(i),i;case G.INT32:case G.FIXED32:case G.SFIXED32:case G.SINT32:case G.UINT32:let a;if(typeof t=="number"?a=t:typeof t=="string"&&t.length>0&&t.trim().length===t.length&&(a=Number(t)),a===void 0)break;return e==G.UINT32||e==G.FIXED32?va(a):mi(a),a;case G.INT64:case G.SFIXED64:case G.SINT64:if(typeof t!="number"&&typeof t!="string")break;let s=Ct.parse(t);return n?s.toString():s;case G.FIXED64:case G.UINT64:if(typeof t!="number"&&typeof t!="string")break;let o=Ct.uParse(t);return n?o.toString():o;case G.BOOL:if(typeof t!="boolean")break;return t;case G.STRING:if(typeof t!="string")break;try{encodeURIComponent(t)}catch{throw new Error("invalid UTF8")}return t;case G.BYTES:if(t==="")return new Uint8Array(0);if(typeof t!="string")break;return ar.dec(t)}throw new Error}function H_(e,t,n,r){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:r?e.values[0].no:Xo;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":let i=e.findName(t);if(i!==void 0)return i.no;if(n)return zo;break}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${gn(t)}`)}function nU(e){return e.repeated||e.kind=="map"?!0:!(e.oneof||e.kind=="message"||e.opt||e.req)}function AO(e,t,n){if(e.kind=="map"){Pe(typeof t=="object"&&t!=null);let r={},i=Object.entries(t);switch(e.V.kind){case"scalar":for(let[s,o]of i)r[s.toString()]=Qo(e.V.T,o);break;case"message":for(let[s,o]of i)r[s.toString()]=o.toJson(n);break;case"enum":let a=e.V.T;for(let[s,o]of i)r[s.toString()]=Y_(a,o,n.enumAsInteger);break}return n.emitDefaultValues||i.length>0?r:void 0}if(e.repeated){Pe(Array.isArray(t));let r=[];switch(e.kind){case"scalar":for(let i=0;i<t.length;i++)r.push(Qo(e.T,t[i]));break;case"enum":for(let i=0;i<t.length;i++)r.push(Y_(e.T,t[i],n.enumAsInteger));break;case"message":for(let i=0;i<t.length;i++)r.push(t[i].toJson(n));break}return n.emitDefaultValues||r.length>0?r:void 0}switch(e.kind){case"scalar":return Qo(e.T,t);case"enum":return Y_(e.T,t,n.enumAsInteger);case"message":return Wo(e.T,t).toJson(n)}}function Y_(e,t,n){var r;if(Pe(typeof t=="number"),e.typeName=="google.protobuf.NullValue")return null;if(n)return t;let i=e.findNumber(t);return(r=i?.name)!==null&&r!==void 0?r:t}function Qo(e,t){switch(e){case G.INT32:case G.SFIXED32:case G.SINT32:case G.FIXED32:case G.UINT32:return Pe(typeof t=="number"),t;case G.FLOAT:case G.DOUBLE:return Pe(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case G.STRING:return Pe(typeof t=="string"),t;case G.BOOL:return Pe(typeof t=="boolean"),t;case G.UINT64:case G.FIXED64:case G.INT64:case G.SFIXED64:case G.SINT64:return Pe(typeof t=="bigint"||typeof t=="string"||typeof t=="number"),t.toString();case G.BYTES:return Pe(t instanceof Uint8Array),ar.enc(t)}}l();var pi=Symbol("@bufbuild/protobuf/unknown-fields"),NO={readUnknownFields:!0,readerFactory:e=>new qo(e)},yO={writeUnknownFields:!0,writerFactory:()=>new Yo};function rU(e){return e?Object.assign(Object.assign({},NO),e):NO}function iU(e){return e?Object.assign(Object.assign({},yO),e):yO}function MO(){return{makeReadOptions:rU,makeWriteOptions:iU,listUnknownFields(e){var t;return(t=e[pi])!==null&&t!==void 0?t:[]},discardUnknownFields(e){delete e[pi]},writeUnknownFields(e,t){let r=e[pi];if(r)for(let i of r)t.tag(i.no,i.wireType).raw(i.data)},onUnknownField(e,t,n,r){let i=e;Array.isArray(i[pi])||(i[pi]=[]),i[pi].push({no:t,wireType:n,data:r})},readMessage(e,t,n,r,i){let a=e.getType(),s=i?t.len:t.pos+n,o,c;for(;t.pos<s&&([o,c]=t.tag(),!(i===!0&&c==Xe.EndGroup));){let u=a.fields.find(o);if(!u){let d=t.skip(c,o);r.readUnknownFields&&this.onUnknownField(e,o,c,d);continue}IO(e,t,u,c,r)}if(i&&(c!=Xe.EndGroup||o!==n))throw new Error("invalid end group tag")},readField:IO,writeMessage(e,t,n){let r=e.getType();for(let i of r.fields.byNumber()){if(!Ko(i,e)){if(i.req)throw new Error(`cannot encode field ${r.typeName}.${i.name} to binary: required field not set`);continue}let a=i.oneof?e[i.oneof.localName].value:e[i.localName];vO(i,a,t,n)}return n.writeUnknownFields&&this.writeUnknownFields(e,t),t},writeField(e,t,n,r){t!==void 0&&vO(e,t,n,r)}}}function IO(e,t,n,r,i){let{repeated:a,localName:s}=n;switch(n.oneof&&(e=e[n.oneof.localName],e.case!=s&&delete e.value,e.case=s,s="value"),n.kind){case"scalar":case"enum":let o=n.kind=="enum"?G.INT32:n.T,c=jo;if(n.kind=="scalar"&&n.L>0&&(c=sU),a){let S=e[s];if(r==Xe.LengthDelimited&&o!=G.STRING&&o!=G.BYTES){let T=t.uint32()+t.pos;for(;t.pos<T;)S.push(c(t,o))}else S.push(c(t,o))}else e[s]=c(t,o);break;case"message":let u=n.T;a?e[s].push(Jo(t,new u,i,n)):ln(e[s])?Jo(t,e[s],i,n):(e[s]=Jo(t,new u,i,n),u.fieldWrapper&&!n.oneof&&!n.repeated&&(e[s]=u.fieldWrapper.unwrapField(e[s])));break;case"map":let[d,p]=aU(n,t,i);e[s][d]=p;break}}function Jo(e,t,n,r){let i=t.getType().runtime.bin,a=r?.delimited;return i.readMessage(t,e,a?r.no:e.uint32(),n,a),t}function aU(e,t,n){let r=t.uint32(),i=t.pos+r,a,s;for(;t.pos<i;){let[o]=t.tag();switch(o){case 1:a=jo(t,e.K);break;case 2:switch(e.V.kind){case"scalar":s=jo(t,e.V.T);break;case"enum":s=t.int32();break;case"message":s=Jo(t,new e.V.T,n,void 0);break}break}}if(a===void 0&&(a=on(e.K,sn.BIGINT)),typeof a!="string"&&typeof a!="number"&&(a=a.toString()),s===void 0)switch(e.V.kind){case"scalar":s=on(e.V.T,sn.BIGINT);break;case"enum":s=e.V.T.values[0].no;break;case"message":s=new e.V.T;break}return[a,s]}function sU(e,t){let n=jo(e,t);return typeof n=="bigint"?n.toString():n}function jo(e,t){switch(t){case G.STRING:return e.string();case G.BOOL:return e.bool();case G.DOUBLE:return e.double();case G.FLOAT:return e.float();case G.INT32:return e.int32();case G.INT64:return e.int64();case G.UINT64:return e.uint64();case G.FIXED64:return e.fixed64();case G.BYTES:return e.bytes();case G.FIXED32:return e.fixed32();case G.SFIXED32:return e.sfixed32();case G.SFIXED64:return e.sfixed64();case G.SINT64:return e.sint64();case G.UINT32:return e.uint32();case G.SINT32:return e.sint32()}}function vO(e,t,n,r){Pe(t!==void 0);let i=e.repeated;switch(e.kind){case"scalar":case"enum":let a=e.kind=="enum"?G.INT32:e.T;if(i)if(Pe(Array.isArray(t)),e.packed)lU(n,a,e.no,t);else for(let s of t)Ma(n,a,e.no,s);else Ma(n,a,e.no,t);break;case"message":if(i){Pe(Array.isArray(t));for(let s of t)xO(n,r,e,s)}else xO(n,r,e,t);break;case"map":Pe(typeof t=="object"&&t!=null);for(let[s,o]of Object.entries(t))oU(n,r,e,s,o);break}}function oU(e,t,n,r,i){e.tag(n.no,Xe.LengthDelimited),e.fork();let a=r;switch(n.K){case G.INT32:case G.FIXED32:case G.UINT32:case G.SFIXED32:case G.SINT32:a=Number.parseInt(r);break;case G.BOOL:Pe(r=="true"||r=="false"),a=r=="true";break}switch(Ma(e,n.K,1,a),n.V.kind){case"scalar":Ma(e,n.V.T,2,i);break;case"enum":Ma(e,G.INT32,2,i);break;case"message":Pe(i!==void 0),e.tag(2,Xe.LengthDelimited).bytes(i.toBinary(t));break}e.join()}function xO(e,t,n,r){let i=Wo(n.T,r);n.delimited?e.tag(n.no,Xe.StartGroup).raw(i.toBinary(t)).tag(n.no,Xe.EndGroup):e.tag(n.no,Xe.LengthDelimited).bytes(i.toBinary(t))}function Ma(e,t,n,r){Pe(r!==void 0);let[i,a]=wO(t);e.tag(n,i)[a](r)}function lU(e,t,n,r){if(!r.length)return;e.tag(n,Xe.LengthDelimited).fork();let[,i]=wO(t);for(let a=0;a<r.length;a++)e[i](r[a]);e.join()}function wO(e){let t=Xe.Varint;switch(e){case G.BYTES:case G.STRING:t=Xe.LengthDelimited;break;case G.DOUBLE:case G.FIXED64:case G.SFIXED64:t=Xe.Bit64;break;case G.FIXED32:case G.SFIXED32:case G.FLOAT:t=Xe.Bit32;break}let n=G[e].toLowerCase();return[t,n]}l();function LO(){return{setEnumType:w_,initPartial(e,t){if(e===void 0)return;let n=t.getType();for(let r of n.fields.byMember()){let i=r.localName,a=t,s=e;if(s[i]!=null)switch(r.kind){case"oneof":let o=s[i].case;if(o===void 0)continue;let c=r.findField(o),u=s[i].value;c&&c.kind=="message"&&!ln(u,c.T)?u=new c.T(u):c&&c.kind==="scalar"&&c.T===G.BYTES&&(u=wa(u)),a[i]={case:o,value:u};break;case"scalar":case"enum":let d=s[i];r.T===G.BYTES&&(d=r.repeated?d.map(wa):wa(d)),a[i]=d;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===G.BYTES)for(let[g,T]of Object.entries(s[i]))a[i][g]=wa(T);else Object.assign(a[i],s[i]);break;case"message":let S=r.V.T;for(let g of Object.keys(s[i])){let T=s[i][g];S.fieldWrapper||(T=new S(T)),a[i][g]=T}break}break;case"message":let p=r.T;if(r.repeated)a[i]=s[i].map(S=>ln(S,p)?S:new p(S));else{let S=s[i];p.fieldWrapper?p.typeName==="google.protobuf.BytesValue"?a[i]=wa(S):a[i]=S:a[i]=ln(S,p)?S:new p(S)}break}}},equals(e,t,n){return t===n?!0:!t||!n?!1:e.fields.byMember().every(r=>{let i=t[r.localName],a=n[r.localName];if(r.repeated){if(i.length!==a.length)return!1;switch(r.kind){case"message":return i.every((s,o)=>r.T.equals(s,a[o]));case"scalar":return i.every((s,o)=>Pn(r.T,s,a[o]));case"enum":return i.every((s,o)=>Pn(G.INT32,s,a[o]))}throw new Error(`repeated cannot contain ${r.kind}`)}switch(r.kind){case"message":return r.T.equals(i,a);case"enum":return Pn(G.INT32,i,a);case"scalar":return Pn(r.T,i,a);case"oneof":if(i.case!==a.case)return!1;let s=r.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,a.value);case"enum":return Pn(G.INT32,i.value,a.value);case"scalar":return Pn(s.T,i.value,a.value)}throw new Error(`oneof cannot contain ${s.kind}`);case"map":let o=Object.keys(i).concat(Object.keys(a));switch(r.V.kind){case"message":let c=r.V.T;return o.every(d=>c.equals(i[d],a[d]));case"enum":return o.every(d=>Pn(G.INT32,i[d],a[d]));case"scalar":let u=r.V.T;return o.every(d=>Pn(u,i[d],a[d]))}break}})},clone(e){let t=e.getType(),n=new t,r=n;for(let i of t.fields.byMember()){let a=e[i.localName],s;if(i.repeated)s=a.map(Zo);else if(i.kind=="map"){s=r[i.localName];for(let[o,c]of Object.entries(a))s[o]=Zo(c)}else i.kind=="oneof"?s=i.findField(a.case)?{case:a.case,value:Zo(a.value)}:{case:void 0}:s=Zo(a);r[i.localName]=s}for(let i of t.runtime.bin.listUnknownFields(e))t.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return n}}}function Zo(e){if(e===void 0)return e;if(ln(e))return e.clone();if(e instanceof Uint8Array){let t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function wa(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function PO(e,t,n){return{syntax:e,json:OO(),bin:MO(),util:Object.assign(Object.assign({},LO()),{newFieldList:t,initFields:n}),makeMessageType(r,i,a){return dO(this,r,i,a)},makeEnum:cO,makeEnumType:L_,getEnumType:lO,makeExtension(r,i,a){return gO(this,r,i,a)}}}l();var el=class{constructor(t,n){this._fields=t,this._normalizer=n}findJsonName(t){if(!this.jsonNames){let n={};for(let r of this.list())n[r.jsonName]=n[r.name]=r;this.jsonNames=n}return this.jsonNames[t]}find(t){if(!this.numbers){let n={};for(let r of this.list())n[r.no]=r;this.numbers=n}return this.numbers[t]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((t,n)=>t.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];let t=this.members,n;for(let r of this.list())r.oneof?r.oneof!==n&&(n=r.oneof,t.push(n)):t.push(r)}return this.members}};l();l();l();function q_(e,t){let n=BO(e);return t?n:_U(dU(n))}function FO(e){return q_(e,!1)}var kO=BO;function BO(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);switch(i){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),n.push(i);break}}return n.join("")}var cU=new Set(["constructor","toString","toJSON","valueOf"]),uU=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),UO=e=>`${e}$`,dU=e=>uU.has(e)?UO(e):e,_U=e=>cU.has(e)?UO(e):e;var tl=class{constructor(t){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=t,this.localName=FO(t)}addField(t){Pe(t.oneof===this,`field ${t.name} not one of ${this.name}`),this.fields.push(t)}findField(t){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n<this.fields.length;n++)this._lookup[this.fields[n].localName]=this.fields[n]}return this._lookup[t]}};function GO(e,t){var n,r,i,a,s,o;let c=[],u;for(let d of typeof e=="function"?e():e){let p=d;if(p.localName=q_(d.name,d.oneof!==void 0),p.jsonName=(n=d.jsonName)!==null&&n!==void 0?n:kO(d.name),p.repeated=(r=d.repeated)!==null&&r!==void 0?r:!1,d.kind=="scalar"&&(p.L=(i=d.L)!==null&&i!==void 0?i:sn.BIGINT),p.delimited=(a=d.delimited)!==null&&a!==void 0?a:!1,p.req=(s=d.req)!==null&&s!==void 0?s:!1,p.opt=(o=d.opt)!==null&&o!==void 0?o:!1,d.packed===void 0&&(t?p.packed=d.kind=="enum"||d.kind=="scalar"&&d.T!=G.BYTES&&d.T!=G.STRING:p.packed=!1),d.oneof!==void 0){let S=typeof d.oneof=="string"?d.oneof:d.oneof.name;(!u||u.name!=S)&&(u=new tl(S)),p.oneof=u,u.addField(p)}c.push(p)}return c}var C=PO("proto3",e=>new el(e,t=>GO(t,!0)),e=>{for(let t of e.getType().fields.byMember()){if(t.opt)continue;let n=t.localName,r=e;if(t.repeated){r[n]=[];continue}switch(t.kind){case"oneof":r[n]={case:void 0};break;case"enum":r[n]=0;break;case"map":r[n]={};break;case"scalar":r[n]=on(t.T,t.L);break;case"message":break}}});l();var ve;(function(e){e[e.Unary=0]="Unary",e[e.ServerStreaming=1]="ServerStreaming",e[e.ClientStreaming=2]="ClientStreaming",e[e.BiDiStreaming=3]="BiDiStreaming"})(ve||(ve={}));var La;(function(e){e[e.NoSideEffects=1]="NoSideEffects",e[e.Idempotent=2]="Idempotent"})(La||(La={}));function V_(...e){let t=new Headers;for(let n of e)n.forEach((r,i)=>{t.append(i,r)});return t}l();function HO(e,t){let n={};for(let[r,i]of Object.entries(e.methods)){let a=t(Object.assign(Object.assign({},i),{localName:r,service:e}));a!=null&&(n[r]=a)}return n}l();l();l();var nl=1;function $_(e){let t,n=new Uint8Array(0);function r(i){let a=new Uint8Array(n.length+i.length);a.set(n),a.set(i,n.length),n=a}return new ReadableStream({start(){t=e.getReader()},async pull(i){let a;for(;;){if(a===void 0&&n.byteLength>=5){let c=0;for(let u=1;u<5;u++)c=(c<<8)+n[u];a={flags:n[0],length:c}}if(a!==void 0&&n.byteLength>=a.length+5)break;let o=await t.read();if(o.done)break;r(o.value)}if(a===void 0){if(n.byteLength==0){i.close();return}i.error(new be("premature end of stream",oe.DataLoss));return}let s=n.subarray(5,5+a.length);n=n.subarray(5+a.length),i.enqueue({flags:a.flags,data:s})}})}function K_(e,t){let n=new Uint8Array(t.length+5);n.set(t,5);let r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,e),r.setUint32(1,t.length),n}var mU=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(s){return new Promise(function(o,c){s=e[a](s),i(o,c,s.done,s.value)})}}function i(a,s,o,c){Promise.resolve(c).then(function(u){a({value:u,done:o})},s)}},Pa=function(e){return this instanceof Pa?(this.v=e,this):new Pa(e)},pU=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(T){return Promise.resolve(T).then(g,p)}}function o(g,T){r[g]&&(i[g]=function(N){return new Promise(function(w,k){a.push([g,N,w,k])>1||c(g,N)})},T&&(i[g]=T(i[g])))}function c(g,T){try{u(r[g](T))}catch(N){S(a[0][3],N)}}function u(g){g.value instanceof Pa?Promise.resolve(g.value.v).then(d,p):S(a[0][2],g)}function d(g){c("next",g)}function p(g){c("throw",g)}function S(g,T){g(T),a.shift(),a.length&&c(a[0][0],a[0][1])}},EU=function(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,a){t[i]=e[i]?function(s){return(n=!n)?{value:Pa(e[i](s)),done:!1}:a?a(s):s}:a}};function YO(e){return pU(this,arguments,function*(){yield Pa(yield*EU(mU(e)))})}l();var qO=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(s){return new Promise(function(o,c){s=e[a](s),i(o,c,s.done,s.value)})}}function i(a,s,o,c){Promise.resolve(c).then(function(u){a({value:u,done:o})},s)}},Ei=function(e){return this instanceof Ei?(this.v=e,this):new Ei(e)},fU=function(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,a){t[i]=e[i]?function(s){return(n=!n)?{value:Ei(e[i](s)),done:!1}:a?a(s):s}:a}},gU=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(T){return Promise.resolve(T).then(g,p)}}function o(g,T){r[g]&&(i[g]=function(N){return new Promise(function(w,k){a.push([g,N,w,k])>1||c(g,N)})},T&&(i[g]=T(i[g])))}function c(g,T){try{u(r[g](T))}catch(N){S(a[0][3],N)}}function u(g){g.value instanceof Ei?Promise.resolve(g.value.v).then(d,p):S(a[0][2],g)}function d(g){c("next",g)}function p(g){c("throw",g)}function S(g,T){g(T),a.shift(),a.length&&c(a[0][0],a[0][1])}};function Ir(e,t){return HO(e,n=>{switch(n.kind){case ve.Unary:return SU(t,e,n);case ve.ServerStreaming:return TU(t,e,n);case ve.ClientStreaming:return hU(t,e,n);case ve.BiDiStreaming:return bU(t,e,n);default:return null}})}function SU(e,t,n){return async function(r,i){var a,s;let o=await e.unary(t,n,i?.signal,i?.timeoutMs,i?.headers,r,i?.contextValues);return(a=i?.onHeader)===null||a===void 0||a.call(i,o.header),(s=i?.onTrailer)===null||s===void 0||s.call(i,o.trailer),o.message}}function TU(e,t,n){return function(r,i){return VO(e.stream(t,n,i?.signal,i?.timeoutMs,i?.headers,YO([r]),i?.contextValues),i)}}function hU(e,t,n){return async function(r,i){var a,s,o,c,u,d;let p=await e.stream(t,n,i?.signal,i?.timeoutMs,i?.headers,r,i?.contextValues);(u=i?.onHeader)===null||u===void 0||u.call(i,p.header);let S,g=0;try{for(var T=!0,N=qO(p.message),w;w=await N.next(),a=w.done,!a;T=!0)c=w.value,T=!1,S=c,g++}catch(k){s={error:k}}finally{try{!T&&!a&&(o=N.return)&&await o.call(N)}finally{if(s)throw s.error}}if(!S)throw new be("protocol error: missing response message",oe.Unimplemented);if(g>1)throw new be("protocol error: received extra messages for client streaming method",oe.Unimplemented);return(d=i?.onTrailer)===null||d===void 0||d.call(i,p.trailer),S}}function bU(e,t,n){return function(r,i){return VO(e.stream(t,n,i?.signal,i?.timeoutMs,i?.headers,r,i?.contextValues),i)}}function VO(e,t){let n=function(){return gU(this,arguments,function*(){var r,i;let a=yield Ei(e);(r=t?.onHeader)===null||r===void 0||r.call(t,a.header),yield Ei(yield*fU(qO(a.message))),(i=t?.onTrailer)===null||i===void 0||i.call(t,a.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}l();function $O(...e){let t=new AbortController,n=e.filter(i=>i!==void 0).concat(t.signal);for(let i of n){if(i.aborted){r.apply(i);break}i.addEventListener("abort",r)}function r(){t.signal.aborted||t.abort(W_(this));for(let i of n)i.removeEventListener("abort",r)}return t}function KO(e){let t=new AbortController,n=()=>{t.abort(new be("the operation timed out",oe.DeadlineExceeded))},r;return e!==void 0&&(e<=0?n():r=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(r)}}function W_(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;let t=new Error("This operation was aborted");return t.name="AbortError",t}l();function rl(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}l();function il(e,t,n){let r=typeof t=="string"?t:t.typeName,i=typeof n=="string"?n:n.name;return e.toString().replace(/\/?$/,`/${r}/${i}`)}l();function z_(e,t){return t instanceof e?t:new e(t)}function WO(e,t){function n(r){return r.done===!0?r:{done:r.done,value:z_(e,r.value)}}return{[Symbol.asyncIterator](){let r=t[Symbol.asyncIterator](),i={next:()=>r.next().then(n)};return r.throw!==void 0&&(i.throw=a=>r.throw(a).then(n)),r.return!==void 0&&(i.return=a=>r.return(a).then(n)),i}}}l();function Q_(e,t){var n;return(n=t?.concat().reverse().reduce((r,i)=>i(r),e))!==null&&n!==void 0?n:e}l();function al(e){var t;let n=Object.assign({},e);return(t=n.ignoreUnknownFields)!==null&&t!==void 0||(n.ignoreUnknownFields=!0),n}function sl(e,t,n,r){let i=t?zO(e.I,r):QO(e.I,n);return{parse:(t?zO(e.O,r):QO(e.O,n)).parse,serialize:i.serialize}}function zO(e,t){return{parse(n){try{return e.fromBinary(n,t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new be(`parse binary: ${i}`,oe.Internal)}},serialize(n){try{return n.toBinary(t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new be(`serialize binary: ${i}`,oe.Internal)}}}}function QO(e,t){var n,r;let i=(n=t?.textEncoder)!==null&&n!==void 0?n:new TextEncoder,a=(r=t?.textDecoder)!==null&&r!==void 0?r:new TextDecoder,s=al(t);return{parse(o){try{let c=a.decode(o);return e.fromJsonString(c,s)}catch(c){throw be.from(c,oe.InvalidArgument)}},serialize(o){try{let c=o.toJsonString(s);return i.encode(c)}catch(c){throw be.from(c,oe.Internal)}}}}l();var DU=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i;var XO="application/proto",JO="application/json",jO="application/connect+proto",ZO="application/connect+json";function eN(e){let t=e?.match(DU);if(!t)return;let n=!!t[1],r=!!t[3];return{stream:n,binary:r}}l();l();function Fa(e,t,n){var r;if(t&&new Headers(t).forEach((o,c)=>n.metadata.append(c,o)),typeof e!="object"||e==null||Array.isArray(e))throw n;let i=n.code;"code"in e&&typeof e.code=="string"&&(i=(r=sO(e.code))!==null&&r!==void 0?r:i);let a=e.message;if(a!=null&&typeof a!="string")throw n;let s=new be(a??"",i,t);if("details"in e&&Array.isArray(e.details))for(let o of e.details){if(o===null||typeof o!="object"||Array.isArray(o)||typeof o.type!="string"||typeof o.value!="string")throw n;try{s.details.push({type:o.type,value:ar.dec(o.value),debug:o.debug})}catch{throw n}}return s}var ol=2;function X_(e){let t=new be("invalid end stream",oe.Unknown),n;try{n=JSON.parse(typeof e=="string"?e:new TextDecoder().decode(e))}catch{throw t}if(typeof n!="object"||n==null||Array.isArray(n))throw t;let r=new Headers;if("metadata"in n){if(typeof n.metadata!="object"||n.metadata==null||Array.isArray(n.metadata))throw t;for(let[a,s]of Object.entries(n.metadata)){if(!Array.isArray(s)||s.some(o=>typeof o!="string"))throw t;for(let o of s)r.append(a,o)}}let i="error"in n&&n.error!=null?Fa(n.error,r,t):void 0;return{metadata:r,error:i}}l();var vr="Content-Type",tN="Content-Length",ka="Content-Encoding";var J_="Accept-Encoding";var nN="Connect-Timeout-Ms",ll="Connect-Protocol-Version",rN="User-Agent";l();function iN(e){switch(e){case 400:return oe.Internal;case 401:return oe.Unauthenticated;case 403:return oe.PermissionDenied;case 404:return oe.Unimplemented;case 429:return oe.Unavailable;case 502:return oe.Unavailable;case 503:return oe.Unavailable;case 504:return oe.Unavailable;default:return oe.Unknown}}l();function cl(e){let t=new Headers,n=new Headers;return e.forEach((r,i)=>{i.toLowerCase().startsWith("trailer-")?n.append(i.substring(8),r):t.append(i,r)}),[t,n]}l();var ul="1";l();function dl(e,t,n,r,i){let a=new Headers(r??{});return n!==void 0&&a.set(nN,`${n}`),a.set(vr,e==ve.Unary?t?XO:JO:t?jO:ZO),a.set(ll,ul),i&&a.set(rN,"connect-es/1.5.0"),a}l();function _l(e,t,n,r){let i=r.get(vr),a=eN(i);if(n!==200){let o=new be(`HTTP ${n}`,iN(n),r);if(e==ve.Unary&&a&&!a.binary)return{isUnaryError:!0,unaryError:o};throw o}let s={binary:t,stream:e!==ve.Unary};if(a?.binary!==s.binary||a.stream!==s.stream)throw new be(`unsupported content type ${i}`,a===void 0?oe.Unknown:oe.Internal,r);return{isUnaryError:!1}}l();var aN="application/";function AU(e,t){return t?ar.enc(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):encodeURIComponent(new TextDecoder().decode(e))}function j_(e,t,n){let r=`?connect=v${ul}`,i=e.header.get(vr);i?.indexOf(aN)===0&&(r+="&encoding="+encodeURIComponent(i.slice(aN.length)));let a=e.header.get(ka);a!==null&&a!=="identity"&&(r+="&compression="+encodeURIComponent(a),n=!0),n&&(r+="&base64=1"),r+="&message="+AU(t,n);let s=e.url+r,o=new Headers(e.header);return[ll,vr,tN,ka,J_].forEach(c=>o.delete(c)),Object.assign(Object.assign({},e),{init:Object.assign(Object.assign({},e.init),{method:"GET"}),url:s,header:o})}l();function Z_(e){let t=Q_(e.next,e.interceptors),[n,r,i]=sN(e),a=Object.assign(Object.assign({},e.req),{message:z_(e.req.method.I,e.req.message),signal:n});return t(a).then(s=>(i(),s),r)}function em(e){let t=Q_(e.next,e.interceptors),[n,r,i]=sN(e),a=Object.assign(Object.assign({},e.req),{message:WO(e.req.method.I,e.req.message),signal:n}),s=!1;return n.addEventListener("abort",function(){var o,c;let u=e.req.message[Symbol.asyncIterator]();s||(o=u.throw)===null||o===void 0||o.call(u,this.reason).catch(()=>{}),(c=u.return)===null||c===void 0||c.call(u).catch(()=>{})}),t(a).then(o=>Object.assign(Object.assign({},o),{message:{[Symbol.asyncIterator](){let c=o.message[Symbol.asyncIterator]();return{next(){return c.next().then(u=>(u.done==!0&&(s=!0,i()),u),r)}}}}}),r)}function sN(e){let{signal:t,cleanup:n}=KO(e.timeoutMs),r=$O(e.signal,t);return[r.signal,function(a){let s=be.from(t.aborted?W_(t):a);return r.abort(s),n(),Promise.reject(s)},function(){n(),r.abort()}]}function Je(e){if(e instanceof be)switch(e.code){case oe.InvalidArgument:return new _i(e.message);case oe.Unauthenticated:return new Ln(e.message);case oe.NotFound:return new ir(e.message);case oe.Unavailable:return Po(e.message);case oe.Canceled:return new di(`${e.message}: This error is likely due to exceeding 'requestTimeoutMs'. You can pass the request timeout value as an option when making the request.`);case oe.DeadlineExceeded:return new di(`${e.message}: This error is likely due to exceeding 'timeoutMs' \u2014 the total time a long running request (like command execution or directory watch) can be active. It can be modified by passing 'timeoutMs' when making the request. Use '0' to disable the timeout.`);default:return new _t(`${e.code}: ${e.message}`)}return e}function OU(e){switch(Mo){case"deno":return btoa(e);case"node":return Buffer.from(e).toString("base64");case"bun":return Buffer.from(e).toString("base64");default:return btoa(e)}}function cn(e){let t=`${e||yr}:`;return{Authorization:`Basic ${OU(t)}`}}l();var rm=(r=>(r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.FILE=1]="FILE",r[r.DIRECTORY=2]="DIRECTORY",r))(rm||{});C.util.setEnumType(rm,"filesystem.FileType",[{no:0,name:"FILE_TYPE_UNSPECIFIED"},{no:1,name:"FILE_TYPE_FILE"},{no:2,name:"FILE_TYPE_DIRECTORY"}]);var im=(s=>(s[s.UNSPECIFIED=0]="UNSPECIFIED",s[s.CREATE=1]="CREATE",s[s.WRITE=2]="WRITE",s[s.REMOVE=3]="REMOVE",s[s.RENAME=4]="RENAME",s[s.CHMOD=5]="CHMOD",s))(im||{});C.util.setEnumType(im,"filesystem.EventType",[{no:0,name:"EVENT_TYPE_UNSPECIFIED"},{no:1,name:"EVENT_TYPE_CREATE"},{no:2,name:"EVENT_TYPE_WRITE"},{no:3,name:"EVENT_TYPE_REMOVE"},{no:4,name:"EVENT_TYPE_RENAME"},{no:5,name:"EVENT_TYPE_CHMOD"}]);var ml=class e extends se{source="";destination="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.MoveRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"source",kind:"scalar",T:9},{no:2,name:"destination",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},pl=class e extends se{entry;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.MoveResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"entry",kind:"message",T:fi}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},El=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.MakeDirRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},fl=class e extends se{entry;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.MakeDirResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"entry",kind:"message",T:fi}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},gl=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.RemoveRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Sl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.RemoveResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Tl=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.StatRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},hl=class e extends se{entry;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.StatResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"entry",kind:"message",T:fi}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},fi=class e extends se{name="";type=0;path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.EntryInfo";static fields=C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:C.getEnumType(rm)},{no:3,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},bl=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.ListDirRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Dl=class e extends se{entries=[];constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.ListDirResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"entries",kind:"message",T:fi,repeated:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Cl=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.WatchDirRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Rl=class e extends se{name="";type=0;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.FilesystemEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:C.getEnumType(im)}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Al=class e extends se{event={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.WatchDirResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"start",kind:"message",T:tm,oneof:"event"},{no:2,name:"filesystem",kind:"message",T:Rl,oneof:"event"},{no:3,name:"keepalive",kind:"message",T:nm,oneof:"event"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},tm=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.WatchDirResponse.StartEvent";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},nm=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.WatchDirResponse.KeepAlive";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Ol=class e extends se{path="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.CreateWatcherRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Nl=class e extends se{watcherId="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.CreateWatcherResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"watcher_id",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},yl=class e extends se{watcherId="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.GetWatcherEventsRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"watcher_id",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Il=class e extends se{events=[];constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.GetWatcherEventsResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"events",kind:"message",T:Rl,repeated:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},vl=class e extends se{watcherId="";constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.RemoveWatcherRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"watcher_id",kind:"scalar",T:9}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},xl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="filesystem.RemoveWatcherResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}};function NU(e){switch(e){case 5:return"chmod";case 1:return"create";case 3:return"remove";case 4:return"rename";case 2:return"write"}}var Ml=class{constructor(t,n,r,i){this.handleStop=t;this.events=n;this.onEvent=r;this.onExit=i;this.handleEvents()}async stop(){this.handleStop()}async*iterateEvents(){try{for await(let t of this.events)switch(t.event.case){case"filesystem":yield t.event;break}}catch(t){throw Je(t)}}async handleEvents(){try{for await(let t of this.iterateEvents()){let n=NU(t.value.type);n!==void 0&&this.onEvent?.({name:t.value.name,type:n})}this.onExit?.()}catch(t){this.onExit?.(t)}}};l();l();async function Ba(e){if(!e.error)return;let t=typeof e.error=="string"?e.error:e.error?.message||await e.response.text();switch(e.response.status){case 400:return new _i(t);case 401:return new Ln(t);case 404:return new ir(t);case 429:return new _t(`${e.response.status}: ${t}: The requests are being rate limited.`);case 502:return Po(t);case 507:return new wo(t);default:return new _t(`${e.response.status}: ${t}`)}}async function Ua(e){let t;try{t=(await e[Symbol.asyncIterator]().next()).value}catch(n){throw n instanceof be&&n.code===oe.Unavailable?new ir("Sandbox is probably not running anymore"):n}if(t.event?.event.case!=="start")throw new Error("Expected start event");return t.event.event.value.pid}async function oN(e){let t;try{t=(await e[Symbol.asyncIterator]().next()).value}catch(n){throw n instanceof be&&n.code===oe.Unavailable?new ir("Sandbox is probably not running anymore"):n}if(t.event?.case!=="start")throw new Error("Expected start event");return t.event.value}var wl=class{api;constructor(t){this.api=Ra({baseUrl:t.apiUrl}),t.logger&&this.api.use(Fo(t.logger))}};l();var lN={typeName:"filesystem.Filesystem",methods:{stat:{name:"Stat",I:Tl,O:hl,kind:ve.Unary},makeDir:{name:"MakeDir",I:El,O:fl,kind:ve.Unary},move:{name:"Move",I:ml,O:pl,kind:ve.Unary},listDir:{name:"ListDir",I:bl,O:Dl,kind:ve.Unary},remove:{name:"Remove",I:gl,O:Sl,kind:ve.Unary},watchDir:{name:"WatchDir",I:Cl,O:Al,kind:ve.ServerStreaming},createWatcher:{name:"CreateWatcher",I:Ol,O:Nl,kind:ve.Unary},getWatcherEvents:{name:"GetWatcherEvents",I:yl,O:Il,kind:ve.Unary},removeWatcher:{name:"RemoveWatcher",I:vl,O:xl,kind:ve.Unary}}};function cN(e){switch(e){case 2:return"dir";case 1:return"file"}}var Ll=class{constructor(t,n,r){this.envdApi=n;this.connectionConfig=r;this.rpc=Ir(lN,t)}rpc;defaultWatchTimeout=6e4;async read(t,n){let r=n?.format??"text",i=await this.envdApi.api.GET("/files",{params:{query:{path:t,username:n?.user||yr}},parseAs:r==="bytes"?"arrayBuffer":r,signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),a=await Ba(i);if(a)throw a;return r==="bytes"?new Uint8Array(i.data):i.response.headers.get("content-length")==="0"?"":i.data}async write(t,n,r){let i=await new Response(n).blob(),a=await this.envdApi.api.POST("/files",{params:{query:{path:t,username:r?.user||yr}},bodySerializer(){let c=new FormData;return c.append("file",i),c},body:{},signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)}),s=await Ba(a);if(s)throw s;let o=a.data;if(!o||o.length===0)throw new Error("Expected to receive information about written file");return o[0]}async list(t,n){try{let r=await this.rpc.listDir({path:t},{headers:cn(n?.user),signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),i=[];for(let a of r.entries){let s=cN(a.type);s&&i.push({name:a.name,type:s,path:a.path})}return i}catch(r){throw Je(r)}}async makeDir(t,n){try{return await this.rpc.makeDir({path:t},{headers:cn(n?.user),signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),!0}catch(r){if(r instanceof be&&r.code===oe.AlreadyExists)return!1;throw Je(r)}}async rename(t,n,r){try{let a=(await this.rpc.move({source:t,destination:n},{headers:cn(r?.user),signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)})).entry;if(!a)throw new Error("Expected to receive information about moved object");return{name:a.name,type:cN(a.type),path:a.path}}catch(i){throw Je(i)}}async remove(t,n){try{await this.rpc.remove({path:t},{headers:cn(n?.user),signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)})}catch(r){throw Je(r)}}async exists(t,n){try{return await this.rpc.stat({path:t},{headers:cn(n?.user),signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),!0}catch(r){if(r instanceof be&&r.code===oe.NotFound)return!1;throw Je(r)}}async watchDir(t,n,r){let i=r?.requestTimeoutMs??this.connectionConfig.requestTimeoutMs,a=new AbortController,s=i?setTimeout(()=>{a.abort()},i):void 0,o=this.rpc.watchDir({path:t},{headers:{...cn(r?.user),[Nr]:Or.toString()},signal:a.signal,timeoutMs:r?.timeoutMs??this.defaultWatchTimeout});try{return await oN(o),clearTimeout(s),new Ml(()=>a.abort(),o,n,r?.onExit)}catch(c){throw Je(c)}}};l();var gi=class extends _t{constructor(n){super(n.error);this.result=n;this.name="CommandExitError"}get exitCode(){return this.result.exitCode}get error(){return this.result.error}get stdout(){return this.result.stdout}get stderr(){return this.result.stderr}},xr=class{constructor(t,n,r,i,a,s,o){this.pid=t;this.handleDisconnect=n;this.handleKill=r;this.events=i;this.onStdout=a;this.onStderr=s;this.onPty=o;this._wait=this.handleEvents()}_stdout="";_stderr="";result;iterationError;_wait;get exitCode(){return this.result?.exitCode}get error(){return this.result?.error}get stderr(){return this._stderr}get stdout(){return this._stdout}async wait(){if(await this._wait,this.iterationError)throw this.iterationError;if(!this.result)throw new _t("Process exited without a result");if(this.result.exitCode!==0)throw new gi(this.result);return this.result}async disconnect(){this.handleDisconnect()}async kill(){return await this.handleKill()}async*iterateEvents(){for await(let t of this.events){let n=t?.event?.event,r;switch(n?.case){case"data":switch(n.value.output.case){case"stdout":r=new TextDecoder().decode(n.value.output.value),this._stdout+=r,yield[r,null,null];break;case"stderr":r=new TextDecoder().decode(n.value.output.value),this._stderr+=r,yield[null,r,null];break;case"pty":yield[null,null,n.value.output.value];break}break;case"end":this.result={exitCode:n.value.exitCode,error:n.value.error,stdout:this.stdout,stderr:this.stderr};break}}}async handleEvents(){try{for await(let[t,n,r]of this.iterateEvents())t!==null?this.onStdout?.(t):n!==null?this.onStderr?.(n):r&&this.onPty?.(r)}catch(t){this.iterationError=Je(t)}}};l();l();l();l();l();l();function uN(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}var Ga=function(e){return this instanceof Ga?(this.v=e,this):new Ga(e)},yU=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(T){return Promise.resolve(T).then(g,p)}}function o(g,T){r[g]&&(i[g]=function(N){return new Promise(function(w,k){a.push([g,N,w,k])>1||c(g,N)})},T&&(i[g]=T(i[g])))}function c(g,T){try{u(r[g](T))}catch(N){S(a[0][3],N)}}function u(g){g.value instanceof Ga?Promise.resolve(g.value.v).then(d,p):S(a[0][2],g)}function d(g){c("next",g)}function p(g){c("throw",g)}function S(g,T){g(T),a.shift(),a.length&&c(a[0][0],a[0][1])}};function am(e){var t;uN();let n=(t=e.useBinaryFormat)!==null&&t!==void 0?t:!1;return{async unary(r,i,a,s,o,c,u){var d;let{serialize:p,parse:S}=sl(i,n,e.jsonOptions,e.binaryOptions);return s=s===void 0?e.defaultTimeoutMs:s<=0?void 0:s,await Z_({interceptors:e.interceptors,signal:a,timeoutMs:s,req:{stream:!1,service:r,method:i,url:il(e.baseUrl,r,i),init:{method:"POST",credentials:(d=e.credentials)!==null&&d!==void 0?d:"same-origin",redirect:"error",mode:"cors"},header:dl(i.kind,n,s,o,!1),contextValues:u??rl(),message:c},next:async g=>{var T;let N=e.useHttpGet===!0&&i.idempotency===La.NoSideEffects,w=null;N?g=j_(g,p(g.message),n):w=p(g.message);let M=await((T=e.fetch)!==null&&T!==void 0?T:globalThis.fetch)(g.url,Object.assign(Object.assign({},g.init),{headers:g.header,signal:g.signal,body:w})),{isUnaryError:B,unaryError:Y}=_l(i.kind,n,M.status,M.headers);if(B)throw Fa(await M.json(),V_(...cl(M.headers)),Y);let[re,Q]=cl(M.headers);return{stream:!1,service:r,method:i,header:re,message:n?S(new Uint8Array(await M.arrayBuffer())):i.O.fromJson(await M.json(),al(e.jsonOptions)),trailer:Q}}})},async stream(r,i,a,s,o,c,u){var d;let{serialize:p,parse:S}=sl(i,n,e.jsonOptions,e.binaryOptions);function g(N,w,k,M){return yU(this,arguments,function*(){let Y=$_(N).getReader(),re=!1;for(;;){let Q=yield Ga(Y.read());if(Q.done)break;let{flags:ae,data:L}=Q.value;if((ae&nl)===nl)throw new be("protocol error: received unsupported compressed output",oe.Internal);if((ae&ol)===ol){re=!0;let P=X_(L);if(P.error){let $=P.error;throw k.forEach((J,_e)=>{$.metadata.append(_e,J)}),$}P.metadata.forEach(($,J)=>w.set(J,$));continue}yield yield Ga(S(L))}if("throwIfAborted"in M&&M.throwIfAborted(),!re)throw"missing EndStreamResponse"})}async function T(N){if(i.kind!=ve.ServerStreaming)throw"The fetch API does not support streaming request bodies";let w=await N[Symbol.asyncIterator]().next();if(w.done==!0)throw"missing request message";return K_(0,p(w.value))}return s=s===void 0?e.defaultTimeoutMs:s<=0?void 0:s,await em({interceptors:e.interceptors,timeoutMs:s,signal:a,req:{stream:!0,service:r,method:i,url:il(e.baseUrl,r,i),init:{method:"POST",credentials:(d=e.credentials)!==null&&d!==void 0?d:"same-origin",redirect:"error",mode:"cors"},header:dl(i.kind,n,s,o,!1),contextValues:u??rl(),message:c},next:async N=>{var w;let M=await((w=e.fetch)!==null&&w!==void 0?w:globalThis.fetch)(N.url,Object.assign(Object.assign({},N.init),{headers:N.header,signal:N.signal,body:await T(N.message)}));if(_l(i.kind,n,M.status,M.headers),M.body===null)throw"missing response body";let B=new Headers;return Object.assign(Object.assign({},N),{header:M.headers,trailer:B,message:g(M.body,B,M.headers,N.signal)})}})}}}l();l();l();var Em=(r=>(r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.SIGTERM=15]="SIGTERM",r[r.SIGKILL=9]="SIGKILL",r))(Em||{});C.util.setEnumType(Em,"process.Signal",[{no:0,name:"SIGNAL_UNSPECIFIED"},{no:15,name:"SIGNAL_SIGTERM"},{no:9,name:"SIGNAL_SIGKILL"}]);var Pl=class e extends se{size;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.PTY";static fields=C.util.newFieldList(()=>[{no:1,name:"size",kind:"message",T:sm}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},sm=class e extends se{cols=0;rows=0;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.PTY.Size";static fields=C.util.newFieldList(()=>[{no:1,name:"cols",kind:"scalar",T:13},{no:2,name:"rows",kind:"scalar",T:13}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Fl=class e extends se{cmd="";args=[];envs={};cwd;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessConfig";static fields=C.util.newFieldList(()=>[{no:1,name:"cmd",kind:"scalar",T:9},{no:2,name:"args",kind:"scalar",T:9,repeated:!0},{no:3,name:"envs",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"cwd",kind:"scalar",T:9,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},kl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ListRequest";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},om=class e extends se{config;pid=0;tag;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessInfo";static fields=C.util.newFieldList(()=>[{no:1,name:"config",kind:"message",T:Fl},{no:2,name:"pid",kind:"scalar",T:13},{no:3,name:"tag",kind:"scalar",T:9,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Bl=class e extends se{processes=[];constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ListResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"processes",kind:"message",T:om,repeated:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Ul=class e extends se{process;pty;tag;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StartRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Fl},{no:2,name:"pty",kind:"message",T:Pl,opt:!0},{no:3,name:"tag",kind:"scalar",T:9,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Gl=class e extends se{process;pty;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.UpdateRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr},{no:2,name:"pty",kind:"message",T:Pl,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Hl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.UpdateResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Yl=class e extends se{event={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"start",kind:"message",T:lm,oneof:"event"},{no:2,name:"data",kind:"message",T:cm,oneof:"event"},{no:3,name:"end",kind:"message",T:um,oneof:"event"},{no:4,name:"keepalive",kind:"message",T:dm,oneof:"event"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},lm=class e extends se{pid=0;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent.StartEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"pid",kind:"scalar",T:13}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},cm=class e extends se{output={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent.DataEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"stdout",kind:"scalar",T:12,oneof:"output"},{no:2,name:"stderr",kind:"scalar",T:12,oneof:"output"},{no:3,name:"pty",kind:"scalar",T:12,oneof:"output"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},um=class e extends se{exitCode=0;exited=!1;status="";error;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent.EndEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"exit_code",kind:"scalar",T:17},{no:2,name:"exited",kind:"scalar",T:8},{no:3,name:"status",kind:"scalar",T:9},{no:4,name:"error",kind:"scalar",T:9,opt:!0}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},dm=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessEvent.KeepAlive";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},ql=class e extends se{event;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StartResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"event",kind:"message",T:Yl}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Vl=class e extends se{event;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ConnectResponse";static fields=C.util.newFieldList(()=>[{no:1,name:"event",kind:"message",T:Yl}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},$l=class e extends se{process;input;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.SendInputRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr},{no:2,name:"input",kind:"message",T:Wl}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Kl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.SendInputResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Wl=class e extends se{input={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessInput";static fields=C.util.newFieldList(()=>[{no:1,name:"stdin",kind:"scalar",T:12,oneof:"input"},{no:2,name:"pty",kind:"scalar",T:12,oneof:"input"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},zl=class e extends se{event={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"start",kind:"message",T:_m,oneof:"event"},{no:2,name:"data",kind:"message",T:mm,oneof:"event"},{no:3,name:"keepalive",kind:"message",T:pm,oneof:"event"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},_m=class e extends se{process;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputRequest.StartEvent";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},mm=class e extends se{input;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputRequest.DataEvent";static fields=C.util.newFieldList(()=>[{no:2,name:"input",kind:"message",T:Wl}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},pm=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputRequest.KeepAlive";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Ql=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.StreamInputResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Xl=class e extends se{process;signal=0;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.SendSignalRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr},{no:2,name:"signal",kind:"enum",T:C.getEnumType(Em)}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Jl=class e extends se{constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.SendSignalResponse";static fields=C.util.newFieldList(()=>[]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},jl=class e extends se{process;constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ConnectRequest";static fields=C.util.newFieldList(()=>[{no:1,name:"process",kind:"message",T:Mr}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}},Mr=class e extends se{selector={case:void 0};constructor(t){super(),C.util.initPartial(t,this)}static runtime=C;static typeName="process.ProcessSelector";static fields=C.util.newFieldList(()=>[{no:1,name:"pid",kind:"scalar",T:13,oneof:"selector"},{no:2,name:"tag",kind:"scalar",T:9,oneof:"selector"}]);static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return C.util.equals(e,t,n)}};var Zl={typeName:"process.Process",methods:{list:{name:"List",I:kl,O:Bl,kind:ve.Unary},connect:{name:"Connect",I:jl,O:Vl,kind:ve.ServerStreaming},start:{name:"Start",I:Ul,O:ql,kind:ve.ServerStreaming},update:{name:"Update",I:Gl,O:Hl,kind:ve.Unary},streamInput:{name:"StreamInput",I:zl,O:Ql,kind:ve.ClientStreaming},sendInput:{name:"SendInput",I:$l,O:Kl,kind:ve.Unary},sendSignal:{name:"SendSignal",I:Xl,O:Jl,kind:ve.Unary}}};l();var Ha=class{constructor(t,n){this.transport=t;this.connectionConfig=n;this.rpc=Ir(Zl,this.transport)}rpc;async create(t){let n=t?.requestTimeoutMs??this.connectionConfig.requestTimeoutMs,r=t?.envs??{};r.TERM="xterm-256color";let i=new AbortController,a=setTimeout(()=>{i.abort()},n),s=this.rpc.start({process:{cmd:"/bin/bash",args:["-i","-l"],envs:r,cwd:t?.cwd},pty:{size:{cols:t.cols,rows:t.rows}}},{headers:{...cn(t?.user),[Nr]:Or.toString()},signal:i.signal,timeoutMs:t?.timeoutMs??6e4});try{let o=await Ua(s);return clearTimeout(a),new xr(o,()=>i.abort(),()=>this.kill(o),s,void 0,void 0,t.onData)}catch(o){throw Je(o)}}async sendInput(t,n,r){try{await this.rpc.sendInput({input:{input:{case:"pty",value:n}},process:{selector:{case:"pid",value:t}}},{signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)})}catch(i){throw Je(i)}}async resize(t,n,r){try{await this.rpc.update({process:{selector:{case:"pid",value:t}},pty:{size:n}},{signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)})}catch(i){throw Je(i)}}async kill(t,n){try{return await this.rpc.sendSignal({process:{selector:{case:"pid",value:t}},signal:9},{signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),!0}catch(r){if(r instanceof be&&r.code===oe.NotFound)return!1;throw Je(r)}}};var ec=class{constructor(t,n){this.connectionConfig=n;this.rpc=Ir(Zl,t)}rpc;defaultProcessConnectionTimeout=6e4;async list(t){try{return(await this.rpc.list({},{signal:this.connectionConfig.getSignal(t?.requestTimeoutMs)})).processes.map(r=>({pid:r.pid,...r.tag&&{tag:r.tag},args:r.config.args,envs:r.config.envs,cmd:r.config.cmd,...r.config.cwd&&{cwd:r.config.cwd}}))}catch(n){throw Je(n)}}async sendStdin(t,n,r){try{await this.rpc.sendInput({process:{selector:{case:"pid",value:t}},input:{input:{case:"stdin",value:new TextEncoder().encode(n)}}},{signal:this.connectionConfig.getSignal(r?.requestTimeoutMs)})}catch(i){throw Je(i)}}async kill(t,n){try{return await this.rpc.sendSignal({process:{selector:{case:"pid",value:t}},signal:9},{signal:this.connectionConfig.getSignal(n?.requestTimeoutMs)}),!0}catch(r){if(r instanceof be&&r.code===oe.NotFound)return!1;throw Je(r)}}async connect(t,n){let r=n?.requestTimeoutMs??this.connectionConfig.requestTimeoutMs,i=new AbortController,a=r?setTimeout(()=>{i.abort()},r):void 0,s=this.rpc.connect({process:{selector:{case:"pid",value:t}}},{signal:i.signal,headers:{[Nr]:Or.toString()},timeoutMs:n?.timeoutMs??this.defaultProcessConnectionTimeout});try{let o=await Ua(s);return clearTimeout(a),new xr(o,()=>i.abort(),()=>this.kill(o),s,n?.onStdout,n?.onStderr,void 0)}catch(o){throw Je(o)}}async run(t,n){let r=await this.start(t,n);return n?.background?r:r.wait()}async start(t,n){let r=n?.requestTimeoutMs??this.connectionConfig.requestTimeoutMs,i=new AbortController,a=r?setTimeout(()=>{i.abort()},r):void 0,s=this.rpc.start({process:{cmd:"/bin/bash",cwd:n?.cwd,envs:n?.envs,args:["-l","-c",t]}},{headers:{...cn(n?.user),[Nr]:Or.toString()},signal:i.signal,timeoutMs:n?.timeoutMs??this.defaultProcessConnectionTimeout});try{let o=await Ua(s);return clearTimeout(a),new xr(o,()=>i.abort(),()=>this.kill(o),s,n?.onStdout,n?.onStderr,void 0)}catch(o){throw Je(o)}}};l();l();l();l();var IU=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,fm=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(IU);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},dN=e=>e==="*"||e==="x"||e==="X",_N=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},vU=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],xU=(e,t)=>{if(dN(e)||dN(t))return 0;let[n,r]=vU(_N(e),_N(t));return n>r?1:n<r?-1:0},gm=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){let r=xU(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0};var Sm=(e,t)=>{let n=fm(e),r=fm(t),i=n.pop(),a=r.pop(),s=gm(n,r);return s!==0?s:i&&a?gm(i.split("."),a.split(".")):i||a?i?-1:1:0};var tc=class{constructor(){}static async kill(t,n){let r=new Dt(n),a=await new Qt(r).api.DELETE("/sandboxes/{sandboxID}",{params:{path:{sandboxID:t}},signal:r.getSignal(n?.requestTimeoutMs)});if(a.error?.code===404)return!1;let s=ya(a);if(s)throw s;return!0}static async list(t){let n=new Dt(t),i=await new Qt(n).api.GET("/sandboxes",{signal:n.getSignal(t?.requestTimeoutMs)}),a=ya(i);if(a)throw a;return i.data?.map(s=>({sandboxId:this.getSandboxId({sandboxId:s.sandboxID,clientId:s.clientID}),templateId:s.templateID,...s.alias&&{name:s.alias},metadata:s.metadata??{},startedAt:new Date(s.startedAt)}))??[]}static async setTimeout(t,n,r){let i=new Dt(r),s=await new Qt(i).api.POST("/sandboxes/{sandboxID}/timeout",{params:{path:{sandboxID:t}},body:{timeout:this.timeoutToSeconds(n)},signal:i.getSignal(r?.requestTimeoutMs)}),o=ya(s);if(o)throw o}static async createSandbox(t,n,r){let i=new Dt(r),s=await new Qt(i).api.POST("/sandboxes",{body:{templateID:t,metadata:r?.metadata,envVars:r?.envs,timeout:this.timeoutToSeconds(n)},signal:i.getSignal(r?.requestTimeoutMs)}),o=ya(s);if(o)throw o;if(Sm(s.data.envdVersion,"0.1.0")<0)throw await this.kill(this.getSandboxId({sandboxId:s.data.sandboxID,clientId:s.data.clientID}),r),new Lo("You need to update the template to use the new SDK. You can do this by running `e2b template build` in the directory with the template.");return this.getSandboxId({sandboxId:s.data.sandboxID,clientId:s.data.clientID})}static timeoutToSeconds(t){return Math.ceil(t/1e3)}static getSandboxId({sandboxId:t,clientId:n}){return`${t}-${n}`}};var Sn=class e extends tc{static defaultTemplate="base";static defaultSandboxTimeoutMs=3e5;files;commands;pty;sandboxId;envdPort=49983;connectionConfig;envdApiUrl;envdApi;constructor(t){super(),this.sandboxId=t.sandboxId,this.connectionConfig=new Dt(t),this.envdApiUrl=`${this.connectionConfig.debug?"http":"https"}://${this.getHost(this.envdPort)}`;let n=am({baseUrl:this.envdApiUrl,useBinaryFormat:!1,interceptors:t?.logger?[aO(t.logger)]:void 0});this.envdApi=new wl({apiUrl:this.envdApiUrl,logger:t?.logger}),this.files=new Ll(n,this.envdApi,this.connectionConfig),this.commands=new ec(n,this.connectionConfig),this.pty=new Ha(n,this.connectionConfig)}static async create(t,n){let{template:r,sandboxOpts:i}=typeof t=="string"?{template:t,sandboxOpts:n}:{template:this.defaultTemplate,sandboxOpts:t},a=new Dt(i),s=a.debug?"debug_sandbox_id":await this.createSandbox(r,i?.timeoutMs??this.defaultSandboxTimeoutMs,i);return new this({sandboxId:s,...a})}static async connect(t,n){let r=new Dt(n);return new this({sandboxId:t,...r})}getHost(t){return this.connectionConfig.debug?`localhost:${t}`:`${t}-${this.sandboxId}.${this.connectionConfig.domain}`}async isRunning(t){let n=this.connectionConfig.getSignal(t?.requestTimeoutMs),r=await this.envdApi.api.GET("/health",{signal:n});if(r.response.status==502)return!1;let i=await Ba(r);if(i)throw i;return!0}async setTimeout(t,n){this.connectionConfig.debug||await e.setTimeout(this.sandboxId,t,{...this.connectionConfig,...n})}async kill(t){this.connectionConfig.debug||await e.kill(this.sandboxId,{...this.connectionConfig,...t})}uploadUrl(t){return this.fileUrl(t)}downloadUrl(t){return this.fileUrl(t)}fileUrl(t){let n=new URL("/files",this.envdApiUrl);return n.searchParams.set("username",yr),t&&n.searchParams.set("path",t),n.toString()}};l();var mN=Z(require("os")),pN=Z(require("path")),nc=Z(require("fs")),Xt=pN.join(mN.homedir(),".e2b","config.json"),Tm=process.env.E2B_DOCS_BASE||"https://e2b.dev/docs";function Gt(){return nc.existsSync(Xt)?JSON.parse(nc.readFileSync(Xt,"utf8")):null}var rc=process.env.E2B_API_KEY,ic=process.env.E2B_ACCESS_TOKEN,fN=Rr(`You must be logged in to use this command. Run ${pe("e2b auth login")}.
99
99
 
100
100
  If you are seeing this message in CI/CD you may need to set the ${pe("E2B_ACCESS_TOKEN")} environment variable.
101
- Visit ${Lt("https://e2b.dev/docs/getting-started/api-key")} to get the access token.`,{width:70,float:"center",padding:.5,margin:1,borderStyle:"round",borderColor:"redBright"});function sr(){if(!rc){let e=Gt();rc=e?.teamApiKey||e?.defaultTeamApiKey}if(!rc)console.error(fN),process.exit(1);else return rc}function ac(){let e=Gt();return e||(console.error("No user config found, run `e2b auth login` to log in first."),process.exit(1)),e}function Ti(){if(ic||(ic=Gt()?.accessToken),!ic)console.error(fN),process.exit(1);else return ic}var EN=Gt(),Ft=new Dt({accessToken:process.env.E2B_ACCESS_TOKEN||EN?.accessToken,apiKey:process.env.E2B_API_KEY||EN?.teamApiKey}),vt=new Qt(Ft);l();var or=new qn("-p, --path <path>",`change root directory where command is executed to ${pe("<path>")} directory`),hi=new qn("--config <e2b-toml>",`specify path to the E2B config toml. By default E2B tries to find ${pe("./e2b.toml")} in root directory.`),Ele=new qn("-s, --select","select multiple sandbox templates from interactive list"),gN=new qn("-s, --select","select sandbox template from interactive list"),bi=new qn("-t, --team <team-id>","specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).");l();var lr="e2b.Dockerfile",sc="Dockerfile",SN=`# You can use most Debian-based base images
101
+ Visit ${Lt("https://e2b.dev/docs/getting-started/api-key")} to get the access token.`,{width:70,float:"center",padding:.5,margin:1,borderStyle:"round",borderColor:"redBright"});function sr(){if(!rc){let e=Gt();rc=e?.teamApiKey||e?.defaultTeamApiKey}if(!rc)console.error(fN),process.exit(1);else return rc}function ac(){let e=Gt();return e||(console.error("No user config found, run `e2b auth login` to log in first."),process.exit(1)),e}function Ti(){if(ic||(ic=Gt()?.accessToken),!ic)console.error(fN),process.exit(1);else return ic}var EN=Gt(),Ft=new Dt({accessToken:process.env.E2B_ACCESS_TOKEN||EN?.accessToken,apiKey:process.env.E2B_API_KEY||EN?.teamApiKey}),vt=new Qt(Ft);l();var or=new qn("-p, --path <path>",`change root directory where command is executed to ${pe("<path>")} directory`),hi=new qn("--config <e2b-toml>",`specify path to the E2B config toml. By default E2B tries to find ${pe("./e2b.toml")} in root directory.`),fle=new qn("-s, --select","select multiple sandbox templates from interactive list"),gN=new qn("-s, --select","select sandbox template from interactive list"),bi=new qn("-t, --team <team-id>","specify the team ID that the operation will be associated with. You can find team ID in the team settings in the E2B dashboard (https://e2b.dev/dashboard?tab=team).");l();var lr="e2b.Dockerfile",sc="Dockerfile",SN=`# You can use most Debian-based base images
102
102
  FROM ubuntu:22.04
103
103
 
104
104
  # Install dependencies and customize sandbox
105
- `;l();l();var Jt=Z(RN()),Ya=Z(NN()),wN=Z(IN()),QU=Object.prototype.toString,XU=Error.prototype.toString,JU=RegExp.prototype.toString,jU=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",ZU=/^Symbol\((.*)\)(.*)$/;function e7(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function vN(e,t=!1){if(e==null||e===!0||e===!1)return""+e;let n=typeof e;if(n==="number")return e7(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return jU.call(e).replace(ZU,"Symbol($1)");let r=QU.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+XU.call(e)+"]":r==="RegExp"?JU.call(e):null}function Bn(e,t){let n=vN(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let a=vN(this[r],t);return a!==null?a:i},2)}function LN(e){return e==null?[]:[].concat(e)}var PN,t7=/\$\{\s*(\w+)\s*\}/g;PN=Symbol.toStringTag;var Ht=class e extends Error{static formatError(t,n){let r=n.label||n.path||"this";return r!==n.path&&(n=Object.assign({},n,{path:r})),typeof t=="string"?t.replace(t7,(i,a)=>Bn(n[a])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,a){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[PN]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],LN(t).forEach(s=>{if(e.isError(s)){this.errors.push(...s.errors);let o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!a&&Error.captureStackTrace&&Error.captureStackTrace(this,e)}},Tn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=r!=null&&r!==n?` (cast from the value \`${Bn(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Bn(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Bn(n,!0)}\``+i}},un={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},cr={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Om={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Nm={isValue:"${path} field must be ${value}"},ym={noUnknown:"${path} field has unspecified keys: ${unknown}"},uc={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},FN={notType:e=>{let{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${Bn(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${Bn(n,!0)}\``}return Ht.formatError(Tn.notType,e)}},Ole=Object.assign(Object.create(null),{mixed:Tn,string:un,number:cr,date:Om,object:ym,array:uc,boolean:Nm,tuple:FN}),bc=e=>e&&e.__isYupSchema__,_c=class e{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:a}=n,s=typeof r=="function"?r:(...o)=>o.every(c=>c===r);return new e(t,(o,c)=>{var u;let d=s(...o)?i:a;return(u=d?.(c))!=null?u:c})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(a=>a.getValue(n?.value,n?.parent,n?.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!bc(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}},cc={context:"$",value:"."};var Un=class{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===cc.context,this.isValue=this.key[0]===cc.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?cc.context:this.isValue?cc.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&(0,Jt.getter)(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n?.parent,n?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}};Un.prototype.__isYupRef=!0;var dn=e=>e==null;function Di(e){function t({value:n,path:r="",options:i,originalValue:a,schema:s},o,c){let{name:u,test:d,params:p,message:S,skipAbsent:g}=e,{parent:T,context:N,abortEarly:w=s.spec.abortEarly,disableStackTrace:k=s.spec.disableStackTrace}=i;function M(J){return Un.isRef(J)?J.getValue(n,T,N):J}function B(J={}){var _e;let Se=Object.assign({value:n,originalValue:a,label:s.spec.label,path:J.path||r,spec:s.spec},p,J.params);for(let Te of Object.keys(Se))Se[Te]=M(Se[Te]);let xe=new Ht(Ht.formatError(J.message||S,Se),n,Se.path,J.type||u,(_e=J.disableStackTrace)!=null?_e:k);return xe.params=Se,xe}let Y=w?o:c,re={path:r,parent:T,type:u,from:i.from,createError:B,resolve:M,options:i,originalValue:a,schema:s},Q=J=>{Ht.isError(J)?Y(J):J?c(null):Y(B())},ae=J=>{Ht.isError(J)?Y(J):o(J)};if(g&&dn(n))return Q(!0);let P;try{var $;if(P=d.call(re,n,re),typeof(($=P)==null?void 0:$.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${re.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(P).then(Q,ae)}}catch(J){ae(J);return}Q(P)}return t.OPTIONS=e,t}function n7(e,t,n,r=n){let i,a,s;return t?((0,Jt.forEach)(t,(o,c,u)=>{let d=c?o.slice(1,o.length-1):o;e=e.resolve({context:r,parent:i,value:n});let p=e.type==="tuple",S=u?parseInt(d,10):0;if(e.innerType||p){if(p&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(n&&S>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[S],e=p?e.spec.types[S]:e.innerType}if(!u){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${s} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}a=d,s=c?"["+o+"]":"."+o}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}var mc=class e extends Set{describe(){let t=[];for(let n of this.values())t.push(Un.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(let r of this.values())n.push(t(r));return n}clone(){return new e(this.values())}merge(t,n){let r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}};function Ci(e,t=new Map){if(bc(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Ci(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(let[r,i]of e.entries())n.set(r,Ci(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(let r of e)n.add(Ci(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=Ci(i,t)}else throw Error(`Unable to clone ${e}`);return n}var St=class{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new mc,this._blacklist=new mc,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Tn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t?.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;let n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ci(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone(),i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(a=>{t.tests.forEach(s=>{a.test(s.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,a)=>a.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,a;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",a=r._cast(t,n);if(n.assert!==!1&&!r.isType(a)){if(i&&dn(a))return a;let s=Bn(t),o=Bn(a);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
105
+ `;l();l();var Jt=Z(RN()),Ya=Z(NN()),wN=Z(IN()),QU=Object.prototype.toString,XU=Error.prototype.toString,JU=RegExp.prototype.toString,jU=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",ZU=/^Symbol\((.*)\)(.*)$/;function e7(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function vN(e,t=!1){if(e==null||e===!0||e===!1)return""+e;let n=typeof e;if(n==="number")return e7(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return jU.call(e).replace(ZU,"Symbol($1)");let r=QU.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+XU.call(e)+"]":r==="RegExp"?JU.call(e):null}function Bn(e,t){let n=vN(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let a=vN(this[r],t);return a!==null?a:i},2)}function LN(e){return e==null?[]:[].concat(e)}var PN,t7=/\$\{\s*(\w+)\s*\}/g;PN=Symbol.toStringTag;var Ht=class e extends Error{static formatError(t,n){let r=n.label||n.path||"this";return r!==n.path&&(n=Object.assign({},n,{path:r})),typeof t=="string"?t.replace(t7,(i,a)=>Bn(n[a])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,a){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[PN]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],LN(t).forEach(s=>{if(e.isError(s)){this.errors.push(...s.errors);let o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!a&&Error.captureStackTrace&&Error.captureStackTrace(this,e)}},Tn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=r!=null&&r!==n?` (cast from the value \`${Bn(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Bn(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Bn(n,!0)}\``+i}},un={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},cr={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Om={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Nm={isValue:"${path} field must be ${value}"},ym={noUnknown:"${path} field has unspecified keys: ${unknown}"},uc={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},FN={notType:e=>{let{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${Bn(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${Bn(n,!0)}\``}return Ht.formatError(Tn.notType,e)}},Nle=Object.assign(Object.create(null),{mixed:Tn,string:un,number:cr,date:Om,object:ym,array:uc,boolean:Nm,tuple:FN}),bc=e=>e&&e.__isYupSchema__,_c=class e{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:a}=n,s=typeof r=="function"?r:(...o)=>o.every(c=>c===r);return new e(t,(o,c)=>{var u;let d=s(...o)?i:a;return(u=d?.(c))!=null?u:c})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(a=>a.getValue(n?.value,n?.parent,n?.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!bc(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}},cc={context:"$",value:"."};var Un=class{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===cc.context,this.isValue=this.key[0]===cc.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?cc.context:this.isValue?cc.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&(0,Jt.getter)(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n?.parent,n?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}};Un.prototype.__isYupRef=!0;var dn=e=>e==null;function Di(e){function t({value:n,path:r="",options:i,originalValue:a,schema:s},o,c){let{name:u,test:d,params:p,message:S,skipAbsent:g}=e,{parent:T,context:N,abortEarly:w=s.spec.abortEarly,disableStackTrace:k=s.spec.disableStackTrace}=i;function M(J){return Un.isRef(J)?J.getValue(n,T,N):J}function B(J={}){var _e;let Se=Object.assign({value:n,originalValue:a,label:s.spec.label,path:J.path||r,spec:s.spec},p,J.params);for(let Te of Object.keys(Se))Se[Te]=M(Se[Te]);let xe=new Ht(Ht.formatError(J.message||S,Se),n,Se.path,J.type||u,(_e=J.disableStackTrace)!=null?_e:k);return xe.params=Se,xe}let Y=w?o:c,re={path:r,parent:T,type:u,from:i.from,createError:B,resolve:M,options:i,originalValue:a,schema:s},Q=J=>{Ht.isError(J)?Y(J):J?c(null):Y(B())},ae=J=>{Ht.isError(J)?Y(J):o(J)};if(g&&dn(n))return Q(!0);let P;try{var $;if(P=d.call(re,n,re),typeof(($=P)==null?void 0:$.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${re.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(P).then(Q,ae)}}catch(J){ae(J);return}Q(P)}return t.OPTIONS=e,t}function n7(e,t,n,r=n){let i,a,s;return t?((0,Jt.forEach)(t,(o,c,u)=>{let d=c?o.slice(1,o.length-1):o;e=e.resolve({context:r,parent:i,value:n});let p=e.type==="tuple",S=u?parseInt(d,10):0;if(e.innerType||p){if(p&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(n&&S>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[S],e=p?e.spec.types[S]:e.innerType}if(!u){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${s} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}a=d,s=c?"["+o+"]":"."+o}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}var mc=class e extends Set{describe(){let t=[];for(let n of this.values())t.push(Un.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(let r of this.values())n.push(t(r));return n}clone(){return new e(this.values())}merge(t,n){let r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}};function Ci(e,t=new Map){if(bc(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Ci(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(let[r,i]of e.entries())n.set(r,Ci(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(let r of e)n.add(Ci(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=Ci(i,t)}else throw Error(`Unable to clone ${e}`);return n}var St=class{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new mc,this._blacklist=new mc,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Tn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t?.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;let n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ci(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone(),i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(a=>{t.tests.forEach(s=>{a.test(s.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,a)=>a.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,a;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",a=r._cast(t,n);if(n.assert!==!1&&!r.isType(a)){if(i&&dn(a))return a;let s=Bn(t),o=Bn(a);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
106
106
 
107
107
  attempted value: ${s}
108
108
  `+(o!==s?`result of cast: ${o}`:""))}return a}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:a,originalValue:s=t,strict:o=this.spec.strict}=n,c=t;o||(c=this._cast(c,Object.assign({assert:!1},n)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:a,value:c,originalValue:s,options:n,tests:u},r,d=>{if(d.length)return i(d,c);this.runTests({path:a,value:c,originalValue:s,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:a,value:s,originalValue:o,path:c,options:u}=t,d=N=>{i||(i=!0,n(N,s))},p=N=>{i||(i=!0,r(N,s))},S=a.length,g=[];if(!S)return p([]);let T={value:s,originalValue:o,path:c,options:u,schema:this};for(let N=0;N<a.length;N++){let w=a[N];w(T,d,function(M){M&&(Array.isArray(M)?g.push(...M):g.push(M)),--S<=0&&p(g)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:a,options:s}){let o=t??n;if(o==null)throw TypeError("Must include `key` or `index` for nested validations");let c=typeof o=="number",u=r[o],d=Object.assign({},s,{strict:!0,parent:r,value:u,originalValue:a[o],key:void 0,[c?"index":"key"]:o,path:c||o.includes(".")?`${i||""}[${u?o:`"${o}"`}]`:(i?`${i}.`:"")+t});return(p,S,g)=>this.resolve(d)._validate(u,d,S,g)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),a=(r=n?.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((s,o)=>i._validate(t,n,(c,u)=>{Ht.isError(c)&&(c.value=u),o(c)},(c,u)=>{c.length?o(new Ht(c,u,void 0,void 0,a)):s(u)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),a,s=(r=n?.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(o,c)=>{throw Ht.isError(o)&&(o.value=c),o},(o,c)=>{if(o.length)throw new Ht(o,t,void 0,void 0,s);a=c}),a}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Ht.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Ht.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Ci(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){let r=this.clone({nullable:t});return r.internalTests.nullable=Di({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){let r=this.clone({optional:t});return r.internalTests.optionality=Di({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Tn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Tn.notNull){return this.nullability(!1,t)}required(t=Tn.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Tn.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Di(n),a=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(s=>!(s.OPTIONS.name===n.name&&(a||s.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=LN(t).map(a=>new Un(a));return i.forEach(a=>{a.isSibling&&r.deps.push(a.key)}),r.conditions.push(typeof n=="function"?new _c(i,n):_c.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Di({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Tn.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=Di({message:n,name:"oneOf",skipAbsent:!0,test(i){let a=this.schema._whitelist,s=a.resolveAll(this.resolve);return s.includes(i)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:s}})}}),r}notOneOf(t,n=Tn.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=Di({message:n,name:"notOneOf",test(i){let a=this.schema._blacklist,s=a.resolveAll(this.resolve);return s.includes(i)?this.createError({params:{values:Array.from(a).join(", "),resolved:s}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){let n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:a,nullable:s}=n.spec;return{meta:i,label:r,optional:a,nullable:s,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,u,d)=>d.findIndex(p=>p.name===c.name)===u)}}};St.prototype.__isYupSchema__=!0;for(let e of["validate","validateSync"])St.prototype[`${e}At`]=function(t,n,r={}){let{parent:i,parentPath:a,schema:s}=n7(this,t,n,r.context);return s[e](i&&i[a],Object.assign({},r,{parent:i,path:t}))};for(let e of["equals","is"])St.prototype[e]=St.prototype.oneOf;for(let e of["not","nope"])St.prototype[e]=St.prototype.notOneOf;var r7=()=>!0;function i7(e){return new pc(e)}var pc=class extends St{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:r7},t))}};i7.prototype=pc.prototype;function a7(){return new Ec}var Ec=class extends St{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Nm.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return dn(n)||n===!0}})}isFalse(t=Nm.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return dn(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}};a7.prototype=Ec.prototype;var s7=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,o7=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,l7=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,c7=e=>dn(e)||e===e.trim(),u7={}.toString();function Lr(){return new fc}var fc=class extends St{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;let i=t!=null&&t.toString?t.toString():t;return i===u7?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Tn.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=un.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=un.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=un.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,a;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:a}=n:i=n),this.test({name:a||"matches",message:i||un.matches,params:{regex:t},skipAbsent:!0,test:s=>s===""&&r||s.search(t)!==-1})}email(t=un.email){return this.matches(s7,{name:"email",message:t,excludeEmptyString:!0})}url(t=un.url){return this.matches(o7,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=un.uuid){return this.matches(l7,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=un.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:c7})}lowercase(t=un.lowercase){return this.transform(n=>dn(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>dn(n)||n===n.toLowerCase()})}uppercase(t=un.uppercase){return this.transform(n=>dn(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>dn(n)||n===n.toUpperCase()})}};Lr.prototype=fc.prototype;var d7=e=>e!=+e;function Dc(){return new gc}var gc=class extends St{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!d7(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return r.isType(i)||i===null?i:parseFloat(i)})})}min(t,n=cr.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=cr.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=cr.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=cr.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=cr.positive){return this.moreThan(0,t)}negative(t=cr.negative){return this.lessThan(0,t)}integer(t=cr.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>dn(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(i=>dn(i)?i:Math[t](i))}};Dc.prototype=gc.prototype;var _7=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function kn(e,t=0){return Number(e)||t}function m7(e){let t=_7.exec(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;let n={year:kn(t[1]),month:kn(t[2],1)-1,day:kn(t[3],1),hour:kn(t[4]),minute:kn(t[5]),second:kn(t[6]),millisecond:t[7]?kn(t[7].substring(0,3)):0,z:t[8]||void 0,plusMinus:t[9]||void 0,hourOffset:kn(t[10]),minuteOffset:kn(t[11])};if(n.z===void 0&&n.plusMinus===void 0)return new Date(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond).valueOf();let r=0;return n.z!=="Z"&&n.plusMinus!==void 0&&(r=n.hourOffset*60+n.minuteOffset,n.plusMinus==="+"&&(r=0-r)),Date.UTC(n.year,n.month,n.day,n.hour,n.minute+r,n.second,n.millisecond)}var kN=new Date(""),p7=e=>Object.prototype.toString.call(e)==="[object Date]";function BN(){return new qa}var qa=class e extends St{constructor(){super({type:"date",check(t){return p7(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=m7(t),isNaN(t)?e.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Un.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Om.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Om.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}};qa.INVALID_DATE=kN;BN.prototype=qa.prototype;BN.INVALID_DATE=kN;function E7(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([s,o])=>`${s}-${o}`));function a(s,o){let c=(0,Jt.split)(s)[0];r.add(c),i.has(`${o}-${c}`)||n.push([o,c])}for(let s of Object.keys(e)){let o=e[s];r.add(s),Un.isRef(o)&&o.isSibling?a(o.path,s):bc(o)&&"deps"in o&&o.deps.forEach(c=>a(c,s))}return wN.default.array(Array.from(r),n).reverse()}function xN(e,t){let n=1/0;return e.some((r,i)=>{var a;if((a=t.path)!=null&&a.includes(r))return n=i,!0}),n}function UN(e){return(t,n)=>xN(e,t)-xN(e,n)}var GN=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function dc(e){if("fields"in e){let t={};for(let[n,r]of Object.entries(e.fields))t[n]=dc(r);return e.setFields(t)}if(e.type==="array"){let t=e.optional();return t.innerType&&(t.innerType=dc(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(dc)}):"optional"in e?e.optional():e}var f7=(e,t)=>{let n=[...(0,Jt.normalizePath)(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=(0,Jt.getter)((0,Jt.join)(n),!0)(e);return!!(i&&r in i)},MN=e=>Object.prototype.toString.call(e)==="[object Object]";function g7(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}var S7=UN([]);function Im(e){return new Sc(e)}var Sc=class extends St{constructor(t){super({type:"object",check(n){return MN(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=S7,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let a=this.fields,s=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,o=[].concat(this._nodes,Object.keys(i).filter(p=>!this._nodes.includes(p))),c={},u=Object.assign({},n,{parent:c,__validating:n.__validating||!1}),d=!1;for(let p of o){let S=a[p],g=p in i;if(S){let T,N=i[p];u.path=(n.path?`${n.path}.`:"")+p,S=S.resolve({value:N,context:n.context,parent:c});let w=S instanceof St?S.spec:void 0,k=w?.strict;if(w!=null&&w.strip){d=d||p in i;continue}T=!n.__validating||!k?S.cast(i[p],u):i[p],T!==void 0&&(c[p]=T)}else g&&!s&&(c[p]=i[p]);(g!==p in c||c[p]!==i[p])&&(d=!0)}return d?c:i}_validate(t,n={},r,i){let{from:a=[],originalValue:s=t,recursive:o=this.spec.recursive}=n;n.from=[{schema:this,value:s},...a],n.__validating=!0,n.originalValue=s,super._validate(t,n,r,(c,u)=>{if(!o||!MN(u)){i(c,u);return}s=s||u;let d=[];for(let p of this._nodes){let S=this.fields[p];!S||Un.isRef(S)||d.push(S.asNestedTest({options:n,key:p,parent:u,parentPath:n.path,originalParent:s}))}this.runTests({tests:d,value:u,originalValue:s,options:n},r,p=>{i(p.sort(this._sortErrors).concat(c),u)})})}clone(t){let n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,a]of Object.entries(this.fields)){let s=r[i];r[i]=s===void 0?a:s}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;let a=this.fields[r],s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),n[r]=a&&"getDefault"in a?a.getDefault(s):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=E7(t,n),r._sortErrors=UN(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){let t={};for(let[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return dc(this)}pick(t){let n={};for(let r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){let n=[];for(let r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=(0,Jt.getter)(t,!0);return this.transform(a=>{if(!a)return a;let s=a;return f7(a,t)&&(s=Object.assign({},a),r||delete s[t],s[n]=i(a)),s})}json(){return this.transform(GN)}noUnknown(t=!0,n=ym.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;let a=g7(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=ym.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;let r={};for(let i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Ya.camelCase)}snakeCase(){return this.transformKeys(Ya.snakeCase)}constantCase(){return this.transformKeys(t=>(0,Ya.snakeCase)(t).toUpperCase())}describe(t){let n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(let[a,s]of Object.entries(n.fields)){var i;let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[a]})),r.fields[a]=s.describe(o)}return r}};Im.prototype=Sc.prototype;function T7(e){return new Tc(e)}var Tc=class extends St{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){let r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1,a=r.map((s,o)=>{let c=this.innerType.cast(s,Object.assign({},n,{path:`${n.path||""}[${o}]`}));return c!==s&&(i=!0),c});return i?a:r}_validate(t,n={},r,i){var a;let s=this.innerType,o=(a=n.recursive)!=null?a:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(c,u)=>{var d;if(!o||!s||!this._typeCheck(u)){i(c,u);return}let p=new Array(u.length);for(let g=0;g<u.length;g++){var S;p[g]=s.asNestedTest({options:n,index:g,parent:u,parentPath:n.path,originalParent:(S=n.originalValue)!=null?S:t})}this.runTests({value:u,tests:p,originalValue:(d=n.originalValue)!=null?d:t,options:n},r,g=>i(g.concat(c),u))})}clone(t){let n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(GN)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!bc(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Bn(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=uc.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||uc.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||uc.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,a)=>!t(r,i,a):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){let n=(t?this.resolve(t):this).clone(),r=super.describe(t);if(n.innerType){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[0]})),r.innerType=n.innerType.describe(a)}return r}};T7.prototype=Tc.prototype;function h7(e){return new hc(e)}var hc=class extends St{constructor(t){super({type:"tuple",spec:{types:t},check(n){let r=this.spec.types;return Array.isArray(n)&&n.length===r.length}}),this.withMutation(()=>{this.typeError(FN.notType)})}_cast(t,n){let{types:r}=this.spec,i=super._cast(t,n);if(!this._typeCheck(i))return i;let a=!1,s=r.map((o,c)=>{let u=o.cast(i[c],Object.assign({},n,{path:`${n.path||""}[${c}]`}));return u!==i[c]&&(a=!0),u});return a?s:i}_validate(t,n={},r,i){let a=this.spec.types;super._validate(t,n,r,(s,o)=>{var c;if(!this._typeCheck(o)){i(s,o);return}let u=[];for(let[p,S]of a.entries()){var d;u[p]=S.asNestedTest({options:n,index:p,parent:o,parentPath:n.path,originalParent:(d=n.originalValue)!=null?d:t})}this.runTests({value:o,tests:u,originalValue:(c=n.originalValue)!=null?c:t,options:n},r,p=>i(p.concat(s),o))})}describe(t){let n=(t?this.resolve(t):this).clone(),r=super.describe(t);return r.innerType=n.spec.types.map((i,a)=>{var s;let o=t;return(s=o)!=null&&s.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[a]})),i.describe(o)}),r}};h7.prototype=hc.prototype;var vc=Z(gy()),Ai=Z(require("fs/promises")),Sy=Z(require("fs")),xc=Z(require("path"));var Oi="e2b.toml";function Q7(e){return`# This is a config for E2B sandbox template.
@@ -150,7 +150,7 @@ Sandbox templates to delete`))),i.forEach(a=>console.log(gt({...a,templateID:a.t
150
150
  `),!t.yes&&!await zy(`Do you really want to delete ${i.length===1?"this template":"these templates"}?`)){console.log("Canceled");return}await Promise.all(i.map(async a=>{console.log(`- Deleting sandbox template ${gt({...a,templateID:a.template_id},a.configPath)}`),await lH(a.template_id),a.configPath&&await by(a.configPath)})),process.stdout.write(`
151
151
  `)}catch(n){console.error(Ar(n.message)),process.exit(1)}});var Jy=new Oe("template").description("manage sandbox templates").alias("tpl").addCommand(Cy).addCommand(qy).addCommand(Ky).addCommand(Xy);l();l();l();function jy(){return{cols:process.stdout.columns,rows:process.stdout.rows}}async function Fc(e){process.stdin.setRawMode(!0),process.stdout.setEncoding("utf-8");let t=await e.pty.create({onData:i=>{process.stdout.write(i)},...jy(),timeoutMs:0}),n=process.stdout.on("resize",()=>e.pty.resize(t.pid,jy())),r=process.stdin.on("data",async i=>{await e.pty.sendInput(t.pid,i)});try{await t.wait()}catch(i){if(i instanceof gi){if(i.exitCode===-1&&i.error==="signal: killed")return;if(i.exitCode===130){console.warn("Terminal session was killed by user");return}}throw i}finally{process.stdout.write(`
152
152
  `),n.destroy(),r.destroy(),process.stdin.setRawMode(!1)}}var Zy=new Oe("connect").description("connect terminal to already running sandbox").argument("<sandboxID>",`connect to sandbox with ${pe("<sandboxID>")}`).alias("cn").action(async e=>{try{let t=sr();e||(console.error("You need to specify sandbox ID"),process.exit(1)),await cH({apiKey:t,sandboxID:e}),process.exit(0)}catch(t){console.error(t),process.exit(1)}});async function cH({apiKey:e,sandboxID:t}){let n=await Sn.connect(t,{apiKey:e});console.log(`Terminal connecting to sandbox ${Lt(`${n.sandboxId}`)}`),await Fc(n),console.log(`Closing terminal connection to sandbox ${Lt(n.sandboxId)}`)}l();var eI=Z(tp());var tI=new Oe("list").description("list all running sandboxes").alias("ls").action(async()=>{try{let e=await kc();e?.length?(new eI.Table({title:"Running sandboxes",columns:[{name:"sandboxID",alignment:"left",title:"Sandbox ID"},{name:"templateID",alignment:"left",title:"Template ID"},{name:"alias",alignment:"left",title:"Alias"},{name:"startedAt",alignment:"left",title:"Started at"},{name:"endAt",alignment:"left",title:"End at"},{name:"cpuCount",alignment:"left",title:"vCPUs"},{name:"memoryMB",alignment:"left",title:"RAM MiB"},{name:"metadata",alignment:"left",title:"Metadata"}],disabledColumns:["clientID"],rows:e.map(n=>({...n,sandboxID:`${n.sandboxID}-${n.clientID}`,startedAt:new Date(n.startedAt).toLocaleString(),endAt:new Date(n.endAt).toLocaleString(),metadata:JSON.stringify(n.metadata)})).sort((n,r)=>n.startedAt.localeCompare(r.startedAt)||n.sandboxID.localeCompare(r.sandboxID)),colorMap:{orange:"\x1B[38;5;216m"}}).printTable(),process.stdout.write(`
153
- `)):console.log("No running sandboxes.")}catch(e){console.error(e),process.exit(1)}});async function kc(){sr();let e=Ft.getSignal(),t=await vt.api.GET("/sandboxes",{signal:e});return Rt(t.error,"Error getting running sandboxes"),t.data}l();async function nI(e,t){await Sn.kill(e,{apiKey:t})?console.log(`Sandbox ${pe(e)} has been killed`):console.error(`Sandbox ${pe(e)} wasn't found`)}var rI=new Oe("kill").description("kill sandbox").argument("[sandboxID]",`kill the sandbox specified by ${pe("[sandboxID]")}`).alias("kl").option("-a, --all","kill all running sandboxes").action(async(e,{all:t})=>{try{let n=sr();if(!e&&!t&&(console.error(`You need to specify ${pe("[sandboxID]")} or use ${pe("-a/--all")} flag`),process.exit(1)),t&&e&&(console.error(`You cannot use ${pe("-a/--all")} flag while specifying ${pe("[sandboxID]")}`),process.exit(1)),t){let r=await Sn.list({apiKey:n});r.length===0&&(console.log("No running sandboxes"),process.exit(0)),await Promise.all(r.map(i=>nI(i.sandboxId,n)))}else await nI(e,n)}catch(n){console.error(n),process.exit(1)}});l();var iI=Z(require("path"));var aI=Z(require("fs"));var sI=new Oe("spawn").description("spawn sandbox and connect terminal to it").argument("[template]",`spawn and connect to sandbox specified by ${pe("[template]")}`).addOption(or).addOption(hi).alias("sp").action(async(e,t)=>{try{let n=sr(),r=e,i=rr(t.path),a=yi(i,t.config),s=aI.default.existsSync(a)?await Ni(a):void 0,o=iI.relative(i,a);!r&&s&&(console.log(`Found sandbox template ${gt({templateID:s.template_id,aliases:s.template_name?[s.template_name]:void 0},o)}`),r=s.template_id),r||(console.error("You need to specify sandbox template ID or path to sandbox template config"),process.exit(1)),await uH({apiKey:n,template:{templateID:r}}),process.exit(0)}catch(n){console.error(n),process.exit(1)}});async function uH({apiKey:e,template:t}){let n=await Sn.create(t.templateID,{apiKey:e}),r=setInterval(async()=>{await n.setTimeout(1e4)},5e3);console.log(`Terminal connecting to template ${gt(t)} with sandbox ID ${pe(`${n.sandboxId}`)}`);try{await Fc(n)}finally{clearInterval(r),await n.kill(),console.log(`Closing terminal connection to template ${gt(t)} with sandbox ID ${pe(`${n.sandboxId}`)}`)}}l();var lI=Z(require("util"));var dH=24*60*60*1e3;function cI(e){return e.split("-")[0]}function _H(e){let t=!0;async function n(){let r=new Date().getTime();for(;!(new Date().getTime()-r>=dH);){if(!(await kc()).find(c=>c.sandboxID===cI(e))){t=!1;break}await Ca(5e3)}}return n(),()=>t}var ip=(i=>(i.DEBUG="DEBUG",i.INFO="INFO",i.WARN="WARN",i.ERROR="ERROR",i))(ip||{});function mH(e,t){if(!t)return!0;switch(t){case"DEBUG":return!0;case"INFO":return e==="INFO"||e==="WARN"||e==="ERROR";case"WARN":return e==="WARN"||e==="ERROR";case"ERROR":return e==="ERROR"}}function oI(e){return Object.values(e).map(t=>pe(t)).join(", ")}var ap=(n=>(n.JSON="json",n.PRETTY="pretty",n))(ap||{});function pH(e){return e?e.replaceAll("Svc",""):""}var uI=new Oe("logs").description("show logs for sandbox").argument("<sandboxID>",`show logs for sandbox specified by ${pe("<sandboxID>")}`).alias("lg").option("--level <level>",`filter logs by level (${oI(ip)}). The logs with the higher levels will be also shown.`,"INFO").option("-f, --follow","keep streaming logs until the sandbox is closed").option("--format <format>",`specify format for printing logs (${oI(ap)})`,"pretty").option("--loggers [loggers]","filter logs by loggers. Specify multiple loggers by separating them with a comma.",e=>e.split(",")).action(async(e,t)=>{try{let n=t?.level.toUpperCase();if(n&&!Object.values(ip).includes(n))throw new Error(`Invalid log level: ${n}`);let r=t?.format.toLowerCase();if(r&&!Object.values(ap).includes(r))throw new Error(`Invalid log format: ${r}`);let i=t?.follow?_H(e):()=>!1,a,s=!0,o=!1;r==="pretty"&&console.log(`
153
+ `)):console.log("No running sandboxes.")}catch(e){console.error(e),process.exit(1)}});async function kc(){sr();let e=Ft.getSignal(),t=await vt.api.GET("/sandboxes",{signal:e});return Rt(t.error,"Error getting running sandboxes"),t.data}l();async function nI(e,t){await Sn.kill(e,{apiKey:t})?console.log(`Sandbox ${pe(e)} has been killed`):console.error(`Sandbox ${pe(e)} wasn't found`)}var rI=new Oe("kill").description("kill sandbox").argument("[sandboxID]",`kill the sandbox specified by ${pe("[sandboxID]")}`).alias("kl").option("-a, --all","kill all running sandboxes").action(async(e,{all:t})=>{try{let n=sr();if(!e&&!t&&(console.error(`You need to specify ${pe("[sandboxID]")} or use ${pe("-a/--all")} flag`),process.exit(1)),t&&e&&(console.error(`You cannot use ${pe("-a/--all")} flag while specifying ${pe("[sandboxID]")}`),process.exit(1)),t){let r=await Sn.list({apiKey:n});r.length===0&&(console.log("No running sandboxes"),process.exit(0)),await Promise.all(r.map(i=>nI(i.sandboxId,n)))}else await nI(e,n)}catch(n){console.error(n),process.exit(1)}});l();var iI=Z(require("path"));var aI=Z(require("fs"));var sI=new Oe("spawn").description("spawn sandbox and connect terminal to it").argument("[template]",`spawn and connect to sandbox specified by ${pe("[template]")}`).addOption(or).addOption(hi).alias("sp").action(async(e,t)=>{try{let n=sr(),r=e,i=rr(t.path),a=yi(i,t.config),s=aI.default.existsSync(a)?await Ni(a):void 0,o=iI.relative(i,a);!r&&s&&(console.log(`Found sandbox template ${gt({templateID:s.template_id,aliases:s.template_name?[s.template_name]:void 0},o)}`),r=s.template_id),r||(console.error("You need to specify sandbox template ID or path to sandbox template config"),process.exit(1)),await uH({apiKey:n,template:{templateID:r}}),process.exit(0)}catch(n){console.error(n),process.exit(1)}});async function uH({apiKey:e,template:t}){let n=await Sn.create(t.templateID,{apiKey:e}),r=setInterval(async()=>{await n.setTimeout(3e4)},5e3);console.log(`Terminal connecting to template ${gt(t)} with sandbox ID ${pe(`${n.sandboxId}`)}`);try{await Fc(n)}finally{clearInterval(r),await n.kill(),console.log(`Closing terminal connection to template ${gt(t)} with sandbox ID ${pe(`${n.sandboxId}`)}`)}}l();var lI=Z(require("util"));var dH=24*60*60*1e3;function cI(e){return e.split("-")[0]}function _H(e){let t=!0;async function n(){let r=new Date().getTime();for(;!(new Date().getTime()-r>=dH);){if(!(await kc()).find(c=>c.sandboxID===cI(e))){t=!1;break}await Ca(5e3)}}return n(),()=>t}var ip=(i=>(i.DEBUG="DEBUG",i.INFO="INFO",i.WARN="WARN",i.ERROR="ERROR",i))(ip||{});function mH(e,t){if(!t)return!0;switch(t){case"DEBUG":return!0;case"INFO":return e==="INFO"||e==="WARN"||e==="ERROR";case"WARN":return e==="WARN"||e==="ERROR";case"ERROR":return e==="ERROR"}}function oI(e){return Object.values(e).map(t=>pe(t)).join(", ")}var ap=(n=>(n.JSON="json",n.PRETTY="pretty",n))(ap||{});function pH(e){return e?e.replaceAll("Svc",""):""}var uI=new Oe("logs").description("show logs for sandbox").argument("<sandboxID>",`show logs for sandbox specified by ${pe("<sandboxID>")}`).alias("lg").option("--level <level>",`filter logs by level (${oI(ip)}). The logs with the higher levels will be also shown.`,"INFO").option("-f, --follow","keep streaming logs until the sandbox is closed").option("--format <format>",`specify format for printing logs (${oI(ap)})`,"pretty").option("--loggers [loggers]","filter logs by loggers. Specify multiple loggers by separating them with a comma.",e=>e.split(",")).action(async(e,t)=>{try{let n=t?.level.toUpperCase();if(n&&!Object.values(ip).includes(n))throw new Error(`Invalid log level: ${n}`);let r=t?.format.toLowerCase();if(r&&!Object.values(ap).includes(r))throw new Error(`Invalid log format: ${r}`);let i=t?.follow?_H(e):()=>!1,a,s=!0,o=!1;r==="pretty"&&console.log(`
154
154
  Logs for sandbox ${pe(e)}:`);let c=kc().then(u=>u.find(d=>d.sandboxID===cI(e))).then(u=>!!u);do{let u=await fH({sandboxID:e,start:a});u.length!==0&&o===!1&&(o=!0,process.stdout.write(`
155
155
  `));for(let S of u)EH(S.timestamp,S.line,n,r,t?.loggers??void 0);let d=await c;if(!d&&u.length===0&&s){r==="pretty"&&console.log(`
156
156
  Stopped printing logs \u2014 sandbox ${O_("not found")}`);break}if(!d){r==="pretty"&&console.log(`
@@ -158,10 +158,10 @@ Stopped printing logs \u2014 sandbox is ${O_("closed")}`);break}let p=u.length>0
158
158
  tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}l();function Lp(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.toLowerCase().replace(/(?:^|\s|-)\S/g,t=>t.toUpperCase())}l();var Qx=require("buffer"),Xx=Z(require("path"),1),iu=Z(require("child_process"),1),ss=Z(require("process"),1),Jx=Z(hp(),1);l();function Pp(e){let t=typeof e=="string"?`
159
159
  `:`
160
160
  `.charCodeAt(),n=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}l();var is=Z(require("process"),1),Gi=Z(require("path"),1),ux=Z(require("url"),1);l();function jc(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}function yq(e={}){let{cwd:t=is.default.cwd(),path:n=is.default.env[jc()],execPath:r=is.default.execPath}=e,i,a=t instanceof URL?ux.default.fileURLToPath(t):t,s=Gi.default.resolve(a),o=[];for(;i!==s;)o.push(Gi.default.join(s,"node_modules/.bin")),i=s,s=Gi.default.resolve(s,"..");return o.push(Gi.default.resolve(a,r,"..")),[...o,n].join(Gi.default.delimiter)}function dx({env:e=is.default.env,...t}={}){e={...e};let n=jc({env:e});return t.path=e[n],e[n]=yq(t),e}l();l();var Iq=(e,t,n,r)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!vq(i,a)&&r||Object.defineProperty(e,n,a)},vq=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},xq=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Mq=(e,t)=>`/* Wrapped ${e}*/
161
- ${t}`,wq=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Lq=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Pq=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,i=Mq.bind(null,r,t.toString());Object.defineProperty(i,"name",Lq),Object.defineProperty(e,"toString",{...wq,value:i})};function Fp(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let i of Reflect.ownKeys(t))Iq(e,t,i,n);return xq(e,t),Pq(e,t,r),e}var Zc=new WeakMap,_x=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,i=e.displayName||e.name||"<anonymous>",a=function(...s){if(Zc.set(a,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return Fp(a,e),Zc.set(a,r),a};_x.callCount=e=>{if(!Zc.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Zc.get(e)};var mx=_x;l();var bx=Z(require("process"),1);l();var Tx=require("os");l();var px=()=>{let e=fx-Ex+1;return Array.from({length:e},Fq)},Fq=(e,t)=>({name:`SIGRT${t+1}`,number:Ex+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ex=34,fx=64;l();var Sx=require("os");l();var gx=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var kp=()=>{let e=px();return[...gx,...e].map(kq)},kq=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:s}}=Sx.constants,o=s!==void 0;return{name:e,number:o?s:t,description:n,supported:o,action:r,forced:i,standard:a}};var Bq=()=>{let e=kp();return Object.fromEntries(e.map(Uq))},Uq=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:s}],hx=Bq(),Gq=()=>{let e=kp(),t=64+1,n=Array.from({length:t},(r,i)=>Hq(i,e));return Object.assign({},...n)},Hq=(e,t)=>{let n=Yq(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:s,forced:o,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:s,forced:o,standard:c}}},Yq=(e,t)=>{let n=t.find(({name:r})=>Tx.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},Rme=Gq();var qq=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",as=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:s,escapedCommand:o,timedOut:c,isCanceled:u,killed:d,parsed:{options:{timeout:p,cwd:S=bx.default.cwd()}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;let g=i===void 0?void 0:hx[i].description,T=r&&r.code,w=`Command ${qq({timedOut:c,timeout:p,errorCode:T,signal:i,signalDescription:g,exitCode:a,isCanceled:u})}: ${s}`,k=Object.prototype.toString.call(r)==="[object Error]",M=k?`${w}
161
+ ${t}`,wq=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Lq=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Pq=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,i=Mq.bind(null,r,t.toString());Object.defineProperty(i,"name",Lq),Object.defineProperty(e,"toString",{...wq,value:i})};function Fp(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let i of Reflect.ownKeys(t))Iq(e,t,i,n);return xq(e,t),Pq(e,t,r),e}var Zc=new WeakMap,_x=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,i=e.displayName||e.name||"<anonymous>",a=function(...s){if(Zc.set(a,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return Fp(a,e),Zc.set(a,r),a};_x.callCount=e=>{if(!Zc.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Zc.get(e)};var mx=_x;l();var bx=Z(require("process"),1);l();var Tx=require("os");l();var px=()=>{let e=fx-Ex+1;return Array.from({length:e},Fq)},Fq=(e,t)=>({name:`SIGRT${t+1}`,number:Ex+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ex=34,fx=64;l();var Sx=require("os");l();var gx=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var kp=()=>{let e=px();return[...gx,...e].map(kq)},kq=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:s}}=Sx.constants,o=s!==void 0;return{name:e,number:o?s:t,description:n,supported:o,action:r,forced:i,standard:a}};var Bq=()=>{let e=kp();return Object.fromEntries(e.map(Uq))},Uq=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:s}],hx=Bq(),Gq=()=>{let e=kp(),t=64+1,n=Array.from({length:t},(r,i)=>Hq(i,e));return Object.assign({},...n)},Hq=(e,t)=>{let n=Yq(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:s,forced:o,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:s,forced:o,standard:c}}},Yq=(e,t)=>{let n=t.find(({name:r})=>Tx.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},Ame=Gq();var qq=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",as=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:s,escapedCommand:o,timedOut:c,isCanceled:u,killed:d,parsed:{options:{timeout:p,cwd:S=bx.default.cwd()}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;let g=i===void 0?void 0:hx[i].description,T=r&&r.code,w=`Command ${qq({timedOut:c,timeout:p,errorCode:T,signal:i,signalDescription:g,exitCode:a,isCanceled:u})}: ${s}`,k=Object.prototype.toString.call(r)==="[object Error]",M=k?`${w}
162
162
  ${r.message}`:w,B=[M,t,e].filter(Boolean).join(`
163
163
  `);return k?(r.originalMessage=r.message,r.message=B):r=new Error(B),r.shortMessage=M,r.command=s,r.escapedCommand=o,r.exitCode=a,r.signal=i,r.signalDescription=g,r.stdout=e,r.stderr=t,r.cwd=S,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=u,r.killed=d&&!c,r};l();var eu=["stdin","stdout","stderr"],Vq=e=>eu.some(t=>e[t]!==void 0),Dx=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return eu.map(r=>e[r]);if(Vq(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${eu.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,eu.length);return Array.from({length:n},(r,i)=>t[i])};l();var Cx=Z(require("os"),1),Rx=Z(Op(),1),$q=1e3*5,Ax=(e,t="SIGTERM",n={})=>{let r=e(t);return Kq(e,t,n,r),r},Kq=(e,t,n,r)=>{if(!Wq(t,n,r))return;let i=Qq(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},Wq=(e,{forceKillAfterTimeout:t},n)=>zq(e)&&t!==!1&&n,zq=e=>e===Cx.default.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Qq=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return $q;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ox=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Xq=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Nx=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((o,c)=>{i=setTimeout(()=>{Xq(e,n,c)},t)}),s=r.finally(()=>{clearTimeout(i)});return Promise.race([a,s])},yx=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Ix=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let i=(0,Rx.default)(()=>{e.kill()});return r.finally(()=>{i()})};l();var vx=require("fs"),xx=require("child_process");l();function tu(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Bp(e){return tu(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}var Jq=e=>e instanceof xx.ChildProcess&&typeof e.then=="function",Up=(e,t,n)=>{if(typeof n=="string")return e[t].pipe((0,vx.createWriteStream)(n)),e;if(Bp(n))return e[t].pipe(n),e;if(!Jq(n))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Bp(n.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(n.stdin),n},Mx=e=>{e.stdout!==null&&(e.pipeStdout=Up.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Up.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Up.bind(void 0,e,"all"))};l();var nu=require("fs");var Yp=Z(yp(),1),wx=Z(Ip(),1),Lx=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},jq=({input:e,inputFile:t})=>typeof t!="string"?e:(Lx(e),(0,nu.readFileSync)(t)),Px=e=>{let t=jq(e);if(tu(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},Zq=({input:e,inputFile:t})=>typeof t!="string"?e:(Lx(e),(0,nu.createReadStream)(t)),Fx=(e,t)=>{let n=Zq(t);n!==void 0&&(tu(n)?n.pipe(e.stdin):e.stdin.end(n))},kx=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=(0,wx.default)();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},Gp=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(n){return n.bufferedData}}},Hp=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?(0,Yp.default)(e,{encoding:t,maxBuffer:r}):Yp.default.buffer(e,{maxBuffer:r})},Bx=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},s)=>{let o=Hp(e,{encoding:r,buffer:i,maxBuffer:a}),c=Hp(t,{encoding:r,buffer:i,maxBuffer:a}),u=Hp(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([s,o,c,u])}catch(d){return Promise.all([{error:d,signal:d.signal,timedOut:d.timedOut},Gp(e,o),Gp(t,c),Gp(n,u)])}};l();var eV=(async()=>{})().constructor.prototype,tV=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(eV,e)]),qp=(e,t)=>{for(let[n,r]of tV){let i=typeof t=="function"?(...a)=>Reflect.apply(r.value,t(),a):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Ux=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});l();var Yx=require("buffer"),qx=require("child_process"),Vx=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],nV=/^[\w.-]+$/,rV=/"/g,iV=e=>typeof e!="string"||nV.test(e)?e:`"${e.replace(rV,'\\"')}"`,Vp=(e,t)=>Vx(e,t).join(" "),$p=(e,t)=>Vx(e,t).map(n=>iV(n)).join(" "),aV=/ +/g;var Gx=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(t==="object"&&e!==null&&!(e instanceof qx.ChildProcess)&&"stdout"in e){let n=typeof e.stdout;if(n==="string")return e.stdout;if(Yx.Buffer.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${n}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},Hx=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e[e.length-1]}${t[0]}`,...t.slice(1)],sV=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{let a=i??e.raw[r],s=a.split(aV).filter(Boolean),o=Hx(n,s,a.startsWith(" "));if(r===t.length)return o;let c=t[r],u=Array.isArray(c)?c.map(d=>Gx(d)):[Gx(c)];return Hx(o,u,a.endsWith(" "))},Kp=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=sV({templates:e,expressions:t,tokens:n,index:r,template:i});return n};l();var $x=require("util"),Kx=Z(require("process"),1),Wx=(0,$x.debuglog)("execa").enabled,ru=(e,t)=>String(e).padStart(t,"0"),oV=()=>{let e=new Date;return`${ru(e.getHours(),2)}:${ru(e.getMinutes(),2)}:${ru(e.getSeconds(),2)}.${ru(e.getMilliseconds(),3)}`},Wp=(e,{verbose:t})=>{t&&Kx.default.stderr.write(`[${oV()}] ${e}
164
- `)};var lV=1e3*1e3*100,cV=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...ss.default.env,...e}:e;return n?dx({env:a,cwd:r,execPath:i}):a},jx=(e,t,n={})=>{let r=Jx.default._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:lV,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||ss.default.cwd(),execPath:ss.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Wx,...n},n.env=cV(n),n.stdio=Dx(n),ss.default.platform==="win32"&&Xx.default.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},os=(e,t,n)=>typeof t!="string"&&!Qx.Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?Pp(t):t;function ls(e,t,n){let r=jx(e,t,n),i=Vp(e,t),a=$p(e,t);Wp(a,r.options),yx(r.options);let s;try{s=iu.default.spawn(r.file,r.args,r.options)}catch(g){let T=new iu.default.ChildProcess,N=Promise.reject(as({error:g,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return qp(T,N),T}let o=Ux(s),c=Nx(s,r.options,o),u=Ix(s,r.options,c),d={isCanceled:!1};s.kill=Ax.bind(null,s.kill.bind(s)),s.cancel=Ox.bind(null,s,d);let S=mx(async()=>{let[{error:g,exitCode:T,signal:N,timedOut:w},k,M,B]=await Bx(s,r.options,u),Y=os(r.options,k),re=os(r.options,M),Q=os(r.options,B);if(g||T!==0||N!==null){let ae=as({error:g,exitCode:T,signal:N,stdout:Y,stderr:re,all:Q,command:i,escapedCommand:a,parsed:r,timedOut:w,isCanceled:d.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:s.killed});if(!r.options.reject)return ae;throw ae}return{command:i,escapedCommand:a,exitCode:0,stdout:Y,stderr:re,all:Q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Fx(s,r.options),s.all=kx(s,r.options),Mx(s),qp(s,S),s}function uV(e,t,n){let r=jx(e,t,n),i=Vp(e,t),a=$p(e,t);Wp(a,r.options);let s=Px(r.options),o;try{o=iu.default.spawnSync(r.file,r.args,{...r.options,input:s})}catch(d){throw as({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let c=os(r.options,o.stdout,o.error),u=os(r.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){let d=as({stdout:c,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:a,parsed:r,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!r.options.reject)return d;throw d}return{command:i,escapedCommand:a,exitCode:0,stdout:c,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var dV=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},zx=(e={})=>({preferLocal:!0,...dV(e),...e});function Zx(e){function t(n,...r){if(!Array.isArray(n))return Zx({...e,...n});let[i,...a]=Kp(n,r);return ls(i,a,zx(e))}return t.sync=(n,...r)=>{if(!Array.isArray(n))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[i,...a]=Kp(n,r);return uV(i,a,zx(e))},t}var ope=Zx();l();var _V={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"}},au=class extends Error{};async function zp(e=ls){let t=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t.stdout);if(!n)throw new au(`Cannot find Windows browser in stdout: ${JSON.stringify(t.stdout)}`);let{id:r}=n.groups,i=_V[r];if(!i)throw new au(`Unknown browser ID: ${r}`);return i}async function Qp(){if(su.default.platform==="linux"){let{stdout:e}=await ls("xdg-mime",["query","default","x-scheme-handler/http"]);return{name:Lp(e.trim().replace(/.desktop$/,"").replace("-"," ")),id:e}}if(su.default.platform==="darwin"){let e=await cp();return{name:await wp(e),id:e}}if(su.default.platform==="win32")return zp();throw new Error("Only macOS, Linux, and Windows are supported")}l();var eM=Z(require("fs"),1);l();var Jp=Z(require("fs"),1),Xp;function mV(){try{return Jp.default.statSync("/.dockerenv"),!0}catch{return!1}}function pV(){try{return Jp.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function jp(){return Xp===void 0&&(Xp=mV()||pV()),Xp}var Zp,EV=()=>{try{return eM.default.statSync("/run/.containerenv"),!0}catch{return!1}};function eE(){return Zp===void 0&&(Zp=EV()||jp()),Zp}var tE=nE.default.dirname((0,sM.fileURLToPath)(importMetaUrl)),tM=nE.default.join(tE,"xdg-open"),{platform:Hi,arch:nM}=lu.default,fV=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let n="/etc/wsl.conf",r=!1;try{await cu.default.access(n,rE.constants.F_OK),r=!0}catch{}if(!r)return e;let i=await cu.default.readFile(n,{encoding:"utf8"}),a=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return a?(t=a.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),rM=async(e,t)=>{let n;for(let r of e)try{return await t(r)}catch(i){n=i}throw n},ou=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return rM(e.app,o=>ou({...e,app:o}));let{name:t,arguments:n=[]}=e.app??{};if(n=[...n],Array.isArray(t))return rM(t,o=>ou({...e,app:{name:o,arguments:n}}));if(t==="browser"||t==="browserPrivate"){let o={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},c={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},u=await Qp();if(u.id in o){let d=o[u.id];return t==="browserPrivate"&&n.push(c[d]),ou({...e,app:{name:Yi[d],arguments:n}})}throw new Error(`${u.name} is not supported as a default browser`)}let r,i=[],a={};if(Hi==="darwin")r="open",e.wait&&i.push("--wait-apps"),e.background&&i.push("--background"),e.newInstance&&i.push("--new"),t&&i.push("-a",t);else if(Hi==="win32"||cs.default&&!eE()&&!t){let o=await fV();r=cs.default?`${o}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${lu.default.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),cs.default||(a.windowsVerbatimArguments=!0);let c=["Start"];e.wait&&c.push("-Wait"),t?(c.push(`"\`"${t}\`""`),e.target&&n.push(e.target)):e.target&&c.push(`"${e.target}"`),n.length>0&&(n=n.map(u=>`"\`"${u}\`""`),c.push("-ArgumentList",n.join(","))),e.target=aM.Buffer.from(c.join(" "),"utf16le").toString("base64")}else{if(t)r=t;else{let o=!tE||tE==="/",c=!1;try{await cu.default.access(tM,rE.constants.X_OK),c=!0}catch{}r=lu.default.versions.electron??(Hi==="android"||o||!c)?"xdg-open":tM}n.length>0&&i.push(...n),e.wait||(a.stdio="ignore",a.detached=!0)}e.target&&i.push(e.target),Hi==="darwin"&&n.length>0&&i.push("--args",...n);let s=oM.default.spawn(r,i,a);return e.wait?new Promise((o,c)=>{s.once("error",c),s.once("close",u=>{if(!e.allowNonzeroExitCode&&u>0){c(new Error(`Exited with code ${u}`));return}o(s)})}):(s.unref(),s)},gV=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return ou({...t,target:e})};function iM(e){if(typeof e=="string"||Array.isArray(e))return e;let{[nM]:t}=e;if(!t)throw new Error(`${nM} is not supported`);return t}function iE({[Hi]:e},{wsl:t}){if(t&&cs.default)return iM(t);if(!e)throw new Error(`${Hi} is not supported`);return iM(e)}var Yi={};Br(Yi,"chrome",()=>iE({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Br(Yi,"firefox",()=>iE({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Br(Yi,"edge",()=>iE({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Br(Yi,"browser",()=>"browser");Br(Yi,"browserPrivate",()=>"browserPrivate");var lM=gV;var dM=Z(require("path"));var _M=new Oe("login").description("log in to CLI").action(async()=>{let e;try{e=Gt()}catch(t){console.error(Ar("Failed to read user config",t))}if(e){console.log(`
164
+ `)};var lV=1e3*1e3*100,cV=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...ss.default.env,...e}:e;return n?dx({env:a,cwd:r,execPath:i}):a},jx=(e,t,n={})=>{let r=Jx.default._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:lV,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||ss.default.cwd(),execPath:ss.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Wx,...n},n.env=cV(n),n.stdio=Dx(n),ss.default.platform==="win32"&&Xx.default.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},os=(e,t,n)=>typeof t!="string"&&!Qx.Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?Pp(t):t;function ls(e,t,n){let r=jx(e,t,n),i=Vp(e,t),a=$p(e,t);Wp(a,r.options),yx(r.options);let s;try{s=iu.default.spawn(r.file,r.args,r.options)}catch(g){let T=new iu.default.ChildProcess,N=Promise.reject(as({error:g,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return qp(T,N),T}let o=Ux(s),c=Nx(s,r.options,o),u=Ix(s,r.options,c),d={isCanceled:!1};s.kill=Ax.bind(null,s.kill.bind(s)),s.cancel=Ox.bind(null,s,d);let S=mx(async()=>{let[{error:g,exitCode:T,signal:N,timedOut:w},k,M,B]=await Bx(s,r.options,u),Y=os(r.options,k),re=os(r.options,M),Q=os(r.options,B);if(g||T!==0||N!==null){let ae=as({error:g,exitCode:T,signal:N,stdout:Y,stderr:re,all:Q,command:i,escapedCommand:a,parsed:r,timedOut:w,isCanceled:d.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:s.killed});if(!r.options.reject)return ae;throw ae}return{command:i,escapedCommand:a,exitCode:0,stdout:Y,stderr:re,all:Q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Fx(s,r.options),s.all=kx(s,r.options),Mx(s),qp(s,S),s}function uV(e,t,n){let r=jx(e,t,n),i=Vp(e,t),a=$p(e,t);Wp(a,r.options);let s=Px(r.options),o;try{o=iu.default.spawnSync(r.file,r.args,{...r.options,input:s})}catch(d){throw as({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let c=os(r.options,o.stdout,o.error),u=os(r.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){let d=as({stdout:c,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:a,parsed:r,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!r.options.reject)return d;throw d}return{command:i,escapedCommand:a,exitCode:0,stdout:c,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var dV=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},zx=(e={})=>({preferLocal:!0,...dV(e),...e});function Zx(e){function t(n,...r){if(!Array.isArray(n))return Zx({...e,...n});let[i,...a]=Kp(n,r);return ls(i,a,zx(e))}return t.sync=(n,...r)=>{if(!Array.isArray(n))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[i,...a]=Kp(n,r);return uV(i,a,zx(e))},t}var lpe=Zx();l();var _V={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"}},au=class extends Error{};async function zp(e=ls){let t=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t.stdout);if(!n)throw new au(`Cannot find Windows browser in stdout: ${JSON.stringify(t.stdout)}`);let{id:r}=n.groups,i=_V[r];if(!i)throw new au(`Unknown browser ID: ${r}`);return i}async function Qp(){if(su.default.platform==="linux"){let{stdout:e}=await ls("xdg-mime",["query","default","x-scheme-handler/http"]);return{name:Lp(e.trim().replace(/.desktop$/,"").replace("-"," ")),id:e}}if(su.default.platform==="darwin"){let e=await cp();return{name:await wp(e),id:e}}if(su.default.platform==="win32")return zp();throw new Error("Only macOS, Linux, and Windows are supported")}l();var eM=Z(require("fs"),1);l();var Jp=Z(require("fs"),1),Xp;function mV(){try{return Jp.default.statSync("/.dockerenv"),!0}catch{return!1}}function pV(){try{return Jp.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function jp(){return Xp===void 0&&(Xp=mV()||pV()),Xp}var Zp,EV=()=>{try{return eM.default.statSync("/run/.containerenv"),!0}catch{return!1}};function eE(){return Zp===void 0&&(Zp=EV()||jp()),Zp}var tE=nE.default.dirname((0,sM.fileURLToPath)(importMetaUrl)),tM=nE.default.join(tE,"xdg-open"),{platform:Hi,arch:nM}=lu.default,fV=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let n="/etc/wsl.conf",r=!1;try{await cu.default.access(n,rE.constants.F_OK),r=!0}catch{}if(!r)return e;let i=await cu.default.readFile(n,{encoding:"utf8"}),a=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return a?(t=a.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),rM=async(e,t)=>{let n;for(let r of e)try{return await t(r)}catch(i){n=i}throw n},ou=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return rM(e.app,o=>ou({...e,app:o}));let{name:t,arguments:n=[]}=e.app??{};if(n=[...n],Array.isArray(t))return rM(t,o=>ou({...e,app:{name:o,arguments:n}}));if(t==="browser"||t==="browserPrivate"){let o={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},c={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},u=await Qp();if(u.id in o){let d=o[u.id];return t==="browserPrivate"&&n.push(c[d]),ou({...e,app:{name:Yi[d],arguments:n}})}throw new Error(`${u.name} is not supported as a default browser`)}let r,i=[],a={};if(Hi==="darwin")r="open",e.wait&&i.push("--wait-apps"),e.background&&i.push("--background"),e.newInstance&&i.push("--new"),t&&i.push("-a",t);else if(Hi==="win32"||cs.default&&!eE()&&!t){let o=await fV();r=cs.default?`${o}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${lu.default.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),cs.default||(a.windowsVerbatimArguments=!0);let c=["Start"];e.wait&&c.push("-Wait"),t?(c.push(`"\`"${t}\`""`),e.target&&n.push(e.target)):e.target&&c.push(`"${e.target}"`),n.length>0&&(n=n.map(u=>`"\`"${u}\`""`),c.push("-ArgumentList",n.join(","))),e.target=aM.Buffer.from(c.join(" "),"utf16le").toString("base64")}else{if(t)r=t;else{let o=!tE||tE==="/",c=!1;try{await cu.default.access(tM,rE.constants.X_OK),c=!0}catch{}r=lu.default.versions.electron??(Hi==="android"||o||!c)?"xdg-open":tM}n.length>0&&i.push(...n),e.wait||(a.stdio="ignore",a.detached=!0)}e.target&&i.push(e.target),Hi==="darwin"&&n.length>0&&i.push("--args",...n);let s=oM.default.spawn(r,i,a);return e.wait?new Promise((o,c)=>{s.once("error",c),s.once("close",u=>{if(!e.allowNonzeroExitCode&&u>0){c(new Error(`Exited with code ${u}`));return}o(s)})}):(s.unref(),s)},gV=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return ou({...t,target:e})};function iM(e){if(typeof e=="string"||Array.isArray(e))return e;let{[nM]:t}=e;if(!t)throw new Error(`${nM} is not supported`);return t}function iE({[Hi]:e},{wsl:t}){if(t&&cs.default)return iM(t);if(!e)throw new Error(`${Hi} is not supported`);return iM(e)}var Yi={};Br(Yi,"chrome",()=>iE({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Br(Yi,"firefox",()=>iE({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Br(Yi,"edge",()=>iE({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Br(Yi,"browser",()=>"browser");Br(Yi,"browserPrivate",()=>"browserPrivate");var lM=gV;var dM=Z(require("path"));var _M=new Oe("login").description("log in to CLI").action(async()=>{let e;try{e=Gt()}catch(t){console.error(Ar("Failed to read user config",t))}if(e){console.log(`
165
165
  Already logged in. ${yo(e)}.
166
166
 
167
167
  If you want to log in as a different user, log out first by running 'e2b auth logout'.