@gadgetinc/ggt 1.7.4 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +142 -31
  2. package/dist/{add-KJLV4API.js → add-TWLGKL2T.js} +8 -7
  3. package/dist/add-TWLGKL2T.js.map +7 -0
  4. package/dist/agent-plugin-TN24O7FB.js +10 -0
  5. package/dist/agent-plugin-TN24O7FB.js.map +7 -0
  6. package/dist/chunk-2742UPMB.js +10 -0
  7. package/dist/chunk-2742UPMB.js.map +7 -0
  8. package/dist/chunk-3OM5WM7E.js +2 -0
  9. package/dist/chunk-3OM5WM7E.js.map +7 -0
  10. package/dist/chunk-442CSROP.js +66 -0
  11. package/dist/chunk-442CSROP.js.map +7 -0
  12. package/dist/chunk-DR4CXBD6.js +11 -0
  13. package/dist/chunk-DR4CXBD6.js.map +7 -0
  14. package/dist/chunk-F255O64V.js +2 -0
  15. package/dist/chunk-F255O64V.js.map +7 -0
  16. package/dist/chunk-GJGBTM5Y.js +2 -0
  17. package/dist/chunk-GJGBTM5Y.js.map +7 -0
  18. package/dist/chunk-HCULGPBH.js +2 -0
  19. package/dist/chunk-HCULGPBH.js.map +7 -0
  20. package/dist/chunk-J232VCIM.js +2 -0
  21. package/dist/chunk-J232VCIM.js.map +7 -0
  22. package/dist/chunk-JG2QCDK2.js +118 -0
  23. package/dist/chunk-JG2QCDK2.js.map +7 -0
  24. package/dist/chunk-JKZNSRLU.js +8 -0
  25. package/dist/chunk-JKZNSRLU.js.map +7 -0
  26. package/dist/chunk-JYE5LLIF.js +9 -0
  27. package/dist/chunk-JYE5LLIF.js.map +7 -0
  28. package/dist/{chunk-SX5LO3XQ.js → chunk-KKIL22RY.js} +1 -1
  29. package/dist/{chunk-SX5LO3XQ.js.map → chunk-KKIL22RY.js.map} +1 -1
  30. package/dist/chunk-L2XBSR7G.js +2 -0
  31. package/dist/chunk-L2XBSR7G.js.map +7 -0
  32. package/dist/chunk-MW6MXMSN.js +2 -0
  33. package/dist/chunk-MW6MXMSN.js.map +7 -0
  34. package/dist/chunk-OUIZQC4D.js +12 -0
  35. package/dist/chunk-OUIZQC4D.js.map +7 -0
  36. package/dist/chunk-R6KJLEKY.js +28 -0
  37. package/dist/chunk-R6KJLEKY.js.map +7 -0
  38. package/dist/chunk-SIR6HLN3.js +69 -0
  39. package/dist/chunk-SIR6HLN3.js.map +7 -0
  40. package/dist/chunk-SVWK2NXG.js +2 -0
  41. package/dist/chunk-SVWK2NXG.js.map +7 -0
  42. package/dist/chunk-T6UHSWMT.js +2 -0
  43. package/dist/{chunk-J2OYMAMD.js.map → chunk-T6UHSWMT.js.map} +2 -2
  44. package/dist/{chunk-JSGXXXFU.js → chunk-WB6O2V5D.js} +6 -6
  45. package/dist/{chunk-JSGXXXFU.js.map → chunk-WB6O2V5D.js.map} +3 -3
  46. package/dist/chunk-XC4F2TLW.js +113 -0
  47. package/dist/chunk-XC4F2TLW.js.map +7 -0
  48. package/dist/chunk-YFUOXDPK.js +10 -0
  49. package/dist/chunk-YFUOXDPK.js.map +7 -0
  50. package/dist/chunk-ZSREFZXV.js +211 -0
  51. package/dist/chunk-ZSREFZXV.js.map +7 -0
  52. package/dist/chunk-ZYDMXS5R.js +6 -0
  53. package/dist/chunk-ZYDMXS5R.js.map +7 -0
  54. package/dist/{configure-CXY6JQB7.js → configure-UJS7V2JX.js} +2 -2
  55. package/dist/configure-UJS7V2JX.js.map +7 -0
  56. package/dist/debugger-QN2MCLBL.js +41 -0
  57. package/dist/debugger-QN2MCLBL.js.map +7 -0
  58. package/dist/deploy-J74PHPQA.js +25 -0
  59. package/dist/deploy-J74PHPQA.js.map +7 -0
  60. package/dist/dev-GGUSOOYP.js +59 -0
  61. package/dist/dev-GGUSOOYP.js.map +7 -0
  62. package/dist/esm-D77XRR65.js +38 -0
  63. package/dist/esm-D77XRR65.js.map +7 -0
  64. package/dist/eval-L6WHUFLU.js +54 -0
  65. package/dist/eval-L6WHUFLU.js.map +7 -0
  66. package/dist/getMachineId-bsd-QUXN4NKS.js +2 -0
  67. package/dist/getMachineId-bsd-QUXN4NKS.js.map +7 -0
  68. package/dist/getMachineId-darwin-TCXBAX22.js +3 -0
  69. package/dist/getMachineId-darwin-TCXBAX22.js.map +7 -0
  70. package/dist/getMachineId-linux-IJ3LYIOX.js +2 -0
  71. package/dist/getMachineId-linux-IJ3LYIOX.js.map +7 -0
  72. package/dist/getMachineId-unsupported-IKXBUCYY.js +2 -0
  73. package/dist/getMachineId-unsupported-IKXBUCYY.js.map +7 -0
  74. package/dist/getMachineId-win-6CX7VSFF.js +2 -0
  75. package/dist/getMachineId-win-6CX7VSFF.js.map +7 -0
  76. package/dist/ggt-5XNRJZSW.js +44 -0
  77. package/dist/ggt-5XNRJZSW.js.map +7 -0
  78. package/dist/{list-3QZTSHQV.js → list-756D46N5.js} +2 -2
  79. package/dist/list-756D46N5.js.map +7 -0
  80. package/dist/login-GMWQRH7V.js +2 -0
  81. package/dist/{logout-SWWGI27Q.js → logout-LQABTJFD.js} +2 -2
  82. package/dist/logout-LQABTJFD.js.map +7 -0
  83. package/dist/logs-AQZB272X.js +28 -0
  84. package/dist/logs-AQZB272X.js.map +7 -0
  85. package/dist/main.js +1 -43
  86. package/dist/main.js.map +4 -4
  87. package/dist/{open-J2ZVNVJ6.js → open-OMZWPQ66.js} +11 -11
  88. package/dist/open-OMZWPQ66.js.map +7 -0
  89. package/dist/problems-FZJKH52E.js +14 -0
  90. package/dist/problems-FZJKH52E.js.map +7 -0
  91. package/dist/pull-XYCYN7QN.js +28 -0
  92. package/dist/pull-XYCYN7QN.js.map +7 -0
  93. package/dist/push-3QM7ZFTC.js +2 -0
  94. package/dist/status-PWAXNK5G.js +14 -0
  95. package/dist/status-PWAXNK5G.js.map +7 -0
  96. package/dist/update-QIQFJFRQ.js +2 -0
  97. package/dist/update-QIQFJFRQ.js.map +7 -0
  98. package/dist/var-N4WGGJXZ.js +159 -0
  99. package/dist/var-N4WGGJXZ.js.map +7 -0
  100. package/dist/{version-NZHW3VLV.js → version-AJKSJJDC.js} +2 -2
  101. package/dist/version-AJKSJJDC.js.map +7 -0
  102. package/dist/{whoami-MIJFO4MW.js → whoami-KJYDSQSD.js} +2 -2
  103. package/dist/whoami-KJYDSQSD.js.map +7 -0
  104. package/package.json +64 -74
  105. package/dist/add-KJLV4API.js.map +0 -7
  106. package/dist/chunk-24OT7GHO.js +0 -65
  107. package/dist/chunk-24OT7GHO.js.map +0 -7
  108. package/dist/chunk-HN3YKQ3C.js +0 -6
  109. package/dist/chunk-HN3YKQ3C.js.map +0 -7
  110. package/dist/chunk-J2OYMAMD.js +0 -2
  111. package/dist/chunk-JBY5A44K.js +0 -7
  112. package/dist/chunk-JBY5A44K.js.map +0 -7
  113. package/dist/chunk-L5H5T2T6.js +0 -66
  114. package/dist/chunk-L5H5T2T6.js.map +0 -7
  115. package/dist/chunk-M6L2X3GX.js +0 -194
  116. package/dist/chunk-M6L2X3GX.js.map +0 -7
  117. package/dist/chunk-MHTXRD5G.js +0 -2
  118. package/dist/chunk-MHTXRD5G.js.map +0 -7
  119. package/dist/chunk-OIVNACS7.js +0 -12
  120. package/dist/chunk-OIVNACS7.js.map +0 -7
  121. package/dist/chunk-QXWICGG6.js +0 -2
  122. package/dist/chunk-QXWICGG6.js.map +0 -7
  123. package/dist/chunk-WNAYBYSG.js +0 -8
  124. package/dist/chunk-WNAYBYSG.js.map +0 -7
  125. package/dist/chunk-X47UA3VR.js +0 -2
  126. package/dist/chunk-X47UA3VR.js.map +0 -7
  127. package/dist/chunk-XGQQOMPO.js +0 -2
  128. package/dist/chunk-XGQQOMPO.js.map +0 -7
  129. package/dist/chunk-XKYYKHP4.js +0 -28
  130. package/dist/chunk-XKYYKHP4.js.map +0 -7
  131. package/dist/chunk-YU6P3ESA.js +0 -121
  132. package/dist/chunk-YU6P3ESA.js.map +0 -7
  133. package/dist/configure-CXY6JQB7.js.map +0 -7
  134. package/dist/deploy-XFZBJJWP.js +0 -25
  135. package/dist/deploy-XFZBJJWP.js.map +0 -7
  136. package/dist/dev-GG6TU3DJ.js +0 -59
  137. package/dist/dev-GG6TU3DJ.js.map +0 -7
  138. package/dist/esm-PLVGBDRY.js +0 -38
  139. package/dist/esm-PLVGBDRY.js.map +0 -7
  140. package/dist/list-3QZTSHQV.js.map +0 -7
  141. package/dist/login-HKGCVIWO.js +0 -2
  142. package/dist/logout-SWWGI27Q.js.map +0 -7
  143. package/dist/logs-DW4PH3U6.js +0 -28
  144. package/dist/logs-DW4PH3U6.js.map +0 -7
  145. package/dist/open-J2ZVNVJ6.js.map +0 -7
  146. package/dist/pull-ORNQFSFG.js +0 -28
  147. package/dist/pull-ORNQFSFG.js.map +0 -7
  148. package/dist/push-KMZZ6JJL.js +0 -2
  149. package/dist/status-JAREJZ4X.js +0 -14
  150. package/dist/status-JAREJZ4X.js.map +0 -7
  151. package/dist/version-NZHW3VLV.js.map +0 -7
  152. package/dist/whoami-MIJFO4MW.js.map +0 -7
  153. /package/dist/{login-HKGCVIWO.js.map → login-GMWQRH7V.js.map} +0 -0
  154. /package/dist/{push-KMZZ6JJL.js.map → push-3QM7ZFTC.js.map} +0 -0
@@ -1,121 +0,0 @@
1
- import{c as K}from"./chunk-J2OYMAMD.js";import{a as be}from"./chunk-JBY5A44K.js";import{a as oo,b as ao}from"./chunk-HN3YKQ3C.js";import{A as Br,D as kt,a as ft,b as Ar,e as mt,f as dt,j as Fr,k as $r,m as ge,n as X,o as jr,w as Lr,x as Mr,y as ye,z as ve}from"./chunk-L5H5T2T6.js";import{a as Dr}from"./chunk-OIVNACS7.js";import{$ as Rr,A as io,N as Or,U as wt,Z as he,b as it,e as J,g as wr,h as _r,ha as C,i as kr,ia as $,ja as _t,m as Tr,n as Sr,u as Cr,v as xr,w as Er,z as Pr}from"./chunk-24OT7GHO.js";import{a as so}from"./chunk-GFQYFEEH.js";import{a as n,b as de,d as nt,f as st,h as T}from"./chunk-7DYQUG5M.js";var Jr=nt(N=>{"use strict";T();var lo=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(N,"__esModule",{value:!0});var po=de("fs"),fo=lo(ao()),ht=fo.default("@kwsites/file-exists");function mo(t,e,r){ht("checking %s",t);try{let s=po.statSync(t);return s.isFile()&&e?(ht("[OK] path represents a file"),!0):s.isDirectory()&&r?(ht("[OK] path represents a directory"),!0):(ht("[FAIL] path represents something other than a file or directory"),!1)}catch(s){if(s.code==="ENOENT")return ht("[FAIL] path is not accessible: %o",s),!1;throw ht("[FATAL] %o",s),s}}n(mo,"check");function ho(t,e=N.READABLE){return mo(t,(e&N.FILE)>0,(e&N.FOLDER)>0)}n(ho,"exists");N.exists=ho;N.FILE=1;N.FOLDER=2;N.READABLE=N.FILE+N.FOLDER});var zr=nt(Bt=>{"use strict";T();function go(t){for(var e in t)Bt.hasOwnProperty(e)||(Bt[e]=t[e])}n(go,"__export");Object.defineProperty(Bt,"__esModule",{value:!0});go(Jr())});var ke=nt((Sl,Vr)=>{T();function yo(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=so(),r.destroy=d,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let m=0;for(let h=0;h<p.length;h++)m=(m<<5)-m+p.charCodeAt(h),m|=0;return r.colors[Math.abs(m)%r.colors.length]}n(e,"selectColor"),r.selectColor=e;function r(p){let m,h=null,g,I;function q(...D){if(!q.enabled)return;let Y=q,lt=Number(new Date),le=lt-(m||lt);Y.diff=le,Y.prev=m,Y.curr=lt,m=lt,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let pt=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(bt,pe)=>{if(bt==="%%")return"%";pt++;let Lt=r.formatters[pe];if(typeof Lt=="function"){let fe=D[pt];bt=Lt.call(Y,fe),D.splice(pt,1),pt--}return bt}),r.formatArgs.call(Y,D),(Y.log||r.log).apply(Y,D)}return n(q,"debug"),q.namespace=p,q.useColors=r.useColors(),q.color=r.selectColor(p),q.extend=s,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:n(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,I=r.enabled(p)),I),"get"),set:n(D=>{h=D},"set")}),typeof r.init=="function"&&r.init(q),q}n(r,"createDebug");function s(p,m){let h=r(this.namespace+(typeof m>"u"?":":m)+p);return h.log=this.log,h}n(s,"extend");function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m,h=(typeof p=="string"?p:"").split(/[\s,]+/),g=h.length;for(m=0;m<g;m++)h[m]&&(p=h[m].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}n(i,"enable");function o(){let p=[...r.names.map(u),...r.skips.map(u).map(m=>"-"+m)].join(",");return r.enable(""),p}n(o,"disable");function a(p){if(p[p.length-1]==="*")return!0;let m,h;for(m=0,h=r.skips.length;m<h;m++)if(r.skips[m].test(p))return!1;for(m=0,h=r.names.length;m<h;m++)if(r.names[m].test(p))return!0;return!1}n(a,"enabled");function u(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}n(u,"toNamespace");function c(p){return p instanceof Error?p.stack||p.message:p}n(c,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n(d,"destroy"),r.enable(r.load()),r}n(yo,"setup");Vr.exports=yo});var Qr=nt((G,It)=>{T();G.formatArgs=bo;G.save=wo;G.load=_o;G.useColors=vo;G.storage=ko();G.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();G.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function vo(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}n(vo,"useColors");function bo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+It.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}n(bo,"formatArgs");G.log=console.debug||console.log||(()=>{});function wo(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}n(wo,"save");function _o(){let t;try{t=G.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}n(_o,"load");function ko(){try{return localStorage}catch{}}n(ko,"localstorage");It.exports=ke()(G);var{formatters:To}=It.exports;To.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Hr=nt((R,Gt)=>{T();var So=de("tty"),Nt=de("util");R.init=Ao;R.log=Po;R.formatArgs=xo;R.save=Oo;R.load=Ro;R.useColors=Co;R.destroy=Nt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");R.colors=[6,2,3,4,5,1];try{let t=oo();t&&(t.stderr||t).level>=2&&(R.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}R.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function Co(){return"colors"in R.inspectOpts?!!R.inspectOpts.colors:So.isatty(process.stderr.fd)}n(Co,"useColors");function xo(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="\x1B[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
2
- `).join(`
3
- `+o),t.push(i+"m+"+Gt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Eo()+e+" "+t[0]}n(xo,"formatArgs");function Eo(){return R.inspectOpts.hideDate?"":new Date().toISOString()+" "}n(Eo,"getDate");function Po(...t){return process.stderr.write(Nt.formatWithOptions(R.inspectOpts,...t)+`
4
- `)}n(Po,"log");function Oo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}n(Oo,"save");function Ro(){return process.env.DEBUG}n(Ro,"load");function Ao(t){t.inspectOpts={};let e=Object.keys(R.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=R.inspectOpts[e[r]]}n(Ao,"init");Gt.exports=ke()(R);var{formatters:Wr}=Gt.exports;Wr.o=function(t){return this.inspectOpts.colors=this.useColors,Nt.inspect(t,this.inspectOpts).split(`
5
- `).map(e=>e.trim()).join(" ")};Wr.O=function(t){return this.inspectOpts.colors=this.useColors,Nt.inspect(t,this.inspectOpts)}});var Yr=nt((Al,Te)=>{T();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Te.exports=Qr():Te.exports=Hr()});var Ce=nt(ot=>{"use strict";T();Object.defineProperty(ot,"__esModule",{value:!0});ot.createDeferred=ot.deferred=void 0;function Se(){let t,e,r="pending";return{promise:new Promise((i,o)=>{t=i,e=o}),done(i){r==="pending"&&(r="resolved",t(i))},fail(i){r==="pending"&&(r="rejected",e(i))},get fulfilled(){return r!=="pending"},get status(){return r}}}n(Se,"deferred");ot.deferred=Se;ot.createDeferred=Se;ot.default=Se});T();var Ir=st(Fr(),1);var tl=Object.freeze({Fatal:"Fatal",Error:"Error",Warning:"Warning",Info:"Info"}),we=n(({problems:t,showFileTypes:e,...r})=>{let s="";for(let[i,o]of Object.entries(t)){s+=$(""),s+=$`• {cyan ${i}} {redBright ${(0,Ir.default)("problem",o.length,!0)}}`;for(let a of o){let[u,...c]=a.message.split(`
6
- `);s+=C` {red ✖} `,(e??a.type==="SourceFile")&&(s+=C`${uo(i)} `),s+=C(u);for(let d of c)s+=$(""),s+=C` ${d}`;for(let d of a.labels)s+=C` {dim ${d}}`;s+=$("")}}return $({...r,content:s})},"sprintProblems"),el=n(t=>{_t(we(t))},"printProblems"),uo=n(t=>{switch(!0){case Cr(t):return it.yellowBright("JavaScript");case xr(t):return it.blue("TypeScript");case Er(t):return it.magenta("Gelly");default:return it.gray("File")}},"filetype"),rl=n(t=>{let e={};for(let r of t){let s=r.node?.apiIdentifier??r.node?.name??"Other";e[s]??=[],e[s].push({type:r.node?.type??"Unknown",severity:r.severity,message:r.message,labels:$r(r.nodeLabels?.map(i=>i?.identifier)??[])})}return e},"publishIssuesToProblems"),nl=n(t=>{let e={};for(let r of t)e[r.path]??=[],e[r.path].push({type:r.type,severity:r.level,message:r.message,labels:[]});return e},"filesyncProblemsToProblems");T();var _e=st(Fr(),1);var Nr=class extends dt{static{n(this,"YarnNotFoundError")}isBug=mt.NO;constructor(){super("Yarn not found")}render(){return C`
7
- Yarn must be installed to sync your application. You can install it by running:
8
-
9
- $ npm install --global yarn
10
-
11
- For more information, see: https://classic.yarnpkg.com/en/docs/install
12
- `}},Mt=class extends dt{constructor(r){super('The ".gadget/sync.json" file was invalid or not found');this.details=r}static{n(this,"UnknownDirectoryError")}isBug=mt.NO;render(){let r=this.details.directory.path;switch(this.details.command){case"add":case"open":case"status":return C`
13
- A ".gadget/sync.json" file is missing in this directory:
14
-
15
- ${r}
16
-
17
- In order to use "ggt ${this.details.command}", you must run it within a directory
18
- that has already been initialized with "ggt dev".
19
- `;case"dev":return C`
20
- A ".gadget/sync.json" file is missing in this directory:
21
-
22
- ${r}
23
-
24
- If you're running "ggt dev" for the first time, we recommend
25
- using a gadget specific directory like this:
26
-
27
- ggt dev ~/gadget/${this.details.args["--app"]??"<name>"}
28
-
29
- To use a non-empty directory without a ".gadget/sync.json" file,
30
- run "ggt dev" again with the "--allow-unknown-directory" flag:
31
-
32
- ggt dev ${r} --allow-unknown-directory
33
- `;default:return C`
34
- A ".gadget/sync.json" file is missing in this directory:
35
-
36
- ${r}
37
-
38
- If you're certain you want to use this directory, you can run
39
- "ggt ${this.details.command}" again with the "--allow-unknown-directory" flag:
40
-
41
- ggt ${this.details.command} --allow-unknown-directory
42
- `}}},Gr=class extends dt{constructor(r){super(`Failed to synchronize files after ${r} attempts.`);this.attempts=r}static{n(this,"TooManyMergeAttemptsError")}isBug=mt.MAYBE;render(){return C`
43
- We merged your local files with your environment's files ${this.attempts} times,
44
- but your local and environment's files still don't match.
45
-
46
- Make sure no one else is editing files on your environment, and try again.
47
- `}},Ur=class extends dt{constructor(r,s){super(`Failed to push local changes to environment after ${(0,_e.default)("attempt",r,!0)}.`);this.attempts=r;this.command=s}static{n(this,"TooManyPushAttemptsError")}isBug=mt.MAYBE;render(){return C`
48
- We tried to push your local changes to your environment ${(0,_e.default)("time",this.attempts,!0)},
49
- but your environment's files kept changing since we last checked.
50
-
51
- Please re-run "ggt ${this.command}" to see the changes and try again.
52
- `}},qr=class extends dt{constructor(r){super("This application is not allowed to be deployed due to fatal errors.");this.fatalErrors=r}static{n(this,"DeployDisallowedError")}isBug=mt.MAYBE;render(){let r=$`{red Gadget has detected the following fatal errors with your files:}`;return r+=we({ensureEmptyLineAbove:!0,problems:this.fatalErrors,showFileTypes:!1}),r+=$({ensureEmptyLineAbove:!0,content:it.red("Please fix these errors and try again.")}),r}},co=n(t=>(t instanceof X&&(t=t.cause),Tr(t)&&(t=t.errors),Sr(t)&&(t=t[0]),_r(t)&&"message"in t&&wr(t.message)&&t.message.includes("Files version mismatch")),"isFilesVersionMismatchError"),dl=n((t,e)=>{if(co(e)){t.log.debug("swallowing files version mismatch",{error:e});return}throw e},"swallowFilesVersionMismatch");T();var ce=st(io(),1);import gr from"node:assert";import $i from"node:path";T();var te=st(zr(),1),Yt=st(Yr(),1),ii=st(Ce(),1),gt=st(Ce(),1);import{spawn as ba}from"child_process";import{EventEmitter as Dc}from"node:events";var Xt=Object.defineProperty,Fo=Object.defineProperties,$o=Object.getOwnPropertyDescriptor,jo=Object.getOwnPropertyDescriptors,ze=Object.getOwnPropertyNames,Kr=Object.getOwnPropertySymbols,An=Object.prototype.hasOwnProperty,Do=Object.prototype.propertyIsEnumerable,Xr=n((t,e,r)=>e in t?Xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,"__defNormalProp"),z=n((t,e)=>{for(var r in e||(e={}))An.call(e,r)&&Xr(t,r,e[r]);if(Kr)for(var r of Kr(e))Do.call(e,r)&&Xr(t,r,e[r]);return t},"__spreadValues"),Ct=n((t,e)=>Fo(t,jo(e)),"__spreadProps"),f=n((t,e)=>n(function(){return t&&(e=(0,t[ze(t)[0]])(t=0)),e},"__init"),"__esm"),Lo=n((t,e)=>n(function(){return e||(0,t[ze(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),O=n((t,e)=>{for(var r in e)Xt(t,r,{get:e[r],enumerable:!0})},"__export"),Mo=n((t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ze(e))!An.call(t,i)&&i!==r&&Xt(t,i,{get:n(()=>e[i],"get"),enumerable:!(s=$o(e,i))||s.enumerable});return t},"__copyProps"),x=n(t=>Mo(Xt({},"__esModule",{value:!0}),t),"__toCommonJS"),St=n((t,e,r)=>new Promise((s,i)=>{var o=n(c=>{try{u(r.next(c))}catch(d){i(d)}},"fulfilled"),a=n(c=>{try{u(r.throw(c))}catch(d){i(d)}},"rejected"),u=n(c=>c.done?s(c.value):Promise.resolve(c.value).then(o,a),"step");u((r=r.apply(t,e)).next())}),"__async");function Bo(...t){let e=new String(t);return Zt.set(e,t),e}n(Bo,"pathspec");function Wt(t){return t instanceof String&&Zt.has(t)}n(Wt,"isPathSpec");function Zr(t){return Zt.get(t)||[]}n(Zr,"toPaths");var Zt,Ot=f({"src/lib/args/pathspec.ts"(){"use strict";Zt=new WeakMap}}),tt,rt=f({"src/lib/errors/git-error.ts"(){"use strict";tt=class extends Error{static{n(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),Rt,vt=f({"src/lib/errors/git-response-error.ts"(){"use strict";rt(),Rt=class extends tt{static{n(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),Fn,$n=f({"src/lib/errors/task-configuration-error.ts"(){"use strict";rt(),Fn=class extends tt{static{n(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function jn(t){return typeof t=="function"?t:ct}n(jn,"asFunction");function Dn(t){return typeof t=="function"&&t!==ct}n(Dn,"isUserFunction");function Ln(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}n(Ln,"splitOn");function Mn(t,e=0){return Bn(t)&&t.length>e?t[e]:void 0}n(Mn,"first");function ut(t,e=0){if(Bn(t)&&t.length>e)return t[t.length-1-e]}n(ut,"last");function Bn(t){return!!(t&&typeof t.length=="number")}n(Bn,"isArrayLike");function At(t="",e=!0,r=`
53
- `){return t.split(r).reduce((s,i)=>{let o=e?i.trim():i;return o&&s.push(o),s},[])}n(At,"toLinesWithContent");function Ve(t,e){return At(t,!0).map(r=>e(r))}n(Ve,"forEachLineWithContent");function Qe(t){return(0,te.exists)(t,te.FOLDER)}n(Qe,"folderExists");function _(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}n(_,"append");function In(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}n(In,"including");function ee(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}n(ee,"remove");function W(t){return Array.isArray(t)?t:[t]}n(W,"asArray");function Nn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}n(Nn,"asCamelCase");function Gn(t){return W(t).map(String)}n(Gn,"asStringArray");function S(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}n(S,"asNumber");function xt(t,e){let r=[];for(let s=0,i=t.length;s<i;s++)r.push(e,t[s]);return r}n(xt,"prefixedArray");function Et(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}n(Et,"bufferToString");function Un(t,e){return Object.assign({},...e.map(r=>r in t?{[r]:t[r]}:{}))}n(Un,"pick");function Fe(t=0){return new Promise(e=>setTimeout(e,t))}n(Fe,"delay");function $e(t){if(t!==!1)return t}n($e,"orVoid");var yt,ct,Ft,re=f({"src/lib/utils/util.ts"(){"use strict";yt="\0",ct=n(()=>{},"NOOP"),Ft=Object.prototype.toString.call.bind(Object.prototype.toString)}});function H(t,e,r){return e(t)?t:arguments.length>2?r:void 0}n(H,"filterType");function We(t,e){let r=Wt(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}n(We,"filterPrimitives");function He(t){return!!t&&Ft(t)==="[object Object]"}n(He,"filterPlainObject");function qn(t){return typeof t=="function"}n(qn,"filterFunction");var $t,A,Jn,Ht,Ye,zn=f({"src/lib/utils/argument-filters.ts"(){"use strict";re(),Ot(),$t=n(t=>Array.isArray(t),"filterArray"),A=n(t=>typeof t=="string","filterString"),Jn=n(t=>Array.isArray(t)&&t.every(A),"filterStringArray"),Ht=n(t=>A(t)||Array.isArray(t)&&t.every(A),"filterStringOrStringArray"),Ye=n(t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number","filterHasLength")}}),je,Io=f({"src/lib/utils/exit-codes.ts"(){"use strict";je=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(je||{})}}),Pt,No=f({"src/lib/utils/git-output-streams.ts"(){"use strict";Pt=class{static{n(this,"GitOutputStreams")}constructor(t,e){this.stdOut=t,this.stdErr=e}asStrings(){return new Pt(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),w,et,Go=f({"src/lib/utils/line-parser.ts"(){"use strict";w=class{static{n(this,"LineParser")}constructor(t,e){this.matches=[],this.parse=(r,s)=>(this.resetMatches(),this._regExp.every((i,o)=>this.addMatch(i,o,r(o)))?this.useMatches(s,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}useMatches(t,e){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let s=r&&t.exec(r);return s&&this.pushMatch(e,s),!!s}pushMatch(t,e){this.matches.push(...e.slice(1))}},et=class extends w{static{n(this,"RemoteLineParser")}addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function Vn(...t){let e=process.cwd(),r=Object.assign(z({baseDir:e},Qn),...t.filter(s=>typeof s=="object"&&s));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}n(Vn,"createInstanceConfig");var Qn,Uo=f({"src/lib/utils/simple-git-options.ts"(){"use strict";Qn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Ke(t,e=[]){return He(t)?Object.keys(t).reduce((r,s)=>{let i=t[s];return Wt(i)?r.push(i):We(i,["boolean"])?r.push(s+"="+i):r.push(s),r},e):e}n(Ke,"appendTaskOptions");function L(t,e=0,r=!1){let s=[];for(let i=0,o=e<0?t.length:e;i<o;i++)"string|number".includes(typeof t[i])&&s.push(String(t[i]));return Ke(Xe(t),s),r||s.push(...qo(t)),s}n(L,"getTrailingOptions");function qo(t){let e=typeof ut(t)=="function";return H(ut(t,e?1:0),$t,[])}n(qo,"trailingArrayArgument");function Xe(t){let e=qn(ut(t));return H(ut(t,e?1:0),He)}n(Xe,"trailingOptionsArgument");function E(t,e=!0){let r=jn(ut(t));return e||Dn(r)?r:void 0}n(E,"trailingFunctionArgument");var Jo=f({"src/lib/utils/task-options.ts"(){"use strict";zn(),re(),Ot()}});function De(t,e){return t(e.stdOut,e.stdErr)}n(De,"callTaskParser");function B(t,e,r,s=!0){return W(r).forEach(i=>{for(let o=At(i,s),a=0,u=o.length;a<u;a++){let c=n((d=0)=>{if(!(a+d>=u))return o[a+d]},"line");e.some(({parse:d})=>d(c,t))}}),t}n(B,"parseStringResponse");var zo=f({"src/lib/utils/task-parser.ts"(){"use strict";re()}}),Wn={};O(Wn,{ExitCodes:n(()=>je,"ExitCodes"),GitOutputStreams:n(()=>Pt,"GitOutputStreams"),LineParser:n(()=>w,"LineParser"),NOOP:n(()=>ct,"NOOP"),NULL:n(()=>yt,"NULL"),RemoteLineParser:n(()=>et,"RemoteLineParser"),append:n(()=>_,"append"),appendTaskOptions:n(()=>Ke,"appendTaskOptions"),asArray:n(()=>W,"asArray"),asCamelCase:n(()=>Nn,"asCamelCase"),asFunction:n(()=>jn,"asFunction"),asNumber:n(()=>S,"asNumber"),asStringArray:n(()=>Gn,"asStringArray"),bufferToString:n(()=>Et,"bufferToString"),callTaskParser:n(()=>De,"callTaskParser"),createInstanceConfig:n(()=>Vn,"createInstanceConfig"),delay:n(()=>Fe,"delay"),filterArray:n(()=>$t,"filterArray"),filterFunction:n(()=>qn,"filterFunction"),filterHasLength:n(()=>Ye,"filterHasLength"),filterPlainObject:n(()=>He,"filterPlainObject"),filterPrimitives:n(()=>We,"filterPrimitives"),filterString:n(()=>A,"filterString"),filterStringArray:n(()=>Jn,"filterStringArray"),filterStringOrStringArray:n(()=>Ht,"filterStringOrStringArray"),filterType:n(()=>H,"filterType"),first:n(()=>Mn,"first"),folderExists:n(()=>Qe,"folderExists"),forEachLineWithContent:n(()=>Ve,"forEachLineWithContent"),getTrailingOptions:n(()=>L,"getTrailingOptions"),including:n(()=>In,"including"),isUserFunction:n(()=>Dn,"isUserFunction"),last:n(()=>ut,"last"),objectToString:n(()=>Ft,"objectToString"),orVoid:n(()=>$e,"orVoid"),parseStringResponse:n(()=>B,"parseStringResponse"),pick:n(()=>Un,"pick"),prefixedArray:n(()=>xt,"prefixedArray"),remove:n(()=>ee,"remove"),splitOn:n(()=>Ln,"splitOn"),toLinesWithContent:n(()=>At,"toLinesWithContent"),trailingFunctionArgument:n(()=>E,"trailingFunctionArgument"),trailingOptionsArgument:n(()=>Xe,"trailingOptionsArgument")});var b=f({"src/lib/utils/index.ts"(){"use strict";zn(),Io(),No(),Go(),Uo(),Jo(),zo(),re()}}),Hn={};O(Hn,{CheckRepoActions:n(()=>Le,"CheckRepoActions"),checkIsBareRepoTask:n(()=>Kn,"checkIsBareRepoTask"),checkIsRepoRootTask:n(()=>Yn,"checkIsRepoRootTask"),checkIsRepoTask:n(()=>Vo,"checkIsRepoTask")});function Vo(t){switch(t){case"bare":return Kn();case"root":return Yn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:ne,parser:Ze}}n(Vo,"checkIsRepoTask");function Yn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:ne,parser(e){return/^\.(git)?$/.test(e.trim())}}}n(Yn,"checkIsRepoRootTask");function Kn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:ne,parser:Ze}}n(Kn,"checkIsBareRepoTask");function Qo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}n(Qo,"isNotRepoMessage");var Le,ne,Ze,Xn=f({"src/lib/tasks/check-is-repo.ts"(){"use strict";b(),Le=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(Le||{}),ne=n(({exitCode:t},e,r,s)=>{if(t===128&&Qo(e))return r(Buffer.from("false"));s(e)},"onError"),Ze=n(t=>t.trim()==="true","parser")}});function Wo(t,e){let r=new Zn(t),s=t?es:ts;return At(e).forEach(i=>{let o=i.replace(s,"");r.paths.push(o),(rs.test(o)?r.folders:r.files).push(o)}),r}n(Wo,"cleanSummaryParser");var Zn,ts,es,rs,Ho=f({"src/lib/responses/CleanSummary.ts"(){"use strict";b(),Zn=class{static{n(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},ts=/^[a-z]+\s*/i,es=/^[a-z]+\s+[a-z]+\s*/i,rs=/\/$/}}),Me={};O(Me,{EMPTY_COMMANDS:n(()=>se,"EMPTY_COMMANDS"),adhocExecTask:n(()=>ns,"adhocExecTask"),configurationErrorTask:n(()=>M,"configurationErrorTask"),isBufferTask:n(()=>is,"isBufferTask"),isEmptyTask:n(()=>os,"isEmptyTask"),straightThroughBufferTask:n(()=>ss,"straightThroughBufferTask"),straightThroughStringTask:n(()=>j,"straightThroughStringTask")});function ns(t){return{commands:se,format:"empty",parser:t}}n(ns,"adhocExecTask");function M(t){return{commands:se,format:"empty",parser(){throw typeof t=="string"?new Fn(t):t}}}n(M,"configurationErrorTask");function j(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}n(j,"straightThroughStringTask");function ss(t){return{commands:t,format:"buffer",parser(e){return e}}}n(ss,"straightThroughBufferTask");function is(t){return t.format==="buffer"}n(is,"isBufferTask");function os(t){return t.format==="empty"||!t.commands.length}n(os,"isEmptyTask");var se,P=f({"src/lib/tasks/task.ts"(){"use strict";$n(),se=[]}}),as={};O(as,{CONFIG_ERROR_INTERACTIVE_MODE:n(()=>tr,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:n(()=>er,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:n(()=>rr,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:n(()=>Jt,"CleanOptions"),cleanTask:n(()=>us,"cleanTask"),cleanWithOptionsTask:n(()=>Yo,"cleanWithOptionsTask"),isCleanOptionsArray:n(()=>Ko,"isCleanOptionsArray")});function Yo(t,e){let{cleanMode:r,options:s,valid:i}=Xo(t);return r?i.options?(s.push(...e),s.some(ea)?M(tr):us(r,s)):M(rr+JSON.stringify(t)):M(er)}n(Yo,"cleanWithOptionsTask");function us(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(s){return Wo(t==="n",s)}}}n(us,"cleanTask");function Ko(t){return Array.isArray(t)&&t.every(e=>nr.has(e))}n(Ko,"isCleanOptionsArray");function Xo(t){let e,r=[],s={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(i=>{Zo(i)?(e=i,s.cleanMode=!0):s.options=s.options&&ta(r[r.length]=`-${i}`)}),{cleanMode:e,options:r,valid:s}}n(Xo,"getCleanOptions");function Zo(t){return t==="f"||t==="n"}n(Zo,"isCleanMode");function ta(t){return/^-[a-z]$/i.test(t)&&nr.has(t.charAt(1))}n(ta,"isKnownOption");function ea(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}n(ea,"isInteractiveMode");var tr,er,rr,Jt,nr,cs=f({"src/lib/tasks/clean.ts"(){"use strict";Ho(),b(),P(),tr="Git clean interactive mode is not supported",er='Git clean mode parameter ("n" or "f") is required',rr="Git clean unknown option found in: ",Jt=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(Jt||{}),nr=new Set(["i",...Gn(Object.values(Jt))])}});function ra(t){let e=new ps;for(let r of ls(t))e.addValue(r.file,String(r.key),r.value);return e}n(ra,"configListParser");function na(t,e){let r=null,s=[],i=new Map;for(let o of ls(t,e))o.key===e&&(s.push(r=o.value),i.has(o.file)||i.set(o.file,[]),i.get(o.file).push(r));return{key:e,paths:Array.from(i.keys()),scopes:i,value:r,values:s}}n(na,"configGetParser");function sa(t){return t.replace(/^(file):/,"")}n(sa,"configFilePath");function*ls(t,e=null){let r=t.split("\0");for(let s=0,i=r.length-1;s<i;){let o=sa(r[s++]),a=r[s++],u=e;if(a.includes(`
54
- `)){let c=Ln(a,`
55
- `);u=c[0],a=c[1]}yield{file:o,key:u,value:a}}}n(ls,"configParser");var ps,ia=f({"src/lib/responses/ConfigList.ts"(){"use strict";b(),ps=class{static{n(this,"ConfigList")}constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((t,e)=>Object.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=ut(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let s=this.addFile(t);s.hasOwnProperty(e)?Array.isArray(s[e])?s[e].push(r):s[e]=[s[e],r]:s[e]=r,this._all=void 0}}}});function xe(t,e){return typeof t=="string"&&Be.hasOwnProperty(t)?t:e}n(xe,"asConfigScope");function oa(t,e,r,s){let i=["config",`--${s}`];return r&&i.push("--add"),i.push(t,e),{commands:i,format:"utf-8",parser(o){return o}}}n(oa,"addConfigTask");function aa(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(s){return na(s,t)}}}n(aa,"getConfigTask");function ua(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return ra(r)}}}n(ua,"listConfigTask");function ca(){return{addConfig(t,e,...r){return this._runTask(oa(t,e,r[0]===!0,xe(r[1],"local")),E(arguments))},getConfig(t,e){return this._runTask(aa(t,xe(e,void 0)),E(arguments))},listConfig(...t){return this._runTask(ua(xe(t[0],void 0)),E(arguments))}}}n(ca,"config_default");var Be,fs=f({"src/lib/tasks/config.ts"(){"use strict";ia(),b(),Be=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Be||{})}});function la(t){return ms.has(t)}n(la,"isDiffNameStatus");var Ee,ms,ds=f({"src/lib/tasks/diff-name-status.ts"(){"use strict";Ee=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(Ee||{}),ms=new Set(Object.values(Ee))}});function pa(...t){return new gs().param(...t)}n(pa,"grepQueryBuilder");function fa(t){let e=new Set,r={};return Ve(t,s=>{let[i,o,a]=s.split(yt);e.add(i),(r[i]=r[i]||[]).push({line:S(o),path:i,preview:a})}),{paths:e,results:r}}n(fa,"parseGrep");function ma(){return{grep(t){let e=E(arguments),r=L(arguments);for(let i of hs)if(r.includes(i))return this._runTask(M(`git.grep: use of "${i}" is not supported.`),e);typeof t=="string"&&(t=pa().param(t));let s=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:s,format:"utf-8",parser(i){return fa(i)}},e)}}}n(ma,"grep_default");var hs,Tt,tn,gs,ys=f({"src/lib/tasks/grep.ts"(){"use strict";b(),P(),hs=["-h"],Tt=Symbol("grepQuery"),gs=class{static{n(this,"GrepQuery")}constructor(){this[tn]=[]}*[(tn=Tt,Symbol.iterator)](){for(let t of this[Tt])yield t}and(...t){return t.length&&this[Tt].push("--and","(",...xt(t,"-e"),")"),this}param(...t){return this[Tt].push(...xt(t,"-e")),this}}}}),vs={};O(vs,{ResetMode:n(()=>zt,"ResetMode"),getResetMode:n(()=>ha,"getResetMode"),resetTask:n(()=>da,"resetTask")});function da(t,e){let r=["reset"];return bs(t)&&r.push(`--${t}`),r.push(...e),j(r)}n(da,"resetTask");function ha(t){if(bs(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}n(ha,"getResetMode");function bs(t){return ws.includes(t)}n(bs,"isValidResetMode");var zt,ws,_s=f({"src/lib/tasks/reset.ts"(){"use strict";P(),zt=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(zt||{}),ws=Array.from(Object.values(zt))}});function ga(){return(0,Yt.default)("simple-git")}n(ga,"createLog");function en(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(s,...i)=>{t(s,...i),r(s,...i)}:t:(s,...i)=>{t(`%s ${s}`,e,...i),r&&r(s,...i)}}n(en,"prefixedLogger");function ya(t,e,{namespace:r}){if(typeof t=="string")return t;let s=e&&e.namespace||"";return s.startsWith(r)?s.substr(r.length+1):s||r}n(ya,"childLoggerName");function sr(t,e,r,s=ga()){let i=t&&`[${t}]`||"",o=[],a=typeof e=="string"?s.extend(e):e,u=ya(H(e,A),a,s);return d(r);function c(p,m){return _(o,sr(t,u.replace(/^[^:]+/,p),m,s))}function d(p){let m=p&&`[${p}]`||"",h=a&&en(a,m)||ct,g=en(s,`${i} ${m}`,h);return Object.assign(a?h:g,{label:t,sibling:c,info:g,step:d})}}n(sr,"createLogger");var ks=f({"src/lib/git-logger.ts"(){"use strict";b(),Yt.default.formatters.L=t=>String(Ye(t)?t.length:"-"),Yt.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Ft(t)}}),Ut,Ie,va=f({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";rt(),ks(),Ut=class{static{n(this,"_TasksPendingQueue")}constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let e=Ut.getName(t.commands[0]),r=sr(this.logLabel,e);return{task:t,logger:r,name:e}}push(t){let e=this.createProgress(t);return e.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,e),e}fatal(t){for(let[e,{logger:r}]of Array.from(this._queue.entries()))e===t.task?(r.info("Failed %o",t),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(e);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let e=this.withProgress(t);if(!e)throw new tt(void 0,"TasksPendingQueue: attempt called for an unknown task");return e.logger("Starting task"),e}static getName(t="empty"){return`task:${t}:${++Ut.counter}`}},Ie=Ut,Ie.counter=0}});function at(t,e){return{method:Mn(t.commands)||"",commands:e}}n(at,"pluginContext");function wa(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}n(wa,"onErrorReceived");function rn(t,e,r,s){return i=>{r("%s received %L bytes",e,i),s("%B",i),t.push(i)}}n(rn,"onDataReceived");var Ne,_a=f({"src/lib/runners/git-executor-chain.ts"(){"use strict";rt(),P(),b(),va(),Ne=class{static{n(this,"GitExecutorChain")}constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Ie}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}attemptTask(t){return St(this,null,function*(){let e=yield this._scheduler.next(),r=n(()=>this._queue.complete(t),"onQueueComplete");try{let{logger:s}=this._queue.attempt(t);return yield os(t)?this.attemptEmptyTask(t,s):this.attemptRemoteTask(t,s)}catch(s){throw this.onFatalException(t,s)}finally{r(),e()}})}onFatalException(t,e){let r=e instanceof tt?Object.assign(e,{task:t}):new tt(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(t,e){return St(this,null,function*(){let r=this._plugins.exec("spawn.binary","",at(t,t.commands)),s=this._plugins.exec("spawn.args",[...t.commands],at(t,t.commands)),i=yield this.gitResponse(t,r,s,this.outputHandler,e.step("SPAWN")),o=yield this.handleTaskData(t,s,i,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),is(t)?De(t.parser,o):De(t.parser,o.asStrings())})}attemptEmptyTask(t,e){return St(this,null,function*(){return e("empty task bypassing child process to call to task's parser"),t.parser(this)})}handleTaskData(t,e,r,s){let{exitCode:i,rejection:o,stdOut:a,stdErr:u}=r;return new Promise((c,d)=>{s("Preparing to handle process response exitCode=%d stdOut=",i);let{error:p}=this._plugins.exec("task.error",{error:o},z(z({},at(t,e)),r));if(p&&t.onError)return s.info("exitCode=%s handling with custom error handler"),t.onError(r,p,m=>{s.info("custom error handler treated as success"),s("custom error returned a %s",Ft(m)),c(new Pt(Array.isArray(m)?Buffer.concat(m):m,Buffer.concat(u)))},d);if(p)return s.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,u.length,o),d(p);s.info("retrieving task output complete"),c(new Pt(Buffer.concat(a),Buffer.concat(u)))})}gitResponse(t,e,r,s,i){return St(this,null,function*(){let o=i.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},at(t,t.commands));return new Promise(u=>{let c=[],d=[];i.info("%s %o",e,r),i("%O",a);let p=this._beforeSpawn(t,r);if(p)return u({stdOut:c,stdErr:d,exitCode:9901,rejection:p});this._plugins.exec("spawn.before",void 0,Ct(z({},at(t,r)),{kill(h){p=h||p}}));let m=ba(e,r,a);m.stdout.on("data",rn(c,"stdOut",i,o.step("stdOut"))),m.stderr.on("data",rn(d,"stdErr",i,o.step("stdErr"))),m.on("error",wa(d,i)),s&&(i("Passing child process stdOut/stdErr to custom outputHandler"),s(e,m.stdout,m.stderr,[...r])),this._plugins.exec("spawn.after",void 0,Ct(z({},at(t,r)),{spawned:m,close(h,g){u({stdOut:c,stdErr:d,exitCode:h,rejection:p||g})},kill(h){m.killed||(p=h,m.kill("SIGINT"))}}))})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,Ct(z({},at(t,e)),{kill(s){r=s||r}})),r}}}}),Ts={};O(Ts,{GitExecutor:n(()=>Ss,"GitExecutor")});var Ss,ka=f({"src/lib/runners/git-executor.ts"(){"use strict";_a(),Ss=class{static{n(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new Ne(this,this._scheduler,this._plugins)}chain(){return new Ne(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function Ta(t,e,r=ct){let s=n(o=>{r(null,o)},"onSuccess"),i=n(o=>{o?.task===t&&r(o instanceof Rt?Sa(o):o,void 0)},"onError2");e.then(s,i)}n(Ta,"taskCallback");function Sa(t){let e=n(s=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${s} should be GitResponseError.git.${s}, this will no longer be available in version 3`),e=ct},"log");return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(s,i){return i in t||(s[i]={enumerable:!1,configurable:!1,get(){return e(i),t.git[i]}}),s}}n(Sa,"addDeprecationNoticeToError");var Ca=f({"src/lib/task-callback.ts"(){"use strict";vt(),b()}});function nn(t,e){return ns(r=>{if(!Qe(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}n(nn,"changeWorkingDirectoryTask");var xa=f({"src/lib/tasks/change-working-directory.ts"(){"use strict";b(),P()}});function Pe(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=ee(e,"-B")),j(e)}n(Pe,"checkoutTask");function Ea(){return{checkout(){return this._runTask(Pe(L(arguments,1)),E(arguments))},checkoutBranch(t,e){return this._runTask(Pe(["-b",t,e,...L(arguments)]),E(arguments))},checkoutLocalBranch(t){return this._runTask(Pe(["-b",t,...L(arguments)]),E(arguments))}}}n(Ea,"checkout_default");var Pa=f({"src/lib/tasks/checkout.ts"(){"use strict";b(),P()}});function Oa(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}n(Oa,"countObjectsResponse");function Ra(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return B(Oa(),[Cs],t)}})}}}n(Ra,"count_objects_default");var Cs,Aa=f({"src/lib/tasks/count-objects.ts"(){"use strict";b(),Cs=new w(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let s=Nn(e);t.hasOwnProperty(s)&&(t[s]=S(r))})}});function Fa(t){return B({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},xs,t)}n(Fa,"parseCommitResult");var xs,$a=f({"src/lib/parsers/parse-commit.ts"(){"use strict";b(),xs=[new w(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,s])=>{t.branch=e,t.commit=s,t.root=!!r}),new w(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),s=r.pop();!s||!s.includes("@")||(t.author={email:s.substr(0,s.length-1),name:r.join("<").trim()})}),new w(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,s])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(s,10)||0}),new w(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,s])=>{t.summary.changes=parseInt(e,10)||0;let i=parseInt(r,10)||0;s==="-"?t.summary.deletions=i:s==="+"&&(t.summary.insertions=i)})]}});function ja(t,e,r){return{commands:["-c","core.abbrev=40","commit",...xt(t,"-m"),...e,...r],format:"utf-8",parser:Fa}}n(ja,"commitTask");function Da(){return{commit(e,...r){let s=E(arguments),i=t(e)||ja(W(e),W(H(r[0],Ht,[])),[...H(r[1],$t,[]),...L(arguments,0,!0)]);return this._runTask(i,s)}};function t(e){return!Ht(e)&&M("git.commit: requires the commit message to be supplied as a string/string[]")}}n(Da,"commit_default");var La=f({"src/lib/tasks/commit.ts"(){"use strict";$a(),b(),P()}});function Ma(){return{firstCommit(){return this._runTask(j(["rev-list","--max-parents=0","HEAD"],!0),E(arguments))}}}n(Ma,"first_commit_default");var Ba=f({"src/lib/tasks/first-commit.ts"(){"use strict";b(),P()}});function Ia(t,e){let r=["hash-object",t];return e&&r.push("-w"),j(r,!0)}n(Ia,"hashObjectTask");var Na=f({"src/lib/tasks/hash-object.ts"(){"use strict";P()}});function Ga(t,e,r){let s=String(r).trim(),i;if(i=Es.exec(s))return new Vt(t,e,!1,i[1]);if(i=Ps.exec(s))return new Vt(t,e,!0,i[1]);let o="",a=s.split(" ");for(;a.length;)if(a.shift()==="in"){o=a.join(" ");break}return new Vt(t,e,/^re/i.test(s),o)}n(Ga,"parseInit");var Vt,Es,Ps,Ua=f({"src/lib/responses/InitSummary.ts"(){"use strict";Vt=class{static{n(this,"InitSummary")}constructor(t,e,r,s){this.bare=t,this.path=e,this.existing=r,this.gitDir=s}},Es=/^Init.+ repository in (.+)$/,Ps=/^Rein.+ in (.+)$/}});function qa(t){return t.includes(ir)}n(qa,"hasBareCommand");function Ja(t=!1,e,r){let s=["init",...r];return t&&!qa(s)&&s.splice(1,0,ir),{commands:s,format:"utf-8",parser(i){return Ga(s.includes("--bare"),e,i)}}}n(Ja,"initTask");var ir,za=f({"src/lib/tasks/init.ts"(){"use strict";Ua(),ir="--bare"}});function or(t){for(let e=0;e<t.length;e++){let r=ar.exec(t[e]);if(r)return`--${r[1]}`}return""}n(or,"logFormatFromCommand");function Va(t){return ar.test(t)}n(Va,"isLogFormat");var ar,jt=f({"src/lib/args/log-format.ts"(){"use strict";ar=/^--(stat|numstat|name-only|name-status)(=|$)/}}),Os,Qa=f({"src/lib/responses/DiffSummary.ts"(){"use strict";Os=class{static{n(this,"DiffSummary")}constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Rs(t=""){let e=As[t];return r=>B(new Os,e,r,!1)}n(Rs,"getDiffParser");var Oe,sn,on,an,As,Fs=f({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";jt(),Qa(),ds(),b(),Oe=[new w(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,s=""])=>{t.files.push({file:e.trim(),changes:S(r),insertions:s.replace(/[^+]/g,"").length,deletions:s.replace(/[^-]/g,"").length,binary:!1})}),new w(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,s])=>{t.files.push({file:e.trim(),before:S(r),after:S(s),binary:!0})}),new w(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let s=/(\d+) i/.exec(r),i=/(\d+) d/.exec(r);t.changed=S(e),t.insertions=S(s?.[1]),t.deletions=S(i?.[1])})],sn=[new w(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,s])=>{let i=S(e),o=S(r);t.changed++,t.insertions+=i,t.deletions+=o,t.files.push({file:s,changes:i+o,insertions:i,deletions:o,binary:!1})}),new w(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],on=[new w(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],an=[new w(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,s,i,o])=>{t.changed++,t.files.push({file:o??s,changes:0,insertions:0,deletions:0,binary:!1,status:$e(la(e)&&e),from:$e(!!o&&s!==o&&s),similarity:S(r)})})],As={"":Oe,"--stat":Oe,"--numstat":sn,"--name-status":an,"--name-only":on}}});function Wa(t,e){return e.reduce((r,s,i)=>(r[s]=t[i]||"",r),Object.create({diff:null}))}n(Wa,"lineBuilder");function $s(t=lr,e=js,r=""){let s=Rs(r);return function(i){let o=At(i.trim(),!1,ur).map(function(a){let u=a.split(cr),c=Wa(u[0].split(t),e);return u.length>1&&u[1].trim()&&(c.diff=s(u[1])),c});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}n($s,"createListLogSummaryParser");var ur,cr,lr,js,Ds=f({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";b(),Fs(),jt(),ur="\xF2\xF2\xF2\xF2\xF2\xF2 ",cr=" \xF2\xF2",lr=" \xF2 ",js=["hash","date","message","refs","author_name","author_email"]}}),Ls={};O(Ls,{diffSummaryTask:n(()=>Ha,"diffSummaryTask"),validateLogFormatConfig:n(()=>ie,"validateLogFormatConfig")});function Ha(t){let e=or(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),ie(r)||{commands:r,format:"utf-8",parser:Rs(e)}}n(Ha,"diffSummaryTask");function ie(t){let e=t.filter(Va);if(e.length>1)return M(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return M(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}n(ie,"validateLogFormatConfig");var pr=f({"src/lib/tasks/diff.ts"(){"use strict";jt(),Fs(),P()}});function Ya(t,e){let r=[],s=[];return Object.keys(t).forEach(i=>{r.push(i),s.push(String(t[i]))}),[r,s.join(e)]}n(Ya,"prettyFormat");function Ka(t){return Object.keys(t).reduce((e,r)=>(r in Ge||(e[r]=t[r]),e),{})}n(Ka,"userOptions");function Ms(t={},e=[]){let r=H(t.splitter,A,lr),s=!We(t.format)&&t.format?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[i,o]=Ya(s,r),a=[],u=[`--pretty=format:${ur}${o}${cr}`,...e],c=t.n||t["max-count"]||t.maxCount;if(c&&u.push(`--max-count=${c}`),t.from||t.to){let d=t.symmetric!==!1?"...":"..";a.push(`${t.from||""}${d}${t.to||""}`)}return A(t.file)&&u.push("--follow",Bo(t.file)),Ke(Ka(t),u),{fields:i,splitter:r,commands:[...u,...a]}}n(Ms,"parseLogOptions");function Xa(t,e,r){let s=$s(t,e,or(r));return{commands:["log",...r],format:"utf-8",parser:s}}n(Xa,"logTask");function Za(){return{log(...r){let s=E(arguments),i=Ms(Xe(arguments),H(arguments[0],$t)),o=e(...r)||ie(i.commands)||t(i);return this._runTask(o,s)}};function t(r){return Xa(r.splitter,r.fields,r.commands)}function e(r,s){return A(r)&&A(s)&&M("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}n(Za,"log_default");var Ge,Bs=f({"src/lib/tasks/log.ts"(){"use strict";jt(),Ot(),Ds(),b(),P(),pr(),Ge=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(Ge||{})}}),Qt,Is,tu=f({"src/lib/responses/MergeSummary.ts"(){"use strict";Qt=class{static{n(this,"MergeSummaryConflict")}constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},Is=class{static{n(this,"MergeSummaryDetail")}constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Ue,Ns,eu=f({"src/lib/responses/PullSummary.ts"(){"use strict";Ue=class{static{n(this,"PullSummary")}constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ns=class{static{n(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Re(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}n(Re,"objectEnumerationResult");function un(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:S(e&&e[1]||"0"),delta:S(r&&r[1]||"0")}}n(un,"asObjectCount");var Gs,ru=f({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";b(),Gs=[new et(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let s=e.toLowerCase(),i=Re(t.remoteMessages);Object.assign(i,{[s]:S(r)})}),new et(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let s=e.toLowerCase(),i=Re(t.remoteMessages);Object.assign(i,{[s]:S(r)})}),new et(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,s])=>{let i=Re(t.remoteMessages);i.total=un(e),i.reused=un(r),i.packReused=S(s)})]}});function Us(t,e){return B({remoteMessages:new Js},qs,e)}n(Us,"parseRemoteMessages");var qs,Js,zs=f({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";b(),ru(),qs=[new et(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...Gs,new et([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new et([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,s])=>{t.remoteMessages.vulnerabilities={count:S(e),summary:r,url:s}})],Js=class{static{n(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function nu(t,e){let r=B(new Ns,Vs,[t,e]);return r.message&&r}n(nu,"parsePullErrorResult");var cn,ln,pn,fn,Vs,mn,fr,Qs=f({"src/lib/parsers/parse-pull.ts"(){"use strict";eu(),b(),zs(),cn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,ln=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,pn=/^(create|delete) mode \d+ (.+)/,fn=[new w(cn,(t,[e,r,s])=>{t.files.push(e),r&&(t.insertions[e]=r.length),s&&(t.deletions[e]=s.length)}),new w(ln,(t,[e,,r,,s])=>r!==void 0||s!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+s||0,!0):!1),new w(pn,(t,[e,r])=>{_(t.files,r),_(e==="create"?t.created:t.deleted,r)})],Vs=[new w(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new w(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new w(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,s,i])=>{t.branch.local=s,t.hash.local=e,t.branch.remote=i,t.hash.remote=r})],mn=n((t,e)=>B(new Ue,fn,[t,e]),"parsePullDetail"),fr=n((t,e)=>Object.assign(new Ue,mn(t,e),Us(t,e)),"parsePullResult")}}),dn,Ws,hn,su=f({"src/lib/parsers/parse-merge.ts"(){"use strict";tu(),b(),Qs(),dn=[new w(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new w(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Qt(e,r))}),new w(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,s])=>{t.conflicts.push(new Qt(e,r,{deleteRef:s}))}),new w(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Qt(e,null))}),new w(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],Ws=n((t,e)=>Object.assign(hn(t,e),fr(t,e)),"parseMergeResult"),hn=n(t=>B(new Is,dn,t),"parseMergeDetail")}});function gn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let s=Ws(e,r);if(s.failed)throw new Rt(s);return s}}:M("Git.merge requires at least one option")}n(gn,"mergeTask");var iu=f({"src/lib/tasks/merge.ts"(){"use strict";vt(),su(),P()}});function ou(t,e,r){let s=r.includes("deleted"),i=r.includes("tag")||/^refs\/tags/.test(t),o=!r.includes("new");return{deleted:s,tag:i,branch:!i,new:!o,alreadyUpdated:o,local:t,remote:e}}n(ou,"pushResultPushedItem");var yn,Hs,vn,au=f({"src/lib/parsers/parse-push.ts"(){"use strict";b(),zs(),yn=[new w(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new w(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref=Ct(z({},t.ref||{}),{local:e})}),new w(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,s])=>{t.pushed.push(ou(e,r,s))}),new w(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,s])=>{t.branch=Ct(z({},t.branch||{}),{local:e,remote:r,remoteName:s})}),new w(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,s,i])=>{t.update={head:{local:e,remote:r},hash:{from:s,to:i}}})],Hs=n((t,e)=>{let r=vn(t,e),s=Us(t,e);return z(z({},r),s)},"parsePushResult"),vn=n((t,e)=>B({pushed:[]},yn,[t,e]),"parsePushDetail")}}),Ys={};O(Ys,{pushTagsTask:n(()=>uu,"pushTagsTask"),pushTask:n(()=>mr,"pushTask")});function uu(t={},e){return _(e,"--tags"),mr(t,e)}n(uu,"pushTagsTask");function mr(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),ee(r,"-v"),_(r,"--verbose"),_(r,"--porcelain"),{commands:r,format:"utf-8",parser:Hs}}n(mr,"pushTask");var Ks=f({"src/lib/tasks/push.ts"(){"use strict";au(),b()}});function cu(){return{showBuffer(){let t=["show",...L(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(ss(t),E(arguments))},show(){let t=["show",...L(arguments,1)];return this._runTask(j(t),E(arguments))}}}n(cu,"show_default");var lu=f({"src/lib/tasks/show.ts"(){"use strict";b(),P()}}),bn,Xs,pu=f({"src/lib/responses/FileStatusSummary.ts"(){"use strict";bn=/^(.+)\0(.+)$/,Xs=class{static{n(this,"FileStatusSummary")}constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let s=bn.exec(t)||[null,t,t];this.from=s[2]||"",this.path=s[1]||""}}}}});function wn(t){let[e,r]=t.split(yt);return{from:r||e,to:e}}n(wn,"renamedFile");function U(t,e,r){return[`${t}${e}`,r]}n(U,"parser3");function Ae(t,...e){return e.map(r=>U(t,r,(s,i)=>_(s.conflicted,i)))}n(Ae,"conflicts");function fu(t,e){let r=e.trim();switch(" "){case r.charAt(2):return s(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return s(" ",r.charAt(0),r.substr(2));default:return}function s(i,o,a){let u=`${i}${o}`,c=Zs.get(u);c&&c(t,a),u!=="##"&&u!=="!!"&&t.files.push(new Xs(a,i,o))}n(s,"data")}n(fu,"splitLine");var _n,Zs,ti,mu=f({"src/lib/responses/StatusSummary.ts"(){"use strict";b(),pu(),_n=class{static{n(this,"StatusSummary")}constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Zs=new Map([U(" ","A",(t,e)=>_(t.created,e)),U(" ","D",(t,e)=>_(t.deleted,e)),U(" ","M",(t,e)=>_(t.modified,e)),U("A"," ",(t,e)=>_(t.created,e)&&_(t.staged,e)),U("A","M",(t,e)=>_(t.created,e)&&_(t.staged,e)&&_(t.modified,e)),U("D"," ",(t,e)=>_(t.deleted,e)&&_(t.staged,e)),U("M"," ",(t,e)=>_(t.modified,e)&&_(t.staged,e)),U("M","M",(t,e)=>_(t.modified,e)&&_(t.staged,e)),U("R"," ",(t,e)=>{_(t.renamed,wn(e))}),U("R","M",(t,e)=>{let r=wn(e);_(t.renamed,r),_(t.modified,r.to)}),U("!","!",(t,e)=>{_(t.ignored=t.ignored||[],e)}),U("?","?",(t,e)=>_(t.not_added,e)),...Ae("A","A","U"),...Ae("D","D","U"),...Ae("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,s=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,a=/\son\s([\S]+)$/,u;u=r.exec(e),t.ahead=u&&+u[1]||0,u=s.exec(e),t.behind=u&&+u[1]||0,u=i.exec(e),t.current=u&&u[1],u=o.exec(e),t.tracking=u&&u[1],u=a.exec(e),t.current=u&&u[1]||t.current,t.detached=/\(no branch\)/.test(e)}]]),ti=n(function(t){let e=t.split(yt),r=new _n;for(let s=0,i=e.length;s<i;){let o=e[s++].trim();o&&(o.charAt(0)==="R"&&(o+=yt+(e[s++]||"")),fu(r,o))}return r},"parseStatusSummary")}});function du(t){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...t.filter(r=>!ei.includes(r))],parser(r){return ti(r)}}}n(du,"statusTask");var ei,hu=f({"src/lib/tasks/status.ts"(){"use strict";mu(),ei=["--null","-z"]}});function Kt(t=0,e=0,r=0,s="",i=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:s,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}n(Kt,"versionResponse");function gu(){return Kt(0,0,0,"",!1)}n(gu,"notInstalledResponse");function yu(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:vu,onError(t,e,r,s){if(t.exitCode===-2)return r(Buffer.from(dr));s(e)}})}}}n(yu,"version_default");function vu(t){return t===dr?gu():B(Kt(0,0,0,t),ri,t)}n(vu,"versionParser");var dr,ri,bu=f({"src/lib/tasks/version.ts"(){"use strict";b(),dr="installed=false",ri=[new w(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,s,i=""])=>{Object.assign(t,Kt(S(e),S(r),S(s),i))}),new w(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,s,i=""])=>{Object.assign(t,Kt(S(e),S(r),s,i))})]}}),ni={};O(ni,{SimpleGitApi:n(()=>qe,"SimpleGitApi")});var qe,wu=f({"src/lib/simple-git-api.ts"(){"use strict";Ca(),xa(),Pa(),Aa(),La(),fs(),Ba(),ys(),Na(),za(),Bs(),iu(),Ks(),lu(),hu(),P(),bu(),b(),qe=class{static{n(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),s=r.push(t);return e&&Ta(t,s,e),Object.create(this,{then:{value:s.then.bind(s)},catch:{value:s.catch.bind(s)},_executor:{value:r}})}add(t){return this._runTask(j(["add",...W(t)]),E(arguments))}cwd(t){let e=E(arguments);return typeof t=="string"?this._runTask(nn(t,this._executor),e):typeof t?.path=="string"?this._runTask(nn(t.path,t.root&&this._executor||void 0),e):this._runTask(M("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(Ia(t,e===!0),E(arguments))}init(t){return this._runTask(Ja(t===!0,this._executor.cwd,L(arguments)),E(arguments))}merge(){return this._runTask(gn(L(arguments)),E(arguments))}mergeFromTo(t,e){return A(t)&&A(e)?this._runTask(gn([t,e,...L(arguments)]),E(arguments,!1)):this._runTask(M("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=mr({remote:H(arguments[0],A),branch:H(arguments[1],A)},L(arguments));return this._runTask(t,E(arguments))}stash(){return this._runTask(j(["stash",...L(arguments)]),E(arguments))}status(){return this._runTask(du(L(arguments)),E(arguments))}},Object.assign(qe.prototype,Ea(),Da(),ca(),Ra(),Ma(),ma(),Za(),cu(),yu())}}),si={};O(si,{Scheduler:n(()=>oi,"Scheduler")});var kn,oi,_u=f({"src/lib/runners/scheduler.ts"(){"use strict";b(),ks(),kn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,ii.createDeferred)();return{promise:e,done:r,id:t}}})(),oi=class{static{n(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=sr("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=_(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),ee(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=_(this.pending,kn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),ai={};O(ai,{applyPatchTask:n(()=>ku,"applyPatchTask")});function ku(t,e){return j(["apply",...e,...t])}n(ku,"applyPatchTask");var Tu=f({"src/lib/tasks/apply-patch.ts"(){"use strict";P()}});function Su(t,e){return{branch:t,hash:e,success:!0}}n(Su,"branchDeletionSuccess");function Cu(t){return{branch:t,hash:null,success:!1}}n(Cu,"branchDeletionFailure");var ui,xu=f({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";ui=class{static{n(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function ci(t,e){return e===1&&Je.test(t)}n(ci,"hasBranchDeletionError");var Tn,Je,Sn,oe,Eu=f({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";xu(),b(),Tn=/(\S+)\s+\(\S+\s([^)]+)\)/,Je=/^error[^']+'([^']+)'/m,Sn=[new w(Tn,(t,[e,r])=>{let s=Su(e,r);t.all.push(s),t.branches[e]=s}),new w(Je,(t,[e])=>{let r=Cu(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],oe=n((t,e)=>B(new ui,Sn,[t,e]),"parseBranchDeletions")}}),li,Pu=f({"src/lib/responses/BranchSummary.ts"(){"use strict";li=class{static{n(this,"BranchSummaryResult")}constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,s,i){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:s,label:i}}}}});function Cn(t){return t?t.charAt(0):""}n(Cn,"branchStatus");function pi(t){return B(new li,fi,t)}n(pi,"parseBranchSummary");var fi,Ou=f({"src/lib/parsers/parse-branch.ts"(){"use strict";Pu(),b(),fi=[new w(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,s,i])=>{t.push(Cn(e),!0,r,s,i)}),new w(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(t,[e,r,s,i])=>{t.push(Cn(e),!1,r,s,i)})]}}),mi={};O(mi,{branchLocalTask:n(()=>Au,"branchLocalTask"),branchTask:n(()=>Ru,"branchTask"),containsDeleteBranchCommand:n(()=>di,"containsDeleteBranchCommand"),deleteBranchTask:n(()=>$u,"deleteBranchTask"),deleteBranchesTask:n(()=>Fu,"deleteBranchesTask")});function di(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}n(di,"containsDeleteBranchCommand");function Ru(t){let e=di(t),r=["branch",...t];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(s,i){return e?oe(s,i).all[0]:pi(s)}}}n(Ru,"branchTask");function Au(){return{format:"utf-8",commands:["branch","-v"],parser:pi}}n(Au,"branchLocalTask");function Fu(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,s){return oe(r,s)},onError({exitCode:r,stdOut:s},i,o,a){if(!ci(String(i),r))return a(i);o(s)}}}n(Fu,"deleteBranchesTask");function $u(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(s,i){return oe(s,i).branches[t]},onError({exitCode:s,stdErr:i,stdOut:o},a,u,c){if(!ci(String(a),s))return c(a);throw new Rt(r.parser(Et(o),Et(i)),String(a))}};return r}n($u,"deleteBranchTask");var ju=f({"src/lib/tasks/branch.ts"(){"use strict";vt(),Eu(),Ou(),b()}}),hi,Du=f({"src/lib/responses/CheckIgnore.ts"(){"use strict";hi=n(t=>t.split(/\n/g).map(e=>e.trim()).filter(e=>!!e),"parseCheckIgnore")}}),gi={};O(gi,{checkIgnoreTask:n(()=>Lu,"checkIgnoreTask")});function Lu(t){return{commands:["check-ignore",...t],format:"utf-8",parser:hi}}n(Lu,"checkIgnoreTask");var Mu=f({"src/lib/tasks/check-ignore.ts"(){"use strict";Du()}}),yi={};O(yi,{cloneMirrorTask:n(()=>Iu,"cloneMirrorTask"),cloneTask:n(()=>vi,"cloneTask")});function Bu(t){return/^--upload-pack(=|$)/.test(t)}n(Bu,"disallowedCommand");function vi(t,e,r){let s=["clone",...r];return A(t)&&s.push(t),A(e)&&s.push(e),s.find(Bu)?M("git.fetch: potential exploit argument blocked."):j(s)}n(vi,"cloneTask");function Iu(t,e,r){return _(r,"--mirror"),vi(t,e,r)}n(Iu,"cloneMirrorTask");var Nu=f({"src/lib/tasks/clone.ts"(){"use strict";P(),b()}});function Gu(t,e){return B({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},bi,[t,e])}n(Gu,"parseFetchResult");var bi,Uu=f({"src/lib/parsers/parse-fetch.ts"(){"use strict";b(),bi=[new w(/From (.+)$/,(t,[e])=>{t.remote=e}),new w(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new w(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new w(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new w(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,s,i])=>{t.updated.push({name:s,tracking:i,to:r,from:e})})]}}),wi={};O(wi,{fetchTask:n(()=>Ju,"fetchTask")});function qu(t){return/^--upload-pack(=|$)/.test(t)}n(qu,"disallowedCommand2");function Ju(t,e,r){let s=["fetch",...r];return t&&e&&s.push(t,e),s.find(qu)?M("git.fetch: potential exploit argument blocked."):{commands:s,format:"utf-8",parser:Gu}}n(Ju,"fetchTask");var zu=f({"src/lib/tasks/fetch.ts"(){"use strict";Uu(),P()}});function Vu(t){return B({moves:[]},_i,t)}n(Vu,"parseMoveResult");var _i,Qu=f({"src/lib/parsers/parse-move.ts"(){"use strict";b(),_i=[new w(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),ki={};O(ki,{moveTask:n(()=>Wu,"moveTask")});function Wu(t,e){return{commands:["mv","-v",...W(t),e],format:"utf-8",parser:Vu}}n(Wu,"moveTask");var Hu=f({"src/lib/tasks/move.ts"(){"use strict";Qu(),b()}}),Ti={};O(Ti,{pullTask:n(()=>Yu,"pullTask")});function Yu(t,e,r){let s=["pull",...r];return t&&e&&s.splice(1,0,t,e),{commands:s,format:"utf-8",parser(i,o){return fr(i,o)},onError(i,o,a,u){let c=nu(Et(i.stdOut),Et(i.stdErr));if(c)return u(new Rt(c));u(o)}}}n(Yu,"pullTask");var Ku=f({"src/lib/tasks/pull.ts"(){"use strict";vt(),Qs(),b()}});function Xu(t){let e={};return Si(t,([r])=>e[r]={name:r}),Object.values(e)}n(Xu,"parseGetRemotes");function Zu(t){let e={};return Si(t,([r,s,i])=>{e.hasOwnProperty(r)||(e[r]={name:r,refs:{fetch:"",push:""}}),i&&s&&(e[r].refs[i.replace(/[^a-z]/g,"")]=s)}),Object.values(e)}n(Zu,"parseGetRemotesVerbose");function Si(t,e){Ve(t,r=>e(r.split(/\s+/)))}n(Si,"forEach");var tc=f({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";b()}}),Ci={};O(Ci,{addRemoteTask:n(()=>ec,"addRemoteTask"),getRemotesTask:n(()=>rc,"getRemotesTask"),listRemotesTask:n(()=>nc,"listRemotesTask"),remoteTask:n(()=>sc,"remoteTask"),removeRemoteTask:n(()=>ic,"removeRemoteTask")});function ec(t,e,r){return j(["remote","add",...r,t,e])}n(ec,"addRemoteTask");function rc(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?Zu:Xu}}n(rc,"getRemotesTask");function nc(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),j(e)}n(nc,"listRemotesTask");function sc(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),j(e)}n(sc,"remoteTask");function ic(t){return j(["remote","remove",t])}n(ic,"removeRemoteTask");var oc=f({"src/lib/tasks/remote.ts"(){"use strict";tc(),P()}}),xi={};O(xi,{stashListTask:n(()=>ac,"stashListTask")});function ac(t={},e){let r=Ms(t),s=["stash","list",...r.commands,...e],i=$s(r.splitter,r.fields,or(s));return ie(s)||{commands:s,format:"utf-8",parser:i}}n(ac,"stashListTask");var uc=f({"src/lib/tasks/stash-list.ts"(){"use strict";jt(),Ds(),pr(),Bs()}}),Ei={};O(Ei,{addSubModuleTask:n(()=>cc,"addSubModuleTask"),initSubModuleTask:n(()=>lc,"initSubModuleTask"),subModuleTask:n(()=>ae,"subModuleTask"),updateSubModuleTask:n(()=>pc,"updateSubModuleTask")});function cc(t,e){return ae(["add",t,e])}n(cc,"addSubModuleTask");function lc(t){return ae(["init",...t])}n(lc,"initSubModuleTask");function ae(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),j(e)}n(ae,"subModuleTask");function pc(t){return ae(["update",...t])}n(pc,"updateSubModuleTask");var fc=f({"src/lib/tasks/sub-module.ts"(){"use strict";P()}});function mc(t,e){let r=isNaN(t),s=isNaN(e);return r!==s?r?1:-1:r?Pi(t,e):0}n(mc,"singleSorted");function Pi(t,e){return t===e?0:t>e?1:-1}n(Pi,"sorted");function dc(t){return t.trim()}n(dc,"trimmed");function qt(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}n(qt,"toNumber");var xn,Oi,hc=f({"src/lib/responses/TagList.ts"(){"use strict";xn=class{static{n(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},Oi=n(function(t,e=!1){let r=t.split(`
56
- `).map(dc).filter(Boolean);e||r.sort(function(i,o){let a=i.split("."),u=o.split(".");if(a.length===1||u.length===1)return mc(qt(a[0]),qt(u[0]));for(let c=0,d=Math.max(a.length,u.length);c<d;c++){let p=Pi(qt(a[c]),qt(u[c]));if(p)return p}return 0});let s=e?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new xn(r,s)},"parseTagList")}}),Ri={};O(Ri,{addAnnotatedTagTask:n(()=>vc,"addAnnotatedTagTask"),addTagTask:n(()=>yc,"addTagTask"),tagListTask:n(()=>gc,"tagListTask")});function gc(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return Oi(r,e)}}}n(gc,"tagListTask");function yc(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}n(yc,"addTagTask");function vc(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}n(vc,"addAnnotatedTagTask");var bc=f({"src/lib/tasks/tag.ts"(){"use strict";hc()}}),wc=Lo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(ka(),x(Ts)),{SimpleGitApi:s}=(wu(),x(ni)),{Scheduler:i}=(_u(),x(si)),{configurationErrorTask:o}=(P(),x(Me)),{asArray:a,filterArray:u,filterPrimitives:c,filterString:d,filterStringOrStringArray:p,filterType:m,getTrailingOptions:h,trailingFunctionArgument:g,trailingOptionsArgument:I}=(b(),x(Wn)),{applyPatchTask:q}=(Tu(),x(ai)),{branchTask:D,branchLocalTask:Y,deleteBranchesTask:lt,deleteBranchTask:le}=(ju(),x(mi)),{checkIgnoreTask:pt}=(Mu(),x(gi)),{checkIsRepoTask:vr}=(Xn(),x(Hn)),{cloneTask:bt,cloneMirrorTask:pe}=(Nu(),x(yi)),{cleanWithOptionsTask:Lt,isCleanOptionsArray:fe}=(cs(),x(as)),{diffSummaryTask:Mi}=(pr(),x(Ls)),{fetchTask:Bi}=(zu(),x(wi)),{moveTask:Ii}=(Hu(),x(ki)),{pullTask:Ni}=(Ku(),x(Ti)),{pushTagsTask:Gi}=(Ks(),x(Ys)),{addRemoteTask:Ui,getRemotesTask:qi,listRemotesTask:Ji,remoteTask:zi,removeRemoteTask:Vi}=(oc(),x(Ci)),{getResetMode:Qi,resetTask:Wi}=(_s(),x(vs)),{stashListTask:Hi}=(uc(),x(xi)),{addSubModuleTask:Yi,initSubModuleTask:Ki,subModuleTask:Xi,updateSubModuleTask:Zi}=(fc(),x(Ei)),{addAnnotatedTagTask:to,addTagTask:eo,tagListTask:ro}=(bc(),x(Ri)),{straightThroughBufferTask:no,straightThroughStringTask:Q}=(P(),x(Me));function v(l,y){this._plugins=y,this._executor=new r(l.baseDir,new i(l.maxConcurrentProcesses),y),this._trimmed=l.trimmed}n(v,"Git2"),(v.prototype=Object.create(s.prototype)).constructor=v,v.prototype.customBinary=function(l){return this._plugins.reconfigure("binary",l),this},v.prototype.env=function(l,y){return arguments.length===1&&typeof l=="object"?this._executor.env=l:(this._executor.env=this._executor.env||{})[l]=y,this},v.prototype.stashList=function(l){return this._runTask(Hi(I(arguments)||{},u(l)&&l||[]),g(arguments))};function br(l,y,k,F){return typeof k!="string"?o(`git.${l}() requires a string 'repoPath'`):y(k,m(F,d),h(arguments))}n(br,"createCloneTask"),v.prototype.clone=function(){return this._runTask(br("clone",bt,...arguments),g(arguments))},v.prototype.mirror=function(){return this._runTask(br("mirror",pe,...arguments),g(arguments))},v.prototype.mv=function(l,y){return this._runTask(Ii(l,y),g(arguments))},v.prototype.checkoutLatestTag=function(l){var y=this;return this.pull(function(){y.tags(function(k,F){y.checkout(F.latest,l)})})},v.prototype.pull=function(l,y,k,F){return this._runTask(Ni(m(l,d),m(y,d),h(arguments)),g(arguments))},v.prototype.fetch=function(l,y){return this._runTask(Bi(m(l,d),m(y,d),h(arguments)),g(arguments))},v.prototype.silent=function(l){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},v.prototype.tags=function(l,y){return this._runTask(ro(h(arguments)),g(arguments))},v.prototype.rebase=function(){return this._runTask(Q(["rebase",...h(arguments)]),g(arguments))},v.prototype.reset=function(l){return this._runTask(Wi(Qi(l),h(arguments)),g(arguments))},v.prototype.revert=function(l){let y=g(arguments);return typeof l!="string"?this._runTask(o("Commit must be a string"),y):this._runTask(Q(["revert",...h(arguments,0,!0),l]),y)},v.prototype.addTag=function(l){let y=typeof l=="string"?eo(l):o("Git.addTag requires a tag name");return this._runTask(y,g(arguments))},v.prototype.addAnnotatedTag=function(l,y){return this._runTask(to(l,y),g(arguments))},v.prototype.deleteLocalBranch=function(l,y,k){return this._runTask(le(l,typeof y=="boolean"?y:!1),g(arguments))},v.prototype.deleteLocalBranches=function(l,y,k){return this._runTask(lt(l,typeof y=="boolean"?y:!1),g(arguments))},v.prototype.branch=function(l,y){return this._runTask(D(h(arguments)),g(arguments))},v.prototype.branchLocal=function(l){return this._runTask(Y(),g(arguments))},v.prototype.raw=function(l){let y=!Array.isArray(l),k=[].slice.call(y?arguments:l,0);for(let V=0;V<k.length&&y;V++)if(!c(k[V])){k.splice(V,k.length-V);break}k.push(...h(arguments,0,!0));var F=g(arguments);return k.length?this._runTask(Q(k,this._trimmed),F):this._runTask(o("Raw: must supply one or more command to execute"),F)},v.prototype.submoduleAdd=function(l,y,k){return this._runTask(Yi(l,y),g(arguments))},v.prototype.submoduleUpdate=function(l,y){return this._runTask(Zi(h(arguments,!0)),g(arguments))},v.prototype.submoduleInit=function(l,y){return this._runTask(Ki(h(arguments,!0)),g(arguments))},v.prototype.subModule=function(l,y){return this._runTask(Xi(h(arguments)),g(arguments))},v.prototype.listRemote=function(){return this._runTask(Ji(h(arguments)),g(arguments))},v.prototype.addRemote=function(l,y,k){return this._runTask(Ui(l,y,h(arguments)),g(arguments))},v.prototype.removeRemote=function(l,y){return this._runTask(Vi(l),g(arguments))},v.prototype.getRemotes=function(l,y){return this._runTask(qi(l===!0),g(arguments))},v.prototype.remote=function(l,y){return this._runTask(zi(h(arguments)),g(arguments))},v.prototype.tag=function(l,y){let k=h(arguments);return k[0]!=="tag"&&k.unshift("tag"),this._runTask(Q(k),g(arguments))},v.prototype.updateServerInfo=function(l){return this._runTask(Q(["update-server-info"]),g(arguments))},v.prototype.pushTags=function(l,y){let k=Gi({remote:m(l,d)},h(arguments));return this._runTask(k,g(arguments))},v.prototype.rm=function(l){return this._runTask(Q(["rm","-f",...a(l)]),g(arguments))},v.prototype.rmKeepLocal=function(l){return this._runTask(Q(["rm","--cached",...a(l)]),g(arguments))},v.prototype.catFile=function(l,y){return this._catFile("utf-8",arguments)},v.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},v.prototype._catFile=function(l,y){var k=g(y),F=["cat-file"],V=y[0];if(typeof V=="string")return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),k);Array.isArray(V)&&F.push.apply(F,V);let me=l==="buffer"?no(F):Q(F);return this._runTask(me,k)},v.prototype.diff=function(l,y){let k=d(l)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Q(["diff",...h(arguments)]);return this._runTask(k,g(arguments))},v.prototype.diffSummary=function(){return this._runTask(Mi(h(arguments,1)),g(arguments))},v.prototype.applyPatch=function(l){let y=p(l)?q(a(l),h([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(y,g(arguments))},v.prototype.revparse=function(){let l=["rev-parse",...h(arguments,!0)];return this._runTask(Q(l,!0),g(arguments))},v.prototype.clean=function(l,y,k){let F=fe(l),V=F&&l.join("")||m(l,d)||"",me=h([].slice.call(arguments,F?1:0));return this._runTask(Lt(V,me),g(arguments))},v.prototype.exec=function(l){let y={commands:[],format:"utf-8",parser(){typeof l=="function"&&l()}};return this._runTask(y)},v.prototype.clearQueue=function(){return this},v.prototype.checkIgnore=function(l,y){return this._runTask(pt(a(m(l,p,[]))),g(arguments))},v.prototype.checkIsRepo=function(l,y){return this._runTask(vr(m(l,d)),g(arguments))},e.exports=v}});Ot();rt();var _c=class extends tt{static{n(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};rt();rt();var Z=class extends tt{static{n(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};vt();$n();Xn();cs();fs();ds();ys();_s();function kc(t){return t?[{type:"spawn.before",action(s,i){t.aborted&&i.kill(new Z(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(s,i){function o(){i.kill(new Z(void 0,"abort","Abort signal received"))}n(o,"kill"),t.addEventListener("abort",o),i.spawned.on("close",()=>t.removeEventListener("abort",o))}}]:void 0}n(kc,"abortPlugin");function Tc(t){return typeof t=="string"&&t.trim().toLowerCase()==="-c"}n(Tc,"isConfigSwitch");function Sc(t,e){if(Tc(t)&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new Z(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}n(Sc,"preventProtocolOverride");function Cc(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new Z(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(e==="clone"&&/^\s*-u\b/.test(t))throw new Z(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(e==="push"&&/^\s*--exec\b/.test(t))throw new Z(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}n(Cc,"preventUploadPack");function xc({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action(r,s){return r.forEach((i,o)=>{let a=o<r.length?r[o+1]:"";t||Sc(i,a),e||Cc(i,s.method)}),r}}}n(xc,"blockUnsafeOperationsPlugin");b();function Ec(t){let e=xt(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}n(Ec,"commandConfigPrefixingPlugin");b();var En=(0,gt.deferred)().promise;function Pc({onClose:t=!0,onExit:e=50}={}){function r(){let i=-1,o={close:(0,gt.deferred)(),closeTimeout:(0,gt.deferred)(),exit:(0,gt.deferred)(),exitTimeout:(0,gt.deferred)()},a=Promise.race([t===!1?En:o.closeTimeout.promise,e===!1?En:o.exitTimeout.promise]);return s(t,o.close,o.closeTimeout),s(e,o.exit,o.exitTimeout),{close(u){i=u,o.close.done()},exit(u){i=u,o.exit.done()},get exitCode(){return i},result:a}}n(r,"createEvents");function s(i,o,a){i!==!1&&(i===!0?o.promise:o.promise.then(()=>Fe(i))).then(a.done)}return n(s,"configureTimeout"),{type:"spawn.after",action(i,o){return St(this,arguments,function*(a,{spawned:u,close:c}){var d,p;let m=r(),h=!0,g=n(()=>void(h=!1),"quickClose");(d=u.stdout)==null||d.on("data",g),(p=u.stderr)==null||p.on("data",g),u.on("error",g),u.on("close",I=>m.close(I)),u.on("exit",I=>m.exit(I));try{yield m.result,h&&(yield Fe(50)),c(m.exitCode)}catch(I){c(m.exitCode,I)}})}}}n(Pc,"completionDetectionPlugin");b();var Oc="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Pn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Rc(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(t)}n(Rc,"isBadArgument");function On(t,e){if(t.length<1||t.length>2)throw new Z(void 0,"binary",Oc);if(t.some(Rc))if(e)console.warn(Pn);else throw new Z(void 0,"binary",Pn);let[s,i]=t;return{binary:s,prefix:i}}n(On,"toBinaryConfig");function Ac(t,e=["git"],r=!1){let s=On(W(e),r);t.on("binary",i=>{s=On(W(i),r)}),t.append("spawn.binary",()=>s.binary),t.append("spawn.args",i=>s.prefix?[s.prefix,...i]:i)}n(Ac,"customBinaryPlugin");rt();function Fc(t){return!!(t.exitCode&&t.stdErr.length)}n(Fc,"isTaskError");function $c(t){return Buffer.concat([...t.stdOut,...t.stdErr])}n($c,"getErrorMessage");function jc(t=!1,e=Fc,r=$c){return(s,i)=>!t&&s||!e(i)?s:r(i)}n(jc,"errorDetectionHandler");function Rn(t){return{type:"task.error",action(e,r){let s=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(s)?{error:new tt(void 0,s.toString("utf-8"))}:{error:s}}}}n(Rn,"errorDetectionPlugin");b();var Lc=class{static{n(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new Dc}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=_(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return W(t).forEach(r=>r&&this.plugins.add(_(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let s=e,i=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===t&&(s=o.action(s,i));return s}};b();function Mc(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,a){return r.includes(a.method)?In(o,e):o}},{type:"spawn.after",action(o,a){var u;a.commands.includes(e)&&((u=a.spawned.stderr)==null||u.on("data",c=>{let d=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));d&&t({method:a.method,stage:Bc(d[1]),progress:S(d[2]),processed:S(d[3]),total:S(d[4])})}))}}]}n(Mc,"progressMonitorPlugin");function Bc(t){return String(t.toLowerCase().split(" ",1))||"unknown"}n(Bc,"progressEventStage");b();function Ic(t){let e=Un(t,["uid","gid"]);return{type:"spawn.options",action(r){return z(z({},e),r)}}}n(Ic,"spawnOptionsPlugin");function Nc({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(s,i){var o,a;let u;function c(){u&&clearTimeout(u),u=setTimeout(p,t)}n(c,"wait");function d(){var m,h;(m=i.spawned.stdout)==null||m.off("data",c),(h=i.spawned.stderr)==null||h.off("data",c),i.spawned.off("exit",d),i.spawned.off("close",d),u&&clearTimeout(u)}n(d,"stop");function p(){d(),i.kill(new Z(void 0,"timeout","block timeout reached"))}n(p,"kill"),r&&((o=i.spawned.stdout)==null||o.on("data",c)),e&&((a=i.spawned.stderr)==null||a.on("data",c)),i.spawned.on("exit",d),i.spawned.on("close",d),c()}}}n(Nc,"timeoutPlugin");Ot();function Gc(){return{type:"spawn.args",action(t){let e=[],r;function s(i){(r=r||[]).push(...i)}n(s,"append2");for(let i=0;i<t.length;i++){let o=t[i];if(Wt(o)){s(Zr(o));continue}if(o==="--"){s(t.slice(i+1).flatMap(a=>Wt(a)&&Zr(a)||a));break}e.push(o)}return r?[...e,"--",...r.map(String)]:e}}}n(Gc,"suffixPathsPlugin");b();var Uc=wc();function qc(t,e){var r;let s=new Lc,i=Vn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!Qe(i.baseDir))throw new _c(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&s.add(Ec(i.config)),s.add(xc(i.unsafe)),s.add(Gc()),s.add(Pc(i.completion)),i.abort&&s.add(kc(i.abort)),i.progress&&s.add(Mc(i.progress)),i.timeout&&s.add(Nc(i.timeout)),i.spawnOptions&&s.add(Ic(i.spawnOptions)),s.add(Rn(jc(!0))),i.errors&&s.add(Rn(i.errors)),Ac(s,i.binary,(r=i.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new Uc(i,s)}n(qc,"gitInstanceFactory");vt();var Ai=qc;T();var Fi=n((t,e)=>{let r=/^(https:\/\/)?(?<slug>[\w-]+?)(--development)?(\..*)?$/.exec(t)?.groups?.slug;if(r)return r;throw new K(C`
57
- ${e} must be the application's {bold slug} or {bold URL}
58
-
59
- {bold EXAMPLES:}
60
- ${e} my-app
61
- ${e} my-app.gadget.app
62
- ${e} https://my-app.gadget.app
63
- ${e} https://my-app.gadget.app/edit
64
- ${e} https://my-app--development.gadget.app/edit
65
- `)},"AppArg");T();import hr from"node:assert";var ue=class{static{n(this,"Edit")}ctx;#t;constructor(e,r){this.ctx=e.child({name:"edit"}),this.#t=new Mr(this.ctx,r,"/edit/api/graphql")}async query({query:e,variables:r,...s}){let i=/query (\w+)/.exec(e)?.[1];hr(i,"query name not found");let o=this.ctx.child({name:"edit",fields:{edit:{query:i}},devFields:{edit:{query:i,variables:wt(r)}}});o.log.info("executing graphql query");let a=await this.#t.execute(o,{operation:e,variables:r,...s,http:{retry:{methods:["POST"]},...s.http}});if(a.errors)throw new X(e,a.errors);if(!a.data)throw new X(e,"Query response did not contain data");return a.data}async mutate({mutation:e,variables:r,...s}){let i=/mutation (\w+)/.exec(e)?.[1];hr(i,"mutation name not found");let o=this.ctx.child({name:"edit",fields:{edit:{mutation:i}},devFields:{edit:{mutation:i,variables:wt(r)}}});o.log.info("executing graphql mutation");let a=await this.#t.execute(o,{operation:e,variables:r,...s});if(a.errors)throw kr(a.errors)&&a.errors[0]&&a.errors[0]==="Unauthenticated. No authenticated client."?new jr(e):new X(e,a.errors);if(!a.data)throw new X(e,"Mutation response did not contain data");return a.data}subscribe({onData:e,...r}){let s=/subscription (\w+)/.exec(r.subscription)?.[1];hr(s,"subscription name not found");let i=this.ctx.child({name:"edit",fields:{edit:{subscription:s}},devFields:{edit:{subscription:s,variables:wt(r.variables)}}}),o=n(async u=>{if(u.errors){a(),await r.onError(new X(r.subscription,u.errors));return}if(!u.data){a(),await r.onError(new X(r.subscription,"Subscription response did not contain data"));return}await e(u.data)},"onResponse");i.log.info("subscribing to graphql subscription");let a=this.#t.subscribe(i,{...r,onResponse:o});return{unsubscribe:n(()=>{a()},"unsubscribe"),resubscribe:n(u=>{a(),u!==void 0&&(r.variables=u),i=this.ctx.child({name:"edit",fields:{edit:{subscription:s}},devFields:{edit:{subscription:s,variables:wt(r.variables)}}}),i.log.info("re-subscribing to graphql subscription"),a=this.#t.subscribe(i,{...r,onResponse:o})},"resubscribe")}}async dispose(){await this.#t.dispose()}};var Kp={"--app":{type:Fi,alias:["-a","--application"]},"--env":{type:String,alias:["-e","--environment"]},"--allow-unknown-directory":Boolean,"--allow-different-app":Boolean},yr=class t{constructor(e,r,s,i,o,a){this.ctx=e;this.args=r;this.directory=s;this.environment=i;this.previousEnvironment=o;this.state=a;this.ctx=e.child({name:"sync-json",fields:n(()=>({syncJson:{directory:this.directory.path,branch:this.gitBranch,...this.state}}),"fields")}),this.edit=new ue(this.ctx,this.environment)}static{n(this,"SyncJson")}gitBranch;edit;get filesVersion(){let e=this.state.environments[this.state.environment];return gr(e,"environment must exist in environments"),BigInt(e.filesVersion)}static async load(e,{command:r,args:s,directory:i}){e=e.child({name:"sync-json"});let o=await Lr(e,r),a=await ve(e);if(a.length===0)throw new K(C`
66
- You (${o.email}) don't have have any Gadget applications.
67
-
68
- Visit https://gadget.new to create one!
69
- `);let u=await ce.default.readFile(i.absolute(".gadget/sync.json"),"utf8").catch(g=>e.log.warn("failed to read .gadget/sync.json",{error:g}));if(!u)return;let c;try{c=Wc.parse(JSON.parse(u))}catch(g){e.log.warn("failed to parse .gadget/sync.json",{error:g,syncJsonFile:u});return}let d=await ji({args:s,availableApps:a,state:c}),p=await Li({command:r,args:s,application:d,state:c});if(Ar({application_id:d.id,environment_id:p.id}),c.application!==d.slug){if(s["--allow-different-app"]){let g={application:d.slug,environment:p.name,environments:{[p.name]:{filesVersion:"0"}}},I=p.type==="production"?new Dt(e,s,i,p,void 0,g):new t(e,s,i,p,void 0,g);return await I.loadGitBranch(),I}throw new K(C`
70
- You were about to sync the following app to the following directory:
71
-
72
- ${d.slug} (${p.name}) → ${i.path}
73
-
74
- However, that directory has already been synced with this app:
75
-
76
- ${c.application} (${c.environment})
77
-
78
- If you're sure that you want to sync:
79
-
80
- ${d.slug} (${p.name}) → ${i.path}
81
-
82
- Run "ggt dev" with the {bold --allow-different-app} flag.
83
- `)}let m;c.environment!==p.name&&(p.type!=="production"&&_t({ensureEmptyLineAbove:!0,content:C`
84
- Changing environment.
85
-
86
- ${c.environment} → ${p.name}
87
- `}),m=c.environment,c.environment=p.name,c.environments[p.name]||(c.environments[p.name]={filesVersion:"0"}));let h=p.type==="production"?new Dt(e,s,i,p,m,c):new t(e,s,i,p,m,c);return await h.save(h.filesVersion),await h.loadGitBranch(),h}static async loadOrInit(e,{command:r,args:s,directory:i}){e=e.child({name:"sync-json"});let o=await t.load(e,{command:r,args:s,directory:i});if(o)return o;if(await i.hasFiles()&&!s["--allow-unknown-directory"])throw new Mt({command:r,args:s,directory:i});let a=await ji({args:s,availableApps:await ve(e)}),u=await Li({command:r,args:s,application:a});await ce.default.ensureDir(i.path);let c={application:a.slug,environment:u.name,environments:{[u.name]:{filesVersion:"0"}}};return o=u.type==="production"?new Dt(e,s,i,u,void 0,c):new t(e,s,i,u,void 0,c),await o.save(o.filesVersion),await o.loadGitBranch(),o}async save(e){let r=this.state.environments[this.state.environment];gr(r,"environment must exist in environments"),r.filesVersion=String(e),this.ctx.log.debug("saving .gadget/sync.json"),await ce.default.outputJSON(this.directory.absolute(".gadget/sync.json"),this.state,{spaces:2})}async loadGitBranch(){this.gitBranch=await Jc(this.ctx,{directory:this.directory})}sprint(e={}){let r=$`
88
- Application ${this.environment.application.slug}
89
- Environment ${this.environment.name}
90
- `;this.gitBranch&&(r+=$({indent:5,content:`Branch ${this.gitBranch}`}));let s=he.domains.app;return ft.isSupported?r+=$({ensureEmptyLineAbove:!0,content:`${ft(kt.link("Preview"),`https://${this.environment.application.slug}--${this.environment.name}.${s}`)} ${ft(kt.link("Editor"),`https://${this.environment.application.primaryDomain}/edit/${this.environment.name}`)} ${ft(kt.link("Playground"),`https://${this.environment.application.primaryDomain}/api/playground/javascript?environment=${this.environment.name}`)} ${ft(kt.link("Docs"),`https://docs.gadget.dev/api/${this.environment.application.slug}`)}`}):r+=$`
91
- ------------------------
92
- Preview https://${this.environment.application.slug}--${this.environment.name}.${s}
93
- Editor https://${this.environment.application.primaryDomain}/edit/${this.environment.name}
94
- Playground https://${this.environment.application.primaryDomain}/api/playground/javascript?environment=${this.environment.name}
95
- Docs https://docs.gadget.dev/api/${this.environment.application.slug}
96
- `,$({...e,content:r})}print(e){e=Or(e,{ensureEmptyLineAbove:!0}),_t(this.sprint(e))}},Dt=class extends yr{static{n(this,"EphemeralSyncJson")}async save(e){let r=this.state.environments[this.state.environment];return gr(r,"environment must exist in environments"),r.filesVersion=String(e),Promise.resolve()}},Xp=n(async t=>{he.windows&&t.startsWith("~/")&&(t=Rr(t.slice(2)));let e=await Pr(".gadget/sync.json",{cwd:t});return e&&(t=$i.join(e,"../..")),t=$i.resolve(t),await Dr.init(t)},"loadSyncJsonDirectory"),ji=n(async({args:t,availableApps:e,state:r})=>{let s=t["--app"]||r?.application;if(!s){let a=Array.from(Br(e)).map(([u,c])=>[u,c.map(d=>d.slug)]);s=await be({groupedChoices:a,content:"Which application do you want to develop?"})}let i=e.find(a=>a.slug===s);if(i)return i;let o=ge(s,e.map(a=>a.slug)).slice(0,5);throw new K(C`
97
- Unknown application:
98
-
99
- ${s}
100
-
101
- Did you mean one of these?
102
-
103
- • ${o.join(`
104
- \u2022 `)}
105
- `)},"loadApplication"),Di=["pull","logs"],Li=n(async({command:t,args:e,application:r,state:s})=>{if(e["--env"]&&!r.multiEnvironmentEnabled)throw new K(C`
106
- You specified an environment but your app doesn't have multiple environments.
107
-
108
- Remove the "--env" flag to sync to the {bold ${r.primaryDomain}} environment.
109
- `);let i=r.environments.filter(c=>c.type===ye.Development);Di.includes(t)&&i.push(...r.environments.filter(c=>c.type===ye.Production));let o=e["--env"]||s?.environment;if(o||(o=await be({choices:i.map(c=>c.name),content:"Which environment do you want to develop on?"})),o.toLowerCase()==="production"&&!Di.includes(t))throw new K(C`
110
- You cannot "ggt ${t}" your {bold production} environment.
111
- `);let a=i.find(c=>c.name===o.toLowerCase());if(a)return{...a,application:r};let u=ge(o,i.map(c=>c.name)).slice(0,5);throw new K(C`
112
- Unknown environment:
113
-
114
- ${o}
115
-
116
- Did you mean one of these?
117
-
118
- • ${u.join(`
119
- \u2022 `)}
120
- `)},"loadEnvironment"),Jc=n(async(t,{directory:e})=>{try{return await Ai(e.path).revparse(["--abbrev-ref","HEAD"])}catch(r){t.log.warn("failed to read git branch",{error:r});return}},"loadBranch"),zc=J.object({application:J.string(),environment:J.string(),environments:J.record(J.object({filesVersion:J.string()}))}),Vc=J.object({app:J.string(),filesVersion:J.string(),mtime:J.number()}),Qc=J.union([zc,Vc]),Wc=Qc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{tl as a,we as b,el as c,rl as d,nl as e,Nr as f,Mt as g,Gr as h,Ur as i,qr as j,co as k,dl as l,Kp as m,yr as n,Xp as o};
121
- //# sourceMappingURL=chunk-YU6P3ESA.js.map