@gadgetinc/ggt 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/add-CVO2CSA3.js +78 -0
- package/dist/add-CVO2CSA3.js.map +7 -0
- package/dist/chunk-3V7YWBUK.js +2 -0
- package/dist/{chunk-BSCZOMV4.js.map → chunk-3V7YWBUK.js.map} +1 -1
- package/dist/chunk-6BXHYE2C.js +187 -0
- package/dist/chunk-6BXHYE2C.js.map +7 -0
- package/dist/{chunk-BYMG3KOL.js → chunk-ACR6CVXY.js} +4 -4
- package/dist/{chunk-BYMG3KOL.js.map → chunk-ACR6CVXY.js.map} +2 -2
- package/dist/{chunk-KMCOZJPU.js → chunk-AGRDDZFS.js} +2 -2
- package/dist/{chunk-KMCOZJPU.js.map → chunk-AGRDDZFS.js.map} +4 -4
- package/dist/chunk-B6XQEEUK.js +2 -0
- package/dist/chunk-B6XQEEUK.js.map +7 -0
- package/dist/chunk-FQ2LR3BI.js +6 -0
- package/dist/chunk-FQ2LR3BI.js.map +7 -0
- package/dist/chunk-GIAIN3IJ.js +65 -0
- package/dist/chunk-GIAIN3IJ.js.map +7 -0
- package/dist/{chunk-THZRTDWW.js → chunk-HCQR6OPH.js} +2 -2
- package/dist/chunk-MIN6ZMLJ.js +117 -0
- package/dist/chunk-MIN6ZMLJ.js.map +7 -0
- package/dist/chunk-O2K4B6AL.js +50 -0
- package/dist/chunk-O2K4B6AL.js.map +7 -0
- package/dist/chunk-P5OUQ5XQ.js +2 -0
- package/dist/chunk-SGMPMYEU.js +2 -0
- package/dist/chunk-SGMPMYEU.js.map +7 -0
- package/dist/{chunk-BZSAGSV3.js → chunk-W5JAWOQQ.js} +2 -2
- package/dist/chunk-XB3JTJT6.js +18 -0
- package/dist/{chunk-6FBP46EB.js.map → chunk-XB3JTJT6.js.map} +3 -3
- package/dist/chunk-YESACFSR.js +2 -0
- package/dist/chunk-YESACFSR.js.map +7 -0
- package/dist/deploy-6JPQ4SNV.js +25 -0
- package/dist/deploy-6JPQ4SNV.js.map +7 -0
- package/dist/dev-ZPSCK7JQ.js +58 -0
- package/dist/{dev-OT7PEKUN.js.map → dev-ZPSCK7JQ.js.map} +4 -4
- package/dist/esm-46TFUFSK.js +36 -0
- package/dist/esm-46TFUFSK.js.map +7 -0
- package/dist/list-A7LFGUXG.js +11 -0
- package/dist/list-A7LFGUXG.js.map +7 -0
- package/dist/login-BP4XIHLA.js +2 -0
- package/dist/logout-PPA6JCDY.js +7 -0
- package/dist/{logout-B3YAZN6R.js.map → logout-PPA6JCDY.js.map} +1 -1
- package/dist/main.js +10 -10
- package/dist/main.js.map +3 -3
- package/dist/open-MWPVVE7V.js +74 -0
- package/dist/open-MWPVVE7V.js.map +7 -0
- package/dist/{pull-SLPBOP6Z.js → pull-WEYQPN7H.js} +4 -4
- package/dist/{pull-SLPBOP6Z.js.map → pull-WEYQPN7H.js.map} +2 -2
- package/dist/push-S4CWMHMS.js +2 -0
- package/dist/status-GI5XJQTQ.js +14 -0
- package/dist/status-GI5XJQTQ.js.map +7 -0
- package/dist/{version-AUI4NRDS.js → version-CXGPMLMK.js} +2 -2
- package/dist/{version-AUI4NRDS.js.map → version-CXGPMLMK.js.map} +1 -1
- package/dist/whoami-PPXXBHUR.js +7 -0
- package/dist/{whoami-TXO7VJXC.js.map → whoami-PPXXBHUR.js.map} +1 -1
- package/package.json +20 -19
- package/dist/add-DCE6CV2D.js +0 -78
- package/dist/add-DCE6CV2D.js.map +0 -7
- package/dist/build-4BGA4IZE.js +0 -3
- package/dist/build-4BGA4IZE.js.map +0 -7
- package/dist/chunk-3Q3GPB6Z.js +0 -2
- package/dist/chunk-3Q3GPB6Z.js.map +0 -7
- package/dist/chunk-57XALM2W.js +0 -2
- package/dist/chunk-57XALM2W.js.map +0 -7
- package/dist/chunk-5WC5D4WL.js +0 -2
- package/dist/chunk-5WC5D4WL.js.map +0 -7
- package/dist/chunk-6FBP46EB.js +0 -18
- package/dist/chunk-AB4I3BMD.js +0 -33
- package/dist/chunk-AB4I3BMD.js.map +0 -7
- package/dist/chunk-BSCZOMV4.js +0 -2
- package/dist/chunk-CXYA3RFX.js +0 -117
- package/dist/chunk-CXYA3RFX.js.map +0 -7
- package/dist/chunk-D2K5XPNJ.js +0 -2
- package/dist/chunk-D2K5XPNJ.js.map +0 -7
- package/dist/chunk-DVKNBG4P.js +0 -180
- package/dist/chunk-DVKNBG4P.js.map +0 -7
- package/dist/chunk-EFU2JNKY.js +0 -9
- package/dist/chunk-EFU2JNKY.js.map +0 -7
- package/dist/chunk-F3EZ4KS3.js +0 -2
- package/dist/chunk-F3EZ4KS3.js.map +0 -7
- package/dist/chunk-GOBNB5VT.js +0 -2
- package/dist/chunk-GOBNB5VT.js.map +0 -7
- package/dist/chunk-HKBXEZNF.js +0 -2
- package/dist/chunk-KGOVR5SK.js +0 -67
- package/dist/chunk-KGOVR5SK.js.map +0 -7
- package/dist/chunk-M4PNFOA5.js +0 -6
- package/dist/chunk-M4PNFOA5.js.map +0 -7
- package/dist/chunk-OLKWG2EP.js +0 -12
- package/dist/chunk-OLKWG2EP.js.map +0 -7
- package/dist/context-L5YSPF3X.js +0 -2
- package/dist/deploy-PBJEUYGH.js +0 -25
- package/dist/deploy-PBJEUYGH.js.map +0 -7
- package/dist/dev-OT7PEKUN.js +0 -55
- package/dist/esm-GJ7RK6IC.js +0 -34
- package/dist/esm-GJ7RK6IC.js.map +0 -7
- package/dist/list-CC5PICEF.js +0 -11
- package/dist/list-CC5PICEF.js.map +0 -7
- package/dist/login-SE7XIHRW.js +0 -2
- package/dist/logout-B3YAZN6R.js +0 -7
- package/dist/open-OVK3YL4O.js +0 -74
- package/dist/open-OVK3YL4O.js.map +0 -7
- package/dist/push-3HGVWCKW.js +0 -2
- package/dist/push-3HGVWCKW.js.map +0 -7
- package/dist/status-7GLNL7D5.js +0 -14
- package/dist/status-7GLNL7D5.js.map +0 -7
- package/dist/user-C34J52UL.js +0 -2
- package/dist/user-C34J52UL.js.map +0 -7
- package/dist/whoami-TXO7VJXC.js +0 -7
- /package/dist/{chunk-THZRTDWW.js.map → chunk-HCQR6OPH.js.map} +0 -0
- /package/dist/{chunk-HKBXEZNF.js.map → chunk-P5OUQ5XQ.js.map} +0 -0
- /package/dist/{chunk-BZSAGSV3.js.map → chunk-W5JAWOQQ.js.map} +0 -0
- /package/dist/{context-L5YSPF3X.js.map → login-BP4XIHLA.js.map} +0 -0
- /package/dist/{login-SE7XIHRW.js.map → push-S4CWMHMS.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as tt,
|
|
1
|
+
import{$ as tt,V as Qt,X as Z,Y as Xt,_ as L}from"./chunk-GIAIN3IJ.js";import{a as Q,c as v,e as X,g as p}from"./chunk-SGMPMYEU.js";var P=v((je,it)=>{p();var H=[],et=0,S=(i,t)=>{et>=t&&H.push(i)};S.WARN=1;S.INFO=2;S.DEBUG=3;S.reset=()=>{H=[]};S.setDebugLevel=i=>{et=i};S.warn=i=>S(i,S.WARN);S.info=i=>S(i,S.INFO);S.debug=i=>S(i,S.DEBUG);S.debugMessages=()=>H;it.exports=S});var D=v((_e,st)=>{p();var rt=Qt();function $(i){return i?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function M(i){let t=$();return(""+i).replace(t,"").split(`
|
|
2
2
|
`).reduce(function(n,o){return rt(o)>n?rt(o):n},0)}function q(i,t){return Array(t+1).join(i)}function Zt(i,t,e,r){let n=M(i);if(t+1>=n){let o=t-n;switch(r){case"right":{i=q(e,o)+i;break}case"center":{let s=Math.ceil(o/2),f=o-s;i=q(e,f)+i+q(e,s);break}default:{i=i+q(e,o);break}}}return i}var k={};function _(i,t,e){t="\x1B["+t+"m",e="\x1B["+e+"m",k[t]={set:i,to:!0},k[e]={set:i,to:!1},k[i]={on:t,off:e}}_("bold",1,22);_("italics",3,23);_("underline",4,24);_("inverse",7,27);_("strikethrough",9,29);function nt(i,t){let e=t[1]?parseInt(t[1].split(";")[0]):0;if(e>=30&&e<=39||e>=90&&e<=97){i.lastForegroundAdded=t[0];return}if(e>=40&&e<=49||e>=100&&e<=107){i.lastBackgroundAdded=t[0];return}if(e===0){for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&delete i[n];return}let r=k[t[0]];r&&(i[r.set]=r.to)}function te(i){let t=$(!0),e=t.exec(i),r={};for(;e!==null;)nt(r,e),e=t.exec(i);return r}function ot(i,t){let e=i.lastBackgroundAdded,r=i.lastForegroundAdded;return delete i.lastBackgroundAdded,delete i.lastForegroundAdded,Object.keys(i).forEach(function(n){i[n]&&(t+=k[n].off)}),e&&e!="\x1B[49m"&&(t+="\x1B[49m"),r&&r!="\x1B[39m"&&(t+="\x1B[39m"),t}function ee(i,t){let e=i.lastBackgroundAdded,r=i.lastForegroundAdded;return delete i.lastBackgroundAdded,delete i.lastForegroundAdded,Object.keys(i).forEach(function(n){i[n]&&(t=k[n].on+t)}),e&&e!="\x1B[49m"&&(t=e+t),r&&r!="\x1B[39m"&&(t=r+t),t}function ie(i,t){if(i.length===M(i))return i.substr(0,t);for(;M(i)>t;)i=i.slice(0,-1);return i}function re(i,t){let e=$(!0),r=i.split($()),n=0,o=0,s="",f,b={};for(;o<t;){f=e.exec(i);let a=r[n];if(n++,o+M(a)>t&&(a=ie(a,t-o)),s+=a,o+=M(a),o<t){if(!f)break;s+=f[0],nt(b,f)}}return ot(b,s)}function ne(i,t,e){if(e=e||"\u2026",M(i)<=t)return i;t-=M(e);let n=re(i,t);n+=e;let o="\x1B]8;;\x07";return i.includes(o)&&!n.includes(o)&&(n+=o),n}function oe(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function se(i,t){i=i||{},t=t||oe();let e=Object.assign({},t,i);return e.chars=Object.assign({},t.chars,i.chars),e.style=Object.assign({},t.style,i.style),e}function le(i,t){let e=[],r=t.split(/(\s+)/g),n=[],o=0,s;for(let f=0;f<r.length;f+=2){let b=r[f],a=o+M(b);o>0&&s&&(a+=s.length),a>i?(o!==0&&e.push(n.join("")),n=[b],o=M(b)):(n.push(s||"",b),o=a),s=r[f+1]}return o&&e.push(n.join("")),e}function ue(i,t){let e=[],r="";function n(s,f){for(r.length&&f&&(r+=f),r+=s;r.length>i;)e.push(r.slice(0,i)),r=r.slice(i)}let o=t.split(/(\s+)/g);for(let s=0;s<o.length;s+=2)n(o[s],s&&o[s-1]);return r.length&&e.push(r),e}function ae(i,t,e=!0){let r=[];t=t.split(`
|
|
3
3
|
`);let n=e?le:ue;for(let o=0;o<t.length;o++)r.push.apply(r,n(i,t[o]));return r}function he(i){let t={},e=[];for(let r=0;r<i.length;r++){let n=ee(t,i[r]);t=te(n);let o=Object.assign({},t);e.push(ot(o,n))}return e}function ce(i,t){let e="\x1B]",r="\x07",n=";";return[e,"8",n,n,i||t,r,t,e,"8",n,n,r].join("")}st.exports={strlen:M,repeat:q,pad:Zt,truncate:ne,mergeOptions:se,wordWrap:ae,colorizeLines:he,hyperlink:ce}});var ht=v((Ge,at)=>{p();var ut={};at.exports=ut;var lt={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(lt).forEach(function(i){var t=lt[i],e=ut[i]=[];e.open="\x1B["+t[0]+"m",e.close="\x1B["+t[1]+"m"})});var ft=v(($e,ct)=>{"use strict";p();ct.exports=function(i,t){t=t||process.argv;var e=t.indexOf("--"),r=/^-{1,2}/.test(i)?"":"--",n=t.indexOf(r+i);return n!==-1&&(e===-1?!0:n<e)}});var pt=v((Fe,dt)=>{"use strict";p();var fe=Q("os"),A=ft(),O=process.env,B=void 0;A("no-color")||A("no-colors")||A("color=false")?B=!1:(A("color")||A("colors")||A("color=true")||A("color=always"))&&(B=!0);"FORCE_COLOR"in O&&(B=O.FORCE_COLOR.length===0||parseInt(O.FORCE_COLOR,10)!==0);function de(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function pe(i){if(B===!1)return 0;if(A("color=16m")||A("color=full")||A("color=truecolor"))return 3;if(A("color=256"))return 2;if(i&&!i.isTTY&&B!==!0)return 0;var t=B?1:0;if(process.platform==="win32"){var e=fe.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in O)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(n){return n in O})||O.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in O)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(O.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in O){var r=parseInt((O.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(O.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(O.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(O.TERM)||"COLORTERM"in O?1:(O.TERM==="dumb",t)}function Y(i){var t=pe(i);return de(t)}dt.exports={supportsColor:Y,stdout:Y(process.stdout),stderr:Y(process.stderr)}});var bt=v((De,gt)=>{p();gt.exports=function(t,e){var r="";t=t||"Run the trap, drop the bass",t=t.split("");var n={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return t.forEach(function(o){o=o.toLowerCase();var s=n[o]||[" "],f=Math.floor(Math.random()*s.length);typeof n[o]<"u"?r+=n[o][f]:r+=o}),r}});var yt=v((Ne,mt)=>{p();mt.exports=function(t,e){t=t||" he is here ";var r={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},n=[].concat(r.up,r.down,r.mid);function o(b){var a=Math.floor(Math.random()*b);return a}function s(b){var a=!1;return n.filter(function(y){a=y===b}),a}function f(b,a){var y="",x,m;a=a||{},a.up=typeof a.up<"u"?a.up:!0,a.mid=typeof a.mid<"u"?a.mid:!0,a.down=typeof a.down<"u"?a.down:!0,a.size=typeof a.size<"u"?a.size:"maxi",b=b.split("");for(m in b)if(!s(m)){switch(y=y+b[m],x={up:0,down:0,mid:0},a.size){case"mini":x.up=o(8),x.mid=o(2),x.down=o(8);break;case"maxi":x.up=o(16)+3,x.mid=o(4)+1,x.down=o(64)+3;break;default:x.up=o(8)+1,x.mid=o(6)/2,x.down=o(8)+1;break}var u=["up","mid","down"];for(var l in u)for(var h=u[l],d=0;d<=x[h];d++)a[h]&&(y=y+r[h][o(r[h].length)])}return y}return f(t,e)}});var xt=v((Ue,wt)=>{p();wt.exports=function(i){return function(t,e,r){if(t===" ")return t;switch(e%3){case 0:return i.red(t);case 1:return i.white(t);case 2:return i.blue(t)}}}});var St=v((Ke,vt)=>{p();vt.exports=function(i){return function(t,e,r){return e%2===0?t:i.inverse(t)}}});var Ot=v((Xe,Ct)=>{p();Ct.exports=function(i){var t=["red","yellow","green","blue","magenta"];return function(e,r,n){return e===" "?e:i[t[r++%t.length]](e)}}});var Et=v((ti,Rt)=>{p();Rt.exports=function(i){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(e,r,n){return e===" "?e:i[t[Math.round(Math.random()*(t.length-2))]](e)}}});var kt=v((ri,Lt)=>{p();var c={};Lt.exports=c;c.themes={};var ge=Q("util"),T=c.styles=ht(),Mt=Object.defineProperties,be=new RegExp(/[\r\n]+/g);c.supportsColor=pt().supportsColor;typeof c.enabled>"u"&&(c.enabled=c.supportsColor()!==!1);c.enable=function(){c.enabled=!0};c.disable=function(){c.enabled=!1};c.stripColors=c.strip=function(i){return(""+i).replace(/\x1B\[\d+m/g,"")};var ii=c.stylize=function(t,e){if(!c.enabled)return t+"";var r=T[e];return!r&&e in c?c[e](t):r.open+t+r.close},me=/[|\\{}()[\]^$+*?.]/g,ye=function(i){if(typeof i!="string")throw new TypeError("Expected a string");return i.replace(me,"\\$&")};function Wt(i){var t=function e(){return xe.apply(e,arguments)};return t._styles=i,t.__proto__=we,t}var Tt=function(){var i={};return T.grey=T.gray,Object.keys(T).forEach(function(t){T[t].closeRe=new RegExp(ye(T[t].close),"g"),i[t]={get:function(){return Wt(this._styles.concat(t))}}}),i}(),we=Mt(function(){},Tt);function xe(){var i=Array.prototype.slice.call(arguments),t=i.map(function(s){return s!=null&&s.constructor===String?s:ge.inspect(s)}).join(" ");if(!c.enabled||!t)return t;for(var e=t.indexOf(`
|
|
4
4
|
`)!=-1,r=this._styles,n=r.length;n--;){var o=T[r[n]];t=o.open+t.replace(o.closeRe,o.open)+o.close,e&&(t=t.replace(be,function(s){return o.close+s+o.open}))}return t}c.setTheme=function(i){if(typeof i=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in i)(function(e){c[e]=function(r){if(typeof i[e]=="object"){var n=r;for(var o in i[e])n=c[i[e][o]](n);return n}return c[i[e]](r)}})(t)};function ve(){var i={};return Object.keys(Tt).forEach(function(t){i[t]={get:function(){return Wt([t])}}}),i}var Se=function(t,e){var r=e.split("");return r=r.map(t),r.join("")};c.trap=bt();c.zalgo=yt();c.maps={};c.maps.america=xt()(c);c.maps.zebra=St()(c);c.maps.rainbow=Ot()(c);c.maps.random=Et()(c);for(At in c.maps)(function(i){c[i]=function(t){return Se(c.maps[i],t)}})(At);var At;Mt(c,ve())});var jt=v((oi,Bt)=>{p();var Ce=kt();Bt.exports=Ce});var Gt=v((li,z)=>{p();var{info:Oe,debug:It}=P(),E=D(),V=class i{constructor(t){this.setOptions(t),this.x=null,this.y=null}setOptions(t){["boolean","number","bigint","string"].indexOf(typeof t)!==-1&&(t={content:""+t}),t=t||{},this.options=t;let e=t.content;if(["boolean","number","bigint","string"].indexOf(typeof e)!==-1)this.content=String(e);else if(!e)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof e);this.colSpan=t.colSpan||1,this.rowSpan=t.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(t,e){this.cells=e;let r=this.options.chars||{},n=t.chars,o=this.chars={};Ee.forEach(function(b){N(r,n,b,o)}),this.truncate=this.options.truncate||t.truncate;let s=this.options.style=this.options.style||{},f=t.style;N(s,f,"padding-left",this),N(s,f,"padding-right",this),this.head=s.head||f.head,this.border=s.border||f.border,this.fixedWidth=t.colWidths[this.x],this.lines=this.computeLines(t),this.desiredWidth=E.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(t){let e=t.wordWrap||t.textWrap,{wordWrap:r=e}=this.options;if(this.fixedWidth&&r){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let s=1;for(;s<this.colSpan;)this.fixedWidth+=t.colWidths[this.x+s],s++}let{wrapOnWordBoundary:n=!0}=t,{wrapOnWordBoundary:o=n}=this.options;return this.wrapLines(E.wordWrap(this.fixedWidth,this.content,o))}return this.wrapLines(this.content.split(`
|
|
@@ -8,4 +8,4 @@ import{$ as tt,N as Qt,P as Z,Q as Xt,_ as L}from"./chunk-KGOVR5SK.js";import{a
|
|
|
8
8
|
`;return s==="none"&&(m=(0,Vt.dedent)(m).slice(1)),m=m.split(`
|
|
9
9
|
`).map(u=>u.trimEnd()).join(`
|
|
10
10
|
`),a&&(m=Z(m,a)),i&&(m=L(i)+L({content:m,ensureEmptyLineAbove:n})),r&&(m=L(m)+L({content:r,ensureEmptyLineAbove:o})),L({content:m,...y})},yi=i=>{tt(ke(i))},Be={none:{"top-left":"",top:"","top-mid":"","top-right":"","left-mid":"",mid:"","mid-mid":"","right-mid":"",left:"",middle:"",right:"","bottom-left":"",bottom:"","bottom-mid":"","bottom-right":""},thin:{"top-left":"\u250C",top:"\u2500","top-mid":"\u252C","top-right":"\u2510","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C","right-mid":"\u2524",left:"\u2502",middle:"\u2502",right:"\u2502","bottom-left":"\u2514",bottom:"\u2500","bottom-mid":"\u2534","bottom-right":"\u2518"},thick:{"top-left":"\u2554",top:"\u2550","top-mid":"\u2564","top-right":"\u2557",left:"\u2551",middle:"\u2502",right:"\u2551","left-mid":"\u255F",mid:"\u2500","mid-mid":"\u253C","right-mid":"\u2562","bottom-left":"\u255A",bottom:"\u2550","bottom-mid":"\u2567","bottom-right":"\u255D"}};export{ke as a,yi as b};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-HCQR6OPH.js.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import{c as V}from"./chunk-YESACFSR.js";import{a as lr}from"./chunk-FQ2LR3BI.js";import{a as yr,b as vr,i as br}from"./chunk-XB3JTJT6.js";import{a as st,c as pr,f as pt,g as mt,j as Pt,l as Wi,m as mr,o as ee,p as Q,t as hr,u as dr,v as re,w as gr,z as ft}from"./chunk-O2K4B6AL.js";import{a as fr}from"./chunk-AGRDDZFS.js";import{$ as z,D as ct,K as lt,P as te,R as ur,U as Et,X as cr,Z as T,_ as R,b as G,e as B,g as tr,h as er,l as rr,m as nr,t as sr,u as ir,v as or,y as ar,z as Qi}from"./chunk-GIAIN3IJ.js";import{a as Vi,c as Zt,e as nt,g as C}from"./chunk-SGMPMYEU.js";var xr=Zt(D=>{"use strict";C();var Ki=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(D,"__esModule",{value:!0});var Xi=Vi("fs"),Zi=Ki(lr()),it=Zi.default("@kwsites/file-exists");function to(t,e,r){it("checking %s",t);try{let n=Xi.statSync(t);return n.isFile()&&e?(it("[OK] path represents a file"),!0):n.isDirectory()&&r?(it("[OK] path represents a directory"),!0):(it("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return it("[FAIL] path is not accessible: %o",n),!1;throw it("[FATAL] %o",n),n}}function eo(t,e=D.READABLE){return to(t,(e&D.FILE)>0,(e&D.FOLDER)>0)}D.exists=eo;D.FILE=1;D.FOLDER=2;D.READABLE=D.FILE+D.FOLDER});var Er=Zt(Rt=>{"use strict";C();function ro(t){for(var e in t)Rt.hasOwnProperty(e)||(Rt[e]=t[e])}Object.defineProperty(Rt,"__esModule",{value:!0});ro(xr())});var ue=Zt(Z=>{"use strict";C();Object.defineProperty(Z,"__esModule",{value:!0});Z.createDeferred=Z.deferred=void 0;function ae(){let t,e,r="pending";return{promise:new Promise((s,i)=>{t=s,e=i}),done(s){r==="pending"&&(r="resolved",t(s))},fail(s){r==="pending"&&(r="rejected",e(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}Z.deferred=ae;Z.createDeferred=ae;Z.default=ae});C();var _r=nt(Wi(),1);var Ec=Object.freeze({Fatal:"Fatal",Error:"Error",Warning:"Warning",Info:"Info"}),ne=({problems:t,showFileTypes:e,...r})=>{let n="";for(let[s,i]of Object.entries(t)){n+=R(""),n+=R`• {cyan ${s}} {redBright ${(0,_r.default)("problem",i.length,!0)}}`;for(let o of i){let[a,...c]=o.message.split(`
|
|
2
|
+
`);n+=T` {red ✖} `,(e??o.type==="SourceFile")&&(n+=T`${Hi(s)} `),n+=T(a);for(let p of c)n+=R(""),n+=T` ${p}`;for(let p of o.labels)n+=T` {dim ${p}}`;n+=R("")}}return R({...r,content:n})},Pc=t=>{z(ne(t))},Hi=t=>{switch(!0){case sr(t):return G.yellowBright("JavaScript");case ir(t):return G.blue("TypeScript");case or(t):return G.magenta("Gelly");default:return G.gray("File")}},Cc=t=>{let e={};for(let r of t){let n=r.node?.apiIdentifier??r.node?.name??"Other";e[n]??=[],e[n].push({type:r.node?.type??"Unknown",severity:r.severity,message:r.message,labels:mr(r.nodeLabels?.map(s=>s?.identifier)??[])})}return e},Rc=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};C();var kr=class extends mt{isBug=pt.NO;constructor(){super("Yarn not found")}render(){return T`
|
|
3
|
+
Yarn must be installed to sync your application. You can install it by running:
|
|
4
|
+
|
|
5
|
+
$ npm install --global yarn
|
|
6
|
+
|
|
7
|
+
For more information, see: https://classic.yarnpkg.com/en/docs/install
|
|
8
|
+
`}},Ct=class extends mt{constructor(r){super('The ".gadget/sync.json" file was invalid or not found');this.details=r}isBug=pt.NO;render(){let r=this.details.directory.path;switch(this.details.command){case"add":case"open":case"status":return T`
|
|
9
|
+
A ".gadget/sync.json" file is missing in this directory:
|
|
10
|
+
|
|
11
|
+
${r}
|
|
12
|
+
|
|
13
|
+
In order to use "ggt ${this.details.command}", you must run it within a directory
|
|
14
|
+
that has already been initialized with "ggt dev".
|
|
15
|
+
`;case"dev":return T`
|
|
16
|
+
A ".gadget/sync.json" file is missing in this directory:
|
|
17
|
+
|
|
18
|
+
${r}
|
|
19
|
+
|
|
20
|
+
If you're running "ggt dev" for the first time, we recommend
|
|
21
|
+
using a gadget specific directory like this:
|
|
22
|
+
|
|
23
|
+
ggt dev ~/gadget/${this.details.args["--app"]??"<name>"}
|
|
24
|
+
|
|
25
|
+
To use a non-empty directory without a ".gadget/sync.json" file,
|
|
26
|
+
run "ggt dev" again with the "--allow-unknown-directory" flag:
|
|
27
|
+
|
|
28
|
+
ggt dev ${r} --allow-unknown-directory
|
|
29
|
+
`;default:return T`
|
|
30
|
+
A ".gadget/sync.json" file is missing in this directory:
|
|
31
|
+
|
|
32
|
+
${r}
|
|
33
|
+
|
|
34
|
+
If you're certain you want to use this directory, you can run
|
|
35
|
+
"ggt ${this.details.command}" again with the "--allow-unknown-directory" flag:
|
|
36
|
+
|
|
37
|
+
ggt ${this.details.command} --allow-unknown-directory
|
|
38
|
+
`}}},wr=class extends mt{constructor(r){super(`Failed to synchronize files after ${r} attempts.`);this.attempts=r}isBug=pt.MAYBE;render(){return T`
|
|
39
|
+
We merged your local files with your environment's files ${this.attempts} times,
|
|
40
|
+
but your local and environment's files still don't match.
|
|
41
|
+
|
|
42
|
+
Make sure no one else is editing files on your environment, and try again.
|
|
43
|
+
`}},Tr=class extends mt{constructor(r){super("This application is not allowed to be deployed due to fatal errors.");this.fatalErrors=r}isBug=pt.MAYBE;render(){let r=R`{red Gadget has detected the following fatal errors with your files:}`;return r+=ne({ensureEmptyLineAbove:!0,problems:this.fatalErrors,showFileTypes:!1}),r+=R({ensureEmptyLineAbove:!0,content:G.red("Please fix these errors and try again.")}),r}},Yi=t=>(t instanceof Q&&(t=t.cause),rr(t)&&(t=t.errors),nr(t)&&(t=t[0]),er(t)&&"message"in t&&tr(t.message)&&t.message.includes("Files version mismatch")),Fc=(t,e)=>{if(Yi(e)){t.log.debug("swallowing files version mismatch",{error:e});return}throw e};C();import Sr from"node:assert";import se from"node:process";var oe=t=>(t=ct(t,{ensureEmptyLineAbove:!0}),Et.isInteractive||(z(t.content),z(JSON.stringify(t.choices??t.groupedChoices,void 0,2)),z({ensureEmptyLineAbove:!0,content:"Aborting because ggt is not running in an interactive terminal."}),se.exit(1)),new Promise(e=>{let r=new ie({formatChoice:n=>n,formatSelection:n=>n,...t});r.on("submit",e),r.on("exit",()=>se.exit(0)),r.on("abort",()=>se.exit(0))})),ie=class extends yr{cursor=0;optionsPerPage=10;options;currentChoices;groupedChoicesTitleIndexMap=new Map;constructor(e){if(super(),this.options=ct(e,{formatChoice:r=>r,formatSelection:r=>r,...e}),this.options.choices)this.currentChoices=this.options.choices;else{this.currentChoices=this.options.groupedChoices.flatMap(([n,s])=>s);let r=0;this.options.groupedChoices.forEach(n=>{let[s,i]=n;i.forEach((o,a)=>{a===0&&this.groupedChoicesTitleIndexMap.set(r,s),r++})})}this.render()}get selection(){let e=this.currentChoices[this.cursor];return Sr(e,`choices[${this.cursor}] is not defined`),e}moveCursor(e){this.cursor=e,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render("Cancel (Ctrl+C)"),this.close()}submit(){this.done=!0,this.aborted=!1,this.value=this.selection,this.fire(),this.render(),this.close()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.currentChoices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.currentChoices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.currentChoices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.currentChoices.length),this.render()}_(e,r){if(e===" "){this.submit();return}}render(e){if(this.closed)return;super.render();let r=this.options.content;if(this.done){Et.persistPrompt(R({...this.options,content:`${r.trimEnd()} ${this.options.formatChoice(e??this.selection)}`}));return}r+=` ${G.gray("Use arrow keys to move")}
|
|
44
|
+
|
|
45
|
+
`;let n="",{startIndex:s,endIndex:i}=vr(this.cursor,this.currentChoices.length,this.optionsPerPage);for(let o=s;o<i;o++){let a;this.cursor===o?a=`${Pt.arrowRight} `:o===s&&s>0?a=`${Pt.arrowUp} `:o===i-1&&i<this.currentChoices.length?a=`${Pt.arrowDown} `:a=" ";let c=this.currentChoices[o];Sr(c,`choices[${o}] is not defined`);let p=this.options.formatChoice(c);this.cursor===o&&(p=G.blue.underline(p)),this.groupedChoicesTitleIndexMap.has(o)&&(o!==s&&(n+=`
|
|
46
|
+
`),n+=`${G.grey(this.groupedChoicesTitleIndexMap.get(o))}
|
|
47
|
+
`),n+=`${a}${p}
|
|
48
|
+
`}this.options.indent&&(n=cr(n,this.options.indent)),Et.updatePrompt(r+n)}};C();var Kt=nt(Qi(),1);import ci from"node:assert";import li from"node:path";C();var Ut=nt(Er(),1),Bt=nt(lr(),1),js=nt(ue(),1),ot=nt(ue(),1);import{spawn as zo}from"child_process";import{EventEmitter as ac}from"node:events";var Nt=Object.defineProperty,no=Object.defineProperties,so=Object.getOwnPropertyDescriptor,io=Object.getOwnPropertyDescriptors,Ce=Object.getOwnPropertyNames,Pr=Object.getOwnPropertySymbols,an=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,Cr=(t,e,r)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F=(t,e)=>{for(var r in e||(e={}))an.call(e,r)&&Cr(t,r,e[r]);if(Pr)for(var r of Pr(e))oo.call(e,r)&&Cr(t,r,e[r]);return t},gt=(t,e)=>no(t,io(e)),l=(t,e)=>function(){return t&&(e=(0,t[Ce(t)[0]])(t=0)),e},ao=(t,e)=>function(){return e||(0,t[Ce(t)[0]])((e={exports:{}}).exports,e),e.exports},P=(t,e)=>{for(var r in e)Nt(t,r,{get:e[r],enumerable:!0})},uo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ce(e))!an.call(t,s)&&s!==r&&Nt(t,s,{get:()=>e[s],enumerable:!(n=so(e,s))||n.enumerable});return t},S=t=>uo(Nt({},"__esModule",{value:!0}),t),dt=(t,e,r)=>new Promise((n,s)=>{var i=c=>{try{a(r.next(c))}catch(p){s(p)}},o=c=>{try{a(r.throw(c))}catch(p){s(p)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,o);a((r=r.apply(t,e)).next())});function co(...t){let e=new String(t);return Gt.set(e,t),e}function Dt(t){return t instanceof String&&Gt.has(t)}function Rr(t){return Gt.get(t)||[]}var Gt,_t=l({"src/lib/args/pathspec.ts"(){"use strict";Gt=new WeakMap}}),H,K=l({"src/lib/errors/git-error.ts"(){"use strict";H=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),kt,ut=l({"src/lib/errors/git-response-error.ts"(){"use strict";K(),kt=class extends H{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),un,cn=l({"src/lib/errors/task-configuration-error.ts"(){"use strict";K(),un=class extends H{constructor(t){super(void 0,t)}}}});function ln(t){return typeof t=="function"?t:rt}function pn(t){return typeof t=="function"&&t!==rt}function mn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}function fn(t,e=0){return hn(t)&&t.length>e?t[e]:void 0}function et(t,e=0){if(hn(t)&&t.length>e)return t[t.length-1-e]}function hn(t){return!!(t&&typeof t.length=="number")}function wt(t="",e=!0,r=`
|
|
49
|
+
`){return t.split(r).reduce((n,s)=>{let i=e?s.trim():s;return i&&n.push(i),n},[])}function Re(t,e){return wt(t,!0).map(r=>e(r))}function Oe(t){return(0,Ut.exists)(t,Ut.FOLDER)}function _(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function dn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function qt(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function q(t){return Array.isArray(t)?t:[t]}function gn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function yn(t){return q(t).map(String)}function w(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}function yt(t,e){let r=[];for(let n=0,s=t.length;n<s;n++)r.push(e,t[n]);return r}function vt(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}function vn(t,e){return Object.assign({},...e.map(r=>r in t?{[r]:t[r]}:{}))}function de(t=0){return new Promise(e=>setTimeout(e,t))}function ge(t){if(t!==!1)return t}var at,rt,Tt,Jt=l({"src/lib/utils/util.ts"(){"use strict";at="\0",rt=()=>{},Tt=Object.prototype.toString.call.bind(Object.prototype.toString)}});function J(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function Ae(t,e){let r=Dt(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function $e(t){return!!t&&Tt(t)==="[object Object]"}function bn(t){return typeof t=="function"}var St,O,_n,It,Le,kn=l({"src/lib/utils/argument-filters.ts"(){"use strict";Jt(),_t(),St=t=>Array.isArray(t),O=t=>typeof t=="string",_n=t=>Array.isArray(t)&&t.every(O),It=t=>O(t)||Array.isArray(t)&&t.every(O),Le=t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number"}}),ye,lo=l({"src/lib/utils/exit-codes.ts"(){"use strict";ye=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(ye||{})}}),bt,po=l({"src/lib/utils/git-output-streams.ts"(){"use strict";bt=class{constructor(t,e){this.stdOut=t,this.stdErr=e}asStrings(){return new bt(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),g,Y,mo=l({"src/lib/utils/line-parser.ts"(){"use strict";g=class{constructor(t,e){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,i)=>this.addMatch(s,i,r(i)))?this.useMatches(n,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 n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},Y=class extends g{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 wn(...t){let e=process.cwd(),r=Object.assign(F({baseDir:e},Tn),...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var Tn,fo=l({"src/lib/utils/simple-git-options.ts"(){"use strict";Tn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Me(t,e=[]){return $e(t)?Object.keys(t).reduce((r,n)=>{let s=t[n];return Dt(s)?r.push(s):Ae(s,["boolean"])?r.push(n+"="+s):r.push(n),r},e):e}function L(t,e=0,r=!1){let n=[];for(let s=0,i=e<0?t.length:e;s<i;s++)"string|number".includes(typeof t[s])&&n.push(String(t[s]));return Me(je(t),n),r||n.push(...ho(t)),n}function ho(t){let e=typeof et(t)=="function";return J(et(t,e?1:0),St,[])}function je(t){let e=bn(et(t));return J(et(t,e?1:0),$e)}function x(t,e=!0){let r=ln(et(t));return e||pn(r)?r:void 0}var go=l({"src/lib/utils/task-options.ts"(){"use strict";kn(),Jt(),_t()}});function ve(t,e){return t(e.stdOut,e.stdErr)}function j(t,e,r,n=!0){return q(r).forEach(s=>{for(let i=wt(s,n),o=0,a=i.length;o<a;o++){let c=(p=0)=>{if(!(o+p>=a))return i[o+p]};e.some(({parse:p})=>p(c,t))}}),t}var yo=l({"src/lib/utils/task-parser.ts"(){"use strict";Jt()}}),Sn={};P(Sn,{ExitCodes:()=>ye,GitOutputStreams:()=>bt,LineParser:()=>g,NOOP:()=>rt,NULL:()=>at,RemoteLineParser:()=>Y,append:()=>_,appendTaskOptions:()=>Me,asArray:()=>q,asCamelCase:()=>gn,asFunction:()=>ln,asNumber:()=>w,asStringArray:()=>yn,bufferToString:()=>vt,callTaskParser:()=>ve,createInstanceConfig:()=>wn,delay:()=>de,filterArray:()=>St,filterFunction:()=>bn,filterHasLength:()=>Le,filterPlainObject:()=>$e,filterPrimitives:()=>Ae,filterString:()=>O,filterStringArray:()=>_n,filterStringOrStringArray:()=>It,filterType:()=>J,first:()=>fn,folderExists:()=>Oe,forEachLineWithContent:()=>Re,getTrailingOptions:()=>L,including:()=>dn,isUserFunction:()=>pn,last:()=>et,objectToString:()=>Tt,orVoid:()=>ge,parseStringResponse:()=>j,pick:()=>vn,prefixedArray:()=>yt,remove:()=>qt,splitOn:()=>mn,toLinesWithContent:()=>wt,trailingFunctionArgument:()=>x,trailingOptionsArgument:()=>je});var d=l({"src/lib/utils/index.ts"(){"use strict";kn(),lo(),po(),mo(),fo(),go(),yo(),Jt()}}),xn={};P(xn,{CheckRepoActions:()=>be,checkIsBareRepoTask:()=>Pn,checkIsRepoRootTask:()=>En,checkIsRepoTask:()=>vo});function vo(t){switch(t){case"bare":return Pn();case"root":return En()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:zt,parser:De}}function En(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:zt,parser(e){return/^\.(git)?$/.test(e.trim())}}}function Pn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:zt,parser:De}}function bo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var be,zt,De,Cn=l({"src/lib/tasks/check-is-repo.ts"(){"use strict";d(),be=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(be||{}),zt=({exitCode:t},e,r,n)=>{if(t===128&&bo(e))return r(Buffer.from("false"));n(e)},De=t=>t.trim()==="true"}});function _o(t,e){let r=new Rn(t),n=t?An:On;return wt(e).forEach(s=>{let i=s.replace(n,"");r.paths.push(i),($n.test(i)?r.folders:r.files).push(i)}),r}var Rn,On,An,$n,ko=l({"src/lib/responses/CleanSummary.ts"(){"use strict";d(),Rn=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},On=/^[a-z]+\s*/i,An=/^[a-z]+\s+[a-z]+\s*/i,$n=/\/$/}}),_e={};P(_e,{EMPTY_COMMANDS:()=>Vt,adhocExecTask:()=>Ln,configurationErrorTask:()=>M,isBufferTask:()=>jn,isEmptyTask:()=>Dn,straightThroughBufferTask:()=>Mn,straightThroughStringTask:()=>$});function Ln(t){return{commands:Vt,format:"empty",parser:t}}function M(t){return{commands:Vt,format:"empty",parser(){throw typeof t=="string"?new un(t):t}}}function $(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}function Mn(t){return{commands:t,format:"buffer",parser(e){return e}}}function jn(t){return t.format==="buffer"}function Dn(t){return t.format==="empty"||!t.commands.length}var Vt,E=l({"src/lib/tasks/task.ts"(){"use strict";cn(),Vt=[]}}),In={};P(In,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Ie,CONFIG_ERROR_MODE_REQUIRED:()=>Be,CONFIG_ERROR_UNKNOWN_OPTION:()=>Fe,CleanOptions:()=>$t,cleanTask:()=>Bn,cleanWithOptionsTask:()=>wo,isCleanOptionsArray:()=>To});function wo(t,e){let{cleanMode:r,options:n,valid:s}=So(t);return r?s.options?(n.push(...e),n.some(Po)?M(Ie):Bn(r,n)):M(Fe+JSON.stringify(t)):M(Be)}function Bn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return _o(t==="n",n)}}}function To(t){return Array.isArray(t)&&t.every(e=>Ne.has(e))}function So(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(s=>{xo(s)?(e=s,n.cleanMode=!0):n.options=n.options&&Eo(r[r.length]=`-${s}`)}),{cleanMode:e,options:r,valid:n}}function xo(t){return t==="f"||t==="n"}function Eo(t){return/^-[a-z]$/i.test(t)&&Ne.has(t.charAt(1))}function Po(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var Ie,Be,Fe,$t,Ne,Fn=l({"src/lib/tasks/clean.ts"(){"use strict";ko(),d(),E(),Ie="Git clean interactive mode is not supported",Be='Git clean mode parameter ("n" or "f") is required',Fe="Git clean unknown option found in: ",$t=(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))($t||{}),Ne=new Set(["i",...yn(Object.values($t))])}});function Co(t){let e=new Gn;for(let r of Nn(t))e.addValue(r.file,String(r.key),r.value);return e}function Ro(t,e){let r=null,n=[],s=new Map;for(let i of Nn(t,e))i.key===e&&(n.push(r=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(r));return{key:e,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function Oo(t){return t.replace(/^(file):/,"")}function*Nn(t,e=null){let r=t.split("\0");for(let n=0,s=r.length-1;n<s;){let i=Oo(r[n++]),o=r[n++],a=e;if(o.includes(`
|
|
50
|
+
`)){let c=mn(o,`
|
|
51
|
+
`);a=c[0],o=c[1]}yield{file:i,key:a,value:o}}}var Gn,Ao=l({"src/lib/responses/ConfigList.ts"(){"use strict";d(),Gn=class{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=et(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);n.hasOwnProperty(e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function ce(t,e){return typeof t=="string"&&ke.hasOwnProperty(t)?t:e}function $o(t,e,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(t,e),{commands:s,format:"utf-8",parser(i){return i}}}function Lo(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return Ro(n,t)}}}function Mo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return Co(r)}}}function jo(){return{addConfig(t,e,...r){return this._runTask($o(t,e,r[0]===!0,ce(r[1],"local")),x(arguments))},getConfig(t,e){return this._runTask(Lo(t,ce(e,void 0)),x(arguments))},listConfig(...t){return this._runTask(Mo(ce(t[0],void 0)),x(arguments))}}}var ke,Un=l({"src/lib/tasks/config.ts"(){"use strict";Ao(),d(),ke=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(ke||{})}});function Do(t){return qn.has(t)}var le,qn,Jn=l({"src/lib/tasks/diff-name-status.ts"(){"use strict";le=(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))(le||{}),qn=new Set(Object.values(le))}});function Io(...t){return new Vn().param(...t)}function Bo(t){let e=new Set,r={};return Re(t,n=>{let[s,i,o]=n.split(at);e.add(s),(r[s]=r[s]||[]).push({line:w(i),path:s,preview:o})}),{paths:e,results:r}}function Fo(){return{grep(t){let e=x(arguments),r=L(arguments);for(let s of zn)if(r.includes(s))return this._runTask(M(`git.grep: use of "${s}" is not supported.`),e);typeof t=="string"&&(t=Io().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(s){return Bo(s)}},e)}}}var zn,ht,Or,Vn,Qn=l({"src/lib/tasks/grep.ts"(){"use strict";d(),E(),zn=["-h"],ht=Symbol("grepQuery"),Vn=class{constructor(){this[Or]=[]}*[(Or=ht,Symbol.iterator)](){for(let t of this[ht])yield t}and(...t){return t.length&&this[ht].push("--and","(",...yt(t,"-e"),")"),this}param(...t){return this[ht].push(...yt(t,"-e")),this}}}}),Wn={};P(Wn,{ResetMode:()=>Lt,getResetMode:()=>Go,resetTask:()=>No});function No(t,e){let r=["reset"];return Hn(t)&&r.push(`--${t}`),r.push(...e),$(r)}function Go(t){if(Hn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function Hn(t){return Yn.includes(t)}var Lt,Yn,Kn=l({"src/lib/tasks/reset.ts"(){"use strict";E(),Lt=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Lt||{}),Yn=Array.from(Object.values(Lt))}});function Uo(){return(0,Bt.default)("simple-git")}function Ar(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...s)=>{t(n,...s),r(n,...s)}:t:(n,...s)=>{t(`%s ${n}`,e,...s),r&&r(n,...s)}}function qo(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Ge(t,e,r,n=Uo()){let s=t&&`[${t}]`||"",i=[],o=typeof e=="string"?n.extend(e):e,a=qo(J(e,O),o,n);return p(r);function c(v,b){return _(i,Ge(t,a.replace(/^[^:]+/,v),b,n))}function p(v){let b=v&&`[${v}]`||"",y=o&&Ar(o,b)||rt,f=Ar(n,`${s} ${b}`,y);return Object.assign(o?y:f,{label:t,sibling:c,info:f,step:p})}}var Xn=l({"src/lib/git-logger.ts"(){"use strict";d(),Bt.default.formatters.L=t=>String(Le(t)?t.length:"-"),Bt.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Tt(t)}}),Ot,we,Jo=l({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";K(),Xn(),Ot=class{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let e=Ot.getName(t.commands[0]),r=Ge(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 H(void 0,"TasksPendingQueue: attempt called for an unknown task");return e.logger("Starting task"),e}static getName(t="empty"){return`task:${t}:${++Ot.counter}`}},we=Ot,we.counter=0}});function tt(t,e){return{method:fn(t.commands)||"",commands:e}}function Vo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}function $r(t,e,r,n){return s=>{r("%s received %L bytes",e,s),n("%B",s),t.push(s)}}var Te,Qo=l({"src/lib/runners/git-executor-chain.ts"(){"use strict";K(),E(),d(),Jo(),Te=class{constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new we}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 dt(this,null,function*(){let e=yield this._scheduler.next(),r=()=>this._queue.complete(t);try{let{logger:n}=this._queue.attempt(t);return yield Dn(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n)}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}})}onFatalException(t,e){let r=e instanceof H?Object.assign(e,{task:t}):new H(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(t,e){return dt(this,null,function*(){let r=this._plugins.exec("spawn.binary","",tt(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],tt(t,t.commands)),s=yield this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),i=yield this.handleTaskData(t,n,s,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),jn(t)?ve(t.parser,i):ve(t.parser,i.asStrings())})}attemptEmptyTask(t,e){return dt(this,null,function*(){return e("empty task bypassing child process to call to task's parser"),t.parser(this)})}handleTaskData(t,e,r,n){let{exitCode:s,rejection:i,stdOut:o,stdErr:a}=r;return new Promise((c,p)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:v}=this._plugins.exec("task.error",{error:i},F(F({},tt(t,e)),r));if(v&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,v,b=>{n.info("custom error handler treated as success"),n("custom error returned a %s",Tt(b)),c(new bt(Array.isArray(b)?Buffer.concat(b):b,Buffer.concat(a)))},p);if(v)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,i),p(v);n.info("retrieving task output complete"),c(new bt(Buffer.concat(o),Buffer.concat(a)))})}gitResponse(t,e,r,n,s){return dt(this,null,function*(){let i=s.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},tt(t,t.commands));return new Promise(a=>{let c=[],p=[];s.info("%s %o",e,r),s("%O",o);let v=this._beforeSpawn(t,r);if(v)return a({stdOut:c,stdErr:p,exitCode:9901,rejection:v});this._plugins.exec("spawn.before",void 0,gt(F({},tt(t,r)),{kill(y){v=y||v}}));let b=zo(e,r,o);b.stdout.on("data",$r(c,"stdOut",s,i.step("stdOut"))),b.stderr.on("data",$r(p,"stdErr",s,i.step("stdErr"))),b.on("error",Vo(p,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(e,b.stdout,b.stderr,[...r])),this._plugins.exec("spawn.after",void 0,gt(F({},tt(t,r)),{spawned:b,close(y,f){a({stdOut:c,stdErr:p,exitCode:y,rejection:v||f})},kill(y){b.killed||(v=y,b.kill("SIGINT"))}}))})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,gt(F({},tt(t,e)),{kill(n){r=n||r}})),r}}}}),Zn={};P(Zn,{GitExecutor:()=>ts});var ts,Wo=l({"src/lib/runners/git-executor.ts"(){"use strict";Qo(),ts=class{constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new Te(this,this._scheduler,this._plugins)}chain(){return new Te(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function Ho(t,e,r=rt){let n=i=>{r(null,i)},s=i=>{i?.task===t&&r(i instanceof kt?Yo(i):i,void 0)};e.then(n,s)}function Yo(t){let e=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=rt};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,s){return s in t||(n[s]={enumerable:!1,configurable:!1,get(){return e(s),t.git[s]}}),n}}var Ko=l({"src/lib/task-callback.ts"(){"use strict";ut(),d()}});function Lr(t,e){return Ln(r=>{if(!Oe(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}var Xo=l({"src/lib/tasks/change-working-directory.ts"(){"use strict";d(),E()}});function pe(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=qt(e,"-B")),$(e)}function Zo(){return{checkout(){return this._runTask(pe(L(arguments,1)),x(arguments))},checkoutBranch(t,e){return this._runTask(pe(["-b",t,e,...L(arguments)]),x(arguments))},checkoutLocalBranch(t){return this._runTask(pe(["-b",t,...L(arguments)]),x(arguments))}}}var ta=l({"src/lib/tasks/checkout.ts"(){"use strict";d(),E()}});function ea(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function ra(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return j(ea(),[es],t)}})}}}var es,na=l({"src/lib/tasks/count-objects.ts"(){"use strict";d(),es=new g(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=gn(e);t.hasOwnProperty(n)&&(t[n]=w(r))})}});function sa(t){return j({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},rs,t)}var rs,ia=l({"src/lib/parsers/parse-commit.ts"(){"use strict";d(),rs=[new g(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new g(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new g(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new g(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let s=parseInt(r,10)||0;n==="-"?t.summary.deletions=s:n==="+"&&(t.summary.insertions=s)})]}});function oa(t,e,r){return{commands:["-c","core.abbrev=40","commit",...yt(t,"-m"),...e,...r],format:"utf-8",parser:sa}}function aa(){return{commit(e,...r){let n=x(arguments),s=t(e)||oa(q(e),q(J(r[0],It,[])),[...J(r[1],St,[]),...L(arguments,0,!0)]);return this._runTask(s,n)}};function t(e){return!It(e)&&M("git.commit: requires the commit message to be supplied as a string/string[]")}}var ua=l({"src/lib/tasks/commit.ts"(){"use strict";ia(),d(),E()}});function ca(){return{firstCommit(){return this._runTask($(["rev-list","--max-parents=0","HEAD"],!0),x(arguments))}}}var la=l({"src/lib/tasks/first-commit.ts"(){"use strict";d(),E()}});function pa(t,e){let r=["hash-object",t];return e&&r.push("-w"),$(r,!0)}var ma=l({"src/lib/tasks/hash-object.ts"(){"use strict";E()}});function fa(t,e,r){let n=String(r).trim(),s;if(s=ns.exec(n))return new Mt(t,e,!1,s[1]);if(s=ss.exec(n))return new Mt(t,e,!0,s[1]);let i="",o=n.split(" ");for(;o.length;)if(o.shift()==="in"){i=o.join(" ");break}return new Mt(t,e,/^re/i.test(n),i)}var Mt,ns,ss,ha=l({"src/lib/responses/InitSummary.ts"(){"use strict";Mt=class{constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},ns=/^Init.+ repository in (.+)$/,ss=/^Rein.+ in (.+)$/}});function da(t){return t.includes(Ue)}function ga(t=!1,e,r){let n=["init",...r];return t&&!da(n)&&n.splice(1,0,Ue),{commands:n,format:"utf-8",parser(s){return fa(n.includes("--bare"),e,s)}}}var Ue,ya=l({"src/lib/tasks/init.ts"(){"use strict";ha(),Ue="--bare"}});function qe(t){for(let e=0;e<t.length;e++){let r=Je.exec(t[e]);if(r)return`--${r[1]}`}return""}function va(t){return Je.test(t)}var Je,xt=l({"src/lib/args/log-format.ts"(){"use strict";Je=/^--(stat|numstat|name-only|name-status)(=|$)/}}),is,ba=l({"src/lib/responses/DiffSummary.ts"(){"use strict";is=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function os(t=""){let e=as[t];return r=>j(new is,e,r,!1)}var me,Mr,jr,Dr,as,us=l({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";xt(),ba(),Jn(),d(),me=[new g(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:w(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new g(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:w(r),after:w(n),binary:!0})}),new g(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);t.changed=w(e),t.insertions=w(n?.[1]),t.deletions=w(s?.[1])})],Mr=[new g(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let s=w(e),i=w(r);t.changed++,t.insertions+=s,t.deletions+=i,t.files.push({file:n,changes:s+i,insertions:s,deletions:i,binary:!1})}),new g(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],jr=[new g(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],Dr=[new g(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,s,i])=>{t.changed++,t.files.push({file:i??n,changes:0,insertions:0,deletions:0,binary:!1,status:ge(Do(e)&&e),from:ge(!!i&&n!==i&&n),similarity:w(r)})})],as={"":me,"--stat":me,"--numstat":Mr,"--name-status":Dr,"--name-only":jr}}});function _a(t,e){return e.reduce((r,n,s)=>(r[n]=t[s]||"",r),Object.create({diff:null}))}function cs(t=Qe,e=ls,r=""){let n=os(r);return function(s){let i=wt(s.trim(),!1,ze).map(function(o){let a=o.split(Ve),c=_a(a[0].split(t),e);return a.length>1&&a[1].trim()&&(c.diff=n(a[1])),c});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var ze,Ve,Qe,ls,ps=l({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";d(),us(),xt(),ze="\xF2\xF2\xF2\xF2\xF2\xF2 ",Ve=" \xF2\xF2",Qe=" \xF2 ",ls=["hash","date","message","refs","author_name","author_email"]}}),ms={};P(ms,{diffSummaryTask:()=>ka,validateLogFormatConfig:()=>Qt});function ka(t){let e=qe(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),Qt(r)||{commands:r,format:"utf-8",parser:os(e)}}function Qt(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'`)}var We=l({"src/lib/tasks/diff.ts"(){"use strict";xt(),us(),E()}});function wa(t,e){let r=[],n=[];return Object.keys(t).forEach(s=>{r.push(s),n.push(String(t[s]))}),[r,n.join(e)]}function Ta(t){return Object.keys(t).reduce((e,r)=>(r in Se||(e[r]=t[r]),e),{})}function fs(t={},e=[]){let r=J(t.splitter,O,Qe),n=!Ae(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"},[s,i]=wa(n,r),o=[],a=[`--pretty=format:${ze}${i}${Ve}`,...e],c=t.n||t["max-count"]||t.maxCount;if(c&&a.push(`--max-count=${c}`),t.from||t.to){let p=t.symmetric!==!1?"...":"..";o.push(`${t.from||""}${p}${t.to||""}`)}return O(t.file)&&a.push("--follow",co(t.file)),Me(Ta(t),a),{fields:s,splitter:r,commands:[...a,...o]}}function Sa(t,e,r){let n=cs(t,e,qe(r));return{commands:["log",...r],format:"utf-8",parser:n}}function xa(){return{log(...r){let n=x(arguments),s=fs(je(arguments),J(arguments[0],St)),i=e(...r)||Qt(s.commands)||t(s);return this._runTask(i,n)}};function t(r){return Sa(r.splitter,r.fields,r.commands)}function e(r,n){return O(r)&&O(n)&&M("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Se,hs=l({"src/lib/tasks/log.ts"(){"use strict";xt(),_t(),ps(),d(),E(),We(),Se=(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))(Se||{})}}),jt,ds,Ea=l({"src/lib/responses/MergeSummary.ts"(){"use strict";jt=class{constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},ds=class{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"}}}}),xe,gs,Pa=l({"src/lib/responses/PullSummary.ts"(){"use strict";xe=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},gs=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function fe(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Ir(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:w(e&&e[1]||"0"),delta:w(r&&r[1]||"0")}}var ys,Ca=l({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";d(),ys=[new Y(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),s=fe(t.remoteMessages);Object.assign(s,{[n]:w(r)})}),new Y(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),s=fe(t.remoteMessages);Object.assign(s,{[n]:w(r)})}),new Y(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let s=fe(t.remoteMessages);s.total=Ir(e),s.reused=Ir(r),s.packReused=w(n)})]}});function vs(t,e){return j({remoteMessages:new _s},bs,e)}var bs,_s,ks=l({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";d(),Ca(),bs=[new Y(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...ys,new Y([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Y([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:w(e),summary:r,url:n}})],_s=class{constructor(){this.all=[]}}}});function Ra(t,e){let r=j(new gs,ws,[t,e]);return r.message&&r}var Br,Fr,Nr,Gr,ws,Ur,He,Ts=l({"src/lib/parsers/parse-pull.ts"(){"use strict";Pa(),d(),ks(),Br=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Fr=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Nr=/^(create|delete) mode \d+ (.+)/,Gr=[new g(Br,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new g(Fr,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new g(Nr,(t,[e,r])=>{_(t.files,r),_(e==="create"?t.created:t.deleted,r)})],ws=[new g(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new g(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new g(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,s])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=s,t.hash.remote=r})],Ur=(t,e)=>j(new xe,Gr,[t,e]),He=(t,e)=>Object.assign(new xe,Ur(t,e),vs(t,e))}}),qr,Ss,Jr,Oa=l({"src/lib/parsers/parse-merge.ts"(){"use strict";Ea(),d(),Ts(),qr=[new g(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new g(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new jt(e,r))}),new g(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new jt(e,r,{deleteRef:n}))}),new g(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new jt(e,null))}),new g(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],Ss=(t,e)=>Object.assign(Jr(t,e),He(t,e)),Jr=t=>j(new ds,qr,t)}});function zr(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=Ss(e,r);if(n.failed)throw new kt(n);return n}}:M("Git.merge requires at least one option")}var Aa=l({"src/lib/tasks/merge.ts"(){"use strict";ut(),Oa(),E()}});function $a(t,e,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(t),i=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:t,remote:e}}var Vr,xs,Qr,La=l({"src/lib/parsers/parse-push.ts"(){"use strict";d(),ks(),Vr=[new g(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new g(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref=gt(F({},t.ref||{}),{local:e})}),new g(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push($a(e,r,n))}),new g(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch=gt(F({},t.branch||{}),{local:e,remote:r,remoteName:n})}),new g(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,s])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:s}}})],xs=(t,e)=>{let r=Qr(t,e),n=vs(t,e);return F(F({},r),n)},Qr=(t,e)=>j({pushed:[]},Vr,[t,e])}}),Es={};P(Es,{pushTagsTask:()=>Ma,pushTask:()=>Ye});function Ma(t={},e){return _(e,"--tags"),Ye(t,e)}function Ye(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),qt(r,"-v"),_(r,"--verbose"),_(r,"--porcelain"),{commands:r,format:"utf-8",parser:xs}}var Ps=l({"src/lib/tasks/push.ts"(){"use strict";La(),d()}});function ja(){return{showBuffer(){let t=["show",...L(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(Mn(t),x(arguments))},show(){let t=["show",...L(arguments,1)];return this._runTask($(t),x(arguments))}}}var Da=l({"src/lib/tasks/show.ts"(){"use strict";d(),E()}}),Wr,Cs,Ia=l({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Wr=/^(.+)\0(.+)$/,Cs=class{constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let n=Wr.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function Hr(t){let[e,r]=t.split(at);return{from:r||e,to:e}}function I(t,e,r){return[`${t}${e}`,r]}function he(t,...e){return e.map(r=>I(t,r,(n,s)=>_(n.conflicted,s)))}function Ba(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,i,o){let a=`${s}${i}`,c=Rs.get(a);c&&c(t,o),a!=="##"&&a!=="!!"&&t.files.push(new Cs(o,s,i))}}var Yr,Rs,Os,Fa=l({"src/lib/responses/StatusSummary.ts"(){"use strict";d(),Ia(),Yr=class{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}},Rs=new Map([I(" ","A",(t,e)=>_(t.created,e)),I(" ","D",(t,e)=>_(t.deleted,e)),I(" ","M",(t,e)=>_(t.modified,e)),I("A"," ",(t,e)=>_(t.created,e)&&_(t.staged,e)),I("A","M",(t,e)=>_(t.created,e)&&_(t.staged,e)&&_(t.modified,e)),I("D"," ",(t,e)=>_(t.deleted,e)&&_(t.staged,e)),I("M"," ",(t,e)=>_(t.modified,e)&&_(t.staged,e)),I("M","M",(t,e)=>_(t.modified,e)&&_(t.staged,e)),I("R"," ",(t,e)=>{_(t.renamed,Hr(e))}),I("R","M",(t,e)=>{let r=Hr(e);_(t.renamed,r),_(t.modified,r.to)}),I("!","!",(t,e)=>{_(t.ignored=t.ignored||[],e)}),I("?","?",(t,e)=>_(t.not_added,e)),...he("A","A","U"),...he("D","D","U"),...he("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,i=/\.{3}(\S*)/,o=/\son\s([\S]+)$/,a;a=r.exec(e),t.ahead=a&&+a[1]||0,a=n.exec(e),t.behind=a&&+a[1]||0,a=s.exec(e),t.current=a&&a[1],a=i.exec(e),t.tracking=a&&a[1],a=o.exec(e),t.current=a&&a[1]||t.current,t.detached=/\(no branch\)/.test(e)}]]),Os=function(t){let e=t.split(at),r=new Yr;for(let n=0,s=e.length;n<s;){let i=e[n++].trim();i&&(i.charAt(0)==="R"&&(i+=at+(e[n++]||"")),Ba(r,i))}return r}}});function Na(t){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...t.filter(r=>!As.includes(r))],parser(r){return Os(r)}}}var As,Ga=l({"src/lib/tasks/status.ts"(){"use strict";Fa(),As=["--null","-z"]}});function Ft(t=0,e=0,r=0,n="",s=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function Ua(){return Ft(0,0,0,"",!1)}function qa(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:Ja,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(Ke));n(e)}})}}}function Ja(t){return t===Ke?Ua():j(Ft(0,0,0,t),$s,t)}var Ke,$s,za=l({"src/lib/tasks/version.ts"(){"use strict";d(),Ke="installed=false",$s=[new g(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,s=""])=>{Object.assign(t,Ft(w(e),w(r),w(n),s))}),new g(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,s=""])=>{Object.assign(t,Ft(w(e),w(r),n,s))})]}}),Ls={};P(Ls,{SimpleGitApi:()=>Ee});var Ee,Va=l({"src/lib/simple-git-api.ts"(){"use strict";Ko(),Xo(),ta(),na(),ua(),Un(),la(),Qn(),ma(),ya(),hs(),Aa(),Ps(),Da(),Ga(),E(),za(),d(),Ee=class{constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&Ho(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask($(["add",...q(t)]),x(arguments))}cwd(t){let e=x(arguments);return typeof t=="string"?this._runTask(Lr(t,this._executor),e):typeof t?.path=="string"?this._runTask(Lr(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(pa(t,e===!0),x(arguments))}init(t){return this._runTask(ga(t===!0,this._executor.cwd,L(arguments)),x(arguments))}merge(){return this._runTask(zr(L(arguments)),x(arguments))}mergeFromTo(t,e){return O(t)&&O(e)?this._runTask(zr([t,e,...L(arguments)]),x(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=Ye({remote:J(arguments[0],O),branch:J(arguments[1],O)},L(arguments));return this._runTask(t,x(arguments))}stash(){return this._runTask($(["stash",...L(arguments)]),x(arguments))}status(){return this._runTask(Na(L(arguments)),x(arguments))}},Object.assign(Ee.prototype,Zo(),aa(),jo(),ra(),ca(),Fo(),xa(),ja(),qa())}}),Ms={};P(Ms,{Scheduler:()=>Ds});var Kr,Ds,Qa=l({"src/lib/runners/scheduler.ts"(){"use strict";d(),Xn(),Kr=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,js.createDeferred)();return{promise:e,done:r,id:t}}})(),Ds=class{constructor(t=2){this.concurrency=t,this.logger=Ge("","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),qt(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=_(this.pending,Kr());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),Is={};P(Is,{applyPatchTask:()=>Wa});function Wa(t,e){return $(["apply",...e,...t])}var Ha=l({"src/lib/tasks/apply-patch.ts"(){"use strict";E()}});function Ya(t,e){return{branch:t,hash:e,success:!0}}function Ka(t){return{branch:t,hash:null,success:!1}}var Bs,Xa=l({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Bs=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Fs(t,e){return e===1&&Pe.test(t)}var Xr,Pe,Zr,Wt,Za=l({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";Xa(),d(),Xr=/(\S+)\s+\(\S+\s([^)]+)\)/,Pe=/^error[^']+'([^']+)'/m,Zr=[new g(Xr,(t,[e,r])=>{let n=Ya(e,r);t.all.push(n),t.branches[e]=n}),new g(Pe,(t,[e])=>{let r=Ka(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],Wt=(t,e)=>j(new Bs,Zr,[t,e])}}),Ns,tu=l({"src/lib/responses/BranchSummary.ts"(){"use strict";Ns=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,s){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:s}}}}});function tn(t){return t?t.charAt(0):""}function Gs(t){return j(new Ns,Us,t)}var Us,eu=l({"src/lib/parsers/parse-branch.ts"(){"use strict";tu(),d(),Us=[new g(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,s])=>{t.push(tn(e),!0,r,n,s)}),new g(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(t,[e,r,n,s])=>{t.push(tn(e),!1,r,n,s)})]}}),qs={};P(qs,{branchLocalTask:()=>nu,branchTask:()=>ru,containsDeleteBranchCommand:()=>Js,deleteBranchTask:()=>iu,deleteBranchesTask:()=>su});function Js(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}function ru(t){let e=Js(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(n,s){return e?Wt(n,s).all[0]:Gs(n)}}}function nu(){return{format:"utf-8",commands:["branch","-v"],parser:Gs}}function su(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return Wt(r,n)},onError({exitCode:r,stdOut:n},s,i,o){if(!Fs(String(s),r))return o(s);i(n)}}}function iu(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,s){return Wt(n,s).branches[t]},onError({exitCode:n,stdErr:s,stdOut:i},o,a,c){if(!Fs(String(o),n))return c(o);throw new kt(r.parser(vt(i),vt(s)),String(o))}};return r}var ou=l({"src/lib/tasks/branch.ts"(){"use strict";ut(),Za(),eu(),d()}}),zs,au=l({"src/lib/responses/CheckIgnore.ts"(){"use strict";zs=t=>t.split(/\n/g).map(e=>e.trim()).filter(e=>!!e)}}),Vs={};P(Vs,{checkIgnoreTask:()=>uu});function uu(t){return{commands:["check-ignore",...t],format:"utf-8",parser:zs}}var cu=l({"src/lib/tasks/check-ignore.ts"(){"use strict";au()}}),Qs={};P(Qs,{cloneMirrorTask:()=>pu,cloneTask:()=>Ws});function lu(t){return/^--upload-pack(=|$)/.test(t)}function Ws(t,e,r){let n=["clone",...r];return O(t)&&n.push(t),O(e)&&n.push(e),n.find(lu)?M("git.fetch: potential exploit argument blocked."):$(n)}function pu(t,e,r){return _(r,"--mirror"),Ws(t,e,r)}var mu=l({"src/lib/tasks/clone.ts"(){"use strict";E(),d()}});function fu(t,e){return j({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},Hs,[t,e])}var Hs,hu=l({"src/lib/parsers/parse-fetch.ts"(){"use strict";d(),Hs=[new g(/From (.+)$/,(t,[e])=>{t.remote=e}),new g(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new g(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new g(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new g(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,s])=>{t.updated.push({name:n,tracking:s,to:r,from:e})})]}}),Ys={};P(Ys,{fetchTask:()=>gu});function du(t){return/^--upload-pack(=|$)/.test(t)}function gu(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(du)?M("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:fu}}var yu=l({"src/lib/tasks/fetch.ts"(){"use strict";hu(),E()}});function vu(t){return j({moves:[]},Ks,t)}var Ks,bu=l({"src/lib/parsers/parse-move.ts"(){"use strict";d(),Ks=[new g(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),Xs={};P(Xs,{moveTask:()=>_u});function _u(t,e){return{commands:["mv","-v",...q(t),e],format:"utf-8",parser:vu}}var ku=l({"src/lib/tasks/move.ts"(){"use strict";bu(),d()}}),Zs={};P(Zs,{pullTask:()=>wu});function wu(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(s,i){return He(s,i)},onError(s,i,o,a){let c=Ra(vt(s.stdOut),vt(s.stdErr));if(c)return a(new kt(c));a(i)}}}var Tu=l({"src/lib/tasks/pull.ts"(){"use strict";ut(),Ts(),d()}});function Su(t){let e={};return ti(t,([r])=>e[r]={name:r}),Object.values(e)}function xu(t){let e={};return ti(t,([r,n,s])=>{e.hasOwnProperty(r)||(e[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(e[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}function ti(t,e){Re(t,r=>e(r.split(/\s+/)))}var Eu=l({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";d()}}),ei={};P(ei,{addRemoteTask:()=>Pu,getRemotesTask:()=>Cu,listRemotesTask:()=>Ru,remoteTask:()=>Ou,removeRemoteTask:()=>Au});function Pu(t,e,r){return $(["remote","add",...r,t,e])}function Cu(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?xu:Su}}function Ru(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),$(e)}function Ou(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),$(e)}function Au(t){return $(["remote","remove",t])}var $u=l({"src/lib/tasks/remote.ts"(){"use strict";Eu(),E()}}),ri={};P(ri,{stashListTask:()=>Lu});function Lu(t={},e){let r=fs(t),n=["stash","list",...r.commands,...e],s=cs(r.splitter,r.fields,qe(n));return Qt(n)||{commands:n,format:"utf-8",parser:s}}var Mu=l({"src/lib/tasks/stash-list.ts"(){"use strict";xt(),ps(),We(),hs()}}),ni={};P(ni,{addSubModuleTask:()=>ju,initSubModuleTask:()=>Du,subModuleTask:()=>Ht,updateSubModuleTask:()=>Iu});function ju(t,e){return Ht(["add",t,e])}function Du(t){return Ht(["init",...t])}function Ht(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),$(e)}function Iu(t){return Ht(["update",...t])}var Bu=l({"src/lib/tasks/sub-module.ts"(){"use strict";E()}});function Fu(t,e){let r=isNaN(t),n=isNaN(e);return r!==n?r?1:-1:r?si(t,e):0}function si(t,e){return t===e?0:t>e?1:-1}function Nu(t){return t.trim()}function At(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var en,ii,Gu=l({"src/lib/responses/TagList.ts"(){"use strict";en=class{constructor(t,e){this.all=t,this.latest=e}},ii=function(t,e=!1){let r=t.split(`
|
|
52
|
+
`).map(Nu).filter(Boolean);e||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return Fu(At(o[0]),At(a[0]));for(let c=0,p=Math.max(o.length,a.length);c<p;c++){let v=si(At(o[c]),At(a[c]));if(v)return v}return 0});let n=e?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new en(r,n)}}}),oi={};P(oi,{addAnnotatedTagTask:()=>Ju,addTagTask:()=>qu,tagListTask:()=>Uu});function Uu(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return ii(r,e)}}}function qu(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function Ju(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var zu=l({"src/lib/tasks/tag.ts"(){"use strict";Gu()}}),Vu=ao({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(Wo(),S(Zn)),{SimpleGitApi:n}=(Va(),S(Ls)),{Scheduler:s}=(Qa(),S(Ms)),{configurationErrorTask:i}=(E(),S(_e)),{asArray:o,filterArray:a,filterPrimitives:c,filterString:p,filterStringOrStringArray:v,filterType:b,getTrailingOptions:y,trailingFunctionArgument:f,trailingOptionsArgument:X}=(d(),S(Sn)),{applyPatchTask:hi}=(Ha(),S(Is)),{branchTask:di,branchLocalTask:gi,deleteBranchesTask:yi,deleteBranchTask:vi}=(ou(),S(qs)),{checkIgnoreTask:bi}=(cu(),S(Vs)),{checkIsRepoTask:_i}=(Cn(),S(xn)),{cloneTask:ki,cloneMirrorTask:wi}=(mu(),S(Qs)),{cleanWithOptionsTask:Ti,isCleanOptionsArray:Si}=(Fn(),S(In)),{diffSummaryTask:xi}=(We(),S(ms)),{fetchTask:Ei}=(yu(),S(Ys)),{moveTask:Pi}=(ku(),S(Xs)),{pullTask:Ci}=(Tu(),S(Zs)),{pushTagsTask:Ri}=(Ps(),S(Es)),{addRemoteTask:Oi,getRemotesTask:Ai,listRemotesTask:$i,remoteTask:Li,removeRemoteTask:Mi}=($u(),S(ei)),{getResetMode:ji,resetTask:Di}=(Kn(),S(Wn)),{stashListTask:Ii}=(Mu(),S(ri)),{addSubModuleTask:Bi,initSubModuleTask:Fi,subModuleTask:Ni,updateSubModuleTask:Gi}=(Bu(),S(ni)),{addAnnotatedTagTask:Ui,addTagTask:qi,tagListTask:Ji}=(zu(),S(oi)),{straightThroughBufferTask:zi,straightThroughStringTask:U}=(E(),S(_e));function h(u,m){this._plugins=m,this._executor=new r(u.baseDir,new s(u.maxConcurrentProcesses),m),this._trimmed=u.trimmed}(h.prototype=Object.create(n.prototype)).constructor=h,h.prototype.customBinary=function(u){return this._plugins.reconfigure("binary",u),this},h.prototype.env=function(u,m){return arguments.length===1&&typeof u=="object"?this._executor.env=u:(this._executor.env=this._executor.env||{})[u]=m,this},h.prototype.stashList=function(u){return this._runTask(Ii(X(arguments)||{},a(u)&&u||[]),f(arguments))};function Ze(u,m,k,A){return typeof k!="string"?i(`git.${u}() requires a string 'repoPath'`):m(k,b(A,p),y(arguments))}h.prototype.clone=function(){return this._runTask(Ze("clone",ki,...arguments),f(arguments))},h.prototype.mirror=function(){return this._runTask(Ze("mirror",wi,...arguments),f(arguments))},h.prototype.mv=function(u,m){return this._runTask(Pi(u,m),f(arguments))},h.prototype.checkoutLatestTag=function(u){var m=this;return this.pull(function(){m.tags(function(k,A){m.checkout(A.latest,u)})})},h.prototype.pull=function(u,m,k,A){return this._runTask(Ci(b(u,p),b(m,p),y(arguments)),f(arguments))},h.prototype.fetch=function(u,m){return this._runTask(Ei(b(u,p),b(m,p),y(arguments)),f(arguments))},h.prototype.silent=function(u){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},h.prototype.tags=function(u,m){return this._runTask(Ji(y(arguments)),f(arguments))},h.prototype.rebase=function(){return this._runTask(U(["rebase",...y(arguments)]),f(arguments))},h.prototype.reset=function(u){return this._runTask(Di(ji(u),y(arguments)),f(arguments))},h.prototype.revert=function(u){let m=f(arguments);return typeof u!="string"?this._runTask(i("Commit must be a string"),m):this._runTask(U(["revert",...y(arguments,0,!0),u]),m)},h.prototype.addTag=function(u){let m=typeof u=="string"?qi(u):i("Git.addTag requires a tag name");return this._runTask(m,f(arguments))},h.prototype.addAnnotatedTag=function(u,m){return this._runTask(Ui(u,m),f(arguments))},h.prototype.deleteLocalBranch=function(u,m,k){return this._runTask(vi(u,typeof m=="boolean"?m:!1),f(arguments))},h.prototype.deleteLocalBranches=function(u,m,k){return this._runTask(yi(u,typeof m=="boolean"?m:!1),f(arguments))},h.prototype.branch=function(u,m){return this._runTask(di(y(arguments)),f(arguments))},h.prototype.branchLocal=function(u){return this._runTask(gi(),f(arguments))},h.prototype.raw=function(u){let m=!Array.isArray(u),k=[].slice.call(m?arguments:u,0);for(let N=0;N<k.length&&m;N++)if(!c(k[N])){k.splice(N,k.length-N);break}k.push(...y(arguments,0,!0));var A=f(arguments);return k.length?this._runTask(U(k,this._trimmed),A):this._runTask(i("Raw: must supply one or more command to execute"),A)},h.prototype.submoduleAdd=function(u,m,k){return this._runTask(Bi(u,m),f(arguments))},h.prototype.submoduleUpdate=function(u,m){return this._runTask(Gi(y(arguments,!0)),f(arguments))},h.prototype.submoduleInit=function(u,m){return this._runTask(Fi(y(arguments,!0)),f(arguments))},h.prototype.subModule=function(u,m){return this._runTask(Ni(y(arguments)),f(arguments))},h.prototype.listRemote=function(){return this._runTask($i(y(arguments)),f(arguments))},h.prototype.addRemote=function(u,m,k){return this._runTask(Oi(u,m,y(arguments)),f(arguments))},h.prototype.removeRemote=function(u,m){return this._runTask(Mi(u),f(arguments))},h.prototype.getRemotes=function(u,m){return this._runTask(Ai(u===!0),f(arguments))},h.prototype.remote=function(u,m){return this._runTask(Li(y(arguments)),f(arguments))},h.prototype.tag=function(u,m){let k=y(arguments);return k[0]!=="tag"&&k.unshift("tag"),this._runTask(U(k),f(arguments))},h.prototype.updateServerInfo=function(u){return this._runTask(U(["update-server-info"]),f(arguments))},h.prototype.pushTags=function(u,m){let k=Ri({remote:b(u,p)},y(arguments));return this._runTask(k,f(arguments))},h.prototype.rm=function(u){return this._runTask(U(["rm","-f",...o(u)]),f(arguments))},h.prototype.rmKeepLocal=function(u){return this._runTask(U(["rm","--cached",...o(u)]),f(arguments))},h.prototype.catFile=function(u,m){return this._catFile("utf-8",arguments)},h.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},h.prototype._catFile=function(u,m){var k=f(m),A=["cat-file"],N=m[0];if(typeof N=="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),k);Array.isArray(N)&&A.push.apply(A,N);let Xt=u==="buffer"?zi(A):U(A);return this._runTask(Xt,k)},h.prototype.diff=function(u,m){let k=p(u)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):U(["diff",...y(arguments)]);return this._runTask(k,f(arguments))},h.prototype.diffSummary=function(){return this._runTask(xi(y(arguments,1)),f(arguments))},h.prototype.applyPatch=function(u){let m=v(u)?hi(o(u),y([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(m,f(arguments))},h.prototype.revparse=function(){let u=["rev-parse",...y(arguments,!0)];return this._runTask(U(u,!0),f(arguments))},h.prototype.clean=function(u,m,k){let A=Si(u),N=A&&u.join("")||b(u,p)||"",Xt=y([].slice.call(arguments,A?1:0));return this._runTask(Ti(N,Xt),f(arguments))},h.prototype.exec=function(u){let m={commands:[],format:"utf-8",parser(){typeof u=="function"&&u()}};return this._runTask(m)},h.prototype.clearQueue=function(){return this},h.prototype.checkIgnore=function(u,m){return this._runTask(bi(o(b(u,v,[]))),f(arguments))},h.prototype.checkIsRepo=function(u,m){return this._runTask(_i(b(u,p)),f(arguments))},e.exports=h}});_t();K();var Qu=class extends H{constructor(t,e){super(void 0,e),this.config=t}};K();K();var W=class extends H{constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};ut();cn();Cn();Fn();Un();Jn();Qn();Kn();function Wu(t){return t?[{type:"spawn.before",action(n,s){t.aborted&&s.kill(new W(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function i(){s.kill(new W(void 0,"abort","Abort signal received"))}t.addEventListener("abort",i),s.spawned.on("close",()=>t.removeEventListener("abort",i))}}]:void 0}function Hu(t){return typeof t=="string"&&t.trim().toLowerCase()==="-c"}function Yu(t,e){if(Hu(t)&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new W(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function Ku(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new W(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 W(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 W(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function Xu({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,i)=>{let o=i<r.length?r[i+1]:"";t||Yu(s,o),e||Ku(s,n.method)}),r}}}d();function Zu(t){let e=yt(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}d();var rn=(0,ot.deferred)().promise;function tc({onClose:t=!0,onExit:e=50}={}){function r(){let s=-1,i={close:(0,ot.deferred)(),closeTimeout:(0,ot.deferred)(),exit:(0,ot.deferred)(),exitTimeout:(0,ot.deferred)()},o=Promise.race([t===!1?rn:i.closeTimeout.promise,e===!1?rn:i.exitTimeout.promise]);return n(t,i.close,i.closeTimeout),n(e,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function n(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>de(s))).then(o.done)}return{type:"spawn.after",action(s,i){return dt(this,arguments,function*(o,{spawned:a,close:c}){var p,v;let b=r(),y=!0,f=()=>void(y=!1);(p=a.stdout)==null||p.on("data",f),(v=a.stderr)==null||v.on("data",f),a.on("error",f),a.on("close",X=>b.close(X)),a.on("exit",X=>b.exit(X));try{yield b.result,y&&(yield de(50)),c(b.exitCode)}catch(X){c(b.exitCode,X)}})}}}d();var ec="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",nn="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)}function sn(t,e){if(t.length<1||t.length>2)throw new W(void 0,"binary",ec);if(t.some(rc))if(e)console.warn(nn);else throw new W(void 0,"binary",nn);let[n,s]=t;return{binary:n,prefix:s}}function nc(t,e=["git"],r=!1){let n=sn(q(e),r);t.on("binary",s=>{n=sn(q(s),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}K();function sc(t){return!!(t.exitCode&&t.stdErr.length)}function ic(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function oc(t=!1,e=sc,r=ic){return(n,s)=>!t&&n||!e(s)?n:r(s)}function on(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new H(void 0,n.toString("utf-8"))}:{error:n}}}}d();var uc=class{constructor(){this.plugins=new Set,this.events=new ac}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 q(t).forEach(r=>r&&this.plugins.add(_(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,s=Object.freeze(Object.create(r));for(let i of this.plugins)i.type===t&&(n=i.action(n,s));return n}};d();function cc(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return r.includes(o.method)?dn(i,e):i}},{type:"spawn.after",action(i,o){var a;o.commands.includes(e)&&((a=o.spawned.stderr)==null||a.on("data",c=>{let p=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));p&&t({method:o.method,stage:lc(p[1]),progress:w(p[2]),processed:w(p[3]),total:w(p[4])})}))}}]}function lc(t){return String(t.toLowerCase().split(" ",1))||"unknown"}d();function pc(t){let e=vn(t,["uid","gid"]);return{type:"spawn.options",action(r){return F(F({},e),r)}}}function mc({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,s){var i,o;let a;function c(){a&&clearTimeout(a),a=setTimeout(v,t)}function p(){var b,y;(b=s.spawned.stdout)==null||b.off("data",c),(y=s.spawned.stderr)==null||y.off("data",c),s.spawned.off("exit",p),s.spawned.off("close",p),a&&clearTimeout(a)}function v(){p(),s.kill(new W(void 0,"timeout","block timeout reached"))}r&&((i=s.spawned.stdout)==null||i.on("data",c)),e&&((o=s.spawned.stderr)==null||o.on("data",c)),s.spawned.on("exit",p),s.spawned.on("close",p),c()}}}_t();function fc(){return{type:"spawn.args",action(t){let e=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<t.length;s++){let i=t[s];if(Dt(i)){n(Rr(i));continue}if(i==="--"){n(t.slice(s+1).flatMap(o=>Dt(o)&&Rr(o)||o));break}e.push(i)}return r?[...e,"--",...r.map(String)]:e}}}d();var hc=Vu();function dc(t,e){var r;let n=new uc,s=wn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!Oe(s.baseDir))throw new Qu(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(Zu(s.config)),n.add(Xu(s.unsafe)),n.add(fc()),n.add(tc(s.completion)),s.abort&&n.add(Wu(s.abort)),s.progress&&n.add(cc(s.progress)),s.timeout&&n.add(mc(s.timeout)),s.spawnOptions&&n.add(pc(s.spawnOptions)),n.add(on(oc(!0))),s.errors&&n.add(on(s.errors)),nc(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new hc(s,n)}ut();var ai=dc;C();var ui=(t,e)=>{let r=/^(https:\/\/)?(?<slug>[\w-]+?)(--development)?(\..*)?$/.exec(t)?.groups?.slug;if(r)return r;throw new V(T`
|
|
53
|
+
${e} must be the application's {bold slug} or {bold URL}
|
|
54
|
+
|
|
55
|
+
{bold EXAMPLES:}
|
|
56
|
+
${e} my-app
|
|
57
|
+
${e} my-app.gadget.app
|
|
58
|
+
${e} https://my-app.gadget.app
|
|
59
|
+
${e} https://my-app.gadget.app/edit
|
|
60
|
+
${e} https://my-app--development.gadget.app/edit
|
|
61
|
+
`)};C();import Xe from"node:assert";var Yt=class{ctx;#t;constructor(e,r){this.ctx=e.child({name:"edit"}),this.#t=new hr(this.ctx,r,"/edit/api/graphql")}async query({query:e,variables:r,...n}){let s=/query (\w+)/.exec(e)?.[1];Xe(s,"query name not found");let i=this.ctx.child({name:"edit",fields:{edit:{query:s}},devFields:{edit:{query:s,variables:lt(r)}}});i.log.info("executing graphql query");let o=await this.#t.execute(i,{operation:e,variables:r,...n,http:{retry:{methods:["POST"]},...n.http}});if(o.errors)throw new Q(e,o.errors);if(!o.data)throw new Q(e,"Query response did not contain data");return o.data}async mutate({mutation:e,variables:r,...n}){let s=/mutation (\w+)/.exec(e)?.[1];Xe(s,"mutation name not found");let i=this.ctx.child({name:"edit",fields:{edit:{mutation:s}},devFields:{edit:{mutation:s,variables:lt(r)}}});i.log.info("executing graphql mutation");let o=await this.#t.execute(i,{operation:e,variables:r,...n});if(o.errors)throw new Q(e,o.errors);if(!o.data)throw new Q(e,"Mutation response did not contain data");return o.data}subscribe({onData:e,...r}){let n=/subscription (\w+)/.exec(r.subscription)?.[1];Xe(n,"subscription name not found");let s=this.ctx.child({name:"edit",fields:{edit:{subscription:n}},devFields:{edit:{subscription:n,variables:lt(r.variables)}}}),i=async a=>{if(a.errors){o(),await r.onError(new Q(r.subscription,a.errors));return}if(!a.data){o(),await r.onError(new Q(r.subscription,"Subscription response did not contain data"));return}await e(a.data)};s.log.info("subscribing to graphql subscription");let o=this.#t.subscribe(s,{...r,onResponse:i});return{unsubscribe:()=>{o()},resubscribe:a=>{o(),a!==void 0&&(r.variables=a),s=this.ctx.child({name:"edit",fields:{edit:{subscription:n}},devFields:{edit:{subscription:n,variables:lt(r.variables)}}}),s.log.info("re-subscribing to graphql subscription"),o=this.#t.subscribe(s,{...r,onResponse:i})}}}async dispose(){await this.#t.dispose()}};var yp={"--app":{type:ui,alias:["-a","--application"]},"--env":{type:String,alias:["-e","--environment"]},"--allow-unknown-directory":Boolean,"--allow-different-app":Boolean},pi=class t{constructor(e,r,n,s,i,o){this.ctx=e;this.args=r;this.directory=n;this.environment=s;this.previousEnvironment=i;this.state=o;this.ctx=e.child({name:"sync-json",fields:()=>({syncJson:{directory:this.directory.path,branch:this.gitBranch,...this.state}})}),this.edit=new Yt(this.ctx,this.environment)}gitBranch;edit;get filesVersion(){let e=this.state.environments[this.state.environment];return ci(e,"environment must exist in environments"),BigInt(e.filesVersion)}static async load(e,{command:r,args:n,directory:s}){e=e.child({name:"sync-json"});let i=await br(e,r),o=await re(e);if(o.length===0)throw new V(T`
|
|
62
|
+
You (${i.email}) don't have have any Gadget applications.
|
|
63
|
+
|
|
64
|
+
Visit https://gadget.new to create one!
|
|
65
|
+
`);let a=await Kt.default.readFile(s.absolute(".gadget/sync.json"),"utf8").catch(f=>e.log.warn("failed to read .gadget/sync.json",{error:f}));if(!a)return;let c;try{c=_c.parse(JSON.parse(a))}catch(f){e.log.warn("failed to parse .gadget/sync.json",{error:f,syncJsonFile:a});return}let p=await mi({args:n,availableApps:o,state:c}),v=await fi({command:r,args:n,application:p,state:c});if(pr({application_id:p.id,environment_id:v.id}),c.application!==p.slug){if(n["--allow-different-app"]){let f=new t(e,n,s,v,void 0,{application:p.slug,environment:v.name,environments:{[v.name]:{filesVersion:"0"}}});return await f.loadGitBranch(),f}throw new V(T`
|
|
66
|
+
You were about to sync the following app to the following directory:
|
|
67
|
+
|
|
68
|
+
${p.slug} (${v.name}) → ${s.path}
|
|
69
|
+
|
|
70
|
+
However, that directory has already been synced with this app:
|
|
71
|
+
|
|
72
|
+
${c.application} (${c.environment})
|
|
73
|
+
|
|
74
|
+
If you're sure that you want to sync:
|
|
75
|
+
|
|
76
|
+
${p.slug} (${v.name}) → ${s.path}
|
|
77
|
+
|
|
78
|
+
Run "ggt dev" with the {bold --allow-different-app} flag.
|
|
79
|
+
`)}let b;c.environment!==v.name&&(z({ensureEmptyLineAbove:!0,content:T`
|
|
80
|
+
Changing environment.
|
|
81
|
+
|
|
82
|
+
${c.environment} → ${v.name}
|
|
83
|
+
`}),b=c.environment,c.environment=v.name,c.environments[v.name]||(c.environments[v.name]={filesVersion:"0"}));let y=new t(e,n,s,v,b,c);return await y.save(y.filesVersion),await y.loadGitBranch(),y}static async loadOrInit(e,{command:r,args:n,directory:s}){e=e.child({name:"sync-json"});let i=await t.load(e,{command:r,args:n,directory:s});if(i)return i;if(await s.hasFiles()&&!n["--allow-unknown-directory"])throw new Ct({command:r,args:n,directory:s});let o=await mi({args:n,availableApps:await re(e)}),a=await fi({command:r,args:n,application:o});return await Kt.default.ensureDir(s.path),i=new t(e,n,s,a,void 0,{application:o.slug,environment:a.name,environments:{[a.name]:{filesVersion:"0"}}}),await i.save(i.filesVersion),await i.loadGitBranch(),i}async save(e){let r=this.state.environments[this.state.environment];ci(r,"environment must exist in environments"),r.filesVersion=String(e),this.ctx.log.debug("saving .gadget/sync.json"),await Kt.default.outputJSON(this.directory.absolute(".gadget/sync.json"),this.state,{spaces:2})}async loadGitBranch(){this.gitBranch=await gc(this.ctx,{directory:this.directory})}sprint(e={}){let r=R`
|
|
84
|
+
Application ${this.environment.application.slug}
|
|
85
|
+
Environment ${this.environment.name}
|
|
86
|
+
`;this.gitBranch&&(r+=R({indent:5,content:`Branch ${this.gitBranch}`}));let n=te.domains.app;return st.isSupported?r+=R({ensureEmptyLineAbove:!0,content:`${st(ft.link("Preview"),`https://${this.environment.application.slug}--${this.environment.name}.${n}`)} ${st(ft.link("Editor"),`https://${this.environment.application.primaryDomain}/edit/${this.environment.name}`)} ${st(ft.link("Playground"),`https://${this.environment.application.primaryDomain}/api/playground/javascript?environment=${this.environment.name}`)} ${st(ft.link("Docs"),`https://docs.gadget.dev/api/${this.environment.application.slug}`)}`}):r+=R`
|
|
87
|
+
------------------------
|
|
88
|
+
Preview https://${this.environment.application.slug}--${this.environment.name}.${n}
|
|
89
|
+
Editor https://${this.environment.application.primaryDomain}/edit/${this.environment.name}
|
|
90
|
+
Playground https://${this.environment.application.primaryDomain}/api/playground/javascript?environment=${this.environment.name}
|
|
91
|
+
Docs https://docs.gadget.dev/api/${this.environment.application.slug}
|
|
92
|
+
`,R({...e,content:r})}print(e){e=ct(e,{ensureEmptyLineAbove:!0}),z(this.sprint(e))}},vp=async t=>{te.windows&&t.startsWith("~/")&&(t=ur(t.slice(2)));let e=await ar(".gadget/sync.json",{cwd:t});return e&&(t=li.join(e,"../..")),t=li.resolve(t),await fr.init(t)},mi=async({args:t,availableApps:e,state:r})=>{let n=t["--app"]||r?.application;if(!n){let o=Array.from(gr(e)).map(([a,c])=>[a,c.map(p=>p.slug)]);n=await oe({groupedChoices:o,content:"Which application do you want to develop?"})}let s=e.find(o=>o.slug===n);if(s)return s;let i=ee(n,e.map(o=>o.slug)).slice(0,5);throw new V(T`
|
|
93
|
+
Unknown application:
|
|
94
|
+
|
|
95
|
+
${n}
|
|
96
|
+
|
|
97
|
+
Did you mean one of these?
|
|
98
|
+
|
|
99
|
+
• ${i.join(`
|
|
100
|
+
\u2022 `)}
|
|
101
|
+
`)},fi=async({command:t,args:e,application:r,state:n})=>{if(e["--env"]&&!r.multiEnvironmentEnabled)throw new V(T`
|
|
102
|
+
You specified an environment but your app doesn't have multiple environments.
|
|
103
|
+
|
|
104
|
+
Remove the "--env" flag to sync to the {bold ${r.primaryDomain}} environment.
|
|
105
|
+
`);let s=r.environments.filter(c=>c.type===dr.Development),i=e["--env"]||n?.environment;if(i||(i=await oe({choices:s.map(c=>c.name),content:"Which environment do you want to develop on?"})),i.toLowerCase()==="production")throw new V(T`
|
|
106
|
+
You cannot "ggt ${t}" your {bold production} environment.
|
|
107
|
+
`);let o=s.find(c=>c.name===i.toLowerCase());if(o)return{...o,application:r};let a=ee(i,s.map(c=>c.name)).slice(0,5);throw new V(T`
|
|
108
|
+
Unknown environment:
|
|
109
|
+
|
|
110
|
+
${i}
|
|
111
|
+
|
|
112
|
+
Did you mean one of these?
|
|
113
|
+
|
|
114
|
+
• ${a.join(`
|
|
115
|
+
\u2022 `)}
|
|
116
|
+
`)},gc=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}},yc=B.object({application:B.string(),environment:B.string(),environments:B.record(B.object({filesVersion:B.string()}))}),vc=B.object({app:B.string(),filesVersion:B.string(),mtime:B.number()}),bc=B.union([yc,vc]),_c=bc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{Ec as a,ne as b,Pc as c,Cc as d,Rc as e,kr as f,Ct as g,wr as h,Tr as i,Yi as j,Fc as k,oe as l,yp as m,pi as n,vp as o};
|
|
117
|
+
//# sourceMappingURL=chunk-MIN6ZMLJ.js.map
|