@gadgetinc/ggt 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +1 -0
  2. package/dist/{add-RDTHYTCK.js → add-DCE6CV2D.js} +2 -2
  3. package/dist/{chunk-M2OJZLL7.js → chunk-6FBP46EB.js} +6 -6
  4. package/dist/{chunk-M2OJZLL7.js.map → chunk-6FBP46EB.js.map} +2 -2
  5. package/dist/{chunk-NGTOMLDS.js → chunk-AB4I3BMD.js} +2 -2
  6. package/dist/{chunk-TRHAPK2F.js → chunk-BYMG3KOL.js} +2 -2
  7. package/dist/{chunk-JKDJXJKF.js → chunk-BZSAGSV3.js} +2 -2
  8. package/dist/{chunk-RYQWS5BH.js → chunk-CXYA3RFX.js} +2 -2
  9. package/dist/{chunk-LWW4E6P5.js → chunk-DVKNBG4P.js} +35 -28
  10. package/dist/chunk-DVKNBG4P.js.map +7 -0
  11. package/dist/{chunk-457GEPUN.js → chunk-EFU2JNKY.js} +3 -3
  12. package/dist/{chunk-CQLM5U6T.js → chunk-KGOVR5SK.js} +12 -12
  13. package/dist/{chunk-CQLM5U6T.js.map → chunk-KGOVR5SK.js.map} +4 -4
  14. package/dist/{chunk-FLXIAZND.js → chunk-KMCOZJPU.js} +2 -2
  15. package/dist/{chunk-VICN6LTV.js → chunk-OLKWG2EP.js} +3 -3
  16. package/dist/{chunk-5ONACLO6.js → chunk-THZRTDWW.js} +2 -2
  17. package/dist/{context-GN36UFJL.js → context-L5YSPF3X.js} +2 -2
  18. package/dist/deploy-PBJEUYGH.js +25 -0
  19. package/dist/deploy-PBJEUYGH.js.map +7 -0
  20. package/dist/{dev-5UFCKF4X.js → dev-OT7PEKUN.js} +2 -2
  21. package/dist/{list-WGRXHV2B.js → list-CC5PICEF.js} +2 -2
  22. package/dist/login-SE7XIHRW.js +2 -0
  23. package/dist/{logout-YXDH5ZZI.js → logout-B3YAZN6R.js} +2 -2
  24. package/dist/main.js +1 -1
  25. package/dist/{open-EOH3Q5KP.js → open-OVK3YL4O.js} +2 -2
  26. package/dist/{pull-UAKKKJJP.js → pull-SLPBOP6Z.js} +2 -2
  27. package/dist/push-3HGVWCKW.js +2 -0
  28. package/dist/{status-UJUGP24U.js → status-7GLNL7D5.js} +2 -2
  29. package/dist/user-C34J52UL.js +2 -0
  30. package/dist/{version-VE55GG37.js → version-AUI4NRDS.js} +2 -2
  31. package/dist/{whoami-OAH55L4M.js → whoami-TXO7VJXC.js} +2 -2
  32. package/package.json +1 -1
  33. package/dist/chunk-LWW4E6P5.js.map +0 -7
  34. package/dist/deploy-BAMMI3ZA.js +0 -24
  35. package/dist/deploy-BAMMI3ZA.js.map +0 -7
  36. package/dist/login-5YZOB4XB.js +0 -2
  37. package/dist/push-7X4P2364.js +0 -2
  38. package/dist/user-B2RIDVTH.js +0 -2
  39. /package/dist/{add-RDTHYTCK.js.map → add-DCE6CV2D.js.map} +0 -0
  40. /package/dist/{chunk-NGTOMLDS.js.map → chunk-AB4I3BMD.js.map} +0 -0
  41. /package/dist/{chunk-TRHAPK2F.js.map → chunk-BYMG3KOL.js.map} +0 -0
  42. /package/dist/{chunk-JKDJXJKF.js.map → chunk-BZSAGSV3.js.map} +0 -0
  43. /package/dist/{chunk-RYQWS5BH.js.map → chunk-CXYA3RFX.js.map} +0 -0
  44. /package/dist/{chunk-457GEPUN.js.map → chunk-EFU2JNKY.js.map} +0 -0
  45. /package/dist/{chunk-FLXIAZND.js.map → chunk-KMCOZJPU.js.map} +0 -0
  46. /package/dist/{chunk-VICN6LTV.js.map → chunk-OLKWG2EP.js.map} +0 -0
  47. /package/dist/{chunk-5ONACLO6.js.map → chunk-THZRTDWW.js.map} +0 -0
  48. /package/dist/{context-GN36UFJL.js.map → context-L5YSPF3X.js.map} +0 -0
  49. /package/dist/{dev-5UFCKF4X.js.map → dev-OT7PEKUN.js.map} +0 -0
  50. /package/dist/{list-WGRXHV2B.js.map → list-CC5PICEF.js.map} +0 -0
  51. /package/dist/{login-5YZOB4XB.js.map → login-SE7XIHRW.js.map} +0 -0
  52. /package/dist/{logout-YXDH5ZZI.js.map → logout-B3YAZN6R.js.map} +0 -0
  53. /package/dist/{open-EOH3Q5KP.js.map → open-OVK3YL4O.js.map} +0 -0
  54. /package/dist/{pull-UAKKKJJP.js.map → pull-SLPBOP6Z.js.map} +0 -0
  55. /package/dist/{push-7X4P2364.js.map → push-3HGVWCKW.js.map} +0 -0
  56. /package/dist/{status-UJUGP24U.js.map → status-7GLNL7D5.js.map} +0 -0
  57. /package/dist/{user-B2RIDVTH.js.map → user-C34J52UL.js.map} +0 -0
  58. /package/dist/{version-VE55GG37.js.map → version-AUI4NRDS.js.map} +0 -0
  59. /package/dist/{whoami-OAH55L4M.js.map → whoami-TXO7VJXC.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{E as $,I as u,x as E}from"./chunk-CQLM5U6T.js";import{c as N,e as g,g as a}from"./chunk-5WC5D4WL.js";var k=N((_e,F)=>{a();function G(t){return Array.isArray(t)?t:[t]}var S="",C=" ",p="\\",B=/^\s+$/,W=/(?:[^\\]|^)\\$/,K=/^\\!/,V=/^\\#/,Y=/\r?\n/g,M=/^\.*\/|^\.+$/,y="/",T="node-ignore";typeof Symbol<"u"&&(T=Symbol.for("node-ignore"));var I=T,q=(t,e,s)=>Object.defineProperty(t,e,{value:s}),J=/([0-z])-([0-z])/g,H=()=>!1,Q=t=>t.replace(J,(e,s,r)=>s.charCodeAt(0)<=r.charCodeAt(0)?e:S),U=t=>{let{length:e}=t;return t.slice(0,e-e%2)},Z=[[/^\uFEFF/,()=>S],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,s)=>e+(s.indexOf("\\")===0?C:S)],[/(\\+?)\s/g,(t,e)=>{let{length:s}=e;return e.slice(0,s-s%2)+C}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,s)=>e+6<s.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,s)=>{let r=s.replace(/\\\*/g,"[^\\/]*");return e+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>p],[/\\\\/g,()=>p],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,s,r,n)=>e===p?`\\[${s}${U(r)}${n}`:n==="]"&&r.length%2===0?`[${Q(s)}${r}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],O=Object.create(null),ee=(t,e)=>{let s=O[t];return s||(s=Z.reduce((r,[n,i])=>r.replace(n,i.bind(t)),t),O[t]=s),e?new RegExp(s,"i"):new RegExp(s)},R=t=>typeof t=="string",te=t=>t&&R(t)&&!B.test(t)&&!W.test(t)&&t.indexOf("#")!==0,se=t=>t.split(Y),x=class{constructor(e,s,r,n){this.origin=e,this.pattern=s,this.negative=r,this.regex=n}},re=(t,e)=>{let s=t,r=!1;t.indexOf("!")===0&&(r=!0,t=t.substr(1)),t=t.replace(K,"!").replace(V,"#");let n=ee(t,e);return new x(s,t,r,n)},ne=(t,e)=>{throw new e(t)},o=(t,e,s)=>R(t)?t?o.isNotRelative(t)?s(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:s("path must not be empty",TypeError):s(`path must be a string, but got \`${e}\``,TypeError),L=t=>M.test(t);o.isNotRelative=L;o.convert=t=>t;var v=class{constructor({ignorecase:e=!0,ignoreCase:s=e,allowRelativePaths:r=!1}={}){q(this,I,!0),this._rules=[],this._ignoreCase=s,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[I]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(te(e)){let s=re(e,this._ignoreCase);this._added=!0,this._rules.push(s)}}add(e){return this._added=!1,G(R(e)?se(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,s){let r=!1,n=!1;return this._rules.forEach(i=>{let{negative:l}=i;if(n===l&&r!==n||l&&!r&&!n&&!s)return;i.regex.test(e)&&(r=!l,n=l)}),{ignored:r,unignored:n}}_test(e,s,r,n){let i=e&&o.convert(e);return o(i,e,this._allowRelativePaths?H:ne),this._t(i,s,r,n)}_t(e,s,r,n){if(e in s)return s[e];if(n||(n=e.split(y)),n.pop(),!n.length)return s[e]=this._testOne(e,r);let i=this._t(n.join(y)+y,s,r,n);return s[e]=i.ignored?i:this._testOne(e,r)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return G(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},d=t=>new v(t),ie=t=>o(t&&o.convert(t),t,H);d.isPathValid=ie;d.default=d;F.exports=d;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=s=>/^\\\\\?\\/.test(s)||/["<>|\u0000-\u001F]+/u.test(s)?s:s.replace(/\\/g,"/");o.convert=t;let e=/^[a-z]:\//i;o.isNotRelative=s=>e.test(s)||L(s)}});var D=N((Ee,X)=>{a();X.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var s=t.length;if(s<=1)return t;var r="";if(s>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),r+i.join("/")}});a();var _=g($(),1);a();var f=g($(),1),j=g(k(),1),A=g(D(),1);import oe from"node:assert";import{createHash as ae}from"node:crypto";import c from"node:path";import{Transform as ce}from"node:stream";import{pipeline as le}from"node:stream/promises";var ue=[".DS_Store","node_modules",".git"],fe=[".gadget/sync.json",".gadget/backup","yarn-error.log"],z=class t{constructor(e){this.path=e}_ignorer;_isHashing=!1;static async init(e){let s=new t(e);return await s.loadIgnoreFile(),s}relative(e){return c.isAbsolute(e)?c.relative(this.path,e):e}absolute(...e){let s=c.resolve(this.path,...e);return oe(s.startsWith(this.path),`expected ${s} to be within ${this.path}`),s}normalize(e,s){return c.isAbsolute(e)&&(e=this.relative(e)),e=(0,A.default)(e,!0),s&&(e+="/"),e}async loadIgnoreFile(){this._ignorer=j.default.default(),this._ignorer.add(ue);try{let e=await f.default.readFile(this.absolute(".ignore"),"utf8");this._ignorer.add(e)}catch(e){h(e)}}ignores(e){return e=this.relative(e),e===""?!1:e.startsWith("..")||(e=(0,A.default)(e,!1),this._isHashing&&fe.some(s=>e.startsWith(s)))?!0:this._ignorer.ignores(e)}async*walk({dir:e=this.path}={}){e!==this.path&&(yield this.normalize(e,!0));for await(let s of await f.default.opendir(e)){let r=c.join(e,s.name);this.ignores(r)||(s.isDirectory()?yield*this.walk({dir:r}):s.isFile()&&(yield this.normalize(r,!1)))}}async hashes(){try{this._isHashing=!0;let e={};for await(let s of this.walk()){let r=this.absolute(s);e[s]=await de(r)}return e}finally{this._isHashing=!1}}async hasFiles(){return!await this.isEmptyOrNonExistent()}async isEmptyOrNonExistent(){let e=!0;try{for await(let s of this.walk()){e=!1;break}}catch(s){h(s)}return e}},ge=process.platform==="linux"||process.platform==="darwin",de=async t=>{let e=ae("sha1");e.update(c.basename(t));let s=await f.default.stat(t),r;if(ge&&(r=s.mode&511),s.isDirectory())return{sha1:e.digest("hex"),permissions:r};let n=new ce({transform(i,l,m){if(!i.includes(13)){m(void 0,i);return}let w=Buffer.alloc(i.length),P=0;for(let b of i)b!==13&&(w[P++]=b);m(void 0,w.subarray(0,P))}});return await le(f.default.createReadStream(t),n,e),{sha1:e.digest("hex"),permissions:r}},h=t=>{if(!(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT"))throw t};var he=E(t=>{if(process.env.GGT_SESSION)return t.log.debug("reading session from env"),process.env.GGT_SESSION;try{return t.log.debug("reading session from disk"),_.default.readFileSync(u("session.txt"),"utf8")}catch(e){h(e);return}}),$e=(t,e)=>{he.clear(),process.env.GGT_SESSION&&(t.log.debug("writing session to env",{session:!!e}),process.env.GGT_SESSION=e),t.log.debug("writing session to disk",{session:!!e,path:u("session.txt")}),e?_.default.outputFileSync(u("session.txt"),e):_.default.removeSync(u("session.txt"))},Ge=E(t=>(t.log.debug("reading token from env"),process.env.GGT_TOKEN));export{z as a,ge as b,h as c,he as d,$e as e,Ge as f};
1
+ import{E as $,I as u,x as E}from"./chunk-KGOVR5SK.js";import{c as N,e as g,g as a}from"./chunk-5WC5D4WL.js";var k=N((_e,F)=>{a();function G(t){return Array.isArray(t)?t:[t]}var S="",C=" ",p="\\",B=/^\s+$/,W=/(?:[^\\]|^)\\$/,K=/^\\!/,V=/^\\#/,Y=/\r?\n/g,M=/^\.*\/|^\.+$/,y="/",T="node-ignore";typeof Symbol<"u"&&(T=Symbol.for("node-ignore"));var I=T,q=(t,e,s)=>Object.defineProperty(t,e,{value:s}),J=/([0-z])-([0-z])/g,H=()=>!1,Q=t=>t.replace(J,(e,s,r)=>s.charCodeAt(0)<=r.charCodeAt(0)?e:S),U=t=>{let{length:e}=t;return t.slice(0,e-e%2)},Z=[[/^\uFEFF/,()=>S],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,s)=>e+(s.indexOf("\\")===0?C:S)],[/(\\+?)\s/g,(t,e)=>{let{length:s}=e;return e.slice(0,s-s%2)+C}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,s)=>e+6<s.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,s)=>{let r=s.replace(/\\\*/g,"[^\\/]*");return e+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>p],[/\\\\/g,()=>p],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,s,r,n)=>e===p?`\\[${s}${U(r)}${n}`:n==="]"&&r.length%2===0?`[${Q(s)}${r}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],O=Object.create(null),ee=(t,e)=>{let s=O[t];return s||(s=Z.reduce((r,[n,i])=>r.replace(n,i.bind(t)),t),O[t]=s),e?new RegExp(s,"i"):new RegExp(s)},R=t=>typeof t=="string",te=t=>t&&R(t)&&!B.test(t)&&!W.test(t)&&t.indexOf("#")!==0,se=t=>t.split(Y),x=class{constructor(e,s,r,n){this.origin=e,this.pattern=s,this.negative=r,this.regex=n}},re=(t,e)=>{let s=t,r=!1;t.indexOf("!")===0&&(r=!0,t=t.substr(1)),t=t.replace(K,"!").replace(V,"#");let n=ee(t,e);return new x(s,t,r,n)},ne=(t,e)=>{throw new e(t)},o=(t,e,s)=>R(t)?t?o.isNotRelative(t)?s(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:s("path must not be empty",TypeError):s(`path must be a string, but got \`${e}\``,TypeError),L=t=>M.test(t);o.isNotRelative=L;o.convert=t=>t;var v=class{constructor({ignorecase:e=!0,ignoreCase:s=e,allowRelativePaths:r=!1}={}){q(this,I,!0),this._rules=[],this._ignoreCase=s,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[I]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(te(e)){let s=re(e,this._ignoreCase);this._added=!0,this._rules.push(s)}}add(e){return this._added=!1,G(R(e)?se(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,s){let r=!1,n=!1;return this._rules.forEach(i=>{let{negative:l}=i;if(n===l&&r!==n||l&&!r&&!n&&!s)return;i.regex.test(e)&&(r=!l,n=l)}),{ignored:r,unignored:n}}_test(e,s,r,n){let i=e&&o.convert(e);return o(i,e,this._allowRelativePaths?H:ne),this._t(i,s,r,n)}_t(e,s,r,n){if(e in s)return s[e];if(n||(n=e.split(y)),n.pop(),!n.length)return s[e]=this._testOne(e,r);let i=this._t(n.join(y)+y,s,r,n);return s[e]=i.ignored?i:this._testOne(e,r)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return G(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},d=t=>new v(t),ie=t=>o(t&&o.convert(t),t,H);d.isPathValid=ie;d.default=d;F.exports=d;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=s=>/^\\\\\?\\/.test(s)||/["<>|\u0000-\u001F]+/u.test(s)?s:s.replace(/\\/g,"/");o.convert=t;let e=/^[a-z]:\//i;o.isNotRelative=s=>e.test(s)||L(s)}});var D=N((Ee,X)=>{a();X.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var s=t.length;if(s<=1)return t;var r="";if(s>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),r+i.join("/")}});a();var _=g($(),1);a();var f=g($(),1),j=g(k(),1),A=g(D(),1);import oe from"node:assert";import{createHash as ae}from"node:crypto";import c from"node:path";import{Transform as ce}from"node:stream";import{pipeline as le}from"node:stream/promises";var ue=[".DS_Store","node_modules",".git"],fe=[".gadget/sync.json",".gadget/backup","yarn-error.log"],z=class t{constructor(e){this.path=e}_ignorer;_isHashing=!1;static async init(e){let s=new t(e);return await s.loadIgnoreFile(),s}relative(e){return c.isAbsolute(e)?c.relative(this.path,e):e}absolute(...e){let s=c.resolve(this.path,...e);return oe(s.startsWith(this.path),`expected ${s} to be within ${this.path}`),s}normalize(e,s){return c.isAbsolute(e)&&(e=this.relative(e)),e=(0,A.default)(e,!0),s&&(e+="/"),e}async loadIgnoreFile(){this._ignorer=j.default.default(),this._ignorer.add(ue);try{let e=await f.default.readFile(this.absolute(".ignore"),"utf8");this._ignorer.add(e)}catch(e){h(e)}}ignores(e){return e=this.relative(e),e===""?!1:e.startsWith("..")||(e=(0,A.default)(e,!1),this._isHashing&&fe.some(s=>e.startsWith(s)))?!0:this._ignorer.ignores(e)}async*walk({dir:e=this.path}={}){e!==this.path&&(yield this.normalize(e,!0));for await(let s of await f.default.opendir(e)){let r=c.join(e,s.name);this.ignores(r)||(s.isDirectory()?yield*this.walk({dir:r}):s.isFile()&&(yield this.normalize(r,!1)))}}async hashes(){try{this._isHashing=!0;let e={};for await(let s of this.walk()){let r=this.absolute(s);e[s]=await de(r)}return e}finally{this._isHashing=!1}}async hasFiles(){return!await this.isEmptyOrNonExistent()}async isEmptyOrNonExistent(){let e=!0;try{for await(let s of this.walk()){e=!1;break}}catch(s){h(s)}return e}},ge=process.platform==="linux"||process.platform==="darwin",de=async t=>{let e=ae("sha1");e.update(c.basename(t));let s=await f.default.stat(t),r;if(ge&&(r=s.mode&511),s.isDirectory())return{sha1:e.digest("hex"),permissions:r};let n=new ce({transform(i,l,m){if(!i.includes(13)){m(void 0,i);return}let w=Buffer.alloc(i.length),P=0;for(let b of i)b!==13&&(w[P++]=b);m(void 0,w.subarray(0,P))}});return await le(f.default.createReadStream(t),n,e),{sha1:e.digest("hex"),permissions:r}},h=t=>{if(!(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT"))throw t};var he=E(t=>{if(process.env.GGT_SESSION)return t.log.debug("reading session from env"),process.env.GGT_SESSION;try{return t.log.debug("reading session from disk"),_.default.readFileSync(u("session.txt"),"utf8")}catch(e){h(e);return}}),$e=(t,e)=>{he.clear(),process.env.GGT_SESSION&&(t.log.debug("writing session to env",{session:!!e}),process.env.GGT_SESSION=e),t.log.debug("writing session to disk",{session:!!e,path:u("session.txt")}),e?_.default.outputFileSync(u("session.txt"),e):_.default.removeSync(u("session.txt"))},Ge=E(t=>(t.log.debug("reading token from env"),process.env.GGT_TOKEN));export{z as a,ge as b,h as c,he as d,$e as e,Ge as f};
2
2
  /*! Bundled license information:
3
3
 
4
4
  normalize-path/index.js:
@@ -9,4 +9,4 @@ normalize-path/index.js:
9
9
  * Released under the MIT License.
10
10
  *)
11
11
  */
12
- //# sourceMappingURL=chunk-FLXIAZND.js.map
12
+ //# sourceMappingURL=chunk-KMCOZJPU.js.map
@@ -1,4 +1,4 @@
1
- import{$ as ft,B as k,F as oe,G as N,H as U,L as Ie,M as at,R as lt,U as ut,W as ct,X as me,Y as Q,Z as Ne,_ as Ee,a as nt,b as Se,f as it,g as ot,h as Be,o as st,z as V}from"./chunk-CQLM5U6T.js";import{a as dt}from"./chunk-F3EZ4KS3.js";import{a as rt,c as he,e as ge,g as h}from"./chunk-5WC5D4WL.js";var Fe=he((Rr,pt)=>{h();var se=1e3,ae=se*60,le=ae*60,Z=le*24,qt=Z*7,Kt=Z*365.25;pt.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Wt(t);if(r==="number"&&isFinite(t))return e.long?Jt(t):zt(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Wt(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return r*Kt;case"weeks":case"week":case"w":return r*qt;case"days":case"day":case"d":return r*Z;case"hours":case"hour":case"hrs":case"hr":case"h":return r*le;case"minutes":case"minute":case"mins":case"min":case"m":return r*ae;case"seconds":case"second":case"secs":case"sec":case"s":return r*se;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function zt(t){var e=Math.abs(t);return e>=Z?Math.round(t/Z)+"d":e>=le?Math.round(t/le)+"h":e>=ae?Math.round(t/ae)+"m":e>=se?Math.round(t/se)+"s":t+"ms"}function Jt(t){var e=Math.abs(t);return e>=Z?Te(t,e,Z,"day"):e>=le?Te(t,e,le,"hour"):e>=ae?Te(t,e,ae,"minute"):e>=se?Te(t,e,se,"second"):t+" ms"}function Te(t,e,r,o){var n=e>=r*1.5;return Math.round(t/r)+" "+o+(n?"s":"")}});var ht=he((Pe,je)=>{h();(function(t,e){typeof Pe=="object"&&typeof je<"u"?je.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Pe,function(){"use strict";var t=1e3,e=6e4,r=36e5,o="millisecond",n="second",c="minute",b="hour",p="day",A="week",w="month",L="quarter",O="year",x="date",M="Invalid Date",Le=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,K={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(u){var a=["th","st","nd","rd"],i=u%100;return"["+u+(a[(i-20)%10]||a[i]||a[0])+"]"}},ne=function(u,a,i){var l=String(u);return!l||l.length>=a?u:""+Array(a+1-l.length).join(i)+u},Ue={s:ne,z:function(u){var a=-u.utcOffset(),i=Math.abs(a),l=Math.floor(i/60),s=i%60;return(a<=0?"+":"-")+ne(l,2,"0")+":"+ne(s,2,"0")},m:function u(a,i){if(a.date()<i.date())return-u(i,a);var l=12*(i.year()-a.year())+(i.month()-a.month()),s=a.clone().add(l,w),f=i-s<0,d=a.clone().add(l+(f?-1:1),w);return+(-(l+(i-s)/(f?s-d:d-s))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:w,y:O,w:A,d:p,D:x,h:b,m:c,s:n,ms:o,Q:L}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},fe="en",W={};W[fe]=K;var et="$isDayjsObject",_e=function(u){return u instanceof Oe||!(!u||!u[et])},Ae=function u(a,i,l){var s;if(!a)return fe;if(typeof a=="string"){var f=a.toLowerCase();W[f]&&(s=f),i&&(W[f]=i,s=f);var d=a.split("-");if(!s&&d.length>1)return u(d[0])}else{var D=a.name;W[D]=a,s=D}return!l&&s&&(fe=s),s||!l&&fe},S=function(u,a){if(_e(u))return u.clone();var i=typeof a=="object"?a:{};return i.date=u,i.args=arguments,new Oe(i)},y=Ue;y.l=Ae,y.i=_e,y.w=function(u,a){return S(u,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var Oe=function(){function u(i){this.$L=Ae(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[et]=!0}var a=u.prototype;return a.parse=function(i){this.$d=function(l){var s=l.date,f=l.utc;if(s===null)return new Date(NaN);if(y.u(s))return new Date;if(s instanceof Date)return new Date(s);if(typeof s=="string"&&!/Z$/i.test(s)){var d=s.match(Le);if(d){var D=d[2]-1||0,R=(d[7]||"0").substring(0,3);return f?new Date(Date.UTC(d[1],D,d[3]||1,d[4]||0,d[5]||0,d[6]||0,R)):new Date(d[1],D,d[3]||1,d[4]||0,d[5]||0,d[6]||0,R)}}return new Date(s)}(i),this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return y},a.isValid=function(){return this.$d.toString()!==M},a.isSame=function(i,l){var s=S(i);return this.startOf(l)<=s&&s<=this.endOf(l)},a.isAfter=function(i,l){return S(i)<this.startOf(l)},a.isBefore=function(i,l){return this.endOf(l)<S(i)},a.$g=function(i,l,s){return y.u(i)?this[l]:this.set(s,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,l){var s=this,f=!!y.u(l)||l,d=y.p(i),D=function(J,$){var G=y.w(s.$u?Date.UTC(s.$y,$,J):new Date(s.$y,$,J),s);return f?G:G.endOf(p)},R=function(J,$){return y.w(s.toDate()[J].apply(s.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice($)),s)},B=this.$W,T=this.$M,C=this.$D,ie="set"+(this.$u?"UTC":"");switch(d){case O:return f?D(1,0):D(31,11);case w:return f?D(1,T):D(0,T+1);case A:var z=this.$locale().weekStart||0,de=(B<z?B+7:B)-z;return D(f?C-de:C+(6-de),T);case p:case x:return R(ie+"Hours",0);case b:return R(ie+"Minutes",1);case c:return R(ie+"Seconds",2);case n:return R(ie+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,l){var s,f=y.p(i),d="set"+(this.$u?"UTC":""),D=(s={},s[p]=d+"Date",s[x]=d+"Date",s[w]=d+"Month",s[O]=d+"FullYear",s[b]=d+"Hours",s[c]=d+"Minutes",s[n]=d+"Seconds",s[o]=d+"Milliseconds",s)[f],R=f===p?this.$D+(l-this.$W):l;if(f===w||f===O){var B=this.clone().set(x,1);B.$d[D](R),B.init(),this.$d=B.set(x,Math.min(this.$D,B.daysInMonth())).$d}else D&&this.$d[D](R);return this.init(),this},a.set=function(i,l){return this.clone().$set(i,l)},a.get=function(i){return this[y.p(i)]()},a.add=function(i,l){var s,f=this;i=Number(i);var d=y.p(l),D=function(T){var C=S(f);return y.w(C.date(C.date()+Math.round(T*i)),f)};if(d===w)return this.set(w,this.$M+i);if(d===O)return this.set(O,this.$y+i);if(d===p)return D(1);if(d===A)return D(7);var R=(s={},s[c]=e,s[b]=r,s[n]=t,s)[d]||1,B=this.$d.getTime()+i*R;return y.w(B,this)},a.subtract=function(i,l){return this.add(-1*i,l)},a.format=function(i){var l=this,s=this.$locale();if(!this.isValid())return s.invalidDate||M;var f=i||"YYYY-MM-DDTHH:mm:ssZ",d=y.z(this),D=this.$H,R=this.$m,B=this.$M,T=s.weekdays,C=s.months,ie=s.meridiem,z=function($,G,pe,ve){return $&&($[G]||$(l,f))||pe[G].slice(0,ve)},de=function($){return y.s(D%12||12,$,"0")},J=ie||function($,G,pe){var ve=$<12?"AM":"PM";return pe?ve.toLowerCase():ve};return f.replace(v,function($,G){return G||function(pe){switch(pe){case"YY":return String(l.$y).slice(-2);case"YYYY":return y.s(l.$y,4,"0");case"M":return B+1;case"MM":return y.s(B+1,2,"0");case"MMM":return z(s.monthsShort,B,C,3);case"MMMM":return z(C,B);case"D":return l.$D;case"DD":return y.s(l.$D,2,"0");case"d":return String(l.$W);case"dd":return z(s.weekdaysMin,l.$W,T,2);case"ddd":return z(s.weekdaysShort,l.$W,T,3);case"dddd":return T[l.$W];case"H":return String(D);case"HH":return y.s(D,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return J(D,R,!0);case"A":return J(D,R,!1);case"m":return String(R);case"mm":return y.s(R,2,"0");case"s":return String(l.$s);case"ss":return y.s(l.$s,2,"0");case"SSS":return y.s(l.$ms,3,"0");case"Z":return d}return null}($)||d.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,l,s){var f,d=this,D=y.p(l),R=S(i),B=(R.utcOffset()-this.utcOffset())*e,T=this-R,C=function(){return y.m(d,R)};switch(D){case O:f=C()/12;break;case w:f=C();break;case L:f=C()/3;break;case A:f=(T-B)/6048e5;break;case p:f=(T-B)/864e5;break;case b:f=T/r;break;case c:f=T/e;break;case n:f=T/t;break;default:f=T}return s?f:y.a(f)},a.daysInMonth=function(){return this.endOf(w).$D},a.$locale=function(){return W[this.$L]},a.locale=function(i,l){if(!i)return this.$L;var s=this.clone(),f=Ae(i,l,!0);return f&&(s.$L=f),s},a.clone=function(){return y.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},u}(),tt=Oe.prototype;return S.prototype=tt,[["$ms",o],["$s",n],["$m",c],["$H",b],["$W",p],["$M",w],["$y",O],["$D",x]].forEach(function(u){tt[u[1]]=function(a){return this.$g(a,u[0],u[1])}}),S.extend=function(u,a){return u.$i||(u(a,Oe,S),u.$i=!0),S},S.locale=Ae,S.isDayjs=_e,S.unix=function(u){return S(1e3*u)},S.en=W[fe],S.Ls=W,S.p={},S})});var Lt=he((Fr,Rt)=>{"use strict";h();var tr=rt("os"),bt=rt("tty"),_=dt(),{env:E}=process,H;_("no-color")||_("no-colors")||_("color=false")||_("color=never")?H=0:(_("color")||_("colors")||_("color=true")||_("color=always"))&&(H=1);"FORCE_COLOR"in E&&(E.FORCE_COLOR==="true"?H=1:E.FORCE_COLOR==="false"?H=0:H=E.FORCE_COLOR.length===0?1:Math.min(parseInt(E.FORCE_COLOR,10),3));function Ve(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function He(t,e){if(H===0)return 0;if(_("color=16m")||_("color=full")||_("color=truecolor"))return 3;if(_("color=256"))return 2;if(t&&!e&&H===void 0)return 0;let r=H||0;if(E.TERM==="dumb")return r;if(process.platform==="win32"){let o=tr.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in E)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in E)||E.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in E)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(E.TEAMCITY_VERSION)?1:0;if(E.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in E){let o=parseInt((E.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(E.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(E.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(E.TERM)||"COLORTERM"in E?1:r}function rr(t){let e=He(t,t&&t.isTTY);return Ve(e)}Rt.exports={supportsColor:rr,stdout:Ve(He(!0,bt.isatty(1))),stderr:Ve(He(!0,bt.isatty(2)))}});var vt=he((jr,Ot)=>{"use strict";h();var nr=Lt(),ce=dt();function At(t){if(/^\d{3,4}$/.test(t)){let r=/(\d{1,2})(\d{2})/.exec(t);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let e=(t||"").split(".").map(r=>parseInt(r,10));return{major:e[0],minor:e[1],patch:e[2]}}function Ye(t){let{env:e}=process;if("FORCE_HYPERLINK"in e)return!(e.FORCE_HYPERLINK.length>0&&parseInt(e.FORCE_HYPERLINK,10)===0);if(ce("no-hyperlink")||ce("no-hyperlinks")||ce("hyperlink=false")||ce("hyperlink=never"))return!1;if(ce("hyperlink=true")||ce("hyperlink=always")||"NETLIFY"in e)return!0;if(!nr.supportsColor(t)||t&&!t.isTTY||process.platform==="win32"||"CI"in e||"TEAMCITY_VERSION"in e)return!1;if("TERM_PROGRAM"in e){let r=At(e.TERM_PROGRAM_VERSION);switch(e.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in e){if(e.VTE_VERSION==="0.50.0")return!1;let r=At(e.VTE_VERSION);return r.major>0||r.minor>=50}return!1}Ot.exports={supportsHyperlink:Ye,stdout:Ye(process.stdout),stderr:Ye(process.stderr)}});var Et=he((Jr,Bt)=>{h();var Ke=Symbol("arg flag"),I=class t extends Error{constructor(e,r){super(e),this.name="ArgError",this.code=r,Object.setPrototypeOf(this,t.prototype)}};function be(t,{argv:e=process.argv.slice(2),permissive:r=!1,stopAtPositional:o=!1}={}){if(!t)throw new I("argument specification object is required","ARG_CONFIG_NO_SPEC");let n={_:[]},c={},b={};for(let p of Object.keys(t)){if(!p)throw new I("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(p[0]!=="-")throw new I(`argument key must start with '-' but found: '${p}'`,"ARG_CONFIG_NONOPT_KEY");if(p.length===1)throw new I(`argument key must have a name; singular '-' keys are not allowed: ${p}`,"ARG_CONFIG_NONAME_KEY");if(typeof t[p]=="string"){c[p]=t[p];continue}let A=t[p],w=!1;if(Array.isArray(A)&&A.length===1&&typeof A[0]=="function"){let[L]=A;A=(O,x,M=[])=>(M.push(L(O,x,M[M.length-1])),M),w=L===Boolean||L[Ke]===!0}else if(typeof A=="function")w=A===Boolean||A[Ke]===!0;else throw new I(`type missing or not a function or valid array type: ${p}`,"ARG_CONFIG_VAD_TYPE");if(p[1]!=="-"&&p.length>2)throw new I(`short argument keys (with a single hyphen) must have only one character: ${p}`,"ARG_CONFIG_SHORTOPT_TOOLONG");b[p]=[A,w]}for(let p=0,A=e.length;p<A;p++){let w=e[p];if(o&&n._.length>0){n._=n._.concat(e.slice(p));break}if(w==="--"){n._=n._.concat(e.slice(p+1));break}if(w.length>1&&w[0]==="-"){let L=w[1]==="-"||w.length===2?[w]:w.slice(1).split("").map(O=>`-${O}`);for(let O=0;O<L.length;O++){let x=L[O],[M,Le]=x[1]==="-"?x.split(/=(.*)/,2):[x,void 0],v=M;for(;v in c;)v=c[v];if(!(v in b))if(r){n._.push(x);continue}else throw new I(`unknown or unexpected option: ${M}`,"ARG_UNKNOWN_OPTION");let[K,ne]=b[v];if(!ne&&O+1<L.length)throw new I(`option requires argument (but was followed by another short argument): ${M}`,"ARG_MISSING_REQUIRED_SHORTARG");if(ne)n[v]=K(!0,v,n[v]);else if(Le===void 0){if(e.length<p+2||e[p+1].length>1&&e[p+1][0]==="-"&&!(e[p+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(K===Number||typeof BigInt<"u"&&K===BigInt))){let Ue=M===v?"":` (alias for ${v})`;throw new I(`option requires argument: ${M}${Ue}`,"ARG_MISSING_REQUIRED_LONGARG")}n[v]=K(e[p+1],v,n[v]),++p}else n[v]=K(Le,v,n[v])}}else n._.push(w)}return n}be.flag=t=>(t[Ke]=!0,t);be.COUNT=be.flag((t,e,r)=>(r||0)+1);be.ArgError=I;Bt.exports=be});h();h();h();import P from"node:process";function ye(){return P.platform!=="win32"?P.env.TERM!=="linux":!!P.env.WT_SESSION||!!P.env.TERMINUS_SUBLIME||P.env.ConEmuTask==="{cmd::Cmder}"||P.env.TERM_PROGRAM==="Terminus-Sublime"||P.env.TERM_PROGRAM==="vscode"||P.env.TERM==="xterm-256color"||P.env.TERM==="alacritty"||P.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var gt={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},mt={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Qt={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Ge={...gt,...mt},Zt={...gt,...Qt},Xt=ye(),er=Xt?Ge:Zt,yt=er,Er=Object.entries(mt);var we={...N.testLike?Ge:yt};if(ye()&&U.windowsOrWsl)for(let t of["tick","cross"])we[t]+=" ";h();h();var m="\x1B[",De="\x1B]",ue="\x07",ke=";",wt=process.env.TERM_PROGRAM==="Apple_Terminal",g={};g.cursorTo=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?m+(t+1)+"G":m+(e+1)+";"+(t+1)+"H"};g.cursorMove=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");let r="";return t<0?r+=m+-t+"D":t>0&&(r+=m+t+"C"),e<0?r+=m+-e+"A":e>0&&(r+=m+e+"B"),r};g.cursorUp=(t=1)=>m+t+"A";g.cursorDown=(t=1)=>m+t+"B";g.cursorForward=(t=1)=>m+t+"C";g.cursorBackward=(t=1)=>m+t+"D";g.cursorLeft=m+"G";g.cursorSavePosition=wt?"\x1B7":m+"s";g.cursorRestorePosition=wt?"\x1B8":m+"u";g.cursorGetPosition=m+"6n";g.cursorNextLine=m+"E";g.cursorPrevLine=m+"F";g.cursorHide=m+"?25l";g.cursorShow=m+"?25h";g.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=g.eraseLine+(r<t-1?g.cursorUp():"");return t&&(e+=g.cursorLeft),e};g.eraseEndLine=m+"K";g.eraseStartLine=m+"1K";g.eraseLine=m+"2K";g.eraseDown=m+"J";g.eraseUp=m+"1J";g.eraseScreen=m+"2J";g.scrollUp=m+"S";g.scrollDown=m+"T";g.clearScreen="\x1Bc";g.clearTerminal=process.platform==="win32"?`${g.eraseScreen}${m}0f`:`${g.eraseScreen}${m}3J${m}H`;g.beep=ue;g.link=(t,e)=>[De,"8",ke,ke,e,ue,t,De,"8",ke,ke,ue].join("");g.image=(t,e={})=>{let r=`${De}1337;File=inline=1`;return e.width&&(r+=`;width=${e.width}`),e.height&&(r+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+t.toString("base64")+ue};g.iTerm={setCwd:(t=process.cwd())=>`${De}50;CurrentDir=${t}${ue}`,annotation:(t,e={})=>{let r=`${De}1337;`,o=typeof e.x<"u",n=typeof e.y<"u";if((o||n)&&!(o&&n&&typeof e.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return t=t.replace(/\|/g,""),r+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?r+=(o?[t,e.length,e.x,e.y]:[e.length,t]).join("|"):r+=t,r+ue}};var Dt=g;var $e=ge(vt(),1);function Y(t,e,{target:r="stdout",...o}={}){return $e.default[r]?Dt.link(t,e):o.fallback===!1?t:typeof o.fallback=="function"?o.fallback(t,e):`${t} (\u200B${e}\u200B)`}Y.isSupported=$e.default.stdout;Y.stderr=(t,e,r={})=>Y(t,e,{target:"stderr",...r});Y.stderr.isSupported=$e.default.stderr;h();var St=ge(Fe(),1);import{setTimeout as ir}from"node:timers/promises";var Kr=(t,e)=>ir((0,St.default)(t),void 0,e),qe=class{resolution;rejection;pendingPromise;constructor(e){this.pendingPromise=e,e.then(r=>(this.resolution=r,r)).catch(r=>{this.rejection=r}).finally(()=>{delete this.pendingPromise})}async unwrap(){if(this.pendingPromise)return await this.pendingPromise;if(this.rejection)throw this.rejection;return this.resolution}},xe=class{[Symbol.toStringTag];resolve;reject;_promise;constructor(){this._promise=new qe(new Promise((e,r)=>{this.resolve=e,this.reject=r})),this[Symbol.toStringTag]=String(this._promise.pendingPromise)}then(e,r){return this._promise.unwrap().then(e,r)}catch(e){return this._promise.unwrap().catch(e)}finally(e){return this._promise.unwrap().finally(e)}};h();var ze=ge(Et(),1);h();import{randomUUID as or}from"node:crypto";h();var Tt=ge(Fe(),1);import We from"node:os";var X,kt=async t=>{t.args["--telemetry"]&&(X=await import("./esm-GJ7RK6IC.js"),X.init({dsn:"https://0c26e0d8afd94e77a88ee1c3aa9e7065@o250689.ingest.sentry.io/6703266",enabled:N.productionLike&&(t.args["--telemetry"]??!1),release:oe.version,environment:oe.version.includes("experimental")?"experimental":"production"}))},$t=async(t,e)=>{if(!X)return;let{maybeGetCurrentApp:r,maybeGetCurrentEnv:o}=await import("./context-GN36UFJL.js"),{maybeGetCurrentUser:n}=await import("./user-B2RIDVTH.js"),c=n(t);X.captureException(e,{event_id:e.id,captureContext:{user:c&&{id:String(c.id),email:c.email,username:c.name??void 0},tags:{application_id:r(t)?.id,environment_id:o(t)?.id,arch:U.arch,bug:e.isBug,environment:N.value,platform:U.platform,shell:U.shell,version:oe.version},contexts:{ctx:{argv:process.argv,args:t.args},cause:e.cause?Q(e.cause):void 0,app:{app_name:oe.name,app_version:oe.version},device:{name:We.hostname(),family:We.type(),arch:We.arch()},runtime:{name:process.release.name,version:process.version}}}}),await X.flush((0,Tt.default)("2s"))},xt=t=>{X&&X.addBreadcrumb(t)};var sr=async(t,e)=>{if(st(e))return t.log.debug("aborting without reporting error",{error:e}),process.exit(1);t.log.error("reporting error and exiting",{error:e});try{let r=q.from(e);if(r.print(),r.isBug===ee.NO)return;await $t(t,r)}finally{process.exit(1)}},mn=async t=>{t.log.debug("installing error handlers"),await kt(t);let e=r=>void sr(t,r);process.once("uncaughtException",e),process.once("unhandledRejection",e)},ee=Object.freeze({YES:"yes",NO:"no",MAYBE:"maybe"}),q=class t extends Error{id=N.testLike?"00000000-0000-0000-0000-000000000000":or();cause;stack;constructor(e){super(e),Error.captureStackTrace(this,this.constructor),this.stack=lt(this.stack,{pretty:!0,basePath:ut})}static from(e){return e instanceof t?e:new Re(e)}sprint(){let e=this.render();if(this.isBug!==ee.NO){e=Ee(e);let r=this.isBug===ee.YES?"This is a bug":"If you think this is a bug",o=`https://github.com/gadget-inc/ggt/issues/new?template=bug_report.yml&error-id=${this.id}`;Y.isSupported?e+=Ee({ensureEmptyLineAbove:!0,content:Ne`
1
+ import{$ as ft,B as k,F as oe,G as N,H as U,L as Ie,M as at,R as lt,U as ut,W as ct,X as me,Y as Q,Z as Ne,_ as Ee,a as nt,b as Se,f as it,g as ot,h as Be,o as st,z as V}from"./chunk-KGOVR5SK.js";import{a as dt}from"./chunk-F3EZ4KS3.js";import{a as rt,c as he,e as ge,g as h}from"./chunk-5WC5D4WL.js";var Fe=he((Rr,pt)=>{h();var se=1e3,ae=se*60,le=ae*60,Z=le*24,qt=Z*7,Kt=Z*365.25;pt.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Wt(t);if(r==="number"&&isFinite(t))return e.long?Jt(t):zt(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Wt(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return r*Kt;case"weeks":case"week":case"w":return r*qt;case"days":case"day":case"d":return r*Z;case"hours":case"hour":case"hrs":case"hr":case"h":return r*le;case"minutes":case"minute":case"mins":case"min":case"m":return r*ae;case"seconds":case"second":case"secs":case"sec":case"s":return r*se;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function zt(t){var e=Math.abs(t);return e>=Z?Math.round(t/Z)+"d":e>=le?Math.round(t/le)+"h":e>=ae?Math.round(t/ae)+"m":e>=se?Math.round(t/se)+"s":t+"ms"}function Jt(t){var e=Math.abs(t);return e>=Z?Te(t,e,Z,"day"):e>=le?Te(t,e,le,"hour"):e>=ae?Te(t,e,ae,"minute"):e>=se?Te(t,e,se,"second"):t+" ms"}function Te(t,e,r,o){var n=e>=r*1.5;return Math.round(t/r)+" "+o+(n?"s":"")}});var ht=he((Pe,je)=>{h();(function(t,e){typeof Pe=="object"&&typeof je<"u"?je.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Pe,function(){"use strict";var t=1e3,e=6e4,r=36e5,o="millisecond",n="second",c="minute",b="hour",p="day",A="week",w="month",L="quarter",O="year",x="date",M="Invalid Date",Le=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,K={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(u){var a=["th","st","nd","rd"],i=u%100;return"["+u+(a[(i-20)%10]||a[i]||a[0])+"]"}},ne=function(u,a,i){var l=String(u);return!l||l.length>=a?u:""+Array(a+1-l.length).join(i)+u},Ue={s:ne,z:function(u){var a=-u.utcOffset(),i=Math.abs(a),l=Math.floor(i/60),s=i%60;return(a<=0?"+":"-")+ne(l,2,"0")+":"+ne(s,2,"0")},m:function u(a,i){if(a.date()<i.date())return-u(i,a);var l=12*(i.year()-a.year())+(i.month()-a.month()),s=a.clone().add(l,w),f=i-s<0,d=a.clone().add(l+(f?-1:1),w);return+(-(l+(i-s)/(f?s-d:d-s))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:w,y:O,w:A,d:p,D:x,h:b,m:c,s:n,ms:o,Q:L}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},fe="en",W={};W[fe]=K;var et="$isDayjsObject",_e=function(u){return u instanceof Oe||!(!u||!u[et])},Ae=function u(a,i,l){var s;if(!a)return fe;if(typeof a=="string"){var f=a.toLowerCase();W[f]&&(s=f),i&&(W[f]=i,s=f);var d=a.split("-");if(!s&&d.length>1)return u(d[0])}else{var D=a.name;W[D]=a,s=D}return!l&&s&&(fe=s),s||!l&&fe},S=function(u,a){if(_e(u))return u.clone();var i=typeof a=="object"?a:{};return i.date=u,i.args=arguments,new Oe(i)},y=Ue;y.l=Ae,y.i=_e,y.w=function(u,a){return S(u,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var Oe=function(){function u(i){this.$L=Ae(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[et]=!0}var a=u.prototype;return a.parse=function(i){this.$d=function(l){var s=l.date,f=l.utc;if(s===null)return new Date(NaN);if(y.u(s))return new Date;if(s instanceof Date)return new Date(s);if(typeof s=="string"&&!/Z$/i.test(s)){var d=s.match(Le);if(d){var D=d[2]-1||0,R=(d[7]||"0").substring(0,3);return f?new Date(Date.UTC(d[1],D,d[3]||1,d[4]||0,d[5]||0,d[6]||0,R)):new Date(d[1],D,d[3]||1,d[4]||0,d[5]||0,d[6]||0,R)}}return new Date(s)}(i),this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return y},a.isValid=function(){return this.$d.toString()!==M},a.isSame=function(i,l){var s=S(i);return this.startOf(l)<=s&&s<=this.endOf(l)},a.isAfter=function(i,l){return S(i)<this.startOf(l)},a.isBefore=function(i,l){return this.endOf(l)<S(i)},a.$g=function(i,l,s){return y.u(i)?this[l]:this.set(s,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,l){var s=this,f=!!y.u(l)||l,d=y.p(i),D=function(J,$){var G=y.w(s.$u?Date.UTC(s.$y,$,J):new Date(s.$y,$,J),s);return f?G:G.endOf(p)},R=function(J,$){return y.w(s.toDate()[J].apply(s.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice($)),s)},B=this.$W,T=this.$M,C=this.$D,ie="set"+(this.$u?"UTC":"");switch(d){case O:return f?D(1,0):D(31,11);case w:return f?D(1,T):D(0,T+1);case A:var z=this.$locale().weekStart||0,de=(B<z?B+7:B)-z;return D(f?C-de:C+(6-de),T);case p:case x:return R(ie+"Hours",0);case b:return R(ie+"Minutes",1);case c:return R(ie+"Seconds",2);case n:return R(ie+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,l){var s,f=y.p(i),d="set"+(this.$u?"UTC":""),D=(s={},s[p]=d+"Date",s[x]=d+"Date",s[w]=d+"Month",s[O]=d+"FullYear",s[b]=d+"Hours",s[c]=d+"Minutes",s[n]=d+"Seconds",s[o]=d+"Milliseconds",s)[f],R=f===p?this.$D+(l-this.$W):l;if(f===w||f===O){var B=this.clone().set(x,1);B.$d[D](R),B.init(),this.$d=B.set(x,Math.min(this.$D,B.daysInMonth())).$d}else D&&this.$d[D](R);return this.init(),this},a.set=function(i,l){return this.clone().$set(i,l)},a.get=function(i){return this[y.p(i)]()},a.add=function(i,l){var s,f=this;i=Number(i);var d=y.p(l),D=function(T){var C=S(f);return y.w(C.date(C.date()+Math.round(T*i)),f)};if(d===w)return this.set(w,this.$M+i);if(d===O)return this.set(O,this.$y+i);if(d===p)return D(1);if(d===A)return D(7);var R=(s={},s[c]=e,s[b]=r,s[n]=t,s)[d]||1,B=this.$d.getTime()+i*R;return y.w(B,this)},a.subtract=function(i,l){return this.add(-1*i,l)},a.format=function(i){var l=this,s=this.$locale();if(!this.isValid())return s.invalidDate||M;var f=i||"YYYY-MM-DDTHH:mm:ssZ",d=y.z(this),D=this.$H,R=this.$m,B=this.$M,T=s.weekdays,C=s.months,ie=s.meridiem,z=function($,G,pe,ve){return $&&($[G]||$(l,f))||pe[G].slice(0,ve)},de=function($){return y.s(D%12||12,$,"0")},J=ie||function($,G,pe){var ve=$<12?"AM":"PM";return pe?ve.toLowerCase():ve};return f.replace(v,function($,G){return G||function(pe){switch(pe){case"YY":return String(l.$y).slice(-2);case"YYYY":return y.s(l.$y,4,"0");case"M":return B+1;case"MM":return y.s(B+1,2,"0");case"MMM":return z(s.monthsShort,B,C,3);case"MMMM":return z(C,B);case"D":return l.$D;case"DD":return y.s(l.$D,2,"0");case"d":return String(l.$W);case"dd":return z(s.weekdaysMin,l.$W,T,2);case"ddd":return z(s.weekdaysShort,l.$W,T,3);case"dddd":return T[l.$W];case"H":return String(D);case"HH":return y.s(D,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return J(D,R,!0);case"A":return J(D,R,!1);case"m":return String(R);case"mm":return y.s(R,2,"0");case"s":return String(l.$s);case"ss":return y.s(l.$s,2,"0");case"SSS":return y.s(l.$ms,3,"0");case"Z":return d}return null}($)||d.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,l,s){var f,d=this,D=y.p(l),R=S(i),B=(R.utcOffset()-this.utcOffset())*e,T=this-R,C=function(){return y.m(d,R)};switch(D){case O:f=C()/12;break;case w:f=C();break;case L:f=C()/3;break;case A:f=(T-B)/6048e5;break;case p:f=(T-B)/864e5;break;case b:f=T/r;break;case c:f=T/e;break;case n:f=T/t;break;default:f=T}return s?f:y.a(f)},a.daysInMonth=function(){return this.endOf(w).$D},a.$locale=function(){return W[this.$L]},a.locale=function(i,l){if(!i)return this.$L;var s=this.clone(),f=Ae(i,l,!0);return f&&(s.$L=f),s},a.clone=function(){return y.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},u}(),tt=Oe.prototype;return S.prototype=tt,[["$ms",o],["$s",n],["$m",c],["$H",b],["$W",p],["$M",w],["$y",O],["$D",x]].forEach(function(u){tt[u[1]]=function(a){return this.$g(a,u[0],u[1])}}),S.extend=function(u,a){return u.$i||(u(a,Oe,S),u.$i=!0),S},S.locale=Ae,S.isDayjs=_e,S.unix=function(u){return S(1e3*u)},S.en=W[fe],S.Ls=W,S.p={},S})});var Lt=he((Fr,Rt)=>{"use strict";h();var tr=rt("os"),bt=rt("tty"),_=dt(),{env:E}=process,H;_("no-color")||_("no-colors")||_("color=false")||_("color=never")?H=0:(_("color")||_("colors")||_("color=true")||_("color=always"))&&(H=1);"FORCE_COLOR"in E&&(E.FORCE_COLOR==="true"?H=1:E.FORCE_COLOR==="false"?H=0:H=E.FORCE_COLOR.length===0?1:Math.min(parseInt(E.FORCE_COLOR,10),3));function Ve(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function He(t,e){if(H===0)return 0;if(_("color=16m")||_("color=full")||_("color=truecolor"))return 3;if(_("color=256"))return 2;if(t&&!e&&H===void 0)return 0;let r=H||0;if(E.TERM==="dumb")return r;if(process.platform==="win32"){let o=tr.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in E)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in E)||E.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in E)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(E.TEAMCITY_VERSION)?1:0;if(E.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in E){let o=parseInt((E.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(E.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(E.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(E.TERM)||"COLORTERM"in E?1:r}function rr(t){let e=He(t,t&&t.isTTY);return Ve(e)}Rt.exports={supportsColor:rr,stdout:Ve(He(!0,bt.isatty(1))),stderr:Ve(He(!0,bt.isatty(2)))}});var vt=he((jr,Ot)=>{"use strict";h();var nr=Lt(),ce=dt();function At(t){if(/^\d{3,4}$/.test(t)){let r=/(\d{1,2})(\d{2})/.exec(t);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let e=(t||"").split(".").map(r=>parseInt(r,10));return{major:e[0],minor:e[1],patch:e[2]}}function Ye(t){let{env:e}=process;if("FORCE_HYPERLINK"in e)return!(e.FORCE_HYPERLINK.length>0&&parseInt(e.FORCE_HYPERLINK,10)===0);if(ce("no-hyperlink")||ce("no-hyperlinks")||ce("hyperlink=false")||ce("hyperlink=never"))return!1;if(ce("hyperlink=true")||ce("hyperlink=always")||"NETLIFY"in e)return!0;if(!nr.supportsColor(t)||t&&!t.isTTY||process.platform==="win32"||"CI"in e||"TEAMCITY_VERSION"in e)return!1;if("TERM_PROGRAM"in e){let r=At(e.TERM_PROGRAM_VERSION);switch(e.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in e){if(e.VTE_VERSION==="0.50.0")return!1;let r=At(e.VTE_VERSION);return r.major>0||r.minor>=50}return!1}Ot.exports={supportsHyperlink:Ye,stdout:Ye(process.stdout),stderr:Ye(process.stderr)}});var Et=he((Jr,Bt)=>{h();var Ke=Symbol("arg flag"),I=class t extends Error{constructor(e,r){super(e),this.name="ArgError",this.code=r,Object.setPrototypeOf(this,t.prototype)}};function be(t,{argv:e=process.argv.slice(2),permissive:r=!1,stopAtPositional:o=!1}={}){if(!t)throw new I("argument specification object is required","ARG_CONFIG_NO_SPEC");let n={_:[]},c={},b={};for(let p of Object.keys(t)){if(!p)throw new I("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(p[0]!=="-")throw new I(`argument key must start with '-' but found: '${p}'`,"ARG_CONFIG_NONOPT_KEY");if(p.length===1)throw new I(`argument key must have a name; singular '-' keys are not allowed: ${p}`,"ARG_CONFIG_NONAME_KEY");if(typeof t[p]=="string"){c[p]=t[p];continue}let A=t[p],w=!1;if(Array.isArray(A)&&A.length===1&&typeof A[0]=="function"){let[L]=A;A=(O,x,M=[])=>(M.push(L(O,x,M[M.length-1])),M),w=L===Boolean||L[Ke]===!0}else if(typeof A=="function")w=A===Boolean||A[Ke]===!0;else throw new I(`type missing or not a function or valid array type: ${p}`,"ARG_CONFIG_VAD_TYPE");if(p[1]!=="-"&&p.length>2)throw new I(`short argument keys (with a single hyphen) must have only one character: ${p}`,"ARG_CONFIG_SHORTOPT_TOOLONG");b[p]=[A,w]}for(let p=0,A=e.length;p<A;p++){let w=e[p];if(o&&n._.length>0){n._=n._.concat(e.slice(p));break}if(w==="--"){n._=n._.concat(e.slice(p+1));break}if(w.length>1&&w[0]==="-"){let L=w[1]==="-"||w.length===2?[w]:w.slice(1).split("").map(O=>`-${O}`);for(let O=0;O<L.length;O++){let x=L[O],[M,Le]=x[1]==="-"?x.split(/=(.*)/,2):[x,void 0],v=M;for(;v in c;)v=c[v];if(!(v in b))if(r){n._.push(x);continue}else throw new I(`unknown or unexpected option: ${M}`,"ARG_UNKNOWN_OPTION");let[K,ne]=b[v];if(!ne&&O+1<L.length)throw new I(`option requires argument (but was followed by another short argument): ${M}`,"ARG_MISSING_REQUIRED_SHORTARG");if(ne)n[v]=K(!0,v,n[v]);else if(Le===void 0){if(e.length<p+2||e[p+1].length>1&&e[p+1][0]==="-"&&!(e[p+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(K===Number||typeof BigInt<"u"&&K===BigInt))){let Ue=M===v?"":` (alias for ${v})`;throw new I(`option requires argument: ${M}${Ue}`,"ARG_MISSING_REQUIRED_LONGARG")}n[v]=K(e[p+1],v,n[v]),++p}else n[v]=K(Le,v,n[v])}}else n._.push(w)}return n}be.flag=t=>(t[Ke]=!0,t);be.COUNT=be.flag((t,e,r)=>(r||0)+1);be.ArgError=I;Bt.exports=be});h();h();h();import P from"node:process";function ye(){return P.platform!=="win32"?P.env.TERM!=="linux":!!P.env.WT_SESSION||!!P.env.TERMINUS_SUBLIME||P.env.ConEmuTask==="{cmd::Cmder}"||P.env.TERM_PROGRAM==="Terminus-Sublime"||P.env.TERM_PROGRAM==="vscode"||P.env.TERM==="xterm-256color"||P.env.TERM==="alacritty"||P.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var gt={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},mt={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Qt={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Ge={...gt,...mt},Zt={...gt,...Qt},Xt=ye(),er=Xt?Ge:Zt,yt=er,Er=Object.entries(mt);var we={...N.testLike?Ge:yt};if(ye()&&U.windowsOrWsl)for(let t of["tick","cross"])we[t]+=" ";h();h();var m="\x1B[",De="\x1B]",ue="\x07",ke=";",wt=process.env.TERM_PROGRAM==="Apple_Terminal",g={};g.cursorTo=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?m+(t+1)+"G":m+(e+1)+";"+(t+1)+"H"};g.cursorMove=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");let r="";return t<0?r+=m+-t+"D":t>0&&(r+=m+t+"C"),e<0?r+=m+-e+"A":e>0&&(r+=m+e+"B"),r};g.cursorUp=(t=1)=>m+t+"A";g.cursorDown=(t=1)=>m+t+"B";g.cursorForward=(t=1)=>m+t+"C";g.cursorBackward=(t=1)=>m+t+"D";g.cursorLeft=m+"G";g.cursorSavePosition=wt?"\x1B7":m+"s";g.cursorRestorePosition=wt?"\x1B8":m+"u";g.cursorGetPosition=m+"6n";g.cursorNextLine=m+"E";g.cursorPrevLine=m+"F";g.cursorHide=m+"?25l";g.cursorShow=m+"?25h";g.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=g.eraseLine+(r<t-1?g.cursorUp():"");return t&&(e+=g.cursorLeft),e};g.eraseEndLine=m+"K";g.eraseStartLine=m+"1K";g.eraseLine=m+"2K";g.eraseDown=m+"J";g.eraseUp=m+"1J";g.eraseScreen=m+"2J";g.scrollUp=m+"S";g.scrollDown=m+"T";g.clearScreen="\x1Bc";g.clearTerminal=process.platform==="win32"?`${g.eraseScreen}${m}0f`:`${g.eraseScreen}${m}3J${m}H`;g.beep=ue;g.link=(t,e)=>[De,"8",ke,ke,e,ue,t,De,"8",ke,ke,ue].join("");g.image=(t,e={})=>{let r=`${De}1337;File=inline=1`;return e.width&&(r+=`;width=${e.width}`),e.height&&(r+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+t.toString("base64")+ue};g.iTerm={setCwd:(t=process.cwd())=>`${De}50;CurrentDir=${t}${ue}`,annotation:(t,e={})=>{let r=`${De}1337;`,o=typeof e.x<"u",n=typeof e.y<"u";if((o||n)&&!(o&&n&&typeof e.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return t=t.replace(/\|/g,""),r+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?r+=(o?[t,e.length,e.x,e.y]:[e.length,t]).join("|"):r+=t,r+ue}};var Dt=g;var $e=ge(vt(),1);function Y(t,e,{target:r="stdout",...o}={}){return $e.default[r]?Dt.link(t,e):o.fallback===!1?t:typeof o.fallback=="function"?o.fallback(t,e):`${t} (\u200B${e}\u200B)`}Y.isSupported=$e.default.stdout;Y.stderr=(t,e,r={})=>Y(t,e,{target:"stderr",...r});Y.stderr.isSupported=$e.default.stderr;h();var St=ge(Fe(),1);import{setTimeout as ir}from"node:timers/promises";var Kr=(t,e)=>ir((0,St.default)(t),void 0,e),qe=class{resolution;rejection;pendingPromise;constructor(e){this.pendingPromise=e,e.then(r=>(this.resolution=r,r)).catch(r=>{this.rejection=r}).finally(()=>{delete this.pendingPromise})}async unwrap(){if(this.pendingPromise)return await this.pendingPromise;if(this.rejection)throw this.rejection;return this.resolution}},xe=class{[Symbol.toStringTag];resolve;reject;_promise;constructor(){this._promise=new qe(new Promise((e,r)=>{this.resolve=e,this.reject=r})),this[Symbol.toStringTag]=String(this._promise.pendingPromise)}then(e,r){return this._promise.unwrap().then(e,r)}catch(e){return this._promise.unwrap().catch(e)}finally(e){return this._promise.unwrap().finally(e)}};h();var ze=ge(Et(),1);h();import{randomUUID as or}from"node:crypto";h();var Tt=ge(Fe(),1);import We from"node:os";var X,kt=async t=>{t.args["--telemetry"]&&(X=await import("./esm-GJ7RK6IC.js"),X.init({dsn:"https://0c26e0d8afd94e77a88ee1c3aa9e7065@o250689.ingest.sentry.io/6703266",enabled:N.productionLike&&(t.args["--telemetry"]??!1),release:oe.version,environment:oe.version.includes("experimental")?"experimental":"production"}))},$t=async(t,e)=>{if(!X)return;let{maybeGetCurrentApp:r,maybeGetCurrentEnv:o}=await import("./context-L5YSPF3X.js"),{maybeGetCurrentUser:n}=await import("./user-C34J52UL.js"),c=n(t);X.captureException(e,{event_id:e.id,captureContext:{user:c&&{id:String(c.id),email:c.email,username:c.name??void 0},tags:{application_id:r(t)?.id,environment_id:o(t)?.id,arch:U.arch,bug:e.isBug,environment:N.value,platform:U.platform,shell:U.shell,version:oe.version},contexts:{ctx:{argv:process.argv,args:t.args},cause:e.cause?Q(e.cause):void 0,app:{app_name:oe.name,app_version:oe.version},device:{name:We.hostname(),family:We.type(),arch:We.arch()},runtime:{name:process.release.name,version:process.version}}}}),await X.flush((0,Tt.default)("2s"))},xt=t=>{X&&X.addBreadcrumb(t)};var sr=async(t,e)=>{if(st(e))return t.log.debug("aborting without reporting error",{error:e}),process.exit(1);t.log.error("reporting error and exiting",{error:e});try{let r=q.from(e);if(r.print(),r.isBug===ee.NO)return;await $t(t,r)}finally{process.exit(1)}},mn=async t=>{t.log.debug("installing error handlers"),await kt(t);let e=r=>void sr(t,r);process.once("uncaughtException",e),process.once("unhandledRejection",e)},ee=Object.freeze({YES:"yes",NO:"no",MAYBE:"maybe"}),q=class t extends Error{id=N.testLike?"00000000-0000-0000-0000-000000000000":or();cause;stack;constructor(e){super(e),Error.captureStackTrace(this,this.constructor),this.stack=lt(this.stack,{pretty:!0,basePath:ut})}static from(e){return e instanceof t?e:new Re(e)}sprint(){let e=this.render();if(this.isBug!==ee.NO){e=Ee(e);let r=this.isBug===ee.YES?"This is a bug":"If you think this is a bug",o=`https://github.com/gadget-inc/ggt/issues/new?template=bug_report.yml&error-id=${this.id}`;Y.isSupported?e+=Ee({ensureEmptyLineAbove:!0,content:Ne`
2
2
  ${r}, ${Y("click here",o)} to create an issue on GitHub.
3
3
  `}):e+=Ee({ensureEmptyLineAbove:!0,content:Ne`
4
4
  ${r}, use the link below to create an issue on GitHub.
@@ -8,5 +8,5 @@ import{$ as ft,B as k,F as oe,G as N,H as U,L as Ie,M as at,R as lt,U as ut,W as
8
8
 
9
9
  `+o}},Mt=class extends q{constructor(r,o){super(r);this.cause=o}isBug=ee.MAYBE;render(){return this.message}};var Qe=(t,e)=>{let r={},o={};for(let[n,c]of Object.entries(t)){if(!("type"in c)){r[n]=c;continue}if(r[n]=c.type,o[n]=c.default,c.alias)for(let b of Array.isArray(c.alias)?c.alias:[c.alias])r[b]=n}try{let n=(0,ze.default)(r,e);for(let[c,b]of Object.entries(o))it(n[c])&&(n[c]=b);return n}catch(n){throw n instanceof ze.default.ArgError&&(n=new Je(n.message)),n instanceof q?n:new Re(n)}},Je=class extends q{isBug=ee.NO;render(){return`${Se.redBright(we.cross)} `+this.message}};h();h();h();h();h();var Ct=(t,e,r,o)=>JSON.stringify({level:t,name:e,msg:Ie(r).trim(),fields:Ut(o)})+`
10
10
  `,Ut=t=>{let e={};for(let[r,o]of Object.entries(t))e[r]=_t(o);return e},_t=t=>(t instanceof Set&&(t=Array.from(t)),Array.isArray(t)?t.map(_t):(t instanceof Map&&(t=Object.fromEntries(t.entries())),Be(t)?Ut(t):ot(t)?Ie(t).trim():t));h();var Ft=ge(ht(),1);import ar from"node:assert";var Pt=(t,e,r,o)=>`${yr()} ${wr(t)} ${Dr(e)}:${br(r)}${Gt(o)}${j}`,F=new nt({level:N.testLike&&U.logLevel<k.PRINT?3:Se.level}),lr=F.hex("#86B5F7"),ur=F.hex("#B2D0FA"),Me=F.hex("#D6D6D6"),cr=F.hex("#C2C2C2"),fr=F.hex("#9DE6A4"),dr=F.hex("#BEEEC3"),pr=F.hex("#EEAC78"),It=F.hex("#F4C7A4"),hr=F.hex("#FAACB5"),jt=F.hex("#A64E4E"),Ze=F.hex("#FFFFFF"),Ce="",re=" ",j=`
11
- `,gr=":",Nt="'",mr=(t,e)=>{let r=t==="error"?jt:Me,o=[];o.push(j);for(let n=0;n<e;n++)o.push(re);return o.push(r(t)),o.push(gr),o.join("")},te=(t,e,r)=>{let o=t.split(j);if(o.length===0)return Ce;let n=[],c=o.shift();ar(c),n.push(e(c));for(let b of o)if(b){n.push(j);for(let p=0;p<r;p++)n.push(re);n.push(e(b))}return n.join(Ce)},Gt=(t,e=2)=>{if(Object.keys(t).length===0)return Ce;let r=[];for(let[o,n]of Object.entries(t)){if(r.push(mr(o,e)),n instanceof Set&&(n=Array.from(n)),Array.isArray(n)){if(n.length===0){r.push(te(" []",Me,e));continue}n=Object.fromEntries(n.entries())}if(n instanceof Map&&(n=Object.fromEntries(n)),Be(n)){let c=Object.entries(n);if(c.length===0){r.push(te(" {}",Me,e));continue}c.length>10&&U.logLevel>k.TRACE&&(n=Object.fromEntries([...c.slice(0,10),[we.ellipsis,`${c.length-10} more`]])),r.push(Gt(n,e+2));continue}switch(r.push(re),typeof n){case"string":r.push(te(Nt+n.replaceAll(j,j+re.repeat(e+o.length))+Nt,ur,e));break;case"number":r.push(te(String(n),It,e));break;case"bigint":r.push(te(String(n)+"n",It,e));break;case"boolean":r.push(te(String(n),dr,e));break;default:r.push(te(String(n),Ze,e));break}}return r.join(Ce)},yr=()=>{let t=(0,Ft.default)().format("hh:mm:ss");return cr(t)},wr=t=>{switch(t){case k.PRINT:return Me("PRINT");case k.TRACE:return lr("TRACE");case k.DEBUG:return pr("DEBUG");case k.INFO:return fr("INFO");case k.WARN:return hr("WARN");case k.ERROR:return jt("ERROR")}},Dr=t=>Ze(t),br=t=>{let e=t.split(j);return e.length===1?re+Ze(t):j+e.map(r=>re+re+r).join(j)};var Vt={pretty:Pt,json:Ct};var Ht=({name:t,fields:e={},devFields:r={}})=>{let o=n=>(c,b,p)=>{let A=n>=U.logLevel,w=n>=k.INFO;if(!A&&!w)return;let L={...V(e),...b};if(N.developmentOrTestLike&&Object.assign(L,V(r),p),"error"in L&&(L.error=Q(L.error)),"reason"in L&&(L.reason=Q(L.reason)),A){let O=Vt[U.logFormat];at.writeStderr(O(n,t,c,L))}w&&xt({level:"log",message:c,data:L})};return{trace:o(k.TRACE),debug:o(k.DEBUG),info:o(k.INFO),warn:o(k.WARN),error:o(k.ERROR)}};var Xe=({name:t,fields:e,devFields:r})=>({...Ht({name:t,fields:e,devFields:r}),child:({name:o,fields:n,devFields:c})=>Xe({name:o||t,fields:()=>({...V(e),...V(n)}),devFields:{...V(r),...V(c)}})});var Yt=class t extends AbortController{args;done=new xe;#t;#e;#r=[];constructor({args:e,log:r,values:o}){super(),this.args=e,this.#t=r,this.#e=o,this.abort=this.abort.bind(this),this.child=this.child.bind(this),this.onAbort=this.onAbort.bind(this),this.signal.addEventListener("abort",async()=>{let n;for(let c of this.#r.reverse())try{await c(this.signal.reason)}catch(b){n??=b,this.log.error("error during abort",{error:n})}n?this.done.reject(n):this.done.resolve()})}get log(){return this.#t}static init({parse:e,...r}){return new t({args:e?Qe(e,me(r,["argv","permissive","stopAtPositional"])):{},log:Xe(me(r,["name","fields","devFields"])),values:{}})}get(e){return this.#e[e]}set(e,r){this.#e[e]=r}child({parse:e,...r}){let o=new t({args:{...this.args,...r.overwrite,...e?Qe(e,ct(me(r,["argv","permissive","stopAtPositional"]),{argv:this.args._})):{}},log:this.log.child(me(r,["name","fields","devFields"])),values:this.#e});return this.onAbort(()=>o.abort()),o}onAbort(e){this.#r.push(e)}};export{Fe as a,Et as b,ht as c,we as d,Y as e,Kr as f,Je as g,Yt as h,sr as i,mn as j,ee as k,q as l,Mt as m};
12
- //# sourceMappingURL=chunk-VICN6LTV.js.map
11
+ `,gr=":",Nt="'",mr=(t,e)=>{let r=t==="error"?jt:Me,o=[];o.push(j);for(let n=0;n<e;n++)o.push(re);return o.push(r(t)),o.push(gr),o.join("")},te=(t,e,r)=>{let o=t.split(j);if(o.length===0)return Ce;let n=[],c=o.shift();ar(c),n.push(e(c));for(let b of o)if(b){n.push(j);for(let p=0;p<r;p++)n.push(re);n.push(e(b))}return n.join(Ce)},Gt=(t,e=2)=>{if(Object.keys(t).length===0)return Ce;let r=[];for(let[o,n]of Object.entries(t)){if(r.push(mr(o,e)),n instanceof Set&&(n=Array.from(n)),Array.isArray(n)){if(n.length===0){r.push(te(" []",Me,e));continue}n=Object.fromEntries(n.entries())}if(n instanceof Map&&(n=Object.fromEntries(n)),Be(n)){let c=Object.entries(n);if(c.length===0){r.push(te(" {}",Me,e));continue}c.length>10&&U.logLevel>k.TRACE&&(n=Object.fromEntries([...c.slice(0,10),[we.ellipsis,`${c.length-10} more`]])),r.push(Gt(n,e+2));continue}switch(r.push(re),typeof n){case"string":r.push(te(Nt+n.replaceAll(j,j+re.repeat(e+o.length))+Nt,ur,e));break;case"number":r.push(te(String(n),It,e));break;case"bigint":r.push(te(String(n)+"n",It,e));break;case"boolean":r.push(te(String(n),dr,e));break;default:r.push(te(String(n),Ze,e));break}}return r.join(Ce)},yr=()=>{let t=(0,Ft.default)().format("hh:mm:ss");return cr(t)},wr=t=>{switch(t){case k.PRINT:return Me("PRINT");case k.TRACE:return lr("TRACE");case k.DEBUG:return pr("DEBUG");case k.INFO:return fr("INFO");case k.WARN:return hr("WARN");case k.ERROR:return jt("ERROR")}},Dr=t=>Ze(t),br=t=>{let e=t.split(j);return e.length===1?re+Ze(t):j+e.map(r=>re+re+r).join(j)};var Vt={pretty:Pt,json:Ct};var Ht=({name:t,fields:e={},devFields:r={}})=>{let o=n=>(c,b,p)=>{let A=n>=U.logLevel,w=n>=k.INFO;if(!A&&!w)return;let L={...V(e),...b};if(N.developmentOrTestLike&&Object.assign(L,V(r),p),"error"in L&&(L.error=Q(L.error)),"reason"in L&&(L.reason=Q(L.reason)),A){let O=Vt[U.logFormat];at.writeStderr(O(n,t,c,L))}w&&xt({level:"log",message:c,data:L})};return{trace:o(k.TRACE),debug:o(k.DEBUG),info:o(k.INFO),warn:o(k.WARN),error:o(k.ERROR)}};var Xe=({name:t,fields:e,devFields:r})=>({...Ht({name:t,fields:e,devFields:r}),child:({name:o,fields:n,devFields:c})=>Xe({name:o||t,fields:()=>({...V(e),...V(n)}),devFields:{...V(r),...V(c)}})});var Yt=class t extends AbortController{args;done=new xe;#t;#e;#r=[];constructor({args:e,log:r,values:o}){super(),this.args=e,this.#t=r,this.#e=o,this.abort=this.abort.bind(this),this.child=this.child.bind(this),this.onAbort=this.onAbort.bind(this),this.signal.addEventListener("abort",async()=>{let n;for(let c of this.#r.reverse())try{await c(this.signal.reason)}catch(b){n??=b,this.log.error("error during abort",{error:n})}n?this.done.reject(n):this.done.resolve()})}get log(){return this.#t}static init({parse:e,...r}){return new t({args:e?Qe(e,me(r,["argv","permissive","stopAtPositional"])):{},log:Xe(me(r,["name","fields","devFields"])),values:{}})}get(e){return this.#e[e]}set(e,r){this.#e[e]=r}child({parse:e,...r}){let o=new t({args:{...this.args,...r.overwrite,...e?Qe(e,ct(me(r,["argv","permissive","stopAtPositional"]),{argv:this.args._})):{}},log:this.log.child(me(r,["name","fields","devFields"])),values:this.#e});return this.onAbort(()=>o.abort()),o}onAbort(e){this.#r.push(e)}};export{Fe as a,Et as b,ht as c,we as d,Y as e,Kr as f,Je as g,Yt as h,sr as i,mn as j,ee as k,q as l,Re as m,Mt as n};
12
+ //# sourceMappingURL=chunk-OLKWG2EP.js.map
@@ -1,4 +1,4 @@
1
- import{$ as tt,N as Qt,P as Z,Q as Xt,_ as L}from"./chunk-CQLM5U6T.js";import{a as Q,c as v,e as X,g as p}from"./chunk-5WC5D4WL.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(`
1
+ import{$ as tt,N as Qt,P as Z,Q as Xt,_ as L}from"./chunk-KGOVR5SK.js";import{a as Q,c as v,e as X,g as p}from"./chunk-5WC5D4WL.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-CQLM5U6T.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-5ONACLO6.js.map
11
+ //# sourceMappingURL=chunk-THZRTDWW.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f}from"./chunk-3Q3GPB6Z.js";import"./chunk-VICN6LTV.js";import"./chunk-CQLM5U6T.js";import"./chunk-F3EZ4KS3.js";import"./chunk-GOBNB5VT.js";import"./chunk-5WC5D4WL.js";export{b as getCurrentApp,e as getCurrentEnv,a as maybeGetCurrentApp,d as maybeGetCurrentEnv,c as setCurrentApp,f as setCurrentEnv};
2
- //# sourceMappingURL=context-GN36UFJL.js.map
1
+ import{a,b,c,d,e,f}from"./chunk-3Q3GPB6Z.js";import"./chunk-OLKWG2EP.js";import"./chunk-KGOVR5SK.js";import"./chunk-F3EZ4KS3.js";import"./chunk-GOBNB5VT.js";import"./chunk-5WC5D4WL.js";export{b as getCurrentApp,e as getCurrentEnv,a as maybeGetCurrentApp,d as maybeGetCurrentEnv,c as setCurrentApp,f as setCurrentEnv};
2
+ //# sourceMappingURL=context-L5YSPF3X.js.map
@@ -0,0 +1,25 @@
1
+ import{a as K}from"./chunk-HKBXEZNF.js";import{a as Z}from"./chunk-BYMG3KOL.js";import{b as V,c as G,e as q,j as u,o as W}from"./chunk-DVKNBG4P.js";import{a as z,c as H,d as R,i as J,n as Q,o as Y}from"./chunk-CXYA3RFX.js";import"./chunk-THZRTDWW.js";import"./chunk-AB4I3BMD.js";import{b as X}from"./chunk-BZSAGSV3.js";import"./chunk-D2K5XPNJ.js";import"./chunk-M4PNFOA5.js";import"./chunk-3Q3GPB6Z.js";import{g as A}from"./chunk-6FBP46EB.js";import"./chunk-EFU2JNKY.js";import"./chunk-KMCOZJPU.js";import{e as D,i as O,m as j}from"./chunk-OLKWG2EP.js";import{$ as o,M as L,P as F,Z as l,b as i,m as x}from"./chunk-KGOVR5SK.js";import"./chunk-F3EZ4KS3.js";import"./chunk-GOBNB5VT.js";import{g as M}from"./chunk-5WC5D4WL.js";M();import re from"node:assert";var ve={...Z,"--env":{type:String,alias:["-e","--environment","--from"]},"--allow-problems":{type:Boolean,alias:"--allow-issues"},"--allow-charges":{type:Boolean},"--allow-data-delete":{type:Boolean}},Le=e=>l`
2
+ Deploys your app to production.
3
+
4
+ This command first performs a sync to ensure that your local and environment directories
5
+ match, changes are tracked since last sync. If any conflicts are detected, they must be
6
+ resolved before deployment.
7
+
8
+ {gray Usage}
9
+ $ ggt deploy [options]
10
+
11
+ {gray Options}
12
+ -a, --app <app_name> Selects a specific app to deploy. Default set on ".gadget/sync.json"
13
+ --from, -e, --env <env_name> Selects a specific environment to sync and deploy from. Default set on ".gadget/sync.json"
14
+ --force Deploys by discarding any changes made to the environment directory since last sync
15
+ --allow-different-directory Deploys from any local directory with existing files, even if the ".gadget/sync.json" file is missing
16
+ --allow-different-app Deploys a different app using the --app command, instead of the one specified in the “.gadget/sync.json” file
17
+ --allow-problems Deploys despite any existing issues found in the app (gelly errors, typescript errors etc.)
18
+ --allow-data-delete Deploys even if it results in the deletion of data in production
19
+ --allow-charges Deploys even if it results in additional charges to your plan
20
+
21
+ {gray Examples}
22
+ Deploys code from the staging environment of a myBlog
23
+ {cyanBright $ ggt deploy -a myBlog -from staging}
24
+ `,Ge=async e=>{let E=await Y(process.cwd()),r=await Q.loadOrInit(e,{directory:E});o({ensureEmptyLineAbove:!0,content:`Deploying ${r.env.name} to ${D(r.app.primaryDomain,`https://${r.app.primaryDomain}/`)}`});let w=new W(r),p=await w.hashes(e);if(!p.inSync&&(p.localChangesToPush.size>0||!p.onlyDotGadgetFilesChanged)){await w.print(e,{hashes:p}),o({ensureEmptyLineAbove:!0,content:"Your environment's files must match your local files before you can deploy."});let a=!1;if(L.isInteractive){let s;switch(!0){case p.bothChanged:s=l`Would you like to push your local changes and {underline discard your environment's} changes now?`,a=!0;break;case p.localChangesToPush.size>0:s=l`Would you like to push your local changes now?`;break;case p.environmentChanges.size>0:s=l`Do you want to {underline discard your environment's} changes now?`,a=!0;break;default:K("no changes to push or discard")}await A(s)}else o({ensureEmptyLineAbove:!0,content:"Assuming you want to push your local files now."});await w.push(e,{hashes:p,force:a||e.args["--force"]})}let T={localFilesVersion:String(r.filesVersion),force:e.args["--allow-problems"],allowDeletedData:e.args["--allow-data-delete"],allowCharges:e.args["--allow-charges"]},f,m=t.NOT_STARTED,P=!1,I=r.edit.subscribe({subscription:q,variables:T,onError:async a=>{if(e.log.error("failed to deploy",{error:a}),f?.fail(_(r,m)+" "+u()),x(a.cause)){let s=a.cause[0];if(re(s,"expected graphqlError to be defined"),s.extensions)switch(!0){case s.extensions.requiresUpgrade:o({ensureEmptyLineAbove:!0,content:s.message.replace(/GGT_PAYMENT_REQUIRED:?\s*/,"")}),process.exit(1);break;case s.extensions.requiresAdditionalCharge:o({ensureEmptyLineAbove:!0,content:s.message.replace(/GGT_PAYMENT_REQUIRED:?\s*/,"")}),await A({ensureEmptyLineAbove:!0,content:"Do you want to continue?"}),I.resubscribe({...T,allowCharges:!0});return}}await O(e,a)},onData:async({publishStatus:a})=>{if(!a){e.log.warn("received empty publish status");return}let{publishStarted:s,progress:b,issues:N,status:y,deletedModelsAndFields:te}=a,B=N.length>0,{deletedModels:C,deletedModelFields:U}=te??{deletedModels:[],deletedModelFields:[]},$=C.length>0||U.length>0;if(!P&&(B||$)){P=!0;let c=N.filter(d=>d.severity===z.Fatal);if(c.length>0&&await O(e,new J(R(c))),B&&(o({ensureEmptyLineAbove:!0,content:l`{bold.yellow !} {bold Issues found in your development app}`}),H({problems:R(N)})),$){o({ensureEmptyLineAbove:!0,content:l`{bold.yellow !} {bold Data deleted on deploy}`});let d=i.blueBright("updated"),S=i.redBright("deleted"),h=[];C.forEach(n=>{h.push({symbol:G,name:i.redBright(n),action:S,indent:0})}),U.forEach(({modelIdentifier:n,fields:g})=>{h.push({symbol:V,name:i.blueBright(n),action:d,indent:0}),g.forEach(v=>{h.push({symbol:G,name:i.redBright(v),action:S,indent:2})})});let oe=h.reduce((n,g)=>Math.max(n,g.name.length),0),ne=h.reduce((n,g)=>Math.max(n,g.indent),0),k=2;o({ensureEmptyLineAbove:!0,content:i.gray("These changes will be applied to production based on the app you're deploying.")});for(let n of h){let g=" ".repeat(n.indent*k),v=" ".repeat(oe-n.name.length+2),se=" ".repeat((ne-n.indent)*k);o({ensureEmptyLineAbove:!1,content:F(`${g}${n.symbol} ${n.name}${v}${se}${n.action}`,6)})}}if(!s)await A("Do you want to continue?"),I.resubscribe({...T,force:!0,allowDeletedData:!0});else{let d=e.args["--allow-data-delete"],S=e.args["--allow-problems"];if(!d&&!S)throw new j("expected --allow-data-delete or --allow-problems to be true");S&&o(l`Deploying regardless of problems because "${i.gray("--allow-problems")}" was passed.`),d&&o(l`Deploying regardless of deleted data because "${i.gray("--allow-data-delete")}" was passed.`)}return}if(y?.code==="Errored"){f?.fail(_(r,m)+" "+u()),y.message&&o({ensureEmptyLineAbove:!0,content:i.red(y.message)}),y.output&&o({ensureEmptyLineAbove:!0,content:l`${D("Check logs",y.output)}`});return}if(b===t.COMPLETED){f?.succeed(ee(r,m));let c=i.green("Deploy successful!");y?.output&&(c+=` ${D("Check logs",y.output)}.`),o({ensureEmptyLineAbove:!0,content:c});return}if(b!==m){let c=_(r,b);if(c!==f?.text){f?.succeed(ee(r,m));let d=m===t.NOT_STARTED||!L.isInteractive;f=X({ensureEmptyLineAbove:d,content:c})}m=b}},onComplete:()=>{I.unsubscribe()}})},t=Object.freeze({NOT_STARTED:"NOT_STARTED",STARTING:"STARTING",BUILDING_ASSETS:"BUILDING_ASSETS",UPLOADING_ASSETS:"UPLOADING_ASSETS",CONVERGING_STORAGE:"CONVERGING_STORAGE",PUBLISHING_TREE:"PUBLISHING_TREE",RELOADING_SANDBOX:"RELOADING_SANDBOX",COMPLETED:"COMPLETED"}),_=(e,E)=>{switch(E){case t.NOT_STARTED:case t.STARTING:case t.BUILDING_ASSETS:case t.UPLOADING_ASSETS:return"Building frontend assets.";case t.CONVERGING_STORAGE:return"Setting up database.";case t.PUBLISHING_TREE:return`Copying ${e.env.name}.`;case t.RELOADING_SANDBOX:return"Restarting app.";case t.COMPLETED:return"Deploy complete!";default:return"Unknown step."}},ee=(e,E)=>{switch(E){case t.NOT_STARTED:case t.STARTING:case t.BUILDING_ASSETS:case t.UPLOADING_ASSETS:return`Built frontend assets. ${u()}`;case t.CONVERGING_STORAGE:return`Setup database. ${u()}`;case t.PUBLISHING_TREE:return`Copied ${e.env.name}. ${u()}`;case t.RELOADING_SANDBOX:return`Restarted app. ${u()}`;case t.COMPLETED:return"Deploy successful!";default:return`Completed unknown step. ${u()}`}};export{t as AppDeploymentSteps,ve as args,Ge as run,ee as stepToSpinnerEnd,_ as stepToSpinnerStart,Le as usage};
25
+ //# sourceMappingURL=deploy-PBJEUYGH.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/commands/deploy.ts"],
4
+ "sourcesContent": ["import chalk from \"chalk\";\nimport indentString from \"indent-string\";\nimport assert from \"node:assert\";\nimport terminalLink from \"terminal-link\";\nimport { PUBLISH_STATUS_SUBSCRIPTION } from \"../services/app/edit/operation.js\";\nimport { type Run, type Usage } from \"../services/command/command.js\";\nimport { deletedSymbol, updatedSymbol } from \"../services/filesync/changes.js\";\nimport { DeployDisallowedError } from \"../services/filesync/error.js\";\nimport { FileSync } from \"../services/filesync/filesync.js\";\nimport { SyncJson, loadSyncJsonDirectory } from \"../services/filesync/sync-json.js\";\nimport { confirm } from \"../services/output/confirm.js\";\nimport { output } from \"../services/output/output.js\";\nimport { println } from \"../services/output/print.js\";\nimport { ProblemSeverity, printProblems, publishIssuesToProblems } from \"../services/output/problems.js\";\nimport { UnexpectedError, reportErrorAndExit } from \"../services/output/report.js\";\nimport { spin, type spinner } from \"../services/output/spinner.js\";\nimport { sprint } from \"../services/output/sprint.js\";\nimport { ts } from \"../services/output/timestamp.js\";\nimport { unreachable } from \"../services/util/assert.js\";\nimport { isGraphQLErrors } from \"../services/util/is.js\";\nimport { args as PushArgs } from \"./push.js\";\n\nexport type DeployArgs = typeof args;\n\nexport const args = {\n ...PushArgs,\n \"--env\": { type: String, alias: [\"-e\", \"--environment\", \"--from\"] },\n \"--allow-problems\": { type: Boolean, alias: \"--allow-issues\" },\n \"--allow-charges\": { type: Boolean },\n \"--allow-data-delete\": { type: Boolean },\n};\n\nexport const usage: Usage = (_ctx) => {\n return sprint`\n Deploys your app to production.\n\n This command first performs a sync to ensure that your local and environment directories\n match, changes are tracked since last sync. If any conflicts are detected, they must be\n resolved before deployment.\n\n {gray Usage}\n $ ggt deploy [options]\n\n {gray Options}\n -a, --app <app_name> Selects a specific app to deploy. Default set on \".gadget/sync.json\"\n --from, -e, --env <env_name> Selects a specific environment to sync and deploy from. Default set on \".gadget/sync.json\"\n --force Deploys by discarding any changes made to the environment directory since last sync\n --allow-different-directory Deploys from any local directory with existing files, even if the \".gadget/sync.json\" file is missing\n --allow-different-app Deploys a different app using the --app command, instead of the one specified in the \u201C.gadget/sync.json\u201D file\n --allow-problems Deploys despite any existing issues found in the app (gelly errors, typescript errors etc.)\n --allow-data-delete Deploys even if it results in the deletion of data in production\n --allow-charges Deploys even if it results in additional charges to your plan\n\n {gray Examples}\n Deploys code from the staging environment of a myBlog\n {cyanBright $ ggt deploy -a myBlog -from staging}\n`;\n};\n\nexport const run: Run<DeployArgs> = async (ctx) => {\n const directory = await loadSyncJsonDirectory(process.cwd());\n const syncJson = await SyncJson.loadOrInit(ctx, { directory });\n\n println({\n ensureEmptyLineAbove: true,\n content: `Deploying ${syncJson.env.name} to ${terminalLink(syncJson.app.primaryDomain, `https://${syncJson.app.primaryDomain}/`)}`,\n });\n\n const filesync = new FileSync(syncJson);\n const hashes = await filesync.hashes(ctx);\n if (!hashes.inSync && (hashes.localChangesToPush.size > 0 || !hashes.onlyDotGadgetFilesChanged)) {\n // the following is true:\n // 1. our local files don't match our environment's files\n // 2. we have local changes to push or non .gadget/ files have changed on our environment\n // therefor, we need to push before we can deploy\n await filesync.print(ctx, { hashes });\n\n println({\n ensureEmptyLineAbove: true,\n content: \"Your environment's files must match your local files before you can deploy.\",\n });\n\n // some scenarios make the confirmation to push changes imply the\n // --force flag (e.g. when both local and environment files have\n // changed, or when only environment files have changed)\n let implicitForce = false;\n\n if (output.isInteractive) {\n let content: string;\n switch (true) {\n case hashes.bothChanged:\n content = sprint`Would you like to push your local changes and {underline discard your environment's} changes now?`;\n implicitForce = true;\n break;\n case hashes.localChangesToPush.size > 0:\n content = sprint`Would you like to push your local changes now?`;\n break;\n case hashes.environmentChanges.size > 0:\n content = sprint`Do you want to {underline discard your environment's} changes now?`;\n implicitForce = true;\n break;\n default:\n unreachable(\"no changes to push or discard\");\n }\n\n await confirm(content);\n } else {\n println({\n ensureEmptyLineAbove: true,\n content: \"Assuming you want to push your local files now.\",\n });\n }\n\n await filesync.push(ctx, { hashes, force: implicitForce || ctx.args[\"--force\"] });\n }\n\n const variables = {\n localFilesVersion: String(syncJson.filesVersion),\n force: ctx.args[\"--allow-problems\"],\n allowDeletedData: ctx.args[\"--allow-data-delete\"],\n allowCharges: ctx.args[\"--allow-charges\"],\n };\n\n let spinner: spinner | undefined;\n let currentStep: AppDeploymentSteps = AppDeploymentSteps.NOT_STARTED;\n let printedProblems = false;\n\n const subscription = syncJson.edit.subscribe({\n subscription: PUBLISH_STATUS_SUBSCRIPTION,\n variables,\n onError: async (error) => {\n ctx.log.error(\"failed to deploy\", { error });\n spinner?.fail(stepToSpinnerStart(syncJson, currentStep) + \" \" + ts());\n\n if (isGraphQLErrors(error.cause)) {\n const graphqlError = error.cause[0];\n assert(graphqlError, \"expected graphqlError to be defined\");\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- TODO: extensions is typed as never undefined, but it can be.\n if (graphqlError.extensions) {\n switch (true) {\n case graphqlError.extensions[\"requiresUpgrade\"]:\n println({ ensureEmptyLineAbove: true, content: graphqlError.message.replace(/GGT_PAYMENT_REQUIRED:?\\s*/, \"\") });\n process.exit(1);\n break;\n case graphqlError.extensions[\"requiresAdditionalCharge\"]:\n println({ ensureEmptyLineAbove: true, content: graphqlError.message.replace(/GGT_PAYMENT_REQUIRED:?\\s*/, \"\") });\n await confirm({ ensureEmptyLineAbove: true, content: \"Do you want to continue?\" });\n subscription.resubscribe({ ...variables, allowCharges: true });\n return;\n }\n }\n }\n\n await reportErrorAndExit(ctx, error);\n },\n onData: async ({ publishStatus }): Promise<void> => {\n if (!publishStatus) {\n ctx.log.warn(\"received empty publish status\");\n return;\n }\n\n const { publishStarted, progress: step, issues, status, deletedModelsAndFields } = publishStatus;\n const hasIssues = issues.length > 0;\n\n const { deletedModels, deletedModelFields } = deletedModelsAndFields ?? { deletedModels: [], deletedModelFields: [] };\n const hasDataLoss = deletedModels.length > 0 || deletedModelFields.length > 0;\n\n if (!printedProblems && (hasIssues || hasDataLoss)) {\n printedProblems = true;\n\n const fatalIssues = issues.filter((issue) => issue.severity === ProblemSeverity.Fatal);\n if (fatalIssues.length > 0) {\n await reportErrorAndExit(ctx, new DeployDisallowedError(publishIssuesToProblems(fatalIssues)));\n }\n\n if (hasIssues) {\n println({ ensureEmptyLineAbove: true, content: sprint`{bold.yellow !} {bold Issues found in your development app}` });\n printProblems({ problems: publishIssuesToProblems(issues) });\n }\n\n if (hasDataLoss) {\n println({\n ensureEmptyLineAbove: true,\n content: sprint`{bold.yellow !} {bold Data deleted on deploy}`,\n });\n\n const updated = chalk.blueBright(\"updated\");\n const deleted = chalk.redBright(\"deleted\");\n\n const rows: { symbol: string; name: string; action: string; indent: number }[] = [];\n\n deletedModels.forEach((model: string) => {\n rows.push({ symbol: deletedSymbol, name: chalk.redBright(model), action: deleted, indent: 0 });\n });\n\n deletedModelFields.forEach(({ modelIdentifier, fields }) => {\n rows.push({ symbol: updatedSymbol, name: chalk.blueBright(modelIdentifier), action: updated, indent: 0 });\n fields.forEach((field) => {\n rows.push({ symbol: deletedSymbol, name: chalk.redBright(field), action: deleted, indent: 2 });\n });\n });\n\n const longestNameLength = rows.reduce((longest, row) => Math.max(longest, row.name.length), 0);\n const longestIndent = rows.reduce((longest, row) => Math.max(longest, row.indent), 0);\n const indentSize = 2;\n\n println({\n ensureEmptyLineAbove: true,\n content: chalk.gray(\"These changes will be applied to production based on the app you're deploying.\"),\n });\n for (const row of rows) {\n const indentation = \" \".repeat(row.indent * indentSize);\n const namePadding = \" \".repeat(longestNameLength - row.name.length + 2);\n const actionPadding = \" \".repeat((longestIndent - row.indent) * indentSize);\n println({\n ensureEmptyLineAbove: false,\n content: indentString(`${indentation}${row.symbol} ${row.name}${namePadding}${actionPadding}${row.action}`, 6),\n });\n }\n }\n\n if (!publishStarted) {\n await confirm(\"Do you want to continue?\");\n subscription.resubscribe({ ...variables, force: true, allowDeletedData: true });\n } else {\n const allowDataDelete = ctx.args[\"--allow-data-delete\"];\n const allowProblems = ctx.args[\"--allow-problems\"];\n\n if (!allowDataDelete && !allowProblems) {\n throw new UnexpectedError(\"expected --allow-data-delete or --allow-problems to be true\");\n }\n\n if (allowProblems) {\n println(sprint`Deploying regardless of problems because \"${chalk.gray(\"--allow-problems\")}\" was passed.`);\n }\n\n if (allowDataDelete) {\n println(sprint`Deploying regardless of deleted data because \"${chalk.gray(\"--allow-data-delete\")}\" was passed.`);\n }\n }\n\n return;\n }\n\n if (status?.code === \"Errored\") {\n spinner?.fail(stepToSpinnerStart(syncJson, currentStep) + \" \" + ts());\n\n if (status.message) {\n println({ ensureEmptyLineAbove: true, content: chalk.red(status.message) });\n }\n if (status.output) {\n println({ ensureEmptyLineAbove: true, content: sprint`${terminalLink(\"Check logs\", status.output)}` });\n }\n return;\n }\n\n if (step === AppDeploymentSteps.COMPLETED) {\n spinner?.succeed(stepToSpinnerEnd(syncJson, currentStep));\n\n let content = chalk.green(\"Deploy successful!\");\n if (status?.output) {\n content += ` ${terminalLink(\"Check logs\", status.output)}.`;\n }\n\n println({ ensureEmptyLineAbove: true, content });\n return;\n }\n\n if (step !== currentStep) {\n const spinnerText = stepToSpinnerStart(syncJson, step);\n if (spinnerText !== spinner?.text) {\n // stop the current spinner, if any, and start a new one\n spinner?.succeed(stepToSpinnerEnd(syncJson, currentStep));\n\n const ensureEmptyLineAbove = currentStep === AppDeploymentSteps.NOT_STARTED || !output.isInteractive;\n spinner = spin({ ensureEmptyLineAbove, content: spinnerText });\n }\n\n currentStep = step as AppDeploymentSteps;\n }\n },\n onComplete: () => {\n subscription.unsubscribe();\n },\n });\n};\n\nexport const AppDeploymentSteps = Object.freeze({\n NOT_STARTED: \"NOT_STARTED\",\n STARTING: \"STARTING\",\n BUILDING_ASSETS: \"BUILDING_ASSETS\",\n UPLOADING_ASSETS: \"UPLOADING_ASSETS\",\n CONVERGING_STORAGE: \"CONVERGING_STORAGE\",\n PUBLISHING_TREE: \"PUBLISHING_TREE\",\n RELOADING_SANDBOX: \"RELOADING_SANDBOX\",\n COMPLETED: \"COMPLETED\",\n});\n\nexport type AppDeploymentSteps = (typeof AppDeploymentSteps)[keyof typeof AppDeploymentSteps];\n\nexport const stepToSpinnerStart = (syncJson: SyncJson, step: string): string => {\n switch (step) {\n case AppDeploymentSteps.NOT_STARTED:\n case AppDeploymentSteps.STARTING:\n case AppDeploymentSteps.BUILDING_ASSETS:\n case AppDeploymentSteps.UPLOADING_ASSETS:\n return \"Building frontend assets.\";\n case AppDeploymentSteps.CONVERGING_STORAGE:\n return \"Setting up database.\";\n case AppDeploymentSteps.PUBLISHING_TREE:\n return `Copying ${syncJson.env.name}.`;\n case AppDeploymentSteps.RELOADING_SANDBOX:\n return \"Restarting app.\";\n case AppDeploymentSteps.COMPLETED:\n return \"Deploy complete!\";\n default:\n return \"Unknown step.\";\n }\n};\n\nexport const stepToSpinnerEnd = (syncJson: SyncJson, step: string): string => {\n switch (step) {\n case AppDeploymentSteps.NOT_STARTED:\n case AppDeploymentSteps.STARTING:\n case AppDeploymentSteps.BUILDING_ASSETS:\n case AppDeploymentSteps.UPLOADING_ASSETS:\n return `Built frontend assets. ${ts()}`;\n case AppDeploymentSteps.CONVERGING_STORAGE:\n return `Setup database. ${ts()}`;\n case AppDeploymentSteps.PUBLISHING_TREE:\n return `Copied ${syncJson.env.name}. ${ts()}`;\n case AppDeploymentSteps.RELOADING_SANDBOX:\n return `Restarted app. ${ts()}`;\n case AppDeploymentSteps.COMPLETED:\n return \"Deploy successful!\";\n default:\n return `Completed unknown step. ${ts()}`;\n }\n};\n"],
5
+ "mappings": "otBAAAA,IAEA,OAAOC,OAAY,cAsBZ,IAAMC,GAAO,CAClB,GAAGA,EACH,QAAS,CAAE,KAAM,OAAQ,MAAO,CAAC,KAAM,gBAAiB,QAAQ,CAAE,EAClE,mBAAoB,CAAE,KAAM,QAAS,MAAO,gBAAiB,EAC7D,kBAAmB,CAAE,KAAM,OAAQ,EACnC,sBAAuB,CAAE,KAAM,OAAQ,CACzC,EAEaC,GAAgBC,GACpBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BIC,GAAuB,MAAOC,GAAQ,CACjD,IAAMC,EAAY,MAAMC,EAAsB,QAAQ,IAAI,CAAC,EACrDC,EAAW,MAAMC,EAAS,WAAWJ,EAAK,CAAE,UAAAC,CAAU,CAAC,EAE7DI,EAAQ,CACN,qBAAsB,GACtB,QAAS,aAAaF,EAAS,IAAI,IAAI,OAAOG,EAAaH,EAAS,IAAI,cAAe,WAAWA,EAAS,IAAI,aAAa,GAAG,CAAC,EAClI,CAAC,EAED,IAAMI,EAAW,IAAIC,EAASL,CAAQ,EAChCM,EAAS,MAAMF,EAAS,OAAOP,CAAG,EACxC,GAAI,CAACS,EAAO,SAAWA,EAAO,mBAAmB,KAAO,GAAK,CAACA,EAAO,2BAA4B,CAK/F,MAAMF,EAAS,MAAMP,EAAK,CAAE,OAAAS,CAAO,CAAC,EAEpCJ,EAAQ,CACN,qBAAsB,GACtB,QAAS,6EACX,CAAC,EAKD,IAAIK,EAAgB,GAEpB,GAAIC,EAAO,cAAe,CACxB,IAAIC,EACJ,OAAQ,GAAM,CACZ,KAAKH,EAAO,YACVG,EAAUd,qGACVY,EAAgB,GAChB,MACF,KAAKD,EAAO,mBAAmB,KAAO,EACpCG,EAAUd,kDACV,MACF,KAAKW,EAAO,mBAAmB,KAAO,EACpCG,EAAUd,sEACVY,EAAgB,GAChB,MACF,QACEG,EAAY,+BAA+B,CAC/C,CAEA,MAAMC,EAAQF,CAAO,CACvB,MACEP,EAAQ,CACN,qBAAsB,GACtB,QAAS,iDACX,CAAC,EAGH,MAAME,EAAS,KAAKP,EAAK,CAAE,OAAAS,EAAQ,MAAOC,GAAiBV,EAAI,KAAK,SAAS,CAAE,CAAC,CAClF,CAEA,IAAMe,EAAY,CAChB,kBAAmB,OAAOZ,EAAS,YAAY,EAC/C,MAAOH,EAAI,KAAK,kBAAkB,EAClC,iBAAkBA,EAAI,KAAK,qBAAqB,EAChD,aAAcA,EAAI,KAAK,iBAAiB,CAC1C,EAEIgB,EACAC,EAAkCC,EAAmB,YACrDC,EAAkB,GAEhBC,EAAejB,EAAS,KAAK,UAAU,CAC3C,aAAckB,EACd,UAAAN,EACA,QAAS,MAAOO,GAAU,CAIxB,GAHAtB,EAAI,IAAI,MAAM,mBAAoB,CAAE,MAAAsB,CAAM,CAAC,EAC3CN,GAAS,KAAKO,EAAmBpB,EAAUc,CAAW,EAAI,IAAMO,EAAG,CAAC,EAEhEC,EAAgBH,EAAM,KAAK,EAAG,CAChC,IAAMI,EAAeJ,EAAM,MAAM,CAAC,EAIlC,GAHAK,GAAOD,EAAc,qCAAqC,EAGtDA,EAAa,WACf,OAAQ,GAAM,CACZ,KAAKA,EAAa,WAAW,gBAC3BrB,EAAQ,CAAE,qBAAsB,GAAM,QAASqB,EAAa,QAAQ,QAAQ,4BAA6B,EAAE,CAAE,CAAC,EAC9G,QAAQ,KAAK,CAAC,EACd,MACF,KAAKA,EAAa,WAAW,yBAC3BrB,EAAQ,CAAE,qBAAsB,GAAM,QAASqB,EAAa,QAAQ,QAAQ,4BAA6B,EAAE,CAAE,CAAC,EAC9G,MAAMZ,EAAQ,CAAE,qBAAsB,GAAM,QAAS,0BAA2B,CAAC,EACjFM,EAAa,YAAY,CAAE,GAAGL,EAAW,aAAc,EAAK,CAAC,EAC7D,MACJ,CAEJ,CAEA,MAAMa,EAAmB5B,EAAKsB,CAAK,CACrC,EACA,OAAQ,MAAO,CAAE,cAAAO,CAAc,IAAqB,CAClD,GAAI,CAACA,EAAe,CAClB7B,EAAI,IAAI,KAAK,+BAA+B,EAC5C,MACF,CAEA,GAAM,CAAE,eAAA8B,EAAgB,SAAUC,EAAM,OAAAC,EAAQ,OAAAC,EAAQ,uBAAAC,EAAuB,EAAIL,EAC7EM,EAAYH,EAAO,OAAS,EAE5B,CAAE,cAAAI,EAAe,mBAAAC,CAAmB,EAAIH,IAA0B,CAAE,cAAe,CAAC,EAAG,mBAAoB,CAAC,CAAE,EAC9GI,EAAcF,EAAc,OAAS,GAAKC,EAAmB,OAAS,EAE5E,GAAI,CAAClB,IAAoBgB,GAAaG,GAAc,CAClDnB,EAAkB,GAElB,IAAMoB,EAAcP,EAAO,OAAQQ,GAAUA,EAAM,WAAaC,EAAgB,KAAK,EAUrF,GATIF,EAAY,OAAS,GACvB,MAAMX,EAAmB5B,EAAK,IAAI0C,EAAsBC,EAAwBJ,CAAW,CAAC,CAAC,EAG3FJ,IACF9B,EAAQ,CAAE,qBAAsB,GAAM,QAASP,8DAAoE,CAAC,EACpH8C,EAAc,CAAE,SAAUD,EAAwBX,CAAM,CAAE,CAAC,GAGzDM,EAAa,CACfjC,EAAQ,CACN,qBAAsB,GACtB,QAASP,gDACX,CAAC,EAED,IAAM+C,EAAUC,EAAM,WAAW,SAAS,EACpCC,EAAUD,EAAM,UAAU,SAAS,EAEnCE,EAA2E,CAAC,EAElFZ,EAAc,QAASa,GAAkB,CACvCD,EAAK,KAAK,CAAE,OAAQE,EAAe,KAAMJ,EAAM,UAAUG,CAAK,EAAG,OAAQF,EAAS,OAAQ,CAAE,CAAC,CAC/F,CAAC,EAEDV,EAAmB,QAAQ,CAAC,CAAE,gBAAAc,EAAiB,OAAAC,CAAO,IAAM,CAC1DJ,EAAK,KAAK,CAAE,OAAQK,EAAe,KAAMP,EAAM,WAAWK,CAAe,EAAG,OAAQN,EAAS,OAAQ,CAAE,CAAC,EACxGO,EAAO,QAASE,GAAU,CACxBN,EAAK,KAAK,CAAE,OAAQE,EAAe,KAAMJ,EAAM,UAAUQ,CAAK,EAAG,OAAQP,EAAS,OAAQ,CAAE,CAAC,CAC/F,CAAC,CACH,CAAC,EAED,IAAMQ,GAAoBP,EAAK,OAAO,CAACQ,EAASC,IAAQ,KAAK,IAAID,EAASC,EAAI,KAAK,MAAM,EAAG,CAAC,EACvFC,GAAgBV,EAAK,OAAO,CAACQ,EAASC,IAAQ,KAAK,IAAID,EAASC,EAAI,MAAM,EAAG,CAAC,EAC9EE,EAAa,EAEnBtD,EAAQ,CACN,qBAAsB,GACtB,QAASyC,EAAM,KAAK,gFAAgF,CACtG,CAAC,EACD,QAAWW,KAAOT,EAAM,CACtB,IAAMY,EAAc,IAAI,OAAOH,EAAI,OAASE,CAAU,EAChDE,EAAc,IAAI,OAAON,GAAoBE,EAAI,KAAK,OAAS,CAAC,EAChEK,GAAgB,IAAI,QAAQJ,GAAgBD,EAAI,QAAUE,CAAU,EAC1EtD,EAAQ,CACN,qBAAsB,GACtB,QAAS0D,EAAa,GAAGH,CAAW,GAAGH,EAAI,MAAM,IAAIA,EAAI,IAAI,GAAGI,CAAW,GAAGC,EAAa,GAAGL,EAAI,MAAM,GAAI,CAAC,CAC/G,CAAC,CACH,CACF,CAEA,GAAI,CAAC3B,EACH,MAAMhB,EAAQ,0BAA0B,EACxCM,EAAa,YAAY,CAAE,GAAGL,EAAW,MAAO,GAAM,iBAAkB,EAAK,CAAC,MACzE,CACL,IAAMiD,EAAkBhE,EAAI,KAAK,qBAAqB,EAChDiE,EAAgBjE,EAAI,KAAK,kBAAkB,EAEjD,GAAI,CAACgE,GAAmB,CAACC,EACvB,MAAM,IAAIC,EAAgB,6DAA6D,EAGrFD,GACF5D,EAAQP,8CAAmDgD,EAAM,KAAK,kBAAkB,CAAC,eAAe,EAGtGkB,GACF3D,EAAQP,kDAAuDgD,EAAM,KAAK,qBAAqB,CAAC,eAAe,CAEnH,CAEA,MACF,CAEA,GAAIb,GAAQ,OAAS,UAAW,CAC9BjB,GAAS,KAAKO,EAAmBpB,EAAUc,CAAW,EAAI,IAAMO,EAAG,CAAC,EAEhES,EAAO,SACT5B,EAAQ,CAAE,qBAAsB,GAAM,QAASyC,EAAM,IAAIb,EAAO,OAAO,CAAE,CAAC,EAExEA,EAAO,QACT5B,EAAQ,CAAE,qBAAsB,GAAM,QAASP,IAASQ,EAAa,aAAc2B,EAAO,MAAM,CAAC,EAAG,CAAC,EAEvG,MACF,CAEA,GAAIF,IAASb,EAAmB,UAAW,CACzCF,GAAS,QAAQmD,GAAiBhE,EAAUc,CAAW,CAAC,EAExD,IAAIL,EAAUkC,EAAM,MAAM,oBAAoB,EAC1Cb,GAAQ,SACVrB,GAAW,IAAIN,EAAa,aAAc2B,EAAO,MAAM,CAAC,KAG1D5B,EAAQ,CAAE,qBAAsB,GAAM,QAAAO,CAAQ,CAAC,EAC/C,MACF,CAEA,GAAImB,IAASd,EAAa,CACxB,IAAMmD,EAAc7C,EAAmBpB,EAAU4B,CAAI,EACrD,GAAIqC,IAAgBpD,GAAS,KAAM,CAEjCA,GAAS,QAAQmD,GAAiBhE,EAAUc,CAAW,CAAC,EAExD,IAAMoD,EAAuBpD,IAAgBC,EAAmB,aAAe,CAACP,EAAO,cACvFK,EAAUsD,EAAK,CAAE,qBAAAD,EAAsB,QAASD,CAAY,CAAC,CAC/D,CAEAnD,EAAcc,CAChB,CACF,EACA,WAAY,IAAM,CAChBX,EAAa,YAAY,CAC3B,CACF,CAAC,CACH,EAEaF,EAAqB,OAAO,OAAO,CAC9C,YAAa,cACb,SAAU,WACV,gBAAiB,kBACjB,iBAAkB,mBAClB,mBAAoB,qBACpB,gBAAiB,kBACjB,kBAAmB,oBACnB,UAAW,WACb,CAAC,EAIYK,EAAqB,CAACpB,EAAoB4B,IAAyB,CAC9E,OAAQA,EAAM,CACZ,KAAKb,EAAmB,YACxB,KAAKA,EAAmB,SACxB,KAAKA,EAAmB,gBACxB,KAAKA,EAAmB,iBACtB,MAAO,4BACT,KAAKA,EAAmB,mBACtB,MAAO,uBACT,KAAKA,EAAmB,gBACtB,MAAO,WAAWf,EAAS,IAAI,IAAI,IACrC,KAAKe,EAAmB,kBACtB,MAAO,kBACT,KAAKA,EAAmB,UACtB,MAAO,mBACT,QACE,MAAO,eACX,CACF,EAEaiD,GAAmB,CAAChE,EAAoB4B,IAAyB,CAC5E,OAAQA,EAAM,CACZ,KAAKb,EAAmB,YACxB,KAAKA,EAAmB,SACxB,KAAKA,EAAmB,gBACxB,KAAKA,EAAmB,iBACtB,MAAO,0BAA0BM,EAAG,CAAC,GACvC,KAAKN,EAAmB,mBACtB,MAAO,mBAAmBM,EAAG,CAAC,GAChC,KAAKN,EAAmB,gBACtB,MAAO,UAAUf,EAAS,IAAI,IAAI,KAAKqB,EAAG,CAAC,GAC7C,KAAKN,EAAmB,kBACtB,MAAO,kBAAkBM,EAAG,CAAC,GAC/B,KAAKN,EAAmB,UACtB,MAAO,qBACT,QACE,MAAO,2BAA2BM,EAAG,CAAC,EAC1C,CACF",
6
+ "names": ["init_cjs", "assert", "args", "usage", "_ctx", "sprint", "run", "ctx", "directory", "loadSyncJsonDirectory", "syncJson", "SyncJson", "println", "terminalLink", "filesync", "FileSync", "hashes", "implicitForce", "output", "content", "unreachable", "confirm", "variables", "spinner", "currentStep", "AppDeploymentSteps", "printedProblems", "subscription", "PUBLISH_STATUS_SUBSCRIPTION", "error", "stepToSpinnerStart", "ts", "isGraphQLErrors", "graphqlError", "assert", "reportErrorAndExit", "publishStatus", "publishStarted", "step", "issues", "status", "deletedModelsAndFields", "hasIssues", "deletedModels", "deletedModelFields", "hasDataLoss", "fatalIssues", "issue", "ProblemSeverity", "DeployDisallowedError", "publishIssuesToProblems", "printProblems", "updated", "source_default", "deleted", "rows", "model", "deletedSymbol", "modelIdentifier", "fields", "updatedSymbol", "field", "longestNameLength", "longest", "row", "longestIndent", "indentSize", "indentation", "namePadding", "actionPadding", "indentString", "allowDataDelete", "allowProblems", "UnexpectedError", "stepToSpinnerEnd", "spinnerText", "ensureEmptyLineAbove", "spin"]
7
+ }
@@ -1,4 +1,4 @@
1
- import{a as it}from"./chunk-HKBXEZNF.js";import{a as gn}from"./chunk-BSCZOMV4.js";import{a as rt,b as En,k as B,l as er,m as nr}from"./chunk-LWW4E6P5.js";import{f as Xt,l as Zt,m as tr,n as rr,o as ir}from"./chunk-RYQWS5BH.js";import"./chunk-5ONACLO6.js";import"./chunk-NGTOMLDS.js";import{b as Qt}from"./chunk-JKDJXJKF.js";import"./chunk-D2K5XPNJ.js";import"./chunk-M4PNFOA5.js";import"./chunk-3Q3GPB6Z.js";import"./chunk-M2OJZLL7.js";import"./chunk-457GEPUN.js";import"./chunk-FLXIAZND.js";import{a as yn,c as wn,d as Jt,f as Yt,i as Vt}from"./chunk-VICN6LTV.js";import{$ as zt,M as Ge,V as tt,Z as W,_ as Kt,b as Bt,o as Ht,y as $t}from"./chunk-CQLM5U6T.js";import"./chunk-F3EZ4KS3.js";import"./chunk-GOBNB5VT.js";import{a as g,b,c as C,d as mn,e as We,f as pn,g as a}from"./chunk-5WC5D4WL.js";var Dr=C(ge=>{"use strict";a();Object.defineProperty(ge,"__esModule",{value:!0});ge.sync=ge.isexe=void 0;var Cn=g("fs"),Tn=g("fs/promises"),Rn=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ir(await(0,Tn.stat)(e),t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};ge.isexe=Rn;var kn=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ir((0,Cn.statSync)(e),t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};ge.sync=kn;var Ir=(e,t)=>e.isFile()&&bn(e,t),bn=(e,t)=>{let r=t.uid??process.getuid?.(),i=t.groups??process.getgroups?.()??[],n=t.gid??process.getgid?.()??i[0];if(r===void 0||n===void 0)throw new Error("cannot get uid or gid");let s=new Set([n,...i]),o=e.mode,c=e.uid,f=e.gid,l=parseInt("100",8),d=parseInt("010",8),u=parseInt("001",8),h=l|d;return!!(o&u||o&d&&s.has(f)||o&l&&c===r||o&h&&r===0)}});var Cr=C(Ee=>{"use strict";a();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.sync=Ee.isexe=void 0;var Ln=g("fs"),On=g("fs/promises"),qn=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ar(await(0,On.stat)(e),e,t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};Ee.isexe=qn;var Fn=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ar((0,Ln.statSync)(e),e,t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};Ee.sync=Fn;var Pn=(e,t)=>{let{pathExt:r=process.env.PATHEXT||""}=t,i=r.split(";");if(i.indexOf("")!==-1)return!0;for(let n=0;n<i.length;n++){let s=i[n].toLowerCase(),o=e.substring(e.length-s.length).toLowerCase();if(s&&o===s)return!0}return!1},Ar=(e,t,r)=>e.isFile()&&Pn(t,r)});var Rr=C(Tr=>{"use strict";a();Object.defineProperty(Tr,"__esModule",{value:!0})});var Fr=C(A=>{"use strict";a();var kr=A&&A.__createBinding||(Object.create?function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]}),Un=A&&A.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),br=A&&A.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&kr(t,e,r);return Un(t,e),t},Mn=A&&A.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&kr(t,e,r)};Object.defineProperty(A,"__esModule",{value:!0});A.sync=A.isexe=A.posix=A.win32=void 0;var Lr=br(Dr());A.posix=Lr;var Or=br(Cr());A.win32=Or;Mn(Rr(),A);var Wn=process.env._ISEXE_TEST_PLATFORM_||process.platform,qr=Wn==="win32"?Or:Lr;A.isexe=qr.isexe;A.sync=qr.sync});var Kr=C((Nc,$r)=>{a();var{isexe:Gn,sync:jn}=Fr(),{join:Bn,delimiter:Hn,sep:Pr,posix:Ur}=g("path"),Mr=process.platform==="win32",Wr=new RegExp(`[${Ur.sep}${Pr===Ur.sep?"":Pr}]`.replace(/(\\)/g,"\\$1")),$n=new RegExp(`^\\.${Wr.source}`),Gr=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),jr=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:i=Hn})=>{let n=e.match(Wr)?[""]:[...Mr?[process.cwd()]:[],...(t||"").split(i)];if(Mr){let s=r||[".EXE",".CMD",".BAT",".COM"].join(i),o=s.split(i).flatMap(c=>[c,c.toLowerCase()]);return e.includes(".")&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:s}}return{pathEnv:n,pathExt:[""]}},Br=(e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&$n.test(t)?t.slice(0,2):"")+Bn(r,t)},Hr=async(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=jr(e,t),s=[];for(let o of r){let c=Br(o,e);for(let f of i){let l=c+f;if(await Gn(l,{pathExt:n,ignoreErrors:!0})){if(!t.all)return l;s.push(l)}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Gr(e)},Kn=(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=jr(e,t),s=[];for(let o of r){let c=Br(o,e);for(let f of i){let l=c+f;if(jn(l,{pathExt:n,ignoreErrors:!0})){if(!t.all)return l;s.push(l)}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Gr(e)};$r.exports=Hr;Hr.sync=Kn});var zr=C(He=>{a();(function(){var e;e=function(t,r,i){var n,s;for(s="";t.length>0;)n=t.match(r),n?(s+=t.slice(0,n.index),s+=i(n),t=t.slice(n.index+n[0].length)):(s+=t,t="");return s},He.split=function(t){var r,i;return t==null&&(t=""),i=[],r="",e(t,/\s*(?:([^\s\\\'\"]+)|'((?:[^\'\\]|\\.)*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|$)?/,function(n){var s,o,c,f,l,d,u;if(f=n[0],u=n[1],d=n[2],s=n[3],o=n[4],c=n[5],l=n[6],c!=null)throw new Error("Unmatched quote");if(r+=u||(d||s||o).replace(/\\(?=.)/,""),l!=null)return i.push(r),r=""}),r&&i.push(r),i},He.escape=function(t){return t==null&&(t=""),t==null?"''":t.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g,"\\$1").replace(/\n/g,`'
1
+ import{a as it}from"./chunk-HKBXEZNF.js";import{a as gn}from"./chunk-BSCZOMV4.js";import{a as rt,d as En,m as B,n as er,o as nr}from"./chunk-DVKNBG4P.js";import{f as Xt,l as Zt,m as tr,n as rr,o as ir}from"./chunk-CXYA3RFX.js";import"./chunk-THZRTDWW.js";import"./chunk-AB4I3BMD.js";import{b as Qt}from"./chunk-BZSAGSV3.js";import"./chunk-D2K5XPNJ.js";import"./chunk-M4PNFOA5.js";import"./chunk-3Q3GPB6Z.js";import"./chunk-6FBP46EB.js";import"./chunk-EFU2JNKY.js";import"./chunk-KMCOZJPU.js";import{a as yn,c as wn,d as Jt,f as Yt,i as Vt}from"./chunk-OLKWG2EP.js";import{$ as zt,M as Ge,V as tt,Z as W,_ as Kt,b as Bt,o as Ht,y as $t}from"./chunk-KGOVR5SK.js";import"./chunk-F3EZ4KS3.js";import"./chunk-GOBNB5VT.js";import{a as g,b,c as C,d as mn,e as We,f as pn,g as a}from"./chunk-5WC5D4WL.js";var Dr=C(ge=>{"use strict";a();Object.defineProperty(ge,"__esModule",{value:!0});ge.sync=ge.isexe=void 0;var Cn=g("fs"),Tn=g("fs/promises"),Rn=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ir(await(0,Tn.stat)(e),t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};ge.isexe=Rn;var kn=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ir((0,Cn.statSync)(e),t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};ge.sync=kn;var Ir=(e,t)=>e.isFile()&&bn(e,t),bn=(e,t)=>{let r=t.uid??process.getuid?.(),i=t.groups??process.getgroups?.()??[],n=t.gid??process.getgid?.()??i[0];if(r===void 0||n===void 0)throw new Error("cannot get uid or gid");let s=new Set([n,...i]),o=e.mode,c=e.uid,f=e.gid,l=parseInt("100",8),d=parseInt("010",8),u=parseInt("001",8),h=l|d;return!!(o&u||o&d&&s.has(f)||o&l&&c===r||o&h&&r===0)}});var Cr=C(Ee=>{"use strict";a();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.sync=Ee.isexe=void 0;var Ln=g("fs"),On=g("fs/promises"),qn=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ar(await(0,On.stat)(e),e,t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};Ee.isexe=qn;var Fn=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return Ar((0,Ln.statSync)(e),e,t)}catch(i){let n=i;if(r||n.code==="EACCES")return!1;throw n}};Ee.sync=Fn;var Pn=(e,t)=>{let{pathExt:r=process.env.PATHEXT||""}=t,i=r.split(";");if(i.indexOf("")!==-1)return!0;for(let n=0;n<i.length;n++){let s=i[n].toLowerCase(),o=e.substring(e.length-s.length).toLowerCase();if(s&&o===s)return!0}return!1},Ar=(e,t,r)=>e.isFile()&&Pn(t,r)});var Rr=C(Tr=>{"use strict";a();Object.defineProperty(Tr,"__esModule",{value:!0})});var Fr=C(A=>{"use strict";a();var kr=A&&A.__createBinding||(Object.create?function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]}),Un=A&&A.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),br=A&&A.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&kr(t,e,r);return Un(t,e),t},Mn=A&&A.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&kr(t,e,r)};Object.defineProperty(A,"__esModule",{value:!0});A.sync=A.isexe=A.posix=A.win32=void 0;var Lr=br(Dr());A.posix=Lr;var Or=br(Cr());A.win32=Or;Mn(Rr(),A);var Wn=process.env._ISEXE_TEST_PLATFORM_||process.platform,qr=Wn==="win32"?Or:Lr;A.isexe=qr.isexe;A.sync=qr.sync});var Kr=C((Nc,$r)=>{a();var{isexe:Gn,sync:jn}=Fr(),{join:Bn,delimiter:Hn,sep:Pr,posix:Ur}=g("path"),Mr=process.platform==="win32",Wr=new RegExp(`[${Ur.sep}${Pr===Ur.sep?"":Pr}]`.replace(/(\\)/g,"\\$1")),$n=new RegExp(`^\\.${Wr.source}`),Gr=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),jr=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:i=Hn})=>{let n=e.match(Wr)?[""]:[...Mr?[process.cwd()]:[],...(t||"").split(i)];if(Mr){let s=r||[".EXE",".CMD",".BAT",".COM"].join(i),o=s.split(i).flatMap(c=>[c,c.toLowerCase()]);return e.includes(".")&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:s}}return{pathEnv:n,pathExt:[""]}},Br=(e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&$n.test(t)?t.slice(0,2):"")+Bn(r,t)},Hr=async(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=jr(e,t),s=[];for(let o of r){let c=Br(o,e);for(let f of i){let l=c+f;if(await Gn(l,{pathExt:n,ignoreErrors:!0})){if(!t.all)return l;s.push(l)}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Gr(e)},Kn=(e,t={})=>{let{pathEnv:r,pathExt:i,pathExtExe:n}=jr(e,t),s=[];for(let o of r){let c=Br(o,e);for(let f of i){let l=c+f;if(jn(l,{pathExt:n,ignoreErrors:!0})){if(!t.all)return l;s.push(l)}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Gr(e)};$r.exports=Hr;Hr.sync=Kn});var zr=C(He=>{a();(function(){var e;e=function(t,r,i){var n,s;for(s="";t.length>0;)n=t.match(r),n?(s+=t.slice(0,n.index),s+=i(n),t=t.slice(n.index+n[0].length)):(s+=t,t="");return s},He.split=function(t){var r,i;return t==null&&(t=""),i=[],r="",e(t,/\s*(?:([^\s\\\'\"]+)|'((?:[^\'\\]|\\.)*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|$)?/,function(n){var s,o,c,f,l,d,u;if(f=n[0],u=n[1],d=n[2],s=n[3],o=n[4],c=n[5],l=n[6],c!=null)throw new Error("Unmatched quote");if(r+=u||(d||s||o).replace(/\\(?=.)/,""),l!=null)return i.push(r),r=""}),r&&i.push(r),i},He.escape=function(t){return t==null&&(t=""),t==null?"''":t.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g,"\\$1").replace(/\n/g,`'
2
2
  '`)}}).call(He)});var Vr=C((Tc,Yr)=>{"use strict";a();var Jr=g("fs"),vt;function zn(){try{return Jr.statSync("/.dockerenv"),!0}catch{return!1}}function Jn(){try{return Jr.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Yr.exports=()=>(vt===void 0&&(vt=zn()||Jn()),vt)});var Qr=C((kc,Nt)=>{"use strict";a();var Yn=g("os"),Vn=g("fs"),Xr=Vr(),Zr=()=>{if(process.platform!=="linux")return!1;if(Yn.release().toLowerCase().includes("microsoft"))return!Xr();try{return Vn.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Xr():!1}catch{return!1}};process.env.__IS_WSL_TEST__?Nt.exports=Zr:Nt.exports=Zr()});var he=C((Lc,I)=>{a();var Xn=zr(),$e=g("child_process"),St=gn(),Zn=Qr(),Qn=g("path"),es=g("url"),ue=g("os"),_t=g("fs"),ts=g("net"),rs=1024;function ii(e){return JSON.parse(JSON.stringify(e))}I.exports.clone=ii;var is=function(e){return typeof e=="string"?e.replace(/(["$`\\])/g,"\\$1"):e},ns=function(e,t){return e.indexOf(t)!==-1},ei={u:"urgency",urgency:"urgency",t:"expire-time",time:"expire-time",timeout:"expire-time",e:"expire-time",expire:"expire-time","expire-time":"expire-time",i:"icon",icon:"icon",c:"category",category:"category",subtitle:"category",h:"hint",hint:"hint",a:"app-name","app-name":"app-name"};I.exports.command=function(e,t,r){return e=Xn.escape(e),process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (command):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.exec(e+" "+t.join(" "),function(i,n,s){if(i)return r(i);r(s,n)})};I.exports.fileCommand=function(e,t,r){return process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (fileCommand):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.execFile(e,t,function(i,n,s){if(i)return r(i,n);r(s,n)})};I.exports.fileCommandJson=function(e,t,r){return process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (fileCommandJson):"),console.info("[notifier path]",e),console.info("[notifier options]",t.join(" "))),$e.execFile(e,t,function(i,n,s){if(i)return r(i,n);if(!n)return r(i,{});try{let o=JSON.parse(n);r(s||null,o)}catch(o){r(o,n)}})};I.exports.immediateFileCommand=function(e,t,r){process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1&&(console.info("node-notifier debug info (notifier):"),console.info("[notifier path]",e)),ss(e,function(i,n){if(!n)return r(new Error("Notifier ("+e+") not found on system."));$e.execFile(e,t),r()})};function ss(e,t){return _t.stat(e,function(r,i){return r?Qn.extname(e)?t(r,!1):_t.stat(e+".exe",function(n,s){if(n)return t(n,!1);t(n,s.isFile())}):t(r,i.isFile())})}var Ke=function(e){return e.appIcon&&(e.icon=e.appIcon,delete e.appIcon),e},Ie=function(e){return e.text&&(e.message=e.text,delete e.text),e},ni=function(e){return e.i&&(e.icon=e.i,delete e.i),e};I.exports.mapToNotifySend=function(e){e=Ke(e),e=Ie(e),e.timeout===!1&&delete e.timeout,e.wait===!0&&(e["expire-time"]=5);for(let t in e)t==="message"||t==="title"||e.hasOwnProperty(t)&&ei[t]!==t&&(e[ei[t]]=e[t],delete e[t]);return typeof e["expire-time"]>"u"?e["expire-time"]=10*1e3:typeof e["expire-time"]=="number"&&(e["expire-time"]=e["expire-time"]*1e3),e};I.exports.mapToGrowl=function(e){if(e=Ke(e),e=ni(e),e=Ie(e),e.icon&&!Buffer.isBuffer(e.icon))try{e.icon=_t.readFileSync(e.icon)}catch{}return e};I.exports.mapToMac=function(e){return e=ni(e),e=Ie(e),e.icon&&(e.appIcon=e.icon,delete e.icon),e.sound===!0&&(e.sound="Bottle"),e.sound===!1&&delete e.sound,e.sound&&e.sound.indexOf("Notification.")===0&&(e.sound="Bottle"),e.wait===!0&&(e.timeout||(e.timeout=5),delete e.wait),!e.wait&&!e.timeout&&(e.timeout===!1?delete e.timeout:e.timeout=10),e.json=!0,e};function xt(e){return Object.prototype.toString.call(e)==="[object Array]"}I.exports.isArray=xt;function os(){}I.exports.actionJackerDecorator=function(e,t,r,i){if(t=ii(t),r=r||os,typeof r!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof r);return function(n,s){let o=s,c={};if(o&&typeof o=="object"&&(c=o,o=o.activationType),o&&(o=o.toLowerCase().trim(),o.match(/^activate|clicked$/)&&(o="activate"),o.match(/^timedout$/)&&(o="timeout")),r.apply(e,[n,o,c]),!i||!o)return;let f=i(o);f&&e.emit(f,e,t,c)}};I.exports.constructArgumentList=function(e,t){let r=[];t=t||{};let i=t.initial||[],n=t.keyExtra||"",s=t.allowedArguments||[],o=t.noEscape!==void 0,c=t.allowedArguments!==void 0,f=!!t.explicitTrue,l=!!t.keepNewlines,d=t.wrapper===void 0?'"':t.wrapper,u=function h(_){return xt(_)?ti(_.map(h).join(",")):(o||(_=is(_)),typeof _=="string"&&!l&&(_=ti(_)),d+_+d)};i.forEach(function(h){r.push(u(h))});for(let h in e)if(e.hasOwnProperty(h)&&(!c||ns(s,h)))if(f&&e[h]===!0)r.push("-"+n+h);else{if(f&&e[h]===!1)continue;r.push("-"+n+h,u(e[h]))}return r};function ti(e){let t=process.platform==="win32"?"\\r\\n":"\\n";return e.replace(/\r?\n/g,t)}var as=["t","m","b","tb","p","id","s","silent","appID","pid","pipeName","close","install"],cs="Notification.",ri="Notification.Default";I.exports.mapToWin8=function(e){e=Ke(e),e=Ie(e),e.icon&&(/^file:\/+/.test(e.icon)?e.p=new es.URL(e.icon).pathname.replace(/^\/(\w:\/)/,"$1").replace(/\//g,"\\"):e.p=e.icon,delete e.icon),e.message&&(e.m=e.message.replace(/\x1b/g,""),delete e.message),e.title&&(e.t=e.title,delete e.title),e.appName&&(e.appID=e.appName,delete e.appName),typeof e.remove<"u"&&(e.close=e.remove,delete e.remove),(e.quiet||e.silent)&&(e.silent=e.quiet||e.silent,delete e.quiet),typeof e.sound<"u"&&(e.s=e.sound,delete e.sound),e.s===!1&&(e.silent=!0,delete e.s),e.s&&e.silent&&delete e.s,e.s===!0&&(e.s=ri),e.s&&e.s.indexOf(cs)!==0&&(e.s=ri),e.actions&&xt(e.actions)&&(e.b=e.actions.join(";"),delete e.actions);for(let t in e)e.hasOwnProperty(t)&&as.indexOf(t)===-1&&delete e[t];return e};I.exports.mapToNotifu=function(e){return e=Ke(e),e=Ie(e),e.icon&&(e.i=e.icon,delete e.icon),e.message&&(e.m=e.message,delete e.message),e.title&&(e.p=e.title,delete e.title),e.time&&(e.d=e.time,delete e.time),e.q!==!1?e.q=!0:delete e.q,e.quiet===!1&&(delete e.q,delete e.quiet),e.sound&&(delete e.q,delete e.sound),e.t&&(e.d=e.t,delete e.t),e.type&&(e.t=fs(e.type),delete e.type),e};I.exports.isMac=function(){return ue.type()==="Darwin"};I.exports.isMountainLion=function(){return ue.type()==="Darwin"&&St.satisfies(It(ue.release()),">=12.0.0")};I.exports.isWin8=function(){return ue.type()==="Windows_NT"&&St.satisfies(It(ue.release()),">=6.2.9200")};I.exports.isWSL=function(){return Zn};I.exports.isLessThanWin8=function(){return ue.type()==="Windows_NT"&&St.satisfies(It(ue.release()),"<6.2.9200")};function It(e){return e.split(".").length===2&&(e+=".0"),e}function fs(e){if(typeof e=="string"||e instanceof String){if(e.toLowerCase()==="info")return"info";if(e.toLowerCase()==="warn")return"warn";if(e.toLowerCase()==="error")return"error"}return"info"}I.exports.createNamedPipe=e=>{let t=Buffer.alloc(rs);return new Promise(r=>{e.instance=ts.createServer(i=>{i.on("data",n=>{t.write(n.toString())}),i.on("end",()=>{e.instance.close()})}),e.instance.listen(e.namedPipe,()=>{r(t)})})}});var li=C((qc,fi)=>{a();var si=g("os"),ls=En(),De=he(),ai=g("events").EventEmitter,us=g("util"),ci="notify-send",ze;fi.exports=Ae;function Ae(e){if(e=De.clone(e||{}),!(this instanceof Ae))return new Ae(e);this.options=e,ai.call(this)}us.inherits(Ae,ai);function hs(){}function ds(e,t){if(e=De.clone(e||{}),t=t||hs,typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof t);if(typeof e=="string"&&(e={title:"node-notifier",message:e}),!e.message)return t(new Error("Message is required.")),this;if(si.type()!=="Linux"&&!si.type().match(/BSD$/))return t(new Error("Only supported on Linux and *BSD systems")),this;if(ze===!1)return t(new Error("notify-send must be installed on the system.")),this;if(ze||this.options.suppressOsdCheck)return oi(e,t),this;try{ze=!!ls.sync(ci),oi(e,t)}catch(r){return ze=!1,t(r)}return this}Object.defineProperty(Ae.prototype,"notify",{get:function(){return this._notify||(this._notify=ds.bind(this)),this._notify}});var ms=["urgency","expire-time","icon","category","hint","app-name"];function oi(e,t){e=De.mapToNotifySend(e),e.title=e.title||"Node Notification:";let r=[e.title,e.message];delete e.title,delete e.message;let i=De.constructArgumentList(e,{initial:r,keyExtra:"-",allowedArguments:ms});De.command(ci,i,t)}});var Dt=C((Pc,hi)=>{a();var ps=g("net"),ui=!1;hi.exports=function(e,t){if(typeof t>"u"&&(t=e,e={}),ui)return t(null,ui);let r=e.port||23053,i=e.host||"localhost",n=ps.connect(r,i);n.setTimeout(100),n.once("connect",function(){n.end(),t(null,!0)}),n.once("error",function(){n.end(),t(null,!1)})}});var pi=C((Mc,mi)=>{a();var ys=g("net"),ws=g("crypto"),di=g("util").format,gs=g("fs"),P=`\r
3
3
  `;function de(e,t){t=t||{},this.type=e,this.host=t.host||"localhost",this.port=t.port||23053,this.request="GNTP/1.0 "+e+" NONE"+P,this.resources=[],this.attempts=0,this.maxAttempts=5}de.prototype.parseResp=function(e){var t={},r,i;return e=e.slice(0,e.indexOf(P+P)).split(P),r=e[0],i=e.slice(1),t.state=r.match(/-(OK|ERROR|CALLBACK)/)[0].slice(1),i.forEach(function(n){n=n.split(": "),t[n[0]]=n[1]}),t};de.prototype.retry=function(){var e=this,t=arguments;setTimeout(function(){e.send.apply(e,t)},750)};de.prototype.addResource=function(e){var t=ws.createHash("md5").update(e).digest("hex"),r="Identifier: "+t+P+"Length: "+e.length+P+P;return this.resources.push({header:r,file:e}),"x-growl-resource://"+t};de.prototype.add=function(e,t){t!==void 0&&(/-Icon/.test(e)&&!/^https?:\/\//.test(t)&&(/\.(png|gif|jpe?g)$/.test(t)?t=this.addResource(gs.readFileSync(t)):t instanceof Buffer&&(t=this.addResource(t))),this.request+=e+": "+t+P)};de.prototype.newline=function(){this.request+=P};de.prototype.send=function(e){var t=this,r=ys.connect(this.port,this.host),i="";e=e||function(){},this.attempts+=1,r.on("connect",function(){r.write(t.request),t.resources.forEach(function(n){r.write(n.header),r.write(n.file),r.write(P+P)})}),r.on("data",function(n){i+=n.toString(),i.slice(i.length-4)===P+P&&(i=t.parseResp(i),i.state==="ERROR"||i.state==="CALLBACK"?r.end():i="")}),r.on("end",function(){if(["200","401","402"].indexOf(i["Error-Code"])>=0)if(t.attempts<=t.maxAttempts)t.retry(e);else{var n='GNTP request to "%s:%d" failed with error code %s (%s)';e(new Error(di(n,t.host,t.port,i["Error-Code"],i["Error-Description"])))}else e(void 0,i)}),r.on("error",function(){e(new Error(di('Error while sending GNTP request to "%s:%d"',t.host,t.port))),r.destroy()})};mi.exports=de});var gi=C((Gc,wi)=>{a();var yi=pi();function Ce(){this.appname="Growly",this.notifications=void 0,this.labels=void 0,this.count=0,this.registered=!1,this.host=void 0,this.port=void 0}Ce.prototype.getLabels=function(){return this.notifications.map(function(e){return e.label})};Ce.prototype.setHost=function(e,t){this.host=e,this.port=t};Ce.prototype.register=function(e,t,r,i){var n;typeof t=="object"&&(r=t,t=void 0),(r===void 0||!r.length)&&(r=[{label:"default",dispname:"Default Notification",enabled:!0}]),typeof arguments[arguments.length-1]=="function"?i=arguments[arguments.length-1]:i=function(){},this.appname=e,this.notifications=r,this.labels=this.getLabels(),this.registered=!0,n=new yi("REGISTER",{host:this.host,port:this.port}),n.add("Application-Name",e),n.add("Application-Icon",t),n.add("Notifications-Count",r.length),n.newline(),r.forEach(function(s){s.enabled===void 0&&(s.enabled=!0),n.add("Notification-Name",s.label),n.add("Notification-Display-Name",s.dispname),n.add("Notification-Enabled",s.enabled?"True":"False"),n.add("Notification-Icon",s.icon),n.newline()}),n.send(i)};Ce.prototype.notify=function(e,t,r){var i=this,n;if(!this.registered){this.register(this.appname,function(s){s&&console.log(s),i.notify.call(i,e,t,r)});return}t=t||{},typeof t=="function"&&(r=t,t={}),n=new yi("NOTIFY",{host:this.host,port:this.port}),n.add("Application-Name",this.appname),n.add("Notification-Name",t.label||this.labels[0]),n.add("Notification-ID",++this.count),n.add("Notification-Title",t.title),n.add("Notification-Text",e),n.add("Notification-Sticky",t.sticky?"True":"False"),n.add("Notification-Priority",t.priority),n.add("Notification-Icon",t.icon),n.add("Notification-Coalescing-ID",t.coalescingId||void 0),n.add("Notification-Callback-Context",r?"context":void 0),n.add("Notification-Callback-Context-Type",r?"string":void 0),n.add("Notification-Callback-Target",void 0),n.newline(),n.send(function(s,o){r&&s?r(s):r&&o.state==="CALLBACK"&&r(void 0,o["Notification-Callback-Result"].toLowerCase())})};wi.exports=new Ce});var Ye=C((Bc,Ni)=>{a();var Es=Dt(),Je=he(),Te=gi(),vi=g("events").EventEmitter,vs=g("util"),Ns="Couldn't connect to growl (might be used as a fallback). Make sure it is running";Ni.exports=Re;var Ei;function Re(e){if(e=Je.clone(e||{}),!(this instanceof Re))return new Re(e);Te.appname=e.name||"Node",this.options=e,vi.call(this)}vs.inherits(Re,vi);function _s(e,t){if(Te.setHost(this.options.host,this.options.port),e=Je.clone(e||{}),typeof e=="string"&&(e={title:"node-notifier",message:e}),t=Je.actionJackerDecorator(this,e,t,function(r){return r==="click"?"click":r==="timedout"?"timeout":!1}),e=Je.mapToGrowl(e),!e.message)return t(new Error("Message is required.")),this;if(e.title=e.title||"Node Notification:",Ei||e.wait){let r=e.wait?t:Ss;return Te.notify(e.message,e,r),e.wait||t(),this}return Es(Te,function(r,i){if(Ei=i,!i)return t(new Error(Ns));Te.notify(e.message,e),t()}),this}Object.defineProperty(Re.prototype,"notify",{get:function(){return this._notify||(this._notify=_s.bind(this)),this._notify}});function Ss(){}});var Ii=C(($c,xi)=>{a();var me=he(),xs=Ye(),Is=g("path"),Ds=Is.join(__dirname,"../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier"),Si=g("events").EventEmitter,As=g("util"),Cs="You need Mac OS X 10.8 or above to use NotificationCenter, or use Growl fallback with constructor option {withFallback: true}.";xi.exports=ke;function ke(e){if(e=me.clone(e||{}),!(this instanceof ke))return new ke(e);this.options=e,Si.call(this)}As.inherits(ke,Si);var _i=null;function Ts(){}function Rs(e,t){let r,i=ks();if(e=me.clone(e||{}),_i=i,typeof e=="string"&&(e={title:"node-notifier",message:e}),t=t||Ts,typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof fn);let n=me.actionJackerDecorator(this,e,t,function(o){return _i!==i?!1:o==="activate"?"click":o==="timeout"?"timeout":o==="replied"?"replied":!1});if(e=me.mapToMac(e),!e.message&&!e.group&&!e.list&&!e.remove)return t(new Error("Message, group, remove or list property is required.")),this;let s=me.constructArgumentList(e);return me.isMountainLion()?(me.fileCommandJson(this.options.customPath||Ds,s,n),this):r||this.options.withFallback?(r=r||new xs(this.options),r.notify(e,t)):(t(new Error(Cs)),this)}Object.defineProperty(ke.prototype,"notify",{get:function(){return this._notify||(this._notify=Rs.bind(this)),this._notify}});function ks(){return{_ref:"val"}}});var At=C((zc,Ti)=>{a();var bs=g("path"),Ls=bs.resolve(__dirname,"../vendor/notifu/notifu"),Os=Dt(),Q=he(),qs=Ct(),Di=Ye(),Fs=g("os"),Ci=g("events").EventEmitter,Ps=g("util"),Ve;Ti.exports=be;function be(e){if(e=Q.clone(e||{}),!(this instanceof be))return new be(e);this.options=e,Ci.call(this)}Ps.inherits(be,Ci);function Us(){}function Ms(e,t){let r,i=this.options;e=Q.clone(e||{}),t=t||Us,typeof e=="string"&&(e={title:"node-notifier",message:e});let n=Q.actionJackerDecorator(this,e,t,function(s){return s==="activate"?"click":s==="timeout"?"timeout":!1});return this.options.withFallback&&Q.isWin8()?(r=r||new qs(i),r.notify(e,t)):this.options.withFallback&&(!Q.isLessThanWin8()||Ve===!0)?(r=r||new Di(i),r.notify(e,t)):!this.options.withFallback||Ve===!1?(Ai(e,i,n),this):(Os(i,function(s,o){if(Ve=o,Ve)return r=r||new Di(i),r.notify(e,t);Ai(e,i,n)}),this)}Object.defineProperty(be.prototype,"notify",{get:function(){return this._notify||(this._notify=Ms.bind(this)),this._notify}});var Ws=["t","d","p","m","i","e","q","w","xp"];function Ai(e,t,r){let i=Fs.arch()==="x64";e=e||{},e=Q.mapToNotifu(e),e.p=e.p||"Node Notification:";let n=Ls+(i?"64":"")+".exe",s=t.customPath||n;if(!e.m)return r(new Error("Message is required.")),this;let o=Q.constructArgumentList(e,{wrapper:"",noEscape:!0,explicitTrue:!0,allowedArguments:Ws});if(e.wait)return Q.fileCommand(s,o,function(c,f){let l=Gs(c.code);return l==="error"?r(c,f):r(null,l)});Q.immediateFileCommand(s,o,r)}function Gs(e){switch(e){case 2:return"timeout";case 3:case 6:case 7:return"activate";case 4:return"close";default:return"error"}}});import js from"crypto";function Le(){return Xe>Ze.length-16&&(js.randomFillSync(Ze),Xe=0),Ze.slice(Xe,Xe+=16)}var Ze,Xe,Tt=b(()=>{a();Ze=new Uint8Array(256),Xe=Ze.length});var Ri,ki=b(()=>{a();Ri=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function Bs(e){return typeof e=="string"&&Ri.test(e)}var se,Oe=b(()=>{a();ki();se=Bs});function Hs(e,t=0){let r=(R[e[t+0]]+R[e[t+1]]+R[e[t+2]]+R[e[t+3]]+"-"+R[e[t+4]]+R[e[t+5]]+"-"+R[e[t+6]]+R[e[t+7]]+"-"+R[e[t+8]]+R[e[t+9]]+"-"+R[e[t+10]]+R[e[t+11]]+R[e[t+12]]+R[e[t+13]]+R[e[t+14]]+R[e[t+15]]).toLowerCase();if(!se(r))throw TypeError("Stringified UUID is invalid");return r}var R,oe,qe=b(()=>{a();Oe();R=[];for(let e=0;e<256;++e)R.push((e+256).toString(16).substr(1));oe=Hs});function $s(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let s=e.node||bi,o=e.clockseq!==void 0?e.clockseq:Rt;if(s==null||o==null){let h=e.random||(e.rng||Le)();s==null&&(s=bi=[h[0]|1,h[1],h[2],h[3],h[4],h[5]]),o==null&&(o=Rt=(h[6]<<8|h[7])&16383)}let c=e.msecs!==void 0?e.msecs:Date.now(),f=e.nsecs!==void 0?e.nsecs:bt+1,l=c-kt+(f-bt)/1e4;if(l<0&&e.clockseq===void 0&&(o=o+1&16383),(l<0||c>kt)&&e.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");kt=c,bt=f,Rt=o,c+=122192928e5;let d=((c&268435455)*1e4+f)%4294967296;n[i++]=d>>>24&255,n[i++]=d>>>16&255,n[i++]=d>>>8&255,n[i++]=d&255;let u=c/4294967296*1e4&268435455;n[i++]=u>>>8&255,n[i++]=u&255,n[i++]=u>>>24&15|16,n[i++]=u>>>16&255,n[i++]=o>>>8|128,n[i++]=o&255;for(let h=0;h<6;++h)n[i+h]=s[h];return t||oe(n)}var bi,Rt,kt,bt,Li,Oi=b(()=>{a();Tt();qe();kt=0,bt=0;Li=$s});function Ks(e){if(!se(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var Qe,Lt=b(()=>{a();Oe();Qe=Ks});function zs(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function et(e,t,r){function i(n,s,o,c){if(typeof n=="string"&&(n=zs(n)),typeof s=="string"&&(s=Qe(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+n.length);if(f.set(s),f.set(n,s.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,o){c=c||0;for(let l=0;l<16;++l)o[c+l]=f[l];return o}return oe(f)}try{i.name=e}catch{}return i.DNS=Js,i.URL=Ys,i}var Js,Ys,Ot=b(()=>{a();qe();Lt();Js="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ys="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});import Vs from"crypto";function Xs(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Vs.createHash("md5").update(e).digest()}var qi,Fi=b(()=>{a();qi=Xs});var Zs,Pi,Ui=b(()=>{a();Ot();Fi();Zs=et("v3",48,qi),Pi=Zs});function Qs(e,t,r){e=e||{};let i=e.random||(e.rng||Le)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return oe(i)}var Mi,Wi=b(()=>{a();Tt();qe();Mi=Qs});import eo from"crypto";function to(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),eo.createHash("sha1").update(e).digest()}var Gi,ji=b(()=>{a();Gi=to});var ro,Bi,Hi=b(()=>{a();Ot();ji();ro=et("v5",80,Gi),Bi=ro});var $i,Ki=b(()=>{a();$i="00000000-0000-0000-0000-000000000000"});function io(e){if(!se(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var zi,Ji=b(()=>{a();Oe();zi=io});var Yi={};mn(Yi,{NIL:()=>$i,parse:()=>Qe,stringify:()=>oe,v1:()=>Li,v3:()=>Pi,v4:()=>Mi,v5:()=>Bi,validate:()=>se,version:()=>zi});var Vi=b(()=>{a();Oi();Ui();Wi();Hi();Ki();Ji();Oe();qe();Lt()});var Ct=C((Xf,Zi)=>{a();var no=g("path"),so=no.resolve(__dirname,"../vendor/snoreToast/snoretoast"),J=he(),oo=At(),ao=g("os"),{v4:co}=(Vi(),pn(Yi)),Xi=g("events").EventEmitter,fo=g("util"),qt,lo="notifierPipe",uo="\\\\.\\pipe\\",ho="/tmp/";Zi.exports=Fe;function Fe(e){if(e=J.clone(e||{}),!(this instanceof Fe))return new Fe(e);this.options=e,Xi.call(this)}fo.inherits(Fe,Xi);function mo(){}function po(e){return e?e.split(";").reduce((t,r)=>{let i=r.split("=");return i&&i.length===2&&(t[i[0]]=i[1]),t},{}):{}}function yo(){return`${J.isWSL()?ho:uo}${lo}-${co()}`}function wo(e,t){e=J.clone(e||{}),t=t||mo;let r=ao.arch()==="x64",i,n={namedPipe:yo()};if(typeof e=="string"&&(e={title:"node-notifier",message:e}),typeof t!="function")throw new TypeError("The second argument must be a function callback. You have passed "+typeof fn);let s=(c,f)=>{let l=po(i&&i.toString("utf16le"));l.action==="buttonClicked"&&l.button?l.activationType=l.button:l.action&&(l.activationType=l.action),c&&c.code===-1&&f(c,l),f(null,l),n.instance&&n.instance.close()},o=c=>s(c,J.actionJackerDecorator(this,e,t,f=>f==="activate"?"click":f||!1));return e.title=e.title||"Node Notification:",typeof e.message>"u"&&typeof e.close>"u"?(t(new Error("Message or ID to close is required.")),this):!J.isWin8()&&!J.isWSL()&&this.options.withFallback?(qt=qt||new oo(this.options),qt.notify(e,t)):(J.createNamedPipe(n).then(c=>{i=c,e.pipeName=n.namedPipe;let f=e.customPath||this.options.customPath||so+"-x"+(r?"64":"86")+".exe";e=J.mapToWin8(e);let l=J.constructArgumentList(e,{explicitTrue:!0,wrapper:"",keepNewlines:!0,noEscape:!0});J.fileCommand(f,l,o)}),this)}Object.defineProperty(Fe.prototype,"notify",{get:function(){return this._notify||(this._notify=wo.bind(this)),this._notify}})});var tn=C((Qf,D)=>{a();var Qi=g("os"),en=he(),Pe=li(),Ft=Ii(),Ue=Ct(),Pt=Ye(),Ut=At(),pe={withFallback:!0},go=en.isWSL()?"WSL":Qi.type();switch(go){case"Linux":D.exports=new Pe(pe),D.exports.Notification=Pe;break;case"Darwin":D.exports=new Ft(pe),D.exports.Notification=Ft;break;case"Windows_NT":en.isLessThanWin8()?(D.exports=new Ut(pe),D.exports.Notification=Ut):(D.exports=new Ue(pe),D.exports.Notification=Ue);break;case"WSL":D.exports=new Ue(pe),D.exports.Notification=Ue;break;default:Qi.type().match(/BSD$/)?(D.exports=new Pe(pe),D.exports.Notification=Pe):(D.exports=new Pt(pe),D.exports.Notification=Pt)}D.exports.NotifySend=Pe;D.exports.NotificationCenter=Ft;D.exports.WindowsToaster=Ue;D.exports.WindowsBalloon=Ut;D.exports.Growl=Pt});a();var on=We(wn(),1),ae=We(yn(),1);import sn from"node:path";a();import{EventEmitter as An}from"node:events";import wt from"node:fs";import we from"node:path";a();import vn from"node:os";var sr=300,ie=20,ve=1e7,or=vn.platform();var Nn=or==="darwin",nt=or==="win32",ne=Nn||nt,ar=3e3,cr=2e4,st=1250;a();var $;(function(e){e[e.DIR=1]="DIR",e[e.FILE=2]="FILE"})($||($={}));var le;(function(e){e.CHANGE="change",e.RENAME="rename"})(le||(le={}));var Ne;(function(e){e.CHANGE="change",e.ERROR="error"})(Ne||(Ne={}));var m;(function(e){e.ADD="add",e.ADD_DIR="addDir",e.CHANGE="change",e.RENAME="rename",e.RENAME_DIR="renameDir",e.UNLINK="unlink",e.UNLINK_DIR="unlinkDir"})(m||(m={}));var L;(function(e){e.ALL="all",e.CLOSE="close",e.ERROR="error",e.READY="ready"})(L||(L={}));a();a();a();var _n=(e,t=1,r)=>{t=Math.max(1,t);let i=r?.leading??!1,n=r?.trailing??!0,s=Math.max(r?.maxWait??1/0,t),o,c,f=0,l=0,d=()=>{let N=Date.now(),F=N-f,re=N-l,fe=F>=t||re>=s;return[N,fe]},u=N=>{if(l=N,!o)return;let F=o;o=void 0,e.apply(void 0,F)},h=()=>{te(0)},_=()=>{c&&(h(),u(Date.now()))},T=N=>{if(l=N,i)return u(N)},U=N=>{if(n&&o)return u(N);o=void 0},M=()=>{c=void 0;let[N,F]=d();return F?U(N):ee(N)},ee=N=>{let F=N-f,re=N-l,fe=t-F,Me=s-re,G=Math.min(fe,Me);return te(G)},te=N=>{c&&clearTimeout(c),!(N<=0)&&(c=setTimeout(M,N))},ce=(...N)=>{let[F,re]=d(),fe=!!c;if(o=N,f=F,(re||!c)&&te(t),re)return fe?u(F):T(F)};return ce.cancel=h,ce.flush=_,ce},je=_n;a();import vr from"node:fs";import ft from"node:path";a();import v from"node:fs";import{promisify as k}from"node:util";a();var V=(e,t)=>function(...i){return e.apply(void 0,i).catch(t)},K=(e,t)=>function(...i){try{return e.apply(void 0,i)}catch(n){return t(n)}};a();import fr from"node:process";var lr=fr.getuid?!fr.getuid():!1,ur=1e4,q=()=>{};a();var _e={isChangeErrorOk:e=>{if(!_e.isNodeError(e))return!1;let{code:t}=e;return t==="ENOSYS"||!lr&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!_e.isNodeError(e))return!1;let{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!_e.isNodeError(e))throw e;if(!_e.isChangeErrorOk(e))throw e}},x=_e;a();a();var ot=class{constructor(){this.interval=25,this.intervalId=void 0,this.limit=ur,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{let r=()=>this.remove(i),i=()=>t(r);this.add(i)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.add(t),t()}}}}},hr=new ot;var X=(e,t)=>function(i){return function n(...s){return hr.schedule().then(o=>{let c=l=>(o(),l),f=l=>{if(o(),Date.now()>=i)throw l;if(t(l)){let d=Math.round(100*Math.random());return new Promise(h=>setTimeout(h,d)).then(()=>n.apply(void 0,s))}throw l};return e.apply(void 0,s).then(c,f)})}},Z=(e,t)=>function(i){return function n(...s){try{return e.apply(void 0,s)}catch(o){if(Date.now()>i)throw o;if(t(o))return n.apply(void 0,s);throw o}}};var Sn={attempt:{chmod:V(k(v.chmod),x.onChangeError),chown:V(k(v.chown),x.onChangeError),close:V(k(v.close),q),fsync:V(k(v.fsync),q),mkdir:V(k(v.mkdir),q),realpath:V(k(v.realpath),q),stat:V(k(v.stat),q),unlink:V(k(v.unlink),q),chmodSync:K(v.chmodSync,x.onChangeError),chownSync:K(v.chownSync,x.onChangeError),closeSync:K(v.closeSync,q),existsSync:K(v.existsSync,q),fsyncSync:K(v.fsync,q),mkdirSync:K(v.mkdirSync,q),realpathSync:K(v.realpathSync,q),statSync:K(v.statSync,q),unlinkSync:K(v.unlinkSync,q)},retry:{close:X(k(v.close),x.isRetriableError),fsync:X(k(v.fsync),x.isRetriableError),open:X(k(v.open),x.isRetriableError),readFile:X(k(v.readFile),x.isRetriableError),rename:X(k(v.rename),x.isRetriableError),stat:X(k(v.stat),x.isRetriableError),write:X(k(v.write),x.isRetriableError),writeFile:X(k(v.writeFile),x.isRetriableError),closeSync:Z(v.closeSync,x.isRetriableError),fsyncSync:Z(v.fsyncSync,x.isRetriableError),openSync:Z(v.openSync,x.isRetriableError),readFileSync:Z(v.readFileSync,x.isRetriableError),renameSync:Z(v.renameSync,x.isRetriableError),statSync:Z(v.statSync,x.isRetriableError),writeSync:Z(v.writeSync,x.isRetriableError),writeFileSync:Z(v.writeFileSync,x.isRetriableError)}},dr=Sn;a();import ct from"node:fs";import Be from"node:path";a();a();a();var at=()=>{};var xn=()=>{let e=at,t=at,r=!1,i=!1;return{promise:new Promise((f,l)=>{e=d=>(r=!0,f(d)),t=d=>(i=!0,l(d))}),resolve:e,reject:t,isPending:()=>!r&&!i,isResolved:()=>r,isRejected:()=>i}},mr=xn;var In=()=>{let{promise:e,resolve:t,isPending:r}=mr(),i=0,n=()=>{i+=1},s=()=>{i-=1,!i&&t()};return(()=>{n(),queueMicrotask(s)})(),{promise:e,isPending:r,increment:n,decrement:s}},pr=In;a();var yr={then:e=>{e()}};a();var wr=e=>Array.isArray(e)?e:[e],gr=e=>typeof e=="function";var Dn=(e,t)=>{let r=t?.followSymlinks??!1,i=t?.depth??1/0,n=t?.limit??1/0,s=t?.ignore??[],o=wr(s).map(w=>gr(w)?w:y=>w.test(y)),c=w=>o.some(y=>y(w)),f=t?.signal??{aborted:!1},l=t?.onDirents||(()=>{}),d=[],u=new Set,h={},_=[],T=new Set,U={},M=[],ee=new Set,te={},ce={},N=new Set,F={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{},map:{}},re={directories:d,directoriesNames:u,directoriesNamesToPaths:h,files:_,filesNames:T,filesNamesToPaths:U,symlinks:M,symlinksNames:ee,symlinksNamesToPaths:te,map:ce},{promise:fe,increment:Me,decrement:G}=pr(),Y=0,Mt=(w,y,E,S)=>{N.has(y)||Y>=n||(Y+=1,w.directories.push(y),w.directoriesNames.add(E),d.push(y),u.add(E),h.propertyIsEnumerable(E)||(h[E]=[]),h[E].push(y),N.add(y),!(S>=i)&&(Y>=n||jt(y,S+1)))},Wt=(w,y,E)=>{N.has(y)||Y>=n||(Y+=1,w.files.push(y),w.filesNames.add(E),_.push(y),T.add(E),U.propertyIsEnumerable(E)||(U[E]=[]),U[E].push(y),N.add(y))},Gt=(w,y,E,S)=>{N.has(y)||Y>=n||(Y+=1,w.symlinks.push(y),w.symlinksNames.add(E),M.push(y),ee.add(E),te.propertyIsEnumerable(E)||(te[E]=[]),te[E].push(y),N.add(y),r&&(S>=i||Y>=n||hn(y,S+1)))},cn=(w,y,E,S,j)=>{f.aborted||c(y)||(S.isDirectory()?Mt(w,y,E,j):S.isFile()?Wt(w,y,E):S.isSymbolicLink()&&Gt(w,y,E,j))},ln=(w,y,E,S)=>{if(f.aborted)return;let j=y===Be.sep?"":Be.sep,H=E.name,ye=`${y}${j}${H}`;c(ye)||(E.isDirectory()?Mt(w,ye,H,S):E.isFile()?Wt(w,ye,H):E.isSymbolicLink()&&Gt(w,ye,H,S))},un=(w,y,E,S)=>{for(let j=0,H=E.length;j<H;j++)ln(w,y,E[j],S)},jt=(w,y)=>{f.aborted||y>i||Y>=n||(Me(),ct.readdir(w,{withFileTypes:!0},(E,S)=>{if(E||f.aborted||!S.length)return G();(l(S)||yr).then(()=>{let H=ce[w]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};un(H,w,S,y),G()})}))},hn=(w,y)=>{Me(),ct.realpath(w,(E,S)=>{if(E||f.aborted)return G();ct.stat(S,(j,H)=>{if(j||f.aborted)return G();let ye=Be.basename(S),dn=ce[w]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};cn(dn,S,ye,H,y),G()})})};return(async(w,y=1)=>(w=Be.normalize(w),N.add(w),jt(w,y),await fe,f.aborted?F:re))(e)},Er=Dn;var z={lang:{debounce:je,attempt:e=>{try{return e()}catch(t){return z.lang.castError(t)}},castArray:e=>z.lang.isArray(e)?e:[e],castError:e=>z.lang.isError(e)?e:z.lang.isString(e)?new Error(e):new Error("Unknown error"),defer:e=>setTimeout(e,0),isArray:e=>Array.isArray(e),isError:e=>e instanceof Error,isFunction:e=>typeof e=="function",isNaN:e=>Number.isNaN(e),isNumber:e=>typeof e=="number",isPrimitive:e=>{if(e===null)return!0;let t=typeof e;return t!=="object"&&t!=="function"},isShallowEqual:(e,t)=>{if(e===t)return!0;if(z.lang.isNaN(e))return z.lang.isNaN(t);if(z.lang.isPrimitive(e)||z.lang.isPrimitive(t))return e===t;for(let r in e)if(!(r in t))return!1;for(let r in t)if(e[r]!==t[r])return!1;return!0},isSet:e=>e instanceof Set,isString:e=>typeof e=="string",isUndefined:e=>e===void 0,noop:()=>{},uniq:e=>e.length<2?e:Array.from(new Set(e))},fs:{getDepth:e=>Math.max(0,e.split(ft.sep).length-1),getRealPath:(e,t)=>{try{return t?vr.realpathSync.native(e):vr.realpathSync(e)}catch{return}},isSubPath:(e,t)=>t.startsWith(e)&&t[e.length]===ft.sep&&t.length-e.length>ft.sep.length,poll:(e,t=cr)=>dr.retry.stat(t)(e,{bigint:!0}).catch(z.lang.noop),readdir:async(e,t,r=1/0,i=1/0,n,s)=>{if(s&&r===1&&e in s){let o=s[e];return[o.directories,o.files]}else{let o=await Er(e,{depth:r,limit:i,ignore:t,signal:n});return[o.directories,o.files]}}}},p=z;a();import lt from"node:path";var ut=class{constructor(t,r,i){this.base=i,this.watcher=t,this.handler=r.handler,this.fswatcher=r.watcher,this.options=r.options,this.folderPath=r.folderPath,this.filePath=r.filePath,this.handlerBatched=this.base?this.base.onWatcherEvent.bind(this.base):this._makeHandlerBatched(this.options.debounce)}_isSubRoot(t){return this.filePath?t===this.filePath:t===this.folderPath||p.fs.isSubPath(this.folderPath,t)}_makeHandlerBatched(t=sr){return(()=>{let r=this.watcher._readyWait,i=[],n=new Set,s=async(c,f)=>{let l=this.options.ignoreInitial?[]:c,d=await this.eventsPopulate([...f]),u=this.eventsDeduplicate([...l,...d]);this.onTargetEvents(u)},o=p.lang.debounce(()=>{this.watcher.isClosed()||(r=s(i,n),i=[],n=new Set)},t);return async(c,f="",l=!1)=>{l?await this.eventsPopulate([f],i,!0):n.add(f),r.then(o)}})()}eventsDeduplicate(t){if(t.length<2)return t;let r={};return t.reduce((i,n)=>{let[s,o]=n,c=r[o];return s===c||s===m.CHANGE&&c===m.ADD||(r[o]=s,i.push(n)),i},[])}async eventsPopulate(t,r=[],i=!1){return await Promise.all(t.map(async n=>{let s=await this.watcher._poller.update(n,this.options.pollingTimeout);await Promise.all(s.map(async o=>{r.push([o,n]),o===m.ADD_DIR?await this.eventsPopulateAddDir(t,n,r,i):o===m.UNLINK_DIR&&await this.eventsPopulateUnlinkDir(t,n,r,i)}))})),r}async eventsPopulateAddDir(t,r,i=[],n=!1){if(n)return i;let s=this.options.recursive?this.options.depth??ie:Math.min(1,this.options.depth??ie),o=this.options.limit??ve,[c,f]=await p.fs.readdir(r,this.options.ignore,s,o,this.watcher._closeSignal),l=[...c,...f];return await Promise.all(l.map(d=>{if(!this.watcher.isIgnored(d,this.options.ignore)&&!t.includes(d))return this.eventsPopulate([d],i,!0)})),i}async eventsPopulateUnlinkDir(t,r,i=[],n=!1){if(n)return i;for(let s of this.watcher._poller.stats.keys())p.fs.isSubPath(r,s)&&(t.includes(s)||await this.eventsPopulate([s],i,!0));return i}onTargetAdd(t){this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAdd(t,this.options.renameTimeout):this.watcher.event(m.ADD,t))}onTargetAddDir(t){t!==this.folderPath&&this.options.recursive&&!ne&&this.options.native!==!1&&this.watcher.watchDirectory(t,this.options,this.handler,void 0,this.base||this),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAddDir(t,this.options.renameTimeout):this.watcher.event(m.ADD_DIR,t))}onTargetChange(t){this._isSubRoot(t)&&this.watcher.event(m.CHANGE,t)}onTargetUnlink(t){this.watcher.watchersClose(lt.dirname(t),t,!1),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlink(t,this.options.renameTimeout):this.watcher.event(m.UNLINK,t))}onTargetUnlinkDir(t){this.watcher.watchersClose(lt.dirname(t),t,!1),this.watcher.watchersClose(t),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlinkDir(t,this.options.renameTimeout):this.watcher.event(m.UNLINK_DIR,t))}onTargetEvent(t){let[r,i]=t;r===m.ADD?this.onTargetAdd(i):r===m.ADD_DIR?this.onTargetAddDir(i):r===m.CHANGE?this.onTargetChange(i):r===m.UNLINK?this.onTargetUnlink(i):r===m.UNLINK_DIR&&this.onTargetUnlinkDir(i)}onTargetEvents(t){for(let r of t)this.onTargetEvent(r)}onWatcherEvent(t,r,i=!1){return this.handlerBatched(t,r,i)}onWatcherChange(t=le.CHANGE,r){if(this.watcher.isClosed())return;let i=lt.resolve(this.folderPath,r||"");this.filePath&&i!==this.folderPath&&i!==this.filePath||this.watcher.isIgnored(i,this.options.ignore)||this.onWatcherEvent(t,i)}onWatcherError(t){nt&&t.code==="EPERM"?this.onWatcherChange(le.CHANGE,""):this.watcher.error(t)}async init(){await this.initWatcherEvents(),await this.initInitialEvents()}async initWatcherEvents(){let t=this.onWatcherChange.bind(this);this.fswatcher.on(Ne.CHANGE,t);let r=this.onWatcherError.bind(this);this.fswatcher.on(Ne.ERROR,r)}async initInitialEvents(){let t=!this.watcher.isReady();if(this.filePath){if(this.watcher._poller.stats.has(this.filePath))return;await this.onWatcherEvent(le.CHANGE,this.filePath,t)}else{let r=this.options.recursive&&ne&&this.options.native!==!1?this.options.depth??ie:Math.min(1,this.options.depth??ie),i=this.options.limit??ve,[n,s]=await p.fs.readdir(this.folderPath,this.options.ignore,r,i,this.watcher._closeSignal,this.options.readdirMap),o=[this.folderPath,...n,...s];await Promise.all(o.map(c=>{if(!this.watcher._poller.stats.has(c)&&!this.watcher.isIgnored(c,this.options.ignore))return this.onWatcherEvent(le.CHANGE,c,t)}))}}},Nr=ut;a();a();var O={interval:100,intervalId:void 0,fns:new Map,init:()=>{O.intervalId||(O.intervalId=setInterval(O.resolve,O.interval))},reset:()=>{O.intervalId&&(clearInterval(O.intervalId),delete O.intervalId)},add:(e,t)=>{O.fns.set(e,Date.now()+t),O.init()},remove:e=>{O.fns.delete(e)},resolve:()=>{if(!O.fns.size)return O.reset();let e=Date.now();for(let[t,r]of O.fns)r>=e||(O.remove(t),t())}},Se=O;var xe=class e{constructor(t){this._watcher=t,this.reset()}getLockAdd(t,r=st){let{ino:i,targetPath:n,events:s,locks:o}=t,c=()=>{let u=this._watcher._poller.paths.find(i||-1,h=>h!==n);if(u&&u!==n){if(p.fs.getRealPath(n,!0)===u)return;this._watcher.event(s.rename,u,n)}else this._watcher.event(s.add,n)};if(!i)return c();let f=()=>{o.add.delete(i),Se.remove(l)},l=()=>{f(),c()};Se.add(l,r);let d=()=>{let u=o.unlink.get(i);if(!u)return;f();let h=u();n===h?s.change&&this._watcher._poller.stats.has(n)&&this._watcher.event(s.change,n):this._watcher.event(s.rename,h,n)};o.add.set(i,d),d()}getLockUnlink(t,r=st){let{ino:i,targetPath:n,events:s,locks:o}=t,c=()=>{this._watcher.event(s.unlink,n)};if(!i)return c();let f=()=>{o.unlink.delete(i),Se.remove(l)},l=()=>{f(),c()};Se.add(l,r);let d=()=>(f(),n);o.unlink.set(i,d),o.add.get(i)?.()}getLockTargetAdd(t,r){let i=this._watcher._poller.getIno(t,m.ADD,$.FILE);return this.getLockAdd({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetAddDir(t,r){let i=this._watcher._poller.getIno(t,m.ADD_DIR,$.DIR);return this.getLockAdd({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}getLockTargetUnlink(t,r){let i=this._watcher._poller.getIno(t,m.UNLINK,$.FILE);return this.getLockUnlink({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetUnlinkDir(t,r){let i=this._watcher._poller.getIno(t,m.UNLINK_DIR,$.DIR);return this.getLockUnlink({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}reset(){this._locksAdd=new Map,this._locksAddDir=new Map,this._locksUnlink=new Map,this._locksUnlinkDir=new Map,this._locksDir={add:this._locksAddDir,unlink:this._locksUnlinkDir},this._locksFile={add:this._locksAdd,unlink:this._locksUnlink}}};xe.DIR_EVENTS={add:m.ADD_DIR,rename:m.RENAME_DIR,unlink:m.UNLINK_DIR};xe.FILE_EVENTS={add:m.ADD,change:m.CHANGE,rename:m.RENAME,unlink:m.UNLINK};var _r=xe;a();a();var ht=class{constructor(){this.map=new Map}clear(){this.map.clear()}delete(t,r){if(p.lang.isUndefined(r))return this.map.delete(t);if(this.map.has(t)){let i=this.map.get(t);if(p.lang.isSet(i)){let n=i.delete(r);return i.size||this.map.delete(t),n}else if(i===r)return this.map.delete(t),!0}return!1}find(t,r){if(this.map.has(t)){let i=this.map.get(t);if(p.lang.isSet(i))return Array.from(i).find(r);if(r(i))return i}}get(t){return this.map.get(t)}has(t,r){if(p.lang.isUndefined(r))return this.map.has(t);if(this.map.has(t)){let i=this.map.get(t);return p.lang.isSet(i)?i.has(r):i===r}return!1}set(t,r){if(this.map.has(t)){let i=this.map.get(t);p.lang.isSet(i)?i.add(r):i!==r&&this.map.set(t,new Set([i,r]))}else this.map.set(t,r);return this}},dt=ht;a();var mt=class{constructor(t){this.ino=t.ino<=Number.MAX_SAFE_INTEGER?Number(t.ino):t.ino,this.size=Number(t.size),this.atimeMs=Number(t.atimeMs),this.mtimeMs=Number(t.mtimeMs),this.ctimeMs=Number(t.ctimeMs),this.birthtimeMs=Number(t.birthtimeMs),this._isFile=t.isFile(),this._isDirectory=t.isDirectory(),this._isSymbolicLink=t.isSymbolicLink()}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isSymbolicLink(){return this._isSymbolicLink}},Sr=mt;var pt=class{constructor(){this.inos={},this.paths=new dt,this.stats=new Map}getIno(t,r,i){let n=this.inos[r];if(!n)return;let s=n[t];if(s&&!(i&&s[1]!==i))return s[0]}getStats(t){return this.stats.get(t)}async poll(t,r){let i=await p.fs.poll(t,r);if(!(!i||!(i.isFile()||i.isDirectory())))return new Sr(i)}reset(){this.inos={},this.paths=new dt,this.stats=new Map}async update(t,r){let i=this.getStats(t),n=await this.poll(t,r);if(this.updateStats(t,n),!i&&n){if(n.isFile())return this.updateIno(t,m.ADD,n),[m.ADD];if(n.isDirectory())return this.updateIno(t,m.ADD_DIR,n),[m.ADD_DIR]}else if(i&&!n){if(i.isFile())return this.updateIno(t,m.UNLINK,i),[m.UNLINK];if(i.isDirectory())return this.updateIno(t,m.UNLINK_DIR,i),[m.UNLINK_DIR]}else if(i&&n){if(i.isFile()){if(n.isFile())return i.ino===n.ino&&!i.size&&!n.size?[]:(this.updateIno(t,m.CHANGE,n),[m.CHANGE]);if(n.isDirectory())return this.updateIno(t,m.UNLINK,i),this.updateIno(t,m.ADD_DIR,n),[m.UNLINK,m.ADD_DIR]}else if(i.isDirectory()){if(n.isFile())return this.updateIno(t,m.UNLINK_DIR,i),this.updateIno(t,m.ADD,n),[m.UNLINK_DIR,m.ADD];if(n.isDirectory())return i.ino===n.ino?[]:(this.updateIno(t,m.UNLINK_DIR,i),this.updateIno(t,m.ADD_DIR,n),[m.UNLINK_DIR,m.ADD_DIR])}}return[]}updateIno(t,r,i){let n=this.inos[r]=this.inos[r]||(this.inos[r]={}),s=i.isFile()?$.FILE:$.DIR;n[t]=[i.ino,s]}updateStats(t,r){if(r)this.paths.set(r.ino,t),this.stats.set(t,r);else{let i=this.stats.get(t)?.ino||-1;this.paths.delete(i,t),this.stats.delete(t)}}},yt=pt;var gt=class e extends An{constructor(t,r,i){super(),this._closed=!1,this._ready=!1,this._closeAborter=new AbortController,this._closeSignal=this._closeAborter.signal,this.on(L.CLOSE,()=>this._closeAborter.abort()),this._closeWait=new Promise(n=>this.on(L.CLOSE,n)),this._readyWait=new Promise(n=>this.on(L.READY,n)),this._locker=new _r(this),this._roots=new Set,this._poller=new yt,this._pollers=new Set,this._subwatchers=new Set,this._watchers={},this._watchersLock=Promise.resolve(),this._watchersRestorable={},this.watch(t,r,i)}isClosed(){return this._closed}isIgnored(t,r){return!!r&&(p.lang.isFunction(r)?!!r(t):r.test(t))}isReady(){return this._ready}close(){return this._locker.reset(),this._poller.reset(),this._roots.clear(),this.watchersClose(),this.isClosed()?!1:(this._closed=!0,this.emit(L.CLOSE))}error(t){if(this.isClosed())return!1;let r=p.lang.castError(t);return this.emit(L.ERROR,r)}event(t,r,i){return this.isClosed()?!1:(this.emit(L.ALL,t,r,i),this.emit(t,r,i))}ready(){return this.isClosed()||this.isReady()?!1:(this._ready=!0,this.emit(L.READY))}pollerExists(t,r){for(let i of this._pollers)if(i.targetPath===t&&p.lang.isShallowEqual(i.options,r))return!0;return!1}subwatcherExists(t,r){for(let i of this._subwatchers)if(i.targetPath===t&&p.lang.isShallowEqual(i.options,r))return!0;return!1}watchersClose(t,r,i=!0){if(t){let n=this._watchers[t];if(n)for(let s of[...n])r&&s.filePath!==r||this.watcherClose(s);if(i)for(let s in this._watchers)p.fs.isSubPath(t,s)&&this.watchersClose(s,r,!1)}else for(let n in this._watchers)this.watchersClose(n,r,!1)}watchersLock(t){return this._watchersLock.then(()=>this._watchersLock=new Promise(async r=>{await t(),r()}))}watchersRestore(){delete this._watchersRestoreTimeout;let t=Object.entries(this._watchersRestorable);this._watchersRestorable={};for(let[r,i]of t)this.watchPath(r,i.options,i.handler)}async watcherAdd(t,r){let{folderPath:i}=t;(this._watchers[i]=this._watchers[i]||[]).push(t);let s=new Nr(this,t,r);return await s.init(),s}watcherClose(t){t.watcher.close();let r=this._watchers[t.folderPath];if(r){let s=r.indexOf(t);r.splice(s,1),r.length||delete this._watchers[t.folderPath]}let i=t.filePath||t.folderPath;this._roots.has(i)&&(this._watchersRestorable[i]=t,this._watchersRestoreTimeout||(this._watchersRestoreTimeout=p.lang.defer(()=>this.watchersRestore())))}watcherExists(t,r,i,n){if(this._watchers[t]?.find(c=>c.handler===i&&(!c.filePath||c.filePath===n)&&c.options.ignore===r.ignore&&!!c.options.native==!!r.native&&(!r.recursive||c.options.recursive)))return!0;let o=we.dirname(t);for(let c=1;c<1/0;c++){if(this._watchers[o]?.find(d=>(c===1||d.options.recursive&&c<=(d.options.depth??ie))&&d.handler===i&&(!d.filePath||d.filePath===n)&&d.options.ignore===r.ignore&&!!d.options.native==!!r.native&&(!r.recursive||d.options.recursive&&ne&&d.options.native!==!1)))return!0;if(!ne)break;let l=we.dirname(t);if(o===l)break;o=l}return!1}async watchDirectories(t,r,i,n,s){if(this.isClosed())return;t=p.lang.uniq(t).sort();let o;for(let c of t)if(!this.isIgnored(c,r.ignore)&&!this.watcherExists(c,r,i,n))try{let f=!r.recursive||ne&&r.native!==!1?r:{...r,recursive:!1},d={watcher:wt.watch(c,f),handler:i,options:r,folderPath:c,filePath:n},u=o=await this.watcherAdd(d,s);if(this._roots.has(n||c)){let _={...r,ignoreInitial:!0,recursive:!1},T=we.dirname(c),U=c;await this.watchDirectories([T],_,i,U,u)}}catch(f){this.error(f)}return o}async watchDirectory(t,r,i,n,s){if(!this.isClosed()&&!this.isIgnored(t,r.ignore)){if(!r.recursive||ne&&r.native!==!1)return this.watchersLock(()=>this.watchDirectories([t],r,i,n,s));{r={...r,recursive:!0};let o=r.depth??ie,c=r.limit??ve,[f]=await p.fs.readdir(t,r.ignore,o,c,this._closeSignal,r.readdirMap);return this.watchersLock(async()=>{let l=await this.watchDirectories([t],r,i,n,s);if(f.length){let d=p.fs.getDepth(t);for(let u of f){let h=p.fs.getDepth(u),_=Math.max(0,o-(h-d)),T={...r,depth:_};await this.watchDirectories([u],T,i,n,s||l)}}})}}}async watchFileOnce(t,r,i){if(this.isClosed()||(r={...r,ignoreInitial:!1},this.subwatcherExists(t,r)))return;let n={targetPath:t,options:r},s=(l,d)=>{d===t&&(f(),i())},o=new e(s),c=()=>{this._subwatchers.add(n),this.on(L.CLOSE,f),o.watchFile(t,r,s)},f=()=>{this._subwatchers.delete(n),this.removeListener(L.CLOSE,f),o.close()};return c()}async watchFile(t,r,i){if(this.isClosed()||this.isIgnored(t,r.ignore))return;r={...r,recursive:!1};let n=we.dirname(t);return this.watchDirectory(n,r,i,t)}async watchPollingOnce(t,r,i){if(this.isClosed())return;let n=!1,s=new yt,o=await this.watchPolling(t,r,async()=>{n||!(await s.update(t,r.pollingTimeout)).length||n||(n=!0,o(),i())})}async watchPolling(t,r,i){if(this.isClosed())return p.lang.noop;if(this.pollerExists(t,r))return p.lang.noop;let n={...r,interval:r.pollingInterval??ar},s={targetPath:t,options:r},o=()=>{this._pollers.add(s),this.on(L.CLOSE,c),wt.watchFile(t,n,i)},c=()=>{this._pollers.delete(s),this.removeListener(L.CLOSE,c),wt.unwatchFile(t,i)};return p.lang.attempt(o),()=>p.lang.attempt(c)}async watchUnknownChild(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchFileOnce(t,r,n)}async watchUnknownTarget(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchPollingOnce(t,r,n)}async watchPaths(t,r,i){if(this.isClosed())return;if(t=p.lang.uniq(t).sort(),t.every((s,o)=>t.every((c,f)=>f===o||!p.fs.isSubPath(s,c))))await Promise.all(t.map(s=>this.watchPath(s,r,i)));else for(let s of t)await this.watchPath(s,r,i)}async watchPath(t,r,i){if(this.isClosed()||(t=we.resolve(t),this.isIgnored(t,r.ignore)))return;let n=await p.fs.poll(t,r.pollingTimeout);if(n){if(n.isFile())return this.watchFile(t,r,i);if(n.isDirectory())return this.watchDirectory(t,r,i);this.error(`"${t}" is not supported`)}else{let s=we.dirname(t);return(await p.fs.poll(s,r.pollingTimeout))?.isDirectory()?this.watchUnknownChild(t,r,i):this.watchUnknownTarget(t,r,i)}}async watch(t,r,i=p.lang.noop){if(p.lang.isFunction(t))return this.watch([],{},t);if(p.lang.isUndefined(t))return this.watch([],r,i);if(p.lang.isFunction(r))return this.watch(t,{},r);if(p.lang.isUndefined(r))return this.watch(t,{},i);if(this.isClosed())return;this.isReady()&&(r.readdirMap=void 0);let n=p.lang.castArray(t);n.forEach(s=>this._roots.add(s)),await this.watchPaths(n,r,i),!this.isClosed()&&(i!==p.lang.noop&&this.on(L.ALL,i),r.readdirMap=void 0,this.ready())}},xr=gt;var an=We(Kr(),1);a();var Et=(e,...t)=>{let r=Kt(e,...t);Ge.isInteractive?Ge.updateFooter(r):Ge.writeStdout(r)};a();var rn=We(tn(),1);var nn=(e,t)=>{e.log.info("notifying user",{notification:t}),rn.default.notify({title:"Gadget",contentImage:tt("favicon-128@4x.png"),icon:tt("favicon-128@4x.png"),sound:!0,timeout:!1,...t},r=>{r&&e.log.warn("error notifying user",{notification:t})})};var xl={...tr,"--prefer":er,"--file-push-delay":{type:Number,default:(0,ae.default)("100ms")},"--file-watch-debounce":{type:Number,default:(0,ae.default)("300ms")},"--file-watch-poll-interval":{type:Number,default:(0,ae.default)("3s")},"--file-watch-poll-timeout":{type:Number,default:(0,ae.default)("20s")},"--file-watch-rename-timeout":{type:Number,default:(0,ae.default)("1.25s")}},Il=e=>W`
4
4
  Clones your Gadget environment's files to your local machine and keeps it in sync, in order to
@@ -52,4 +52,4 @@ ${r.sprint({indent:4})}
52
52
 
53
53
  Waiting for file changes${Jt.ellipsis} {gray Press Ctrl+C to stop}
54
54
  `})};export{xl as args,Dl as run,Il as usage};
55
- //# sourceMappingURL=dev-5UFCKF4X.js.map
55
+ //# sourceMappingURL=dev-OT7PEKUN.js.map
@@ -1,4 +1,4 @@
1
- import{b as l}from"./chunk-5ONACLO6.js";import{f as c,g as u}from"./chunk-NGTOMLDS.js";import"./chunk-D2K5XPNJ.js";import"./chunk-3Q3GPB6Z.js";import{l as g}from"./chunk-M2OJZLL7.js";import"./chunk-457GEPUN.js";import"./chunk-FLXIAZND.js";import"./chunk-VICN6LTV.js";import{$ as o,M as p,Z as a,_ as m}from"./chunk-CQLM5U6T.js";import"./chunk-F3EZ4KS3.js";import"./chunk-GOBNB5VT.js";import{g as n}from"./chunk-5WC5D4WL.js";n();var U=()=>a`
1
+ import{b as l}from"./chunk-THZRTDWW.js";import{f as c,g as u}from"./chunk-AB4I3BMD.js";import"./chunk-D2K5XPNJ.js";import"./chunk-3Q3GPB6Z.js";import{l as g}from"./chunk-6FBP46EB.js";import"./chunk-EFU2JNKY.js";import"./chunk-KMCOZJPU.js";import"./chunk-OLKWG2EP.js";import{$ as o,M as p,Z as a,_ as m}from"./chunk-KGOVR5SK.js";import"./chunk-F3EZ4KS3.js";import"./chunk-GOBNB5VT.js";import{g as n}from"./chunk-5WC5D4WL.js";n();var U=()=>a`
2
2
  List the apps available to the currently logged-in user.
3
3
 
4
4
  {bold Usage}
@@ -8,4 +8,4 @@ import{b as l}from"./chunk-5ONACLO6.js";import{f as c,g as u}from"./chunk-NGTOML
8
8
 
9
9
  Visit https://gadget.new to create one!
10
10
  `;return}let f=u(e);if(p.isInteractive)f.forEach((t,r)=>{o(a`{grey ${r}}`),l({json:t,headers:["Name","Domain"],rows:t.map(i=>[i.slug,i.primaryDomain])}),o("")});else{let t="";for(let r of e)t+=m`${r.slug}\t${r.primaryDomain}`;o({json:e,content:t})}};export{b as run,U as usage};
11
- //# sourceMappingURL=list-WGRXHV2B.js.map
11
+ //# sourceMappingURL=list-CC5PICEF.js.map